source: branches/688-fixup/modules/InsertImage/insert_image.html @ 693

Last change on this file since 693 was 693, checked in by gogo, 13 years ago

This should be the same as trunk@688 but preserving history. Now to get
this back to the trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 4.7 KB
Line 
1<html>
2
3<head>
4  <title>Insert Image</title>
5
6<script type="text/javascript" src="../../popups/popup.js"></script>
7<link rel="stylesheet" type="text/css" href="../../popups/popup.css" />
8
9<script type="text/javascript">
10
11window.resizeTo(400, 100);
12
13Xinha = window.opener.Xinha;
14function i18n(str) {
15  return (Xinha._lc(str, 'Xinha'));
16}
17
18function Init() {
19  __dlg_translate('Xinha');
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
37function 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
62function onCancel() {
63  __dlg_close(null);
64  return false;
65}
66
67function 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"
133title="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"
146title="Horizontal padding" />
147
148<p />
149
150<div class="fr">Vertical:</div>
151<input type="text" name="vert" id="f_vert" size="5"
152title="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;"
163        height="200" width="300" src="../../popups/blank.html"></iframe>
164  </td>
165  <td valign="bottom" style="text-align: right">
166    <button type="button" name="ok" onclick="return onOK();">OK</button><br>
167    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
168  </td>
169 </tr>
170</table>
171</form>
172</body>
173</html>
Note: See TracBrowser for help on using the repository browser.