From 87fbc62214d04d7e5aa9dc381dd50160c9f27360 Mon Sep 17 00:00:00 2001 From: Andre D Date: Sat, 6 Jun 2015 15:41:54 -0400 Subject: [PATCH] Add a config Ignored intentionally to avoid commting configs. --- .gitignore | 2 +- index.html | 1 + static/js/downloadable.js | 2 +- static/js/drop.js | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) 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,