mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-09-28 18:53:13 +00:00
Compare commits
No commits in common. "master" and "1.38.0" have entirely different histories.
|
@ -1,5 +1,5 @@
|
|||
var vendorCopy = [
|
||||
'jquery/dist/jquery.min.js',
|
||||
'jquery/jquery.min.js',
|
||||
|
||||
'fancybox/source/jquery.fancybox.pack.js',
|
||||
'fancybox/source/helpers/jquery.fancybox-media.js',
|
||||
|
|
|
@ -55,9 +55,3 @@ npm run lint
|
|||
```
|
||||
grunt bump
|
||||
```
|
||||
|
||||
Запустить сборку расширения браузером:
|
||||
|
||||
```
|
||||
/bin/bash pack_chromium.sh /usr/bin/chromium /path/to/repository/chrome_point_plus /path/to/private/key.pem
|
||||
```
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chrome-point-plus",
|
||||
"version": "1.42.1",
|
||||
"version": "1.38.0",
|
||||
"authors": [
|
||||
"Alexey Skobkin"
|
||||
],
|
||||
|
@ -14,7 +14,7 @@
|
|||
"chrome_point_plus/vendors/**"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "~3",
|
||||
"jquery": "~1.10.1",
|
||||
"fancybox": "~2.1.5",
|
||||
"markitup": "~1.1.14",
|
||||
"soundcloud": "git@github.com:soundcloud/Widget-JS-API.git"
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
"option_fancybox_bind_images_to_one_flow": {
|
||||
"message": "Bind all images to one Fancybox gallery"
|
||||
},
|
||||
"option_fancybox_smart_hints": {
|
||||
"message": "Generate image caption from tags"
|
||||
},
|
||||
"option_images_load_original": {
|
||||
"message": "Load original images instead of thumbnails"
|
||||
},
|
||||
|
@ -113,12 +116,6 @@
|
|||
"option_ajax_comments": {
|
||||
"message": "Send comments via AJAX (CTRL+Enter)"
|
||||
},
|
||||
"option_right_panel": {
|
||||
"message": "Right side panel"
|
||||
},
|
||||
"option_right_panel_to_unread": {
|
||||
"message": "\"Go to unread comment\" button"
|
||||
},
|
||||
"option_fluid_layout": {
|
||||
"message": "Fluid layout"
|
||||
},
|
||||
|
@ -180,9 +177,6 @@
|
|||
"option_other_move_all_to_menu":{
|
||||
"message": "Move \"All posts\" to left menu"
|
||||
},
|
||||
"option_other_remove_fucking_button":{
|
||||
"message": "Remove the fucking button"
|
||||
},
|
||||
"option_other_post_draft_save":{
|
||||
"message": "Save post drafts"
|
||||
},
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
"option_fancybox_bind_images_to_one_flow": {
|
||||
"message": "Связать все картинки в одну галерею Fancybox"
|
||||
},
|
||||
"option_fancybox_smart_hints": {
|
||||
"message": "Генерировать подписи к картинкам из тегов"
|
||||
},
|
||||
"option_images_load_original": {
|
||||
"message": "Загружать оригиналы вместо миниатюр"
|
||||
},
|
||||
|
@ -113,12 +116,6 @@
|
|||
"option_ajax_comments": {
|
||||
"message": "Отправка комментариев через AJAX (CTRL+Enter)"
|
||||
},
|
||||
"option_right_panel": {
|
||||
"message": "Боковая панель справа"
|
||||
},
|
||||
"option_right_panel_to_unread": {
|
||||
"message": "Кнопка \"Перейти к непрочитанному\""
|
||||
},
|
||||
"option_fluid_layout": {
|
||||
"message": ""Резиновая" вёрстка (растянуть сайт по горизонтали)"
|
||||
},
|
||||
|
@ -180,9 +177,6 @@
|
|||
"option_other_move_all_to_menu":{
|
||||
"message": "Переместить \"Всё подряд\" в левое меню"
|
||||
},
|
||||
"option_other_remove_fucking_button":{
|
||||
"message": "Убрать ёбаную кнопку"
|
||||
},
|
||||
"option_other_post_draft_save":{
|
||||
"message": "Сохранение черновика поста"
|
||||
},
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#pp-right-panel {
|
||||
width: 32px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
right: 3px;
|
||||
opacity: .3;
|
||||
transition: opacity 500ms;
|
||||
}
|
||||
|
||||
#pp-right-panel:hover {
|
||||
opacity: 1;
|
||||
transition: opacity 500ms;
|
||||
}
|
||||
|
||||
#pp-right-panel #pp-go-to-unread {
|
||||
background-image: url("/img/menu-my.png");
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pp-right-panel span#pp-unread-count {
|
||||
position: relative;
|
||||
top: 7px;
|
||||
left: 11px;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
|
@ -124,7 +124,7 @@ div#markItUpText-input {
|
|||
right: 5px;
|
||||
top: 5px;
|
||||
display: none;
|
||||
background-image: url('//point.im/img/btn-edit.png');
|
||||
background-image: url("//point.im/img/btn-edit.png");
|
||||
background-size: 100% 100%;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
@ -216,44 +216,3 @@ div#markItUpText-input {
|
|||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* "All" link in left menu */
|
||||
#pp-left-menu-all {
|
||||
/* Opened Lock icon from default point.im icon set */
|
||||
background-image: url('/img/icon-private-inactive.png') !important;
|
||||
}
|
||||
|
||||
/* Highlight post with new comments */
|
||||
.pp-post-unread {
|
||||
background-color: #EEFFEE;
|
||||
}
|
||||
|
||||
/* Video from direct links */
|
||||
.pp-video-player {
|
||||
display: block;
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
/* Audio from direct links */
|
||||
.pp-audio-player {
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
/* Coub embedded video */
|
||||
.pp-video-player-coub {
|
||||
max-width: 640px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* New posts and comments auto refresh in left menu by @NokitaKaze */
|
||||
.pp-left-menu-refreshed {
|
||||
background-color: #f2ebee;
|
||||
color: #7c3558;
|
||||
}
|
||||
|
||||
#pp-iframe-unread-refresh {
|
||||
width: 600px;
|
||||
height: 300px;
|
||||
display: none;
|
||||
}
|
|
@ -23,10 +23,7 @@ function PointPlus(ppVersion) {
|
|||
console.info('Point+ %s', ppVersion);
|
||||
|
||||
// Getting username
|
||||
var point_username = $('#name').find('h1').text();
|
||||
// Getting post id
|
||||
var postId = $('#top-post').attr('data-id');
|
||||
console.debug('Current post id detected as #%s', postId);
|
||||
var point_username = $('#name h1').text();
|
||||
|
||||
// Проверяем, загрузились ли мы
|
||||
var point_plus_debug = $('#point-plus-debug');
|
||||
|
@ -46,59 +43,13 @@ function PointPlus(ppVersion) {
|
|||
// Options debug
|
||||
try {
|
||||
console.debug('Options loaded: %O', options.getOptions());
|
||||
} catch(e) {
|
||||
console.error('Options load error: %O', e);
|
||||
}
|
||||
} catch(e){}
|
||||
|
||||
create_tag_system();
|
||||
|
||||
// Move "all posts" to left menu
|
||||
if (options.is('option_other_move_all_to_menu')) {
|
||||
$('div.secret a').insertAfter('#left-menu #menu-recent').attr({'id': 'pp-left-menu-all'});
|
||||
}
|
||||
|
||||
// Side panel
|
||||
if (options.is('option_right_panel')) {
|
||||
// Loading side panel CSS
|
||||
messenger.css('css/modules/side_panel.css');
|
||||
|
||||
// Creating side panel
|
||||
var $side_panel = $('<div>').attr({
|
||||
id: 'pp-right-panel'
|
||||
});
|
||||
|
||||
$('body').append($side_panel);
|
||||
|
||||
if (options.is('option_right_panel_to_unread') && $('#comments').length > 0) {
|
||||
$go_to_unread_block = $('<div>').attr({
|
||||
id: 'pp-go-to-unread',
|
||||
}).click(function() {
|
||||
var $unread_comment = $('#comments').find('div.post.unread').first();
|
||||
|
||||
if ($unread_comment.length > 0) {
|
||||
$('html body').animate({ scrollTop: $unread_comment.offset().top }, 500);
|
||||
$unread_comment.removeClass('unread');
|
||||
// Updating count
|
||||
update_right_panel_unread_count();
|
||||
}
|
||||
});
|
||||
|
||||
$side_panel.append($go_to_unread_block);
|
||||
|
||||
$go_to_unread_link = $('<span>').attr({
|
||||
id: 'pp-unread-count',
|
||||
});
|
||||
|
||||
$go_to_unread_block.append($go_to_unread_link);
|
||||
|
||||
// Updating count
|
||||
update_right_panel_unread_count();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove fucking button
|
||||
if (options.is('option_other_remove_fucking_button')) {
|
||||
$('#scrollToTop').remove();
|
||||
$('div.secret a').insertAfter('a#menu-recent').css('background-image','url("img/icon-private-inactive.png")');
|
||||
}
|
||||
|
||||
// Embedding
|
||||
|
@ -120,9 +71,9 @@ function PointPlus(ppVersion) {
|
|||
// Parse webm-links and create video instead
|
||||
if (options.is('option_videos_parse_links')) {
|
||||
if (options.is('option_videos_parse_links_type', 'all')) {
|
||||
parse_video_links(options, true);
|
||||
parse_all_videos(options);
|
||||
} else {
|
||||
parse_video_links(options);
|
||||
parse_webm(options);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +93,7 @@ function PointPlus(ppVersion) {
|
|||
// If scripts are executed
|
||||
if (response) {
|
||||
// Processing links
|
||||
$('div.post .post-content a[href*="\\:\\/\\/soundcloud\\.com\\/"]').each(function(index) {
|
||||
$('.post .post-content a[href*="\\:\\/\\/soundcloud\\.com\\/"]').each(function(index) {
|
||||
console.log($(this));
|
||||
|
||||
// @todo: вынести в отдельный шаблон
|
||||
|
@ -226,6 +177,13 @@ function PointPlus(ppVersion) {
|
|||
});
|
||||
}
|
||||
|
||||
// Правим хинты у фансибокса
|
||||
if (options.is('option_fancybox_smart_hints')) {
|
||||
fancybox_set_smart_hints();
|
||||
} else {
|
||||
$('.post .postimg').attr('data-fancybox-title', ' ');
|
||||
}
|
||||
|
||||
// Videos
|
||||
if (options.is('option_fancybox_videos')) {
|
||||
$('.postimg.youtube').addClass('fancybox-media').fancybox({
|
||||
|
@ -255,26 +213,24 @@ function PointPlus(ppVersion) {
|
|||
if (options.is('option_nsfw')) {
|
||||
$('.post-tag-nsfw,.post-tag-сиськи').find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'hidden-images');
|
||||
|
||||
$post = $('div.post');
|
||||
|
||||
if (options.is('option_nsfw_hide_posts')) {
|
||||
if ($('#comments').length == 0) {
|
||||
console.log('Hide NSFW posts in feed, %i hidden', $post.length);
|
||||
$post.addClass('hide-nsfw-posts');
|
||||
console.log('Hide NSFW posts in feed, %i hidden', $('.post').length);
|
||||
$('.post').addClass('hide-nsfw-posts');
|
||||
}
|
||||
}
|
||||
|
||||
// Blurred posts
|
||||
if (options.is('option_nsfw_blur_posts_entire')) {
|
||||
console.log('Bluring NSFW posts');
|
||||
$('div.post').addClass('blur-nsfw-entire');
|
||||
$('.post').addClass('blur-nsfw-entire');
|
||||
} else if (options.is('option_nsfw_blur_posts_images')) {
|
||||
console.log('Bluring images in NSFW posts');
|
||||
$('div.post').addClass('blur-nsfw-images');
|
||||
$('.post').addClass('blur-nsfw-images');
|
||||
}
|
||||
|
||||
// Blurred comments
|
||||
if ($post.hasClass('post-tag-nsfw') || $post.hasClass('post-tag-сиськи')) {
|
||||
if ($('.post').hasClass('post-tag-nsfw') || $('.post').hasClass('post-tag-сиськи')) {
|
||||
if (options.is('option_nsfw_blur_comments_entire')) {
|
||||
console.log('Bluring comments');
|
||||
$('#comments').addClass('blur-nsfw-entire');
|
||||
|
@ -374,7 +330,7 @@ function PointPlus(ppVersion) {
|
|||
}
|
||||
// Google search
|
||||
if (options.is('option_search_with_google')) {
|
||||
$('#search-form').find('input[type="text"]').attr('placeholder', 'Google').keydown(function(e) {
|
||||
$('#search-form input[type="text"]').attr('placeholder', 'Google').keydown(function(e) {
|
||||
if (e.keyCode == 10 || e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
document.location.href = '//www.google.ru/search?q=site%3Apoint.im+' + $(this).val();
|
||||
|
@ -387,8 +343,11 @@ function PointPlus(ppVersion) {
|
|||
ws = new WebSocket(((location.protocol == 'https:') ? 'wss' : 'ws') + '://point.im/ws');
|
||||
console.log('WebSocket created: %O', ws);
|
||||
|
||||
// Detecting post id if presented
|
||||
var postId = $('#top-post').attr('data-id');
|
||||
console.debug('Current post id detected as #%s', postId);
|
||||
// Detecting view mode
|
||||
treeSwitch = $('#tree-switch').children('a.active').attr('href');
|
||||
treeSwitch = $('#tree-switch a.active').attr('href');
|
||||
console.debug('Comments view mode: %s', treeSwitch);
|
||||
|
||||
// Error handler
|
||||
|
@ -396,12 +355,6 @@ function PointPlus(ppVersion) {
|
|||
console.error('WebSocket error: %O', err);
|
||||
};
|
||||
|
||||
// Close handler
|
||||
ws.onclose = function(evt) {
|
||||
console.error('WebSocket closed: %O', evt);
|
||||
};
|
||||
|
||||
// todo: refactor to background service
|
||||
// Message handler
|
||||
ws.onmessage = function(evt) {
|
||||
try {
|
||||
|
@ -433,7 +386,11 @@ function PointPlus(ppVersion) {
|
|||
|
||||
// Comments
|
||||
case 'comment':
|
||||
console.groupCollapsed('WS \'%s\' #%s/%s', wsMessage.a, wsMessage.post_id, wsMessage.comment_id);
|
||||
if (wsMessage.a === 'comment') {
|
||||
console.groupCollapsed('WS comment #%s/%s', wsMessage.post_id, wsMessage.comment_id);
|
||||
} else if (wsMessage.a === 'ok') {
|
||||
console.groupCollapsed('WS comment rec #%s/%s', wsMessage.post_id, wsMessage.comment_id);
|
||||
}
|
||||
|
||||
// Check option
|
||||
if ( ! options.is('option_ws_comments')) {
|
||||
|
@ -456,8 +413,6 @@ function PointPlus(ppVersion) {
|
|||
break;
|
||||
}
|
||||
|
||||
// If comment has text
|
||||
if (wsMessage.hasOwnProperty('html') && typeof wsMessage.html === 'string') {
|
||||
// Generating comment from websocket message
|
||||
create_comment_elements({
|
||||
id: (wsMessage.a === 'ok') ? wsMessage.rcid : wsMessage.comment_id,
|
||||
|
@ -466,18 +421,18 @@ function PointPlus(ppVersion) {
|
|||
author: wsMessage.author,
|
||||
html: wsMessage.html,
|
||||
fadeOut: options.is('option_ws_comments_color_fadeout'),
|
||||
isRec: (wsMessage.a === 'ok'),
|
||||
isRec: (wsMessage.a === 'ok') ? true : false,
|
||||
unread: (point_username && point_username !== wsMessage.author) ? true : false,
|
||||
}, function($comment) {
|
||||
// It's time to DOM
|
||||
console.info('Inserting comment');
|
||||
|
||||
// Search for parent comment
|
||||
$parentComment = (wsMessage.to_comment_id) ? ($('div.post[data-comment-id="' + wsMessage.to_comment_id + '"]')) : [];
|
||||
$parentComment = (wsMessage.to_comment_id) ? ($('.post[data-comment-id="' + wsMessage.to_comment_id + '"]')) : [];
|
||||
console.log('Parent comment: %O', $parentComment || null);
|
||||
|
||||
// If list mode or not addressed to other comment
|
||||
if (treeSwitch === '?tree=0' || !wsMessage.to_comment_id || !$parentComment.length) {
|
||||
if ($('#comments #tree-switch a').eq(0).hasClass('active') || (wsMessage.to_comment_id === null) || (!$parentComment.length)) {
|
||||
// Adding to the end of the list
|
||||
$('.content-wrap #comments #post-reply').before($comment);
|
||||
} else {
|
||||
|
@ -505,12 +460,9 @@ function PointPlus(ppVersion) {
|
|||
}, function(response) {});
|
||||
}
|
||||
|
||||
// Updating comments number
|
||||
update_right_panel_unread_count();
|
||||
|
||||
console.groupEnd();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
@ -557,6 +509,7 @@ function PointPlus(ppVersion) {
|
|||
console.log(e);
|
||||
console.log(evt.data);
|
||||
}
|
||||
;
|
||||
};
|
||||
}
|
||||
// Font size
|
||||
|
@ -703,7 +656,7 @@ function create_comment_elements(commentData, onCommentCreated) {
|
|||
$commentTemplate.find('.action-labels .more-label').attr('for', 'action-' + commentData.postId + '_' + commentData.id);
|
||||
$commentTemplate.find('.post-content input[name="action-radio"]').attr('id', 'action-' + commentData.postId + '_' + commentData.id);
|
||||
// Bookmark link
|
||||
$commentTemplate.find('.action-buttons a.bookmark').attr('href', $('#top-post').find('.info a').attr('href') + commentData.postId + '/b?comment_id=' + commentData.id + '&csrf_token=' + csRfToken);
|
||||
$commentTemplate.find('.action-buttons a.bookmark').attr('href', $('#top-post .info a').attr('href') + commentData.postId + '/b?comment_id=' + commentData.id + '&csrf_token=' + csRfToken);
|
||||
// Reply form
|
||||
$commentTemplate.find('.post-content input.reply-radio').attr('id', 'reply-' + commentData.postId + '_' + commentData.id);
|
||||
$commentTemplate.find('.post-content form.reply-form').attr('action', '/' + commentData.postId);
|
||||
|
@ -728,116 +681,94 @@ function create_comment_elements(commentData, onCommentCreated) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update undread comments count in right panel
|
||||
*
|
||||
* @param {?object} $span jQuery object of unread count <span>
|
||||
*/
|
||||
function update_right_panel_unread_count($span) {
|
||||
var unread_count = $('#comments').find('div.post.unread').length;
|
||||
|
||||
if (typeof $span === 'undefined') {
|
||||
$span = $('#pp-unread-count');
|
||||
}
|
||||
|
||||
if ($span.length > 0) {
|
||||
$span.text(unread_count);
|
||||
}
|
||||
}
|
||||
|
||||
// Помечаем непрочитанные посты более видимо чем каким-то баджем
|
||||
// Эта часть изначально была написана @RainbowSpike
|
||||
// Эта часть написана @RainbowSpike
|
||||
function mark_unread_post() {
|
||||
var $posts = $('.content-wrap').children('div.post');
|
||||
$posts.css({'padding-left':'2px'});
|
||||
|
||||
$posts.each(function() {
|
||||
if ($(this).find('.post-id .unread').length > 0) {
|
||||
$(this).addClass('pp-post-unread');
|
||||
}
|
||||
var divs = $(".content-wrap > .post").css({'padding-left':'2px'}); // массив постов
|
||||
for (var i = 0; i < divs.length; i++) { // обыск постов
|
||||
var spans = $(divs[i]).find(".unread"); // поиск метки непрочитанных комментов
|
||||
if (spans.length > 0) { // если в посте есть непрочитанные комменты...
|
||||
$(divs[i]).css({//...залить пост зеленоватым и скруглить
|
||||
'background-color': '#EEFFEE',
|
||||
'border-radius': '10px'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse video links in posts
|
||||
*
|
||||
* @param {object} current_options
|
||||
* @param {boolean} all
|
||||
*/
|
||||
function parse_video_links(current_options, all) {
|
||||
if (typeof all === 'undefined') {
|
||||
all = false;
|
||||
}
|
||||
|
||||
var regex;
|
||||
|
||||
if (all) {
|
||||
regex = new RegExp('\\.(webm|avi|mp4|mpg|mpeg)(\\?.+)?$', 'i');
|
||||
} else {
|
||||
regex = new RegExp('\\.(webm)(\\?.+)?$', 'i');
|
||||
}
|
||||
|
||||
// Webm
|
||||
function parse_webm(current_options) {
|
||||
$('.post-content a:not(.booru_pic)').each(function(num, obj) {
|
||||
var href = obj.href;
|
||||
var matches;
|
||||
|
||||
if (matches = href.match(regex)) {
|
||||
var href = obj.href;
|
||||
var n = null;
|
||||
|
||||
if (n = href.match(new RegExp('\\.webm(\\?.+)?$', 'i'))) {
|
||||
var player = document.createElement('video');
|
||||
var mime = video_extension_to_mime(matches[1]);
|
||||
// Там может быть не vp8+vorbis, но мы этого никак не узнаем
|
||||
$(player)
|
||||
.html('<source src="' + href + '" type=\'' + mime + '\' />')
|
||||
.attr('controls', 'controls')
|
||||
.addClass('pp-video-player')
|
||||
;
|
||||
$(player).html('<source src="' + href + '" type=\'video/webm; codecs="vp8, vorbis"\' />').attr('controls', 'controls').css({
|
||||
'display': 'block',
|
||||
'max-width': '95%'
|
||||
}).addClass('parsed-webm-link');
|
||||
|
||||
obj.parentElement.insertBefore(player, obj);
|
||||
|
||||
if (current_options.is('option_embedding_remove_original_link')) {
|
||||
$(obj).remove();
|
||||
$(obj).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Видео
|
||||
function parse_all_videos(current_options) {
|
||||
$('.post-content a:not(.booru_pic)').each(function(num, obj) {
|
||||
|
||||
var href = obj.href;
|
||||
var n = null;
|
||||
|
||||
if (n = href.match(new RegExp('\\.(webm|avi|mp4|mpg|mpeg)(\\?.+)?$', 'i'))) {
|
||||
var player = document.createElement('video');
|
||||
var mime = video_extension_to_mime(n[1]);
|
||||
$(player).html('<source src="' + href + '" type=\'' + mime + '\' />').attr('controls', 'controls').css({
|
||||
'display': 'block',
|
||||
'max-width': '95%'
|
||||
}).addClass('parsed-webm-link');
|
||||
|
||||
obj.parentElement.insertBefore(player, obj);
|
||||
|
||||
if (current_options.is('option_embedding_remove_original_link')) {
|
||||
$(obj).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects mime and codecs by file extension
|
||||
*
|
||||
* @param {string} extension
|
||||
* @returns {string}
|
||||
*/
|
||||
function video_extension_to_mime(extension) {
|
||||
switch (extension) {
|
||||
case 'webm':
|
||||
return 'video/webm; codecs="vp8, vorbis"';
|
||||
case 'avi':
|
||||
return 'video/avi;';
|
||||
case 'mp4':
|
||||
return 'video/mp4;';
|
||||
case 'mpg':
|
||||
return 'video/mp4;';
|
||||
case 'mpeg':
|
||||
return 'video/mp4;';
|
||||
case 'webm':return 'video/webm; codecs="vp8, vorbis';
|
||||
case 'avi' :return 'video/avi;';
|
||||
case 'mp4' :return 'video/mp4;';
|
||||
case 'mpg' :return 'video/mp4;';
|
||||
case 'mpeg':return 'video/mp4;';
|
||||
}
|
||||
}
|
||||
|
||||
// Аудио
|
||||
function parse_all_audios(current_options){
|
||||
var regex_all = new RegExp('^https?:\\/\\/([a-z0-9.-]+)\\/[a-z0-9_\\/.%-]+\\.(mp3|ogg|wav)(\\?.+)?$', 'i');
|
||||
var regex_vk = new RegExp('\\.vk\\.me$', 'i');
|
||||
|
||||
$('.post-content a').each(function(num, obj) {
|
||||
if ($(obj).hasClass('booru_pic')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var href = obj.href;
|
||||
var n;
|
||||
var n = null;
|
||||
|
||||
if (n = href.match(regex_all)) {
|
||||
if (n = href.match(new RegExp('^https?:\\/\\/([a-z0-9.-]+)\\/[a-z0-9_\\/.%-]+\\.(mp3|ogg|wav)(\\?.+)?$', 'i'))) {
|
||||
var domain = n[1];
|
||||
// Проверяем откуда мы грузимся
|
||||
if (domain.match(regex_vk)) {
|
||||
if (domain.match(new RegExp('\\.vk\\.me$', 'i'))){
|
||||
// Так то ж Контакт!
|
||||
if (typeof(n[3])=='undefined'){
|
||||
return;
|
||||
|
@ -849,36 +780,25 @@ function parse_all_audios(current_options) {
|
|||
|
||||
var player = document.createElement('audio');
|
||||
var mime = audio_extension_to_mime(n[2]);
|
||||
|
||||
$(player)
|
||||
.html('<source src="' + href + '" type=\'' + mime + '\' />')
|
||||
.attr('controls', 'controls')
|
||||
.addClass('pp-audio-player')
|
||||
;
|
||||
$(player).html('<source src="' + href + '" type=\'' + mime + '\' />').attr('controls', 'controls').css({
|
||||
'display': 'block',
|
||||
'max-width': '350px'
|
||||
}).addClass('parsed-audio-link');
|
||||
|
||||
obj.parentElement.insertBefore(player, obj);
|
||||
|
||||
if (current_options.is('option_embedding_remove_original_link')) {
|
||||
$(obj).remove();
|
||||
$(obj).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects mime and codecs by audio file extension
|
||||
*
|
||||
* @param extension
|
||||
* @returns {*}
|
||||
*/
|
||||
function audio_extension_to_mime(extension) {
|
||||
switch (extension) {
|
||||
case 'mp3':
|
||||
return 'audio/mpeg';
|
||||
case 'ogg':
|
||||
return 'audio/ogg; codecs="vorbis"';
|
||||
case 'wav':
|
||||
return 'audio/vnd.wave';
|
||||
case 'mp3': return 'audio/mpeg';
|
||||
case 'ogg': return 'audio/ogg; codecs=vorbis';
|
||||
case 'wav': return 'audio/vnd.wave';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -886,21 +806,19 @@ function audio_extension_to_mime(extension) {
|
|||
* Показывает количество рекомендаций и комментаторов у постов
|
||||
*/
|
||||
function set_posts_count_label() {
|
||||
$posts = $('.content-wrap').children('div.post');
|
||||
|
||||
var posts_hash = {};
|
||||
var posts = {};
|
||||
var ids;
|
||||
|
||||
$posts.each(function(n, post) {
|
||||
$('.content-wrap > .post').each(function(n, post) {
|
||||
var $post = $(post);
|
||||
var postId = $post.data('id');
|
||||
|
||||
posts_hash[postId] = $post;
|
||||
posts[postId] = $post;
|
||||
});
|
||||
|
||||
ids = Object.keys(posts_hash);
|
||||
ids = Object.keys(posts);
|
||||
|
||||
$posts.find('.post-id .cn').addClass('changed_background');
|
||||
$('.content-wrap > .post .post-id a .cn').addClass('changed_background');
|
||||
|
||||
$.ajax('https://api.kanaria.ru/point/get_post_info.php?list=' + encodeURIComponent(ids.join(',')), {
|
||||
dataType: 'json',
|
||||
|
@ -909,15 +827,15 @@ function set_posts_count_label() {
|
|||
var postInfo = data.list[id];
|
||||
|
||||
if (postInfo) {
|
||||
posts_hash[id].find('.post-id').after(
|
||||
posts[id].find('.post-id').after(
|
||||
'<div class="pp-post-counters">' +
|
||||
'<span class="pp-unique-comments"></span> ' +
|
||||
'<span class="pp-recommendation-count"></span> ' +
|
||||
'</div>'
|
||||
);
|
||||
)
|
||||
|
||||
posts_hash[id].find('.pp-unique-comments').text(postInfo.count_comment_unique);
|
||||
posts_hash[id].find('.pp-recommendation-count').text(postInfo.count_recommendation);
|
||||
posts[id].find('.pp-unique-comments').text(postInfo.count_comment_unique);
|
||||
posts[id].find('.pp-recommendation-count').text(postInfo.count_recommendation);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -925,12 +843,10 @@ function set_posts_count_label() {
|
|||
}
|
||||
|
||||
function parse_pleercom_links(current_options) {
|
||||
var regex = new RegExp('^https?:\\/\\/pleer\\.com\\/tracks\\/([0-9a-z]+)', 'i');
|
||||
|
||||
$('.post-content a').each(function(num, link) {
|
||||
var $link = $(link);
|
||||
var href = link.href;
|
||||
var matches = href.match(regex);
|
||||
var matches = href.match(new RegExp('^https?:\\/\\/pleer\\.com\\/tracks\\/([0-9a-z]+)', 'i'));
|
||||
|
||||
if (matches) {
|
||||
trackHref = 'http://embed.pleer.com/normal/track?id=' + matches[1] + '&t=grey';
|
||||
|
@ -947,11 +863,9 @@ function parse_pleercom_links(current_options) {
|
|||
}
|
||||
|
||||
// Проставляем теги у постов
|
||||
// @todo Переписать блокировку тегов и убрать подобное выставление тегов в виде классов
|
||||
// @hint В данный момент эта фича используются для NSFW, потом выборку по тегам можно будет использовать много где
|
||||
function create_tag_system() {
|
||||
$('.content-wrap').children('div.post').each(function() {
|
||||
// @todo refactor
|
||||
$('.content-wrap > .post').each(function() {
|
||||
var tags = $(this).find('div.tags a.tag');
|
||||
for (var i = 0; i < tags.length; i++) {
|
||||
var tag_name = $(tags[i]).html().toLowerCase();
|
||||
|
@ -974,7 +888,8 @@ function set_space_key_skip_handler() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (32 == event.keyCode) {
|
||||
var k = event.keyCode;
|
||||
if (k == 32) {
|
||||
space_key_event();
|
||||
return false;
|
||||
}
|
||||
|
@ -984,7 +899,7 @@ function set_space_key_skip_handler() {
|
|||
function space_key_event() {
|
||||
var scroll_current = Math.floor($('body').scrollTop());
|
||||
|
||||
var posts = $('.content-wrap > div.post');
|
||||
var posts = $('.content-wrap > .post');
|
||||
for (var i = 0; i < posts.length; i++) {
|
||||
var this_top_px = Math.floor(posts.eq(i).offset().top);
|
||||
if (this_top_px > scroll_current) {
|
||||
|
@ -1030,17 +945,13 @@ var draft_waiting = false;
|
|||
* Restore draft from localStorage
|
||||
*/
|
||||
function draft_restore() {
|
||||
var $post_form = $('#new-post-form');
|
||||
var $text_input = $post_form.find('#text-input');
|
||||
var $tags_input = $post_form.find('#tags-input');
|
||||
|
||||
chrome.storage.local.get(['point_draft_text', 'point_draft_tags'], function(items) {
|
||||
if ($text_input.val() === '') {
|
||||
$text_input.val(items.point_draft_text);
|
||||
if ($('#new-post-form #text-input').val() === '') {
|
||||
$('#new-post-form #text-input').val(items.point_draft_text);
|
||||
draft_last_text = items.point_draft_text;
|
||||
}
|
||||
if ($tags_input.val() === '') {
|
||||
$tags_input.val(items.point_draft_tags);
|
||||
if ($('#new-post-form #tags-input').val() === '') {
|
||||
$('#new-post-form #tags-input').val(items.point_draft_tags);
|
||||
draft_last_tags = items.point_draft_tags;
|
||||
}
|
||||
});
|
||||
|
@ -1059,7 +970,7 @@ function draft_set_save_handler() {
|
|||
}
|
||||
});
|
||||
// Adding span indicator
|
||||
$('#new-post-wrap').find('.footnote').append($('<span id="draft-save-status">'));
|
||||
$('#new-post-wrap .footnote').append($('<span id="draft-save-status">'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1076,10 +987,8 @@ function draft_save_check() {
|
|||
}
|
||||
}
|
||||
|
||||
var $post_form = $('#new-post-form');
|
||||
|
||||
var current_text = $post_form.find('#text-input').val();
|
||||
var current_tags = $post_form.find('#tags-input').val();
|
||||
var current_text = $('#new-post-form #text-input').val();
|
||||
var current_tags = $('#new-post-form #tags-input').val();
|
||||
|
||||
if ((draft_last_text === current_text) && (draft_last_tags === current_tags)) {
|
||||
draft_save_busy = false;
|
||||
|
@ -1114,38 +1023,95 @@ function draft_save_check() {
|
|||
|
||||
// Парсим ссылки на coub
|
||||
function parse_coub_links(current_options) {
|
||||
var regex = new RegExp('^https?:\\/\\/coub\\.com\\/view\\/([0-9a-z]+)', 'i');
|
||||
|
||||
$('.post-content a').each(function(num, obj) {
|
||||
var href = obj.href;
|
||||
var matches;
|
||||
var n = null;
|
||||
|
||||
if (matches = href.match(regex)) {
|
||||
if (n = href.match(new RegExp('^https?:\\/\\/coub\\.com\\/view\\/([0-9a-z]+)', 'i'))) {
|
||||
var player = document.createElement('iframe');
|
||||
var parent_width = $(obj.parentElement).width();
|
||||
$(player)
|
||||
.attr({
|
||||
'src': 'https://coub.com/embed/' + matches[1] + '?muted=false&autostart=false&originalSize=false&hideTopBar=false&startWithHD=true',
|
||||
$(player).attr({
|
||||
'src': 'https://coub.com/embed/' + n[1] + '?muted=false&autostart=false&originalSize=false&hideTopBar=false&startWithHD=true',
|
||||
'allowfullscreen': 'true'
|
||||
})
|
||||
.css({
|
||||
}).css({
|
||||
'max-width': '640px',
|
||||
'border': 'none',
|
||||
'width': Math.floor(parent_width * 0.9),
|
||||
'height': Math.ceil(parent_width * 0.9 * 480 / 640)
|
||||
})
|
||||
.addClass('pp-video-player-coub')
|
||||
.addClass('embeded_video')
|
||||
.addClass('embeded_video_' + matches[1])
|
||||
;
|
||||
}).addClass('embeded_video').addClass('embeded_video_' + n[1]);
|
||||
|
||||
obj.parentElement.insertBefore(player, obj);
|
||||
|
||||
if (current_options.is('option_embedding_remove_original_link')) {
|
||||
$(obj).remove();
|
||||
$(obj).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Правим хинт в FancyBox
|
||||
function fancybox_set_smart_hints(){
|
||||
$('.post').each(function() {
|
||||
var all_post_images = $(this).find('.postimg');
|
||||
if (all_post_images.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tags = $(this).find('div.tags a.tag');
|
||||
var default_hint_text = '';// Дефолтный текст для хинта в FancyBox, если не нашлость другого
|
||||
// Сначала теги
|
||||
for (var i = 0; i < tags.length; i++) {
|
||||
var tag_name = $(tags[i]).html().toLowerCase();
|
||||
default_hint_text += ' ' + tag_name;
|
||||
}
|
||||
|
||||
// Потом текст
|
||||
var textcontent = $(this).find('.text-content');
|
||||
if (textcontent.length > 0) {
|
||||
textcontent = textcontent[0];
|
||||
for (var i = 0; i < textcontent.childNodes.length; i++) {
|
||||
var current_child_node = textcontent.childNodes[i];
|
||||
if ((current_child_node.nodeName !== 'P') && (current_child_node.nodeName !== '#text')) {
|
||||
continue;
|
||||
}
|
||||
var a = $(current_child_node).find('a.postimg');
|
||||
if (a.length > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var tmp_str = current_child_node.textContent.replace(/(\n(\r)?)/g, ' ');
|
||||
tmp_str = tmp_str.replace("\t", " ");
|
||||
default_hint_text += ' ' + tmp_str;
|
||||
}
|
||||
}
|
||||
|
||||
// Режем текст
|
||||
default_hint_text = default_hint_text.replace(new RegExp(' {2,}'), ' ').replace(new RegExp(' +$'), '').substr(1);
|
||||
if (default_hint_text.length > 140) {
|
||||
default_hint_text = default_hint_text.substr(0, 140 - 3) + '...';
|
||||
}
|
||||
|
||||
// Выставляем дефолтный
|
||||
all_post_images.attr('data-fancybox-title', default_hint_text);
|
||||
|
||||
// А теперь перебираем по одному все картинки
|
||||
var paragraphs = $(this).find('.post-content > .text > p, .post-content > .text, .text-content > p, .text-content');
|
||||
|
||||
paragraphs.each(function() {
|
||||
var nodes = this.childNodes;
|
||||
for (var i = 0; i < nodes.length - 2; i++) {
|
||||
if ($(nodes[i]).hasClass('booru_pic')) {
|
||||
if (nodes[i + 2].nodeName == '#text') {
|
||||
$(nodes[i]).attr('data-fancybox-title', nodes[i + 2].textContent);
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Система заметок о пользователях
|
||||
* https://bitbucket.org/skobkin/chrome_point_plus/issue/50/---------------------------
|
||||
|
@ -1175,8 +1141,8 @@ function hints_draw_main_user_hint(items) {
|
|||
}
|
||||
|
||||
var current_user_hint_block = document.createElement('div');
|
||||
var $counters = $('.aside-content #counters');
|
||||
$counters[0].parentElement.insertBefore(current_user_hint_block, $counters[0]);
|
||||
$('.aside .aside-content #counters')[0].parentElement.
|
||||
insertBefore(current_user_hint_block, $('.aside .aside-content #counters')[0]);
|
||||
$(current_user_hint_block).addClass('current-user-hint');
|
||||
|
||||
// Рисуем кнопки управления
|
||||
|
@ -1236,19 +1202,17 @@ function safe_saned_text(text, object) {
|
|||
|
||||
// Рисуем title'ы на всех доступных пользователях, точнее на их аватарках
|
||||
function hints_set_titles_on_users(items) {
|
||||
var regex = new RegExp('^https?\\://([0-9a-z-]+)\\.point\\.im/$', 'i');
|
||||
|
||||
$('a').each(function() {
|
||||
var href = $(this).attr('href');
|
||||
if (typeof(href) == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var matches = href.match(regex);
|
||||
if (matches == null) {
|
||||
var n = href.match(new RegExp('^https?\\://([0-9a-z-]+)\\.point\\.im/$', 'i'));
|
||||
if (n == null) {
|
||||
return;
|
||||
}
|
||||
var this_user_name = matches[1].toLowerCase();
|
||||
var this_user_name = n[1].toLowerCase();
|
||||
if (typeof(items[this_user_name]) == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
@ -1272,15 +1236,11 @@ function hints_save_new_hint(username, new_hint) {
|
|||
*/
|
||||
function set_comments_refresh_tick(current_options) {
|
||||
// Проверяем, чтобы были баджи
|
||||
var $left_menu = $('#left-menu');
|
||||
var $menu_recent_posts = $left_menu.find('#menu-recent');
|
||||
var $menu_recent_comments = $left_menu.find('#menu-comments');
|
||||
|
||||
if ($menu_recent_posts.children('.unread').length == 0) {
|
||||
$menu_recent_posts.append('<span class="unread" style="display: none;">0</span>');
|
||||
if ($('#main #left-menu #menu-recent .unread').length == 0) {
|
||||
$('#main #left-menu #menu-recent').append('<span class="unread" style="display: none;">0</span>');
|
||||
}
|
||||
if ($menu_recent_comments.children('.unread').length == 0) {
|
||||
$menu_recent_comments.append('<span class="unread" style="display: none;">0</span>');
|
||||
if ($('#main #left-menu #menu-comments .unread').length == 0) {
|
||||
$('#main #left-menu #menu-comments').append('<span class="unread" style="display: none;">0</span>');
|
||||
}
|
||||
|
||||
// Ставим тик
|
||||
|
@ -1310,55 +1270,60 @@ var window_focused = true;
|
|||
|
||||
// Очищаем [0; 0]
|
||||
function set_comments_refresh_clear_title_marks() {
|
||||
document.title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
||||
var new_title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
||||
document.title = new_title;
|
||||
window_focused = true;
|
||||
}
|
||||
|
||||
// Проверка обновления комментариев, обновляется по крону
|
||||
function comments_count_refresh_tick(current_options) {
|
||||
$('#pp-iframe-unread-refresh').remove();
|
||||
|
||||
$('#debug_iframe').remove();
|
||||
var iframe = document.createElement('iframe');
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
$(iframe)
|
||||
.on('load', function() {
|
||||
$(iframe).on('load', function() {
|
||||
var a = $(iframe.contentDocument.body).find('#main #left-menu #menu-recent .unread');
|
||||
var b = $(iframe.contentDocument.body).find('#main #left-menu #menu-comments .unread');
|
||||
var count_recent = (a.length == 0) ? 0 : parseInt(a.text());
|
||||
var count_comments = (b.length == 0) ? 0 : parseInt(b.text());
|
||||
|
||||
console.log('Comments: %d, Recent: %d', count_comments, count_recent);
|
||||
|
||||
var $menu = $('#left-menu');
|
||||
var $menu_posts = $menu.children('#menu-recent');
|
||||
var $menu_posts_unread = $menu_posts.children('span.unread');
|
||||
var $menu_comments = $menu.children('#menu-comments');
|
||||
var $menu_comments_unread = $menu_comments.children('span.unread');
|
||||
|
||||
if (count_recent > 0) {
|
||||
if (parseInt($menu_posts_unread.text()) != count_recent) {
|
||||
$menu_posts_unread.text(count_recent).show().addClass('pp-left-menu-refreshed');
|
||||
if (parseInt($('#main #left-menu #menu-recent .unread').text()) != count_recent) {
|
||||
$('#main #left-menu #menu-recent .unread').text(count_recent).show().css({
|
||||
'background-color': '#f2ebee',
|
||||
'color': '#7c3558'
|
||||
});
|
||||
setTimeout(function() {
|
||||
$menu_posts_unread.removeClass('pp-left-menu-refreshed');
|
||||
$('#main #left-menu #menu-recent .unread').css({
|
||||
'background-color': '',
|
||||
'color': ''
|
||||
});
|
||||
}, 15000);
|
||||
}
|
||||
} else {
|
||||
$menu_posts_unread.text('0').hide();
|
||||
$('#main #left-menu #menu-recent .unread').text('0').hide();
|
||||
}
|
||||
|
||||
if (count_comments > 0) {
|
||||
if (parseInt($menu_comments_unread.text()) != count_comments) {
|
||||
$menu_comments_unread.text(count_comments).show().addClass('pp-left-menu-refreshed');
|
||||
if (parseInt($('#main #left-menu #menu-comments .unread').text()) != count_comments) {
|
||||
$('#main #left-menu #menu-comments .unread').text(count_comments).show().css({
|
||||
'background-color': '#f2ebee',
|
||||
'color': '#7c3558'
|
||||
});
|
||||
setTimeout(function() {
|
||||
$menu_comments_unread.removeClass('pp-left-menu-refreshed');
|
||||
$('#main #left-menu #menu-comments .unread').css({
|
||||
'background-color': '',
|
||||
'color': ''
|
||||
});
|
||||
}, 15000);
|
||||
}
|
||||
} else {
|
||||
$menu_comments_unread.text('0').hide();
|
||||
$('#main #left-menu #menu-comments .unread').text('0').hide();
|
||||
}
|
||||
|
||||
if ((current_options.is('option_other_comments_count_refresh_title')) && (!window_focused)) {
|
||||
if ((current_options.is('option_other_comments_count_refresh_title')) &&
|
||||
(!window_focused)) {
|
||||
var new_title = document.title.replace(new RegExp('^\\[[0-9]+\\; [0-9]+\\] '), '');
|
||||
if ((count_recent > 0) || (count_comments > 0)) {
|
||||
new_title = '[' + count_recent + '; ' + count_comments + '] ' + new_title;
|
||||
|
@ -1366,16 +1331,17 @@ function comments_count_refresh_tick(current_options) {
|
|||
document.title = new_title;
|
||||
}
|
||||
|
||||
$('#pp-iframe-unread-refresh').remove();
|
||||
})
|
||||
.attr({
|
||||
$('#debug_iframe').remove();
|
||||
}).attr({
|
||||
// Из-за Same Origin'а я дёргаю несуществующую страницу на том же домене, чтобы получить баджи и,
|
||||
// в то же время не прочитать новые сообщения в ленте, которые могли появиться, если их написал
|
||||
// этот пользователь
|
||||
'src': '//' + document.domain + '/?tag=' + Math.random(),
|
||||
'id': 'pp-iframe-unread-refresh'
|
||||
})
|
||||
;
|
||||
'id': 'debug_iframe'
|
||||
}).css({
|
||||
'width': '600px',
|
||||
'height': '300px'
|
||||
}).hide();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1424,15 +1390,13 @@ function twitter_tweet_embedding_wait_for_ready_injected() {
|
|||
* Парсим все ссылки. Эта функция запускается из page scope
|
||||
*/
|
||||
function twitter_tweet_embedding_parse_links() {
|
||||
var regex = new RegExp('^https?://(www\\.)?twitter\\.com/[^/]+/status/([0-9]+)', 'i');
|
||||
|
||||
// Обрабатываем все твиты
|
||||
var twitter_tweet_count = 0;
|
||||
$('.post-content a:not(.booru_pic)').each(function(num, obj) {
|
||||
var href = obj.href;
|
||||
var n;
|
||||
|
||||
if (n = href.match(regex)) {
|
||||
if (n = href.match(new RegExp('^https?://(www\\.)?twitter\\.com/[^/]+/status/([0-9]+)', 'i'))) {
|
||||
var tweet = document.createElement('div');
|
||||
$(tweet).attr({
|
||||
'id': 'tweet-' + twitter_tweet_count,
|
||||
|
@ -1483,10 +1447,11 @@ function instagram_posts_embedding_init(options) {
|
|||
id: 'instagram-' + num,
|
||||
href: 'http://instagram.com/p/' + matches[2] + '/media/?size=l',
|
||||
title: response.title,
|
||||
traget: '_blank',
|
||||
'data-fancybox-group': (options.is('option_fancybox_bind_images_to_one_flow')) ? 'one_flow_gallery' : '',
|
||||
'data-fancybox-title': (options.is('option_fancybox_smart_hints')) ? response.title : ''
|
||||
})
|
||||
.append($img)
|
||||
;
|
||||
.append($img);
|
||||
|
||||
$link.before($imgLink);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Point+",
|
||||
"version": "1.42.1",
|
||||
"version": "1.38.0",
|
||||
"default_locale": "ru",
|
||||
"author": "__MSG_ext_author__",
|
||||
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
|
||||
|
@ -27,7 +27,7 @@
|
|||
{
|
||||
"matches": ["http://*.point.im/*", "https://*.point.im/*"],
|
||||
"js": [
|
||||
"vendor/jquery/dist/jquery.min.js",
|
||||
"vendor/jquery/jquery.min.js",
|
||||
|
||||
"js/options-manager.js",
|
||||
"js/message-sender.js",
|
||||
|
|
|
@ -11,10 +11,10 @@ function Booru($links, options) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Base URL of gelbooru picture API (@NokitaKaze)
|
||||
* Откуда тянуть картинки
|
||||
* @type {String}
|
||||
*/
|
||||
Booru.baseUrl = 'https://evidell.xyz/get_booru_picture.php';
|
||||
Booru.baseUrl = 'https://api.kanaria.ru/point/get_booru_picture.php';
|
||||
|
||||
/* jshint maxlen:false */
|
||||
Booru.services = {
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<input type="checkbox" name="option-fancybox-bind-images-to-one-flow">
|
||||
<span data-i18n="option_fancybox_bind_images_to_one_flow"></span>
|
||||
</label>
|
||||
|
||||
<label class="option-node">
|
||||
<input type="checkbox" name="option-fancybox-smart-hints">
|
||||
<span data-i18n="option_fancybox_smart_hints"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="option-node">
|
||||
|
@ -150,16 +155,6 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="option-node">
|
||||
<input type="checkbox" name="option-right-panel" id="option-right-panel">
|
||||
<label for="option-right-panel" data-i18n="option_right_panel"></label>
|
||||
|
||||
<label class="option-node">
|
||||
<input type="checkbox" name="option-right-panel-to-unread">
|
||||
<span data-i18n="option_right_panel_to_unread"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="option-node">
|
||||
<input type="checkbox" name="option-fluid-layout">
|
||||
<span data-i18n="option_fluid_layout"></span>
|
||||
|
@ -237,11 +232,6 @@
|
|||
<span data-i18n="option_other_move_all_to_menu"></span>
|
||||
</label>
|
||||
|
||||
<label class="option-node">
|
||||
<input type="checkbox" name="option-other-remove-fucking-button">
|
||||
<span data-i18n="option_other_remove_fucking_button"></span>
|
||||
</label>
|
||||
|
||||
<label class="option-node">
|
||||
<input type="checkbox" name="option-other-post-draft-save">
|
||||
<span data-i18n="option_other_post_draft_save"></span>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
BROWSER_BINARY=$1
|
||||
PATH_EXTENSION=$2
|
||||
PATH_KEY=$3
|
||||
|
||||
echo "Packing extension using $BROWSER_BINARY and key from $PATH_KEY"
|
||||
#echo "$BROWSER_BINARY --pack-extension=$PATH_EXTENSION --pack-extension-key=$PATH_KEY"
|
||||
eval "$BROWSER_BINARY --pack-extension=$PATH_EXTENSION --pack-extension-key=$PATH_KEY"
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
zip -9 -r chrome_point_plus.zip chrome_point_plus
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chrome-point-plus",
|
||||
"version": "1.42.1",
|
||||
"version": "1.38.0",
|
||||
"description": "Chrome extension for point.im",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue