summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Johansson (neku) <neku@pomf.se>2015-07-02 21:11:04 +0200
committerEric Johansson (neku) <neku@pomf.se>2015-07-02 21:11:04 +0200
commit51438bb7ebc562b7f53f911a0790b21cbf7891bb (patch)
tree1566c8a17c1de2c048076f30d87f85be4bc5681a
parent3ffec35e4839069d32dcb60377888d0ab2289023 (diff)
parent0b57a76fe439459524b248cabaf8a477b7dcc003 (diff)
Merge pull request #36 from v0l/master
Pass back propper url after upload
-rw-r--r--Gruntfile.js1
-rw-r--r--js/pomf.js4
-rw-r--r--pages/index.swig2
-rw-r--r--pages/upload_form.swig2
-rw-r--r--static/upload.php2
5 files changed, 6 insertions, 5 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 10e2b2b..7581083 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -9,6 +9,7 @@ module.exports = function (grunt) {
autoescape: true
},
banners: grunt.file.readJSON('pages/banners.json'),
+ max_upload_size: 50,
dest: "dist/",
cwd: "pages/",
generateSitemap: false,
diff --git a/js/pomf.js b/js/pomf.js
index 52d03ee..f5dd06b 100644
--- a/js/pomf.js
+++ b/js/pomf.js
@@ -124,9 +124,9 @@ $(function () {
eachRow(res.files, function (row, file, files) {
var link = $('<a>')
- link.attr('href', 'http://a.pomf.se/' + file.url)
+ link.attr('href', file.url)
.attr('target', '_BLANK')
- .text('a.pomf.se/' + file.url)
+ .text(file.url.replace("http://","").replace("https://",""))
$('.file-url', row).append(link)
})
diff --git a/pages/index.swig b/pages/index.swig
index d69bc02..9215859 100644
--- a/pages/index.swig
+++ b/pages/index.swig
@@ -3,7 +3,7 @@
{% block body %}
<div class="jumbotron">
<h1>Ohayou!</h1>
- <p class="lead">Max upload size is 50MiB, read the <a href="faq.html">FAQ</a></p>
+ <p class="lead">Max upload size is {{max_upload_size}}MiB, read the <a href="faq.html">FAQ</a></p>
{% include "check_script.swig" %}
{% include "check_fileapi.swig" %}
{% include "upload_form.swig" %}
diff --git a/pages/upload_form.swig b/pages/upload_form.swig
index 7430f28..c5a00ce 100644
--- a/pages/upload_form.swig
+++ b/pages/upload_form.swig
@@ -1,3 +1,3 @@
<a href="javascript:;" id="upload-btn" class="btn">Select <span>or drop </span>file(s)</a>
-<input type="file" id="upload-input" name="files[]" multiple data-max-size="50MiB">
+<input type="file" id="upload-input" name="files[]" multiple data-max-size="{{max_upload_size}}MiB">
<ul id="upload-filelist"></ul>
diff --git a/static/upload.php b/static/upload.php
index 7756e03..4a209f3 100644
--- a/static/upload.php
+++ b/static/upload.php
@@ -125,7 +125,7 @@ function upload_file ($file) {
return array(
'hash' => $file->get_sha1(),
'name' => $file->name,
- 'url' => $newname,
+ 'url' => POMF_URL . $newname,
'size' => $file->size
);
} else {