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/clone/wp-conte.../plugins/embedpre.../assets/pdf/web
File: viewer.js
}
[7500] Fix | Delete
return;
[7501] Fix | Delete
}
[7502] Fix | Delete
if (select) {
[7503] Fix | Delete
selection.extend(caretPosition.offsetNode, caretPosition.offset);
[7504] Fix | Delete
} else {
[7505] Fix | Delete
selection.setPosition(caretPosition.offsetNode, caretPosition.offset);
[7506] Fix | Delete
}
[7507] Fix | Delete
}
[7508] Fix | Delete
#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX) {
[7509] Fix | Delete
if (this.#isVisible(newLineElementRect)) {
[7510] Fix | Delete
this.#setCaretPositionHelper(selection, caretX, select, newLineElement, newLineElementRect);
[7511] Fix | Delete
return;
[7512] Fix | Delete
}
[7513] Fix | Delete
this.#mainContainer.addEventListener("scrollend", this.#setCaretPositionHelper.bind(this, selection, caretX, select, newLineElement, null), {
[7514] Fix | Delete
once: true
[7515] Fix | Delete
});
[7516] Fix | Delete
newLineElement.scrollIntoView();
[7517] Fix | Delete
}
[7518] Fix | Delete
#getNodeOnNextPage(textLayer, isUp) {
[7519] Fix | Delete
while (true) {
[7520] Fix | Delete
const page = textLayer.closest(".page");
[7521] Fix | Delete
const pageNumber = parseInt(page.getAttribute("data-page-number"));
[7522] Fix | Delete
const nextPage = isUp ? pageNumber - 1 : pageNumber + 1;
[7523] Fix | Delete
textLayer = this.#viewerContainer.querySelector(`.page[data-page-number="${nextPage}"] .textLayer`);
[7524] Fix | Delete
if (!textLayer) {
[7525] Fix | Delete
return null;
[7526] Fix | Delete
}
[7527] Fix | Delete
const walker = document.createTreeWalker(textLayer, NodeFilter.SHOW_TEXT);
[7528] Fix | Delete
const node = isUp ? walker.lastChild() : walker.firstChild();
[7529] Fix | Delete
if (node) {
[7530] Fix | Delete
return node;
[7531] Fix | Delete
}
[7532] Fix | Delete
}
[7533] Fix | Delete
}
[7534] Fix | Delete
moveCaret(isUp, select) {
[7535] Fix | Delete
const selection = document.getSelection();
[7536] Fix | Delete
if (selection.rangeCount === 0) {
[7537] Fix | Delete
return;
[7538] Fix | Delete
}
[7539] Fix | Delete
const {
[7540] Fix | Delete
focusNode
[7541] Fix | Delete
} = selection;
[7542] Fix | Delete
const focusElement = focusNode.nodeType !== Node.ELEMENT_NODE ? focusNode.parentElement : focusNode;
[7543] Fix | Delete
const root = focusElement.closest(".textLayer");
[7544] Fix | Delete
if (!root) {
[7545] Fix | Delete
return;
[7546] Fix | Delete
}
[7547] Fix | Delete
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
[7548] Fix | Delete
walker.currentNode = focusNode;
[7549] Fix | Delete
const focusRect = focusElement.getBoundingClientRect();
[7550] Fix | Delete
let newLineElement = null;
[7551] Fix | Delete
const nodeIterator = (isUp ? walker.previousSibling : walker.nextSibling).bind(walker);
[7552] Fix | Delete
while (nodeIterator()) {
[7553] Fix | Delete
const element = walker.currentNode.parentElement;
[7554] Fix | Delete
if (!this.#isOnSameLine(focusRect, element.getBoundingClientRect())) {
[7555] Fix | Delete
newLineElement = element;
[7556] Fix | Delete
break;
[7557] Fix | Delete
}
[7558] Fix | Delete
}
[7559] Fix | Delete
if (!newLineElement) {
[7560] Fix | Delete
const node = this.#getNodeOnNextPage(root, isUp);
[7561] Fix | Delete
if (!node) {
[7562] Fix | Delete
return;
[7563] Fix | Delete
}
[7564] Fix | Delete
if (select) {
[7565] Fix | Delete
const lastNode = (isUp ? walker.firstChild() : walker.lastChild()) || focusNode;
[7566] Fix | Delete
selection.extend(lastNode, isUp ? 0 : lastNode.length);
[7567] Fix | Delete
const range = document.createRange();
[7568] Fix | Delete
range.setStart(node, isUp ? node.length : 0);
[7569] Fix | Delete
range.setEnd(node, isUp ? node.length : 0);
[7570] Fix | Delete
selection.addRange(range);
[7571] Fix | Delete
return;
[7572] Fix | Delete
}
[7573] Fix | Delete
const [caretX] = this.#getCaretPosition(selection, isUp);
[7574] Fix | Delete
const {
[7575] Fix | Delete
parentElement
[7576] Fix | Delete
} = node;
[7577] Fix | Delete
this.#setCaretPosition(select, selection, parentElement, parentElement.getBoundingClientRect(), caretX);
[7578] Fix | Delete
return;
[7579] Fix | Delete
}
[7580] Fix | Delete
const [caretX, caretY] = this.#getCaretPosition(selection, isUp);
[7581] Fix | Delete
const newLineElementRect = newLineElement.getBoundingClientRect();
[7582] Fix | Delete
if (this.#isUnderOver(newLineElementRect, caretX, caretY, isUp)) {
[7583] Fix | Delete
this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX);
[7584] Fix | Delete
return;
[7585] Fix | Delete
}
[7586] Fix | Delete
while (nodeIterator()) {
[7587] Fix | Delete
const element = walker.currentNode.parentElement;
[7588] Fix | Delete
const elementRect = element.getBoundingClientRect();
[7589] Fix | Delete
if (!this.#isOnSameLine(newLineElementRect, elementRect)) {
[7590] Fix | Delete
break;
[7591] Fix | Delete
}
[7592] Fix | Delete
if (this.#isUnderOver(elementRect, caretX, caretY, isUp)) {
[7593] Fix | Delete
this.#setCaretPosition(select, selection, element, elementRect, caretX);
[7594] Fix | Delete
return;
[7595] Fix | Delete
}
[7596] Fix | Delete
}
[7597] Fix | Delete
this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX);
[7598] Fix | Delete
}
[7599] Fix | Delete
}
[7600] Fix | Delete
[7601] Fix | Delete
;// CONCATENATED MODULE: ./web/download_manager.js
[7602] Fix | Delete
[7603] Fix | Delete
[7604] Fix | Delete
[7605] Fix | Delete
[7606] Fix | Delete
function download(blobUrl, filename) {
[7607] Fix | Delete
const a = document.createElement("a");
[7608] Fix | Delete
if (!a.click) {
[7609] Fix | Delete
throw new Error('DownloadManager: "a.click()" is not supported.');
[7610] Fix | Delete
}
[7611] Fix | Delete
a.href = blobUrl;
[7612] Fix | Delete
a.target = "_parent";
[7613] Fix | Delete
if ("download" in a) {
[7614] Fix | Delete
a.download = filename;
[7615] Fix | Delete
}
[7616] Fix | Delete
(document.body || document.documentElement).append(a);
[7617] Fix | Delete
a.click();
[7618] Fix | Delete
a.remove();
[7619] Fix | Delete
}
[7620] Fix | Delete
class DownloadManager {
[7621] Fix | Delete
#openBlobUrls = new WeakMap();
[7622] Fix | Delete
downloadUrl(url, filename, _options) {
[7623] Fix | Delete
if (!createValidAbsoluteUrl(url, "http://example.com")) {
[7624] Fix | Delete
console.error(`downloadUrl - not a valid URL: ${url}`);
[7625] Fix | Delete
return;
[7626] Fix | Delete
}
[7627] Fix | Delete
download(url + "#pdfjs.action=download", filename);
[7628] Fix | Delete
}
[7629] Fix | Delete
downloadData(data, filename, contentType) {
[7630] Fix | Delete
const blobUrl = URL.createObjectURL(new Blob([data], {
[7631] Fix | Delete
type: contentType
[7632] Fix | Delete
}));
[7633] Fix | Delete
download(blobUrl, filename);
[7634] Fix | Delete
}
[7635] Fix | Delete
openOrDownloadData(data, filename, dest = null) {
[7636] Fix | Delete
const isPdfData = isPdfFile(filename);
[7637] Fix | Delete
const contentType = isPdfData ? "application/pdf" : "";
[7638] Fix | Delete
if (isPdfData) {
[7639] Fix | Delete
let blobUrl = this.#openBlobUrls.get(data);
[7640] Fix | Delete
if (!blobUrl) {
[7641] Fix | Delete
blobUrl = URL.createObjectURL(new Blob([data], {
[7642] Fix | Delete
type: contentType
[7643] Fix | Delete
}));
[7644] Fix | Delete
this.#openBlobUrls.set(data, blobUrl);
[7645] Fix | Delete
}
[7646] Fix | Delete
let viewerUrl;
[7647] Fix | Delete
viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename);
[7648] Fix | Delete
if (dest) {
[7649] Fix | Delete
viewerUrl += `#${escape(dest)}`;
[7650] Fix | Delete
}
[7651] Fix | Delete
try {
[7652] Fix | Delete
window.open(viewerUrl);
[7653] Fix | Delete
return true;
[7654] Fix | Delete
} catch (ex) {
[7655] Fix | Delete
console.error(`openOrDownloadData: ${ex}`);
[7656] Fix | Delete
URL.revokeObjectURL(blobUrl);
[7657] Fix | Delete
this.#openBlobUrls.delete(data);
[7658] Fix | Delete
}
[7659] Fix | Delete
}
[7660] Fix | Delete
this.downloadData(data, filename, contentType);
[7661] Fix | Delete
return false;
[7662] Fix | Delete
}
[7663] Fix | Delete
download(blob, url, filename, _options) {
[7664] Fix | Delete
const blobUrl = URL.createObjectURL(blob);
[7665] Fix | Delete
download(blobUrl, filename);
[7666] Fix | Delete
}
[7667] Fix | Delete
}
[7668] Fix | Delete
[7669] Fix | Delete
;// CONCATENATED MODULE: ./web/overlay_manager.js
[7670] Fix | Delete
class OverlayManager {
[7671] Fix | Delete
#overlays = new WeakMap();
[7672] Fix | Delete
#active = null;
[7673] Fix | Delete
get active() {
[7674] Fix | Delete
return this.#active;
[7675] Fix | Delete
}
[7676] Fix | Delete
async register(dialog, canForceClose = false) {
[7677] Fix | Delete
if (typeof dialog !== "object") {
[7678] Fix | Delete
throw new Error("Not enough parameters.");
[7679] Fix | Delete
} else if (this.#overlays.has(dialog)) {
[7680] Fix | Delete
throw new Error("The overlay is already registered.");
[7681] Fix | Delete
}
[7682] Fix | Delete
this.#overlays.set(dialog, {
[7683] Fix | Delete
canForceClose
[7684] Fix | Delete
});
[7685] Fix | Delete
dialog.addEventListener("cancel", evt => {
[7686] Fix | Delete
this.#active = null;
[7687] Fix | Delete
});
[7688] Fix | Delete
}
[7689] Fix | Delete
async open(dialog) {
[7690] Fix | Delete
if (!this.#overlays.has(dialog)) {
[7691] Fix | Delete
throw new Error("The overlay does not exist.");
[7692] Fix | Delete
} else if (this.#active) {
[7693] Fix | Delete
if (this.#active === dialog) {
[7694] Fix | Delete
throw new Error("The overlay is already active.");
[7695] Fix | Delete
} else if (this.#overlays.get(dialog).canForceClose) {
[7696] Fix | Delete
await this.close();
[7697] Fix | Delete
} else {
[7698] Fix | Delete
throw new Error("Another overlay is currently active.");
[7699] Fix | Delete
}
[7700] Fix | Delete
}
[7701] Fix | Delete
this.#active = dialog;
[7702] Fix | Delete
dialog.showModal();
[7703] Fix | Delete
}
[7704] Fix | Delete
async close(dialog = this.#active) {
[7705] Fix | Delete
if (!this.#overlays.has(dialog)) {
[7706] Fix | Delete
throw new Error("The overlay does not exist.");
[7707] Fix | Delete
} else if (!this.#active) {
[7708] Fix | Delete
throw new Error("The overlay is currently not active.");
[7709] Fix | Delete
} else if (this.#active !== dialog) {
[7710] Fix | Delete
throw new Error("Another overlay is currently active.");
[7711] Fix | Delete
}
[7712] Fix | Delete
dialog.close();
[7713] Fix | Delete
this.#active = null;
[7714] Fix | Delete
}
[7715] Fix | Delete
}
[7716] Fix | Delete
[7717] Fix | Delete
;// CONCATENATED MODULE: ./web/password_prompt.js
[7718] Fix | Delete
[7719] Fix | Delete
[7720] Fix | Delete
class PasswordPrompt {
[7721] Fix | Delete
#activeCapability = null;
[7722] Fix | Delete
#updateCallback = null;
[7723] Fix | Delete
#reason = null;
[7724] Fix | Delete
constructor(options, overlayManager, isViewerEmbedded = false) {
[7725] Fix | Delete
this.dialog = options.dialog;
[7726] Fix | Delete
this.label = options.label;
[7727] Fix | Delete
this.input = options.input;
[7728] Fix | Delete
this.submitButton = options.submitButton;
[7729] Fix | Delete
this.cancelButton = options.cancelButton;
[7730] Fix | Delete
this.overlayManager = overlayManager;
[7731] Fix | Delete
this._isViewerEmbedded = isViewerEmbedded;
[7732] Fix | Delete
this.submitButton.addEventListener("click", this.#verify.bind(this));
[7733] Fix | Delete
this.cancelButton.addEventListener("click", this.close.bind(this));
[7734] Fix | Delete
this.input.addEventListener("keydown", e => {
[7735] Fix | Delete
if (e.keyCode === 13) {
[7736] Fix | Delete
this.#verify();
[7737] Fix | Delete
}
[7738] Fix | Delete
});
[7739] Fix | Delete
this.overlayManager.register(this.dialog, true);
[7740] Fix | Delete
this.dialog.addEventListener("close", this.#cancel.bind(this));
[7741] Fix | Delete
}
[7742] Fix | Delete
async open() {
[7743] Fix | Delete
await this.#activeCapability?.promise;
[7744] Fix | Delete
this.#activeCapability = Promise.withResolvers();
[7745] Fix | Delete
try {
[7746] Fix | Delete
await this.overlayManager.open(this.dialog);
[7747] Fix | Delete
} catch (ex) {
[7748] Fix | Delete
this.#activeCapability.resolve();
[7749] Fix | Delete
throw ex;
[7750] Fix | Delete
}
[7751] Fix | Delete
const passwordIncorrect = this.#reason === PasswordResponses.INCORRECT_PASSWORD;
[7752] Fix | Delete
if (!this._isViewerEmbedded || passwordIncorrect) {
[7753] Fix | Delete
this.input.focus();
[7754] Fix | Delete
}
[7755] Fix | Delete
this.label.setAttribute("data-l10n-id", `pdfjs-password-${passwordIncorrect ? "invalid" : "label"}`);
[7756] Fix | Delete
}
[7757] Fix | Delete
async close() {
[7758] Fix | Delete
if (this.overlayManager.active === this.dialog) {
[7759] Fix | Delete
this.overlayManager.close(this.dialog);
[7760] Fix | Delete
}
[7761] Fix | Delete
}
[7762] Fix | Delete
#verify() {
[7763] Fix | Delete
const password = this.input.value;
[7764] Fix | Delete
if (password?.length > 0) {
[7765] Fix | Delete
this.#invokeCallback(password);
[7766] Fix | Delete
}
[7767] Fix | Delete
}
[7768] Fix | Delete
#cancel() {
[7769] Fix | Delete
this.#invokeCallback(new Error("PasswordPrompt cancelled."));
[7770] Fix | Delete
this.#activeCapability.resolve();
[7771] Fix | Delete
}
[7772] Fix | Delete
#invokeCallback(password) {
[7773] Fix | Delete
if (!this.#updateCallback) {
[7774] Fix | Delete
return;
[7775] Fix | Delete
}
[7776] Fix | Delete
this.close();
[7777] Fix | Delete
this.input.value = "";
[7778] Fix | Delete
this.#updateCallback(password);
[7779] Fix | Delete
this.#updateCallback = null;
[7780] Fix | Delete
}
[7781] Fix | Delete
async setUpdateCallback(updateCallback, reason) {
[7782] Fix | Delete
if (this.#activeCapability) {
[7783] Fix | Delete
await this.#activeCapability.promise;
[7784] Fix | Delete
}
[7785] Fix | Delete
this.#updateCallback = updateCallback;
[7786] Fix | Delete
this.#reason = reason;
[7787] Fix | Delete
}
[7788] Fix | Delete
}
[7789] Fix | Delete
[7790] Fix | Delete
;// CONCATENATED MODULE: ./web/base_tree_viewer.js
[7791] Fix | Delete
[7792] Fix | Delete
const TREEITEM_OFFSET_TOP = -100;
[7793] Fix | Delete
const TREEITEM_SELECTED_CLASS = "selected";
[7794] Fix | Delete
class BaseTreeViewer {
[7795] Fix | Delete
constructor(options) {
[7796] Fix | Delete
if (this.constructor === BaseTreeViewer) {
[7797] Fix | Delete
throw new Error("Cannot initialize BaseTreeViewer.");
[7798] Fix | Delete
}
[7799] Fix | Delete
this.container = options.container;
[7800] Fix | Delete
this.eventBus = options.eventBus;
[7801] Fix | Delete
this._l10n = options.l10n;
[7802] Fix | Delete
this.reset();
[7803] Fix | Delete
}
[7804] Fix | Delete
reset() {
[7805] Fix | Delete
this._pdfDocument = null;
[7806] Fix | Delete
this._lastToggleIsShow = true;
[7807] Fix | Delete
this._currentTreeItem = null;
[7808] Fix | Delete
this.container.textContent = "";
[7809] Fix | Delete
this.container.classList.remove("treeWithDeepNesting");
[7810] Fix | Delete
}
[7811] Fix | Delete
_dispatchEvent(count) {
[7812] Fix | Delete
throw new Error("Not implemented: _dispatchEvent");
[7813] Fix | Delete
}
[7814] Fix | Delete
_bindLink(element, params) {
[7815] Fix | Delete
throw new Error("Not implemented: _bindLink");
[7816] Fix | Delete
}
[7817] Fix | Delete
_normalizeTextContent(str) {
[7818] Fix | Delete
return removeNullCharacters(str, true) || "\u2013";
[7819] Fix | Delete
}
[7820] Fix | Delete
_addToggleButton(div, hidden = false) {
[7821] Fix | Delete
const toggler = document.createElement("div");
[7822] Fix | Delete
toggler.className = "treeItemToggler";
[7823] Fix | Delete
if (hidden) {
[7824] Fix | Delete
toggler.classList.add("treeItemsHidden");
[7825] Fix | Delete
}
[7826] Fix | Delete
toggler.onclick = evt => {
[7827] Fix | Delete
evt.stopPropagation();
[7828] Fix | Delete
toggler.classList.toggle("treeItemsHidden");
[7829] Fix | Delete
if (evt.shiftKey) {
[7830] Fix | Delete
const shouldShowAll = !toggler.classList.contains("treeItemsHidden");
[7831] Fix | Delete
this._toggleTreeItem(div, shouldShowAll);
[7832] Fix | Delete
}
[7833] Fix | Delete
};
[7834] Fix | Delete
div.prepend(toggler);
[7835] Fix | Delete
}
[7836] Fix | Delete
_toggleTreeItem(root, show = false) {
[7837] Fix | Delete
this._l10n.pause();
[7838] Fix | Delete
this._lastToggleIsShow = show;
[7839] Fix | Delete
for (const toggler of root.querySelectorAll(".treeItemToggler")) {
[7840] Fix | Delete
toggler.classList.toggle("treeItemsHidden", !show);
[7841] Fix | Delete
}
[7842] Fix | Delete
this._l10n.resume();
[7843] Fix | Delete
}
[7844] Fix | Delete
_toggleAllTreeItems() {
[7845] Fix | Delete
this._toggleTreeItem(this.container, !this._lastToggleIsShow);
[7846] Fix | Delete
}
[7847] Fix | Delete
_finishRendering(fragment, count, hasAnyNesting = false) {
[7848] Fix | Delete
if (hasAnyNesting) {
[7849] Fix | Delete
this.container.classList.add("treeWithDeepNesting");
[7850] Fix | Delete
this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden");
[7851] Fix | Delete
}
[7852] Fix | Delete
this._l10n.pause();
[7853] Fix | Delete
this.container.append(fragment);
[7854] Fix | Delete
this._l10n.resume();
[7855] Fix | Delete
this._dispatchEvent(count);
[7856] Fix | Delete
}
[7857] Fix | Delete
render(params) {
[7858] Fix | Delete
throw new Error("Not implemented: render");
[7859] Fix | Delete
}
[7860] Fix | Delete
_updateCurrentTreeItem(treeItem = null) {
[7861] Fix | Delete
if (this._currentTreeItem) {
[7862] Fix | Delete
this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS);
[7863] Fix | Delete
this._currentTreeItem = null;
[7864] Fix | Delete
}
[7865] Fix | Delete
if (treeItem) {
[7866] Fix | Delete
treeItem.classList.add(TREEITEM_SELECTED_CLASS);
[7867] Fix | Delete
this._currentTreeItem = treeItem;
[7868] Fix | Delete
}
[7869] Fix | Delete
}
[7870] Fix | Delete
_scrollToCurrentTreeItem(treeItem) {
[7871] Fix | Delete
if (!treeItem) {
[7872] Fix | Delete
return;
[7873] Fix | Delete
}
[7874] Fix | Delete
this._l10n.pause();
[7875] Fix | Delete
let currentNode = treeItem.parentNode;
[7876] Fix | Delete
while (currentNode && currentNode !== this.container) {
[7877] Fix | Delete
if (currentNode.classList.contains("treeItem")) {
[7878] Fix | Delete
const toggler = currentNode.firstElementChild;
[7879] Fix | Delete
toggler?.classList.remove("treeItemsHidden");
[7880] Fix | Delete
}
[7881] Fix | Delete
currentNode = currentNode.parentNode;
[7882] Fix | Delete
}
[7883] Fix | Delete
this._l10n.resume();
[7884] Fix | Delete
this._updateCurrentTreeItem(treeItem);
[7885] Fix | Delete
this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP);
[7886] Fix | Delete
}
[7887] Fix | Delete
}
[7888] Fix | Delete
[7889] Fix | Delete
;// CONCATENATED MODULE: ./web/pdf_attachment_viewer.js
[7890] Fix | Delete
[7891] Fix | Delete
[7892] Fix | Delete
[7893] Fix | Delete
class PDFAttachmentViewer extends BaseTreeViewer {
[7894] Fix | Delete
constructor(options) {
[7895] Fix | Delete
super(options);
[7896] Fix | Delete
this.downloadManager = options.downloadManager;
[7897] Fix | Delete
this.eventBus._on("fileattachmentannotation", this.#appendAttachment.bind(this));
[7898] Fix | Delete
}
[7899] Fix | Delete
reset(keepRenderedCapability = false) {
[7900] Fix | Delete
super.reset();
[7901] Fix | Delete
this._attachments = null;
[7902] Fix | Delete
if (!keepRenderedCapability) {
[7903] Fix | Delete
this._renderedCapability = Promise.withResolvers();
[7904] Fix | Delete
}
[7905] Fix | Delete
this._pendingDispatchEvent = false;
[7906] Fix | Delete
}
[7907] Fix | Delete
async _dispatchEvent(attachmentsCount) {
[7908] Fix | Delete
this._renderedCapability.resolve();
[7909] Fix | Delete
if (attachmentsCount === 0 && !this._pendingDispatchEvent) {
[7910] Fix | Delete
this._pendingDispatchEvent = true;
[7911] Fix | Delete
await waitOnEventOrTimeout({
[7912] Fix | Delete
target: this.eventBus,
[7913] Fix | Delete
name: "annotationlayerrendered",
[7914] Fix | Delete
delay: 1000
[7915] Fix | Delete
});
[7916] Fix | Delete
if (!this._pendingDispatchEvent) {
[7917] Fix | Delete
return;
[7918] Fix | Delete
}
[7919] Fix | Delete
}
[7920] Fix | Delete
this._pendingDispatchEvent = false;
[7921] Fix | Delete
this.eventBus.dispatch("attachmentsloaded", {
[7922] Fix | Delete
source: this,
[7923] Fix | Delete
attachmentsCount
[7924] Fix | Delete
});
[7925] Fix | Delete
}
[7926] Fix | Delete
_bindLink(element, {
[7927] Fix | Delete
content,
[7928] Fix | Delete
description,
[7929] Fix | Delete
filename
[7930] Fix | Delete
}) {
[7931] Fix | Delete
if (description) {
[7932] Fix | Delete
element.title = description;
[7933] Fix | Delete
}
[7934] Fix | Delete
element.onclick = () => {
[7935] Fix | Delete
this.downloadManager.openOrDownloadData(content, filename);
[7936] Fix | Delete
return false;
[7937] Fix | Delete
};
[7938] Fix | Delete
}
[7939] Fix | Delete
render({
[7940] Fix | Delete
attachments,
[7941] Fix | Delete
keepRenderedCapability = false
[7942] Fix | Delete
}) {
[7943] Fix | Delete
if (this._attachments) {
[7944] Fix | Delete
this.reset(keepRenderedCapability);
[7945] Fix | Delete
}
[7946] Fix | Delete
this._attachments = attachments || null;
[7947] Fix | Delete
if (!attachments) {
[7948] Fix | Delete
this._dispatchEvent(0);
[7949] Fix | Delete
return;
[7950] Fix | Delete
}
[7951] Fix | Delete
const fragment = document.createDocumentFragment();
[7952] Fix | Delete
let attachmentsCount = 0;
[7953] Fix | Delete
for (const name in attachments) {
[7954] Fix | Delete
const item = attachments[name];
[7955] Fix | Delete
const div = document.createElement("div");
[7956] Fix | Delete
div.className = "treeItem";
[7957] Fix | Delete
const element = document.createElement("a");
[7958] Fix | Delete
this._bindLink(element, item);
[7959] Fix | Delete
element.textContent = this._normalizeTextContent(item.filename);
[7960] Fix | Delete
div.append(element);
[7961] Fix | Delete
fragment.append(div);
[7962] Fix | Delete
attachmentsCount++;
[7963] Fix | Delete
}
[7964] Fix | Delete
this._finishRendering(fragment, attachmentsCount);
[7965] Fix | Delete
}
[7966] Fix | Delete
#appendAttachment(item) {
[7967] Fix | Delete
const renderedPromise = this._renderedCapability.promise;
[7968] Fix | Delete
renderedPromise.then(() => {
[7969] Fix | Delete
if (renderedPromise !== this._renderedCapability.promise) {
[7970] Fix | Delete
return;
[7971] Fix | Delete
}
[7972] Fix | Delete
const attachments = this._attachments || Object.create(null);
[7973] Fix | Delete
for (const name in attachments) {
[7974] Fix | Delete
if (item.filename === name) {
[7975] Fix | Delete
return;
[7976] Fix | Delete
}
[7977] Fix | Delete
}
[7978] Fix | Delete
attachments[item.filename] = item;
[7979] Fix | Delete
this.render({
[7980] Fix | Delete
attachments,
[7981] Fix | Delete
keepRenderedCapability: true
[7982] Fix | Delete
});
[7983] Fix | Delete
});
[7984] Fix | Delete
}
[7985] Fix | Delete
}
[7986] Fix | Delete
[7987] Fix | Delete
;// CONCATENATED MODULE: ./web/grab_to_pan.js
[7988] Fix | Delete
const CSS_CLASS_GRAB = "grab-to-pan-grab";
[7989] Fix | Delete
class GrabToPan {
[7990] Fix | Delete
constructor({
[7991] Fix | Delete
element
[7992] Fix | Delete
}) {
[7993] Fix | Delete
this.element = element;
[7994] Fix | Delete
this.document = element.ownerDocument;
[7995] Fix | Delete
this.activate = this.activate.bind(this);
[7996] Fix | Delete
this.deactivate = this.deactivate.bind(this);
[7997] Fix | Delete
this.toggle = this.toggle.bind(this);
[7998] Fix | Delete
this._onMouseDown = this.#onMouseDown.bind(this);
[7999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function