lenya/src/webapp/lenya/resources/misc/midas/midas_files backcolor.gif,NONE,1.1 bold.gif,NONE,1.1 colors.html,NONE,1.1 content.html,NONE,1.1 copy.gif,NONE,1.1 cut.gif,NONE,1.1 forecolor.gif,NONE,1.1 indent.gif,NONE,1.1 italic.gif,NONE,1.1 justifycenter.gif,NONE,1.1 justifyleft.gif,NONE,1.1 justifyright.gif,NONE,1.1 link.gif,NONE,1.1 midas.css,NONE,1.1 midas.js,NONE,1.1 orderedlist.gif,NONE,1.1 outdent.gif,NONE,1.1 paste.gif,NONE,1.1 redo.gif,NONE,1.1 table.gif,NONE,1.1 underline.gif,NONE,1.1 undo.gif,NONE,1.1 unorderedlist.gif,NONE,1.1

Michael Wechner <[email protected]> Tue, 20 May 2003 21:00:27 +0200
Newsgroups gmane.comp.cms.wyona.cvs
Message-ID <[email protected]>
Update of /repository/lenya/src/webapp/lenya/resources/misc/midas/midas_files
In directory erbium:/tmp/cvs-serv22013/midas/midas_files

Added Files:
	backcolor.gif bold.gif colors.html content.html copy.gif 
	cut.gif forecolor.gif indent.gif italic.gif justifycenter.gif 
	justifyleft.gif justifyright.gif link.gif midas.css midas.js 
	orderedlist.gif outdent.gif paste.gif redo.gif table.gif 
	underline.gif undo.gif unorderedlist.gif 
Log Message:
Mozilla Midas added

--- NEW FILE: backcolor.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: bold.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: colors.html ---
<html><head><title>Text Color</title>

<script>
function selectColor(color)
{
parent.document.getElementById("edit").contentDocument.execCommand(parent.command, false, color);
parent.document.getElementById("colorpalette").style.visibility="hidden";
parent.document.getElementById("edit").contentWindow.focus();
}

function InitColorPalette() {
  if (document.getElementsByTagName)
    var x = document.getElementsByTagName('TD');
  else if (document.all)
    var x = document.all.tags('TD');
  for (var i=0;i<x.length;i++)
  {
    x[i].onmouseover = over;
    x[i].onmouseout = out;
    x[i].onclick = click;
  }
}

function over()
{
this.style.border='2px dotted white';
}

function out()
{
this.style.border='1px solid gray';
}

