Skip to content

Commit

Permalink
Merge pull request #352 from ffoodd/webextension-fixtextspacing
Browse files Browse the repository at this point in the history
Webextension fix all features
  • Loading branch information
ffoodd committed May 9, 2019
2 parents 785e504 + 22bfd7f commit 41c02c0
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 45 deletions.
Binary file modified a11ycss-webextension-chrome.zip
Binary file not shown.
Binary file modified a11ycss-webextension-firefox.zip
Binary file not shown.
28 changes: 14 additions & 14 deletions webextension/scripts/a11ycss.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ let button = document.getElementById("a11ycssBtnApply");
function storeA11ycss(strLevel) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
let a11ycssLevel = [];
// Get a11y.css stored levels
let getLevel = browser.storage.local.get("a11ycssLevel");
getLevel.then(
// when we got something
(item) => {
let a11ycssLevel = [];
if (item && item.a11ycssLevel) {
let a11ycssLevel = item.a11ycssLevel;
a11ycssLevel = item.a11ycssLevel;
}
// Add or replace current tab's value
a11ycssLevel[tabs[0].id] = {"level": strLevel};
// And set it back to the storage
let setting = browser.storage.local.set({ a11ycssLevel });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
a11ycssLevel[tabs[0].id] = {"level": strLevel};
// And set it back to the storage
let setting = browser.storage.local.set({ a11ycssLevel });
setting.then(null, onError); // just in case
});
}

Expand Down Expand Up @@ -69,22 +69,22 @@ function removeA11ycss() {
function storeStatus(strStatus) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
let a11ycssStatus = [];
// Get a11y.css stored levels
let getStatus = browser.storage.local.get("a11ycssStatus");
getStatus.then(
// when we got something
(item) => {
let a11ycssStatus = [];
if (item && item.a11ycssStatus) {
let a11ycssStatus = item.a11ycssStatus;
a11ycssStatus = item.a11ycssStatus;
}
// Add or replace current tab's value
a11ycssStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ a11ycssStatus });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
a11ycssStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ a11ycssStatus });
setting.then(null, onError); // just in case
});
}

Expand Down
14 changes: 7 additions & 7 deletions webextension/scripts/checkalts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ let btnCheckalts = document.getElementById('btnCheckalts');
function storeCheckAltsStatus(strStatus) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
let checkAltsStatus = [];
// Get a11y.css stored status
let getStatus = browser.storage.local.get("checkAltsStatus");
getStatus.then(
// when we got something
(item) => {
let checkAltsStatus = [];
if (item && item.checkAltsStatus) {
let checkAltsStatus = item.checkAltsStatus;
checkAltsStatus = item.checkAltsStatus;
}
// Add or replace current tab's value
checkAltsStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ checkAltsStatus });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
checkAltsStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ checkAltsStatus });
setting.then(null, onError); // just in case
});
}

Expand Down
14 changes: 7 additions & 7 deletions webextension/scripts/outline.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ function removeOutline() {
function storeOutlineStatus(strStatus) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
let outlineStatus = [];
// Get a11y.css stored status
let getStatus = browser.storage.local.get("outlineStatus");
getStatus.then(
// when we got something
(item) => {
let outlineStatus = [];
if (item && item.outlineStatus) {
let outlineStatus = item.outlineStatus;
outlineStatus = item.outlineStatus;
}
// Add or replace current tab's value
outlineStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ outlineStatus });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
outlineStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ outlineStatus });
setting.then(null, onError); // just in case
});
}

Expand Down
14 changes: 7 additions & 7 deletions webextension/scripts/showlangattribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ let btnShowLangAttribute = document.getElementById('btnShowLangAttribute');
function storeShowLangStatus(strStatus) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
let showLangStatus = [];
// Get a11y.css stored status
let getStatus = browser.storage.local.get("showLangStatus");
getStatus.then(
// when we got something
(item) => {
let showLangStatus = [];
if (item && item.showLangStatus) {
let showLangStatus = item.showLangStatus;
showLangStatus = item.showLangStatus;
}
// Add or replace current tab's value
showLangStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ showLangStatus });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
showLangStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ showLangStatus });
setting.then(null, onError); // just in case
});
}

Expand Down
18 changes: 8 additions & 10 deletions webextension/scripts/textspacing.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
let btnTextspacing = document.getElementById('btnTextspacing');
let textSpacingStatus = [];

function storeTextSpacingStatus(strStatus) {
// Get current tab ID
browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
// Get a11y.css stored status
let getStatus = browser.storage.local.get("textSpacingStatus");
getStatus.then(
browser.storage.local.get("textSpacingStatus").then(
// when we got something
(item) => {
let textSpacingStatus = [];
if (item && item.textSpacingStatus) {
let textSpacingStatus = item.textSpacingStatus;
textSpacingStatus = item.textSpacingStatus;
}
// Add or replace current tab's value
textSpacingStatus[tabs[0].id] = {"status": strStatus};
// And set it back to the storage
let setting = browser.storage.local.set({ textSpacingStatus });
setting.then(null, onError); // just in case
}
);
// Add or replace current tab's value
textSpacingStatus[tabs[0].id] = {"status": strStatus};
console.log(textSpacingStatus);
// And set it back to the storage
let setting = browser.storage.local.set({ textSpacingStatus });
setting.then(null, onError); // just in case
});
}

Expand Down

0 comments on commit 41c02c0

Please sign in to comment.