From bc29a53984b4d8f38ea89c247ddbcf1bb1372aed Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sat, 15 Nov 2014 07:59:56 +0400 Subject: [PATCH] - Dynamic options loading on the options page - Fixed fluid layout option --- chrome_point_plus/js/options.js | 120 +++++--------------------------- chrome_point_plus/manifest.json | 2 +- chrome_point_plus/options.html | 2 +- 3 files changed, 21 insertions(+), 103 deletions(-) diff --git a/chrome_point_plus/js/options.js b/chrome_point_plus/js/options.js index 21a2def..38874e2 100644 --- a/chrome_point_plus/js/options.js +++ b/chrome_point_plus/js/options.js @@ -47,7 +47,7 @@ function pp_save_options() { ppOptions.option_fancybox_images = document.getElementById('option-fancybox-images').checked; ppOptions.option_fancybox_videos = document.getElementById('option-fancybox-videos').checked; ppOptions.option_fancybox_posts = document.getElementById('option-fancybox-posts').checked; - ppOptions.option_fluid_layout = document.getElementById('option-layout-fluid').checked; + ppOptions.option_fluid_layout = document.getElementById('option-fluid-layout').checked; ppOptions.option_images_load_original = document.getElementById('option-images-load-original').checked; ppOptions.option_embedding = document.getElementById('option-embedding').checked; ppOptions.option_images_load_booru = document.getElementById('option-images-load-booru').checked; @@ -82,106 +82,24 @@ function pp_save_options() { function pp_restore_options() { // Loading options chrome.storage.sync.get(ppOptions, function(options) { - // CTRL+Enter - if (options.option_ctrl_enter == true) { - document.getElementById('option-ctrl-enter').checked = true; - } - // Fancybox - // - if (options.option_fancybox == true) { - document.getElementById('option-fancybox').checked = true; - } - // Images - if (options.option_fancybox_images == true) { - document.getElementById('option-fancybox-images').checked = true; - } - // Videos - if (options.option_fancybox_videos == true) { - document.getElementById('option-fancybox-videos').checked = true; - } - // Posts - if (options.option_fancybox_posts == true) { - document.getElementById('option-fancybox-posts').checked = true; - } - // Fluid layout - if (options.option_fluid_layout == true) { - document.getElementById('option-layout-fluid').checked = true; - } - // Load original images - if (options.option_images_load_original == true) { - document.getElementById('option-images-load-original').checked = true; - } - // Embedding - if (options.option_embedding == true) { - document.getElementById('option-embedding').checked = true; - } - // Load images from Gelbooru, Danbooru, etc - if (options.option_images_load_booru == true) { - document.getElementById('option-images-load-booru').checked = true; - } - // Wrap WEBM videos into the