From b0a93ccddb568126b5f5f971f27f57657f947c02 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:24:16 +0200 Subject: [PATCH] Fixed loading ep_font_color3 --- src/node/hooks/express/specialpages.ts | 6 ++++-- src/static/js/ace.js | 1 - src/static/js/ace2_inner.js | 2 -- src/static/js/caretPosition.ts | 1 - src/static/js/l10n.ts | 26 +++++++++++++------------- src/static/js/pad.js | 1 + src/static/js/vendors/html10n.ts | 2 ++ 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/node/hooks/express/specialpages.ts b/src/node/hooks/express/specialpages.ts index 73233ecbc..3677bbfa6 100644 --- a/src/node/hooks/express/specialpages.ts +++ b/src/node/hooks/express/specialpages.ts @@ -92,7 +92,8 @@ const convertTypescript = (content: string) => { loader: 'js' }, alias:{ - "ep_etherpad-lite/static/js/browser": 'ep_etherpad-lite/static/js/vendors/browser' + "ep_etherpad-lite/static/js/browser": 'ep_etherpad-lite/static/js/vendors/browser', + "ep_etherpad-lite/static/js/nice-select": 'ep_etherpad-lite/static/js/vendors/nice-select' }, bundle: true, // Bundle the files together minify: process.env.NODE_ENV === "production", // Minify the output @@ -212,7 +213,8 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str loader: 'js' }, alias:{ - "ep_etherpad-lite/static/js/browser": 'ep_etherpad-lite/static/js/vendors/browser' + "ep_etherpad-lite/static/js/browser": 'ep_etherpad-lite/static/js/vendors/browser', + "ep_etherpad-lite/static/js/nice-select": 'ep_etherpad-lite/static/js/vendors/nice-select' }, bundle: true, // Bundle the files together minify: process.env.NODE_ENV === "production", // Minify the output diff --git a/src/static/js/ace.js b/src/static/js/ace.js index dece1c4c2..a1b5d99c8 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -100,7 +100,6 @@ const Ace2Editor = function () { }; const doActionsPendingInit = () => { - console.log('doActionsPendingInit', actionsPendingInit) for (const fn of actionsPendingInit) fn(); actionsPendingInit = []; }; diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 90abcb7b8..641c5ecdb 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -484,7 +484,6 @@ function Ace2Inner(editorInfo, cssManagers) { newText = `${lines.join('\n')}\n`; } - window.console.log('importText', {text, undoable, dontProcess, newText}) inCallStackIfNecessary(`importText${undoable ? 'Undoable' : ''}`, () => { setDocText(newText); @@ -526,7 +525,6 @@ function Ace2Inner(editorInfo, cssManagers) { const oldLen = rep.lines.totalWidth(); const numLines = rep.lines.length(); - window.console.log(rep, numLines - 1); const upToLastLine = rep.lines.offsetOfIndex(numLines - 1); const lastLineLength = rep.lines.atIndex(numLines - 1).text.length; const assem = Changeset.smartOpAssembler(); diff --git a/src/static/js/caretPosition.ts b/src/static/js/caretPosition.ts index d7f7bf4b6..5134a0ed0 100644 --- a/src/static/js/caretPosition.ts +++ b/src/static/js/caretPosition.ts @@ -191,7 +191,6 @@ const getDimensionOfFirstBrowserLineOfRepLine = (line: number, rep: RepModel) => }; const getSelectionRange = () => { - console.log("Selection is",window.frameElement) if (!window.getSelection) { return; } diff --git a/src/static/js/l10n.ts b/src/static/js/l10n.ts index b55c7f007..2211318c0 100644 --- a/src/static/js/l10n.ts +++ b/src/static/js/l10n.ts @@ -1,18 +1,18 @@ import html10n from '../js/vendors/html10n'; -((document) => { - // Set language for l10n - let regexpLang: string | undefined; - let language = document.cookie.match(/language=((\w{2,3})(-\w+)?)/); - if (language) regexpLang = language[1]; +// Set language for l10n +let regexpLang: string | undefined; +let language = document.cookie.match(/language=((\w{2,3})(-\w+)?)/); +if (language) regexpLang = language[1]; - html10n.mt.bind('indexed', () => { - html10n.localize([regexpLang, navigator.language, 'en']); - }); +html10n.mt.bind('indexed', () => { + console.log('Navigator language', navigator.language) + console.log('Localizing things', [regexpLang, navigator.language, 'en']) + html10n.localize([regexpLang, navigator.language, 'en']); +}); - html10n.mt.bind('localized', () => { - document.documentElement.lang = html10n.getLanguage()!; - document.documentElement.dir = html10n.getDirection()!; - }); -})(document); +html10n.mt.bind('localized', () => { + document.documentElement.lang = html10n.getLanguage()!; + document.documentElement.dir = html10n.getDirection()!; +}); diff --git a/src/static/js/pad.js b/src/static/js/pad.js index fd2b69565..d6648f031 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -139,6 +139,7 @@ const getParameters = [ name: 'lang', checkVal: null, callback: (val) => { + console.log('Val is', val) html10n.localize([val, 'en']); Cookies.set('language', val); }, diff --git a/src/static/js/vendors/html10n.ts b/src/static/js/vendors/html10n.ts index eb07f8dba..39da71200 100644 --- a/src/static/js/vendors/html10n.ts +++ b/src/static/js/vendors/html10n.ts @@ -472,6 +472,7 @@ export class Html10n { } localize(langs: (string|undefined)[]|string) { + console.log('Available langs ', langs) if ('string' === typeof langs) { langs = [langs]; } @@ -549,6 +550,7 @@ export class Html10n { break; } } + // @ts-ignore if(lang != l) continue; }