Merged in NokitaKaze/chrome_point_plus-nokita-version (pull request #2)

1.9.2
This commit is contained in:
Alexey Skobkin 2014-11-15 17:27:49 +03:00
commit d07a560233
5 changed files with 59 additions and 38 deletions

View file

@ -158,7 +158,8 @@ div#markItUpText-input {
/* Auto-loaded Booru pictures */ /* Auto-loaded Booru pictures */
.booru_pic { .booru_pic {
display: block; display: block !important;
float: none !important;
} }
.booru_pic img { .booru_pic img {

View file

@ -7,6 +7,8 @@ var ppOptions = [
'option_fancybox_videos', 'option_fancybox_videos',
// Open posts in Fancybox // Open posts in Fancybox
'option_fancybox_posts', 'option_fancybox_posts',
// Bind all images from fancybox to one flow
'option_fancybox_bind_images_to_one_flow',
// CTRL+Enter // CTRL+Enter
'option_ctrl_enter', 'option_ctrl_enter',
// Load original images // Load original images
@ -47,6 +49,7 @@ function pp_save_options() {
ppOptions.option_fancybox_images = document.getElementById('option-fancybox-images').checked; ppOptions.option_fancybox_images = document.getElementById('option-fancybox-images').checked;
ppOptions.option_fancybox_videos = document.getElementById('option-fancybox-videos').checked; ppOptions.option_fancybox_videos = document.getElementById('option-fancybox-videos').checked;
ppOptions.option_fancybox_posts = document.getElementById('option-fancybox-posts').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_fluid_layout = document.getElementById('option-fluid-layout').checked;
ppOptions.option_images_load_original = document.getElementById('option-images-load-original').checked; ppOptions.option_images_load_original = document.getElementById('option-images-load-original').checked;
ppOptions.option_embedding = document.getElementById('option-embedding').checked; ppOptions.option_embedding = document.getElementById('option-embedding').checked;
@ -67,6 +70,7 @@ function pp_save_options() {
ppOptions.option_other_hightlight_post_comments = document.getElementById('option-other-hightlight-post-comments').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; ppOptions.option_other_show_recommendation_count = document.getElementById('option-other-show-recommendation-count').checked;
// Saving parameters // Saving parameters
chrome.storage.sync.set(ppOptions, function() { chrome.storage.sync.set(ppOptions, function() {
// Update status to let user know options were saved. // Update status to let user know options were saved.

View file

@ -9,16 +9,39 @@ $(document).ready(function() {
// Options debug // Options debug
console.debug('Options loaded: %O', options); 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 // Fancybox
if (options.option_fancybox == true) { 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 // Images
if (options.option_fancybox_images == true) { if (options.option_fancybox_images == true) {
if (options.option_fancybox_bind_images_to_one_flow!==true) {
// Linking images in posts to the galleries // Linking images in posts to the galleries
$('.post-content .text').each(function (idxPost) { $('.post-content .text').each(function (idxPost) {
$(this).find('a.postimg:not(.youtube)').attr('rel', 'post' + idxPost); $(this).find('a.postimg:not(.youtube)').attr('rel', 'post' + idxPost);
}); });
}
// Init fancybox // Init fancybox
$('.postimg:not(.youtube)').fancybox(); $('.postimg:not(.youtube)').fancybox({
type: 'image'
});
} }
// Videos // Videos
if (options.option_fancybox_videos == true) { 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 // Hotkeys
// Send by CTRL+Enter // Send by CTRL+Enter
if (options.option_ctrl_enter == true) { 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.href += '&add_' + encodeURIComponent(index) + '=' + encodeURIComponent(additional[index]);
} }
} }
a.id = 'booru_pic_' + booru_picture_count; $(a).addClass('booru_pic').addClass('booru-' + domain + '-' + id).addClass('postimg').attr({
$(a).addClass('booru_pic').addClass('booru-' + domain + '-' + id); 'id': 'booru_pic_' + booru_picture_count,
a.title = domain + ' image #' + id; 'title': domain + ' image #' + id,
a.target = '_blank'; 'target': '_blank'
});
var image = document.createElement('img'); var image = document.createElement('img');
image.alt = a.title; image.alt = a.title;

View file

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Point+", "name": "Point+",
"version": "1.9.1", "version": "1.9.2",
"author": "Alexey Skobkin", "author": "Alexey Skobkin",
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
"description": "More features for point.im", "description": "More features for point.im",

View file

@ -32,6 +32,10 @@
<div class="option"> <div class="option">
<input type="checkbox" id="option-fancybox-posts"><label for="option-fancybox-posts">Use for post links</label> <input type="checkbox" id="option-fancybox-posts"><label for="option-fancybox-posts">Use for post links</label>
</div> </div>
<div class="option">
<input type="checkbox" id="option-fancybox-bind-images-to-one-flow"><label for="option-fancybox-bind-images-to-one-flow">Bind all images from fancybox to one flow</label>
</div>
</div> </div>
<div class="option"> <div class="option">