Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230567
Change subject: Use `.parent` instead of `.super` in demos and tests, too
......................................................................
Use `.parent` instead of `.super` in demos and tests, too
For IE 8 compatibility. We're consistently using `.parent` in code
since 8ab6a48297aefdcc69960b76e54abd4486221af4.
Change-Id: Idc7e7865ee517b40e3e79fc78168010095f9836e
---
M demos/demo.js
M demos/pages/dialogs.js
M demos/pages/toolbars.js
M demos/pages/widgets.js
M tests/mixins/FlaggedElement.test.js
5 files changed, 34 insertions(+), 34 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/67/230567/1
diff --git a/demos/demo.js b/demos/demo.js
index 16fa2ee..04203cd 100644
--- a/demos/demo.js
+++ b/demos/demo.js
@@ -6,7 +6,7 @@
*/
OO.ui.Demo = function OoUiDemo() {
// Parent
- OO.ui.Demo.super.call( this );
+ OO.ui.Demo.parent.call( this );
// Normalization
this.normalizeHash();
diff --git a/demos/pages/dialogs.js b/demos/pages/dialogs.js
index 0a51051..f3944d6 100644
--- a/demos/pages/dialogs.js
+++ b/demos/pages/dialogs.js
@@ -6,7 +6,7 @@
windowManager = new OO.ui.WindowManager();
function SimpleDialog( config ) {
- SimpleDialog.super.call( this, config );
+ SimpleDialog.parent.call( this, config );
}
OO.inheritClass( SimpleDialog, OO.ui.Dialog );
SimpleDialog.static.title = 'Simple dialog';
@@ -14,7 +14,7 @@
var closeButton,
dialog = this;
- SimpleDialog.super.prototype.initialize.apply( this, arguments
);
+ SimpleDialog.parent.prototype.initialize.apply( this, arguments
);
this.content = new OO.ui.PanelLayout( { padded: true, expanded:
false } );
this.content.$element.append( '<p>Dialog content</p>' );
@@ -33,7 +33,7 @@
};
function ProcessDialog( config ) {
- ProcessDialog.super.call( this, config );
+ ProcessDialog.parent.call( this, config );
}
OO.inheritClass( ProcessDialog, OO.ui.ProcessDialog );
ProcessDialog.static.title = 'Process dialog';
@@ -43,7 +43,7 @@
{ action: 'other', label: 'Other', flags: 'other' }
];
ProcessDialog.prototype.initialize = function () {
- ProcessDialog.super.prototype.initialize.apply( this, arguments
);
+ ProcessDialog.parent.prototype.initialize.apply( this,
arguments );
this.content = new OO.ui.PanelLayout( { padded: true, expanded:
false } );
this.content.$element.append( '<p>Dialog content</p>' );
this.$body.append( this.content.$element );
@@ -55,14 +55,14 @@
dialog.close( { action: action } );
} );
}
- return ProcessDialog.super.prototype.getActionProcess.call(
this, action );
+ return ProcessDialog.parent.prototype.getActionProcess.call(
this, action );
};
ProcessDialog.prototype.getBodyHeight = function () {
return this.content.$element.outerHeight( true );
};
function FramelessProcessDialog( config ) {
- FramelessProcessDialog.super.call( this, config );
+ FramelessProcessDialog.parent.call( this, config );
}
OO.inheritClass( FramelessProcessDialog, ProcessDialog );
FramelessProcessDialog.static.actions = OO.copy(
FramelessProcessDialog.static.actions );
@@ -71,13 +71,13 @@
} );
function SearchWidgetDialog( config ) {
- SearchWidgetDialog.super.call( this, config );
+ SearchWidgetDialog.parent.call( this, config );
this.broken = false;
}
OO.inheritClass( SearchWidgetDialog, OO.ui.ProcessDialog );
SearchWidgetDialog.static.title = 'Search widget dialog';
SearchWidgetDialog.prototype.initialize = function () {
- SearchWidgetDialog.super.prototype.initialize.apply( this,
arguments );
+ SearchWidgetDialog.parent.prototype.initialize.apply( this,
arguments );
var i,
items = [],
searchWidget = new OO.ui.SearchWidget();
@@ -102,7 +102,7 @@
};
function BrokenDialog( config ) {
- BrokenDialog.super.call( this, config );
+ BrokenDialog.parent.call( this, config );
this.broken = false;
}
OO.inheritClass( BrokenDialog, OO.ui.ProcessDialog );
@@ -116,7 +116,7 @@
return 250;
};
BrokenDialog.prototype.initialize = function () {
- BrokenDialog.super.prototype.initialize.apply( this, arguments
);
+ BrokenDialog.parent.prototype.initialize.apply( this, arguments
);
this.content = new OO.ui.PanelLayout( { padded: true } );
this.fieldset = new OO.ui.FieldsetLayout( {
label: 'Dialog with error handling', icon: 'alert'
@@ -130,13 +130,13 @@
this.$body.append( this.content.$element );
};
BrokenDialog.prototype.getSetupProcess = function ( data ) {
- return BrokenDialog.super.prototype.getSetupProcess.call( this,
data )
+ return BrokenDialog.parent.prototype.getSetupProcess.call(
this, data )
.next( function () {
this.broken = true;
}, this );
};
BrokenDialog.prototype.getActionProcess = function ( action ) {
- return BrokenDialog.super.prototype.getActionProcess.call(
this, action )
+ return BrokenDialog.parent.prototype.getActionProcess.call(
this, action )
.next( function () {
return 1000;
}, this )
@@ -157,7 +157,7 @@
// Return a promise to remaing pending
while closing
return closing;
}
- return
BrokenDialog.super.prototype.getActionProcess.call( this, action );
+ return
BrokenDialog.parent.prototype.getActionProcess.call( this, action );
}, this );
};
@@ -170,7 +170,7 @@
}
OO.inheritClass( SamplePage, OO.ui.PageLayout );
SamplePage.prototype.setupOutlineItem = function ( outlineItem ) {
- SamplePage.super.prototype.setupOutlineItem.call( this,
outlineItem );
+ SamplePage.parent.prototype.setupOutlineItem.call( this,
outlineItem );
this.outlineItem
.setMovable( true )
.setRemovable( true )
@@ -179,7 +179,7 @@
};
function BookletDialog( config ) {
- BookletDialog.super.call( this, config );
+ BookletDialog.parent.call( this, config );
}
OO.inheritClass( BookletDialog, OO.ui.ProcessDialog );
BookletDialog.static.title = 'Booklet dialog';
@@ -191,7 +191,7 @@
return 250;
};
BookletDialog.prototype.initialize = function () {
- BookletDialog.super.prototype.initialize.apply( this, arguments
);
+ BookletDialog.parent.prototype.initialize.apply( this,
arguments );
var dialog = this;
@@ -242,14 +242,14 @@
this.close( { action: action } );
}, this );
}
- return BookletDialog.super.prototype.getActionProcess.call(
this, action );
+ return BookletDialog.parent.prototype.getActionProcess.call(
this, action );
};
BookletDialog.prototype.onBookletLayoutSet = function ( page ) {
page.$element.append( this.navigationField.$element );
};
function OutlinedBookletDialog( config ) {
- OutlinedBookletDialog.super.call( this, config );
+ OutlinedBookletDialog.parent.call( this, config );
}
OO.inheritClass( OutlinedBookletDialog, OO.ui.ProcessDialog );
OutlinedBookletDialog.static.title = 'Booklet dialog';
@@ -261,7 +261,7 @@
return 250;
};
OutlinedBookletDialog.prototype.initialize = function () {
- OutlinedBookletDialog.super.prototype.initialize.apply( this,
arguments );
+ OutlinedBookletDialog.parent.prototype.initialize.apply( this,
arguments );
this.bookletLayout = new OO.ui.BookletLayout( {
outlined: true
} );
@@ -283,13 +283,13 @@
this.close( { action: action } );
}, this );
}
- return
OutlinedBookletDialog.super.prototype.getActionProcess.call( this, action );
+ return
OutlinedBookletDialog.parent.prototype.getActionProcess.call( this, action );
};
OutlinedBookletDialog.prototype.onBookletLayoutSet = function ( page ) {
this.setSize( page.getName() );
};
OutlinedBookletDialog.prototype.getSetupProcess = function ( data ) {
- return
OutlinedBookletDialog.super.prototype.getSetupProcess.call( this, data )
+ return
OutlinedBookletDialog.parent.prototype.getSetupProcess.call( this, data )
.next( function () {
this.bookletLayout.setPage( this.getSize() );
}, this );
@@ -303,12 +303,12 @@
}
OO.inheritClass( SampleCard, OO.ui.CardLayout );
SampleCard.prototype.setupTabItem = function ( tabItem ) {
- SampleCard.super.prototype.setupTabItem.call( this, tabItem );
+ SampleCard.parent.prototype.setupTabItem.call( this, tabItem );
this.tabItem.setLabel( this.label );
};
function IndexedDialog( config ) {
- IndexedDialog.super.call( this, config );
+ IndexedDialog.parent.call( this, config );
}
OO.inheritClass( IndexedDialog, OO.ui.ProcessDialog );
IndexedDialog.static.title = 'Index dialog';
@@ -320,7 +320,7 @@
return 250;
};
IndexedDialog.prototype.initialize = function () {
- IndexedDialog.super.prototype.initialize.apply( this, arguments
);
+ IndexedDialog.parent.prototype.initialize.apply( this,
arguments );
this.indexLayout = new OO.ui.IndexLayout();
this.cards = [
new SampleCard( 'first', { label: 'One' } ),
@@ -340,11 +340,11 @@
this.close( { action: action } );
}, this );
}
- return IndexedDialog.super.prototype.getActionProcess.call(
this, action );
+ return IndexedDialog.parent.prototype.getActionProcess.call(
this, action );
};
function MenuDialog( config ) {
- MenuDialog.super.call( this, config );
+ MenuDialog.parent.call( this, config );
}
OO.inheritClass( MenuDialog, OO.ui.ProcessDialog );
MenuDialog.static.title = 'Menu dialog';
@@ -356,7 +356,7 @@
return 350;
};
MenuDialog.prototype.initialize = function () {
- MenuDialog.super.prototype.initialize.apply( this, arguments );
+ MenuDialog.parent.prototype.initialize.apply( this, arguments );
var menuLayout = new OO.ui.MenuLayout(),
positionField = new OO.ui.FieldLayout(
new OO.ui.ButtonSelectWidget( {
@@ -416,7 +416,7 @@
this.close( { action: action } );
}, this );
}
- return MenuDialog.super.prototype.getActionProcess.call( this,
action );
+ return MenuDialog.parent.prototype.getActionProcess.call( this,
action );
};
config = [
diff --git a/demos/pages/toolbars.js b/demos/pages/toolbars.js
index 7d30815..b729e36 100644
--- a/demos/pages/toolbars.js
+++ b/demos/pages/toolbars.js
@@ -27,7 +27,7 @@
function createTool( toolbar, group, name, icon, title, init, onSelect,
displayBothIconAndLabel ) {
var Tool = function () {
- Tool.super.apply( this, arguments );
+ Tool.parent.apply( this, arguments );
this.toggled = false;
if ( init ) {
init.call( this );
@@ -65,7 +65,7 @@
function createDisabledToolGroup( parent, name ) {
var DisabledToolGroup = function () {
- DisabledToolGroup.super.apply( this, arguments );
+ DisabledToolGroup.parent.apply( this, arguments );
this.setDisabled( true );
};
diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 5eb3f36..d861bd9 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -12,7 +12,7 @@
config = config || {};
// Parent constructor
- DragDropGroupWidget.super.call( this, config );
+ DragDropGroupWidget.parent.call( this, config );
// Mixin constructors
OO.ui.mixin.DraggableGroupElement.call( this, $.extend( {},
config, { $group: this.$element } ) );
@@ -42,7 +42,7 @@
config = config || {};
// Parent constructor
- DragDropItemWidget.super.call( this, config );
+ DragDropItemWidget.parent.call( this, config );
// Mixin constructors
OO.ui.mixin.DraggableElement.call( this, config );
diff --git a/tests/mixins/FlaggedElement.test.js
b/tests/mixins/FlaggedElement.test.js
index bb9be1d..464819a 100644
--- a/tests/mixins/FlaggedElement.test.js
+++ b/tests/mixins/FlaggedElement.test.js
@@ -2,7 +2,7 @@
QUnit.module( 'FlaggedElement' );
function TestElement( config ) {
- TestElement.super.call( this, config );
+ TestElement.parent.call( this, config );
OO.ui.mixin.FlaggedElement.call( this, config );
}
OO.inheritClass( TestElement, OO.ui.Widget );
--
To view, visit https://gerrit.wikimedia.org/r/230567
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc7e7865ee517b40e3e79fc78168010095f9836e
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits