Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -164,6 +164,10 @@ |
165 | 165 | 'styles' => 'resources/ext.translate.special.supportedlanguages.css', |
166 | 166 | ) + $resourcePaths; |
167 | 167 | |
| 168 | +$wgResourceModules['ext.translate.special.importtranslations'] = array( |
| 169 | + 'scripts' => 'resources/ext.translate.special.importtranslations.js', |
| 170 | +) + $resourcePaths; |
| 171 | + |
168 | 172 | $wgResourceModules['jquery.autoresize'] = array( |
169 | 173 | 'scripts' => 'resources/jquery.autoresize.js', |
170 | 174 | ) + $resourcePaths; |
Index: trunk/extensions/Translate/specials/SpecialImportTranslations.php |
— | — | @@ -117,8 +117,7 @@ |
118 | 118 | protected function outputForm() { |
119 | 119 | global $wgOut; |
120 | 120 | |
121 | | - $wgOut->includeJQuery(); |
122 | | - $this->out->addScriptFile( TranslateUtils::assetPath( 'js/import.js' ) ); |
| 121 | + $wgOut->addModules( 'ext.translate.special.importtranslations' ); |
123 | 122 | |
124 | 123 | /** |
125 | 124 | * Ugly but necessary form building ahead, ohoy |
Index: trunk/extensions/Translate/resources/import.js |
— | — | @@ -1,15 +0,0 @@ |
2 | | -/** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */ |
3 | | -function translateImportInit(){ |
4 | | - os_initHandlers( 'mw-translate-up-wiki-input', 'mw-translate-import', document.getElementById('mw-translate-up-wiki-input') ); |
5 | | - |
6 | | - jQuery(".mw-translate-import-inputs").each(function(i) { |
7 | | - os_hookEvent(this, "focus", function(event) { |
8 | | - var srcid = os_getTarget(event).id; |
9 | | - var inputid = srcid.replace("-input", ""); |
10 | | - |
11 | | - jQuery("#" + inputid).attr("checked", "checked"); |
12 | | - }); |
13 | | - }); |
14 | | -} |
15 | | - |
16 | | -hookEvent("load", translateImportInit); |
\ No newline at end of file |
Index: trunk/extensions/Translate/resources/ext.translate.special.importtranslations.js |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +/** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */ |
| 3 | +function translateImportInit(){ |
| 4 | + os_initHandlers( 'mw-translate-up-wiki-input', 'mw-translate-import', document.getElementById('mw-translate-up-wiki-input') ); |
| 5 | + |
| 6 | + jQuery(".mw-translate-import-inputs").each(function(i) { |
| 7 | + os_hookEvent(this, "focus", function(event) { |
| 8 | + var srcid = os_getTarget(event).id; |
| 9 | + var inputid = srcid.replace("-input", ""); |
| 10 | + |
| 11 | + jQuery("#" + inputid).attr("checked", "checked"); |
| 12 | + }); |
| 13 | + }); |
| 14 | +} |
| 15 | + |
| 16 | +hookEvent("load", translateImportInit); |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/resources/ext.translate.special.importtranslations.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 17 | + native |