]> source.dussan.org Git - gitblit.git/commitdiff
Set tooltip for truncated tag and branch messages 31/31/1
authorJames Moger <james.moger@gitblit.com>
Thu, 13 Mar 2014 14:43:54 +0000 (10:43 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 13 Mar 2014 14:43:54 +0000 (10:43 -0400)
src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
src/main/java/com/gitblit/wicket/panels/LinkPanel.java
src/main/java/com/gitblit/wicket/panels/TagsPanel.java

index 28751fab2383441eb4cfc7c1adba462207de4c38..6a7873ea2f0556ac1c5152c986b543912ec3be74 100644 (file)
@@ -133,7 +133,7 @@ public class BranchesPanel extends BasePanel {
                                                CommitPage.class, WicketUtils.newObjectParameter(model.name,\r
                                                                entry.getName()));\r
                                if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
+                                       shortlog.setTooltip(shortMessage);\r
                                }\r
                                item.add(shortlog);\r
 \r
index cdcf574fe7c47439f66a6990663b5e7bfc848b04..06159ac3b641346b1bd5054be3d5299e70e3d96e 100644 (file)
@@ -113,4 +113,9 @@ public class LinkPanel extends Panel {
                c.add(new SimpleAttributeModifier("rel", "nofollow"));\r
        }\r
 \r
+       public void setTooltip(String tooltip) {\r
+               Component c = get("link");\r
+               c.add(new SimpleAttributeModifier("title", tooltip));\r
+       }\r
+\r
 }\r
index 1e06a7fcc218f296c343f72ef51419f283cd1141..9f3987bee73cd73044921b1bedaaf461a3354a8a 100644 (file)
@@ -96,9 +96,13 @@ public class TagsPanel extends BasePanel {
                                if (linkClass.equals(BlobPage.class)) {\r
                                        // Blob Tag Object\r
                                        item.add(WicketUtils.newImage("tagIcon", "file_16x16.png"));\r
-                                       item.add(new LinkPanel("tagDescription", "list", message, TagPage.class,\r
+                                       LinkPanel messageLink = new LinkPanel("tagDescription", "list", message, TagPage.class,\r
                                                        WicketUtils.newObjectParameter(repositoryName, entry.getObjectId()\r
-                                                                       .getName())));\r
+                                                                       .getName()));\r
+                                       if (!entry.getShortMessage().equals(message)) {\r
+                                               messageLink.setTooltip(entry.getShortMessage());\r
+                                       }\r
+                                       item.add(messageLink);\r
 \r
                                        Fragment fragment = new Fragment("tagLinks", "blobLinks", this);\r
                                        fragment.add(new BookmarkablePageLink<Void>("tag", TagPage.class, WicketUtils\r
@@ -118,9 +122,13 @@ public class TagsPanel extends BasePanel {
                                        // Standard Tag Object\r
                                        if (entry.isAnnotatedTag()) {\r
                                                item.add(WicketUtils.newImage("tagIcon", "tag_16x16.png"));\r
-                                               item.add(new LinkPanel("tagDescription", "list", message, TagPage.class,\r
+                                               LinkPanel messageLink = new LinkPanel("tagDescription", "list", message, TagPage.class,\r
                                                                WicketUtils.newObjectParameter(repositoryName, entry.getObjectId()\r
-                                                                               .getName())));\r
+                                                                               .getName()));\r
+                                               if (!message.equals(entry.getShortMessage())) {\r
+                                                       messageLink.setTooltip(entry.getShortMessage());\r
+                                               }\r
+                                               item.add(messageLink);\r
 \r
                                                Fragment fragment = new Fragment("tagLinks", "annotatedLinks", this);\r
                                                fragment.add(new BookmarkablePageLink<Void>("tag", TagPage.class,\r