利用者:Mr.R1234/sandbox.js
表示
お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。
多くの Windows や Linux のブラウザ
- Ctrl を押しながら F5 を押す。
Mac における Safari
Mac における Chrome や Firefox
- ⌘ Cmd と ⇧ Shift を押しながら R を押す。
詳細についてはWikipedia:キャッシュを消すをご覧ください。
function CustomizeEditform() {
$(document.editform.wpTextbox1).wikiEditor('addToToolbar', {
sections: {
'mytools': {
type: 'booklet',
label: '訂正',
pages: {
'mysnippet': {
label: 'スニペット',
layout: 'characters',
characters: [
'<br/>',
{
label: '{{要出典範囲}}',
action: {
type: 'encapsulate',
options: {
pre: '{{要出典|date=' + (new Date()).getUTCFullYear() + '年' + ((new Date()).getUTCMonth() + 1) + '月|',
peri: '',
post: '}}'
}
},
},
],
},
'myedit': {
label: '編集',
layout: 'characters',
characters: [
{
label: '改行削除',
action: {
type: 'replace',
options: {
regex: /\r|\n/g,
regexReplace: '',
}
},
},
],
},
},
}
}
});
}
$(function () {
if (document.editform) {
mw.loader.using('user.options').then(function () {
if (mw.user.options.get('usebetatoolbar') == 1) {
mw.loader.using('ext.wikiEditor.toolbar').then(CustomizeEditform);
}
});
}
});