| Line 9: |
Line 9: |
| | (function ($, mw, OO) { | | (function ($, mw, OO) { |
| | 'use strict'; | | 'use strict'; |
| − | mw.notify("Runnng Merge gadget")
| |
| | var messages, entityId = mw.config.get('wbEntityId'), api = new mw.Api(); | | var messages, entityId = mw.config.get('wbEntityId'), api = new mw.Api(); |
| | | | |
| Line 798: |
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 939: |
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 951: |
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 991: |
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,113: |
Line 1,112: |
| | // 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 () { |