Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.gadgetmanager.ui.js |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | |
11 | 11 | var |
12 | 12 | /** |
13 | | - * @var {Object} Local alias to gadgetmananger |
| 13 | + * @var {Object} Local alias to mw.gadgets |
14 | 14 | */ |
15 | | - gm = mw.gadgetManager, |
| 15 | + ga = mw.gadgets, |
16 | 16 | /** |
17 | 17 | * @var {Object} HTML fragements |
18 | 18 | */ |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | <td><label for="mw-gadgetmanager-input-hidden"><html:msg key="gadgetmanager-prop-hidden"></label></td>\ |
59 | 59 | <td><input type="checkbox" id="mw-gadgetmanager-input-hidden" /></td>\ |
60 | 60 | </tr>\ |
61 | | - ' + ( gm.conf.enableSharing ? '<tr>\ |
| 61 | + ' + ( ga.conf.enableSharing ? '<tr>\ |
62 | 62 | <td><label for="mw-gadgetmanager-input-shared"><html:msg key="gadgetmanager-prop-shared"></label></td>\ |
63 | 63 | <td><input type="checkbox" id="mw-gadgetmanager-input-shared" /></td>\ |
64 | 64 | </tr>\ |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | /** |
86 | 86 | * @var {Object} Complete static cache for all rights. |
87 | 87 | */ |
88 | | - suggestCacheRights = gm.conf.allRights, |
| 88 | + suggestCacheRights = ga.conf.allRights, |
89 | 89 | /** |
90 | 90 | * @var {Number} Maximum number of autocomplete suggestions in the gadget editor input fields. |
91 | 91 | */ |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | |
121 | 121 | /* Public functions */ |
122 | 122 | |
123 | | - gm.ui = { |
| 123 | + ga.ui = { |
124 | 124 | /** |
125 | 125 | * Initializes the the page. For now just binding click handlers |
126 | 126 | * to the anchor tags in the table. |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | $( '.mw-gadgetmanager-gadgets .mw-gadgetmanager-gadgets-title a' ) |
131 | 131 | .click( function( e ) { |
132 | 132 | e.preventDefault(); |
133 | | - gm.ui.startGadgetEditor( $( this ).data( 'gadget-id' ) ); |
| 133 | + ga.ui.startGadgetEditor( $( this ).data( 'gadget-id' ) ); |
134 | 134 | }); |
135 | 135 | }, |
136 | 136 | |
— | — | @@ -146,19 +146,19 @@ |
147 | 147 | // @todo Notification: In case of an 'error'. |
148 | 148 | var gadget, cats; |
149 | 149 | |
150 | | - gm.api.getGadgetCategories( function( ret ) { |
| 150 | + ga.api.getGadgetCategories( function( ret ) { |
151 | 151 | if ( gadget ) { |
152 | 152 | // getGadgetData already done |
153 | | - return gm.ui.showFancyForm( gadget, ret ); |
| 153 | + return ga.ui.showFancyForm( gadget, ret ); |
154 | 154 | } |
155 | 155 | // getGadgetData not done yet, leave cats for it's callback to use |
156 | 156 | cats = ret; |
157 | 157 | }); |
158 | 158 | |
159 | | - gm.api.getGadgetData( gadgetId, function( ret ) { |
| 159 | + ga.api.getGadgetData( gadgetId, function( ret ) { |
160 | 160 | if ( cats ) { |
161 | 161 | // getGadgetCategories already done |
162 | | - return gm.ui.showFancyForm( ret, cats ); |
| 162 | + return ga.ui.showFancyForm( ret, cats ); |
163 | 163 | } |
164 | 164 | // getGadgetCategories not done yet, leave gadget for it's callback to use |
165 | 165 | gadget = ret; |
— | — | @@ -173,19 +173,19 @@ |
174 | 174 | * @return {jQuery} The (dialogged) form. |
175 | 175 | */ |
176 | 176 | showFancyForm: function( gadget, categories ) { |
177 | | - var $form = gm.ui.getFancyForm( gadget.metadata, categories ), |
| 177 | + var $form = ga.ui.getFancyForm( gadget.metadata, categories ), |
178 | 178 | buttons = {}; |
179 | 179 | |
180 | 180 | // Form submit |
181 | 181 | buttons[mw.msg( 'gadgetmanager-editor-save' )] = function() { |
182 | | - gm.api.doModifyGadget( gadget, { |
| 182 | + ga.api.doModifyGadget( gadget, { |
183 | 183 | starttimestamp: ISODateString( new Date() ), |
184 | 184 | success: function( response ) { |
185 | 185 | $form.dialog( 'close' ); |
186 | 186 | window.location.reload(); |
187 | 187 | }, |
188 | 188 | error: function( error ) { |
189 | | - mw.log( 'gm.api.doModifyGadget: error', error ); |
| 189 | + mw.log( 'mw.gadgets.api.doModifyGadget: error', error ); |
190 | 190 | // @todo Notification: $formNotif.add( .. ); |
191 | 191 | } |
192 | 192 | }); |
— | — | @@ -400,6 +400,6 @@ |
401 | 401 | }; |
402 | 402 | |
403 | 403 | // Launch on document ready |
404 | | - $( document ).ready( gm.ui.initUI ); |
| 404 | + $( document ).ready( ga.ui.initUI ); |
405 | 405 | |
406 | 406 | })( jQuery ); |