DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:editonlink

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:editonlink [2018-11-17 18:20] – [Development] sancayaplugin:editonlink [2020-09-26 11:29] (current) – lastupdate Aleksandr
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Adds a popover button "Edit" to inner wiki links, so you can go edit that page in one click.+description: Adds a popover button "Edit" to inner wiki links, so you can go edit that page in one click
 author     : Constant Illumination (Chang Zhao) author     : Constant Illumination (Chang Zhao)
 email      : alex@obschy.ru email      : alex@obschy.ru
 type       : action type       : action
-lastupdate : 2018-11-17+lastupdate : 2019-02-16
 compatible : Greebo, "Frusterick Manners", "Elenor Of Tsort", Detritus compatible : Greebo, "Frusterick Manners", "Elenor Of Tsort", Detritus
 tags       : button, css, editing, links, shortcut, tooltip tags       : button, css, editing, links, shortcut, tooltip
Line 67: Line 67:
 === Change Log === === Change Log ===
  
 +  * **2019-02-16** //v1.3.4//. Split by character instead of regex.
 +  * **2019-02-16** //v1.3.3//. Final polishing & Version up.
 +  * **2019-02-15** //v1.3.2//. Search narrowed.
 +  * **2019-02-15** //v1.3.1//. In case there could be other 'do=' parameter in wikilink, let's add search/replace.
 +  * **2019-02-15** //v1.3//. Bug corrected: when nice URL rewriting is off, link parameters shouldn't be removed.
 +  * **2018-12-12** //v1.2//. Some workarounds for Firefox invisibility bug.
   * **2018-11-17** //v1.1//. Support for multiline links, ctrl-click, right-click.   * **2018-11-17** //v1.1//. Support for multiline links, ctrl-click, right-click.
     * In case of multiline link, clientBoundingRect top-right might not give the correct position of the button; so I use adding another element with the same positioning on the link click, to learn the actual coordinates of the ":after" element (the button).     * In case of multiline link, clientBoundingRect top-right might not give the correct position of the button; so I use adding another element with the same positioning on the link click, to learn the actual coordinates of the ":after" element (the button).
-    * Using things like ctrl-click and right-click, the user can stay on the page after clicking the link; so restore the target link to its original href (onmouseleave).+    * Using things like ctrl-click and right-click, the user can stay on the page after clicking the link; so restore the target link to its original href (onmouseleave).
   * **2018-11-16** //v1.0.5//. More contrast for the hover underline wave   * **2018-11-16** //v1.0.5//. More contrast for the hover underline wave
   * **2018-11-15** //v1.0.4//. Underline wave style adjusted   * **2018-11-15** //v1.0.4//. Underline wave style adjusted
Line 80: Line 86:
  
 To discuss bugs or issues, please use the github [[https://github.com/chang-zhao/dokuwiki-editonlink/issues|tracker]]. To discuss bugs or issues, please use the github [[https://github.com/chang-zhao/dokuwiki-editonlink/issues|tracker]].
 +
 +Due to a bug (at least, in some versions of modern Firefox & clones), in rare cases, some elements can become (intermittently) invisible in the browser window. Apparently, this has nothing to do with this plugin.
  
 === ToDo/Wish List === === ToDo/Wish List ===
Line 89: Line 97:
 //Q.// Would buttons added to **all** those links slow down the page? //Q.// Would buttons added to **all** those links slow down the page?
  
-//A.// Not at all. The plugin is very tiny and well optimized. Javascript uses only one event listener regardless of how much links are there, and it'fired only once per click; so it doesn't affect the performance. As for CSS, modern browsers are very fast in applying the same styles to many elements; so even if there are hundreds of links on your page, I doubt you could notice any difference.+//A.// Not at all. In general, there are several reasons why pages can get slower with plugins and other bells and whistles: 
 + 
 +  * Loading larger contents. In this case, the plugin is very tiny (about 3 kb non gzipped). 
 +  * Loading of additional files. For example, if a page requests additional pictures, you need to wait while the request to the server gets there and back. It can slow the page rendering indeed, therefore DokuWiki transforms small pictures into inline CSS (encoded text in CSS), which wouldn't require additional requests. In this plugin, the pictures are already inline CSS -- no delay whatsoever. 
 +  * Heavy Javascript processing in browser can slow the page down. In this plugin, there is no such thing. The program is well optimized, it uses only one event listener regardless of how much links are there on the page. And it'invoked only once per click; so it doesn't affect the performance at all. 
 +  * CSS styling takes some (small) time, so the more CSS, the slower the page. However, modern browsers are very fast in applying the same styles to many elements; so even if there are hundreds of links on your page, I doubt you could notice any difference
 +  * Inserting elements in DOM can be somehow time-consuming -- especially when repeated many times. In other words, Javascript can insert elements in your page, and then every time the browser has to re-calculate and re-construct everything. But in this plugin, the buttons are pseudo-elements -- CSS styles, not real elements, they don't get inserted in the DOM. The only insertion happens on clicking the link -- and it takes just few milliseconds. 
 + 
 +Conclusion: this plugin just couldn't have any noticeable effect on the performance.
  
 ===== Discussion ===== ===== Discussion =====
  
-If the link contains a parameter -- like "this:page?do=something", then the button click replaces that parameter with "?do=edit".+If the link contains a parameter -- like "this:page?do=something", then the button click replaces that parameter with "?do=edit" (for the moment of clicking; then the link gets restored to its original URL). The point is, by this button you go to edit a "core" address, with any additional parameters stripped. I believe it's how the editing works anyway.
  
 An interesting development could be to show a little popup menu when clicking that button. (It would be painted by JS, only by the click, thus having no influence on the speed of the page). An interesting development could be to show a little popup menu when clicking that button. (It would be painted by JS, only by the click, thus having no influence on the speed of the page).
plugin/editonlink.1542475223.txt.gz · Last modified: 2018-11-17 18:20 by sancaya

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki