
Consider non-traditional ways of commenting posts in the forum on the example of site X and HabrAjax automation scripts. They are known to have a primary purpose - to view articles and comments without reloading the page. To watch is not to write in response, not to rate comments, but just to watch. If we want to comment, we do not have the Habr API, which would allow us to send a comment. We'll have to open the article in a new window, find the same comment and respond to it. Inconvenient. But there is a mechanism for contextual quoting and answering a quote, which has so far worked for comments in a single article, but not in a loaded article in a tape. And also - he worked everywhere (in loaded and single articles) for writing letters (private messages) through Habr.
Why not use a mechanism similar to writing letters? Open an article in a frame or a new window if you make an answer with a quote in the uploaded article.
How does the answer in the mail (LS) through the citation?
1) select the text in the article or in the comments to it;
1.1) you can write something in response directly in the context of the quotation;
2) select the “Letter” or “Author” button - a frame is opened, and if Ctrl is pressed, then a new window (tab);
3) if there was an “Author”, then we specify the name of the author in the page for choosing authors; if a short name with a Latin name was highlighted, then you may have chosen the author's name - it appears in the author's selection field as a hint (if you select “Letter” - a letter is immediately opened to the author of the article or the commentator);
4) the auxiliary texts appear in the letter field: the topic (the title of the article and the date), the quotation (with the author and the date), the typed contextual response (under clause 1.1), the link to the article and the comment (or only to the article);
If you look at the preview, the letter blank will look like this:
Next, add or edit the letter and send it (or do not send).
And so, in addition to the mechanism for writing letters, in the absence of a commenting API, we use with similar rules ...
')
The mechanism for sending a comment through the frame
1) select the text in the article (question) or in the commentary to it;
1.1) you can write something in response directly in the context of the quotation;
2) choose the button "Answer" ...
If we are not in a single article, but in the tape, in the frame we observe the response field in which the selected quotation is loaded. As you can see, the answer is the same comment, the quote from which you have chosen. A single article appears in the frame, already tied to a comment by the fact that a quote with the focus of the text input on the last position is entered in the input field under it.
Next - add a comment. We check that we haven’t yet answered the next new comments, and we send or do not send the dialed. Unlike the letter, the answer does not need to write links, because the answer is obviously executed in context - only a quote is written.
A small life hack : if we want to answer, but not quote, we need to select
1 character of the comment or article, not counting the extreme spaces. The script will cut the spaces, count the characters and decide that quotes with 1 character do not exist, and will not output a quote.
The second life hack : if you want to rate a comment, you can go to the comment in the frame, showing the script the intention to enter a quote. But instead, we do not enter a comment, but put the estimate in the frame in the usual way, by clicking on the arrow button.
Again, the evaluation hack is a consequence of the lack of an API for entering a comment on the site. When and if it appears, input of comments and ratings will be possible in a more elegant and natural way - by simply pressing the context button “Answer”, simply by pressing the evaluation arrow.
More on contextual citations, but only in text format, has been described
here .
UPD: since the morning the answer buttons worked, and now they fixed something on the site and broke the script. Responses to comments do not work, you can already see where (disable if (! ReplyButt && authorColors && next ('reply', replyM))), version 107 with the restored functions will be posted in some time.
UPD2: fixed (version 107).