doortts doortts 2017-07-31
favorite: Support favrorite menu shortcut key, F
@23840a636abb5be9d819f1b860de17937ec16c0f
app/assets/stylesheets/less/_usermenu.less
--- app/assets/stylesheets/less/_usermenu.less
+++ app/assets/stylesheets/less/_usermenu.less
@@ -776,5 +776,11 @@
   margin-left: 50px;
 }
 
+.shortcut-message {
+  color: white;
+  background-color: #87c98a;
+  padding: 3px 6px;
+  border-radius: 2px;
+}
 
 
app/views/common/scripts.scala.html
--- app/views/common/scripts.scala.html
+++ app/views/common/scripts.scala.html
@@ -85,7 +85,7 @@
         }
         @requestHeader.session.get("loginId") match {
             case Some(v) => { yobi.ShortcutKey.setKeymapLink({
-                "P": "@routes.UserApp.userInfo(v)"
+                "U": "@routes.UserApp.userInfo(v)"
             }); }
             case None => { }
         }
app/views/common/usermenu.scala.html
--- app/views/common/usermenu.scala.html
+++ app/views/common/usermenu.scala.html
@@ -88,7 +88,7 @@
         <li class="divider"></li>
         }
         <li class="gnb-usermenu-dropdown" id="sidebar-open-btn">
-            <a href="javascript:void(0);" class="gnb-dropdown-toggle">
+            <a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="tooltip" data-placement="bottom" title="@Messages("user.menu"), @Messages("title.shortcut") (F)">
                 <span class="avatar-wrap smaller">
                     <img src="@currentUser.avatarUrl(32)" />
                 </span>
app/views/help/keymap.scala.html
--- app/views/help/keymap.scala.html
+++ app/views/help/keymap.scala.html
@@ -1,22 +1,8 @@
 @**
-* Yobi, Project Hosting SW
+* Yona, 21st Century Project Hosting SW
 *
-* Copyright 2013 NAVER Corp.
-* http://yobi.io
-*
-* @author JiHan Kim
-*
-* 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
 **@
 @(section:String, project:Project)(implicit request: play.api.mvc.RequestHeader)
 
@@ -50,7 +36,7 @@
 
                 @if(project != null ) {
                     @if(project.vcs.equals("GIT")){
-                        <span class="ybtn ybtn-small">F</span>
+                        <span class="ybtn ybtn-small">P</span>
                         <span class="help-inline">@Messages("menu.pullRequest")</span><br>
                     }
                 }
@@ -103,9 +89,12 @@
                     <div class="span7">
                         <h5>@Messages("site")</h5>
 
-                        <span class="ybtn ybtn-small">P</span>
+                        <span class="ybtn ybtn-small">U</span>
                         <span class="help-inline">@Messages("userinfo.profile")</span><br>
 
+                        <span class="ybtn ybtn-small">F</span>
+                        <span class="help-inline">@Messages("user.menu")</span><br>
+
                         @if(isMac){
                         <span class="ybtn ybtn-small">CTRL</span> +
                         }
app/views/projectMenu.scala.html
--- app/views/projectMenu.scala.html
+++ app/views/projectMenu.scala.html
@@ -143,7 +143,7 @@
             ,"M": "@routes.MilestoneApp.milestones(project.owner, project.name)"
         }
         @if(menuSetting.pullRequest && project.vcs.equals("GIT")){
-           ,"F": "@getPullRequestURL(project)"
+           ,"P": "@getPullRequestURL(project)"
         }
         @requestHeader.session.get("loginId") match {
             case Some(role) if role.equals("manager") => { "Q": "@routes.ProjectApp.settingForm(project.owner, project.name)" }
conf/messages
--- conf/messages
+++ conf/messages
@@ -934,6 +934,7 @@
 title.search = Search
 title.searchByKeyword = Search by keyword
 title.sendMail = Send email
+title.shortcut = Shortcut
 title.signup = Sign up
 title.signupFor = Sign up for <span class="highlight">{0}</span>
 title.signupConfirmDesc = It is required admission of admin for activation.
@@ -982,6 +983,7 @@
 user.loginId.duplicate = Same log in ID already exists.
 user.loginWithNewPassword = Please log in with new password!
 user.logout.success = You have logged out successfully
+user.menu = User menu
 user.name = Name
 user.newPassword = New password
 user.notExists.name = User not exists
conf/messages.ko-KR
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
@@ -926,6 +926,7 @@
 title.search = 검색
 title.searchByKeyword = 키워드로 검색
 title.sendMail = 메일 발송
+title.shortcut = 단축키
 title.signup = 멤버 가입
 title.signupFor = <span class="highlight">{0}</span> 멤버 가입
 title.signupConfirmDesc = 가입 후 사용을 위해서는 관리자의 승인이 필요합니다
@@ -974,6 +975,7 @@
 user.loginId.duplicate = 이미 존재하는 아이디입니다.
 user.loginWithNewPassword = 새로 설정한 비밀번호로 로그인 하세요
 user.logout.success = 로그아웃했습니다
+user.menu = 사용자 메뉴
 user.name = 이름
 user.newPassword = 신규 비밀번호
 user.notExists.name = 존재하지 않는 사용자입니다.
public/javascripts/common/yona.Usermenu.js
--- public/javascripts/common/yona.Usermenu.js
+++ public/javascripts/common/yona.Usermenu.js
@@ -16,6 +16,19 @@
         var PIXEL_CRITERIA_FOR_SMALL_DEVICE = 720;  // Criteria to distinguish small devices
         var SIDE_BAR_DEFAULT_WIDTH = "420px";
 
+      $(document).on("keypress", function openFavoriteMenuWithShortcutKey(event) {
+        if (isShortcutKeyPressed(event)) {
+          event.preventDefault();
+          openSidebar($sidebar);
+          updateStar();
+        }
+      });
+
+      function isShortcutKeyPressed(event) {
+        return (event.which === 102 || event.which === 12601)     // keycode => 102: f, 12623: ㄹ
+            && $(':focus').length === 0;                        // avoid already somewhere focused state
+      }
+
         $("#main").on("click", function(event){
             if( $sidebar.width() !== 0 && $(event.target).parents("#mySidenav").length == 0) {
                 closeSidebar($sidebar);
@@ -86,6 +99,7 @@
         }).on("keydown.moveCursorFromInputform", function(e) {
             switch (e.keyCode) {
                 case 27:   // ESC
+                    $('.project-search').blur();
                     closeSidebar($sidebar);
                     break;
                 default:
Add a comment
List