JSFiddle - React, Tailwind, and code Playground
JavaScript
// console overrideCMObj
if (console == undefined) {
console = {
log: function (text) {
alert(text);
}
};
}
var ____temp = {};
____temp.each = function (coll, callback) {
console.log("using custom jquery each");
for (var i = 0; i < coll.length; i++) {
callback(i, coll[i]);
}
}
// namespaces
var Jrte = {};
Jrte.MenuItems = {};
Jrte.Data = {};
// window stuff
Jrte.Data.JRTE_HOTKEYS_ADDED = false;
// menu item
Jrte.MenuItem = function (name, iconUrl, isSelectedBoolFunc, whenSelectedFunc, whenNotselectedFunc) {
this.Name = name;
this.IconUrl = iconUrl;
this.IsSelectedFunc = isSelectedBoolFunc;
this.WhenNotSelectedFunc = whenNotselectedFunc;
this.WhenSelectedFunc = whenSelectedFunc;
};
// Main object
Jrte.Editor = function (jQueryTextAreaElement, settings, instanceIndex) {
// vars
var initIndex = instanceIndex;
var textarea = jQueryTextAreaElement;
var options = settings;
var iframe = undefined;
var iframeNative = undefined;
var iframeNativeConWin = undefined;
var iframeNativeConWinDoc = undefined;
var iframeNativeConWinDocBody = undefined;
var contextMenu = undefined;
var contextMenuHeader = undefined;
var contextMenuInner = undefined;
var contextMenuItemObjs = [];
var contextMenuFunctions = [];
var jrteFileName = "jquery-jrte.js"
//var jrteFileName = "jrte-js?v=KzNttzFJPz-MUlK-LnBgGF-UeM-cRN9_iXCwjFXGPeg1";
var relativePath = undefined;
var loaderUxDelay = settings.loaderUxDelay;
// menu items
var menuItemScripts = settings.menuItems;
menuItemScripts.push([{
fileName: "jrte.menuitems.bold.js",
getFunction: function () {
return new Jrte.MenuItems.Bold();
}
}], [{
fileName: "jrte.menuitems.bold.js",
getFunction: function () {
return new Jrte.MenuItems.Bold();
}
}]);
// helpers
var htmlEncode = function (html) {
...