<?php
/**
 * $Horde: horde/util/editor/designmode/editor.php,v 1.7 2003/01/03 12:44:49 jan Exp $
 *
 * Copyright 2002-2003 Chuck Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

define('HORDE_BASE', dirname(__FILE__) . '/../../..');
require_once HORDE_BASE . '/lib/base.php';

$title = _("DHTML Rich Text Editor");
$js_onLoad = null;

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DHTML Rich Text Editor</title>

<style>
body {
    border: 0;
    margin: 0;
    background: buttonface;
}

iframe {
    padding-top: 0px;
    width: 100%;
    height: 100%;
    border: 2px inset;
}

td.coolButton {
    font-family: arial;
    font-size: 14px;
    width: 16px;
    height: 16px;
    font: menu;
}
</style>

<script language="JavaScript" type="text/javascript" src="stringbuilder.js"></script>
<script language="JavaScript" type="text/javascript" src="editor.js"></script>
<script language="JavaScript" type="text/javascript" src="coolbuttons.js"></script>
<script language="JavaScript" type="text/javascript">

var public_description = new Editor();

function fixSize() {
    var edit = document.all.edit;
    edit.style.top = toolBar.offsetHeight;
    edit.style.height = Math.max(0, document.body.offsetHeight - toolBar.offsetHeight - 4);
    edit.style.width = Math.max(0, document.body.offsetWidth - 4);
}

window.onresize = fixSize;

</script>
</head>
<body scroll="no">

<table cellspacing="0" id="toolBar">
    <tr>
        <td class="coolButton" onclick="document.all.edit.setCut(); document.all.edit.frameWindow.focus();">
            &nbsp;<b><?php echo _("Cut") ?></b>&nbsp;
        </td>
        <td class="coolButton" onclick="document.all.edit.setCopy(); document.all.edit.frameWindow.focus();">
            &nbsp;<b><?php echo _("Copy") ?></b>&nbsp;
        </td>
        <td class="coolButton" onclick="document.all.edit.setPaste(); document.all.edit.frameWindow.focus();">
            &nbsp;<b><?php echo _("Paste") ?></b>&nbsp;
        </td>
        <td class="coolButton" onclick="document.all.edit.setBold(); document.all.edit.frameWindow.focus();">
            &nbsp;<b><?php echo _("Bold") ?></b>&nbsp;
        </td>
        <td class="coolButton" onclick="document.all.edit.setItalic(); document.all.edit.frameWindow.focus();">
            &nbsp;<i><?php echo _("Italic") ?></i>&nbsp;
        </td>
        <td class="coolButton" onclick="document.all.edit.setUnderline(); document.all.edit.frameWindow.focus();">
            &nbsp;<u><?php echo _("Underline") ?></u>&nbsp;
        </td>
        <td><div style="width: 2px; border: 1px inset; margin-top: 1px"></div></td>
    </tr>
</table>

<iframe frameborder="0" id="edit" class="richEdit" onblur="return false" usebr="usebr"></iframe>

</body>

<script type="text/javascript">
fixSize();
var all = document.all;
var l = all.length;
for (var i = 0; i < l; i++) {
    if (all[i].tagName != "INPUT" && all[i].tagName != "TEXTAREA") {
        all[i].unselectable = "on";
    }
}
</script>
</html>
