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
}
[6500] Fix | Delete
#render() {
[6501] Fix | Delete
const editToolbar = this.#toolbar = document.createElement("div");
[6502] Fix | Delete
editToolbar.className = "editToolbar";
[6503] Fix | Delete
editToolbar.setAttribute("role", "toolbar");
[6504] Fix | Delete
editToolbar.addEventListener("contextmenu", noContextMenu);
[6505] Fix | Delete
const buttons = this.#buttons = document.createElement("div");
[6506] Fix | Delete
buttons.className = "buttons";
[6507] Fix | Delete
editToolbar.append(buttons);
[6508] Fix | Delete
this.#addHighlightButton();
[6509] Fix | Delete
return editToolbar;
[6510] Fix | Delete
}
[6511] Fix | Delete
#getLastPoint(boxes, isLTR) {
[6512] Fix | Delete
let lastY = 0;
[6513] Fix | Delete
let lastX = 0;
[6514] Fix | Delete
for (const box of boxes) {
[6515] Fix | Delete
const y = box.y + box.height;
[6516] Fix | Delete
if (y < lastY) {
[6517] Fix | Delete
continue;
[6518] Fix | Delete
}
[6519] Fix | Delete
const x = box.x + (isLTR ? box.width : 0);
[6520] Fix | Delete
if (y > lastY) {
[6521] Fix | Delete
lastX = x;
[6522] Fix | Delete
lastY = y;
[6523] Fix | Delete
continue;
[6524] Fix | Delete
}
[6525] Fix | Delete
if (isLTR) {
[6526] Fix | Delete
if (x > lastX) {
[6527] Fix | Delete
lastX = x;
[6528] Fix | Delete
}
[6529] Fix | Delete
} else if (x < lastX) {
[6530] Fix | Delete
lastX = x;
[6531] Fix | Delete
}
[6532] Fix | Delete
}
[6533] Fix | Delete
return [isLTR ? 1 - lastX : lastX, lastY];
[6534] Fix | Delete
}
[6535] Fix | Delete
show(parent, boxes, isLTR) {
[6536] Fix | Delete
const [x, y] = this.#getLastPoint(boxes, isLTR);
[6537] Fix | Delete
const {
[6538] Fix | Delete
style
[6539] Fix | Delete
} = this.#toolbar ||= this.#render();
[6540] Fix | Delete
parent.append(this.#toolbar);
[6541] Fix | Delete
style.insetInlineEnd = `${100 * x}%`;
[6542] Fix | Delete
style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`;
[6543] Fix | Delete
}
[6544] Fix | Delete
hide() {
[6545] Fix | Delete
this.#toolbar.remove();
[6546] Fix | Delete
}
[6547] Fix | Delete
#addHighlightButton() {
[6548] Fix | Delete
const button = document.createElement("button");
[6549] Fix | Delete
button.className = "highlightButton";
[6550] Fix | Delete
button.tabIndex = 0;
[6551] Fix | Delete
button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button1`);
[6552] Fix | Delete
const span = document.createElement("span");
[6553] Fix | Delete
button.append(span);
[6554] Fix | Delete
span.className = "visuallyHidden";
[6555] Fix | Delete
span.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label");
[6556] Fix | Delete
button.addEventListener("contextmenu", noContextMenu);
[6557] Fix | Delete
button.addEventListener("click", () => {
[6558] Fix | Delete
this.#uiManager.highlightSelection("floating_button");
[6559] Fix | Delete
});
[6560] Fix | Delete
this.#buttons.append(button);
[6561] Fix | Delete
}
[6562] Fix | Delete
}
[6563] Fix | Delete
[6564] Fix | Delete
;// CONCATENATED MODULE: ./src/display/editor/tools.js
[6565] Fix | Delete
[6566] Fix | Delete
[6567] Fix | Delete
[6568] Fix | Delete
[6569] Fix | Delete
[6570] Fix | Delete
[6571] Fix | Delete
[6572] Fix | Delete
[6573] Fix | Delete
[6574] Fix | Delete
[6575] Fix | Delete
[6576] Fix | Delete
[6577] Fix | Delete
[6578] Fix | Delete
[6579] Fix | Delete
[6580] Fix | Delete
[6581] Fix | Delete
[6582] Fix | Delete
[6583] Fix | Delete
[6584] Fix | Delete
[6585] Fix | Delete
[6586] Fix | Delete
[6587] Fix | Delete
function bindEvents(obj, element, names) {
[6588] Fix | Delete
for (const name of names) {
[6589] Fix | Delete
element.addEventListener(name, obj[name].bind(obj));
[6590] Fix | Delete
}
[6591] Fix | Delete
}
[6592] Fix | Delete
function opacityToHex(opacity) {
[6593] Fix | Delete
return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, "0");
[6594] Fix | Delete
}
[6595] Fix | Delete
class IdManager {
[6596] Fix | Delete
#id = 0;
[6597] Fix | Delete
get id() {
[6598] Fix | Delete
return `${AnnotationEditorPrefix}${this.#id++}`;
[6599] Fix | Delete
}
[6600] Fix | Delete
}
[6601] Fix | Delete
class ImageManager {
[6602] Fix | Delete
#baseId = getUuid();
[6603] Fix | Delete
#id = 0;
[6604] Fix | Delete
#cache = null;
[6605] Fix | Delete
static get _isSVGFittingCanvas() {
[6606] Fix | Delete
const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`;
[6607] Fix | Delete
const canvas = new OffscreenCanvas(1, 3);
[6608] Fix | Delete
const ctx = canvas.getContext("2d");
[6609] Fix | Delete
const image = new Image();
[6610] Fix | Delete
image.src = svg;
[6611] Fix | Delete
const promise = image.decode().then(() => {
[6612] Fix | Delete
ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);
[6613] Fix | Delete
return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;
[6614] Fix | Delete
});
[6615] Fix | Delete
return shadow(this, "_isSVGFittingCanvas", promise);
[6616] Fix | Delete
}
[6617] Fix | Delete
async #get(key, rawData) {
[6618] Fix | Delete
this.#cache ||= new Map();
[6619] Fix | Delete
let data = this.#cache.get(key);
[6620] Fix | Delete
if (data === null) {
[6621] Fix | Delete
return null;
[6622] Fix | Delete
}
[6623] Fix | Delete
if (data?.bitmap) {
[6624] Fix | Delete
data.refCounter += 1;
[6625] Fix | Delete
return data;
[6626] Fix | Delete
}
[6627] Fix | Delete
try {
[6628] Fix | Delete
data ||= {
[6629] Fix | Delete
bitmap: null,
[6630] Fix | Delete
id: `image_${this.#baseId}_${this.#id++}`,
[6631] Fix | Delete
refCounter: 0,
[6632] Fix | Delete
isSvg: false
[6633] Fix | Delete
};
[6634] Fix | Delete
let image;
[6635] Fix | Delete
if (typeof rawData === "string") {
[6636] Fix | Delete
data.url = rawData;
[6637] Fix | Delete
image = await fetchData(rawData, "blob");
[6638] Fix | Delete
} else {
[6639] Fix | Delete
image = data.file = rawData;
[6640] Fix | Delete
}
[6641] Fix | Delete
if (image.type === "image/svg+xml") {
[6642] Fix | Delete
const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;
[6643] Fix | Delete
const fileReader = new FileReader();
[6644] Fix | Delete
const imageElement = new Image();
[6645] Fix | Delete
const imagePromise = new Promise((resolve, reject) => {
[6646] Fix | Delete
imageElement.onload = () => {
[6647] Fix | Delete
data.bitmap = imageElement;
[6648] Fix | Delete
data.isSvg = true;
[6649] Fix | Delete
resolve();
[6650] Fix | Delete
};
[6651] Fix | Delete
fileReader.onload = async () => {
[6652] Fix | Delete
const url = data.svgUrl = fileReader.result;
[6653] Fix | Delete
imageElement.src = (await mustRemoveAspectRatioPromise) ? `${url}#svgView(preserveAspectRatio(none))` : url;
[6654] Fix | Delete
};
[6655] Fix | Delete
imageElement.onerror = fileReader.onerror = reject;
[6656] Fix | Delete
});
[6657] Fix | Delete
fileReader.readAsDataURL(image);
[6658] Fix | Delete
await imagePromise;
[6659] Fix | Delete
} else {
[6660] Fix | Delete
data.bitmap = await createImageBitmap(image);
[6661] Fix | Delete
}
[6662] Fix | Delete
data.refCounter = 1;
[6663] Fix | Delete
} catch (e) {
[6664] Fix | Delete
console.error(e);
[6665] Fix | Delete
data = null;
[6666] Fix | Delete
}
[6667] Fix | Delete
this.#cache.set(key, data);
[6668] Fix | Delete
if (data) {
[6669] Fix | Delete
this.#cache.set(data.id, data);
[6670] Fix | Delete
}
[6671] Fix | Delete
return data;
[6672] Fix | Delete
}
[6673] Fix | Delete
async getFromFile(file) {
[6674] Fix | Delete
const {
[6675] Fix | Delete
lastModified,
[6676] Fix | Delete
name,
[6677] Fix | Delete
size,
[6678] Fix | Delete
type
[6679] Fix | Delete
} = file;
[6680] Fix | Delete
return this.#get(`${lastModified}_${name}_${size}_${type}`, file);
[6681] Fix | Delete
}
[6682] Fix | Delete
async getFromUrl(url) {
[6683] Fix | Delete
return this.#get(url, url);
[6684] Fix | Delete
}
[6685] Fix | Delete
async getFromId(id) {
[6686] Fix | Delete
this.#cache ||= new Map();
[6687] Fix | Delete
const data = this.#cache.get(id);
[6688] Fix | Delete
if (!data) {
[6689] Fix | Delete
return null;
[6690] Fix | Delete
}
[6691] Fix | Delete
if (data.bitmap) {
[6692] Fix | Delete
data.refCounter += 1;
[6693] Fix | Delete
return data;
[6694] Fix | Delete
}
[6695] Fix | Delete
if (data.file) {
[6696] Fix | Delete
return this.getFromFile(data.file);
[6697] Fix | Delete
}
[6698] Fix | Delete
return this.getFromUrl(data.url);
[6699] Fix | Delete
}
[6700] Fix | Delete
getSvgUrl(id) {
[6701] Fix | Delete
const data = this.#cache.get(id);
[6702] Fix | Delete
if (!data?.isSvg) {
[6703] Fix | Delete
return null;
[6704] Fix | Delete
}
[6705] Fix | Delete
return data.svgUrl;
[6706] Fix | Delete
}
[6707] Fix | Delete
deleteId(id) {
[6708] Fix | Delete
this.#cache ||= new Map();
[6709] Fix | Delete
const data = this.#cache.get(id);
[6710] Fix | Delete
if (!data) {
[6711] Fix | Delete
return;
[6712] Fix | Delete
}
[6713] Fix | Delete
data.refCounter -= 1;
[6714] Fix | Delete
if (data.refCounter !== 0) {
[6715] Fix | Delete
return;
[6716] Fix | Delete
}
[6717] Fix | Delete
data.bitmap = null;
[6718] Fix | Delete
}
[6719] Fix | Delete
isValidId(id) {
[6720] Fix | Delete
return id.startsWith(`image_${this.#baseId}_`);
[6721] Fix | Delete
}
[6722] Fix | Delete
}
[6723] Fix | Delete
class CommandManager {
[6724] Fix | Delete
#commands = [];
[6725] Fix | Delete
#locked = false;
[6726] Fix | Delete
#maxSize;
[6727] Fix | Delete
#position = -1;
[6728] Fix | Delete
constructor(maxSize = 128) {
[6729] Fix | Delete
this.#maxSize = maxSize;
[6730] Fix | Delete
}
[6731] Fix | Delete
add({
[6732] Fix | Delete
cmd,
[6733] Fix | Delete
undo,
[6734] Fix | Delete
post,
[6735] Fix | Delete
mustExec,
[6736] Fix | Delete
type = NaN,
[6737] Fix | Delete
overwriteIfSameType = false,
[6738] Fix | Delete
keepUndo = false
[6739] Fix | Delete
}) {
[6740] Fix | Delete
if (mustExec) {
[6741] Fix | Delete
cmd();
[6742] Fix | Delete
}
[6743] Fix | Delete
if (this.#locked) {
[6744] Fix | Delete
return;
[6745] Fix | Delete
}
[6746] Fix | Delete
const save = {
[6747] Fix | Delete
cmd,
[6748] Fix | Delete
undo,
[6749] Fix | Delete
post,
[6750] Fix | Delete
type
[6751] Fix | Delete
};
[6752] Fix | Delete
if (this.#position === -1) {
[6753] Fix | Delete
if (this.#commands.length > 0) {
[6754] Fix | Delete
this.#commands.length = 0;
[6755] Fix | Delete
}
[6756] Fix | Delete
this.#position = 0;
[6757] Fix | Delete
this.#commands.push(save);
[6758] Fix | Delete
return;
[6759] Fix | Delete
}
[6760] Fix | Delete
if (overwriteIfSameType && this.#commands[this.#position].type === type) {
[6761] Fix | Delete
if (keepUndo) {
[6762] Fix | Delete
save.undo = this.#commands[this.#position].undo;
[6763] Fix | Delete
}
[6764] Fix | Delete
this.#commands[this.#position] = save;
[6765] Fix | Delete
return;
[6766] Fix | Delete
}
[6767] Fix | Delete
const next = this.#position + 1;
[6768] Fix | Delete
if (next === this.#maxSize) {
[6769] Fix | Delete
this.#commands.splice(0, 1);
[6770] Fix | Delete
} else {
[6771] Fix | Delete
this.#position = next;
[6772] Fix | Delete
if (next < this.#commands.length) {
[6773] Fix | Delete
this.#commands.splice(next);
[6774] Fix | Delete
}
[6775] Fix | Delete
}
[6776] Fix | Delete
this.#commands.push(save);
[6777] Fix | Delete
}
[6778] Fix | Delete
undo() {
[6779] Fix | Delete
if (this.#position === -1) {
[6780] Fix | Delete
return;
[6781] Fix | Delete
}
[6782] Fix | Delete
this.#locked = true;
[6783] Fix | Delete
const {
[6784] Fix | Delete
undo,
[6785] Fix | Delete
post
[6786] Fix | Delete
} = this.#commands[this.#position];
[6787] Fix | Delete
undo();
[6788] Fix | Delete
post?.();
[6789] Fix | Delete
this.#locked = false;
[6790] Fix | Delete
this.#position -= 1;
[6791] Fix | Delete
}
[6792] Fix | Delete
redo() {
[6793] Fix | Delete
if (this.#position < this.#commands.length - 1) {
[6794] Fix | Delete
this.#position += 1;
[6795] Fix | Delete
this.#locked = true;
[6796] Fix | Delete
const {
[6797] Fix | Delete
cmd,
[6798] Fix | Delete
post
[6799] Fix | Delete
} = this.#commands[this.#position];
[6800] Fix | Delete
cmd();
[6801] Fix | Delete
post?.();
[6802] Fix | Delete
this.#locked = false;
[6803] Fix | Delete
}
[6804] Fix | Delete
}
[6805] Fix | Delete
hasSomethingToUndo() {
[6806] Fix | Delete
return this.#position !== -1;
[6807] Fix | Delete
}
[6808] Fix | Delete
hasSomethingToRedo() {
[6809] Fix | Delete
return this.#position < this.#commands.length - 1;
[6810] Fix | Delete
}
[6811] Fix | Delete
destroy() {
[6812] Fix | Delete
this.#commands = null;
[6813] Fix | Delete
}
[6814] Fix | Delete
}
[6815] Fix | Delete
class KeyboardManager {
[6816] Fix | Delete
constructor(callbacks) {
[6817] Fix | Delete
this.buffer = [];
[6818] Fix | Delete
this.callbacks = new Map();
[6819] Fix | Delete
this.allKeys = new Set();
[6820] Fix | Delete
const {
[6821] Fix | Delete
isMac
[6822] Fix | Delete
} = util_FeatureTest.platform;
[6823] Fix | Delete
for (const [keys, callback, options = {}] of callbacks) {
[6824] Fix | Delete
for (const key of keys) {
[6825] Fix | Delete
const isMacKey = key.startsWith("mac+");
[6826] Fix | Delete
if (isMac && isMacKey) {
[6827] Fix | Delete
this.callbacks.set(key.slice(4), {
[6828] Fix | Delete
callback,
[6829] Fix | Delete
options
[6830] Fix | Delete
});
[6831] Fix | Delete
this.allKeys.add(key.split("+").at(-1));
[6832] Fix | Delete
} else if (!isMac && !isMacKey) {
[6833] Fix | Delete
this.callbacks.set(key, {
[6834] Fix | Delete
callback,
[6835] Fix | Delete
options
[6836] Fix | Delete
});
[6837] Fix | Delete
this.allKeys.add(key.split("+").at(-1));
[6838] Fix | Delete
}
[6839] Fix | Delete
}
[6840] Fix | Delete
}
[6841] Fix | Delete
}
[6842] Fix | Delete
#serialize(event) {
[6843] Fix | Delete
if (event.altKey) {
[6844] Fix | Delete
this.buffer.push("alt");
[6845] Fix | Delete
}
[6846] Fix | Delete
if (event.ctrlKey) {
[6847] Fix | Delete
this.buffer.push("ctrl");
[6848] Fix | Delete
}
[6849] Fix | Delete
if (event.metaKey) {
[6850] Fix | Delete
this.buffer.push("meta");
[6851] Fix | Delete
}
[6852] Fix | Delete
if (event.shiftKey) {
[6853] Fix | Delete
this.buffer.push("shift");
[6854] Fix | Delete
}
[6855] Fix | Delete
this.buffer.push(event.key);
[6856] Fix | Delete
const str = this.buffer.join("+");
[6857] Fix | Delete
this.buffer.length = 0;
[6858] Fix | Delete
return str;
[6859] Fix | Delete
}
[6860] Fix | Delete
exec(self, event) {
[6861] Fix | Delete
if (!this.allKeys.has(event.key)) {
[6862] Fix | Delete
return;
[6863] Fix | Delete
}
[6864] Fix | Delete
const info = this.callbacks.get(this.#serialize(event));
[6865] Fix | Delete
if (!info) {
[6866] Fix | Delete
return;
[6867] Fix | Delete
}
[6868] Fix | Delete
const {
[6869] Fix | Delete
callback,
[6870] Fix | Delete
options: {
[6871] Fix | Delete
bubbles = false,
[6872] Fix | Delete
args = [],
[6873] Fix | Delete
checker = null
[6874] Fix | Delete
}
[6875] Fix | Delete
} = info;
[6876] Fix | Delete
if (checker && !checker(self, event)) {
[6877] Fix | Delete
return;
[6878] Fix | Delete
}
[6879] Fix | Delete
callback.bind(self, ...args, event)();
[6880] Fix | Delete
if (!bubbles) {
[6881] Fix | Delete
event.stopPropagation();
[6882] Fix | Delete
event.preventDefault();
[6883] Fix | Delete
}
[6884] Fix | Delete
}
[6885] Fix | Delete
}
[6886] Fix | Delete
class ColorManager {
[6887] Fix | Delete
static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
[6888] Fix | Delete
get _colors() {
[6889] Fix | Delete
const colors = new Map([["CanvasText", null], ["Canvas", null]]);
[6890] Fix | Delete
getColorValues(colors);
[6891] Fix | Delete
return shadow(this, "_colors", colors);
[6892] Fix | Delete
}
[6893] Fix | Delete
convert(color) {
[6894] Fix | Delete
const rgb = getRGB(color);
[6895] Fix | Delete
if (!window.matchMedia("(forced-colors: active)").matches) {
[6896] Fix | Delete
return rgb;
[6897] Fix | Delete
}
[6898] Fix | Delete
for (const [name, RGB] of this._colors) {
[6899] Fix | Delete
if (RGB.every((x, i) => x === rgb[i])) {
[6900] Fix | Delete
return ColorManager._colorsMapping.get(name);
[6901] Fix | Delete
}
[6902] Fix | Delete
}
[6903] Fix | Delete
return rgb;
[6904] Fix | Delete
}
[6905] Fix | Delete
getHexCode(name) {
[6906] Fix | Delete
const rgb = this._colors.get(name);
[6907] Fix | Delete
if (!rgb) {
[6908] Fix | Delete
return name;
[6909] Fix | Delete
}
[6910] Fix | Delete
return Util.makeHexColor(...rgb);
[6911] Fix | Delete
}
[6912] Fix | Delete
}
[6913] Fix | Delete
class AnnotationEditorUIManager {
[6914] Fix | Delete
#activeEditor = null;
[6915] Fix | Delete
#allEditors = new Map();
[6916] Fix | Delete
#allLayers = new Map();
[6917] Fix | Delete
#altTextManager = null;
[6918] Fix | Delete
#annotationStorage = null;
[6919] Fix | Delete
#changedExistingAnnotations = null;
[6920] Fix | Delete
#commandManager = new CommandManager();
[6921] Fix | Delete
#currentPageIndex = 0;
[6922] Fix | Delete
#deletedAnnotationsElementIds = new Set();
[6923] Fix | Delete
#draggingEditors = null;
[6924] Fix | Delete
#editorTypes = null;
[6925] Fix | Delete
#editorsToRescale = new Set();
[6926] Fix | Delete
#enableHighlightFloatingButton = false;
[6927] Fix | Delete
#filterFactory = null;
[6928] Fix | Delete
#focusMainContainerTimeoutId = null;
[6929] Fix | Delete
#highlightColors = null;
[6930] Fix | Delete
#highlightWhenShiftUp = false;
[6931] Fix | Delete
#highlightToolbar = null;
[6932] Fix | Delete
#idManager = new IdManager();
[6933] Fix | Delete
#isEnabled = false;
[6934] Fix | Delete
#isWaiting = false;
[6935] Fix | Delete
#lastActiveElement = null;
[6936] Fix | Delete
#mainHighlightColorPicker = null;
[6937] Fix | Delete
#mlManager = null;
[6938] Fix | Delete
#mode = AnnotationEditorType.NONE;
[6939] Fix | Delete
#selectedEditors = new Set();
[6940] Fix | Delete
#selectedTextNode = null;
[6941] Fix | Delete
#pageColors = null;
[6942] Fix | Delete
#showAllStates = null;
[6943] Fix | Delete
#boundBlur = this.blur.bind(this);
[6944] Fix | Delete
#boundFocus = this.focus.bind(this);
[6945] Fix | Delete
#boundCopy = this.copy.bind(this);
[6946] Fix | Delete
#boundCut = this.cut.bind(this);
[6947] Fix | Delete
#boundPaste = this.paste.bind(this);
[6948] Fix | Delete
#boundKeydown = this.keydown.bind(this);
[6949] Fix | Delete
#boundKeyup = this.keyup.bind(this);
[6950] Fix | Delete
#boundOnEditingAction = this.onEditingAction.bind(this);
[6951] Fix | Delete
#boundOnPageChanging = this.onPageChanging.bind(this);
[6952] Fix | Delete
#boundOnScaleChanging = this.onScaleChanging.bind(this);
[6953] Fix | Delete
#boundSelectionChange = this.#selectionChange.bind(this);
[6954] Fix | Delete
#boundOnRotationChanging = this.onRotationChanging.bind(this);
[6955] Fix | Delete
#previousStates = {
[6956] Fix | Delete
isEditing: false,
[6957] Fix | Delete
isEmpty: true,
[6958] Fix | Delete
hasSomethingToUndo: false,
[6959] Fix | Delete
hasSomethingToRedo: false,
[6960] Fix | Delete
hasSelectedEditor: false,
[6961] Fix | Delete
hasSelectedText: false
[6962] Fix | Delete
};
[6963] Fix | Delete
#translation = [0, 0];
[6964] Fix | Delete
#translationTimeoutId = null;
[6965] Fix | Delete
#container = null;
[6966] Fix | Delete
#viewer = null;
[6967] Fix | Delete
static TRANSLATE_SMALL = 1;
[6968] Fix | Delete
static TRANSLATE_BIG = 10;
[6969] Fix | Delete
static get _keyboardManager() {
[6970] Fix | Delete
const proto = AnnotationEditorUIManager.prototype;
[6971] Fix | Delete
const arrowChecker = self => self.#container.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && self.hasSomethingToControl();
[6972] Fix | Delete
const textInputChecker = (_self, {
[6973] Fix | Delete
target: el
[6974] Fix | Delete
}) => {
[6975] Fix | Delete
if (el instanceof HTMLInputElement) {
[6976] Fix | Delete
const {
[6977] Fix | Delete
type
[6978] Fix | Delete
} = el;
[6979] Fix | Delete
return type !== "text" && type !== "number";
[6980] Fix | Delete
}
[6981] Fix | Delete
return true;
[6982] Fix | Delete
};
[6983] Fix | Delete
const small = this.TRANSLATE_SMALL;
[6984] Fix | Delete
const big = this.TRANSLATE_BIG;
[6985] Fix | Delete
return shadow(this, "_keyboardManager", new KeyboardManager([[["ctrl+a", "mac+meta+a"], proto.selectAll, {
[6986] Fix | Delete
checker: textInputChecker
[6987] Fix | Delete
}], [["ctrl+z", "mac+meta+z"], proto.undo, {
[6988] Fix | Delete
checker: textInputChecker
[6989] Fix | Delete
}], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], proto.redo, {
[6990] Fix | Delete
checker: textInputChecker
[6991] Fix | Delete
}], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], proto.delete, {
[6992] Fix | Delete
checker: textInputChecker
[6993] Fix | Delete
}], [["Enter", "mac+Enter"], proto.addNewEditorFromKeyboard, {
[6994] Fix | Delete
checker: (self, {
[6995] Fix | Delete
target: el
[6996] Fix | Delete
}) => !(el instanceof HTMLButtonElement) && self.#container.contains(el) && !self.isEnterHandled
[6997] Fix | Delete
}], [[" ", "mac+ "], proto.addNewEditorFromKeyboard, {
[6998] Fix | Delete
checker: (self, {
[6999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function