diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index c02fc7f..bdd9829 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -22,6 +22,9 @@ function PointPlus(ppVersion) { console.group('point-plus'); console.info('Point+ %s', ppVersion); + // Getting username + var point_username = $('#name h1').text(); + // Проверяем, загрузились ли мы var point_plus_debug = $('#point-plus-debug'); if (point_plus_debug.length > 0) { @@ -397,7 +400,7 @@ function PointPlus(ppVersion) { console.groupEnd(); break; } - + // Generating comment from websocket message create_comment_elements({ id: (wsMessage.a === 'ok') ? wsMessage.rcid : wsMessage.comment_id, @@ -406,7 +409,8 @@ function PointPlus(ppVersion) { author: wsMessage.author, text: wsMessage.text, fadeOut: options.is('option_ws_comments_color_fadeout'), - isRec: (wsMessage.a === 'ok') ? true : false + 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'); @@ -584,6 +588,7 @@ var months = [ * @param {string} commentData.text Text of the comment * @param {boolean} commentData.fadeOut Is fadeout enabled or not * @param {boolean|null} commentData.isRec Is comment also a recommendation + * @param {boolean} commentData.unread Is comment unread * @param {function} onCommentCreated Callback which is called when comment is ready * */ @@ -592,7 +597,7 @@ function create_comment_elements(commentData, onCommentCreated) { // Initializing comment element var $commentTemplate = $('