-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added alt text display added alternate file size divisions added tool tips to explain each setting fixed examples alignment
- Loading branch information
Showing
6 changed files
with
289 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
function toggleExtension() { | ||
//get current enabled state | ||
browser.storage.local.get('enabled', toggleState); | ||
chrome.storage.local.get('enabled', toggleState); | ||
} | ||
function toggleState(result) { | ||
var state = (typeof result.enabled == 'undefined')? false : !result.enabled; | ||
function toggleState(storage) { | ||
//disable state on first toggle since default is enabled | ||
const state = (typeof storage.enabled === 'undefined')? false : !storage.enabled; | ||
|
||
browser.storage.local.set({ | ||
chrome.storage.local.set({ | ||
enabled: state | ||
}); | ||
updateIcon(state); | ||
//send message to content script to update its state | ||
browser.tabs.query({currentWindow: true, active: true}, function(tabs) { | ||
browser.tabs.sendMessage(tabs[0].id, {imgDataState: "update"}); | ||
}); | ||
} | ||
|
||
function updateIcon(state) { | ||
browser.browserAction.setIcon({ path: state? 'icons/thumb-48.png' : 'icons/disable-48.png' }); | ||
chrome.browserAction.setIcon({ path: state? 'icons/thumb-48.png' : 'icons/disable-48.png' }); | ||
chrome.browserAction.setTitle({ title: state? 'Image Data (Enabled)' : 'Image Data (Disabled)' }); | ||
} | ||
function initIcon(result) { | ||
updateIcon((typeof result.enabled == 'undefined')? true : result.enabled); | ||
function initIcon(storage) { | ||
updateIcon((typeof storage.enabled === 'undefined')? true : storage.enabled); | ||
} | ||
//toggle extension when toolbar button is clicked | ||
browser.browserAction.onClicked.addListener(toggleExtension); | ||
chrome.browserAction.onClicked.addListener(toggleExtension); | ||
//on browser startup get prior state | ||
browser.storage.local.get('enabled', initIcon); | ||
chrome.storage.local.get('enabled', initIcon); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
input[type="number"] { | ||
width: 5em; | ||
} | ||
|
||
.preset { | ||
display: inline-block; | ||
vertical-align: top; | ||
cursor: pointer; | ||
/*margin: 0 0.05em;*/ | ||
} | ||
#boxContainer { | ||
padding-bottom: .3em; | ||
} | ||
#boxLeft { | ||
float: left; | ||
} | ||
#boxRight { | ||
float: right; | ||
} | ||
#settCurOffset { | ||
display: none; | ||
} | ||
#settStyle { | ||
width: 100%; | ||
} | ||
#settScale { | ||
margin-bottom: 1.2em; | ||
} |
Oops, something went wrong.