decklist.ejs
10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HearthCompare - 하스스톤 도우미</title>
<!-- 부트스트랩 -->
<link href="../../static/bootstrap-3.3.2-dist/css/bootstrap.min.css?ver=1" rel="stylesheet">
<link href="../../static/main.css" rel="stylesheet">
<!-- IE8 에서 HTML5 요소와 미디어 쿼리를 위한 HTML5 shim 와 Respond.js -->
<!-- WARNING: Respond.js 는 당신이 file:// 을 통해 페이지를 볼 때는 동작하지 않습니다. -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#logoutButton').click(function(){
$.ajax({
type:'POST',
url:'/logout',
success:function(result){
alert('로그아웃에 성공하였습니다.\n로그인 화면으로 이동합니다.')
window.location.href='/'
},
error:function(result){
alert('로그아웃에 실패하였습니다.')
return false
}
})
})
$('#value_1').click(function () {
let obj = new Object()
obj.value = $('#value_1').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
$('#value_2').click(function () {
let obj = new Object()
obj.value = $('#value_2').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
$('#value_3').click(function () {
let obj = new Object()
obj.value = $('#value_3').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
$('#value_4').click(function () {
let obj = new Object()
obj.value = $('#value_4').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
$('#value_5').click(function () {
let obj = new Object()
obj.value = $('#value_5').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
$('#value_6').click(function () {
let obj = new Object()
obj.value = $('#value_6').val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname1',
data:stringData,
async:false,
dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
/*for ( var i=0;i<decks.length;i++) {
$('#value_'+(i+1)).click(function () {
let obj = new Object()
obj.value = $('#value_' + (i+1)).val()
const stringData = JSON.stringify(obj)
$.ajax({
type:'POST',
url:'/api/deck/getdeckname',
data:stringData,
async:false,
//dataType:'JSON',
contentType:'application/json; charset=utf-8',
traditional:true,
processdata:false,
success:function(result){
alert('검색 성공')
window.location.href='/prob_result'
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
})
})
}*/
})
</script>
</head>
<body>
<nav class="navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" aria-expanded="false" aria-controls="navbar" type="button" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/menulist">HearthCompare</a>
</div>
<div class="navbar-collapse collapse" id="navbar" aria-expanded="false" style="height: 1px;">
<ul class="nav navbar-nav">
</ul>
<div class="navbar-right">
<input type="button" class="btn navbar-btn" id="logoutButton" style="color:#000;" value="로그아웃" />
</div>
</div>
</div>
</nav>
<div class="container show-grid" >
<div class="padding" style="width:100px"></div>
<div class="container" style="width:50%;">
<div class="row">
<h3 class="form-signin-heading col-md-10" style="text-align: left;">내 덱 리스트</h3>
<a href="/newdeck"><input type="button" class="btn col-md-2" value="+" style="margin-left: 345px;" /></a>
</div>
<br>
<table class="table" style="width:100%">
<% for ( var i=0;i<decks.length;i++) { %>
<tr id="rm<%=(i+1)%>">
<td><input type=button style="text-align: center; width:100%; height:42px" id ="value_<%= (i+1)%>" value ="<%= decks[i].deckTitle %>"></input></td>
</tr>
<% } %>
</table>
</div>
<br><br><br><br><br><br><br><br><br><br>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<a href="/menulist"><input class="btn btn-lg btn-primary btn-block" type="button" id="backToMenuList" value="메뉴 선택으로 돌아가기" /></a>
</div>
</div>
</div>
<!-- jQuery (부트스트랩의 자바스크립트 플러그인을 위해 필요합니다) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- 모든 컴파일된 플러그인을 포함합니다 (아래), 원하지 않는다면 필요한 각각의 파일을 포함하세요 -->
<script src="../../static/bootstrap-3.3.2-dist/js/bootstrap.min.js"></script>
</body>
</html>