DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dokubookmark

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:dokubookmark [2014-07-09 09:14] – Updating / replacing broken download link hh lohmannplugin:dokubookmark [2020-02-20 13:47] (current) Aleksandr
Line 1: Line 1:
-====== dokubookmark plugin ======+====== dokubookmark Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: bookmarklet to submit content to DokuWiki+description: Bookmarklet to submit content to DokuWiki
 author     : Robin Gareus author     : Robin Gareus
 email      : robin@gareus.org email      : robin@gareus.org
Line 12: Line 12:
 similar    :  similar    : 
 tags       : bookmark blog create tags tags       : bookmark blog create tags
-sourcerepo : http://gareus.org/gitweb/?p=dokubookmark.git+
 downloadurl: http://gareus.org/_media/oss/dokubookmark/dokubookmark.zip downloadurl: http://gareus.org/_media/oss/dokubookmark/dokubookmark.zip
-----+bugtracker :  
 +sourcerepo : http://gareus.org/gitweb/?p=dokubookmark.git 
 +donationurl: 
  
-^ Download | [[http://gareus.org/_media/oss/dokubookmark/dokubookmark.zip|dokubookmark.zip]] | +screenshot_img:  
-^ Version  | 0.6.0 | +----
-^ GIT repository | http://gareus.org/gitweb/?p=dokubookmark.git |+
  
 ===== News ===== ===== News =====
Line 37: Line 38:
   - preview, fill in CAPTCHA (or log-in) and save   - preview, fill in CAPTCHA (or log-in) and save
  
-This plugin was inspired by the [[tips]] section's [[tips:weblog_bookmarklet]] article - thanks to Riny. +This plugin was inspired by the [[:tips]] section's [[tips:weblog_bookmarklet]] article -- thanks to Riny.
  
 ===== Setup ===== ===== Setup =====
 +
 Just install the plugin, the default settings will do, but you may want to tweak them to your preferences. Just install the plugin, the default settings will do, but you may want to tweak them to your preferences.
  
 ==== Config ==== ==== Config ====
-They're documented - use DokuWiki's //Configuration panel//.+ 
 +They're documented -- use DokuWiki's //Configuration panel//.
 ^ config-key        ^ default-value     ^ description| ^ config-key        ^ default-value     ^ description|
-| default namespace | ''wiki:weblog:@D@'' | where to save new pages | +| default namespace | ''wiki:weblog:@D@''  | where to save new pages  
-| Namespace Presets | ''Private=weblog:@D@;Public=wik..''((too long to post here)) | flexible version of the above. allows to specify multiple namespaces and custom templates| +| Namespace Presets | ''Private=weblog:@D@;Public=wik..''((too long to post here))  | flexible version of the above. allows to specify multiple namespaces and custom templates| 
-| Date-time format  | ''Y:m_d_His'' | how to [[http://php.net/date|format]] timestamps \\ Note: timestamps (''@D@'') can be used for wiki-page names; a colon separates namespaces. | +| Date-time format  | ''Y:m_d_His'' | how to [[phpfn>date|format]] timestamps\\ Note: timestamps (''@D@'') can be used for wiki-page names; a colon separates namespaces. | 
-| tagbox            | 1 | on/off - show available tags - requires the [[tag]] plugin | +| tagbox            | 1  | on/off -- show available tags -- requires the [[plugin:tag]] plugin  
-| tabboxtable       | 1 | on/off - if showing tags, put them in a HTML table | +| tabboxtable       | 1  | on/off -- if showing tags, put them in a HTML table  
-| wikitemplate      | ''...''((too long to post here))| the fallback page-template that is used if no other templates have been specified/found |+| wikitemplate      | ''...''((too long to post here))  | the fallback page-template that is used if no other templates have been specified/found  |
  
 Placeholders (replaced in wiki-page-name and wiki-page-template: Placeholders (replaced in wiki-page-name and wiki-page-template:
-  * ''@T@'' - title of the bookmarked page (as shown in browser title bar) +  * ''@T@'' -- title of the bookmarked page (as shown in browser title bar) 
-  * ''@U@'' - the URL of the page to bookmark +  * ''@U@'' -- the URL of the page to bookmark 
-  * ''@D@'' - timestamp, now +  * ''@D@'' -- timestamp, now 
-  * ''@S@'' - text that was selected. +  * ''@S@'' -- text that was selected. 
-  * ''@F@'' - //foo// - the user who is making the change or 'anonymous' +  * ''@F@'' -- //foo// -- the user who is making the change or 'anonymous' 
-  * ''@N@'' - title/page-name. Identical to''@S'' if it is a single word, otherwise ''@T@''. In both cases the value is stripped of non-alphanumerical characters and space is replaced with underscore. +  * ''@N@'' -- title/page-name. Identical to ''@S'' if it is a single word, otherwise ''@T@''. In both cases the value is stripped of non-alphanumerical characters and space is replaced with underscore. 
  
-If a _template.txt exists in the namespace of the page, the default DokuWiki placeholders (''@PAGE@'', etc ) are also available for those wiki-pages.+If a _template.txt exists in the namespace of the page, the default DokuWiki placeholders (''@PAGE@'', etc.) are also available for those wiki-pages.
  
-//Notes//:  +//Notes:// Tags are optional (requires the DokuWiki [[plugin:tag]] plugin). Presets come in handy to quickly change the namespace or apply templates.
-Tags are optional (requires the DokuWiki [[tag]] plugin). +
-Presets come in handy to quickly change the namespace or apply templates.+
  
 Direct-saving can be enabled in the configuration, it is identical to DokuWiki //save// (it even checks sectok). It is intended to close the popup-window after a successful save (it does not yet) or redirect the user to edit/preview/draft-merge if some concurrency or permission error occurs. Direct-saving can be enabled in the configuration, it is identical to DokuWiki //save// (it even checks sectok). It is intended to close the popup-window after a successful save (it does not yet) or redirect the user to edit/preview/draft-merge if some concurrency or permission error occurs.
- 
  
 ==== Bookmarklet ==== ==== Bookmarklet ====
Line 76: Line 75:
 Add a new bookmark in your browser with the //Location// text below. Adjust the hostname and protocol to match your DokuWiki server's host-name. Add a new bookmark in your browser with the //Location// text below. Adjust the hostname and protocol to match your DokuWiki server's host-name.
  
-  javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('http://MY-HOST-NAME/doku.php?do=dokubookmark&te='+escape(Q)+'&ur='+escape(location.href)+'&ti='+escape(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=680,height=520,left=210,top=150,status=yes'));+<code javascript> 
 +javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('http://MY-HOST-NAME/doku.php?do=dokubookmark&te='+escape(Q)+'&ur='+escape(location.href)+'&ti='+escape(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=680,height=520,left=210,top=150,status=yes')); 
 +</code>
  
 To prevent 'encoding-hell' (hello Russians encodings!) use ''encodeURI()'' instead ''escape()''. It guaranteed provide result as UTF-8 string. So, bookmarklet should look like: To prevent 'encoding-hell' (hello Russians encodings!) use ''encodeURI()'' instead ''escape()''. It guaranteed provide result as UTF-8 string. So, bookmarklet should look like:
  
-  javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('http://MY-HOST-NAME/doku.php?do=dokubookmark&te='+encodeURI(Q)+'&ur='+encodeURI(location.href)+'&ti='+encodeURI(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=680,height=520,left=210,top=150,status=yes'));+<code javascript> 
 +javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('http://MY-HOST-NAME/doku.php?do=dokubookmark&te='+encodeURI(Q)+'&ur='+encodeURI(location.href)+'&ti='+encodeURI(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=680,height=520,left=210,top=150,status=yes')); 
 +</code>
  
  
-====== Discussion ======+===== Discussion =====
  
 Any help to improve this plugin is welcome. Feel free to discuss here or drop us a line, contact info comes with the source. Any help to improve this plugin is welcome. Feel free to discuss here or drop us a line, contact info comes with the source.
plugin/dokubookmark.1404890095.txt.gz · Last modified: 2014-07-09 09:14 by hh lohmann

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