Difference between revisions of "Extension:Javascript"
From Organic Design wiki
(Use this to manage what JS gets loaded) |
m |
||
Line 7: | Line 7: | ||
if (!defined('MEDIAWIKI')) die('Not an entry point.'); | if (!defined('MEDIAWIKI')) die('Not an entry point.'); | ||
− | define('JAVASCRIPT_VERSION','0.0.0, 2007-06- | + | define('JAVASCRIPT_VERSION','0.0.0, 2007-06-25'); |
− | $wgExtensionFunctions[] = ' | + | $wgExtensionFunctions[] = 'wfSetupJavascript'; |
− | $wgExtensionCredits[' | + | $wgExtensionCredits['other'][] = array( |
'name' => 'Javascript', | 'name' => 'Javascript', | ||
'author' => '[http://www.organicdesign.co.nz/nad User:Nad]', | 'author' => '[http://www.organicdesign.co.nz/nad User:Nad]', | ||
Line 20: | Line 20: | ||
# Notes: | # Notes: | ||
− | # Load all files in $JavascriptDirectory into $ | + | # Load all files in $JavascriptDirectory into $JavascriptScripts using filename as key |
# Other extensions can add to the list if they need to | # Other extensions can add to the list if they need to | ||
# After all extenions are loaded and $wgOut is established, add all the script | # After all extenions are loaded and $wgOut is established, add all the script | ||
+ | |||
+ | function wfSetupJavascript() { | ||
+ | global $wgOut,$JavascriptDirectory,$JavascriptScripts; | ||
+ | } | ||
+ | |||
?> | ?> |
Revision as of 00:50, 25 June 2007
<?php
- Extension:JavascriptTemplate:Php
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: http://www.organicdesign.co.nz/nad
- - Started: 2007-06-25, see article history
if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('JAVASCRIPT_VERSION','0.0.0, 2007-06-25');
$wgExtensionFunctions[] = 'wfSetupJavascript';
$wgExtensionCredits['other'][] = array( 'name' => 'Javascript', 'author' => 'User:Nad', 'description' => 'Handles the loading of Javascript files', 'url' => 'http://www.mediawiki.org/wiki/Extension:Javascript', 'version' => JAVASCRIPT_VERSION );
- Notes:
- Load all files in $JavascriptDirectory into $JavascriptScripts using filename as key
- Other extensions can add to the list if they need to
- After all extenions are loaded and $wgOut is established, add all the script
function wfSetupJavascript() { global $wgOut,$JavascriptDirectory,$JavascriptScripts; }
?>