From 9d70ac386192ef044d5d9a2ad6df004151ed1626 Mon Sep 17 00:00:00 2001 From: Kieran Harkin Date: Wed, 24 Jun 2015 10:48:17 +0100 Subject: pass full url back to client --- js/pomf.js | 4 ++-- static/upload.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 = $('') - 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/static/upload.php b/static/upload.php index 7756e03..5675eeb 100644 --- a/static/upload.php +++ b/static/upload.php @@ -86,7 +86,7 @@ function upload_file ($file) { return array( 'hash' => $file->get_sha1(), 'name' => $file->name, - 'url' => $result['filename'], + 'url' => POMF_URL . $result['filename'], 'size' => $file->size ); } -- cgit v1.2.3 From 7ab7199e5e2911ec819bdcb6a0f9c73e561c482a Mon Sep 17 00:00:00 2001 From: Kieran Harkin Date: Wed, 24 Jun 2015 10:54:56 +0100 Subject: pass full url --- static/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/upload.php b/static/upload.php index 5675eeb..4a209f3 100644 --- a/static/upload.php +++ b/static/upload.php @@ -86,7 +86,7 @@ function upload_file ($file) { return array( 'hash' => $file->get_sha1(), 'name' => $file->name, - 'url' => POMF_URL . $result['filename'], + 'url' => $result['filename'], 'size' => $file->size ); } @@ -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 { -- cgit v1.2.3 From 0b57a76fe439459524b248cabaf8a477b7dcc003 Mon Sep 17 00:00:00 2001 From: Kieran Harkin Date: Thu, 25 Jun 2015 11:23:13 +0100 Subject: Add max upload size to gruntfile --- Gruntfile.js | 1 + pages/index.swig | 2 +- pages/upload_form.swig | 2 +- 3 files changed, 3 insertions(+), 2 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/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 %}

Ohayou!

-

Max upload size is 50MiB, read the FAQ

+

Max upload size is {{max_upload_size}}MiB, read the FAQ

{% 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 @@ Select or drop file(s) - + -- cgit v1.2.3