source: trunk/popups/insert_table.html @ 19

Last change on this file since 19 was 19, checked in by gogo, 15 years ago

Adding subversion properties.

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 4.8 KB
Line 
1<html>
2
3<head>
4  <title>Insert Table</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  i18n = window.opener.HTMLArea.I18N.dialogs; // load the HTMLArea plugin and lang file
14  __dlg_translate(i18n);
15  __dlg_init();
16  document.getElementById("f_rows").focus();
17};
18
19function onOK() {
20  var required = {
21    "f_rows": "You must enter a number of rows",
22    "f_cols": "You must enter a number of columns"
23  };
24  for (var i in required) {
25    var el = document.getElementById(i);
26    if (!el.value) {
27      alert(required[i]);
28      el.focus();
29      return false;
30    }
31  }
32  var fields = ["f_rows", "f_cols", "f_width", "f_unit", "f_fixed",
33                "f_align", "f_border", "f_spacing", "f_padding"];
34  var param = new Object();
35  for (var i in fields) {
36    var id = fields[i];
37    var el = document.getElementById(id);
38    param[id] = (el.type == "checkbox") ? el.checked : el.value;
39  }
40  __dlg_close(param);
41  return false;
42};
43
44function onCancel() {
45  __dlg_close(null);
46  return false;
47};
48
49</script>
50
51<style type="text/css">
52html, body {
53  background: ButtonFace;
54  color: ButtonText;
55  font: 11px Tahoma,Verdana,sans-serif;
56  margin: 0px;
57  padding: 0px;
58}
59body { padding: 5px; }
60table {
61  font: 11px Tahoma,Verdana,sans-serif;
62}
63form p {
64  margin-top: 5px;
65  margin-bottom: 5px;
66}
67.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
68.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
69fieldset { padding: 0px 10px 5px 5px; }
70select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
71button { width: 70px; }
72.space { padding: 2px; }
73
74.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
75border-bottom: 1px solid black; letter-spacing: 2px;
76}
77form { padding: 0px; margin: 0px; }
78</style>
79
80</head>
81
82<body onload="Init()">
83
84<div class="title">Insert Table</div>
85
86<form action="" method="get">
87<table border="0" style="padding: 0px; margin: 0px">
88  <tbody>
89
90  <tr>
91    <td style="width: 4em; text-align: right">Rows:</td>
92    <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
93    <td style="width: 4em; text-align: right">Width:</td>
94    <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
95    <td><select size="1" name="unit" id="f_unit" title="Width unit">
96      <option value="%" selected="1"  >Percent</option>
97      <option value="px"              >Pixels</option>
98      <option value="em"              >Em</option>
99    </select></td>
100  </tr>
101  <tr>
102    <td style="width: 4em; text-align: right">Cols:</td>
103    <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
104    <td style="text-align: right"><input type="checkbox" checked="checked" name="fixed" id="f_fixed" /></td>
105    <td colspan="2"><label for="f_fixed"
106    >Fixed width columns</label></td>
107  </tr>
108  </tbody>
109</table>
110
111<p />
112
113<fieldset style="float: left; margin-left: 5px;">
114<legend>Layout</legend>
115
116<div class="space"></div>
117
118<div class="fl">Alignment:</div>
119<select size="1" name="align" id="f_align"
120  title="Positioning of this table">
121  <option value="" selected="1"                >Not set</option>
122  <option value="left"                         >Left</option>
123  <option value="right"                        >Right</option>
124  <option value="texttop"                      >Texttop</option>
125  <option value="absmiddle"                    >Absmiddle</option>
126  <option value="baseline"                     >Baseline</option>
127  <option value="absbottom"                    >Absbottom</option>
128  <option value="bottom"                       >Bottom</option>
129  <option value="middle"                       >Middle</option>
130  <option value="top"                          >Top</option>
131</select>
132
133<p />
134
135<div class="fl">Border thickness:</div>
136<input type="text" name="border" id="f_border" size="5" value="1"
137title="Leave empty for no border" />
138<!--
139<p />
140
141<div class="fl">Collapse borders:</div>
142<input type="checkbox" name="collapse" id="f_collapse" />
143-->
144<div class="space"></div>
145
146</fieldset>
147
148<fieldset style="float:right; margin-right: 5px;">
149<legend>Spacing</legend>
150
151<div class="space"></div>
152
153<div class="fr">Cell spacing:</div>
154<input type="text" name="spacing" id="f_spacing" size="5" value="1"
155title="Space between adjacent cells" />
156
157<p />
158
159<div class="fr">Cell padding:</div>
160<input type="text" name="padding" id="f_padding" size="5" value="1"
161title="Space between content and border in cell" />
162
163<div class="space"></div>
164
165</fieldset>
166
167<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
168<button type="button" name="ok" onclick="return onOK();">OK</button>
169<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
170</div>
171
172</form>
173
174</body>
175</html>
Note: See TracBrowser for help on using the repository browser.