tinymce.init({
  selector: "textarea.tinymce",
  height: 600,
  language: 'ru',
  promotion: false,
  branding: false,
  convert_urls: true,
  relative_urls: true,
  remove_script_host: true,
  image_class_list: [
      {title: 'None', value: ''},
      {title: 'Адаптивный', value: 'img-fluid'},
      {title: 'Превью', value: 'img-thumbnail'},
      {title: 'Слева', value: 'float-start'},
      {title: 'Справа', value: 'float-end'},
      {title: 'По центру', value: 'mx-auto d-block'},
  ],
  //keys
  api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  editimage_api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  spellchecker_api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  mediaembed_api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  linkchecker_api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  tinydrive_api_key:"vzc822ybbaa517i2jfue6ss7dh90h6zj93fl28k4obrhofj6",
  //tinydrive_dropbox_app_key: 'jee1s9eykoh752j',
  //tinydrive_google_drive_key: 'AIzaSyAsVRuCBc-BLQ1xNKtnLHB3AeoK-xmOrTc',
  //tinydrive_google_drive_client_id: '748627179519-p9vv3va1mppc66fikai92b3ru73mpukf.apps.googleusercontent.com',
  tinydrive_service_url: '/admin/ajax/',
  tinydrive_upload_path: '/files/uploads',
  tinydrive_token_provider: function (success, failure) {
       success({ token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.Ks_BdfH4CWilyzLNk8S2gDARFhuxIauLa8PwhdEQhEo' });
  },
  content_css: '/admin/design/css/bootstrap.min.css',
  plugins: [
    'advlist', 'autolink', 'link', 'bsgrid', 'image', 'lists', 'tinydrive', 'advcode', 'editimage', 'charmap', 'preview', 'anchor', 'pagebreak',
    'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'fullscreen', 'insertdatetime', 'powerpaste',
    'media', 'table', 'emoticons', 'template'
  ],
  toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | ' +
    'bullist numlist outdent indent | link image media fullscreen | forecolor backcolor emoticons bsgrid code',
  menu: {
    favs: { title: '⭐️', items: 'code | insertfile | searchreplace | emoticons' }
  },
  menubar: 'favs file edit view insert format tools table',
  content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
  extended_valid_elements: 'img[class=img-fluid|!src|border:0|alt|title|style]',
  style_formats: [
        { title: 'Custom format', format: 'customformat' },
        { title: 'Align left', format: 'alignleft' },
        { title: 'Align center', format: 'aligncenter' },
        { title: 'Align right', format: 'alignright' },
        { title: 'Align full', format: 'alignfull' },
        { title: 'Bold text', inline: 'strong' },
        { title: 'Red text', inline: 'span', styles: { color: '#ff0000' } },
        { title: 'Red header', block: 'h1', styles: { color: '#ff0000' } },
        { title: 'Badge', inline: 'span', styles: { display: 'inline-block', border: '1px solid #2276d2', 'border-radius': '5px', padding: '2px 5px', margin: '0 2px', color: '#2276d2' } },

        { title: 'DIV Border' },
        { title: 'Border #000', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #000', 'border-radius': '5px', color: '#000' } },
        { title: 'Border #333', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #333', 'border-radius': '5px', color: '#333' } },
        { title: 'Border #666', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #666', 'border-radius': '5px', color: '#666' } },
        { title: 'Border #999', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #999', 'border-radius': '5px', color: '#999' } },
        { title: 'Border #CCC', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #CCC', 'border-radius': '5px', color: '#CCC' } },
        { title: 'Border #FFF', selector: 'div', styles: { display: 'inline-block', outline: '1px solid #FFF', 'border-radius': '5px', color: '#FFF' } },

        { title: 'DIV Background' },
        { title: 'Background #000', selector: 'div', styles: { 'background-color': '#000' } },
        { title: 'Background #333', selector: 'div', styles: { 'background-color': '#333' } },
        { title: 'Background #666', selector: 'div', styles: { 'background-color': '#666' } },
        { title: 'Background #999', selector: 'div', styles: { 'background-color': '#999' } },
        { title: 'Background #CCC', selector: 'div', styles: { 'background-color': '#CCC' } },
        { title: 'Background #FFF', selector: 'div', styles: { 'background-color': '#FFF' } }
    ]
});
