wysiwyg fejl ?
Hejza. Jeg sidder og rodder med sådan en editor. Vil ikke bruge Phonixv kanon gode version, da jeg ikke skal bruge alle funktioner i den. Det bliver sur hvis man fjerner funktioner, så har prøvet med en anden. Nu kom så et problem, jeg skal lave et link. Her vil jeg til gengæld gerne bruge hans popup. Har Tilføjet script.js til siden og den se nu sådan her ud:/*
PhoenixV's WYS-II-WYG editor, version 1.3a
Kommenteret d. 05/08-2003
*/
function indsaetBill() {
window.showModalDialog("billede.html", window, "center:yes;status:no;help:no;dialogWidth:295px;dialogHeight:112px;");
}
function indsaetLink() {
window.showModalDialog("link.html", window, "center:yes;status:no;help:no;dialogWidth:388px;dialogHeight:138px;");
}
function indsaetEmail() {
window.showModalDialog("email.html", window, "center:yes;status:no;help:no;dialogWidth:321px;dialogHeight:123px;");
}
function indsaetTabel() {
window.showModalDialog("tabel.html", window, "center:yes;status:no;help:no;dialogWidth:343px;dialogHeight:140px;");
}
Min kode ser sådan her ud:
<html>
<head>
<script type="text/javascript" src="script.js"></script>
<script>
function initFrame() {
frames.idContent.document.body.innerHTML = idContentTemp.innerHTML;
frames.idContent.document.body.style.border = "1px solid";
frames.idContent.document.designMode = "on";
}
function doSave() {
document.f.t.value = frames.idContent.document.body.innerHTML; //Her smides editor indhold i input felt
if (confirm("Du er ved at gemme dokumentet.\nEr du sikker på at du er færdig med at redigere?")) {
return true;
} else {
return false;
}
document.f.submit();//Her må du opdatere record med php
}
</script>
</head>
<body>
<a href="#" onclick="doSave();">gem</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('cut');">klip</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('copy');">kopier</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('paste');">sæt ind</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('bold');">fed</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('JustifyCenter')">Center</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('JustifyLeft')">Left</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('JustifyRight')">Rigth</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('italic');">italic</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('Undo');">Fejlk</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('Redo');">Merek</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('underline');">underline</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('insertunorderedlist');">bulllist</a>
<a href="#" onclick="frames.idContent.focus();frames.idContent.document.execCommand('insertorderedlist');">numlist</a> <br><br>
<a href="#" onClick="indsaetLink();">Link</a> <br><br>
<iframe id="idContent" name="idContent" onload="initFrame();" frameborder="no"></iframe>
<div id="idContentTemp" style="display:none;">indsæt php db kald her</div>
<form name="f" method="post" action="" style="display:inline;">
<input type="hidden" name="t">
</form>
</body>
</html>
Kan nogen hjælpe mig til at få rettet det til at virke?
