diff --git a/LICENSE.TXT b/chrome_point_plus/LICENSE.TXT similarity index 100% rename from LICENSE.TXT rename to chrome_point_plus/LICENSE.TXT diff --git a/css/jquery.fancybox.css b/chrome_point_plus/css/jquery.fancybox.css similarity index 100% rename from css/jquery.fancybox.css rename to chrome_point_plus/css/jquery.fancybox.css diff --git a/images/blank.gif b/chrome_point_plus/images/blank.gif similarity index 100% rename from images/blank.gif rename to chrome_point_plus/images/blank.gif diff --git a/images/fancybox_loading.gif b/chrome_point_plus/images/fancybox_loading.gif similarity index 100% rename from images/fancybox_loading.gif rename to chrome_point_plus/images/fancybox_loading.gif diff --git a/images/fancybox_loading@2x.gif b/chrome_point_plus/images/fancybox_loading@2x.gif similarity index 100% rename from images/fancybox_loading@2x.gif rename to chrome_point_plus/images/fancybox_loading@2x.gif diff --git a/images/fancybox_overlay.png b/chrome_point_plus/images/fancybox_overlay.png similarity index 100% rename from images/fancybox_overlay.png rename to chrome_point_plus/images/fancybox_overlay.png diff --git a/images/fancybox_sprite.png b/chrome_point_plus/images/fancybox_sprite.png similarity index 100% rename from images/fancybox_sprite.png rename to chrome_point_plus/images/fancybox_sprite.png diff --git a/images/fancybox_sprite@2x.png b/chrome_point_plus/images/fancybox_sprite@2x.png similarity index 100% rename from images/fancybox_sprite@2x.png rename to chrome_point_plus/images/fancybox_sprite@2x.png diff --git a/chrome_point_plus/images/icon128.png b/chrome_point_plus/images/icon128.png new file mode 100644 index 0000000..b30c54b Binary files /dev/null and b/chrome_point_plus/images/icon128.png differ diff --git a/chrome_point_plus/images/icon16.png b/chrome_point_plus/images/icon16.png new file mode 100644 index 0000000..a4ebaea Binary files /dev/null and b/chrome_point_plus/images/icon16.png differ diff --git a/chrome_point_plus/images/icon19.png b/chrome_point_plus/images/icon19.png new file mode 100644 index 0000000..516a599 Binary files /dev/null and b/chrome_point_plus/images/icon19.png differ diff --git a/chrome_point_plus/images/icon24.png b/chrome_point_plus/images/icon24.png new file mode 100644 index 0000000..dfaead6 Binary files /dev/null and b/chrome_point_plus/images/icon24.png differ diff --git a/chrome_point_plus/images/icon256.png b/chrome_point_plus/images/icon256.png new file mode 100644 index 0000000..b614b25 Binary files /dev/null and b/chrome_point_plus/images/icon256.png differ diff --git a/chrome_point_plus/images/icon32.png b/chrome_point_plus/images/icon32.png new file mode 100644 index 0000000..62587bc Binary files /dev/null and b/chrome_point_plus/images/icon32.png differ diff --git a/chrome_point_plus/images/icon38.png b/chrome_point_plus/images/icon38.png new file mode 100644 index 0000000..82c52b5 Binary files /dev/null and b/chrome_point_plus/images/icon38.png differ diff --git a/chrome_point_plus/images/icon48.png b/chrome_point_plus/images/icon48.png new file mode 100644 index 0000000..cae54f5 Binary files /dev/null and b/chrome_point_plus/images/icon48.png differ diff --git a/chrome_point_plus/images/icon64.png b/chrome_point_plus/images/icon64.png new file mode 100644 index 0000000..5fca622 Binary files /dev/null and b/chrome_point_plus/images/icon64.png differ diff --git a/js/background.js b/chrome_point_plus/js/background.js similarity index 100% rename from js/background.js rename to chrome_point_plus/js/background.js diff --git a/js/jquery-1.10.1.min.js b/chrome_point_plus/js/jquery-1.10.1.min.js similarity index 100% rename from js/jquery-1.10.1.min.js rename to chrome_point_plus/js/jquery-1.10.1.min.js diff --git a/js/jquery.fancybox-media.js b/chrome_point_plus/js/jquery.fancybox-media.js similarity index 100% rename from js/jquery.fancybox-media.js rename to chrome_point_plus/js/jquery.fancybox-media.js diff --git a/js/jquery.fancybox.pack.js b/chrome_point_plus/js/jquery.fancybox.pack.js similarity index 100% rename from js/jquery.fancybox.pack.js rename to chrome_point_plus/js/jquery.fancybox.pack.js diff --git a/chrome_point_plus/js/options.js b/chrome_point_plus/js/options.js new file mode 100644 index 0000000..4fe5d03 --- /dev/null +++ b/chrome_point_plus/js/options.js @@ -0,0 +1,53 @@ +// Saves options to localStorage. +function save_options() { + // CTRL+Enter + var checkbox_ctrl_enter = document.getElementById('option-ctrl-enter'); + // Fancybox + // Images + var checkbox_fancybox_images = document.getElementById('option-fancybox-images'); + // Videos + var checkbox_fancybox_videos = document.getElementById('option-fancybox-videos'); + // Posts + var checkbox_fancybox_posts = document.getElementById('option-fancybox-posts'); + + // Saving parameters + chrome.storage.sync.set({ + 'option_ctrl_enter': checkbox_ctrl_enter.checked, + 'option_fancybox_images': checkbox_fancybox_images.checked, + 'option_fancybox_videos': checkbox_fancybox_videos.checked, + 'option_fancybox_posts': checkbox_fancybox_posts.checked, + }, function() { + // Update status to let user know options were saved. + var status = document.getElementById('status'); + status.innerHTML = 'Options Saved.'; + setTimeout(function() { + window.close(); + }, 1500); + }); +} + +// Restores select box state to saved value from localStorage. +function restore_options() { + // Loading options + chrome.storage.sync.get(['option_fancybox_images', 'option_fancybox_videos', 'option_fancybox_posts', 'option_ctrl_enter'], function(options) { + // CTRL+Enter + if (options.option_ctrl_enter == true) { + document.getElementById('option-ctrl-enter').checked = true; + } + // Fancybox + // 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; + } + }); +} +document.addEventListener('DOMContentLoaded', restore_options); +document.querySelector('#save').addEventListener('click', save_options); \ No newline at end of file diff --git a/js/point-plus.js b/chrome_point_plus/js/point-plus.js similarity index 54% rename from js/point-plus.js rename to chrome_point_plus/js/point-plus.js index 3b570cf..5695f22 100644 --- a/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -1,9 +1,14 @@ $(document).ready(function() { // Loading options - chrome.storage.sync.get(['option_ctrl_enter', 'option_fancybox'], function(options) { - // Fix the classes and init fancybox - if (options.option_fancybox == true) { - $('.postimg').addClass('fancybox-media').fancybox({ + chrome.storage.sync.get(['option_fancybox_images', 'option_fancybox_videos', 'option_fancybox_posts', 'option_ctrl_enter'], function(options) { + // Fancybox + // Images + if (options.option_fancybox_images == true) { + $('.postimg:not(.video)').fancybox(); + } + // Videos + if (options.option_fancybox_videos == true) { + $('.postimg.video').addClass('fancybox-media').fancybox({ helpers: { media: { youtube: { @@ -15,6 +20,12 @@ $(document).ready(function() { } }); } + // Posts + if (options.option_fancybox_posts == true) { + $('.post-id a').attr('data-fancybox-type', 'iframe').fancybox({ + maxWidth: 780 + }); + } // Send by CTRL+Enter if (options.option_ctrl_enter == true) { @@ -26,6 +37,7 @@ $(document).ready(function() { } }); } + }); // Showing page action diff --git a/manifest.json b/chrome_point_plus/manifest.json similarity index 69% rename from manifest.json rename to chrome_point_plus/manifest.json index cdc3b67..14efe28 100644 --- a/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,18 +1,26 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.0", + "version": "1.1", "author": "Alexey Skobkin", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "description": "Some new features for point.im", "options_page": "options.html", "page_action": { - "default_icon": "images/icon38.png", + "default_icon": { + "19": "images/icon19.png", + "38": "images/icon38.png" + }, "default_title": "Point+", "default_popup": "options.html" }, "icons": { - "128": "images/icon128.png" + "16": "images/icon16.png", + "32": "images/icon32.png", + "48": "images/icon48.png", + "64": "images/icon64.png", + "128": "images/icon128.png", + "256": "images/icon256.png" }, "content_scripts": [ { diff --git a/chrome_point_plus/options.html b/chrome_point_plus/options.html new file mode 100644 index 0000000..c09feb0 --- /dev/null +++ b/chrome_point_plus/options.html @@ -0,0 +1,32 @@ + + Point Plus options + + +

