📜 ⬆️ ⬇️

Editing your article on Habré by highlighting a quote in HabrAjax; Iceweasel support

In the HabrAjax script (2013-2013.04.20), convenient editing of corrections in own articles has been added. Simply select a unique part of the text and select the <E> button among the contextual buttons. In the half-height frame, an input field opens with the selection exactly on the place that was selected.

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

HabrAjax users and article focus


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

')

Edit your own articles


Not so long ago, we saw the heroic and rather successful attempt of Habr's user to make WYSIWYM the editor for Habr's articles. In short, this is such an editor so that the structure of the article is displayed, and, in particular, it would be convenient to find the edit points. The “heroism” of such attempts lies in the fact that you have to become attached to the site scripts and “subscribe” to their support. A little that will change - the editor will break, and you need to quickly fix, synchronize the change. No script that works in conjunction with another is protected from this.

HabrAjax has a solution for searching the context based on a highlighted quote. At the same time, you can select quotes one by one and make many edits in the original input field before sending changes to the site or making a preview. Linking to the site script is, of course, also 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 do not affect the search function for the edit site, except, of course, the ability to run HabrAjax at all.

What is the difference of this method of editing from the traditional?


Traditionally, if an error was 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. This is usually accompanied by a number of actions:

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

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

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

A half frame will open with an edit page and the selected text will be highlighted in the frame in the input field.
If there are more than 1 samples, a hint will tell about this, and the “next” link will go to the next match (in the example, the word “by” was selected and 8 matches were found). If it was not found, nothing will be highlighted (in the example, we searched for the word "<E>", but it is entered as "& lt; E>", therefore 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 will be 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 window height is small), when you click on <E>, hold down Ctrl to open the window in a new tab. The ability to work with multiple selections in turn will not suffer, because the communication between the windows goes through localStorage. You can even select a quote in another new tab, and the script on the edit page will pick it up and select it.

Tool conversion - from space technology to conventional


Further, an excellent recursive idea arose: if we are previewing the article, then it suffices to hang up the selection handler on the preview text that appears, so that from the new text of the article through localStorage it is necessary to inform the listener of changes about the new selection of the article. The listener will immediately highlight the same text in the input box and twist 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 contextual button <E> will show this text in the input field.

Why is article editing just now?


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

What is next in line with contextual quotation?


In addition to a few (more precisely, 9-10) working contextual buttons, the user will see another 6 (which are shown in the figure above) if he turns on the “quote-corrector [beta]” setting. But it is still useless, since the entire cycle of highlighting errors in quotations and sending letters is not supported. By the way, the subsystem of contextual buttons began to develop with this idea. But, as you can see, everything else is done, but the main mechanism is not, because there is not enough scripting infrastructure for it. In a near 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 for 1.5 years in the official distribution of Linux Debian Squeeze and does not think to change. Therefore, after a pause in the support of this version of the browser, the script returned to work with the outdated, but relevant for Fx3.6, version of Greasemonkey 0.9.6 (not Scriptish, because it supports only the 4th version of the browser from birth) and supported the browser Iceweasel (Greasemonkey for it is loaded from packages , also terribly outdated version 0.8).

(Recall that for normal reading of script metadata in GreaseMonkey, you need to delete "/ *" before "<!" In the 4th line of the script - this is an old and unsolvable feature of GreaseMonkey that was discussed in the article more than a year ago. However, leaving these characters will not give read only the logo and version number from the metadata of the loaded script - not the most important data. Some new functions will not work either, such as sending events, functions from displaying pictures (insertAdjacentHTML), resizing pictures, writing a letter.)

ZenComment support in Firefox 3.6


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

Problem with Opera


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

The problem with the meter on the hosting


Around March 20, 2013 the counter on their hosting broke for all the scripts. Knowing the extreme slowness of admins, it is not surprising that it is not working so far. However, users are added, judging by the polls. Perhaps you need to arrange your own visitor count. Let's do a poll to see if a visitor counter is needed for the script.

Other features


* Added <H3> button for inputting a tag when typing an article (otherwise it’s inconvenient without them).
* Began to draw the framework of the tables under the load of articles.
* The script switched to consecutive version numbering, “by build”, with a recognizable date in the text of the version of the script.
* Learned how to work with the empty 500th page to show redirects to content copiers, for example, Google Cache and others. All this is about the last month or two.

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

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

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


All Articles