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 [2010-11-26 00:10] – [Discussion] 91.86.180.33plugin: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
 type       : action helper type       : action helper
-lastupdate : 2008-09-30 +lastupdate : 2011-12-21 
-compatible : 2005-07-01 - 2008-05-05 + devel+compatible : >= 2008-05-05
 depends    : depends    :
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : bookmark blog create+tags       : bookmark blog create tags
  
-downloadurl: http://mir.dnsalias.com/_media/oss/dokubookmark/dokubookmark.zip+downloadurl: http://gareus.org/_media/oss/dokubookmark/dokubookmark.zip 
 +bugtracker :  
 +sourcerepo : http://gareus.org/gitweb/?p=dokubookmark.git 
 +donationurl:  
 + 
 +screenshot_img: 
 ---- ----
  
- Download | [[http://mir.dnsalias.com/_media/oss/dokubookmark/dokubookmark.zip|dokubookmark.zip]] |+===== News ===== 
 + 
 +  * **0.6.0** 
 +    * Use standard editor (instead previously built-in text entry); increases compatibility and interoperability. 
 +    * Removed ''tagbox'' functionality; [[plugin:tagentry]] can provide this functionality 
 +    * Base support for [[plugin:blogtng]]: push default tag (currently non-configurable) to blogtng tags field
  
 ===== Usage ===== ===== Usage =====
Line 28: 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.
- +
-//dokubookmark// includes [[tag]]-plugin support to easily and quickly tag pages. However the current schema is not suitable for large tag lists. Using the tag-cloud may be nice. Yet more brainstorm and discussion is needed; have fun.+
  
 ===== 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 68: 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:
  
 +<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.
Line 92: Line 106:
  
 what do you need? "a global changelog without the bookmarks" may translate into a namespace-white/blacklisted changelog or index. Maybe there's an existing solution available, the most close I could find quickly was [[userhistory]], [[recent]] and [[editor]]. what do you need? "a global changelog without the bookmarks" may translate into a namespace-white/blacklisted changelog or index. Maybe there's an existing solution available, the most close I could find quickly was [[userhistory]], [[recent]] and [[editor]].
- 
  
 --  -- 
Line 119: Line 132:
  
 Hi, Hi,
-I'm not a coder so this might seems overkill, but I wrapped the bookmarklet in a firefox custom button with a short-cut key. I could post it if anyone is interested.+I'm not a coder so this might seems overkill, but I wrapped the bookmarklet in a firefox custom button with a short-cut key. Following instructions on https://developer.mozilla.org/en/custom_toolbar_button 
 +<code javascript> 
 +CustomButton = {  
 + 
 +1: function () {  
 + 
 +myDoc = window._content.document 
 +mySel = myDoc.selection?myDoc.selection.createRange().text:myDoc.getSelection();  
 +myContent = encodeURIComponent(mySel); 
 +myloc = encodeURIComponent(myDoc.location.href); 
 +mytitle=encodeURIComponent(myDoc.title); 
 + 
 +myparam='scrollbars=yes,resizable=yes,toolbars=yes,width=680,height=520,left=210,top=150,status=yes'; 
 + 
 +myUri = "http://localhost:8800/doku.php?do=dokubookmark&te=" + myContent + '&ur=' + myloc + '&ti=' + mytitle; 
 + 
 +window.open(myUri,'dokuwikiadd', myparam); 
 +  },  
 + 
 +
 +</code> 
 + 
 +Is there a possibility to add the bookmarked page title in the page name (after the date (@D@))? tried with @T@ but it includes the url and creates namespaces. 
  
 -- bandit8876 at gmail -- bandit8876 at gmail
 +
 +This is great, but I have a hard time to get it working with my own templates; it does load the _template.txt from the default namespace, but switching presets does not load the _template.txt from that particular namespace. Any pointers are welcome.
 +
 +-- Hans Peter Willems
plugin/dokubookmark.1290726637.txt.gz · Last modified: 2010-11-26 00:10 by 91.86.180.33

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