-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathedit.html
90 lines (72 loc) · 2.96 KB
/
edit.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
<html>
<head>
<title>Font Detect (Edit)</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="stylesheets/font-detect-edit.css" />
<link rel="stylesheet" type="text/css" media="print" href="stylesheets/font-detect-print.css" />
</head>
<body>
<div id="forms" class="noprint">
<form id="font-text-set">
<label for="font-text" class="col">text: </label>
<textarea id="font-text" cols="40" rows="5">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</textarea>
<label for="font-size" class="col"> font-size: </label>
<input id="font-size" type="text" value="32px" size="5"/>
<input type="submit" value="Set" />
</form>
<form>
<label for="font-family" class="col">font-family: </label>
<select id="font-family">
<option value="---">---</option>
</select>
<input id="font-family-list" type="submit" value="Load font list" />
<p id="status"> </p>
</form>
<form>
<label class="col"> </label>
<input id="text-add" type="submit" value="Add text" />
<input id="text-clear" type="submit" value="Clear" />
<input id="text-load-all" type="submit" value="Add all fonts" />
</form>
<div style="display:none" id="font-detect-swf"></div>
<br class="clear" />
</div>
<div id="content">
</div>
<script src="javascripts/jquery-1.2.6.pack.js"></script>
<script src="javascripts/swfobject.js"></script>
<script src="javascripts/font-detect.js"></script>
<script src="javascripts/font-detect-edit.js"></script>
<script>
$(document).ready(function() {
var editFontDetect = new EditFontDetect();
$("#font-text-set").bind("submit", function(e) {
newEditFontDetect().updateText($("#font-text").val(), $("#font-size").val());
return false;
});
$("#font-family-list").click(function(e) {
$("#status").html("Loading SWF...");
var fontDetect = new FontDetect("font-detect-swf", "flash/FontList.swf", function(fd) {
var fonts = fd.fonts();
editFontDetect.setFonts(fonts);
editFontDetect.updateSelect(fonts);
});
return false;
});
$("#text-clear").click(function(e) {
editFontDetect.clearText();
return false;
});
$("#text-add").click(function(e) {
editFontDetect.addText($('#font-text').val(), $('#font-size').val(), $('#font-family').val(), false);
return false;
});
$("#text-load-all").click(function(e) {
editFontDetect.clearText();
editFontDetect.addAll($('#font-text').val(), $('#font-size').val());
return false;
});
});
</script>
</body>
</html>