Verified Commit 7dd1f6f4 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Refactor existing codebase

parent fce27eb9
......@@ -98,10 +98,10 @@ main._showReleaseNotes = function (details) {
chrome.runtime.onInstalled.addListener(main._showReleaseNotes);
main._initializeSettings();
wrappers.setBadgeBackgroundColor({
wrappers.browserAction.setBadgeBackgroundColor({
'color': [74, 130, 108, 255]
});
wrappers.setBadgeTextColor({
wrappers.browserAction.setBadgeTextColor({
'color': [255, 255, 255, 255]
});
......@@ -42,7 +42,7 @@ stateManager.registerInjection = function (tabIdentifier, injection) {
if (stateManager.showIconBadge === true) {
wrappers.setBadgeText({
wrappers.browserAction.setBadgeText({
'tabId': tabIdentifier,
'text': injectionCount.toString()
});
......@@ -233,7 +233,7 @@ stateManager._handleStorageChanged = function (changes) {
stateManager._clearBadgeText = function (tabIdentifier) {
wrappers.setBadgeText({
wrappers.browserAction.setBadgeText({
'tabId': tabIdentifier,
'text': ''
});
......@@ -260,7 +260,7 @@ stateManager._domainIsWhitelisted = function (domain) {
stateManager._setIconDefault = function (tabIdentifier) {
wrappers.setIcon({
wrappers.browserAction.setIcon({
'path': stateManager.defaultIconPath,
'tabId': tabIdentifier
});
......@@ -268,7 +268,7 @@ stateManager._setIconDefault = function (tabIdentifier) {
stateManager._setIconDisabled = function (tabIdentifier) {
wrappers.setIcon({
wrappers.browserAction.setIcon({
'path': stateManager.disabledIconPath,
'tabId': tabIdentifier
});
......
......@@ -23,30 +23,33 @@ var wrappers = {};
* Public Methods
*/
wrappers.setBadgeBackgroundColor = function (details) {
wrappers.browserAction = {
if (chrome.browserAction.setBadgeBackgroundColor !== undefined) {
chrome.browserAction.setBadgeBackgroundColor(details);
}
};
setBadgeBackgroundColor (details) {
wrappers.setBadgeText = function (details) {
if (chrome.browserAction.setBadgeBackgroundColor !== undefined) {
chrome.browserAction.setBadgeBackgroundColor(details);
}
},
if (chrome.browserAction.setBadgeText !== undefined) {
chrome.browserAction.setBadgeText(details);
}
};
setBadgeText (details) {
wrappers.setBadgeTextColor = function (details) {
if (chrome.browserAction.setBadgeText !== undefined) {
chrome.browserAction.setBadgeText(details);
}
},
if (chrome.browserAction.setBadgeTextColor !== undefined) {
chrome.browserAction.setBadgeTextColor(details);
}
};
setBadgeTextColor (details) {
if (chrome.browserAction.setBadgeTextColor !== undefined) {
chrome.browserAction.setBadgeTextColor(details);
}
},
wrappers.setIcon = function (details) {
setIcon (details) {
if (chrome.browserAction.setIcon !== undefined) {
chrome.browserAction.setIcon(details);
if (chrome.browserAction.setIcon !== undefined) {
chrome.browserAction.setIcon(details);
}
}
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment