Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.gadgetmanager.js |
— | — | @@ -93,7 +93,9 @@ |
94 | 94 | /** |
95 | 95 | * @var {Number} Maximum number of autocomplete suggestions in the gadget editor input fields. |
96 | 96 | */ |
97 | | - suggestLimit = 7; |
| 97 | + suggestLimit = 7, |
| 98 | + nsGadgetId = mw.config.get( 'wgNamespaceIds' ).gadget, |
| 99 | + nsSpecialId = mw.config.get( 'wgNamespaceIds' ).special; |
98 | 100 | |
99 | 101 | /* Local functions */ |
100 | 102 | |
— | — | @@ -178,11 +180,11 @@ |
179 | 181 | ga.ui.startGadgetManager( id ); |
180 | 182 | return; |
181 | 183 | } |
182 | | - // Use localized page name if possible to avoid redirect |
| 184 | + // Use localized special page name if possible to avoid redirect |
183 | 185 | if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Gadgets' ) { |
184 | | - t = new mw.Title( mw.config.get( 'wgTitle' ) + '/' + id, -1 ); |
| 186 | + t = new mw.Title( mw.config.get( 'wgTitle' ) + '/' + id, nsSpecialId ); |
185 | 187 | } else { |
186 | | - t = new mw.Title( 'Gadgets/' + id, -1 ); |
| 188 | + t = new mw.Title( 'Gadgets/' + id, nsSpecialId ); |
187 | 189 | } |
188 | 190 | window.location.href = t.getUrl(); |
189 | 191 | |
— | — | @@ -344,8 +346,7 @@ |
345 | 347 | * @return {jQuery} The form. |
346 | 348 | */ |
347 | 349 | getFancyForm: function( gadget, categories, mode ) { |
348 | | - var nsGadgetId = mw.config.get( 'wgNamespaceIds' ).gadget, |
349 | | - metadata = gadget.metadata, |
| 350 | + var metadata = gadget.metadata, |
350 | 351 | $form = $( tpl.fancyForm ).localize(), |
351 | 352 | $idSpan = $form.find( '.mw-gadgetmanager-id' ), |
352 | 353 | $idErrMsg = $form.find( '.mw-gadgetmanager-id-errorbox' ); |