| 1 | <!DOCTYPE html |
|---|
| 2 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//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 | <head> |
|---|
| 6 | <title>Insert Image</title> |
|---|
| 7 | |
|---|
| 8 | <script type="text/javascript" src="../../popups/popup.js"></script> |
|---|
| 9 | <link rel="stylesheet" type="text/css" href="../../popups/popup.css" /> |
|---|
| 10 | |
|---|
| 11 | <script type="text/javascript"> |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | Xinha = window.opener.Xinha; |
|---|
| 15 | function i18n(str) { |
|---|
| 16 | return (Xinha._lc(str, 'Xinha')); |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | function Init() { |
|---|
| 20 | __dlg_translate('Xinha'); |
|---|
| 21 | __dlg_init(null,{width:410,height:400}); |
|---|
| 22 | |
|---|
| 23 | document.getElementById("f_align").selectedIndex = 1; |
|---|
| 24 | document.getElementById("f_align").selectedIndex = 5; |
|---|
| 25 | var param = window.dialogArguments; |
|---|
| 26 | if (param["f_base"]) { |
|---|
| 27 | document.getElementById("f_base").value = param["f_base"]; |
|---|
| 28 | } |
|---|
| 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"]) { |
|---|
| 36 | window.ipreview.location.replace(Xinha._resolveRelativeUrl(param.f_base, param.f_url)); |
|---|
| 37 | } |
|---|
| 38 | document.getElementById("f_url").focus(); |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | function onOK() { |
|---|
| 42 | var required = { |
|---|
| 43 | "f_url": i18n("You must enter the URL") |
|---|
| 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 | |
|---|
| 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; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | function onCancel() { |
|---|
| 67 | __dlg_close(null); |
|---|
| 68 | return false; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | function onPreview() { |
|---|
| 72 | var f_url = document.getElementById("f_url"); |
|---|
| 73 | var url = f_url.value; |
|---|
| 74 | var base = document.getElementById("f_base").value; |
|---|
| 75 | if (!url) { |
|---|
| 76 | alert(i18n("You must enter the URL")); |
|---|
| 77 | f_url.focus(); |
|---|
| 78 | return false; |
|---|
| 79 | } |
|---|
| 80 | window.ipreview.location.replace(Xinha._resolveRelativeUrl(base, url)); |
|---|
| 81 | return false; |
|---|
| 82 | } |
|---|
| 83 | </script> |
|---|
| 84 | |
|---|
| 85 | </head> |
|---|
| 86 | |
|---|
| 87 | <body class="dialog" onload="Init()"> |
|---|
| 88 | |
|---|
| 89 | <div class="title">Insert Image</div> |
|---|
| 90 | <!--- new stuff ---> |
|---|
| 91 | <form action="" method="get"> |
|---|
| 92 | <input type="hidden" name="base" id="f_base"/> |
|---|
| 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 | |
|---|
| 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 image"> |
|---|
| 121 | <option value="" >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" selected="selected" >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 | <br /> |
|---|
| 134 | |
|---|
| 135 | <div class="fl">Border thickness:</div> |
|---|
| 136 | <input type="text" name="border" id="f_border" size="5" |
|---|
| 137 | title="Leave empty for no border" /> |
|---|
| 138 | |
|---|
| 139 | <div class="space"></div> |
|---|
| 140 | |
|---|
| 141 | </fieldset> |
|---|
| 142 | |
|---|
| 143 | <fieldset> |
|---|
| 144 | <legend>Spacing</legend> |
|---|
| 145 | |
|---|
| 146 | <div class="space"></div> |
|---|
| 147 | |
|---|
| 148 | <div class="fr">Horizontal:</div> |
|---|
| 149 | <input type="text" name="horiz" id="f_horiz" size="5" |
|---|
| 150 | title="Horizontal padding" /> |
|---|
| 151 | |
|---|
| 152 | <br /> |
|---|
| 153 | |
|---|
| 154 | <div class="fr">Vertical:</div> |
|---|
| 155 | <input type="text" name="vert" id="f_vert" size="5" |
|---|
| 156 | title="Vertical padding" /> |
|---|
| 157 | |
|---|
| 158 | <div class="space"></div> |
|---|
| 159 | |
|---|
| 160 | </fieldset> |
|---|
| 161 | <div class="space" style="clear:all"></div> |
|---|
| 162 | <div> |
|---|
| 163 | Image Preview:<br /> |
|---|
| 164 | <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" |
|---|
| 165 | height="200" width="100%" src="../../popups/blank.html"></iframe> |
|---|
| 166 | </div> |
|---|
| 167 | <div id="buttons"> |
|---|
| 168 | <button type="submit" name="ok" onclick="return onOK();">OK</button> |
|---|
| 169 | <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> |
|---|
| 170 | </div> |
|---|
| 171 | </form> |
|---|
| 172 | </body> |
|---|
| 173 | </html> |
|---|