Showing
2 changed files
with
40 additions
and
37 deletions
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | - <head> | 3 | + |
4 | +<head> | ||
4 | <title> findpage</title> | 5 | <title> findpage</title> |
5 | <link rel="stylesheet" href='/stylesheets/findPage_style.css' type="text/css"> | 6 | <link rel="stylesheet" href='/stylesheets/findPage_style.css' type="text/css"> |
6 | 7 | ||
7 | <script src="https://developers.kakao.com/sdk/js/kakao.js"></script> | 8 | <script src="https://developers.kakao.com/sdk/js/kakao.js"></script> |
8 | <script> | 9 | <script> |
9 | Kakao.init('0678e32dab56db1c52ac63ab4ccb7663') | 10 | Kakao.init('0678e32dab56db1c52ac63ab4ccb7663') |
10 | - function sendLink(id){ | 11 | + function sendLink(id) { |
11 | - var data=[]; | 12 | + var data = []; |
12 | var strData = "<%= data %>"; | 13 | var strData = "<%= data %>"; |
13 | - var splitData=strData.split(','); | 14 | + var splitData = strData.split(','); |
14 | - for(var i=0;i<splitData.length;i+=5){ | 15 | + for (var i = 0; i < splitData.length; i += 5) { |
15 | - data.push([Number(splitData[i]),splitData[i+1],Number(splitData[i+2]),Number(splitData[i+3]),splitData[i+4],splitData[i+5]]); | 16 | + data.push([Number(splitData[i]), splitData[i + 1], Number(splitData[i + 2]), Number(splitData[i + 3]), splitData[i + 4], splitData[i + 5]]); |
16 | } | 17 | } |
17 | var index; | 18 | var index; |
18 | - for(var i=0;i<data.length;i++){ | 19 | + for (var i = 0; i < data.length; i++) { |
19 | console.log(data.length); | 20 | console.log(data.length); |
20 | - if(data[i][0]===id){ | 21 | + if (data[i][0] === id) { |
21 | - index=i; | 22 | + index = i; |
22 | Kakao.Link.sendDefault({ | 23 | Kakao.Link.sendDefault({ |
23 | objectType: 'location', | 24 | objectType: 'location', |
24 | address: `${data[i][5]}`, | 25 | address: `${data[i][5]}`, |
25 | addressTitle: `${data[i][1]}`, | 26 | addressTitle: `${data[i][1]}`, |
26 | - content:{ | 27 | + content: { |
27 | title: `공연 이름: ${data[i][1]}\n공연 위치: ${data[i][5]}`, | 28 | title: `공연 이름: ${data[i][1]}\n공연 위치: ${data[i][5]}`, |
28 | - description: `${splitData[i+2]}`, | 29 | + description: `${splitData[i + 2]}`, |
29 | - imageUrl:'https://ifh.cc/g/aEvr86.png', | 30 | + imageUrl: 'https://ifh.cc/g/aEvr86.png', |
30 | - link:{ | 31 | + link: { |
31 | - mobileWebUrl: 'http://naver.com', | 32 | + mobileWebUrl: 'https://culturegallery.herokuapp.com/', |
32 | - webUrl: 'http://naver.com', | 33 | + webUrl: 'https://culturegallery.herokuapp.com/', |
33 | }, | 34 | }, |
34 | }, | 35 | }, |
35 | buttons: [ | 36 | buttons: [ |
36 | { | 37 | { |
37 | title: 'Culture Gallery', | 38 | title: 'Culture Gallery', |
38 | link: { | 39 | link: { |
39 | - mobileWebUrl: 'http://naver.com', | 40 | + mobileWebUrl: 'https://culturegallery.herokuapp.com/', |
40 | - webUrl: 'http://naver.com', | 41 | + webUrl: 'https://culturegallery.herokuapp.com/', |
41 | }, | 42 | }, |
42 | }, | 43 | }, |
43 | ], | 44 | ], |
... | @@ -47,16 +48,17 @@ | ... | @@ -47,16 +48,17 @@ |
47 | 48 | ||
48 | } | 49 | } |
49 | </script> | 50 | </script> |
50 | - </head> | 51 | +</head> |
51 | - <body> | 52 | + |
53 | +<body> | ||
52 | <h1 class='name'>공연 이름을 검색해보세요!</h1> | 54 | <h1 class='name'>공연 이름을 검색해보세요!</h1> |
53 | 55 | ||
54 | - <div class = "question"> | 56 | + <div class="question"> |
55 | <input type="text" value='' id="inputText" placeholder="어떤 공연을 찾으시나요?"> | 57 | <input type="text" value='' id="inputText" placeholder="어떤 공연을 찾으시나요?"> |
56 | <button onclick='find()'>검색</button> | 58 | <button onclick='find()'>검색</button> |
57 | </div> | 59 | </div> |
58 | </div> | 60 | </div> |
59 | - <table class="table" > | 61 | + <table class="table"> |
60 | <tr> | 62 | <tr> |
61 | <th>id</th> | 63 | <th>id</th> |
62 | <th>행사 이름</th> | 64 | <th>행사 이름</th> |
... | @@ -69,21 +71,21 @@ | ... | @@ -69,21 +71,21 @@ |
69 | </tbody> | 71 | </tbody> |
70 | </table> | 72 | </table> |
71 | 73 | ||
72 | -</div> | 74 | + </div> |
73 | <script> | 75 | <script> |
74 | - function find(){ | 76 | + function find() { |
75 | var row = ``; | 77 | var row = ``; |
76 | - var input= document.getElementById('inputText').value; | 78 | + var input = document.getElementById('inputText').value; |
77 | - var dataContainer=document.getElementById('map-data'); | 79 | + var dataContainer = document.getElementById('map-data'); |
78 | - var data=[]; | 80 | + var data = []; |
79 | var strData = "<%= data %>"; | 81 | var strData = "<%= data %>"; |
80 | - var splitData=strData.split(','); | 82 | + var splitData = strData.split(','); |
81 | - for(var i=0;i<splitData.length;i+=5){ | 83 | + for (var i = 0; i < splitData.length; i += 5) { |
82 | - data.push([Number(splitData[i]),splitData[i+1],Number(splitData[i+2]),Number(splitData[i+3]),splitData[i+4],splitData[i+5]]); | 84 | + data.push([Number(splitData[i]), splitData[i + 1], Number(splitData[i + 2]), Number(splitData[i + 3]), splitData[i + 4], splitData[i + 5]]); |
83 | } | 85 | } |
84 | 86 | ||
85 | - for(var i=0;i<data.length;i++){ | 87 | + for (var i = 0; i < data.length; i++) { |
86 | - if(data[i][1].indexOf(input)!=-1){ | 88 | + if (data[i][1].indexOf(input) != -1) { |
87 | row = `<tr> | 89 | row = `<tr> |
88 | <td> ${data[i][0]}</td> | 90 | <td> ${data[i][0]}</td> |
89 | <td> ${data[i][1]}</td> | 91 | <td> ${data[i][1]}</td> |
... | @@ -93,10 +95,11 @@ | ... | @@ -93,10 +95,11 @@ |
93 | <td> <input type="button" onclick="sendLink(${data[i][0]})" value="전송하기"> </td> | 95 | <td> <input type="button" onclick="sendLink(${data[i][0]})" value="전송하기"> </td> |
94 | 96 | ||
95 | </tr>` | 97 | </tr>` |
96 | - dataContainer.innerHTML+=row; | 98 | + dataContainer.innerHTML += row; |
97 | } | 99 | } |
98 | } | 100 | } |
99 | } | 101 | } |
100 | </script> | 102 | </script> |
101 | - </body> | 103 | +</body> |
104 | + | ||
102 | </html> | 105 | </html> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -32,16 +32,16 @@ | ... | @@ -32,16 +32,16 @@ |
32 | description: `${splitData[i + 2]}`, | 32 | description: `${splitData[i + 2]}`, |
33 | imageUrl: 'https://ifh.cc/g/aEvr86.png', | 33 | imageUrl: 'https://ifh.cc/g/aEvr86.png', |
34 | link: { | 34 | link: { |
35 | - mobileWebUrl: 'http://naver.com', | 35 | + mobileWebUrl: 'https://culturegallery.herokuapp.com/', |
36 | - webUrl: 'http://naver.com', | 36 | + webUrl: 'https://culturegallery.herokuapp.com/', |
37 | }, | 37 | }, |
38 | }, | 38 | }, |
39 | buttons: [ | 39 | buttons: [ |
40 | { | 40 | { |
41 | title: 'Culture Gallery', | 41 | title: 'Culture Gallery', |
42 | link: { | 42 | link: { |
43 | - mobileWebUrl: 'http://naver.com', | 43 | + mobileWebUrl: 'https://culturegallery.herokuapp.com/', |
44 | - webUrl: 'http://naver.com', | 44 | + webUrl: 'https://culturegallery.herokuapp.com/', |
45 | }, | 45 | }, |
46 | }, | 46 | }, |
47 | ], | 47 | ], | ... | ... |
-
Please register or login to post a comment