Skip to content

Commit 3a752fd

Browse files
committed
Revert "Load js-url lib using legacy-loader"
Didn't work in Firefox for some reason. `[Script Loader] ReferenceError: module is not defined` This reverts commit 5b83deb.
1 parent 567f26f commit 3a752fd

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"js-yaml": "^3.7.0",
5757
"jsdom-nogyp": "^0.8.3",
5858
"keymaster": "^1.6.2",
59-
"legacy-loader": "0.0.2",
6059
"list.js": "^1.5.0",
6160
"lodash": "^4.17.4",
6261
"lz-string": "1.4.4",

public/js/history.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ import {
1212
urlpath
1313
} from './lib/config'
1414

15-
var jsUrl = require('js-url')
16-
1715
window.migrateHistoryFromTempCallback = null
1816

1917
migrateHistoryFromTemp()
2018

2119
function migrateHistoryFromTemp () {
22-
if (jsUrl('#tempid')) {
20+
if (window.url('#tempid')) {
2321
$.get(`${serverurl}/temp`, {
24-
tempid: jsUrl('#tempid')
22+
tempid: window.url('#tempid')
2523
})
2624
.done(data => {
2725
if (data && data.temp) {

public/js/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import _ from 'lodash'
2121

2222
import List from 'list.js'
2323

24-
var jsUrl = require('js-url')
25-
2624
import {
2725
checkLoginStateChanged,
2826
setloginStateChangeEvent
@@ -1476,12 +1474,12 @@ $('#gistImportModalConfirm').click(function () {
14761474
if (!isValidURL(gisturl)) {
14771475
showMessageModal('<i class="fa fa-github"></i> Import from Gist', 'Not a valid URL :(', '', '', false)
14781476
} else {
1479-
var hostname = jsUrl('hostname', gisturl)
1477+
var hostname = window.url('hostname', gisturl)
14801478
if (hostname !== 'gist.github.com') {
14811479
showMessageModal('<i class="fa fa-github"></i> Import from Gist', 'Not a valid Gist URL :(', '', '', false)
14821480
} else {
14831481
ui.spinner.show()
1484-
$.get('https://api.github.com/gists/' + jsUrl('-1', gisturl))
1482+
$.get('https://api.github.com/gists/' + window.url('-1', gisturl))
14851483
.done(function (data) {
14861484
if (data.files) {
14871485
var contents = ''

webpackBaseConfig.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module.exports = {
190190
index: [
191191
'babel-polyfill',
192192
'script!jquery-ui-resizable',
193-
'js-url',
193+
'script!js-url',
194194
'expose?filterXSS!xss',
195195
'script!Idle.Js',
196196
'expose?LZString!lz-string',
@@ -241,7 +241,7 @@ module.exports = {
241241
'expose?jsyaml!js-yaml',
242242
'script!mermaid',
243243
'expose?moment!moment',
244-
'js-url',
244+
'script!js-url',
245245
'script!handlebars',
246246
'expose?hljs!highlight.js',
247247
'expose?emojify!emojify.js',
@@ -374,8 +374,7 @@ module.exports = {
374374
'bootstrap-tooltip': path.join(__dirname, 'public/vendor/bootstrap/tooltip.min.js'),
375375
'headjs': path.join(__dirname, 'node_modules/reveal.js/lib/js/head.min.js'),
376376
'reveal-markdown': path.join(__dirname, 'public/js/reveal-markdown.js'),
377-
abcjs: path.join(__dirname, 'public/vendor/abcjs_basic_3.1.1-min.js'),
378-
'js-url': path.join(__dirname, 'node_modules/js-url/url.js')
377+
abcjs: path.join(__dirname, 'public/vendor/abcjs_basic_3.1.1-min.js')
379378
}
380379
},
381380

@@ -430,9 +429,6 @@ module.exports = {
430429
}, {
431430
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
432431
loader: 'url?limit=10000&mimetype=image/gif'
433-
}, {
434-
test: /\/node_modules\/js-url\/url.js/,
435-
loader: 'legacy'
436432
}]
437433
},
438434
node: {

0 commit comments

Comments
 (0)