-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (74 loc) · 4.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<script src="https://code.jquery.com/jquery-2.2.3.min.js" defer></script>
<script src="dist/js/bootstrap-checkbox.min.js" defer></script>-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script type="text/javascript">
function onload(){
var newURL = "file:///C:/Users/Natalie/Documents/NetBeansProjects/WhatToppings/public_html/index.html?session=" + randomString(6);
$("#link").attr('href', newURL);
$("#link").text(newURL);
//$(':checkbox').checkboxpicker();
//$('#input-1').checkboxpicker({
//html: true,
//offLabel: '<span class="glyphicon glyphicon-remove">',
//onLabel: '<span class="glyphicon glyphicon-ok">'
//});
}
function randomString(length) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for(var i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
function calculate(){
//POST the results serverside.
//MATCH the results based on the session id.
//COUNT the number of posts to display as the number of people that participated
//CALCULATE the optimum pizza toppings
}
</script>
<title>What Toppings</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body onload="onload();">
<div>Pizza toppings</div><br>
Your topping survey link: <a id="link"></a><br>
<form name="toppings" onsubmit="calculate();"><br>
<label>How many pizzas?<input type="text" id="numberOfPizzas"><br></label>
<p>Thumbs up the toppings you like. Thumbs down the ones you can't stand.
If you don't care either way, ignore it.</p><br>
<p>MEAT</p>
<label><input type="checkbox" data-reverse id="pepperoni" value="pepperoni">Pepperoni<br></label>
<label><input type="checkbox" id="sausage" value="sausage">Sausage<br></label>
<label><input type="checkbox" id="ham" value="ham">Ham<br></label>
<label><input type="checkbox" id="chicken" value="chicken">Chicken<br></label>
<label><input type="checkbox" id="hamburger" value="hamburger">Hamburger<br></label>
<label><input type="checkbox" id="bacon" value="bacon">Bacon<br></label>
<label><input type="checkbox" id="anchovies" value="anchovies">Anchovies<br></label><br>
<p>VEGGIES</p>
<label><input type="checkbox" id="pineapple" value="pineapple">Pineapple<br></label>
<label><input type="checkbox" id="tomatoes" value="tomatoes">Tomatoes<br></label>
<label><input type="checkbox" id="bell_peppers" value="bell_peppers">Bell peppers<br></label>
<label><input type="checkbox" id="olives" value="olives">Olives<br></label>
<label><input type="checkbox" id="mushrooms" value="mushrooms">Mushrooms<br></label>
<label><input type="checkbox" id="onions" value="onions">Onions<br></label>
<label><input type="checkbox" id="garlic" value="garlic">Garlic<br></label>
<label><input type="checkbox" id="jalapenos" value="jalapenos">Jalapeños<br></label>
<label><input type="checkbox" id="spinach" value="spinach">Spinach<br></label>
<label><input type="checkbox" id="asparagus" value="asparagus">Asparagus<br></label><br>
<input type="submit" value="I'm hungry ( ͡° ͜ʖ ͡°)">
</form>
</body>
</html>