mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-23 18:17:14 +00:00
Convert require to import: broadcast_slider, chat, collab_client
- 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
503e3e209f
commit
ab99abd35d
3 changed files with 17 additions and 16 deletions
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
// These parameters were global, now they are injected. A reference to the
|
||||
// Timeslider controller would probably be more appropriate.
|
||||
const _ = require('./underscore');
|
||||
const padmodals = require('./pad_modals').padmodals;
|
||||
const colorutils = require('./colorutils').colorutils;
|
||||
import _ from './underscore.js';
|
||||
import {padmodals} from './pad_modals.js';
|
||||
import {colorutils} from './colorutils.js';
|
||||
import html10n from './vendors/html10n';
|
||||
|
||||
const loadBroadcastSliderJS = (fireWhenAllScriptsAreLoaded) => {
|
||||
|
|
@ -373,4 +373,4 @@ const loadBroadcastSliderJS = (fireWhenAllScriptsAreLoaded) => {
|
|||
return BroadcastSlider;
|
||||
};
|
||||
|
||||
exports.loadBroadcastSliderJS = loadBroadcastSliderJS;
|
||||
export {loadBroadcastSliderJS};
|
||||
|
|
|
|||
|
|
@ -16,20 +16,19 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import ChatMessage from './ChatMessage';
|
||||
import padutils from './pad_utils'
|
||||
const padcookie = require('./pad_cookie').padcookie;
|
||||
const Tinycon = require('tinycon/tinycon');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const padeditor = require('./pad_editor').padeditor;
|
||||
import ChatMessage from './ChatMessage.js';
|
||||
import padutils from './pad_utils.js'
|
||||
import {padcookie} from './pad_cookie.js';
|
||||
import Tinycon from 'tinycon/tinycon';
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
import {padeditor} from './pad_editor.js';
|
||||
import html10n from './vendors/html10n';
|
||||
|
||||
// Removes diacritics and lower-cases letters. https://stackoverflow.com/a/37511463
|
||||
const normalize = (s) => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
|
||||
|
||||
|
||||
exports.chat = (() => {
|
||||
let isStuck = false;
|
||||
const chat = (() => {
|
||||
let userAndChat = false;
|
||||
let chatMentions = 0;
|
||||
return {
|
||||
|
|
@ -296,3 +295,5 @@ exports.chat = (() => {
|
|||
},
|
||||
};
|
||||
})();
|
||||
|
||||
export {chat};
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const chat = require('./chat').chat;
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const browser = require('./vendors/browser');
|
||||
import {chat} from './chat.js';
|
||||
import hooks from './pluginfw/hooks.js';
|
||||
import browser from './vendors/browser.js';
|
||||
|
||||
// Dependency fill on init. This exists for `pad.socket` only.
|
||||
// TODO: bind directly to the socket.
|
||||
|
|
@ -510,4 +510,4 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
|||
return self;
|
||||
};
|
||||
|
||||
exports.getCollabClient = getCollabClient;
|
||||
export {getCollabClient};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue