diff --git a/.gitignore b/.gitignore index 86d82cf..80560b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ i/ - +static/js/config.js server diff --git a/index.html b/index.html index 4b8982e..8c6d309 100644 --- a/index.html +++ b/index.html @@ -181,6 +181,7 @@ + diff --git a/static/js/downloadable.js b/static/js/downloadable.js index c0e7571..34d61de 100644 --- a/static/js/downloadable.js +++ b/static/js/downloadable.js @@ -68,7 +68,7 @@ $(function () { function downloadfromident(ident) { var xhr = new XMLHttpRequest(); xhr.onload = downloaded - xhr.open('GET', 'i/' + ident.ident) + xhr.open('GET', (g.config.server ? g.config.server : '') + 'i/' + ident.ident) xhr.responseType = 'blob' xhr.addEventListener('progress', downloadprogress, false) diff --git a/static/js/drop.js b/static/js/drop.js index f4eff04..90c9ec0 100644 --- a/static/js/drop.js +++ b/static/js/drop.js @@ -1,4 +1,5 @@ var g = {} +g.config = {} $(function () { var pastearea = $('#pastearea') @@ -19,7 +20,7 @@ $(function () { formdata.append('ident', data.ident) formdata.append('file', data.encrypted) $.ajax({ - url: 'up', + url: (g.config.server ? g.config.server : '') + 'up', data: formdata, cache: false, processData: false,