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
TR: "row",
[12500] Fix | Delete
TH: "columnheader",
[12501] Fix | Delete
TD: "cell",
[12502] Fix | Delete
THead: "columnheader",
[12503] Fix | Delete
TBody: null,
[12504] Fix | Delete
TFoot: null,
[12505] Fix | Delete
Caption: null,
[12506] Fix | Delete
Figure: "figure",
[12507] Fix | Delete
Formula: null,
[12508] Fix | Delete
Artifact: null
[12509] Fix | Delete
};
[12510] Fix | Delete
const HEADING_PATTERN = /^H(\d+)$/;
[12511] Fix | Delete
class StructTreeLayerBuilder {
[12512] Fix | Delete
#treeDom = undefined;
[12513] Fix | Delete
get renderingDone() {
[12514] Fix | Delete
return this.#treeDom !== undefined;
[12515] Fix | Delete
}
[12516] Fix | Delete
render(structTree) {
[12517] Fix | Delete
if (this.#treeDom !== undefined) {
[12518] Fix | Delete
return this.#treeDom;
[12519] Fix | Delete
}
[12520] Fix | Delete
const treeDom = this.#walk(structTree);
[12521] Fix | Delete
treeDom?.classList.add("structTree");
[12522] Fix | Delete
return this.#treeDom = treeDom;
[12523] Fix | Delete
}
[12524] Fix | Delete
hide() {
[12525] Fix | Delete
if (this.#treeDom && !this.#treeDom.hidden) {
[12526] Fix | Delete
this.#treeDom.hidden = true;
[12527] Fix | Delete
}
[12528] Fix | Delete
}
[12529] Fix | Delete
show() {
[12530] Fix | Delete
if (this.#treeDom?.hidden) {
[12531] Fix | Delete
this.#treeDom.hidden = false;
[12532] Fix | Delete
}
[12533] Fix | Delete
}
[12534] Fix | Delete
#setAttributes(structElement, htmlElement) {
[12535] Fix | Delete
const {
[12536] Fix | Delete
alt,
[12537] Fix | Delete
id,
[12538] Fix | Delete
lang
[12539] Fix | Delete
} = structElement;
[12540] Fix | Delete
if (alt !== undefined) {
[12541] Fix | Delete
htmlElement.setAttribute("aria-label", removeNullCharacters(alt));
[12542] Fix | Delete
}
[12543] Fix | Delete
if (id !== undefined) {
[12544] Fix | Delete
htmlElement.setAttribute("aria-owns", id);
[12545] Fix | Delete
}
[12546] Fix | Delete
if (lang !== undefined) {
[12547] Fix | Delete
htmlElement.setAttribute("lang", removeNullCharacters(lang, true));
[12548] Fix | Delete
}
[12549] Fix | Delete
}
[12550] Fix | Delete
#walk(node) {
[12551] Fix | Delete
if (!node) {
[12552] Fix | Delete
return null;
[12553] Fix | Delete
}
[12554] Fix | Delete
const element = document.createElement("span");
[12555] Fix | Delete
if ("role" in node) {
[12556] Fix | Delete
const {
[12557] Fix | Delete
role
[12558] Fix | Delete
} = node;
[12559] Fix | Delete
const match = role.match(HEADING_PATTERN);
[12560] Fix | Delete
if (match) {
[12561] Fix | Delete
element.setAttribute("role", "heading");
[12562] Fix | Delete
element.setAttribute("aria-level", match[1]);
[12563] Fix | Delete
} else if (PDF_ROLE_TO_HTML_ROLE[role]) {
[12564] Fix | Delete
element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]);
[12565] Fix | Delete
}
[12566] Fix | Delete
}
[12567] Fix | Delete
this.#setAttributes(node, element);
[12568] Fix | Delete
if (node.children) {
[12569] Fix | Delete
if (node.children.length === 1 && "id" in node.children[0]) {
[12570] Fix | Delete
this.#setAttributes(node.children[0], element);
[12571] Fix | Delete
} else {
[12572] Fix | Delete
for (const kid of node.children) {
[12573] Fix | Delete
element.append(this.#walk(kid));
[12574] Fix | Delete
}
[12575] Fix | Delete
}
[12576] Fix | Delete
}
[12577] Fix | Delete
return element;
[12578] Fix | Delete
}
[12579] Fix | Delete
}
[12580] Fix | Delete
[12581] Fix | Delete
;// CONCATENATED MODULE: ./web/text_accessibility.js
[12582] Fix | Delete
[12583] Fix | Delete
[12584] Fix | Delete
[12585] Fix | Delete
class TextAccessibilityManager {
[12586] Fix | Delete
#enabled = false;
[12587] Fix | Delete
#textChildren = null;
[12588] Fix | Delete
#textNodes = new Map();
[12589] Fix | Delete
#waitingElements = new Map();
[12590] Fix | Delete
setTextMapping(textDivs) {
[12591] Fix | Delete
this.#textChildren = textDivs;
[12592] Fix | Delete
}
[12593] Fix | Delete
static #compareElementPositions(e1, e2) {
[12594] Fix | Delete
const rect1 = e1.getBoundingClientRect();
[12595] Fix | Delete
const rect2 = e2.getBoundingClientRect();
[12596] Fix | Delete
if (rect1.width === 0 && rect1.height === 0) {
[12597] Fix | Delete
return +1;
[12598] Fix | Delete
}
[12599] Fix | Delete
if (rect2.width === 0 && rect2.height === 0) {
[12600] Fix | Delete
return -1;
[12601] Fix | Delete
}
[12602] Fix | Delete
const top1 = rect1.y;
[12603] Fix | Delete
const bot1 = rect1.y + rect1.height;
[12604] Fix | Delete
const mid1 = rect1.y + rect1.height / 2;
[12605] Fix | Delete
const top2 = rect2.y;
[12606] Fix | Delete
const bot2 = rect2.y + rect2.height;
[12607] Fix | Delete
const mid2 = rect2.y + rect2.height / 2;
[12608] Fix | Delete
if (mid1 <= top2 && mid2 >= bot1) {
[12609] Fix | Delete
return -1;
[12610] Fix | Delete
}
[12611] Fix | Delete
if (mid2 <= top1 && mid1 >= bot2) {
[12612] Fix | Delete
return +1;
[12613] Fix | Delete
}
[12614] Fix | Delete
const centerX1 = rect1.x + rect1.width / 2;
[12615] Fix | Delete
const centerX2 = rect2.x + rect2.width / 2;
[12616] Fix | Delete
return centerX1 - centerX2;
[12617] Fix | Delete
}
[12618] Fix | Delete
enable() {
[12619] Fix | Delete
if (this.#enabled) {
[12620] Fix | Delete
throw new Error("TextAccessibilityManager is already enabled.");
[12621] Fix | Delete
}
[12622] Fix | Delete
if (!this.#textChildren) {
[12623] Fix | Delete
throw new Error("Text divs and strings have not been set.");
[12624] Fix | Delete
}
[12625] Fix | Delete
this.#enabled = true;
[12626] Fix | Delete
this.#textChildren = this.#textChildren.slice();
[12627] Fix | Delete
this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);
[12628] Fix | Delete
if (this.#textNodes.size > 0) {
[12629] Fix | Delete
const textChildren = this.#textChildren;
[12630] Fix | Delete
for (const [id, nodeIndex] of this.#textNodes) {
[12631] Fix | Delete
const element = document.getElementById(id);
[12632] Fix | Delete
if (!element) {
[12633] Fix | Delete
this.#textNodes.delete(id);
[12634] Fix | Delete
continue;
[12635] Fix | Delete
}
[12636] Fix | Delete
this.#addIdToAriaOwns(id, textChildren[nodeIndex]);
[12637] Fix | Delete
}
[12638] Fix | Delete
}
[12639] Fix | Delete
for (const [element, isRemovable] of this.#waitingElements) {
[12640] Fix | Delete
this.addPointerInTextLayer(element, isRemovable);
[12641] Fix | Delete
}
[12642] Fix | Delete
this.#waitingElements.clear();
[12643] Fix | Delete
}
[12644] Fix | Delete
disable() {
[12645] Fix | Delete
if (!this.#enabled) {
[12646] Fix | Delete
return;
[12647] Fix | Delete
}
[12648] Fix | Delete
this.#waitingElements.clear();
[12649] Fix | Delete
this.#textChildren = null;
[12650] Fix | Delete
this.#enabled = false;
[12651] Fix | Delete
}
[12652] Fix | Delete
removePointerInTextLayer(element) {
[12653] Fix | Delete
if (!this.#enabled) {
[12654] Fix | Delete
this.#waitingElements.delete(element);
[12655] Fix | Delete
return;
[12656] Fix | Delete
}
[12657] Fix | Delete
const children = this.#textChildren;
[12658] Fix | Delete
if (!children || children.length === 0) {
[12659] Fix | Delete
return;
[12660] Fix | Delete
}
[12661] Fix | Delete
const {
[12662] Fix | Delete
id
[12663] Fix | Delete
} = element;
[12664] Fix | Delete
const nodeIndex = this.#textNodes.get(id);
[12665] Fix | Delete
if (nodeIndex === undefined) {
[12666] Fix | Delete
return;
[12667] Fix | Delete
}
[12668] Fix | Delete
const node = children[nodeIndex];
[12669] Fix | Delete
this.#textNodes.delete(id);
[12670] Fix | Delete
let owns = node.getAttribute("aria-owns");
[12671] Fix | Delete
if (owns?.includes(id)) {
[12672] Fix | Delete
owns = owns.split(" ").filter(x => x !== id).join(" ");
[12673] Fix | Delete
if (owns) {
[12674] Fix | Delete
node.setAttribute("aria-owns", owns);
[12675] Fix | Delete
} else {
[12676] Fix | Delete
node.removeAttribute("aria-owns");
[12677] Fix | Delete
node.setAttribute("role", "presentation");
[12678] Fix | Delete
}
[12679] Fix | Delete
}
[12680] Fix | Delete
}
[12681] Fix | Delete
#addIdToAriaOwns(id, node) {
[12682] Fix | Delete
const owns = node.getAttribute("aria-owns");
[12683] Fix | Delete
if (!owns?.includes(id)) {
[12684] Fix | Delete
node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id);
[12685] Fix | Delete
}
[12686] Fix | Delete
node.removeAttribute("role");
[12687] Fix | Delete
}
[12688] Fix | Delete
addPointerInTextLayer(element, isRemovable) {
[12689] Fix | Delete
const {
[12690] Fix | Delete
id
[12691] Fix | Delete
} = element;
[12692] Fix | Delete
if (!id) {
[12693] Fix | Delete
return null;
[12694] Fix | Delete
}
[12695] Fix | Delete
if (!this.#enabled) {
[12696] Fix | Delete
this.#waitingElements.set(element, isRemovable);
[12697] Fix | Delete
return null;
[12698] Fix | Delete
}
[12699] Fix | Delete
if (isRemovable) {
[12700] Fix | Delete
this.removePointerInTextLayer(element);
[12701] Fix | Delete
}
[12702] Fix | Delete
const children = this.#textChildren;
[12703] Fix | Delete
if (!children || children.length === 0) {
[12704] Fix | Delete
return null;
[12705] Fix | Delete
}
[12706] Fix | Delete
const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0);
[12707] Fix | Delete
const nodeIndex = Math.max(0, index - 1);
[12708] Fix | Delete
const child = children[nodeIndex];
[12709] Fix | Delete
this.#addIdToAriaOwns(id, child);
[12710] Fix | Delete
this.#textNodes.set(id, nodeIndex);
[12711] Fix | Delete
const parent = child.parentNode;
[12712] Fix | Delete
return parent?.classList.contains("markedContent") ? parent.id : null;
[12713] Fix | Delete
}
[12714] Fix | Delete
moveElementInDOM(container, element, contentElement, isRemovable) {
[12715] Fix | Delete
const id = this.addPointerInTextLayer(contentElement, isRemovable);
[12716] Fix | Delete
if (!container.hasChildNodes()) {
[12717] Fix | Delete
container.append(element);
[12718] Fix | Delete
return id;
[12719] Fix | Delete
}
[12720] Fix | Delete
const children = Array.from(container.childNodes).filter(node => node !== element);
[12721] Fix | Delete
if (children.length === 0) {
[12722] Fix | Delete
return id;
[12723] Fix | Delete
}
[12724] Fix | Delete
const elementToCompare = contentElement || element;
[12725] Fix | Delete
const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0);
[12726] Fix | Delete
if (index === 0) {
[12727] Fix | Delete
children[0].before(element);
[12728] Fix | Delete
} else {
[12729] Fix | Delete
children[index - 1].after(element);
[12730] Fix | Delete
}
[12731] Fix | Delete
return id;
[12732] Fix | Delete
}
[12733] Fix | Delete
}
[12734] Fix | Delete
[12735] Fix | Delete
;// CONCATENATED MODULE: ./web/text_highlighter.js
[12736] Fix | Delete
[12737] Fix | Delete
class TextHighlighter {
[12738] Fix | Delete
#eventAbortController = null;
[12739] Fix | Delete
constructor({
[12740] Fix | Delete
findController,
[12741] Fix | Delete
eventBus,
[12742] Fix | Delete
pageIndex
[12743] Fix | Delete
}) {
[12744] Fix | Delete
this.findController = findController;
[12745] Fix | Delete
this.matches = [];
[12746] Fix | Delete
this.eventBus = eventBus;
[12747] Fix | Delete
this.pageIdx = pageIndex;
[12748] Fix | Delete
this.textDivs = null;
[12749] Fix | Delete
this.textContentItemsStr = null;
[12750] Fix | Delete
this.enabled = false;
[12751] Fix | Delete
}
[12752] Fix | Delete
setTextMapping(divs, texts) {
[12753] Fix | Delete
this.textDivs = divs;
[12754] Fix | Delete
this.textContentItemsStr = texts;
[12755] Fix | Delete
}
[12756] Fix | Delete
enable() {
[12757] Fix | Delete
if (!this.textDivs || !this.textContentItemsStr) {
[12758] Fix | Delete
throw new Error("Text divs and strings have not been set.");
[12759] Fix | Delete
}
[12760] Fix | Delete
if (this.enabled) {
[12761] Fix | Delete
throw new Error("TextHighlighter is already enabled.");
[12762] Fix | Delete
}
[12763] Fix | Delete
this.enabled = true;
[12764] Fix | Delete
if (!this.#eventAbortController) {
[12765] Fix | Delete
this.#eventAbortController = new AbortController();
[12766] Fix | Delete
this.eventBus._on("updatetextlayermatches", evt => {
[12767] Fix | Delete
if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {
[12768] Fix | Delete
this._updateMatches();
[12769] Fix | Delete
}
[12770] Fix | Delete
}, {
[12771] Fix | Delete
signal: this.#eventAbortController.signal
[12772] Fix | Delete
});
[12773] Fix | Delete
}
[12774] Fix | Delete
this._updateMatches();
[12775] Fix | Delete
}
[12776] Fix | Delete
disable() {
[12777] Fix | Delete
if (!this.enabled) {
[12778] Fix | Delete
return;
[12779] Fix | Delete
}
[12780] Fix | Delete
this.enabled = false;
[12781] Fix | Delete
this.#eventAbortController?.abort();
[12782] Fix | Delete
this.#eventAbortController = null;
[12783] Fix | Delete
this._updateMatches(true);
[12784] Fix | Delete
}
[12785] Fix | Delete
_convertMatches(matches, matchesLength) {
[12786] Fix | Delete
if (!matches) {
[12787] Fix | Delete
return [];
[12788] Fix | Delete
}
[12789] Fix | Delete
const {
[12790] Fix | Delete
textContentItemsStr
[12791] Fix | Delete
} = this;
[12792] Fix | Delete
let i = 0,
[12793] Fix | Delete
iIndex = 0;
[12794] Fix | Delete
const end = textContentItemsStr.length - 1;
[12795] Fix | Delete
const result = [];
[12796] Fix | Delete
for (let m = 0, mm = matches.length; m < mm; m++) {
[12797] Fix | Delete
let matchIdx = matches[m];
[12798] Fix | Delete
while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {
[12799] Fix | Delete
iIndex += textContentItemsStr[i].length;
[12800] Fix | Delete
i++;
[12801] Fix | Delete
}
[12802] Fix | Delete
if (i === textContentItemsStr.length) {
[12803] Fix | Delete
console.error("Could not find a matching mapping");
[12804] Fix | Delete
}
[12805] Fix | Delete
const match = {
[12806] Fix | Delete
begin: {
[12807] Fix | Delete
divIdx: i,
[12808] Fix | Delete
offset: matchIdx - iIndex
[12809] Fix | Delete
}
[12810] Fix | Delete
};
[12811] Fix | Delete
matchIdx += matchesLength[m];
[12812] Fix | Delete
while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
[12813] Fix | Delete
iIndex += textContentItemsStr[i].length;
[12814] Fix | Delete
i++;
[12815] Fix | Delete
}
[12816] Fix | Delete
match.end = {
[12817] Fix | Delete
divIdx: i,
[12818] Fix | Delete
offset: matchIdx - iIndex
[12819] Fix | Delete
};
[12820] Fix | Delete
result.push(match);
[12821] Fix | Delete
}
[12822] Fix | Delete
return result;
[12823] Fix | Delete
}
[12824] Fix | Delete
_renderMatches(matches) {
[12825] Fix | Delete
if (matches.length === 0) {
[12826] Fix | Delete
return;
[12827] Fix | Delete
}
[12828] Fix | Delete
const {
[12829] Fix | Delete
findController,
[12830] Fix | Delete
pageIdx
[12831] Fix | Delete
} = this;
[12832] Fix | Delete
const {
[12833] Fix | Delete
textContentItemsStr,
[12834] Fix | Delete
textDivs
[12835] Fix | Delete
} = this;
[12836] Fix | Delete
const isSelectedPage = pageIdx === findController.selected.pageIdx;
[12837] Fix | Delete
const selectedMatchIdx = findController.selected.matchIdx;
[12838] Fix | Delete
const highlightAll = findController.state.highlightAll;
[12839] Fix | Delete
let prevEnd = null;
[12840] Fix | Delete
const infinity = {
[12841] Fix | Delete
divIdx: -1,
[12842] Fix | Delete
offset: undefined
[12843] Fix | Delete
};
[12844] Fix | Delete
function beginText(begin, className) {
[12845] Fix | Delete
const divIdx = begin.divIdx;
[12846] Fix | Delete
textDivs[divIdx].textContent = "";
[12847] Fix | Delete
return appendTextToDiv(divIdx, 0, begin.offset, className);
[12848] Fix | Delete
}
[12849] Fix | Delete
function appendTextToDiv(divIdx, fromOffset, toOffset, className) {
[12850] Fix | Delete
let div = textDivs[divIdx];
[12851] Fix | Delete
if (div.nodeType === Node.TEXT_NODE) {
[12852] Fix | Delete
const span = document.createElement("span");
[12853] Fix | Delete
div.before(span);
[12854] Fix | Delete
span.append(div);
[12855] Fix | Delete
textDivs[divIdx] = span;
[12856] Fix | Delete
div = span;
[12857] Fix | Delete
}
[12858] Fix | Delete
const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);
[12859] Fix | Delete
const node = document.createTextNode(content);
[12860] Fix | Delete
if (className) {
[12861] Fix | Delete
const span = document.createElement("span");
[12862] Fix | Delete
span.className = `${className} appended`;
[12863] Fix | Delete
span.append(node);
[12864] Fix | Delete
div.append(span);
[12865] Fix | Delete
return className.includes("selected") ? span.offsetLeft : 0;
[12866] Fix | Delete
}
[12867] Fix | Delete
div.append(node);
[12868] Fix | Delete
return 0;
[12869] Fix | Delete
}
[12870] Fix | Delete
let i0 = selectedMatchIdx,
[12871] Fix | Delete
i1 = i0 + 1;
[12872] Fix | Delete
if (highlightAll) {
[12873] Fix | Delete
i0 = 0;
[12874] Fix | Delete
i1 = matches.length;
[12875] Fix | Delete
} else if (!isSelectedPage) {
[12876] Fix | Delete
return;
[12877] Fix | Delete
}
[12878] Fix | Delete
let lastDivIdx = -1;
[12879] Fix | Delete
let lastOffset = -1;
[12880] Fix | Delete
for (let i = i0; i < i1; i++) {
[12881] Fix | Delete
const match = matches[i];
[12882] Fix | Delete
const begin = match.begin;
[12883] Fix | Delete
if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {
[12884] Fix | Delete
continue;
[12885] Fix | Delete
}
[12886] Fix | Delete
lastDivIdx = begin.divIdx;
[12887] Fix | Delete
lastOffset = begin.offset;
[12888] Fix | Delete
const end = match.end;
[12889] Fix | Delete
const isSelected = isSelectedPage && i === selectedMatchIdx;
[12890] Fix | Delete
const highlightSuffix = isSelected ? " selected" : "";
[12891] Fix | Delete
let selectedLeft = 0;
[12892] Fix | Delete
if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
[12893] Fix | Delete
if (prevEnd !== null) {
[12894] Fix | Delete
appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
[12895] Fix | Delete
}
[12896] Fix | Delete
beginText(begin);
[12897] Fix | Delete
} else {
[12898] Fix | Delete
appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);
[12899] Fix | Delete
}
[12900] Fix | Delete
if (begin.divIdx === end.divIdx) {
[12901] Fix | Delete
selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);
[12902] Fix | Delete
} else {
[12903] Fix | Delete
selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);
[12904] Fix | Delete
for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {
[12905] Fix | Delete
textDivs[n0].className = "highlight middle" + highlightSuffix;
[12906] Fix | Delete
}
[12907] Fix | Delete
beginText(end, "highlight end" + highlightSuffix);
[12908] Fix | Delete
}
[12909] Fix | Delete
prevEnd = end;
[12910] Fix | Delete
if (isSelected) {
[12911] Fix | Delete
findController.scrollMatchIntoView({
[12912] Fix | Delete
element: textDivs[begin.divIdx],
[12913] Fix | Delete
selectedLeft,
[12914] Fix | Delete
pageIndex: pageIdx,
[12915] Fix | Delete
matchIndex: selectedMatchIdx
[12916] Fix | Delete
});
[12917] Fix | Delete
}
[12918] Fix | Delete
}
[12919] Fix | Delete
if (prevEnd) {
[12920] Fix | Delete
appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
[12921] Fix | Delete
}
[12922] Fix | Delete
}
[12923] Fix | Delete
_updateMatches(reset = false) {
[12924] Fix | Delete
if (!this.enabled && !reset) {
[12925] Fix | Delete
return;
[12926] Fix | Delete
}
[12927] Fix | Delete
const {
[12928] Fix | Delete
findController,
[12929] Fix | Delete
matches,
[12930] Fix | Delete
pageIdx
[12931] Fix | Delete
} = this;
[12932] Fix | Delete
const {
[12933] Fix | Delete
textContentItemsStr,
[12934] Fix | Delete
textDivs
[12935] Fix | Delete
} = this;
[12936] Fix | Delete
let clearedUntilDivIdx = -1;
[12937] Fix | Delete
for (const match of matches) {
[12938] Fix | Delete
const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);
[12939] Fix | Delete
for (let n = begin, end = match.end.divIdx; n <= end; n++) {
[12940] Fix | Delete
const div = textDivs[n];
[12941] Fix | Delete
div.textContent = textContentItemsStr[n];
[12942] Fix | Delete
div.className = "";
[12943] Fix | Delete
}
[12944] Fix | Delete
clearedUntilDivIdx = match.end.divIdx + 1;
[12945] Fix | Delete
}
[12946] Fix | Delete
if (!findController?.highlightMatches || reset) {
[12947] Fix | Delete
return;
[12948] Fix | Delete
}
[12949] Fix | Delete
const pageMatches = findController.pageMatches[pageIdx] || null;
[12950] Fix | Delete
const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;
[12951] Fix | Delete
this.matches = this._convertMatches(pageMatches, pageMatchesLength);
[12952] Fix | Delete
this._renderMatches(this.matches);
[12953] Fix | Delete
}
[12954] Fix | Delete
}
[12955] Fix | Delete
[12956] Fix | Delete
;// CONCATENATED MODULE: ./web/text_layer_builder.js
[12957] Fix | Delete
[12958] Fix | Delete
[12959] Fix | Delete
[12960] Fix | Delete
[12961] Fix | Delete
[12962] Fix | Delete
[12963] Fix | Delete
[12964] Fix | Delete
[12965] Fix | Delete
[12966] Fix | Delete
[12967] Fix | Delete
[12968] Fix | Delete
class TextLayerBuilder {
[12969] Fix | Delete
#enablePermissions = false;
[12970] Fix | Delete
#onAppend = null;
[12971] Fix | Delete
#renderingDone = false;
[12972] Fix | Delete
#textLayer = null;
[12973] Fix | Delete
static #textLayers = new Map();
[12974] Fix | Delete
static #selectionChangeAbortController = null;
[12975] Fix | Delete
constructor({
[12976] Fix | Delete
pdfPage,
[12977] Fix | Delete
highlighter = null,
[12978] Fix | Delete
accessibilityManager = null,
[12979] Fix | Delete
enablePermissions = false,
[12980] Fix | Delete
onAppend = null
[12981] Fix | Delete
}) {
[12982] Fix | Delete
this.pdfPage = pdfPage;
[12983] Fix | Delete
this.highlighter = highlighter;
[12984] Fix | Delete
this.accessibilityManager = accessibilityManager;
[12985] Fix | Delete
this.#enablePermissions = enablePermissions === true;
[12986] Fix | Delete
this.#onAppend = onAppend;
[12987] Fix | Delete
this.div = document.createElement("div");
[12988] Fix | Delete
this.div.tabIndex = 0;
[12989] Fix | Delete
this.div.className = "textLayer";
[12990] Fix | Delete
}
[12991] Fix | Delete
#finishRendering() {
[12992] Fix | Delete
this.#renderingDone = true;
[12993] Fix | Delete
const endOfContent = document.createElement("div");
[12994] Fix | Delete
endOfContent.className = "endOfContent";
[12995] Fix | Delete
this.div.append(endOfContent);
[12996] Fix | Delete
this.#bindMouse(endOfContent);
[12997] Fix | Delete
}
[12998] Fix | Delete
async render(viewport, textContentParams = null) {
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function