Index: xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/richtext/RichTextProcessor.java =================================================================== --- xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/richtext/RichTextProcessor.java (revision 25399) +++ xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/richtext/RichTextProcessor.java (working copy) @@ -15,16 +15,16 @@ */ package org.hippoecm.frontend.plugins.richtext; +import org.apache.wicket.RequestCycle; +import org.apache.wicket.ResourceReference; +import org.apache.wicket.protocol.http.WicketURLDecoder; +import org.hippoecm.frontend.plugins.xinha.services.links.ExternalXinhaLink; + import java.util.Set; import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.wicket.RequestCycle; -import org.apache.wicket.ResourceReference; -import org.apache.wicket.protocol.http.WicketURLDecoder; -import org.hippoecm.frontend.plugins.xinha.services.links.ExternalXinhaLink; - public class RichTextProcessor { @SuppressWarnings("unused") private final static String SVN_ID = "$Id$"; @@ -34,7 +34,7 @@ private static Pattern IMG_PATTERN = Pattern.compile("]+>", Pattern.CASE_INSENSITIVE); private static Pattern SRC_PATTERN = Pattern.compile("src=\"([^\"]+)\"", Pattern.CASE_INSENSITIVE); private static Pattern FACET_SELECT_PATTERN = Pattern.compile("facetselect=\"([^\"]+)\"", Pattern.CASE_INSENSITIVE); - private static Pattern FACET_SELECT_OR_SRC_PATTERN = Pattern.compile("(facetselect|src)=\"([^\"]+)\"", + private static Pattern FACET_SELECT_OR_SRC_PATTERN = Pattern.compile("(facetselect|type|src)=\"([^\"]+)\"", Pattern.CASE_INSENSITIVE); private static Pattern LINK_PATTERN = Pattern.compile("]+>", Pattern.CASE_INSENSITIVE); @@ -60,6 +60,7 @@ String link = s.group(1); if (!link.startsWith("http:") && !link.startsWith("https:")) { + String type = link.substring(link.lastIndexOf("/")+1); String url; try { url = decorator.getURL(link); @@ -71,6 +72,9 @@ newImg.append("facetselect=\""); newImg.append(link); newImg.append("\" "); + newImg.append("type=\""); + newImg.append(type); + newImg.append("\" "); } else { s.appendReplacement(newImg, src.replace("\\", "\\\\").replace("$", "\\$")); } @@ -96,16 +100,19 @@ String src = null; String facet = null; + String type = null; while (s.find()) { String srcOrFacet = s.group(); if (srcOrFacet.startsWith("src")) { src = srcOrFacet; - } else { + } else if(srcOrFacet.startsWith("facetselect")) { facet = srcOrFacet; + } else{ + type = srcOrFacet; } s.appendReplacement(newImg, ""); } - if (src != null && facet != null) { + if (src != null && facet != null && type != null) { Matcher fs = FACET_SELECT_PATTERN.matcher(facet); if (fs.find()) { fs.appendReplacement(newImg, ("src=\"" + fs.group(1) + "\"").replace("\\", "\\\\").replace("$", @@ -116,6 +123,8 @@ newImg.append(src); } else if (facet != null) { newImg.append(facet); + } else if (type != null) { + newImg.append(type); } s.appendTail(newImg); m.appendReplacement(processed, newImg.toString().replace("\\", "\\\\").replace("$", "\\$")); Index: xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.css =================================================================== --- xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.css (revision 25399) +++ xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.css (working copy) @@ -21,4 +21,19 @@ .hippo-root .upload-wrapper .upload-button-osx { position: relative; +}.hippo-dialog-type select, .hippo-dialog-align select{ + margin-top:5px; +} +.hippo-dialog-type, .hippo-dialog-align{ + float:left; + margin-right: 20px; +} +.hippo-dialog-alt{ + float:right; +} +.hippo-dialog-alt .text-input{ + float:left; +} +body .hippo-picker-properties div.hippo-dialog-alt div.text-input input { + width: 282px; } \ No newline at end of file Index: xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.html =================================================================== --- xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.html (revision 25399) +++ xinha-frontend/src/main/java/org/hippoecm/frontend/plugins/xinha/dialog/images/ImageBrowserDialog.html (working copy) @@ -28,20 +28,26 @@ - - - Align: - + + + + Align: - + [ Align dropdown ] + + + Type: + [ type dropdown ] + + + + Alternative text: + + + [Alt text box] + - - Alternative text: - - - [Alt text box] -