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 [2021-05-16 05:59] – Use a known type 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 : 2021-05-13 +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>>
 button to every ''%%<code>%%'' or ''%%<file>%%'' [[:wiki:syntax#Code Blocks|code block]] button to every ''%%<code>%%'' or ''%%<file>%%'' [[:wiki:syntax#Code Blocks|code block]]
-as shown on the screenshot below.+as shown on the screenshot below. Actually, on desktop browser, buttons become visible 
 +only when mouse cursor enters the ''%%<code>%%'' or ''%%<file>%%'' region. On mobile 
 +browsers, the buttons are always visible.
  
 {{https://github.com/schplurtz/dokuwiki-plugin-copy2clipboard/raw/master/screenshot.png}} {{https://github.com/schplurtz/dokuwiki-plugin-copy2clipboard/raw/master/screenshot.png}}
Line 37: 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 44: Line 46:
   - It correctly copies codes formatted by geshi((This is the library component used by DokuWiki to highlight syntax)). if you encounter the dreaded "Unrecognized character \xC2" error when you copy code to perl or python, manually or with other extensions, then copy2clipboard is the extension you need,   - It correctly copies codes formatted by geshi((This is the library component used by DokuWiki to highlight syntax)). if you encounter the dreaded "Unrecognized character \xC2" error when you copy code to perl or python, manually or with other extensions, then copy2clipboard is the extension you need,
   - It makes sure line endings are adapted to the os the navigator is running on. This eliminates powershell bug [[https://github.com/PowerShell/PSReadLine/issues/496|496]] and [[https://github.com/PowerShell/PowerShell/issues/3816|3816]] where lines are pasted in reverse order.   - It makes sure line endings are adapted to the os the navigator is running on. This eliminates powershell bug [[https://github.com/PowerShell/PSReadLine/issues/496|496]] and [[https://github.com/PowerShell/PowerShell/issues/3816|3816]] where lines are pasted in reverse order.
-  - It has no known bugs, yet.+  - <del>It has no known bugs, yet.</del>((This is the kind of statement that can't stand long...))
  
 ===== 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 57: 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 70: 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 =====
plugin/copy2clipboard.1621137548.txt.gz · Last modified: 2021-05-16 05:59 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