-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
79 lines (75 loc) · 2.95 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Diacriticism</title>
<link href="diacriticism.css" rel="stylesheet">
</head>
<body>
<div id="diacriticism">
<div id="main-output" class="output"></div>
<div class="form">
<input type="text" class="input" type="text" value="diacriticism" />
<div class="presets">
<label for="presetInput">presets</label>
<select id="presetInput"></select>
|
<button id="refreshButton">Refresh</button>
</div>
</div>
<div class="output-grid">
<p class="instructions">Click grey boxes to copy text to the clipboard.</p>
</div>
<div class="footer">
<p class="subdued">This is a tool for abusing <a href="http://en.wikipedia.org/wiki/Combining_Diacritical_Marks">combining diacritical marks</a> made by <a href="http://danielmclaren.com">Niel McLaren</a>. <a href="https://github.com/danielgm/diacriticism">Source code</a>.</p>
<p class="subdued">If you have questions, find this useful, and/or do anything hilarious with this, <a href="http://twitter.com/danielgm">let me know</a>!</p>
</div>
</div>
<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="zeroclipboard/ZeroClipboard.js"></script>
<script type="text/javascript" src="diacriticism.js"></script>
<script type="text/javascript">
var setupDiacriticism = (function() {
return function(dc) {
dc.val($('.input').val());
$('.input')
.focus(function() {
this.select();
})
.keyup(function(e) {
if (e.which == 13) {
dc.reset();
}
else {
dc.val($('.input').val());
}
})
.select();
return dc;
}
})();
var criticisms = Array.apply(null, Array(21)).map(function(_, i) {
$('.output-grid')
.append('<div id="output-' + i + '" class="output" title="Click to copy to clipboard."></div>');
var d = diacriticism('#output-' + i);
setupDiacriticism(d);
return d;
});
criticisms.push(setupDiacriticism(diacriticism('#main-output')));
$('#refreshButton').click(function() {
criticisms.forEach(function(d) { d.reset(); });
});
diacriticism.presets().forEach(function(d) {
var selected = d == criticisms[0].preset() ? ' selected="true"' : '';
$('#presetInput').append(
'<option value="' + d + '"' + selected + '>' + d + '</option>');
});
$('#presetInput').change(function(e) {
var p = $('#presetInput').val();
criticisms.forEach(function(d) { d.preset(p); })
});
</script>
</body>
</html>