plugin:toolbox
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:toolbox [2010-04-08 21:21] – 71.142.80.55 | plugin:toolbox [2024-02-12 17:38] (current) – Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
Line 5: | Line 5: | ||
author | author | ||
email : andi@splitbrain.org | email : andi@splitbrain.org | ||
- | type : | + | type : |
- | lastupdate : 2010-02-24 | + | lastupdate : 2017-03-18 |
- | compatible : 2009-12-25+ | + | compatible : Frusterick Manners, Greebo, Hogfather |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : javascript, toolbar, sort, indent, wordcount, list, tables | + | tags : javascript, toolbar, sort, indent, wordcount, list, findandreplace, |
- | downloadurl: | + | downloadurl: |
- | bugtracker : http:// | + | bugtracker : https:// |
- | sourcerepo : http:// | + | sourcerepo : https:// |
donationurl: | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
---- | ---- | ||
- | ~~INFO: | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Download | + | Search |
+ | |||
+ | ==== Browser Extensions ==== | ||
+ | |||
+ | If you want to use this plugin on a wiki that does not have it installed (eg. on dokuwiki.org or a wiki where you have no administrative control) you can also install it as a browser extension((It' | ||
+ | |||
+ | The browser extension will automatically inject the appropriate JavaScript when you edit a DokuWiki page. It will look and feel exactly as if the plugin was installed for all users in that wiki. | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | Theoretically it should be possible to install the same extension in Microsoft Edge as well, but it seems their store is not open for developers, yet. | ||
==== Changes ==== | ==== Changes ==== | ||
- | {{rss>http:// | + | {{rss>https:// |
===== Usage ===== | ===== Usage ===== | ||
Line 54: | Line 66: | ||
Might not always be 100% correct, but should be good enough. | Might not always be 100% correct, but should be good enough. | ||
- | ===== More features ===== | + | {{https:// |
- | Might come some day. Earlier if you send patches. Here are a few ideas: | + | ==== Find and Replace ==== |
- | * Search | + | This opens a Find and Replace |
- | * [[tips: | + | |
+ | {{http:// | ||
- | ==== Added codebutton plugin | + | ===== More features ===== |
- | I integrated the [[plugin: | + | |
- | < | + | Might come some day. Earlier |
- | if(window.toolbar!=undefined){ | + | |
- | toolbar[toolbar.length] = { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | toolbar[toolbar.length] = { | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | toolbar[toolbar.length] ={ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | toolbar[toolbar.length] ={ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | toolbar[toolbar.length] ={ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | toolbar[toolbar.length] ={ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }; | + | |
- | } | + | |
- | /** | + | |
- | * Sort the selected text | + | |
- | */ | + | |
- | function tb_toolbox_sort(btn, | + | |
- | var selection = getSelection($(edid)); | + | |
- | if(!selection.getLength()){ | + | |
- | alert(LANG.plugins.toolbox.notext); | + | |
- | return; | + | |
- | } | + | |
- | + | ||
- | var text = selection.getText(); | + | |
- | text = text.split(" | + | |
- | text.sort(); | + | |
- | if(opts[' | + | |
- | text = text.join(" | + | |
- | + | ||
- | pasteText(selection, | + | |
- | pickerClose(); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Indent the selected text | + | |
- | */ | + | |
- | function tb_toolbox_indent(btn, | + | |
- | var selection = getSelection($(edid)); | + | |
- | if(!selection.getLength()){ | + | |
- | alert(LANG.plugins.toolbox.notext); | + | |
- | return; | + | |
- | } | + | |
- | + | ||
- | var text = selection.getText(); | + | |
- | text = text.split(" | + | |
- | for(var i=0; i< | + | |
- | if(opts[' | + | |
- | text[i] = text[i].replace(/ | + | |
- | }else{ | + | |
- | text[i] = ' | + | |
- | } | + | |
- | } | + | |
- | text = text.join(" | + | |
- | + | ||
- | pasteText(selection, | + | |
- | pickerClose(); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Count words and characters | + | |
- | * | + | |
- | * @link http:// | + | |
- | */ | + | |
- | function tb_toolbox_counter(btn, | + | |
- | + | ||
- | function charcounter(text){ | + | |
- | var list = text.split(/ | + | |
- | var len = text.length; | + | |
- | if(list[len-1] == '' | + | |
- | if(list[0] == '' | + | |
- | if(len < 0) len=0; | + | |
- | return len; | + | |
- | } | + | |
- | + | ||
- | function wordcounter(text){ | + | |
- | var list = text.split(/ | + | |
- | var len = list.length; | + | |
- | if(list[len-1] == '' | + | |
- | if(list[0] == '' | + | |
- | if(len < 0) len=0; | + | |
- | return len; | + | |
- | } | + | |
- | + | ||
- | + | ||
- | var obj = $(edid); | + | |
- | var call = 0; | + | |
- | var wall = 0; | + | |
- | var csec = charcounter(obj.value); | + | |
- | var wsec = wordcounter(obj.value); | + | |
- | + | ||
- | if(obj.form.elements.prefix && obj.form.elements.prefix.value){ | + | |
- | call += charcounter(obj.form.elements.prefix.value); | + | |
- | wall += wordcounter(obj.form.elements.prefix.value); | + | |
- | } | + | |
- | if(obj.form.elements.suffix && obj.form.elements.suffix.value){ | + | |
- | call += charcounter(obj.form.elements.suffix.value); | + | |
- | wall += wordcounter(obj.form.elements.suffix.value); | + | |
- | } | + | |
- | + | ||
- | var out = ''; | + | |
- | + | ||
- | if(call){ | + | |
- | out += LANG.plugins.toolbox.total; | + | |
- | out += " | + | |
- | out += " | + | |
- | + | ||
- | out += LANG.plugins.toolbox.section; | + | |
- | }else{ | + | |
- | out += LANG.plugins.toolbox.total; | + | |
- | } | + | |
- | out += " | + | |
- | out += " | + | |
- | + | ||
- | var selection = getSelection($(edid)); | + | |
- | if(selection.getLength()){ | + | |
- | var text = selection.getText(); | + | |
- | + | ||
- | out += LANG.plugins.toolbox.selection; | + | |
- | out += " | + | |
- | out += " | + | |
- | } | + | |
- | + | ||
- | pickerClose(); | + | |
- | alert(out); | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | Perhaps someone could use it. | + | |
- | + | ||
- | Note: I also added this tot the lang.php: | + | |
- | < | + | |
- | $lang[' | + | |
- | </ | + | |
- | + | ||
- | And the image (code.png) of the [[plugin: | + | |
- | //Theo// |
plugin/toolbox.1270754512.txt.gz · Last modified: 2010-04-08 21:21 by 71.142.80.55