DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jokuwiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
plugin:jokuwiki [2013-06-30 16:15] – created SyMcBeanplugin:jokuwiki [2019-01-13 15:29] (current) – Added bugtracker LarsDW223
Line 1: Line 1:
-====== Jokuwiki plugin ======+====== Jokuwiki Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Integrate javascript in Dokuwiki+description: Integrate javascript in DokuWiki
 author     : SyMcBean author     : SyMcBean
 email      : colin.mckinnon@gmail.com email      : colin.mckinnon@gmail.com
 type       : syntax type       : syntax
-lastupdate : 2013-06-24+lastupdate : 2016-07-06
 compatible :  Adora Belle, Weatherwax compatible :  Adora Belle, Weatherwax
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : wrap, inlinejs similar    : wrap, inlinejs
-tags       : javascript,jquery, style+tags       : javascript,jquery, style,performance
  
-downloadurl: http://www.ralstonrats.co.uk/jokuwiki-29Jun13.zip+downloadurl: https://github.com/symcbean/jokuwiki/archive/master.zip 
 +bugtracker : https://github.com/symcbean/jokuwiki/issues 
 +sourcerepo : https://github.com/symcbean/jokuwiki
 ---- ----
  
Line 27: Line 29:
  
 ===== Usage ===== ===== Usage =====
 +
 <code html> <code html>
 <jw name='jwHelloWorld' <jw name='jwHelloWorld'
Line 33: Line 36:
   ></jw>   ></jw>
 </code> </code>
-(the example above requires the jwHelloWorld plugin to run).+(the example above requires the [[plugin:jwHelloWorld|jwHelloWorld plugin]] to run).
  
 The Jokuwiki opening tag has a number of attributes: The Jokuwiki opening tag has a number of attributes:
Line 67: Line 70:
  
 Not exactly rocket science so far!  Not exactly rocket science so far! 
 +
 ===== Speed enhancement ===== ===== Speed enhancement =====
 +
     - Since processing of the content (arguments to the initiator) is deferred, the javascript need not be loaded before the Jokuwiki tag is declared in the html - i.e. script tags can be moved to the bottom, and/or use the defer/async tags or be loaded via AJAX. In short, the page is not blocked loading javascript content.     - Since processing of the content (arguments to the initiator) is deferred, the javascript need not be loaded before the Jokuwiki tag is declared in the html - i.e. script tags can be moved to the bottom, and/or use the defer/async tags or be loaded via AJAX. In short, the page is not blocked loading javascript content.
     - Even without the overhead of jQuery, the amount of content which is different between individual pages is often less than 50% of the data downloaded from the server. Jokuwiki provides hooks to integrate [[https://github.com/defunkt/jquery-pjax|PJAX]] into templates and thereby reducing the total traffic on page transitions.     - Even without the overhead of jQuery, the amount of content which is different between individual pages is often less than 50% of the data downloaded from the server. Jokuwiki provides hooks to integrate [[https://github.com/defunkt/jquery-pjax|PJAX]] into templates and thereby reducing the total traffic on page transitions.
-    - Actually, halving the content size isn't really a //great// performance saving - with HTTP it's all about the latency. But eliminating the need to re-fetch (even from cache), re-parse and re-compile the javascript on each page (along with parsing the CSS) does represent a big performance boost - on a bare installation of Weatherwax on my development machine this saves between 250 and 350 milliseconds per page load.+    - Actually, halving the content size isn't really a //great// performance saving - with HTTP it's all about the latency. But eliminating the need to re-fetch (even from cache), re-parse and re-compile the javascript on each page (along with parsing the CSS) does represent a big performance boost - on a bare installation of Weatherwax on my development machine this saves around 450 milliseconds per page load.
  
 ===== Security Enhancement ===== ===== Security Enhancement =====
 +
 Allowing inline javascript is a big security risk. Adopting a strict [[https://developer.chrome.com/extensions/contentSecurityPolicy.html|Content Security Policy]], rejecting inline javascript //and inline CSS// almost completely eliminates cross-site scripting vulnerabilities. Note that the versions of Dokuwiki up to, and including Weatherwax inject inline Javascript to define variables including JSINFO and SIG. Allowing inline javascript is a big security risk. Adopting a strict [[https://developer.chrome.com/extensions/contentSecurityPolicy.html|Content Security Policy]], rejecting inline javascript //and inline CSS// almost completely eliminates cross-site scripting vulnerabilities. Note that the versions of Dokuwiki up to, and including Weatherwax inject inline Javascript to define variables including JSINFO and SIG.
  
 ===== Compatible Templates ===== ===== Compatible Templates =====
-PJAX page loading and Content Security Policy support requires changes to the template - and Jokuwiki simplifies the implementation of these changes. The starterPjax template is a demonstration of PJAX and CSP capable template using Jokuwiki; the template defines the PJAX container Div and also injects a Jokuwiki widget to update the page title. 
  
 +Jokuwiki should be compatible with all templates, however the additional functionality jokuwiki was designed to support (much faster page loading, better security) require a template which is jokuwiki aware.
  
 +PJAX page loading and Content Security Policy support requires changes to the template - and Jokuwiki simplifies the implementation of these changes. The starterPjax template is a demonstration of PJAX and CSP capable template using Jokuwiki; the template defines the PJAX container Div and also injects a Jokuwiki widget to update the page title.
    
 ===== Source code and installation ===== ===== Source code and installation =====
Line 84: Line 91:
  
 ===== Versions ===== ===== Versions =====
 +
   * **2013-06-24** : First version.   * **2013-06-24** : First version.
  
 ===== ToDo ===== ===== ToDo =====
 +
   * Add a built-in widget to initialize Dokuwiki variables   * Add a built-in widget to initialize Dokuwiki variables
   * Add  an AJAX save/load interface for arbitrary JSON data - serverside and clientside   * Add  an AJAX save/load interface for arbitrary JSON data - serverside and clientside
plugin/jokuwiki.1372601702.txt.gz · Last modified: 2013-06-30 16:15 by SyMcBean

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