diff --git a/chrome_point_plus/_locales/en/messages.json b/chrome_point_plus/_locales/en/messages.json index a091bfc..f896da8 100644 --- a/chrome_point_plus/_locales/en/messages.json +++ b/chrome_point_plus/_locales/en/messages.json @@ -159,6 +159,9 @@ "option_other_comments_nesting_level":{ "message": "Comments Nesting level indicator" }, + "option_other_comments_user_system":{ + "message": "Your hints about users" + }, "option_other_comments_count_refresh":{ "message": "Refresh unread posts and comments count in left menu" }, diff --git a/chrome_point_plus/_locales/ru/messages.json b/chrome_point_plus/_locales/ru/messages.json index ddb1612..edad6f4 100644 --- a/chrome_point_plus/_locales/ru/messages.json +++ b/chrome_point_plus/_locales/ru/messages.json @@ -159,6 +159,9 @@ "option_other_comments_nesting_level":{ "message": "Индикатор уровня вложенности коммнентариев" }, + "option_other_comments_user_system":{ + "message": "Заметки о пользователях на полях" + }, "option_other_comments_count_refresh":{ "message": "Обновляем количество непрочитанных комментариев и постов в ленте" }, diff --git a/chrome_point_plus/css/point-plus.css b/chrome_point_plus/css/point-plus.css index 5c214cf..4491680 100644 --- a/chrome_point_plus/css/point-plus.css +++ b/chrome_point_plus/css/point-plus.css @@ -295,5 +295,5 @@ div#markItUpText-input { #comments .post:hover .nesting { background-repeat: repeat-x; - background-image: url('chrome-extension://__MSG_@@extension_id__/images/habra-point.png'); + background-image: url('chrome-extension://__MSG_@@extension_id__/images/nesting-point.png'); } \ No newline at end of file diff --git a/chrome_point_plus/images/habra-point.png b/chrome_point_plus/images/nesting-point.png similarity index 52% rename from chrome_point_plus/images/habra-point.png rename to chrome_point_plus/images/nesting-point.png index 4de06aa..d58b653 100644 Binary files a/chrome_point_plus/images/habra-point.png and b/chrome_point_plus/images/nesting-point.png differ diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index 72d9935..571ac8c 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -108,7 +108,7 @@ $(document).ready(function() { $('.post-content .text').each(function() { $(this).find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'one_flow_gallery'); }); - }else{ + } else { $('.post-content .text').each(function(idxPost) { $(this).find('a.postimg:not(.youtube)').attr('data-fancybox-group', 'post' + idxPost); }); @@ -158,7 +158,7 @@ $(document).ready(function() { if (options.option_nsfw_hide_posts.value == true) { if ($('#comments').length == 0) { - console.log('Hide NSFW posts in feed, '+$('.post').length+' hidden'); + console.log('Hide NSFW posts in feed, %i hidden', $('.post').length); $('.post').addClass('hide-nsfw-posts'); } } @@ -498,7 +498,9 @@ $(document).ready(function() { } // Система комментариев у пользователей - hints_init_user_system(); + if (options.option_other_comments_user_system.value == true) { + hints_init_user_system(); + } // Nesting level indicator if (options.option_other_comments_nesting_level.value == true) { @@ -926,7 +928,7 @@ function space_key_event() { var draft_last_text = ''; // Последний зафиксированный текст // Восстанавливаем черновик function draft_restore() { - chrome.storage.local.get('point_draft_text', function (items) { + 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; @@ -1053,10 +1055,10 @@ function fancybox_set_smart_hints(){ */ // Инициализируем function hints_init_user_system() { - chrome.storage.sync.get('point_user_hints', function (items) { + chrome.storage.sync.get('point_user_hints', function(items) { if (typeof(items.point_user_hints) == 'undefined') { // Первый запуск системы - chrome.storage.sync.set({'point_user_hints': {}}, function () { + chrome.storage.sync.set({'point_user_hints': {}}, function() { hints_draw_main_user_hint({}); hints_set_titles_on_users({}); }); @@ -1071,7 +1073,7 @@ function hints_init_user_system() { // Рисуем хинт и кнопку под текущим пользователем function hints_draw_main_user_hint(items) { var current_user_name = $('.aside .info h1').text().toLowerCase(); - if (current_user_name.length == '') { + if (current_user_name.length == 0) { return; } @@ -1085,8 +1087,8 @@ function hints_draw_main_user_hint(items) { $(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) { + $(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]; @@ -1111,13 +1113,13 @@ function hints_draw_main_user_hint(items) { $(change_hint_block).addClass('change_hint_block').hide(). html('' + 'Отмена'); - $(change_hint_block).find('.button_save').on('click', function () { + $(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 () { + $(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); @@ -1137,7 +1139,7 @@ function hints_raw_text_to_html(text) { // Рисуем title'ы на всех доступных пользователях, точнее на их аватарках function hints_set_titles_on_users(items) { - $('a').each(function () { + $('a').each(function() { var href = $(this).attr('href'); if (typeof(href) == 'undefined') { return; @@ -1160,7 +1162,7 @@ function hints_set_titles_on_users(items) { // Сохраняем новый хинт function hints_save_new_hint(username, new_hint) { - chrome.storage.sync.get('point_user_hints', function (items) { + 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}); }); @@ -1176,7 +1178,7 @@ function draw_nesting_level_indicator() { } function draw_nesting_level_indicator_level(obj, level) { - obj.find('> .post').each(function () { + obj.find('> .post').each(function() { var nesting = document.createElement('div'); $(nesting).addClass('nesting').css({ 'width': (10 * level) + 'px' @@ -1188,7 +1190,7 @@ function draw_nesting_level_indicator_level(obj, level) { }); }); - obj.each(function () { + obj.each(function() { var comments = $(this).find('> .comments'); if (comments.length > 0) { draw_nesting_level_indicator_level(comments, level + 1); @@ -1218,20 +1220,20 @@ function comments_count_refresh_tick() { 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: ' + count_comments + ', Recent: ' + count_recent); + console.log('Comments: %d, Recent: %d', count_comments, count_recent); if (count_recent > 0) { 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 () { + setTimeout(function() { $('#main #left-menu #menu-recent .unread').css({ 'background-color': '#ebeef2', 'color': '#35587c' @@ -1248,7 +1250,7 @@ function comments_count_refresh_tick() { 'background-color': '#f2ebee', 'color': '#7c3558' }); - setTimeout(function () { + setTimeout(function() { $('#main #left-menu #menu-comments .unread').css({ 'background-color': '#ebeef2', 'color': '#35587c' @@ -1264,7 +1266,7 @@ function comments_count_refresh_tick() { // Из-за Same Origin'а я дёргаю несуществующую страницу на том же домене, чтобы получить баджи и, // в то же время не прочитать новые сообщения в ленте, которые могли появиться, если их написал // этот пользователь - 'src': 'https://' + document.domain + '/?tag=' + Math.random(), + 'src': '//' + document.domain + '/?tag=' + Math.random(), 'id': 'debug_iframe' }).css({ 'width': '600px', diff --git a/chrome_point_plus/manifest.json b/chrome_point_plus/manifest.json index 0c41533..21a2e5f 100644 --- a/chrome_point_plus/manifest.json +++ b/chrome_point_plus/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Point+", - "version": "1.18.2", + "version": "1.18.3", "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 d0045d1..8c89edb 100644 --- a/chrome_point_plus/options.html +++ b/chrome_point_plus/options.html @@ -178,6 +178,10 @@
+ +
+ +