-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
284 lines (235 loc) · 9.09 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
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Ccall : 1-Click Conference Calls</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script type="text/javascript" src="//use.typekit.net/rrf5isi.js"></script>
<script type="text/javascript">
try {
Typekit.load();
} catch(e) {
}
</script>
</head>
<body lang="en">
<div id="container">
<div id="main">
<div id="cc-logo" class="logo" alt="ccall"><img src="img/ccall.svg"></div>
<h1>Conference calls
<br>
without ass pain.
<br>
</h1>
<p>
<div id="confForm" name="confForm">
<div class="step">
We’ll combine the # and code into a single link for <b>iPhone*</b> users.
</div>
<input type="tel" id="confNumber" placeholder="phone #">
<input type="tel" id="confID" placeholder="conf code #">
<br>
<br>
<button type="submit" id="submitButton" class="inactive">
GET MAGIC LINK
</button>
</div>
<div id="link-holder"></div>
</p>
<article>
<b>We made CCALL because</b> it’s a pain in the ass to enter conference codes from a mobile phone. If you've ever had a calendar invite with a long conference ID and scribbled it on the back of your hand to avoid jumping between the email, your calendar and your phone app then you understand why we did this.
<br>
<br>
<div class="logo" id="experiment-logo">
<a href="http://twitter.com/exprmnt"><img src="img/logo_exp.svg"></a>
</div>
is a design and technology collective built to solve modern problems.
<br>
<br>
*Android still pain in ass.
<br><br>
</article>
</div>
</div><!-- main -->
<div class="social">
<div class="social-cat share">
<div class="social-head">SHARE</div>
<a href="https://www.facebook.com/sharer/sharer.php?u=ccall.me" target="_blank"><img src="img/fb.svg"></a> <a href="https://twitter.com/home?status=Never%20enter%20a%20conference%20call%20code%20on%20your%20iPhone%20again:%20http://ccall.me%20from%20@exprmnt&source=webclient" target="_blank"><img src="img/twitter.svg"></a>
</div>
<div class="social-cat fork">
<div class="social-head">FORK</div>
<a href="https://github.com/theexperiment/ccall" target="_blank"><img src="img/github.svg"></a>
</div>
<div class="social-cat hello">
<div class="social-head">HELLO</div>
<a href="https://twitter.com/exprmnt" target="_blank"><img src="img/twitter.svg"></a>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/libs/jquery-1.11.1.min.js"><\/script>');
</script>
<script type="text/javascript" src="js/service/Service.js"></script>
<script type="text/javascript" src="js/vo/ShortCcallURL.js"></script>
<!-- <script type="text/javascript" src="js/vo/ShortURL.js"></script> -->
<!-- <script type="text/javascript" src="js/vo/ShortBitlyURL.js"></script> -->
<!-- <script src="js/libs/jquery.urlshortener.min.js"></script> -->
<script src="js/libs/detectmobilebrowser.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.5/ZeroClipboard.min.js"></script>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script> -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45973655-4', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var cn = $("#confNumber");
var cid = $("#confID");
cn.bind('keyup', keyHandler);
cid.bind('keyup', keyHandler);
function keyHandler(argument) {
if (cn.val().length >= 1 && cid.val().length >= 1) {
$('#submitButton').removeClass('inactive');
} else {
$('#submitButton').addClass('inactive');
}
if (cn.val().length >= 1 || cid.val().length >= 1) {
$('#link-holder').empty();
}
}
var service = Service.getInstance();
var scope = this;
var client;
var longURL;
var shortURL;
var isUrlInvalid;
var flashIsEnabled = true;
/*
* Listener for the service
*/
$(service).on("shortURLDataSuccess", function(event, response) {
shortURL = response.data.url;
// console.log('HTTP response, shortURL set: ' + shortURL);
if (!$.browser.mobile && flashIsEnabled) {
// dont do anything
} else {
$('#link-holder').html('<div class="step" id="step3">Copy/paste this magic link so iPhoners can avoid pain.</div><h2><a href="' + shortURL + '">' + shortURL + '</a></h2>');
ga('send', 'event', 'api', 'receive', 'shorturl');
}
});
function initClipboard() {
// console.log('is Desktop - initClipboard()');
client = new ZeroClipboard($('#submitButton'));
client.on('ready', function(event) {
// console.log('movie is loaded');
client.on('copy', function(event) {
// console.log('client.on(copy)');
isUrlInvalid = validateForm();
if (!isUrlInvalid) event.clipboardData.setData('text/plain', shortURL);
});
client.on('aftercopy', function(event) {
if (!isUrlInvalid) {
// console.log('Copied text to clipboard: ' + event.data['text/plain']);
$('#link-holder').html('<div class="step" id="step3"> <a href="' + shortURL + '">' + shortURL + ' </a> <br>Your magic link has been copied to your clipboard. Now just Ctrl+V or Command+V(mac)</div>');
resetForm();
ga('send', 'event', 'api', 'receive', 'shorturl');
} else {
// console.log('form invalid, halting - client.on(aftercopy)');
}
});
});
client.on('error', function(event) {
// console.log('ZeroClipboard error of type "' + event.name + '": ' + event.message);
if (event.name == 'flash-disabled')
{
flashIsEnabled = false;
$('#submitButton').click(function() {
validateForm();
});
}
else
{
$('#link-holder').html('<div class="step" id="step3">Opps, something happened getting your magic link. Please try again.</div>');
}
});
}
function resetForm() {
cn.val('');
cid.val('');
$('#submitButton').addClass('inactive');
}
function validateForm() {
// console.log('validateForm()');
// check for valid numbers
var error = false;
var cnVal = cn.val().replace(/\D/g, '');
var cidVal = cid.val();
if (cnVal.length != 7 && cnVal.length != 10 && cnVal.length != 11) {// ADD REGEX HERE
// console.log('addClass error cn');
cn.addClass('error');
error = true;
}
if (cidVal.length <= 1) {
// console.log('addClass error cid');
cid.addClass('error');
error = true;
}
if (error) {
setTimeout(function() {
// console.log('remove error classes');
cn.removeClass('error');
cid.removeClass('error');
}, 2000);
return true;
}
// check for missing #
if (cidVal.charAt(cidVal.length - 1) != '#') {
var r = confirm("Cancel if you need to add a # to the end of your code.");
if (r == true) {
setLongURL();
} else {
return true;
}
} else {
setLongURL();
}
}
function setLongURL() {
console.log('setLongURL()');
var httpBase = $(location).attr('href').substring(0, $(location).attr('href').lastIndexOf("/") + 1);
// strip off # if one exists
var localConfId = cid.val();
var lastChar = localConfId.substr(cid.val().length - 1);
var useHash = lastChar == '#';
// strip off all non-numerical characters from phone number
var localConfPhoneNumber = cn.val();
localConfPhoneNumber = localConfPhoneNumber.replace(/\D/g, '');
if (useHash)// strip it off
{
localConfId = localConfId.substring(0, localConfId.length - 1);
}
longURL = httpBase + 'ccall_result.html?n=' + localConfPhoneNumber + '&i=' + localConfId + ((useHash) ? ('&useHash=true') : ('&useHash=false'));
service.getCcallShortURL(longURL);
}
$('#cc-logo').click(function() {
var httpBase = $(location).attr('href').substring(0, $(location).attr('href').lastIndexOf("/") + 1);
window.location = httpBase;
});
$('#cc-logo').hover(function() {
$(this).css('cursor', 'pointer');
});
if (!$.browser.mobile) {
initClipboard();
} else {
$('#submitButton').click(function() {
validateForm();
});
}
</script>
</body>
</html>