1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00

add inputmask

This commit is contained in:
DanieL 2022-09-21 13:51:50 -03:00
parent ab84f1e730
commit e07838c6c7
203 changed files with 29712 additions and 5216 deletions

View file

@ -1,5 +1,5 @@
/**
* TinyMCE version 6.1.2 (2022-07-29)
* TinyMCE version 6.2.0 (2022-09-08)
*/
(function () {
@ -59,6 +59,9 @@
return fn.apply(null, all);
};
}
const call = f => {
f();
};
const never = constant(false);
const always = constant(true);
@ -169,11 +172,9 @@
r[i] = x;
};
const internalFilter = (obj, pred, onTrue, onFalse) => {
const r = {};
each$1(obj, (x, i) => {
(pred(x, i) ? onTrue : onFalse)(x, i);
});
return r;
};
const filter$1 = (obj, pred) => {
const t = {};
@ -578,6 +579,10 @@
const trim = blank(/^\s+|\s+$/g);
const isNotEmpty = s => s.length > 0;
const isEmpty = s => !isNotEmpty(s);
const toInt = (value, radix = 10) => {
const num = parseInt(value, radix);
return isNaN(num) ? Optional.none() : Optional.some(num);
};
const toFloat = value => {
const num = parseFloat(value);
return isNaN(num) ? Optional.none() : Optional.some(num);
@ -852,19 +857,16 @@
const getTDTHOverallStyle = (dom, elm, name) => {
const cells = dom.select('td,th', elm);
let firstChildStyle;
const checkChildren = (firstChildStyle, elms) => {
for (let i = 0; i < elms.length; i++) {
const currentStyle = dom.getStyle(elms[i], name);
if (typeof firstChildStyle === 'undefined') {
firstChildStyle = currentStyle;
}
if (firstChildStyle !== currentStyle) {
return '';
}
for (let i = 0; i < cells.length; i++) {
const currentStyle = dom.getStyle(cells[i], name);
if (isUndefined(firstChildStyle)) {
firstChildStyle = currentStyle;
}
return firstChildStyle;
};
return checkChildren(firstChildStyle, cells);
if (firstChildStyle !== currentStyle) {
return '';
}
}
return firstChildStyle;
};
const setAlign = (editor, elm, name) => {
global$2.each('left center right'.split(' '), align => {
@ -1583,7 +1585,7 @@
};
const isListGroup = item => hasNonNullableKey(item, 'menu');
const buildListItems = items => map(items, item => {
const text = item.text || item.title;
const text = item.text || item.title || '';
if (isListGroup(item)) {
return {
text,
@ -2088,7 +2090,7 @@
if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) {
return optBorderWidth.getOr('');
}
return dom.getAttrib(elm, 'border') || getTDTHOverallStyle(editor.dom, elm, 'border-width') || getTDTHOverallStyle(editor.dom, elm, 'border');
return dom.getAttrib(elm, 'border') || getTDTHOverallStyle(editor.dom, elm, 'border-width') || getTDTHOverallStyle(editor.dom, elm, 'border') || '';
};
const dom = editor.dom;
const cellspacing = shouldStyleWithCss(editor) ? dom.getStyle(elm, 'border-spacing') || dom.getAttrib(elm, 'cellspacing') : dom.getAttrib(elm, 'cellspacing') || dom.getStyle(elm, 'border-spacing');
@ -2096,8 +2098,8 @@
return {
width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'),
height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'),
cellspacing,
cellpadding,
cellspacing: cellspacing !== null && cellspacing !== void 0 ? cellspacing : '',
cellpadding: cellpadding !== null && cellpadding !== void 0 ? cellpadding : '',
border: getBorder(dom, elm),
caption: !!dom.select('caption', elm)[0],
class: dom.getAttrib(elm, 'class', ''),
@ -2536,7 +2538,7 @@
const styleTDTH = (dom, elm, name, value) => {
if (elm.tagName === 'TD' || elm.tagName === 'TH') {
if (isString(name)) {
if (isString(name) && isNonNullable(value)) {
dom.setStyle(elm, name, value);
} else {
dom.setStyles(elm, name);
@ -2553,7 +2555,9 @@
const dom = editor.dom;
const attrs = {};
const styles = {};
attrs.class = data.class;
if (!isUndefined(data.class)) {
attrs.class = data.class;
}
styles.height = addPxSuffix(data.height);
if (shouldStyleWithCss(editor)) {
styles.width = addPxSuffix(data.width);
@ -2580,9 +2584,10 @@
}
}
if (hasAdvancedTableTab(editor)) {
styles['background-color'] = data.backgroundcolor;
styles['border-color'] = data.bordercolor;
styles['border-style'] = data.borderstyle;
const advData = data;
styles['background-color'] = advData.backgroundcolor;
styles['border-color'] = advData.bordercolor;
styles['border-style'] = advData.borderstyle;
}
attrs.style = dom.serializeStyle({
...getDefaultStyles(editor),
@ -2603,13 +2608,13 @@
}
editor.undoManager.transact(() => {
if (!tableElm) {
const cols = parseInt(data.cols, 10) || 1;
const rows = parseInt(data.rows, 10) || 1;
const cols = toInt(data.cols).getOr(1);
const rows = toInt(data.rows).getOr(1);
editor.execCommand('mceInsertTable', false, {
rows,
columns: cols
});
tableElm = getSelectionCell(getSelectionStart(editor), getIsRoot(editor)).bind(cell => table(cell, getIsRoot(editor))).map(table => table.dom).getOrUndefined();
tableElm = getSelectionCell(getSelectionStart(editor), getIsRoot(editor)).bind(cell => table(cell, getIsRoot(editor))).map(table => table.dom).getOrDie();
}
if (size(modifiedData) > 0) {
applyDataToElement(editor, tableElm, data);
@ -2635,7 +2640,15 @@
const dom = editor.dom;
let tableElm;
let data = extractDataFromSettings(editor, hasAdvancedTableTab(editor));
if (insertNewTable === false) {
if (insertNewTable) {
data.cols = '1';
data.rows = '1';
if (hasAdvancedTableTab(editor)) {
data.borderstyle = '';
data.bordercolor = '';
data.backgroundcolor = '';
}
} else {
tableElm = dom.getParent(editor.selection.getStart(), 'table', editor.getBody());
if (tableElm) {
data = extractDataFromTableElement(editor, tableElm, hasAdvancedTableTab(editor));
@ -2646,14 +2659,6 @@
data.backgroundcolor = '';
}
}
} else {
data.cols = '1';
data.rows = '1';
if (hasAdvancedTableTab(editor)) {
data.borderstyle = '';
data.bordercolor = '';
data.backgroundcolor = '';
}
}
const classes = buildListItems(getTableClassList(editor));
if (classes.length > 0) {
@ -2795,7 +2800,7 @@
const resetTargets = () => {
targets.set(cached(findTargets)());
selectionDetails = targets.get().bind(getExtractedDetails);
each(changeHandlers.get(), handler => handler());
each(changeHandlers.get(), call);
};
const setupHandler = handler => {
handler();

File diff suppressed because one or more lines are too long