File "editor_image.html"

Full Path: /home/analogde/www/private/templates/common/editor_image.html
File size: 2.69 KB
MIME-type: text/html
Charset: utf-8

<html>
<head><title>Insert Image</title>
<style><%include editor_dialog.css%></style>
<script>
function formSubmit() {
  var img_source = document.getElementById('img_source');
  var img_title  = document.getElementById('img_title');
  var img_width  = document.getElementById('img_width');
  var img_height = document.getElementById('img_height');
  var img_border = document.getElementById('img_border');
  var img_align  = document.getElementById('img_align');
  if (img_source.value != '') {      
    var img = document.createElement('IMG');
    img.src = img_source.value;

    if (img_title.value)  img.title = img_title.value;
    if (img_width.value)  img.width = img_width.value;
    if (img_height.value) img.height= img_height.value;
    if (img_border.value) img.height= img_border.value;
    if (img_align.options[img_align.selectedIndex].value != '') {
      img.align = img_align.options[img_align.selectedIndex].value;          
    }
    opener.dialogWindow.returnFunc(img);
    window.close();
  }
  else {
    alert("Please enter image source");
  }
}
</script>
</head>
<body class=body>
<BR>
<table border=0 cellpadding=3 align=center width="100%">
    <tr class="body">
      <td valign="top"><div>Source:</div></td>
      <td colspan="2">
        <input size="37" id="img_source" name="img_source" value="http://">
      </td>
    </tr>
    <tr class="body">
      <td class="body" width="25%">Title:</td>
      <td class="body" width="75%"  colspan="2">
        <input type="text" id="img_title" size="37">
      </td>
    </tr>
    <tr class="body">
      <td class="body" width="25%">Width:</td>
      <td class="body" width="20%">
        <input type="text" id="img_width" size="5">
      </td>
      <td class="body"  align="right">Height:&nbsp;
        <input type="text" id="img_height" size="5">
      </td>
    </tr>
    <tr class="body">
      <td class="body" width="25%">Border:</td>
      <td class="body" width="20%">
        <input type="text" id="img_border" size="5">
      </td>
      <td class="body" align="right">Alignment:&nbsp;
        <select id="img_align">
          <option =''>Normal</option>
          <option ='bottom'>Bottom</option>
          <option ='left'>Left</option>
          <option ='middle'>Middle</option>
          <option ='right'>Right</option>
          <option ='texttop'>Texttop</option>
          <option ='top'>Top</option>
        </select>
      </td>
    </tr>
    <tr class=body>
        <td align="right" colspan="3">
            <HR>
            <input type="button" class=button onclick="formSubmit()" value="Submit">
            <input type="button" class=button onclick="window.close(); opener.setFocus();" value="Cancel">
        </td>
    </tr>
</table>
</body>
</html>