CoreFiles by mySites.guru
plugin-es5.js90 lines, 2,604 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
7e3d281f3737bf43eba1fbe4c74a4d1f
sha1
a93809312eda0c5c97707fa81df565f60519dde9
sha256
02aae260972cd273c5323433a0e6789204852f9040b06e32948a107270c7af1d
(function () {
  'use strict';

  /**
   * plugin.js
   *
   * Original code by Arjan Haverkamp
   * Copyright 2013-2015 Arjan Haverkamp ([email protected])
   */
  window.tinymce.PluginManager.add('highlightPlus', function (editor, url) {
    var showSourceEditor = function showSourceEditor() {
      editor.focus();
      editor.selection.collapse(true);
      editor.options.register('codemirror', {
        processor: 'object',
        default: {
          codemirrorWidth: 800,
          codemirrorHeight: 550,
          fullscreen: false,
          indentOnInit: true,
          config: {
            mode: 'htmlmixed',
            theme: 'default',
            lineNumbers: true,
            lineWrapping: true,
            indentUnit: 2,
            tabSize: 2,
            indentWithTabs: true,
            matchBrackets: true,
            saveCursorPosition: false,
            styleActiveLine: true
          }
        }
      });
      var cmSettings = editor.options.get('codemirror');

      // Insert caret marker
      if (cmSettings.config.saveCursorPosition) {
        editor.selection.setContent('<span style="display: none;" class="CmCaReT">&#x0;</span>');
      }
      var buttonsConfig = [{
        type: 'custom',
        text: 'Ok',
        name: 'codemirrorOk',
        primary: true
      }, {
        type: 'cancel',
        text: 'Cancel',
        name: 'codemirrorCancel'
      }];
      var config = {
        title: 'Source code',
        url: url + "/source.html",
        width: cmSettings.width,
        height: cmSettings.height,
        resizable: true,
        maximizable: true,
        fullScreen: cmSettings.fullscreen,
        saveCursorPosition: false,
        buttons: buttonsConfig
      };
      config.onAction = function (dialogApi, actionData) {
        if (actionData.name === 'codemirrorOk') {
          var doc = document.querySelectorAll('.tox-dialog__body-iframe iframe')[0];
          doc.contentWindow.tinymceHighlighterSubmit();
          editor.undoManager.add();
          // eslint-disable-next-line no-use-before-define
          win.close();
        }
      };
      var win = editor.windowManager.openUrl(config);
      if (cmSettings.fullscreen) {
        win.fullscreen(true);
      }
    };
    editor.ui.registry.addButton('code', {
      icon: 'sourcecode',
      title: 'Source code+',
      tooltip: 'Source code+',
      onAction: showSourceEditor
    });
    editor.ui.registry.addMenuItem('code', {
      icon: 'sourcecode',
      text: 'Source code+',
      onAction: showSourceEditor,
      context: 'tools'
    });
  });

})();

No other release has this exact content. See every version of this file.