plugin:custombuttons
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:custombuttons [2020-11-19 13:54] – Hogfather compat Laynee | plugin: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:// | sourcerepo : https:// | ||
donationurl: | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
---- | ---- | ||
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:< | - **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:< | ||
- | Note: Icon by Joseph North! | + | Note: Icon by [[http:// |
===== 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:// | + | {{:plugin: |
- | ** Shortcut button for adding a bash script** | + | ==== Shortcut button for adding a bash script |
- | {{http:// | + | {{:plugin: |
- | ** Deleting | + | ==== Deleting |
Just click at a radio button and then click " | Just click at a radio button and then click " | ||
- | {{http:// | + | {{:plugin: |
- | ** 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:// | + | {{:plugin: |
- | ** Multiline Codes ** | + | ==== Multiline Codes ==== |
If you want to have a shortcut for a common used multiline template (eg. a table) you can use " | If you want to have a shortcut for a common used multiline template (eg. a table) you can use " | ||
Line 70: | Line 72: | ||
</ | </ | ||
- | ===== Bugs ===== | + | ==== Bugs and Feature |
- | + | ||
- | ==== Text-Icons are too small to read in Binky. ==== | + | |
- | + | ||
- | Some dokuwiki releases resize icons to 16x16 size. Just comment the width resizing in / | + | |
- | + | ||
- | <code javascript> | + | |
- | ... | + | |
- | // create the icon and add it to the button | + | |
- | $ico.attr(' | + | |
- | //Disable resizing icons | + | |
- | // $ico.attr(' | + | |
- | | + | |
- | $btn.append($ico); | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | If you use a dokuwiki template (like vector for example) including " | + | |
- | + | ||
- | ==== Code field does not insert code ==== | + | |
- | + | ||
- | | + | |
- | + | ||
- | 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. | + | |
- | + | ||
- | | + | |
- | + | ||
- | --- The Guy // | + | |
- | + | ||
- | ==== Conflict with Indexmenu plugin ==== | + | |
- | + | ||
- | Having " | + | |
- | + | ||
- | --- [[user> | + | |
- | + | ||
- | ===== Feature | + | |
- | + | ||
- | ==== Placeholder symbol ==== | + | |
- | + | ||
- | It would be great to have a placeholder symbol for the selected text, e.g "&&" | + | |
- | + | ||
- | - You don't need three fields to define the button command. You type it like "< | + | |
- | - It's possible to use the selected text more than once: '' | + | |
- | + | ||
- | ==== 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: | + | |
- | + | ||
- | 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: | + | |
- | + | ||
- | would show as | + | |
- | + | ||
- | <todo startdate: | + | |
- | + | ||
- | :-) To achieve the above //date// substitutions edit your %%action.php%% file in the plugin folder to include these additional lines: | + | |
- | <code php> | + | |
- | $json = new JSON(JSON_LOOSE_TYPE); | + | |
- | $file = @file_get_contents(DOKU_PLUGIN . " | + | |
- | if(!$file) return false; | + | |
- | + | ||
- | /** Start of new lines */ | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | $file = str_replace(' | + | |
- | /** End of new lines */ | + | |
- | + | ||
- | return $json-> | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | 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 " | + | |
- | + | ||
- | --- // | + | |
- | + | ||
- | ==== 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:// |
plugin/custombuttons.1605790456.txt.gz · Last modified: 2020-11-19 13:54 by Laynee