-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
406 lines (358 loc) · 12.7 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
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
<meta charset="utf-8" />
<title>Videotranscribr</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="https://js.stripe.com/v1/" type="text/javascript">
</script>
<style type="text/css">
/*<![CDATA[*/
body { padding-top: 60px; /* 60px to make the container go all the way
to the bottom of the topbar */ }
/*]]>*/
</style>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" /><!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
<link href="assets/ico/favicon.ico" rel="shortcut icon" />
<link href="assets/ico/apple-touch-icon-144-precomposed.png" rel="apple-touch-icon-precomposed" sizes="144x144" />
<link href="assets/ico/apple-touch-icon-114-precomposed.png" rel="apple-touch-icon-precomposed" sizes="114x114" />
<link href="assets/ico/apple-touch-icon-72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72" />
<link href="assets/ico/apple-touch-icon-57-precomposed.png" rel="apple-touch-icon-precomposed" />
<script type="text/javascript">
//<![CDATA[
var linkid = 1;
var linkNumber = 5;
var linkCount = 0;
var totalTime = 0;
var stripevisible = 0;
function verifyEmailMatch()
{
var email1 = document.getElementById('email_addr').value;
var email2 = document.getElementById('email_addr_repeat').value;
if (email1 != email2)
{
input.setCustomValidity('The two email addresses must match.');
}
else
{
// input is valid -- reset the error message
input.setCustomValidity('');
}
}
function verifyInputs()
{
var c = 0;
var form = document.getElementById("infoform");
for(i=0; i< form.length; i++)
{
var field = form.elements[i];
if(field.id.match(/link/g) && field.value != '') c++;
if(field.value == '' && field.required)
{
field.setCustomValidity('Required');
return 0;
}
}
linkCount = c;
return 1;
}
function add(type)
{
// console.log("type: " + type);
// console.log("linkid: " + linkid);
if(linkid > 4)
{
showErrorLabel("Limit 5 videos per transaction");
}
else
{
var divid = "linkdiv" + linkid;
var oldelement = document.getElementById(divid);
// console.log('oldelement: ', oldelement);
var types = oldelement.children;
console.log('types: ', types);
var imgdiv;
// because removeChild will alter the types.length
// we have to access it in reverse order.
for (var i = types.length-1; i >= 0; i--)
{
console.log("i: " + i);
console.log("types tagname: " + types[i].tagName.toLowerCase());
if (types[i].tagName.toLowerCase() == 'a')
{
console.log("removing element");
oldelement.removeChild(types[i]);
}
}
removeErrLabel();
//Create an input type dynamically.
linkid++;
var newdiv = document.createElement("div");
newdiv.id = "linkdiv" + linkid;
var newlabel = document.createElement("label");
newlabel.innerHTML = "Video URL " + linkid;
var newelement = document.createElement("input");
newelement.setAttribute("type", type);
newelement.setAttribute("id", "link" + linkid);
newelement.setAttribute("name", "link" + linkid);
var plusbtn = document.createElement("a");
plusbtn.href = "javascript:observeInputValue('linkdiv' + linkid);";
var img1 = document.createElement("img");
img1.src="plus-icon.png";
img1.id="plus-img";
plusbtn.appendChild(img1);
var minusbtn = document.createElement("a");
minusbtn.href = "javascript:removeURLField();";
var img2 = document.createElement("img");
img2.src="minus-icon.jpg";
img2.id="minus-img";
minusbtn.appendChild(img2);
newdiv.appendChild(newlabel);
newdiv.appendChild(newelement);
newdiv.appendChild(plusbtn);
newdiv.appendChild(minusbtn);
document.getElementById("videourls").appendChild(newdiv);
}
parseURLS();
}
function removeURLField()
{
removeErrLabel();
var divid = "linkdiv" + linkid;
var oldelement = document.getElementById(divid);
console.log(oldelement);
document.getElementById("videourls").removeChild(oldelement);
linkid--;
divid = "linkdiv" + linkid;
var currelement = document.getElementById(divid);
var plusbtn = document.createElement("a");
plusbtn.href = "javascript:observeInputValue('linkdiv' + linkid);";
var img1 = document.createElement("img");
img1.src="plus-icon.png";
img1.id="plus-img";
plusbtn.appendChild(img1);
currelement.appendChild(plusbtn);
if (Number(linkid) > 1)
{
var minusbtn = document.createElement("a");
minusbtn.href = "javascript:removeURLField();";
var img2 = document.createElement("img");
img2.src="minus-icon.jpg";
img2.id="minus-img";
minusbtn.appendChild(img2);
currelement.appendChild(minusbtn);
}
parseURLS();
}
function removeErrLabel()
{
var errlabel = document.getElementById('errlabel');
if (errlabel != null)
document.getElementById("videourls").removeChild(errlabel);
}
function parseURLS()
{
totalTime = 0;
for(var i = 1; i < linkid + 1; i++)
{
var lid = "link" + i;
var link = document.getElementById(lid);
var url = link.value;
//console.log(url)
var matched = url.match(/youtube/g);
if(matched)
parseYouTube(url);
matched = url.match(/vimeo/g);
if(matched)
parseVimeo(url);
}
}
function parseYouTube(url)
{
var vid = url.split("=");
var vidId = vid[vid.length-1];
var youtubeCallback = "http://gdata.youtube.com/feeds/api/videos/" + vidId + "?v=2&alt=jsonc&callback=getYouTubeDuration&prettyprint=true"
var script = document.createElement("script");
script.src = youtubeCallback;
var spanform = document.getElementById("urlspan");
spanform.appendChild(script);
}
function parseVimeo(url)
{
var vid = url.split("/");
var vidId = vid[vid.length-1];
var vimeoCallback = "http://vimeo.com/api/v2/video/" + vidId + ".json?callback=getVimeoDuration";
var script = document.createElement("script");
script.src = vimeoCallback;
var spanform = document.getElementById("urlspan");
spanform.appendChild(script);
}
function showErrorLabel(msg)
{
var errlabel = document.getElementById('errlabel');
if(!errlabel)
{
var errlabel =document.createElement("label");
errlabel.setAttribute("id", "errlabel");
}
errlabel.innerHTML = msg;
var spanform = document.getElementById("videourls");
spanform.appendChild(errlabel);
}
// callback function from vimeo
function getVimeoDuration(jsonobj)
{
var time = jsonobj[0].duration;
if( time > 5400)
showErrorLabel("Individual video time limit must be < 90 minutes");
else
totalTime += time;
updateTimeTxt();
observeInputValue();
}
// callback function from youtube
function getYouTubeDuration(jsonobj)
{
var time = jsonobj["data"]["duration"];
if(time > 5400)
showErrorLabel("Individual video time limit must be < 90 minutes");
else
totalTime += time;
updateTimeTxt();
observeInputValue();
}
function updateTimeTxt()
{
var totaltxt = document.getElementById("total");
totaltxt.value = ((totalTime/60)*3).toFixed(2);
}
function observeInputValue(input)
{
if(input && input.value != '')
add('text');
if(verifyInputs())
{
var totaltxt = document.getElementById("total");
var updateval = ((totalTime/60)*3).toFixed(2);
console.log(totaltxt.value);
if(totaltxt.value != "0")
{
var paybutton = document.getElementById("customButton");
if(totaltxt.value != 0)
paybutton.style.visibility = "visible";
else
paybutton.style.visibility = "invisible";
}
}
}
//]]>
</script>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">VideoTranscribr</a>
<ul class="nav">
<li><a href="#FAQ">FAQ</a></li>
<li><a href="#Transcribe">Transcribe</a></li>
</ul>
<form class="navbar-form pull-right"></form>
</div>
</div>
</div>
<div class="container">
<div class="hero-unit">
<div>
<h1>Video Transcription Services</h1>
<br>
<p>We offer fast, accurate, and inexpensive video and audio transcriptions for all your needs. Have a file you need transcribed? Send us the link, confirm your payment and response speed, and we'll get your transcript to you in no time!</p>
</div><a class="btn btn-primary" href="#Transcribe">Transcribe »</a>
</div>
<h3 id="FAQ"><a id="FAQ" name="FAQ"></a> Frequently Asked Questions</h3>
<ul style="font-size: 13px;">
<li>
<h4>What are your prices?</h4>Our prices are extremely competitive: we offer 1 business day turnaround for $4 a minute and 3 business day turnaround for $2 a minute
</li>
<li>
<h4>What languages of transcription do you offer?</h4>Currently, only English-language videos are available for transcription
</li>
<li>
<h4>What payment types do you accept?</h4>Because we use the excellent and secure <a href="https://stripe.com/">Stripe</a> payment system we are able to accept Visa, Mastercard, and American Express
</li>
<li>
<h4>What is your privacy policy for my content?</h4>We hate having our information distributed to third-parties and care just as much about privacy as you do. We will never sell or discuss your content with anyone, ever. Period.
</li>
<li>
<h4>How are the transcription files returned to me?</h4>We return both a .txt and a .doc (Microsoft Word format) in the <a href="http://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format">SubTime format</a>
</li>
</ul>
<div class="well Payment" id="Payment">
<div>
<h1>Transcribe my files already!</h1>
</div>
</div>
<a id="Transcribe" name="Transcribe"></a>
<span id="urlspan"></span>
<form action="charge.php" id="infoform" method="post" name="infoform">
<label>Full Name</label> <input id="full_name" name="full_name" placeholder="Jane Doe" required="" type="text"/>
<label>Email Address</label> <input id="email_addr" name="email_addr" placeholder="[email protected]" required="" type="email"/>
<label>Verify Email Address</label> <input id="email_addr_repeat" name="email_addr_repeat" oninput="verifyEmailMatch()" placeholder="[email protected]" required="" type="email" />
<div id="videourls">
<div id="linkdiv1">
<label>File URL (YouTube or Vimeo accepted)</label> <input id="link1" name="link1" placeholder="http://www.youtube.com/watch?v=VCfjvTOS6bM" required="" type="text"></input>
<a href="javascript:observeInputValue('link' + linkid);"><img id="plus-img" src="plus-icon.png"></img></a>
</div>
</div>
<br/>
<br />
<label>Estimated total</label> $<input id="total" name="total" readonly="readonly" value="0" /><br />
<br />
<input id="calcbutton" onclick="parseURLS()" type="button" value="Calculate Cost" />
<input id="stripeToken" name="stripeToken" style="visibility:hidden" value="" />
<br/>
<br/>
<span id="stripespan"></span> <script src="https://checkout.stripe.com/v2/checkout.js" type="text/javascript">
</script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript">
</script> <input id="customButton" required="" type="button" value="Pay with Stripe" /> <script type="text/javascript">
//<![CDATA[
$('#customButton').click(function(){
var token = function(res){
console.log('Got token ID:', res.id);
document.getElementById("stripeToken").value = res.id;
var total = document.getElementById("total");
total.value = (total.value*100).toFixed(0);
document.getElementById("infoform").submit();
};
StripeCheckout.open({
key: 'pk_test_7cw6SNXgq3gGCgXJhEFm3b4y',
address: true,
amount: ((totalTime/60)*300).toFixed(0),
name: 'VideoTranscribr',
description: '' + linkCount + 'x videos - $' + ((totalTime/60)*3).toFixed(2),
panelLabel: 'Checkout',
token: token
});
return false;
});
//]]>
</script> <!-- add code for custom button submission so we can't submit with invalid data
or fields that are left empty -->
</form>
<hr />
<div>
© Nick & Sam 2012
</div>
</div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript">
</script><script src="assets/js/bootstrap.js" type="text/javascript">
</script>
</body>
</html>