This plugin provides the ability to use traditional copy-and-paste javascript code snippets in your wiki pages.
This plugin does one thing: it inserts the contents of the javascript into the BODY of a wiki page (inbetween the < BODY > and < /BODY > tags) at the position where the .js file is called. So, this works for javascripts that only need code to be put in the BODY of a web page.
--> For javascripts where code also needs to be inserted into the HEAD (inbetween the < HEAD > and < /HEAD > tags), an update to this plugin is in the works
- Copy and paste your code snippet into a new text document, and remove the , and tags.
- Save the document with .js at the end in place of .txt (or you can rename it after saving).
- Put this new .js file in the root folder of your tiki installation.
Use the following syntax (replacing js-file_name.js with the name of the new .js file) in the wiki page where you want the javascript to run: {JSFILE(file=js-file_name.js)}{JSFILE}
Version 2 of JSFILE includes a head parameter {JSFILE(head=js-file_name.js,file=js-file_name.js)}{JSFILE} which allows JavaScript to be added into the HEAD section on the WIKI page.
This version requires 1 line of code to be added in your header.tpl:
{elseif $forum_info.name ne ''} : {$forum_info.name} {/if} </title> {* --- jscalendar block --- *} {if $feature_jscalendar eq 'y'} <link rel="StyleSheet" href="lib/jscalendar/calendar-system.css" type="text/css"></link>
and insert the line after the /title:
{if $jshead ne ''}{/if}
Your finished code should look like:
{elseif $thread_info.title ne ''} : {$thread_info.title} {elseif $forum_info.name ne ''} : {$forum_info.name} {/if} </title> {if $jshead ne ''}{/if} {* --- jscalendar block --- *} {if $feature_jscalendar eq 'y'} <link rel="StyleSheet" href="lib/jscalendar/calendar-system.css" type="text/css"></link>
This plugin is current under development and available from http://mods.tiki.org