View difference between Paste ID: 80hnNsfQ and YYg6G9tT
SHOW: | | - or go back to the newest paste.
1-
<script>
1+
var nameArray = [
2-
var nameArray=new Array();
2+
	"I'm gunna give you a fun problem",
3-
	nameArray[0]="I'm gunna give you a fun problem";
3+
	"I think that's a stupid number",
4-
	nameArray[1]="I think that's a stupid number";
4+
	"Jesus God",
5-
	nameArray[2]="Jesus God";
5+
	"Hold on, let me finish",
6-
	nameArray[3]="Hold on, let me finish";
6+
	"No, I have no faith in aliens",
7-
	nameArray[4]="No, I have no faith in aliens";
7+
	"It's also possible you could walk through the wall",
8-
	nameArray[5]="It's also possible you could walk through the wall";
8+
	"By the way, the heart is an incredible organ",
9-
	nameArray[6]="By the way, the heart is an incredible organ";
9+
	"There's very little activity out here",
10-
	nameArray[7]="There's very little activity out here";
10+
	"Wow, I wanna hit that",
11-
	nameArray[8]="Wow, I wanna hit that";
11+
	"Idiot",
12-
	nameArray[9]="Idiot";
12+
	"There's no more Mexicans here, how in the hell am I gunna keep my yard?",
13-
	nameArray[10]="There's no more Mexicans here, how in the hell am I gunna keep my yard?";
13+
	"Political Bullshit",
14-
	nameArray[11]="Political Bullshit";
14+
	"This is Wacko",
15-
	nameArray[12]="This is Wacko";
15+
];
16
var baseurl = "http://dl.dropbox.com/u/109430408/bob/";
17-
var i;
17+
var container = $('<div />');
18-
var sub;
18+
var clips = $('<div />');
19-
function runLoop(){
19+
$(document).ready(function() {
20-
	var container = $('<div />');
20+
	$(document.body).append(container);
21-
    var clips = $('<div />');
21+
	$(document.body).append(clips);
22-
    $(document).ready(function(){
22+
	nameArray.forEach(function(label,i) {
23-
		$(document.body).append(container);
23+
		var snd = $('<audio id="sound'+i+'" src="'+baseurl+i+'.ogg"></audio>');
24-
		$(document.body).append(clips);
24+
		clips.append(snd);
25-
		nameArray.forEach(function(label,i) {
25+
		var btn = $('<button value="'+label+'">'+label+'</button>');
26-
			var snd = $('<audio id="sound'+i+'" src="'+baseurl+i+'.ogg"></audio>');
26+
		container.append(btn);
27-
			clips.append(snd);
27+
		btn.click(function() {
28-
28+
			snd.play();
29-
			var btn = $('<button value="'+label+'">'+label+'</button>');
29+
		});
30-
			container.append(btn).click(function() {
30+
	});
31-
						var audio=document.getElementById('sound'+i);
31+