Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/themes/inlite
File: theme.js
direction = direction.split('-')[0];
[7000] Fix | Delete
}
[7001] Fix | Delete
if (direction === 'column') {
[7002] Fix | Delete
posName = 'y';
[7003] Fix | Delete
sizeName = 'h';
[7004] Fix | Delete
minSizeName = 'minH';
[7005] Fix | Delete
maxSizeName = 'maxH';
[7006] Fix | Delete
innerSizeName = 'innerH';
[7007] Fix | Delete
beforeName = 'top';
[7008] Fix | Delete
deltaSizeName = 'deltaH';
[7009] Fix | Delete
contentSizeName = 'contentH';
[7010] Fix | Delete
alignBeforeName = 'left';
[7011] Fix | Delete
alignSizeName = 'w';
[7012] Fix | Delete
alignAxisName = 'x';
[7013] Fix | Delete
alignInnerSizeName = 'innerW';
[7014] Fix | Delete
alignMinSizeName = 'minW';
[7015] Fix | Delete
alignAfterName = 'right';
[7016] Fix | Delete
alignDeltaSizeName = 'deltaW';
[7017] Fix | Delete
alignContentSizeName = 'contentW';
[7018] Fix | Delete
} else {
[7019] Fix | Delete
posName = 'x';
[7020] Fix | Delete
sizeName = 'w';
[7021] Fix | Delete
minSizeName = 'minW';
[7022] Fix | Delete
maxSizeName = 'maxW';
[7023] Fix | Delete
innerSizeName = 'innerW';
[7024] Fix | Delete
beforeName = 'left';
[7025] Fix | Delete
deltaSizeName = 'deltaW';
[7026] Fix | Delete
contentSizeName = 'contentW';
[7027] Fix | Delete
alignBeforeName = 'top';
[7028] Fix | Delete
alignSizeName = 'h';
[7029] Fix | Delete
alignAxisName = 'y';
[7030] Fix | Delete
alignInnerSizeName = 'innerH';
[7031] Fix | Delete
alignMinSizeName = 'minH';
[7032] Fix | Delete
alignAfterName = 'bottom';
[7033] Fix | Delete
alignDeltaSizeName = 'deltaH';
[7034] Fix | Delete
alignContentSizeName = 'contentH';
[7035] Fix | Delete
}
[7036] Fix | Delete
availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
[7037] Fix | Delete
maxAlignEndPos = totalFlex = 0;
[7038] Fix | Delete
for (i = 0, l = items.length; i < l; i++) {
[7039] Fix | Delete
ctrl = items[i];
[7040] Fix | Delete
ctrlLayoutRect = ctrl.layoutRect();
[7041] Fix | Delete
ctrlSettings = ctrl.settings;
[7042] Fix | Delete
flex = ctrlSettings.flex;
[7043] Fix | Delete
availableSpace -= i < l - 1 ? spacing : 0;
[7044] Fix | Delete
if (flex > 0) {
[7045] Fix | Delete
totalFlex += flex;
[7046] Fix | Delete
if (ctrlLayoutRect[maxSizeName]) {
[7047] Fix | Delete
maxSizeItems.push(ctrl);
[7048] Fix | Delete
}
[7049] Fix | Delete
ctrlLayoutRect.flex = flex;
[7050] Fix | Delete
}
[7051] Fix | Delete
availableSpace -= ctrlLayoutRect[minSizeName];
[7052] Fix | Delete
size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
[7053] Fix | Delete
if (size > maxAlignEndPos) {
[7054] Fix | Delete
maxAlignEndPos = size;
[7055] Fix | Delete
}
[7056] Fix | Delete
}
[7057] Fix | Delete
rect = {};
[7058] Fix | Delete
if (availableSpace < 0) {
[7059] Fix | Delete
rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
[7060] Fix | Delete
} else {
[7061] Fix | Delete
rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
[7062] Fix | Delete
}
[7063] Fix | Delete
rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
[7064] Fix | Delete
rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
[7065] Fix | Delete
rect[alignContentSizeName] = maxAlignEndPos;
[7066] Fix | Delete
rect.minW = min(rect.minW, contLayoutRect.maxW);
[7067] Fix | Delete
rect.minH = min(rect.minH, contLayoutRect.maxH);
[7068] Fix | Delete
rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
[7069] Fix | Delete
rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
[7070] Fix | Delete
if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
[7071] Fix | Delete
rect.w = rect.minW;
[7072] Fix | Delete
rect.h = rect.minH;
[7073] Fix | Delete
container.layoutRect(rect);
[7074] Fix | Delete
this.recalc(container);
[7075] Fix | Delete
if (container._lastRect === null) {
[7076] Fix | Delete
var parentCtrl = container.parent();
[7077] Fix | Delete
if (parentCtrl) {
[7078] Fix | Delete
parentCtrl._lastRect = null;
[7079] Fix | Delete
parentCtrl.recalc();
[7080] Fix | Delete
}
[7081] Fix | Delete
}
[7082] Fix | Delete
return;
[7083] Fix | Delete
}
[7084] Fix | Delete
ratio = availableSpace / totalFlex;
[7085] Fix | Delete
for (i = 0, l = maxSizeItems.length; i < l; i++) {
[7086] Fix | Delete
ctrl = maxSizeItems[i];
[7087] Fix | Delete
ctrlLayoutRect = ctrl.layoutRect();
[7088] Fix | Delete
maxSize = ctrlLayoutRect[maxSizeName];
[7089] Fix | Delete
size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
[7090] Fix | Delete
if (size > maxSize) {
[7091] Fix | Delete
availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName];
[7092] Fix | Delete
totalFlex -= ctrlLayoutRect.flex;
[7093] Fix | Delete
ctrlLayoutRect.flex = 0;
[7094] Fix | Delete
ctrlLayoutRect.maxFlexSize = maxSize;
[7095] Fix | Delete
} else {
[7096] Fix | Delete
ctrlLayoutRect.maxFlexSize = 0;
[7097] Fix | Delete
}
[7098] Fix | Delete
}
[7099] Fix | Delete
ratio = availableSpace / totalFlex;
[7100] Fix | Delete
pos = contPaddingBox[beforeName];
[7101] Fix | Delete
rect = {};
[7102] Fix | Delete
if (totalFlex === 0) {
[7103] Fix | Delete
if (pack === 'end') {
[7104] Fix | Delete
pos = availableSpace + contPaddingBox[beforeName];
[7105] Fix | Delete
} else if (pack === 'center') {
[7106] Fix | Delete
pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName];
[7107] Fix | Delete
if (pos < 0) {
[7108] Fix | Delete
pos = contPaddingBox[beforeName];
[7109] Fix | Delete
}
[7110] Fix | Delete
} else if (pack === 'justify') {
[7111] Fix | Delete
pos = contPaddingBox[beforeName];
[7112] Fix | Delete
spacing = Math.floor(availableSpace / (items.length - 1));
[7113] Fix | Delete
}
[7114] Fix | Delete
}
[7115] Fix | Delete
rect[alignAxisName] = contPaddingBox[alignBeforeName];
[7116] Fix | Delete
for (i = 0, l = items.length; i < l; i++) {
[7117] Fix | Delete
ctrl = items[i];
[7118] Fix | Delete
ctrlLayoutRect = ctrl.layoutRect();
[7119] Fix | Delete
size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
[7120] Fix | Delete
if (align === 'center') {
[7121] Fix | Delete
rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2);
[7122] Fix | Delete
} else if (align === 'stretch') {
[7123] Fix | Delete
rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]);
[7124] Fix | Delete
rect[alignAxisName] = contPaddingBox[alignBeforeName];
[7125] Fix | Delete
} else if (align === 'end') {
[7126] Fix | Delete
rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
[7127] Fix | Delete
}
[7128] Fix | Delete
if (ctrlLayoutRect.flex > 0) {
[7129] Fix | Delete
size += ctrlLayoutRect.flex * ratio;
[7130] Fix | Delete
}
[7131] Fix | Delete
rect[sizeName] = size;
[7132] Fix | Delete
rect[posName] = pos;
[7133] Fix | Delete
ctrl.layoutRect(rect);
[7134] Fix | Delete
if (ctrl.recalc) {
[7135] Fix | Delete
ctrl.recalc();
[7136] Fix | Delete
}
[7137] Fix | Delete
pos += size + spacing;
[7138] Fix | Delete
}
[7139] Fix | Delete
}
[7140] Fix | Delete
});
[7141] Fix | Delete
[7142] Fix | Delete
var FlowLayout = Layout$1.extend({
[7143] Fix | Delete
Defaults: {
[7144] Fix | Delete
containerClass: 'flow-layout',
[7145] Fix | Delete
controlClass: 'flow-layout-item',
[7146] Fix | Delete
endClass: 'break'
[7147] Fix | Delete
},
[7148] Fix | Delete
recalc: function (container) {
[7149] Fix | Delete
container.items().filter(':visible').each(function (ctrl) {
[7150] Fix | Delete
if (ctrl.recalc) {
[7151] Fix | Delete
ctrl.recalc();
[7152] Fix | Delete
}
[7153] Fix | Delete
});
[7154] Fix | Delete
},
[7155] Fix | Delete
isNative: function () {
[7156] Fix | Delete
return true;
[7157] Fix | Delete
}
[7158] Fix | Delete
});
[7159] Fix | Delete
[7160] Fix | Delete
var descendant = function (scope, selector) {
[7161] Fix | Delete
return one(selector, scope);
[7162] Fix | Delete
};
[7163] Fix | Delete
[7164] Fix | Delete
var toggleFormat = function (editor, fmt) {
[7165] Fix | Delete
return function () {
[7166] Fix | Delete
editor.execCommand('mceToggleFormat', false, fmt);
[7167] Fix | Delete
};
[7168] Fix | Delete
};
[7169] Fix | Delete
var addFormatChangedListener = function (editor, name, changed) {
[7170] Fix | Delete
var handler = function (state) {
[7171] Fix | Delete
changed(state, name);
[7172] Fix | Delete
};
[7173] Fix | Delete
if (editor.formatter) {
[7174] Fix | Delete
editor.formatter.formatChanged(name, handler);
[7175] Fix | Delete
} else {
[7176] Fix | Delete
editor.on('init', function () {
[7177] Fix | Delete
editor.formatter.formatChanged(name, handler);
[7178] Fix | Delete
});
[7179] Fix | Delete
}
[7180] Fix | Delete
};
[7181] Fix | Delete
var postRenderFormatToggle = function (editor, name) {
[7182] Fix | Delete
return function (e) {
[7183] Fix | Delete
addFormatChangedListener(editor, name, function (state) {
[7184] Fix | Delete
e.control.active(state);
[7185] Fix | Delete
});
[7186] Fix | Delete
};
[7187] Fix | Delete
};
[7188] Fix | Delete
[7189] Fix | Delete
var register = function (editor) {
[7190] Fix | Delete
var alignFormats = [
[7191] Fix | Delete
'alignleft',
[7192] Fix | Delete
'aligncenter',
[7193] Fix | Delete
'alignright',
[7194] Fix | Delete
'alignjustify'
[7195] Fix | Delete
];
[7196] Fix | Delete
var defaultAlign = 'alignleft';
[7197] Fix | Delete
var alignMenuItems = [
[7198] Fix | Delete
{
[7199] Fix | Delete
text: 'Left',
[7200] Fix | Delete
icon: 'alignleft',
[7201] Fix | Delete
onclick: toggleFormat(editor, 'alignleft')
[7202] Fix | Delete
},
[7203] Fix | Delete
{
[7204] Fix | Delete
text: 'Center',
[7205] Fix | Delete
icon: 'aligncenter',
[7206] Fix | Delete
onclick: toggleFormat(editor, 'aligncenter')
[7207] Fix | Delete
},
[7208] Fix | Delete
{
[7209] Fix | Delete
text: 'Right',
[7210] Fix | Delete
icon: 'alignright',
[7211] Fix | Delete
onclick: toggleFormat(editor, 'alignright')
[7212] Fix | Delete
},
[7213] Fix | Delete
{
[7214] Fix | Delete
text: 'Justify',
[7215] Fix | Delete
icon: 'alignjustify',
[7216] Fix | Delete
onclick: toggleFormat(editor, 'alignjustify')
[7217] Fix | Delete
}
[7218] Fix | Delete
];
[7219] Fix | Delete
editor.addMenuItem('align', {
[7220] Fix | Delete
text: 'Align',
[7221] Fix | Delete
menu: alignMenuItems
[7222] Fix | Delete
});
[7223] Fix | Delete
editor.addButton('align', {
[7224] Fix | Delete
type: 'menubutton',
[7225] Fix | Delete
icon: defaultAlign,
[7226] Fix | Delete
menu: alignMenuItems,
[7227] Fix | Delete
onShowMenu: function (e) {
[7228] Fix | Delete
var menu = e.control.menu;
[7229] Fix | Delete
global$4.each(alignFormats, function (formatName, idx) {
[7230] Fix | Delete
menu.items().eq(idx).each(function (item) {
[7231] Fix | Delete
return item.active(editor.formatter.match(formatName));
[7232] Fix | Delete
});
[7233] Fix | Delete
});
[7234] Fix | Delete
},
[7235] Fix | Delete
onPostRender: function (e) {
[7236] Fix | Delete
var ctrl = e.control;
[7237] Fix | Delete
global$4.each(alignFormats, function (formatName, idx) {
[7238] Fix | Delete
addFormatChangedListener(editor, formatName, function (state) {
[7239] Fix | Delete
ctrl.icon(defaultAlign);
[7240] Fix | Delete
if (state) {
[7241] Fix | Delete
ctrl.icon(formatName);
[7242] Fix | Delete
}
[7243] Fix | Delete
});
[7244] Fix | Delete
});
[7245] Fix | Delete
}
[7246] Fix | Delete
});
[7247] Fix | Delete
global$4.each({
[7248] Fix | Delete
alignleft: [
[7249] Fix | Delete
'Align left',
[7250] Fix | Delete
'JustifyLeft'
[7251] Fix | Delete
],
[7252] Fix | Delete
aligncenter: [
[7253] Fix | Delete
'Align center',
[7254] Fix | Delete
'JustifyCenter'
[7255] Fix | Delete
],
[7256] Fix | Delete
alignright: [
[7257] Fix | Delete
'Align right',
[7258] Fix | Delete
'JustifyRight'
[7259] Fix | Delete
],
[7260] Fix | Delete
alignjustify: [
[7261] Fix | Delete
'Justify',
[7262] Fix | Delete
'JustifyFull'
[7263] Fix | Delete
],
[7264] Fix | Delete
alignnone: [
[7265] Fix | Delete
'No alignment',
[7266] Fix | Delete
'JustifyNone'
[7267] Fix | Delete
]
[7268] Fix | Delete
}, function (item, name) {
[7269] Fix | Delete
editor.addButton(name, {
[7270] Fix | Delete
active: false,
[7271] Fix | Delete
tooltip: item[0],
[7272] Fix | Delete
cmd: item[1],
[7273] Fix | Delete
onPostRender: postRenderFormatToggle(editor, name)
[7274] Fix | Delete
});
[7275] Fix | Delete
});
[7276] Fix | Delete
};
[7277] Fix | Delete
var Align = { register: register };
[7278] Fix | Delete
[7279] Fix | Delete
var getFirstFont = function (fontFamily) {
[7280] Fix | Delete
return fontFamily ? fontFamily.split(',')[0] : '';
[7281] Fix | Delete
};
[7282] Fix | Delete
var findMatchingValue = function (items, fontFamily) {
[7283] Fix | Delete
var font = fontFamily ? fontFamily.toLowerCase() : '';
[7284] Fix | Delete
var value;
[7285] Fix | Delete
global$4.each(items, function (item) {
[7286] Fix | Delete
if (item.value.toLowerCase() === font) {
[7287] Fix | Delete
value = item.value;
[7288] Fix | Delete
}
[7289] Fix | Delete
});
[7290] Fix | Delete
global$4.each(items, function (item) {
[7291] Fix | Delete
if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) {
[7292] Fix | Delete
value = item.value;
[7293] Fix | Delete
}
[7294] Fix | Delete
});
[7295] Fix | Delete
return value;
[7296] Fix | Delete
};
[7297] Fix | Delete
var createFontNameListBoxChangeHandler = function (editor, items) {
[7298] Fix | Delete
return function () {
[7299] Fix | Delete
var self = this;
[7300] Fix | Delete
self.state.set('value', null);
[7301] Fix | Delete
editor.on('init nodeChange', function (e) {
[7302] Fix | Delete
var fontFamily = editor.queryCommandValue('FontName');
[7303] Fix | Delete
var match = findMatchingValue(items, fontFamily);
[7304] Fix | Delete
self.value(match ? match : null);
[7305] Fix | Delete
if (!match && fontFamily) {
[7306] Fix | Delete
self.text(getFirstFont(fontFamily));
[7307] Fix | Delete
}
[7308] Fix | Delete
});
[7309] Fix | Delete
};
[7310] Fix | Delete
};
[7311] Fix | Delete
var createFormats = function (formats) {
[7312] Fix | Delete
formats = formats.replace(/;$/, '').split(';');
[7313] Fix | Delete
var i = formats.length;
[7314] Fix | Delete
while (i--) {
[7315] Fix | Delete
formats[i] = formats[i].split('=');
[7316] Fix | Delete
}
[7317] Fix | Delete
return formats;
[7318] Fix | Delete
};
[7319] Fix | Delete
var getFontItems = function (editor) {
[7320] Fix | Delete
var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
[7321] Fix | Delete
var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
[7322] Fix | Delete
return global$4.map(fonts, function (font) {
[7323] Fix | Delete
return {
[7324] Fix | Delete
text: { raw: font[0] },
[7325] Fix | Delete
value: font[1],
[7326] Fix | Delete
textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : ''
[7327] Fix | Delete
};
[7328] Fix | Delete
});
[7329] Fix | Delete
};
[7330] Fix | Delete
var registerButtons = function (editor) {
[7331] Fix | Delete
editor.addButton('fontselect', function () {
[7332] Fix | Delete
var items = getFontItems(editor);
[7333] Fix | Delete
return {
[7334] Fix | Delete
type: 'listbox',
[7335] Fix | Delete
text: 'Font Family',
[7336] Fix | Delete
tooltip: 'Font Family',
[7337] Fix | Delete
values: items,
[7338] Fix | Delete
fixedWidth: true,
[7339] Fix | Delete
onPostRender: createFontNameListBoxChangeHandler(editor, items),
[7340] Fix | Delete
onselect: function (e) {
[7341] Fix | Delete
if (e.control.settings.value) {
[7342] Fix | Delete
editor.execCommand('FontName', false, e.control.settings.value);
[7343] Fix | Delete
}
[7344] Fix | Delete
}
[7345] Fix | Delete
};
[7346] Fix | Delete
});
[7347] Fix | Delete
};
[7348] Fix | Delete
var register$1 = function (editor) {
[7349] Fix | Delete
registerButtons(editor);
[7350] Fix | Delete
};
[7351] Fix | Delete
var FontSelect = { register: register$1 };
[7352] Fix | Delete
[7353] Fix | Delete
var round = function (number, precision) {
[7354] Fix | Delete
var factor = Math.pow(10, precision);
[7355] Fix | Delete
return Math.round(number * factor) / factor;
[7356] Fix | Delete
};
[7357] Fix | Delete
var toPt = function (fontSize, precision) {
[7358] Fix | Delete
if (/[0-9.]+px$/.test(fontSize)) {
[7359] Fix | Delete
return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
[7360] Fix | Delete
}
[7361] Fix | Delete
return fontSize;
[7362] Fix | Delete
};
[7363] Fix | Delete
var findMatchingValue$1 = function (items, pt, px) {
[7364] Fix | Delete
var value;
[7365] Fix | Delete
global$4.each(items, function (item) {
[7366] Fix | Delete
if (item.value === px) {
[7367] Fix | Delete
value = px;
[7368] Fix | Delete
} else if (item.value === pt) {
[7369] Fix | Delete
value = pt;
[7370] Fix | Delete
}
[7371] Fix | Delete
});
[7372] Fix | Delete
return value;
[7373] Fix | Delete
};
[7374] Fix | Delete
var createFontSizeListBoxChangeHandler = function (editor, items) {
[7375] Fix | Delete
return function () {
[7376] Fix | Delete
var self = this;
[7377] Fix | Delete
editor.on('init nodeChange', function (e) {
[7378] Fix | Delete
var px, pt, precision, match;
[7379] Fix | Delete
px = editor.queryCommandValue('FontSize');
[7380] Fix | Delete
if (px) {
[7381] Fix | Delete
for (precision = 3; !match && precision >= 0; precision--) {
[7382] Fix | Delete
pt = toPt(px, precision);
[7383] Fix | Delete
match = findMatchingValue$1(items, pt, px);
[7384] Fix | Delete
}
[7385] Fix | Delete
}
[7386] Fix | Delete
self.value(match ? match : null);
[7387] Fix | Delete
if (!match) {
[7388] Fix | Delete
self.text(pt);
[7389] Fix | Delete
}
[7390] Fix | Delete
});
[7391] Fix | Delete
};
[7392] Fix | Delete
};
[7393] Fix | Delete
var getFontSizeItems = function (editor) {
[7394] Fix | Delete
var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
[7395] Fix | Delete
var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats;
[7396] Fix | Delete
return global$4.map(fontsizeFormats.split(' '), function (item) {
[7397] Fix | Delete
var text = item, value = item;
[7398] Fix | Delete
var values = item.split('=');
[7399] Fix | Delete
if (values.length > 1) {
[7400] Fix | Delete
text = values[0];
[7401] Fix | Delete
value = values[1];
[7402] Fix | Delete
}
[7403] Fix | Delete
return {
[7404] Fix | Delete
text: text,
[7405] Fix | Delete
value: value
[7406] Fix | Delete
};
[7407] Fix | Delete
});
[7408] Fix | Delete
};
[7409] Fix | Delete
var registerButtons$1 = function (editor) {
[7410] Fix | Delete
editor.addButton('fontsizeselect', function () {
[7411] Fix | Delete
var items = getFontSizeItems(editor);
[7412] Fix | Delete
return {
[7413] Fix | Delete
type: 'listbox',
[7414] Fix | Delete
text: 'Font Sizes',
[7415] Fix | Delete
tooltip: 'Font Sizes',
[7416] Fix | Delete
values: items,
[7417] Fix | Delete
fixedWidth: true,
[7418] Fix | Delete
onPostRender: createFontSizeListBoxChangeHandler(editor, items),
[7419] Fix | Delete
onclick: function (e) {
[7420] Fix | Delete
if (e.control.settings.value) {
[7421] Fix | Delete
editor.execCommand('FontSize', false, e.control.settings.value);
[7422] Fix | Delete
}
[7423] Fix | Delete
}
[7424] Fix | Delete
};
[7425] Fix | Delete
});
[7426] Fix | Delete
};
[7427] Fix | Delete
var register$2 = function (editor) {
[7428] Fix | Delete
registerButtons$1(editor);
[7429] Fix | Delete
};
[7430] Fix | Delete
var FontSizeSelect = { register: register$2 };
[7431] Fix | Delete
[7432] Fix | Delete
var hideMenuObjects = function (editor, menu) {
[7433] Fix | Delete
var count = menu.length;
[7434] Fix | Delete
global$4.each(menu, function (item) {
[7435] Fix | Delete
if (item.menu) {
[7436] Fix | Delete
item.hidden = hideMenuObjects(editor, item.menu) === 0;
[7437] Fix | Delete
}
[7438] Fix | Delete
var formatName = item.format;
[7439] Fix | Delete
if (formatName) {
[7440] Fix | Delete
item.hidden = !editor.formatter.canApply(formatName);
[7441] Fix | Delete
}
[7442] Fix | Delete
if (item.hidden) {
[7443] Fix | Delete
count--;
[7444] Fix | Delete
}
[7445] Fix | Delete
});
[7446] Fix | Delete
return count;
[7447] Fix | Delete
};
[7448] Fix | Delete
var hideFormatMenuItems = function (editor, menu) {
[7449] Fix | Delete
var count = menu.items().length;
[7450] Fix | Delete
menu.items().each(function (item) {
[7451] Fix | Delete
if (item.menu) {
[7452] Fix | Delete
item.visible(hideFormatMenuItems(editor, item.menu) > 0);
[7453] Fix | Delete
}
[7454] Fix | Delete
if (!item.menu && item.settings.menu) {
[7455] Fix | Delete
item.visible(hideMenuObjects(editor, item.settings.menu) > 0);
[7456] Fix | Delete
}
[7457] Fix | Delete
var formatName = item.settings.format;
[7458] Fix | Delete
if (formatName) {
[7459] Fix | Delete
item.visible(editor.formatter.canApply(formatName));
[7460] Fix | Delete
}
[7461] Fix | Delete
if (!item.visible()) {
[7462] Fix | Delete
count--;
[7463] Fix | Delete
}
[7464] Fix | Delete
});
[7465] Fix | Delete
return count;
[7466] Fix | Delete
};
[7467] Fix | Delete
var createFormatMenu = function (editor) {
[7468] Fix | Delete
var count = 0;
[7469] Fix | Delete
var newFormats = [];
[7470] Fix | Delete
var defaultStyleFormats = [
[7471] Fix | Delete
{
[7472] Fix | Delete
title: 'Headings',
[7473] Fix | Delete
items: [
[7474] Fix | Delete
{
[7475] Fix | Delete
title: 'Heading 1',
[7476] Fix | Delete
format: 'h1'
[7477] Fix | Delete
},
[7478] Fix | Delete
{
[7479] Fix | Delete
title: 'Heading 2',
[7480] Fix | Delete
format: 'h2'
[7481] Fix | Delete
},
[7482] Fix | Delete
{
[7483] Fix | Delete
title: 'Heading 3',
[7484] Fix | Delete
format: 'h3'
[7485] Fix | Delete
},
[7486] Fix | Delete
{
[7487] Fix | Delete
title: 'Heading 4',
[7488] Fix | Delete
format: 'h4'
[7489] Fix | Delete
},
[7490] Fix | Delete
{
[7491] Fix | Delete
title: 'Heading 5',
[7492] Fix | Delete
format: 'h5'
[7493] Fix | Delete
},
[7494] Fix | Delete
{
[7495] Fix | Delete
title: 'Heading 6',
[7496] Fix | Delete
format: 'h6'
[7497] Fix | Delete
}
[7498] Fix | Delete
]
[7499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function