Point+ options

+ +

Fancybox pop-up

+

+ +

+

+ +

+

+ +

+

Hotkeys

+

+ +

+
+
+ + +

+ Send bug report +

+ + + + + \ No newline at end of file diff --git a/images/icon128.png b/images/icon128.png deleted file mode 100644 index f624767..0000000 Binary files a/images/icon128.png and /dev/null differ diff --git a/images/icon38.png b/images/icon38.png deleted file mode 100644 index 9c7a9b6..0000000 Binary files a/images/icon38.png and /dev/null differ diff --git a/js/options.js b/js/options.js deleted file mode 100644 index 42c6427..0000000 --- a/js/options.js +++ /dev/null @@ -1,39 +0,0 @@ -// Saves options to localStorage. -function save_options() { - // CTRL+Enter - var checkbox_ctrl_enter = document.getElementById('option-ctrl-enter'); - // Fancybox - var checkbox_fancybox = document.getElementById('option-fancybox'); - - // Saving parameters - chrome.storage.sync.set({ - 'option_ctrl_enter': checkbox_ctrl_enter.checked, - 'option_fancybox': checkbox_fancybox.checked - }, function() { - // Update status to let user know options were saved. - var status = document.getElementById('status'); - status.innerHTML = 'Options Saved.'; - setTimeout(function() { - window.close(); - }, 1500); - }); -} - -// Restores select box state to saved value from localStorage. -function restore_options() { - // Loading options - chrome.storage.sync.get(['option_ctrl_enter', 'option_fancybox'], 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; - } - ; - }); -} -document.addEventListener('DOMContentLoaded', restore_options); -document.querySelector('#save').addEventListener('click', save_options); \ No newline at end of file diff --git a/options.html b/options.html deleted file mode 100644 index 4e739a9..0000000 --- a/options.html +++ /dev/null @@ -1,26 +0,0 @@ - - Point Plus Options - - -

Point+ Options

-

- -

-

- -

-
-
- - -
-
- -

- Send bug report -

- - - - - \ No newline at end of file