X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Ftemplates%2FimageBrowser.html;h=ba8220d56d4f60da93bb12f49ac2363de4b2841a;hb=f7bb19a511caebdf7fb892d4a0c5d350be08472c;hp=9bcaa9dd0809fa9662e1212a31d745cd907731a0;hpb=0df5e91852f737d760c5a9f54c5667309fbadcc2;p=Sone.git diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index 9bcaa9d..ba8220d 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -2,6 +2,28 @@
+ + <%if albumRequested> <%ifnull album> @@ -50,11 +72,33 @@ }); }); $("#edit-album label").hide(); + + hideAndShowBlock(".edit-album", ".show-edit-album", ".hide-edit-album"); + hideAndShowBlock(".create-album", ".show-create-album", ".hide-create-album"); + hideAndShowBlock(".upload-image", ".show-upload-image", ".hide-upload-image"); + hideAndShowBlock(".delete-album", ".show-delete-album", ".hide-delete-album"); + + hideAndShowData = function(activationElements, activeElements, hideElement, showElement) { + $(activationElements).click(function() { + imageId = $(this).closest(".image").find(".image-id").text(); + $(hideElement, $("#image-" + imageId)).hide(); + $(showElement, $("#image-" + imageId)).show(); + $(document).click(function(event) { + if ($(event.target).closest("#image-" + imageId).size() == 0) { + $(showElement).hide(); + $(hideElement).show(); + } + return $(event.target).is("button"); + }); + }); + }; + + hideAndShowData(".image-title, .image-description", ".image", ".show-data", ".edit-data"); }); <%/if> -<% album.description|html>
+ + <%if album.sone.local> + + +