Skip to content

Commit

Permalink
데스크탑 우클릭 이벤트 추가, 앱 리스트 및 데스크탑 설정 창 추가 Added Desktop Right Click Event…
Browse files Browse the repository at this point in the history
…, App List and Desktop Settings Windows
  • Loading branch information
Lavender204 committed Sep 15, 2018
1 parent af504d0 commit f88bdbd
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 4 deletions.
11 changes: 11 additions & 0 deletions res/ui_front/app-drawer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>App Drawer</title>
</head>
<body>
<b>Installed Apps</b>
</body>
</html>
31 changes: 31 additions & 0 deletions res/ui_front/css/context_menu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#context-menu {
list-style: none;
margin: 0px;
margin-top: 4px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 3px;
font-size: 15px;
color: #ffffff;
}

#rc-menu {
display: none;
position: fixed;
border: 1px solid green;
width: 200px;
background: #616161;
box-shadow: 3px 3px 2px #E9E9E9;
border-radius: 4px;
}

li {
padding; 3px;
padding-left: 10px;
}

#context-menu :hover {
color: white;
background: #9E9E9E;
border-radius: 2px;
}
11 changes: 11 additions & 0 deletions res/ui_front/desktop-settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>Desktop Settings</title>
</head>
<body>
<b>Desktop Settings</b>
</body>
</html>
18 changes: 16 additions & 2 deletions res/ui_front/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="./css/fixed_status_bar.css" />
<link rel="stylesheet" href="./css/background.css" />
<link rel="stylesheet" href="./css/context_menu.css" />
</head>
<body onload="startTime()">
<div id="desktop">
Expand All @@ -16,7 +18,19 @@
<div id="clock" style="float: right;"></div><br />
<div id="date" style="float: right;"></div>
</div>


<!-- Initially hidden, appears when right-click -->
<div id="rc-menu">
<ul id="context-menu">
<li>Open App Drawer</li>
<li>Open Desktop Settings</li>
</ul>
</div>

<script type="text/javascript" src="./js/clock.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<script type="text/javascript" src="./js/context_menu.js"></script>
</body>
</html>
</html>
10 changes: 8 additions & 2 deletions res/ui_front/js/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
hour = hour - 12;
}

else if (hour == 0) {
AMPM = "오전";
hour = hour + 12;
}

else if (hour == 12) {
AMPM = "오후";
}
Expand All @@ -23,7 +28,8 @@

minute = checkTime(minute);
second = checkTime(second);

month = checkTime(month);

document.getElementById('clock').innerHTML = AMPM + " " + hour + ":" + minute;
document.getElementById('date').innerHTML = year + "-" + month + "-" + date;
var t = setTimeout(startTime, 500);
Expand All @@ -35,4 +41,4 @@ function checkTime (i) {
i = "0" + i;
}
return i;
}
}
23 changes: 23 additions & 0 deletions res/ui_front/js/context_menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Right Click context menu, requires jQuery
$(document).bind("contextmenu", function(e) {
e.preventDefault();
$("#rc-menu").css("left", e.pageX);
$("#rc-menu").css("top", e.pageY);
$("#rc-menu").fadeIn(100, startFocusOut());
});

function startFocusOut() {
$(document).on("click", function() {
$("#rc-menu").hide();
$(document).off("click");
});
}

$("#context-menu > li").click(function() {
if ($(this).text() == "Open App Drawer") {
window.open("./app-drawer.html", "App List", "width=1280,height=720");
}
if ($(this).text() == "Open Desktop Settings") {
window.open("./desktop-settings.html", "Desktop Settings", "width=1280,height=720");
}
});

0 comments on commit f88bdbd

Please sign in to comment.