📜 ⬆️ ⬇️

Finalization of the Karma Quick Show script (FF, Chrome, Opera)

The script published yesterday for showing KarmaPischyk (by Atilla ) had one flaw that did not allow it to be used on parts of the pages, namely, on pages with domains of the 3rd level (personal blogs). Not so much the script itself turned out to be interesting, although the solution is useful, thanks to the author for it (I almost did not change anything in the design and behavior of it), but a solution to the issue of cross-domain scripting. The request to the API goes to the domain of the 2nd level, and the script - at the 3rd level. As a result, I had to completely abandon the use of XMLHttp to the API and make an appeal to the frame - the ancient “frame AJAX”.

I would formulate the purpose of this script differently than the author. Not to “reduce the objectivity of the assessment”, but to improve the effect on karma, depending on its value. For example, if karma is in a dangerous range near zero, then each change has a strong effect on the ability to publish. Sometimes you need to keep from changing, and for this you do not have to go to the user’s page. For this reason, I arranged 3 colors in such ranges: to -6, from -5 to +9 and from +10 and higher.



Added response delay. If the mouse was above the user's nickname less than 300 ms, data loading does not occur. Added a rating view in the title hint. By targeting yourself near the comment, their karma and rating are also shown. Made without memorizing the karma of different authors, so the data is not loaded only when re-showing the same author.

The script conflicts with another script, HabraKarma (author: fedor.indutny) for Chrome, so you need to enable them separately through the chrome window: // extensions /.
')
Tested in Chrome 4 and FF 3.6 + GreaseMonkey.
I do not post it on the official pages - perhaps the author himself will further refine the script and publish it.

Download:
For FF + GreaseMonkey, for Chrome: HabraKarmaView.user.js, version 1.1, 3.8 KB (below - the newer version!).

Opera is incomplete (in reading data from the frame), Safari was not checked (if it is capable, then only for Mac, since GreaseKit only works on Macs).


Today, 23.15. Finalization of the script .
1. Removed blinking and disappearing prompts due to more complex organization of the hanging block.
2. Added feature - constant hanging of the block with karma, if you click on it. Constantly hanging blocks are no longer loaded every time. The mode of constant hovering is removed if you click on the pointer (block with karma) again (the pointer of the hand changes to an arrow).
3. The colors are made paler and calmer, the rounded corners of the blocks are in accordance with the overall design.

Now it looks like this (FF; the lower block was clicked and is in the permanent display mode):

Of the minuses: the site with regular viewing of karma from time to time (every few hours) begins to wonder if I am a robot and require authorization and a captcha pass. (Watch karma without authorization does not interfere.)

26 March. Opera began to work. Its access mechanism to XML turned out to be a little different - something could not read, but something could write. As a result, the same actions without loss of functionality. Added the "+" and "-" buttons.

FF + GreaseMonkey, Chrome3 +, Opera 10+ : HabraKarmaViewPlus.user.js, version 1.3 , 5.7 KB

Source: https://habr.com/ru/post/88727/


All Articles