Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/build
File: script.js
});
[7500] Fix | Delete
this.disableUserSelect(false);
[7501] Fix | Delete
}
[7502] Fix | Delete
}
[7503] Fix | Delete
registerEditorTypes(types) {
[7504] Fix | Delete
if (this.#editorTypes) {
[7505] Fix | Delete
return;
[7506] Fix | Delete
}
[7507] Fix | Delete
this.#editorTypes = types;
[7508] Fix | Delete
for (const editorType of this.#editorTypes) {
[7509] Fix | Delete
this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);
[7510] Fix | Delete
}
[7511] Fix | Delete
}
[7512] Fix | Delete
getId() {
[7513] Fix | Delete
return this.#idManager.id;
[7514] Fix | Delete
}
[7515] Fix | Delete
get currentLayer() {
[7516] Fix | Delete
return this.#allLayers.get(this.#currentPageIndex);
[7517] Fix | Delete
}
[7518] Fix | Delete
getLayer(pageIndex) {
[7519] Fix | Delete
return this.#allLayers.get(pageIndex);
[7520] Fix | Delete
}
[7521] Fix | Delete
get currentPageIndex() {
[7522] Fix | Delete
return this.#currentPageIndex;
[7523] Fix | Delete
}
[7524] Fix | Delete
addLayer(layer) {
[7525] Fix | Delete
this.#allLayers.set(layer.pageIndex, layer);
[7526] Fix | Delete
if (this.#isEnabled) {
[7527] Fix | Delete
layer.enable();
[7528] Fix | Delete
} else {
[7529] Fix | Delete
layer.disable();
[7530] Fix | Delete
}
[7531] Fix | Delete
}
[7532] Fix | Delete
removeLayer(layer) {
[7533] Fix | Delete
this.#allLayers.delete(layer.pageIndex);
[7534] Fix | Delete
}
[7535] Fix | Delete
updateMode(mode, editId = null, isFromKeyboard = false) {
[7536] Fix | Delete
if (this.#mode === mode) {
[7537] Fix | Delete
return;
[7538] Fix | Delete
}
[7539] Fix | Delete
this.#mode = mode;
[7540] Fix | Delete
if (mode === AnnotationEditorType.NONE) {
[7541] Fix | Delete
this.setEditingState(false);
[7542] Fix | Delete
this.#disableAll();
[7543] Fix | Delete
return;
[7544] Fix | Delete
}
[7545] Fix | Delete
this.setEditingState(true);
[7546] Fix | Delete
this.#enableAll();
[7547] Fix | Delete
this.unselectAll();
[7548] Fix | Delete
for (const layer of this.#allLayers.values()) {
[7549] Fix | Delete
layer.updateMode(mode);
[7550] Fix | Delete
}
[7551] Fix | Delete
if (!editId && isFromKeyboard) {
[7552] Fix | Delete
this.addNewEditorFromKeyboard();
[7553] Fix | Delete
return;
[7554] Fix | Delete
}
[7555] Fix | Delete
if (!editId) {
[7556] Fix | Delete
return;
[7557] Fix | Delete
}
[7558] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7559] Fix | Delete
if (editor.annotationElementId === editId) {
[7560] Fix | Delete
this.setSelected(editor);
[7561] Fix | Delete
editor.enterInEditMode();
[7562] Fix | Delete
break;
[7563] Fix | Delete
}
[7564] Fix | Delete
}
[7565] Fix | Delete
}
[7566] Fix | Delete
addNewEditorFromKeyboard() {
[7567] Fix | Delete
if (this.currentLayer.canCreateNewEmptyEditor()) {
[7568] Fix | Delete
this.currentLayer.addNewEditor();
[7569] Fix | Delete
}
[7570] Fix | Delete
}
[7571] Fix | Delete
updateToolbar(mode) {
[7572] Fix | Delete
if (mode === this.#mode) {
[7573] Fix | Delete
return;
[7574] Fix | Delete
}
[7575] Fix | Delete
this._eventBus.dispatch("switchannotationeditormode", {
[7576] Fix | Delete
source: this,
[7577] Fix | Delete
mode
[7578] Fix | Delete
});
[7579] Fix | Delete
}
[7580] Fix | Delete
updateParams(type, value) {
[7581] Fix | Delete
if (!this.#editorTypes) {
[7582] Fix | Delete
return;
[7583] Fix | Delete
}
[7584] Fix | Delete
switch (type) {
[7585] Fix | Delete
case AnnotationEditorParamsType.CREATE:
[7586] Fix | Delete
this.currentLayer.addNewEditor();
[7587] Fix | Delete
return;
[7588] Fix | Delete
case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
[7589] Fix | Delete
this.#mainHighlightColorPicker?.updateColor(value);
[7590] Fix | Delete
break;
[7591] Fix | Delete
case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:
[7592] Fix | Delete
this._eventBus.dispatch("reporttelemetry", {
[7593] Fix | Delete
source: this,
[7594] Fix | Delete
details: {
[7595] Fix | Delete
type: "editing",
[7596] Fix | Delete
data: {
[7597] Fix | Delete
type: "highlight",
[7598] Fix | Delete
action: "toggle_visibility"
[7599] Fix | Delete
}
[7600] Fix | Delete
}
[7601] Fix | Delete
});
[7602] Fix | Delete
(this.#showAllStates ||= new Map()).set(type, value);
[7603] Fix | Delete
this.showAllEditors("highlight", value);
[7604] Fix | Delete
break;
[7605] Fix | Delete
}
[7606] Fix | Delete
for (const editor of this.#selectedEditors) {
[7607] Fix | Delete
editor.updateParams(type, value);
[7608] Fix | Delete
}
[7609] Fix | Delete
for (const editorType of this.#editorTypes) {
[7610] Fix | Delete
editorType.updateDefaultParams(type, value);
[7611] Fix | Delete
}
[7612] Fix | Delete
}
[7613] Fix | Delete
showAllEditors(type, visible, updateButton = false) {
[7614] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7615] Fix | Delete
if (editor.editorType === type) {
[7616] Fix | Delete
editor.show(visible);
[7617] Fix | Delete
}
[7618] Fix | Delete
}
[7619] Fix | Delete
const state = this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? true;
[7620] Fix | Delete
if (state !== visible) {
[7621] Fix | Delete
this.#dispatchUpdateUI([[AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible]]);
[7622] Fix | Delete
}
[7623] Fix | Delete
}
[7624] Fix | Delete
enableWaiting(mustWait = false) {
[7625] Fix | Delete
if (this.#isWaiting === mustWait) {
[7626] Fix | Delete
return;
[7627] Fix | Delete
}
[7628] Fix | Delete
this.#isWaiting = mustWait;
[7629] Fix | Delete
for (const layer of this.#allLayers.values()) {
[7630] Fix | Delete
if (mustWait) {
[7631] Fix | Delete
layer.disableClick();
[7632] Fix | Delete
} else {
[7633] Fix | Delete
layer.enableClick();
[7634] Fix | Delete
}
[7635] Fix | Delete
layer.div.classList.toggle("waiting", mustWait);
[7636] Fix | Delete
}
[7637] Fix | Delete
}
[7638] Fix | Delete
#enableAll() {
[7639] Fix | Delete
if (!this.#isEnabled) {
[7640] Fix | Delete
this.#isEnabled = true;
[7641] Fix | Delete
for (const layer of this.#allLayers.values()) {
[7642] Fix | Delete
layer.enable();
[7643] Fix | Delete
}
[7644] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7645] Fix | Delete
editor.enable();
[7646] Fix | Delete
}
[7647] Fix | Delete
}
[7648] Fix | Delete
}
[7649] Fix | Delete
#disableAll() {
[7650] Fix | Delete
this.unselectAll();
[7651] Fix | Delete
if (this.#isEnabled) {
[7652] Fix | Delete
this.#isEnabled = false;
[7653] Fix | Delete
for (const layer of this.#allLayers.values()) {
[7654] Fix | Delete
layer.disable();
[7655] Fix | Delete
}
[7656] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7657] Fix | Delete
editor.disable();
[7658] Fix | Delete
}
[7659] Fix | Delete
}
[7660] Fix | Delete
}
[7661] Fix | Delete
getEditors(pageIndex) {
[7662] Fix | Delete
const editors = [];
[7663] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7664] Fix | Delete
if (editor.pageIndex === pageIndex) {
[7665] Fix | Delete
editors.push(editor);
[7666] Fix | Delete
}
[7667] Fix | Delete
}
[7668] Fix | Delete
return editors;
[7669] Fix | Delete
}
[7670] Fix | Delete
getEditor(id) {
[7671] Fix | Delete
return this.#allEditors.get(id);
[7672] Fix | Delete
}
[7673] Fix | Delete
addEditor(editor) {
[7674] Fix | Delete
this.#allEditors.set(editor.id, editor);
[7675] Fix | Delete
}
[7676] Fix | Delete
removeEditor(editor) {
[7677] Fix | Delete
if (editor.div.contains(document.activeElement)) {
[7678] Fix | Delete
if (this.#focusMainContainerTimeoutId) {
[7679] Fix | Delete
clearTimeout(this.#focusMainContainerTimeoutId);
[7680] Fix | Delete
}
[7681] Fix | Delete
this.#focusMainContainerTimeoutId = setTimeout(() => {
[7682] Fix | Delete
this.focusMainContainer();
[7683] Fix | Delete
this.#focusMainContainerTimeoutId = null;
[7684] Fix | Delete
}, 0);
[7685] Fix | Delete
}
[7686] Fix | Delete
this.#allEditors.delete(editor.id);
[7687] Fix | Delete
this.unselect(editor);
[7688] Fix | Delete
if (!editor.annotationElementId || !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)) {
[7689] Fix | Delete
this.#annotationStorage?.remove(editor.id);
[7690] Fix | Delete
}
[7691] Fix | Delete
}
[7692] Fix | Delete
addDeletedAnnotationElement(editor) {
[7693] Fix | Delete
this.#deletedAnnotationsElementIds.add(editor.annotationElementId);
[7694] Fix | Delete
this.addChangedExistingAnnotation(editor);
[7695] Fix | Delete
editor.deleted = true;
[7696] Fix | Delete
}
[7697] Fix | Delete
isDeletedAnnotationElement(annotationElementId) {
[7698] Fix | Delete
return this.#deletedAnnotationsElementIds.has(annotationElementId);
[7699] Fix | Delete
}
[7700] Fix | Delete
removeDeletedAnnotationElement(editor) {
[7701] Fix | Delete
this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);
[7702] Fix | Delete
this.removeChangedExistingAnnotation(editor);
[7703] Fix | Delete
editor.deleted = false;
[7704] Fix | Delete
}
[7705] Fix | Delete
#addEditorToLayer(editor) {
[7706] Fix | Delete
const layer = this.#allLayers.get(editor.pageIndex);
[7707] Fix | Delete
if (layer) {
[7708] Fix | Delete
layer.addOrRebuild(editor);
[7709] Fix | Delete
} else {
[7710] Fix | Delete
this.addEditor(editor);
[7711] Fix | Delete
this.addToAnnotationStorage(editor);
[7712] Fix | Delete
}
[7713] Fix | Delete
}
[7714] Fix | Delete
setActiveEditor(editor) {
[7715] Fix | Delete
if (this.#activeEditor === editor) {
[7716] Fix | Delete
return;
[7717] Fix | Delete
}
[7718] Fix | Delete
this.#activeEditor = editor;
[7719] Fix | Delete
if (editor) {
[7720] Fix | Delete
this.#dispatchUpdateUI(editor.propertiesToUpdate);
[7721] Fix | Delete
}
[7722] Fix | Delete
}
[7723] Fix | Delete
get #lastSelectedEditor() {
[7724] Fix | Delete
let ed = null;
[7725] Fix | Delete
for (ed of this.#selectedEditors) {}
[7726] Fix | Delete
return ed;
[7727] Fix | Delete
}
[7728] Fix | Delete
updateUI(editor) {
[7729] Fix | Delete
if (this.#lastSelectedEditor === editor) {
[7730] Fix | Delete
this.#dispatchUpdateUI(editor.propertiesToUpdate);
[7731] Fix | Delete
}
[7732] Fix | Delete
}
[7733] Fix | Delete
toggleSelected(editor) {
[7734] Fix | Delete
if (this.#selectedEditors.has(editor)) {
[7735] Fix | Delete
this.#selectedEditors.delete(editor);
[7736] Fix | Delete
editor.unselect();
[7737] Fix | Delete
this.#dispatchUpdateStates({
[7738] Fix | Delete
hasSelectedEditor: this.hasSelection
[7739] Fix | Delete
});
[7740] Fix | Delete
return;
[7741] Fix | Delete
}
[7742] Fix | Delete
this.#selectedEditors.add(editor);
[7743] Fix | Delete
editor.select();
[7744] Fix | Delete
this.#dispatchUpdateUI(editor.propertiesToUpdate);
[7745] Fix | Delete
this.#dispatchUpdateStates({
[7746] Fix | Delete
hasSelectedEditor: true
[7747] Fix | Delete
});
[7748] Fix | Delete
}
[7749] Fix | Delete
setSelected(editor) {
[7750] Fix | Delete
for (const ed of this.#selectedEditors) {
[7751] Fix | Delete
if (ed !== editor) {
[7752] Fix | Delete
ed.unselect();
[7753] Fix | Delete
}
[7754] Fix | Delete
}
[7755] Fix | Delete
this.#selectedEditors.clear();
[7756] Fix | Delete
this.#selectedEditors.add(editor);
[7757] Fix | Delete
editor.select();
[7758] Fix | Delete
this.#dispatchUpdateUI(editor.propertiesToUpdate);
[7759] Fix | Delete
this.#dispatchUpdateStates({
[7760] Fix | Delete
hasSelectedEditor: true
[7761] Fix | Delete
});
[7762] Fix | Delete
}
[7763] Fix | Delete
isSelected(editor) {
[7764] Fix | Delete
return this.#selectedEditors.has(editor);
[7765] Fix | Delete
}
[7766] Fix | Delete
get firstSelectedEditor() {
[7767] Fix | Delete
return this.#selectedEditors.values().next().value;
[7768] Fix | Delete
}
[7769] Fix | Delete
unselect(editor) {
[7770] Fix | Delete
editor.unselect();
[7771] Fix | Delete
this.#selectedEditors.delete(editor);
[7772] Fix | Delete
this.#dispatchUpdateStates({
[7773] Fix | Delete
hasSelectedEditor: this.hasSelection
[7774] Fix | Delete
});
[7775] Fix | Delete
}
[7776] Fix | Delete
get hasSelection() {
[7777] Fix | Delete
return this.#selectedEditors.size !== 0;
[7778] Fix | Delete
}
[7779] Fix | Delete
get isEnterHandled() {
[7780] Fix | Delete
return this.#selectedEditors.size === 1 && this.firstSelectedEditor.isEnterHandled;
[7781] Fix | Delete
}
[7782] Fix | Delete
undo() {
[7783] Fix | Delete
this.#commandManager.undo();
[7784] Fix | Delete
this.#dispatchUpdateStates({
[7785] Fix | Delete
hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),
[7786] Fix | Delete
hasSomethingToRedo: true,
[7787] Fix | Delete
isEmpty: this.#isEmpty()
[7788] Fix | Delete
});
[7789] Fix | Delete
}
[7790] Fix | Delete
redo() {
[7791] Fix | Delete
this.#commandManager.redo();
[7792] Fix | Delete
this.#dispatchUpdateStates({
[7793] Fix | Delete
hasSomethingToUndo: true,
[7794] Fix | Delete
hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),
[7795] Fix | Delete
isEmpty: this.#isEmpty()
[7796] Fix | Delete
});
[7797] Fix | Delete
}
[7798] Fix | Delete
addCommands(params) {
[7799] Fix | Delete
this.#commandManager.add(params);
[7800] Fix | Delete
this.#dispatchUpdateStates({
[7801] Fix | Delete
hasSomethingToUndo: true,
[7802] Fix | Delete
hasSomethingToRedo: false,
[7803] Fix | Delete
isEmpty: this.#isEmpty()
[7804] Fix | Delete
});
[7805] Fix | Delete
}
[7806] Fix | Delete
#isEmpty() {
[7807] Fix | Delete
if (this.#allEditors.size === 0) {
[7808] Fix | Delete
return true;
[7809] Fix | Delete
}
[7810] Fix | Delete
if (this.#allEditors.size === 1) {
[7811] Fix | Delete
for (const editor of this.#allEditors.values()) {
[7812] Fix | Delete
return editor.isEmpty();
[7813] Fix | Delete
}
[7814] Fix | Delete
}
[7815] Fix | Delete
return false;
[7816] Fix | Delete
}
[7817] Fix | Delete
delete() {
[7818] Fix | Delete
this.commitOrRemove();
[7819] Fix | Delete
if (!this.hasSelection) {
[7820] Fix | Delete
return;
[7821] Fix | Delete
}
[7822] Fix | Delete
const editors = [...this.#selectedEditors];
[7823] Fix | Delete
const cmd = () => {
[7824] Fix | Delete
for (const editor of editors) {
[7825] Fix | Delete
editor.remove();
[7826] Fix | Delete
}
[7827] Fix | Delete
};
[7828] Fix | Delete
const undo = () => {
[7829] Fix | Delete
for (const editor of editors) {
[7830] Fix | Delete
this.#addEditorToLayer(editor);
[7831] Fix | Delete
}
[7832] Fix | Delete
};
[7833] Fix | Delete
this.addCommands({
[7834] Fix | Delete
cmd,
[7835] Fix | Delete
undo,
[7836] Fix | Delete
mustExec: true
[7837] Fix | Delete
});
[7838] Fix | Delete
}
[7839] Fix | Delete
commitOrRemove() {
[7840] Fix | Delete
this.#activeEditor?.commitOrRemove();
[7841] Fix | Delete
}
[7842] Fix | Delete
hasSomethingToControl() {
[7843] Fix | Delete
return this.#activeEditor || this.hasSelection;
[7844] Fix | Delete
}
[7845] Fix | Delete
#selectEditors(editors) {
[7846] Fix | Delete
for (const editor of this.#selectedEditors) {
[7847] Fix | Delete
editor.unselect();
[7848] Fix | Delete
}
[7849] Fix | Delete
this.#selectedEditors.clear();
[7850] Fix | Delete
for (const editor of editors) {
[7851] Fix | Delete
if (editor.isEmpty()) {
[7852] Fix | Delete
continue;
[7853] Fix | Delete
}
[7854] Fix | Delete
this.#selectedEditors.add(editor);
[7855] Fix | Delete
editor.select();
[7856] Fix | Delete
}
[7857] Fix | Delete
this.#dispatchUpdateStates({
[7858] Fix | Delete
hasSelectedEditor: this.hasSelection
[7859] Fix | Delete
});
[7860] Fix | Delete
}
[7861] Fix | Delete
selectAll() {
[7862] Fix | Delete
for (const editor of this.#selectedEditors) {
[7863] Fix | Delete
editor.commit();
[7864] Fix | Delete
}
[7865] Fix | Delete
this.#selectEditors(this.#allEditors.values());
[7866] Fix | Delete
}
[7867] Fix | Delete
unselectAll() {
[7868] Fix | Delete
if (this.#activeEditor) {
[7869] Fix | Delete
this.#activeEditor.commitOrRemove();
[7870] Fix | Delete
if (this.#mode !== AnnotationEditorType.NONE) {
[7871] Fix | Delete
return;
[7872] Fix | Delete
}
[7873] Fix | Delete
}
[7874] Fix | Delete
if (!this.hasSelection) {
[7875] Fix | Delete
return;
[7876] Fix | Delete
}
[7877] Fix | Delete
for (const editor of this.#selectedEditors) {
[7878] Fix | Delete
editor.unselect();
[7879] Fix | Delete
}
[7880] Fix | Delete
this.#selectedEditors.clear();
[7881] Fix | Delete
this.#dispatchUpdateStates({
[7882] Fix | Delete
hasSelectedEditor: false
[7883] Fix | Delete
});
[7884] Fix | Delete
}
[7885] Fix | Delete
translateSelectedEditors(x, y, noCommit = false) {
[7886] Fix | Delete
if (!noCommit) {
[7887] Fix | Delete
this.commitOrRemove();
[7888] Fix | Delete
}
[7889] Fix | Delete
if (!this.hasSelection) {
[7890] Fix | Delete
return;
[7891] Fix | Delete
}
[7892] Fix | Delete
this.#translation[0] += x;
[7893] Fix | Delete
this.#translation[1] += y;
[7894] Fix | Delete
const [totalX, totalY] = this.#translation;
[7895] Fix | Delete
const editors = [...this.#selectedEditors];
[7896] Fix | Delete
const TIME_TO_WAIT = 1000;
[7897] Fix | Delete
if (this.#translationTimeoutId) {
[7898] Fix | Delete
clearTimeout(this.#translationTimeoutId);
[7899] Fix | Delete
}
[7900] Fix | Delete
this.#translationTimeoutId = setTimeout(() => {
[7901] Fix | Delete
this.#translationTimeoutId = null;
[7902] Fix | Delete
this.#translation[0] = this.#translation[1] = 0;
[7903] Fix | Delete
this.addCommands({
[7904] Fix | Delete
cmd: () => {
[7905] Fix | Delete
for (const editor of editors) {
[7906] Fix | Delete
if (this.#allEditors.has(editor.id)) {
[7907] Fix | Delete
editor.translateInPage(totalX, totalY);
[7908] Fix | Delete
}
[7909] Fix | Delete
}
[7910] Fix | Delete
},
[7911] Fix | Delete
undo: () => {
[7912] Fix | Delete
for (const editor of editors) {
[7913] Fix | Delete
if (this.#allEditors.has(editor.id)) {
[7914] Fix | Delete
editor.translateInPage(-totalX, -totalY);
[7915] Fix | Delete
}
[7916] Fix | Delete
}
[7917] Fix | Delete
},
[7918] Fix | Delete
mustExec: false
[7919] Fix | Delete
});
[7920] Fix | Delete
}, TIME_TO_WAIT);
[7921] Fix | Delete
for (const editor of editors) {
[7922] Fix | Delete
editor.translateInPage(x, y);
[7923] Fix | Delete
}
[7924] Fix | Delete
}
[7925] Fix | Delete
setUpDragSession() {
[7926] Fix | Delete
if (!this.hasSelection) {
[7927] Fix | Delete
return;
[7928] Fix | Delete
}
[7929] Fix | Delete
this.disableUserSelect(true);
[7930] Fix | Delete
this.#draggingEditors = new Map();
[7931] Fix | Delete
for (const editor of this.#selectedEditors) {
[7932] Fix | Delete
this.#draggingEditors.set(editor, {
[7933] Fix | Delete
savedX: editor.x,
[7934] Fix | Delete
savedY: editor.y,
[7935] Fix | Delete
savedPageIndex: editor.pageIndex,
[7936] Fix | Delete
newX: 0,
[7937] Fix | Delete
newY: 0,
[7938] Fix | Delete
newPageIndex: -1
[7939] Fix | Delete
});
[7940] Fix | Delete
}
[7941] Fix | Delete
}
[7942] Fix | Delete
endDragSession() {
[7943] Fix | Delete
if (!this.#draggingEditors) {
[7944] Fix | Delete
return false;
[7945] Fix | Delete
}
[7946] Fix | Delete
this.disableUserSelect(false);
[7947] Fix | Delete
const map = this.#draggingEditors;
[7948] Fix | Delete
this.#draggingEditors = null;
[7949] Fix | Delete
let mustBeAddedInUndoStack = false;
[7950] Fix | Delete
for (const [{
[7951] Fix | Delete
x,
[7952] Fix | Delete
y,
[7953] Fix | Delete
pageIndex
[7954] Fix | Delete
}, value] of map) {
[7955] Fix | Delete
value.newX = x;
[7956] Fix | Delete
value.newY = y;
[7957] Fix | Delete
value.newPageIndex = pageIndex;
[7958] Fix | Delete
mustBeAddedInUndoStack ||= x !== value.savedX || y !== value.savedY || pageIndex !== value.savedPageIndex;
[7959] Fix | Delete
}
[7960] Fix | Delete
if (!mustBeAddedInUndoStack) {
[7961] Fix | Delete
return false;
[7962] Fix | Delete
}
[7963] Fix | Delete
const move = (editor, x, y, pageIndex) => {
[7964] Fix | Delete
if (this.#allEditors.has(editor.id)) {
[7965] Fix | Delete
const parent = this.#allLayers.get(pageIndex);
[7966] Fix | Delete
if (parent) {
[7967] Fix | Delete
editor._setParentAndPosition(parent, x, y);
[7968] Fix | Delete
} else {
[7969] Fix | Delete
editor.pageIndex = pageIndex;
[7970] Fix | Delete
editor.x = x;
[7971] Fix | Delete
editor.y = y;
[7972] Fix | Delete
}
[7973] Fix | Delete
}
[7974] Fix | Delete
};
[7975] Fix | Delete
this.addCommands({
[7976] Fix | Delete
cmd: () => {
[7977] Fix | Delete
for (const [editor, {
[7978] Fix | Delete
newX,
[7979] Fix | Delete
newY,
[7980] Fix | Delete
newPageIndex
[7981] Fix | Delete
}] of map) {
[7982] Fix | Delete
move(editor, newX, newY, newPageIndex);
[7983] Fix | Delete
}
[7984] Fix | Delete
},
[7985] Fix | Delete
undo: () => {
[7986] Fix | Delete
for (const [editor, {
[7987] Fix | Delete
savedX,
[7988] Fix | Delete
savedY,
[7989] Fix | Delete
savedPageIndex
[7990] Fix | Delete
}] of map) {
[7991] Fix | Delete
move(editor, savedX, savedY, savedPageIndex);
[7992] Fix | Delete
}
[7993] Fix | Delete
},
[7994] Fix | Delete
mustExec: true
[7995] Fix | Delete
});
[7996] Fix | Delete
return true;
[7997] Fix | Delete
}
[7998] Fix | Delete
dragSelectedEditors(tx, ty) {
[7999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function