49,332
edits
(→Japanese characters: new section) |
|||
Line 420: | Line 420: | ||
Is there a way to incorporate Japanese hiragana and katakana characters into the "special characters" in the box above the editing field? It would be more convenient for editors to include and transcribe Japanese characters if they need to without resorting to copy-pasting or using an external source to incorporate Japanese characters. Thanks! {{User:Mario/sig}} 22:43, 8 June 2015 (EDT) | Is there a way to incorporate Japanese hiragana and katakana characters into the "special characters" in the box above the editing field? It would be more convenient for editors to include and transcribe Japanese characters if they need to without resorting to copy-pasting or using an external source to incorporate Japanese characters. Thanks! {{User:Mario/sig}} 22:43, 8 June 2015 (EDT) | ||
:I followed [http://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization this page] and came up with the JavaScript below, but it doesn't work. If anyone can get this working on their [[Special:Mypage/common.js|user JS]] then we can customize it and add it to the main JS. | |||
<pre>var customizeToolbar = function() { | |||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'characters', | |||
'pages': { | |||
'emoticons': { | |||
'layout': 'characters', | |||
'label': 'Emoticons', | |||
'characters': [ ':)', ':))', ':(', '<3', ';)' ] | |||
} | |||
} | |||
} ); | |||
}; | |||
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar */ | |||
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) { | |||
mw.loader.using( 'user.options', function () { | |||
// This can be the string "0" if the user disabled the preference | |||
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) { | |||
$.when( | |||
mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready | |||
).then( customizeToolbar ); | |||
} | |||
} ); | |||
}</pre> | |||
:--{{User:Porplemontage/sig}} 00:57, 9 June 2015 (EDT) |