Skip to content
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Original creators:
- [Andy Wang](https://github.com/ownzandy)
- [Biggie Emmanuel](https://github.com/bigolu)

Contributors:
- [Scott Reed](https://github.com/sreed101)

Continued Support:
- [Jun Woo Shin](https://github.com/jwoos)

Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Tabbo",
"description": "Tab Management Hotkeys",
"short_name": "Tabbo – Tab Management Hotkeys",
"version": "0.9.5",
"version": "0.9.6",
"icons": {
"16": "images/tabbo16.png",
"48": "images/tabbo48.png",
Expand All @@ -26,7 +26,8 @@
"tabs",
"https://ajax.googleapis.com/",
"chrome://favicon/",
"<all_urls>"
"<all_urls>",
"storage"
],
"commands": {
"pop_off": {
Expand Down
1 change: 0 additions & 1 deletion popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h4>Tabbo</h4>
<hr>
<div class="cta" id="instructions">instructions</div>
<div class="cta" id="keybinds">set keybinds</div>
<div class="cta bonus" id="bonus">bonus</div>
<script src="scripts/popup.js"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ Promise.all([
openWindows.appendChild(h1);
}

chrome.storage.local.get(['window_default_id', 'window_default_serial'], results => {
if (results['window_default_id'] && results['window_default_serial']
&& JSON.stringify(windows.map(window => window.id)) === results['window_default_serial']) {
const sendWindow = windows.find(window => window.id === results['window_default_id']);
if (sendWindow) {
selectWindow(sendWindow, toSendId);
}
}
});

windows.forEach((w) => {
if (w.id === current.id) {
return;
Expand All @@ -40,12 +50,21 @@ Promise.all([
<div class="screen-index">${count}</div>
<div class="tab-count">${w.tabs.length + (w.tabs.length === 1 ? " tab" : " tabs")}
</div>`;

const defaultDiv = document.createElement('div');
defaultDiv.className = 'default';
defaultDiv.innerHTML = `Default <input type="checkbox" name="default" value="` + count + `">`;

div.addEventListener('click', () => {
selectWindow(w, toSendId);
});

defaultDiv.addEventListener('click', () => {
chrome.storage.local.set({'window_default_serial': JSON.stringify(windows.map(window => window.id)), 'window_default_id': w.id});
});

openWindows.appendChild(div);
div.appendChild(defaultDiv);

count++;
});
Expand Down
22 changes: 1 addition & 21 deletions scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,4 @@ document.querySelector('#send').addEventListener('click', () => {

document.querySelector('#send').addEventListener('click', () => {
port.postMessage('send');
});

let bonusClicked = 0;
const bonusElem = document.querySelector('#bonus');

document.querySelector('#bonus').addEventListener('click', () => {
bonusClicked += 1;

if (bonusClicked === 1) {
bonusElem.innerHTML('stop it');
} else if (bonusClicked === 2) {
bonusElem.innerHTML('I\'m warning you');
} else if (bonusClicked === 3) {
bonusElem.innerHTML('last warning...');
}

if (bonusClicked > 3) {
bonusElem.innerHTML('explode!!');
port.postMessage('explode');
}
});
});
11 changes: 0 additions & 11 deletions styles/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,3 @@ h4 {
.cta:hover {
background-color: #66150F;
}

.bonus {
background-color: transparent;
color: #B02519;
}

.bonus:hover {
background-color: transparent;
color: #66150F;
}

5 changes: 5 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ body {
box-shadow: 0px 2px 12px 1px rgba(0,0,0,0.75);
}

.default {
position: relative;
top: 200px;
}

.screen-index {
position: absolute;
width: 100%;
Expand Down