//#### The OK button was hit.
function Ok()
{
if ( oEditor.FCKBrowserInfo.IsIE )
oEditor.FCKUndo.SaveUndoStep() ;
eAL.toggle("txtSource");
FCK.SetData( document.getElementById('txtSource').value, false ) ;
return true ;
}
</script>
<script language="javascript" type="text/javascript" src="<path to editArea>/edit_area_full.js"></script>
<script language="javascript" type="text/javascript">
editAreaLoader.init({
id : "txtSource" // textarea id
,syntax: "html" // syntax to be uses for highgliting
,start_highlight: true // to display with highlight mode on start-up
,allow_toggle: false
});
</script>
</head>
//#### The OK button was hit.
function Ok()
{
if ( oEditor.FCKBrowserInfo.IsIE )
oEditor.FCKUndo.SaveUndoStep() ;
FCK.SetData( document.getElementById('txtSource').value, false ) ;
return true ;
}
</script>
</head>
window.onload = function()
{
// EnableXHTML and EnableSourceXHTML has been deprecated
// document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
var width=document.body.offsetWidth-25;
document.getElementById('txtSource').style.width=width+'px';
}
I have only tested this in FF 3.5 and IE 8, but they both appeared to work correctly and I have used something similar in other browsers, so I am confident enough to offer this up as an alternative to the fixed width issue.
didn't check to see if this was posted elsewhere, sorry if it is.
Re: Enhance FCK-Editor to a real time syntax highlighting editor
Re: Enhance FCK-Editor to a real time syntax highlighting editor
//#### The OK button was hit. function Ok() { if ( oEditor.FCKBrowserInfo.IsIE ) oEditor.FCKUndo.SaveUndoStep() ; eAL.toggle("txtSource"); FCK.SetData( document.getElementById('txtSource').value, false ) ; return true ; } </script> <script language="javascript" type="text/javascript" src="<path to editArea>/edit_area_full.js"></script> <script language="javascript" type="text/javascript"> editAreaLoader.init({ id : "txtSource" // textarea id ,syntax: "html" // syntax to be uses for highgliting ,start_highlight: true // to display with highlight mode on start-up ,allow_toggle: false }); </script> </head>//#### The OK button was hit. function Ok() { if ( oEditor.FCKBrowserInfo.IsIE ) oEditor.FCKUndo.SaveUndoStep() ; FCK.SetData( document.getElementById('txtSource').value, false ) ; return true ; } </script> </head>Re: Enhance FCK-Editor to a real time syntax highlighting editor
One note, for IE7 we had to change the WIDTH:100% in the textarea style near the bottom of fck_source.html to a fixed width.
Otherwise, it seems to work great!!
Thanks again!
- Bill
Re: Enhance FCK-Editor to a real time syntax highlighting editor
http://en.wikipedia.org/wiki/Comparison ... de_editors
Codemirror
Dan Dascalescu
Re: Enhance FCK-Editor to a real time syntax highlighting editor
I basically just added two lines to the onload function that gets the size of the window and resizes the textarea appropriately.
The original code:
window.onload = function() { // EnableXHTML and EnableSourceXHTML has been deprecated // document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ; document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ; // Activate the "OK" button. window.parent.SetOkButton( true ) ; }The changed code:
window.onload = function() { // EnableXHTML and EnableSourceXHTML has been deprecated // document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ; document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ; // Activate the "OK" button. window.parent.SetOkButton( true ) ; var width=document.body.offsetWidth-25; document.getElementById('txtSource').style.width=width+'px'; }I have only tested this in FF 3.5 and IE 8, but they both appeared to work correctly and I have used something similar in other browsers, so I am confident enough to offer this up as an alternative to the fixed width issue.
didn't check to see if this was posted elsewhere, sorry if it is.