This commit is contained in:
Alexey Skobkin 2014-11-26 23:07:12 +04:00
parent 699fd726c4
commit b607c04045
2 changed files with 25 additions and 19 deletions

View file

@ -103,26 +103,32 @@ function pp_restore_options() {
} }
}); });
// Loading options // Loading options
chrome.storage.sync.get('options', function(options) { chrome.storage.sync.get('options', function(options) {
// Setting options in DOM
$.each(options.options, function(key, data) { try {
switch (data.type) { // Setting options in DOM
case 'boolean': $.each(options.options, function(key, data) {
if (data.value) { switch (data.type) {
$('#' + key.replace(/_/g, '-')).prop('checked', true); case 'boolean':
if (data.value) {
$('#' + key.replace(/_/g, '-')).prop('checked', true);
}
break;
case 'enum':
$('.option-node .option-enum[name="' + key.replace(/_/g, '-') + '"][value="' + data.value + '"]').prop('checked', true);
break;
default:
console.warn('Invalid option "%s" type: %O', key, data);
break;
} }
break; });
} catch (ex) {
case 'enum': console.error('Error while loading extension options: %O', ex);
$('.option-node .option-enum[name="' + key.replace(/_/g, '-') + '"][value="' + data.value + '"]').prop('checked', true);
break;
default:
console.warn('Invalid option "%s" type: %O', key, data);
break;
} }
});
// Showing version // Showing version
$('#pp-version').html('Point+ ' + getVersion() $('#pp-version').html('Point+ ' + getVersion()

View file

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Point+", "name": "Point+",
"version": "1.17.2", "version": "1.17.3",
"default_locale": "ru", "default_locale": "ru",
"author": "__MSG_ext_author__", "author": "__MSG_ext_author__",
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",