-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsubmit.html
More file actions
255 lines (250 loc) · 6.42 KB
/
submit.html
File metadata and controls
255 lines (250 loc) · 6.42 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<html>
<head>
<meta charset=utf-8></meta>
<title>Submit | An Interactive IPA Chart</title>
<link href="/psi.ico" rel="shortcut icon" type="image/x-icon">
<style>
@font-face {
font-family: "Raleway";
font-style: normal;
font-weight: 200px;
src: local("Raleway"), url(http://themes.googleusercontent.com/static/fonts/raleway/v6/cIFy4yrWPDz3zOxk7hIQLUuEpTyoUstqEm5AMlJo4.woff) format("woff");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 200px;
src: local("Open Sans"), local("OpenSans"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format("woff");
}
* {
margin: 0px;
padding: 0px;
}
body {
width: 100%;
height: 100%;
margin: auto;
font-family: "Open Sans";
}
a {
color: black;
text-decoration: none;
}
header, header h1, footer {
font-family: "Raleway";
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
text-align: center;
min-height: 25px;
min-width: 25px;
white-space: nowrap
}
.play {
display: none;
}
.on {
color: black;
}
.off {
color: lightgray;
}
.sound {
font-family: arial;
}
.popup {
overflow: hidden;
}
select option:selected {
font-size: 200%;
}
.side, .side div, .side div a {
text-align: right;
}
caption {
text-align: center;
}
.sub {
float: right;
}
.half td a {
text-align: center;
}
nav {
width: 30%;
margin: auto;
}
#cv, #type, #menu, nav {
display: flex;
flex-flow: row nowrap;
}
.flex {
flex-grow: 2;
}
#language {
font-size: 150%;
margin: 20px;
}
#scratch {
width: 100%;
clear: both;
font-size: 30px;
margin-top: 30px;
}
li {
list-style-type: none;
display: inline;
}
#footer {
clear: both;
width: 100%;
text-align: center;
}
.link {
color: blue;
}
button {
margin: auto;
}
[type='checkbox'] {
display: none;
}
#cv tr:first-child .rotate {
height: 130px;
width: 1px;
}
#showAll {
display: inline-block;
}
tr:first-child th:first-child {
pointer-events: none;
}
</style>
<script src="jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script>
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</head>
<body>
<nav>
<button id="toggleAll">Toggle All</button>
<label style='margin-right: 30px;' ><input id="showAll" type='checkbox' checked /> Show All</label>
<input type=text id=name />
<button id='submit'>Submit</button>
</nav>
<main>
<form>
<div id='cv'>
</div>
</form>
<div id='type'>
<div class='flex'></div>
<textarea id='notes' placeholder='notes...'></textarea>
<div class='flex'></div>
</div>
</main>
<script src='util.js'></script>
<script>
function render(filename) {
$.post("ipa.php", {"mode": "2", "filename": filename},
function(data) {
$("#cv").empty()
$("#cv").append($(data))
$('.half:eq(0)').before($('<div></div>', {class: 'flex'}))
$('.half:eq(0)').after($('<div></div>', {class: 'flex'}))
$('.half:eq(1)').after($('<div></div>', {class: 'flex'}))
$(".sub, audio").remove()
rotate(true)
$(".rotate, .side").each(function() {
$(this).find('div').html($(this).find('div a').text())
})
$(".rotate").click(function(e) {
e.preventDefault()
var ri = $(this)[0].cellIndex, $that = $(this)
$that.toggleClass('off')
$that.parent().parent().parent().find("tr:not(:first)").each(function() {
if ($that.hasClass('off')) {
$(this).children().eq(ri*2).addClass('off')
$(this).children().eq(ri*2-1).addClass('off')
$(this).children().eq(ri*2).find("input").attr("checked", false)
$(this).children().eq(ri*2-1).find("input").attr("checked", false)
}
else if (!$that.hasClass('off')) {
$(this).children().eq(ri*2).removeClass('off')
$(this).children().eq(ri*2-1).removeClass('off')
$(this).children().eq(ri*2).find("input").attr("checked", true)
$(this).children().eq(ri*2-1).find("input").attr("checked", true)
}
})
})
$(".side").click(function() {
var $that = $(this)
$that.toggleClass('off')
$that.parent().find("td").each(function() {
if ($that.hasClass('off')) {
$(this).addClass('off')
$(this).find("input").attr("checked", false)
}
else if (!$that.hasClass('off')) {
$(this).removeClass('off')
$(this).find("input").attr("checked", true)
}
})
})
$("td").each(function() {
var letter = $(this).find("a").html() || ""
var number = $(this).attr("number") || ""
$(this).html("<input name='letters[]' type='checkbox' name='letter[]' checked value='" + letter + ", " + number + "'>" + letter + "</input>")
})
$("td").click(function() {
$(this).find('input').attr('checked', !$(this).find('input').attr('checked'))
$(this).toggleClass('off')
})
})
}
$(function() {
render('All')
$("#submit").click(function() {
var name = $('#name').val()
if (name) {
log($("form").serialize() + "&mode=3&filename=" + name + "¬es=" + $('#notes').val())
$.ajax({
type: "POST",
url: "ipa.php",
data: $("form").serialize() + "&mode=3&filename=" + name + "¬es=" + $('#notes').val(),
dataType: "text",
success: function(data) {
alert("Thank you! " + capital(name) + " submitted.");
window.location.href = 'index.html'
}
})
}
})
$('#cv').antiselect(true)
$("#year").text(new Date().getFullYear())
$('#showAll').click(function() {
if ($(this).is(':checked')) {
render('All')
}
else {
render('IPA.txt')
}
})
$('#toggleAll').click(function() {
$('#cv td').click()
})
})
</script>
<div id=footer>
Make sure your browser is set to standard <a href='http://www.unc.edu/~jlsmith/ipa-fonts.html' target='_blank' class='link'>Unicode</a> fonts in order for the page to properly render.<br />
Not configured for Internet Explorer. Designed in <a href='https://www.google.com/intl/en/chrome/browser/' target='_blank' class='link'>Google Chrome</a>.<br />
Please contact me with any questions, suggestions for features, errors encountered or language requests.<br />
©<span id='year'></span> Matthew Morrone <a href="mailto:matthewmorrone1@gmail.com" class='link'>matthewmorrone1@gmail.com</a>
</div>
</body>
</html>