Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     tinymce.PluginManager.add('ref_mce_button', function( editor, url ) {
  3.             editor.addButton( 'ref_mce_button', {
  4.                 title: 'Отзывы',
  5.                 icon: 'icon dashicons-before dashicons-carrot',
  6.                 onclick: function() {
  7.                     editor.windowManager.open( {
  8.                     title: 'Отзывы по теме',
  9.                     body: [
  10.                         {
  11.                             type: 'textbox', // тип textbox = текстовое поле
  12.                             name: 'refbody', // ID
  13.                             label: 'Текст', // Надпись
  14.                             value: '', // значение по умолчанию
  15.                             multiline: true, // большое текстовое поле - textarea
  16.                             minWidth: 300, // минимальная ширина в пикселях
  17.                             minHeight: 100 // минимальная высота в пикселях
  18.                         },
  19.                         {
  20.                             type: 'textbox',
  21.                             name: 'refname',
  22.                             label: 'Имя/ник автора',
  23.                             value: ''
  24.                         },
  25.                         {
  26.                             type: 'textbox',
  27.                             name: 'refsource',
  28.                             label: 'Источник',
  29.                             value: ''
  30.                         }
  31.                     ],
  32.                     onsubmit: function( e ) {
  33.                     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>');
  34.                                     }
  35.                 });
  36.         }
  37.     });
  38.      });
  39. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement