source: trunk/popups/insert_image.html @ 109

Last change on this file since 109 was 109, checked in by niko, 14 years ago

#147
use only one global popup.css

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