我正在尝试为我的 WikiEdit 工具栏创建一个自定义选择按钮。但是,我找不到如何使用我的 wiki 页面上的所有模板动态填充它。
到目前为止,这是我添加到 common.js 文件中的内容:
var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'templates': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Templates'
// or 'labelMsg': 'section-emoticons-label' for a localized label
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'templates',
'groups': {
'templates': {
'label': 'add-template' // or use labelMsg for a localized label, see above
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'templates',
'group': 'templates',
'tools': {
'choose': {
label: 'Add Template!',
type: 'select',
action: {
type: 'module',
options: {
{{Special:Allpages/Template|mode=list}} // this does not work, but I suppose I need something similar
}
}
}
}
} );
}