From 46aed7047cf627293459db58a0d418064f271b33 Mon Sep 17 00:00:00 2001 From: jeb228 Date: Wed, 14 Jul 2010 13:45:35 +0000 Subject: [PATCH] NIHVIVO-772 entityBasic.jsp will use imageUploadUtils.js instead of confirmPhotoDeletion.js. Modify PropertyEditLinks.java so only the thumbnail delete link will have the "thumbnail" class. --- .../webapp/web/jsptags/PropertyEditLinks.java | 18 +++++++----------- .../web/js/imageUpload/confirmPhotoDeletion.js | 9 --------- webapp/web/templates/entity/entityBasic.jsp | 2 +- 3 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 webapp/web/js/imageUpload/confirmPhotoDeletion.js diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/jsptags/PropertyEditLinks.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/jsptags/PropertyEditLinks.java index c11099652..35709659d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/jsptags/PropertyEditLinks.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/jsptags/PropertyEditLinks.java @@ -673,8 +673,12 @@ public class PropertyEditLinks extends TagSupport{ this.text = text; } + // Only a "delete" link gets the "thumbnail" class. + // TODO Make this cleaner. public String makeElement() { - String element = ""; element += text; element += "\n"; @@ -687,16 +691,8 @@ public class PropertyEditLinks extends TagSupport{ private LinkStruct getImageLink(String subjectUri, String contextPath, String action, String mouseOverText, String text) { ImageLinkStruct ls = new ImageLinkStruct(); - String url; - if (action == "delete") { - url = "javascript:delete_photo('" - + makeRelativeHref(contextPath + "uploadImages", - "entityUri", subjectUri, "action", action) + "')"; - } else { - url = makeRelativeHref(contextPath + "uploadImages", "entityUri", - subjectUri, "action", action); - } - ls.setHref(url); + ls.setHref(makeRelativeHref(contextPath + "uploadImages", "entityUri", + subjectUri, "action", action)); ls.setType(action); ls.setMouseoverText(mouseOverText); ls.setText(text); diff --git a/webapp/web/js/imageUpload/confirmPhotoDeletion.js b/webapp/web/js/imageUpload/confirmPhotoDeletion.js deleted file mode 100644 index c8cee74d5..000000000 --- a/webapp/web/js/imageUpload/confirmPhotoDeletion.js +++ /dev/null @@ -1,9 +0,0 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - - -function delete_photo(passUrl) { - var delete_photo_answer = confirm ("Are you sure you want to delete your photo?"); - if (delete_photo_answer){ - window.open(passUrl); - } -} diff --git a/webapp/web/templates/entity/entityBasic.jsp b/webapp/web/templates/entity/entityBasic.jsp index 7cd191529..bdaf0219a 100644 --- a/webapp/web/templates/entity/entityBasic.jsp +++ b/webapp/web/templates/entity/entityBasic.jsp @@ -311,6 +311,6 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L - +