Hello all.
Heres the scoop... I've developed a Forum Extension for MediaWiki and a couple users asked to make the forum compatible with the FCKeditor MediaWiki Extension.
Im having a problem with the following javascript; after searching the net and coming up empty i thought i would post here.
While posting a new thread with the Forum Extension the FCKeditor is appearing and functioning fine (the forum uses its own submit form and database tables to hold posts and threads).
In the posting area there is a strip of smiles which are added to the post textbox via javascript. These smiles work fine with the FCKeditor and IE, but do not work with Firefox.
Heres is a small part of the php function which displayed the posting form.
heres is the javascript which adds the smiles...
Theres alittle more to that javasctript but this forum kicks up the following error when trying to post it.
Anyway...
my javascript skills are vary poor so im hoping someone will beable ot help out with this.
Thanks for your time.
_
Heres the scoop... I've developed a Forum Extension for MediaWiki and a couple users asked to make the forum compatible with the FCKeditor MediaWiki Extension.
Im having a problem with the following javascript; after searching the net and coming up empty i thought i would post here.
While posting a new thread with the Forum Extension the FCKeditor is appearing and functioning fine (the forum uses its own submit form and database tables to hold posts and threads).
In the posting area there is a strip of smiles which are added to the post textbox via javascript. These smiles work fine with the FCKeditor and IE, but do not work with Firefox.
Heres is a small part of the php function which displayed the posting form.
function PostForm(...){
global $oFCKeditorExtension, $pageEditor, $IP, $wgOut;
if (file_exists($IP . '/extensions/FCKeditor/FCKeditor.php') AND $this->FCKeditor){
// needs work, paseing wiki links wrong
#$form->textbox1 = $wgOut->parse($boxPost) ;
$form->textbox1 = str_replace("\r", '<br />', $boxPost);
$boxPost = $form->textbox1;
$oFCKeditorExtension->onEditPageShowEditFormInitial($form);
}
$html .= '<form id="editform" name="editform" action="'.$this->awclink.'post/todo_'.urlencode($todo).'" method="post" enctype="multipart/form-data" '.$extra['javaCheck'] .'>';
$html .= '<textarea name="wpTextbox1" id="wpTextbox1" cols="'.$this->boxwidth.'" rows="'.$extra['tbRows'].'" wrap="virtual" class="post_box">'.$boxPost.'</textarea>';
}
heres is the javascript which adds the smiles...
function add_emotions(emot){
var emo = emot.replace("%27","'")
// needs iframe work... FF not working
if(document.getElementById('wpTextbox1___Frame')){
// alert("frame");
var myIframe=document.getElementById('wpTextbox1___Frame').contentWindow;
var myField= myIframe.document.getElementById('xEditingArea');
} else {
// alert("no frame");
var myField = document.getElementById("wpTextbox1");
}
}
Theres alittle more to that javasctript but this forum kicks up the following error when trying to post it.
Not AcceptableThere is nothing special about the javascript which i have not included, it just has an IE/Moxxila check with myField.value= in it. The problem (i think) is in the javascript which i posted, trying to work with the iframe.
An appropriate representation of the requested resource /forums/posting.php could not be found on this server.
Anyway...
my javascript skills are vary poor so im hoping someone will beable ot help out with this.
Thanks for your time.
_
