mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
Fixed bootstrap.
This commit is contained in:
parent
d70387966b
commit
3b76d80c14
10 changed files with 40 additions and 28 deletions
|
@ -188,6 +188,9 @@ importers:
|
|||
jose:
|
||||
specifier: ^5.6.3
|
||||
version: 5.6.3
|
||||
jquery:
|
||||
specifier: ^3.7.1
|
||||
version: 3.7.1
|
||||
js-cookie:
|
||||
specifier: ^3.0.5
|
||||
version: 3.0.5
|
||||
|
@ -3168,6 +3171,9 @@ packages:
|
|||
jose@5.6.3:
|
||||
resolution: {integrity: sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==}
|
||||
|
||||
jquery@3.7.1:
|
||||
resolution: {integrity: sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==}
|
||||
|
||||
js-cookie@3.0.5:
|
||||
resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==}
|
||||
engines: {node: '>=14'}
|
||||
|
@ -7672,6 +7678,8 @@ snapshots:
|
|||
|
||||
jose@5.6.3: {}
|
||||
|
||||
jquery@3.7.1: {}
|
||||
|
||||
js-cookie@3.0.5: {}
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
|
|
|
@ -12,6 +12,8 @@ import {userCanModify} from './webaccess';
|
|||
import {pluginDefs} from '../../../static/js/pluginfw/plugin_defs';
|
||||
|
||||
import {build, buildSync} from 'esbuild'
|
||||
import {availableLangs} from "../i18n";
|
||||
import {clientPluginNames} from "../../../static/js/pluginfw/shared";
|
||||
let ioI: { sockets: { sockets: any[]; }; } | null = null
|
||||
|
||||
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', {
|
||||
req,
|
||||
toolbar,
|
||||
settings: settings,
|
||||
clientPluginNames: clientPluginNames,
|
||||
langs: availableLangs,
|
||||
isReadOnly,
|
||||
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', {
|
||||
req,
|
||||
toolbar,
|
||||
langs: availableLangs,
|
||||
settings: settings,
|
||||
isReadOnly,
|
||||
entrypoint: '/watch/timeslider?hash=' + hash
|
||||
})
|
||||
|
@ -210,7 +217,8 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str
|
|||
},
|
||||
alias:{
|
||||
"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
|
||||
minify: process.env.NODE_ENV === "production", // Minify the output
|
||||
|
|
|
@ -249,7 +249,7 @@ const getFileCompressed = async (filename: string, contentType: string|false) =>
|
|||
|
||||
const compressResult = await compressJS(content.toString());
|
||||
|
||||
if (compressResult.warnings) {
|
||||
if (compressResult.warnings.length != 0) {
|
||||
console.error(`Error compressing JS (${filename}) using terser`, compressResult.warnings);
|
||||
} else {
|
||||
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));
|
||||
|
||||
if (compressResult) {
|
||||
if (compressResult == null) {
|
||||
console.error(`Error compressing CSS (${filename}) using terser`, compressResult);
|
||||
} else {
|
||||
contentString = compressResult
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`CleanCSS.minify() returned an error on ${filename}: ${error}`);
|
||||
console.error(`CleanCSS.minify() returned an error on : ${error}`);
|
||||
}
|
||||
resolve(content.toString());
|
||||
});
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"formidable": "^3.5.1",
|
||||
"http-errors": "^2.0.0",
|
||||
"jose": "^5.6.3",
|
||||
"jquery": "^3.7.1",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsdom": "^24.1.0",
|
||||
"jsonminify": "0.4.2",
|
||||
|
|
|
@ -867,7 +867,8 @@ export type PadSettings = {
|
|||
|
||||
export const pad = new Pad()
|
||||
|
||||
exports.baseURL = '';
|
||||
exports.randomString = randomString;
|
||||
exports.getParams = getParams;
|
||||
exports.pad = pad;
|
||||
export let baseURL = '';
|
||||
|
||||
export const setPadBaseURL = (url: string)=> {
|
||||
baseURL = url
|
||||
}
|
||||
|
|
|
@ -101,4 +101,3 @@ class PadConnectionStatus {
|
|||
|
||||
|
||||
export const padconnectionstatus = new PadConnectionStatus()
|
||||
exports.padconnectionstatus = padconnectionstatus;
|
||||
|
|
11
src/static/js/vendors/nice-select.js
vendored
11
src/static/js/vendors/nice-select.js
vendored
|
@ -1,3 +1,7 @@
|
|||
import jquery from 'jquery';
|
||||
window.jQuery = jquery;
|
||||
window.$ = jquery;
|
||||
|
||||
// WARNING: This file has been modified from the Original
|
||||
// TODO: Nice Select seems relatively abandoned, we should consider other options.
|
||||
|
||||
|
@ -5,9 +9,8 @@
|
|||
https://github.com/hernansartorio/jquery-nice-select
|
||||
Made by Hernán Sartorio */
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.niceSelect = function(method) {
|
||||
(function() {
|
||||
window.$.fn.niceSelect = function(method) {
|
||||
|
||||
// Methods
|
||||
if (typeof method == 'string') {
|
||||
|
@ -209,4 +212,4 @@
|
|||
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
}(window.jQuery));
|
||||
|
|
|
@ -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>
|
||||
<html translate="no" class="pad <%=pluginUtils.clientPluginNames().join(' '); %> <%=settings.skinVariants%>">
|
||||
<html translate="no" class="pad <%=clientPluginNames().join(' '); %> <%=settings.skinVariants%>">
|
||||
<head>
|
||||
<% e.begin_block("htmlHead"); %>
|
||||
<% e.end_block(); %>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import browser from 'ep_etherpad-lite/static/js/vendors/browser'
|
||||
import {padeditbar} from 'ep_etherpad-lite/static/js/pad_editbar'
|
||||
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 () => {
|
||||
|
||||
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');
|
||||
|
||||
const basePath = new URL('..', window.location.href).pathname;
|
||||
window.$ = window.jQuery = require('ep_etherpad-lite/static/js/vendors/jquery');
|
||||
window.browser = browser;
|
||||
const pad = require('ep_etherpad-lite/static/js/pad');
|
||||
pad.baseURL = basePath;
|
||||
setPadBaseURL(basePath);
|
||||
window.plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
|
||||
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.pluginDefs = require('../../src/static/js/pluginfw/plugin_defs');
|
||||
pad.init();
|
||||
await new Promise((resolve) => $(resolve));
|
||||
await new Promise((resolve) => window.$(resolve));
|
||||
await hooks.aCallAll('documentReady');
|
||||
})();
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
<%
|
||||
var settings = require("ep_etherpad-lite/node/utils/Settings")
|
||||
, langs = require("ep_etherpad-lite/node/hooks/i18n").availableLangs
|
||||
%>
|
||||
<!doctype html>
|
||||
<html translate="no" class="pad <%=settings.skinVariants%>">
|
||||
<head>
|
||||
|
|
Loading…
Reference in a new issue