--- /dev/null
+/*\r
+ * Copyright 2012 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit.wicket;\r
+\r
+import org.apache.wicket.markup.ComponentTag;\r
+import org.apache.wicket.markup.html.WebComponent;\r
+import org.apache.wicket.model.Model;\r
+\r
+public class ExternalImage extends WebComponent {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ public ExternalImage(String id, String url) {\r
+ super(id, new Model<String>(url));\r
+ }\r
+\r
+ protected void onComponentTag(ComponentTag tag) {\r
+ super.onComponentTag(tag);\r
+ checkComponentTag(tag, "img");\r
+ tag.put("src", getDefaultModelObjectAsString());\r
+ }\r
+}
\ No newline at end of file
\r
import java.text.MessageFormat;\r
\r
-import org.apache.wicket.AttributeModifier;\r
import org.apache.wicket.behavior.SimpleAttributeModifier;\r
-import org.apache.wicket.markup.html.image.Image;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.link.Link;\r
import org.apache.wicket.markup.html.panel.Panel;\r
-import org.apache.wicket.model.Model;\r
import org.eclipse.jgit.lib.PersonIdent;\r
\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.ActivityUtils;\r
import com.gitblit.utils.StringUtils;\r
+import com.gitblit.wicket.ExternalImage;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.pages.GravatarProfilePage;\r
\r
WicketUtils.newObjectParameter(hash));\r
link.add(new SimpleAttributeModifier("target", "_blank"));\r
String url = ActivityUtils.getGravatarThumbnailUrl(email, width);\r
- Image image = new Image("image");\r
- image.add(new AttributeModifier("src", true, new Model<String>(url)));\r
+ ExternalImage image = new ExternalImage("image", url);\r
WicketUtils.setCssClass(image, "gravatar");\r
link.add(image);\r
WicketUtils.setHtmlTooltip(link,\r