Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/159555
Change subject: Kill super
......................................................................
Kill super
Pave the way for using OOJS's class system.
Dependency: I37fa38b955104692ad544c71aaada9d48d209fcc
Change-Id: Ia099c4ad3b44493d6f376dcd4381e9a47329e0fe
---
M javascripts/common/CtaDrawer.js
M javascripts/common/Page.js
M javascripts/common/PageApi.js
M javascripts/common/Section.js
M javascripts/common/api.js
M javascripts/common/toast.js
M javascripts/modules/PageList.js
M javascripts/modules/editor/AbuseFilterOverlay.js
M javascripts/modules/editor/AbuseFilterPanel.js
M javascripts/modules/editor/EditorApi.js
M javascripts/modules/editor/EditorOverlay.js
M javascripts/modules/editor/EditorOverlayBase.js
M javascripts/modules/editor/VisualEditorOverlay.js
M javascripts/modules/languages/LanguageOverlay.js
M javascripts/modules/mediaViewer/ImageApi.js
M javascripts/modules/mediaViewer/ImageOverlay.js
M javascripts/modules/nearby/Nearby.js
M javascripts/modules/nearby/NearbyOverlay.js
M javascripts/modules/nearby/PagePreviewOverlay.js
M javascripts/modules/notifications/NotificationsOverlay.js
M javascripts/modules/search/SearchApi.js
M javascripts/modules/search/SearchOverlay.js
M javascripts/modules/talk/TalkOverlay.js
M javascripts/modules/talk/TalkSectionAddOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
M javascripts/modules/toc/toc.js
M javascripts/modules/tutorials/ContentOverlay.js
M javascripts/modules/uploads/LeadPhotoUploaderButton.js
M javascripts/modules/uploads/PhotoApi.js
M javascripts/modules/uploads/PhotoUploadOverlay.js
M javascripts/modules/uploads/PhotoUploadProgress.js
M javascripts/modules/uploads/UploadTutorial.js
M javascripts/modules/watchstar/Watchstar.js
M javascripts/modules/wikigrok/WikiGrokDrawer.js
M javascripts/specials/uploads.js
35 files changed, 84 insertions(+), 84 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/55/159555/1
diff --git a/javascripts/common/CtaDrawer.js b/javascripts/common/CtaDrawer.js
index bdf0781..ce1c37f 100644
--- a/javascripts/common/CtaDrawer.js
+++ b/javascripts/common/CtaDrawer.js
@@ -33,8 +33,8 @@
if ( self.$( '.edit-anon' ) ) {
self.$( '.edit-anon' ).click( $.proxy( self,
'hide' ) );
}
- self._super();
- },
+ Drawer.prototype.postRender.apply( self, arguments );
+ }
} );
M.define( 'CtaDrawer', CtaDrawer );
diff --git a/javascripts/common/Page.js b/javascripts/common/Page.js
index 3920779..a898725 100644
--- a/javascripts/common/Page.js
+++ b/javascripts/common/Page.js
@@ -39,7 +39,7 @@
// Surface the display title for M.reloadPage
this.displayTitle = options.displayTitle;
options.languageUrl = mw.util.getUrl(
'Special:MobileLanguages/' + options.title );
- this._super( options );
+ View.prototype.initialize.apply( this, arguments );
},
/**
@@ -86,7 +86,7 @@
// FIXME: The Page object is pretty central and used more like
a model at times than a view. Time to introduce Models?
render: function( options ) {
var pageTitle = options.title, self = this,
- $el = this.$el, _super = self._super;
+ $el = this.$el;
// prevent talk icon being re-rendered after an edit to
a talk page
options.isTalkPage = self.isTalkPage();
@@ -100,7 +100,7 @@
// Resurface the display title for
M.reloadPage
self.displayTitle =
options.displayTitle;
- _super.call( self, options );
+ View.prototype.render.apply( self,
arguments );
// reset loader
$el.removeClass( 'spinner loading' );
@@ -108,7 +108,7 @@
self.emit( 'ready', self );
} ).fail( $.proxy( self, 'emit', 'error' ) );
} else {
- self._super( options );
+ View.prototype.render.apply( self, arguments );
}
},
diff --git a/javascripts/common/PageApi.js b/javascripts/common/PageApi.js
index 3eafed9..dca9cdd 100644
--- a/javascripts/common/PageApi.js
+++ b/javascripts/common/PageApi.js
@@ -52,7 +52,7 @@
*/
PageApi = Api.extend( {
initialize: function() {
- this._super();
+ Api.prototype.initialize.apply( this, arguments );
this.cache = {};
},
diff --git a/javascripts/common/Section.js b/javascripts/common/Section.js
index 1f51be9..cf4a151 100644
--- a/javascripts/common/Section.js
+++ b/javascripts/common/Section.js
@@ -27,7 +27,7 @@
$.each( options.children || [], function() {
self.children.push( new Section( this ) );
} );
- this._super( options );
+ View.prototype.initialize.apply( self, arguments );
}
} );
M.define( 'Section', Section );
diff --git a/javascripts/common/api.js b/javascripts/common/api.js
index 562fd55..a7a2527 100644
--- a/javascripts/common/api.js
+++ b/javascripts/common/api.js
@@ -13,8 +13,6 @@
apiUrl: mw.util.wikiScript( 'api' ),
/**
- * Constructor, if you override it, use _super().
- *
* @method
*/
initialize: function() {
diff --git a/javascripts/common/toast.js b/javascripts/common/toast.js
index 62c7cd0..eb66c8d 100644
--- a/javascripts/common/toast.js
+++ b/javascripts/common/toast.js
@@ -19,7 +19,7 @@
removeAttr( 'class' ).
addClass( this.className ).
addClass( className );
- this._super();
+ Drawer.prototype.show.apply( this, arguments );
}
} );
diff --git a/javascripts/modules/PageList.js b/javascripts/modules/PageList.js
index 0d63a2b..e91ad93 100644
--- a/javascripts/modules/PageList.js
+++ b/javascripts/modules/PageList.js
@@ -19,11 +19,11 @@
}
this.api = new WatchstarApi( options );
- this._super( options );
+ View.prototype.initialize.apply( this, arguments );
},
template: M.template.get( 'articleList.hogan' ),
- postRender: function( options ) {
- this._super( options );
+ postRender: function() {
+ View.prototype.postRender.apply( this, arguments );
var pages = [], $li = this.$( 'li' ),
api = this.api;
diff --git a/javascripts/modules/editor/AbuseFilterOverlay.js
b/javascripts/modules/editor/AbuseFilterOverlay.js
index 76e1ebe..3c3c5fb 100644
--- a/javascripts/modules/editor/AbuseFilterOverlay.js
+++ b/javascripts/modules/editor/AbuseFilterOverlay.js
@@ -10,7 +10,7 @@
className: 'overlay abusefilter-overlay',
postRender: function () {
- this._super();
+ Overlay.prototype.postRender.apply( this, arguments );
// make links open in separate tabs
this.$( 'a' ).attr( 'target', '_blank' );
}
diff --git a/javascripts/modules/editor/AbuseFilterPanel.js
b/javascripts/modules/editor/AbuseFilterPanel.js
index 2d3d74d..e42c132 100644
--- a/javascripts/modules/editor/AbuseFilterPanel.js
+++ b/javascripts/modules/editor/AbuseFilterPanel.js
@@ -12,7 +12,7 @@
className: 'panel hidden',
initialize: function() {
- this._super();
+ View.prototype.initialize.apply( this, arguments );
this.isDisallowed = false;
},
diff --git a/javascripts/modules/editor/EditorApi.js
b/javascripts/modules/editor/EditorApi.js
index aa7cb4c..efb6c15 100644
--- a/javascripts/modules/editor/EditorApi.js
+++ b/javascripts/modules/editor/EditorApi.js
@@ -7,7 +7,7 @@
EditorApi = Api.extend( {
initialize: function( options ) {
- this._super( options );
+ Api.prototype.initialize.apply( this, arguments );
this.title = options.title;
this.sectionId = options.sectionId;
this.oldId = options.oldId;
diff --git a/javascripts/modules/editor/EditorOverlay.js
b/javascripts/modules/editor/EditorOverlay.js
index ff123bd..1fac4af 100644
--- a/javascripts/modules/editor/EditorOverlay.js
+++ b/javascripts/modules/editor/EditorOverlay.js
@@ -38,7 +38,7 @@
} else {
options.editingMsg = mw.msg(
'mobile-frontend-editor-editing-page', options.title );
}
- this._super( options );
+ EditorOverlayBase.prototype.initialize.apply( this,
arguments );
if ( isVisualEditorEnabled ) {
this.initializeSwitcher();
}
@@ -46,7 +46,7 @@
postRender: function( options ) {
var self = this;
- this._super( options );
+ EditorOverlayBase.prototype.postRender.apply( this,
arguments );
this.$preview = this.$( '.preview' );
this.$content = this.$( '.wikitext-editor' ).
@@ -149,7 +149,7 @@
self.$preview.show();
} );
- this._super();
+ EditorOverlayBase.prototype._prepareForSave.apply(
this, arguments );
},
_hidePreview: function() {
@@ -225,7 +225,7 @@
var self = this,
options = { summary: this.$( '.summary' ).val()
};
- this._super();
+ EditorOverlayBase.prototype._save.apply( this,
arguments );
if ( this.confirmAborted ) {
return;
}
diff --git a/javascripts/modules/editor/EditorOverlayBase.js
b/javascripts/modules/editor/EditorOverlayBase.js
index 7866354..f8a2703 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -143,7 +143,7 @@
this.sectionId = options.sectionId;
this.funnel = options.funnel;
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
},
reportError: function ( msg, errorText ) {
this.log( 'error', errorText );
@@ -166,7 +166,7 @@
}
this.log( 'submit' );
},
- postRender: function( options ) {
+ postRender: function() {
var self = this;
this.$spinner = self.$( '.spinner' );
// log edit attempt
@@ -176,7 +176,7 @@
// log cancel attempt
self.log( 'cancel' );
} );
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
this._showHidden( '.initial-header' );
},
/**
@@ -205,7 +205,7 @@
hide: function( force ) {
var confirmMessage = mw.msg(
'mobile-frontend-editor-cancel-confirm' );
if ( force || !this._hasChanged() || window.confirm(
confirmMessage ) ) {
- return this._super();
+ return Overlay.prototype.hide.apply( this,
arguments );
} else {
return false;
}
diff --git a/javascripts/modules/editor/VisualEditorOverlay.js
b/javascripts/modules/editor/VisualEditorOverlay.js
index d61746e..b53b954 100644
--- a/javascripts/modules/editor/VisualEditorOverlay.js
+++ b/javascripts/modules/editor/VisualEditorOverlay.js
@@ -17,7 +17,7 @@
var self = this;
options.previewingMsg = mw.msg(
'mobile-frontend-page-edit-summary', options.title );
options.editingMsg = mw.msg(
'mobile-frontend-editor-editing' );
- this._super( options );
+ EditorOverlayBase.prototype.initialize.apply( this,
arguments );
this.hasChanged = false;
this.$continueBtn = self.$( '.continue' ).prop(
'disabled', true );
this.initializeSwitcher();
@@ -32,7 +32,7 @@
}
},
show: function() {
- this._super();
+ EditorOverlayBase.prototype.show.apply( this, arguments
);
if ( this.target === undefined ) {
// FIXME: we have to initialize
MobileViewTarget after this.$el
// is attached to DOM, maybe we should attach
it earlier and hide
@@ -65,8 +65,8 @@
} );
}
},
- hide: function( force ) {
- var retval = this._super( force );
+ hide: function() {
+ var retval = EditorOverlayBase.prototype.hide.apply(
this, arguments );
if ( retval ) {
this.destroyTarget();
}
@@ -89,7 +89,7 @@
}
} );
this.$( '.surface' ).hide();
- this._super( options );
+ EditorOverlayBase.prototype.postRender.apply( this,
arguments );
},
switchToEditor: function() {
this._showHidden( '.initial-header' );
@@ -101,7 +101,7 @@
this.$( '[contenteditable]' ).blur();
this.$( '.surface' ).hide();
this._showHidden( '.save-header, .save-panel' );
- this._super();
+ EditorOverlayBase.prototype._prepareForSave.apply(
this, arguments );
},
_save: function() {
var
@@ -110,7 +110,7 @@
summary = this.$( '.save-panel input' ).val(),
options = { summary: summary };
- this._super();
+ EditorOverlayBase.prototype._save.apply( this,
arguments );
if ( this.confirmAborted ) {
return;
}
@@ -147,7 +147,7 @@
} );
},
onSave: function() {
- this._super();
+ EditorOverlayBase.prototype.onSave.apply( this,
arguments );
this.clearSpinner();
this.destroyTarget();
},
diff --git a/javascripts/modules/languages/LanguageOverlay.js
b/javascripts/modules/languages/LanguageOverlay.js
index 6512d98..1e24974 100644
--- a/javascripts/modules/languages/LanguageOverlay.js
+++ b/javascripts/modules/languages/LanguageOverlay.js
@@ -21,7 +21,7 @@
options.variantHeader = mw.msg(
'mobile-frontend-language-variant-header' );
}
M.emit( 'language-overlay-initialize', options );
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
},
filterLists: function( val ) {
@@ -43,9 +43,9 @@
}
},
- postRender: function( options ) {
+ postRender: function() {
var self = this;
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
this.$( 'ul' ).find( 'a' ).on( 'click', function() {
M.emit( 'language-select', $( this ).attr(
'lang' ) );
diff --git a/javascripts/modules/mediaViewer/ImageApi.js
b/javascripts/modules/mediaViewer/ImageApi.js
index 4f67252..7a6ad32 100644
--- a/javascripts/modules/mediaViewer/ImageApi.js
+++ b/javascripts/modules/mediaViewer/ImageApi.js
@@ -20,7 +20,7 @@
*/
ImageApi = Api.extend( {
initialize: function() {
- this._super();
+ Api.prototype.initialize.apply( this, arguments );
this._cache = {};
},
diff --git a/javascripts/modules/mediaViewer/ImageOverlay.js
b/javascripts/modules/mediaViewer/ImageOverlay.js
index 62287e0..e38c0bd 100644
--- a/javascripts/modules/mediaViewer/ImageOverlay.js
+++ b/javascripts/modules/mediaViewer/ImageOverlay.js
@@ -22,7 +22,7 @@
postRender: function( options ) {
var self = this, $img;
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
api.getThumb( options.title ).done( function( data ) {
var author, url = data.descriptionurl +
'#mw-jump-to-license';
@@ -67,7 +67,7 @@
},
show: function() {
- this._super();
+ Overlay.prototype.show.apply( this, arguments );
this._positionImage();
},
diff --git a/javascripts/modules/nearby/Nearby.js
b/javascripts/modules/nearby/Nearby.js
index 61e3c78..8f3d82f 100644
--- a/javascripts/modules/nearby/Nearby.js
+++ b/javascripts/modules/nearby/Nearby.js
@@ -59,7 +59,8 @@
return result;
},
initialize: function( options ) {
- var self = this, _super = this._super;
+ var self = this,
+ _super = PageList.prototype.initialize;
options.loadingMessage = mw.msg(
'mobile-frontend-nearby-loading' );
@@ -98,7 +99,7 @@
// Run it once for loader etc
this._isLoading = true;
- this._super( options );
+ PageList.prototype.initialize.apply( this, arguments );
},
_find: function( options ) {
var result = $.Deferred(), self = this;
@@ -124,11 +125,11 @@
}
return result;
},
- postRender: function( options ) {
+ postRender: function() {
if ( !this._isLoading ) {
this.$( '.loading' ).hide();
}
- this._super( options );
+ PageList.prototype.postRender.apply( this, arguments );
this._postRenderLinks();
},
_postRenderLinks: function() {
diff --git a/javascripts/modules/nearby/NearbyOverlay.js
b/javascripts/modules/nearby/NearbyOverlay.js
index 81770f5..e4f868f 100644
--- a/javascripts/modules/nearby/NearbyOverlay.js
+++ b/javascripts/modules/nearby/NearbyOverlay.js
@@ -18,13 +18,13 @@
},
initialize: function( options ) {
options.pretext = mw.message(
'mobile-frontend-nearby-to-page', options.title );
- this._super( options );
+ Overlay.prototype.initialize.apply( this,
options );
this.latLngString = options.latitude + ',' +
options.longitude;
},
postRender: function( options ) {
var widget;
- this._super( options );
+ Overlay.prototype.postRender.apply( this,
options );
widget = new Nearby( {
source: options.source,
range: 2000,
diff --git a/javascripts/modules/nearby/PagePreviewOverlay.js
b/javascripts/modules/nearby/PagePreviewOverlay.js
index af75235..f8ae362 100644
--- a/javascripts/modules/nearby/PagePreviewOverlay.js
+++ b/javascripts/modules/nearby/PagePreviewOverlay.js
@@ -28,7 +28,7 @@
optionalArgs = { url: endpoint,
dataType: 'jsonp' };
}
- this._super( options );
+ Overlay.prototype.initialize.apply( this,
options );
loader.show();
M.pageApi.getPage( options.title,
options.endpoint, true ).done( function( page ) {
options.page = new Page( page );
@@ -96,7 +96,7 @@
return;
}
var $preview, nodes;
- this._super( options );
+ Overlay.prototype.postRender.apply( this,
options );
$preview = this.$( '.preview' );
// Remove tables, infoboxes, navboxes, message
boxes, hatnotes, and images.
$preview.find( 'table, .dablink, .rellink,
.thumb' ).remove();
diff --git a/javascripts/modules/notifications/NotificationsOverlay.js
b/javascripts/modules/notifications/NotificationsOverlay.js
index 8f20d1a..d8e94b2 100644
--- a/javascripts/modules/notifications/NotificationsOverlay.js
+++ b/javascripts/modules/notifications/NotificationsOverlay.js
@@ -28,7 +28,7 @@
},
initialize: function( options ) {
var self = this;
- this._super( options );
+ Overlay.prototype.initialize.apply( this,
options );
// Anchor tag that corresponds to a
notifications badge
this.$badge = options.$badge;
// On error use the url as a fallback
@@ -96,7 +96,7 @@
options.heading = '<strong>' + mw.msg(
'notifications' ) + '</strong>';
},
postRender: function( options ) {
- this._super( options );
+ Overlay.prototype.postRender.apply( this,
options );
if ( options.notifications ||
options.errorMessage ) {
this.$( '.loading' ).remove();
diff --git a/javascripts/modules/search/SearchApi.js
b/javascripts/modules/search/SearchApi.js
index 2edbff1..abdbc3f 100644
--- a/javascripts/modules/search/SearchApi.js
+++ b/javascripts/modules/search/SearchApi.js
@@ -33,7 +33,7 @@
SearchApi = Api.extend( {
initialize: function() {
- this._super();
+ Api.prototype.initialize.apply( this, arguments );
this.searchCache = {};
},
diff --git a/javascripts/modules/search/SearchOverlay.js
b/javascripts/modules/search/SearchOverlay.js
index 99633b5..59fb7e7 100644
--- a/javascripts/modules/search/SearchOverlay.js
+++ b/javascripts/modules/search/SearchOverlay.js
@@ -20,9 +20,9 @@
},
closeOnBack: false,
- initialize: function( options ) {
+ initialize: function() {
var self = this;
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
this.api = new SearchApi();
// FIXME: horrible, remove when we get overlay manager
@@ -33,7 +33,7 @@
} );
},
- postRender: function( options ) {
+ postRender: function() {
var
self = this,
$clear = this.$( '.clear' ),
@@ -44,7 +44,7 @@
// displayed.
this.$( '.overlay-header-container' ).css( 'top', $(
'.header' ).offset().top );
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
this.$input = this.$( 'input' ).on( 'input', function()
{
// Make sure search header is docked to the top
of the screen when the
@@ -94,7 +94,7 @@
},
show: function() {
- this._super();
+ Overlay.prototype.show.apply( this, arguments );
this.$input.focus();
},
diff --git a/javascripts/modules/talk/TalkOverlay.js
b/javascripts/modules/talk/TalkOverlay.js
index 4366599..16d776f 100644
--- a/javascripts/modules/talk/TalkOverlay.js
+++ b/javascripts/modules/talk/TalkOverlay.js
@@ -19,7 +19,7 @@
},
initialize: function( options ) {
var self = this,
- _super = this._super;
+ _super = Overlay.prototype.initialize;
this.loadingOverlay = new LoadingOverlay();
this.loadingOverlay.show();
@@ -53,13 +53,12 @@
options.sections = sections;
options.explanation = explanation;
- this._super( options );
},
postRender: function( options ) {
var $add = this.$( 'button.add' ),
page = options.page, self = this;
- this._super( options );
+ Overlay.prototype.postRender.apply( this,
arguments );
if ( !user.isAnon() ) {
$add.click( function() {
var overlay = new
TalkSectionAddOverlay( {
diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js
b/javascripts/modules/talk/TalkSectionAddOverlay.js
index aabdeec..4e18ccc 100644
--- a/javascripts/modules/talk/TalkSectionAddOverlay.js
+++ b/javascripts/modules/talk/TalkSectionAddOverlay.js
@@ -32,13 +32,13 @@
mw.config.get( 'wgMFLicenseLink' )
);
}
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
this.talkOverlay = options.parent;
this.title = options.title;
},
- postRender: function( options ) {
+ postRender: function() {
var self = this;
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy(
self, 'hide' ) );
this.confirm = this.$( 'button.confirm-save' );
this.confirm.on( 'click', function() {
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js
b/javascripts/modules/talk/TalkSectionOverlay.js
index ddcafdb..7860b56 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -28,12 +28,12 @@
mw.config.get( 'wgMFLicenseLink' )
);
}
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
},
postRender: function( options ) {
var self = this, $comment = this.$( '.comment' ),
$textarea = $comment.find( 'textarea' );
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy(
self, 'hide' ) );
this.$( '.loading' ).remove();
if ( user.isAnon() || !M.isAlphaGroupMember() ) {
diff --git a/javascripts/modules/toc/toc.js b/javascripts/modules/toc/toc.js
index 1122a50..fda92bb 100644
--- a/javascripts/modules/toc/toc.js
+++ b/javascripts/modules/toc/toc.js
@@ -13,9 +13,9 @@
tagName: 'div',
className: 'toc-mobile',
template: M.template.get( 'modules/toc/toc.hogan' ),
- postRender: function( options ) {
+ postRender: function() {
var log = MobileWebClickTracking.log;
- this._super( options );
+ View.prototype.postRender.apply( this, arguments );
// Click tracking for table of contents so we can see
if people interact with it
this.$( 'h2' ).on( toggle.eventName, function() {
log( 'page-toc-toggle' );
diff --git a/javascripts/modules/tutorials/ContentOverlay.js
b/javascripts/modules/tutorials/ContentOverlay.js
index e6dd117..baefb1a 100644
--- a/javascripts/modules/tutorials/ContentOverlay.js
+++ b/javascripts/modules/tutorials/ContentOverlay.js
@@ -23,7 +23,7 @@
appendTo: '#mw-mf-page-center',
postRender: function( options ) {
var self = this, $target;
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
if ( options.target ) {
$target = $( options.target );
// Ensure we position the overlay correctly but
do not show the arrow
diff --git a/javascripts/modules/uploads/LeadPhotoUploaderButton.js
b/javascripts/modules/uploads/LeadPhotoUploaderButton.js
index 699322e..7e4a498 100644
--- a/javascripts/modules/uploads/LeadPhotoUploaderButton.js
+++ b/javascripts/modules/uploads/LeadPhotoUploaderButton.js
@@ -15,7 +15,7 @@
initialize: function( options ) {
options.pageTitle = mw.config.get( 'wgPageName' );
- this._super( options );
+ PhotoUploaderButton.prototype.initialize.apply( this,
arguments );
}
} );
diff --git a/javascripts/modules/uploads/PhotoApi.js
b/javascripts/modules/uploads/PhotoApi.js
index bb3268c..2932333 100644
--- a/javascripts/modules/uploads/PhotoApi.js
+++ b/javascripts/modules/uploads/PhotoApi.js
@@ -94,7 +94,7 @@
* for inserting images in a page.
*/
initialize: function( options ) {
- this._super();
+ Api.prototype.initialize.apply( this, arguments );
options = options || {};
this.editorApi = options.editorApi;
},
diff --git a/javascripts/modules/uploads/PhotoUploadOverlay.js
b/javascripts/modules/uploads/PhotoUploadOverlay.js
index b1494f7..7a1066e 100644
--- a/javascripts/modules/uploads/PhotoUploadOverlay.js
+++ b/javascripts/modules/uploads/PhotoUploadOverlay.js
@@ -82,7 +82,7 @@
);
}
- this._super( options );
+ Overlay.prototype.initialize.apply( this, arguments );
},
_save: function() {
@@ -157,7 +157,7 @@
postRender: function() {
var self = this, $submitButton;
- this._super();
+ Overlay.prototype.initialize.apply( this, arguments );
$submitButton = this.$( '.submit' ).
prop( 'disabled', true ).
@@ -185,7 +185,7 @@
show: function() {
var self = this;
- this._super();
+ Overlay.prototype.show.apply( this, arguments );
if ( this.file ) {
EXIF.getData( this.file, function() {
@@ -202,13 +202,14 @@
},
hide: function( force ) {
+ var hide = Overlay.prototype.hide;
// In the case of a missing file force close
if ( force || !this.file ) {
- return this._super();
+ return hide.apply( this, arguments );
} else if ( window.confirm( mw.msg(
'mobile-frontend-image-cancel-confirm' ) ) ) {
this.emit( 'cancel' );
this.log( { action: 'previewCancel' } );
- return this._super();
+ return hide.apply( this, arguments );
} else {
return false;
}
diff --git a/javascripts/modules/uploads/PhotoUploadProgress.js
b/javascripts/modules/uploads/PhotoUploadProgress.js
index d1b17fb..992dc17 100644
--- a/javascripts/modules/uploads/PhotoUploadProgress.js
+++ b/javascripts/modules/uploads/PhotoUploadProgress.js
@@ -12,13 +12,13 @@
template: M.template.get( 'uploads/PhotoUploadProgress.hogan' ),
fullScreen: false,
- initialize: function( options ) {
- this._super( options );
+ initialize: function() {
+ Overlay.prototype.initialize.apply( this, arguments );
this.progressBar = new ProgressBar();
},
postRender: function() {
- this._super();
+ Overlay.prototype.postRender.apply( this, arguments );
this.$( '.submit' ).on( M.tapEvent( 'click' ), $.proxy(
this, 'emit', 'submit' ) );
},
@@ -28,11 +28,12 @@
},
hide: function( force ) {
+ var hide = Overlay.prototype.hide;
if ( force ) {
- return this._super();
+ return hide.apply( this, arguments );
} else if ( window.confirm( mw.msg(
'mobile-frontend-image-cancel-confirm' ) ) ) {
this.emit( 'cancel' );
- return this._super();
+ return hide.apply( this, arguments );
} else {
return false;
}
diff --git a/javascripts/modules/uploads/UploadTutorial.js
b/javascripts/modules/uploads/UploadTutorial.js
index 836e49f..ab0b60b 100644
--- a/javascripts/modules/uploads/UploadTutorial.js
+++ b/javascripts/modules/uploads/UploadTutorial.js
@@ -50,7 +50,7 @@
this._showCurrentPage();
- this._super( options );
+ Overlay.prototype.postRender.apply( this, arguments );
},
_showCurrentPage: function() {
diff --git a/javascripts/modules/watchstar/Watchstar.js
b/javascripts/modules/watchstar/Watchstar.js
index 330ee07..af06cf3 100644
--- a/javascripts/modules/watchstar/Watchstar.js
+++ b/javascripts/modules/watchstar/Watchstar.js
@@ -20,7 +20,7 @@
className: 'icon icon-32px watch-this-article',
template: M.template.compile( '<a>', 'hogan' ),
initialize: function( options ) {
- var self = this, _super = this._super,
+ var self = this, _super = View.prototype.initialize,
page = options.page;
this.drawer = new CtaDrawer( {
@@ -40,7 +40,7 @@
} );
} else {
api.setWatchedPage( options.page,
options.isWatched );
- this._super( options );
+ _super.call( self, options );
}
},
postRender: function( options ) {
diff --git a/javascripts/modules/wikigrok/WikiGrokDrawer.js
b/javascripts/modules/wikigrok/WikiGrokDrawer.js
index 4701611..b1bbcc9 100644
--- a/javascripts/modules/wikigrok/WikiGrokDrawer.js
+++ b/javascripts/modules/wikigrok/WikiGrokDrawer.js
@@ -130,7 +130,7 @@
// If the user hasn't opted-out of WikiGrok, load the
interface.
if ( !localStorage.getItem( 'mfHideWikiGrok' ) ) {
- this._super.call( this, options );
+ Drawer.prototype.postRender.apply( this,
arguments );
// For final 'Thanks' step
if ( options.thankUser ) {
this.$( '.wg-buttons .quit' ).on(
'click', function() {
diff --git a/javascripts/specials/uploads.js b/javascripts/specials/uploads.js
index 079c420..4bbd2d9 100644
--- a/javascripts/specials/uploads.js
+++ b/javascripts/specials/uploads.js
@@ -14,7 +14,7 @@
UserGalleryApi = Api.extend( {
initialize: function() {
- this._super();
+ Api.prototype.initialize.apply( this, arguments );
this.limit = 10;
},
getPhotos: function() {
@@ -74,7 +74,7 @@
this.threshold = 1000;
this.shouldLoad = true;
this.api = new UserGalleryApi();
- this._super();
+ View.prototype.initialize.apply( this, arguments );
},
postRender: function() {
this.$end = this.$( '.end' );
--
To view, visit https://gerrit.wikimedia.org/r/159555
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia099c4ad3b44493d6f376dcd4381e9a47329e0fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits