summaryrefslogtreecommitdiff
path: root/extensions/WikiEditor/modules
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/WikiEditor/modules')
-rw-r--r--extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js39
-rw-r--r--extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js16
2 files changed, 49 insertions, 6 deletions
diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js
index 52b7498f..1477a332 100644
--- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js
+++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js
@@ -613,9 +613,42 @@ getDefaultConfig: function() {
"\u20ac", "\u20a0", "\u20a3", "\u0192", "\u20b4", "\u20ad", "\u20a4", "\u2133", "\u20a5",
"\u20a6", "\u2116", "\u20a7", "\u20b0", "\u00a3", "\u17db", "\u20a8", "\u20aa", "\u09f3",
"\u20ae", "\u20a9", "\u00a5", "\u2660", "\u2663", "\u2665", "\u2666", "m\u00b2", "m\u00b3",
- "\u2013", "\u2014", "\u2026", "\u2018", "\u2019", "\u201c", "\u201d", "\u00b0", "\u2032",
- "\u2033", "\u2248", "\u2260", "\u2264", "\u2265", "\u00b1", "\u2212", "\u00d7", "\u00f7",
- "\u2190", "\u2192", "\u00b7", "\u00a7", "\u203D"
+ {
+ 'label': "\u2013",
+ 'titleMsg': 'wikieditor-toolbar-characters-endash',
+ 'action' : {
+ 'type' : 'replace',
+ 'options' : {
+ 'peri' : "\u2013",
+ 'selectPeri': false
+ }
+ }
+ },
+ {
+ 'label': "\u2014",
+ 'titleMsg': 'wikieditor-toolbar-characters-emdash',
+ 'action' : {
+ 'type' : 'replace',
+ 'options' : {
+ 'peri' : "\u2014",
+ 'selectPeri': false
+ }
+ }
+ },
+ "\u2026", "\u2018", "\u2019", "\u201c", "\u201d", "\u00b0", "\u2032",
+ "\u2033", "\u2248", "\u2260", "\u2264", "\u2265", "\u00b1",
+ {
+ 'label': "\u2212",
+ 'titleMsg': 'wikieditor-toolbar-characters-minus',
+ 'action' : {
+ 'type' : 'replace',
+ 'options' : {
+ 'peri' : "\u2212",
+ 'selectPeri': false
+ }
+ }
+ },
+ "\u00d7", "\u00f7", "\u2190", "\u2192", "\u00b7", "\u00a7", "\u203D"
]
},
'greek': {
diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
index e7d2213a..9024ba1d 100644
--- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
+++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
@@ -1,7 +1,7 @@
/**
* Toolbar module for wikiEditor
*/
-( function( $ ) { $.wikiEditor.modules.toolbar = {
+( function ( mw, $ ) { $.wikiEditor.modules.toolbar = {
/**
* API accessible functions
@@ -563,6 +563,8 @@ fn: {
}
}
};
+ // In some cases the label for the character isn't the same as the
+ // character that gets inserted (e.g. Hebrew vowels)
} else if ( character && 0 in character && 1 in character ) {
character = {
'label' : character[0],
@@ -577,7 +579,15 @@ fn: {
}
if ( character && 'action' in character && 'label' in character ) {
actions[character.label] = character.action;
- return '<span rel="' + character.label + '">' + character.label + '</span>';
+ if ( character.titleMsg !== undefined ) {
+ return mw.html.element(
+ 'span',
+ { 'rel': character.label, 'title': mw.msg( character.titleMsg ) },
+ character.label
+ );
+ } else {
+ return mw.html.element( 'span', { 'rel': character.label }, character.label );
+ }
}
mw.log( "A character for the toolbar was undefined. This is not supposed to happen. Double check the config." );
return ""; // bug 31673; also an additional fix for bug 24208...
@@ -780,4 +790,4 @@ fn: {
}
}
-}; } )( jQuery );
+}; } )( mediaWiki, jQuery );