Editing your article on Habré through highlighting quotes in HabrAjax; Iceweasel support

    In the HabrAjax script (113.2013.04.20), convenient editing of corrections in own articles has been added. Simply select a unique section of text and select a button among the context buttons. In the half-height frame, an input field opens with the selection in the exact place that was selected.

    Also, support for Iceweasel browsers (based on Fx3.6) in Debian was provided and support for Firefox 3.6 was returned in other OSs (but there will be a problem installing the old version of Greasemonkey relevant for 3.6). The potential audience is 1% of the rest of Firefox users.

    HabrAjax user audience and article focus


    The average number of script users is 40-60 people. Therefore, if an article is read by 3,000 people, then it can be of practical interest only to 1.5% of readers. Let another 10% have a desire to try the script. But not more. Because few people use scripts at all. The rest - just find out that the functions made for ease of use are available in a particular script.


    Editing your own articles


    Not so long ago, we saw a heroic and rather successful attempt by a Habr user to make a WYSIWYM editor for Habr's articles. Briefly - this is such an editor that displays the structure of the article, and, in particular, it would be convenient to find places of edits. The “heroism” of such attempts is that you have to bind to the site’s scripts and “subscribe” to their support. A little bit will change - the editor will break, and you need to quickly fix it, synchronize the change. Not a single script that is paired with another is protected from this.

    In HabrAjaxa solution appeared to search for the context based on the selected quote. At the same time, you can select quotes one after another and make many edits in the original input field before posting changes to the site or making a preview. The binding to the site script is also, of course, there, but much weaker. The script only needs to know the id in the textarea edit field. No other changes to HTML and JS on the site affect the function of finding the edit site, except, of course, the ability to run HabrAjax in general.

    What is the difference between this editing method and the traditional one?


    Traditionally, if an error is found in the text of your article (for example, a comma is missing), then you need to quickly get to the same place in the editing form. Usually this is accompanied by a series of actions:

    *) copy a section of text so that it can later be found by Ctrl-F when editing;
    *) open the article for editing (find such an icon:) ;
    *) found? great, click; now we are looking in a new window that opens ...
    *) to find a section of text (it is desirable that it is unique and does not contain tags, otherwise it will have to be sorted out) (note that without a script, the height of the input field is small);
    *) start editing in the area of ​​the selected area.

    Well, or look with your eyes and savvy :).
    Using text selection with a context button, now in HabrAjax it is done like this:
    (It will work, of course, only with a quote from its own article during authorization.)

    *) select the text as for copying;
    *) point to the context button <_>, then click on (or Ctrl +);

    A half frame with an edit page will open and the search text in the frame in the input field will be highlighted.
    If there are more than 1 samples, this will be indicated by a hint, and the link “next” will go to the next match (in the example in the figure, the word “by” was selected and 8 matches were found). If not found, nothing will stand out (in the example we searched for the word "", but it is entered as" <E> ", so nothing was found).

                 

    On the original page of the article, you can repeat the selection of another fragment so that after 1-2 seconds it is highlighted again in the input field. Thus, you can go to different parts of the text in the input field, without leaving the page; make several edits, and then send the edited to the server and close the frame.

    If it is more convenient to edit in another tab (for example, the height of the window is small), when you click onhold Ctrl to open the window in a new tab. The ability to work with multiple selections will not be affected in turn, because communication between windows goes through localStorage. You can even select a quote in another new tab, and the script on the editing page picks it up and selects it at home.

    Tool conversion - from space technology to conventional


    Next, an excellent recursive idea arose: if we are doing an article preview, then just hang the selection handler on the appeared preview text to inform the listener of the changes about the new article selection from the new article text through localStorage. The listener will immediately select the same text in the input field and tighten the page for viewing. The circle of edits closed on one page without frames. But frames helped create it. In other words, if we select text on the page for creating or editing an article, the context button will show this text in the input field.

    Why did article editing appear just now?


    This is a completely random phenomenon. The edit mechanism through a quote appeared in the script about 3 months ago, but other functions were more important - for example, responding to a comment or writing a letter with a quote - fewer users can write and edit articles. But recently there was a time for working with selection, and the previously prepared editing mechanism was done.

    What's next in line with contextual quotation?


    In addition to several (more precisely, 9-10) working context buttons, the user will see 6 more (which are shown in the figure above) if he turns on the “quote-corrector [beta]” setting. But it is so far useless, since the entire cycle of highlighting an error in a quote and sending a letter is not supported. By the way, it was with this idea that the subsystem of contextual buttons began to develop. But, as you can see, everything else is done, but the main mechanism is not, because the script infrastructure is not enough for it. At some close time, this mechanism will appear in the group of context buttons.

    Iceweasel and Firefox 3.6


    You might think that this version of the browser is hopelessly outdated, however, it has been supported in the official Linux distribution of Debian Squeeze for 1.5 years now and does not intend to change. Therefore, after a pause in support of this version of the browser, the script returned to working with the outdated, but relevant for Fx3.6 version of Greasemonkey 0.9.6 (not Scriptish, because from birth it supports only the 4th version of the browser) and supported the Iceweasel browser (Greasemonkey for it is loaded from packages , which are also terribly outdated version 0.8).

    (Let me remind you that for normal reading of script metadata in GreaseMonkey you need to remove the "/ *" before "

    ZenComment Support in Firefox 3.6


    Stylish 1.2 in Fx3.6 does not support the rule @-moz-document regexp("http://habrahabr.ru/(?!special/).*"), but supports the usual domain ("habrahabr.ru"), so in 3.6 you will have to drop the habrahabr.ru/special * URL exception and replace the rule with domain ("habrahabr.ru") manually. Or use the ZenComment version built into the script (usually the current version, included in the settings).

    Problem with the Opera


    Now, for some reason, there are very few Opera users for this script, although there were a normal number of them according to a poll a year ago. It may be due to the fact that the “Install” button on the page does not install the script on the Opera, but it always has been. Installation on the Opera has always been a more complicated procedure for user script, and this is described even in one of the articles specifically. Nevertheless, the script supports Opera, including the 12th version, all functions work.

    The problem with the counter on the hosting


    Around March 20, 2013 the counter on their hosting broke for all scripts. Knowing the extreme unhurriedness of admins, it is not surprising that it does not work so far. However, users are adding, judging by the polls. You may need to set up your own hit counter. Let’s do a survey to determine if a script needs a hit counter.

    Other functions


    * Added button

    to enter a tag when typing an article (otherwise it’s inconvenient without them).
    * Steel frame tables be drawn when under fire rate articles.
    * The script switched to sequential numbering of versions, "by builds", with a recognizable date in the text of the version of the script.
    * Learned how to work with a blank 500th page to show redirects to content copiers, for example, Google Cache and others. All this - in about the last month or two.

    Perhaps you need other advanced functions for the script. For example, the function of polling a new version on a hosting and the ability to manually update after polling have been working for a long time. The user can read not only the date and number of the new version, but also a comment line about what appeared in the new version.

    On the other hand, remember that there are only 50 users of the script, and this number can instantly evaporate if the script is no longer supported. This is almost nothing compared to several thousand regular readers of Habr. for example, a new guide to script functions based on a list of settings would be useful for new users.

    Only registered users can participate in the survey. Please come in.

    (Please respond only to HabrAjax users and those interested.) Do I need a hit counter specifically for HabrAjax?

    • 41.6% yes 15
    • 69.4% no 25
    • 16.6% only needs a download counter, as on hosting 6

    Also popular now: