mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-23 18:17:14 +00:00
Convert require to import: domline, linestylefilter, broadcast
- 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')
- Convert exports.X = Y to export {X}
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
ab99abd35d
commit
c2a0ff74a8
3 changed files with 23 additions and 23 deletions
|
|
@ -23,15 +23,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const makeCSSManager = require('./cssmanager').makeCSSManager;
|
||||
const domline = require('./domline').domline;
|
||||
import AttribPool from './AttributePool';
|
||||
import {compose, deserializeOps, inverse, isIdentity, moveOpsToNewPool, mutateAttributionLines, mutateTextLines, splitAttributionLines, splitTextLines, unpack} from './Changeset';
|
||||
const attributes = require('./attributes');
|
||||
const linestylefilter = require('./linestylefilter').linestylefilter;
|
||||
const colorutils = require('./colorutils').colorutils;
|
||||
const _ = require('./underscore');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
import {makeCSSManager} from './cssmanager.js';
|
||||
import {domline} from './domline.js';
|
||||
import AttribPool from './AttributePool.js';
|
||||
import {compose, deserializeOps, inverse, isIdentity, moveOpsToNewPool, mutateAttributionLines, mutateTextLines, splitAttributionLines, splitTextLines, unpack} from './Changeset.js';
|
||||
import attributes from './attributes.js';
|
||||
import {linestylefilter} from './linestylefilter.js';
|
||||
import {colorutils} from './colorutils.js';
|
||||
import _ from './underscore.js';
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
|
||||
import html10n from './vendors/html10n';
|
||||
|
||||
|
|
@ -574,4 +574,4 @@ const loadBroadcastJS = (socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
|||
return changesetLoader;
|
||||
};
|
||||
|
||||
exports.loadBroadcastJS = loadBroadcastJS;
|
||||
export {loadBroadcastJS};
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
// requires: plugins
|
||||
// requires: undefined
|
||||
|
||||
const Security = require('./security');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const _ = require('./underscore');
|
||||
const lineAttributeMarker = require('./linestylefilter').lineAttributeMarker;
|
||||
import Security from './security.js';
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
import _ from './underscore.js';
|
||||
import {lineAttributeMarker} from './linestylefilter.js';
|
||||
const noop = () => {};
|
||||
|
||||
|
||||
|
|
@ -280,4 +280,4 @@ domline.processSpaces = (s, doesWrap) => {
|
|||
return parts.join('');
|
||||
};
|
||||
|
||||
exports.domline = domline;
|
||||
export {domline};
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@
|
|||
// requires: plugins
|
||||
// requires: undefined
|
||||
|
||||
import {deserializeOps} from './Changeset';
|
||||
import attributes from './attributes';
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
import {deserializeOps} from './Changeset.js';
|
||||
import attributes from './attributes.js';
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
const linestylefilter = {};
|
||||
const AttributeManager = require('./AttributeManager');
|
||||
import padutils from './pad_utils'
|
||||
import Op from "./Op";
|
||||
import AttributeManager from './AttributeManager.js';
|
||||
import padutils from './pad_utils.js'
|
||||
import Op from "./Op.js";
|
||||
|
||||
linestylefilter.ATTRIB_CLASSES = {
|
||||
bold: 'tag:b',
|
||||
|
|
@ -47,7 +47,7 @@ linestylefilter.ATTRIB_CLASSES = {
|
|||
};
|
||||
|
||||
const lineAttributeMarker = 'lineAttribMarker';
|
||||
exports.lineAttributeMarker = lineAttributeMarker;
|
||||
export {lineAttributeMarker};
|
||||
|
||||
linestylefilter.getAuthorClassName = (author) => `author-${author.replace(/[^a-y0-9]/g, (c) => {
|
||||
if (c === '.') return '-';
|
||||
|
|
@ -290,4 +290,4 @@ linestylefilter.populateDomLine = (textLine, aline, apool, domLineObj) => {
|
|||
func(text, '');
|
||||
};
|
||||
|
||||
exports.linestylefilter = linestylefilter;
|
||||
export {linestylefilter};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue