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

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