Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/themes/inlite
File: theme.js
}
[4000] Fix | Delete
};
[4001] Fix | Delete
this._super(settings);
[4002] Fix | Delete
},
[4003] Fix | Delete
Statics: {
[4004] Fix | Delete
OK: 1,
[4005] Fix | Delete
OK_CANCEL: 2,
[4006] Fix | Delete
YES_NO: 3,
[4007] Fix | Delete
YES_NO_CANCEL: 4,
[4008] Fix | Delete
msgBox: function (settings) {
[4009] Fix | Delete
var buttons;
[4010] Fix | Delete
var callback = settings.callback || function () {
[4011] Fix | Delete
};
[4012] Fix | Delete
function createButton(text, status, primary) {
[4013] Fix | Delete
return {
[4014] Fix | Delete
type: 'button',
[4015] Fix | Delete
text: text,
[4016] Fix | Delete
subtype: primary ? 'primary' : '',
[4017] Fix | Delete
onClick: function (e) {
[4018] Fix | Delete
e.control.parents()[1].close();
[4019] Fix | Delete
callback(status);
[4020] Fix | Delete
}
[4021] Fix | Delete
};
[4022] Fix | Delete
}
[4023] Fix | Delete
switch (settings.buttons) {
[4024] Fix | Delete
case MessageBox.OK_CANCEL:
[4025] Fix | Delete
buttons = [
[4026] Fix | Delete
createButton('Ok', true, true),
[4027] Fix | Delete
createButton('Cancel', false)
[4028] Fix | Delete
];
[4029] Fix | Delete
break;
[4030] Fix | Delete
case MessageBox.YES_NO:
[4031] Fix | Delete
case MessageBox.YES_NO_CANCEL:
[4032] Fix | Delete
buttons = [
[4033] Fix | Delete
createButton('Yes', 1, true),
[4034] Fix | Delete
createButton('No', 0)
[4035] Fix | Delete
];
[4036] Fix | Delete
if (settings.buttons === MessageBox.YES_NO_CANCEL) {
[4037] Fix | Delete
buttons.push(createButton('Cancel', -1));
[4038] Fix | Delete
}
[4039] Fix | Delete
break;
[4040] Fix | Delete
default:
[4041] Fix | Delete
buttons = [createButton('Ok', true, true)];
[4042] Fix | Delete
break;
[4043] Fix | Delete
}
[4044] Fix | Delete
return new Window({
[4045] Fix | Delete
padding: 20,
[4046] Fix | Delete
x: settings.x,
[4047] Fix | Delete
y: settings.y,
[4048] Fix | Delete
minWidth: 300,
[4049] Fix | Delete
minHeight: 100,
[4050] Fix | Delete
layout: 'flex',
[4051] Fix | Delete
pack: 'center',
[4052] Fix | Delete
align: 'center',
[4053] Fix | Delete
buttons: buttons,
[4054] Fix | Delete
title: settings.title,
[4055] Fix | Delete
role: 'alertdialog',
[4056] Fix | Delete
items: {
[4057] Fix | Delete
type: 'label',
[4058] Fix | Delete
multiline: true,
[4059] Fix | Delete
maxWidth: 500,
[4060] Fix | Delete
maxHeight: 200,
[4061] Fix | Delete
text: settings.text
[4062] Fix | Delete
},
[4063] Fix | Delete
onPostRender: function () {
[4064] Fix | Delete
this.aria('describedby', this.items()[0]._id);
[4065] Fix | Delete
},
[4066] Fix | Delete
onClose: settings.onClose,
[4067] Fix | Delete
onCancel: function () {
[4068] Fix | Delete
callback(false);
[4069] Fix | Delete
}
[4070] Fix | Delete
}).renderTo(domGlobals.document.body).reflow();
[4071] Fix | Delete
},
[4072] Fix | Delete
alert: function (settings, callback) {
[4073] Fix | Delete
if (typeof settings === 'string') {
[4074] Fix | Delete
settings = { text: settings };
[4075] Fix | Delete
}
[4076] Fix | Delete
settings.callback = callback;
[4077] Fix | Delete
return MessageBox.msgBox(settings);
[4078] Fix | Delete
},
[4079] Fix | Delete
confirm: function (settings, callback) {
[4080] Fix | Delete
if (typeof settings === 'string') {
[4081] Fix | Delete
settings = { text: settings };
[4082] Fix | Delete
}
[4083] Fix | Delete
settings.callback = callback;
[4084] Fix | Delete
settings.buttons = MessageBox.OK_CANCEL;
[4085] Fix | Delete
return MessageBox.msgBox(settings);
[4086] Fix | Delete
}
[4087] Fix | Delete
}
[4088] Fix | Delete
});
[4089] Fix | Delete
[4090] Fix | Delete
function WindowManagerImpl (editor) {
[4091] Fix | Delete
var open = function (args, params, closeCallback) {
[4092] Fix | Delete
var win;
[4093] Fix | Delete
args.title = args.title || ' ';
[4094] Fix | Delete
args.url = args.url || args.file;
[4095] Fix | Delete
if (args.url) {
[4096] Fix | Delete
args.width = parseInt(args.width || 320, 10);
[4097] Fix | Delete
args.height = parseInt(args.height || 240, 10);
[4098] Fix | Delete
}
[4099] Fix | Delete
if (args.body) {
[4100] Fix | Delete
args.items = {
[4101] Fix | Delete
defaults: args.defaults,
[4102] Fix | Delete
type: args.bodyType || 'form',
[4103] Fix | Delete
items: args.body,
[4104] Fix | Delete
data: args.data,
[4105] Fix | Delete
callbacks: args.commands
[4106] Fix | Delete
};
[4107] Fix | Delete
}
[4108] Fix | Delete
if (!args.url && !args.buttons) {
[4109] Fix | Delete
args.buttons = [
[4110] Fix | Delete
{
[4111] Fix | Delete
text: 'Ok',
[4112] Fix | Delete
subtype: 'primary',
[4113] Fix | Delete
onclick: function () {
[4114] Fix | Delete
win.find('form')[0].submit();
[4115] Fix | Delete
}
[4116] Fix | Delete
},
[4117] Fix | Delete
{
[4118] Fix | Delete
text: 'Cancel',
[4119] Fix | Delete
onclick: function () {
[4120] Fix | Delete
win.close();
[4121] Fix | Delete
}
[4122] Fix | Delete
}
[4123] Fix | Delete
];
[4124] Fix | Delete
}
[4125] Fix | Delete
win = new Window(args);
[4126] Fix | Delete
win.on('close', function () {
[4127] Fix | Delete
closeCallback(win);
[4128] Fix | Delete
});
[4129] Fix | Delete
if (args.data) {
[4130] Fix | Delete
win.on('postRender', function () {
[4131] Fix | Delete
this.find('*').each(function (ctrl) {
[4132] Fix | Delete
var name = ctrl.name();
[4133] Fix | Delete
if (name in args.data) {
[4134] Fix | Delete
ctrl.value(args.data[name]);
[4135] Fix | Delete
}
[4136] Fix | Delete
});
[4137] Fix | Delete
});
[4138] Fix | Delete
}
[4139] Fix | Delete
win.features = args || {};
[4140] Fix | Delete
win.params = params || {};
[4141] Fix | Delete
win = win.renderTo(domGlobals.document.body).reflow();
[4142] Fix | Delete
return win;
[4143] Fix | Delete
};
[4144] Fix | Delete
var alert = function (message, choiceCallback, closeCallback) {
[4145] Fix | Delete
var win;
[4146] Fix | Delete
win = MessageBox.alert(message, function () {
[4147] Fix | Delete
choiceCallback();
[4148] Fix | Delete
});
[4149] Fix | Delete
win.on('close', function () {
[4150] Fix | Delete
closeCallback(win);
[4151] Fix | Delete
});
[4152] Fix | Delete
return win;
[4153] Fix | Delete
};
[4154] Fix | Delete
var confirm = function (message, choiceCallback, closeCallback) {
[4155] Fix | Delete
var win;
[4156] Fix | Delete
win = MessageBox.confirm(message, function (state) {
[4157] Fix | Delete
choiceCallback(state);
[4158] Fix | Delete
});
[4159] Fix | Delete
win.on('close', function () {
[4160] Fix | Delete
closeCallback(win);
[4161] Fix | Delete
});
[4162] Fix | Delete
return win;
[4163] Fix | Delete
};
[4164] Fix | Delete
var close = function (window) {
[4165] Fix | Delete
window.close();
[4166] Fix | Delete
};
[4167] Fix | Delete
var getParams = function (window) {
[4168] Fix | Delete
return window.params;
[4169] Fix | Delete
};
[4170] Fix | Delete
var setParams = function (window, params) {
[4171] Fix | Delete
window.params = params;
[4172] Fix | Delete
};
[4173] Fix | Delete
return {
[4174] Fix | Delete
open: open,
[4175] Fix | Delete
alert: alert,
[4176] Fix | Delete
confirm: confirm,
[4177] Fix | Delete
close: close,
[4178] Fix | Delete
getParams: getParams,
[4179] Fix | Delete
setParams: setParams
[4180] Fix | Delete
};
[4181] Fix | Delete
}
[4182] Fix | Delete
[4183] Fix | Delete
var get = function (editor, panel) {
[4184] Fix | Delete
var renderUI = function () {
[4185] Fix | Delete
return Render.renderUI(editor, panel);
[4186] Fix | Delete
};
[4187] Fix | Delete
return {
[4188] Fix | Delete
renderUI: renderUI,
[4189] Fix | Delete
getNotificationManagerImpl: function () {
[4190] Fix | Delete
return NotificationManagerImpl(editor);
[4191] Fix | Delete
},
[4192] Fix | Delete
getWindowManagerImpl: function () {
[4193] Fix | Delete
return WindowManagerImpl();
[4194] Fix | Delete
}
[4195] Fix | Delete
};
[4196] Fix | Delete
};
[4197] Fix | Delete
var ThemeApi = { get: get };
[4198] Fix | Delete
[4199] Fix | Delete
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
[4200] Fix | Delete
[4201] Fix | Delete
var path = function (parts, scope) {
[4202] Fix | Delete
var o = scope !== undefined && scope !== null ? scope : Global;
[4203] Fix | Delete
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
[4204] Fix | Delete
o = o[parts[i]];
[4205] Fix | Delete
}
[4206] Fix | Delete
return o;
[4207] Fix | Delete
};
[4208] Fix | Delete
var resolve = function (p, scope) {
[4209] Fix | Delete
var parts = p.split('.');
[4210] Fix | Delete
return path(parts, scope);
[4211] Fix | Delete
};
[4212] Fix | Delete
[4213] Fix | Delete
var unsafe = function (name, scope) {
[4214] Fix | Delete
return resolve(name, scope);
[4215] Fix | Delete
};
[4216] Fix | Delete
var getOrDie = function (name, scope) {
[4217] Fix | Delete
var actual = unsafe(name, scope);
[4218] Fix | Delete
if (actual === undefined || actual === null) {
[4219] Fix | Delete
throw new Error(name + ' not available on this browser');
[4220] Fix | Delete
}
[4221] Fix | Delete
return actual;
[4222] Fix | Delete
};
[4223] Fix | Delete
var Global$1 = { getOrDie: getOrDie };
[4224] Fix | Delete
[4225] Fix | Delete
function FileReader () {
[4226] Fix | Delete
var f = Global$1.getOrDie('FileReader');
[4227] Fix | Delete
return new f();
[4228] Fix | Delete
}
[4229] Fix | Delete
[4230] Fix | Delete
var global$c = tinymce.util.Tools.resolve('tinymce.util.Promise');
[4231] Fix | Delete
[4232] Fix | Delete
var blobToBase64 = function (blob) {
[4233] Fix | Delete
return new global$c(function (resolve) {
[4234] Fix | Delete
var reader = FileReader();
[4235] Fix | Delete
reader.onloadend = function () {
[4236] Fix | Delete
resolve(reader.result.split(',')[1]);
[4237] Fix | Delete
};
[4238] Fix | Delete
reader.readAsDataURL(blob);
[4239] Fix | Delete
});
[4240] Fix | Delete
};
[4241] Fix | Delete
var Conversions = { blobToBase64: blobToBase64 };
[4242] Fix | Delete
[4243] Fix | Delete
var pickFile = function () {
[4244] Fix | Delete
return new global$c(function (resolve) {
[4245] Fix | Delete
var fileInput;
[4246] Fix | Delete
fileInput = domGlobals.document.createElement('input');
[4247] Fix | Delete
fileInput.type = 'file';
[4248] Fix | Delete
fileInput.style.position = 'fixed';
[4249] Fix | Delete
fileInput.style.left = 0;
[4250] Fix | Delete
fileInput.style.top = 0;
[4251] Fix | Delete
fileInput.style.opacity = 0.001;
[4252] Fix | Delete
domGlobals.document.body.appendChild(fileInput);
[4253] Fix | Delete
fileInput.onchange = function (e) {
[4254] Fix | Delete
resolve(Array.prototype.slice.call(e.target.files));
[4255] Fix | Delete
};
[4256] Fix | Delete
fileInput.click();
[4257] Fix | Delete
fileInput.parentNode.removeChild(fileInput);
[4258] Fix | Delete
});
[4259] Fix | Delete
};
[4260] Fix | Delete
var Picker = { pickFile: pickFile };
[4261] Fix | Delete
[4262] Fix | Delete
var count$1 = 0;
[4263] Fix | Delete
var seed = function () {
[4264] Fix | Delete
var rnd = function () {
[4265] Fix | Delete
return Math.round(Math.random() * 4294967295).toString(36);
[4266] Fix | Delete
};
[4267] Fix | Delete
return 's' + Date.now().toString(36) + rnd() + rnd() + rnd();
[4268] Fix | Delete
};
[4269] Fix | Delete
var uuid = function (prefix) {
[4270] Fix | Delete
return prefix + count$1++ + seed();
[4271] Fix | Delete
};
[4272] Fix | Delete
var Uuid = { uuid: uuid };
[4273] Fix | Delete
[4274] Fix | Delete
var create$1 = function (dom, rng) {
[4275] Fix | Delete
var bookmark = {};
[4276] Fix | Delete
function setupEndPoint(start) {
[4277] Fix | Delete
var offsetNode, container, offset;
[4278] Fix | Delete
container = rng[start ? 'startContainer' : 'endContainer'];
[4279] Fix | Delete
offset = rng[start ? 'startOffset' : 'endOffset'];
[4280] Fix | Delete
if (container.nodeType === 1) {
[4281] Fix | Delete
offsetNode = dom.create('span', { 'data-mce-type': 'bookmark' });
[4282] Fix | Delete
if (container.hasChildNodes()) {
[4283] Fix | Delete
offset = Math.min(offset, container.childNodes.length - 1);
[4284] Fix | Delete
if (start) {
[4285] Fix | Delete
container.insertBefore(offsetNode, container.childNodes[offset]);
[4286] Fix | Delete
} else {
[4287] Fix | Delete
dom.insertAfter(offsetNode, container.childNodes[offset]);
[4288] Fix | Delete
}
[4289] Fix | Delete
} else {
[4290] Fix | Delete
container.appendChild(offsetNode);
[4291] Fix | Delete
}
[4292] Fix | Delete
container = offsetNode;
[4293] Fix | Delete
offset = 0;
[4294] Fix | Delete
}
[4295] Fix | Delete
bookmark[start ? 'startContainer' : 'endContainer'] = container;
[4296] Fix | Delete
bookmark[start ? 'startOffset' : 'endOffset'] = offset;
[4297] Fix | Delete
}
[4298] Fix | Delete
setupEndPoint(true);
[4299] Fix | Delete
if (!rng.collapsed) {
[4300] Fix | Delete
setupEndPoint();
[4301] Fix | Delete
}
[4302] Fix | Delete
return bookmark;
[4303] Fix | Delete
};
[4304] Fix | Delete
var resolve$1 = function (dom, bookmark) {
[4305] Fix | Delete
function restoreEndPoint(start) {
[4306] Fix | Delete
var container, offset, node;
[4307] Fix | Delete
function nodeIndex(container) {
[4308] Fix | Delete
var node = container.parentNode.firstChild, idx = 0;
[4309] Fix | Delete
while (node) {
[4310] Fix | Delete
if (node === container) {
[4311] Fix | Delete
return idx;
[4312] Fix | Delete
}
[4313] Fix | Delete
if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
[4314] Fix | Delete
idx++;
[4315] Fix | Delete
}
[4316] Fix | Delete
node = node.nextSibling;
[4317] Fix | Delete
}
[4318] Fix | Delete
return -1;
[4319] Fix | Delete
}
[4320] Fix | Delete
container = node = bookmark[start ? 'startContainer' : 'endContainer'];
[4321] Fix | Delete
offset = bookmark[start ? 'startOffset' : 'endOffset'];
[4322] Fix | Delete
if (!container) {
[4323] Fix | Delete
return;
[4324] Fix | Delete
}
[4325] Fix | Delete
if (container.nodeType === 1) {
[4326] Fix | Delete
offset = nodeIndex(container);
[4327] Fix | Delete
container = container.parentNode;
[4328] Fix | Delete
dom.remove(node);
[4329] Fix | Delete
}
[4330] Fix | Delete
bookmark[start ? 'startContainer' : 'endContainer'] = container;
[4331] Fix | Delete
bookmark[start ? 'startOffset' : 'endOffset'] = offset;
[4332] Fix | Delete
}
[4333] Fix | Delete
restoreEndPoint(true);
[4334] Fix | Delete
restoreEndPoint();
[4335] Fix | Delete
var rng = dom.createRng();
[4336] Fix | Delete
rng.setStart(bookmark.startContainer, bookmark.startOffset);
[4337] Fix | Delete
if (bookmark.endContainer) {
[4338] Fix | Delete
rng.setEnd(bookmark.endContainer, bookmark.endOffset);
[4339] Fix | Delete
}
[4340] Fix | Delete
return rng;
[4341] Fix | Delete
};
[4342] Fix | Delete
var Bookmark = {
[4343] Fix | Delete
create: create$1,
[4344] Fix | Delete
resolve: resolve$1
[4345] Fix | Delete
};
[4346] Fix | Delete
[4347] Fix | Delete
var global$d = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
[4348] Fix | Delete
[4349] Fix | Delete
var global$e = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
[4350] Fix | Delete
[4351] Fix | Delete
var getSelectedElements = function (rootElm, startNode, endNode) {
[4352] Fix | Delete
var walker, node;
[4353] Fix | Delete
var elms = [];
[4354] Fix | Delete
walker = new global$d(startNode, rootElm);
[4355] Fix | Delete
for (node = startNode; node; node = walker.next()) {
[4356] Fix | Delete
if (node.nodeType === 1) {
[4357] Fix | Delete
elms.push(node);
[4358] Fix | Delete
}
[4359] Fix | Delete
if (node === endNode) {
[4360] Fix | Delete
break;
[4361] Fix | Delete
}
[4362] Fix | Delete
}
[4363] Fix | Delete
return elms;
[4364] Fix | Delete
};
[4365] Fix | Delete
var unwrapElements = function (editor, elms) {
[4366] Fix | Delete
var bookmark, dom, selection;
[4367] Fix | Delete
dom = editor.dom;
[4368] Fix | Delete
selection = editor.selection;
[4369] Fix | Delete
bookmark = Bookmark.create(dom, selection.getRng());
[4370] Fix | Delete
global$4.each(elms, function (elm) {
[4371] Fix | Delete
editor.dom.remove(elm, true);
[4372] Fix | Delete
});
[4373] Fix | Delete
selection.setRng(Bookmark.resolve(dom, bookmark));
[4374] Fix | Delete
};
[4375] Fix | Delete
var isLink = function (elm) {
[4376] Fix | Delete
return elm.nodeName === 'A' && elm.hasAttribute('href');
[4377] Fix | Delete
};
[4378] Fix | Delete
var getParentAnchorOrSelf = function (dom, elm) {
[4379] Fix | Delete
var anchorElm = dom.getParent(elm, isLink);
[4380] Fix | Delete
return anchorElm ? anchorElm : elm;
[4381] Fix | Delete
};
[4382] Fix | Delete
var getSelectedAnchors = function (editor) {
[4383] Fix | Delete
var startElm, endElm, rootElm, anchorElms, selection, dom, rng;
[4384] Fix | Delete
selection = editor.selection;
[4385] Fix | Delete
dom = editor.dom;
[4386] Fix | Delete
rng = selection.getRng();
[4387] Fix | Delete
startElm = getParentAnchorOrSelf(dom, global$e.getNode(rng.startContainer, rng.startOffset));
[4388] Fix | Delete
endElm = global$e.getNode(rng.endContainer, rng.endOffset);
[4389] Fix | Delete
rootElm = editor.getBody();
[4390] Fix | Delete
anchorElms = global$4.grep(getSelectedElements(rootElm, startElm, endElm), isLink);
[4391] Fix | Delete
return anchorElms;
[4392] Fix | Delete
};
[4393] Fix | Delete
var unlinkSelection = function (editor) {
[4394] Fix | Delete
unwrapElements(editor, getSelectedAnchors(editor));
[4395] Fix | Delete
};
[4396] Fix | Delete
var Unlink = { unlinkSelection: unlinkSelection };
[4397] Fix | Delete
[4398] Fix | Delete
var createTableHtml = function (cols, rows) {
[4399] Fix | Delete
var x, y, html;
[4400] Fix | Delete
html = '<table data-mce-id="mce" style="width: 100%">';
[4401] Fix | Delete
html += '<tbody>';
[4402] Fix | Delete
for (y = 0; y < rows; y++) {
[4403] Fix | Delete
html += '<tr>';
[4404] Fix | Delete
for (x = 0; x < cols; x++) {
[4405] Fix | Delete
html += '<td><br></td>';
[4406] Fix | Delete
}
[4407] Fix | Delete
html += '</tr>';
[4408] Fix | Delete
}
[4409] Fix | Delete
html += '</tbody>';
[4410] Fix | Delete
html += '</table>';
[4411] Fix | Delete
return html;
[4412] Fix | Delete
};
[4413] Fix | Delete
var getInsertedElement = function (editor) {
[4414] Fix | Delete
var elms = editor.dom.select('*[data-mce-id]');
[4415] Fix | Delete
return elms[0];
[4416] Fix | Delete
};
[4417] Fix | Delete
var insertTableHtml = function (editor, cols, rows) {
[4418] Fix | Delete
editor.undoManager.transact(function () {
[4419] Fix | Delete
var tableElm, cellElm;
[4420] Fix | Delete
editor.insertContent(createTableHtml(cols, rows));
[4421] Fix | Delete
tableElm = getInsertedElement(editor);
[4422] Fix | Delete
tableElm.removeAttribute('data-mce-id');
[4423] Fix | Delete
cellElm = editor.dom.select('td,th', tableElm);
[4424] Fix | Delete
editor.selection.setCursorLocation(cellElm[0], 0);
[4425] Fix | Delete
});
[4426] Fix | Delete
};
[4427] Fix | Delete
var insertTable = function (editor, cols, rows) {
[4428] Fix | Delete
editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
[4429] Fix | Delete
};
[4430] Fix | Delete
var formatBlock = function (editor, formatName) {
[4431] Fix | Delete
editor.execCommand('FormatBlock', false, formatName);
[4432] Fix | Delete
};
[4433] Fix | Delete
var insertBlob = function (editor, base64, blob) {
[4434] Fix | Delete
var blobCache, blobInfo;
[4435] Fix | Delete
blobCache = editor.editorUpload.blobCache;
[4436] Fix | Delete
blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64);
[4437] Fix | Delete
blobCache.add(blobInfo);
[4438] Fix | Delete
editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
[4439] Fix | Delete
};
[4440] Fix | Delete
var collapseSelectionToEnd = function (editor) {
[4441] Fix | Delete
editor.selection.collapse(false);
[4442] Fix | Delete
};
[4443] Fix | Delete
var unlink = function (editor) {
[4444] Fix | Delete
editor.focus();
[4445] Fix | Delete
Unlink.unlinkSelection(editor);
[4446] Fix | Delete
collapseSelectionToEnd(editor);
[4447] Fix | Delete
};
[4448] Fix | Delete
var changeHref = function (editor, elm, url) {
[4449] Fix | Delete
editor.focus();
[4450] Fix | Delete
editor.dom.setAttrib(elm, 'href', url);
[4451] Fix | Delete
collapseSelectionToEnd(editor);
[4452] Fix | Delete
};
[4453] Fix | Delete
var insertLink = function (editor, url) {
[4454] Fix | Delete
editor.execCommand('mceInsertLink', false, { href: url });
[4455] Fix | Delete
collapseSelectionToEnd(editor);
[4456] Fix | Delete
};
[4457] Fix | Delete
var updateOrInsertLink = function (editor, url) {
[4458] Fix | Delete
var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
[4459] Fix | Delete
elm ? changeHref(editor, elm, url) : insertLink(editor, url);
[4460] Fix | Delete
};
[4461] Fix | Delete
var createLink = function (editor, url) {
[4462] Fix | Delete
url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url);
[4463] Fix | Delete
};
[4464] Fix | Delete
var Actions = {
[4465] Fix | Delete
insertTable: insertTable,
[4466] Fix | Delete
formatBlock: formatBlock,
[4467] Fix | Delete
insertBlob: insertBlob,
[4468] Fix | Delete
createLink: createLink,
[4469] Fix | Delete
unlink: unlink
[4470] Fix | Delete
};
[4471] Fix | Delete
[4472] Fix | Delete
var addHeaderButtons = function (editor) {
[4473] Fix | Delete
var formatBlock = function (name) {
[4474] Fix | Delete
return function () {
[4475] Fix | Delete
Actions.formatBlock(editor, name);
[4476] Fix | Delete
};
[4477] Fix | Delete
};
[4478] Fix | Delete
for (var i = 1; i < 6; i++) {
[4479] Fix | Delete
var name = 'h' + i;
[4480] Fix | Delete
editor.addButton(name, {
[4481] Fix | Delete
text: name.toUpperCase(),
[4482] Fix | Delete
tooltip: 'Heading ' + i,
[4483] Fix | Delete
stateSelector: name,
[4484] Fix | Delete
onclick: formatBlock(name),
[4485] Fix | Delete
onPostRender: function () {
[4486] Fix | Delete
var span = this.getEl().firstChild.firstChild;
[4487] Fix | Delete
span.style.fontWeight = 'bold';
[4488] Fix | Delete
}
[4489] Fix | Delete
});
[4490] Fix | Delete
}
[4491] Fix | Delete
};
[4492] Fix | Delete
var addToEditor = function (editor, panel) {
[4493] Fix | Delete
editor.addButton('quicklink', {
[4494] Fix | Delete
icon: 'link',
[4495] Fix | Delete
tooltip: 'Insert/Edit link',
[4496] Fix | Delete
stateSelector: 'a[href]',
[4497] Fix | Delete
onclick: function () {
[4498] Fix | Delete
panel.showForm(editor, 'quicklink');
[4499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function