Fixed bootstrap.

This commit is contained in:
SamTv12345 2024-07-23 09:58:52 +02:00
parent d70387966b
commit 3b76d80c14
10 changed files with 40 additions and 28 deletions

View file

@ -188,6 +188,9 @@ importers:
jose: jose:
specifier: ^5.6.3 specifier: ^5.6.3
version: 5.6.3 version: 5.6.3
jquery:
specifier: ^3.7.1
version: 3.7.1
js-cookie: js-cookie:
specifier: ^3.0.5 specifier: ^3.0.5
version: 3.0.5 version: 3.0.5
@ -3168,6 +3171,9 @@ packages:
jose@5.6.3: jose@5.6.3:
resolution: {integrity: sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==} resolution: {integrity: sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==}
jquery@3.7.1:
resolution: {integrity: sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==}
js-cookie@3.0.5: js-cookie@3.0.5:
resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==}
engines: {node: '>=14'} engines: {node: '>=14'}
@ -7672,6 +7678,8 @@ snapshots:
jose@5.6.3: {} jose@5.6.3: {}
jquery@3.7.1: {}
js-cookie@3.0.5: {} js-cookie@3.0.5: {}
js-tokens@4.0.0: {} js-tokens@4.0.0: {}

View file

@ -12,6 +12,8 @@ import {userCanModify} from './webaccess';
import {pluginDefs} from '../../../static/js/pluginfw/plugin_defs'; import {pluginDefs} from '../../../static/js/pluginfw/plugin_defs';
import {build, buildSync} from 'esbuild' import {build, buildSync} from 'esbuild'
import {availableLangs} from "../i18n";
import {clientPluginNames} from "../../../static/js/pluginfw/shared";
let ioI: { sockets: { sockets: any[]; }; } | null = null let ioI: { sockets: { sockets: any[]; }; } | null = null
export const socketio = (hookName: string, {io}: any) => { export const socketio = (hookName: string, {io}: any) => {
@ -157,6 +159,9 @@ const handleLiveReload = async (args: any, padString: string, timeSliderString:
const content = requireP('ep_etherpad-lite/templates/pad.html', { const content = requireP('ep_etherpad-lite/templates/pad.html', {
req, req,
toolbar, toolbar,
settings: settings,
clientPluginNames: clientPluginNames,
langs: availableLangs,
isReadOnly, isReadOnly,
entrypoint: '/watch/pad?hash=' + hash entrypoint: '/watch/pad?hash=' + hash
}) })
@ -186,6 +191,8 @@ const handleLiveReload = async (args: any, padString: string, timeSliderString:
const content = requireP('ep_etherpad-lite/templates/timeslider.html', { const content = requireP('ep_etherpad-lite/templates/timeslider.html', {
req, req,
toolbar, toolbar,
langs: availableLangs,
settings: settings,
isReadOnly, isReadOnly,
entrypoint: '/watch/timeslider?hash=' + hash entrypoint: '/watch/timeslider?hash=' + hash
}) })
@ -210,7 +217,8 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str
}, },
alias:{ 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' "ep_etherpad-lite/static/js/nice-select": 'ep_etherpad-lite/static/js/vendors/nice-select',
"jquery": "ep_etherpad-lite/node_modules/jquery"
}, },
bundle: true, // Bundle the files together bundle: true, // Bundle the files together
minify: process.env.NODE_ENV === "production", // Minify the output minify: process.env.NODE_ENV === "production", // Minify the output

View file

@ -249,7 +249,7 @@ const getFileCompressed = async (filename: string, contentType: string|false) =>
const compressResult = await compressJS(content.toString()); const compressResult = await compressJS(content.toString());
if (compressResult.warnings) { if (compressResult.warnings.length != 0) {
console.error(`Error compressing JS (${filename}) using terser`, compressResult.warnings); console.error(`Error compressing JS (${filename}) using terser`, compressResult.warnings);
} else { } else {
jsSources = compressResult.code.toString(); // Convert content obj code to string jsSources = compressResult.code.toString(); // Convert content obj code to string
@ -268,13 +268,13 @@ const getFileCompressed = async (filename: string, contentType: string|false) =>
const compressResult = await compressCSS(path.resolve(ROOT_DIR, filename)); const compressResult = await compressCSS(path.resolve(ROOT_DIR, filename));
if (compressResult) { if (compressResult == null) {
console.error(`Error compressing CSS (${filename}) using terser`, compressResult); console.error(`Error compressing CSS (${filename}) using terser`, compressResult);
} else { } else {
contentString = compressResult contentString = compressResult
} }
} catch (error) { } catch (error) {
console.error(`CleanCSS.minify() returned an error on ${filename}: ${error}`); console.error(`CleanCSS.minify() returned an error on : ${error}`);
} }
resolve(content.toString()); resolve(content.toString());
}); });

View file

