r97162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97161‎ | r97162 | r97163 >
Date:15:48, 15 September 2011
Author:catrope
Status:ok
Tags:
Comment:
RL2: Followup r97154, use mw.gadgets instead of mw.gadgetManager
Modified paths:
  • /branches/RL2/extensions/Gadgets/modules/ext.gadgets.gadgetmanager.ui.js (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.gadgetmanager.ui.js
@@ -9,9 +9,9 @@
1010
1111 var
1212 /**
13 - * @var {Object} Local alias to gadgetmananger
 13+ * @var {Object} Local alias to mw.gadgets
1414 */
15 - gm = mw.gadgetManager,
 15+ ga = mw.gadgets,
1616 /**
1717 * @var {Object} HTML fragements
1818 */
@@ -57,7 +57,7 @@
5858 <td><label for="mw-gadgetmanager-input-hidden"><html:msg key="gadgetmanager-prop-hidden"></label></td>\
5959 <td><input type="checkbox" id="mw-gadgetmanager-input-hidden" /></td>\
6060 </tr>\
61 - ' + ( gm.conf.enableSharing ? '<tr>\
 61+ ' + ( ga.conf.enableSharing ? '<tr>\
6262 <td><label for="mw-gadgetmanager-input-shared"><html:msg key="gadgetmanager-prop-shared"></label></td>\
6363 <td><input type="checkbox" id="mw-gadgetmanager-input-shared" /></td>\
6464 </tr>\
@@ -84,7 +84,7 @@
8585 /**
8686 * @var {Object} Complete static cache for all rights.
8787 */
88 - suggestCacheRights = gm.conf.allRights,
 88+ suggestCacheRights = ga.conf.allRights,
8989 /**
9090 * @var {Number} Maximum number of autocomplete suggestions in the gadget editor input fields.
9191 */
@@ -119,7 +119,7 @@
120120
121121 /* Public functions */
122122
123 - gm.ui = {
 123+ ga.ui = {
124124 /**
125125 * Initializes the the page. For now just binding click handlers
126126 * to the anchor tags in the table.
@@ -129,7 +129,7 @@
130130 $( '.mw-gadgetmanager-gadgets .mw-gadgetmanager-gadgets-title a' )
131131 .click( function( e ) {
132132 e.preventDefault();
133 - gm.ui.startGadgetEditor( $( this ).data( 'gadget-id' ) );
 133+ ga.ui.startGadgetEditor( $( this ).data( 'gadget-id' ) );
134134 });
135135 },
136136
@@ -146,19 +146,19 @@
147147 // @todo Notification: In case of an 'error'.
148148 var gadget, cats;
149149
150 - gm.api.getGadgetCategories( function( ret ) {
 150+ ga.api.getGadgetCategories( function( ret ) {
151151 if ( gadget ) {
152152 // getGadgetData already done
153 - return gm.ui.showFancyForm( gadget, ret );
 153+ return ga.ui.showFancyForm( gadget, ret );
154154 }
155155 // getGadgetData not done yet, leave cats for it's callback to use
156156 cats = ret;
157157 });
158158
159 - gm.api.getGadgetData( gadgetId, function( ret ) {
 159+ ga.api.getGadgetData( gadgetId, function( ret ) {
160160 if ( cats ) {
161161 // getGadgetCategories already done
162 - return gm.ui.showFancyForm( ret, cats );
 162+ return ga.ui.showFancyForm( ret, cats );
163163 }
164164 // getGadgetCategories not done yet, leave gadget for it's callback to use
165165 gadget = ret;
@@ -173,19 +173,19 @@
174174 * @return {jQuery} The (dialogged) form.
175175 */
176176 showFancyForm: function( gadget, categories ) {
177 - var $form = gm.ui.getFancyForm( gadget.metadata, categories ),
 177+ var $form = ga.ui.getFancyForm( gadget.metadata, categories ),
178178 buttons = {};
179179
180180 // Form submit
181181 buttons[mw.msg( 'gadgetmanager-editor-save' )] = function() {
182 - gm.api.doModifyGadget( gadget, {
 182+ ga.api.doModifyGadget( gadget, {
183183 starttimestamp: ISODateString( new Date() ),
184184 success: function( response ) {
185185 $form.dialog( 'close' );
186186 window.location.reload();
187187 },
188188 error: function( error ) {
189 - mw.log( 'gm.api.doModifyGadget: error', error );
 189+ mw.log( 'mw.gadgets.api.doModifyGadget: error', error );
190190 // @todo Notification: $formNotif.add( .. );
191191 }
192192 });
@@ -400,6 +400,6 @@
401401 };
402402
403403 // Launch on document ready
404 - $( document ).ready( gm.ui.initUI );
 404+ $( document ).ready( ga.ui.initUI );
405405
406406 })( jQuery );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97154RL2: Rewrite of ext.gadgets.api that Timo and I worked on together at http://......catrope14:17, 15 September 2011

Status & tagging log