| Line 6: |
Line 6: |
| | */ | | */ |
| | // See also: MediaWiki:Gadget-EmptyDetect.js and MediaWiki:Gadget-RfDHelper.js | | // See also: MediaWiki:Gadget-EmptyDetect.js and MediaWiki:Gadget-RfDHelper.js |
| − |
| |
| − |
| |
| | | | |
| | (function ($, mw, OO) { | | (function ($, mw, OO) { |
| | + | 'use strict'; |
| | + | var messages, entityId = mw.config.get('wbEntityId'), api = new mw.Api(); |
| | | | |
| − | 'use strict';
| |
| − | var messages;
| |
| − | var entityId = mw.config.get( 'wbEntityId' );
| |
| − | var api = new mw.Api();
| |
| − | mw.notify("Got API "+ entityId);
| |
| | messages = (function () { | | messages = (function () { |
| | var translations = { | | var translations = { |
| Line 644: |
Line 639: |
| | return ret; | | return ret; |
| | }()); | | }()); |
| − | mw.notify("read messages");
| + | |
| | /** | | /** |
| | * Retrieve items by id | | * Retrieve items by id |
| Line 671: |
Line 666: |
| | mw.storage.remove('merge-pending-id'); | | mw.storage.remove('merge-pending-id'); |
| | } | | } |
| − |
| |
| | | | |
| | /** | | /** |
| Line 713: |
Line 707: |
| | }); | | }); |
| | } | | } |
| − |
| |
| | | | |
| | /** | | /** |
| Line 757: |
Line 750: |
| | } | | } |
| | OO.mixinClass(Merger, OO.EventEmitter); | | OO.mixinClass(Merger, OO.EventEmitter); |
| − | mw.notify("added mixin")
| + | |
| | /** | | /** |
| | * Merge process | | * Merge process |
| Line 804: |
Line 797: |
| | } | | } |
| | }, function (code, result) { | | }, function (code, result) { |
| − | self.emit('error', result.error.extradata[0] || result.error.info); | + | self.emit('error', result.error.info || result.error.extradata[0] ); |
| | }); | | }); |
| | }; | | }; |
| − | mw.notify("added merger")
| |
| | | | |
| | /** | | /** |
| Line 864: |
Line 856: |
| | } | | } |
| | OO.inheritClass(MergeDialog, OO.ui.ProcessDialog); | | OO.inheritClass(MergeDialog, OO.ui.ProcessDialog); |
| − | mw.notify("inherited")
| |
| | | | |
| | MergeDialog.static.name = 'mergeDialog'; | | MergeDialog.static.name = 'mergeDialog'; |
| Line 888: |
Line 879: |
| | } | | } |
| | ]; | | ]; |
| − | mw.notify("merge dialog")
| + | |
| | /** | | /** |
| | * @inheritdoc | | * @inheritdoc |
| Line 947: |
Line 938: |
| | ]); | | ]); |
| | this.mergeUnwatch = new OO.ui.CheckboxInputWidget({ | | this.mergeUnwatch = new OO.ui.CheckboxInputWidget({ |
| − | selected: mw.storage.get('merge-unwatch') === true | + | selected: mw.storage.get('merge-unwatch') === 'true' |
| | }); | | }); |
| | fieldset.addItems([ | | fieldset.addItems([ |
| Line 959: |
Line 950: |
| | ]); | | ]); |
| | this.loadMergeDestination = new OO.ui.CheckboxInputWidget({ | | this.loadMergeDestination = new OO.ui.CheckboxInputWidget({ |
| − | selected: mw.storage.get('merge-load-destination') !== false | + | selected: mw.storage.get('merge-load-destination') !== 'false' |
| | }); | | }); |
| | fieldset.addItems([ | | fieldset.addItems([ |
| Line 999: |
Line 990: |
| | */ | | */ |
| | MergeDialog.prototype.saveOptions = function () { | | MergeDialog.prototype.saveOptions = function () { |
| − | mw.storage.set('merge-always-lowest-id', this.mergeAlwaysLowestId.isSelected()); | + | mw.storage.set('merge-always-lowest-id', this.mergeAlwaysLowestId.isSelected().toString()); |
| − | mw.storage.set('merge-unwatch', this.mergeUnwatch.isSelected()); | + | mw.storage.set('merge-unwatch', this.mergeUnwatch.isSelected().toString()); |
| − | mw.storage.set('merge-create-redirect', this.mergeCreateRedirect.isSelected()); | + | mw.storage.set('merge-create-redirect', this.mergeCreateRedirect.isSelected().toString()); |
| − | mw.storage.set('merge-load-destination', this.loadMergeDestination.isSelected()); | + | mw.storage.set('merge-load-destination', this.loadMergeDestination.isSelected().toString()); |
| | }; | | }; |
| | | | |
| Line 1,118: |
Line 1,109: |
| | windowManager.openWindow(dialog); | | windowManager.openWindow(dialog); |
| | } | | } |
| − | mw.notify("Merging")
| |
| | | | |
| | // Initialization | | // Initialization |
| | if (entityId !== null && | | if (entityId !== null && |
| − | [0, 146].indexOf(mw.config.get('wgNamespaceNumber')) !== -1 && | + | [120, 146].indexOf(mw.config.get('wgNamespaceNumber')) !== -1 && |
| | mw.config.get('wgAction') === 'view') { | | mw.config.get('wgAction') === 'view') { |
| | $(window).on('focus storage', function () { | | $(window).on('focus storage', function () { |
| Line 1,174: |
Line 1,164: |
| | launchDialog: launchDialog | | launchDialog: launchDialog |
| | }; | | }; |
| − |
| |
| | }(jQuery, mediaWiki, OO)); | | }(jQuery, mediaWiki, OO)); |