사용자:Ellif/common.js: 두 판 사이의 차이
(새 문서: var customizeToolbar = function () { →Your code goes here: "‘’": { "action": { "type": "encapsulate", "options": { "pre":...) |
잔글편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
var customizeToolbar = function () { | var customizeToolbar = function () { | ||
/* Your code goes here */ | /* Your code goes here */ | ||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'characters', | |||
'pages': { | |||
'emoticons': { | |||
'layout': 'characters', | |||
'label': 'Emoticons', | |||
'characters': | |||
"‘’": { | "‘’": { | ||
"action": { | "action": { |
2021년 1월 28일 (목) 18:34 판
var customizeToolbar = function () {
/* Your code goes here */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'characters',
'pages': {
'emoticons': {
'layout': 'characters',
'label': 'Emoticons',
'characters':
"‘’": {
"action": {
"type": "encapsulate",
"options": {
"pre": "‘",
"post": "’"
}
}
},
"“”": {
"action": {
"type": "encapsulate",
"options": {
"pre": "“",
"post": "”"
}
}
},
"’": "’",
"·": "·",
"〈〉": {
"action": {
"type": "encapsulate",
"options": {
"pre": "〈",
"post": "〉"
}
}
},
"「」": {
"action": {
"type": "encapsulate",
"options": {
"pre": "「",
"post": "」"
}
}
},
"『』": {
"action": {
"type": "encapsulate",
"options": {
"pre": "『",
"post": "』"
}
}
},
"《》": {
"action": {
"type": "encapsulate",
"options": {
"pre": "《",
"post": "》"
}
}
},
"—": {
"titleMsg": "special-characters-title-emdash",
"action": {
"type": "replace",
"options": {
"peri": "—",
"selectPeri": false
}
}
},
"⸺": {
"titleMsg": "special-characters-title-two-emdash",
"action": {
"type": "replace",
"options": {
"peri": "⸺",
"selectPeri": false
}
}
},
"△": "△",
"▲": "▲",
"□": "□",
"■": "■",
"¹": "¹",
"²": "²",
"³": "³",
"←": "←",
"→": "→",
"↑": "↑",
"↓": "↓",
"↘": "↘",
"↗": "↗",
"⇐": "⇐",
"⇒": "⇒",
"⇘": "⇘",
"⇗": "⇗",
"☆": "☆",
"★": "★",
"㈜": "㈜",
"틀:del": {
"action": {
"type": "encapsulate",
"options": {
"pre": "{{del|",
"post": "}}"
}
}
},
"\u003Cdel\u003E": {
"action": {
"type": "encapsulate",
"options": {
"pre": "\u003Cdel\u003E",
"post": "\u003C/del\u003E"
}
}
},
"틀:()": {
"action": {
"type": "encapsulate",
"options": {
"pre": "{{()|",
"post": "}}"
}
}
}
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
mw.loader.using( 'user.options' ).then( function () {
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor' ), $.ready
).then( customizeToolbar );
}
} );
}