- md5
- 66d9aa7d58ee118a0d030a8f8ba9c10c
- sha1
- f60e51e341c5ff9a16fd2ed5befe2f98b05be6bd
- sha256
- 4feffc51132fefc2587b7c46ccff97e17a7d3571514a64e99f0a902dcbcf6f9c
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
(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);
if (!editor.settings.codemirror) editor.settings.codemirror = {}; // Insert caret marker
if (editor.settings.codemirror && editor.settings.codemirror.saveCursorPosition) {
editor.selection.setContent('<span style="display: none;" class="CmCaReT">�</span>');
}
var codemirrorWidth = 800;
if (editor.settings.codemirror.width) {
codemirrorWidth = editor.settings.codemirror.width;
}
var codemirrorHeight = 550;
if (editor.settings.codemirror.height) {
codemirrorHeight = editor.settings.codemirror.height;
}
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: codemirrorWidth,
height: codemirrorHeight,
resizable: true,
maximizable: true,
fullScreen: editor.settings.codemirror.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 (editor.settings.codemirror.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'
});
});
})();
The same content is in 40 releases, Joomla 4.1.0-rc1 to 4.2.9. See them all, or every version of this file.