mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-23 18:17:14 +00:00
Convert require to import: rjquery, timeslider, underscore
- Convert const X = require('Y') to import X from 'Y.js'
- Convert const {A, B} = require('Y') to import {A, B} from 'Y.js'
- Add .js extensions to relative imports
- Keep external packages without .js (e.g., 'tinycon/tinycon', 'underscore')
- Convert exports.X = Y to export {X}
- Convert module.exports to export default
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
fea9e5128f
commit
e7bc5cdef9
3 changed files with 15 additions and 11 deletions
|
|
@ -1,6 +1,8 @@
|
|||
// @ts-nocheck
|
||||
'use strict';
|
||||
// Provides a require'able version of jQuery without leaking $ and jQuery;
|
||||
window.$ = require('./vendors/jquery');
|
||||
import $ from './vendors/jquery.js';
|
||||
window.$ = $;
|
||||
const jq = window.$.noConflict(true);
|
||||
exports.jQuery = exports.$ = jq;
|
||||
|
||||
export {jq as jQuery, jq as $};
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@
|
|||
|
||||
// These jQuery things should create local references, but for now `require()`
|
||||
// assigns to the global `$` and augments it with plugins.
|
||||
require('./vendors/jquery');
|
||||
import './vendors/jquery.js';
|
||||
|
||||
import {randomString, Cookies} from "./pad_utils";
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
import padutils from './pad_utils'
|
||||
const socketio = require('./socketio');
|
||||
import html10n from '../js/vendors/html10n'
|
||||
import {randomString, Cookies} from "./pad_utils.js";
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
import padutils from './pad_utils.js'
|
||||
import socketio from './socketio.js';
|
||||
import html10n from '../js/vendors/html10n.js'
|
||||
let token, padId, exportLinks, socket, changesetLoader, BroadcastSlider;
|
||||
let cp = '';
|
||||
const playbackSpeedCookie = 'timesliderPlaybackSpeed';
|
||||
|
|
@ -222,5 +222,5 @@ const handleClientVars = (message) => {
|
|||
});
|
||||
};
|
||||
|
||||
exports.baseURL = '';
|
||||
exports.init = init;
|
||||
export const baseURL = '';
|
||||
export {init};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
// @ts-nocheck
|
||||
'use strict';
|
||||
|
||||
module.exports = require('underscore');
|
||||
import _ from 'underscore';
|
||||
|
||||
export default _;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue