Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B2E5200BDA for ; Tue, 13 Dec 2016 22:21:28 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 29AD0160B23; Tue, 13 Dec 2016 21:21:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 23F1D160B07 for ; Tue, 13 Dec 2016 22:21:26 +0100 (CET) Received: (qmail 63610 invoked by uid 500); 13 Dec 2016 21:21:26 -0000 Mailing-List: contact commits-help@jspwiki.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jspwiki.apache.org Delivered-To: mailing list commits@jspwiki.apache.org Received: (qmail 63601 invoked by uid 99); 13 Dec 2016 21:21:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2016 21:21:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F2940E38C2; Tue, 13 Dec 2016 21:21:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brushed@apache.org To: commits@jspwiki.apache.org Message-Id: <173c80d94f6d420b931c9fba07b325de@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: jspwiki git commit: JSPWIKI-1032: IMAGE html rendering improvs Date: Tue, 13 Dec 2016 21:21:25 +0000 (UTC) archived-at: Tue, 13 Dec 2016 21:21:28 -0000 Repository: jspwiki Updated Branches: refs/heads/master 4e7810ca8 -> 014dc6707 JSPWIKI-1032: IMAGE html rendering improvs Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/014dc670 Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/014dc670 Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/014dc670 Branch: refs/heads/master Commit: 014dc670790bc3c1e4b5d306efa2b75be2426161 Parents: 4e7810c Author: brushed Authored: Tue Dec 13 22:21:13 2016 +0100 Committer: brushed Committed: Tue Dec 13 22:21:13 2016 +0100 ---------------------------------------------------------------------- ChangeLog | 6 ++ .../src/main/java/org/apache/wiki/Release.java | 2 +- .../main/java/org/apache/wiki/plugin/Image.java | 36 +++++++----- .../java/org/apache/wiki/util/XhtmlUtil.java | 60 ++++++++++---------- .../main/styles/haddock/default/variables.less | 2 +- 5 files changed, 59 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jspwiki/blob/014dc670/ChangeLog ---------------------------------------------------------------------- diff --git a/ChangeLog b/ChangeLog index 1c16582..6b998e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2016-12-13 Dirk Frederickx (brushed AT apache DOT org) + * 2.10.3-svn-19 + + * JSPWIKI-1032 : Use image "src" attribute instead of "href" + +2016-12-13 Dirk Frederickx (brushed AT apache DOT org) + * 2.10.3-svn-18 * [JSPWIKI-1037] UI will not display with IE 9 or IE10. http://git-wip-us.apache.org/repos/asf/jspwiki/blob/014dc670/jspwiki-war/src/main/java/org/apache/wiki/Release.java ---------------------------------------------------------------------- diff --git a/jspwiki-war/src/main/java/org/apache/wiki/Release.java b/jspwiki-war/src/main/java/org/apache/wiki/Release.java index 25f3842..5b3584d 100644 --- a/jspwiki-war/src/main/java/org/apache/wiki/Release.java +++ b/jspwiki-war/src/main/java/org/apache/wiki/Release.java @@ -72,7 +72,7 @@ public final class Release { *

