From 5b83deb043296c23ff912a2472703c1f7faddb4b Mon Sep 17 00:00:00 2001
From: Literallie
Date: Thu, 19 Oct 2017 22:48:13 +0200
Subject: Load js-url lib using legacy-loader
Doesn't use eval, plus no window object access
---
public/js/index.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'public/js/index.js')
diff --git a/public/js/index.js b/public/js/index.js
index b336af90..25bd1c36 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -3,6 +3,7 @@
modeType, Idle, serverurl, key, gapi, Dropbox, FilePicker
ot, MediaUploader, hex2rgb, num_loaded, Visibility */
+
require('../vendor/showup/showup')
require('../css/index.css')
@@ -21,6 +22,8 @@ import _ from 'lodash'
import List from 'list.js'
+var jsUrl = require('js-url')
+
import {
checkLoginStateChanged,
setloginStateChangeEvent
@@ -1474,12 +1477,12 @@ $('#gistImportModalConfirm').click(function () {
if (!isValidURL(gisturl)) {
showMessageModal(' Import from Gist', 'Not a valid URL :(', '', '', false)
} else {
- var hostname = window.url('hostname', gisturl)
+ var hostname = jsUrl('hostname', gisturl)
if (hostname !== 'gist.github.com') {
showMessageModal(' Import from Gist', 'Not a valid Gist URL :(', '', '', false)
} else {
ui.spinner.show()
- $.get('https://api.github.com/gists/' + window.url('-1', gisturl))
+ $.get('https://api.github.com/gists/' + jsUrl('-1', gisturl))
.done(function (data) {
if (data.files) {
var contents = ''
--
cgit v1.2.3