mediawiki.js: Reorder setGlobalMapValue() to avoid a forward reference.
mediawiki.action.edit.stash.js: Reorder two functions without to avoid
forward references.
In all other cases add eslint-disable-next-line no-use-before-define.
Change-Id: Ic8b2f8cf61dcfb1a215ad3d3dddfd40282e3e836
* @class mw.Uri
*/
-/* eslint-disable no-use-before-define */
-
( function ( mw, $ ) {
var parser, properties;
return uri;
}
href = hrefCur;
+ // eslint-disable-next-line no-use-before-define
uri = new Uri( href );
return uri;
};
/*!
* Scripts for pre-emptive edit preparing on action=edit
*/
-/* eslint-disable no-use-before-define */
+
( function ( mw, $ ) {
if ( !mw.config.get( 'wgAjaxEditStash' ) ) {
return;
return;
}
+ // Whether the body text content changed since the last stashEdit()
+ function isTextChanged() {
+ return lastText !== $text.textSelection( 'getContents' );
+ }
+
+ // Whether the edit summary has changed since the last stashEdit()
+ function isSummaryChanged() {
+ return lastSummary !== $summary.textSelection( 'getContents' );
+ }
+
// Send a request to stash the edit to the API.
// If a request is in progress, abort it since its payload is stale and the API
// may limit concurrent stash parses.
if ( stashReq ) {
if ( lastPriority > priority ) {
// Stash request for summary change should wait on pending text change stash
+ // eslint-disable-next-line no-use-before-define
stashReq.then( checkStash );
return;
}
} );
}
- // Whether the body text content changed since the last stashEdit()
- function isTextChanged() {
- return lastText !== $text.textSelection( 'getContents' );
- }
-
- // Whether the edit summary has changed since the last stashEdit()
- function isSummaryChanged() {
- return lastSummary !== $summary.textSelection( 'getContents' );
- }
-
// Check whether text or summary have changed and call stashEdit()
function checkStash() {
if ( !isTextChanged() && !isSummaryChanged() ) {
* Implement AJAX navigation for multi-page images so the user may browse without a full page reload.
*/
-/* eslint-disable no-use-before-define */
-
( function ( mw, $ ) {
var jqXhr, $multipageimage, $spinner,
cache = {},
// Replace table contents
$multipageimage.empty().append( $contents.clone() );
+ // eslint-disable-next-line no-use-before-define
bindPageNavigation( $multipageimage );
// Fire hook because the page's content has changed
*/
/* global mwNow */
-/* eslint-disable no-use-before-define */
( function ( $ ) {
'use strict';
}() );
}
+ /**
+ * Alias property to the global object.
+ *
+ * @private
+ * @static
+ * @member mw.Map
+ * @param {mw.Map} map
+ * @param {string} key
+ * @param {Mixed} value
+ */
+ function setGlobalMapValue( map, key, value ) {
+ map.values[ key ] = value;
+ log.deprecate(
+ window,
+ key,
+ value,
+ // Deprecation notice for mw.config globals (T58550, T72470)
+ map === mw.config && 'Use mw.config instead.'
+ );
+ }
+
/**
* Create an object that can be read from or written to via methods that allow
* interaction both with single and multiple properties at once.
}
}
- /**
- * Alias property to the global object.
- *
- * @private
- * @static
- * @param {mw.Map} map
- * @param {string} key
- * @param {Mixed} value
- */
- function setGlobalMapValue( map, key, value ) {
- map.values[ key ] = value;
- log.deprecate(
- window,
- key,
- value,
- // Deprecation notice for mw.config globals (T58550, T72470)
- map === mw.config && 'Use mw.config instead.'
- );
- }
-
Map.prototype = {
constructor: Map,
mw.loader.store.set( module, registry[ module ] );
for ( m in registry ) {
if ( registry[ m ].state === 'loaded' && allReady( registry[ m ].dependencies ) ) {
+ // eslint-disable-next-line no-use-before-define
execute( m );
}
}