mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 02:38:40 +00:00
Merge "Support an "other" page for special characters"
This commit is contained in:
commit
2a8c61b57f
|
@ -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 ) ) {
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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."
|
||||
}
|
||||
|
|
|
@ -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 !== '<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 = {}; // key is label, value is char to insert
|
||||
$.each( groupCharacters, function ( charKey, charVal ) {
|
||||
|
|
Loading…
Reference in a new issue