diff --git a/src/static/js/pad_editor.ts b/src/static/js/pad_editor.ts index 267ad5dd6..05f1ac762 100644 --- a/src/static/js/pad_editor.ts +++ b/src/static/js/pad_editor.ts @@ -22,10 +22,10 @@ * limitations under the License. */ -import padutils from "./pad_utils"; -const Ace2Editor = require('./ace').Ace2Editor; -import html10n from '../js/vendors/html10n' -const skinVariants = require('./skin_variants'); +import padutils from "./pad_utils.js"; +import {Ace2Editor} from './ace.js'; +import html10n from '../js/vendors/html10n.js' +import skinVariants from './skin_variants.js'; const padeditor = (() => { let pad = undefined; @@ -47,7 +47,7 @@ const padeditor = (() => { const targetLineNumber = $(this).index() + 1; window.location.hash = `L${targetLineNumber}`; }); - exports.focusOnLine(self.ace); + focusOnLine(self.ace); self.ace.setProperty('wraps', true); self.initViewOptions(); self.setViewOptions(initialViewOptions); @@ -248,9 +248,7 @@ const padeditor = (() => { return self; })(); -exports.padeditor = padeditor; - -exports.focusOnLine = (ace) => { +const focusOnLine = (ace) => { // If a number is in the URI IE #L124 go to that line number const lineNumber = window.location.hash.substr(1); if (lineNumber) { @@ -296,3 +294,5 @@ exports.focusOnLine = (ace) => { } // End of setSelection / set Y position of editor }; + +export {padeditor, focusOnLine}; diff --git a/src/static/js/pad_modals.ts b/src/static/js/pad_modals.ts index 3e2c2459b..22eaaf73f 100644 --- a/src/static/js/pad_modals.ts +++ b/src/static/js/pad_modals.ts @@ -23,8 +23,8 @@ * limitations under the License. */ -const padeditbar = require('./pad_editbar').padeditbar; -const automaticReconnect = require('./pad_automatic_reconnect'); +import {padeditbar} from './pad_editbar.js'; +import automaticReconnect from './pad_automatic_reconnect.js'; const padmodals = (() => { let pad = undefined; @@ -53,4 +53,4 @@ const padmodals = (() => { return self; })(); -exports.padmodals = padmodals; +export {padmodals}; diff --git a/src/static/js/pad_userlist.ts b/src/static/js/pad_userlist.ts index 85bb32a98..2307d6268 100644 --- a/src/static/js/pad_userlist.ts +++ b/src/static/js/pad_userlist.ts @@ -17,9 +17,9 @@ * limitations under the License. */ -import padutils from './pad_utils' -const hooks = require('./pluginfw/hooks'); -import html10n from './vendors/html10n'; +import padutils from './pad_utils.js' +import hooks from './pluginfw/hooks.js'; +import html10n from './vendors/html10n.js'; let myUserInfo = {}; let colorPickerOpen = false; @@ -619,4 +619,4 @@ const showColorPicker = () => { } }; -exports.paduserlist = paduserlist; +export {paduserlist};