DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:double-click-to-edit

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
tips:double-click-to-edit [2012-08-26 23:24] – reminder to clear cache 1.186.187.111tips:double-click-to-edit [2016-03-12 15:42] (current) – reverted hint to save js in template folder (not future-proof and only per template) and fixed reference to js under conf ach
Line 3: Line 3:
 The javascript snippet below adds the ability to double-click a section of an article to go straight to the edit mode for that section. The javascript snippet below adds the ability to double-click a section of an article to go straight to the edit mode for that section.
  
-It is easy to add it. Just create a **script.js** file under your templates directory (for eg lib/tpl/default/script.js) and append the following code snippet to it:+It is easy to add it. Just create a **userscript.js** file under your conf directory (i.e. ./conf/userscript.js) and append the following code snippet to it:
  
-<code javascript>+<code javascript conf/userscript.js>
 jQuery(document).ready(function(){ jQuery(document).ready(function(){
  
Line 26: Line 26:
 </code> </code>
  
-Remember to purge the javascript cache by calling+Remember to [[devel:caching#purging_the_cache|purge the javascript cache]], e.g. by calling
   http://example.com/lib/exe/js.php?purge=true   http://example.com/lib/exe/js.php?purge=true
 and clean up your browser's cache as well. and clean up your browser's cache as well.
  
  
-Tested on Release 2012-01-25b "Angua"+Tested on Release 2015-08-10a "Detritus" 
  
 The functionality of the code has been commented inline. Submit any improvements and fixes you may have. The functionality of the code has been commented inline. Submit any improvements and fixes you may have.
  
-For queries, contact the author on http://twitter.com/dayson+For queries, contact the author on http://twitter.com/daysonhi
tips/double-click-to-edit.1346016286.txt.gz · Last modified: 2012-08-26 23:24 by 1.186.187.111

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