Skip to content
Merged

Dev #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 116 additions & 1 deletion css/index.css

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ button.disabled {
background-size: 27px 27px;
width: 27px;
height: 27px;
background-image: url('https://www.google.com/favicon.ico');
background-image: url('../images/icons/defaultFavIcon.png');
}
}

Expand Down Expand Up @@ -631,7 +631,7 @@ button.disabled {

}

#update-modal {
.info-modal.modal-box {
display: none;
.modal-body {
width: 450px;
Expand Down Expand Up @@ -684,6 +684,7 @@ button.disabled {
}

a {
color: #0181eb;
&:visited {
color: #0181eb;
}
Expand All @@ -706,6 +707,12 @@ button.disabled {
}
}

#promo-modal {
.modal-body .header-title-wrap .icon-48 {
background: url('../images/icons/promo/icon48.png');
}
}

body.update {
#update-modal {
display: block;
Expand All @@ -715,6 +722,15 @@ body.update {
}
}

body.promo {
#promo-modal {
display: block;
}
.main-view {
min-height: 500px;
}
}

body {
&.align-right {
.tab-layer {
Expand Down
Binary file added images/icons/defaultFavIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/promo/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 36 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</div>
</div>
<div class = "input-container-footer modal-footer">
<button class="button primary" id="input-save">Save</button>
<button class="button primary disabled" id="input-save">Save</button>
<button class="button" id="input-cancel">Cancel</button>
</div>
</div>
Expand All @@ -101,7 +101,7 @@
</div>
</div>

<div id="update-modal" class="modal-box">
<div id="update-modal" class="modal-box info-modal">
<div class="modal-body">
<div class="header-title-wrap">
<div class="icon-48"></div>
Expand All @@ -128,13 +128,45 @@
</li>
</ul>
<div class="update-list-footer bold">
You can checkout the <a target="_blank" href="http://youtu.be/GFHl98nAV04">video demo</a> for a more detailed description.
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.
</div>
<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>
<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>
</div>
<div class="modal-footer">
<button class="button primary" id="update-apply">Lets go!</button>
</div>
</div>

<div id="promo-modal" class="modal-box info-modal">
<div class="modal-body">
<div class="header-title-wrap">
<div class="icon-48"></div>
<div class="header-title">
Quick Find for Google Chrome&#0153;
</div>
</div>
<div class="update-list-header">Hey, I just finished building another Chrome extension and thought you might want to check it out.</div>
<div class="update-list-header">Features:</div>
<ul class="update-list">
<li class="update-entry">
<strong>Port of Firefox Quick Find features + awesome new ones.</strong>
</li>
<li class="update-entry">
Search results in one location. Navigate to links in just a few keystrokes.
</li>
<li class="update-entry">
Case match, link search, highlight all toggle, highlight and then search.
</li>
</ul>
<div class="update-list-footer bold">
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.
</div>
<div class="additional-message bold">Hope you find it as useful as Tab Resize! Thanks! -Peter</div>
</div>
<div class="modal-footer">
<button class="button primary" id="promo-apply">Close</button>
</div>
</div>

</body>
</html>
20 changes: 13 additions & 7 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ var util = {

// base case we update the current window
if(x === 0 && y === 0){
window.chrome.windows.update(_tabsArray[index].windowId,{ left: leftValue,
top: rightValue,
width: resize.width,
height: resize.height,
state: "normal"
});
if(resize.numRows === 1 && resize.numCols === 1 && !resize.isMac){
window.chrome.windows.update(_tabsArray[index].windowId,{ state: "maximized" });
} else {
window.chrome.windows.update(_tabsArray[index].windowId,{ left: leftValue,
top: rightValue,
width: resize.width,
height: resize.height,
state: "normal"
});
}

if(singleTab){
return;
Expand Down Expand Up @@ -138,7 +142,9 @@ var util = {
*/
setUndoStorage: function(resize, tabIndex, windowId, tabsArray, cb) {
window.chrome.windows.get(windowId,{},function(_windowCb){
var updateInfo = {left: _windowCb.left,
var updateInfo = (_windowCb.state === 'maximized' && !resize.isMac) ? {focused: true,
state: "maximized",
incognito: _windowCb.incognito} : {left: _windowCb.left,
top: _windowCb.top,
width: _windowCb.width,
height: _windowCb.height,
Expand Down
3 changes: 2 additions & 1 deletion js/custom_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
clearCustomValues: function(){
$('#numRows').val('');
$('#numCols').val('');
$('#input-save').addClass('disabled');
},

/**
Expand All @@ -45,7 +46,7 @@
this.clearCustomValues();

if(!Number(customRows) || !Number(customCols) || Number(customRows) < 1 || Number(customCols) < 1){
window.alert('Please enter valid input values.');
//window.alert('Please enter valid input values.');
} else {
var layoutType = customRows + 'x' + customCols;
resize.layout.addLayout(layoutType);
Expand Down
10 changes: 5 additions & 5 deletions js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@
function processSelectedTab(curTab,index,tabs){
for(var i=1;index<tabs.length && i<5;index++,i++){
curTab = tabs[index];
if(curTab.favIconUrl){
var tabLayers = $('.resize-container').find('.tab-layer-' + i);
tabLayers.addClass('valid-tab');
for(var j=0;j<tabLayers.length; j++){
var tabLayers = $('.resize-container').find('.tab-layer-' + i);
tabLayers.addClass('valid-tab');
for(var j=0;j<tabLayers.length; j++){
if(curTab.favIconUrl && curTab.favIconUrl.indexOf('chrome://') !== 0){
tabLayers.eq(j).find('.fav-icon').css('background-image','url("' + curTab.favIconUrl + '")');
tabLayers.eq(j).attr('title',curTab.title);
}
tabLayers.eq(j).attr('title',curTab.title);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@
}

util.drawTable(resize.canvasWidth, resize.canvasHeight, numRows, numCols, context);
$('#input-save').removeClass('disabled');
} else {
var $this = $(this),
val = Number($this.attr('value'));

if(val === 0 || isNaN(val)){
$this.attr('value','');
$('#input-save').addClass('disabled');
}
}
}).on('change','#checkbox-single-tab', function(){
var checked = $(this).attr('checked');
Expand All @@ -121,6 +130,8 @@
}
}).on('click','#update-apply',function(){
options.hideUpdateModal();
}).on('click','#promo-apply',function(){
options.hidePromoModal();
}).on('click','.signature a',function(){
if($(this).hasClass('rate-it')){
sendTracking('info-links','rate-it');
Expand Down
6 changes: 6 additions & 0 deletions js/main_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
$body.addClass('update');
resize.options.showUpdateModal();
}

if(localStorage.getItem('update-seen') && updateCount === resize.badgeLimit && !localStorage.getItem('promo-seen')){
var $body = $('body');
$body.addClass('promo');
resize.options.showPromoModal();
}
},

/**
Expand Down
25 changes: 22 additions & 3 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
that.recombineTabs(1,window.id,newTabsArray.slice(1));
});
} else {
alert("Previous tabs were closed.");
if(!resize.isMac){
alert("Previous tabs were closed.");
}
that.disableUndoButton();
}
});
Expand Down Expand Up @@ -162,7 +164,7 @@
},

/**
* hides the default layout confirmation modal box
* hides the update modal box
*/
hideUpdateModal: function() {
$('body').removeClass('update');
Expand All @@ -171,11 +173,28 @@
},

/**
* shows the default layout confirmation modal box
* shows the update modal box
*/
showUpdateModal: function() {
$('#update-modal').trigger('show');
$('.main-view').addClass('inactive');
},

/**
* hides the promo modal box
*/
hidePromoModal: function() {
$('body').removeClass('promo');
$('.main-view').removeClass('inactive');
localStorage.setItem('promo-seen',true);
},

/**
* shows the promo modal box
*/
showPromoModal: function() {
$('#promo-modal').trigger('show');
$('.main-view').addClass('inactive');
}

};
Expand Down
3 changes: 2 additions & 1 deletion js/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
custom_view: {},
options: {},
util: {},
badgeLimit: 5
badgeLimit: 5,
isMac: navigator.platform.toUpperCase().indexOf('MAC')!==-1
};

window.resize = resize;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Tab Resize - split screen layouts",
"short_name": "Tab Resize",
"version": "2.0.8",
"version": "2.0.8.4",
"manifest_version": 2,
"description": "Split Screen made easy. Resize the CURRENT tab and tabs to the RIGHT into layouts on separate windows. w/ Multi Monitor Support.",
"browser_action": {
Expand Down