Page MenuHomePhabricator
Paste P4087

JS changes between mw-1.28.0-wmf.17 and mw-1.28.0-wmf.18
ActivePublic

Authored by Gilles on Sep 21 2016, 12:07 PM.
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/ContentTranslation/modules/translation/ext.cx.translation.js 2016-08-30 11:19:02.910974283 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/ContentTranslation/modules/translation/ext.cx.translation.js 2016-09-06 16:27:32.944677947 +0000
@@ -369,6 +369,8 @@
// If source section has zero height, do not add a placeholder
// Zero height means either the section is empty or invisible.
if ( $sourceSection.height() === 0 ) {
+ // Hide the section to avoid the margin, if any, take up space.
+ $sourceSection.hide();
continue;
}
sourceSectionId = $sourceSection.attr( 'id' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/ContentTranslation/modules/tools/ext.cx.tools.mt.js 2016-08-30 11:19:02.906974252 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/ContentTranslation/modules/tools/ext.cx.tools.mt.js 2016-09-06 16:27:32.936677884 +0000
@@ -439,246 +439,6 @@
targetLanguage: mw.cx.targetLanguage
};
- /**
- * MT Control card
- */
- function MTControlCard() {
- this.mt = null;
- this.$targetSection = null;
- this.$sourceSection = null;
- this.$card = null;
- this.$translations = null;
- this.$providersMenu = null;
- }
-
- /**
- * Prepare and return the card template.
- *
- * @return {jQuery}
- */
- MTControlCard.prototype.getCard = function () {
- var $titleRow, $title, $controlButtonsBlock;
-
- this.$card = $( '<div>' )
- .addClass( 'card mt' );
-
- $title = $( '<div>' )
- .addClass( 'card__title' )
- .text( mw.msg( 'cx-tools-mt-title' ) );
-
- $titleRow = $( '<div>' )
- .addClass( 'card__title-row' )
- .append( $title );
-
- this.$providerSelectorTrigger = $( '<div>' )
- .addClass( 'card__trigger' );
-
- this.$keepDefault = $( '<div>' )
- .addClass( 'card__control-button cx-mt-set-default' )
- .text( mw.msg( 'cx-tools-mt-set-default' ) )
- .hide();
-
- $controlButtonsBlock = $( '<div>' )
- .addClass( 'card__button-block' )
- .append( this.$keepDefault );
-
- this.$card.append(
- $titleRow,
- this.$providerSelectorTrigger,
- $controlButtonsBlock
- );
- this.$providersMenu = $( [] );
-
- this.listen();
-
- return this.$card;
- };
-
- /**
- * Select a given provider id for the current section.
- *
- * @param {string} providerId Provider id
- */
- MTControlCard.prototype.onProviderSelect = function ( providerId ) {
- // Hide the menu
- this.$providersMenu.hide();
-
- // Set the main label
- this.$providerSelectorTrigger.text( this.getProviderLabel( providerId ) );
-
- // Apply the selected provider to the current section.
- this.mt.changeProvider( providerId );
- this.mt.translate();
- };
-
- MTControlCard.prototype.listen = function () {
- var self = this;
-
- this.$providerSelectorTrigger
- .on( 'click', function ( e ) {
- self.$providersMenu.toggle();
- e.stopPropagation();
- } );
-
- // Hide the dropdown on clicking outside of it
- $( 'html' ).on( 'click', function ( e ) {
- if ( !e.isDefaultPrevented() ) {
- self.$providersMenu.hide();
- }
- } );
-
- this.$keepDefault.on( 'click', function () {
- self.mt.setDefaultProvider( self.mt.provider );
- self.$keepDefault.hide();
- } );
- };
-
- MTControlCard.prototype.buildProvidersMenu = function ( providers ) {
- var i, self = this,
- nonDefaultMT = false,
- newProvider = false;
-
- this.$providersMenu = $( '<ul>' )
- .addClass( 'card__providers-menu' )
- .hide();
-
- if ( this.mt.translationOptions.indexOf( this.mt.providers[ 0 ] ) === 0 &&
- this.mt.translationOptions.indexOf( this.mt.provider ) >= 0
- ) {
- nonDefaultMT = true;
- this.$card.find( '.card__title-row' )
- .addClass( 'card--new' )
- .append( $( '<div>' )
- .text( mw.msg( 'cx-tools-mt-new-providers-available' ) )
- .addClass( 'card__new-providers' )
- );
- }
-
- if ( !this.$targetSection.data( 'cx-state' ) ) {
- providers.unshift( resetMT );
- }
-
- // Add available machine translation engines to the menu
- for ( i = 0; i < providers.length; i++ ) {
- newProvider = nonDefaultMT && this.mt.translationOptions.indexOf( providers[ i ] ) < 0;
- this.$providersMenu.append(
- this.getProviderMenuItem( providers[ i ], newProvider )
- );
- }
-
- // Set the main label
- this.$providerSelectorTrigger.text( this.getProviderLabel( this.mt.provider ) );
-
- if ( this.mt.provider !== this.mt.getPreferredProvider() ) {
- this.$keepDefault.show();
- } else {
- this.$keepDefault.hide();
- }
-
- this.$providerSelectorTrigger.after( this.$providersMenu );
-
- this.$providersMenu.find( '.card__providers-menu-item' )
- .on( 'click', function () {
- self.onProviderSelect( $( this ).data( 'provider' ) );
- } );
- };
-
- /**
- * Get the text for the menu item in the providers list.
- *
- * @param {string} providerId Provider id.
- * @return {string}
- */
- MTControlCard.prototype.getProviderLabel = function ( providerId ) {
- var providerLabels = {
- Yandex: mw.msg( 'cx-tools-mt-provider-title', 'Yandex.Translate' ),
- 'no-mt': mw.msg( 'cx-tools-mt-dont-use' ),
- 'source-mt': mw.msg( 'cx-tools-mt-use-source' ),
- 'reset-mt': mw.msg( 'cx-tools-mt-reset' )
- };
-
- return providerLabels[ providerId ] || mw.msg( 'cx-tools-mt-provider-title', providerId );
- };
-
- /**
- * Get a menu item for the providers list.
- *
- * @param {string} providerId Provider id.
- * @return {jQuery}
- */
- MTControlCard.prototype.getProviderMenuItem = function ( providerId, newProvider ) {
- var $label,
- providerIdPrefix = 'cx-provider-',
- selected = '',
- $new = $( [] );
-
- $label = $( '<span>' )
- .text( this.getProviderLabel( providerId ) );
-
- if ( newProvider ) {
- $new = $( '<span>' )
- .text( mw.msg( 'cx-tools-mt-new-provider' ) )
- .addClass( 'card__providers-menu-item--new' );
- }
-
- // Mark the selected item
- if ( providerId === this.mt.provider ) {
- selected = 'selected';
- }
-
- return $( '<li>' )
- .addClass( [
- 'card__providers-menu-item', selected, providerIdPrefix + providerId
- ].join( ' ' ) )
- .attr( 'data-provider', providerId )
- .append( $label, $new );
- };
-
- MTControlCard.prototype.start = function ( $section ) {
- var self = this,
- sourceId;
-
- this.$targetSection = $section;
- sourceId = this.$targetSection.data( 'source' );
- this.$sourceSection = mw.cx.getSourceSection( sourceId );
- this.mt = this.$sourceSection.data( 'cxmt' );
-
- if ( !this.mt ) {
- this.mt = new MachineTranslation( sourceId );
- this.$sourceSection.data( 'cxmt', this.mt );
- }
-
- this.mt.init().then( function () {
- var menuItems = self.mt.providers.concat(
- self.mt.translationOptions.filter( function ( item ) {
- return self.mt.providers.indexOf( item ) < 0;
- } ) );
-
- self.buildProvidersMenu( menuItems );
- } );
-
- this.$card.show();
- this.onShow();
- };
-
- MTControlCard.prototype.stop = function () {
- this.$card.remove();
- mw.hook( 'mw.cx.tools.shown' ).fire( true );
- };
-
- MTControlCard.prototype.onShow = function () {
- mw.hook( 'mw.cx.tools.shown' ).fire( true );
- };
-
- MTControlCard.prototype.getTriggerEvents = function () {
- return [
- 'mw.cx.translation.focus',
- 'mw.cx.translation.change'
- ];
- };
-
- mw.cx.tools.mt = MTControlCard;
-
function initTranslationRequest( sourceSectionId ) {
var mt;
mt = new MachineTranslation( sourceSectionId );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/MobileFrontend/resources/mobile.notifications.overlay/NotificationsOverlay.js 2016-08-30 11:20:26.579615670 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/MobileFrontend/resources/mobile.notifications.overlay/NotificationsOverlay.js 2016-09-07 18:38:47.950775734 +0000
@@ -10,7 +10,7 @@
* @uses mw.Api
*/
NotificationsOverlay = function ( options ) {
- var modelManager, unreadCounter, controller, wrapperWidget,
+ var modelManager, unreadCounter, wrapperWidget,
maxNotificationCount = mw.config.get( 'wgEchoMaxNotificationCount' ),
echoApi = new mw.echo.api.EchoApi();
@@ -29,9 +29,12 @@
mw.echo.config.maxPrioritizedActions = 1;
+ this.count = 0;
+ this.doneLoading = false;
+
unreadCounter = new mw.echo.dm.UnreadNotificationCounter( echoApi, 'all', maxNotificationCount );
modelManager = new mw.echo.dm.ModelManager( unreadCounter, { type: [ 'message', 'alert' ] } );
- controller = new mw.echo.Controller(
+ this.controller = new mw.echo.Controller(
echoApi,
modelManager,
{
@@ -39,14 +42,40 @@
}
);
- wrapperWidget = new mw.echo.ui.NotificationsWrapper( controller, modelManager, {
+ wrapperWidget = new mw.echo.ui.NotificationsWrapper( this.controller, modelManager, {
$overlay: this.$overlay
} );
+ // Mark all read
+ this.markAllReadButton = new OO.ui.ButtonWidget( {
+ icon: 'doubleCheck',
+ title: mw.msg( 'echo-mark-all-as-read' )
+ } );
+ this.markAllReadButton.toggle( false );
+ this.$( '.overlay-header' )
+ .append(
+ $( '<div>' )
+ .addClass( 'notifications-overlay-header-markAllRead' )
+ .append(
+ this.markAllReadButton.$element
+ )
+ );
+
+ // TODO: We should be using 'toast' (which uses mw.notify)
+ // when this bug is fixed: https://phabricator.wikimedia.org/T143837
+ this.confirmationWidget = new mw.echo.ui.ConfirmationPopupWidget();
+ this.$overlay.append( this.confirmationWidget.$element );
+
// Events
unreadCounter.connect( this, {
countChange: 'onUnreadCountChange'
} );
+ modelManager.connect( this, {
+ update: 'checkShowMarkAllRead'
+ } );
+ this.markAllReadButton.connect( this, {
+ click: 'onMarkAllReadButtonClick'
+ } );
// Initialize
this.$( '.overlay-content' ).append(
@@ -56,12 +85,15 @@
// Populate notifications
wrapperWidget.populate()
- .then( controller.updateLocalSeenTime.bind( controller ) )
- .then( this.setBadgeSeen.bind( this ) );
+ .then( this.setDoneLoading.bind( this ) )
+ .then( this.controller.updateLocalSeenTime.bind( this.controller ) )
+ .then( this.setBadgeSeen.bind( this ) )
+ .then( this.checkShowMarkAllRead.bind( this ) );
};
OO.mfExtend( NotificationsOverlay, Overlay, {
className: 'overlay notifications-overlay navigation-drawer',
+ isBorderBox: false,
/**
* @inheritdoc
* @cfg {Object} defaults Default options hash.
@@ -77,6 +109,49 @@
} ).options
} ),
/**
+ * Set done loading flag for notifications list
+ *
+ * @method
+ */
+ setDoneLoading: function () {
+ this.doneLoading = true;
+ },
+ /**
+ * Check if notifications have finished loading
+ *
+ * @method
+ * @return {Boolean} Notifications list has finished loading
+ */
+ isDoneLoading: function () {
+ return this.doneLoading;
+ },
+ /**
+ * Toggle mark all read button
+ *
+ * @method
+ */
+ checkShowMarkAllRead: function () {
+ this.markAllReadButton.toggle(
+ this.isDoneLoading() &&
+ this.controller.manager.hasLocalUnread()
+ );
+ },
+ /**
+ * Respond to mark all read button click
+ */
+ onMarkAllReadButtonClick: function () {
+ var overlay = this,
+ numNotifications = this.controller.manager.getLocalUnread().length;
+
+ this.controller.markLocalNotificationsRead()
+ .then( function () {
+ overlay.confirmationWidget.setLabel(
+ mw.msg( 'echo-mark-all-as-read-confirmation', numNotifications )
+ );
+ overlay.confirmationWidget.showAnimated();
+ } );
+ },
+ /**
* Fall back to notifications archive page.
* @method
*/
@@ -91,17 +166,21 @@
*/
onUnreadCountChange: function ( count ) {
var $badgeCounter = this.$badge.find( '.notification-count' );
- if ( count > 0 ) {
+ this.count = count;
+
+ if ( this.count > 0 ) {
$badgeCounter.text( count ).show();
} else {
$badgeCounter.hide();
}
+
+ this.checkShowMarkAllRead();
},
/**
- * Mark that all the notifications in the badge are seen.
- *
- * @method
- */
+ * Mark that all the notifications in the badge are seen.
+ *
+ * @method
+ */
setBadgeSeen: function () {
this.$badge
.find( '.notification-count' )
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/ZeroBanner/modules/interstitial.js 2016-09-01 23:46:43.241265458 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/ZeroBanner/modules/interstitial.js 2016-09-14 18:45:42.400527164 +0000
@@ -21,40 +21,6 @@
};
} )();
- $( '#page-secondary-actions' ).find( '.languageSelector' ).off();
-
- if ( isMdot ) {
- /* CSS isn't working for this element, and !important breaks stuff */
- $( '.icon-settings' ).show();
- }
-
- /*
- In the future state with ESI, we may need to revisit approach.
- But for now, we'll have Varnish send a cookie.
- And if the user doesn't have cookies but does have JS, we'll check
- the config API as a last resort.
- */
- if ( settings.get( 'zerodontask', true ) ) {
- $( '.icon-watchlist,.icon-loginout,#page-actions' ).show();
- $( '.hlist > li:not(.new)' ).css( 'display', 'inline-block' );
- if ( !isMdot ) {
- /* the previous display: inline-block needs a tweak */
- $( '#ca-upload' ).hide();
- } else {
- /*
- FIXME: jdlrobson in change 83133 - "Maybe MobileFrontend can make this
- easier by marking these links with a shared class so you can do something
- like $( '.httpsLink' ).show();"
- */
- $( '.icon-uploads,#ca-upload' ).show();
- }
- // Theoretically, cookies could be turned off, but it's unlikely.
- // We decided to avoid hitting the API in this case.
- } else {
- /* We should avoid !important for these */
- $( '.icon-uploads,.edit-page' ).hide();
- }
-
// Disable other click event handlers for images/thumbnails, for example, the
// mobile media viewer.
// FIXME: Figure out a less fragile way to handle this
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Popups/resources/ext.popups.targets/desktopTarget.js 2016-08-30 11:20:46.123765493 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Popups/resources/ext.popups.targets/desktopTarget.js 2016-09-06 16:29:36.017627419 +0000
@@ -147,15 +147,16 @@
linkInteractionToken = mw.popups.getRandomToken();
$link
+ .off( 'mouseleave.popups blur.popups click.popups' )
// We are passing the same data, rather than a shared object, into two different functions.
// The reason is that we don't want one function to change the data and
// have a side-effect on the other function's data.
- .on( 'mouseleave blur', {
+ .on( 'mouseleave.popups blur.popups', {
dwellStartTime: dwellStartTime,
linkInteractionToken: linkInteractionToken,
hovercardsSuppressedByGadget: isNavigationPopupsGadgetEnabled()
}, onLinkAbandon )
- .on( 'click', {
+ .on( 'click.popups', {
dwellStartTime: dwellStartTime,
linkInteractionToken: linkInteractionToken,
hovercardsSuppressedByGadget: isNavigationPopupsGadgetEnabled()
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Kartographer/modules/box/Map.js 2016-08-30 11:20:04.355445303 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Kartographer/modules/box/Map.js 2016-09-14 18:55:19.836997200 +0000
@@ -1,4 +1,4 @@
-/* globals module */
+/* globals module, require */
/**
* # Kartographer Map class.
*
@@ -8,13 +8,15 @@
* @class Kartographer.Box.MapClass
* @extends L.Map
*/
-module.Map = ( function ( mw, OpenFullScreenControl, CloseFullScreenControl, dataLayerOpts, ScaleControl, document, undefined ) {
+module.Map = ( function ( mw, OpenFullScreenControl, CloseFullScreenControl, dataLayerOpts, ScaleControl, topojson, window, undefined ) {
var scale, urlFormat,
mapServer = mw.config.get( 'wgKartographerMapServer' ),
worldLatLng = new L.LatLngBounds( [ -90, -180 ], [ 90, 180 ] ),
Map,
- precisionPerZoom = [ 0, 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5 ];
+ precisionPerZoom = [ 0, 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5 ],
+ liveDataPromise = false,
+ groupsLoaded = {};
function bracketDevicePixelRatio() {
var i, scale,
@@ -47,6 +49,12 @@
fallbackZoom: 13
} );
+ L.Popup.mergeOptions( {
+ minWidth: 160,
+ maxWidth: 300,
+ autoPanPadding: [ 12, 12 ]
+ } );
+
/**
* Gets the valid bounds of a map/layer.
*
@@ -111,55 +119,150 @@
* @private
*/
function getMapGroupData( dataGroups ) {
- var deferred = $.Deferred(),
- groupsLoaded = mw.config.get( 'wgKartographerLiveData' ),
+ var apiPromise = $.Deferred(),
+ // LiveData is provided by the server on initial page load
+ // But it may contain external data that we have to load here
+ liveData = mw.config.get( 'wgKartographerLiveData' ) || {},
groupsToLoad = [],
promises = [];
- if ( !groupsLoaded ) {
- // Keep the reference to groupsLoaded, as it shouldn't change again
- groupsLoaded = {};
- mw.config.set( 'wgKartographerLiveData', groupsLoaded );
+ // On initial page load, server provided some live data
+ // Here we process all externalData refs in the live data, ensuring that we only do it once
+ if ( liveDataPromise === false ) {
+ liveDataPromise = loadGeoJsonAsync( liveData ).then( function () {
+ liveDataPromise = true;
+ } );
+ }
+ if ( liveDataPromise !== true ) {
+ promises.push( liveDataPromise );
}
// For each requested layer, make sure it is loaded or is promised to be loaded
- $( dataGroups ).each( function ( key, value ) {
- var data = groupsLoaded[ value ];
+ $.each( dataGroups, function ( key, group ) {
+ var data = groupsLoaded[ group ];
if ( data === undefined ) {
- groupsToLoad.push( value );
- // Once loaded, this value will be replaced with the received data
- groupsLoaded[ value ] = deferred.promise();
+ if ( liveData[ group ] === undefined ) {
+ groupsToLoad.push( group );
+ // Once loaded, this value will be replaced with the received data
+ groupsLoaded[ group ] = apiPromise.promise();
+ }
} else if ( data !== null && $.isFunction( data.then ) ) {
promises.push( data );
}
} );
if ( groupsToLoad.length ) {
- promises.push( deferred.promise() );
- }
- if ( !promises.length ) {
- return deferred.resolve( groupsLoaded ).promise();
+ new mw.Api().get( {
+ action: 'query',
+ formatversion: '2',
+ titles: mw.config.get( 'wgPageName' ),
+ prop: 'mapdata',
+ mpdgroups: groupsToLoad.join( '|' )
+ } ).done( function ( data ) {
+ var rawMapData = data.query.pages[ 0 ].mapdata,
+ mapData = rawMapData && JSON.parse( rawMapData ) || {};
+ return loadGeoJsonAsync( mapData ).then( function () {
+ apiPromise.resolve( groupsLoaded );
+ } );
+ } );
+ promises.push( apiPromise.promise() );
}
- new mw.Api().get( {
- action: 'query',
- formatversion: '2',
- titles: mw.config.get( 'wgPageName' ),
- prop: 'mapdata',
- mpdgroups: groupsToLoad.join( '|' )
- } ).done( function ( data ) {
- var rawMapData = data.query.pages[ 0 ].mapdata,
- mapData = rawMapData && JSON.parse( rawMapData ) || {};
- $.extend( groupsLoaded, mapData );
- deferred.resolve( groupsLoaded );
- } );
-
return $.when.apply( $, promises ).then( function () {
// All pending promises are done
return groupsLoaded;
} ).promise();
}
+ /**
+ * Traverse data, load all external data, and expand it in place. Returns a promise.
+ *
+ * @param {Object} data groupId->GeoJson, where geojson may contain ExternalData hrefs
+ * @return {Promise} resolved when all external data objects are expanded in place
+ */
+ function loadGeoJsonAsync( data ) {
+ var promises = [];
+ $.each( data, function ( key, value ) {
+ loadGeoJsonRec( value, promises );
+ } );
+ return $.when.apply( $, promises ).then( function () {
+ $.extend( groupsLoaded, data );
+ } );
+ }
+
+ /**
+ * Recursive function to traverse data and expand external data
+ *
+ * @param {Object|Array|*} data to traverse
+ * @param {Promise[]} pendingPromises list of promises, one for each external data XHR
+ */
+ function loadGeoJsonRec( data, pendingPromises ) {
+ if ( $.isArray( data ) ) {
+ $.each( data, function ( key, value ) {
+ loadGeoJsonRec( value, pendingPromises );
+ } );
+ } else if ( $.isPlainObject( data ) && data.type ) {
+ if ( data.type === 'GeometryCollection' && data.geometries ) {
+ loadGeoJsonRec( data.geometries, pendingPromises );
+ } else if ( data.type === 'FeatureCollection' && data.features ) {
+ loadGeoJsonRec( data.features, pendingPromises );
+ } else if ( data.type === 'ExternalData' ) {
+ pendingPromises.push( loadExternalDataAsync( data ) );
+ }
+ }
+ }
+
+ /**
+ * For a given ExternalData object, gets it via XHR and expands it in place
+ *
+ * @param {Object} data
+ * @param {string} data.href URL to external data
+ * @return {Promise} resolved when done with geojson expansion
+ */
+ function loadExternalDataAsync( data ) {
+ var uri = new mw.Uri( data.href );
+ // If url begins with protocol:///... mark it as having relative host
+ if ( /^[a-z]+:\/\/\//.test( data.href ) ) {
+ uri.isRelativeHost = true;
+ }
+ switch ( uri.protocol ) {
+ case 'geoshape':
+ // geoshape:///?ids=Q16,Q30
+ // geoshape:///?query=SELECT...
+ // Get geo shapes data from OSM database by supplying Wikidata IDs or query
+ // https://maps.wikimedia.org/shape?ids=Q16,Q30
+ if ( !uri.query || ( !uri.query.ids && !uri.query.query ) ) {
+ throw new Error( 'geoshape: missing ids or query parameter in: ' + data.href );
+ }
+ if ( !uri.isRelativeHost && uri.host !== 'maps.wikimedia.org' ) {
+ throw new Error( 'geoshape: hostname must be missing or "maps.wikimedia.org": ' + data.href );
+ }
+ uri.protocol = 'https';
+ uri.host = 'maps.wikimedia.org';
+ uri.port = undefined;
+ uri.path = '/geoshape';
+ uri.query.origin = location.protocol + '//' + location.host;
+ // HACK: workaround for T144777
+ uri.query.getgeojson = 1;
+
+ return $.getJSON( uri.toString() ).then( function ( geoshape ) {
+ delete data.href;
+
+ // HACK: workaround for T144777 - we should be using topojson instead
+ $.extend( data, geoshape );
+
+ // data.type = 'FeatureCollection';
+ // data.features = [];
+ // $.each( geoshape.objects, function ( key ) {
+ // data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) );
+ // } );
+ } );
+
+ default:
+ throw new Error( 'Unknown protocol ' + data.href );
+ }
+ }
+
/*jscs:disable disallowDanglingUnderscores */
Map = L.Map.extend( {
/**
@@ -674,8 +777,8 @@
if ( this.options.fullscreen ) {
this._size = new L.Point(
- document.body.clientWidth,
- document.body.clientHeight
+ window.innerWidth,
+ window.innerHeight
);
return;
}
@@ -780,7 +883,8 @@
module.CloseFullScreenControl,
module.dataLayerOpts,
module.ScaleControl,
- document
+ require( 'ext.kartographer.lib.topojson' ),
+ window
);
module.map = ( function ( Map ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Kartographer/modules/box/Link.js 2016-08-30 11:20:04.355445303 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Kartographer/modules/box/Link.js 2016-09-06 16:28:45.429237152 +0000
@@ -94,7 +94,7 @@
);
} else {
map = this.fullScreenMap = L.kartographer.map( {
- container: document.createElement( 'div' ),
+ container: L.DomUtil.create( 'div', 'mw-kartographer-mapDialog-map' ),
fullscreen: true,
link: true,
center: position.center,
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Kartographer/modules/wikivoyage/ControlNearby.js 2016-08-30 11:20:04.359445334 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Kartographer/modules/wikivoyage/ControlNearby.js 2016-09-06 16:28:45.433237183 +0000
@@ -14,8 +14,11 @@
var articlePath = mw.config.get( 'wgArticlePath' );
- function mousepopup( marker, data ) {
- marker.bindPopup( data.title, { minWidth: 140, maxWidth: 140, closeButton: false } );
+ function prepareMarker( marker, data ) {
+ marker.setIcon( L.mapbox.marker.icon( {
+ 'marker-color': 'a2a9b1'
+ } ) );
+ marker.bindPopup( data.title, { closeButton: false } );
marker.on( 'click', function () {
this.openPopup();
} );
@@ -28,8 +31,14 @@
link = mw.html.element( 'a', {
href: mw.format( articlePath, wgPageName ),
target: '_blank'
- }, wgPageName );
- return img + link;
+ }, wgPageName ),
+ title = mw.html.element( 'div', {
+ 'class': 'marker-title'
+ }, new mw.html.Raw( link ) ),
+ description = mw.html.element( 'div', {
+ 'class': 'marker-description'
+ }, new mw.html.Raw( img ) );
+ return title + description;
}
function createMarker( latitude, longitude, wgArticle, thumbnail ) {
@@ -106,7 +115,7 @@
pruneCluster.RegisterMarker(
createMarker.apply( null, addressPoints[ i ] )
);
- pruneCluster.PrepareLeafletMarker = mousepopup;
+ pruneCluster.PrepareLeafletMarker = prepareMarker;
}
pruneCluster.ProcessView();
} ).fail( function () {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Echo/modules/model/mw.echo.dm.ModelManager.js 2016-08-30 11:19:20.963112666 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Echo/modules/model/mw.echo.dm.ModelManager.js 2016-09-07 18:38:34.842674731 +0000
@@ -288,6 +288,18 @@
};
/**
+ * Get local unread notifications
+ *
+ * @return {mw.echo.dm.NotificationItem[]} Local unread notifications
+ */
+ mw.echo.dm.ModelManager.prototype.getLocalUnread = function () {
+ var isUnread = function ( item ) {
+ return !item.isRead();
+ };
+
+ return this.getLocalNotifications().filter( isUnread );
+ };
+ /**
* Check whether there are talk notifications, and emit an event
* in case there aren't any left.
*
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Echo/modules/ui/mw.echo.ui.CrossWikiNotificationItemWidget.js 2016-08-30 11:19:20.967112697 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Echo/modules/ui/mw.echo.ui.CrossWikiNotificationItemWidget.js 2016-09-06 16:27:53.248834591 +0000
@@ -315,7 +315,9 @@
mw.echo.ui.CrossWikiNotificationItemWidget.prototype.toggleExpanded = function ( show ) {
this.expanded = show !== undefined ? !!show : !this.expanded;
- if ( show ) {
+ this.$element.toggleClass( 'mw-echo-ui-crossWikiNotificationItemWidget-expanded', this.expanded );
+
+ if ( this.expanded ) {
this.getList().$element.slideDown();
} else {
this.getList().$element.slideUp();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/SemanticForms/libs/SemanticForms.js 2016-08-30 11:21:02.691892503 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/SemanticForms/libs/SemanticForms.js 2016-09-06 16:29:57.529793376 +0000
@@ -10,7 +10,7 @@
* @author Harold Solbrig
* @author Eugene Mednikov
*/
-/*global sfgShowOnSelect, sfgFieldProperties, sfgCargoFields, validateAll, alert, sf*/
+/*global sfgShowOnSelect, sfgFieldProperties, sfgCargoFields, sfgDependentFields, validateAll, alert, sf*/
// Activate autocomplete functionality for the specified field
( function ( $, mw ) {
@@ -1059,6 +1059,7 @@
* Functions for multiple-instance templates.
*/
$.fn.addInstance = function( addAboveCurInstance ) {
+ var sfgShowOnSelect = mw.config.get( 'sfgShowOnSelect' );
var wrapper = this.closest(".multipleTemplateWrapper");
var multipleTemplateList = wrapper.find('.multipleTemplateList');
@@ -1224,7 +1225,9 @@
// templates.
$.fn.setDependentAutocompletion = function( dependentField, baseField, baseValue ) {
// Get data from either Cargo or Semantic MediaWiki.
- var myServer = mw.config.get( 'wgScriptPath' ) + "/api.php";
+ var myServer = mw.config.get( 'wgScriptPath' ) + "/api.php",
+ sfgCargoFields = mw.config.get( 'sfgCargoFields' ),
+ sfgFieldProperties = mw.config.get( 'sfgFieldProperties' );
myServer += "?action=sfautocomplete&format=json";
if ( sfgCargoFields.hasOwnProperty( dependentField ) ) {
var cargoTableAndFieldStr = sfgCargoFields[dependentField];
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/SemanticForms/libs/SF_jsGrid.js 2016-08-30 11:21:02.687892472 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/SemanticForms/libs/SF_jsGrid.js 2016-09-06 16:29:57.529793376 +0000
@@ -8,6 +8,8 @@
( function ( $, mw ) {
$( '.sfJSGrid' ).each( function() {
+ var sfgGridParams = mw.config.get( 'sfgGridParams' ),
+ sfgGridValues = mw.config.get( 'sfgGridValues' );
var $gridDiv = $( this );
var templateName = $gridDiv.attr( 'data-template-name' );
var gridHeight = $gridDiv.attr( 'height' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Graph/lib/graph2.compiled.js 2016-08-30 11:19:58.319399032 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Graph/lib/graph2.compiled.js 2016-09-19 13:52:49.923289819 +0000
@@ -506,29 +506,37 @@
* Performs post-processing of the data requested by the graph's spec
*/
VegaWrapper.prototype.dataParser = function dataParser(error, data, opt, callback) {
- if (error) {
- callback(error);
- return;
+ if (!error) {
+ try {
+ data = this.parseDataOrThrow(data, opt);
+ } catch (e) {
+ error = e;
+ }
}
+ if (error) data = undefined;
+ callback(error, data);
+};
+
+/**
+ * Performs post-processing of the data requested by the graph's spec, and throw on error
+ */
+VegaWrapper.prototype.parseDataOrThrow = function parseDataOrThrow(data, opt) {
switch (opt.graphProtocol) {
case 'wikiapi:':
case 'wikiraw:':
// This was an API call - check for errors
data = JSON.parse(data);
if (data.error) {
- error = new Error('API error: ' + JSON.stringify(data.error));
- data = undefined;
- } else {
- if (data.warnings) {
- this.logger('API warnings: ' + JSON.stringify(data.warnings));
- }
- if (opt.graphProtocol === 'wikiraw') {
- try {
- data = data.query.pages[0].revisions[0].content;
- } catch (e) {
- data = undefined;
- error = new Error('Page content not available ' + opt.url);
- }
+ throw new Error('API error: ' + JSON.stringify(data.error));
+ }
+ if (data.warnings) {
+ this.logger('API warnings: ' + JSON.stringify(data.warnings));
+ }
+ if (opt.graphProtocol === 'wikiraw:') {
+ try {
+ data = data.query.pages[0].revisions[0].content;
+ } catch (e) {
+ throw new Error('Page content not available ' + opt.url);
}
}
break;
@@ -549,7 +557,8 @@
});
break;
}
- callback(error, data);
+
+ return data;
};
/**
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RelatedArticles/resources/ext.relatedArticles.readMore/index.js 2016-08-30 11:20:50.191796679 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RelatedArticles/resources/ext.relatedArticles.readMore/index.js 2016-09-06 16:29:42.105674387 +0000
@@ -48,14 +48,7 @@
.append( $( '<h2></h2>' ).text( mw.msg( 'relatedarticles-read-more-heading' ) ) )
.append( cards.$el );
- // If a skin has marked up a footer content area prepend it there
- if ( $( '.footer-content' ).length ) {
- $readMore.prependTo( '.footer-content' );
- } else {
- $( '<div class="read-more-container post-content" />' )
- .append( $readMore )
- .insertAfter( '#content' );
- }
+ $( '.read-more-container' ).append( $readMore );
// the ReadMore code is ready
mw.track( 'ext.relatedArticles.logReady', { $readMore: $readMore } );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RelatedArticles/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js 2016-08-30 11:20:50.191796679 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RelatedArticles/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js 2016-09-06 16:29:42.105674387 +0000
@@ -77,7 +77,22 @@
parameters.gsrnamespace = '0';
parameters.gsrlimit = limit;
parameters.gsrqiprofile = 'classic_noboostlinks';
- parameters.smaxage = 86400; // 24 hours
+
+ // Currently, if you're logged in, then the API uses your language by default ard so responses
+ // are always private i.e. they shouldn't be cached in a shared cache and can be cached by the
+ // browser.
+ //
+ // By make the API use the language of the content rather than that of the user, the API
+ // reponse is made public, i.e. they can be cached in a shared cache.
+ //
+ // See T97096 for more detail and discussion.
+ parameters.uselang = 'content';
+
+ // Instruct shared caches that the response will become stale in 24 hours.
+ parameters.smaxage = 86400;
+
+ // Instruct the browser that the response will become stale in 24 hours.
+ parameters.maxage = 86400;
} else {
return $.Deferred().resolve( [] );
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RelatedArticles/resources/ext.relatedArticles.readMore.bootstrap/index.js 2016-08-30 11:20:50.191796679 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RelatedArticles/resources/ext.relatedArticles.readMore.bootstrap/index.js 2016-09-06 16:29:42.105674387 +0000
@@ -21,12 +21,10 @@
* @ignore
*/
function loadRelatedArticles() {
- /**
- * Threshold value to load related articles - after about half scroll
- */
- var scrollThreshold = ( $( document ).height() / 2 ) - $window.height();
+ var readMore = $( '.read-more-container' ).get( 0 ),
+ scrollThreshold = $( document ).height() / 2 - $window.height();
- if ( $window.scrollTop() > scrollThreshold ) {
+ if ( mw.viewport.isElementCloseToViewport( readMore, scrollThreshold ) ) {
$.when(
// Note we load dependencies here rather than ResourceLoader
// to avoid PHP exceptions when Cards not installed
@@ -68,6 +66,14 @@
// any skin except minerva stable
( config.skin !== 'minerva' || config.wgMFMode === 'beta' )
) {
+ // Add container to DOM for checking distance on scroll
+ // If a skin has marked up a footer content area prepend it there
+ if ( $( '.footer-content' ).length ) {
+ $( '<div class="read-more-container" />' ).prependTo( '.footer-content' );
+ } else {
+ $( '<div class="read-more-container post-content" />' )
+ .insertAfter( '#content' );
+ }
// try related articles load on scroll
$window.on( 'scroll', debouncedLoad );
// try an initial load, in case of no scroll
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Flow/modules/editor/editors/visualeditor/ui/widgets/mw.flow.ve.ui.MentionTargetInputWidget.js 2016-08-30 11:19:47.467315842 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Flow/modules/editor/editors/visualeditor/ui/widgets/mw.flow.ve.ui.MentionTargetInputWidget.js 2016-09-06 16:28:22.121057336 +0000
@@ -63,7 +63,7 @@
// Then check the user exists
return mw.flow.ve.userCache.get( this.value ).then(
function ( user ) {
- return !user.missing;
+ return !user.missing && !user.invalid;
},
function () {
// If the API is down or behaving strangely, we shouldn't prevent
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js 2016-08-30 11:22:38.884629916 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js 2016-09-06 20:27:01.853911095 +0000
@@ -16,36 +16,53 @@
*/
$.widget( 'wikibase.entityselector', $.wikibase.entityselector, {
+ /**
+ * @property {Function}
+ * @private
+ */
_oldCreate: $.wikibase.entityselector.prototype._create,
+ /**
+ * @inheritdoc
+ * @protected
+ */
_create: function() {
var self = this;
- self._oldCreate.apply( self, arguments );
+ this._oldCreate.apply( this, arguments );
var focusHandler = function( event ) {
- if( self._useSuggester() && self.element.val() === ''
- && !self.options.menu.element.is( ":visible" ) ) {
+ if ( self._useSuggester()
+ && self.element.val() === ''
+ && !self.options.menu.element.is( ':visible' )
+ ) {
self.options.minTermLength = 0;
self._cache = {}; // is done in the entityselector on eachchange too
self.search();
}
};
- self.element.on( 'focus', focusHandler );
+
+ // Search for suggestions once the field is initially focused.
+ // We only need to do this once, afterwards the old suggestions
+ // will re-appear on focus anyway.
+ this.element.one( 'focus', focusHandler );
},
+ /**
+ * @property {Function}
+ * @private
+ */
_oldGetSearchApiParameters: $.wikibase.entityselector.prototype._getSearchApiParameters,
/**
- *
+ * @inheritdoc
+ * @protected
* @param {string} term
* @return {Object}
*/
_getSearchApiParameters: function( term ) {
- var self = this;
-
- if( !self._useSuggester() ) {
- return self._oldGetSearchApiParameters( term )
+ if ( !this._useSuggester() ) {
+ return this._oldGetSearchApiParameters( term );
} else {
var data = {
action: 'wbsgetsuggestions',
@@ -57,108 +74,120 @@
? this._cache.nextSuggestionOffset
: 0
};
- if( data.context == 'item' ) {
- data.entity = self._getEntity().getId();
+
+ if ( data.context === 'item' ) {
+ data.entity = this._getEntity().getId();
} else {
- data.properties = self._getPropertyId();
+ data.properties = this._getPropertyId();
}
+
return data;
}
},
/**
+ * @private
* @return {boolean}
*/
_useSuggester: function() {
var entity = this._getEntity();
- return this.options.type === 'property' && entity !== null && entity.getType() === 'item';
+
+ return this.options.type === 'property' && entity && entity.getType() === 'item';
},
/**
* Get the entity from the surrounding entityview or return null
+ * @private
* @return {wikibase.Entity|null}
*/
_getEntity: function() {
try {
var $entityView = this.element.closest( ':wikibase-entityview' );
- } catch( e ) {
- return null;
- }
- var entity = $entityView.length > 0 ? $entityView.data( 'entityview' ).option( 'value' ) : null;
- if( entity ) {
- return entity;
- } else {
+ } catch ( ex ) {
return null;
}
+
+ return $entityView.length > 0
+ ? $entityView.data( 'entityview' ).option( 'value' )
+ : null;
},
/**
* Returns the property id for the enclosing statementview or null if no property is selected yet.
*
+ * @private
* @return {string|null}
*/
_getPropertyId: function() {
try {
var $statementview = this.element.closest( ':wikibase-statementview' );
- } catch( e ) {
- return null;
- }
- var statement = $statementview.length > 0 ? $statementview.data( 'statementview' ).option( 'value' ) : null;
- if( statement ) {
- return statement.getClaim().getMainSnak().getPropertyId();
- } else {
+ } catch ( ex ) {
return null;
}
+
+ var statement = $statementview.length > 0
+ ? $statementview.data( 'statementview' ).option( 'value' )
+ : null;
+
+ return statement ? statement.getClaim().getMainSnak().getPropertyId() : null;
},
/**
* Returns either 'item', 'qualifier', 'reference' or null depending on the context of the entityselector.
* 'item' is returned in case that the selector is for a new property in an item.
*
- * @return {string}
+ * @private
+ * @return {string|null}
*/
_getPropertyContext: function() {
- if( this._isInNewStatementView() ) {
+ if ( this._isInNewStatementView() ) {
return 'item';
- } else if( this._isQualifier() ) {
+ } else if ( this._isQualifier() ) {
return 'qualifier';
- } else if( this._isReference() ) {
- return 'reference'
+ } else if ( this._isReference() ) {
+ return 'reference';
} else {
return null;
}
},
/**
+ * @private
* @return {boolean}
*/
_isQualifier: function() {
- var $statementview = this.element.closest( ':wikibase-statementview' );
- var statementview = $statementview.data( 'statementview' );
- if( !statementview ) {
+ var $statementview = this.element.closest( ':wikibase-statementview' ),
+ statementview = $statementview.data( 'statementview' );
+
+ if ( !statementview ) {
return false;
}
+
return this.element.closest( statementview.$qualifiers ).length > 0;
},
/**
+ * @private
* @return {boolean}
*/
_isReference: function() {
var $referenceview = this.element.closest( ':wikibase-referenceview' );
+
return $referenceview.length > 0;
},
/**
* detect if this is a new statement view.
+ * @private
* @return {boolean}
*/
_isInNewStatementView: function() {
- var $statementview = this.element.closest( ':wikibase-statementview' );
- var value = ( $statementview.length > 0 )
- ? $statementview.data( 'statementview' ).option( 'value' )
- : null;
- return value === null;
+ var $statementview = this.element.closest( ':wikibase-statementview' ),
+ value = $statementview.length > 0
+ ? $statementview.data( 'statementview' ).option( 'value' )
+ : null;
+
+ return !value;
}
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ViewFactory.js 2016-08-30 11:22:39.112631663 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ViewFactory.js 2016-09-06 20:27:01.981912065 +0000
@@ -12,6 +12,7 @@
* @author Adrian Heine <adrian.heine@wikimedia.de>
* @constructor
*
+ * @param {wikibase.view.StructureEditorFactory} structureEditorFactory
* @param {util.ContentLanguages} contentLanguages
* Required by the `ValueView` for limiting the list of available languages for
* particular `jQuery.valueview.Expert` instances like the `Expert` responsible
@@ -39,6 +40,7 @@
* @param {string|null} [vocabularyLookupApiUrl=null]
*/
var SELF = MODULE.ViewFactory = function ViewFactory(
+ structureEditorFactory,
contentLanguages,
dataTypeStore,
entityIdHtmlFormatter,
@@ -51,6 +53,7 @@
userLanguages,
vocabularyLookupApiUrl
) {
+ this._structureEditorFactory = structureEditorFactory;
this._contentLanguages = contentLanguages;
this._dataTypeStore = dataTypeStore;
this._entityIdHtmlFormatter = entityIdHtmlFormatter;
@@ -67,94 +70,101 @@
};
/**
+ * @property {wikibase.view.StructureEditorFactory}
+ * @private
+ */
+ SELF.prototype._structureEditorFactory = null;
+
+ /**
* @property {util.ContentLanguages}
* @private
- **/
+ */
SELF.prototype._contentLanguages = null;
/**
* @property {dataTypes.DataTypeStore}
* @private
- **/
+ */
SELF.prototype._dataTypeStore = null;
/**
* @property {wikibase.entityIdFormatter.EntityIdHtmlFormatter}
* @private
- **/
+ */
SELF.prototype._entityIdHtmlFormatter = null;
/**
* @property {wikibase.entityIdFormatter.EntityIdPlainFormatter}
* @private
- **/
+ */
SELF.prototype._entityIdPlainFormatter = null;
/**
* @property {wikibase.store.EntityStore}
* @private
- **/
+ */
SELF.prototype._entityStore = null;
/**
* @property {jQuery.util.EventSingletonManager}
* @private
- **/
+ */
SELF.prototype._eventSingletonManager = null;
/**
* @property {jQuery.valueview.ExpertStore}
* @private
- **/
+ */
SELF.prototype._expertStore = null;
/**
* @property {wikibase.ValueFormatterFactory}
* @private
- **/
+ */
SELF.prototype._formatterFactory = null;
/**
* @property {util.MessageProvider}
* @private
- **/
+ */
SELF.prototype._messageProvider = null;
/**
* @property {valueParsers.ValueParserStore}
* @private
- **/
+ */
SELF.prototype._parserStore = null;
/**
* @property {string[]}
* @private
- **/
+ */
SELF.prototype._userLanguages = null;
/**
* @property {string|null}
* @private
- **/
+ */
SELF.prototype._vocabularyLookupApiUrl = null;
/**
* Construct a suitable view for the given entity on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {wikibase.datamodel.Entity} entity
* @param {jQuery} $entityview
* @return {jQuery.wikibase.entityview} The constructed entity view
* @throws {Error} If there is no view for the given entity type
- **/
- SELF.prototype.getEntityView = function( entity, $entityview ) {
+ */
+ SELF.prototype.getEntityView = function( startEditingCallback, entity, $entityview ) {
return this._getView(
// Typically "itemview" or "propertyview".
entity.getType() + 'view',
$entityview,
{
- buildEntityTermsView: $.proxy( this.getEntityTermsView, this ),
- buildSitelinkGroupListView: $.proxy( this.getSitelinkGroupListView, this ),
- buildStatementGroupListView: $.proxy( this.getStatementGroupListView, this ),
+ buildEntityTermsView: this.getEntityTermsView.bind( this, startEditingCallback ),
+ buildSitelinkGroupListView: this.getSitelinkGroupListView.bind( this, startEditingCallback ),
+ buildStatementGroupListView: this.getStatementGroupListView.bind( this, startEditingCallback ),
value: entity
}
);
@@ -163,11 +173,12 @@
/**
* Construct a suitable terms view for the given fingerprint on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {wikibase.datamodel.Fingerprint} fingerprint
* @param {jQuery} $entitytermsview
* @return {jQuery.wikibase.entitytermsview} The constructed entity terms view
- **/
- SELF.prototype.getEntityTermsView = function( fingerprint, $entitytermsview ) {
+ */
+ SELF.prototype.getEntityTermsView = function( startEditingCallback, fingerprint, $entitytermsview ) {
return this._getView(
'entitytermsview',
$entitytermsview,
@@ -182,11 +193,12 @@
/**
* Construct a suitable view for the given sitelink set on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {wikibase.datamodel.SiteLinkSet} sitelinkSet
* @param {jQuery} $sitelinkgrouplistview
* @return {jQuery.wikibase.sitelinkgrouplistview} The constructed sitelinkgrouplistview
- **/
- SELF.prototype.getSitelinkGroupListView = function( sitelinkSet, $sitelinkgrouplistview ) {
+ */
+ SELF.prototype.getSitelinkGroupListView = function( startEditingCallback, sitelinkSet, $sitelinkgrouplistview ) {
var self = this;
return this._getView(
@@ -197,7 +209,7 @@
listItemAdapter: new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.sitelinkgroupview,
getNewItem: function( value, dom ) {
- return self.getSitelinkGroupView( value.group, value.siteLinks, $( dom ) );
+ return self.getSitelinkGroupView( startEditingCallback, value.group, value.siteLinks, $( dom ) );
}
} )
}
@@ -207,19 +219,20 @@
/**
* Construct a suitable view for the given sitelink group on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {string} groupName
* @param {wikibase.datamodel.SiteLinkSet} siteLinks
* @param {jQuery} $sitelinkgroupview
* @return {jQuery.wikibase.sitelinkgroupview} The constructed sitelinkgroupview
- **/
- SELF.prototype.getSitelinkGroupView = function( groupName, siteLinks, $sitelinkgroupview ) {
+ */
+ SELF.prototype.getSitelinkGroupView = function( startEditingCallback, groupName, siteLinks, $sitelinkgroupview ) {
return this._getView(
'sitelinkgroupview',
$sitelinkgroupview,
{
groupName: groupName,
value: siteLinks,
- getSiteLinkListView: this.getSiteLinkListView.bind( this )
+ getSiteLinkListView: this.getSiteLinkListView.bind( this, startEditingCallback )
}
);
};
@@ -227,13 +240,14 @@
/**
* Construct a suitable view for the given sitelink list on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {wikibase.datamodel.SiteLink[]} siteLinks
* @param {jQuery} $sitelinklistview
* @param {string[]} allowedSiteIds
* @param {jQuery} $counter
* @return {jQuery.wikibase.sitelinklistview} The constructed sitelinklistview
- **/
- SELF.prototype.getSiteLinkListView = function( siteLinks, $sitelinklistview, allowedSiteIds, $counter ) {
+ */
+ SELF.prototype.getSiteLinkListView = function( startEditingCallback, siteLinks, $sitelinklistview, allowedSiteIds, $counter ) {
return this._getView(
'sitelinklistview',
$sitelinklistview,
@@ -242,17 +256,19 @@
allowedSiteIds: allowedSiteIds,
encapsulate: true,
eventSingletonManager: this._eventSingletonManager,
- getListItemAdapter: this.getListItemAdapterForSiteLinkView.bind( this ),
+ getListItemAdapter: this.getListItemAdapterForSiteLinkView.bind( this, startEditingCallback ),
value: siteLinks
}
);
};
/**
+ * @param {Function} startEditingCallback
* @param {Function} getAllowedSites
+ * @param {Function} removeCallback
* @return {jQuery.wikibase.listview.ListItemAdapter}
*/
- SELF.prototype.getListItemAdapterForSiteLinkView = function( getAllowedSites ) {
+ SELF.prototype.getListItemAdapterForSiteLinkView = function( startEditingCallback, getAllowedSites, removeCallback ) {
var self = this;
return new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.sitelinkview,
@@ -263,7 +279,16 @@
{
value: value,
getAllowedSites: getAllowedSites,
- entityIdPlainFormatter: self._entityIdPlainFormatter
+ entityIdPlainFormatter: self._entityIdPlainFormatter,
+ getSiteLinkRemover: function( $dom, title ) {
+ return self._structureEditorFactory.getRemover(
+ function () {
+ return startEditingCallback().then( function() { return removeCallback( view ); } );
+ },
+ $dom,
+ title
+ );
+ }
}
);
return view;
@@ -271,14 +296,25 @@
} );
};
+ SELF.prototype._getAdderWithStartEditing = function( startEditingCallback ) {
+ var structureEditorFactory = this._structureEditorFactory;
+ return function( doAdd, $dom, label ) {
+ var newDoAdd = function() {
+ return startEditingCallback().then( doAdd );
+ };
+ return structureEditorFactory.getAdder( newDoAdd, $dom, label );
+ };
+ };
+
/**
* Construct a suitable view for the list of statement groups for the given entity on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {wikibase.datamodel.Item|wikibase.datamodel.Property} entity
* @param {jQuery} $statementgrouplistview
* @return {jQuery.wikibase.statementgrouplistview} The constructed statementgrouplistview
- **/
- SELF.prototype.getStatementGroupListView = function( entity, $statementgrouplistview ) {
+ */
+ SELF.prototype.getStatementGroupListView = function( startEditingCallback, entity, $statementgrouplistview ) {
var statementGroupSet = entity.getStatements();
return this._getView(
'statementgrouplistview',
@@ -287,6 +323,7 @@
// If we have no HTML to initialize on, pass the raw data
value: $statementgrouplistview.is( ':empty' ) ? statementGroupSet : null,
listItemAdapter: this.getListItemAdapterForStatementGroupView(
+ startEditingCallback,
entity.getId(),
function( guid ) {
var res = null;
@@ -302,7 +339,8 @@
} );
return res;
}
- )
+ ),
+ getAdder: this._getAdderWithStartEditing( startEditingCallback )
}
);
};
@@ -310,18 +348,19 @@
/**
* Construct a `ListItemAdapter` for `statementgroupview`s
*
+ * @param {Function} startEditingCallback
* @param {string} entityId
* @param {Function} getStatementForGuid A function returning a `wikibase.datamodel.Statement` for a given GUID
* @return {jQuery.wikibase.listview.ListItemAdapter} The constructed ListItemAdapter
- **/
- SELF.prototype.getListItemAdapterForStatementGroupView = function( entityId, getStatementForGuid ) {
+ */
+ SELF.prototype.getListItemAdapterForStatementGroupView = function( startEditingCallback, entityId, getStatementForGuid ) {
return new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.statementgroupview,
newItemOptionsFn: $.proxy( function( value ) {
return {
value: value,
entityIdHtmlFormatter: this._entityIdHtmlFormatter,
- buildStatementListView: $.proxy( this.getStatementListView, this, entityId, value && value.getKey(), getStatementForGuid )
+ buildStatementListView: $.proxy( this.getStatementListView, this, startEditingCallback, entityId, value && value.getKey(), getStatementForGuid )
};
}, this )
} );
@@ -330,6 +369,7 @@
/**
* Construct a suitable view for the given list of statements on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {string} entityId
* @param {string|null} propertyId Optionally specifies a property
* all statements should be on or are on
@@ -337,8 +377,8 @@
* @param {wikibase.datamodel.StatementList} value
* @param {jQuery} $statementlistview
* @return {jQuery.wikibase.statementgroupview} The constructed statementlistview
- **/
- SELF.prototype.getStatementListView = function( entityId, propertyId, getStatementForGuid, value, $statementlistview ) {
+ */
+ SELF.prototype.getStatementListView = function( startEditingCallback, entityId, propertyId, getStatementForGuid, value, $statementlistview ) {
propertyId = propertyId || $statementlistview.closest( '.wikibase-statementgroupview' ).attr( 'id' );
return this._getView(
@@ -346,14 +386,17 @@
$statementlistview,
{
value: value.length === 0 ? null : value,
- listItemAdapter: this.getListItemAdapterForStatementView(
+ getListItemAdapter: this.getListItemAdapterForStatementView.bind(
+ this,
+ startEditingCallback,
entityId,
function( dom ) {
var guidMatch = dom.className.match( /wikibase-statement-(\S+)/ );
return guidMatch ? getStatementForGuid( guidMatch[ 1 ] ) : null;
},
propertyId
- )
+ ),
+ getAdder: this._getAdderWithStartEditing( startEditingCallback )
}
);
};
@@ -361,25 +404,28 @@
/**
* Construct a `ListItemAdapter` for `statementview`s
*
+ * @param {Function} startEditingCallback
* @param {string} entityId
* @param {Function} getValueForDom A function returning a `wikibase.datamodel.Statement` or `null`
* for a given DOM element
* @param {string|null} [propertyId] Optionally a property all statements are or should be on
+ * @param {Function} removeCallback A function that accepts a statementview and removes it from
+ * the list.
* @return {jQuery.wikibase.listview.ListItemAdapter} The constructed ListItemAdapter
- **/
- SELF.prototype.getListItemAdapterForStatementView = function( entityId, getValueForDom, propertyId ) {
+ */
+ SELF.prototype.getListItemAdapterForStatementView = function( startEditingCallback, entityId, getValueForDom, propertyId, removeCallback ) {
var listItemAdapter = new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.statementview,
getNewItem: $.proxy( function( value, dom ) {
value = value || getValueForDom( dom );
- var view = this.getStatementView( entityId, propertyId, value, $( dom ) );
+ var view = this.getStatementView( startEditingCallback, entityId, propertyId, removeCallback, value, $( dom ) );
return view;
}, this )
} );
return listItemAdapter;
};
- SELF.prototype.getStatementView = function( entityId, propertyId, value, $dom ) {
+ SELF.prototype.getStatementView = function( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
var currentPropertyId = value ? value.getClaim().getMainSnak().getPropertyId() : propertyId;
var view = this._getView(
'statementview',
@@ -397,15 +443,17 @@
}
},
- buildReferenceListItemAdapter: $.proxy( this.getListItemAdapterForReferenceView, this ),
buildSnakView: $.proxy(
this.getSnakView,
this,
+ startEditingCallback,
false
),
entityIdPlainFormatter: this._entityIdPlainFormatter,
+ getAdder: this._getAdderWithStartEditing( startEditingCallback ),
+ getReferenceListItemAdapter: this.getListItemAdapterForReferenceView.bind( this, startEditingCallback ),
guidGenerator: new wb.utilities.ClaimGuidGenerator( entityId ),
- qualifiersListItemAdapter: this.getListItemAdapterForSnakListView()
+ qualifiersListItemAdapter: this.getListItemAdapterForSnakListView( startEditingCallback )
}
);
return view;
@@ -416,31 +464,47 @@
*
* @return {jQuery.wikibase.listview.ListItemAdapter} The constructed ListItemAdapter
*/
- SELF.prototype.getListItemAdapterForReferenceView = function() {
+ SELF.prototype.getListItemAdapterForReferenceView = function( startEditingCallback, removeCallback ) {
return new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.referenceview,
- newItemOptionsFn: $.proxy( function( value ) {
- return {
- value: value || null,
- listItemAdapter: this.getListItemAdapterForSnakListView()
- };
+ getNewItem: $.proxy( function( value, dom ) {
+ return this.getReferenceView( startEditingCallback, removeCallback, value, $( dom ) );
}, this )
} );
};
+ SELF.prototype.getReferenceView = function( startEditingCallback, removeCallback, value, $dom ) {
+ var structureEditorFactory = this._structureEditorFactory;
+ var view = this._getView(
+ 'referenceview',
+ $dom,
+ {
+ value: value || null,
+ listItemAdapter: this.getListItemAdapterForSnakListView( startEditingCallback ),
+ getAdder: this._getAdderWithStartEditing( startEditingCallback ),
+ getReferenceRemover: function( $dom ) {
+ return structureEditorFactory.getRemover( function() {
+ return startEditingCallback().then( function() { return removeCallback( view ); } );
+ }, $dom );
+ }
+ }
+ );
+ return view;
+ };
+
/**
* Construct a `ListItemAdapter` for `snaklistview`s
*
* @return {jQuery.wikibase.listview.ListItemAdapter} The constructed ListItemAdapter
*/
- SELF.prototype.getListItemAdapterForSnakListView = function() {
+ SELF.prototype.getListItemAdapterForSnakListView = function( startEditingCallback ) {
return new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.snaklistview,
newItemOptionsFn: $.proxy( function( value ) {
return {
+ getListItemAdapter: this.getListItemAdapterForSnakView.bind( this, startEditingCallback ),
value: value || undefined,
- singleProperty: true,
- listItemAdapter: this.getListItemAdapterForSnakView()
+ singleProperty: true
};
}, this )
} );
@@ -451,11 +515,12 @@
*
* @return {jQuery.wikibase.listview.ListItemAdapter} The constructed ListItemAdapter
*/
- SELF.prototype.getListItemAdapterForSnakView = function() {
+ SELF.prototype.getListItemAdapterForSnakView = function( startEditingCallback, removeCallback ) {
return new $.wikibase.listview.ListItemAdapter( {
listItemWidget: $.wikibase.snakview,
- newItemOptionsFn: $.proxy( function( value ) {
- return this._getSnakViewOptions(
+ getNewItem: $.proxy( function( value, dom ) {
+ return this.getSnakView(
+ startEditingCallback,
true,
{
locked: {
@@ -466,7 +531,9 @@
value || {
property: null,
snaktype: wb.datamodel.PropertyValueSnak.TYPE
- }
+ },
+ $( dom ),
+ removeCallback
);
}, this )
} );
@@ -475,43 +542,42 @@
/**
* Construct a suitable view for the given snak on the given DOM element
*
+ * @param {Function} startEditingCallback
* @param {boolean} drawProperty Whether the snakview should draw its property
* @param {Object} options An object with keys `locked` and `autoStartEditing`
* @param {wikibase.datamodel.Snak|null} snak
* @param {jQuery} $snakview
* @return {jQuery.wikibase.snakview} The constructed snakview
*/
- SELF.prototype.getSnakView = function( drawProperty, options, snak, $snakview ) {
- return this._getView(
+ SELF.prototype.getSnakView = function( startEditingCallback, drawProperty, options, snak, $snakview, removeCallback ) {
+ var structureEditorFactory = this._structureEditorFactory;
+ var view = this._getView(
'snakview',
$snakview,
- this._getSnakViewOptions( drawProperty, options, snak )
+ {
+ value: snak || undefined,
+ locked: options.locked,
+ autoStartEditing: options.autoStartEditing,
+ dataTypeStore: this._dataTypeStore,
+ entityIdHtmlFormatter: this._entityIdHtmlFormatter,
+ entityIdPlainFormatter: this._entityIdPlainFormatter,
+ entityStore: this._entityStore,
+ valueViewBuilder: this._getValueViewBuilder(),
+ drawProperty: drawProperty,
+ getSnakRemover: removeCallback ? function( $dom ) {
+ return structureEditorFactory.getRemover( function() {
+ return startEditingCallback().then( function() { return removeCallback( view ); } );
+ }, $dom );
+ } : null
+ }
);
- };
-
- /**
- * @param {boolean} drawProperty Whether the snakview should draw its property
- * @param {Object} options An object with keys `locked` and `autoStartEditing`
- * @param {wikibase.datamodel.Snak|null} snak
- */
- SELF.prototype._getSnakViewOptions = function( drawProperty, options, snak ) {
- return {
- value: snak || undefined,
- locked: options.locked,
- autoStartEditing: options.autoStartEditing,
- dataTypeStore: this._dataTypeStore,
- entityIdHtmlFormatter: this._entityIdHtmlFormatter,
- entityIdPlainFormatter: this._entityIdPlainFormatter,
- entityStore: this._entityStore,
- valueViewBuilder: this._getValueViewBuilder(),
- drawProperty: drawProperty
- };
+ return view;
};
/**
* @private
* @return {wikibase.ValueViewBuilder}
- **/
+ */
SELF.prototype._getValueViewBuilder = function() {
return new wb.ValueViewBuilder(
this._expertStore,
@@ -528,7 +594,7 @@
* @private
* @return {Object} The constructed view
* @throws {Error} If there is no view with the given name
- **/
+ */
SELF.prototype._getView = function( viewName, $dom, options ) {
if ( !$.wikibase[ viewName ] ) {
throw new Error( 'View ' + viewName + ' does not exist' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ControllerViewFactory.js 2016-08-30 11:22:39.112631663 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ControllerViewFactory.js 2016-09-06 20:27:01.981912065 +0000
@@ -12,8 +12,12 @@
}
);
-SELF.prototype.getEntityTermsView = function( value, $entitytermsview ) {
- var view = PARENT.prototype.getEntityTermsView.apply( this, arguments );
+SELF.prototype.getEntityTermsView = function( startEditingCallback, value, $entitytermsview ) {
+ var controller;
+ var startEditingController = function() {
+ return controller.startEditing();
+ };
+ var view = PARENT.prototype.getEntityTermsView.call( this, startEditingController, value, $entitytermsview );
var $container = this._toolbarFactory.getToolbarContainer( view.element );
$container.sticknode( {
$container: view.$entitytermsforlanguagelistview,
@@ -67,29 +71,33 @@
} );
var entityTermsChanger = this._entityChangersFactory.getEntityTermsChanger();
- this._getController( $container, view, entityTermsChanger, null, value );
+ controller = this._getController( $container, view, entityTermsChanger, null, value, startEditingCallback );
return view;
};
-SELF.prototype.getStatementView = function( entityId, propertyId, value, $dom ) {
+SELF.prototype.getStatementView = function( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
var controller;
- var statementview = PARENT.prototype.getStatementView.apply( this, arguments );
-
- var removeFromListView = function( statementview ) {
- var $statementlistview = statementview.element.closest( ':wikibase-statementlistview' ),
- statementlistview = $statementlistview.data( 'statementlistview' );
- if ( statementlistview ) {
- statementlistview.remove( statementview );
- }
+ var startEditingController = function() {
+ return controller.startEditing();
};
+ var statementview = PARENT.prototype.getStatementView.call(
+ this,
+ startEditingController,
+ entityId,
+ propertyId,
+ removeCallback,
+ value,
+ $dom
+ );
var statementsChanger = this._entityChangersFactory.getStatementsChanger();
- controller = statementview._controller = this._getController(
+ controller = this._getController(
this._toolbarFactory.getToolbarContainer( statementview.element ),
statementview,
statementsChanger,
- removeFromListView.bind( null, statementview ),
- value
+ removeCallback.bind( null, statementview ),
+ value,
+ startEditingCallback
);
if ( !value ) {
@@ -98,20 +106,25 @@
return statementview;
};
-SELF.prototype.getSitelinkGroupView = function( groupName, value, $sitelinkgroupview ) {
- var view = PARENT.prototype.getSitelinkGroupView.apply( this, arguments );
+SELF.prototype.getSitelinkGroupView = function( startEditingCallback, groupName, value, $sitelinkgroupview ) {
+ var controller;
+ var startEditingController = function() {
+ return controller.startEditing();
+ };
+ var view = PARENT.prototype.getSitelinkGroupView.call( this, startEditingController, groupName, value, $sitelinkgroupview );
var siteLinkSetsChanger = this._entityChangersFactory.getSiteLinkSetsChanger();
- this._getController(
+ controller = this._getController(
this._toolbarFactory.getToolbarContainer( view.element.find( '.wikibase-sitelinkgroupview-heading-container' ) ),
view,
siteLinkSetsChanger,
null,
- value
+ value,
+ startEditingCallback
);
return view;
};
-SELF.prototype._getController = function( $container, view, model, onRemove, value ) {
+SELF.prototype._getController = function( $container, view, model, onRemove, value, startEditingCallback ) {
var edittoolbar = this._toolbarFactory.getEditToolbar(
{
$container: $container,
@@ -120,7 +133,7 @@
view.element
);
- var controller = new wb.view.ToolbarViewController( model, edittoolbar, view, onRemove );
+ var controller = new wb.view.ToolbarViewController( model, edittoolbar, view, onRemove, startEditingCallback );
edittoolbar.setController( controller );
controller.setValue( value );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ToolbarFactory.js 2016-08-30 11:22:39.112631663 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ToolbarFactory.js 2016-09-06 20:27:01.981912065 +0000
@@ -15,22 +15,44 @@
var SELF = MODULE.ToolbarFactory = function ToolbarFactory() {};
/**
+ * Create a addtoolbar
+ *
+ * @param {Object} options
+ * @param {jQuery} $dom
+ * @return {jQuery.wikibase.addtoolbar} The addtoolbar
+ */
+ SELF.prototype.getAddToolbar = function( options, $dom ) {
+ return this._getToolbar( 'add', $dom, options );
+ };
+
+ /**
* Create an edittoolbar
*
* @param {Object} options
* @param {jQuery} $dom
* @return {jQuery.wikibase.edittoolbar} The edittoolbar
- **/
+ */
SELF.prototype.getEditToolbar = function( options, $dom ) {
return this._getToolbar( 'edit', $dom, options );
};
/**
+ * Create a removetoolbar
+ *
+ * @param {Object} options
+ * @param {jQuery} $dom
+ * @return {jQuery.wikibase.removetoolbar} The removetoolbar
+ */
+ SELF.prototype.getRemoveToolbar = function( options, $dom ) {
+ return this._getToolbar( 'remove', $dom, options );
+ };
+
+ /**
* Find or append a toolbar container
*
* @param {jQuery} $root
* @return {jQuery} The toolbar container
- **/
+ */
SELF.prototype.getToolbarContainer = function( $root ) {
var $container = $root.children( '.wikibase-toolbar-container' ).first();
if ( $container.length === 0 ) {
@@ -43,7 +65,7 @@
* @private
* @return {Object} The constructed toolbar
* @throws {Error} If there is no toolbar with the given name
- **/
+ */
SELF.prototype._getToolbar = function( toolbarType, $dom, options ) {
var toolbarName = toolbarType + 'toolbar';
if ( !$.wikibase[ toolbarName ] ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ToolbarViewController.js 2016-08-30 11:22:39.112631663 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/wikibase/view/ToolbarViewController.js 2016-09-06 20:27:01.981912065 +0000
@@ -20,14 +20,16 @@
* @param {jQuery.wikibase.edittoolbar} toolbar
* @param {jQuery.ui.EditableTemplatedWidget} view
* @param {Function} removeView
+ * @param {Function} startEditingCallback
*/
var SELF = util.inherit(
wb.view.ViewController,
- function( model, toolbar, view, removeView ) {
+ function( model, toolbar, view, removeView, startEditingCallback ) {
this._model = model;
this._toolbar = toolbar;
this._view = view;
this._removeView = removeView;
+ this._startEditingCallback = startEditingCallback;
}
);
@@ -62,6 +64,12 @@
SELF.prototype._removeView = null;
/**
+ * @property {Function}
+ * @private
+ */
+SELF.prototype._startEditingCallback = null;
+
+/**
* @param {Object|null} value A wikibase.datamodel object supporting at least an equals method.
*/
SELF.prototype.setValue = function( value ) {
@@ -86,6 +94,7 @@
this._view.widgetEventPrefix + 'disable',
$.proxy( this._updateToolbarState, this )
);
+ result.done( this._startEditingCallback );
return result;
};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.descriptionview.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.descriptionview.js 2016-09-06 20:27:01.973912005 +0000
@@ -5,12 +5,12 @@
( function( $, mw, wb ) {
'use strict';
- var PARENT = $.ui.TemplatedWidget;
+ var PARENT = $.ui.EditableTemplatedWidget;
/**
* Manages a description.
* @since 0.5
- * @extends jQuery.ui.TemplatedWidget
+ * @extends jQuery.ui.EditableTemplatedWidget
*
* @option {wikibase.datamodel.Term} value
*
@@ -36,11 +36,6 @@
},
/**
- * @type {boolean}
- */
- _isInEditMode: false,
-
- /**
* @see jQuery.ui.TemplatedWidget._create
*
* @throws {Error} if required parameters are not specified properly.
@@ -74,7 +69,7 @@
PARENT.prototype._create.call( this );
if ( this.$text.text() === '' ) {
- this._draw();
+ this.draw();
}
},
@@ -82,14 +77,14 @@
* @see jQuery.ui.TemplatedWidget.destroy
*/
destroy: function() {
- if ( this._isInEditMode ) {
+ if ( this.isInEditMode() ) {
var self = this;
this.element.one( this.widgetEventPrefix + 'afterstopediting', function( event ) {
PARENT.prototype.destroy.call( self );
} );
- this.cancelEditing();
+ this.stopEditing( true );
} else {
PARENT.prototype.destroy.call( this );
}
@@ -98,7 +93,8 @@
/**
* Main draw routine.
*/
- _draw: function() {
+ draw: function() {
+ var done = $.Deferred().resolve().promise();
var self = this,
languageCode = this.options.value.getLanguageCode(),
descriptionText = this.options.value.getText();
@@ -109,7 +105,7 @@
this.element[descriptionText ? 'removeClass' : 'addClass']( 'wb-empty' );
- if ( !this._isInEditMode && !descriptionText ) {
+ if ( !this.isInEditMode() && !descriptionText ) {
this.$text.text( mw.msg( 'wikibase-description-empty' ) );
// Apply lang and dir of UI language
// instead language of that row
@@ -117,16 +113,16 @@
this.element
.attr( 'lang', userLanguage )
.attr( 'dir', $.util.getDirectionality( userLanguage ) );
- return;
+ return done;
}
this.element
.attr( 'lang', languageCode )
.attr( 'dir', $.util.getDirectionality( languageCode ) );
- if ( !this._isInEditMode ) {
+ if ( !this.isInEditMode() ) {
this.$text.text( descriptionText );
- return;
+ return done;
}
var $input = $( document.createElement( this.options.inputNodeName ) );
@@ -162,106 +158,7 @@
}
this.$text.empty().append( $input );
- },
-
- /**
- * Starts the widget's edit mode.
- */
- startEditing: function() {
- if ( this._isInEditMode ) {
- return;
- }
- this.element.addClass( 'wb-edit' );
- this._isInEditMode = true;
- this._draw();
- this._trigger( 'afterstartediting' );
- },
-
- /**
- * Stops the widget's edit mode.
- *
- * @param {boolean} dropValue
- */
- stopEditing: function( dropValue ) {
- if ( !this._isInEditMode ) {
- return;
- } else if ( !this.isValid() && !dropValue ) {
- return;
- } else if ( dropValue ) {
- this._afterStopEditing( dropValue );
- return;
- }
-
- this.disable();
-
- this._trigger( 'stopediting', null, [dropValue] );
-
- this.enable();
- this._afterStopEditing( dropValue );
- },
-
- /**
- * Cancels the widget's edit mode.
- */
- cancelEditing: function() {
- this.stopEditing( true );
- },
-
- /**
- * Callback tearing down edit mode.
- *
- * @param {boolean} dropValue
- */
- _afterStopEditing: function( dropValue ) {
- if ( !dropValue ) {
- this.options.value = this.value();
- } else if ( this.options.value.getText() === '' ) {
- this.$text.children( '.' + this.widgetFullName + '-input' ).val( '' );
- }
-
- this.element.removeClass( 'wb-edit' );
- this._isInEditMode = false;
- this._draw();
-
- this._trigger( 'afterstopediting', null, [dropValue] );
- },
-
- /**
- * @return {boolean}
- */
- isValid: function() {
- // Function is required by edittoolbar definition.
- return true;
- },
-
- /**
- * @return {boolean}
- */
- isInitialValue: function() {
- if ( !this._isInEditMode ) {
- return true;
- }
-
- return this.value().equals( this.options.value );
- },
-
- /**
- * Toggles error state.
- *
- * @param {Error} error
- */
- setError: function( error ) {
- if ( error ) {
- this.element.addClass( 'wb-error' );
- this._trigger( 'toggleerror', null, [error] );
- } else {
- this.removeError();
- this._trigger( 'toggleerror' );
- }
- },
-
- removeError: function() {
- this.element.removeClass( 'wb-error' );
+ return done;
},
/**
@@ -274,7 +171,7 @@
var response = PARENT.prototype._setOption.call( this, key, value );
- if ( key === 'disabled' && this._isInEditMode ) {
+ if ( key === 'disabled' && this.isInEditMode() ) {
this.$text.children( '.' + this.widgetFullName + '-input' ).prop( 'disabled', value );
}
@@ -292,7 +189,7 @@
return this.option( 'value', value );
}
- if ( !this._isInEditMode ) {
+ if ( !this.isInEditMode() ) {
return this.options.value;
}
@@ -306,7 +203,7 @@
* @see jQuery.ui.TemplatedWidget.focus
*/
focus: function() {
- if ( this._isInEditMode ) {
+ if ( this.isInEditMode() ) {
this.$text.children( '.' + this.widgetFullName + '-input' ).focus();
} else {
this.element.focus();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js 2016-09-06 20:27:01.973912005 +0000
@@ -27,11 +27,6 @@
* @event afterstartediting
* - {jQuery.Event}
*
- * @event stopediting
- * - {jQuery.Event}
- * - {boolean} Whether to drop the value.
- * - {Function} Callback function.
- *
* @event afterstopediting
* - {jQuery.Event}
* - {boolean} Whether to drop the value.
@@ -324,7 +319,6 @@
[
prefix + 'create.' + this.widgetName,
prefix + 'afterstartediting.' + this.widgetName,
- prefix + 'stopediting.' + this.widgetName,
prefix + 'afterstopediting.' + this.widgetName,
prefix + 'disable.' + this.widgetName
].join( ' ' ),
@@ -344,22 +338,6 @@
},
/**
- * @see jQuery.ui.EditableTemplatedWidget.isValid
- * @return {boolean}
- */
- isValid: function() {
- return this._getEntitytermsforlanguagelistview().isValid();
- },
-
- /**
- * @see jQuery.ui.EditableTemplatedWidget.isInitialValue
- * @return {boolean}
- */
- isInitialValue: function() {
- return this._getEntitytermsforlanguagelistview().isInitialValue();
- },
-
- /**
* @inheritdoc
*/
startEditing: function() {
@@ -369,16 +347,6 @@
},
/**
- * @inheritdoc
- */
- stopEditing: function( dropValue ) {
- var deferred = $.Deferred();
- this._trigger( 'stopediting', null, [dropValue] );
- this._afterStopEditing( dropValue );
- return deferred.resolve( dropValue ).promise();
- },
-
- /**
* @param {boolean} dropValue
*/
_afterStopEditing: function( dropValue ) {
@@ -419,13 +387,6 @@
},
/**
- * @inheritdoc
- */
- isEmpty: function() {
- return this._getEntitytermsforlanguagelistview().isEmpty();
- },
-
- /**
* @inheritdoc
*/
_setOption: function( key, value ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinkgroupview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinkgroupview.js 2016-09-06 20:27:01.977912034 +0000
@@ -211,21 +211,6 @@
} );
},
- _save: function() {
- var deferred = $.Deferred();
- return deferred.resolve().promise();
- },
-
- stopEditing: function( dropValue ) {
- var done = $.Deferred().resolve( dropValue ).promise();
- if ( !this.isInEditMode() ) {
- return done;
- }
- this._trigger( 'stopediting', null, [dropValue] );
- this._afterStopEditing( dropValue );
- return done;
- },
-
/**
* @see jQuery.ui.EditableTemplatedWidget._afterStopEditing
*/
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.js 2016-09-06 20:27:01.973912005 +0000
@@ -25,11 +25,6 @@
* @event afterstartediting
* - {jQuery.Event}
*
- * @event stopediting
- * - {jQuery.Event}
- * - {boolean} Whether to drop the value.
- * - {Function} Callback function.
- *
* @event afterstopediting
* - {jQuery.Event}
* - {boolean} Whether to drop the value.
@@ -169,7 +164,6 @@
[
prefix + 'create.' + this.widgetName,
prefix + 'afterstartediting.' + this.widgetName,
- prefix + 'stopediting.' + this.widgetName,
prefix + 'afterstopediting.' + this.widgetName,
prefix + 'disable.' + this.widgetName
].join( ' ' ),
@@ -377,44 +371,6 @@
return !!this.$listview.data( 'listview' ).items().length;
},
- /**
- * @return {boolean}
- */
- isValid: function() {
- if ( !this._isInEditMode ) {
- return true;
- }
-
- var listview = this.$listview.data( 'listview' ),
- lia = listview.listItemAdapter(),
- isValid = true;
-
- listview.items().each( function() {
- var entitytermsforlanguageview = lia.liInstance( $( this ) );
- isValid = entitytermsforlanguageview.isValid();
- return isValid;
- } );
-
- return isValid;
- },
-
- /**
- * @return {boolean}
- */
- isInitialValue: function() {
- var listview = this.$listview.data( 'listview' ),
- lia = listview.listItemAdapter(),
- isInitialValue = true;
-
- listview.items().each( function() {
- var entitytermsforlanguageview = lia.liInstance( $( this ) );
- isInitialValue = entitytermsforlanguageview.isInitialValue();
- return isInitialValue;
- } );
-
- return isInitialValue;
- },
-
startEditing: function() {
if ( this._isInEditMode ) {
return;
@@ -437,12 +393,10 @@
stopEditing: function( dropValue ) {
var deferred = $.Deferred();
- if ( !this._isInEditMode || !this.isValid() && !dropValue ) {
+ if ( !this._isInEditMode ) {
return deferred.resolve().promise();
}
- this._trigger( 'stopediting', null, [dropValue] );
-
this.disable();
var listview = this.$listview.data( 'listview' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.js 2016-09-06 20:27:01.973912005 +0000
@@ -5,7 +5,7 @@
( function( mw, wb, $ ) {
'use strict';
- var PARENT = $.ui.TemplatedWidget;
+ var PARENT = $.ui.EditableTemplatedWidget;
/**
* Displays and allows editing label and description in a specific language.
@@ -28,11 +28,6 @@
* @event afterstartediting
* - {jQuery.Event}
*
- * @event stopediting
- * - {jQuery.Event}
- * - {boolean} Whether to drop the value.
- * - {Function} Callback function.
- *
* @event afterstopediting
* - {jQuery.Event}
* - {boolean} Whether to drop the value.
@@ -84,11 +79,6 @@
$aliasesview: null,
/**
- * @type {boolean}
- */
- _isInEditMode: false,
-
- /**
* @see jQuery.ui.TemplatedWidget._create
*/
_create: function() {
@@ -119,12 +109,12 @@
PARENT.prototype.destroy.call( self );
}
- if ( this._isInEditMode ) {
+ if ( this.isInEditMode() ) {
this.element.one( this.widgetEventPrefix + 'afterstopediting', function( event ) {
degrade();
} );
- this.cancelEditing();
+ this.stopEditing( true );
} else {
degrade();
}
@@ -160,7 +150,6 @@
[
widgetName + 'create.' + self.widgetName,
widgetName + 'afterstartediting.' + self.widgetName,
- widgetName + 'stopediting.' + self.widgetName,
widgetName + 'afterstopediting.' + self.widgetName,
widgetName + 'disable.' + self.widgetName
].join( ' ' ),
@@ -181,85 +170,32 @@
} );
},
- /**
- * @return {boolean}
- */
- isValid: function() {
- return this.$labelview.data( 'labelview' ).isValid()
- && this.$descriptionview.data( 'descriptionview' ).isValid()
- && this.$aliasesview.data( 'aliasesview' ).isValid();
- },
-
- /**
- * @return {boolean}
- */
- isInitialValue: function() {
- return this.$labelview.data( 'labelview' ).isInitialValue()
- && this.$descriptionview.data( 'descriptionview' ).isInitialValue()
- && this.$aliasesview.data( 'aliasesview' ).isInitialValue();
+ draw: function() {
+ return $.Deferred().resolve().promise();
},
/**
* Puts the widget into edit mode.
*/
startEditing: function() {
- if ( this._isInEditMode ) {
- return;
+ if ( this.isInEditMode() ) {
+ return $.Deferred().resolve().promise();
}
- this._isInEditMode = true;
- this.element.addClass( 'wb-edit' );
-
this.$labelview.data( 'labelview' ).startEditing();
this.$descriptionview.data( 'descriptionview' ).startEditing();
this.$aliasesview.data( 'aliasesview' ).startEditing();
-
- this._trigger( 'afterstartediting' );
- },
-
- /**
- * Stops the widget's edit mode.
- *
- * @param {boolean} [dropValue]
- */
- stopEditing: function( dropValue ) {
- if ( !this._isInEditMode || !this.isValid() && !dropValue ) {
- return;
- }
-
- this._trigger( 'stopediting', null, [dropValue] );
-
- this.disable();
-
- var labelview = this.$labelview.data( 'labelview' ),
- descriptionview = this.$descriptionview.data( 'descriptionview' ),
- aliasesview = this.$aliasesview.data( 'aliasesview' );
-
- labelview.stopEditing( dropValue );
- descriptionview.stopEditing( dropValue );
- aliasesview.stopEditing( dropValue );
-
- this._afterStopEditing( dropValue );
+ return PARENT.prototype.startEditing.call( this );
},
/**
* @param {boolean} [dropValue]
*/
_afterStopEditing: function( dropValue ) {
- if ( !dropValue ) {
- this.options.value = this.value();
- }
- this._isInEditMode = false;
- this.enable();
- this.element.removeClass( 'wb-edit' );
- this._trigger( 'afterstopediting', null, [dropValue] );
- },
-
- /**
- * Cancels editing.
- */
- cancelEditing: function() {
- this.stopEditing( true );
+ this.$labelview.data( 'labelview' ).stopEditing( dropValue );
+ this.$descriptionview.data( 'descriptionview' ).stopEditing( dropValue );
+ this.$aliasesview.data( 'aliasesview' ).stopEditing( dropValue );
+ return PARENT.prototype._afterStopEditing.call( this, dropValue );
},
/**
@@ -345,23 +281,8 @@
this.$labelview.data( 'labelview' ).focus();
},
- /**
- * Applies/Removes error state.
- *
- * @param {Error} [error]
- */
- setError: function( error ) {
- if ( error ) {
- this.element.addClass( 'wb-error' );
- this._trigger( 'toggleerror', null, [error] );
- } else {
- this.removeError();
- this._trigger( 'toggleerror' );
- }
- },
-
removeError: function() {
- this.element.removeClass( 'wb-error' );
+ PARENT.prototype.removeError.call( this );
this.$labelview.data( 'labelview' ).removeError();
this.$descriptionview.data( 'descriptionview' ).removeError();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js 2016-09-06 20:27:01.977912034 +0000
@@ -129,6 +129,9 @@
return $.map( self._getUnusedAllowedSiteIds(), function( siteId ) {
return wb.sites.getSite( siteId );
} );
+ },
+ function( sitelinkview ) {
+ self.$listview.data( 'listview' ).removeItem( sitelinkview.element );
}
);
@@ -309,65 +312,6 @@
},
/**
- * @see jQuery.ui.EditableTemplatedWidget.isEmpty
- * @return {boolean}
- */
- isEmpty: function() {
- return !this.$listview.data( 'listview' ).items().length;
- },
-
- /**
- * @see jQuery.ui.EditableTemplatedWidget.isValid
- * @return {boolean}
- */
- isValid: function() {
- var listview = this.$listview.data( 'listview' ),
- lia = listview.listItemAdapter(),
- isValid = true;
-
- listview.items().each( function() {
- // Site link views are regarded valid if they have a valid site. Invalid site links
- // (without a page name) and empty values (with no site id and page name input) are
- // supposed to be stripped when querying this widget for its value.
- // Put together, we consider sitelinkviews invalid only when they have something in
- // the siteId input field which does not resolve to a valid siteId and which is not
- // empty.
- var sitelinkview = lia.liInstance( $( this ) );
- isValid = sitelinkview.value() !== null
- || sitelinkview.isEmpty()
- // Previously existing values do always feature a valid site id:
- || Boolean( sitelinkview.option( 'value' ) );
- return isValid;
- } );
-
- return isValid;
- },
-
- /**
- * @see jQuery.ui.EditableTemplatedWidget.isInitialValue
- * @return {boolean}
- */
- isInitialValue: function() {
- var listview = this.$listview.data( 'listview' ),
- lia = listview.listItemAdapter(),
- $nonEmptyItems = listview.nonEmptyItems(),
- isInitialValue = true;
-
- if ( $nonEmptyItems.length !== this.options.value.length ) {
- return false;
- }
-
- // Ignore empty values.
- $nonEmptyItems.each( function() {
- var sitelinkview = lia.liInstance( $( this ) );
- isInitialValue = sitelinkview.value().equals( sitelinkview.option( 'value' ) );
- return isInitialValue;
- } );
-
- return isInitialValue;
- },
-
- /**
* @see jQuery.ui.EditableTemplatedWidget.startEditing
*/
startEditing: function() {
@@ -429,29 +373,11 @@
* @see jQuery.ui.EditableTemplatedWidget.stopEditing
*/
stopEditing: function( dropValue ) {
- var done = $.Deferred().resolve( dropValue ).promise();
- if ( !this.isInEditMode() ) {
- return done;
- }
- if ( dropValue ) {
- this.$listview.data( 'listview' ).value( this.options.value );
- this._refreshCounter();
- } else {
+ if ( !dropValue ) {
this._removeIncompleteSiteLinks();
}
- this._trigger( 'stopediting', null, [dropValue] );
- this._afterStopEditing( dropValue );
- return done;
- },
-
- /**
- * @see jQuery.ui.EditableTemplatedWidget._save
- */
- _save: function() {
- var deferred = $.Deferred();
-
- return deferred.resolve().promise();
+ return PARENT.prototype.stopEditing.call( this, dropValue );
},
/**
@@ -462,7 +388,6 @@
return PARENT.prototype._afterStopEditing.call( this, dropValue )
.done( function() {
- self.$listview.data( 'listview' ).value( self.options.value );
self._refreshCounter();
self._eventSingletonManager.unregister(
self,
@@ -480,18 +405,6 @@
} );
},
- _resetEditMode: function() {
- this.enable();
-
- var listview = this.$listview.data( 'listview' ),
- lia = listview.listItemAdapter();
-
- listview.items().each( function() {
- var sitelinkview = lia.liInstance( $( this ) );
- sitelinkview.startEditing();
- } );
- },
-
/**
* @see jQuery.ui.TemplatedWidget.focus
*/
@@ -525,7 +438,7 @@
return $foundNode || $nodes.first();
}
- if ( !this.isValid() ) {
+ if ( this.value() === null ) {
$items = $items.filter( function() {
var sitelinkview = lia.liInstance( $( this ) );
return sitelinkview.value() === null;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js 2016-08-30 11:22:39.108631633 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js 2016-09-06 20:27:01.981912065 +0000
@@ -18,10 +18,7 @@
* Apart from the required methods, the interaction widget has to have defined a help message in
* its options that will be used as tooltip message.
*
- * @option {Function} [getHelpMessage=option.interactionWidget.getHelpMessage]
- *
- * @option {jQuery.Widget} [interactionWidget]
- * Name of the widget the toolbar shall interact with.
+ * @option {Function} getHelpMessage
*
* @option {Function} [onRemove]
* Function to be triggered when hitting the "remove" button. If omitted, no "remove"
@@ -47,7 +44,6 @@
*/
options: {
getHelpMessage: null,
- interactionWidget: null,
onRemove: null,
buttonLabels: {
edit: mw.msg( 'wikibase-edit' ),
@@ -92,20 +88,6 @@
_create: function() {
PARENT.prototype._create.call( this );
- if ( this.options.interactionWidget ) {
- this.setController( this.options.interactionWidget );
- if ( !this.options.getHelpMessage ) {
- if ( !this.options.interactionWidget.getHelpMessage ) {
- throw new Error( 'Either getHelpMessage or interactionWidget.getHelpMessage '
- + 'option must be provided' );
- }
- this.options.getHelpMessage = $.proxy(
- this.options.interactionWidget.getHelpMessage,
- this.options.interactionWidget
- );
- }
- }
-
this._buttons = {};
var $scrapedSubToolbar = this.getContainer().children( '.wikibase-toolbar' );
@@ -134,10 +116,6 @@
destroy: function() {
var self = this;
- if ( this.options.interactionWidget ) {
- this.options.interactionWidget.element.off( '.' + this.widgetName );
- }
-
if ( this._$tooltipAnchor ) {
var $wbtooltip = this._$tooltipAnchor.find( ':wikibase-wbtooltip' ),
wbtooltip = $wbtooltip.data( 'wbtooltip' );
@@ -219,82 +197,12 @@
} );
},
- _attachInteractionWidgetEventHandlers: function() {
- var self = this,
- prefix = this.options.interactionWidget.widgetEventPrefix;
-
- function isInteractionWidgetNode( node ) {
- return node === self.options.interactionWidget.element.get( 0 );
- }
-
- this.options.interactionWidget.element
- .on( prefix + 'afterstartediting.' + this.widgetName, function( event ) {
- if ( isInteractionWidgetNode( event.target ) ) {
- self.toEditMode();
- self._trigger( 'afterstartediting' );
- }
- } )
- .on( prefix + 'stopediting.' + this.widgetName, function( event, dropValue ) {
- if ( !isInteractionWidgetNode( event.target ) ) {
- return;
- }
- self.disable();
- if ( !dropValue ) {
- self.toggleActionMessage( mw.msg( 'wikibase-save-inprogress' ) );
- }
- } )
- .on( prefix + 'afterstopediting.' + this.widgetName, function( event, dropValue ) {
- if ( isInteractionWidgetNode( event.target ) ) {
- self.toNonEditMode();
- self.enable();
- if ( !dropValue ) {
- self.toggleActionMessage();
- self._trigger( 'afterstopediting' );
- }
- }
- } )
- .on( prefix + 'disable.' + this.widgetName, function( event, disable ) {
- if ( isInteractionWidgetNode( event.target ) ) {
- self[disable ? 'disable' : 'enable']();
- }
- } )
- .on( prefix + 'toggleerror.' + this.widgetName, function( event, error ) {
- if ( isInteractionWidgetNode( event.target ) && error instanceof wb.api.RepoApiError ) {
- var $anchor;
-
- if ( error.action === 'save' || error.action === 'remove' ) {
- $anchor = self.getButton( error.action ).element;
- }
-
- self.enable();
- self.toggleActionMessage();
- // FIXME Move responsibility of displaying error out of here completely.
- if ( $( event.target ).data( 'sitelinkgroupview' ) === undefined ) {
- self.displayError( error, $anchor );
- }
- }
- } );
- },
-
_attachEventHandlers: function() {
var self = this;
- if ( this.options.interactionWidget ) {
- this._attachInteractionWidgetEventHandlers();
- }
-
this.getContainer()
.on( 'toolbarbuttonaction.' + this.widgetName, function( event ) {
if ( self._buttons.edit && event.target === self._buttons.edit.get( 0 ) ) {
- if ( self.options.interactionWidget ) {
- var prefix = self.options.interactionWidget.widgetEventPrefix;
- self.options.interactionWidget.element.one(
- prefix + 'afterstartediting.' + self.widgetName,
- function() {
- self._trigger( 'edit' );
- }
- );
- }
self._controller.startEditing();
} else if ( self._buttons.save && event.target === self._buttons.save.get( 0 ) ) {
self._controller.stopEditing();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.labelview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.labelview.js 2016-09-06 20:27:01.973912005 +0000
@@ -90,7 +90,7 @@
PARENT.prototype.destroy.call( self );
} );
- this.cancelEditing();
+ this.stopEditing( true );
} else {
PARENT.prototype.destroy.call( this );
}
@@ -172,15 +172,6 @@
* @inheritdoc
* @protected
*/
- _save: function() {
- var deferred = $.Deferred();
- return deferred.resolve().promise();
- },
-
- /**
- * @inheritdoc
- * @protected
- */
_afterStopEditing: function( dropValue ) {
if ( dropValue && this.options.value.getText() === '' ) {
this.$text.children( '.' + this.widgetFullName + '-input' ).val( '' );
@@ -189,24 +180,6 @@
},
/**
- * @inheritdoc
- */
- isValid: function() {
- return true;
- },
-
- /**
- * @inheritdoc
- */
- isInitialValue: function() {
- if ( !this.isInEditMode() ) {
- return true;
- }
-
- return this.value().equals( this.options.value );
- },
-
- /**
* @inheritdoc
* @protected
*
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/snakview/snakview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/snakview/snakview.js 2016-09-06 20:27:01.977912034 +0000
@@ -55,12 +55,6 @@
* @param {jQuery.Event} event
*/
/**
- * @event stopediting
- * Triggered when stopping the widget's edit mode.
- * @param {jQuery.Event} event
- * @param {boolean} dropValue
- */
-/**
* @event afterstopediting
* Triggered after having stopped the widget's edit mode.
* @param {jQuery.Event} event
@@ -97,7 +91,8 @@
entityStore: null,
valueViewBuilder: null,
dataTypeStore: null,
- drawProperty: true
+ drawProperty: true,
+ getSnakRemover: null
},
/**
@@ -260,6 +255,14 @@
$( '<div/>' ).append( $( '<span/>' ).addClass( 'mw-small-spinner' ) )
);
+ // The "value" variation contains experts that depend on the property and value type. Must
+ // be recreated when the property changes. Would be better to do this in updateVariation,
+ // and only when the value type changes, but at this point we can't find out any more.
+ if ( this._variation ) {
+ this._variation.destroy();
+ this._variation = null;
+ }
+
this.updateVariation();
this.drawSnakTypeSelector();
this.drawVariation();
@@ -280,6 +283,10 @@
* @inheritdoc
*/
destroy: function() {
+ if ( this._snakRemover ) {
+ this._snakRemover.destroy();
+ this._snakRemover = null;
+ }
var snakTypeSelector = this._getSnakTypeSelector();
if ( snakTypeSelector ) {
snakTypeSelector.destroy();
@@ -306,6 +313,10 @@
this._isInEditMode = true;
+ if ( this.options.getSnakRemover ) {
+ this._snakRemover = this.options.getSnakRemover( this.element );
+ }
+
if ( this._variation ) {
$( this._variation ).one( 'afterstartediting', function() {
self._trigger( 'afterstartediting' );
@@ -348,9 +359,12 @@
return;
}
- var snak = this.snak();
+ if ( this._snakRemover ) {
+ this._snakRemover.destroy();
+ this._snakRemover = null;
+ }
- this._trigger( 'stopediting', null, [dropValue] );
+ var snak = this.snak();
this._isInEditMode = false;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/snakview/snakview.variations.Value.js 2016-09-06 20:27:01.977912034 +0000
@@ -400,7 +400,7 @@
}
},
- /*
+ /**
* @inheritdoc
*/
isFocusable: function() {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.aliasesview.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.aliasesview.js 2016-09-06 20:27:01.973912005 +0000
@@ -162,32 +162,6 @@
/**
* @inheritdoc
* @protected
- */
- _save: function() {
- return $.Deferred().resolve().promise();
- },
-
- /**
- * @inheritdoc
- */
- isValid: function() {
- return true;
- },
-
- /**
- * @inheritdoc
- */
- isInitialValue: function() {
- if ( !this.isInEditMode() ) {
- return true;
- }
-
- return this.value().equals( this.options.value );
- },
-
- /**
- * @inheritdoc
- * @protected
*
* @throws {Error} when trying to set the widget's value to something other than a
* `wikibase.datamodel.MultiTerm` instance.
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.referenceview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.referenceview.js 2016-09-06 20:27:01.973912005 +0000
@@ -24,13 +24,6 @@
* @param {jQuery.Event} event
*/
/**
- * @event stopediting
- * Triggered when stopping the widget's edit mode, immediately before re-drawing.
- * @param {jQuery.Event} event
- * @param {boolean} dropValue
- * Whether the widget's value will be reset to the one from before starting edit mode.
- */
-/**
* @event afterstopediting
* Triggered after having stopped the widget's edit mode and non-edit mode is redrawn.
* @param {boolean} dropValue
@@ -58,6 +51,7 @@
'' // snaklistview widget
],
templateShortCuts: {
+ $heading: '.wikibase-referenceview-heading',
$listview: '.wikibase-referenceview-listview'
},
value: null,
@@ -90,6 +84,8 @@
} );
this._updateReferenceHashClass( this.value() );
+
+ this._referenceRemover = this.options.getReferenceRemover( this.$heading );
},
/**
@@ -123,12 +119,6 @@
// Propagate "change" event.
self._trigger( 'change' );
- } )
- .one( lia.prefixedEvent( 'stopediting.' + this.widgetName ),
- function( event, dropValue ) {
- event.stopPropagation();
- event.preventDefault();
- self.stopEditing( dropValue );
} );
},
@@ -142,8 +132,7 @@
events = [
'snakviewchange.' + this.widgetName,
'listviewitemremoved.' + this.widgetName,
- lia.prefixedEvent( 'change.' + this.widgetName ),
- lia.prefixedEvent( 'stopediting.' + this.widgetName )
+ lia.prefixedEvent( 'change.' + this.widgetName )
];
this.$listview.off( events.join( ' ' ) );
},
@@ -220,6 +209,8 @@
this.element.addClass( 'wb-edit' );
this._isInEditMode = true;
+ this._snakListAdder = this.options.getAdder( this.enterNewItem.bind( this ), this.element );
+
this._trigger( 'afterstartediting' );
},
@@ -233,6 +224,9 @@
return;
}
+ this._snakListAdder.destroy();
+ this._snakListAdder = null;
+
this._isInEditMode = false;
this.element.removeClass( 'wb-edit' );
@@ -282,11 +276,12 @@
return listview.enterNewItem().done( function( $snaklistview ) {
lia.liInstance( $snaklistview ).enterNewItem()
- .done( function() {
+ .done( function( $snakview ) {
// Since the new snakview will be initialized empty which invalidates the
// snaklistview, external components using the snaklistview will be noticed via
// the "change" event.
self._trigger( 'change' );
+ $snakview.data( 'snakview' ).focus();
} );
} );
},
@@ -321,6 +316,10 @@
if ( key === 'disabled' ) {
this.$listview.data( 'listview' ).option( key, value );
+ this._referenceRemover[ value ? 'disable' : 'enable' ]();
+ if ( this._snakListAdder ) {
+ this._snakListAdder[ value ? 'disable' : 'enable' ]();
+ }
}
return response;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementlistview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementlistview.js 2016-09-06 20:27:01.977912034 +0000
@@ -1,4 +1,4 @@
-( function( wb, $ ) {
+( function( wb, mw, $ ) {
'use strict';
var PARENT = $.ui.TemplatedWidget;
@@ -22,7 +22,7 @@
* @param {Object} options
* @param {wikibase.datamodel.StatementList} [options.value]
* The list of `Statement`s to be displayed by this view.
- * @param {jQuery.wikibase.listview.ListItemAdapter} options.listItemAdapter
+ * @param {Function} options.getListItemAdapter
*/
/**
* @event afterstartediting
@@ -65,7 +65,7 @@
$listview: '.wikibase-statementlistview-listview'
},
value: null,
- listItemAdapter: null
+ getListItemAdapter: null
},
/**
@@ -81,7 +81,7 @@
* @throws {Error} if a required option is not specified properly.
*/
_create: function() {
- if ( !this.options.listItemAdapter
+ if ( !this.options.getListItemAdapter
|| ( this.options.value && !( this.options.value instanceof wb.datamodel.StatementList ) )
) {
throw new Error( 'Required option not specified properly' );
@@ -117,6 +117,13 @@
.on( toggleErrorEvent, function( event, error ) {
self._trigger( 'toggleerror', null, [error] );
} );
+
+ var $containerWrapper = this.element.children( '.wikibase-toolbar-wrapper' );
+ if ( $containerWrapper.length === 0 ) {
+ $containerWrapper = mw.wbTemplate( 'wikibase-toolbar-wrapper', '' ).appendTo( this.element );
+ }
+
+ this._statementAdder = this.options.getAdder( this.enterNewItem.bind( this ), $containerWrapper );
},
/**
@@ -125,6 +132,10 @@
*/
destroy: function() {
this._listview.destroy();
+ if ( this._statementAdder ) {
+ this._statementAdder.destroy();
+ this._statementAdder = null;
+ }
PARENT.prototype.destroy.call( this );
},
@@ -136,7 +147,7 @@
*/
_createListView: function() {
this.$listview.listview( {
- listItemAdapter: this.options.listItemAdapter,
+ listItemAdapter: this.options.getListItemAdapter( this._remove.bind( this ) ),
value: this.options.value ? this.options.value.toArray() : null
} );
@@ -196,7 +207,7 @@
*
* @param {jQuery.wikibase.statementview} statementview
*/
- remove: function( statementview ) {
+ _remove: function( statementview ) {
this._listview.removeItem( statementview.element );
this._trigger( 'afterremove' );
},
@@ -217,6 +228,9 @@
if ( key === 'disabled' ) {
this._listview.option( key, value );
+ if ( this._statementAdder ) {
+ this._statementAdder[ value ? 'disable' : 'enable' ]();
+ }
}
return response;
@@ -237,4 +251,4 @@
} );
-}( wikibase, jQuery ) );
+}( wikibase, mediaWiki, jQuery ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js 2016-09-06 20:27:01.977912034 +0000
@@ -27,11 +27,6 @@
* @event afterstartediting
* - {jQuery.Event}
*
- * @event stopediting
- * - {jQuery.Event}
- * - {boolean} Whether to drop the value.
- * - {Function} Callback function.
- *
* @event afterstopediting
* - {jQuery.Event}
* - {boolean} Whether to drop the value.
@@ -105,6 +100,26 @@
this._createBadgeSelector();
},
+ _createRemover: function() {
+ this._siteLinkRemover = this.options.getSiteLinkRemover( this.$siteIdContainer, mw.msg( 'wikibase-remove' ) );
+ this._siteLinkRemover[ this.options.value ? 'enable' : 'disable' ]();
+
+ // Update inputautoexpand maximum width after adding "remove" toolbar:
+ var $siteIdInput = this.$siteId.find( 'input' ),
+ inputautoexpand = $siteIdInput.length
+ ? $siteIdInput.data( 'inputautoexpand' )
+ : null;
+ if ( inputautoexpand ) {
+ $siteIdInput.inputautoexpand( {
+ maxWidth: this.element.width() - (
+ this.$siteIdContainer.outerWidth( true ) - $siteIdInput.width()
+ )
+ } );
+ }
+
+ this.updatePageNameInputAutoExpand();
+ },
+
/**
* @see jQuery.ui.TemplatedWidget.destroy
*/
@@ -113,6 +128,11 @@
this._badgeselector.destroy();
}
+ if ( this._siteLinkRemover ) {
+ this._siteLinkRemover.destroy();
+ this._siteLinkRemover = null;
+ }
+
if ( this._isInEditMode ) {
var self = this;
@@ -152,6 +172,7 @@
// Adding/removing badges decreases/increases available space:
self.updatePageNameInputAutoExpand();
self._trigger( 'change' );
+ self._siteLinkRemover[ self.value() === null ? 'disable' : 'enable' ]();
} );
this._badgeselector = $badgeselector.data( 'badgeselector' );
@@ -207,6 +228,8 @@
}
}
+ this._createRemover();
+
var $pageNameInput = $( '<input>' )
.attr( 'placeholder', mw.msg( 'wikibase-sitelink-page-edit-placeholder' ) )
.attr( 'dir', dir )
@@ -220,12 +243,17 @@
self.setError();
self._trigger( 'change' );
}
+ self._siteLinkRemover[ self.value() === null ? 'disable' : 'enable' ]();
} );
this.$link.find( '.wikibase-sitelinkview-page' )
.attr( 'dir', dir )
.empty().append( $pageNameInput );
+ if ( this._badgeselector ) {
+ this._badgeselector.startEditing();
+ }
+
if ( this.options.value ) {
this.updatePageNameInputAutoExpand();
// Site of an existing site link is not supposed to be changeable.
@@ -272,6 +300,7 @@
pagesuggester.option( 'siteId', siteId );
self._trigger( 'change' );
+ self._siteLinkRemover[ self.value() === null ? 'disable' : 'enable' ]();
} )
.on(
'siteselectorselected.' + this.widgetName + ' siteselectorchange.' + this.widgetName,
@@ -348,9 +377,6 @@
this._isInEditMode = true;
this._draw();
- if ( this._badgeselector ) {
- this._badgeselector.startEditing();
- }
if ( this.option( 'disabled' ) ) {
this._setState( 'disable' );
@@ -376,8 +402,6 @@
return deferred.resolve().promise();
}
- this._trigger( 'stopediting', null, [dropValue] );
-
if ( this._badgeselector ) {
this._badgeselector.stopEditing( dropValue );
}
@@ -488,6 +512,10 @@
siteselector[state]();
}
+ if ( this._siteLinkRemover ) {
+ this._siteLinkRemover[ state ]();
+ }
+
// Do not enable page input if no site is set:
if ( state === 'disable' || hasSiteId ) {
this.$link.find( 'input' ).data( 'pagesuggester' )[state]();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js 2016-09-06 20:27:01.977912034 +0000
@@ -316,25 +316,11 @@
* @inheritdoc
*/
stopEditing: function( dropValue ) {
- if ( dropValue ) {
- this._setRank( this.options.value );
- }
// Hide the menu the rank selector currently references to:
if ( $menu && $menu.data( this.widgetName ) === this ) {
$menu.hide();
}
-
- var deferred = $.Deferred();
- this._trigger( 'stopediting', null, [dropValue] );
- this._afterStopEditing( dropValue );
- return deferred.resolve( dropValue ).promise();
- },
-
- /**
- * @inheritdoc
- */
- isEmpty: function() {
- return false;
+ return PARENT.prototype.stopEditing.call( this, dropValue );
}
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.snaklistview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.snaklistview.js 2016-09-06 20:27:01.977912034 +0000
@@ -30,13 +30,6 @@
* @param {jQuery.Event} event
*/
/**
- * @event stopediting
- * Triggered when stopping the widget's edit mode.
- * @param {jQuery.Event}
- * @param {boolean} If `true`, the widget's value will be reset to the one from before edit mode was
- * started.
- */
-/**
* @event afterstopediting
* Triggered after having stopped the widget's edit mode.
* @param {jQuery.Event} event
@@ -97,7 +90,7 @@
_create: function() {
this.options.value = this.options.value || new wb.datamodel.SnakList();
- if ( !this.options.listItemAdapter || !( this.options.value instanceof wb.datamodel.SnakList ) ) {
+ if ( !this.options.getListItemAdapter || !( this.options.value instanceof wb.datamodel.SnakList ) ) {
throw new Error( 'Required option not specified properly' );
}
@@ -130,7 +123,9 @@
}
this.$listview.listview( {
- listItemAdapter: this.options.listItemAdapter,
+ listItemAdapter: this.options.getListItemAdapter( function( snakview ) {
+ self._listview.removeItem( snakview.element );
+ } ),
value: this.options.value.toArray()
} );
@@ -150,8 +145,6 @@
self._trigger( 'change' );
}
);
-
- this._attachEditModeEventHandlers();
},
/**
@@ -197,10 +190,7 @@
return;
}
- this._trigger( 'stopediting', null, [dropValue] );
-
this.element.removeClass( 'wb-error' );
- this._detachEditModeEventHandlers();
this.disable();
if ( dropValue ) {
@@ -235,34 +225,6 @@
},
/**
- * Attaches event listeners that shall trigger stopping the `snaklistview`'s edit mode.
- *
- * @private
- */
- _attachEditModeEventHandlers: function() {
- var self = this;
-
- this.$listview.one( this._lia.prefixedEvent( 'stopediting.' + this.widgetName ),
- function( event, dropValue ) {
- event.stopImmediatePropagation();
- event.preventDefault();
- self._detachEditModeEventHandlers();
- self._attachEditModeEventHandlers();
- self.stopEditing( dropValue );
- }
- );
- },
-
- /**
- * Detaches event listeners that shall trigger stopping the `snaklistview`'s edit mode.
- *
- * @private
- */
- _detachEditModeEventHandlers: function() {
- this.$listview.off( this._lia.prefixedEvent( 'stopediting.' + this.widgetName ) );
- },
-
- /**
* Sets a new `SnakList` or returns the current `SnakList` (including pending `Snaks` not yet
* committed).
*
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementview.js 2016-09-06 20:27:01.977912034 +0000
@@ -31,7 +31,7 @@
* @param {Object} options
* @param {wikibase.datamodel.Statement|null} [options.value=null]
* The `Statement` displayed by the view.
- * @param {Function} options.buildReferenceListItemAdapter
+ * @param {Function} options.getReferenceListItemAdapter
* @param {Function} options.buildSnakView
* @param {wikibase.utilities.ClaimGuidGenerator} options.guidGenerator
* Required for dynamically generating GUIDs for new `Statement`s.
@@ -138,13 +138,19 @@
_$toggler: null,
/**
+ * @property {Object}
+ * @private
+ */
+ _referenceAdder: null,
+
+ /**
* @inheritdoc
* @protected
*
* @throws {Error} if a required option is not specified properly.
*/
_create: function() {
- if ( !this.options.buildReferenceListItemAdapter
+ if ( !this.options.getReferenceListItemAdapter
|| !this.options.buildSnakView
|| !this.options.entityIdPlainFormatter
|| !this.options.guidGenerator
@@ -161,6 +167,21 @@
} else {
this._createReferencesToggler();
}
+
+ var self = this;
+ this._referenceAdder = this.options.getAdder(
+ function() {
+ var listview = self._referencesListview,
+ lia = listview.listItemAdapter();
+
+ listview.enterNewItem().done( function( $referenceview ) {
+ var referenceview = lia.liInstance( $referenceview );
+ referenceview.focus();
+ } );
+ },
+ this.$references,
+ mw.msg( 'wikibase-addreference' )
+ );
this.element.toggleClass( 'wb-new', this.options.value === null );
},
@@ -227,9 +248,6 @@
.on( 'snakviewchange.' + this.widgetName, function( event, status ) {
event.stopPropagation();
self._trigger( 'change' );
- } )
- .on( 'snakviewstopediting.' + this.widgetName, function( event ) {
- event.stopPropagation();
} );
this._mainSnakSnakView = this.options.buildSnakView(
@@ -262,7 +280,7 @@
// Using the property id, qualifier snaks are split into groups of snaklistviews. These
// snaklistviews are managed in a listview:
- var $qualifiers = this.$qualifiers.children();
+ var $qualifiers = this.$qualifiers.children( '.wikibase-listview' );
if ( !$qualifiers.length ) {
$qualifiers = $( '<div/>' ).prependTo( this.$qualifiers );
}
@@ -270,9 +288,6 @@
listItemAdapter: this.options.qualifiersListItemAdapter,
value: groupedQualifierSnaks
} )
- .on( 'snaklistviewstopediting.' + this.widgetName, function( event, dropValue ) {
- event.stopPropagation();
- } )
.on( 'snaklistviewchange.' + this.widgetName,
function( event ) {
event.stopPropagation();
@@ -313,7 +328,11 @@
return;
}
- var lia = this.options.buildReferenceListItemAdapter();
+ var lia = this.options.getReferenceListItemAdapter(
+ function( referenceview ) {
+ self._referencesListview.removeItem( referenceview.element );
+ }
+ );
$listview.listview( {
listItemAdapter: lia,
@@ -440,9 +459,13 @@
_destroyQualifiersListView: function() {
this._qualifiers.destroy();
this.$qualifiers
- .off( '.' + this.widgetName )
- .empty();
+ .off( '.' + this.widgetName );
this._qualifiers = null;
+
+ if ( this._qualifierAdder ) {
+ this._qualifierAdder.destroy();
+ this._qualifierAdder = null;
+ }
},
/**
@@ -454,6 +477,8 @@
.off( '.' + this.widgetName )
.empty();
this._referencesListview = null;
+ this._referenceAdder.destroy();
+ this._referenceAdder = null;
},
/**
@@ -613,6 +638,24 @@
startEditing: function() {
var self = this;
+ if ( this.isInEditMode() ) {
+ return $.Deferred().resolve().promise();
+ }
+
+ this._qualifierAdder = this.options.getAdder(
+ function() {
+ var listview = self._qualifiers;
+ listview.enterNewItem();
+
+ var snaklistview = listview.value()[listview.value().length - 1];
+ snaklistview.enterNewItem().done( function() {
+ snaklistview.focus();
+ } );
+ },
+ this.$qualifiers,
+ mw.msg( 'wikibase-addqualifier' )
+ );
+
// We need to initialize the main snak before calling PARENT::startEditing,
// since that triggers 'afterstartediting' which tries to set focus into
// the main snak
@@ -645,16 +688,6 @@
}
},
- stopEditing: function( dropValue ) {
- var deferred = $.Deferred();
-
- this._trigger( 'stopediting', null, [dropValue] );
-
- this._afterStopEditing( dropValue );
-
- return deferred.resolve( dropValue ).promise();
- },
-
/**
* @inheritdoc
* @protected
@@ -720,15 +753,6 @@
/**
* @inheritdoc
- */
- isEmpty: function() {
- return false;
- // TODO: Supposed to do at least...
- // this._mainSnakSnakView.isEmpty(); (does not exist at the moment of writing)
- },
-
- /**
- * @inheritdoc
* @protected
*/
_setOption: function( key, value ) {
@@ -747,6 +771,7 @@
if ( this._referencesListview ) {
this._referencesListview.option( key, value );
}
+ this._referenceAdder[ value ? 'disable' : 'enable']();
}
if ( key === 'value' ) {
this.element.toggleClass( 'wb-new', value === null );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementgrouplistview.js 2016-08-30 11:22:39.104631602 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.statementgrouplistview.js 2016-09-06 20:27:01.977912034 +0000
@@ -74,6 +74,7 @@
this.element.statementgrouplabelscroll();
+ this._statementGroupAdder = this.options.getAdder( this.enterNewItem.bind( this ), this.element );
},
/**
@@ -82,6 +83,10 @@
*/
destroy: function() {
this.listview.destroy();
+ if ( this._statementGroupAdder ) {
+ this._statementGroupAdder.destroy();
+ this._statementGroupAdder = null;
+ }
PARENT.prototype.destroy.call( this );
},
@@ -208,6 +213,9 @@
if ( key === 'disabled' ) {
this.listview.option( key, value );
+ if ( this._statementGroupAdder ) {
+ this._statementGroupAdder[ value ? 'disable' : 'enable' ]();
+ }
}
return response;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js 2016-08-30 11:22:39.100631571 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js 2016-09-06 20:27:01.973912005 +0000
@@ -1,6 +1,7 @@
/**
* @license GPL-2.0+
* @author H. Snater < mediawiki@snater.com >
+ * @author Adrian Heine <adrian.heine@wikimedia.de>
*/
( function( $ ) {
'use strict';
@@ -20,12 +21,6 @@
* Triggered after having started the widget's edit mode and edit mode has been rendered.
* - {jQuery.Event}
*
- * @event stopediting
- * Triggered when stopping the widget's edit mode, immediately before re-drawing.
- * - {jQuery.Event}
- * - {boolean} dropValue
- * Whether the widget's value will be reset to the one from before starting edit mode.
- *
* @event afterstopediting
* Triggered after having stopped the widget's edit mode and non-edit mode is redrawn.
* - {jQuery.Event}
@@ -117,51 +112,15 @@
* - {Error}
*/
stopEditing: function( dropValue ) {
- var self = this,
- deferred = $.Deferred();
-
- if ( !this.isInEditMode() || !this.isValid() && !dropValue ) {
- return deferred.resolve().promise();
+ var done = $.Deferred().resolve().promise();
+ if ( !this.isInEditMode() ) {
+ return done;
}
-
- this._trigger( 'stopediting', null, [dropValue] );
-
- this.disable();
-
- if ( dropValue ) {
- return this._afterStopEditing( dropValue );
- } else {
- this._save()
- .done( function( savedValue ) {
- self.options.value = savedValue || self.value();
- self._afterStopEditing( dropValue )
- .done( function() {
- deferred.resolve( dropValue );
- } )
- .fail( function( error ) {
- deferred.reject( error );
- } );
- } )
- .fail( function( error ) {
- self.setError( error );
- deferred.reject( error );
- self.enable();
- } );
- }
-
- return deferred.promise();
+ this._afterStopEditing( dropValue );
+ return done;
},
/**
- * @return {Object} jQuery.Promise
- * Resolved parameters:
- * - {*} [value] the data model object returned by save API call
- * Rejected parameters:
- * - {Error}
- */
- _save: util.abstractMember,
-
- /**
* @param {boolean} dropValue
* @return {Object} jQuery.Promise
* No resolved parameters.
@@ -178,7 +137,7 @@
.done( function() {
self.enable();
self._trigger( 'afterstopediting', null, [dropValue] );
- deferred.resolve( dropValue );
+ deferred.resolve();
} )
.fail( function( error ) {
self.setError( error );
@@ -189,13 +148,6 @@
},
/**
- * Cancels the widget's edit mode.
- */
- cancelEditing: function() {
- this.stopEditing( true );
- },
-
- /**
* Returns whether the widget is in edit mode.
*/
isInEditMode: function() {
@@ -213,28 +165,6 @@
value: util.abstractMember,
/**
- * Returns whether the widget features any value (may it be valid or invalid).
- *
- * @return {boolean}
- */
- isEmpty: util.abstractMember,
-
- /**
- * Returns whether the widget's value is valid.
- *
- * @return {boolean}
- */
- isValid: util.abstractMember,
-
- /**
- * Returns whether the widget's value is the widget's value from before starting edit mode.
- * (Always returns "true" in non-edit mode.)
- *
- * @return {boolean}
- */
- isInitialValue: util.abstractMember,
-
- /**
* Toggles error state.
*
* @param {Error} [error]
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/wikibase/view/ToolbarViewController.tests.js 2016-08-30 11:22:39.124631755 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/wikibase/view/ToolbarViewController.tests.js 2016-09-06 20:27:01.985912096 +0000
@@ -34,7 +34,9 @@
enable: function() {},
isValid: function() {},
setError: function() {},
- startEditing: function() {},
+ startEditing: function() {
+ return $.Deferred();
+ },
stopEditing: function() {},
value: function() {}
},
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/wikibase/view/ViewFactory.tests.js 2016-08-30 11:22:39.124631755 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/wikibase/view/ViewFactory.tests.js 2016-09-06 20:27:01.985912096 +0000
@@ -19,13 +19,13 @@
QUnit.test( 'getEntityView constructs correct views', function( assert ) {
assert.expect( 2 );
var entityStore = new wb.store.EntityStore(),
- viewFactory = new ViewFactory( null, null, null, null, entityStore ),
+ viewFactory = new ViewFactory( null, null, null, null, null, entityStore ),
fooView = {},
$dom = $( '<div/>' ),
FooView = $dom.fooview = $.wikibase.fooview = sinon.spy();
$dom.data = sinon.spy( function() { return fooView; } );
- var res = viewFactory.getEntityView( getEntityStub( 'foo' ), $dom );
+ var res = viewFactory.getEntityView( null, getEntityStub( 'foo' ), $dom );
assert.strictEqual( res, fooView );
sinon.assert.calledOnce( FooView );
@@ -34,11 +34,11 @@
QUnit.test( 'getEntityView throws on incorrect views', function( assert ) {
assert.expect( 1 );
var entityStore = new wb.store.EntityStore(),
- viewFactory = new ViewFactory( null, null, null, null, entityStore );
+ viewFactory = new ViewFactory( null, null, null, null, null, entityStore );
assert.throws(
function() {
- viewFactory.getEntityView( getEntityStub( 'unknown' ) );
+ viewFactory.getEntityView( null, getEntityStub( 'unknown' ) );
},
new Error( 'View unknownview does not exist' )
);
@@ -51,7 +51,7 @@
$dom = $( '<div/>' ),
FooView = $dom.fooview = $.wikibase.fooview = sinon.spy();
- viewFactory.getEntityView( entity, $dom );
+ viewFactory.getEntityView( null, entity, $dom );
sinon.assert.calledWith( FooView, sinon.match( {
buildEntityTermsView: sinon.match.func,
@@ -70,7 +70,7 @@
sinon.spy( $.wikibase, 'sitelinkgrouplistview' );
$dom.sitelinkgrouplistview = $.wikibase.sitelinkgrouplistview;
- viewFactory.getSitelinkGroupListView( sitelinkSet, $dom );
+ viewFactory.getSitelinkGroupListView( null, sitelinkSet, $dom );
sinon.assert.calledWith( $.wikibase.sitelinkgrouplistview, sinon.match( {
value: sitelinkSet
@@ -89,7 +89,7 @@
sinon.stub( $.wikibase, 'sitelinkgroupview' );
$dom.sitelinkgroupview = $.wikibase.sitelinkgroupview;
- viewFactory.getSitelinkGroupView( groupName, siteLinks, $dom );
+ viewFactory.getSitelinkGroupView( null, groupName, siteLinks, $dom );
sinon.assert.calledWith( $.wikibase.sitelinkgroupview, sinon.match( {
groupName: groupName,
@@ -109,7 +109,7 @@
sinon.spy( $.wikibase, 'sitelinklistview' );
$dom.sitelinklistview = $.wikibase.sitelinklistview;
- viewFactory.getSiteLinkListView( siteLinks, $dom );
+ viewFactory.getSiteLinkListView( null, siteLinks, $dom );
sinon.assert.calledWith( $.wikibase.sitelinklistview, sinon.match( {
value: siteLinks,
@@ -122,12 +122,13 @@
QUnit.test( 'getStatementGroupListView passes correct options to views', function( assert ) {
assert.expect( 1 );
var entity = new wb.datamodel.Item( 'Q1' ),
- viewFactory = new ViewFactory(),
+ structureEditorFactory = { getAdder: function() {} },
+ viewFactory = new ViewFactory( structureEditorFactory ),
$dom = $( '<div/>' );
$dom.statementgrouplistview = sinon.stub( $.wikibase, 'statementgrouplistview' );
- viewFactory.getStatementGroupListView( entity, $dom );
+ viewFactory.getStatementGroupListView( null, entity, $dom );
sinon.assert.calledWith( $.wikibase.statementgrouplistview, sinon.match( {
listItemAdapter: sinon.match.instanceOf( $.wikibase.listview.ListItemAdapter )
@@ -140,11 +141,11 @@
assert.expect( 3 );
var entityId = 'Q1',
entityIdHtmlFormatter = {},
- viewFactory = new ViewFactory( null, null, entityIdHtmlFormatter ),
+ viewFactory = new ViewFactory( null, null, null, entityIdHtmlFormatter ),
ListItemAdapter = sinon.spy( $.wikibase.listview, 'ListItemAdapter' ),
value = new wb.datamodel.StatementGroup( 'P1' );
- viewFactory.getListItemAdapterForStatementGroupView( entityId );
+ viewFactory.getListItemAdapterForStatementGroupView( null, entityId );
sinon.assert.calledWith(
ListItemAdapter,
@@ -176,13 +177,14 @@
new wb.datamodel.Statement( new wb.datamodel.Claim( new wb.datamodel.PropertyNoValueSnak( 'P1' ) ) )
] ),
entityId = 'entityId',
- viewFactory = new ViewFactory(),
+ structureEditorFactory = { getAdder: function() {} },
+ viewFactory = new ViewFactory( structureEditorFactory ),
$dom = $( '<div/>' );
sinon.stub( $.wikibase.listview, 'ListItemAdapter' );
sinon.stub( viewFactory, '_getView' );
- viewFactory.getStatementListView( entityId, null, function () {}, value, $dom );
+ viewFactory.getStatementListView( null, entityId, null, function () {}, value, $dom );
sinon.assert.calledWith(
viewFactory._getView,
@@ -204,13 +206,14 @@
assert.expect( 1 );
var value = new wb.datamodel.StatementList(),
entityId = 'entityId',
- viewFactory = new ViewFactory(),
+ structureEditorFactory = { getAdder: function() {} },
+ viewFactory = new ViewFactory( structureEditorFactory ),
$dom = $( '<div/>' );
sinon.stub( $.wikibase.listview, 'ListItemAdapter' );
$dom.statementlistview = sinon.stub( $.wikibase, 'statementlistview' );
- viewFactory.getStatementListView( entityId, null, function () {}, value, $dom );
+ viewFactory.getStatementListView( null, entityId, null, function () {}, value, $dom );
sinon.assert.calledWith(
$.wikibase.statementlistview,
@@ -228,7 +231,9 @@
var entityId = 'Q1',
value = null,
entityIdPlainFormatter = {},
+ structureEditorFactory = { getAdder: function() {} },
viewFactory = new ViewFactory(
+ structureEditorFactory,
null,
null,
null,
@@ -240,7 +245,7 @@
sinon.stub( viewFactory, '_getView' );
- viewFactory.getListItemAdapterForStatementView( entityId, function () { return statement; } );
+ viewFactory.getListItemAdapterForStatementView( null, entityId, function () { return statement; } );
sinon.assert.calledWith(
ListItemAdapter,
@@ -269,7 +274,7 @@
}
},
- buildReferenceListItemAdapter: sinon.match.instanceOf( Function ),
+ getReferenceListItemAdapter: sinon.match.instanceOf( Function ),
buildSnakView: sinon.match.instanceOf( Function ),
entityIdPlainFormatter: entityIdPlainFormatter,
guidGenerator: sinon.match.instanceOf( wb.utilities.ClaimGuidGenerator ),
@@ -286,13 +291,14 @@
var entityId = 'Q1',
propertyId = 'propertyId',
value = null,
- viewFactory = new ViewFactory(),
+ structureEditorFactory = { getAdder: function() {} },
+ viewFactory = new ViewFactory( structureEditorFactory ),
ListItemAdapter = sinon.spy( $.wikibase.listview, 'ListItemAdapter' ),
dom = {};
sinon.stub( viewFactory, '_getView' );
- viewFactory.getListItemAdapterForStatementView( entityId, function () {}, propertyId );
+ viewFactory.getListItemAdapterForStatementView( null, entityId, function () {}, propertyId );
ListItemAdapter.args[0][0].getNewItem( value, dom );
@@ -314,13 +320,14 @@
assert.expect( 1 );
var propertyId = 'P1',
value = new wb.datamodel.Statement( new wb.datamodel.Claim( new wb.datamodel.PropertyNoValueSnak( propertyId ) ) ),
- viewFactory = new ViewFactory(),
+ structureEditorFactory = { getAdder: function() {} },
+ viewFactory = new ViewFactory( structureEditorFactory ),
ListItemAdapter = sinon.spy( $.wikibase.listview, 'ListItemAdapter' ),
dom = {};
sinon.stub( viewFactory, '_getView' );
- viewFactory.getListItemAdapterForStatementView( 'Q1', function () {}, null );
+ viewFactory.getListItemAdapterForStatementView( null, 'Q1', function () {}, null );
ListItemAdapter.args[0][0].getNewItem( value, dom );
@@ -339,34 +346,44 @@
} );
QUnit.test( 'getListItemAdapterForReferenceView passes correct options to ListItemAdapter', function( assert ) {
- assert.expect( 3 );
- var value = null,
- viewFactory = new ViewFactory(),
+ assert.expect( 1 );
+ var viewFactory = new ViewFactory(),
+ removeCallback = function() {},
ListItemAdapter = sinon.spy( $.wikibase.listview, 'ListItemAdapter' );
- viewFactory.getListItemAdapterForReferenceView();
+ viewFactory.getListItemAdapterForReferenceView( null, removeCallback );
sinon.assert.calledWith(
ListItemAdapter,
sinon.match( {
listItemWidget: $.wikibase.referenceview,
- newItemOptionsFn: sinon.match.func
+ getNewItem: sinon.match.func
} )
);
- var result = ListItemAdapter.args[0][0].newItemOptionsFn( value );
+ ListItemAdapter.restore();
+ } );
- assert.deepEqual(
- result,
- {
+ QUnit.test( 'getReferenceView passes correct options to view', function( assert ) {
+ assert.expect( 1 );
+ var value = null,
+ viewFactory = new ViewFactory(),
+ removeCallback = function() {},
+ $dom = $( '<div/>' ),
+ referenceview = sinon.stub( $dom, 'referenceview' );
+
+ viewFactory.getReferenceView( null, removeCallback, value, $dom );
+
+ sinon.assert.calledWith(
+ referenceview,
+ sinon.match( {
value: value || null,
- listItemAdapter: result.listItemAdapter // Hack
- }
+ listItemAdapter: sinon.match.instanceOf( $.wikibase.listview.ListItemAdapter ),
+ getReferenceRemover: sinon.match.func
+ } )
);
- assert.ok( result.listItemAdapter instanceof $.wikibase.listview.ListItemAdapter );
-
- ListItemAdapter.restore();
+ referenceview.restore();
} );
QUnit.test( 'getListItemAdapterForSnakListView passes correct options to ListItemAdapter', function( assert ) {
@@ -390,42 +407,20 @@
assert.deepEqual(
result,
{
- value: value || undefined,
+ getListItemAdapter: result.getListItemAdapter, // Hack
singleProperty: true,
- listItemAdapter: result.listItemAdapter // Hack
+ value: value || undefined
}
);
- assert.ok( result.listItemAdapter instanceof $.wikibase.listview.ListItemAdapter );
+ assert.ok( result.getListItemAdapter instanceof Function );
$.wikibase.listview.ListItemAdapter.restore();
} );
QUnit.test( 'getListItemAdapterForSnakView passes correct options to ListItemAdapter', function( assert ) {
- assert.expect( 3 );
- var contentLanguages = {},
- value = null,
- dataTypeStore = {},
- entityIdHtmlFormatter = {},
- entityIdPlainFormatter = {},
- entityStore = {},
- expertStore = {},
- formatterFactory = {},
- messageProvider = {},
- parserStore = {},
- userLanguages = [],
- viewFactory = new ViewFactory(
- contentLanguages,
- dataTypeStore,
- entityIdHtmlFormatter,
- entityIdPlainFormatter,
- entityStore,
- expertStore,
- formatterFactory,
- messageProvider,
- parserStore,
- userLanguages
- ),
+ assert.expect( 1 );
+ var viewFactory = new ViewFactory(),
ListItemAdapter = sinon.spy( $.wikibase.listview, 'ListItemAdapter' );
viewFactory.getListItemAdapterForSnakView();
@@ -434,44 +429,10 @@
ListItemAdapter,
sinon.match( {
listItemWidget: $.wikibase.snakview,
- newItemOptionsFn: sinon.match.func
+ getNewItem: sinon.match.func
} )
);
- sinon.spy( wb, 'ValueViewBuilder' );
-
- var result = ListItemAdapter.args[0][0].newItemOptionsFn( value );
-
- assert.deepEqual(
- result,
- {
- value: value || {
- property: null,
- snaktype: 'value'
- },
- autoStartEditing: undefined,
- dataTypeStore: dataTypeStore,
- drawProperty: true,
- entityIdHtmlFormatter: entityIdHtmlFormatter,
- entityIdPlainFormatter: entityIdPlainFormatter,
- entityStore: entityStore,
- locked: {
- property: false
- },
- valueViewBuilder: wb.ValueViewBuilder.returnValues[0]
- }
- );
-
- sinon.assert.calledWith( wb.ValueViewBuilder,
- expertStore,
- formatterFactory,
- parserStore,
- userLanguages[0],
- messageProvider,
- contentLanguages
- );
-
- wb.ValueViewBuilder.restore();
$.wikibase.listview.ListItemAdapter.restore();
} );
@@ -489,6 +450,7 @@
parserStore = {},
userLanguages = [],
viewFactory = new ViewFactory(
+ null,
contentLanguages,
dataTypeStore,
entityIdHtmlFormatter,
@@ -507,7 +469,7 @@
sinon.spy( wb, 'ValueViewBuilder' );
- viewFactory.getSnakView( false, options, value, $dom );
+ viewFactory.getSnakView( null, false, options, value, $dom );
sinon.assert.calledWith(
$.wikibase.snakview,
@@ -546,6 +508,7 @@
messageProvider = { getMessage: function() { return message; } },
userLanguages = [],
viewFactory = new ViewFactory(
+ null,
contentLanguages,
null,
null,
@@ -562,7 +525,7 @@
sinon.spy( $.wikibase, 'entitytermsview' );
$dom.entitytermsview = $.wikibase.entitytermsview;
- viewFactory.getEntityTermsView( fingerprint, $dom );
+ viewFactory.getEntityTermsView( null, fingerprint, $dom );
sinon.assert.calledWith( $.wikibase.entitytermsview, sinon.match( {
value: fingerprint,
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.sitelinkview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.sitelinkview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -12,7 +12,14 @@
function createSitelinkview( options ) {
options = $.extend( {
entityIdPlainFormatter: 'i am an EntityIdPlainFormatter',
- allowedSiteIds: ['aawiki', 'enwiki']
+ allowedSiteIds: ['aawiki', 'enwiki'],
+ getSiteLinkRemover: function() {
+ return {
+ destroy: function() {},
+ disable: function() {},
+ enable: function() {}
+ };
+ }
}, options );
return $( '<div/>' )
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.tests.js 2016-09-06 20:27:01.985912096 +0000
@@ -6,32 +6,7 @@
'use strict';
QUnit.module( 'jquery.wikibase.edittoolbar', QUnit.newMwEnvironment( {
- setup: function() {
- $.widget( 'wikibasetest.editablewidget', {
- getHelpMessage: function() {
- return $.Deferred().resolve( 'help message' ).promise();
- },
- startEditing: function() {
- this._trigger( 'afterstartediting' );
- },
- stopEditing: function( dropValue ) {
- var self = this;
- this._trigger( 'stopediting', null, [dropValue] );
- setTimeout( function() {
- self._trigger( 'afterstopediting', null, [dropValue] );
- }, 0 );
- },
- cancelEditing: function() {
- return this.stopEditing( true );
- },
- setError: function() {
- this._trigger( 'toggleerror' );
- }
- } );
- },
teardown: function() {
- delete( $.wikibasetest.editablewidget );
-
$( '.test_edittoolbar' ).each( function() {
var $edittoolbar = $( this ),
edittoolbar = $edittoolbar.data( 'edittoolbar' );
@@ -53,7 +28,9 @@
return $( '<span/>' )
.addClass( 'test_edittoolbar' )
.edittoolbar( $.extend( {
- interactionWidget: $( '<div/>' ).editablewidget().data( 'editablewidget' )
+ getHelpMessage: function() {
+ return $.Deferred().resolve().promise();
+ }
}, options || {} ) );
}
@@ -196,32 +173,4 @@
);
} );
-QUnit.test( 'afterstartediting and afterstopediting events', 2, function( assert ) {
- var $edittoolbar = createEdittoolbar(),
- edittoolbar = $edittoolbar.data( 'edittoolbar' ),
- widget = edittoolbar.option( 'interactionWidget' );
-
- $edittoolbar
- .on( 'edittoolbarafterstartediting', function() {
- assert.ok(
- true,
- 'Triggered "afterstartediting" event.'
- );
- } )
- .on( 'edittoolbarafterstopediting', function() {
- QUnit.start();
-
- assert.ok(
- true,
- 'Triggered "afterstopediting" event.'
- );
- } );
-
- widget.startEditing();
-
- QUnit.stop();
-
- widget.stopEditing();
-} );
-
}( jQuery, QUnit ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entityselector.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entityselector.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -35,7 +35,8 @@
*/
var newTestEntitySelector = function( options ) {
options = $.extend( {
- source: entityStubs
+ source: entityStubs,
+ delay: 0 // Time waster, also some tests below assume this to be < 100ms
}, options || {} );
return $( '<input />' )
@@ -106,7 +107,7 @@
window.setTimeout( function() {
QUnit.start();
- }, 200 );
+ }, 100 );
} );
QUnit.test( 'Item constructor', function( assert ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -200,33 +200,6 @@
$queue.dequeue( 'tests' );
} );
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 3 );
- var $aliasesview = createAliasesview(),
- aliasesview = $aliasesview.data( 'aliasesview' );
-
- aliasesview.startEditing();
-
- assert.ok(
- aliasesview.isInitialValue(),
- 'Verified isInitialValue() returning true.'
- );
-
- aliasesview.$list.data( 'tagadata' ).getTags().first().find( 'input' ).val( 'changed' );
-
- assert.ok(
- !aliasesview.isInitialValue(),
- 'Verified isInitialValue() returning false after changing value.'
- );
-
- aliasesview.$list.data( 'tagadata' ).getTags().first().find( 'input' ).val( 'a' );
-
- assert.ok(
- aliasesview.isInitialValue(),
- 'Verified isInitialValue() returning true after resetting to initial value.'
- );
-} );
-
QUnit.test( 'setError()', function( assert ) {
assert.expect( 1 );
var $aliasesview = createAliasesview(),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -90,45 +90,6 @@
);
} );
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 3 );
- var view = createEntitytermsforlanguagelistview().data( 'entitytermsforlanguagelistview' ),
- listview = view.$listview.data( 'listview' );
-
- assert.ok(
- view.isInitialValue(),
- 'Verified isInitialValue() returning true.'
- );
-
- var $item = listview.addItem( {
- language: 'fa',
- label: new wb.datamodel.Term( 'fa', 'fa-label' ),
- description: new wb.datamodel.Term( 'fa', 'fa-description' ),
- aliases: new wb.datamodel.MultiTerm( 'fa', [] )
- } );
-
- assert.ok(
- view.isInitialValue(),
- 'Verified isInitialValue()still returning false after adding another unchanged value.'
- );
-
- // Replace the method with a fake that always acts like the value changed.
- $item.data( 'entitytermsforlanguageview' ).isInitialValue = function() {
- return false;
- };
-
- assert.ok(
- !view.isInitialValue(),
- 'Verified isInitialValue() returning false.'
- );
-} );
-
-// TODO: Add test which is kind of pointless without having a method to save a whole fingerprint
-// which could be overwritten by the test mechanism. Instead, the "save" functions of labelview,
-// descriptionview and aliasesview for each single entitytermsforlanguage would need to be
-// overwritten (see entitytermsforlanguage tests).
-// QUnit.test( 'startEditing() & stopEditing()', function( assert ) {} );
-
QUnit.test( 'setError()', function( assert ) {
assert.expect( 1 );
var $entitytermsforlanguagelistview = createEntitytermsforlanguagelistview(),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/snakview/snakview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/snakview/snakview.tests.js 2016-09-06 20:27:01.985912096 +0000
@@ -46,6 +46,8 @@
return $.Deferred().resolve().promise();
}
},
+ getSnakRemover: function() {
+ },
valueViewBuilder: 'I am a ValueViewBuilder',
dataTypeStore: new dt.DataTypeStore()
}, options || {} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.descriptionview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.descriptionview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -100,33 +100,6 @@
descriptionview.stopEditing();
} );
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 3 );
- var $descriptionview = createDescriptionview(),
- descriptionview = $descriptionview.data( 'descriptionview' );
-
- descriptionview.startEditing();
-
- assert.ok(
- descriptionview.isInitialValue(),
- 'Verified isInitialValue() returning true.'
- );
-
- descriptionview.$text.find( 'textarea' ).val( 'changed' );
-
- assert.ok(
- !descriptionview.isInitialValue(),
- 'Verified isInitialValue() returning false after changing value.'
- );
-
- descriptionview.$text.find( 'textarea' ).val( 'test description' );
-
- assert.ok(
- descriptionview.isInitialValue(),
- 'Verified isInitialValue() returning true after resetting to initial value.'
- );
-} );
-
QUnit.test( 'setError()', function( assert ) {
assert.expect( 1 );
var $descriptionview = createDescriptionview(),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementlistview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementlistview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -31,7 +31,9 @@
destroy: function() {}
};
},
- listItemAdapter: statementviewListItemAdapter,
+ getListItemAdapter: function() {
+ return statementviewListItemAdapter;
+ },
value: new wb.datamodel.StatementList()
}, options || {} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.sitelinklistview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.sitelinklistview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -155,7 +155,7 @@
);
} );
-QUnit.test( 'isValid()', function( assert ) {
+QUnit.test( 'value()', function( assert ) {
assert.expect( 1 );
var $sitelinklistview = createSitelinklistview( {
value: [new wb.datamodel.SiteLink( 'enwiki', 'enwiki-page' )]
@@ -163,12 +163,12 @@
sitelinklistview = $sitelinklistview.data( 'sitelinklistview' );
assert.ok(
- sitelinklistview.isValid(),
- 'Verified isValid() returning TRUE.'
+ sitelinklistview.value(),
+ 'Verified value() returning value.'
);
} );
-QUnit.test( 'isValid() with invalid sitelinkview', function( assert ) {
+QUnit.test( 'value() with invalid sitelinkview', function( assert ) {
assert.expect( 1 );
var $sitelinklistview = createSitelinklistview( {
value: []
@@ -188,54 +188,10 @@
return false;
};
- assert.ok(
- !sitelinklistview.isValid(),
- 'Verified isValid() returning FALSE.'
- );
-} );
-
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 5 );
- var $sitelinklistview = createSitelinklistview( {
- value: [new wb.datamodel.SiteLink( 'enwiki', 'enwiki-page' )]
- } ),
- sitelinklistview = $sitelinklistview.data( 'sitelinklistview' ),
- listview = sitelinklistview.$listview.data( 'listview' );
-
- assert.ok(
- sitelinklistview.isInitialValue(),
- 'Verified isInitialValue() returning TRUE.'
- );
-
- var $sitelinkview = listview.items().first(),
- lia = listview.listItemAdapter(),
- sitelink = lia.liInstance( $sitelinkview ).value();
- listview.removeItem( $sitelinkview );
-
- assert.notOk(
- sitelinklistview.isInitialValue(),
- 'FALSE after removing an item.'
- );
-
- listview.addItem( sitelink );
-
- assert.ok(
- sitelinklistview.isInitialValue(),
- 'TRUE after resetting to initial state.'
- );
-
- $sitelinkview = listview.addItem( new wb.datamodel.SiteLink( 'aawiki', 'aawiki-page' ) );
-
- assert.notOk(
- sitelinklistview.isInitialValue(),
- 'FALSE after adding an item, even if the added item is unchanged.'
- );
-
- listview.removeItem( $sitelinkview );
-
- assert.ok(
- sitelinklistview.isInitialValue(),
- 'TRUE after resetting to initial state.'
+ assert.strictEqual(
+ sitelinklistview.value().length,
+ 0,
+ 'Verified value() returning valid values.'
);
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementgrouplistview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementgrouplistview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -19,6 +19,11 @@
*/
var createStatementgrouplistview = function( options, $node ) {
options = $.extend( {
+ getAdder: function() {
+ return {
+ destroy: function() {}
+ };
+ },
listItemAdapter: statementgroupviewListItemAdapter,
value: new wb.datamodel.StatementGroupSet()
}, options || {} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.statementview.tests.js 2016-09-06 20:27:01.985912096 +0000
@@ -27,7 +27,12 @@
*/
var createStatementview = function( options, $node ) {
options = $.extend( {
- buildReferenceListItemAdapter: function() {
+ getAdder: function() {
+ return {
+ destroy: function() {}
+ };
+ },
+ getReferenceListItemAdapter: function() {
return wb.tests.getMockListItemAdapter(
'mytestreferenceview',
function() {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -185,34 +185,6 @@
$queue.dequeue( 'tests' );
} );
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 3 );
- var $entitytermsforlanguageview = createEntitytermsforlanguageview(),
- entitytermsforlanguageview
- = $entitytermsforlanguageview.data( 'entitytermsforlanguageview' );
-
- entitytermsforlanguageview.startEditing();
-
- assert.ok(
- entitytermsforlanguageview.isInitialValue(),
- 'Verified isInitialValue() returning true.'
- );
-
- entitytermsforlanguageview.$label.find( 'input, textarea' ).val( 'changed' );
-
- assert.ok(
- !entitytermsforlanguageview.isInitialValue(),
- 'Verified isInitialValue() returning false after changing value.'
- );
-
- entitytermsforlanguageview.$label.find( 'input, textarea' ).val( 'test label' );
-
- assert.ok(
- entitytermsforlanguageview.isInitialValue(),
- 'Verified isInitialValue() returning true after resetting to initial value.'
- );
-} );
-
QUnit.test( 'setError()', function( assert ) {
assert.expect( 1 );
var $entitytermsforlanguageview = createEntitytermsforlanguageview(),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.referenceview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.referenceview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -13,11 +13,25 @@
*/
function createReferenceview( options ) {
options = $.extend( {
+ getAdder: function() {
+ return {
+ destroy: function() {}
+ };
+ },
+ getReferenceRemover: function() {
+ return {
+ destroy: function() {}
+ };
+ },
listItemAdapter: wb.tests.getMockListItemAdapter(
'snaklistview',
function() {
this.enterNewItem = function() {
- return $.Deferred().resolve().promise();
+ return $.Deferred().resolve( {
+ data: function() {
+ return { focus: function() {} };
+ }
+ } ).promise();
};
this.isValid = function() {
return false;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.labelview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.labelview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -100,33 +100,6 @@
labelview.stopEditing();
} );
-QUnit.test( 'isInitialValue()', function( assert ) {
- assert.expect( 3 );
- var $labelview = createLabelview(),
- labelview = $labelview.data( 'labelview' );
-
- labelview.startEditing();
-
- assert.ok(
- labelview.isInitialValue(),
- 'Verified isInitialValue() returning true.'
- );
-
- labelview.$text.find( 'textarea' ).val( 'changed' );
-
- assert.ok(
- !labelview.isInitialValue(),
- 'Verified isInitialValue() returning false after changing value.'
- );
-
- labelview.$text.find( 'textarea' ).val( 'test label' );
-
- assert.ok(
- labelview.isInitialValue(),
- 'Verified isInitialValue() returning true after resetting to initial value.'
- );
-} );
-
QUnit.test( 'setError()', function( assert ) {
assert.expect( 1 );
var $labelview = createLabelview(),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.snaklistview.tests.js 2016-08-30 11:22:39.120631725 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/wikibase/jquery.wikibase.snaklistview.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -50,7 +50,9 @@
function createSnaklistview( value, additionalOptions ) {
var options = $.extend( additionalOptions, {
value: value || undefined,
- listItemAdapter: listItemAdapter
+ getListItemAdapter: function() {
+ return listItemAdapter;
+ }
} );
return $( '<div/>' )
@@ -230,7 +232,7 @@
);
} );
- QUnit.test( 'Basic start and stop editing', 6, function( assert ) {
+ QUnit.test( 'Basic start and stop editing', 5, function( assert ) {
var $node = createSnaklistview(),
snaklistview = $node.data( 'snaklistview' );
@@ -256,16 +258,7 @@
// Should not trigger any events since in edit mode already:
snaklistview.startEditing();
- QUnit.stop( 2 );
-
- $node.on( 'snaklistviewstopediting', function( e ) {
- assert.ok(
- true,
- 'Triggered "stopediting" event.'
- );
-
- QUnit.start();
- } );
+ QUnit.stop( 1 );
$node.on( 'snaklistviewafterstopediting', function( e ) {
assert.ok(
@@ -294,7 +287,7 @@
snaklistview.stopEditing();
} );
- QUnit.test( 'Basic start and stop editing of filled snaklistview', 6, function( assert ) {
+ QUnit.test( 'Basic start and stop editing of filled snaklistview', 5, function( assert ) {
var $node = createSnaklistview( snakLists[0] ),
snaklistview = $node.data( 'snaklistview' );
@@ -324,16 +317,7 @@
// Should not trigger any events since in edit mode already:
snaklistview.startEditing();
- QUnit.stop( 2 );
-
- $node.on( 'snaklistviewstopediting', function( e ) {
- assert.ok(
- true,
- 'Triggered "stopediting" event.'
- );
-
- QUnit.start();
- } );
+ QUnit.stop( 1 );
$node.on( 'snaklistviewafterstopediting', function( e ) {
assert.ok(
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/ui/jquery.ui.EditableTemplatedWidget.tests.js 2016-08-30 11:22:39.116631694 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/view/tests/qunit/jquery/ui/jquery.ui.EditableTemplatedWidget.tests.js 2016-09-06 20:27:01.981912065 +0000
@@ -11,25 +11,13 @@
_create: function() {
this._initialValue = this.options.value;
},
- _draw: function() {},
- _save: function() {
- return $.Deferred().resolve().promise();
- },
+ draw: function() {},
value: function( value ) {
if ( value === undefined ) {
this.option( 'value', value );
} else {
return this.option( 'value' );
}
- },
- isEmpty: function() {
- return !this.option( 'value' );
- },
- isValid: function() {
- return !!this.option( 'value' );
- },
- isInitialValue: function() {
- return this.option( 'value' ) === this._initialValue;
}
} );
},
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/repo/resources/wikibase.ui.entityViewInit.js 2016-08-30 11:22:39.068631326 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/repo/resources/wikibase.ui.entityViewInit.js 2016-09-06 20:27:01.937911731 +0000
@@ -17,35 +17,6 @@
}
/**
- * @param {jQuery} $entityview
- */
- function initToolbarController( $entityview ) {
- // The toolbars (defined per jquery.wikibase.toolbarcontroller.definition) that should
- // be initialized:
- var toolbarControllerConfig = {
- toolbars: {
- addtoolbar: [
- 'statementgrouplistview-statementgroupview',
- 'statementlistview-statementview',
- 'statementview-snakview',
- 'statementview-referenceview',
- 'referenceview-snakview'
- ],
- edittoolbar: [
- ],
- removetoolbar: [
- 'referenceview',
- 'statementview-snakview',
- 'referenceview-snakview',
- 'sitelinkgroupview-sitelinkview'
- ]
- }
- };
-
- $entityview.toolbarcontroller( toolbarControllerConfig );
- }
-
- /**
* @return {string[]} An ordered list of languages the user wants to use, the first being her
* preferred language, and thus the UI language (currently wgUserLanguage).
*/
@@ -115,8 +86,11 @@
htmlDataValueEntityIdFormatter = formatterFactory.getFormatter( null, null, 'text/html' ),
plaintextDataValueEntityIdFormatter = formatterFactory.getFormatter( null, null, 'text/plain' ),
entityIdParser = new ( parserStore.getParser( wb.datamodel.EntityId.TYPE ) )( { lang: userLanguages[0] } ),
+ toolbarFactory = new wb.view.ToolbarFactory(),
+ structureEditorFactory = new wb.view.StructureEditorFactory( toolbarFactory ),
viewFactoryClass = wb.view.ViewFactory,
viewFactoryArguments = [
+ structureEditorFactory,
contentLanguages,
dataTypeStore,
new wb.entityIdFormatter.CachingEntityIdHtmlFormatter(
@@ -136,7 +110,10 @@
parserStore,
userLanguages,
repoApiUrl
- ];
+ ],
+ startEditingCallback = function() {
+ return $.Deferred().resolve().promise();
+ };
if ( isEditable() ) {
viewFactoryClass = wb.view.ControllerViewFactory;
@@ -148,7 +125,7 @@
viewFactoryArguments.unshift( null );
var viewFactory = new ( Function.prototype.bind.apply( viewFactoryClass, viewFactoryArguments ) );
- var entityView = viewFactory.getEntityView( entity, $entityview );
+ var entityView = viewFactory.getEntityView( startEditingCallback, entity, $entityview );
return entityView.widgetName;
}
@@ -374,10 +351,6 @@
var entityInitializer = new wb.EntityInitializer( 'wbEntity' );
var canEdit = isEditable();
- if ( canEdit ) {
- initToolbarController( $entityview );
- }
-
entityInitializer.getEntity().done( function( entity ) {
var viewName = createEntityView( entity, $entityview.first() );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Wikidata/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.siteselector.js 2016-08-30 11:22:38.980630652 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Wikidata/extensions/Wikibase/lib/resources/jquery.wikibase/jquery.wikibase.siteselector.js 2016-09-06 20:27:01.897911429 +0000
@@ -208,7 +208,7 @@
deferred = $.Deferred();
if ( term === '' ) {
- return deferred.resolve( [], term ).promise;
+ return deferred.resolve( [], term ).promise();
}
var suggestedSites = $.grep( source, function( site ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/GuidedTour/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js 2016-08-30 11:19:58.999404245 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/GuidedTour/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js 2016-09-06 16:28:38.741185556 +0000
@@ -840,15 +840,12 @@
* Initializes step, making it ready to be displayed.
* Other methods call this after all augmentation is complete.
*
- * @param {boolean} shouldFlipHorizontally true to flip requested position
- * horizontally before calling low-level guiders library, false otherwise
- *
* @return {jQuery.Promise} Promise that resolves successfully, except on AJAX failure
* when mw.guidedTour.WikitextDescription or mw.Title are used for a description.
*
* @private
*/
- Step.prototype.initialize = function ( shouldFlipHorizontally ) {
+ Step.prototype.initialize = function () {
var self = this, options = this.specification,
passedInOnClose = options.onClose, passedInOnShow = options.onShow;
@@ -911,7 +908,7 @@
if ( options.position !== undefined ) {
options.position = getValueForSkin( options, 'position' );
- if ( shouldFlipHorizontally ) {
+ if ( this.tour.flipRTL ) {
options.position = guiders.getFlippedPosition( options.position, {
horizontal: true
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/GuidedTour/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js 2016-08-30 11:19:58.999404245 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/GuidedTour/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js 2016-09-06 16:28:38.741185556 +0000
@@ -115,6 +115,13 @@
*/
this.cssClass = 'mw-guidedtour-tour-' + this.name;
+ /**
+ * Whether the tour should be flipped; see getShouldFlipHorizontally.
+ *
+ * Initialized in initialize()
+ */
+ this.flipRTL = null;
+
moduleName = internal.getTourModuleName( this.name );
/**
@@ -135,30 +142,38 @@
this.isInitialized = false;
}
+ // TODO: Change this to use before/after (T142267)
/**
* Determines whether guiders in this tour should be horizontally flipped due to LTR/RTL
*
* Considers the HTML element's dir attribute and body LTR/RTL classes in addition
* to parameter.
*
+ * We assume that all tours defined in extensions use LTR, as with CSS/LESS.
+ *
+ * We assume that tours defined on-wiki use their site's directionality.
+ *
+ * Examples:
+ *
+ * * A user on Arabic Wikipedia views an extension-defined tour in the default
+ * language for their wiki (Arabic). The tour is flipped.
+ *
+ * * A user on Hebrew Wikipedia writes a tour in the MediaWiki namespace. They
+ * view the tour in the default language (Hebrew). The tour is not flipped.
+ *
+ * * A user on English Wikipedia is browsing with the user language set to Farsi.
+ * They view an extension-defined tour. The tour is flipped.
+ *
* @private
*
- * @param {boolean} isExtensionDefined true if the tour is extension-defined,
- * false otherwise
+ * @param {'ltr'|'rtl'} interfaceDirection Direction the interface is being viewed
+ * in; can be changed by user preferences or uselang
+ * @param {'ltr'|'rtl'} siteDirection Main direction of site
*
* @return {boolean} true if steps should be flipped, false otherwise
*/
- Tour.prototype.getShouldFlipHorizontally = function () {
- var tourDirection, interfaceDirection, siteDirection, $body;
-
- $body = $( document.body );
-
- // Main direction of the site
- siteDirection = $body.is( '.sitedir-ltr' ) ? 'ltr' : 'rtl';
-
- // Direction the interface is being viewed in.
- // This can be changed by user preferences or uselang
- interfaceDirection = $( 'html' ).attr( 'dir' );
+ Tour.prototype.getShouldFlipHorizontally = function ( interfaceDirection, siteDirection ) {
+ var tourDirection;
// Direction the tour is assumed to be written for
tourDirection = this.isExtensionDefined ? 'ltr' : siteDirection;
@@ -176,16 +191,19 @@
* @return {jQuery.Promise} Promise that waits on all steps to initialize (or one to fail)
*/
Tour.prototype.initialize = function () {
- var stepName, shouldFlipHorizontally, promises = [], tour = this;
+ var stepName, promises = [], tour = this,
+ $body = $( document.body ),
+ interfaceDirection = $( 'html' ).attr( 'dir' ),
+ siteDirection = $body.hasClass( 'sitedir-ltr' ) ? 'ltr' : 'rtl';
if ( this.isInitialized ) {
return $.Deferred().resolve();
}
- shouldFlipHorizontally = this.getShouldFlipHorizontally();
+ this.flipRTL = this.getShouldFlipHorizontally( interfaceDirection, siteDirection );
for ( stepName in this.steps ) {
- promises.push( this.steps[stepName].initialize( shouldFlipHorizontally ) );
+ promises.push( this.steps[stepName].initialize() );
}
return $.when.apply( $, promises ).then( function () {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/GuidedTour/tests/qunit/ext.guidedTour.lib.tests.js 2016-08-30 11:19:58.999404245 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/GuidedTour/tests/qunit/ext.guidedTour.lib.tests.js 2016-09-06 16:28:38.745185586 +0000
@@ -1320,8 +1320,7 @@
// Full coverage of all code paths
var getStateStub, EXTENSION_NAME = 'extension', ONWIKI_NAME = 'onwiki',
- extensionTour, onwikiTour, $body = $( document.body ),
- $html = $( 'html' ), originalSiteDir, originalInterfaceDir;
+ extensionTour, onwikiTour;
getStateStub = this.stub( mw.loader, 'getState' );
getStateStub.withArgs( gt.internal.getTourModuleName( ONWIKI_NAME ) )
@@ -1338,11 +1337,6 @@
name: ONWIKI_NAME
} );
- originalSiteDir = $body.is( '.sitedir-ltr' ) ? 'ltr' : 'rtl';
- originalInterfaceDir = $( 'html' ).attr( 'dir' );
-
- $body.removeClass( 'sitedir-rtl' ).addClass( 'sitedir-ltr' );
-
// There are two different directionalities
// * Site as a whole (sitedir- class)
// * User interface (html[dir])
@@ -1351,60 +1345,49 @@
// Extension tours don't care about site language; tour direction is ltr
// Should flip if interface direction is different from tour direction
- $html.attr( 'dir', 'ltr' );
assert.strictEqual(
- extensionTour.getShouldFlipHorizontally(),
+ extensionTour.getShouldFlipHorizontally( 'ltr', 'ltr' ),
false,
'No flip for extension tour when interface language and site language are both ltr'
);
assert.strictEqual(
- onwikiTour.getShouldFlipHorizontally(),
+ onwikiTour.getShouldFlipHorizontally( 'ltr', 'ltr' ),
false,
'No flip for onwiki tour when interface language and site language are both ltr'
);
- $html.attr( 'dir', 'rtl' );
assert.strictEqual(
- extensionTour.getShouldFlipHorizontally(),
+ extensionTour.getShouldFlipHorizontally( 'rtl', 'ltr' ),
true,
'Flip for extension tour when interface language is rtl and site language is ltr'
);
assert.strictEqual(
- onwikiTour.getShouldFlipHorizontally(),
+ onwikiTour.getShouldFlipHorizontally( 'rtl', 'ltr' ),
true,
'Flip for onwiki tour when interface language is rtl and site language is ltr'
);
- $body.removeClass( 'sitedir-ltr' ).addClass( 'sitedir-rtl' );
-
- $html.attr( 'dir', 'ltr' );
assert.strictEqual(
- extensionTour.getShouldFlipHorizontally(),
+ extensionTour.getShouldFlipHorizontally( 'ltr', 'rtl' ),
false,
'No flip for extension tour when interface language is ltr and site language is rtl'
);
assert.strictEqual(
- onwikiTour.getShouldFlipHorizontally(),
+ onwikiTour.getShouldFlipHorizontally( 'ltr', 'rtl' ),
true,
'Flip for onwiki tour when interface language is ltr and site language is rtl'
);
- $html.attr( 'dir', 'rtl' );
assert.strictEqual(
- extensionTour.getShouldFlipHorizontally(),
+ extensionTour.getShouldFlipHorizontally( 'rtl', 'rtl' ),
true,
'Flip for extension tour when interface language is rtl and site language is rtl'
);
assert.strictEqual(
- onwikiTour.getShouldFlipHorizontally(),
+ onwikiTour.getShouldFlipHorizontally( 'rtl', 'rtl' ),
false,
'No flip for onwiki tour when interface language and site language are both rtl'
);
-
- $body.removeClass( 'sitedir-ltr sitedir-rtl' )
- .addClass( 'sitedir-' + originalSiteDir );
-
- $html.attr( 'dir', originalInterfaceDir );
} );
QUnit.test( 'Tour.initialize', 3, function ( assert ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UploadWizard/resources/uw.EventFlowLogger.js 2016-08-30 11:22:07.036385765 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UploadWizard/resources/uw.EventFlowLogger.js 2016-09-13 13:18:01.096094998 +0000
@@ -271,6 +271,8 @@
this.log( 'UploadWizardExceptionFlowEvent', {
message: ( err.message || '' ),
url: 'debug://NS_ERROR_NOT_AVAILABLE',
+ line: 0,
+ column: 0,
stack: JSON.stringify( {
type: img.tagName,
url: String( img.src ).slice( 0, 100 ),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UploadWizard/resources/transports/mw.FormDataTransport.js 2016-08-30 11:22:07.036385765 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UploadWizard/resources/transports/mw.FormDataTransport.js 2016-09-06 16:31:07.714334801 +0000
@@ -213,7 +213,7 @@
if ( this.xhr ) {
this.xhr.abort();
}
- return;
+ return deferred.reject();
}
// Slice API was changed and has vendor prefix for now
// new version now require start/end and not start/length
@@ -369,7 +369,7 @@
params = {};
if ( this.aborted ) {
- return;
+ return $.Deferred().reject();
}
if ( !this.firstPoll ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.pagepreparation.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.pagepreparation.js 2016-09-06 16:30:41.442132130 +0000
@@ -11,7 +11,8 @@
function savePage( pageName, pageContent ) {
var api = new mw.Api();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'edit',
format: 'json',
title: pageName,
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.messagetable.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.messagetable.js 2016-09-06 16:30:41.438132100 +0000
@@ -35,56 +35,14 @@
mcprop: 'definition|translation|tags|properties',
rawcontinue: 1
} );
- },
-
- loadMessages: function ( changes ) {
- // FIXME: this should be member method
- var $container = $( '.tux-messagelist' ),
- $loader = $( '.tux-messagetable-loader' ),
- $statsbar = $( '.tux-message-list-statsbar' );
-
- changes = changes || {};
-
- // Clear current messages
- $container.trigger( 'clear' );
-
- // Change the properties that are provided
- if ( changes.filter !== undefined ) {
- $loader.data( 'filter', changes.filter );
- }
- if ( changes.group !== undefined ) {
- $loader.data( 'messagegroup', changes.group );
- }
-
- // Reset the number of messages remaining
- $loader.find( '.tux-messagetable-loader-info' ).text(
- mw.msg( 'tux-messagetable-loading-messages', $loader.data( 'pagesize' ) )
- );
-
- // Reset the statsbar
- $statsbar
- .empty()
- .removeData()
- .languagestatsbar( {
- language: $container.data( 'targetlangcode' ),
- group: $loader.data( 'messagegroup' )
- } );
-
- // Reset other info and make visible
- $loader
- .removeData( 'offset' )
- .removeAttr( 'data-offset' )
- .removeClass( 'hide' );
-
- // And start loading
- $loader.trigger( 'appear' );
}
} );
- function MessageTable( container, options ) {
+ function MessageTable( container, options, settings ) {
this.$container = $( container );
this.options = options;
this.options = $.extend( {}, $.fn.messagetable.defaults, options );
+ this.settings = settings;
// mode can be proofread, page or translate
this.mode = this.options.mode;
this.firstProofreadTipShown = false;
@@ -103,8 +61,6 @@
MessageTable.prototype = {
init: function () {
- this.switchMode( this.mode );
- this.initialized = true;
this.$actionBar.removeClass( 'hide' );
},
@@ -131,8 +87,6 @@
}, 300 );
} );
- this.$container.on( 'clear', $.proxy( messageTable.clear, messageTable ) );
-
this.$loader.appear( function () {
// Avoid the overlap calls to load()
setTimeout( function () {
@@ -412,98 +366,143 @@
}
},
+ /**
+ * Start loading messages again with new settings.
+ *
+ * @param {Object} changes
+ */
+ changeSettings: function ( changes ) {
+ var $statsbar = $( '.tux-message-list-statsbar' );
+
+ // Clear current messages
+ this.clear();
+ this.settings = $.extend( this.settings, changes );
+
+ if ( this.initialized === false ) {
+ this.switchMode( this.mode );
+ }
+
+ // Reset the number of messages remaining
+ this.$loaderInfo.text(
+ mw.msg( 'tux-messagetable-loading-messages', this.$loader.data( 'pagesize' ) )
+ );
+
+ // Reset the statsbar
+ $statsbar
+ .empty()
+ .removeData()
+ .languagestatsbar( {
+ language: this.settings.language,
+ group: this.settings.group
+ } );
+
+ this.initialized = true;
+ // Reset other info and make visible
+ this.$loader
+ .removeData( 'offset' )
+ .removeAttr( 'data-offset' )
+ .removeClass( 'hide' )
+ // And start loading
+ .trigger( 'appear' );
+ },
+
load: function () {
var remaining,
query,
- messageTable = this,
- $messageList = $( '.tux-messagelist' ),
+ self = this,
offset = this.$loader.data( 'offset' ),
- filter = messageTable.$loader.data( 'filter' ),
- targetLangCode = $messageList.data( 'targetlangcode' ),
- messagegroup = messageTable.$loader.data( 'messagegroup' ),
- pageSize = messageTable.$loader.data( 'pagesize' );
+ pageSize = this.$loader.data( 'pagesize' );
if ( offset === -1 ) {
return;
}
- if ( messageTable.loading ) {
+ if ( this.loading ) {
// Avoid duplicate loading - the offset will be wrong and it will result
// in duplicate messages shown in the page
return;
}
- messageTable.loading = true;
+ this.loading = true;
this.$loaderIcon.removeClass( 'tux-loading-indicator--stopped' );
- mw.translate.getMessages( messagegroup, targetLangCode, offset, pageSize, filter )
- .done( function ( result ) {
- var messages = result.query.messagecollection,
- state;
-
- if ( !messageTable.loading ) {
- // reject. This was cancelled.
- return;
- }
+ mw.translate.getMessages(
+ this.settings.group,
+ this.settings.language,
+ offset,
+ pageSize,
+ this.settings.filter
+ ).done( function ( result ) {
+ var messages = result.query.messagecollection,
+ state;
+
+ if ( !self.loading ) {
+ // reject. This was cancelled.
+ return;
+ }
- if ( messages.length === 0 ) {
- // And this is the first load for the filter...
- if ( messageTable.$container.children().length === 0 ) {
- messageTable.displayEmptyListHelp();
- }
+ if ( messages.length === 0 ) {
+ // And this is the first load for the filter...
+ if ( self.$container.children().length === 0 ) {
+ self.displayEmptyListHelp();
}
+ }
- $.each( messages, function ( index, message ) {
- message.group = messagegroup;
- messageTable.add( message );
- messageTable.messages.push( message );
-
- if ( index === 0 && messageTable.mode === 'translate' ) {
- $( '.tux-message:first' ).data( 'translateeditor' ).init();
- }
- } );
+ $.each( messages, function ( index, message ) {
+ message.group = self.settings.group;
+ self.add( message );
+ self.messages.push( message );
- state = result.query.metadata && result.query.metadata.state;
- $( '.tux-workflow' ).workflowselector( messagegroup, targetLangCode, state );
+ if ( index === 0 && self.mode === 'translate' ) {
+ $( '.tux-message:first' ).data( 'translateeditor' ).init();
+ }
+ } );
- // Dynamically loaded messages should pass the search filter if present.
- query = $( '.tux-message-filter-box' ).val();
+ state = result.query.metadata && result.query.metadata.state;
+ $( '.tux-workflow' ).workflowselector(
+ self.settings.group,
+ self.settings.language,
+ state
+ );
- if ( query ) {
- messageTable.search( query );
- }
+ // Dynamically loaded messages should pass the search filter if present.
+ query = $( '.tux-message-filter-box' ).val();
- if ( result[ 'query-continue' ] === undefined ) {
- // End of messages
- messageTable.$loader.data( 'offset', -1 )
- .addClass( 'hide' );
- } else {
- messageTable.$loader.data( 'offset', result[ 'query-continue' ].messagecollection.mcoffset );
+ if ( query ) {
+ self.search( query );
+ }
- remaining = result.query.metadata.remaining;
+ if ( result[ 'query-continue' ] === undefined ) {
+ // End of messages
+ self.$loader.data( 'offset', -1 )
+ .addClass( 'hide' );
+ } else {
+ self.$loader.data( 'offset', result[ 'query-continue' ].messagecollection.mcoffset );
- messageTable.$loaderInfo.text(
- mw.msg( 'tux-messagetable-more-messages', remaining )
- );
+ remaining = result.query.metadata.remaining;
- // Make sure the floating toolbars are visible without the need for scroll
- $( window ).trigger( 'scroll' );
- }
+ self.$loaderInfo.text(
+ mw.msg( 'tux-messagetable-more-messages', remaining )
+ );
- messageTable.updateLastMessage();
- } )
- .fail( function ( errorCode, response ) {
- if ( response.error && response.error.code === 'mctranslate-language-disabled' ) {
- $( '.tux-editor-header .group-warning' )
- .text( mw.msg( 'translate-language-disabled' ) )
- .show();
- }
- messageTable.$loader.data( 'offset', -1 ).addClass( 'hide' );
- } )
- .always( function () {
- messageTable.$loaderIcon.addClass( 'tux-loading-indicator--stopped' );
- messageTable.loading = false;
- } );
+ // Make sure the floating toolbars are visible without the need for scroll
+ $( window ).trigger( 'scroll' );
+ }
+
+ self.updateLastMessage();
+ } )
+ .fail( function ( errorCode, response ) {
+ if ( response.error && response.error.code === 'mctranslate-language-disabled' ) {
+ $( '.tux-editor-header .group-warning' )
+ .text( mw.msg( 'translate-language-disabled' ) )
+ .show();
+ }
+ self.$loader.data( 'offset', -1 ).addClass( 'hide' );
+ } )
+ .always( function () {
+ self.$loaderIcon.addClass( 'tux-loading-indicator--stopped' );
+ self.loading = false;
+ } );
},
updateLastMessage: function () {
@@ -637,7 +636,7 @@
*/
switchMode: function ( mode ) {
var messageTable = this,
- filter = messageTable.$loader.data( 'filter' ),
+ filter = this.settings.filter,
userId = mw.config.get( 'wgUserId' ),
$tuxTabUntranslated,
$tuxTabUnproofread,
@@ -690,7 +689,7 @@
$tuxTabUnproofread.addClass( 'hide' );
$controlOwnButton.addClass( 'hide' );
- if ( messageTable.$loader.data( 'filter' ).indexOf( '!translated' ) > -1 ) {
+ if ( filter.indexOf( '!translated' ) > -1 ) {
$hideTranslatedButton.removeClass( 'hide' );
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js 2016-09-06 16:30:41.442132130 +0000
@@ -15,7 +15,8 @@
uri = new mw.Uri( e.target.href );
params = uri.query;
- params.token = mw.user.tokens.get( 'csrfToken' );
+ // Change to csrf when support for MW 1.26 is dropped
+ params.token = mw.user.tokens.get( 'editToken' );
$.post( uri.path, params ).done( function () {
location.reload();
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.translationstashstorage.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.translationstashstorage.js 2016-09-06 16:30:41.442132130 +0000
@@ -22,7 +22,8 @@
save: function ( title, translation ) {
var api = new mw.Api();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'translationstash',
subaction: 'add',
title: title,
@@ -41,7 +42,8 @@
getUserTranslations: function ( user ) {
var api = new mw.Api();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'translationstash',
subaction: 'query',
username: user
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.quickedit.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.quickedit.js 2016-09-06 16:30:41.442132130 +0000
@@ -75,7 +75,8 @@
return b + ' (_)'.replace( '_', key );
} )
.attr( 'accesskey', key )
- .attr( 'title', '[' + mw.util.tooltipAccessKeyPrefix + key + ']' );
+ .attr( 'title', '[' + key + ']' )
+ .updateTooltipAccessKeys();
} );
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.workflowselector.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.workflowselector.js 2016-09-06 16:30:41.442132130 +0000
@@ -69,7 +69,8 @@
format: 'json'
};
- return api.postWithToken( 'csrf', params );
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', params );
},
/**
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.editor.helpers.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.editor.helpers.js 2016-09-06 16:30:41.438132100 +0000
@@ -55,7 +55,8 @@
api = new mw.Api(),
newDocumentation = translateEditor.$editor.find( '.tux-textarea-documentation' ).val();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'edit',
title: translateEditor.message.title
.replace( /\/[a-z\-]+$/, '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.translate.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.translate.js 2016-09-06 16:30:41.442132130 +0000
@@ -3,7 +3,8 @@
var state = {
group: null,
- language: null
+ language: null,
+ messageList: null
};
mw.translate = mw.translate || {};
@@ -31,72 +32,30 @@
mw.translate.changeUrl( changes );
mw.translate.updateTabLinks( changes );
- mw.translate.loadMessages( changes );
+ state.messageList.changeSettings( changes );
updateGroupInformation( state );
},
changeLanguage: function ( language ) {
- var changes, targetDir, targetLangAttrib,
- userLanguageCode = mw.config.get( 'wgUserLanguage' );
-
- if ( !checkDirty() ) {
- return;
- }
-
- state.language = language;
-
- changes = {
+ var changes = {
language: language
};
- if ( language === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
- targetLangAttrib = userLanguageCode;
- targetDir = $.uls.data.getDir( userLanguageCode );
- } else {
- targetLangAttrib = language;
- targetDir = $.uls.data.getDir( language );
- }
-
- // Changes to attributes must also be reflected
- // when the element is created on the server side
- $( '.ext-translate-language-selector > .uls' )
- .text( $.uls.data.getAutonym( language ) )
- .attr( {
- lang: targetLangAttrib,
- dir: targetDir
- } );
- $( '.tux-messagelist' ).data( {
- targetlangcode: language,
- targetlangdir: targetDir
- } );
-
- mw.translate.changeUrl( changes );
- mw.translate.updateTabLinks( changes );
- mw.translate.loadMessages();
- updateGroupInformation( state );
+ // Force a URL change (no AJAX) until client-side language changing
+ // is stable enough. This doesn't do checks for some restrictions atm.
+ mw.translate.changeUrl( changes, true );
},
changeFilter: function ( filter ) {
- var realFilters, uri;
-
if ( !checkDirty() ) {
return;
}
- realFilters = [ '!ignored' ];
- uri = new mw.Uri( window.location.href );
- if ( uri.query.optional !== '1' ) {
- realFilters.push( '!optional' );
- }
- if ( filter ) {
- realFilters.push( filter );
- }
-
mw.translate.changeUrl( { filter: filter } );
- mw.translate.loadMessages( { filter: realFilters.join( '|' ) } );
+ state.messageList.changeSettings( { filter: getActualFilter( filter ) } );
},
- changeUrl: function ( params ) {
+ changeUrl: function ( params, forceChange ) {
var uri = new mw.Uri( window.location.href );
uri.extend( params );
@@ -105,9 +64,9 @@
return;
}
- // Change the URL with this URI, but don't leave the page.
- if ( history.pushState && $( '.tux-messagelist' ).length ) {
- // IE<10 does not support pushState. Never mind.
+ // If supported by the browser and requested, change the URL with
+ // this URI but try not to leave the page.
+ if ( !forceChange && history.pushState && $( '.tux-messagelist' ).length ) {
history.pushState( uri, null, uri.toString() );
} else {
// For old browsers, just reload
@@ -133,6 +92,21 @@
}
} );
+ function getActualFilter( filter ) {
+ var realFilters, uri;
+
+ realFilters = [ '!ignored' ];
+ uri = new mw.Uri( window.location.href );
+ if ( uri.query.optional !== '1' ) {
+ realFilters.push( '!optional' );
+ }
+ if ( filter ) {
+ realFilters.push( filter );
+ }
+
+ return realFilters.join( '|' );
+ }
+
function checkDirty() {
if ( mw.translate.isDirty() ) {
return window.confirm( mw.msg( 'translate-js-support-unsaved-warning' ) );
@@ -255,7 +229,14 @@
filter, uri, position;
$messageList = $( '.tux-messagelist' );
+ state.group = $( '.tux-messagetable-loader' ).data( 'messagegroup' );
+ state.language = $messageList.data( 'targetlangcode' ) || // for tux=1
+ mw.config.get( 'wgUserLanguage' ); // for tux=0
+
if ( $messageList.length ) {
+ $messageList.messagetable();
+ state.messageList = $messageList.data( 'messagetable' );
+
uri = new mw.Uri( window.location.href );
filter = uri.query.filter;
@@ -263,7 +244,6 @@
filter = '!translated';
}
- mw.translate.changeFilter( filter );
$( '.tux-message-selector li' ).each( function () {
var $this = $( this );
@@ -271,11 +251,20 @@
$this.addClass( 'selected' );
}
} );
- }
- state.group = $( '.tux-messagetable-loader' ).data( 'messagegroup' );
- state.language = $messageList.data( 'targetlangcode' ) || // for tux=1
- mw.config.get( 'wgUserLanguage' ); // for tux=0
+ mw.translate.changeUrl( {
+ group: state.group,
+ language: state.language,
+ filter: filter
+ } );
+
+ // Start loading messages
+ state.messageList.changeSettings( {
+ group: state.group,
+ language: state.language,
+ filter: getActualFilter( filter )
+ } );
+ }
if ( $( 'body' ).hasClass( 'rtl' ) ) {
position = {
@@ -292,8 +281,6 @@
updateGroupInformation( state );
- $messageList.messagetable();
-
$( '.ext-translate-language-selector .uls' ).one( 'click', function () {
var $target = $( this );
mw.loader.using( 'ext.uls.mediawiki' ).done( function () {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.aggregategroups.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.aggregategroups.js 2016-09-06 16:30:41.442132130 +0000
@@ -24,7 +24,8 @@
group: $target.data( 'groupid' )
} );
- api.postWithToken( 'csrf', params )
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params )
.done( successFunction )
.fail( function ( code, data ) {
window.alert( data.error && data.error.info );
@@ -76,7 +77,8 @@
group: subgroupId
} );
- api.postWithToken( 'csrf', params )
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params )
.done( successFunction )
.fail( function ( code, data ) {
window.alert( data.error && data.error.info );
@@ -102,7 +104,8 @@
'do': 'remove'
} );
- api.postWithToken( 'csrf', params )
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params )
.done( successFunction )
.fail( function ( code, data ) {
window.alert( data.error && data.error.info );
@@ -143,7 +146,8 @@
format: 'json'
};
- api.postWithToken( 'csrf', params )
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params )
.done( successFunction )
.fail( function ( code, data ) {
window.alert( data.error.info );
@@ -354,7 +358,8 @@
format: 'json'
};
- api.postWithToken( 'csrf', params )
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params )
.done( successFunction )
.fail( function ( code, data ) {
window.alert( data.error && data.error.info );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.editor.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.editor.js 2016-09-06 16:30:41.438132100 +0000
@@ -434,7 +434,7 @@
$layoutActions,
$infoToggleIcon,
$messageList,
- targetLangAttrib, targetLangDir, targetLangCode,
+ targetLangAttrib, targetLangDir, targetLangCode, prefix,
$messageTools = translateEditor.createMessageTools(),
canTranslate = mw.translate.canTranslate();
@@ -815,28 +815,17 @@
);
if ( canTranslate ) {
- // BC for MW <= 1.26
-
- ( function () {
- if ( mw.loader.getState( 'jquery.accessKeyLabel' ) ) {
- return mw.loader.using( 'jquery.accessKeyLabel' ).then( function () {
- return $.fn.updateTooltipAccessKeys.getAccessKeyPrefix();
- } );
- }
-
- return $.Deferred().resolve( mw.util.tooltipAccessKeyPrefix );
- }() ).done( function ( prefix ) {
- $editorColumn.append( $( '<div>' )
- .addClass( 'row shortcutinfo' )
- .text( mw.msg(
- 'tux-editor-shortcut-info',
- ( prefix + 's' ).toUpperCase(),
- ( prefix + 'd' ).toUpperCase(),
- 'ALT',
- ( prefix + 'b' ).toUpperCase()
- ) )
- );
- } );
+ prefix = $.fn.updateTooltipAccessKeys.getAccessKeyPrefix();
+ $editorColumn.append( $( '<div>' )
+ .addClass( 'row shortcutinfo' )
+ .text( mw.msg(
+ 'tux-editor-shortcut-info',
+ ( prefix + 's' ).toUpperCase(),
+ ( prefix + 'd' ).toUpperCase(),
+ 'ALT',
+ ( prefix + 'b' ).toUpperCase()
+ ) )
+ );
}
return $editorColumn;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.pagemigration.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.pagemigration.js 2016-09-06 16:30:41.442132130 +0000
@@ -22,7 +22,8 @@
title = 'Translations:' + pageName + '/' + identifier + '/' + langCode;
summary = $( '#pm-summary' ).val();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'edit',
format: 'json',
watchlist: 'nochange',
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.proofread.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.proofread.js 2016-09-06 16:30:41.442132130 +0000
@@ -206,7 +206,8 @@
params.assert = 'user';
}
- api.postWithToken( 'csrf', params ).done( function () {
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params ).done( function () {
$message.find( '.tux-proofread-action' )
.removeClass( 'tux-warning' ) // in case, it failed previously
.addClass( 'accepted' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js 2016-09-06 16:30:41.442132130 +0000
@@ -31,7 +31,8 @@
options = $.extend( {}, { action: 'translatesandbox' }, options );
- return api.postWithToken( 'csrf', options )
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', options )
.promise();
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.special.translate.legacy.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.special.translate.legacy.js 2016-09-06 16:30:41.442132130 +0000
@@ -32,7 +32,8 @@
$b.val( mw.msg( 'translate-messagereview-progress' ) );
$b.prop( 'disabled', true );
- api.postWithToken( 'csrf', params ).done( successFunction ).fail( failFunction );
+ // Change to csrf when support for MW 1.26 is dropped
+ api.postWithToken( 'edit', params ).done( successFunction ).fail( failFunction );
} );
} );
}( jQuery, mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/Translate/resources/js/ext.translate.storage.js 2016-08-30 11:21:42.316196261 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/Translate/resources/js/ext.translate.storage.js 2016-09-06 16:30:41.442132130 +0000
@@ -24,7 +24,8 @@
save: function ( title, translation, editSummary ) {
var api = new mw.Api();
- return api.postWithToken( 'csrf', {
+ // Change to csrf when support for MW 1.26 is dropped
+ return api.postWithToken( 'edit', {
action: 'edit',
title: title,
text: translation,
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.PointerView.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.PointerView.js 2016-09-06 16:53:47.144883263 +0000
@@ -73,7 +73,7 @@
// and the extra space added on the right side of the pointer container used for correct
// restricting the pointer dragging area
getAdjustedLeftPositionWhenRtl: function ( pos ) {
- return this.getElement().offsetParent().width() - pos - 16 - 15;
+ return this.getElement().offsetParent().width() - pos - 16 - 18;
},
/**
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.SliderView.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.SliderView.js 2016-09-06 16:29:46.113705307 +0000
@@ -170,8 +170,8 @@
pointerContainerStyle = { right: pointerContainerPosition + 'px', width: pointerContainerWidth + 'px' };
}
$slider.css( {
- width: ( containerWidth + this.containerMargin ) + 'px'
- } )
+ width: ( containerWidth + this.containerMargin ) + 'px'
+ } )
.append(
this.backwardArrowButton.$element,
$( '<div>' )
@@ -283,6 +283,8 @@
* applied (blue border) which is not what is wanted. And generally setting a focus on disabled
* buttons does not seem right in case of RevisionSlider's arrow buttons.
* This method removes focus from the disabled button if such case happens.
+ *
+ * @param {jQuery.Event} e
*/
arrowFocusHandler: function ( e ) {
var button = e.data.button;
@@ -307,7 +309,7 @@
$clickedRev.data( 'revid' )
);
} else {
- pOld.setPosition( parseInt( $clickedRev.attr( 'data-pos' ), 10 ) ) ;
+ pOld.setPosition( parseInt( $clickedRev.attr( 'data-pos' ), 10 ) );
view.refreshRevisions(
$clickedRev.data( 'revid' ),
view.getRevElementAtPosition( $revisions, pNew.getPosition() ).data( 'revid' )
@@ -599,11 +601,11 @@
self.addRevisionsAtEnd( $slider, revs );
- /*jshint -W024 */
- if ( data.continue === undefined ) {
+ /* jshint -W024 */
+ if ( data.continue === undefined ) { // eslint-disable-line dot-notation
self.noMoreNewerRevisions = true;
}
- /*jshint +W024 */
+ /* jshint +W024 */
} );
},
@@ -640,11 +642,11 @@
}
self.addRevisionsAtStart( $slider, revs, precedingRevisionSize );
- /*jshint -W024 */
- if ( data.continue === undefined ) {
+ /* jshint -W024 */
+ if ( data.continue === undefined ) { // eslint-disable-line dot-notation
self.noMoreOlderRevisions = true;
}
- /*jshint +W024 */
+ /* jshint +W024 */
} );
},
@@ -777,6 +779,7 @@
/**
* @param {jQuery} $slider
+ * @return {boolean}
*/
shouldExpandSlider: function ( $slider ) {
var sliderWidth = parseInt( $slider.css( 'width' ), 10 ),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.DiffPage.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.DiffPage.js 2016-09-07 13:13:31.424291616 +0000
@@ -1,4 +1,6 @@
( function ( mw, $ ) {
+ /* global wikEd */
+
/**
* Module handling diff page reloading and the RevisionSlider browser history
*
@@ -50,6 +52,7 @@
$sidePanel = $( '#mw-panel' ),
$navigation = $( '#p-views' ),
$catLinks = $( '#catlinks' ),
+ $printFooter = $( '.printfooter' ),
scrollLeft = $container.find( '.mw-revslider-revisions-container' ).scrollLeft();
$data = $( data );
@@ -57,10 +60,25 @@
$navigation.replaceWith( $data.find( '#p-views' ) );
$catLinks.replaceWith( $data.find( '#catlinks' ) );
$sidePanel.replaceWith( $data.find( '#mw-panel' ) );
+ $printFooter.replaceWith( $data.find( '.printfooter' ) );
$contentText.html( $data.find( '#mw-content-text' ) )
.find( '.mw-revslider-revisions-container' ).scrollLeft( scrollLeft );
mw.hook( 'wikipage.content' ).fire( $contentText );
+
+ // In order to correctly interact with third-party code (extensions and gadgets)
+ // Revision slider should trigger some general (core) hook that other parties listen too
+ // Following wikEdDiff.js-specific code is deprecated and will be removed in the future.
+ // WikEdDiff should be updated to use a hook.
+ if ( self.wikEdDiffDetected() ) {
+ self.reInitWikEdDiff();
+ }
+
+ // Following code is deprecated and will be removed soon. Revision Slider should
+ // trigger general (core) hook instead of its own hook. Extensions do not have to
+ // be aware of Revision Slider to interact properly with it.
+ mw.hook( 'revslider.diffreload' ).fire( $contentText );
+
}, function ( xhr ) {
$( 'table.diff[data-mw="interface"]' ).removeClass( 'mw-revslider-diff-loading' );
if ( xhr.statusText !== 'abort' ) {
@@ -76,6 +94,16 @@
} );
},
+ wikEdDiffDetected: function () {
+ return typeof wikEd !== 'undefined' && $( 'meta[name=wikEdDiffSetupFlag]' ).length !== 0;
+ },
+
+ reInitWikEdDiff: function () {
+ $( 'meta[name=wikEdDiffSetupFlag]' ).remove();
+ $( 'meta[name=wikEdDiffStartupFlag]' ).remove();
+ wikEd.DiffSetup();
+ },
+
/**
* Replaces the current state in the history stack
*
@@ -118,6 +146,7 @@
* @param {number} revId1
* @param {number} revId2
* @param {SliderView} sliderView
+ * @return {Object}
*/
getStateObject: function ( revId1, revId2, sliderView ) {
return {
@@ -134,6 +163,7 @@
*
* @param {number} revId1
* @param {number} revId2
+ * @return {string}
*/
getStateUrl: function ( revId1, revId2 ) {
var url = mw.util.wikiScript( 'index' ) + '?diff=' + Math.max( revId1, revId2 ) + '&oldid=' + Math.min( revId1, revId2 ),
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.init.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.init.js 2016-09-06 16:29:46.113705307 +0000
@@ -1,9 +1,13 @@
( function ( mw, $ ) {
- var expanded = false,
+ var autoExpand = mw.user.options.get( 'userjs-revslider-autoexpand' ) === '1',
+ expanded = autoExpand,
initialized = false,
- /*jshint -W024 */
+ autoExpandButton,
+ /* eslint-disable dot-notation */
+ /* jshint -W024 */
toggleButton = OO.ui.ButtonWidget.static.infuse( $( '.mw-revslider-toggle-button' ) ),
- /*jshint +W024 */
+ /* jshint +W024 */
+ /* eslint-enable dot-notation */
initialize = function () {
var startTime = mw.now(),
api = new mw.libs.revisionSlider.Api( mw.util.wikiScript( 'api' ) );
@@ -61,6 +65,36 @@
mw.track( 'counter.MediaWiki.RevisionSlider.event.load' );
+ autoExpandButton = new OO.ui.ToggleButtonWidget( {
+ icon: 'pin',
+ classes: [ 'mw-revslider-auto-expand-button' ],
+ title: mw.message( autoExpand ?
+ 'revisionslider-turn-off-auto-expand-title' :
+ 'revisionslider-turn-on-auto-expand-title'
+ ).text(),
+ value: autoExpand
+ } );
+
+ autoExpandButton.connect( this, {
+ click: function () {
+ autoExpand = !autoExpand;
+ ( new mw.Api() ).saveOption( 'userjs-revslider-autoexpand', autoExpand ? '1' : '0' );
+ if ( autoExpand ) {
+ autoExpandButton.setTitle( mw.message( 'revisionslider-turn-off-auto-expand-title' ).text() );
+ mw.track( 'counter.MediaWiki.RevisionSlider.event.autoexpand.on' );
+ } else {
+ autoExpandButton.setTitle( mw.message( 'revisionslider-turn-on-auto-expand-title' ).text() );
+ mw.track( 'counter.MediaWiki.RevisionSlider.event.autoexpand.off' );
+ }
+ }
+ } );
+
+ $( '.mw-revslider-container' ).append( autoExpandButton.$element );
+
+ if ( autoExpand ) {
+ initialize();
+ }
+
toggleButton.connect( this, {
click: function () {
expanded = !expanded;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.RevisionListView.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.RevisionListView.js 2016-09-06 16:29:46.113705307 +0000
@@ -24,16 +24,6 @@
tooltipTimeout: -1,
/**
- * @type {OO.ui.PopupWidget}
- */
- currentTooltip: null,
-
- /**
- * @type {jQuery}
- */
- $highlightedRevisionWrapper: null,
-
- /**
* @param {number} revisionTickWidth
* @param {number} positionOffset
* @return {jQuery}
@@ -74,12 +64,13 @@
.addClass( diffSize > 0 ? 'mw-revslider-revision-up' : 'mw-revslider-revision-down' )
.append( $( '<div>' ).addClass( 'mw-revslider-revision-border-box' ) )
)
- .mouseover( showTooltip )
- .mouseout( hideTooltip )
+ .mouseenter( showTooltip )
+ .mouseleave( hideTooltip )
);
}
this.keepTooltipsOnHover();
+ this.closeTooltipsOnClick();
return $html;
},
@@ -105,11 +96,16 @@
* Hides the current tooltip immediately
*/
hideCurrentTooltip: function () {
- if ( this.tooltipTimeout !== -1 && this.$highlightedRevisionWrapper !== null ) {
+ var $highlightedRevisionWrapper = $( '.mw-revslider-revision-wrapper-hovered' ),
+ $currentTooltip = $( '.mw-revslider-revision-tooltip' );
+ if ( this.tooltipTimeout !== -1 ) {
window.clearTimeout( this.tooltipTimeout );
- this.$highlightedRevisionWrapper.removeClass( 'mw-revslider-revision-wrapper-hovered' );
- this.currentTooltip.toggle( false );
- this.currentTooltip.$element.remove();
+ }
+ if ( $highlightedRevisionWrapper.length !== 0 ) {
+ $highlightedRevisionWrapper.removeClass( 'mw-revslider-revision-wrapper-hovered' );
+ }
+ if ( $currentTooltip.length !== 0 ) {
+ $currentTooltip.remove();
}
},
@@ -119,14 +115,13 @@
* @param {jQuery} $rev
*/
hideTooltip: function ( $rev ) {
- var self = this;
+ var $currentTooltip = $( '.mw-revslider-revision-tooltip' );
this.tooltipTimeout = window.setTimeout( function () {
- if ( $rev !== null ) {
+ if ( $rev.length !== 0 ) {
$rev.removeClass( 'mw-revslider-revision-wrapper-hovered' );
}
- if ( self.currentTooltip !== null && self.currentTooltip.isVisible() ) {
- self.currentTooltip.toggle( false );
- self.currentTooltip.$element.remove();
+ if ( $currentTooltip.length !== 0 ) {
+ $currentTooltip.remove();
}
}, 500 );
},
@@ -144,6 +139,9 @@
if ( revision === null ) {
return;
}
+
+ this.hideCurrentTooltip();
+
tooltip = this.makeTooltip( revision );
tooltip.$element.css( {
left: $rev.offset().left + this.revisionWidth / 2 + 'px',
@@ -152,10 +150,7 @@
$( 'body' ).append( tooltip.$element );
tooltip.toggle( true );
- this.hideCurrentTooltip();
$rev.addClass( 'mw-revslider-revision-wrapper-hovered' );
- this.$highlightedRevisionWrapper = $rev;
- this.currentTooltip = tooltip;
},
/**
@@ -179,11 +174,26 @@
var self = this;
$( document )
- .on( 'mouseover', '.mw-revslider-revision-tooltip', function () {
+ .on( 'mouseenter', '.mw-revslider-revision-tooltip', function () {
window.clearTimeout( self.tooltipTimeout );
} )
- .on( 'mouseout', '.mw-revslider-revision-tooltip', function () {
- self.hideTooltip( self.$highlightedRevisionWrapper );
+ .on( 'mouseleave', '.mw-revslider-revision-tooltip', function () {
+ self.hideTooltip( $( '.mw-revslider-revision-wrapper-hovered' ) );
+ } );
+ },
+
+ /**
+ * Sets an event handler to close tooltips when clicking somewhere outside
+ */
+ closeTooltipsOnClick: function () {
+ var self = this;
+
+ $( document )
+ .on( 'click', function ( event ) {
+ if ( $( event.target ).closest( '.mw-revslider-revision-tooltip' ).length === 0 &&
+ $( event.target ).closest( '.mw-revslider-revisions-container' ).length === 0 ) {
+ self.hideCurrentTooltip();
+ }
} );
},
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.HelpDialog.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.HelpDialog.js 2016-09-06 16:29:46.113705307 +0000
@@ -1,6 +1,7 @@
( function ( mw, $ ) {
+ /* eslint-disable dot-notation */
// JSHint does not like OOJS' usage of "static" and "super"
- /*jshint -W024 */
+ /* jshint -W024 */
/**
* Module containing the RevisionSlider tutorial
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.Revision.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.Revision.js 2016-09-06 16:29:46.113705307 +0000
@@ -1,5 +1,5 @@
( function ( mw, $ ) {
- /*global moment:false */
+ /* global moment:false */
/**
* @param {Object} data - Containing keys `id`, `size`, `comment`, `parsedcomment`, `timestamp`, `user` and `minor`
* @constructor
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/modules/ext.RevisionSlider.Api.js 2016-08-30 11:20:53.223819921 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/modules/ext.RevisionSlider.Api.js 2016-09-06 16:29:46.109705275 +0000
@@ -20,6 +20,7 @@
* @param {number} [options.startId] Start ID
* @param {number} [options.endId] End ID
* @param {Object} [options.knownUserGenders] Known user genders
+ * @return {jQuery.Promise}
*/
fetchRevisionData: function ( pageName, options ) {
var xhr, userXhr,
@@ -31,9 +32,11 @@
xhr = this.fetchRevisions( pageName, options )
.done( function ( data ) {
var revs = data.query.pages[ 0 ].revisions,
- /*jshint -W024 */
+ /* eslint-disable dot-notation */
+ /* jshint -W024 */
revContinue = data.continue,
- /*jshint +W024 */
+ /* jshint +W024 */
+ /* eslint-enable dot-notation */
genderData = options.knownUserGenders || {},
userNames;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.Pointer.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.Pointer.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -15,4 +15,4 @@
assert.equal( pointer.getPosition(), pos );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.PointerView.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.PointerView.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -24,4 +24,4 @@
pv.getElement().addClass( 'mw-revslider-pointer-upper' );
assert.equal( pv.getOffset(), 16 );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.SliderView.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.SliderView.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -51,11 +51,11 @@
mw.config.values.extRevisionSliderOldRev = null;
mw.config.values.extRevisionSliderNewRev = null;
- assert.throws(
+ assert.throws( // eslint-disable-line dot-notation
function () {
view.render( $container );
}
);
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.HelpDialog.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.HelpDialog.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -40,4 +40,4 @@
);
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.Revision.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.Revision.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -107,5 +107,5 @@
assert.notOk( rev.hasEmptyComment() );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.Slider.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.Slider.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -15,9 +15,9 @@
QUnit.test( 'has revisions', function ( assert ) {
var revs = new RevisionList( [
- new Revision( { revid: 1 } ),
- new Revision( { revid: 2 } )
- ] ),
+ new Revision( { revid: 1 } ),
+ new Revision( { revid: 2 } )
+ ] ),
slider = new Slider( revs );
assert.equal( slider.getRevisions(), revs );
@@ -54,4 +54,4 @@
assert.equal( slider.getFirstVisibleRevisionIndex(), 0 );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.RevisionListView.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.RevisionListView.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -189,4 +189,4 @@
assert.ok( $pageSizeLineHtml.text().match( /1,337/ ) );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/QUnit.revisionSlider.testOrSkip.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/QUnit.revisionSlider.testOrSkip.js 2016-09-06 16:29:46.117705338 +0000
@@ -11,4 +11,4 @@
}
}
} );
-} )( jQuery );
+}( jQuery ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.RevisionList.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.RevisionList.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -39,10 +39,10 @@
QUnit.test( 'Push appends revisions to the end of the list', function ( assert ) {
var list = new RevisionList( [
- new Revision( { revid: 1, size: 5 } ),
- new Revision( { revid: 2, size: 21 } ),
- new Revision( { revid: 3, size: 13 } )
- ] ),
+ new Revision( { revid: 1, size: 5 } ),
+ new Revision( { revid: 2, size: 21 } ),
+ new Revision( { revid: 3, size: 13 } )
+ ] ),
revisions;
list.push( [
new Revision( { revid: 6, size: 19 } ),
@@ -117,7 +117,7 @@
new Revision( { revid: 3, size: 13 } ),
new Revision( { revid: 6, size: 19 } ),
new Revision( { revid: 8, size: 25 } )
- ] ),
+ ] ),
slicedList = list.slice( 1, 3 ),
revisions = slicedList.getRevisions();
@@ -148,10 +148,10 @@
QUnit.test( 'makeRevisions converts revision data into list of Revision objects', function ( assert ) {
var revs = [
- { revid: 1, size: 5, userGender: 'female' },
- { revid: 2, size: 21, userGender: 'unknown' },
- { revid: 3, size: 13 }
- ],
+ { revid: 1, size: 5, userGender: 'female' },
+ { revid: 2, size: 21, userGender: 'unknown' },
+ { revid: 3, size: 13 }
+ ],
revisions = makeRevisions( revs );
assert.equal( revisions[ 0 ].getId(), 1 );
@@ -161,4 +161,4 @@
assert.equal( revisions[ 2 ].getId(), 3 );
assert.equal( revisions[ 2 ].getSize(), 13 );
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/tests/qunit/RevisionSlider.DiffPage.test.js 2016-08-30 11:20:53.227819952 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/tests/qunit/RevisionSlider.DiffPage.test.js 2016-09-06 16:29:46.117705338 +0000
@@ -41,4 +41,4 @@
);
} );
-} )( mediaWiki );
+}( mediaWiki ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/RevisionSlider/Gruntfile.js 2016-08-30 11:20:53.219819890 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/RevisionSlider/Gruntfile.js 2016-09-06 16:29:46.105705245 +0000
@@ -1,12 +1,20 @@
-/*jshint node:true */
+/* jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
+ eslint: {
+ all: [
+ '*.js',
+ 'tests/**/*.js',
+ 'modules/**/*.js'
+ ]
+ },
jshint: {
options: {
jshintrc: true
@@ -38,6 +46,6 @@
}
} );
- grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'stylelint', 'banana' ] );
+ grunt.registerTask( 'test', [ 'eslint', 'jshint', 'jscs', 'jsonlint', 'stylelint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/CentralNotice/resources/subscribing/ext.centralNotice.geoIP.js 2016-08-30 11:18:35.662765405 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/CentralNotice/resources/subscribing/ext.centralNotice.geoIP.js 2016-09-08 23:37:48.340719257 +0000
@@ -1,21 +1,22 @@
/**
- * Process location data and set up window.Geo.
- * Provides mw.centralNotice.setWindowGeo().
+ * Processes location data and sets up a promise that resolves with that data.
+ * Sets the global window.Geo and provides the public mw.geoIP object.
+ * TODO Deprecate global window.Geo
* TODO Move this out of CentralNotice. See https://phabricator.wikimedia.org/T102848
*/
( function ( $, mw ) {
var COOKIE_NAME = 'GeoIP',
- GEOIP_LOOKUP_URL = '//geoiplookup.wikimedia.org/';
+ geoPromise;
/**
* Parse geo data in cookieValue and return an object with properties from
- * the fields therein. Returns null if the value couldn't be parsed.
+ * the fields therein. Returns null if the value couldn't be parsed or
+ * doesn't contain location data.
*
* The cookie will look like one of the following:
* - "US:CO:Denver:39.6762:-104.887:v4"
- * - ":::::v6"
- * - ""
+ * - ":::::v4"
*
* @param {string} cookieValue
* @return {?Object}
@@ -45,6 +46,12 @@
.concat( matches.slice( 2 ) );
}
+ // There was no info found if there's no country field, or if it's
+ // empty
+ if ( ( typeof matches[ 1 ] !== 'string' ) || ( matches[ 1 ].length === 0 ) ) {
+ return null;
+ }
+
// Return a juicy Geo object
return {
country: matches[ 1 ],
@@ -57,44 +64,21 @@
}
/**
- * Serialize geoObj to store it in the cookie.
- *
- * @param {Object} geoObj
- * @return {string}
+ * Serialize a geo object and store it in the cookie
+ * @param {Object} geo
*/
- function serializeCookieValue( geoObj ) {
-
+ function storeGeoInCookie( geo ) {
var parts = [
- geoObj.country,
- geoObj.region,
- ( geoObj.city && geoObj.city.replace( /[^a-z]/i, '_' ) ) || '',
- geoObj.lat,
- geoObj.lon,
- ( geoObj.IP && geoObj.IP.match( ':' ) ) ? 'v6' : 'v4'
- ];
-
- return parts.join( ':' );
- }
+ geo.country,
+ geo.region || '',
+ ( geo.city && geo.city.replace( /[^a-z]/i, '_' ) ) || '',
+ geo.lat || '',
+ geo.lon || '',
+ geo.af || ''
+ ],
+ cookieValue = parts.join( ':' );
- /**
- * Can we rely on this geo data?
- *
- * @param {Object} geoObj
- * @return {boolean}
- */
- function isGeoDataValid( geoObj ) {
- // - Ensure 'country' is set to detect whether the cookie was succesfully
- // parsed by parseCookieValue().
- // - Ensure 'country' is non-empty to detect empty values for when
- // geo lookup failed (typically on IPv6 connections). This check
- // is mandatory as otherwise the below code does not fallback to
- // geoiplookup.wikimedia.org (IPv4-powered).
- // - The check for geoObj.af !== 'vx' became mandatory in recent
- // refactoring to account for the temporary Geo value for during the
- // lookup request. It (or something similar) is necesssary.
- return ( typeof geoObj.country === 'string' &&
- geoObj.country.length > 0 &&
- geoObj.af !== 'vx' );
+ $.cookie( COOKIE_NAME, cookieValue, { path: '/' } );
}
/**
@@ -103,113 +87,84 @@
mw.geoIP = {
/**
- * Deferred object used to indicate when window.Geo is fully processed
- * @private
- */
- deferred: $.Deferred(),
-
- /**
- * Attempt to set window.Geo with data from the GeoIP cookie. If that fails,
- * make a background call that sets window.Geo, and attempt to set the
- * cookie.
+ * Don't call this function! It is only exposed for tests.
*
+ * Set a promise that resolves with geo. First try to get data from the
+ * GeoIP cookie. If that fails, and if a background lookup callback
+ * module is configured, try the background lookup.
* @private
*/
- setWindowGeo: function () {
+ makeGeoWithPromise: function () {
var cookieValue = $.cookie( COOKIE_NAME ),
- geoObj;
+ geo, deferred, lookupModule;
// Were we able to read the cookie?
if ( cookieValue ) {
- geoObj = parseCookieValue( cookieValue );
+ geo = parseCookieValue( cookieValue );
- // All good? Set window.Geo and get outta here.
- if ( geoObj && isGeoDataValid( geoObj ) ) {
- window.Geo = geoObj;
- mw.geoIP.deferred.resolve();
+ // All good? Resolve with geo and get outta here.
+ if ( geo ) {
+ deferred = $.Deferred();
+ geoPromise = deferred.promise();
+ deferred.resolve( geo );
return;
}
}
// Handle no geo data from the cookie.
- // First, set window.Geo to signal the lack of geo data.
- // TODO Is this really how we want to do this?
- // Note: This should coordinate with check for af !== 'vx' in
- // isGeoDataValid().
- window.Geo = {
- country: '',
- region: '',
- city: '',
- lat: '',
- lon: '',
- af: 'vx'
- };
-
- // Try to get geo data via a background request.
- // The WMF host used for this has no IPv6 address, so the request will
- // force dual-stack users to fall back to IPv4. This is intentional;
- // IPv4 lookups may succeed when a IPv6 one fails.
- $.ajax( {
- url: GEOIP_LOOKUP_URL,
- dataType: 'script',
- cache: true
- } ).always( function () {
-
- // The script should set window.Geo itself. Regardless of what
- // happened, we'll store the contents of window.Geo in a cookie...
- // If the call was unsuccessful, we'll just be storing the
- // invalid data, which should trigger another attempt next
- // time around. If it was successful and we have good data,
- // subsequent page views should trigger neither an IP lookup in
- // Varnish nor an AJAX request get the data.
-
- // Sanity check
- if ( !window.Geo || typeof window.Geo !== 'object' ) {
-
- mw.log.warn( 'window.Geo cleared or ' +
- 'incorrectly set by GeoIP lookup.' );
-
- mw.geoIP.deferred.reject();
- return;
- }
-
- if ( !isGeoDataValid( window.Geo ) ) {
- mw.geoIP.deferred.reject();
- return;
- }
-
- cookieValue = serializeCookieValue( window.Geo );
-
- // Update the cookie so we don't need to fetch it next time.
- // FIXME: This doesn't work in WMF production, because Varnish sets its initial
- // Geo cookie with a wildcard domain (e.g. '.wikipedia.org'). This avoids sending
- // the client a cookie for each domain. But, doesn't work with this function
- // because cookies vary on path and domain. This doesn't update the '.wikipedia.org'
- // cookie but creates a new 'en.wikipedia.org' cookie.
- // TODO: Update retreival code above to bypass $.cookie() and use document.cookie
- // directly to find the better entry instead of the first one. Both cookies will
- // be available through document.cookie.
- // http://blog.jasoncust.com/2012/01/problem-with-documentcookie.html
- $.cookie( COOKIE_NAME, cookieValue, { path: '/' } );
-
- mw.geoIP.deferred.resolve();
- } );
+ // If there's a background lookup to fall back to, do that
+ lookupModule =
+ mw.config.get( 'wgCentralNoticeGeoIPBackgroundLookupModule' );
+
+ if ( lookupModule ) {
+
+ geoPromise = mw.loader.using( lookupModule )
+
+ // require arg needed for debug mode to work TODO fixed?
+ .then( function ( require ) {
+ var lookupCallback = require( lookupModule );
+
+ // Chaining lookup: here, return the promise provided by
+ // lookupCallback(), so it controls the result of the
+ // new promise we get from then(). Also, the geo object
+ // returned by the lookup promise's then() handler will
+ // be passed on as an argument to the new promise's
+ // done() handlers.
+ return lookupCallback();
+ } );
+
+ // If the lookup was successful, store geo in a cookie
+ geoPromise.done( function ( geo ) {
+ storeGeoInCookie( geo );
+ } );
+
+ // If no background lookup is available, we don't have geo data
+ } else {
+ deferred = $.Deferred();
+ geoPromise = deferred.promise();
+ deferred.reject();
+ }
},
/**
- * Returns a promise that resolves when window.Geo is available. While
+ * Returns a promise that resolves with geo when it's available. While
* it's usually available right away, it may not be if a background
- * call is needed.
+ * call is performed.
*
* @return {jQuery.Promise}
*/
getPromise: function () {
- return mw.geoIP.deferred.promise();
+ return geoPromise;
}
};
- mw.geoIP.setWindowGeo();
+ mw.geoIP.makeGeoWithPromise();
+
+ // For legacy code, set global window.Geo TODO: deprecate
+ geoPromise.done( function ( geo ) {
+ window.Geo = geo;
+ } );
} )( jQuery, mediaWiki );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/CentralNotice/resources/subscribing/ext.centralNotice.display.state.js 2016-08-30 11:18:35.662765405 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/CentralNotice/resources/subscribing/ext.centralNotice.display.state.js 2016-09-08 23:37:48.340719257 +0000
@@ -108,10 +108,9 @@
state.data.uselang = mw.config.get( 'wgUserLanguage' );
state.data.device = urlParams.device || getDeviceCode();
- // data.country may already have been set, if setInvalidGeoData() was
- // called
+ // data.country should already have been set
state.data.country = urlParams.country || state.data.country ||
- ( window.Geo && window.Geo.country ) || UNKNOWN_COUNTRY_CODE;
+ UNKNOWN_COUNTRY_CODE;
// Some parameters should get through even if they have falsey values
state.data.debug = urlParams.debug !== undefined ? true : false;
@@ -176,8 +175,16 @@
banner: null,
/**
+ * Call this with geo data before calling setUp() or
+ * setUpForTestingBanner().
+ */
+ setGeoData: function ( geo ) {
+ state.data.country = ( geo && geo.country );
+ },
+
+ /**
* Call this before calling setUp() or setUpForTestingBanner()
- * if window.Geo is known to be invalid.
+ * if valid geo data is not available.
*/
setInvalidGeoData: function () {
state.data.country = UNKNOWN_COUNTRY_CODE;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/CentralNotice/resources/subscribing/ext.centralNotice.display.js 2016-08-30 11:18:35.662765405 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/CentralNotice/resources/subscribing/ext.centralNotice.display.js 2016-09-08 23:37:48.340719257 +0000
@@ -504,6 +504,7 @@
mw.geoIP.getPromise()
.fail( cn.internal.state.setInvalidGeoData )
+ .done( cn.internal.state.setGeoData )
.always( reallyChooseAndMaybeDisplay );
},
@@ -513,6 +514,7 @@
// campaign and banner.
mw.geoIP.getPromise()
.fail( cn.internal.state.setInvalidGeoData )
+ .done( cn.internal.state.setGeoData )
.always( function () {
cn.internal.state.setUpForTestingBanner();
setUpDataProperty();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/CentralNotice/tests/qunit/subscribing/ext.centralNotice.display.tests.js 2016-08-30 11:18:35.666765436 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/CentralNotice/tests/qunit/subscribing/ext.centralNotice.display.tests.js 2016-09-08 23:37:48.340719257 +0000
@@ -3,7 +3,6 @@
'use strict';
var realAjax = $.ajax,
- realWindowGeo = window.Geo,
realGeoIP = mw.geoIP,
realBucketCookie = $.cookie( 'CN' ),
realHideCookie = $.cookie( 'centralnotice_hide_fundraising' ),
@@ -146,12 +145,12 @@
'<div id=siteNotice><div id=centralNotice></div></div>'
);
- // Mock window.Geo object and mw.geoIP
- window.Geo = {};
+ // Mock mw.geoIP
mw.geoIP = {
getPromise: function () {
var deferred = $.Deferred();
- deferred.resolve();
+ // Resolve with minimal valid geo object
+ deferred.resolve( { country: 'AQ' } );
return deferred.promise();
}
};
@@ -164,10 +163,6 @@
mw.centralNotice.internal.state.data = {};
mw.centralNotice.internal.state.campaign = null;
mw.centralNotice.internal.state.banner = null;
-
- if ( typeof realWindowGeo !== 'undefined' ) {
- window.Geo = realWindowGeo;
- }
}
} ) );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/CentralNotice/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js 2016-08-30 11:18:35.666765436 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/CentralNotice/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js 2016-09-08 23:37:48.340719257 +0000
@@ -4,7 +4,7 @@
var
COOKIE_NAME = 'GeoIP',
BAD_COOKIE = 'asdfasdf',
- UNKNOWN_IPV6_COOKIE = ':::::v6',
+ UNKNOWN_COOKIE = ':::::v4',
GOOD_COOKIE = 'US:CO:Denver:39.6762:-104.887:v4',
GOOD_GEO = {
af: 'v4',
@@ -14,94 +14,49 @@
lon: -104.887,
region: 'CO'
},
- realAjax = $.ajax,
- realCookie = $.cookie( COOKIE_NAME ),
- realDeferred = mw.geoIP.deferred,
- realGeo = window.Geo;
+ realCookie = $.cookie( COOKIE_NAME );
QUnit.module( 'ext.centralNotice.geoIP', QUnit.newMwEnvironment( {
teardown: function () {
- $.ajax = realAjax;
// This cookie is always set to '/' in prod and should be here too.
// If a cookie of the same name is set without a path it may be
// found first by the jquery getter and will screw some behaviors
// up until it is removed.
$.cookie( COOKIE_NAME, realCookie, { path: '/' } );
- mw.geoIP.deferred = realDeferred;
- window.Geo = realGeo;
}
} ) );
- QUnit.test( 'parse geo from valid cookie', 2, function ( assert ) {
- var madeAjaxCall = false;
+ QUnit.test( 'parse geo from valid cookie', 1, function ( assert ) {
$.cookie( COOKIE_NAME, GOOD_COOKIE, { path: '/' } );
- mw.geoIP.deferred = $.Deferred();
- window.Geo = null;
- $.ajax = function () {
- madeAjaxCall = true;
- return $.Deferred().resolve().promise();
- };
-
- mw.geoIP.setWindowGeo();
- mw.geoIP.getPromise().then( function () {
- assert.equal( madeAjaxCall, false, 'no ajax call if cookie was valid' );
- assert.deepEqual( window.Geo, GOOD_GEO, 'good geo was set' );
+ mw.geoIP.makeGeoWithPromise();
+ return mw.geoIP.getPromise().then( function ( geo ) {
+ assert.deepEqual( geo, GOOD_GEO, 'parsed geo' );
+ }, function () {
+ // Message to show when promise fails
+ return 'geo not retrieved';
} );
} );
- QUnit.test( 'restore geo if cookie is invalid', 3, function ( assert ) {
- // Break the cookie. This should kill window.Geo
+ QUnit.test( 'cookie invalid', 1, function ( assert ) {
$.cookie( COOKIE_NAME, BAD_COOKIE, { path: '/' } );
- mw.geoIP.deferred = $.Deferred();
- window.Geo = null;
- // setWindowGeo() should make an ajax call that restores window.Geo
- $.ajax = function () {
- assert.equal( window.Geo.af, 'vx', 'geo filled with vx' );
- window.Geo = GOOD_GEO;
- return $.Deferred().resolve().promise();
- };
-
- mw.geoIP.setWindowGeo();
- mw.geoIP.getPromise().then( function () {
- assert.equal( $.cookie( COOKIE_NAME ), GOOD_COOKIE, 'cookie was restored' );
- assert.deepEqual( window.Geo, GOOD_GEO, 'good geo was restored' );
+ mw.geoIP.makeGeoWithPromise();
+ mw.geoIP.getPromise().fail( function () {
+ assert.ok( true, 'geoIP promise fails' );
+ } ).done( function () {
+ assert.ok( false, 'geoIP promise fails' );
} );
} );
- QUnit.test( 'geo info unavailable', 2, function ( assert ) {
- $.cookie( COOKIE_NAME, BAD_COOKIE, { path: '/' } );
- mw.geoIP.deferred = $.Deferred();
- window.Geo = null;
-
- $.ajax = function () {
- // Mock failed call, don't reset geo.
- return $.Deferred().reject().promise();
- };
+ QUnit.test( 'cookie valid but unknown location', 1, function ( assert ) {
+ $.cookie( COOKIE_NAME, UNKNOWN_COOKIE, { path: '/' } );
- mw.geoIP.setWindowGeo();
+ mw.geoIP.makeGeoWithPromise();
mw.geoIP.getPromise().fail( function () {
- assert.equal( $.cookie( COOKIE_NAME ), BAD_COOKIE, 'cookie unchanged' );
- assert.equal( window.Geo.af, 'vx', 'vx geo was set' );
- } );
- } );
-
- QUnit.test( 'unknown ipv6 cookie', 3, function ( assert ) {
- $.cookie( COOKIE_NAME, UNKNOWN_IPV6_COOKIE, { path: '/' } );
- mw.geoIP.deferred = $.Deferred();
- window.Geo = null;
-
- $.ajax = function () {
- assert.equal( window.Geo.af, 'vx', 'geo filled with vx' );
- window.Geo = GOOD_GEO;
- return $.Deferred().resolve().promise();
- };
-
- mw.geoIP.setWindowGeo();
- mw.geoIP.getPromise().done( function () {
- assert.equal( $.cookie( COOKIE_NAME ), GOOD_COOKIE, 'cookie updated' );
- assert.deepEqual( window.Geo, GOOD_GEO, 'good geo was loaded' );
+ assert.ok( true, 'geoIP promise fails' );
+ } ).done( function () {
+ assert.ok( false, 'geoIP promise fails' );
} );
} );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 2016-08-30 11:22:17.184463561 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 2016-09-06 16:31:20.166430859 +0000
@@ -194,13 +194,38 @@
*/
ve.init.mw.ArticleTarget.prototype.setMode = function ( mode ) {
if ( mode !== this.mode ) {
- $( '#ca-ve-edit' ).toggleClass( 'selected', mode === 'visual' );
- $( '#ca-edit' ).toggleClass( 'selected', mode === 'source' );
this.mode = mode;
+ this.updateTabs( true );
}
};
/**
+ * Update state of editing tabs
+ */
+ve.init.mw.ArticleTarget.prototype.updateTabs = function ( editing ) {
+ var selectVe = false,
+ selectEdit = false;
+
+ // Deselect current mode (e.g. "view" or "history"). In skins like monobook that don't have
+ // separate tab sections for content actions and namespaces the below is a no-op.
+ $( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
+
+ if ( editing ) {
+ if ( $( '#ca-ve-edit' ).length ) {
+ selectVe = this.mode === 'visual';
+ selectEdit = this.mode === 'source';
+ } else {
+ // Single edit tab
+ selectEdit = true;
+ }
+ } else {
+ $( '#ca-view' ).addClass( 'selected' );
+ }
+ $( '#ca-ve-edit' ).toggleClass( 'selected', selectVe );
+ $( '#ca-edit' ).toggleClass( 'selected', selectEdit );
+};
+
+/**
* Handle response to a successful load request.
*
* This method is called within the context of a target instance. If successful the DOM from the
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js 2016-08-30 11:22:17.184463561 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js 2016-09-06 16:31:20.166430859 +0000
@@ -113,7 +113,7 @@
}
},
- requestParsoidData: function ( pageName, oldid, targetName, modified ) {
+ requestParsoidData: function ( pageName, oldid, targetName, modified, wikitext ) {
var start, apiXhr, restbaseXhr, apiPromise, restbasePromise, dataPromise, pageHtmlUrl,
switched = false,
fromEditedState = false,
@@ -151,7 +151,7 @@
ve.track( 'trace.restbaseLoad.enter' );
if (
conf.fullRestbaseUrl &&
- $( '#wpTextbox1' ).textSelection( 'getContents' ) &&
+ ( wikitext || ( wikitext = $( '#wpTextbox1' ).textSelection( 'getContents' ) ) ) &&
!$( '[name=wpSection]' ).val()
) {
switched = true;
@@ -166,7 +166,7 @@
data: {
title: pageName,
oldid: oldid,
- wikitext: $( '#wpTextbox1' ).textSelection( 'getContents' ),
+ wikitext: wikitext,
stash: 'true'
},
// Should be synchronised with ApiVisualEditor.php
@@ -196,9 +196,6 @@
duration: ve.now() - start,
targetName: targetName
} );
- mw.track( 'event.VET135171', {
- msg: 'getResponseHeader: ' + jqxhr.getResponseHeader( 'etag' )
- } );
return [ data, jqxhr.getResponseHeader( 'etag' ) ];
},
function ( response ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 2016-08-30 11:22:17.180463531 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 2016-09-06 16:31:20.162430827 +0000
@@ -24,6 +24,9 @@
pageCanLoadVE, init, targetPromise, enable, tempdisable, autodisable,
tabPreference, userPrefEnabled, userPrefPreferShow, initialWikitext, oldid,
onlyTabIsVE, isLoading,
+ editModes = {
+ edit: 'visual'
+ },
active = false,
targetLoaded = false,
progressStep = 0,
@@ -34,6 +37,10 @@
],
plugins = [];
+ if ( mw.config.get( 'wgVisualEditorConfig' ).enableWikitext ) {
+ editModes.editsource = 'source';
+ }
+
function showLoading() {
var $content, contentRect, offsetTop, windowHeight, top, bottom, middle;
@@ -152,18 +159,6 @@
target = ve.init.mw.targetFactory.create(
conf.contentModels[ mw.config.get( 'wgPageContentModel' ) ]
);
- target.connect( this, {
- transformPage: function () {
- if ( onlyTabIsVE ) {
- $( '#ca-edit' ).addClass( 'selected' );
- }
- },
- restorePage: function () {
- if ( onlyTabIsVE ) {
- $( '#ca-edit' ).removeClass( 'selected' );
- }
- }
- } );
target.setContainer( $( '#content' ) );
targetLoaded = true;
return target;
@@ -188,7 +183,7 @@
trackActivateStart( { type: 'page', mechanism: 'click' } );
if ( !active ) {
- if ( uri.query.action !== 'edit' && uri.query.veaction !== 'edit' && uri.query.veaction !== 'editsource' ) {
+ if ( uri.query.action !== 'edit' && !( uri.query.veaction in editModes ) ) {
if ( history.pushState ) {
// Replace the current state with one that is tagged as ours, to prevent the
// back button from breaking when used to exit VE. FIXME: there should be a better
@@ -648,7 +643,7 @@
trackActivateStart( { type: 'section', mechanism: 'click' } );
- if ( history.pushState && uri.query.veaction !== 'edit' && uri.query.veaction !== 'editsource' ) {
+ if ( history.pushState && !( uri.query.veaction in editModes ) ) {
// Replace the current state with one that is tagged as ours, to prevent the
// back button from breaking when used to exit VE. FIXME: there should be a better
// way to do this. See also similar code in the DesktopArticleTarget constructor.
@@ -782,7 +777,7 @@
) {
if (
// … if on a ?veaction=edit page
- ( isViewPage && ( uri.query.veaction === 'edit' || uri.query.veaction === 'editsource' ) ) ||
+ ( isViewPage && uri.query.veaction in editModes ) ||
// … or if on ?action=edit in single edit mode and the user wants it
(
isEditPage &&
@@ -812,7 +807,7 @@
type: uri.query.vesection === undefined ? 'page' : 'section',
mechanism: 'url'
} );
- activateTarget( uri.query.veaction === 'editsource' ? 'source' : 'visual' );
+ activateTarget( editModes[ uri.query.veaction ] );
} else if ( pageCanLoadVE && userPrefEnabled ) {
// Page can be edited in VE, parameters are good, user prefs are mostly good
// but have visualeditor-tabs=prefer-wt? Add a keyboard shortcut to go to
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js 2016-08-30 11:22:17.184463561 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js 2016-09-06 16:31:20.166430859 +0000
@@ -43,16 +43,6 @@
/**
* @inheritdoc
*/
-ve.init.mw.DesktopWikitextArticleTarget.prototype.restorePage = function () {
- $( '#ca-edit' ).removeClass( 'selected' );
-
- // Parent method
- ve.init.mw.DesktopWikitextArticleTarget.super.prototype.restorePage.apply( this, arguments );
-};
-
-/**
- * @inheritdoc
- */
ve.init.mw.DesktopWikitextArticleTarget.prototype.switchToWikitextEditor = function ( discardChanges, modified ) {
var dataPromise,
target = this;
@@ -75,19 +65,68 @@
this.reloadSurface( dataPromise );
};
+/**
+ * Switch to the visual editor.
+ */
ve.init.mw.DesktopWikitextArticleTarget.prototype.switchToVisualEditor = function () {
+ var dataPromise;
+
this.setMode( 'visual' );
- this.reloadSurface();
+
+ dataPromise = mw.libs.ve.targetLoader.requestParsoidData(
+ this.pageName,
+ this.revid,
+ this.constructor.name,
+ this.edited,
+ this.getWikitextFromDocument( this.getSurface().getDom() )
+ );
+
+ this.reloadSurface( dataPromise );
+};
+
+/**
+ * @inheritdoc
+ */
+ve.init.mw.DesktopWikitextArticleTarget.prototype.onWindowPopState = function ( e ) {
+ var veaction, mode;
+
+ if ( !this.verifyPopState( e.state ) ) {
+ return;
+ }
+
+ // Parent method
+ ve.init.mw.DesktopWikitextArticleTarget.super.prototype.onWindowPopState.apply( this, arguments );
+
+ veaction = this.currentUri.query.veaction;
+ mode = veaction === 'editsource' ? 'source' : 'visual';
+
+ if ( this.active ) {
+ if ( veaction === 'editsource' && this.mode === 'visual' ) {
+ this.actFromPopState = true;
+ this.switchToWikitextEditor();
+ } else if ( veaction === 'edit' && this.mode === 'source' ) {
+ this.actFromPopState = true;
+ this.switchToVisualEditor();
+ }
+ }
};
+/**
+ * Reload the target surface in the new editor mode
+ */
ve.init.mw.DesktopWikitextArticleTarget.prototype.reloadSurface = function ( dataPromise ) {
var target = this;
// Create progress - will be discarded when surface is destroyed.
- this.getSurface().createProgress( $.Deferred().promise() );
+ this.getSurface().createProgress(
+ $.Deferred().promise(),
+ ve.msg( this.mode === 'source' ? 'visualeditor-mweditmodesource-progress' : 'visualeditor-mweditmodeve-progress' ),
+ true /* non-cancellable */
+ );
this.activating = true;
this.activatingDeferred = $.Deferred();
this.load( dataPromise );
this.activatingDeferred.done( function () {
+ target.updateHistoryState();
target.afterActivate();
target.setupTriggerListeners();
} );
@@ -228,7 +267,7 @@
if ( this.mode === 'source' ) {
data = ve.extendObject( {}, options, { format: 'json' } );
- data.wikitext = Array.prototype.map.call( doc.body.children, function ( p ) { return p.innerText; } ).join( '\n' );
+ data.wikitext = this.getWikitextFromDocument( doc );
return new mw.Api().post( data, { contentType: 'multipart/form-data' } );
} else {
@@ -237,6 +276,16 @@
}
};
+/**
+ * Get wikitext for the whole document
+ *
+ * @param {ve.dm.Document} doc Document
+ * @return {string} Wikitext
+ */
+ve.init.mw.DesktopWikitextArticleTarget.prototype.getWikitextFromDocument = function ( doc ) {
+ return Array.prototype.map.call( doc.body.children, function ( p ) { return p.innerText; } ).join( '\n' );
+};
+
/* Registration */
ve.init.mw.targetFactory.register( ve.init.mw.DesktopWikitextArticleTarget );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 2016-08-30 11:22:17.184463561 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 2016-09-06 16:31:20.166430859 +0000
@@ -765,8 +765,9 @@
* Add the redirect header when a redirect is inserted into the page.
*
* @param {ve.dm.MetaItem} metaItem Item that was inserted
+ * @param {boolean} [loading=false] Whether VE is loading.
*/
-ve.init.mw.DesktopArticleTarget.prototype.onMetaItemInserted = function ( metaItem ) {
+ve.init.mw.DesktopArticleTarget.prototype.onMetaItemInserted = function ( metaItem, loading ) {
var title, target, $link;
if ( metaItem.getType() === 'mwRedirect' ) {
target = this;
@@ -776,6 +777,10 @@
.text( title );
ve.init.platform.linkCache.styleElement( title, $link );
+ if ( loading ) {
+ this.$originalRedirectMsg = $( '.redirectMsg' ).clone();
+ this.$originalRedirectSub = $( '#redirectsub, #redirectsub + br' ).clone();
+ }
// Add redirect target header
if ( !$( '#redirectsub' ).length ) {
$( '#contentSub' ).append(
@@ -785,7 +790,6 @@
$( '<br>' )
);
}
- this.$originalContent.find( '.redirectMsg' ).remove();
$( '<div>' )
// Bit of a hack: Make sure any redirect note is styled
.addClass( 'redirectMsg mw-content-' + $( 'html' ).attr( 'dir' ) )
@@ -1173,12 +1177,9 @@
* Page modifications for switching to edit mode.
*/
ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () {
- var uri, $content;
+ var $content;
- // Deselect current mode (e.g. "view" or "history"). In skins like monobook that don't have
- // separate tab sections for content actions and namespaces the below is a no-op.
- $( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
- $( '#ca-ve-edit' ).addClass( 'selected' );
+ this.updateTabs( true );
this.emit( 'transformPage' );
mw.hook( 've.activate' ).fire();
@@ -1196,13 +1197,22 @@
// Support IE9: Disable links
$( '.ve-init-mw-desktopArticleTarget-uneditableContent' ).on( 'click.ve-target', function () { return false; } );
- // Push veaction=edit url in history (if not already. If we got here by a veaction=edit
+ this.updateHistoryState();
+};
+
+/**
+ * Update the history state based on the editor mode
+ */
+ve.init.mw.DesktopArticleTarget.prototype.updateHistoryState = function () {
+ var uri,
+ veaction = this.mode === 'visual' ? 'edit' : 'editsource';
+
+ // Push veaction=edit(source) url in history (if not already. If we got here by a veaction=edit(source)
// permalink then it will be there already and the constructor called #activate)
if (
!this.actFromPopState &&
history.pushState &&
- this.currentUri.query.veaction !== 'edit' &&
- this.currentUri.query.veaction !== 'editsource' &&
+ this.currentUri.query.veaction !== veaction &&
this.currentUri.query.action !== 'edit'
) {
// Set the current URL
@@ -1215,7 +1225,7 @@
uri.query.action = 'edit';
mw.config.set( 'wgAction', 'edit' );
} else {
- uri.query.veaction = 'edit';
+ uri.query.veaction = veaction;
delete uri.query.action;
mw.config.set( 'wgAction', 'view' );
}
@@ -1234,11 +1244,21 @@
// Skins like monobook don't have a tab for view mode and instead just have the namespace tab
// selected. We didn't deselect the namespace tab, so we're ready after deselecting #ca-ve-edit.
// In skins having #ca-view (like Vector), select that.
- $( '#ca-ve-edit' ).removeClass( 'selected' );
- $( '#ca-view' ).addClass( 'selected' );
+ this.updateTabs( false );
// Remove any VE-added redirectMsg
- $( '.mw-body-content > .ve-redirect-header' ).remove();
+ if ( $( '.mw-body-content > .ve-redirect-header' ).length ) {
+ $( '.mw-body-content > .ve-redirect-header' ).remove();
+ $( '#contentSub #redirectSub, #contentSub #redirectSub + br' ).remove();
+ }
+
+ // Restore any previous redirectMsg/redirectsub
+ if ( this.$originalRedirectMsg ) {
+ this.$originalRedirectMsg.prependTo( $( '#mw-content-text' ) );
+ this.$originalRedirectSub.prependTo( $( '#contentSub' ) );
+ this.$originalRedirectMsg = undefined;
+ this.$originalRedirectSub = undefined;
+ }
mw.hook( 've.deactivate' ).fire();
this.emit( 'restorePage' );
@@ -1271,14 +1291,13 @@
history.pushState( this.popState, document.title, uri );
}
}
- this.actFromPopState = false;
};
/**
* @param {Event} e Native event object
*/
ve.init.mw.DesktopArticleTarget.prototype.onWindowPopState = function ( e ) {
- var newUri;
+ var newUri, veaction;
if ( !this.verifyPopState( e.state ) ) {
// Ignore popstate events fired for states not created by us
@@ -1287,12 +1306,13 @@
}
newUri = this.currentUri = new mw.Uri( location.href );
+ veaction = newUri.query.veaction;
- if ( !this.active && newUri.query.veaction === 'edit' ) {
+ if ( !this.active && ( veaction === 'edit' || veaction === 'editsource' ) ) {
this.actFromPopState = true;
this.activate();
}
- if ( this.active && newUri.query.veaction !== 'edit' ) {
+ if ( this.active && veaction !== 'edit' && veaction !== 'editsource' ) {
this.actFromPopState = true;
this.deactivate( false, 'navigate-back' );
}
@@ -1333,6 +1353,8 @@
}
// Remove any VE-added ve-redirect-header
$( '.redirectMsg' ).removeClass( 've-redirect-header' );
+ this.$originalRedirectMsg = undefined;
+ this.$originalRedirectSub = undefined;
// Re-set any edit section handlers now that the page content has been replaced
if (
@@ -1446,7 +1468,7 @@
redirectMetaItems = this.getSurface().getModel().getMetaList().getItemsInGroup( 'mwRedirect' );
if ( redirectMetaItems.length ) {
- this.onMetaItemInserted( redirectMetaItems[ 0 ] );
+ this.onMetaItemInserted( redirectMetaItems[ 0 ], true );
windowAction = ve.ui.actionFactory.create( 'window', this.getSurface() );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/annotations/ve.ce.MWNowikiAnnotation.js 2016-08-30 11:22:17.124463102 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/annotations/ve.ce.MWNowikiAnnotation.js 2016-09-06 16:31:20.058430024 +0000
@@ -14,9 +14,9 @@
* @param {ve.dm.MWNowikiAnnotation} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWNowikiAnnotation = function VeCeMWNowikiAnnotation( model, config ) {
+ve.ce.MWNowikiAnnotation = function VeCeMWNowikiAnnotation() {
// Parent constructor
- ve.ce.Annotation.call( this, model, config );
+ ve.ce.MWNowikiAnnotation.super.apply( this, arguments );
// DOM changes
this.$element.addClass( 've-ce-mwNowikiAnnotation' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -33,9 +33,9 @@
* @param {ve.dm.MWSignatureNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWSignatureNode = function VeCeMWSignatureNode( model ) {
+ve.ce.MWSignatureNode = function VeCeMWSignatureNode() {
// Parent constructor
- ve.ce.MWTransclusionInlineNode.call( this, model );
+ ve.ce.MWSignatureNode.super.apply( this, arguments );
// DOM changes
this.$element.addClass( 've-ce-mwSignatureNode' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWMagicLinkNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWMagicLinkNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -15,9 +15,9 @@
* @param {ve.dm.MWMagicLinkNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWMagicLinkNode = function VeCeMWMagicLinkNode( model, config ) {
+ve.ce.MWMagicLinkNode = function VeCeMWMagicLinkNode() {
// Parent constructor
- ve.ce.LeafNode.call( this, model, config );
+ ve.ce.MWMagicLinkNode.super.apply( this, arguments );
// Mixin constructors
ve.ce.FocusableNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWEntityNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWEntityNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -14,9 +14,9 @@
* @param {ve.dm.MWEntityNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWEntityNode = function VeCeMWEntityNode( model, config ) {
+ve.ce.MWEntityNode = function VeCeMWEntityNode() {
// Parent constructor
- ve.ce.LeafNode.call( this, model, config );
+ ve.ce.MWEntityNode.super.apply( this, arguments );
// DOM changes
this.$element.addClass( 've-ce-mwEntityNode' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -14,9 +14,9 @@
* @param {ve.dm.MWImageCaptionNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWImageCaptionNode = function VeCeMWImageCaptionNode( model, config ) {
+ve.ce.MWImageCaptionNode = function VeCeMWImageCaptionNode() {
// Parent constructor
- ve.ce.BranchNode.call( this, model, config );
+ ve.ce.MWImageCaptionNode.super.apply( this, arguments );
};
/* Inheritance */
@@ -46,7 +46,7 @@
}
// Parent method
- ve.ce.BranchNode.prototype.onSplice.apply( this, arguments );
+ ve.ce.MWImageCaptionNode.super.prototype.onSplice.apply( this, arguments );
// Reset the magnify icon, prepend it to the caption
this.$magnify.prependTo( this.$element );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWPreformattedNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWPreformattedNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -14,9 +14,9 @@
* @param {ve.dm.MWPreformattedNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWPreformattedNode = function VeCeMWPreformattedNode( model, config ) {
+ve.ce.MWPreformattedNode = function VeCeMWPreformattedNode() {
// Parent constructor
- ve.ce.PreformattedNode.call( this, model, config );
+ ve.ce.MWPreformattedNode.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -16,10 +16,10 @@
* @param {ve.dm.MWInlineImageNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode( model, config ) {
+ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode() {
var isError;
// Parent constructor
- ve.ce.LeafNode.call( this, model, config );
+ ve.ce.MWInlineImageNode.super.apply( this, arguments );
isError = this.model.getAttribute( 'isError' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -15,9 +15,9 @@
* @param {ve.dm.MWNumberedExternalLinkNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWNumberedExternalLinkNode = function VeCeMWNumberedExternalLinkNode( model, config ) {
+ve.ce.MWNumberedExternalLinkNode = function VeCeMWNumberedExternalLinkNode() {
// Parent constructor
- ve.ce.LeafNode.call( this, model, config );
+ ve.ce.MWNumberedExternalLinkNode.super.apply( this, arguments );
// Mixin constructors
ve.ce.FocusableNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js 2016-08-30 11:22:17.124463102 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js 2016-09-06 16:31:20.058430024 +0000
@@ -16,11 +16,11 @@
* @param {ve.dm.MWBlockImageNode} model Model to observe
* @param {Object} [config] Configuration options
*/
-ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode( model, config ) {
+ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode() {
var type, align, isError;
// Parent constructor
- ve.ce.BranchNode.call( this, model, config );
+ ve.ce.MWBlockImageNode.super.apply( this, arguments );
type = this.model.getAttribute( 'type' );
align = this.model.getAttribute( 'align' );
@@ -256,7 +256,7 @@
*/
ve.ce.MWBlockImageNode.prototype.onSetup = function () {
// Parent method
- ve.ce.BranchNode.prototype.onSetup.call( this );
+ ve.ce.MWBlockImageNode.super.prototype.onSetup.call( this );
this.updateClasses();
};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTransclusionContentModel.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTransclusionContentModel.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWTransclusionContentModel = function VeDmMWTransclusionContentModel( transclusion, value ) {
// Parent constructor
- ve.dm.MWTransclusionPartModel.call( this, transclusion );
+ ve.dm.MWTransclusionContentModel.super.call( this, transclusion );
// Properties
this.value = value || '';
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js 2016-09-06 16:31:20.066430087 +0000
@@ -19,7 +19,7 @@
*/
ve.dm.MWTemplateModel = function VeDmMWTemplateModel( transclusion, target ) {
// Parent constructor
- ve.dm.MWTransclusionPartModel.call( this, transclusion );
+ ve.dm.MWTemplateModel.super.call( this, transclusion );
// Properties
this.target = target;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js 2016-09-06 16:31:20.066430087 +0000
@@ -14,9 +14,9 @@
* @constructor
* @param {ve.dm.MWTransclusionModel} transclusion Transclusion
*/
-ve.dm.MWTemplatePlaceholderModel = function VeDmMWTemplatePlaceholderModel( transclusion ) {
+ve.dm.MWTemplatePlaceholderModel = function VeDmMWTemplatePlaceholderModel() {
// Parent constructor
- ve.dm.MWTransclusionPartModel.call( this, transclusion );
+ ve.dm.MWTemplatePlaceholderModel.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWIndexDisableMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWIndexDisableMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWIndexDisableMetaItem = function VeDmMWIndexDisableMetaItem( element ) {
+ve.dm.MWIndexDisableMetaItem = function VeDmMWIndexDisableMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWIndexDisableMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWRedirectMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWRedirectMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWRedirectMetaItem = function VeDmMWRedirectMetaItem( element ) {
+ve.dm.MWRedirectMetaItem = function VeDmMWRedirectMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWRedirectMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNewSectionEditDisableMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNewSectionEditDisableMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNewSectionEditDisableMetaItem = function VeDmMWNewSectionEditDisableMetaItem( element ) {
+ve.dm.MWNewSectionEditDisableMetaItem = function VeDmMWNewSectionEditDisableMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNewSectionEditDisableMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNewSectionEditForceMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNewSectionEditForceMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNewSectionEditForceMetaItem = function VeDmMWNewSectionEditForceMetaItem( element ) {
+ve.dm.MWNewSectionEditForceMetaItem = function VeDmMWNewSectionEditForceMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNewSectionEditForceMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWDisplayTitleMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWDisplayTitleMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWDisplayTitleMetaItem = function VeDmMWDisplayTitleMetaItem( element ) {
+ve.dm.MWDisplayTitleMetaItem = function VeDmMWDisplayTitleMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWDisplayTitleMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWHiddenCategoryMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWHiddenCategoryMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWHiddenCategoryMetaItem = function VeDmMWHiddenCategoryMetaItem( element ) {
+ve.dm.MWHiddenCategoryMetaItem = function VeDmMWHiddenCategoryMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWHiddenCategoryMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoContentConvertMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoContentConvertMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNoContentConvertMetaItem = function VeDmMWNoContentConvertMetaItem( element ) {
+ve.dm.MWNoContentConvertMetaItem = function VeDmMWNoContentConvertMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNoContentConvertMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWTOCForceMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWTOCForceMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWTOCForceMetaItem = function VeDmMWTOCForceMetaItem( element ) {
+ve.dm.MWTOCForceMetaItem = function VeDmMWTOCForceMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWTOCForceMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWAlienMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWAlienMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -14,9 +14,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWAlienMetaItem = function VeDmMWAlienMetaItem( element ) {
+ve.dm.MWAlienMetaItem = function VeDmMWAlienMetaItem() {
// Parent constructor
- ve.dm.AlienMetaItem.call( this, element );
+ ve.dm.MWAlienMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoEditSectionMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoEditSectionMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNoEditSectionMetaItem = function VeDmMWNoEditSectionMetaItem( element ) {
+ve.dm.MWNoEditSectionMetaItem = function VeDmMWNoEditSectionMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNoEditSectionMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWLanguageMetaItem = function VeDmMWLanguageMetaItem( element ) {
+ve.dm.MWLanguageMetaItem = function VeDmMWLanguageMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWLanguageMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWStaticRedirectMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWStaticRedirectMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWStaticRedirectMetaItem = function VeDmMWStaticRedirectMetaItem( element ) {
+ve.dm.MWStaticRedirectMetaItem = function VeDmMWStaticRedirectMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWStaticRedirectMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWCategoryMetaItem = function VeDmMWCategoryMetaItem( element ) {
+ve.dm.MWCategoryMetaItem = function VeDmMWCategoryMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWCategoryMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWIndexForceMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWIndexForceMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWIndexForceMetaItem = function VeDmMWIndexForceMetaItem( element ) {
+ve.dm.MWIndexForceMetaItem = function VeDmMWIndexForceMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWIndexForceMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWDefaultSortMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWDefaultSortMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWDefaultSortMetaItem = function VeDmMWDefaultSortMetaItem( element ) {
+ve.dm.MWDefaultSortMetaItem = function VeDmMWDefaultSortMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWDefaultSortMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoTitleConvertMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoTitleConvertMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNoTitleConvertMetaItem = function VeDmMWNoTitleConvertMetaItem( element ) {
+ve.dm.MWNoTitleConvertMetaItem = function VeDmMWNoTitleConvertMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNoTitleConvertMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoGalleryMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWNoGalleryMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWNoGalleryMetaItem = function VeDmMWNoGalleryMetaItem( element ) {
+ve.dm.MWNoGalleryMetaItem = function VeDmMWNoGalleryMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWNoGalleryMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWTOCDisableMetaItem.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWTOCDisableMetaItem.js 2016-09-06 16:31:20.062430056 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {Object} element Reference to element in meta-linmod
*/
-ve.dm.MWTOCDisableMetaItem = function VeDmMWTOCDisableMetaItem( element ) {
+ve.dm.MWTOCDisableMetaItem = function VeDmMWTOCDisableMetaItem() {
// Parent constructor
- ve.dm.MetaItem.call( this, element );
+ ve.dm.MWTOCDisableMetaItem.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWExternalLinkAnnotation.js 2016-09-06 21:33:14.788051193 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWExternalLinkAnnotation.js 2016-09-06 21:45:12.921471919 +0000
@@ -20,9 +20,9 @@
* @constructor
* @param {Object} element
*/
-ve.dm.MWExternalLinkAnnotation = function VeDmMWExternalLinkAnnotation( element ) {
+ve.dm.MWExternalLinkAnnotation = function VeDmMWExternalLinkAnnotation() {
// Parent constructor
- ve.dm.LinkAnnotation.call( this, element );
+ ve.dm.MWExternalLinkAnnotation.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWNowikiAnnotation.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWNowikiAnnotation.js 2016-09-06 16:31:20.062430056 +0000
@@ -16,9 +16,9 @@
* @constructor
* @param {Object} element [description]
*/
-ve.dm.MWNowikiAnnotation = function VeDmMWNowikiAnnotation( element ) {
+ve.dm.MWNowikiAnnotation = function VeDmMWNowikiAnnotation() {
// Parent constructor
- ve.dm.Annotation.call( this, element );
+ ve.dm.MWNowikiAnnotation.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js 2016-08-30 11:22:17.128463132 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js 2016-09-06 16:31:20.062430056 +0000
@@ -17,9 +17,9 @@
* @constructor
* @param {Object} element
*/
-ve.dm.MWInternalLinkAnnotation = function VeDmMWInternalLinkAnnotation( element ) {
+ve.dm.MWInternalLinkAnnotation = function VeDmMWInternalLinkAnnotation() {
// Parent constructor
- ve.dm.LinkAnnotation.call( this, element );
+ ve.dm.MWInternalLinkAnnotation.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -19,7 +19,7 @@
*/
ve.dm.MWBlockImageNode = function VeDmMWBlockImageNode() {
// Parent constructor
- ve.dm.BranchNode.apply( this, arguments );
+ ve.dm.MWBlockImageNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.MWImageNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWPreformattedNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWPreformattedNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWPreformattedNode = function VeDmMWPreformattedNode() {
// Parent constructor
- ve.dm.PreformattedNode.apply( this, arguments );
+ ve.dm.MWPreformattedNode.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWMagicLinkNode = function VeDmMWMagicLinkNode() {
// Parent constructor
- ve.dm.LeafNode.apply( this, arguments );
+ ve.dm.MWMagicLinkNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.FocusableNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -16,7 +16,7 @@
*/
ve.dm.MWGalleryNode = function VeDmMWGalleryNode() {
// Parent constructor
- ve.dm.MWBlockExtensionNode.apply( this, arguments );
+ ve.dm.MWGalleryNode.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWEntityNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWEntityNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -16,7 +16,7 @@
*/
ve.dm.MWEntityNode = function VeDmMWEntityNode() {
// Parent constructor
- ve.dm.LeafNode.apply( this, arguments );
+ ve.dm.MWEntityNode.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWSignatureNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWSignatureNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -16,9 +16,9 @@
* @constructor
* @param {Object} [element] Reference to element in linear model
*/
-ve.dm.MWSignatureNode = function VeDmMWSignatureNode( element ) {
+ve.dm.MWSignatureNode = function VeDmMWSignatureNode() {
// Parent constructor
- ve.dm.MWTransclusionInlineNode.call( this, element );
+ ve.dm.MWSignatureNode.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWNumberedExternalLinkNode = function VeDmMWNumberedExternalLinkNode() {
// Parent constructor
- ve.dm.LeafNode.apply( this, arguments );
+ ve.dm.MWNumberedExternalLinkNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.FocusableNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWImageCaptionNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWImageCaptionNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWImageCaptionNode = function VeDmMWImageCaptionNode() {
// Parent constructor
- ve.dm.BranchNode.apply( this, arguments );
+ ve.dm.MWImageCaptionNode.super.apply( this, arguments );
};
OO.inheritClass( ve.dm.MWImageCaptionNode, ve.dm.BranchNode );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -408,7 +408,7 @@
*/
ve.dm.MWTransclusionBlockNode = function VeDmMWTransclusionBlockNode() {
// Parent constructor
- ve.dm.MWTransclusionNode.apply( this, arguments );
+ ve.dm.MWTransclusionBlockNode.super.apply( this, arguments );
};
OO.inheritClass( ve.dm.MWTransclusionBlockNode, ve.dm.MWTransclusionNode );
@@ -428,7 +428,7 @@
*/
ve.dm.MWTransclusionInlineNode = function VeDmMWTransclusionInlineNode() {
// Parent constructor
- ve.dm.MWTransclusionNode.apply( this, arguments );
+ ve.dm.MWTransclusionInlineNode.super.apply( this, arguments );
};
OO.inheritClass( ve.dm.MWTransclusionInlineNode, ve.dm.MWTransclusionNode );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -17,7 +17,7 @@
*/
ve.dm.MWInlineImageNode = function VeDmMWInlineImageNode() {
// Parent constructor
- ve.dm.LeafNode.apply( this, arguments );
+ ve.dm.MWInlineImageNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.MWImageNode.call( this );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js 2016-08-30 11:22:17.132463163 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js 2016-09-06 16:31:20.066430087 +0000
@@ -238,7 +238,7 @@
}
} );
}
- // Parent method
+ // Mixin method
return ve.dm.ResizableNode.prototype.getScalable.call( this );
};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryItemWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryItemWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -25,7 +25,7 @@
config = ve.extendObject( { indicator: 'down' }, config );
// Parent constructor
- OO.ui.ButtonWidget.call( this, config );
+ ve.ui.MWCategoryItemWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.DraggableElement.call( this, config );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -24,7 +24,7 @@
config = config || {};
// Parent constructor
- OO.ui.OptionWidget.call( this, config );
+ ve.ui.MWMediaResultWidget.super.call( this, config );
// Properties
this.setRowHeight( config.rowHeight || 150 );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWParameterResultWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWParameterResultWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -19,7 +19,7 @@
config = ve.extendObject( { icon: 'parameter' }, config );
// Parent constructor
- OO.ui.DecoratedOptionWidget.call( this, config );
+ ve.ui.MWParameterResultWidget.super.call( this, config );
// Initialization
this.$element.addClass( 've-ui-mwParameterResultWidget' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWNoParametersResultWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWNoParametersResultWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -16,7 +16,7 @@
*/
ve.ui.MWNoParametersResultWidget = function VeUiMWNoParametersResultWidget( config ) {
// Parent constructor
- OO.ui.OptionWidget.call( this, config );
+ ve.ui.MWNoParametersResultWidget.super.call( this, config );
// Initialization
this.$element.addClass( 've-ui-mwNoParametersResultWidget' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWParameterSearchWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWParameterSearchWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -24,7 +24,7 @@
}, config );
// Parent constructor
- OO.ui.SearchWidget.call( this, config );
+ ve.ui.MWParameterSearchWidget.super.call( this, config );
// Properties
this.template = template;
@@ -62,7 +62,7 @@
*/
ve.ui.MWParameterSearchWidget.prototype.onQueryChange = function () {
// Parent method
- OO.ui.SearchWidget.prototype.onQueryChange.call( this );
+ ve.ui.MWParameterSearchWidget.super.prototype.onQueryChange.call( this );
// Populate
this.addResults();
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -25,7 +25,7 @@
config = config || {};
// Parent constructor
- OO.ui.Widget.call( this, config );
+ ve.ui.MWCategoryWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.GroupElement.call( this, config );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -19,7 +19,7 @@
config = ve.extendObject( { autoClose: true }, config );
// Parent constructor
- OO.ui.PopupWidget.call( this, config );
+ ve.ui.MWCategoryPopupWidget.super.call( this, config );
// Properties
this.category = null;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMoreParametersResultWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMoreParametersResultWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -21,7 +21,7 @@
config = ve.extendObject( { icon: 'parameter-set' }, config );
// Parent constructor
- OO.ui.DecoratedOptionWidget.call( this, config );
+ ve.ui.MWMoreParametersResultWidget.super.call( this, config );
// Initialization
this.$element.addClass( 've-ui-mwMoreParametersResultWidget' );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWTocWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWTocWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -18,7 +18,7 @@
ve.ui.MWTocWidget = function VeUiMWTocWidget( surface, config ) {
// Parent constructor
- OO.ui.Widget.call( this, config );
+ ve.ui.MWTocWidget.super.call( this, config );
// Properties
this.surface = surface;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -22,7 +22,7 @@
}, config );
// Parent constructor
- OO.ui.SearchWidget.call( this, config );
+ ve.ui.MWMediaSearchWidget.super.call( this, config );
// Properties
this.providers = {};
@@ -208,7 +208,7 @@
this.searchValue = trimmed;
// Parent method
- OO.ui.SearchWidget.prototype.onQueryChange.apply( this, arguments );
+ ve.ui.MWMediaSearchWidget.super.prototype.onQueryChange.apply( this, arguments );
// Reset
this.itemCache = {};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js 2016-08-30 11:22:17.204463715 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js 2016-09-06 16:31:20.202431136 +0000
@@ -23,7 +23,7 @@
}, config );
// Parent constructor
- OO.ui.TextInputWidget.call( this, config );
+ ve.ui.MWCategoryInputWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.LookupElement.call( this, config );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js 2016-08-30 11:22:17.192463623 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js 2016-09-06 16:31:20.186431013 +0000
@@ -43,7 +43,7 @@
*/
ve.ui.MWAlienExtensionInspector.prototype.initialize = function () {
// Parent method
- ve.ui.MWExtensionInspector.prototype.initialize.apply( this, arguments );
+ ve.ui.MWAlienExtensionInspector.super.prototype.initialize.apply( this, arguments );
this.$attributes = $( '<div>' ).addClass( 've-ui-mwAlienExtensionInspector-attributes' );
this.form.$element.append( this.$attributes );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js 2016-08-30 11:22:17.192463623 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js 2016-09-06 16:31:20.186431013 +0000
@@ -14,9 +14,9 @@
* @constructor
* @param {Object} [config] Configuration options
*/
-ve.ui.MWLinkNodeInspector = function VeUiMWLinkNodeInspector( config ) {
+ve.ui.MWLinkNodeInspector = function VeUiMWLinkNodeInspector() {
// Parent constructor
- ve.ui.NodeInspector.call( this, config );
+ ve.ui.MWLinkNodeInspector.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js 2016-08-30 11:22:17.192463623 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js 2016-09-06 16:31:20.186431013 +0000
@@ -14,9 +14,9 @@
* @constructor
* @param {Object} [config] Configuration options
*/
-ve.ui.MWMagicLinkNodeInspector = function VeUiMWMagicLinkNodeInspector( config ) {
+ve.ui.MWMagicLinkNodeInspector = function VeUiMWMagicLinkNodeInspector() {
// Parent constructor
- ve.ui.NodeInspector.call( this, config );
+ ve.ui.MWMagicLinkNodeInspector.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWParameterPlaceholderPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWParameterPlaceholderPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -23,7 +23,7 @@
}, config );
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWParameterPlaceholderPage.super.call( this, name, config );
// Properties
this.name = name;
@@ -77,9 +77,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWParameterPlaceholderPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWParameterPlaceholderPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWParameterPlaceholderPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTemplatePlaceholderPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -25,7 +25,7 @@
}, config );
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWTemplatePlaceholderPage.super.call( this, name, config );
// Properties
this.placeholder = placeholder;
@@ -87,9 +87,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWTemplatePlaceholderPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWTemplatePlaceholderPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWTemplatePlaceholderPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWLanguagesPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWLanguagesPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -15,9 +15,9 @@
* @param {string} name Unique symbolic name of page
* @param {Object} [config] Configuration options
*/
-ve.ui.MWLanguagesPage = function VeUiMWLanguagesPage( name, config ) {
+ve.ui.MWLanguagesPage = function VeUiMWLanguagesPage() {
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWLanguagesPage.super.apply( this, arguments );
// Properties
this.languagesFieldset = new OO.ui.FieldsetLayout( {
@@ -44,9 +44,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWLanguagesPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWLanguagesPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWLanguagesPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -21,7 +21,7 @@
config = config || {};
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWCategoriesPage.super.apply( this, arguments );
// Properties
this.metaList = null;
@@ -77,9 +77,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWCategoriesPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWCategoriesPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWCategoriesPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js 2016-08-30 11:22:17.192463623 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -15,11 +15,11 @@
* @param {string} name Unique symbolic name of page
* @param {Object} [config] Configuration options
*/
-ve.ui.MWAdvancedSettingsPage = function VeUiMWAdvancedSettingsPage( name, config ) {
+ve.ui.MWAdvancedSettingsPage = function VeUiMWAdvancedSettingsPage() {
var advancedSettingsPage = this;
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWAdvancedSettingsPage.super.apply( this, arguments );
// Properties
this.metaList = null;
@@ -167,9 +167,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWAdvancedSettingsPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWAdvancedSettingsPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWAdvancedSettingsPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTransclusionContentPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTransclusionContentPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -23,7 +23,7 @@
}, config );
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWTransclusionContentPage.super.call( this, name, config );
// Properties
this.content = content;
@@ -63,9 +63,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWTransclusionContentPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWTransclusionContentPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWTransclusionContentPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js 2016-09-06 16:31:20.186431013 +0000
@@ -25,7 +25,7 @@
}, config );
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWTemplatePage.super.call( this, name, config );
// Properties
this.template = template;
@@ -95,9 +95,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWTemplatePage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWTemplatePage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWTemplatePage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js 2016-09-07 23:29:45.797497976 +0000
@@ -25,7 +25,7 @@
}, config );
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWParameterPage.super.call( this, name, config );
// Properties
this.edited = false;
@@ -341,9 +341,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWParameterPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWParameterPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWParameterPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js 2016-08-30 11:22:17.196463653 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js 2016-09-06 16:31:20.186431013 +0000
@@ -20,7 +20,7 @@
var settingsPage = this;
// Parent constructor
- OO.ui.PageLayout.call( this, name, config );
+ ve.ui.MWSettingsPage.super.apply( this, arguments );
// Properties
this.metaList = null;
@@ -167,9 +167,9 @@
/**
* @inheritdoc
*/
-ve.ui.MWSettingsPage.prototype.setOutlineItem = function ( outlineItem ) {
+ve.ui.MWSettingsPage.prototype.setOutlineItem = function () {
// Parent method
- OO.ui.PageLayout.prototype.setOutlineItem.call( this, outlineItem );
+ ve.ui.MWSettingsPage.super.prototype.setOutlineItem.apply( this, arguments );
if ( this.outlineItem ) {
this.outlineItem
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/actions/ve.ui.MWWikitextAction.js 2016-08-30 11:22:17.192463623 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/actions/ve.ui.MWWikitextAction.js 2016-09-06 16:31:20.178430951 +0000
@@ -13,9 +13,9 @@
* @constructor
* @param {ve.ui.Surface} surface Surface to act on
*/
-ve.ui.MWWikitextAction = function VeUiMWWikitextAction( surface ) {
+ve.ui.MWWikitextAction = function VeUiMWWikitextAction() {
// Parent constructor
- ve.ui.Action.call( this, surface );
+ ve.ui.MWWikitextAction.super.apply( this, arguments );
};
/* Inheritance */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js 2016-08-30 11:22:17.200463684 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js 2016-09-06 16:31:20.198431104 +0000
@@ -19,9 +19,9 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWSignatureTool = function VeUiMWSignatureTool( toolGroup, config ) {
+ve.ui.MWSignatureTool = function VeUiMWSignatureTool() {
// Parent constructor
- ve.ui.MWTransclusionDialogTool.call( this, toolGroup, config );
+ ve.ui.MWSignatureTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWSignatureTool, ve.ui.MWTransclusionDialogTool );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js 2016-08-30 11:22:17.200463684 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js 2016-09-06 16:31:20.198431104 +0000
@@ -14,8 +14,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading1FormatTool = function VeUiMWHeading1FormatTool( toolGroup, config ) {
- ve.ui.Heading1FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading1FormatTool = function VeUiMWHeading1FormatTool() {
+ ve.ui.MWHeading1FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading1FormatTool, ve.ui.Heading1FormatTool );
ve.ui.MWHeading1FormatTool.static.title =
@@ -32,8 +32,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading2FormatTool = function VeUiMWHeading2FormatTool( toolGroup, config ) {
- ve.ui.Heading2FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading2FormatTool = function VeUiMWHeading2FormatTool() {
+ ve.ui.MWHeading2FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading2FormatTool, ve.ui.Heading2FormatTool );
ve.ui.MWHeading2FormatTool.static.title =
@@ -50,8 +50,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading3FormatTool = function VeUiMWHeading3FormatTool( toolGroup, config ) {
- ve.ui.Heading3FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading3FormatTool = function VeUiMWHeading3FormatTool() {
+ ve.ui.MWHeading3FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading3FormatTool, ve.ui.Heading3FormatTool );
ve.ui.MWHeading3FormatTool.static.title =
@@ -68,8 +68,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading4FormatTool = function VeUiMWHeading4FormatTool( toolGroup, config ) {
- ve.ui.Heading4FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading4FormatTool = function VeUiMWHeading4FormatTool() {
+ ve.ui.MWHeading4FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading4FormatTool, ve.ui.Heading4FormatTool );
ve.ui.MWHeading4FormatTool.static.title =
@@ -86,8 +86,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading5FormatTool = function VeUiMWHeading5FormatTool( toolGroup, config ) {
- ve.ui.Heading5FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading5FormatTool = function VeUiMWHeading5FormatTool() {
+ ve.ui.MWHeading5FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading5FormatTool, ve.ui.Heading5FormatTool );
ve.ui.MWHeading5FormatTool.static.title =
@@ -104,8 +104,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWHeading6FormatTool = function VeUiMWHeading6FormatTool( toolGroup, config ) {
- ve.ui.Heading6FormatTool.call( this, toolGroup, config );
+ve.ui.MWHeading6FormatTool = function VeUiMWHeading6FormatTool() {
+ ve.ui.MWHeading6FormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWHeading6FormatTool, ve.ui.Heading6FormatTool );
ve.ui.MWHeading6FormatTool.static.title =
@@ -134,8 +134,8 @@
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
-ve.ui.MWPreformattedFormatTool = function VeUiMWPreformattedFormatTool( toolGroup, config ) {
- ve.ui.FormatTool.call( this, toolGroup, config );
+ve.ui.MWPreformattedFormatTool = function VeUiMWPreformattedFormatTool() {
+ ve.ui.MWPreformattedFormatTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWPreformattedFormatTool, ve.ui.PreformattedFormatTool );
ve.ui.MWPreformattedFormatTool.static.format = { type: 'mwPreformatted' };
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWEditModeTool.js 2016-08-30 11:22:17.200463684 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWEditModeTool.js 2016-09-06 16:31:20.198431104 +0000
@@ -19,7 +19,9 @@
var tool = this,
$content = $( '<p>' ).text( mw.msg( 'visualeditor-mweditmodewt-popup-body' ) ),
showAgainLayout, showAgainCheckbox;
- ve.ui.MWPopupTool.call( this, mw.msg( 'visualeditor-mweditmodewt-popup-title' ), toolGroup, config );
+
+ // Parent constructor
+ ve.ui.MWEditModeTool.super.call( this, mw.msg( 'visualeditor-mweditmodewt-popup-title' ), toolGroup, config );
if ( !mw.user.isAnon() ) {
showAgainCheckbox = new OO.ui.CheckboxInputWidget()
@@ -83,6 +85,7 @@
* @param {Object} [config] Config options
*/
ve.ui.MWEditModeSourceTool = function VeUiMWEditModeSourceTool() {
+ // Parent constructor
ve.ui.MWEditModeSourceTool.super.apply( this, arguments );
};
OO.inheritClass( ve.ui.MWEditModeSourceTool, ve.ui.MWEditModeTool );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js 2016-08-30 11:22:17.200463684 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js 2016-09-06 16:31:20.198431104 +0000
@@ -13,13 +13,17 @@
*
* @class
* @extends ve.ui.LinkInspectorTool
+ * @mixins ve.ui.MWEducationPopupTool
*
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWLinkInspectorTool = function VeUiMwLinkInspectorTool() {
+ // Parent constructor
ve.ui.MWLinkInspectorTool.super.apply( this, arguments );
+
+ // Mixin constructor
ve.ui.MWEducationPopupTool.call( this, {
title: ve.msg( 'visualeditor-linkinspector-educationpopup-title' ),
text: ve.msg( 'visualeditor-linkinspector-educationpopup-text' )
@@ -29,6 +33,7 @@
/* Inheritance */
OO.inheritClass( ve.ui.MWLinkInspectorTool, ve.ui.LinkInspectorTool );
+
OO.mixinClass( ve.ui.MWLinkInspectorTool, ve.ui.MWEducationPopupTool );
/* Static Properties */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/lib/ve/src/init/ve.init.Target.js 2016-09-01 23:45:30.404706120 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/lib/ve/src/init/ve.init.Target.js 2016-09-06 16:31:27.702488993 +0000
@@ -354,11 +354,9 @@
* Destroy and remove all surfaces from the target
*/
ve.init.Target.prototype.clearSurfaces = function () {
- if ( this.surfaces.indexOf( this.surface ) !== -1 ) {
- // We're about to destroy this.surface, so unset it for sanity
- // Otherwise, getSurface() could return a destroyed surface
- this.surface = null;
- }
+ // We're about to destroy this.surface, so unset it for sanity
+ // Otherwise, getSurface() could return a destroyed surface
+ this.surface = null;
while ( this.surfaces.length ) {
this.surfaces.pop().destroy();
}
@@ -379,6 +377,9 @@
* @param {ve.ui.Surface} surface Surface
*/
ve.init.Target.prototype.setSurface = function ( surface ) {
+ if ( this.surfaces.indexOf( surface ) === -1 ) {
+ throw new Error( 'Active surface must have been added first' );
+ }
if ( surface !== this.surface ) {
this.surface = surface;
this.setupToolbar( surface );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js 2016-08-30 11:22:23.588512655 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js 2016-09-06 16:31:27.694488930 +0000
@@ -1756,7 +1756,7 @@
* @param {jQuery.Event} e Paste event
*/
ve.ce.Surface.prototype.beforePaste = function ( e ) {
- var range, node, nodeRange, contextElement, nativeRange,
+ var range, startNode, endNode, contextElement, nativeRange,
context, leftText, rightText, textNode, textStart, textEnd,
selection = this.getModel().getSelection(),
clipboardData = e.originalEvent.clipboardData,
@@ -1765,11 +1765,8 @@
documentModel = surfaceModel.getDocument();
if ( selection instanceof ve.dm.LinearSelection ) {
- // Pasting over a linear selection? Remove first.
- fragment.removeContent();
range = fragment.getSelection().getRange();
} else if ( selection instanceof ve.dm.TableSelection ) {
- // Selection removal is handled in after paste for tables (depends on pasted content)
range = new ve.Range( selection.getRanges()[ 0 ].start );
} else {
e.preventDefault();
@@ -1798,27 +1795,27 @@
this.$pasteTarget.empty();
// Get node from cursor position
- node = documentModel.getBranchNodeFromOffset( range.start );
- if ( node.canContainContent() ) {
+ startNode = documentModel.getBranchNodeFromOffset( range.start );
+ if ( startNode.canContainContent() ) {
// If this is a content branch node, then add its DM HTML
// to the paste target to give CE some context.
textStart = textEnd = 0;
- nodeRange = node.getRange();
- contextElement = node.getClonedElement();
+ contextElement = startNode.getClonedElement();
// Make sure that context doesn't have any attributes that might confuse
// the importantElement check in afterPaste.
$( documentModel.getStore().value( contextElement.originalDomElementsIndex ) ).removeAttr( 'id typeof rel' );
context = [ contextElement ];
// If there is content to the left of the cursor, put a placeholder
// character to the left of the cursor
- if ( range.start > nodeRange.start ) {
+ if ( range.start > startNode.getRange().start ) {
leftText = '☀';
context.push( leftText );
textStart = textEnd = 1;
}
// If there is content to the right of the cursor, put a placeholder
// character to the right of the cursor
- if ( range.end < nodeRange.end ) {
+ endNode = documentModel.getBranchNodeFromOffset( range.end );
+ if ( range.end < endNode.getRange().end ) {
rightText = '☂';
context.push( rightText );
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/lib/ve/src/ui/ve.ui.DataTransferHandlerFactory.js 2016-08-30 11:22:23.608512808 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/lib/ve/src/ui/ve.ui.DataTransferHandlerFactory.js 2016-09-06 16:31:27.710489054 +0000
@@ -33,14 +33,33 @@
* @inheritdoc
*/
ve.ui.DataTransferHandlerFactory.prototype.register = function ( constructor ) {
- var i, j, ilen, jlen, kinds, types, extensions;
+ // Parent method
+ ve.ui.DataTransferHandlerFactory.super.prototype.register.apply( this, arguments );
+
+ this.updateIndexes( constructor, true );
+};
+/**
+ * @inheritdoc
+ */
+ve.ui.DataTransferHandlerFactory.prototype.unregister = function ( constructor ) {
// Parent method
- ve.ui.DataTransferHandlerFactory.super.prototype.register.call( this, constructor );
+ ve.ui.DataTransferHandlerFactory.super.prototype.unregister.apply( this, arguments );
- kinds = constructor.static.kinds;
- types = constructor.static.types;
- extensions = constructor.static.extensions;
+ this.updateIndexes( constructor, false );
+};
+
+/**
+ * Update indexes used for handler loopup
+ *
+ * @param {Function} constructor Handler's constructor to insert/remove
+ * @param {boolean} insert Insert the handler into the indexes, remove otherwise
+ */
+ve.ui.DataTransferHandlerFactory.prototype.updateIndexes = function ( constructor, insert ) {
+ var i, j, ilen, jlen,
+ kinds = constructor.static.kinds,
+ types = constructor.static.types,
+ extensions = constructor.static.extensions;
function ensureArray( obj, prop ) {
if ( obj[ prop ] === undefined ) {
@@ -56,23 +75,42 @@
return obj[ prop ];
}
+ function remove( arr, item ) {
+ var index;
+ if ( ( index = arr.indexOf( item ) ) !== -1 ) {
+ arr.splice( index, 1 );
+ }
+ }
+
if ( !kinds ) {
for ( j = 0, jlen = types.length; j < jlen; j++ ) {
- ensureArray( this.handlerNamesByType, types[ j ] ).unshift( constructor.static.name );
+ if ( insert ) {
+ ensureArray( this.handlerNamesByType, types[ j ] ).unshift( constructor.static.name );
+ } else {
+ remove( this.handlerNamesByType[ types[ j ] ], constructor.static.name );
+ }
}
} else {
for ( i = 0, ilen = kinds.length; i < ilen; i++ ) {
for ( j = 0, jlen = types.length; j < jlen; j++ ) {
- ensureArray(
- ensureMap( this.handlerNamesByKindAndType, kinds[ i ] ),
- types[ j ]
- ).unshift( constructor.static.name );
+ if ( insert ) {
+ ensureArray(
+ ensureMap( this.handlerNamesByKindAndType, kinds[ i ] ),
+ types[ j ]
+ ).unshift( constructor.static.name );
+ } else {
+ remove( this.handlerNamesByKindAndType[ kinds[ i ] ][ types[ j ] ], constructor.static.name );
+ }
}
}
}
if ( constructor.prototype instanceof ve.ui.FileTransferHandler ) {
for ( i = 0, ilen = extensions.length; i < ilen; i++ ) {
- ensureArray( this.handlerNamesByExtension, extensions[ i ] ).unshift( constructor.static.name );
+ if ( insert ) {
+ ensureArray( this.handlerNamesByExtension, extensions[ i ] ).unshift( constructor.static.name );
+ } else {
+ remove( this.handlerNamesByExtension[ extensions[ i ] ], constructor.static.name );
+ }
}
}
};
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/lib/ve/tests/ce/ve.ce.Surface.test.js 2016-08-30 11:22:23.616512869 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/lib/ve/tests/ce/ve.ce.Surface.test.js 2016-09-06 16:31:27.718489116 +0000
@@ -1377,6 +1377,32 @@
msg: 'Text into paragraph'
},
{
+ rangeOrSelection: new ve.Range( 4, 5 ),
+ pasteHtml: 'Bar',
+ expectedRangeOrSelection: new ve.Range( 7 ),
+ expectedOps: [
+ [
+ { type: 'retain', length: 4 },
+ {
+ type: 'replace',
+ insert: [],
+ remove: [ 'o' ]
+ },
+ { type: 'retain', length: docLen - 5 }
+ ],
+ [
+ { type: 'retain', length: 4 },
+ {
+ type: 'replace',
+ insert: [ 'B', 'a', 'r' ],
+ remove: []
+ },
+ { type: 'retain', length: docLen - 5 }
+ ]
+ ],
+ msg: 'Text into selection'
+ },
+ {
rangeOrSelection: new ve.Range( 25 ),
internalSourceRangeOrSelection: new ve.Range( 3, 6 ),
expectedRangeOrSelection: new ve.Range( 28 ),
@@ -1428,12 +1454,60 @@
bias: 'stop',
index: ve.dm.example.annIndex( 'b', 'Quux' )
},
- { type: 'retain', length: 5 }
+ { type: 'retain', length: docLen - 25 }
]
],
msg: 'External text into annotated content'
},
{
+ rangeOrSelection: new ve.Range( 23, 27 ),
+ pasteHtml: 'Foo',
+ expectedRangeOrSelection: new ve.Range( 26 ),
+ expectedOps: [
+ [
+ { type: 'retain', length: 23 },
+ {
+ type: 'replace',
+ insert: [],
+ remove: [
+ [ 'Q', [ bold ] ],
+ [ 'u', [ bold ] ],
+ [ 'u', [ bold ] ],
+ [ 'x', [ bold ] ]
+ ]
+ },
+ { type: 'retain', length: docLen - 27 }
+ ],
+ [
+ { type: 'retain', length: 23 },
+ {
+ type: 'replace',
+ insert: [ 'F', 'o', 'o' ],
+ remove: []
+ },
+ { type: 'retain', length: docLen - 27 }
+ ],
+ [
+ { type: 'retain', length: 23 },
+ {
+ type: 'annotate',
+ method: 'set',
+ bias: 'start',
+ index: ve.dm.example.annIndex( 'b', 'Quux' )
+ },
+ { type: 'retain', length: 3 },
+ {
+ type: 'annotate',
+ method: 'set',
+ bias: 'stop',
+ index: ve.dm.example.annIndex( 'b', 'Quux' )
+ },
+ { type: 'retain', length: docLen - 27 }
+ ]
+ ],
+ msg: 'External text over annotated content'
+ },
+ {
rangeOrSelection: new ve.Range( 4 ),
pasteHtml: '<span style="color:red;">Foo</span><font style="color:blue;">bar</font>',
expectedRangeOrSelection: new ve.Range( 10 ),
@@ -2656,7 +2730,7 @@
if ( model.getHistory().length ) {
txs = model.getHistory()[ 0 ].transactions;
for ( i = 0; i < txs.length; i++ ) {
- txops = txs[ i ].getOperations();
+ txops = ve.copy( txs[ i ].getOperations() );
for ( j = 0; j < txops.length; j++ ) {
if ( txops[ j ].remove ) {
ve.dm.example.postprocessAnnotations( txops[ j ].remove, doc.getStore() );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/build/screenshots.js 2016-08-30 11:22:17.124463102 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/build/screenshots.js 2016-09-06 16:31:20.054429994 +0000
@@ -28,7 +28,7 @@
driver = new chrome.Driver();
}
- driver.manage().timeouts().setScriptTimeout( 30000 );
+ driver.manage().timeouts().setScriptTimeout( 40000 );
driver.manage().window().setSize( 1200, 1000 );
driver.get( 'https://en.wikipedia.org/wiki/PageDoesNotExist?veaction=edit&uselang=' + lang );
@@ -154,7 +154,7 @@
}
} );
} ),
- 30000
+ 40000
);
}
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/VisualEditor/Gruntfile.js 2016-08-30 11:22:17.124463102 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/VisualEditor/Gruntfile.js 2016-09-06 16:31:20.050429963 +0000
@@ -59,7 +59,7 @@
'screenshots-en': {
options: {
reporter: 'spec',
- timeout: 30000,
+ timeout: 40000,
require: [
function () {
/* jshint undef:false */
@@ -72,7 +72,7 @@
'screenshots-all': {
options: {
reporter: 'spec',
- timeout: 30000,
+ timeout: 40000,
require: [
function () {
/* jshint undef:false */
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UniversalLanguageSelector/resources/js/ext.uls.interface.js 2016-08-30 11:21:49.460251027 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UniversalLanguageSelector/resources/js/ext.uls.interface.js 2016-09-06 16:30:50.722203720 +0000
@@ -213,14 +213,14 @@
ulsPopup.toggle( true );
ulsPopup.toggleClipping( false );
// if the mouse is over the tooltip, do not hide
- $( '.tipsy' ).on( 'mouseover', function () {
+ $( '.uls-tipsy' ).on( 'mouseover', function () {
window.clearTimeout( tipsyTimer );
} ).on( 'mouseout', function () {
tipsyTimer = window.setTimeout( hideTipsy, timeout );
} );
// hide the tooltip when clicked on it
- $( '.tipsy' ).on( 'click', hideTipsy );
+ $( '.uls-tipsy' ).on( 'click', hideTipsy );
// Event handler for links in the tooltip.
// It looks like the tipsy is always created from scratch so that
@@ -251,7 +251,7 @@
padded: true,
width: 300,
align: 'forwards',
- classes: [ 'tipsy' ],
+ classes: [ 'uls-tipsy' ],
$content: ( function () {
var link = $( '<a>' ).text( previousAutonym )
.attr( {
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js 2016-08-30 11:21:49.460251027 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js 2016-09-06 16:30:50.722203720 +0000
@@ -153,7 +153,7 @@
* Prepare the UI language selector
*/
prepareLanguages: function () {
- var loginUri, $loginCta,
+ var $loginCta,
displaySettings = this,
SUGGESTED_LANGUAGES_NUMBER = 3,
anonsAllowed = mw.config.get( 'wgULSAnonCanChangeLanguage' ),
@@ -162,10 +162,6 @@
// Don't let anonymous users change interface language
if ( !anonsAllowed && mw.user.isAnon() ) {
- loginUri = new mw.Uri();
- loginUri.query = {
- title: 'Special:UserLogin'
- };
$loginCta = $( '<p>' )
.attr( 'id', 'uls-display-settings-anon-log-in-cta' );
autonym = $.uls.data.getAutonym( this.contentLanguage );
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UniversalLanguageSelector/lib/jquery.uls/src/jquery.uls.lcd.js 2016-08-30 11:21:49.452250966 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UniversalLanguageSelector/lib/jquery.uls/src/jquery.uls.lcd.js 2016-09-08 13:42:10.117838378 +0000
@@ -24,18 +24,18 @@
var noResultsTemplate, LanguageCategoryDisplay;
- noResultsTemplate = $( '<div>' ).addClass( 'twelve columns uls-no-results-view hide' );
+ noResultsTemplate = $( '<div>' ).addClass( 'uls-no-results-view hide' );
noResultsTemplate.append(
$( '<h2>' )
.attr( 'data-i18n', 'uls-no-results-found' )
- .addClass( 'eleven columns offset-by-one uls-no-results-found-title' )
+ .addClass( 'uls-no-results-found-title' )
.text( 'No results found' ),
$( '<div>' )
.attr( 'id', 'uls-no-found-more' )
.addClass( 'uls-no-found-more' )
.append(
$( '<div>' )
- .addClass( 'ten columns offset-by-one' )
+ .addClass( '' )
.append(
$( '<p>' ).append(
$( '<span>' ).text( 'You can search by language name, script name, ISO code of language or you can browse by region.' )
@@ -47,7 +47,7 @@
LanguageCategoryDisplay = function ( element, options ) {
this.$element = $( element );
this.options = $.extend( {}, $.fn.lcd.defaults, options );
- this.$element.addClass( 'lcd' );
+ this.$element.addClass( 'uls-lcd' );
this.regionLanguages = {};
this.renderTimeout = null;
this.cachedQuicklist = null;
@@ -109,8 +109,9 @@
},
render: function () {
- var $section,
+ var $section, $quicklist,
lcd = this,
+ narrowMode = this.options.columns === 1,
regions = [],
regionNames = {
// These are fallback text when i18n library not present
@@ -124,7 +125,16 @@
PA: 'Pacific'
};
- regions.push( this.buildQuicklist() );
+ $quicklist = this.buildQuicklist();
+ regions.push( $quicklist );
+
+ if ( narrowMode && $quicklist.length ) {
+ regions.push( $( '<h3>' )
+ .attr( 'data-i18n', 'uls-region-all' )
+ .addClass( 'uls-lcd-region-title' )
+ .text( 'All languages' )
+ );
+ }
$.each( $.uls.data.regiongroups, function ( regionCode ) {
lcd.regionLanguages[ regionCode ] = [];
@@ -135,14 +145,14 @@
}
$section = $( '<div>' )
- .addClass( 'eleven columns offset-by-one uls-lcd-region-section hide' )
+ .addClass( 'uls-lcd-region-section hide' )
.attr( 'id', regionCode );
// Show a region heading, unless we are using a narrow ULS
- if ( lcd.options.columns !== 1 ) {
+ if ( !narrowMode ) {
$section.append( $( '<h3>' )
.attr( 'data-i18n', 'uls-region-' + regionCode )
- .addClass( 'eleven columns uls-lcd-region-title' )
+ .addClass( 'uls-lcd-region-title' )
.text( regionNames[ regionCode ] )
);
}
@@ -306,7 +316,7 @@
this.options.quickList = this.options.quickList();
}
- if ( !this.options.quickList ) {
+ if ( !this.options.quickList.length ) {
this.cachedQuicklist = $( [] );
return this.cachedQuicklist;
}
@@ -317,13 +327,13 @@
quickList.sort( $.uls.data.sortByAutonym );
$quickListSection = $( '<div>' )
- .addClass( 'eleven columns offset-by-one uls-lcd-region-section' )
+ .addClass( 'uls-lcd-region-section' )
.attr( 'id', 'uls-lcd-quicklist' );
$quickListSectionTitle = $( '<h3>' )
.attr( 'data-i18n', 'uls-common-languages' )
- .addClass( 'eleven columns uls-lcd-region-title' )
- .text( 'Common languages' ); // This is placeholder text if jquery.i18n not present
+ .addClass( 'uls-lcd-region-title' )
+ .text( 'Suggested languages' ); // This is placeholder text if jquery.i18n not present
$quickListSection.append( $quickListSectionTitle );
this.renderRegion(
@@ -401,7 +411,8 @@
// Other supported values are 1 and 2.
// Other values will have rendering issues.
columns: 4,
- languageDecorator: null
+ languageDecorator: null,
+ quickList: []
};
$.fn.lcd.Constructor = LanguageCategoryDisplay;
--- /srv/mediawiki/php-1.28.0-wmf.17/extensions/UniversalLanguageSelector/lib/jquery.uls/src/jquery.uls.core.js 2016-08-30 11:21:49.452250966 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/extensions/UniversalLanguageSelector/lib/jquery.uls/src/jquery.uls.core.js 2016-09-08 13:42:10.117838378 +0000
@@ -91,7 +91,7 @@
this.initialized = false;
this.$languageFilter = this.$menu.find( '#uls-languagefilter' );
- this.$resultsView = this.$menu.find( 'div.uls-language-list' );
+ this.$resultsView = this.$menu.find( '.uls-language-list' );
this.render();
this.listen();
@@ -134,15 +134,25 @@
* @returns {Object}
*/
position: function () {
- var pos;
+ var pos,
+ top = this.top,
+ left = this.left;
+
+ if ( top === undefined ) {
+ pos = $.extend( {}, this.$element.offset(), {
+ height: this.$element[ 0 ].offsetHeight
+ } );
+ top = pos.top + pos.height;
+ }
+
+ if ( left === undefined ) {
+ left = $( window ).width() / 2 - this.$menu.outerWidth() / 2;
+ }
- pos = $.extend( {}, this.$element.offset(), {
- height: this.$element[ 0 ].offsetHeight
- } );
return {
- top: this.top !== undefined ? this.top : pos.top + pos.height,
- left: this.left !== undefined ? this.left : '25%'
+ top: top,
+ left: left
};
},
@@ -157,7 +167,6 @@
};
this.$menu.addClass( widthClasses[this.getMenuWidth()] );
- this.$menu.css( this.position() );
if ( !this.initialized ) {
$( 'body' ).prepend( this.$menu );
@@ -165,6 +174,7 @@
this.initialized = true;
}
+ this.$menu.css( this.position() );
this.$menu.show();
this.$menu.scrollIntoView();
this.shown = true;
@@ -250,7 +260,7 @@
languages: this.languages,
columns: columnsOptions[ this.getMenuWidth() ],
- quickList: languagesCount > 12 ? this.options.quickList : false,
+ quickList: languagesCount > 12 ? this.options.quickList : [],
clickhandler: $.proxy( this.select, this ),
source: this.$languageFilter,
showRegions: this.options.showRegions,
@@ -348,7 +358,7 @@
languagesCount = objectLength( this.options.languages );
- if ( languagesCount < 12 ) {
+ if ( languagesCount < 25 ) {
return 'narrow';
}
@@ -387,7 +397,7 @@
onSelect: null, // Callback function to be called when a language is selected
searchAPI: null, // Language search API
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
- quickList: null, // Array of language codes or function that returns such
+ quickList: [], // Array of language codes or function that returns such
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).
// If not specified, it will be set automatically.
menuWidth: null,
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/src/mediawiki/mediawiki.util.js 2016-08-30 11:17:28.762252570 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/src/mediawiki/mediawiki.util.js 2016-09-06 16:25:53.867913556 +0000
@@ -512,32 +512,6 @@
mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.' );
/**
- * Access key prefix. Might be wrong for browsers implementing the accessKeyLabel property.
- * @property {string} tooltipAccessKeyPrefix
- * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead.
- */
- mw.log.deprecate( util, 'tooltipAccessKeyPrefix', $.fn.updateTooltipAccessKeys.getAccessKeyPrefix(), 'Use jquery.accessKeyLabel instead.' );
-
- /**
- * Regex to match accesskey tooltips.
- *
- * Should match:
- *
- * - "[ctrl-option-x]"
- * - "[alt-shift-x]"
- * - "[ctrl-alt-x]"
- * - "[ctrl-x]"
- *
- * The accesskey is matched in group $6.
- *
- * Will probably not work for browsers implementing the accessKeyLabel property.
- *
- * @property {RegExp} tooltipAccessKeyRegexp
- * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead.
- */
- mw.log.deprecate( util, 'tooltipAccessKeyRegexp', /\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/, 'Use jquery.accessKeyLabel instead.' );
-
- /**
* Add the appropriate prefix to the accesskey shown in the tooltip.
*
* If the `$nodes` parameter is given, only those nodes are updated;
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/src/mediawiki/page/rollback.js 2016-08-30 11:17:28.762252570 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/src/mediawiki/page/rollback.js 2016-09-08 23:19:11.752172857 +0000
@@ -15,7 +15,7 @@
page = mw.util.getParamValue( 'title', url ),
user = mw.util.getParamValue( 'from', url );
- if ( !page || !user ) {
+ if ( !page || user === null ) {
// Let native browsing handle the link
return true;
}
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/src/mediawiki/mediawiki.toc.js 2016-08-30 11:17:28.762252570 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/src/mediawiki/mediawiki.toc.js 2016-09-06 16:25:53.863913527 +0000
@@ -10,7 +10,8 @@
$tocList = $toc.find( 'ul' ).eq( 0 );
// Hide/show the table of contents element
- function toggleToc() {
+ function toggleToc( e ) {
+ e.preventDefault();
if ( $tocList.is( ':hidden' ) ) {
$tocList.slideDown( 'fast' );
$tocToggleLink.text( mw.msg( 'hidetoc' ) );
@@ -30,11 +31,8 @@
hideToc = mw.cookie.get( 'hidetoc' ) === '1';
$tocToggleLink = $( '<a href="#" id="togglelink"></a>' )
- .text( hideToc ? mw.msg( 'showtoc' ) : mw.msg( 'hidetoc' ) )
- .click( function ( e ) {
- e.preventDefault();
- toggleToc();
- } );
+ .text( mw.msg( hideToc ? 'showtoc' : 'hidetoc' ) )
+ .click( toggleToc );
$tocTitle.append(
$tocToggleLink
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/src/mediawiki/mediawiki.js 2016-08-31 02:25:32.541574055 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/src/mediawiki/mediawiki.js 2016-09-06 16:25:53.863913527 +0000
@@ -1195,7 +1195,7 @@
// Force jQuery behaviour to be for crossDomain. Otherwise jQuery would use
// XHR for a same domain request instead of <script>, which changes the request
// headers (potentially missing a cache hit), and reduces caching in general
- // since browsers cache XHR much less (if at all). And XHR means we retreive
+ // since browsers cache XHR much less (if at all). And XHR means we retrieve
// text, so we'd need to $.globalEval, which then messes up line numbers.
crossDomain: true,
cache: true
@@ -1667,6 +1667,34 @@
}
}
+ /**
+ * Evaluate a batch of load.php responses retrieved from mw.loader.store.
+ *
+ * @private
+ * @param {string[]} implementations Array containing pieces of JavaScript code in the
+ * form of calls to mw.loader#implement().
+ * @param {Function} cb Callback in case of failure
+ * @param {Error} cb.err
+ */
+ function batchEval( implementations, cb ) {
+ if ( !implementations.length ) {
+ return;
+ }
+ mw.requestIdleCallback( function iterate( deadline ) {
+ while ( implementations[ 0 ] && deadline.timeRemaining() > 5 ) {
+ try {
+ $.globalEval( implementations.shift() );
+ } catch ( err ) {
+ cb( err );
+ return;
+ }
+ }
+ if ( implementations[ 0 ] ) {
+ mw.requestIdleCallback( iterate );
+ }
+ } );
+ }
+
/* Public Members */
return {
/**
@@ -1691,7 +1719,7 @@
* @protected
*/
work: function () {
- var q, batch, concatSource, origBatch;
+ var q, batch, implementations, sourceModules;
batch = [];
@@ -1708,50 +1736,50 @@
}
}
+ // Now that the queue has been processed into a batch, clear the queue.
+ // This MUST happen before we initiate any eval or network request. Otherwise,
+ // it is possible for a cached script to instantly trigger the same work queue
+ // again; all before we've cleared it causing each request to include modules
+ // which are already loaded.
+ queue = [];
+
+ if ( !batch.length ) {
+ return;
+ }
+
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
- concatSource = [];
- origBatch = batch;
+ implementations = [];
+ sourceModules = [];
batch = $.grep( batch, function ( module ) {
- var source = mw.loader.store.get( module );
- if ( source ) {
- concatSource.push( source );
+ var implementation = mw.loader.store.get( module );
+ if ( implementation ) {
+ implementations.push( implementation );
+ sourceModules.push( module );
return false;
}
return true;
} );
- try {
- $.globalEval( concatSource.join( ';' ) );
- } catch ( err ) {
+ batchEval( implementations, function ( err ) {
// Not good, the cached mw.loader.implement calls failed! This should
// never happen, barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how corrupt the string is, it is likely that some
// modules' implement() succeeded while the ones after the error will
// never run and leave their modules in the 'loading' state forever.
-
// Since this is an error not caused by an individual module but by
// something that infected the implement call itself, don't take any
// risks and clear everything in this cache.
mw.loader.store.clear();
- // Re-add the ones still pending back to the batch and let the server
- // repopulate these modules to the cache.
- // This means that at most one module will be useless (the one that had
- // the error) instead of all of them.
mw.track( 'resourceloader.exception', { exception: err, source: 'store-eval' } );
- origBatch = $.grep( origBatch, function ( module ) {
+
+ // Re-add the failed ones that are still pending back to the batch
+ var failed = $.grep( sourceModules, function ( module ) {
return registry[ module ].state === 'loading';
} );
- batch = batch.concat( origBatch );
- }
+ batchRequest( failed );
+ } );
}
- // Now that the queue has been processed into a batch, clear up the queue.
- // This MUST happen before we initiate any network request. Else it's possible
- // that a script will be locally cached, instantly load, and work the queue
- // again; all before we've cleared it causing each request to include modules
- // which are already loaded.
- queue = [];
-
batchRequest( batch );
},
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/src/mediawiki/mediawiki.Title.js 2016-08-30 11:17:28.758252539 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/src/mediawiki/mediawiki.Title.js 2016-09-06 16:25:53.859913495 +0000
@@ -164,9 +164,12 @@
'|&#x[0-9A-Fa-f]+;'
),
- // From MediaWikiTitleCodec.php#L225 @26fcab1f18c568a41
- // "Clean up whitespace" in function MediaWikiTitleCodec::splitTitleString()
- rWhitespace = /[ _\u0009\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\s]+/g,
+ // From MediaWikiTitleCodec::splitTitleString() in PHP
+ // Note that this is not equivalent to /\s/, e.g. underscore is included, tab is not included.
+ rWhitespace = /[ _\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+/g,
+
+ // From MediaWikiTitleCodec::splitTitleString() in PHP
+ rUnicodeBidi = /[\u200E\u200F\u202A-\u202E]/g,
/**
* Slightly modified from Flinfo. Credit goes to Lupo and Flominator.
@@ -181,18 +184,6 @@
replace: '',
generalRule: true
},
- // Space, underscore, tab, NBSP and other unusual spaces
- {
- pattern: rWhitespace,
- replace: ' ',
- generalRule: true
- },
- // unicode bidi override characters: Implicit, Embeds, Overrides
- {
- pattern: /[\u200E\u200F\u202A-\u202E]/g,
- replace: '',
- generalRule: true
- },
// control characters
{
pattern: /[\x00-\x1f\x7f]/g,
@@ -261,8 +252,10 @@
namespace = defaultNamespace === undefined ? NS_MAIN : defaultNamespace;
title = title
+ // Strip Unicode bidi override characters
+ .replace( rUnicodeBidi, '' )
// Normalise whitespace to underscores and remove duplicates
- .replace( /[ _\s]+/g, '_' )
+ .replace( rWhitespace, '_' )
// Trim underscores
.replace( rUnderscoreTrim, '' );
@@ -557,8 +550,8 @@
namespace = defaultNamespace === undefined ? NS_MAIN : defaultNamespace;
- // Normalise whitespace and remove duplicates
- title = $.trim( title.replace( rWhitespace, ' ' ) );
+ // Normalise additional whitespace
+ title = $.trim( title.replace( /\s/g, ' ' ) );
// Process initial colon
if ( title !== '' && title[ 0 ] === ':' ) {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/pl.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/pl.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Rafal Hirsz : https://github.com/evoL
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/cs.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/cs.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : petrbela : https://github.com/petrbela
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/az.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/az.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : topchiyev : https://github.com/topchiyev
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var suffixes = {
1: '-inci',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ar-sa.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ar-sa.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Suhail Alkowaileet : https://github.com/xsoh
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '١',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/lb.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/lb.js 2016-09-13 23:17:13.852190432 +0000
@@ -7,13 +7,15 @@
// and 'eifelerRegelAppliesToNumber' methods are meant for
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/de.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/de.js 2016-09-13 23:17:13.848190400 +0000
@@ -4,13 +4,15 @@
// author: Menelion Elensúle: https://github.com/Oire
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sk.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sk.js 2016-09-13 23:17:13.852190432 +0000
@@ -4,13 +4,15 @@
// based on work of petrbela : https://github.com/petrbela
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/lt.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/lt.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Mindaugas Mozūras : https://github.com/mmozuras
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var units = {
'm' : 'minutė_minutės_minutę',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/bn.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/bn.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Kaushik Gandhi : https://github.com/kaushikgandhi
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '১',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/fo.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/fo.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Ragnar Johannesen : https://github.com/ragnar123
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('fo', {
months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/de-at.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/de-at.js 2016-09-13 23:17:13.844190368 +0000
@@ -5,13 +5,15 @@
// author : Martin Groller : https://github.com/MadMG
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sr-cyrl.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sr-cyrl.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var translator = {
words: { //Different grammatical cases
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/uz.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/uz.js 2016-09-13 23:17:13.856190464 +0000
@@ -3,13 +3,15 @@
// author : Sardor Muminov : https://github.com/muminoff
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('uz', {
months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ar.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ar.js 2016-09-13 23:17:13.844190368 +0000
@@ -5,13 +5,15 @@
// Native plural forms: forabi https://github.com/forabi
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '١',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/tzm.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/tzm.js 2016-09-13 23:17:13.856190464 +0000
@@ -3,13 +3,15 @@
// author : Abdel Said : https://github.com/abdelsaid
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('tzm', {
months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ta.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ta.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
/*var symbolMap = {
'1': '௧',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ca.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ca.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ca', {
months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/pt-br.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/pt-br.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('pt-br', {
months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/en-ca.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/en-ca.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Jonathan Abourbih : https://github.com/jonbca
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('en-ca', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/bg.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/bg.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Krasen Borisov : https://github.com/kraz
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('bg', {
months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/da.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/da.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Ulrik Nielsen : https://github.com/mrbase
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('da', {
months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/vi.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/vi.js 2016-09-13 23:17:13.856190464 +0000
@@ -3,13 +3,15 @@
// author : Bang Nguyen : https://github.com/bangnk
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('vi', {
months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ko.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ko.js 2016-09-13 23:17:13.852190432 +0000
@@ -6,13 +6,15 @@
// - Kyungwook, Park : https://github.com/kyungw00k
// - Jeeeyul Lee <jeeeyul@gmail.com>
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ko', {
months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/lv.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/lv.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Kristaps Karlsons : https://github.com/skakri
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var units = {
'mm': 'minūti_minūtes_minūte_minūtes',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/hi.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/hi.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Mayank Singhal : https://github.com/mayanksinghal
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '१',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/uk.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/uk.js 2016-09-13 23:17:13.856190464 +0000
@@ -4,13 +4,15 @@
// Author : Menelion Elensúle : https://github.com/Oire
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function plural(word, num) {
var forms = word.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/mk.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/mk.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Borislav Mickov : https://github.com/B0k0
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('mk', {
months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/es.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/es.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Julio Napurí : https://github.com/julionc
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/hr.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/hr.js 2016-09-13 23:17:13.848190400 +0000
@@ -5,13 +5,15 @@
// based on (sl) translation by Robert Sedovšek
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function translate(number, withoutSuffix, key) {
var result = number + ' ';
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/th.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/th.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Kridsada Thanabulpong : https://github.com/sirn
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('th', {
months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ml.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ml.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Floyd Pink : https://github.com/floydpink
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ml', {
months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sv.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sv.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Jens Alm : https://github.com/ulmus
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('sv', {
months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ka.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ka.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Irakli Janiashvili : https://github.com/irakli-janiashvili
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function monthsCaseReplace(m, format) {
var months = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/hu.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/hu.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Adam Brunner : https://github.com/adambrunner
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/is.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/is.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Hinrik Örn Sigurðsson : https://github.com/hinrik
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function plural(n) {
if (n % 100 === 11) {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/et.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/et.js 2016-09-13 23:17:13.848190400 +0000
@@ -4,13 +4,15 @@
// improvements : Illimar Tambek : https://github.com/ragulka
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sl.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sl.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Robert Sedovšek : https://github.com/sedovsek
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function translate(number, withoutSuffix, key) {
var result = number + ' ';
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/be.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/be.js 2016-09-13 23:17:13.844190368 +0000
@@ -5,13 +5,15 @@
// Author : Menelion Elensúle : https://github.com/Oire
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function plural(word, num) {
var forms = word.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/zh-tw.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/zh-tw.js 2016-09-13 23:17:13.856190464 +0000
@@ -3,13 +3,15 @@
// author : Ben : https://github.com/ben-lin
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('zh-tw', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/mr.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/mr.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Harshad Kale : https://github.com/kalehv
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '१',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/el.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/el.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Aggelos Karalias : https://github.com/mehiel
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('el', {
monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/tr.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/tr.js 2016-09-13 23:17:13.856190464 +0000
@@ -4,13 +4,15 @@
// Burak Yiğit Kaya: https://github.com/BYK
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var suffixes = {
1: '\'inci',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/tl-ph.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/tl-ph.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Dan Hagman
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('tl-ph', {
months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/he.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/he.js 2016-09-13 23:17:13.848190400 +0000
@@ -5,13 +5,15 @@
// author : Tal Ater : https://github.com/TalAter
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('he', {
months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ru.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ru.js 2016-09-13 23:17:13.852190432 +0000
@@ -4,13 +4,15 @@
// Author : Menelion Elensúle : https://github.com/Oire
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function plural(word, num) {
var forms = word.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/zh-cn.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/zh-cn.js 2016-09-13 23:17:13.856190464 +0000
@@ -4,13 +4,15 @@
// author : Zeno Zeng : https://github.com/zenozeng
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('zh-cn', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ne.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ne.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : suvash : https://github.com/suvash
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '१',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/it.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/it.js 2016-09-13 23:17:13.848190400 +0000
@@ -4,13 +4,15 @@
// author: Mattia Larentis: https://github.com/nostalgiaz
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('it', {
months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/fr.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/fr.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : John Fischer : https://github.com/jfroffice
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('fr', {
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/tzm-latn.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/tzm-latn.js 2016-09-13 23:17:13.856190464 +0000
@@ -3,13 +3,15 @@
// author : Abdel Said : https://github.com/abdelsaid
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('tzm-latn', {
months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/en-au.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/en-au.js 2016-09-13 23:17:13.848190400 +0000
@@ -2,13 +2,15 @@
// locale : australian english (en-au)
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('en-au', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/eu.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/eu.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Eneko Illarramendi : https://github.com/eillarra
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('eu', {
months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sq.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sq.js 2016-09-13 23:17:13.852190432 +0000
@@ -5,13 +5,15 @@
// author : Oerd Cukalla : https://github.com/oerd (fixes)
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('sq', {
months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ja.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ja.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : LI Long : https://github.com/baryon
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ja', {
months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/bo.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/bo.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Thupten N. Chakrishar : https://github.com/vajradog
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '༡',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/af.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/af.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Werner Mollentze : https://github.com/wernerm
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('af', {
months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/cy.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/cy.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Robert Allen
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('cy', {
months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ms-my.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ms-my.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Weldan Jamili : https://github.com/weldan
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ms-my', {
months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/nl.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/nl.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Joris Röling : https://github.com/jjupiter
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/fi.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/fi.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Tarmo Aidantausta : https://github.com/bleadof
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
numbersFuture = [
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/nn.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/nn.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : https://github.com/mechuwind
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('nn', {
months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/bs.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/bs.js 2016-09-13 23:17:13.844190368 +0000
@@ -4,13 +4,15 @@
// based on (hr) translation by Bojan Marković
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function translate(number, withoutSuffix, key) {
var result = number + ' ';
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/cv.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/cv.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Anatoly Mironov : https://github.com/mirontoli
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('cv', {
months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/id.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/id.js 2016-09-13 23:17:13.848190400 +0000
@@ -4,13 +4,15 @@
// reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('id', {
months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ar-ma.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ar-ma.js 2016-09-13 23:17:13.844190368 +0000
@@ -4,13 +4,15 @@
// author : Abdel Said : https://github.com/abdelsaid
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('ar-ma', {
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/nb.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/nb.js 2016-09-13 23:17:13.852190432 +0000
@@ -4,13 +4,15 @@
// Sigurd Gartmann : https://github.com/sigurdga
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('nb', {
months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/my.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/my.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Squar team, mysquar.com
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '၁',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/br.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/br.js 2016-09-13 23:17:13.844190368 +0000
@@ -3,13 +3,15 @@
// author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function relativeTimeWithMutation(number, withoutSuffix, key) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/sr.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/sr.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var translator = {
words: { //Different grammatical cases
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/fr-ca.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/fr-ca.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Jonathan Abourbih : https://github.com/jonbca
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('fr-ca', {
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/pt.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/pt.js 2016-09-13 23:17:13.852190432 +0000
@@ -3,13 +3,15 @@
// author : Jefferson : https://github.com/jalex79
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('pt', {
months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/gl.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/gl.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Juan G. Hurtado : https://github.com/juanghurtado
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('gl', {
months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/hy-am.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/hy-am.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Armendarabyan : https://github.com/armendarabyan
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function monthsCaseReplace(m, format) {
var months = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/km.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/km.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Kruy Vanna : https://github.com/kruyvanna
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('km', {
months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/ro.js 2016-08-30 11:17:28.618251465 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/ro.js 2016-09-13 23:17:13.852190432 +0000
@@ -4,13 +4,15 @@
// author : Valentin Agachi : https://github.com/avaly
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/fa.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/fa.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Ebrahim Byagowi : https://github.com/ebraminio
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
var symbolMap = {
'1': '۱',
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/eo.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/eo.js 2016-09-13 23:17:13.848190400 +0000
@@ -5,13 +5,15 @@
// Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('eo', {
months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/resources/lib/moment/locale/en-gb.js 2016-08-30 11:17:28.614251435 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/resources/lib/moment/locale/en-gb.js 2016-09-13 23:17:13.848190400 +0000
@@ -3,13 +3,15 @@
// author : Chris Gedrim : https://github.com/chrisgedrim
(function (factory) {
- if (typeof define === 'function' && define.amd) {
+ // Comment out broken wrapper, see T145382
+ /*if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
- }
+ }*/
+ factory(this.moment);
}(function (moment) {
return moment.defineLocale('en-gb', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
--- /srv/mediawiki/php-1.28.0-wmf.17/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js 2016-08-30 11:17:28.854253275 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js 2016-09-06 16:25:53.951914204 +0000
@@ -38,6 +38,8 @@
'A < B',
'A > B',
'A | B',
+ 'A \t B',
+ 'A \n B',
// URL encoding
'A%20B',
'A%23B',
@@ -222,7 +224,7 @@
assert.equal( title.getPrefixedText(), '.foo' );
} );
- QUnit.test( 'Transformation', 11, function ( assert ) {
+ QUnit.test( 'Transformation', 12, function ( assert ) {
var title;
title = new mw.Title( 'File:quux pif.jpg' );
@@ -242,10 +244,12 @@
assert.equal( title.toText(), 'User:HAshAr' );
assert.equal( title.getNamespaceId(), 2, 'Case-insensitive namespace prefix' );
- // Don't ask why, it's the way the backend works. One space is kept of each set.
- title = new mw.Title( 'Foo __ \t __ bar' );
+ title = new mw.Title( 'Foo \u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000 bar' );
assert.equal( title.getMain(), 'Foo_bar', 'Merge multiple types of whitespace/underscores into a single underscore' );
+ title = new mw.Title( 'Foo\u200E\u200F\u202A\u202B\u202C\u202D\u202Ebar' );
+ assert.equal( title.getMain(), 'Foobar', 'Strip Unicode bidi override characters' );
+
// Regression test: Previously it would only detect an extension if there is no space after it
title = new mw.Title( 'Example.js ' );
assert.equal( title.getExtension(), 'js', 'Space after an extension is stripped' );
--- /srv/mediawiki/php-1.28.0-wmf.17/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 2016-08-30 11:17:28.854253275 +0000
+++ /srv/mediawiki/php-1.28.0-wmf.18/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 2016-09-06 16:25:53.951914204 +0000
@@ -237,20 +237,6 @@
assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' );
} );
- QUnit.test( 'tooltipAccessKey', 4, function ( assert ) {
- this.suppressWarnings();
-
- assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'tooltipAccessKeyPrefix must be a string' );
- assert.equal( $.type( mw.util.tooltipAccessKeyRegexp ), 'regexp', 'tooltipAccessKeyRegexp is a regexp' );
- assert.ok( mw.util.updateTooltipAccessKeys, 'updateTooltipAccessKeys is non-empty' );
-
- 'Example [a]'.replace( mw.util.tooltipAccessKeyRegexp, function ( sub, m1, m2, m3, m4, m5, m6 ) {
- assert.equal( m6, 'a', 'tooltipAccessKeyRegexp finds the accesskey hint' );
- } );
-
- this.restoreWarnings();
- } );
-
QUnit.test( '$content', 2, function ( assert ) {
assert.ok( mw.util.$content instanceof jQuery, 'mw.util.$content instance of jQuery' );
assert.strictEqual( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' );