1 | <html> |
---|
2 | |
---|
3 | <head> |
---|
4 | <title>Insert Image</title> |
---|
5 | |
---|
6 | <script type="text/javascript" src="popup.js"></script> |
---|
7 | <link rel="stylesheet" type="text/css" href="popup.css" /> |
---|
8 | |
---|
9 | <script type="text/javascript"> |
---|
10 | |
---|
11 | window.resizeTo(400, 100); |
---|
12 | |
---|
13 | HTMLArea = window.opener.HTMLArea; |
---|
14 | function i18n(str) { |
---|
15 | return (HTMLArea._lc(str, 'HTMLArea')); |
---|
16 | } |
---|
17 | |
---|
18 | function Init() { |
---|
19 | __dlg_translate('HTMLArea'); |
---|
20 | __dlg_init(); |
---|
21 | // Make sure the translated string appears in the drop down. (for gecko) |
---|
22 | document.getElementById("f_align").selectedIndex = 1; |
---|
23 | document.getElementById("f_align").selectedIndex = 5; |
---|
24 | var param = window.dialogArguments; |
---|
25 | if (param) { |
---|
26 | document.getElementById("f_url").value = param["f_url"]; |
---|
27 | document.getElementById("f_alt").value = param["f_alt"]; |
---|
28 | document.getElementById("f_border").value = param["f_border"]; |
---|
29 | document.getElementById("f_align").value = param["f_align"]; |
---|
30 | document.getElementById("f_vert").value = param["f_vert"]; |
---|
31 | document.getElementById("f_horiz").value = param["f_horiz"]; |
---|
32 | window.ipreview.location.replace(param.f_url); |
---|
33 | } |
---|
34 | document.getElementById("f_url").focus(); |
---|
35 | } |
---|
36 | |
---|
37 | function onOK() { |
---|
38 | var required = { |
---|
39 | "f_url": i18n("You must enter the URL") |
---|
40 | }; |
---|
41 | for (var i in required) { |
---|
42 | var el = document.getElementById(i); |
---|
43 | if (!el.value) { |
---|
44 | alert(required[i]); |
---|
45 | el.focus(); |
---|
46 | return false; |
---|
47 | } |
---|
48 | } |
---|
49 | // pass data back to the calling window |
---|
50 | var fields = ["f_url", "f_alt", "f_align", "f_border", |
---|
51 | "f_horiz", "f_vert"]; |
---|
52 | var param = new Object(); |
---|
53 | for (var i in fields) { |
---|
54 | var id = fields[i]; |
---|
55 | var el = document.getElementById(id); |
---|
56 | param[id] = el.value; |
---|
57 | } |
---|
58 | __dlg_close(param); |
---|
59 | return false; |
---|
60 | } |
---|
61 | |
---|
62 | function onCancel() { |
---|
63 | __dlg_close(null); |
---|
64 | return false; |
---|
65 | } |
---|
66 | |
---|
67 | function onPreview() { |
---|
68 | var f_url = document.getElementById("f_url"); |
---|
69 | var url = f_url.value; |
---|
70 | if (!url) { |
---|
71 | alert(i18n("You must enter the URL")); |
---|
72 | f_url.focus(); |
---|
73 | return false; |
---|
74 | } |
---|
75 | window.ipreview.location.replace(url); |
---|
76 | return false; |
---|
77 | } |
---|
78 | </script> |
---|
79 | |
---|
80 | </head> |
---|
81 | |
---|
82 | <body class="dialog" onload="Init()"> |
---|
83 | |
---|
84 | <div class="title">Insert Image</div> |
---|
85 | <!--- new stuff ---> |
---|
86 | <form action="" method="get"> |
---|
87 | <table border="0" width="100%" style="padding: 0px; margin: 0px"> |
---|
88 | <tbody> |
---|
89 | |
---|
90 | <tr> |
---|
91 | <td style="width: 7em; text-align: right">Image URL:</td> |
---|
92 | <td><input type="text" name="url" id="f_url" style="width:75%" |
---|
93 | title="Enter the image URL here" /> |
---|
94 | <button name="preview" onclick="return onPreview();" |
---|
95 | title="Preview the image in a new window">Preview</button> |
---|
96 | </td> |
---|
97 | </tr> |
---|
98 | <tr> |
---|
99 | <td style="width: 7em; text-align: right">Alternate text:</td> |
---|
100 | <td><input type="text" name="alt" id="f_alt" style="width:100%" |
---|
101 | title="For browsers that don't support images" /></td> |
---|
102 | </tr> |
---|
103 | |
---|
104 | </tbody> |
---|
105 | </table> |
---|
106 | |
---|
107 | <p /> |
---|
108 | |
---|
109 | <fieldset style="float: left; margin-left: 5px;"> |
---|
110 | <legend>Layout</legend> |
---|
111 | |
---|
112 | <div class="space"></div> |
---|
113 | |
---|
114 | <div class="fl">Alignment:</div> |
---|
115 | <select size="1" name="align" id="f_align" |
---|
116 | title="Positioning of this image"> |
---|
117 | <option value="" >Not set</option> |
---|
118 | <option value="left" >Left</option> |
---|
119 | <option value="right" >Right</option> |
---|
120 | <option value="texttop" >Texttop</option> |
---|
121 | <option value="absmiddle" >Absmiddle</option> |
---|
122 | <option value="baseline" selected="1" >Baseline</option> |
---|
123 | <option value="absbottom" >Absbottom</option> |
---|
124 | <option value="bottom" >Bottom</option> |
---|
125 | <option value="middle" >Middle</option> |
---|
126 | <option value="top" >Top</option> |
---|
127 | </select> |
---|
128 | |
---|
129 | <p /> |
---|
130 | |
---|
131 | <div class="fl">Border thickness:</div> |
---|
132 | <input type="text" name="border" id="f_border" size="5" |
---|
133 | title="Leave empty for no border" /> |
---|
134 | |
---|
135 | <div class="space"></div> |
---|
136 | |
---|
137 | </fieldset> |
---|
138 | |
---|
139 | <fieldset style="float:right; margin-right: 5px;"> |
---|
140 | <legend>Spacing</legend> |
---|
141 | |
---|
142 | <div class="space"></div> |
---|
143 | |
---|
144 | <div class="fr">Horizontal:</div> |
---|
145 | <input type="text" name="horiz" id="f_horiz" size="5" |
---|
146 | title="Horizontal padding" /> |
---|
147 | |
---|
148 | <p /> |
---|
149 | |
---|
150 | <div class="fr">Vertical:</div> |
---|
151 | <input type="text" name="vert" id="f_vert" size="5" |
---|
152 | title="Vertical padding" /> |
---|
153 | |
---|
154 | <div class="space"></div> |
---|
155 | |
---|
156 | </fieldset> |
---|
157 | <br clear="all" /> |
---|
158 | <table width="100%" style="margin-bottom: 0.2em"> |
---|
159 | <tr> |
---|
160 | <td valign="bottom"> |
---|
161 | <div class="fr">Image Preview:</div> |
---|
162 | <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe> |
---|
163 | </td> |
---|
164 | <td valign="bottom" style="text-align: right"> |
---|
165 | <button type="button" name="ok" onclick="return onOK();">OK</button><br> |
---|
166 | <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> |
---|
167 | </td> |
---|
168 | </tr> |
---|
169 | </table> |
---|
170 | </form> |
---|
171 | </body> |
---|
172 | </html> |
---|