Add a config

Ignored intentionally to avoid commting configs.
This commit is contained in:
Andre D 2015-06-06 15:41:54 -04:00
parent dfebc3975d
commit 87fbc62214
4 changed files with 5 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,3 +1,3 @@
i/
static/js/config.js
server

View file

@ -181,6 +181,7 @@
<script src="/static/js/drop.js"></script>
<script src="/static/js/loadencryption.js"></script>
<script src="/static/js/downloadable.js"></script>
<script src="/static/js/config.js"></script>
<script>
$(window).unload(function () { $(window).unbind('unload') })
</script>

View file

@ -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)

View file

@ -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,