CuteEditor via AJAX

Last post 01-08-2009, 12:00 PM by infringer. 8 replies.
Sort Posts: Previous Next
  •  12-17-2008, 12:45 PM 47047

    CuteEditor via AJAX

    I have successfully used CuteEditor before in static pages.
     
    Now what I'm trying to do is load a CuteEditor, dynamically via AJAX.
     
    The user is going to click a button that says "View Customer Notes".
     
    The javascript is going to send an AJAX request like this:
        new Ajax.Request("modules/reserve/client_notes.php", {
          parameters: "cust=" + cust_num + "&recnum=" + cust_recnum,
          onSuccess: Reserve.gotReport.bind(this),
          onFailure: Reserve.gotFailure.bind(this)
          });
    client_notes.php has the following in it:
     
    require("../../core/CuteEditor_Files/include_CuteEditor.php");
    $cEditor = new CuteEditor();
    $cEditor->ID = 'rcvIntNotes';
    $cEditor->AutoConfigure = CoachFlex;
    $cEditor->FilesPath = "../../core/CuteEditor_Files";
    $cEditor->ShowCodeViewToolBar = false;
    $cEditor->ThemeType = "Office2003_BlueTheme";
    $cEditor->UseFontTags=false;
    $cEditor->Width = "500px";
    $cEditor->Height = "150px";
    $cEditor->EditorOnPaste = "PastePureText";
    $cEditor->EditorBodyStyle = "font: normal 0.75em Arial;";
    $cEditor->BreakElement="Br";
    $cEditor->EnableStripScriptTags=true;
    $cEditor->ShowPreviewMode = false;
    $cEditor->ShowTagSelecter = false;
    $cEditor->MaxHTMLLength = 65535;
    $editor .= $cEditor->GetString();
    $cEditor = null;
    $result = array();
    $result['header'] = '';
    $result['table'] = $editor;
    $result = json_encode($result); 
    header("Content-Type: application/json");
    print $result;
    exit(0);
     
    then the processing Javascript is:
      var json = transport.responseJSON;
      $('scrollbar_content').update(json.table);
      $('resNameRightTop').update(json.header);
     
     
    What i expect to happen is the "scrollbar_content" div to be filled with a CuteEditor.
    What happens is I get a white box that says:"

    Not Found

    The requested URL /CuteEditor_Files/template.php was not found on this server.
    "
     
    For some reason it doesn't seem to be placing the "FilesPath" in the look for template.php?
     
    Can someone help me figure this out?
     
    Thanks,
    -David
     
     
  •  12-17-2008, 2:22 PM 47053 in reply to 47047

    Re: CuteEditor via AJAX

  •  12-17-2008, 2:39 PM 47057 in reply to 47053

    Re: CuteEditor via AJAX

    that's exactly what I'm wanting.
     
    Any ETA?  or is it something I can do now with a little bit of work?
     
    -David
  •  12-17-2008, 2:56 PM 47058 in reply to 47047

    Re: CuteEditor via AJAX

    Please download the control again. I've included it into the the download package.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-26-2008, 12:41 PM 47227 in reply to 47058

    Re: CuteEditor via AJAX

    Any tips on how to use the new control?  There's no documentation...
     
    Thanks,
    -David
  •  12-26-2008, 1:53 PM 47229 in reply to 47227

    Re: CuteEditor via AJAX

    I've tried several different things, even set up a section of code EXACTLY like your code (just in my directory structure) and still receive a:

    Not Found

    The requested URL /core/CuteEditor_Files/template.php was not found on this server.
     
    Here's my directory structure:
     
    $home/core/CuteEditor_files
    $home/modules/<modules>
    $home/index.php
     
    index.php is a custom built page controller.
     
    index.php calls a page (the page is in the modules directory) that then calls a Modalbox...  (I have successfully used the editor inside a Modalbox before, so that is not the issue).
    The modalbox that is loaded contains 2 divs a left and a right.  The left div remains static, the right div changes.  At some point the right div should show a editor.
     
    Whenever I change my FilesPath variable... i get messages like this:  Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "../core/CuteEditor_Files/Languages/en-en.xml" in D:\wamp\www\CoachFlex\core\CuteEditor_Files\include_CuteEditor.php on line 864
    Error while parsing the Languages fileLanguages/en-en.xml
     
    So I know I've got the pathing set up correctly?
     
    Any clues as to what might be happening?
     
    Thanks,
    -David
     
  •  12-26-2008, 2:37 PM 47231 in reply to 47229

    Re: CuteEditor via AJAX

    After looking at the Modalbox some more (http://www.wildbit.com/labs/modalbox/), I believe I'm not going to be able to load the CuteEditor dynamically?  Unless someone can help me come up with a way to do it.
     
    You can see at the modalbox's wiki pages... (http://code.google.com/p/modalbox/wiki/DefiningJavaScript) that javascripts can't be included the way the Modalbox loads (Prototype's AJAX.Updater)  so unless there is someway I can preload the needed Javascripts so that they are already on the page, then just insert the CuteEditor information when I need it I don't think it's going to be possible.
     
    Anyone have any possible ideas?
  •  12-26-2008, 3:53 PM 47233 in reply to 47231

    Re: CuteEditor via AJAX

    Sorry to spam the forums... just trying to keep post my new findings to see if I can help any.
     
    FCKeditor works properly for this function, so I am planning on just using it for the time being as this doesn't have to be a huge deal of formatting, but I want to use CuteEditor...
     
     
  •  01-08-2009, 12:00 PM 47561 in reply to 47233

    Re: CuteEditor via AJAX

    I'd like to make an update, I stated incorrectly before.
     
    I canNOT get CuteEditor to work AT ALL inside a ModalBox (http://www.wildbit.com/labs/modalbox/)
     
    Just updating the issue
View as RSS news feed in XML