Merged in isqua/chrome_point_plus/combine_embedding_remove_link (pull request #38) Replace all “don’t remove original link” with single “remove original link” option

This commit is contained in:
Alexey Skobkin 2015-01-31 15:30:13 +03:00
commit f8e573a8b5
4 changed files with 45 additions and 90 deletions

View file

@ -66,7 +66,7 @@
"message": "Audio from direct links" "message": "Audio from direct links"
}, },
"option_videos_parse_links": { "option_videos_parse_links": {
"message": "Video from direct links" "message": "Video from direct links ▼"
}, },
"option_videos_parse_webm": { "option_videos_parse_webm": {
"message": "Only webm" "message": "Only webm"
@ -74,23 +74,14 @@
"option_videos_parse_all_links": { "option_videos_parse_all_links": {
"message": "Parse all links" "message": "Parse all links"
}, },
"option_videos_parse_leave_links": {
"message": "Leave original link"
},
"option_embedding_soundcloud": { "option_embedding_soundcloud": {
"message": "Soundcloud ▼" "message": "Soundcloud"
},
"option_embedding_soundcloud_orig_link": {
"message": "Leave original link"
}, },
"option_embedding_pleercom": { "option_embedding_pleercom": {
"message": "Pleer.com ▼" "message": "Pleer.com"
}, },
"option_embedding_coubcom": { "option_embedding_coubcom": {
"message": "Coub.com ▼" "message": "Coub.com"
},
"option_embedding_coubcom_orig_link": {
"message": "Leave original link"
}, },
"option_embedding_twitter_tweets": { "option_embedding_twitter_tweets": {
"message": "Twitter" "message": "Twitter"
@ -98,8 +89,8 @@
"option_embedding_instagram_posts": { "option_embedding_instagram_posts": {
"message": "Instagram" "message": "Instagram"
}, },
"option_embedding_instagram_posts_orig_link": { "option_embedding_remove_original_link": {
"message": "Leave original link" "message": "Remove original link"
}, },
"option_nsfw": { "option_nsfw": {
"message": "NSFW content filtering" "message": "NSFW content filtering"

View file

@ -66,7 +66,7 @@
"message": "Аудио по прямой ссылке" "message": "Аудио по прямой ссылке"
}, },
"option_videos_parse_links": { "option_videos_parse_links": {
"message": "Видео по прямой ссылке" "message": "Видео по прямой ссылке ▼"
}, },
"option_videos_parse_webm": { "option_videos_parse_webm": {
"message": "Только webm" "message": "Только webm"
@ -74,23 +74,14 @@
"option_videos_parse_all_links": { "option_videos_parse_all_links": {
"message": "Все ссылки на видео" "message": "Все ссылки на видео"
}, },
"option_videos_parse_leave_links": {
"message": "Оставлять ссылку на видео"
},
"option_embedding_soundcloud": { "option_embedding_soundcloud": {
"message": "Soundcloud ▼" "message": "Soundcloud"
},
"option_embedding_soundcloud_orig_link": {
"message": "Не убирать ссылку"
}, },
"option_embedding_pleercom": { "option_embedding_pleercom": {
"message": "Pleer.com ▼" "message": "Pleer.com"
}, },
"option_embedding_coubcom": { "option_embedding_coubcom": {
"message": "Coub.com ▼" "message": "Coub.com"
},
"option_embedding_coubcom_orig_link": {
"message": "Не убирать ссылку"
}, },
"option_embedding_twitter_tweets": { "option_embedding_twitter_tweets": {
"message": "Twitter" "message": "Twitter"
@ -98,8 +89,8 @@
"option_embedding_instagram_posts": { "option_embedding_instagram_posts": {
"message": "Instagram" "message": "Instagram"
}, },
"option_embedding_instagram_posts_orig_link": { "option_embedding_remove_original_link": {
"message": "Не убирать ссылку" "message": "Удалять оригинальную ссылку"
}, },
"option_nsfw": { "option_nsfw": {
"message": "Фильтрация NSFW-контента" "message": "Фильтрация NSFW-контента"

View file

@ -96,12 +96,10 @@ function PointPlus(ppVersion) {
</div>'); </div>');
// Replace or prepend // Replace or prepend
if (options.is('option_embedding_soundcloud_orig_link')) { if (options.is('option_embedding_remove_original_link')) {
// Before
$(this).before($player);
} else {
// Replace
$(this).replaceWith($player); $(this).replaceWith($player);
} else {
$(this).before($player);
} }
}); });
} }
@ -846,7 +844,7 @@ function parse_webm(current_options) {
obj.parentElement.insertBefore(player, obj); obj.parentElement.insertBefore(player, obj);
if (current_options.is('option_videos_parse_leave_links', false)) { if (current_options.is('option_embedding_remove_original_link')) {
$(obj).hide(); $(obj).hide();
} }
} }
@ -870,7 +868,7 @@ function parse_all_videos(current_options) {
obj.parentElement.insertBefore(player, obj); obj.parentElement.insertBefore(player, obj);
if (current_options.is('option_videos_parse_leave_links', false)) { if (current_options.is('option_embedding_remove_original_link')) {
$(obj).hide(); $(obj).hide();
} }
} }
@ -919,7 +917,7 @@ function parse_all_audios(current_options){
obj.parentElement.insertBefore(player, obj); obj.parentElement.insertBefore(player, obj);
if (current_options.is('option_audios_parse_leave_links', false)) { if (current_options.is('option_embedding_remove_original_link')) {
$(obj).hide(); $(obj).hide();
} }
} }
@ -984,7 +982,7 @@ function parse_pleercom_links(current_options) {
'<embed src="' + trackHref + '" type="application/x-shockwave-flash" width="578" height="60">' + '<embed src="' + trackHref + '" type="application/x-shockwave-flash" width="578" height="60">' +
'</embed></object>'); '</embed></object>');
if ( ! current_options.is('option_embedding_pleercom_orig_link')) { if (current_options.is('option_embedding_remove_original_link')) {
$link.remove(); $link.remove();
} }
} }
@ -1171,7 +1169,7 @@ function parse_coub_links(current_options) {
obj.parentElement.insertBefore(player, obj); obj.parentElement.insertBefore(player, obj);
if (current_options.is('option_embedding_coubcom_orig_link', false)) { if (current_options.is('option_embedding_remove_original_link')) {
$(obj).hide(); $(obj).hide();
} }
} }
@ -1578,7 +1576,7 @@ function instagram_posts_embedding_init(options) {
$link.before($imgLink); $link.before($imgLink);
if ( ! options.is('option_embedding_instagram_posts_orig_link')) { if (options.is('option_embedding_remove_original_link')) {
$link.remove(); $link.remove();
} }
} }

