Skip to content

Commit

Permalink
Initial creation of repository
Browse files Browse the repository at this point in the history
  • Loading branch information
max-radin committed Jan 16, 2015
1 parent f2da0fb commit 9a6ae2d
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
84 changes: 84 additions & 0 deletions soundboard.xml
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License
-->
<ModulePrefs title="Hangout Soundboard">
<Require feature="rpc" />
<Require feature="views" />
<Require feature="locked-domain" />
</ModulePrefs>
<Content type="html"><![CDATA[
<html>
<style type="text/css">
<!--
.button {
border-radius: 3px;
-moz-border-radius: 3px;
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd));
background: -moz-linear-gradient(top, #fff, #ddd);
border: 1px solid #bbb;
}
.button:active {
background: -webkit-gradient(linear, left top, left bottom, from(#aaa), to(#333));
background: -moz-linear-gradient(bottom, #ddd, #aaa); }
-->
</style>
<body>
<script src="//plus.google.com/hangouts/_/api/v1/hangout.js"></script>
<h3>Hangout Soundboard</h3>
<hr>
<div id="buttonsDiv"></div>
<script>
var retVal = '<p>';
soundNames = ["Roar","Bear","Lightning","Spell 1","Spell 2","Mystic aura","Turn down"];
for (i = 0; i < soundNames.length; i++) {
retVal += '<input class="button" type="button" value="' + soundNames[i] + '" id="' + soundNames[i] + '" ';
retVal += 'onClick="playSound(' + i + ')"/>'
retVal += '<br><br>';
}
retVal += '</p>'
var div = document.getElementById('buttonsDiv');
div.innerHTML = retVal;
sounds = []
for (i = 0; i < soundNames.length; i++) {
myURL = "http://www.maxradin.com/soundboard/sounds/" + soundNames[i] + ".wav";
sounds.push(gapi.hangout.av.effects.createAudioResource(
myURL).createSound({loop: false, localOnly: false}));
}
function playSound(i) {
sounds[i].play();
}
function init() {
// When API is ready...
}
// Wait for gadget to load.
gadgets.util.registerOnLoadHandler(init);
</script>
</body>
]]>
</Content>
</Module>

19 changes: 19 additions & 0 deletions test.html
@@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<body>

<p>Header...</p>

<script>
soundNames = ["Roar"]
soundFilenames = ["predator-roar.wav"]


alert("Hello!")
alert(soundNames[0])
</script>

<p>...Footer</p>

</body>
</html>

0 comments on commit 9a6ae2d

Please sign in to comment.