* If the build identifier is empty, it is not added. */ - public static final String BUILD = "18"; + public static final String BUILD = "19"; /** * This is the generic version string you should use when printing out the version. It is of http://git-wip-us.apache.org/repos/asf/jspwiki/blob/014dc670/jspwiki-war/src/main/java/org/apache/wiki/plugin/Image.java ---------------------------------------------------------------------- diff --git a/jspwiki-war/src/main/java/org/apache/wiki/plugin/Image.java b/jspwiki-war/src/main/java/org/apache/wiki/plugin/Image.java index b6dc0be..5ee799a 100644 --- a/jspwiki-war/src/main/java/org/apache/wiki/plugin/Image.java +++ b/jspwiki-war/src/main/java/org/apache/wiki/plugin/Image.java @@ -1,4 +1,4 @@ -/* +/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. */ package org.apache.wiki.plugin; @@ -46,8 +46,9 @@ import org.apache.wiki.util.TextUtil; *

  • style - the style attribute of the image
  • *
  • class - the associated class for the image
  • *
  • border - the border for the image
  • + *
  • title - the title for the image, can be presented as a tooltip to the user
  • * - * + * * @since 2.1.4. */ // FIXME: It is not yet possible to do wiki internal links. In order to @@ -79,6 +80,8 @@ public class Image // public static final String PARAM_MAP = "map"; /** The parameter name for setting the border. Value is {@value}. */ public static final String PARAM_BORDER = "border"; + /** The parameter name for setting the title. Value is {@value}. */ + public static final String PARAM_TITLE = "title"; /** * This method is used to clean away things like quotation marks which @@ -108,6 +111,7 @@ public class Image String cssclass= getCleanParameter( params, PARAM_CLASS ); // String map = getCleanParameter( params, PARAM_MAP ); String border = getCleanParameter( params, PARAM_BORDER ); + String title = getCleanParameter( params, PARAM_TITLE ); if( src == null ) { @@ -141,42 +145,44 @@ public class Image result.append( "\n" ); - if( caption != null ) + if( caption != null ) { result.append("\n"); } result.append( " instead of
    "+TextUtil.replaceEntities(caption)+"
    " ); - - if( link != null ) + + if( link != null ) { result.append(" 0 ) // check [a-zA-z] { char c = s.charAt(0); http://git-wip-us.apache.org/repos/asf/jspwiki/blob/014dc670/jspwiki-war/src/main/java/org/apache/wiki/util/XhtmlUtil.java ---------------------------------------------------------------------- diff --git a/jspwiki-war/src/main/java/org/apache/wiki/util/XhtmlUtil.java b/jspwiki-war/src/main/java/org/apache/wiki/util/XhtmlUtil.java index a44acba..d8e96cf 100644 --- a/jspwiki-war/src/main/java/org/apache/wiki/util/XhtmlUtil.java +++ b/jspwiki-war/src/main/java/org/apache/wiki/util/XhtmlUtil.java @@ -1,4 +1,4 @@ -/* +/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. */ package org.apache.wiki.util; @@ -30,7 +30,7 @@ import org.jdom2.output.XMLOutputter; *

    * This uses JDOM2 as its backing implementation. *

    - * + * *

    Example

    *

    * To generate a single element, an Element with PCDATA content, and then @@ -52,26 +52,26 @@ import org.jdom2.output.XMLOutputter; * @since 2.10 */ public final class XhtmlUtil { - + private XhtmlUtil() {} - + /** to print

    */ public static final Format EXPAND_EMPTY_NODES = Format.getCompactFormat().setExpandEmptyElements( true ); - + /** * Serializes the Element to a String using a compact serialization format. - * + * * @param element the element to serialize. * @return the serialized Element. */ - public static String serialize( Element element ) { + public static String serialize( Element element ) { return serialize( element, false ); } /** * Serializes the Element to a String. If pretty is true, * uses a pretty whitespace format, otherwise a compact format. - * + * * @param element the element to serialize. * @param pretty if true, use a pretty whitespace format. * @return the serialized Element. @@ -82,7 +82,7 @@ public final class XhtmlUtil { /** * Serializes the Element to a String. Allows to use a custom format. - * + * * @param element the element to serialize. * @param format custom format used to serialize the Element. * @return the serialized Element. @@ -91,10 +91,10 @@ public final class XhtmlUtil { XMLOutputter out = new XMLOutputter( format ); return out.outputString( element ); } - + /** * Return an Element with an element type name matching the parameter. - * + * * @param element the XHTML element type. * @return a JDOM2 Element. */ @@ -105,7 +105,7 @@ public final class XhtmlUtil { /** * Return an Element with an element type name matching the parameter, * and optional PCDATA (parsed character data, a String) content. - * + * * @param element the XHTML element type. * @param content the optional PCDATA content. * @return a JDOM2 Element. @@ -120,7 +120,7 @@ public final class XhtmlUtil { /** * Return an XHTML link with a required 'href' attribute value and optional link (PCDATA) content. - * + * * @param href the required 'href' value. * @param content the optional link (PCDATA) content. * @return a JDOM2 Element. @@ -131,10 +131,10 @@ public final class XhtmlUtil { } return fLink(href,content,null); } - + /** * Return an XHTML link target with a required 'id' attribute value. - * + * * @param id the required 'id' link target value. * @return a JDOM2 Element. */ @@ -144,11 +144,11 @@ public final class XhtmlUtil { } return fLink( null, content, id ); } - + /** * Return an XHTML link with an optional 'href' attribute, optional * link content, and optional 'id' link target value. - * + * * @param href the optional 'href' value. * @param content the optional link (PCDATA) content. * @param id the optional 'id' link target value. @@ -158,20 +158,20 @@ public final class XhtmlUtil { Element a = element( XHTML.a ); if( href != null ) { a.setAttribute( XHTML.ATTR_href, href ); - } + } if( content != null ) { a.addContent( content ); } if( id != null ) { - a.setAttribute( XHTML.ATTR_id, id ); + a.setAttribute( XHTML.ATTR_id, id ); } return a; } - + /** * Return an XHTML img element with an required 'src' attribute * and optional 'alt' alternative text value. - * + * * @param src the required 'src' value. * @param alt the optional 'alt' alternative text value. * @return a JDOM2 Element. @@ -181,16 +181,16 @@ public final class XhtmlUtil { if( src == null ) { throw new IllegalArgumentException( "missing 'src' attribute value." ); } - img.setAttribute( XHTML.ATTR_href, src ); + img.setAttribute( XHTML.ATTR_src, src ); if( alt != null ) { - img.setAttribute( XHTML.ATTR_alt, alt ); + img.setAttribute( XHTML.ATTR_alt, alt ); } return img; } - + /** * Return an XHTML form input element with optional 'type', 'name' and 'value' attributes. - * + * * @param type the optional 'type' value. * @param name the optional 'name' value. * @param value the optional 'value' value. @@ -202,19 +202,19 @@ public final class XhtmlUtil { input.setAttribute( XHTML.ATTR_type, type ); } if( name != null ) { - input.setAttribute( XHTML.ATTR_name, name ); + input.setAttribute( XHTML.ATTR_name, name ); } if( value != null ) { - input.setAttribute( XHTML.ATTR_value, value ); + input.setAttribute( XHTML.ATTR_value, value ); } return input; } - + public static void setClass( Element element, String classValue ) { if( classValue == null ) { throw new IllegalArgumentException( "missing 'class' attribute value." ); } element.setAttribute( XHTML.ATTR_class, classValue ); } - + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jspwiki/blob/014dc670/jspwiki-war/src/main/styles/haddock/default/variables.less ---------------------------------------------------------------------- diff --git a/jspwiki-war/src/main/styles/haddock/default/variables.less b/jspwiki-war/src/main/styles/haddock/default/variables.less index cd6c123..a76bdea 100644 --- a/jspwiki-war/src/main/styles/haddock/default/variables.less +++ b/jspwiki-war/src/main/styles/haddock/default/variables.less @@ -161,7 +161,7 @@ images/feather-small.png wxh 162x286 @carousel-progress-size: 2px; // Category -@wiki-category-link-color: #545454; +@wiki-category-link-color: @state-info-bg; //#545454; //Editor @wiki-editor-bg : @white;