source: trunk/popups/insert_image.html @ 76

Last change on this file since 76 was 76, checked in by niko, 14 years ago
  • #146: added dlg_translate in popups/insert_image.html
  • #145: added label in dlg_translate (popups/popup.js)
  • #144: updated german translation (lang/de.js)

added HTMLArea._lc when in createSelect - so we can translate option-items (htmlarea.js)

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