View file

@ -75,68 +75,43 @@
<span data-i18n="option_videos_parse_all_links"></span> <span data-i18n="option_videos_parse_all_links"></span>
</label> </label>
</div> </div>
<label class="option-node">
<input type="checkbox" name="option-videos-parse-leave-links">
<span data-i18n="option_videos_parse_leave_links"></span>
</label>
</div> </div>
<div class="option-node"> <label class="option-node">
<input type="checkbox" name="option-audios-parse-links" id="option-audios-parse-links"> <input type="checkbox" name="option-audios-parse-links">
<label for="option-audios-parse-links" data-i18n="option_audios_parse_links"></label> <span data-i18n="option_audios_parse_links"></span>
</label>
<label class="option-node"> <label class="option-node">
<input type="checkbox" name="option-audios-parse-leave-links"> <input type="checkbox" name="option-embedding-soundcloud">
<span data-i18n="option_embedding_soundcloud_orig_link"></span> <span data-i18n="option_embedding_soundcloud"></span>
</label> </label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-soundcloud" id="option-embedding-soundcloud">
<label for="option-embedding-soundcloud" data-i18n="option_embedding_soundcloud"></label>
<label class="option-node"> <label class="option-node">
<input type="checkbox" name="option-embedding-soundcloud-orig-link"> <input type="checkbox" name="option-embedding-pleercom">
<span data-i18n="option_embedding_soundcloud_orig_link"></span> <span data-i18n="option_embedding_pleercom"></span>
</label> </label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-pleercom" id="option-embedding-pleercom">
<label for="option-embedding-pleercom" data-i18n="option_embedding_pleercom"></label>
<label class="option-node"> <label class="option-node">
<input type="checkbox" name="option-embedding-pleercom-orig-link"> <input type="checkbox" name="option-embedding-coubcom">
<span data-i18n="option_embedding_soundcloud_orig_link"></span> <span data-i18n="option_embedding_coubcom"></span>
</label> </label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-coubcom" id="option-embedding-coubcom">
<label for="option-embedding-coubcom" data-i18n="option_embedding_coubcom"></label>
<label class="option-node">
<input type="checkbox" name="option-embedding-coubcom-orig-link">
<span data-i18n="option_embedding_coubcom_orig_link"></span>
</label>
</div>
<label class="option-node"> <label class="option-node">
<input type="checkbox" name="option-embedding-twitter-tweets"> <input type="checkbox" name="option-embedding-twitter-tweets">
<span data-i18n="option_embedding_twitter_tweets"></span> <span data-i18n="option_embedding_twitter_tweets"></span>
</label> </label>
<div class="option-node"> <label class="option-node">
<input type="checkbox" name="option-embedding-instagram-posts" id="option-embedding-instagram-posts"> <input type="checkbox" name="option-embedding-instagram-posts">
<label for="option-embedding-instagram-posts" data-i18n="option_embedding_instagram_posts"></label> <span data-i18n="option_embedding_instagram_posts"></span>
</label>
<label class="option-node"> <label class="option-node">
<input type="checkbox" name="option-embedding-instagram-posts-orig-link"> <input type="checkbox" name="option-embedding-remove-original-link">
<span data-i18n="option_embedding_instagram_posts_orig_link"></span> <span data-i18n="option_embedding_remove_original_link">
</label> </label>
</div> </div>
</div>
<div class="option-node"> <div class="option-node">
<input type="checkbox" name="option-nsfw" id="option-nsfw"> <input type="checkbox" name="option-nsfw" id="option-nsfw">