[Notice] Announcing the End of Demo Server [Read me]
doortts doortts 2018-10-24
mention: Colorize mention link
@a40084e25f33f34f5312ac01c6b92357c43d9053
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -3072,14 +3072,14 @@
             &.mentioned {
                 .media-body {
                     &:before {
-                        background-color: #C5EBFD;
+                        background-color: #e1f5fe;
                         border-color: #56C5F7;
                     }
                     border: 1px solid #56C5F7;
                 }
 
                 .meta-info {
-                    background-color: #C5EBFD;
+                    background-color: #e1f5fe;
                 }
             }
 
@@ -6652,7 +6652,8 @@
     color: white;
 
     &.me {
-        background-color: #4FC3F7;
+        background-color: #BA68C8;
+        border: 1px solid #BA68C8;
     }
 
     &:hover {
@@ -6666,6 +6667,29 @@
     }
 }
 
+.project-link, .org-link {
+    -webkit-font-smoothing: antialiased;
+    -webkit-text-size-adjust: 100%;
+    -webkit-font-feature-settings: "kern" 1;
+    -moz-font-feature-settings: "kern" 1;
+    -o-font-feature-settings: "kern" 1;
+    font-feature-settings: "kern" 1;
+    font-kerning: normal;
+    border: 1px solid #9741ff;
+    border-radius: 3px;
+    margin-right: 3px;
+    padding-left: 2px;
+    padding-right: 2px;
+    background-color: #9741ff;
+    font-weight: 600;
+    color: white;
+
+    &:hover {
+        color: white;
+        background-color: #9741ff !important;
+    }
+}
+
 .ago-date {
   vertical-align: middle;
 }
app/utils/AutoLinkRenderer.java
--- app/utils/AutoLinkRenderer.java
+++ app/utils/AutoLinkRenderer.java
@@ -305,7 +305,7 @@
         Organization org = Organization.findByName(userId);
 
         if(org != null) {
-            return new Link(RouteUtil.getUrl(org), "@" + org.name);
+            return new Link(RouteUtil.getUrl(org), "<span class='org-link'>@" + org.name + "</span>");
         }
 
         if (user.isAnonymous() ) {
@@ -333,7 +333,7 @@
         Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
 
         if (project != null) {
-            return new Link(RouteUtil.getUrl(project), "@" + project.toString());
+            return new Link(RouteUtil.getUrl(project), "<span class='project-link'>@" + project.toString() + "</span>");
         } else {
             return Link.EMPTY_LINK;
         }
app/views/board/view.scala.html
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
@@ -251,6 +251,7 @@
 
             // detect comment which contains mention at me
             $(".comment-body:contains('@UserApp.currentUser().getPureNameOnly')").closest(".comment").addClass("mentioned");
+            $(".user-link:contains('@UserApp.currentUser().getPureNameOnly')").addClass("me");
 
             $('#translate').one('click', function (e) {
                 var data = {
app/views/git/view.scala.html
--- app/views/git/view.scala.html
+++ app/views/git/view.scala.html
@@ -1,22 +1,8 @@
 @**
-* Yobi, Project Hosting SW
+* Yona, 21st Century Project Hosting SW
 *
-* Copyright 2013 NAVER Corp.
-* http://yobi.io
-*
-* @author Keesun Baik
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "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.
+* Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
+* https://yona.io
 **@
 @(project: Project, pull: PullRequest, canDeleteBranch: Boolean, canRestoreBranch: Boolean)
 
@@ -144,6 +130,10 @@
         $("button.moreBtn").on("click", function(){
             $(this).next("pre.commitMsg.desc").toggleClass("hidden");
         });
+
+        // detect comment which contains mention at me
+        $(".comment-body:contains('@UserApp.currentUser().getPureNameOnly')").closest(".comment").addClass("mentioned");
+        $(".user-link:contains('@UserApp.currentUser().getPureNameOnly')").addClass("me");
     });
 </script>
 }
app/views/issue/view.scala.html
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
@@ -500,6 +500,7 @@
 
         // detect comment which contains mention at me
         $(".comment-body:contains('@UserApp.currentUser().getPureNameOnly')").closest(".comment").addClass("mentioned");
+        $(".user-link:contains('@UserApp.currentUser().getPureNameOnly')").addClass("me");
     });
 
         $(function () {
app/views/milestone/view.scala.html
--- app/views/milestone/view.scala.html
+++ app/views/milestone/view.scala.html
@@ -1,24 +1,10 @@
 @**
-* Yobi, Project Hosting SW
+* Yona, 21st Century Project Hosting SW
 *
-* Copyright 2013 NAVER Corp.
-* http://yobi.io
-*
-* @author Keesun Baik
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "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.
+* Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
+* https://yona.io
 **@
-@(title: String, milestone: models.Milestone, project: Project, issueState:State)
+@(title: String, milestone: Milestone, project: Project, issueState:State)
 @import scala.collection.immutable._
 @import org.apache.commons.lang.StringUtils
 @import utils.TemplateHelper._
@@ -155,6 +141,9 @@
             "sMilestoneId" : "@milestone.id",
             "sURLLabels"   : "@routes.IssueApp.issues(project.owner, project.name)"
         });
+
+        // detect links contains mention at me
+        $(".user-link:contains('@UserApp.currentUser().getPureNameOnly')").addClass("me");
     });
 </script>
 }
Add a comment
List