Skip to content

Commit

Permalink
Merge pull request #23 from gbaptista/gb-firefox-settings-pages-issues
Browse files Browse the repository at this point in the history
Firefox settings pages issues
  • Loading branch information
gbaptista authored Feb 3, 2018
2 parents fc4416f + f84add8 commit 6f71503
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion html/settings/stored-data/local.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="locale" data-locale="settingsStoredDataLocalTitle"></h2>

<br><br>

<span id="used"></span> | <button id="clear" class="locale" data-locale="settingsClearAllButtonText"></button>
<span id="used"></span><button id="clear" class="locale" data-locale="settingsClearAllButtonText"></button>

<div class="tabs"></div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion html/settings/stored-data/sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="locale" data-locale="settingsStoredDataSyncTitle"></h2>

<br><br>

<span id="used"></span> | <button id="clear" class="locale" data-locale="settingsClearAllButtonText"></button>
<span id="used"></span><button id="clear" class="locale" data-locale="settingsClearAllButtonText"></button>

<div class="options"></div>
</body>
Expand Down
10 changes: 7 additions & 3 deletions js/settings/stored-data/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ $(document).ready(function() {
$('#loading').fadeOut(200);
};

chrome.storage.local.getBytesInUse(null, function(bytesUsed) {
$('#used').html((bytesUsed/1000000).toFixed(2) + ' MB');
});
try {
chrome.storage.local.getBytesInUse(null, function(bytesUsed) {
$('#used').html((bytesUsed/1000000).toFixed(2) + ' MB | ');
});
} catch (_) {
$('#used').remove();
}

$('#clear').click(function() {
if(confirm(chrome.i18n.getMessage('settingsConfirmWindowText'))) {
Expand Down
10 changes: 7 additions & 3 deletions js/settings/stored-data/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ $(document).ready(function() {
$('#loading').fadeIn(200);
}

chrome.storage.sync.getBytesInUse(null, function(bytesUsed) {
$('#used').html((bytesUsed/1000000).toFixed(2) + ' MB');
});
try {
chrome.storage.sync.getBytesInUse(null, function(bytesUsed) {
$('#used').html((bytesUsed/1000000).toFixed(2) + ' MB | ');
});
} catch (_) {
$('#used').remove();
}

$('#clear').click(function() {
if(confirm(chrome.i18n.getMessage('settingsConfirmWindowText'))) {
Expand Down
5 changes: 5 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"default_popup": "html/popup/popup.html"
},
"options_page": "html/settings/advanced.html",
"options_ui": {
"page": "html/settings/advanced.html",
"open_in_tab": true,
"browser_style": false
},
"content_scripts": [
{
"matches": ["<all_urls>"],
Expand Down

0 comments on commit 6f71503

Please sign in to comment.