DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:copy2clipboard

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:copy2clipboard [2022-03-06 13:15] – [Known Bugs and Issues] schplurtzplugin:copy2clipboard [2024-03-04 17:42] (current) – [Description] schplurtz
Line 6: Line 6:
 email      : Schplurtz-AT-Laposte•net email      : Schplurtz-AT-Laposte•net
 type       : Action type       : Action
-lastupdate : 2022-03-06 +lastupdate : 2023-04-17 
-compatible : elenor of tsort, frusterick manners, greebo, hogfather+compatible : elenor of tsort, frusterick manners, greebo, hogfather, igor, jack jackrum, kaos
 depends    : depends    :
 conflicts  : conflicts  :
Line 24: Line 24:
  
   - Install the plugin   - Install the plugin
-  - Enjoy !+  - Enjoy!
  
 Once installed, it will automatically add a <<copy to clipboard>> Once installed, it will automatically add a <<copy to clipboard>>
Line 39: Line 39:
  
 This is already done by other extensions, [[copycode]] and [[codeclipboard]]. This is already done by other extensions, [[copycode]] and [[codeclipboard]].
-However, it has the following advantages over the other extensions (beeing horribly partial here ;-)) :+However, it has the following advantages over the other extensions (being horribly partial here ;-)):
  
   - made of pure javascript, there is no PHP requirement, no DokuWiki requirement. It will work on any DokuWiki version, with any PHP version,   - made of pure javascript, there is no PHP requirement, no DokuWiki requirement. It will work on any DokuWiki version, with any PHP version,
Line 50: Line 50:
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and+Install the plugin using the [[extensions|Extensions Manager]] Plugin and
 the download URL above, which points to latest version of the plugin. the download URL above, which points to latest version of the plugin.
 Refer to [[:Plugins]] on how to install plugins manually. Refer to [[:Plugins]] on how to install plugins manually.
Line 59: Line 59:
 ===== Browser compatibility ===== ===== Browser compatibility =====
  
-Copy2code is javascript only and requires that your browser supports+Copy2clipboard is javascript only and requires that your browser supports
 writing text to the clipboard via the clipboard API. As of 2021, writing text to the clipboard via the clipboard API. As of 2021,
 it seems to me that this is a not so old feature. Check the it seems to me that this is a not so old feature. Check the
Line 72: Line 72:
 There is nothing to configure. If you want that this plugin uses There is nothing to configure. If you want that this plugin uses
 your language, please add a translation on your language, please add a translation on
-https://translate.dokuwiki.org/plugin/copy2clipboard .+[[https://translate.dokuwiki.org/plugin/copy2clipboard]].
  
 ===== Change Log ===== ===== Change Log =====
Line 82: Line 82:
   * lone NO-BREAK SPACEs, (aka NBSP, aka [[https://www.fileformat.info/info/unicode/char/00a0/index.htm|U+00A0]]) on a line by themselves are not copied to the clipboard.   * lone NO-BREAK SPACEs, (aka NBSP, aka [[https://www.fileformat.info/info/unicode/char/00a0/index.htm|U+00A0]]) on a line by themselves are not copied to the clipboard.
     * This is not a bug but a feature. A lone NBSP almost never happens intentionally in a source code, so this will virtually break no code. On the other hand, geshi which is used by DokuWiki adds it to every empty lines, making empty lines non empty. Moreover, U+00A0 is not a white space, and it causes syntax error in programming languages, or formatted text file such as YAML or LDIF. The benefit of removing this character is much greater than the drawback of keeping it.     * This is not a bug but a feature. A lone NBSP almost never happens intentionally in a source code, so this will virtually break no code. On the other hand, geshi which is used by DokuWiki adds it to every empty lines, making empty lines non empty. Moreover, U+00A0 is not a white space, and it causes syntax error in programming languages, or formatted text file such as YAML or LDIF. The benefit of removing this character is much greater than the drawback of keeping it.
-  * If the ''%%<code>%%'' or ''%%<file>%%'' is the last element of a section, and depending on the [[:template|template]] used, it is possible that copy2clipboard created element covers the "edit" button preventing it to respond to click events :-(. Ie, the button won't work. This is the case for example with the default DokuWiki template as shown on this image.\\ {{https://images2.imgbox.com/fd/04/pkbi697K_o.jpg}} There is no general solution for copy2clipboard to prevent this ; sorry. The workaround is to use some CSS to move down the button so that it is no more under the copy2clipboard element. In the particular case of the default DokuWiki template, you do this by editing a file named ''conf/userstyle.css'' with a notepad and add the following content. <code css conf/userstyle.css.snippet> 
-div.dokuwiki div.secedit { 
-  margin-top: 0 
-} 
-</code>Please see [[devel:css#user_styles]] for the complete reference. 
- 
  
 Issues, bug, suggestions should only be discussed on Issues, bug, suggestions should only be discussed on
plugin/copy2clipboard.1646568959.txt.gz · Last modified: 2022-03-06 13:15 by schplurtz

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