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 %>