mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Update VE core submodule to master (d1ce123)
New changes: 6cf8864 Follow-up eb97c1f: Fix build for added language 'inh' d1ce123 SpecialCharacterDialog: Use getReadyProcess promise to wait for char list Local changes: * SpecialCharacterDialog: Defer loading of character list. Saves ~40k for most users who never use it. Change-Id: I74b30fee96e1ae4463ed28c19bef4b515330220e Depends-On: I45dc9f788aa5bd702b91ffd9f63b05b1f4760691
This commit is contained in:
parent
7df0e7589e
commit
fd3683e414
|
@ -1126,7 +1126,6 @@
|
|||
"jquery.cookie",
|
||||
"jquery.byteLimit",
|
||||
"mediawiki.skinning.content.parsoid",
|
||||
"mediawiki.language.specialCharacters",
|
||||
"mediawiki.widgets",
|
||||
"ext.visualEditor.switching"
|
||||
],
|
||||
|
|
2
lib/ve
2
lib/ve
|
@ -1 +1 @@
|
|||
Subproject commit eb97c1fc0959980e08ecb16b331547fb9a7294f5
|
||||
Subproject commit d1ce123f9ff1f46d86476c86b8ccb23d04ee35a7
|
|
@ -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 !== '<visualeditor-quick-access-characters.json>' ) {
|
||||
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 !== '<visualeditor-quick-access-characters.json>' ) {
|
||||
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;
|
||||
} );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue