[1] | 1 | <html> |
---|
| 2 | |
---|
| 3 | <head> |
---|
| 4 | <title>Insert Table</title> |
---|
| 5 | |
---|
| 6 | <script type="text/javascript" src="popup.js"></script> |
---|
[109] | 7 | <link rel="stylesheet" type="text/css" href="popup.css" /> |
---|
[1] | 8 | |
---|
| 9 | <script type="text/javascript"> |
---|
| 10 | |
---|
| 11 | window.resizeTo(400, 100); |
---|
| 12 | |
---|
[246] | 13 | HTMLArea = window.opener.HTMLArea; |
---|
| 14 | function i18n(str) { |
---|
| 15 | return (HTMLArea._lc(str, 'HTMLArea')); |
---|
[419] | 16 | } |
---|
[246] | 17 | |
---|
[1] | 18 | function Init() { |
---|
[60] | 19 | HTMLArea = window.opener.HTMLArea; // load the HTMLArea plugin and lang file |
---|
| 20 | __dlg_translate('HTMLArea'); |
---|
[1] | 21 | __dlg_init(); |
---|
[246] | 22 | // Make sure the translated string appears in the drop down. (for gecko) |
---|
| 23 | document.getElementById("f_unit").selectedIndex = 1; |
---|
| 24 | document.getElementById("f_unit").selectedIndex = 0; |
---|
| 25 | document.getElementById("f_align").selectedIndex = 1; |
---|
| 26 | document.getElementById("f_align").selectedIndex = 0; |
---|
[1] | 27 | document.getElementById("f_rows").focus(); |
---|
[419] | 28 | } |
---|
[1] | 29 | |
---|
| 30 | function onOK() { |
---|
| 31 | var required = { |
---|
[246] | 32 | "f_rows": i18n("You must enter a number of rows"), |
---|
| 33 | "f_cols": i18n("You must enter a number of columns") |
---|
[1] | 34 | }; |
---|
| 35 | for (var i in required) { |
---|
| 36 | var el = document.getElementById(i); |
---|
| 37 | if (!el.value) { |
---|
| 38 | alert(required[i]); |
---|
| 39 | el.focus(); |
---|
| 40 | return false; |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | var fields = ["f_rows", "f_cols", "f_width", "f_unit", "f_fixed", |
---|
| 44 | "f_align", "f_border", "f_spacing", "f_padding"]; |
---|
| 45 | var param = new Object(); |
---|
| 46 | for (var i in fields) { |
---|
| 47 | var id = fields[i]; |
---|
| 48 | var el = document.getElementById(id); |
---|
| 49 | param[id] = (el.type == "checkbox") ? el.checked : el.value; |
---|
| 50 | } |
---|
| 51 | __dlg_close(param); |
---|
| 52 | return false; |
---|
[419] | 53 | } |
---|
[1] | 54 | |
---|
| 55 | function onCancel() { |
---|
| 56 | __dlg_close(null); |
---|
| 57 | return false; |
---|
[419] | 58 | } |
---|
[1] | 59 | |
---|
| 60 | </script> |
---|
| 61 | |
---|
| 62 | </head> |
---|
| 63 | |
---|
[239] | 64 | <body class="dialog" onload="Init()"> |
---|
[1] | 65 | |
---|
| 66 | <div class="title">Insert Table</div> |
---|
| 67 | |
---|
| 68 | <form action="" method="get"> |
---|
| 69 | <table border="0" style="padding: 0px; margin: 0px"> |
---|
| 70 | <tbody> |
---|
| 71 | |
---|
| 72 | <tr> |
---|
| 73 | <td style="width: 4em; text-align: right">Rows:</td> |
---|
| 74 | <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td> |
---|
| 75 | <td style="width: 4em; text-align: right">Width:</td> |
---|
| 76 | <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td> |
---|
| 77 | <td><select size="1" name="unit" id="f_unit" title="Width unit"> |
---|
| 78 | <option value="%" selected="1" >Percent</option> |
---|
| 79 | <option value="px" >Pixels</option> |
---|
| 80 | <option value="em" >Em</option> |
---|
| 81 | </select></td> |
---|
| 82 | </tr> |
---|
| 83 | <tr> |
---|
| 84 | <td style="width: 4em; text-align: right">Cols:</td> |
---|
| 85 | <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td> |
---|
| 86 | <td style="text-align: right"><input type="checkbox" checked="checked" name="fixed" id="f_fixed" /></td> |
---|
| 87 | <td colspan="2"><label for="f_fixed" |
---|
| 88 | >Fixed width columns</label></td> |
---|
| 89 | </tr> |
---|
| 90 | </tbody> |
---|
| 91 | </table> |
---|
| 92 | |
---|
| 93 | <p /> |
---|
| 94 | |
---|
| 95 | <fieldset style="float: left; margin-left: 5px;"> |
---|
| 96 | <legend>Layout</legend> |
---|
| 97 | |
---|
| 98 | <div class="space"></div> |
---|
| 99 | |
---|
| 100 | <div class="fl">Alignment:</div> |
---|
| 101 | <select size="1" name="align" id="f_align" |
---|
| 102 | title="Positioning of this table"> |
---|
| 103 | <option value="" selected="1" >Not set</option> |
---|
| 104 | <option value="left" >Left</option> |
---|
| 105 | <option value="right" >Right</option> |
---|
| 106 | <option value="texttop" >Texttop</option> |
---|
| 107 | <option value="absmiddle" >Absmiddle</option> |
---|
| 108 | <option value="baseline" >Baseline</option> |
---|
| 109 | <option value="absbottom" >Absbottom</option> |
---|
| 110 | <option value="bottom" >Bottom</option> |
---|
| 111 | <option value="middle" >Middle</option> |
---|
| 112 | <option value="top" >Top</option> |
---|
| 113 | </select> |
---|
| 114 | |
---|
| 115 | <p /> |
---|
| 116 | |
---|
| 117 | <div class="fl">Border thickness:</div> |
---|
| 118 | <input type="text" name="border" id="f_border" size="5" value="1" |
---|
| 119 | title="Leave empty for no border" /> |
---|
| 120 | <!-- |
---|
| 121 | <p /> |
---|
| 122 | |
---|
| 123 | <div class="fl">Collapse borders:</div> |
---|
| 124 | <input type="checkbox" name="collapse" id="f_collapse" /> |
---|
| 125 | --> |
---|
| 126 | <div class="space"></div> |
---|
| 127 | |
---|
| 128 | </fieldset> |
---|
| 129 | |
---|
| 130 | <fieldset style="float:right; margin-right: 5px;"> |
---|
| 131 | <legend>Spacing</legend> |
---|
| 132 | |
---|
| 133 | <div class="space"></div> |
---|
| 134 | |
---|
| 135 | <div class="fr">Cell spacing:</div> |
---|
| 136 | <input type="text" name="spacing" id="f_spacing" size="5" value="1" |
---|
| 137 | title="Space between adjacent cells" /> |
---|
| 138 | |
---|
| 139 | <p /> |
---|
| 140 | |
---|
| 141 | <div class="fr">Cell padding:</div> |
---|
| 142 | <input type="text" name="padding" id="f_padding" size="5" value="1" |
---|
| 143 | title="Space between content and border in cell" /> |
---|
| 144 | |
---|
| 145 | <div class="space"></div> |
---|
| 146 | |
---|
| 147 | </fieldset> |
---|
| 148 | |
---|
| 149 | <div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;"> |
---|
| 150 | <button type="button" name="ok" onclick="return onOK();">OK</button> |
---|
| 151 | <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> |
---|
| 152 | </div> |
---|
| 153 | |
---|
| 154 | </form> |
---|
| 155 | |
---|
| 156 | </body> |
---|
[246] | 157 | </html> |
---|