Index: trunk/extensions/JS2Support/JS2Support.php |
— | — | @@ -13,70 +13,24 @@ |
14 | 14 | 'descriptionmsg' => 'js2support-desc', |
15 | 15 | ); |
16 | 16 | |
17 | | -$dir = dirname( __FILE__ ) . '/'; |
18 | | -$wgExtensionMessagesFiles[ 'JS2Support' ] = $dir . 'JS2Support.i18n.php'; |
19 | | -$wgAutoloadClasses[ 'ScriptLoaderOutputPage' ] = $dir . 'ScriptLoaderOutputPage.php'; |
| 17 | +$js2Dir = dirname( __FILE__ ) . '/'; |
| 18 | +$wgExtensionMessagesFiles[ 'JS2Support' ] = $js2Dir . 'JS2Support.i18n.php'; |
20 | 19 | |
21 | | -$wgAutoloadClasses = array_merge( $wgAutoloadClasses, |
22 | | - array( |
23 | | - 'JSMin' => $dir . 'js/mwEmbed/includes/library/JSMin.php', |
24 | | - 'Minify_CSS' => $dir . 'js/mwEmbed/includes/library/CSS.php', |
25 | | - 'Minify_CommentPreserver' => $dir . 'js/mwEmbed/includes/library/CommentPreserver.php', |
26 | | - 'Minify_CSS_Compressor' => $dir . 'js/mwEmbed/includes/library/CSS/Compressor.php', |
27 | | - 'Minify_CSS_UriRewriter' => $dir . 'js/mwEmbed/includes/library/CSS/UriRewriter.php', |
28 | | - 'JSMinException' => $dir . 'js/mwEmbed/includes/minify/JSMin.php', |
29 | | - 'jsScriptLoader' => $dir . 'js/mwEmbed/jsScriptLoader.php', |
30 | | - 'jsClassLoader' => $dir . 'js/mwEmbed/includes/jsClassLoader.php', |
31 | | - 'simpleFileCache' => $dir . 'js/mwEmbed/jsScriptLoader.php', |
32 | | - ) |
33 | | -); |
34 | 20 | |
35 | | -// Autoloader for core mediaWiki JavaScript files (path is from the MediaWiki root folder) |
36 | | -// All other named paths should be merged with this global |
37 | | -$wgScriptLoaderNamedPaths = array( |
38 | | - 'ajax' => 'skins/common/ajax.js', |
39 | | - 'ajaxwatch' => 'skins/common/ajaxwatch.js', |
40 | | - 'allmessages' => 'skins/common/allmessages.js', |
41 | | - 'block' => 'skins/common/block.js', |
42 | | - 'changepassword' => 'skins/common/changepassword.js', |
43 | | - 'diff' => 'skins/common/diff.js', |
44 | | - 'edit' => 'skins/common/edit.js', |
45 | | - 'enhancedchanges.js' => 'skins/common/enhancedchanges.js', |
46 | | - 'history' => 'skins/common/history.js', |
47 | | - 'htmlform' => 'skins/common/htmlform.js', |
48 | | - 'IEFixes' => 'skins/common/IEFixes.js', |
49 | | - 'metadata' => 'skins/common/metadata.js', |
50 | | - 'mwsuggest' => 'skins/common/mwsuggest.js', |
51 | | - 'prefs' => 'skins/common/prefs.js', |
52 | | - 'preview' => 'skins/common/preview.js', |
53 | | - 'protect' => 'skins/common/protect.js', |
54 | | - 'rightclickedit' => 'skins/common/rightclickedit.js', |
55 | | - 'sticky' => 'skins/common/sticky.js', |
56 | | - 'upload' => 'skins/common/upload.js', |
57 | | - 'wikibits' => 'skins/common/wikibits.js', |
58 | | - |
59 | | - // Css bindings |
60 | | - 'mw.style.shared' => 'skins/common/shared.css', |
61 | | - 'mw.style.commonPrint' => 'skins/common/commonPrint.css', |
62 | | - 'mw.style.vectorMainLTR' => 'skins/vector/main-ltr.css', |
63 | | - 'mw.style.vectorMainRTR' => 'skins/vector/main-rtl.css', |
64 | | - |
65 | | - // Monobook css |
66 | | - 'mw.sytle.mbMain' => 'skins/monobook/main.css', |
67 | | - 'mw.style.mbIE5' => 'skins/monobook/IE50Fixes.css', |
68 | | - 'mw.style.mbIE55' => 'skins/monobook/IE55Fixes.css', |
69 | | - 'mw.style.mbIE60' => 'skins/skins/monobook/IE60Fixes.css', |
70 | | - 'mw.style.mbIE7' => 'skins/monobook/IE70Fixes.css', |
71 | | -); |
72 | | - |
73 | | - |
74 | 21 | /** |
75 | | - * Remap output page |
| 22 | + * Setup the js2 extension: |
76 | 23 | */ |
77 | 24 | $wgExtensionFunctions[] = 'wfReMapOutputPage'; |
78 | 25 | function wfReMapOutputPage(){ |
79 | | - global $wgOut; |
| 26 | + global $wgOut, $js2Dir, $wgAutoloadClasses, $wgScriptLoaderNamedPaths; |
| 27 | + |
| 28 | + // Remap output page as part of the extension setup |
80 | 29 | $wgOut = new StubObject( 'wgOut', 'ScriptLoaderOutputPage' ); |
| 30 | + |
| 31 | + $wgAutoloadClasses[ 'ScriptLoaderOutputPage' ] = $js2Dir . 'ScriptLoaderOutputPage.php'; |
| 32 | + |
| 33 | + // Include all the mediaWiki autoload classes: |
| 34 | + require( $js2Dir . 'JS2AutoLoader.php'); |
81 | 35 | } |
82 | 36 | |
83 | 37 | /** |
— | — | @@ -93,13 +47,9 @@ |
94 | 48 | return true; |
95 | 49 | } |
96 | 50 | |
97 | | -/*************************** |
98 | | -* LocalSettings.php enabled js extensions |
99 | | -****************************/ |
100 | | -require_once( $dir . 'AddMediaWizard/AddMediaWizard.php' ); |
101 | | - |
102 | 51 | /**************************** |
103 | | -* DefaultSettings.php |
| 52 | +* Configuration |
| 53 | +* Could eventually go into DefaultSettings.php |
104 | 54 | *****************************/ |
105 | 55 | |
106 | 56 | /* |
— | — | @@ -114,6 +64,11 @@ |
115 | 65 | */ |
116 | 66 | $wgExtensionJavascriptLoader = array(); |
117 | 67 | |
| 68 | +/** |
| 69 | + * The set of script-loader Named Paths, populated via extensions and javascript module loaders |
| 70 | + */ |
| 71 | +$wgScriptLoaderNamedPaths = array(); |
| 72 | + |
118 | 73 | /* |
119 | 74 | * $wgEnableScriptLoader; If the script loader should be used to group all javascript requests. |
120 | 75 | * more about the script loader: http://www.mediawiki.org/wiki/ScriptLoader |
— | — | @@ -153,16 +108,12 @@ |
154 | 109 | $wgClosureCompilerLevel = 'SIMPLE_OPTIMIZATIONS'; |
155 | 110 | |
156 | 111 | /* |
157 | | - * $wgScriptModifiedMsgCheck Checks MediaWiki NS for latest |
| 112 | + * $wgScriptModifiedMsgCheck Checks MediaWiki NS for latest messege |
158 | 113 | * Revision for generating the request id. |
159 | 114 | * |
160 | 115 | */ |
161 | 116 | $wgScriptModifiedMsgCheck = false; |
162 | 117 | |
163 | | -/** |
164 | | - * If the api iframe proxy should be enabled or not. |
165 | | - */ |
166 | | -$wgEnableIframeApiProxy = false; |
167 | 118 | |
168 | 119 | /** |
169 | 120 | * boolean; if we should enable javascript localization (it loads mw.addMessages json |
— | — | @@ -173,7 +124,7 @@ |
174 | 125 | /** |
175 | 126 | * Path for mwEmbed normally js/mwEmbed/ |
176 | 127 | */ |
177 | | -$wgMwEmbedDirectory = "extensions/JS2Support/js/mwEmbed"; |
| 128 | +$wgMwEmbedDirectory = "extensions/JS2Support/mwEmbed"; |
178 | 129 | |
179 | 130 | /** |
180 | 131 | * Enables javascript on debugging |
Index: trunk/extensions/JS2Support/JS2AutoLoader.php |
— | — | @@ -1,23 +1,22 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -/**************************** |
| 4 | +/**************************** |
5 | 5 | * JS2 AutoLoader.php |
6 | 6 | *****************************/ |
7 | | -$mwEmbedAutoLoadClasses = array( |
8 | | - 'JSMin' => $dir . 'mwEmbed/includes/library/JSMin.php', |
9 | | - 'Minify_CSS' => $dir . 'mwEmbed/includes/library/CSS.php', |
10 | | - 'Minify_CommentPreserver' => $dir . 'mwEmbed/includes/library/CommentPreserver.php', |
11 | | - 'Minify_CSS_Compressor' => $dir . 'mwEmbed/includes/library/CSS/Compressor.php', |
12 | | - 'Minify_CSS_UriRewriter' => $dir . 'mwEmbed/includes/library/CSS/UriRewriter.php', |
13 | | - 'JSMinException' => $dir . 'mwEmbed/includes/minify/JSMin.php', |
14 | | - 'jsScriptLoader' => $dir . 'mwEmbed/jsScriptLoader.php', |
15 | | - 'jsClassLoader' => $dir . 'mwEmbed/includes/jsClassLoader.php', |
16 | | - 'simpleFileCache' => $dir . 'mwEmbed/jsScriptLoader.php', |
17 | | -); |
18 | | -$wgAutoloadClasses = array_merge( $wgAutoloadClasses, $mwEmbedAutoLoadClasses); |
| 7 | +$wgAutoloadClasses = array_merge( $wgAutoloadClasses, array( |
| 8 | + 'JSMin' => $js2Dir . 'mwEmbed/includes/library/JSMin.php', |
| 9 | + 'Minify_CSS' => $js2Dir . 'mwEmbed/includes/library/CSS.php', |
| 10 | + 'Minify_CommentPreserver' => $js2Dir . 'mwEmbed/includes/library/CommentPreserver.php', |
| 11 | + 'Minify_CSS_Compressor' => $js2Dir . 'mwEmbed/includes/library/CSS/Compressor.php', |
| 12 | + 'Minify_CSS_UriRewriter' => $js2Dir . 'mwEmbed/includes/library/CSS/UriRewriter.php', |
| 13 | + 'JSMinException' => $js2Dir . 'mwEmbed/includes/minify/JSMin.php', |
| 14 | + 'jsScriptLoader' => $js2Dir . 'mwEmbed/jsScriptLoader.php', |
| 15 | + 'jsClassLoader' => $js2Dir . 'mwEmbed/includes/jsClassLoader.php', |
| 16 | + 'simpleFileCache' => $js2Dir . 'mwEmbed/jsScriptLoader.php', |
| 17 | +)); |
19 | 18 | |
20 | 19 | // Autoloader for core mediaWiki JavaScript files (path is from the MediaWiki folder) |
21 | | -$wgJSAutoloadLocalClasses = array( |
| 20 | +$wgScriptLoaderNamedPaths = array_merge( $wgScriptLoaderNamedPaths, array( |
22 | 21 | 'ajax' => 'skins/common/ajax.js', |
23 | 22 | 'ajaxwatch' => 'skins/common/ajaxwatch.js', |
24 | 23 | 'allmessages' => 'skins/common/allmessages.js', |
— | — | @@ -38,11 +37,6 @@ |
39 | 38 | 'sticky' => 'skins/common/sticky.js', |
40 | 39 | 'upload' => 'skins/common/upload.js', |
41 | 40 | 'wikibits' => 'skins/common/wikibits.js', |
| 41 | +) ); |
42 | 42 | |
43 | | - // js2 entry points |
44 | | - 'uploadPage' => $dir . 'uploadPage.js', |
45 | | - 'editPage' => $dir . 'editPage.js', |
46 | | - 'ajaxCategories' => $dir . 'ajaxcategories.js', |
47 | | - 'apiProxyPage' => $dir . 'apiProxyPage.js' |
48 | | -); |
49 | 43 | ?> |
Index: trunk/extensions/JS2Support/mwScriptLoader.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | // Set a constant so the script-loader knows its not being used in "stand alone mode" |
29 | 29 | define( 'SCRIPTLOADER_MEDIAWIKI', true); |
30 | 30 | |
31 | | -require_once( dirname(__FILE__) . '/js/mwEmbed/jsScriptLoader.php'); |
| 31 | +require_once( dirname(__FILE__) . '/mwEmbed/jsScriptLoader.php'); |
32 | 32 | // Do quick cache check via jsScriptLoader |
33 | 33 | $myScriptLoader = new jsScriptLoader(); |
34 | 34 | if( $myScriptLoader->outputFromCache() ){ |
Index: trunk/extensions/JS2Support/README |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | # Upload Wizard |
39 | 39 | require_once( "$IP/extensions/UploadWizard/UploadWizard.php" ); |
40 | 40 | |
41 | | -# Ogg Handler with html5 player, transcoding + subtitle support. |
| 41 | +# TimedMediaHandler, update to Ogg Handler with html5 player, multi-format transcoding & subtitle support. |
42 | 42 | require_once( "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php" ); |
43 | 43 | |
44 | 44 | |