From 27bca63a006ee1c3d1c77f95e8996dbdb95fa244 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Mon, 21 Apr 2014 23:40:08 +0400 Subject: [PATCH] - Font size adjust (#13) - Options page bugfix --- chrome_point_plus/js/options.js | 20 ++++++++++++++++++-- chrome_point_plus/js/point-plus.js | 4 ++++ chrome_point_plus/manifest.json | 5 +++-- chrome_point_plus/options.html | 16 +++++++++++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/chrome_point_plus/js/options.js b/chrome_point_plus/js/options.js index 6dd6a30..8926346 100644 --- a/chrome_point_plus/js/options.js +++ b/chrome_point_plus/js/options.js @@ -16,7 +16,9 @@ var ppOptions = [ // Comments 'option_ws_comments', 'option_ws_comments_color_fadeout', 'option_ws_comments_notifications', // Feeds - 'option_ws_feeds', 'option_ws_feeds_subscriptions', 'option_ws_feeds_blogs' + 'option_ws_feeds', 'option_ws_feeds_subscriptions', 'option_ws_feeds_blogs', + // Font size + 'option_enlarge_font', 'option_enlarge_font_size' ]; // Saves options to localStorage. @@ -55,6 +57,10 @@ function pp_save_options() { var option_ws_feeds_subscriptions = document.getElementById('option-ws-feeds-subscriptions'); // Blogs var option_ws_feeds_blogs = document.getElementById('option-ws-feeds-blogs'); + // Font size + var option_enlarge_font = document.getElementById('option-enlarge-font'); + // Size ratio + var option_enlarge_font_size = document.querySelector('input[name="pp-font-size"]:checked'); // Saving parameters chrome.storage.sync.set({ @@ -73,7 +79,9 @@ function pp_save_options() { 'option_ws_comments_notifications': option_ws_comments_notifications.checked, 'option_ws_feeds': option_ws_feeds.checked, 'option_ws_feeds_subscriptions': option_ws_feeds_subscriptions.checked, - 'option_ws_feeds_blogs': option_ws_feeds_blogs.checked + 'option_ws_feeds_blogs': option_ws_feeds_blogs.checked, + 'option_enlarge_font': option_enlarge_font.checked, + 'option_enlarge_font_size': option_enlarge_font_size.value }, function() { // Update status to let user know options were saved. var status = document.getElementById('status'); @@ -158,6 +166,14 @@ function pp_restore_options() { if (options.option_ws_feeds_blogs == true) { document.getElementById('option-ws-feeds-blogs').checked = true; } + // Font size + if (options.option_enlarge_font == true) { + document.getElementById('option-enlarge-font').checked = true; + } + // Size ratio + if (options.option_enlarge_font_size !== undefined) { + document.getElementById('option-enlarge-font-' + options.option_enlarge_font_size).checked = true; + } // Showing version document.getElementById('pp-version').innerHTML = 'Point+ ' + getVersion() + ' by @skobkin-ru'; diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index af75953..a118922 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -319,6 +319,10 @@ $(document).ready(function() { } ; }; + } + // Font size + if ((options.option_enlarge_font == true) && (options.option_enlarge_font_size !== undefined)) { + $('body').css('font-size', (options.option_enlarge_font_size / 100) + 'em'); } }); diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 0e1caec..cc3b29b 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.7", + "version": "1.8", "author": "Alexey Skobkin", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "description": "More features for point.im", @@ -52,6 +52,7 @@ "http://*.point.im/*", "https://*.point.im/*", "storage", - "notifications" + "notifications", + "tabs" ] } \ No newline at end of file diff --git a/chrome_point_plus/options.html b/chrome_point_plus/options.html index 3dbb86d..206d70f 100644 --- a/chrome_point_plus/options.html +++ b/chrome_point_plus/options.html @@ -35,7 +35,7 @@
-
@@ -61,11 +61,21 @@
-
-
+ +
+ + +
+ + + +