diff options
author | Sheogorath | 2019-04-16 19:27:02 +0200 |
---|---|---|
committer | Sheogorath | 2019-04-16 19:28:23 +0200 |
commit | c0e75b8606267d50617807e251953ecc87b0a4e6 (patch) | |
tree | 36a5a7cc3a76f554cfb566d44c47cc8005bc366f /public/js | |
parent | d359d4aa847c8c1a86eb344f424efa377f7b8aaa (diff) |
Replace js-url with wurl
js-url is outdated and wurl is it's successor. This will fix some
vulnerabilities in the dependencies and also optimize the build process
by removing the external library toward internal tooling.
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to '')
-rw-r--r-- | public/js/history.js | 5 | ||||
-rw-r--r-- | public/js/index.js | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/public/js/history.js b/public/js/history.js index 6007bef4..27b8cd28 100644 --- a/public/js/history.js +++ b/public/js/history.js @@ -4,6 +4,7 @@ import store from 'store' import S from 'string' import LZString from 'lz-string' +import url from 'wurl' import { checkNoteIdValid, @@ -23,9 +24,9 @@ window.migrateHistoryFromTempCallback = null migrateHistoryFromTemp() function migrateHistoryFromTemp () { - if (window.url('#tempid')) { + if (url('#tempid')) { $.get(`${serverurl}/temp`, { - tempid: window.url('#tempid') + tempid: url('#tempid') }) .done(data => { if (data && data.temp) { diff --git a/public/js/index.js b/public/js/index.js index c59c94d0..d5345a8c 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -17,6 +17,7 @@ import { saveAs } from 'file-saver' import randomColor from 'randomcolor' import store from 'store' import hljs from 'highlight.js' +import url from 'wurl' import _ from 'lodash' @@ -1373,12 +1374,12 @@ $('#gistImportModalConfirm').click(function () { if (!isValidURL(gisturl)) { showMessageModal('<i class="fa fa-github"></i> Import from Gist', 'Not a valid URL :(', '', '', false) } else { - var hostname = window.url('hostname', gisturl) + var hostname = url('hostname', gisturl) if (hostname !== 'gist.github.com') { showMessageModal('<i class="fa fa-github"></i> 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/' + url('-1', gisturl)) .done(function (data) { if (data.files) { var contents = '' |