UserGuide: Script plugin

Difference between revisions from 2010/01/08 16:04 and 2010/01/08 16:03.
{include:subpage plugins}

Script plugin provides inserting both inline and external JavaScript.

Example syntax:

{{^{script}alert('Hello world!');{/script} }}
	
Will obviously insert this script into the page (and therefore activate it)
	
{{^{script label="Say hello!" title="Greeting" key="g"}alert('Hello world!');{/script} }}
	
Will create link with text "Say hello!", tooltip "Greeting" and access key "g". It will activate after clicking on this link.

{{^{script src="path_to_javascript_file.js"}{/script} }}

Will insert this external JavaScript file into the page.

{{^{script show}alert('Hello world!');{/script} }}

Will do the same but also displays source code.

Most attributes can be combined freely, but their order is fixed! Order is:

src, label, title, key, show

Written by Swen Wetzel, xanatoswetzel@web.de, some minor changes made by Adam Zivner

!Download and installation
Script plugin '''is not a part of official LionWiki distribution'''. You can download it from [here|./download/plugins/Script/Script-1.0.tar.bz2]. Extract the archive to plugins/ directory and that's it.

{tags: plugin, userguide}

{script label="Say hello!" title="Greeting" key="g"}alert('Hello world!');{/script}