- md5
- 7e3d281f3737bf43eba1fbe4c74a4d1f
- sha1
- a93809312eda0c5c97707fa81df565f60519dde9
- sha256
- 02aae260972cd273c5323433a0e6789204852f9040b06e32948a107270c7af1d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
(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">�</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.