From ab8055b5cab2523d925f59c65bc38df103a26991 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 2 Dec 2020 15:02:12 -0500 Subject: deleted old apps and media --- app/photos/static/image-preview.js | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 app/photos/static/image-preview.js (limited to 'app/photos/static/image-preview.js') diff --git a/app/photos/static/image-preview.js b/app/photos/static/image-preview.js deleted file mode 100644 index b8fead5..0000000 --- a/app/photos/static/image-preview.js +++ /dev/null @@ -1,42 +0,0 @@ -function build_image_preview () { - var url = window.location.href - var cur = url.split('/')[6]; - if (cur) { - var container = document.createElement("div"); - container.className = "form-row field-image"; - var wrapper = document.createElement("div"); - var label = document.createElement("label"); - label.textContent = "Image:"; - var pwrap = document.createElement("p"); - var img = document.createElement("img"); - - var request = new XMLHttpRequest(); - request.open('GET', '/photos/luximage/data/admin/preview/'+cur+'/', true); - request.onload = function() { - if (request.status >= 200 && request.status < 400) { - var data = JSON.parse(request.responseText); - //console.log(data); - img.src = data['url']; - } else { - console.log("server error"); - } - }; - request.onerror = function() { - console.log("error on request"); - }; - request.send(); - pwrap.appendChild(img); - wrapper.appendChild(label); - wrapper.appendChild(pwrap); - container.appendChild(wrapper); - parent = document.getElementById("luximage_form"); - node = parent.children[1].children[0]; - node.parentNode.insertBefore(container, node.previousSibling); - } else { - return; - } -} - -document.addEventListener("DOMContentLoaded", function(event) { - build_image_preview(); -}); -- cgit v1.2.3-70-g09d2