From 3c399fab5eff69fb3581957bd8bc5374eafc7e03 Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Sat, 15 Nov 2014 13:08:53 +0300 Subject: [PATCH] =?UTF-8?q?*=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B1=D0=B0=D0=B3=20=D1=81=20FancyBox,=20=D0=BD?= =?UTF-8?q?=D1=83=D0=B6=D0=BD=D0=BE=20=D0=B1=D1=8B=D0=BB=D0=BE=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D1=81=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20type:images,=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BC=D1=83=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=20=D0=BC=D0=B5=D0=B4=D0=B8=D0=B0=D1=85=D0=B5?= =?UTF-8?q?=D0=BB=D0=BF=D0=B5=D1=80=20=D0=BD=D0=B5=20=D0=BA=D1=83=D1=88?= =?UTF-8?q?=D0=B0=D0=BB=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D1=83,=20=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8E=20null=20+=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4=D0=B8?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D1=8C=20=D0=B2=D1=81=D0=B5=20=D0=BA=D0=B0?= =?UTF-8?q?=D1=80=D1=82=D0=B8=D0=BD=D0=BA=D0=B8=20=D0=B8=D0=B7=20=D0=A4?= =?UTF-8?q?=D0=B0=D0=BD=D1=81=D0=B8=D0=B1=D0=BE=D0=BA=D1=81=D0=B0=20=D0=B2?= =?UTF-8?q?=20=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=83=D0=B4=D0=BE=D0=B1=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D1=81=D0=BA=D1=80=D0=BE=D0=BB=D0=BB=D0=B8=D0=BD=D0=B3?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/css/point-plus.css | 29 +++++++------- chrome_point_plus/js/options.js | 6 ++- chrome_point_plus/js/point-plus.js | 56 +++++++++++++++++----------- chrome_point_plus/manifest.json | 2 +- chrome_point_plus/options.html | 4 ++ 5 files changed, 59 insertions(+), 38 deletions(-) diff --git a/chrome_point_plus/css/point-plus.css b/chrome_point_plus/css/point-plus.css index 70ed23d..f301c67 100644 --- a/chrome_point_plus/css/point-plus.css +++ b/chrome_point_plus/css/point-plus.css @@ -157,26 +157,27 @@ div#markItUpText-input { } /* Auto-loaded Booru pictures */ -.booru_pic{ - display: block; +.booru_pic { + display: block !important; + float: none !important; } -.booru_pic img{ - border: none; - max-width: 60%; - max-height: 300px; +.booru_pic img { + border: none; + max-width: 60%; + max-height: 300px; } /* Labels in post */ -.post .post-id a .authors_unique_count, .post .post-id a .recomendation_count{ - padding: 0 .5em; - font-weight: normal; - color: #35587c; - background: #f2f2eb; +.post .post-id a .authors_unique_count, .post .post-id a .recomendation_count { + padding: 0 .5em; + font-weight: normal; + color: #35587c; + background: #f2f2eb; } -.post .post-id a .recomendation_count{ - margin-left: 0.2em; - background: #f2eceb; +.post .post-id a .recomendation_count { + margin-left: 0.2em; + background: #f2eceb; } diff --git a/chrome_point_plus/js/options.js b/chrome_point_plus/js/options.js index 38874e2..429abe9 100644 --- a/chrome_point_plus/js/options.js +++ b/chrome_point_plus/js/options.js @@ -7,6 +7,8 @@ var ppOptions = [ 'option_fancybox_videos', // Open posts in Fancybox 'option_fancybox_posts', + // Bind all images from fancybox to one flow + 'option_fancybox_bind_images_to_one_flow', // CTRL+Enter 'option_ctrl_enter', // Load original images @@ -47,6 +49,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_fancybox_bind_images_to_one_flow = document.getElementById('option-fancybox-bind-images-to-one-flow').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; @@ -66,7 +69,8 @@ function pp_save_options() { ppOptions.option_at_before_username = document.getElementById('option-at-before-username').checked; ppOptions.option_other_hightlight_post_comments = document.getElementById('option-other-hightlight-post-comments').checked; ppOptions.option_other_show_recommendation_count = document.getElementById('option-other-show-recommendation-count').checked; - + + // Saving parameters chrome.storage.sync.set(ppOptions, function() { // Update status to let user know options were saved. diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index e1e46a6..f89782d 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -8,17 +8,40 @@ $(document).ready(function() { chrome.storage.sync.get(ppOptions, function(options) { // Options debug console.debug('Options loaded: %O', options); - + + // Embedding + if (options.option_embedding == true) { + // Load pictures from Booru, Tumblr and some other sites + if (options.option_images_load_booru == true){ + load_all_booru_images(); + } + // Parse webm-links and create video instead + if (options.option_videos_parse_webm == true){ + parse_webm(); + } + } + // Fancybox if (options.option_fancybox == true) { + if (options.option_fancybox_bind_images_to_one_flow==true){ + // Linking images in posts to the galleries + $('.post-content .text').each(function () { + $(this).find('a.postimg:not(.youtube)').attr('rel', 'one_flow_gallery'); + }); + } + // Images if (options.option_fancybox_images == true) { - // Linking images in posts to the galleries - $('.post-content .text').each(function(idxPost) { - $(this).find('a.postimg:not(.youtube)').attr('rel', 'post' + idxPost); - }); + if (options.option_fancybox_bind_images_to_one_flow!==true) { + // Linking images in posts to the galleries + $('.post-content .text').each(function (idxPost) { + $(this).find('a.postimg:not(.youtube)').attr('rel', 'post' + idxPost); + }); + } // Init fancybox - $('.postimg:not(.youtube)').fancybox(); + $('.postimg:not(.youtube)').fancybox({ + type: 'image' + }); } // Videos if (options.option_fancybox_videos == true) { @@ -43,18 +66,6 @@ $(document).ready(function() { } } - // Embedding - if (options.option_embedding == true) { - // Load pictures from Booru, Tumblr and some other sites - if (options.option_images_load_booru == true){ - load_all_booru_images(); - } - // Parse webm-links and create video instead - if (options.option_videos_parse_webm == true){ - parse_webm(); - } - } - // Hotkeys // Send by CTRL+Enter if (options.option_ctrl_enter == true) { @@ -453,10 +464,11 @@ function create_image(domain, id, additional) { a.href += '&add_' + encodeURIComponent(index) + '=' + encodeURIComponent(additional[index]); } } - a.id = 'booru_pic_' + booru_picture_count; - $(a).addClass('booru_pic').addClass('booru-' + domain + '-' + id); - a.title = domain + ' image #' + id; - a.target = '_blank'; + $(a).addClass('booru_pic').addClass('booru-' + domain + '-' + id).addClass('postimg').attr({ + 'id': 'booru_pic_' + booru_picture_count, + 'title': domain + ' image #' + id, + 'target': '_blank' + }); var image = document.createElement('img'); image.alt = a.title; diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 67e2e58..6971443 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.9.1", + "version": "1.9.2", "author": "Alexey Skobkin", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "description": "More features for point.im", diff --git a/chrome_point_plus/options.html b/chrome_point_plus/options.html index a41b848..b98ae15 100644 --- a/chrome_point_plus/options.html +++ b/chrome_point_plus/options.html @@ -32,6 +32,10 @@
+ +
+ +