This website works better with JavaScript.
Home
Help
Sign In
LILiK
/
icfp2015
Watch
5
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
added local json input
visualizer
edoardoo
9 years ago
parent
758568c033
commit
07869652b2
4 changed files
with
29 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-0
public/index.html
+6
-0
public/scripts/functions.js
+16
-0
public/style/style.less
+6
-0
server.js
+ 1
- 0
public/index.html
View File
@ -19,6 +19,7 @@
<
button
onclick
=
"toggleLeaderBoard()"
>
LeaderBoard
<
/
button
>
<
section
id
=
"listBoard"
>
Loading...
<
/
section
>
<
/
div
>
<
div
class
=
"bottomRight"
>
<
input
placeholder
=
"Paste Json, visible only locally."
type
=
"text"
id
=
"sendHCJson"
>
<
button
onclick
=
"sendJson()"
>
Send
<
/
button
>
<
/
div
>
<
section
id
=
"honeyComb"
>
<
/
section
>
+ 6
- 0
public/scripts/functions.js
View File
@ -253,6 +253,12 @@ function ringTheBell(){
document
.
onkeydown
=
checkKey
;
function
sendJson
(
)
{
// console.log("sending mama some json.")
// socket.emit("jsonToParse", document.getElementById("sendHCJson").value);
populateHoneycomb
(
JSON
.
parse
(
document
.
getElementById
(
"sendHCJson"
)
.
value
)
,
0
)
;
}
function
checkKey
(
e
)
{
e
=
e
||
window
.
event
;
+ 16
- 0
public/style/style.less
View File
@ -26,6 +26,22 @@ audio{
-webkit-transition: all .5s ease-in-out; /* Android 2.1+, Chrome 1-25, iOS 3.2-6.1, Safari 3.2-6 */
transition: all .5s ease-in-out;
}
.bottomRight{
position: fixed;
right: 0;
bottom: 0;
z-index: 9999;
background: #666;
padding: 10px;
button{
margin-left: 10px;
margin-right: 10px;
}
input{
min-width: 200px;
}
}
#controlBar{
position: fixed;
top: 0;
+ 6
- 0
server.js
View File
@ -67,5 +67,11 @@ io.sockets.on('connection', function(socket){
console
.
log
(
'Live interface connected.'
)
;
}
}
)
;
socket
.
on
(
'jsonToParse'
,
function
(
msg
)
{
if
(
msg
==
"true"
)
{
console
.
log
(
'Json received.'
)
;
socket
.
emit
(
"jsonHoneycomb"
,
msg
)
;
}
}
)
;
}
)
;
Write
Preview
Loading…
Cancel
Save