| Index: trunk/extensions/Translate/Translate.php |
| — | — | @@ -168,6 +168,10 @@ |
| 169 | 169 | 'scripts' => 'resources/ext.translate.special.importtranslations.js', |
| 170 | 170 | ) + $resourcePaths; |
| 171 | 171 | |
| | 172 | +$wgResourceModules['ext.translate.selecttoinput'] = array( |
| | 173 | + 'scripts' => 'resources/ext.translate.selecttoinput.js', |
| | 174 | +) + $resourcePaths; |
| | 175 | + |
| 172 | 176 | $wgResourceModules['jquery.autoresize'] = array( |
| 173 | 177 | 'scripts' => 'resources/jquery.autoresize.js', |
| 174 | 178 | ) + $resourcePaths; |
| Index: trunk/extensions/Translate/utils/JsSelectToInput.js |
| — | — | @@ -1,11 +0,0 @@ |
| 2 | | -function appendFromSelect(selectid,targetid) { |
| 3 | | - var select = document.getElementById(selectid); |
| 4 | | - var target = document.getElementById(targetid); |
| 5 | | - if(!target || !select) return; |
| 6 | | - var atxt = select.options[select.selectedIndex].value; |
| 7 | | - if(!atxt) return; |
| 8 | | - /* Ugly hack */ |
| 9 | | - target.value = target.value.replace(/default/, '' ); |
| 10 | | - if(target.value.replace(/[\s\t\n]/ig,'') != '') atxt = ', ' + atxt; |
| 11 | | - target.value += atxt; |
| 12 | | -} |
| Index: trunk/extensions/Translate/utils/JsSelectToInput.php |
| — | — | @@ -112,6 +112,6 @@ |
| 113 | 113 | if ( $done ) return; |
| 114 | 114 | |
| 115 | 115 | global $wgOut; |
| 116 | | - $wgOut->addScriptFile( TranslateUtils::assetPath( 'utils/JsSelectToInput.js' ) ); |
| | 116 | + $wgOut->addModules( 'ext.translate.selecttoinput' ); |
| 117 | 117 | } |
| 118 | 118 | } |
| Index: trunk/extensions/Translate/utils/UserToggles.php |
| — | — | @@ -63,6 +63,7 @@ |
| 64 | 64 | 'help-message' => 'translate-pref-editassistlang-help', |
| 65 | 65 | 'select' => $select, |
| 66 | 66 | 'valid-values' => array_keys( $languages ), |
| | 67 | + 'name' => 'translate-editlangs', |
| 67 | 68 | ); |
| 68 | 69 | |
| 69 | 70 | return true; |
| Index: trunk/extensions/Translate/resources/ext.translate.selecttoinput.js |
| — | — | @@ -0,0 +1,11 @@ |
| | 2 | +window.appendFromSelect = function(selectid,targetid) { |
| | 3 | + var select = document.getElementById(selectid); |
| | 4 | + var target = document.getElementById(targetid); |
| | 5 | + if(!target || !select) return; |
| | 6 | + var atxt = select.options[select.selectedIndex].value; |
| | 7 | + if(!atxt) return; |
| | 8 | + /* Ugly hack */ |
| | 9 | + target.value = target.value.replace(/default/, '' ); |
| | 10 | + if(target.value.replace(/[\s\t\n]/ig,'') != '') atxt = ', ' + atxt; |
| | 11 | + target.value += atxt; |
| | 12 | +} |
| Property changes on: trunk/extensions/Translate/resources/ext.translate.selecttoinput.js |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 13 | + native |