function click()
{
  selectColor(this.id);
}
</script></head>
<body bgcolor="white" onload="InitColorPalette()">
<table border="1" cellpadding="1" cellspacing="1">
<tbody><tr>
<td id="#FFFFFF" bgcolor="#ffffff" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCCCC" bgcolor="#ffcccc" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC99" bgcolor="#ffcc99" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF99" bgcolor="#ffff99" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFFCC" bgcolor="#ffffcc" width="20" height="20"><img width="1" height="1"></td>
<td id="#99FF99" bgcolor="#99ff99" width="20" height="20"><img width="1" height="1"></td>
<td id="#99FFFF" bgcolor="#99ffff" width="20" height="20"><img width="1" height="1"></td>
<td id="#CCFFFF" bgcolor="#ccffff" width="20" height="20"><img width="1" height="1"></td>
<td id="#CCCCFF" bgcolor="#ccccff" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCCFF" bgcolor="#ffccff" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#CCCCCC" bgcolor="#cccccc" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF6666" bgcolor="#ff6666" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF9966" bgcolor="#ff9966" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF66" bgcolor="#ffff66" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF33" bgcolor="#ffff33" width="20" height="20"><img width="1" height="1"></td>
<td id="#66FF99" bgcolor="#66ff99" width="20" height="20"><img width="1" height="1"></td>
<td id="#33FFFF" bgcolor="#33ffff" width="20" height="20"><img width="1" height="1"></td>
<td id="#66FFFF" bgcolor="#66ffff" width="20" height="20"><img width="1" height="1"></td>
<td id="#9999FF" bgcolor="#9999ff" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF99FF" bgcolor="#ff99ff" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#C0C0C0" bgcolor="#c0c0c0" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF0000" bgcolor="#ff0000" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF9900" bgcolor="#ff9900" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC66" bgcolor="#ffcc66" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFFF00" bgcolor="#ffff00" width="20" height="20"><img width="1" height="1"></td>
<td id="#33FF33" bgcolor="#33ff33" width="20" height="20"><img width="1" height="1"></td>
<td id="#66CCCC" bgcolor="#66cccc" width="20" height="20"><img width="1" height="1"></td>
<td id="#33CCFF" bgcolor="#33ccff" width="20" height="20"><img width="1" height="1"></td>
<td id="#6666CC" bgcolor="#6666cc" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC66CC" bgcolor="#cc66cc" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#999999" bgcolor="#999999" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC0000" bgcolor="#cc0000" width="20" height="20"><img width="1" height="1"></td>
<td id="#FF6600" bgcolor="#ff6600" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC33" bgcolor="#ffcc33" width="20" height="20"><img width="1" height="1"></td>
<td id="#FFCC00" bgcolor="#ffcc00" width="20" height="20"><img width="1" height="1"></td>
<td id="#33CC00" bgcolor="#33cc00" width="20" height="20"><img width="1" height="1"></td>
<td id="#00CCCC" bgcolor="#00cccc" width="20" height="20"><img width="1" height="1"></td>
<td id="#3366FF" bgcolor="#3366ff" width="20" height="20"><img width="1" height="1"></td>
<td id="#6633FF" bgcolor="#6633ff" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC33CC" bgcolor="#cc33cc" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#666666" bgcolor="#666666" width="20" height="20"><img width="1" height="1"></td>
<td id="#990000" bgcolor="#990000" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC6600" bgcolor="#cc6600" width="20" height="20"><img width="1" height="1"></td>
<td id="#CC9933" bgcolor="#cc9933" width="20" height="20"><img width="1" height="1"></td>
<td id="#999900" bgcolor="#999900" width="20" height="20"><img width="1" height="1"></td>
<td id="#009900" bgcolor="#009900" width="20" height="20"><img width="1" height="1"></td>
<td id="#339999" bgcolor="#339999" width="20" height="20"><img width="1" height="1"></td>
<td id="#3333FF" bgcolor="#3333ff" width="20" height="20"><img width="1" height="1"></td>
<td id="#6600CC" bgcolor="#6600cc" width="20" height="20"><img width="1" height="1"></td>
<td id="#993399" bgcolor="#993399" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#333333" bgcolor="#333333" width="20" height="20"><img width="1" height="1"></td>
<td id="#660000" bgcolor="#660000" width="20" height="20"><img width="1" height="1"></td>
<td id="#993300" bgcolor="#993300" width="20" height="20"><img width="1" height="1"></td>
<td id="#996633" bgcolor="#996633" width="20" height="20"><img width="1" height="1"></td>
<td id="#666600" bgcolor="#666600" width="20" height="20"><img width="1" height="1"></td>
<td id="#006600" bgcolor="#006600" width="20" height="20"><img width="1" height="1"></td>
<td id="#336666" bgcolor="#336666" width="20" height="20"><img width="1" height="1"></td>
<td id="#000099" bgcolor="#000099" width="20" height="20"><img width="1" height="1"></td>
<td id="#333399" bgcolor="#333399" width="20" height="20"><img width="1" height="1"></td>
<td id="#663366" bgcolor="#663366" width="20" height="20"><img width="1" height="1"></td>
</tr>
<tr>
<td id="#000000" bgcolor="#000000" width="20" height="20"><img width="1" height="1"></td>
<td id="#330000" bgcolor="#330000" width="20" height="20"><img width="1" height="1"></td>
<td id="#663300" bgcolor="#663300" width="20" height="20"><img width="1" height="1"></td>
<td id="#663333" bgcolor="#663333" width="20" height="20"><img width="1" height="1"></td>
<td id="#333300" bgcolor="#333300" width="20" height="20"><img width="1" height="1"></td>
<td id="#003300" bgcolor="#003300" width="20" height="20"><img width="1" height="1"></td>
<td id="#003333" bgcolor="#003333" width="20" height="20"><img width="1" height="1"></td>
<td id="#000066" bgcolor="#000066" width="20" height="20"><img width="1" height="1"></td>
<td id="#330099" bgcolor="#330099" width="20" height="20"><img width="1" height="1"></td>
<td id="#330033" bgcolor="#330033" width="20" height="20"><img width="1" height="1"></td>
</tr>
</tbody></table>
</body></html>
--- NEW FILE: content.html ---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:n="http://www.betaversion.org/linotype/news/1.0">

