diff --git a/extension.json b/extension.json index 42f04c9b86..26e05729cb 100644 --- a/extension.json +++ b/extension.json @@ -1126,7 +1126,6 @@ "jquery.cookie", "jquery.byteLimit", "mediawiki.skinning.content.parsoid", - "mediawiki.language.specialCharacters", "mediawiki.widgets", "ext.visualEditor.switching" ], diff --git a/lib/ve b/lib/ve index eb97c1fc09..d1ce123f9f 160000 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit eb97c1fc0959980e08ecb16b331547fb9a7294f5 +Subproject commit d1ce123f9ff1f46d86476c86b8ccb23d04ee35a7 diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js b/modules/ve-mw/init/ve.init.mw.Platform.js index 70062fcd51..d589ebfa8e 100644 --- a/modules/ve-mw/init/ve.init.mw.Platform.js +++ b/modules/ve-mw/init/ve.init.mw.Platform.js @@ -182,35 +182,36 @@ ve.init.mw.Platform.prototype.getUserLanguages = mw.language.getFallbackLanguage * @inheritdoc */ ve.init.mw.Platform.prototype.fetchSpecialCharList = function () { - var characters = {}, - otherGroupName = mw.msg( 'visualeditor-special-characters-group-other' ), - otherMsg = mw.msg( 'visualeditor-quick-access-characters.json' ), - groupObject; + return mw.loader.using( 'mediawiki.language.specialCharacters' ).then( function () { + var characters = {}, + otherGroupName = mw.msg( 'visualeditor-special-characters-group-other' ), + otherMsg = mw.msg( 'visualeditor-quick-access-characters.json' ), + groupObject; - if ( otherMsg !== '' ) { - try { - characters[ otherGroupName ] = JSON.parse( otherMsg ); - } catch ( err ) { - ve.log( 've.init.mw.Platform: Could not parse the Special Character list.' ); - ve.log( err ); - } - } - - $.each( mw.language.specialCharacters, function ( groupName, groupCharacters ) { - groupObject = {}; // button label => character data to insert - $.each( groupCharacters, function ( charKey, charVal ) { - // VE has a different format and it would be a pain to change it now - if ( typeof charVal === 'string' ) { - groupObject[ charVal ] = charVal; - } else if ( typeof charVal === 'object' && 0 in charVal && 1 in charVal ) { - groupObject[ charVal[ 0 ] ] = charVal[ 1 ]; - } else { - groupObject[ charVal.label ] = charVal; + if ( otherMsg !== '' ) { + try { + characters[ otherGroupName ] = JSON.parse( otherMsg ); + } catch ( err ) { + ve.log( 've.init.mw.Platform: Could not parse the Special Character list.' ); + ve.log( err ); } - } ); - characters[ mw.msg( 'special-characters-group-' + groupName ) ] = groupObject; - } ); + } - // This implementation always resolves instantly - return $.Deferred().resolve( characters ).promise(); + $.each( mw.language.specialCharacters, function ( groupName, groupCharacters ) { + groupObject = {}; // button label => character data to insert + $.each( groupCharacters, function ( charKey, charVal ) { + // VE has a different format and it would be a pain to change it now + if ( typeof charVal === 'string' ) { + groupObject[ charVal ] = charVal; + } else if ( typeof charVal === 'object' && 0 in charVal && 1 in charVal ) { + groupObject[ charVal[ 0 ] ] = charVal[ 1 ]; + } else { + groupObject[ charVal.label ] = charVal; + } + } ); + characters[ mw.msg( 'special-characters-group-' + groupName ) ] = groupObject; + } ); + + return characters; + } ); };