dcsimg
Can anyone help with yui text editor
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zoran_pekez
Posted On:   Saturday, August 29, 2009 06:12 AM

I have used Ritch text editor form yui library, and it posts texts to my forum fine. However, there is a problem with deleting texts form the forum pages, because, I can not make delete button perform the following function. When editing and also deleting a thread, variable $vars needs to be sent together with the post. Diference is that when editing, on submit the page posts on itself, while when deleting the page is posted to kill.php. // to specify the extra trailing variables to send via POST along with the form I use: $vars = ($postID ? "?postID=".$postID : ($new_thread ? "?new_thread=true" : "")); // if this is a post edit, create $vars that will delete the post if sent to ki   More>>

I have used Ritch text editor form yui library, and it posts texts to my forum fine.
However, there is a problem with deleting texts form the forum pages, because, I can not make delete button perform the following function.

When editing and also deleting a thread, variable $vars needs to be sent together with the post. Diference is that when editing, on submit the page posts on itself, while when deleting the page is posted to kill.php.

// to specify the extra trailing variables to send via POST along with the form I use:
$vars = ($postID ? "?postID=".$postID : ($new_thread ? "?new_thread=true" : ""));

// if this is a post edit, create $vars that will delete the post if sent to kill.php
else if submited on itself and if this is a new thread, than if will edit the text or submit a new thread.
// this uses the javascript function from forum.inc to prompt the user
// to make sure theyre sure
if ($postID) {
$vars = "?postID=".$postID;
echo "


ACTION='kill.php?postID=".$postID."' METHOD='POST'>";
}

Now this is from file YUI.js that controls the Rich Text Editor:

YAHOO.util.Event.onDOMReady(initialiseMe);


function initialiseMe() {
var postEditor = new YAHOO.widget.Editor('postBody',{
height:'200px',
width:'575px',
dompath:true,
animate:true,
hadleSubmit:false
});
postEditor.render();

// and this creates panel that holds the text editor:

var postBodyPanel=new YAHOO.widget.Panel('win',{
width:'600px',
fixedcenter:false,
underlay:'shadow',
close:false,
visible:true
});
//postBodyPanel.setHeader("");


// and this creates the spaceholders for submit and delete buttons:

postBodyPanel.setFooter("
");


//setup submit button
var oSubmitButton = new YAHOO.widget.Button({
id: 'submitButton',
type:'button',
label:'Submit',
container:'submitBTN'
});
//event hedling
oSubmitButton.addListener('click',function() {
postEditor.saveHTML();
document.postEntry.submit();
});


postBodyPanel.render();
}


Can you suggest how to create delete button as well.    <<Less
About | Sitemap | Contact