<head>
  <link href="midas_files/main.css" type="text/css" rel="stylesheet">
  <style>
      body { padding: 0px; margin: 0px; border: 0px }
      p { padding: 1px; margin: 4px 0px 4px 0px; }
      blockquote { padding: 1px; margin: 4px 40px 4px 40px; }
      #page { padding: 5px; margin: 0px; border: 0px }
      #page p { background-color: #eee; }
      #page blockquote { background-color: #eee; }
      #page li { background-color: #eee; }
      #source { font-family: monospace; padding: 5px; }
  </style>
</head>

<body class="news" id="page" xmlns="http://www.w3.org/1999/xhtml" xmlns:r="http://xml.apache.org/cocoon/requestgenerator/2.0">
Wie geht es Vanya und Karin?gjhg<br><br>jhjkh$ sdhjh<br>sakdjh<br>asdkhjljkh<br>
</body>
</html>

--- NEW FILE: copy.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: cut.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: forecolor.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: indent.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: italic.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: justifycenter.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: justifyleft.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: justifyright.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: link.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: midas.css ---
/* Midas CSS */

.imagebutton {height: 22; width: 23; border: solid 2px #C0C0C0; background-color: #C0C0C0}

.image {position: relative; left: 1; top: 1; height:20; width:21; border:none;}

.toolbar {height: 30; background-color: #C0C0C0;}

--- NEW FILE: midas.js ---
var command = "";


function InitToolbarButtons() {
  kids = document.getElementsByTagName('DIV');

  for (var i=0; i < kids.length; i++) {
    if (kids[i].className == "imagebutton") {
      kids[i].onmouseover = tbmouseover;
      kids[i].onmouseout = tbmouseout;
      kids[i].onmousedown = tbmousedown;
      kids[i].onmouseup = tbmouseup;
      kids[i].onclick = tbclick;
    }
  }
}

function tbmousedown(e)
{
  this.firstChild.style.left = 2;
  this.firstChild.style.top = 2;
  this.style.border="inset 2px";
  e.preventDefault();
}

function tbmouseup()
{
  this.firstChild.style.left = 1;
  this.firstChild.style.top = 1;
  this.style.border="outset 2px";
}

function tbmouseout()
{
  this.style.border="solid 2px #C0C0C0";
}

function tbmouseover()
{
  this.style.border="outset 2px";
}

  function insertNodeAtSelection(win, insertNode)
  {
      // get current selection
      var sel = win.getSelection();

      // get the first range of the selection
      // (there's almost always only one range)
      var range = sel.getRangeAt(0);

      // deselect everything
      sel.removeAllRanges();

      // remove content of current selection from document
      range.deleteContents();

      // get location of current selection
      var container = range.startContainer;
      var pos = range.startOffset;

      // make a new range for the new selection
      range=document.createRange();

      if (container.nodeType==3 && insertNode.nodeType==3) {

        // if we insert text in a textnode, do optimized insertion
        container.insertData(pos, insertNode.nodeValue);

        // put cursor after inserted text
        range.setEnd(container, pos+insertNode.length);
        range.setStart(container, pos+insertNode.length);

      } else {


        var afterNode;
        if (container.nodeType==3) {

          // when inserting into a textnode
          // we create 2 new textnodes
          // and put the insertNode in between

          var textNode = container;
          container = textNode.parentNode;
          var text = textNode.nodeValue;

          // text before the split
          var textBefore = text.substr(0,pos);
          // text after the split
          var textAfter = text.substr(pos);

          var beforeNode = document.createTextNode(textBefore);
          var afterNode = document.createTextNode(textAfter);

          // insert the 3 new nodes before the old one
          container.insertBefore(afterNode, textNode);
          container.insertBefore(insertNode, afterNode);
          container.insertBefore(beforeNode, insertNode);

          // remove the old node
          container.removeChild(textNode);

        } else {

          // else simply insert the node
          afterNode = container.childNodes[pos];
          container.insertBefore(insertNode, afterNode);
        }

        range.setEnd(afterNode, 0);
        range.setStart(afterNode, 0);
      }

      sel.addRange(range);
  };

function getOffsetTop(elm) {

  var mOffsetTop = elm.offsetTop;
  var mOffsetParent = elm.offsetParent;

  while(mOffsetParent){
    mOffsetTop += mOffsetParent.offsetTop;
    mOffsetParent = mOffsetParent.offsetParent;
  }
 
  return mOffsetTop;
}

function getOffsetLeft(elm) {

  var mOffsetLeft = elm.offsetLeft;
  var mOffsetParent = elm.offsetParent;

  while(mOffsetParent){
    mOffsetLeft += mOffsetParent.offsetLeft;
    mOffsetParent = mOffsetParent.offsetParent;
  }
 
  return mOffsetLeft;
}

function tbclick()
{
  if ((this.id == "forecolor") || (this.id == "hilitecolor")) {
    parent.command = this.id;
    buttonElement = document.getElementById(this.id);
    document.getElementById("colorpalette").style.left = getOffsetLeft(buttonElement);
    document.getElementById("colorpalette").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight;
    document.getElementById("colorpalette").style.visibility="visible";
  } else if (this.id == "createlink") {
    var szURL = prompt("Enter a URL:", "");
    document.getElementById('edit').contentWindow.document.execCommand("CreateLink",false,szURL)
  } else if (this.id == "createtable") {
    e = document.getElementById("edit");
    rowstext = prompt("enter rows");
    colstext = prompt("enter cols");
    rows = parseInt(rowstext);
    cols = parseInt(colstext);
    if ((rows > 0) && (cols > 0)) {
      table = e.contentWindow.document.createElement("table");
      table.setAttribute("border", "1");
      table.setAttribute("cellpadding", "2");
      table.setAttribute("cellspacing", "2");
      tbody = e.contentWindow.document.createElement("tbody");
      for (var i=0; i < rows; i++) {
        tr =e.contentWindow.document.createElement("tr");
        for (var j=0; j < cols; j++) {
          td =e.contentWindow.document.createElement("td");
          br =e.contentWindow.document.createElement("br");
          td.appendChild(br);
          tr.appendChild(td);
        }
        tbody.appendChild(tr);
      }
      table.appendChild(tbody);      
      insertNodeAtSelection(e.contentWindow, table);
    }
  } else {
    document.getElementById('edit').contentWindow.document.execCommand(this.id, false, null);
  }
}

function Select(selectname)
{
  var cursel = document.getElementById(selectname).selectedIndex;
  /* First one is always a label */
  if (cursel != 0) {
    var selected = document.getElementById(selectname).options[cursel].value;
    document.getElementById('edit').contentWindow.document.execCommand(selectname, false, selected);
    document.getElementById(selectname).selectedIndex = 0;
  }
  document.getElementById("edit").contentWindow.focus();
}

function dismisscolorpalette()
{
  document.getElementById("colorpalette").style.visibility="hidden";
}

function Start() {
  document.getElementById('edit').contentWindow.document.designMode = "on";
  try {
    document.getElementById('edit').contentWindow.document.execCommand("undo", false, null);
  }  catch (e) {
    alert("This demo is not supported on your level of Mozilla.");
  }

  InitToolbarButtons();
  document.addEventListener("mousedown", dismisscolorpalette, true);
  document.getElementById("edit").contentWindow.document.addEventListener("mousedown", dismisscolorpalette, true);
  document.addEventListener("keypress", dismisscolorpalette, true);
  document.getElementById("edit").contentWindow.document.addEventListener("keypress", dismisscolorpalette, true);
}

--- NEW FILE: orderedlist.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: outdent.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: paste.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: redo.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: table.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: underline.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: undo.gif ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: unorderedlist.gif ---
(This appears to be a binary file; contents omitted.)