From fbe0b698c246eeaed1c63a66d6067b47d002010b Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 09:15:14 +0300 Subject: [PATCH 01/22] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=BC=D0=B0=D0=B6=D0=BE=D1=80=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=B1=D0=B0=D0=B3,=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0?= =?UTF-8?q?=20=D1=87=D0=B5=D1=80=D0=BD=D0=BE=D0=B2=D0=B8=D0=BA=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=B0=D0=BB=D1=81=D1=8F=20=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D1=80=D1=8B=D0=BC=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=D0=BC,=20=D0=B5=D1=81=D0=BB=D0=B8=20Point+=20?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=B7=D0=B8=D0=BB=D1=81=D1=8F=20=D1=81=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BA=D0=BE=D0=BC=20=D0=B4=D0=BE=D0=BB=D0=B3=D0=BE?= =?UTF-8?q?=20https://bitbucket.org/skobkin/chrome=5Fpoint=5Fplus/issue/36?= =?UTF-8?q?/--------------?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/js/point-plus.js | 14 ++++++++++---- chrome_point_plus/manifest.json | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index 9b103b2..f37114c 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -981,19 +981,25 @@ function space_key_event() { /* Автосохранение черновиков */ var draft_last_text = ''; // Последний зафиксированный текст +// Восстанавливаем черновик function draft_restore() { - chrome.storage.local.get('point_draft_text', function(items) { - $('#new-post-form #text-input').val(items.point_draft_text); - draft_last_text = items.point_draft_text; + chrome.storage.local.get('point_draft_text', function (items) { + if ($('#new-post-form #text-input').val() == '') { + $('#new-post-form #text-input').val(items.point_draft_text); + draft_last_text = items.point_draft_text; + } }); } +// Установка хандлера function draft_set_save_handler() { + // @hint Не буду я сажать на ивенты, обосрись setInterval(draft_save_check, 5000); - $('#new-post-wrap .footnote').append($('
')); + $('#new-post-wrap .footnote').append($('')); } var draft_save_busy = false; +// Фукнция, дёргающаяся по крону function draft_save_check() { if (draft_save_busy) { return; diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 4bb9aa8..69ac6e2 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.17.3", + "version": "1.17.4", "default_locale": "ru", "author": "__MSG_ext_author__", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", From 6777d8b2412bc328d995640ba2b38f7fdaa0ecb2 Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 09:45:36 +0300 Subject: [PATCH 02/22] =?UTF-8?q?https://bitbucket.org/skobkin/chrome=5Fpo?= =?UTF-8?q?int=5Fplus/issue/47/fancybox=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0?= =?UTF-8?q?=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/_locales/en/messages.json | 3 + chrome_point_plus/_locales/ru/messages.json | 3 + chrome_point_plus/js/point-plus.js | 106 +++++++++++--------- chrome_point_plus/manifest.json | 2 +- chrome_point_plus/options.html | 4 + 5 files changed, 68 insertions(+), 50 deletions(-) diff --git a/chrome_point_plus/_locales/en/messages.json b/chrome_point_plus/_locales/en/messages.json index 2da5306..46823c9 100644 --- a/chrome_point_plus/_locales/en/messages.json +++ b/chrome_point_plus/_locales/en/messages.json @@ -47,6 +47,9 @@ "option_fancybox_bind_images_to_one_flow": { "message": "Bind all images from fancybox to one flow" }, + "option_fancybox_smart_hints": { + "message": "Smart hints for images in fancybox gallery" + }, "option_images_load_original": { "message": "Load original images instead of thumbnails" }, diff --git a/chrome_point_plus/_locales/ru/messages.json b/chrome_point_plus/_locales/ru/messages.json index 3ba0d68..7b8c795 100644 --- a/chrome_point_plus/_locales/ru/messages.json +++ b/chrome_point_plus/_locales/ru/messages.json @@ -47,6 +47,9 @@ "option_fancybox_bind_images_to_one_flow": { "message": "Связать все картинки в одну галерею" }, + "option_fancybox_smart_hints": { + "message": "Включить умные описания для картинок при скроллинге галереи" + }, "option_images_load_original": { "message": "Загружать оригиналы вместо миниатюр" }, diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index f37114c..57d8df0 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -108,64 +108,26 @@ $(document).ready(function() { $('.post-content .text').each(function() { $(this).find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'one_flow_gallery'); }); + }else{ + $('.post-content .text').each(function(idxPost) { + $(this).find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'post' + idxPost); + }); } // Images if (options.option_fancybox_images.value == true) { - if (options.option_fancybox_bind_images_to_one_flow.value !== true) { - // Linking images in posts to the galleries - $('.post-content .text').each(function(idxPost) { - $(this).find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'post' + idxPost); - }); - } // Init fancybox $('.postimg:not(.youtube)').fancybox({ type: 'image' }); } - // Правим хинт в FancyBox - $('.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 hint_text = '';// Текст для хинта в FancyBox - // Сначала теги - for (var i = 0; i < tags.length; i++) { - var tag_name = $(tags[i]).html().toLowerCase(); - 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", " "); - hint_text += ' ' + tmp_str; - } - } - - // Режем - hint_text = hint_text.replace(new RegExp(' {2,}'), ' ').replace(new RegExp(' +$'), '').substr(1); - if (hint_text.length > 140) { - hint_text = hint_text.substr(0, 140 - 3) + '...'; - } - - all_post_images.attr('data-fancybox-title', hint_text); - }); + // Правим хинты у фансибокса + if (options.option_fancybox_smart_hints.value == true) { + fancybox_set_smart_hints(); + } else { + $('.post .postimg').attr('data-fancybox-title', ' '); + } // Videos if (options.option_fancybox_videos.value == true) { @@ -675,7 +637,7 @@ function parse_webm(current_options) { if (n = href.match(new RegExp('\\.webm(\\?.+)?$', 'i'))) { var player = document.createElement('video'); - // @todo Там может быть не vp8+vorbis + // Там может быть не vp8+vorbis, но мы этого никак не узнаем $(player).html('').attr('controls', 'controls').css({ 'display': 'block', 'max-width': '95%' @@ -1055,3 +1017,49 @@ function parse_coub_links(current_options) { } }); } + +// Правим хинт в 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 hint_text = '';// Текст для хинта в FancyBox + // Сначала теги + for (var i = 0; i < tags.length; i++) { + var tag_name = $(tags[i]).html().toLowerCase(); + 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", " "); + hint_text += ' ' + tmp_str; + } + } + + // Режем + hint_text = hint_text.replace(new RegExp(' {2,}'), ' ').replace(new RegExp(' +$'), '').substr(1); + if (hint_text.length > 140) { + hint_text = hint_text.substr(0, 140 - 3) + '...'; + } + + all_post_images.attr('data-fancybox-title', hint_text); + }); +} diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 69ac6e2..bda5e8d 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.17.4", + "version": "1.18.0", "default_locale": "ru", "author": "__MSG_ext_author__", "homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus", diff --git a/chrome_point_plus/options.html b/chrome_point_plus/options.html index aa4f4c9..e17e065 100644 --- a/chrome_point_plus/options.html +++ b/chrome_point_plus/options.html @@ -36,6 +36,10 @@
+ +
+ +
From 8d368ab4a68846decac079c5e4abc687b8f747af Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 10:05:29 +0300 Subject: [PATCH 03/22] =?UTF-8?q?*=20=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20*=20=D0=A1=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B0=D0=BB=202px=20=D0=BF=D0=B0=D0=B4=D0=B4=D0=B8?= =?UTF-8?q?=D0=BD=D0=B3=20=D1=81=D0=BB=D0=B5=D0=B2=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D1=81=D1=82=D0=BE=D0=B2,=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D0=BC=D1=83=20=D1=87=D1=82=D0=BE=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=B3=D0=B4=D0=B0=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8F=20"mark=20unread=20post?= =?UTF-8?q?s",=20=D0=B0=D0=B2=D0=B0=D1=82=D0=B0=D1=80=20=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D0=B7=D0=B8=D1=82=20=D0=BD=D0=B0=20=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=B4=D1=8E=D1=80=20=D0=B8=20=D1=81=D1=82=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=81=D1=8F=20=D0=9D=D0=95=D0=9A=D0=A0=D0=90?= =?UTF-8?q?=D0=A1=D0=98=D0=92=D0=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/js/point-plus.js | 38 +++--------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index 57d8df0..b102784 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -612,7 +612,7 @@ function create_image(domain, id, additional) { // Помечаем непрочитанные посты более видимо чем каким-то баджем // Эта часть написана @RainbowSpike function mark_unread_post() { - var divs = $(".post"); // массив постов + var divs = $(".post").css({'padding-left':'2px'}); // массив постов for (var i = 0; i < divs.length; i++) { // обыск постов var spans = $(divs[i]).find(".unread"); // поиск метки непрочитанных комментов if (spans.length > 0) { // если в посте есть непрочитанные комменты... @@ -859,39 +859,7 @@ function create_pleercom_ajax(id, current_options) { } // Проставляем теги у постов -function create_tag_system() { - $('.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(); - $(this).addClass('post-tag-' + tag_name); - } - }); -} - -// Скролл по пробелу -function set_space_key_skip_handler() { - if ($('#comments').length > 0) { - return; - } - - // @todo Свериться с Best-practice биндинга функций. Мб там on или bind - $(document.body).keydown(function(e) { - // @todo Я хотел по отпусканию кнопки, но там уже скролл срабатывает - // проверяем фокус - if ($(':focus').length > 0) { - return; - } - - var k = event.keyCode; - if (k == 32){ - space_key_event(); - return false; - } - }); -} - -// Проставляем теги у постов +// @hint В данный момент эта фича используются для NSFW, потом выборку по тегам можно будет использовать много где function create_tag_system() { $('.post').each(function() { var tags = $(this).find('div.tags a.tag'); @@ -961,7 +929,7 @@ function draft_set_save_handler() { } var draft_save_busy = false; -// Фукнция, дёргающаяся по крону +// Фукнция, дёргающаяся по крону, проверяющая надо ли сохранять черновик function draft_save_check() { if (draft_save_busy) { return; From 6110aa6785f2d87e0f7dadcc6128b75013b85550 Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 11:42:48 +0300 Subject: [PATCH 04/22] =?UTF-8?q?+=20=D0=A1=D0=B8=D1=81=D1=82=D0=B5=D0=BC?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D1=81=D0=BA=D0=B8=D1=85=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B5=D0=B2=20=D0=BA?= =?UTF-8?q?=20=D0=B4=D1=80=D1=83=D0=B3=D0=B8=D0=BC=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=D0=BC=20?= =?UTF-8?q?https://bitbucket.org/skobkin/chrome=5Fpoint=5Fplus/issue/50/--?= =?UTF-8?q?-------------------------?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/css/point-plus.css | 52 +++++++++++- chrome_point_plus/js/point-plus.js | 118 +++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 1 deletion(-) diff --git a/chrome_point_plus/css/point-plus.css b/chrome_point_plus/css/point-plus.css index 177851a..db76034 100644 --- a/chrome_point_plus/css/point-plus.css +++ b/chrome_point_plus/css/point-plus.css @@ -235,4 +235,54 @@ div#markItUpText-input { display: block; color: rgba(255,255,255,.75); padding: 10px 0px; -} \ No newline at end of file +} + +/* User hints */ +.current-user-hint{ + min-height: 30px; + position: relative; +} + +.current-user-hint .edit { + position: absolute; + right: 5px; + top: 5px; + display: none; + background-image: url("//point.im/img/btn-edit.png"); + background-size: 100% 100%; + width: 16px; + height: 16px; +} + +.current-user-hint:hover .edit { + display: block; +} + +.current-user-hint > .text{ + margin: 1em 0; + color: green; + font-style: italic; +} + +.aside .aside-content #counters{ + clear: both; +} + +.current-user-hint .change_hint_block{ + +} + +.current-user-hint .change_hint_block textarea{ + width: 98%; + max-width: 98%; + margin-bottom: 10px; + height: 140px; +} + +.current-user-hint .change_hint_block .button_save{ + margin-right: 10px; +} + +.current-user-hint .change_hint_block .button_cancel{ + +} diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index b102784..5b42fe5 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -497,6 +497,9 @@ $(document).ready(function() { set_space_key_skip_handler(); } + // Система комментариев у пользователей + hints_init_user_system(); + $('#point-plus-debug').fadeOut(1000); }); }); @@ -1031,3 +1034,118 @@ function fancybox_set_smart_hints(){ all_post_images.attr('data-fancybox-title', hint_text); }); } + +/** + * Система заметок о пользователях + * https://bitbucket.org/skobkin/chrome_point_plus/issue/50/--------------------------- + */ +// Инициализируем +function hints_init_user_system() { + chrome.storage.sync.get('point_user_hints', function (items) { + if (typeof(items.point_user_hints) == 'undefined') { + // Первый запуск системы + chrome.storage.sync.set({'point_user_hints': {}}, function () { + hints_draw_main_user_hint({}); + hints_set_titles_on_users({}); + }); + } else { + // Второй+ запуск системы + hints_draw_main_user_hint(items.point_user_hints); + hints_set_titles_on_users(items.point_user_hints); + } + }); +} + +// Рисуем хинт и кнопку под текущим пользователем +function hints_draw_main_user_hint(items) { + var current_user_name = $('.aside .info h1').text().toLowerCase(); + if (current_user_name.length == '') { + return; + } + + var current_user_hint_block = document.createElement('div'); + $('.aside .aside-content #counters')[0].parentElement. + insertBefore(current_user_hint_block, $('.aside .aside-content #counters')[0]); + $(current_user_hint_block).addClass('current-user-hint'); + + // Рисуем кнопки управления + var buttons_block = document.createElement('div'); + $(buttons_block).addClass('buttons'). + html(''); + current_user_hint_block.appendChild(buttons_block); + $(buttons_block).find('.edit').on('click', function () { + chrome.storage.sync.get('point_user_hints', function (items) { + var current_text = ''; + if (typeof(items.point_user_hints[current_user_name]) !== 'undefined') { + current_text = items.point_user_hints[current_user_name]; + } + + $('.current-user-hint .change_hint_block').slideDown(500); + $('.current-user-hint .change_hint_block textarea').val(current_text); + }); + }); + + // Рисуем текст + var current_text = ''; + if (typeof(items[current_user_name]) !== 'undefined') { + current_text = items[current_user_name]; + } + var text_block = document.createElement('div'); + $(text_block).addClass('text').html(hints_raw_text_to_html(current_text)); + current_user_hint_block.appendChild(text_block); + + // Рисуем невидимый блок для управления + var change_hint_block = document.createElement('div'); + $(change_hint_block).addClass('change_hint_block').hide(). + html('' + + 'Отмена'); + $(change_hint_block).find('.button_save').on('click', function () { + $('.current-user-hint .change_hint_block').slideUp(500); + var new_text = $('.current-user-hint .change_hint_block textarea').val(); + $('.current-user-hint > .text').hide().html(hints_raw_text_to_html(new_text)).fadeIn(750); + hints_save_new_hint(current_user_name, new_text); + }); + $(change_hint_block).find('.button_cancel').on('click', function () { + $('.current-user-hint .change_hint_block').slideUp(500); + }); + current_user_hint_block.appendChild(change_hint_block); +} + +// Превращаем сырой текст в нормальный, обёрнутый в p +function hints_raw_text_to_html(text) { + // @todo проверить как работает + text = text + .replace('&', "&") + .replace('<', "<") + .replace('>', ">") + .replace('"', """) + .replace("'", "'") + .replace(/\r?\n/g, "

") + return '

' + text + '

'; +} + +// Рисуем title'ы на всех доступных пользователях, точнее на их аватарках +function hints_set_titles_on_users(items) { + $('a').each(function () { + var n = $(this).attr('href').match(new RegExp('^https?\\://([0-9a-z-]+)\\.point\\.im/$')); + if (n == null) { + return; + } + var this_user_name = n[1].toLowerCase(); + if (typeof(items[this_user_name]) == 'undefined') { + return; + } + + $(this).attr({ + 'title': items[this_user_name] + }); + }); +} + +// Сохраняем новый хинт +function hints_save_new_hint(username, new_hint) { + chrome.storage.sync.get('point_user_hints', function (items) { + items.point_user_hints[username] = new_hint; + chrome.storage.sync.set({'point_user_hints': items.point_user_hints}); + }); +} From b41b20e5ebb3ede804996962567d6f539754853e Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 12:14:29 +0300 Subject: [PATCH 05/22] =?UTF-8?q?*=20https://bitbucket.org/skobkin/chrome?= =?UTF-8?q?=5Fpoint=5Fplus/issue/36/--------------=20=D0=A7=D0=B5=D1=80?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B8=D0=BA=20=D1=81=D0=BE=D1=85=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D1=87=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B7=20keyup,=20=D0=B0=20=D0=BD=D0=B5=20=D0=BF=D0=BE=20=D0=BA?= =?UTF-8?q?=D1=80=D0=BE=D0=BD=D1=83=20*=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B2=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=82=D0=BA=D0=B0?= =?UTF-8?q?=D1=85,=20=D1=83=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B6=D0=B5=D1=82=20=D0=BD=D0=B5=20=D0=B1=D1=8B?= =?UTF-8?q?=D1=82=D1=8C=20href'=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/js/point-plus.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index 5b42fe5..4fb381d 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -926,8 +926,10 @@ function draft_restore() { // Установка хандлера function draft_set_save_handler() { - // @hint Не буду я сажать на ивенты, обосрись - setInterval(draft_save_check, 5000); + // Господи, прости меня грешного за эту строку. Меня вынудили + $('#text-input').on('keyup', function(){ + draft_save_check(); + }); $('#new-post-wrap .footnote').append($('')); } @@ -1127,7 +1129,12 @@ function hints_raw_text_to_html(text) { // Рисуем title'ы на всех доступных пользователях, точнее на их аватарках function hints_set_titles_on_users(items) { $('a').each(function () { - var n = $(this).attr('href').match(new RegExp('^https?\\://([0-9a-z-]+)\\.point\\.im/$')); + var href = $(this).attr('href'); + if (typeof(href) == 'undefined') { + return; + } + + var n = href.match(new RegExp('^https?\\://([0-9a-z-]+)\\.point\\.im/$')); if (n == null) { return; } From c46b58fb0e2abd023bdda70c3c85a2ee10b87775 Mon Sep 17 00:00:00 2001 From: Nokita Kaze Date: Fri, 26 Dec 2014 13:14:21 +0300 Subject: [PATCH 06/22] + Nesting-level https://bitbucket.org/skobkin/chrome_point_plus/issue/16/nesting-level-indicator --- chrome_point_plus/_locales/en/messages.json | 5 +- chrome_point_plus/_locales/ru/messages.json | 3 ++ chrome_point_plus/css/point-plus.css | 11 +++++ chrome_point_plus/images/habra-point.png | Bin 0 -> 593 bytes chrome_point_plus/js/point-plus.js | 51 +++++++++++++++++--- chrome_point_plus/options.html | 4 ++ 6 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 chrome_point_plus/images/habra-point.png diff --git a/chrome_point_plus/_locales/en/messages.json b/chrome_point_plus/_locales/en/messages.json index 46823c9..c1771f4 100644 --- a/chrome_point_plus/_locales/en/messages.json +++ b/chrome_point_plus/_locales/en/messages.json @@ -156,7 +156,10 @@ "option_other_scroll_space_key":{ "message": "Scrolling posts with `space` key" }, - + "option_other_comments_nesting_level":{ + "message": "Comments Nesting level indicator" + }, + "options_feedback_text": { "message": "

If you find an error do not hesitate to send me a bug report<\/a>.<\/p>

Also you can make a donation in the following ways:<\/p>