From d499a66a4e3d40630b5926b35736a62fb50cb68c Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Wed, 6 Sep 2023 15:23:11 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=B6=95=ED=82=A4=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=9E=90=EB=B0=94=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp | 4 +- .../WEB-INF/jsp/fims/cvlc/cvlc01050-info.jsp | 4 +- .../WEB-INF/jsp/fims/cvlc/cvlc02060-info.jsp | 4 +- src/main/webapp/WEB-INF/jsp/include/tail.jsp | 3 +- .../js/fims/framework/cmm/shortcutKey.js | 79 +++++++++++++++++++ 5 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 src/main/webapp/resources/js/fims/framework/cmm/shortcutKey.js diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp index 54826fa4..574ff43f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp @@ -14,8 +14,8 @@ - - + + diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01050-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01050-info.jsp index 51ec65e4..c393ab98 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01050-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01050-info.jsp @@ -73,8 +73,8 @@ diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02060-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02060-info.jsp index a4a1e7a0..b6966d07 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02060-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc02060-info.jsp @@ -16,8 +16,8 @@
- - + +
diff --git a/src/main/webapp/WEB-INF/jsp/include/tail.jsp b/src/main/webapp/WEB-INF/jsp/include/tail.jsp index 128b972f..34b80219 100644 --- a/src/main/webapp/WEB-INF/jsp/include/tail.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/tail.jsp @@ -53,7 +53,8 @@ - + + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/shortcutKey.js b/src/main/webapp/resources/js/fims/framework/cmm/shortcutKey.js new file mode 100644 index 00000000..103e8b62 --- /dev/null +++ b/src/main/webapp/resources/js/fims/framework/cmm/shortcutKey.js @@ -0,0 +1,79 @@ +document.addEventListener('keydown', (event) => { + + var RESERVED_FUNCTION_KEYS = ["F1","F2","F3","F4","F6","F7","F8","F9","F10","F11","PageDown","PageUp"]; + var KEYS_FOR_GLOBAL = ["F9","F10","F11"]; + + if(RESERVED_FUNCTION_KEYS.includes(event.key)){ + + event.preventDefault(); + + var activeBasckdropYn = isActiveBackdrop(); + + var curArea = getCurrentAreaForShortcutKey(); + + if(KEYS_FOR_GLOBAL.includes(event.key)){ //전역 기능 + + if(!activeBasckdropYn){ + //TODO : do somthing + } + + } else { //페이지별,다이얼로그별 버튼 + + if(curArea != null){ + + var targetButton = $(curArea).find("button.btn-"+event.key); + + if(targetButton.length == 1){ + targetButton.click(); + } else { + if(targetButton.length > 1){ + debug('단축키 버튼 중복 : ' + targetButton.length + "개"); + } + } + + } + + } + + return false; + } +}); + +//단축키 기능이 사용될 영역을 반환한다. +function getCurrentAreaForShortcutKey(){ + + if(isActiveBackdrop()){ + return getLastDialog(); + } else { + return getActiveRootTabArea(); + } + + return null; +} + +//현재 활성화된 최상위 탭 영역을 반환한다. +function getActiveRootTabArea(){ + return $("#innerPageTabContents").children(".active")[0]; +} + +//마지막으로 열린 다이얼로그 영역을 반환한다. +function getLastDialog(){ + return $("div.modal.show").last()[0]; +} + +//백드롭 영역 활성화 여부를 반환한다. +function isActiveBackdrop(){ + + if($("div.modal-backdrop").length < 1){ + return false; + } + + var isActiveYn = false; + $("div.modal-backdrop").each(function(){ + if($(this).hasClass("show")){ + isActiveYn = true; + }; + }); + + return isActiveYn; +}