diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 27ae9d9c9d..13f59dcc58 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -66,7 +66,7 @@ class VisualEditorHooks { public static function onContentHandlerDefaultModelFor( Title $title, &$model ) { $messages = array( 'Visualeditor-cite-tool-definition.json', - 'Visualeditor-specialcharinspector-characterlist-insert' + 'Visualeditor-quick-access-characters.json' ); if ( $title->inNamespace( NS_MEDIAWIKI ) && in_array( $title->getText(), $messages ) ) { diff --git a/VisualEditor.php b/VisualEditor.php index 60d692d7f3..3f2dab3927 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -322,6 +322,10 @@ $wgResourceModules += array( 'ext.visualEditor.targetLoader', 'jquery.uls.data', ), + 'messages' => array( + 'visualeditor-quick-access-characters.json', + 'visualeditor-special-characters-group-other' + ), 'targets' => array( 'desktop', 'mobile' ), ), @@ -772,7 +776,6 @@ $wgResourceModules += array( 'visualeditor-slug-insert', 'visualeditor-specialcharacter-button-tooltip', 'visualeditor-specialcharacterinspector-title', - 'visualeditor-specialcharinspector-characterlist-insert', 'visualeditor-table-caption', 'visualeditor-table-delete-col', 'visualeditor-table-delete-row', diff --git a/extension.json b/extension.json index e47424f594..66d7fdb67c 100644 --- a/extension.json +++ b/extension.json @@ -384,6 +384,10 @@ "styles": [ "modules/ve-mw/init/styles/ve.init.mw.Target.css" ], + "messages": [ + "visualeditor-quick-access-characters.json", + "visualeditor-special-characters-group-other" + ], "dependencies": [ "jquery.byteLength", "jquery.client", @@ -821,7 +825,6 @@ "visualeditor-slug-insert", "visualeditor-specialcharacter-button-tooltip", "visualeditor-specialcharacterinspector-title", - "visualeditor-specialcharinspector-characterlist-insert", "visualeditor-table-caption", "visualeditor-table-delete-col", "visualeditor-table-delete-row", diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json index cadb404a81..8829490e45 100644 --- a/modules/ve-mw/i18n/en.json +++ b/modules/ve-mw/i18n/en.json @@ -316,5 +316,6 @@ "visualeditor-viewpage-savewarning-title": "Are you sure?", "visualeditor-wikitext-warning": "You are using VisualEditor - [[{{MediaWiki:visualeditor-wikitext-warning-link}}|wikitext]] does not work here. To switch to source editing at any time without losing your changes, open the dropdown menu next to \"{{int:visualeditor-toolbar-savedialog}}\" and select \"{{int:visualeditor-mweditmodesource-title}}\".", "visualeditor-wikitext-warning-link": "mediawikiwiki:Special:MyLanguage/Help:Formatting", - "visualeditor-wikitext-warning-title": "Wikitext markup detected" + "visualeditor-wikitext-warning-title": "Wikitext markup detected", + "visualeditor-special-characters-group-other": "Often used" } diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json index 93690f2c2b..92292abae5 100644 --- a/modules/ve-mw/i18n/qqq.json +++ b/modules/ve-mw/i18n/qqq.json @@ -325,5 +325,6 @@ "visualeditor-viewpage-savewarning-title": "Title of the dialog shown when the user tries to leave the editor without saving their changes.\n\nFollowed by the following buttons:\n* {{msg-mw|Visualeditor-viewpage-savewarning-discard}}\n* {{msg-mw|Visualeditor-viewpage-savewarning-keep}}\n{{Identical|Are you sure?}}", "visualeditor-wikitext-warning": "Contents of notification displayed when Wikitext has been detected.\n\nRefers to:\n* {{msg-mw|Visualeditor-wikitext-warning-link}}\n* {{msg-mw|Visualeditor-toolbar-cancel}}\n* {{msg-mw|Visualeditor-mweditmodesource-title}}\nSee also:\n* {{msg-mw|Visualeditor-beta-warning}}", "visualeditor-wikitext-warning-link": "Link to page describing what Wikitext is.\n\nUsed in:\n* {{msg-mw|Visualeditor-wikitext-warning}}.\n\nTranslate to a title where most wikis in the language you're translating to have one such help page; if they don't have one, you can use [[mw:Special:MyLanguage/Help:Formatting]] as target.", - "visualeditor-wikitext-warning-title": "Title of notification displayed when Wikitext has been detected" + "visualeditor-wikitext-warning-title": "Title of notification displayed when Wikitext has been detected", + "visualeditor-special-characters-group-other": "Label of the special character group shown if the wiki has visualeditor-quick-access-characters.json set up." } diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js b/modules/ve-mw/init/ve.init.mw.Platform.js index ab68e06661..fafe80055f 100644 --- a/modules/ve-mw/init/ve.init.mw.Platform.js +++ b/modules/ve-mw/init/ve.init.mw.Platform.js @@ -114,7 +114,19 @@ ve.init.mw.Platform.prototype.getUserLanguages = function () { */ 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; + + 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 = {}; // key is label, value is char to insert $.each( groupCharacters, function ( charKey, charVal ) {