@ -46,6 +46,7 @@
"formidable": "^3.5.1", "formidable": "^3.5.1",
"http-errors": "^2.0.0", "http-errors": "^2.0.0",
"jose": "^5.6.3", "jose": "^5.6.3",
"jquery": "^3.7.1",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"jsdom": "^24.1.0", "jsdom": "^24.1.0",
"jsonminify": "0.4.2", "jsonminify": "0.4.2",

View file

@ -867,7 +867,8 @@ export type PadSettings = {
export const pad = new Pad() export const pad = new Pad()
exports.baseURL = ''; export let baseURL = '';
exports.randomString = randomString;
exports.getParams = getParams; export const setPadBaseURL = (url: string)=> {
exports.pad = pad; baseURL = url
}

View file

@ -101,4 +101,3 @@ class PadConnectionStatus {
export const padconnectionstatus = new PadConnectionStatus() export const padconnectionstatus = new PadConnectionStatus()
exports.padconnectionstatus = padconnectionstatus;

View file

@ -1,3 +1,7 @@
import jquery from 'jquery';
window.jQuery = jquery;
window.$ = jquery;
// WARNING: This file has been modified from the Original // WARNING: This file has been modified from the Original
// TODO: Nice Select seems relatively abandoned, we should consider other options. // TODO: Nice Select seems relatively abandoned, we should consider other options.
@ -5,9 +9,8 @@
https://github.com/hernansartorio/jquery-nice-select https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */ Made by Hernán Sartorio */
(function($) { (function() {
window.$.fn.niceSelect = function(method) {
$.fn.niceSelect = function(method) {
// Methods // Methods
if (typeof method == 'string') { if (typeof method == 'string') {
@ -209,4 +212,4 @@
}; };
}(jQuery)); }(window.jQuery));

View file

@ -1,10 +1,5 @@
<%
import settings from 'ep_etherpad-lite/node/utils/Settings'
import langs from 'ep_etherpad-lite/node/hooks/i18n'
import {pluginUtils} from 'ep_etherpad-lite/static/js/pluginfw/shared'
%>
<!doctype html> <!doctype html>
<html translate="no" class="pad <%=pluginUtils.clientPluginNames().join(' '); %> <%=settings.skinVariants%>"> <html translate="no" class="pad <%=clientPluginNames().join(' '); %> <%=settings.skinVariants%>">
<head> <head>
<% e.begin_block("htmlHead"); %> <% e.begin_block("htmlHead"); %>
<% e.end_block(); %> <% e.end_block(); %>

View file

@ -1,7 +1,10 @@
import browser from 'ep_etherpad-lite/static/js/vendors/browser' import browser from 'ep_etherpad-lite/static/js/vendors/browser'
import {padeditbar} from 'ep_etherpad-lite/static/js/pad_editbar' import {padeditbar} from 'ep_etherpad-lite/static/js/pad_editbar'
import {padImpExp} from 'ep_etherpad-lite/static/js/pad_impexp' import {padImpExp} from 'ep_etherpad-lite/static/js/pad_impexp'
import jquery from 'jquery';
window.jQuery = jquery;
window.$ = jquery;
import {pad, setPadBaseURL} from 'ep_etherpad-lite/static/js/pad'
(async () => { (async () => {
require('../../src/static/js/l10n') require('../../src/static/js/l10n')
@ -17,10 +20,8 @@ import {padImpExp} from 'ep_etherpad-lite/static/js/pad_impexp'
//window.require.resolveTmp = require.resolve('ep_etherpad-lite/static/js/pad_cookie'); //window.require.resolveTmp = require.resolve('ep_etherpad-lite/static/js/pad_cookie');
const basePath = new URL('..', window.location.href).pathname; const basePath = new URL('..', window.location.href).pathname;
window.$ = window.jQuery = require('ep_etherpad-lite/static/js/vendors/jquery');
window.browser = browser; window.browser = browser;
const pad = require('ep_etherpad-lite/static/js/pad'); setPadBaseURL(basePath);
pad.baseURL = basePath;
window.plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); window.plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
@ -44,6 +45,6 @@ import {padImpExp} from 'ep_etherpad-lite/static/js/pad_impexp'
window._postPluginUpdateForTestingDone = true; window._postPluginUpdateForTestingDone = true;
window.pluginDefs = require('../../src/static/js/pluginfw/plugin_defs'); window.pluginDefs = require('../../src/static/js/pluginfw/plugin_defs');
pad.init(); pad.init();
await new Promise((resolve) => $(resolve)); await new Promise((resolve) => window.$(resolve));
await hooks.aCallAll('documentReady'); await hooks.aCallAll('documentReady');
})(); })();

View file

@ -1,7 +1,3 @@
<%
var settings = require("ep_etherpad-lite/node/utils/Settings")
, langs = require("ep_etherpad-lite/node/hooks/i18n").availableLangs
%>
<!doctype html> <!doctype html>
<html translate="no" class="pad <%=settings.skinVariants%>"> <html translate="no" class="pad <%=settings.skinVariants%>">
<head> <head>