Allows you to mark new comments with one mouse movement.
Made versions for three browsers - Chrome, Opera and Firefox.
It is necessary to hold Shift and hold the mouse over the new comments - every comment that the mouse has passed over will be read.
You do not need to wait for a long time until the standard feature from Habra scrolls to each new comment.
Conveniently, if new comments are located close and you can see them all at once. One stroke of the mouse - and you're done.
')
If you hold down Ctrl-Shift, then all the children will also be dropped from the comment that was played with the mouse.
I did it for myself, but suddenly it would be useful for someone.
The code is very simple, done quickly on jquery.
that.$('.comment_item > .comment_body') .live('mouseover', function(event) { if (event.shiftKey) { var el = that.$(this); var root = !event.ctrlKey ? el : el.parent(); var info = root.find('.info.is_new'); if (info.length) { info.removeClass('is_new'); var xpanel_new = that.$('#xpanel .new'); var n = xpanel_new.html()|0; n -= info.length; if (n < 0) { n = 0; } xpanel_new.html(n); if (!n) { xpanel_new.hide(); } else { xpanel_new.show(); } } } })
For Firefox done on the jetpack engine, the code to run the content script:
exports.main = function(options, callbacks) { var data = require("sdk/self").data; require("sdk/page-mod").PageMod({ include: "*.habrahabr.ru", attachTo: ["existing", "top", "frame"], contentScriptFile : [ data.url("includes/jquery-1.8.0.min.js"), data.url("includes/content.js") ], contentScriptWhen : 'end' }); };
For the old Opera (up to 15) to run the content-script, you need to put the scripts in the
/ includes folder