1 (edited by skillful 2011-04-10 2:31:18 PM)

Topic: TINYMCE and xajax

Where an error in a code? It is desirable to show a code. I don't speak on English, I am sorry!!!!


<?php

define('PUN_ROOT', 'http://localhost/subdomain/subdomain/');

require_once("../../../../ajax/xajax_core/xajax.inc.php");




function test($sId)
{
    $Response = new xajaxResponse();

    $Response->includeScript(PUN_ROOT.'include/viz_redaktor/tinymce/jscripts/tiny_mce/tiny_mce.js');
    $Response->includeScript(PUN_ROOT.'include/viz_redaktor/tinymce/jscripts/general.js');

    $tinyMCE = 'tinyMCE.init({
   
    mode : "textareas",
        theme : "advanced",
        plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
    });';

    $Response->script($tinyMCE);

    $message = $sId['content'];

    $fly_block2 = '<textarea name="content" id="content" style="width:100%">'.$message.'</textarea>';

    $Response->alert(print_r($sId,true));
    $Response->Assign("output", "innerHTML",  $fly_block2);
    return $Response;
}

$xajax = new xajax();
$xajax->setFlag("debug", true);
$xajax->registerFunction("test");

$xajax->processRequest();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>


<?php
$xajax->printJavascript('http://localhost/subdomain/subdomain/ajax/');
?>


<!-- TinyMCE -->


<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
   
tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
});
</script>

</head>
<body>

<form id="form" method="post" action="somepage">
 
    <textarea class="post" name="user_text" id="user_text" cols="65" rows="15" style="width:600px"></textarea>
   
    <a class="btn" href="javascript:;"
        onclick="tinyMCE.triggerSave(false,false);tinymce.execCommand('mceToggleEditor',false,'content');">
        <span>Toggle TinyMCE</span>
    </a>

    <input type="button" class="button" value="add comment"

    onClick="tinyMCE.triggerSave(false,false);xajax_test(xajax.getFormValues('form')); return false;" accesskey="s" /></div></div>
</form>


<div id="output"></div>

</body>
</html>

Re: TINYMCE and xajax

any one please help me with this TINYMCE and xajax its not working

Re: TINYMCE and xajax

See this post:

http://community.xajax-project.org/topi … ith-xajax/

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.