source: trunk/modules/InsertImage/insert_image.html @ 771

Last change on this file since 771 was 740, checked in by ray, 13 years ago

Ticket #603 Popop Dialog Height

  • Property svn:eol-style set to native
  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 5.1 KB
Line 
1<!DOCTYPE html
2     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5  <title>Insert Image</title>
6
7<script type="text/javascript" src="../../popups/popup.js"></script>
8<link rel="stylesheet" type="text/css" href="../../popups/popup.css" />
9
10<script type="text/javascript">
11
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(null,{width:410,height:400});
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["f_base"]) {
26      document.getElementById("f_base").value = param["f_base"];
27  }
28  document.getElementById("f_url").value    = param["f_url"] ? param["f_url"] : "";
29  document.getElementById("f_alt").value    = param["f_alt"] ? param["f_alt"] : "";
30  document.getElementById("f_border").value = (typeof param["f_border"]!="undefined") ? param["f_border"] : "";
31  document.getElementById("f_align").value  = param["f_align"] ? param["f_align"] : "";
32  document.getElementById("f_vert").value   = (typeof param["f_vert"]!="undefined") ? param["f_vert"] : "";
33  document.getElementById("f_horiz").value  = (typeof param["f_horiz"]!="undefined") ? param["f_horiz"] : "";
34  if (param["f_url"]) {
35      window.ipreview.location.replace(Xinha._resolveRelativeUrl(param.f_base, param.f_url));
36  }
37  document.getElementById("f_url").focus();
38}
39
40function onOK() {
41  var required = {
42    "f_url": i18n("You must enter the URL")
43  };
44  for (var i in required) {
45    var el = document.getElementById(i);
46    if (!el.value) {
47      alert(required[i]);
48      el.focus();
49      return false;
50    }
51  }
52  // pass data back to the calling window
53  var fields = ["f_url", "f_alt", "f_align", "f_border",
54                "f_horiz", "f_vert"];
55  var param = new Object();
56  for (var i in fields) {
57    var id = fields[i];
58    var el = document.getElementById(id);
59    param[id] = el.value;
60  }
61  __dlg_close(param);
62  return false;
63}
64
65function onCancel() {
66  __dlg_close(null);
67  return false;
68}
69
70function onPreview() {
71  var f_url = document.getElementById("f_url");
72  var url = f_url.value;
73  var base = document.getElementById("f_base").value;
74  if (!url) {
75    alert(i18n("You must enter the URL"));
76    f_url.focus();
77    return false;
78  }
79  window.ipreview.location.replace(Xinha._resolveRelativeUrl(base, url));
80  return false;
81}
82</script>
83
84</head>
85
86<body class="dialog" onload="Init()">
87
88<div class="title">Insert Image</div>
89<!--- new stuff --->
90<form action="" method="get">
91<input type="hidden" name="base" id="f_base"/>
92<table border="0" width="100%" style="padding: 0px; margin: 0px">
93  <tbody>
94
95  <tr>
96    <td style="width: 7em; text-align: right">Image URL:</td>
97    <td><input type="text" name="url" id="f_url" style="width:75%"
98      title="Enter the image URL here" />
99      <button name="preview" onclick="return onPreview();"
100      title="Preview the image in a new window">Preview</button>
101    </td>
102  </tr>
103  <tr>
104    <td style="width: 7em; text-align: right">Alternate text:</td>
105    <td><input type="text" name="alt" id="f_alt" style="width:100%"
106      title="For browsers that don't support images" /></td>
107  </tr>
108
109  </tbody>
110</table>
111
112<br />
113
114<fieldset style="float: left; margin-left: 5px;">
115<legend>Layout</legend>
116
117<div class="space"></div>
118
119<div class="fl">Alignment:</div>
120<select size="1" name="align" id="f_align"
121  title="Positioning of this image">
122  <option value=""                             >Not set</option>
123  <option value="left"                         >Left</option>
124  <option value="right"                        >Right</option>
125  <option value="texttop"                      >Texttop</option>
126  <option value="absmiddle"                    >Absmiddle</option>
127  <option value="baseline" selected="1"        >Baseline</option>
128  <option value="absbottom"                    >Absbottom</option>
129  <option value="bottom"                       >Bottom</option>
130  <option value="middle"                       >Middle</option>
131  <option value="top"                          >Top</option>
132</select>
133
134<br />
135
136<div class="fl">Border thickness:</div>
137<input type="text" name="border" id="f_border" size="5"
138title="Leave empty for no border" />
139
140<div class="space"></div>
141
142</fieldset>
143
144<fieldset>
145<legend>Spacing</legend>
146
147<div class="space"></div>
148
149<div class="fr">Horizontal:</div>
150<input type="text" name="horiz" id="f_horiz" size="5"
151title="Horizontal padding" />
152
153<br />
154
155<div class="fr">Vertical:</div>
156<input type="text" name="vert" id="f_vert" size="5"
157title="Vertical padding" />
158
159<div class="space"></div>
160
161</fieldset>
162<br style="clear:all"/>
163<div>
164Image Preview:<br />
165    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;"
166        height="200" width="100%" src="../../popups/blank.html"></iframe>
167</div>
168<div id="buttons">
169<button type="button" name="ok" onclick="return onOK();">OK</button>
170<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
171</div>
172</form>
173</body>
174</html>
Note: See TracBrowser for help on using the repository browser.