Skip to content

Commit

Permalink
move sounds into own file
Browse files Browse the repository at this point in the history
  • Loading branch information
novas0x2a committed Jan 13, 2010
1 parent 1df3971 commit 85c15e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
30 changes: 1 addition & 29 deletions main.html
Expand Up @@ -4,37 +4,9 @@
<link type="text/css" rel="stylesheet" href="http://www.dustball.com/dojo/kiosk.css" />
<meta http-equiv="refresh" content="180" />
<script type="text/javascript" language="javascript" src="/static/niftyplayer.js"></script>
<script type="text/javascript" src="/static/sounds.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<title>Hacker Dojo Kiosk</title>
<script type="text/javascript" charset="utf-8">
function showmsg(m) {
msgbox = document.getElementById("msg");
msgbox.style.display="block";
msgbox.innerHTML = m;
setTimeout('msgbox.style.display="none";',10000);
}

function playsound(file) {
$('body').append('\<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">\<param name=movie value="/static/niftyplayer.swf?file='+file+'&as=1">\<param name=quality value=high>\<param name=bgcolor value=#FFFFFF>\<embed src="/static/niftyplayer.swf?file='+file+'&as=1" quality=high bgcolor=#FFFFFF width="0" height="0" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">\<\/embed>\<\/object>');
setTimeout(function(){ $("#niftyPlayer1").remove(); }, 4000);
}

function gotMsg(msg) {
msg = eval("(" + msg + ")");
if (msg["say"] != null) {
playsound("http://chapaai.adamsmith.as:8999/speech?text="+msg["say"]);
}
if (msg["text"] != null) {
showmsg(msg["text"]);
}
document.getElementById("staff").src = document.getElementById("staff").src;
waitForMsg();
}
function waitForMsg(){ $('body').append('\<script type="text/javascript" src="http://live.readyinrealtime.com/hackerdojo-signin?callback=gotMsg">\<\/script>'); }
$(document).ready(function(){
setTimeout(waitForMsg, 4000);
});
</script>
</head>
<body>

Expand Down
29 changes: 29 additions & 0 deletions static/sounds.js
@@ -0,0 +1,29 @@
function showmsg(m) {
msgbox = document.getElementById("msg");
msgbox.style.display="block";
msgbox.innerHTML = m;
setTimeout('msgbox.style.display="none";',10000);
}

function playsound(file) {
$('body').append('\<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">\<param name=movie value="/static/niftyplayer.swf?file='+file+'&as=1">\<param name=quality value=high>\<param name=bgcolor value=#FFFFFF>\<embed src="/static/niftyplayer.swf?file='+file+'&as=1" quality=high bgcolor=#FFFFFF width="0" height="0" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">\<\/embed>\<\/object>');
setTimeout(function(){ $("#niftyPlayer1").remove(); }, 4000);
}

function gotMsg(msg) {
msg = eval("(" + msg + ")");
if (msg["say"] != null) {
playsound("http://chapaai.adamsmith.as:8999/speech?text="+msg["say"]);
}
if (msg["text"] != null) {
showmsg(msg["text"]);
}
document.getElementById("staff").src = document.getElementById("staff").src;
waitForMsg();
}

function waitForMsg(){ $('body').append('\<script type="text/javascript" src="http://live.readyinrealtime.com/hackerdojo-signin?callback=gotMsg">\<\/script>'); }

$(document).ready(function(){
setTimeout(waitForMsg, 4000);
});

0 comments on commit 85c15e2

Please sign in to comment.