Skip to content

Commit 6ab0657

Browse files
committed
Merge pull request #26 from peterdotjs/dev
Dev
2 parents 16cf76f + f698779 commit 6ab0657

File tree

13 files changed

+232
-25
lines changed

13 files changed

+232
-25
lines changed

css/index.css

Lines changed: 116 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/style.less

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ button.disabled {
294294
background-size: 27px 27px;
295295
width: 27px;
296296
height: 27px;
297-
background-image: url('https://www.google.com/favicon.ico');
297+
background-image: url('../images/icons/defaultFavIcon.png');
298298
}
299299
}
300300

@@ -631,7 +631,7 @@ button.disabled {
631631

632632
}
633633

634-
#update-modal {
634+
.info-modal.modal-box {
635635
display: none;
636636
.modal-body {
637637
width: 450px;
@@ -684,6 +684,7 @@ button.disabled {
684684
}
685685

686686
a {
687+
color: #0181eb;
687688
&:visited {
688689
color: #0181eb;
689690
}
@@ -706,6 +707,12 @@ button.disabled {
706707
}
707708
}
708709

710+
#promo-modal {
711+
.modal-body .header-title-wrap .icon-48 {
712+
background: url('../images/icons/promo/icon48.png');
713+
}
714+
}
715+
709716
body.update {
710717
#update-modal {
711718
display: block;
@@ -715,6 +722,15 @@ body.update {
715722
}
716723
}
717724

725+
body.promo {
726+
#promo-modal {
727+
display: block;
728+
}
729+
.main-view {
730+
min-height: 500px;
731+
}
732+
}
733+
718734
body {
719735
&.align-right {
720736
.tab-layer {

images/icons/defaultFavIcon.png

1.17 KB
Loading

images/icons/promo/icon48.png

1.78 KB
Loading

index.html

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</div>
8585
</div>
8686
<div class = "input-container-footer modal-footer">
87-
<button class="button primary" id="input-save">Save</button>
87+
<button class="button primary disabled" id="input-save">Save</button>
8888
<button class="button" id="input-cancel">Cancel</button>
8989
</div>
9090
</div>
@@ -101,7 +101,7 @@
101101
</div>
102102
</div>
103103

104-
<div id="update-modal" class="modal-box">
104+
<div id="update-modal" class="modal-box info-modal">
105105
<div class="modal-body">
106106
<div class="header-title-wrap">
107107
<div class="icon-48"></div>
@@ -128,13 +128,45 @@
128128
</li>
129129
</ul>
130130
<div class="update-list-footer bold">
131-
You can checkout the <a target="_blank" href="http://youtu.be/GFHl98nAV04">video demo</a> for a more detailed description.
131+
You can checkout the <a target="_blank" href="https://www.youtube.com/watch?v=GFHl98nAV04" title="https://www.youtube.com/watch?v=GFHl98nAV04">video demo</a> for a more detailed description.
132132
</div>
133-
<div class="additional-message bold">If you like the extension and find it useful please show your support by rating it in the <a target="_blank" href="https://chrome.google.com/webstore/detail/tab-resize-split-screen-l/bkpenclhmiealbebdopglffmfdiilejc/reviews">web store</a>. Thanks! -Peter</div>
133+
<div class="additional-message bold">If you like the extension and find it useful please show your support by rating it in the <a target="_blank" href="https://chrome.google.com/webstore/detail/tab-resize-split-screen-l/bkpenclhmiealbebdopglffmfdiilejc/reviews" title="https://chrome.google.com/webstore/detail/tab-resize-split-screen-l/bkpenclhmiealbebdopglffmfdiilejc/reviews">web store</a>. Thanks! -Peter</div>
134134
</div>
135135
<div class="modal-footer">
136136
<button class="button primary" id="update-apply">Lets go!</button>
137137
</div>
138138
</div>
139+
140+
<div id="promo-modal" class="modal-box info-modal">
141+
<div class="modal-body">
142+
<div class="header-title-wrap">
143+
<div class="icon-48"></div>
144+
<div class="header-title">
145+
Quick Find for Google Chrome&#0153;
146+
</div>
147+
</div>
148+
<div class="update-list-header">Hey, I just finished building another Chrome extension and thought you might want to check it out.</div>
149+
<div class="update-list-header">Features:</div>
150+
<ul class="update-list">
151+
<li class="update-entry">
152+
<strong>Port of Firefox Quick Find features + awesome new ones.</strong>
153+
</li>
154+
<li class="update-entry">
155+
Search results in one location. Navigate to links in just a few keystrokes.
156+
</li>
157+
<li class="update-entry">
158+
Case match, link search, highlight all toggle, highlight and then search.
159+
</li>
160+
</ul>
161+
<div class="update-list-footer bold">
162+
You can checkout the <a target="_blank" href="https://www.youtube.com/watch?v=x2PEyTyJ6iM" title="https://www.youtube.com/watch?v=x2PEyTyJ6iM">video demo</a> or <a target="_blank" href="https://chrome.google.com/webstore/detail/quick-find-for-google-chr/dejblhmebonldngnmeidliaifgiagcjj" title="https://chrome.google.com/webstore/detail/quick-find-for-google-chr/dejblhmebonldngnmeidliaifgiagcjj">Chrome store page</a> for a more detailed description.
163+
</div>
164+
<div class="additional-message bold">Hope you find it as useful as Tab Resize! Thanks! -Peter</div>
165+
</div>
166+
<div class="modal-footer">
167+
<button class="button primary" id="promo-apply">Close</button>
168+
</div>
169+
</div>
170+
139171
</body>
140172
</html>

js/background.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ var util = {
9494

9595
// base case we update the current window
9696
if(x === 0 && y === 0){
97-
window.chrome.windows.update(_tabsArray[index].windowId,{ left: leftValue,
98-
top: rightValue,
99-
width: resize.width,
100-
height: resize.height,
101-
state: "normal"
102-
});
97+
if(resize.numRows === 1 && resize.numCols === 1 && !resize.isMac){
98+
window.chrome.windows.update(_tabsArray[index].windowId,{ state: "maximized" });
99+
} else {
100+
window.chrome.windows.update(_tabsArray[index].windowId,{ left: leftValue,
101+
top: rightValue,
102+
width: resize.width,
103+
height: resize.height,
104+
state: "normal"
105+
});
106+
}
103107

104108
if(singleTab){
105109
return;
@@ -138,7 +142,9 @@ var util = {
138142
*/
139143
setUndoStorage: function(resize, tabIndex, windowId, tabsArray, cb) {
140144
window.chrome.windows.get(windowId,{},function(_windowCb){
141-
var updateInfo = {left: _windowCb.left,
145+
var updateInfo = (_windowCb.state === 'maximized' && !resize.isMac) ? {focused: true,
146+
state: "maximized",
147+
incognito: _windowCb.incognito} : {left: _windowCb.left,
142148
top: _windowCb.top,
143149
width: _windowCb.width,
144150
height: _windowCb.height,

js/custom_view.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
clearCustomValues: function(){
3434
$('#numRows').val('');
3535
$('#numCols').val('');
36+
$('#input-save').addClass('disabled');
3637
},
3738

3839
/**
@@ -45,7 +46,7 @@
4546
this.clearCustomValues();
4647

4748
if(!Number(customRows) || !Number(customCols) || Number(customRows) < 1 || Number(customCols) < 1){
48-
window.alert('Please enter valid input values.');
49+
//window.alert('Please enter valid input values.');
4950
} else {
5051
var layoutType = customRows + 'x' + customCols;
5152
resize.layout.addLayout(layoutType);

js/layout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@
141141
function processSelectedTab(curTab,index,tabs){
142142
for(var i=1;index<tabs.length && i<5;index++,i++){
143143
curTab = tabs[index];
144-
if(curTab.favIconUrl){
145-
var tabLayers = $('.resize-container').find('.tab-layer-' + i);
146-
tabLayers.addClass('valid-tab');
147-
for(var j=0;j<tabLayers.length; j++){
144+
var tabLayers = $('.resize-container').find('.tab-layer-' + i);
145+
tabLayers.addClass('valid-tab');
146+
for(var j=0;j<tabLayers.length; j++){
147+
if(curTab.favIconUrl && curTab.favIconUrl.indexOf('chrome://') !== 0){
148148
tabLayers.eq(j).find('.fav-icon').css('background-image','url("' + curTab.favIconUrl + '")');
149-
tabLayers.eq(j).attr('title',curTab.title);
150149
}
150+
tabLayers.eq(j).attr('title',curTab.title);
151151
}
152152
}
153153
}

js/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@
9595
}
9696

9797
util.drawTable(resize.canvasWidth, resize.canvasHeight, numRows, numCols, context);
98+
$('#input-save').removeClass('disabled');
99+
} else {
100+
var $this = $(this),
101+
val = Number($this.attr('value'));
102+
103+
if(val === 0 || isNaN(val)){
104+
$this.attr('value','');
105+
$('#input-save').addClass('disabled');
106+
}
98107
}
99108
}).on('change','#checkbox-single-tab', function(){
100109
var checked = $(this).attr('checked');
@@ -121,6 +130,8 @@
121130
}
122131
}).on('click','#update-apply',function(){
123132
options.hideUpdateModal();
133+
}).on('click','#promo-apply',function(){
134+
options.hidePromoModal();
124135
}).on('click','.signature a',function(){
125136
if($(this).hasClass('rate-it')){
126137
sendTracking('info-links','rate-it');

js/main_view.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
$body.addClass('update');
9292
resize.options.showUpdateModal();
9393
}
94+
95+
if(localStorage.getItem('update-seen') && updateCount === resize.badgeLimit && !localStorage.getItem('promo-seen')){
96+
var $body = $('body');
97+
$body.addClass('promo');
98+
resize.options.showPromoModal();
99+
}
94100
},
95101

96102
/**

0 commit comments

Comments
 (0)