DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:custombuttons

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:custombuttons [2020-11-19 13:54] – Hogfather compat Layneeplugin:custombuttons [2023-12-24 14:14] (current) Klap-in
Line 6: Line 6:
 email      : conx@xanthopoulos.info email      : conx@xanthopoulos.info
 type       : action, admin type       : action, admin
-lastupdate : 2019-07-11 +lastupdate : 2021-02-28 
-compatible : Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Greebo, Hogfather+compatible : Igor, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Greebo, Hogfather, Jack Jackrum
 depends    :  depends    : 
 conflicts  conflicts 
Line 17: Line 17:
 sourcerepo : https://github.com/ConX/dokuwiki-plugin-custombuttons sourcerepo : https://github.com/ConX/dokuwiki-plugin-custombuttons
 donationurl:  donationurl: 
 +
 +screenshot_img: :plugin:custombuttons:result.png
 ---- ----
  
Line 26: Line 28:
   - **Wiki Format blocks:** This should be used when the tags you want to shortcut have an opening and closing part and the user should add something in the middle. ex:<code><file bash bash.sh></file></code>   - **Wiki Format blocks:** This should be used when the tags you want to shortcut have an opening and closing part and the user should add something in the middle. ex:<code><file bash bash.sh></file></code>
  
-Note: Icon by Joseph North!+Note: Icon by [[http://sublink.ca/icons/|Joseph North]]!
    
 ===== Download and Installation ===== ===== Download and Installation =====
Line 37: Line 39:
  
  
-** Shortcut button for a commonly used URL**+==== Shortcut button for a commonly used URL ====
  
-{{http://img848.imageshack.us/img848/5072/cburlshortcut.png?nolink&200|}}+{{:plugin:custombuttons:cburlshortcut.png?nolink|}}
  
  
-** Shortcut button for adding a bash script**+==== Shortcut button for adding a bash script ====
  
-{{http://img857.imageshack.us/img857/5849/cbbashscript.png?nolink&200|}}+{{:plugin:custombuttons:cbbashscript.png?nolink|}}
  
-** Deleting **+==== Deleting ====
  
 Just click at a radio button and then click "Delete". Just click at a radio button and then click "Delete".
  
-{{http://img696.imageshack.us/img696/8307/deletehe.png?nolink&300|}}+{{:plugin:custombuttons:deletehe.png?nolink|}}
  
-** Using the buttons**+==== Using the buttons ====
  
 After you have successfully inserted some buttons you should be able to see them at the edit toolbar, as shown below. After you have successfully inserted some buttons you should be able to see them at the edit toolbar, as shown below.
  
-{{http://img856.imageshack.us/img856/4568/result.png?nolink&200|}}+{{:plugin:custombuttons:result.png?nolink|}}
  
  
-** Multiline Codes **+==== Multiline Codes ====
  
 If you want to have a shortcut for a common used multiline template (eg. a table) you can use "\n" in the code field to denote the line change. If you want to have a shortcut for a common used multiline template (eg. a table) you can use "\n" in the code field to denote the line change.
Line 70: Line 72:
 </code> </code>
  
-===== Bugs ===== +==== Bugs and Feature Requests ====
- +
-==== Text-Icons are too small to read in Binky. ==== +
- +
-Some dokuwiki releases resize icons to 16x16 size. Just comment the width resizing in /lib/scripts/edit.js (around line 40) +
- +
-<code javascript> +
- ... +
-    // create the icon and add it to the button +
-    $ico.attr('src', icon); +
-    //Disable resizing icons +
-   // $ico.attr('width', 16); +
-   $ico.attr('height', 16); +
-    $btn.append($ico); +
- ... +
-</code> +
- +
-If you use a dokuwiki template (like vector for example) including "user.js" file, copy the function who manages toolbar button from "edit.js" dokuwiki file and disable icon localy in the user.js file. Do not forget to activate the template option "user-script overwrite".  +
- +
-==== Code field does not insert code ==== +
- +
- Hello, +
- +
- When setting up the custom button to insert code, it does not work when using the button. Instead of inserting code field, it inserts label field. +
- +
- Regards. +
- +
---- The Guy //2015-02-13 10:42// +
- +
-==== Conflict with Indexmenu plugin ==== +
- +
-Having "Custombuttons 2014-12-10" and "indexmenu 2014-11-24" on DW 2012-01-25b "Angua" results in "Navigation tree is not displayed" issue ([[plugin:indexmenu#the_tree_is_not_displayed]]). +
- +
---- [[user>mubed|mubed]] //2015-01-08 17:41// +
- +
-===== Feature requests ===== +
- +
-==== Placeholder symbol ==== +
- +
-It would be great to have a placeholder symbol for the selected text, e.g "&&" or "$$". This has two benefits: +
- +
-  - You don't need three fields to define the button command. You type it like "<pre>$$<post>" instead +
-  - It's possible to use the selected text more than once: ''%%[[http://mysearch.com?s=&&|Search result for "&&"]]%%'' +
- +
-==== Variable Substitution ==== +
-It would be great to be able to insert other data as well, eg dates, username etc +
- +
-eg I have a button that inserts  +
-   +
-  <todo startdate:yyyy-mm-dd @user>//my text here//</todo> +
-   +
-I'd like to be able to have custom button fill in information such as the date, time and username (or any other info calculated from that eg: +
- +
-  <todo startdate:@Date@ due:@date@+10 @@user@>Update AVG boot disk</todo> +
-   +
-would show as +
-   +
-  <todo startdate:2015-02-25 due:2105-03-07 @Chris>Update AVG boot disk</todo> +
- +
-:-) To achieve the above //date// substitutions edit your %%action.php%% file in the plugin folder to include these additional lines:  +
-<code php>    protected function loadCBData() { +
-        $json = new JSON(JSON_LOOSE_TYPE); +
-        $file = @file_get_contents(DOKU_PLUGIN . "custombuttons/config.json"); +
-        if(!$file) return false; +
- +
-/** Start of new lines */ +
-        $file = str_replace('@@TODAY@@',date("Y-m-d"),$file); +
-        $file = str_replace('@@USER@@',$client,$file); +
-        $file = str_replace('@@ONEWEEK@@',date("Y-m-d",strtotime('+7 days')),$file); +
-        $file = str_replace('@@TWOWEEKS@@',date("Y-m-d",strtotime('+14 days')),$file); +
-        $file = str_replace('@@THREEWEEKS@@',date("Y-m-d",strtotime('+21 days')),$file); +
-        $file = str_replace('@@FOURWEEKS@@' ,date("Y-m-d",strtotime('+28 days')),$file); +
-        $file = str_replace('@@ONEMONTH@@',date("Y-m-d",strtotime('+30 days')),$file); +
-/** End of new lines */ +
- +
-        return $json->decode($file); +
-    } +
-</code> +
- +
-I'm still working on getting the username substituted in...  If I'd known it was this simple I'd have done it ages ago.  The placeholders to put in your button text are @@TODAY@@, @@ONEWEEK@@ etc.  Hopefully its obvious enough to make your own tweaks. +
- +
- +
-==== Add button "Edit Selected" ==== +
-A simple button, next to "Delete Selected", which gives the possibility to change the fields of an existing button. +
- +
- --- //[[dgtorpedo@gmail.com|Torpedo]] 2015/05/25 22:36// +
- +
-==== Let every users create their own buttons ====+
  
-A great improvment would be to give the ability for every users (not only the admin) to create their own buttons.+Use [[https://github.com/ConX/dokuwiki-plugin-custombuttons/issues|GitHub Issues]] to reports bugs and request features.
plugin/custombuttons.1605790456.txt.gz · Last modified: 2020-11-19 13:54 by Laynee

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