text: require('./bootstrap');
  
  $(document).ready(function () {
      var $button = $('.admin-delete-form button');
  
      $button.on('click', function (e) {
          if ($button.data('confirm')) {
              if (!confirm($button.data('confirm'))) {
                  e.preventDefault();
              }
          }
      });
  
      tinymce.init({
          skin_url: '/css/skins/ui/oxide',
          selector: "#tinymce",
          height: 300,
          menubar: false,
          plugins: [
              'advlist autolink lists link image charmap print preview anchor',
              'searchreplace visualblocks code fullscreen',
              'insertdatetime media table paste code help wordcount'
          ],
          toolbar: [
              'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent |  numlist bullist | ',
              'forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen  preview save print | insertfile image media template link anchor codesample | ltr rtl code'
          ],
          content_css: [
              '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
              '//www.tinymce.com/css/codepen.min.css',
          ],
          relative_urls: false,
          file_picker_types: 'file image media',
          file_picker_callback: function (callback, value, meta) {
              let x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
              let y = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  
              let type = 'image' === meta.filetype ? 'Images' : 'Files',
                  url = '/laravel-filemanager?editor=tinymce5&type=' + type;
  
              tinymce.activeEditor.windowManager.openUrl({
                  url: url,
                  title: 'Filemanager',
                  width: x * 0.8,
                  height: y * 0.8,
                  onMessage: (api, message) => {
                      callback(message.content);
                  }
              });
          }
      });
  
      $('.selectpicker').select2();
  
  });
  