| 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 671: |
Line 666: |
| | mw.storage.remove('merge-pending-id'); | | mw.storage.remove('merge-pending-id'); |
| | } | | } |
| − |
| |
| | | | |
| | /** | | /** |
| Line 713: |
Line 707: |
| | }); | | }); |
| | } | | } |
| − |
| |
| | | | |
| | /** | | /** |
| 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] ); |
| | }); | | }); |
| | }; | | }; |
| − |
| |
| | | | |
| | /** | | /** |
| Line 946: |
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 958: |
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 998: |
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,117: |
Line 1,109: |
| | windowManager.openWindow(dialog); | | windowManager.openWindow(dialog); |
| | } | | } |
| − | mw.notify("Mergiiing")
| |
| | | | |
| | // 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,173: |
Line 1,164: |
| | launchDialog: launchDialog | | launchDialog: launchDialog |
| | }; | | }; |
| − |
| |
| | }(jQuery, mediaWiki, OO)); | | }(jQuery, mediaWiki, OO)); |