Index: trunk/extensions/TimedText/README |
— | — | @@ -0,0 +1,5 @@ |
| 2 | + |
| 3 | +to enable put |
| 4 | +require_once( "$IP/extensions/TimedText/TimedText.php" ); |
| 5 | + |
| 6 | +in LocalSettings.php |
Index: trunk/extensions/TimedText/TimedText.php |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<?php |
| 3 | +if( !defined( 'MEDIAWIKI' ) ) { |
| 4 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
| 5 | + die( 1 ); |
| 6 | +} |
| 7 | + |
| 8 | +$wgExtensionCredits['other'][] = array( |
| 9 | + 'name' => 'Add TimedText editing', |
| 10 | + 'status' => 'experimental', |
| 11 | + 'author' => 'MediaBot', |
| 12 | + 'version' => '0.1', |
| 13 | + 'url' => 'http://www.example.com', |
| 14 | + 'description' => 'load custom javascript on TimedText edit pages.', |
| 15 | +); |
| 16 | + |
| 17 | +$wgHooks['EditPageBeforeEditToolbar'][] = 'wfAddTimedTextJs'; |
| 18 | + |
| 19 | +function wfAddTimedTextJs( &$toolabar ) { |
| 20 | + global $wgOut, $wgTitle, $action, $wgScriptPath; |
| 21 | + $name = $wgTitle->getPrefixedDBKey(); |
| 22 | + if($action == 'edit' && substr($name, 0, 10) == 'TimedText:') |
| 23 | + { |
| 24 | + //$wgOut->addScriptClass( 'mvTimedTextEdit' ); |
| 25 | + $wgOut->addScriptFile( $wgScriptPath. '/js2/mwEmbed/libTimedText/mvTimeTextEdit.js' ); |
| 26 | + } |
| 27 | + return true; |
| 28 | +} |
| 29 | + |
| 30 | +?> |