From 97ba7d0347faa84a017cacb069e7ab45fd16c8dd Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 29 Oct 2017 15:32:45 -0700 Subject: query the media endpoint for the last photo uploaded --- views/new-post.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'views/new-post.php') diff --git a/views/new-post.php b/views/new-post.php index 726a671..7040308 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -340,6 +340,18 @@ function addNewPhoto() { } $(function(){ + // Check if there's a pending file at the media endpoint + $.getJSON("/new/last-photo.json", function(response){ + if(response.url) { + photos.push({ + url: response.url, + alt: null, + external: true + }); + refreshPhotoPreviews(); + } + }); + $("#note_photo").on("change", function(e){ // If the user has a media endpoint, upload the photo to it right now -- cgit v1.2.3