Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- tinymce.PluginManager.add('ref_mce_button', function( editor, url ) {
- editor.addButton( 'ref_mce_button', {
- title: 'Отзывы',
- icon: 'icon dashicons-before dashicons-carrot',
- onclick: function() {
- editor.windowManager.open( {
- title: 'Отзывы по теме',
- body: [
- {
- type: 'textbox', // тип textbox = текстовое поле
- name: 'refbody', // ID
- label: 'Текст', // Надпись
- value: '', // значение по умолчанию
- multiline: true, // большое текстовое поле - textarea
- minWidth: 300, // минимальная ширина в пикселях
- minHeight: 100 // минимальная высота в пикселях
- },
- {
- type: 'textbox',
- name: 'refname',
- label: 'Имя/ник автора',
- value: ''
- },
- {
- type: 'textbox',
- name: 'refsource',
- label: 'Источник',
- value: ''
- }
- ],
- onsubmit: function( e ) {
- editor.insertContent( '<p style="reference"><div class="external-reference"><div class="external-reference-body">' + e.data.refbody + '</div><div class="external-reference-name">' + e.data.refname + '</div><div class="external-reference-source">' + e.data.refsource + '</div></div></p>');
- }
- });
- }
- });
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement