From 6baf87cee57dd8fd13db07901d5404126ed52f0e Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Mon, 7 Jan 2002 07:30:26 +0000 Subject: [PATCH] needed a quick solution to target tag issues --- .../venice/ui/jsp/UtilTargetTag.java | 45 +++++++++++++++ tlds/utils-taglib.tld | 7 +++ web/format/conf/posts.jsp | 55 +++++++------------ 3 files changed, 71 insertions(+), 36 deletions(-) create mode 100644 src/com/silverwrist/venice/ui/jsp/UtilTargetTag.java diff --git a/src/com/silverwrist/venice/ui/jsp/UtilTargetTag.java b/src/com/silverwrist/venice/ui/jsp/UtilTargetTag.java new file mode 100644 index 0000000..858357e --- /dev/null +++ b/src/com/silverwrist/venice/ui/jsp/UtilTargetTag.java @@ -0,0 +1,45 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT + * WARRANTY OF ANY KIND, either express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * The Original Code is the Venice Web Communities System. + * + * The Initial Developer of the Original Code is Eric J. Bowersox , + * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are + * Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. + * + * Contributor(s): + */ +package com.silverwrist.venice.ui.jsp; + +import javax.servlet.jsp.*; +import javax.servlet.jsp.tagext.*; +import com.silverwrist.venice.ui.*; + +public class UtilTargetTag extends VeniceBodyTagSupport +{ + /*-------------------------------------------------------------------------------- + * Overrides from class BodyTagSupport + *-------------------------------------------------------------------------------- + */ + + public int doAfterBody() throws JspException + { + UtilXLinkTag xlink = (UtilXLinkTag)findAncestorWithClass(this,UtilXLinkTag.class); + if (xlink!=null) + { // set the link data + xlink.setTarget(getBodyContent().getString().trim()); + return SKIP_BODY; + + } // end if + + throw new JspTagException(" tag not nested inside a compatible tag!"); + + } // end doAfterBody + +} // end class UtilHrefTag diff --git a/tlds/utils-taglib.tld b/tlds/utils-taglib.tld index 8af189f..7d4a805 100644 --- a/tlds/utils-taglib.tld +++ b/tlds/utils-taglib.tld @@ -358,4 +358,11 @@ JSP + + target + com.silverwrist.venice.ui.jsp.UtilTargetTag + Supplies a target for the xlink tag. + JSP + + diff --git a/web/format/conf/posts.jsp b/web/format/conf/posts.jsp index 11e5e9f..4c6184b 100644 --- a/web/format/conf/posts.jsp +++ b/web/format/conf/posts.jsp @@ -272,43 +272,26 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l , <%= view.formatDate(msg.getPostDate()) %> ) + <% if (msg.hasAttachment()) { %> + + <% if (view.displayAttachmentInNewWindow(msg)) { %> + _blank + <% } // end if %> + + conf/view_attachment.js.vs?<%= base_locator %>&msg=<%= msg.getPostID() %> + + + + + (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) + + + + + (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) + + <% - if (msg.hasAttachment()) { - if (view.displayAttachmentInNewWindow(msg)) { -%> - - - conf/view_attachment.js.vs?<%= base_locator %>&msg=<%= msg.getPostID() %> - - - - - (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) - - - - - (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) - - - <% } else { %> - - - conf/view_attachment.js.vs?<%= base_locator %>&msg=<%= msg.getPostID() %> - - - - - (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) - - - - - (Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes) - - -<% - } // end if } // end if } // end if %>