CoreFiles by mySites.guru
plugin.js94 lines, 2,449 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
302a0e999a760eaa6d6a443c8ccfc477
sha1
5d4c8082ba2a79c9efd7ed5f7d7a49947abe018f
sha256
39ff2cedd94acca7981ecfcc8cf9d74e848b699fdd1ba57944e42994939188ed
(function () {
var code = (function () {
  'use strict';

  var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

  var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');

  var getMinWidth = function (editor) {
    return editor.getParam('code_dialog_width', 600);
  };
  var getMinHeight = function (editor) {
    return editor.getParam('code_dialog_height', Math.min(global$1.DOM.getViewPort().h - 200, 500));
  };
  var $_e90paoa1jm0ofy6v = {
    getMinWidth: getMinWidth,
    getMinHeight: getMinHeight
  };

  var setContent = function (editor, html) {
    editor.focus();
    editor.undoManager.transact(function () {
      editor.setContent(html);
    });
    editor.selection.setCursorLocation();
    editor.nodeChanged();
  };
  var getContent = function (editor) {
    return editor.getContent({ source_view: true });
  };
  var $_6f8nd4a3jm0ofy6w = {
    setContent: setContent,
    getContent: getContent
  };

  var open = function (editor) {
    var minWidth = $_e90paoa1jm0ofy6v.getMinWidth(editor);
    var minHeight = $_e90paoa1jm0ofy6v.getMinHeight(editor);
    var win = editor.windowManager.open({
      title: 'Source code',
      body: {
        type: 'textbox',
        name: 'code',
        multiline: true,
        minWidth: minWidth,
        minHeight: minHeight,
        spellcheck: false,
        style: 'direction: ltr; text-align: left'
      },
      onSubmit: function (e) {
        $_6f8nd4a3jm0ofy6w.setContent(editor, e.data.code);
      }
    });
    win.find('#code').value($_6f8nd4a3jm0ofy6w.getContent(editor));
  };
  var $_6ohe8ba0jm0ofy6t = { open: open };

  var register = function (editor) {
    editor.addCommand('mceCodeEditor', function () {
      $_6ohe8ba0jm0ofy6t.open(editor);
    });
  };
  var $_fvwfr9zjm0ofy6s = { register: register };

  var register$1 = function (editor) {
    editor.addButton('code', {
      icon: 'code',
      tooltip: 'Source code',
      onclick: function () {
        $_6ohe8ba0jm0ofy6t.open(editor);
      }
    });
    editor.addMenuItem('code', {
      icon: 'code',
      text: 'Source code',
      onclick: function () {
        $_6ohe8ba0jm0ofy6t.open(editor);
      }
    });
  };
  var $_h5j0na4jm0ofy6x = { register: register$1 };

  global.add('code', function (editor) {
    $_fvwfr9zjm0ofy6s.register(editor);
    $_h5j0na4jm0ofy6x.register(editor);
    return {};
  });
  function Plugin () {
  }

  return Plugin;

}());
})();

The same content is in 3 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha7. See them all, or every version of this file.