This is an old revision of the document!
Table of Contents
editonlink Plugin
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
(Early releases (before 1.0.3) had different download links; so if you have problems with their updating in Extension Manager, just uninstall the plugin and install it afresh.)
Examples/Usage
After you installed the plugin, the links to pages in your wiki will receive “Edit” button (appears on hover). So you would not need to click first the link to go to that page, and then to click “Edit page” there. With this new popover button you go to the editor window of that other page in one click.
See the popover button in action: Demo.
Hover the links and notice how the button size is adjusting to different font sizes.
Configuration and Settings
The plugin should work out of the box. If you would like to adjust its looks for your template, then read on please.
Technical notes:
1. If you disable Javascript, clicking the popover button will just go to the target link, without editing the target page.
2. The sizes of the popover buttons get adjusted with the links font sizes (=1em
). If you want to change the appearance (the size of the popover button, its color etc.), you can apply your styles, for example, in <your dokuwiki>/conf/userstyle.css
or in CSS files of your template. (For the original CSS see <your dokuwiki>/lib/plugins/editonlink/style.css
).
Note that you could safely change the size of the button, because the Javascript would calculate its size correctly; but if you dramatically change its perfect round form ;), and especially the positioning of the button as related to its parent link, then you should accordingly change the calculations of the target region on the screen (it's in <your dokuwiki>/lib/plugins/editonlink/script.js
, and you can overwrite it in <your dokuwiki>/conf/userscript.js
or in JS files of your template).
3. Likewise, overwrite CSS if you like to change the animation of hovered links. (This animation is done via tiny inline SVG).
4. Buttons are automatically added to inner wiki links (CSS classes wikilink1
, wikilink2
– existing and non-existing pages) and to breadcrumbs (CSS class breadcrumbs
). It can be changed via CSS.
5. CSS conflicts are unlikely, but they can happen if you style the inner wiki links in your template with :after
pseudo-elements. That can conflict with the popover button. Then maybe you could change :after
to :before
, or something.
6. In order to add the popover button, the inner links get position: relative
. It might happen that you wish to give some of such links in your template position: absolute
or position: fixed
. (For example, if you use those links as dropdowns in navigation toolbars or something).
Then a conflict with this plugin can happen. To avoid it, you can, for example, remove classes wikilink1
, wikilink2
and breadcrumbs
from those specially positioned links; or wrap them in div's or span's and give special positioning to those instead of the links.
Development
I had an idea of turning CSS of the plugin off any time when Javascript is disabled in user's browser. It could be done by detecting <html>
class: no-js
or js
(at least, in default DokuWiki template and similar). But it appears that links on the page get drawn before <html>
gets class js
set; so I just leave CSS as it is.
Change Log
[preferable GitHub RSS feed or similar]
- 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-14 v1.0.3 Style & test improvements; download link changed. Uninstall and then reinstall the plugin in case you have problems upgrading via Extension Manager.
- 2018-11-14 v1.0.2 Removed hash part of the URL when going to editing
- 2018-11-14 v1.0.1 Style fix
- 2018-11-13 v1.0 Initial release
Known Bugs and Issues
To discuss bugs or issues, please use the github tracker.
ToDo/Wish List
Empty.
FAQ
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's 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.