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.

This commit is contained in:
jeb228 2010-07-14 13:45:35 +00:00
parent 8a299c67a0
commit 46aed7047c
3 changed files with 8 additions and 21 deletions

View file

@ -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 = "<a class=\"image thumbnail " + type + "\" href=\"" + href + "\"";
String element = "<a class=\"image "
+ ("delete".equals(type) ? "thumbnail delete" : type)
+ "\" href=\"" + href + "\"";
element += " title=\"" + mouseoverText + "\">";
element += text;
element += "</a>\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);

View file

@ -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);
}
}

View file

@ -311,6 +311,6 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
</div> <!-- content -->
<script type="text/javascript" src="/vivo/js/imageUpload/confirmPhotoDeletion.js"></script>
<script type="text/javascript" src="/vivo/js/imageUpload/imageUploadUtils.js"></script>