שלום.
יש ברשותי עורך טקסט שמשום מה הוא לא עובד בFF...עכשיו רציתי לשאול כיצד לעשות שהוא יעבוד...הנה הקוד שלו:
HTML קוד:
<html dir="rtl">
<head>
<title>WYSIWYG - By BlueNosE</title>
<script>
function addtext(eCommandname)
{
document.getElementById('editor').focus();
document.execCommand(eCommandname);
document.getElementById('editor').focus();
}
function insertimage()
{
document.getElementById('editor').focus();
document.execCommand('insertimage',true);
document.getElementById('editor').focus();
}
function othercolor()
{
document.getElementById('editor').focus();
var oc = prompt ("כתוב כאן את שם הצבע או את מספרו (6 ספרות, בלי #):","");
if (oc == "NULL" || oc == "")
document.getElementById('editor').focus();
else
{
document.execCommand('forecolor',false,oc);
document.getElementById('editor').focus();
}
}
function otherfont()
{
document.getElementById('editor').focus();
var oc = prompt ("כתוב כאן את שם הפונט:","");
if (oc == "NULL" || oc == "")
document.getElementById('editor').focus();
else
{
document.execCommand('fontname',false,oc);
document.getElementById('editor').focus();
}
}
function smile(path)
{
document.getElementById('editor').focus();
document.execCommand('absoluteposition',false,1);
document.getElementById('editor').focus();
}
function putin(str)
{
s = str.toLowerCase();
f.code.value = s;
}
</script>
</head>
<body bgcolor="#ffffff">
<select id="slct" onchange="if (this[this.selectedIndex].value != 'none') {
if (this[this.selectedIndex].value == 'other') othercolor(); else {
document.getElementById('editor').focus();
document.execCommand('forecolor',false,this[this.selectedIndex].value);
document.getElementById('editor').focus();}}"
style="font-family:arial;font-weight:bold;width:50px;">
<option value="none" style="color:#626262;" id="none">צבע</option>
<option value="black" style="color:black;">●</option>
<option value="red" style="color:red;">●</option>
<option value="orange" style="color:orange;">●</option>
<option value="yellow" style="color:yellow;">●</option>
<option value="lightgreen" style="color:lightgreen;">●</option>
<option value="green" style="color:green;">●</option>
<option value="blue" style="color:blue;">●</option>
<option value="other" style="color:#626262;">אחר...</option>
</select>
<select id="slctfont" onchange="if (this[this.selectedIndex].value != 'none') {
if (this[this.selectedIndex].value == 'other') otherfont(); else {
document.getElementById('editor').focus();
document.execCommand('fontname',false,this[this.selectedIndex].value);
document.getElementById('editor').focus();}}"
style="font-weight:bold;font-family:arial;">
<option value="none" style="color:#626262;" id="none">גופן</option>
<option value="arial">אריאל</option>
<option value="tahoma">טהומה</option>
<option value="courier">קורייר</option>
<option value="geneva">ג'נבה</option>
<option value="times new roman">טיימס</option>
<option value="comic sans ms">קומיק</option>
<option value="impact">אימפקט</option>
<option value="other" style="color:#626262;">אחר...</option>
</select>
<select id="slctsize" onchange="if (this[this.selectedIndex].value != 'none') {
document.getElementById('editor').focus();
document.execCommand('fontsize',false,this[this.selectedIndex].value);
document.getElementById('editor').focus();}"
style="font-weight:bold;font-family:arial;">
<option value="none" style="color:#626262;" id="none">גודל</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<img src="_line.gif" hspace="0" vspace="0" width="1" height="20" />
<input type="image" src="undo.gif" onclick="addtext('undo');" width="21" height="20" />
<input type="image" src="redo.gif" onclick="addtext('redo');" width="21" height="20" />
<br />
<input type="image" src="bold.gif" onclick="addtext('bold');" width="21" height="20" />
<input type="image" src="underline.gif" onclick="addtext('underline');" width="21" height="20" />
<input type="image" src="italic.gif" onclick="addtext('italic');" width="21" height="20" />
<img src="_line.gif" hspace="0" vspace="0" width="1" height="20" />
<input type="image" src="link.gif" onclick="addtext('createlink');" width="21" height="20" />
<input type="image" src="unlink.gif" onclick="addtext('unlink');" width="21" height="20" />
<input type="image" src="img.gif" onclick="insertimage();" width="21" height="20" />
<img src="_line.gif" hspace="0" vspace="0" width="1" height="20" />
<input type="image" src="right.gif" onclick="addtext('justifyright');" width="21" height="20" />
<input type="image" src="center.gif" onclick="addtext('justifycenter');" width="21" height="20" />
<input type="image" src="left.gif" onclick="addtext('justifyleft');" width="21" height="20" />
<img src="_line.gif" hspace="0" vspace="0" width="1" height="20" />
<input type="image" src="ol.gif" onclick="addtext('insertorderedlist');" width="21" height="20" />
<input type="image" src="ul.gif" onclick="addtext('insertunorderedlist');" width="21" height="20" />
<input type="image" src="indent.gif" onclick="addtext('indent');" width="21" height="20" />
<input type="image" src="outdent.gif" onclick="addtext('outdent');" width="21" height="20" />
<img src="_line.gif" hspace="0" vspace="0" width="1" height="20" />
<input type="image" src="remove.gif" onclick="addtext('removeformat');" width="21" height="20" />
<input type="image" src="smiles/smile.gif" onclick="smile('smile.gif');" width="15" height="15" />
<input type="image" src="ins.gif" onclick="addtext('overwrite');" width="21" height="20" />
<input type="image" src="saveas.gif" onclick="addtext('saveas');" width="21" height="20" />
<div contenteditable="true"
style="border:1px solid black;height:250px;width:450px;overflow:auto;" id="editor"></div>
<a href="javascript:;" onclick="putin(editor.innerHTML);">[ HTML ]</a>
<form name="f">
<textarea id="code" name="code" rows="10" cols="60" readonly="readonly" unselectable="off"
style="font-family:lucida sans, lucida sans unicode, arial;font-size:14px;direction:ltr;
background-color:#ffffff;border:1px solid black;">
</textarea><br />
</body>
</html>