Finalization of the script for quick display of karma (FF, Chrome, Opera)

    The KarmaPischik script for showing karma published by Atilla yesterday had one flaw that prevented it from being used on part of the pages, namely, on pages with third-level domains (personal blogs). It turned out to be interesting not so much the script itself, although the solution is useful, thanks to the author for it (I almost did not change anything in the design and behavior), but the solution to the cross-domain scripting issue. The request to the API goes to the 2nd level domain, and the script goes to the 3rd level. As a result, we had to completely abandon the application of XMLHttp to the API and make a call to the frame - the ancient "frame AJAX".

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



    Added delayed response. If the mouse was above the user's nickname for less than 300 ms, data loading does not occur. Added a rating view to the title tooltip. By hovering over a comment, your karma and rating are also shown. Made without remembering the karma of different authors, therefore, data is not loaded only when the same author is shown again.

    The script conflicts with another script, HabraKarma (author: fedor.indutny) for Chrome, so you need to enable them individually through the chrome: // extensions / window.

    Tested in Chrome 4 and FF 3.6 + GreaseMonkey.
    I don’t post it on official pages - perhaps the author himself will finalize the script further and publish it.

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

    The opera is incomplete (in reading data from the frame), Safari was not tested (if it is, then only for Mac, because GreaseKit works only on Macs).


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

    Now it looks like this (FF; the lower block has been clicked and is in constant display mode):

    Of the minuses: the site, when regularly viewing karma periodically (every few hours), begins to wonder if I’m a robot and require authorization and the passage of captcha. (Watching karma without authorization does not stop.)

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

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

    Also popular now: