summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-10-29 15:32:45 -0700
committerAaron Parecki <aaron@parecki.com>2017-10-29 15:32:45 -0700
commit97ba7d0347faa84a017cacb069e7ab45fd16c8dd (patch)
tree200e3c471b65e189f3e09b6c525412c1b90de14d /views
parentffb3011eeb8620fde05c7893d2fe98d3d1ae0bb3 (diff)
query the media endpoint for the last photo uploaded
Diffstat (limited to 'views')
-rw-r--r--views/new-post.php12
1 files changed, 12 insertions, 0 deletions
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