Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-09-17 12:39:03

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

setup

I followed the instructions in the newbie guide to a "t"

I get no editor, or any indication of what isn't working. 

This is the solution as on my .aspx page:

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<script type="text/javascript">
    _editor_url = "/TextEditor/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
 
  <script type="text/javascript" src="~/Admin/TextEditor/XinhaCore.js"></script>
 
  <script type="text/javascript">
      xinha_editors = null;
      xinha_init = null;
      xinha_config = null;
      xinha_plugins = null;

      // This contains the names of textareas we will make into Xinha editors
      xinha_init = xinha_init ? xinha_init : function() {
          /** STEP 1 ***************************************************************
          * First, specify the textareas that shall be turned into Xinhas.
          * For each one add the respective id to the xinha_editors array.
          * I you want add more than on textarea, keep in mind that these
          * values are comma seperated BUT there is no comma after the last value.
          * If you are going to use this configuration on several pages with different
          * textarea ids, you can add them all. The ones that are not found on the
          * current page will just be skipped.
          ************************************************************************/

          xinha_editors = xinha_editors ? xinha_editors :
  [
  'newbiearea1'
  ];

          /** STEP 2 ***************************************************************
          * Now, what are the plugins you will be using in the editors on this
          * page.  List all the plugins you will need, even if not all the editors
          * will use all the plugins.
          *
          * The list of plugins below is a good starting point, but if you prefer
          * a simpler editor to start with then you can use the following
          *
          * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
          *
          * which will load no extra plugins at all.
          ************************************************************************/

          xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];

          // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
          if (!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


          /** STEP 3 ***************************************************************
          * We create a default configuration to be used by all the editors.
          * If you wish to configure some of the editors differently this will be
          * done in step 5.
          *
          * If you want to modify the default config you might do something like this.
          *
          *   xinha_config = new Xinha.Config();
          *   xinha_config.width  = '640px';
          *   xinha_config.height = '420px';
          *
          *************************************************************************/

          xinha_config = xinha_config ? xinha_config() : new Xinha.Config();

          //this is the standard toolbar, feel free to remove buttons as you like
          xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator", "formatblock", "fontname", "fontsize", "bold", "italic", "underline", "strikethrough"],
    ["separator", "forecolor", "hilitecolor", "textindicator"],
    ["separator", "subscript", "superscript"],
    ["linebreak", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull"],
    ["separator", "insertorderedlist", "insertunorderedlist", "outdent", "indent"],
    ["separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable"],
    ["linebreak", "separator", "undo", "redo", "selectall", "print"], (Xinha.is_gecko ? [] : ["cut", "copy", "paste", "overwrite", "saveas"]),
    ["separator", "killword", "clearfonts", "removeformat", "toggleborders", "splitblock", "lefttoright", "righttoleft"],
    ["separator", "htmlmode", "showhelp", "about"]
  ];


          // To adjust the styling inside the editor, we can load an external stylesheet like this
          // NOTE : YOU MUST GIVE AN ABSOLUTE URL

          xinha_config.pageStyleSheets = [_editor_url + "examples/full_example.css"];

          /** STEP 4 ***************************************************************
          * We first create editors for the textareas.
          *
          * You can do this in two ways, either
          *
          *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
          *
          * if you want all the editor objects to use the same set of plugins, OR;
          *
          *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
          *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
          *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
          *
          * if you want to use a different set of plugins for one or more of the
          * editors.
          ************************************************************************/

          xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

          /** STEP 5 ***************************************************************
          * If you want to change the configuration variables of any of the
          * editors,  this is the place to do that, for example you might want to
          * change the width and height of one of the editors, like this...
          *
          *   xinha_editors.myTextArea.config.width  = '640px';
          *   xinha_editors.myTextArea.config.height = '480px';
          *
          ************************************************************************/


          /** STEP 6 ***************************************************************
          * Finally we "start" the editors, this turns the textareas into
          * Xinha editors.
          ************************************************************************/

          Xinha.startEditors(xinha_editors);
      }

      Xinha._addEvent(window, 'load', xinha_init); // this executes the xinha_init function on page load
      // and does not interfere with window.onload properties set by other scripts

  </script>
 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<div id="regpage">
       
<h3>Edit About Us</h3>

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>
</div>

</asp:Content>

This is the source of the page as rendered:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
    Goddess Creations - Edit About Us
</title>

<script type="text/javascript">
    _editor_url = "/TextEditor/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
 
  <script type="text/javascript" src="~/Admin/TextEditor/XinhaCore.js"></script>
 
  <script type="text/javascript">
      xinha_editors = null;
      xinha_init = null;
      xinha_config = null;
      xinha_plugins = null;

      // This contains the names of textareas we will make into Xinha editors
      xinha_init = xinha_init ? xinha_init : function() {
          /** STEP 1 ***************************************************************
          * First, specify the textareas that shall be turned into Xinhas.
          * For each one add the respective id to the xinha_editors array.
          * I you want add more than on textarea, keep in mind that these
          * values are comma seperated BUT there is no comma after the last value.
          * If you are going to use this configuration on several pages with different
          * textarea ids, you can add them all. The ones that are not found on the
          * current page will just be skipped.
          ************************************************************************/

          xinha_editors = xinha_editors ? xinha_editors :
  [
  'newbiearea1'
  ];

          /** STEP 2 ***************************************************************
          * Now, what are the plugins you will be using in the editors on this
          * page.  List all the plugins you will need, even if not all the editors
          * will use all the plugins.
          *
          * The list of plugins below is a good starting point, but if you prefer
          * a simpler editor to start with then you can use the following
          *
          * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
          *
          * which will load no extra plugins at all.
          ************************************************************************/

          xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];

          // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
          if (!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


          /** STEP 3 ***************************************************************
          * We create a default configuration to be used by all the editors.
          * If you wish to configure some of the editors differently this will be
          * done in step 5.
          *
          * If you want to modify the default config you might do something like this.
          *
          *   xinha_config = new Xinha.Config();
          *   xinha_config.width  = '640px';
          *   xinha_config.height = '420px';
          *
          *************************************************************************/

          xinha_config = xinha_config ? xinha_config() : new Xinha.Config();

          //this is the standard toolbar, feel free to remove buttons as you like
          xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator", "formatblock", "fontname", "fontsize", "bold", "italic", "underline", "strikethrough"],
    ["separator", "forecolor", "hilitecolor", "textindicator"],
    ["separator", "subscript", "superscript"],
    ["linebreak", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull"],
    ["separator", "insertorderedlist", "insertunorderedlist", "outdent", "indent"],
    ["separator", "inserthorizontalrule", "createlink", "insertimage", "inserttable"],
    ["linebreak", "separator", "undo", "redo", "selectall", "print"], (Xinha.is_gecko ? [] : ["cut", "copy", "paste", "overwrite", "saveas"]),
    ["separator", "killword", "clearfonts", "removeformat", "toggleborders", "splitblock", "lefttoright", "righttoleft"],
    ["separator", "htmlmode", "showhelp", "about"]
  ];


          // To adjust the styling inside the editor, we can load an external stylesheet like this
          // NOTE : YOU MUST GIVE AN ABSOLUTE URL

          xinha_config.pageStyleSheets = [_editor_url + "examples/full_example.css"];

          /** STEP 4 ***************************************************************
          * We first create editors for the textareas.
          *
          * You can do this in two ways, either
          *
          *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
          *
          * if you want all the editor objects to use the same set of plugins, OR;
          *
          *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
          *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
          *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
          *
          * if you want to use a different set of plugins for one or more of the
          * editors.
          ************************************************************************/

          xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

          /** STEP 5 ***************************************************************
          * If you want to change the configuration variables of any of the
          * editors,  this is the place to do that, for example you might want to
          * change the width and height of one of the editors, like this...
          *
          *   xinha_editors.myTextArea.config.width  = '640px';
          *   xinha_editors.myTextArea.config.height = '480px';
          *
          ************************************************************************/


          /** STEP 6 ***************************************************************
          * Finally we "start" the editors, this turns the textareas into
          * Xinha editors.
          ************************************************************************/

          Xinha.startEditors(xinha_editors);
      }

      Xinha._addEvent(window, 'load', xinha_init); // this executes the xinha_init function on page load
      // and does not interfere with window.onload properties set by other scripts

  </script>
 
<link href="../GoddessStyles.css" rel="stylesheet" type="text/css" /></head>

<body>
   
    <form name="aspnetForm" method="post" action="EditAbout.aspx" id="aspnetForm" style="height:18.5cm; width:21.56cm; margin-left:auto; margin-right:auto;">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAgIDD2QWBgIBD2QWAmYPZBYCZg9kFgZmDw9kFgQeC29ubW91c2VvdmVyBRhzcmM9J0J1dHRvbnMvaG9tZU9uLmpwZyceCm9ubW91c2VvdXQFFnNyYz0nQnV0dG9ucy9ob21lLmpwZydkAgEPD2QWBB8ABRlzcmM9J0J1dHRvbnMvYWJvdXRPbi5qcGcnHwEFF3NyYz0nQnV0dG9ucy9hYm91dC5qcGcnZAICDw9kFgQfAAUbc3JjPSdCdXR0b25zL2NvbnRhY3RPbi5qcGcnHwEFGXNyYz0nQnV0dG9ucy9jb250YWN0LmpwZydkAgMPZBYCZg9kFgJmD2QWBGYPD2QWBB8ABRtzcmM9J0J1dHRvbnMvcHJpdmFjeU9uLmpwZycfAQUZc3JjPSdCdXR0b25zL3ByaXZhY3kuanBnJ2QCAQ8PZBYEHwAFHHNyYz0nQnV0dG9ucy92aWV3Y2FydE9uLmpwZycfAQUac3JjPSdCdXR0b25zL3ZpZXdjYXJ0LmpwZydkAgcPZBYKZg9kFgJmD2QWAmYPD2QWBB8ABRhzcmM9J0J1dHRvbnMvbWluZE9uLmpwZycfAQUWc3JjPSdCdXR0b25zL21pbmQuanBnJ2QCAQ9kFgJmD2QWAmYPD2QWBB8ABRhzcmM9J0J1dHRvbnMvYm9keU9uLmpwZycfAQUWc3JjPSdCdXR0b25zL2JvZHkuanBnJ2QCAg9kFgJmD2QWAmYPD2QWBB8ABRpzcmM9J0J1dHRvbnMvc3Bpcml0T24uanBnJx8BBRhzcmM9J0J1dHRvbnMvc3Bpcml0LmpwZydkAgMPZBYCZg9kFgJmDw9kFgQfAAUac3JjPSdCdXR0b25zL2hlYXJ0aE9uLmpwZycfAQUYc3JjPSdCdXR0b25zL2hlYXJ0aC5qcGcnZAIED2QWAmYPZBYCZg8PZBYEHwAFGXNyYz0nQnV0dG9ucy9oZWFydE9uLmpwZycfAQUXc3JjPSdCdXR0b25zL2hlYXJ0LmpwZydkGAIFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYMBRVjdGwwMCRJbWFnZUJ1dHRvbkhvbWUFFmN0bDAwJEltYWdlQnV0dG9uQWJvdXQFGGN0bDAwJEltYWdlQnV0dG9uQ29udGFjdAUYY3RsMDAkSW1hZ2VCdXR0b25Qcml2YWN5BRljdGwwMCRJbWFnZUJ1dHRvblZpZXdDYXJ0BRVjdGwwMCRJbWFnZUJ1dHRvbk1pbmQFFWN0bDAwJEltYWdlQnV0dG9uQm9keQUXY3RsMDAkSW1hZ2VCdXR0b25TcGlyaXQFF2N0bDAwJEltYWdlQnV0dG9uSGVhcnRoBRZjdGwwMCRJbWFnZUJ1dHRvbkhlYXJ0BSNjdGwwMCRMb2dpblZpZXcxJExvZ2luU3RhdHVzMSRjdGwwMQUjY3RsMDAkTG9naW5WaWV3MSRMb2dpblN0YXR1czEkY3RsMDMFEGN0bDAwJExvZ2luVmlldzEPD2QCAWQCvtdON2eXSlCLPzl/khmlV8HLBQ==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<script src="/GoddessCreations/WebResource.axd?d=qz2z6_GaUObPkSe3BbGc9g2&t=633699560950937500" type="text/javascript"></script>

<div>

    <input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE" value="XAbr2ktuBpSid1ljo35AG_NEhFxvqzIBI6U1CKFx6tIY5QI1PAE3NqRLVGSuBFg60" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWDQK6wLa8BQKQx/RUAq+L774DApO72pcPAra0jt0MAoqO5c8HArG+z+AHAvTGgP8OArvFj5cOAtjFxNwMAtvPgZ4MApG45N8FAtXJm+MOO7q6OgwawLV0nkxGFnBD/1/ay98=" />
</div>
   
    <div id="wrapper">

    <div id="logo">
   
    <img src="Images/goddessHeader.jpg" alt="Goddess Creations" />
        
    <div id="menu1">
        <table id="ctl00_Table1" cellspacing="0" border="0" style="border-collapse:collapse;">
    <tr>
        <td><input type="image" name="ctl00$ImageButtonHome" id="ctl00_ImageButtonHome" onmouseover="src='Buttons/homeOn.jpg'" onmouseout="src='Buttons/home.jpg'" src="../Buttons/home.jpg" alt="home" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonHome", "", false, "", "../Home.aspx", false, false))" style="border-width:0px;" /><input type="image" name="ctl00$ImageButtonAbout" id="ctl00_ImageButtonAbout" onmouseover="src='Buttons/aboutOn.jpg'" onmouseout="src='Buttons/about.jpg'" src="../Buttons/about.jpg" alt="about us" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonAbout", "", false, "", "../About.aspx", false, false))" style="border-width:0px;" /><input type="image" name="ctl00$ImageButtonContact" id="ctl00_ImageButtonContact" onmouseover="src='Buttons/contactOn.jpg'" onmouseout="src='Buttons/contact.jpg'" src="../Buttons/contact.jpg" alt="contact us" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonContact", "", false, "", "../Contact.aspx", false, false))" style="border-width:0px;" /></td>
    </tr>
</table>
    </div><!-- menu1 -->
   
    <div id="menu2">
        <table id="ctl00_Table2" cellspacing="0" border="0" style="border-collapse:collapse;">
    <tr>
        <td><input type="image" name="ctl00$ImageButtonPrivacy" id="ctl00_ImageButtonPrivacy" onmouseover="src='Buttons/privacyOn.jpg'" onmouseout="src='Buttons/privacy.jpg'" src="../Buttons/privacy.jpg" alt="privacy policy" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonPrivacy", "", false, "", "../Privacy.aspx", false, false))" style="border-width:0px;" /><input type="image" name="ctl00$ImageButtonViewCart" id="ctl00_ImageButtonViewCart" onmouseover="src='Buttons/viewcartOn.jpg'" onmouseout="src='Buttons/viewcart.jpg'" src="../Buttons/viewcart.jpg" alt="view shopping cart" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonViewCart", "", false, "", "../shoppingcartpage.aspx", false, false))" style="border-width:0px;" /></td>
    </tr>
</table>
    </div><!-- menu2 -->
   
    </div><!-- logo -->
   
    <div id="leftCol">
   
    <img id="ctl00_Image1" src="../Images/goddessWeb.jpg" style="border-width:0px;" /><div id="blueBlock">
         
       
   
    <div id="brownBlock">
   
    <br />
       
       
        <table id="ctl00_Table3" cellspacing="0" align="Center" border="0" style="border-collapse:collapse;">
    <tr align="center">
        <td><input type="image" name="ctl00$ImageButtonMind" id="ctl00_ImageButtonMind" onmouseover="src='Buttons/mindOn.jpg'" onmouseout="src='Buttons/mind.jpg'" src="../Buttons/mind.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonMind", "", false, "", "../Mind.aspx", false, false))" style="border-width:0px;" /></td>
    </tr><tr align="center">
        <td><input type="image" name="ctl00$ImageButtonBody" id="ctl00_ImageButtonBody" onmouseover="src='Buttons/bodyOn.jpg'" onmouseout="src='Buttons/body.jpg'" src="../Buttons/body.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonBody", "", false, "", "../Body.aspx", false, false))" style="border-width:0px;" /></td>
    </tr><tr align="center">
        <td><input type="image" name="ctl00$ImageButtonSpirit" id="ctl00_ImageButtonSpirit" onmouseover="src='Buttons/spiritOn.jpg'" onmouseout="src='Buttons/spirit.jpg'" src="../Buttons/spirit.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonSpirit", "", false, "", "../Spirit.aspx", false, false))" style="border-width:0px;" /></td>
    </tr><tr align="center">
        <td><input type="image" name="ctl00$ImageButtonHearth" id="ctl00_ImageButtonHearth" onmouseover="src='Buttons/hearthOn.jpg'" onmouseout="src='Buttons/hearth.jpg'" src="../Buttons/hearth.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonHearth", "", false, "", "../Hearth.aspx", false, false))" style="border-width:0px;" /></td>
    </tr><tr align="center">
        <td><input type="image" name="ctl00$ImageButtonHeart" id="ctl00_ImageButtonHeart" onmouseover="src='Buttons/heartOn.jpg'" onmouseout="src='Buttons/heart.jpg'" src="../Buttons/heart.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ImageButtonHeart", "", false, "", "../Heart.aspx", false, false))" style="border-width:0px;" /></td>
    </tr><tr align="center">
        <td><img id="ctl00_Image2" src="../Images/moonsWeb.jpg" style="border-width:0px;" /></td>
    </tr>
</table>
               
       
       
    </div><!-- brownBlock -->
    </div><!-- blueBlock --> 
    </div><!-- leftCol --> 
   
        <div id="contentWin">
       

<div id="regpage">
       
<h3>Edit About Us</h3>

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>
</div>


        </div><!-- contentWin -->
       
 
    </div><!-- wrapper -->
 
    <div id="footer">
       
        <a id="ctl00_LoginView1_LoginStatus1" href="javascript:__doPostBack('ctl00$LoginView1$LoginStatus1$ctl00','')" style="color:#31221F;">Logout</a>
        <span id="ctl00_LoginView1_LoginName1">alex</span>
        <a id="ctl00_LoginView1_LinkButton1" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginView1$LinkButton1", "", false, "", "AdminPanel.aspx", false, true))" style="color:#31221F;">Administration Panel</a>
       
    </div><!-- footer -->
   
  </form>

</body>
</html>

Offline

#2 2009-09-17 13:00:08

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Just to remove some confusion, I made a brand new asp page with nothing on it except one textarea.

Again I followed the setup instructions in the newbie guide, but no luck

Here's the code:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
    <script type="text/javascript">
    _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
 
  <script type="text/javascript" src="/xinha/XinhaCore.js"></script>
   
  <script type="text/javascript">

  xinha_editors = null;
  xinha_init    = null;
  xinha_config  = null;
  xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
   /** STEP 1 ***************************************************************
   * First, specify the textareas that shall be turned into Xinhas.
   * For each one add the respective id to the xinha_editors array.
   * I you want add more than on textarea, keep in mind that these
   * values are comma seperated BUT there is no comma after the last value.
   * If you are going to use this configuration on several pages with different
   * textarea ids, you can add them all. The ones that are not found on the
   * current page will just be skipped.
   ************************************************************************/
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'newbiearea1'
  ];
 
  /** STEP 2 ***************************************************************
   * Now, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   *
   * The list of plugins below is a good starting point, but if you prefer
   * a simpler editor to start with then you can use the following
   *
   * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
   *
   * which will load no extra plugins at all.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];
 
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new Xinha.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
   
  //this is the standard toolbar, feel free to remove buttons as you like
  xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
    ["separator","htmlmode","showhelp","about"]
  ];

       
   // To adjust the styling inside the editor, we can load an external stylesheet like this
   // NOTE : YOU MUST GIVE AN ABSOLUTE URL
 
   xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
   *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/


  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
                                            // and does not interfere with window.onload properties set by other scripts
</script>
 
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>
    </div>
    </form>
</body>
</html>

AND THEN THE SOURCE OF PAGE RENDERED BY ABOVE CODE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title>
   
    <script type="text/javascript">
    _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
 
  <script type="text/javascript" src="/xinha/XinhaCore.js"></script>
   
  <script type="text/javascript">

  xinha_editors = null;
  xinha_init    = null;
  xinha_config  = null;
  xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
   /** STEP 1 ***************************************************************
   * First, specify the textareas that shall be turned into Xinhas.
   * For each one add the respective id to the xinha_editors array.
   * I you want add more than on textarea, keep in mind that these
   * values are comma seperated BUT there is no comma after the last value.
   * If you are going to use this configuration on several pages with different
   * textarea ids, you can add them all. The ones that are not found on the
   * current page will just be skipped.
   ************************************************************************/
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'newbiearea1'
  ];
 
  /** STEP 2 ***************************************************************
   * Now, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   *
   * The list of plugins below is a good starting point, but if you prefer
   * a simpler editor to start with then you can use the following
   *
   * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
   *
   * which will load no extra plugins at all.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];
 
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new Xinha.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
   
  //this is the standard toolbar, feel free to remove buttons as you like
  xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
    ["separator","htmlmode","showhelp","about"]
  ];

       
   // To adjust the styling inside the editor, we can load an external stylesheet like this
   // NOTE : YOU MUST GIVE AN ABSOLUTE URL
 
   xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
   *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/


  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
                                            // and does not interfere with window.onload properties set by other scripts
</script>
 
</head>
<body>
    <form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZClZsghjo0rfvRtWqP8LGou4n9X5" />
</div>

    <div>
    <textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>
    </div>
    </form>
</body>
</html>

I used all the same names as in the example:  my file folder is in the main area of my solution and is named "xinha"

even followed the example by naming textarea "newbiearea1"

I can't create a simpler solution that includes this editor, yet even this wont work

ANY SUGGESTIONS?

Offline

#3 2009-09-17 13:07:26

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

NOW I SETUP THE SIMPLEST HTML PAGE TO TEST THIS:

<HTML>
<HEAD>

<TITLE>

</TITLE>

<script type="text/javascript">
    _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
 
  <script type="text/javascript" src="/xinha/XinhaCore.js"></script>
   
  <script type="text/javascript">

  xinha_editors = null;
  xinha_init    = null;
  xinha_config  = null;
  xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
   /** STEP 1 ***************************************************************
   * First, specify the textareas that shall be turned into Xinhas.
   * For each one add the respective id to the xinha_editors array.
   * I you want add more than on textarea, keep in mind that these
   * values are comma seperated BUT there is no comma after the last value.
   * If you are going to use this configuration on several pages with different
   * textarea ids, you can add them all. The ones that are not found on the
   * current page will just be skipped.
   ************************************************************************/
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'newbiearea1'
  ];
 
  /** STEP 2 ***************************************************************
   * Now, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   *
   * The list of plugins below is a good starting point, but if you prefer
   * a simpler editor to start with then you can use the following
   *
   * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
   *
   * which will load no extra plugins at all.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];
 
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new Xinha.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
   
  //this is the standard toolbar, feel free to remove buttons as you like
  xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
    ["separator","htmlmode","showhelp","about"]
  ];

       
   // To adjust the styling inside the editor, we can load an external stylesheet like this
   // NOTE : YOU MUST GIVE AN ABSOLUTE URL
 
   xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
   *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/


  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
                                            // and does not interfere with window.onload properties set by other scripts
</script>

</HEAD>

<BODY>

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>

</BODY>

</HTML>

CAN ANYONE TELL MY WHY THIS ISN"T WORKING??

Offline

#4 2009-09-17 14:15:46

ateslik
Xinha Community Member
Registered: 2009-07-16
Posts: 33

Re: setup

_editor_url  = "/xinha/"; // Note the end of line ';'

Your javascript error console should point that out. Or another error if there are more.

Offline

#5 2009-09-17 14:21:30

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Thanks for your reply.

I fixed that error (which, by the way, is incorrect on the xinha Newbie Quide).

That being said, I still have no xinha editor appearing.

This is as simple as I can make the code, and still no luck:

<HTML>

<HEAD>

<TITLE>

</TITLE>

<script type="text/javascript">
    _editor_url  = "/xinha/"; 
    _editor_lang = "en";     
    _editor_skin = "silva";   
  </script>

 
  <script type="text/javascript" src="/xinha/XinhaCore.js"></script>
   
<script type="text/javascript">

  xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;


xinha_init = xinha_init ? xinha_init : function()
{
   
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'newbiearea1'
  ];
 
 
  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'TableOperations'
  ];
 
  if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


  xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
   
  xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
    ["separator","htmlmode","showhelp","about"]
  ];

       
   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

 
   xinha_editors.newbiearea1.config.width  = '640px';
   xinha_editors.newbiearea1.config.height = '480px';
   


  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init);

  </script>

</HEAD>

<BODY>

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>

</BODY>

</HTML>

Offline

#6 2009-09-17 14:23:10

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

is there a reason why sometimes "xinha" is capitalized and sometimes not?

Offline

#7 2009-09-17 14:55:20

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

This code is now as simple as it can get.  This is the exact code listed in the newbie guide.  The only thing I added was the basic HTML page it is wrapped in.  I have tried to adjust my xinha URL all different ways, as that is the only thing that I seem to have any control over.

Offline

#8 2009-09-17 15:44:49

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Does anyone have any working code to share?  The code from the Newbie's Guide, when copied exactly as offered, does not work at all.

Offline

#9 2009-09-17 16:53:27

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Ok I hard coded all the paths like:

_editor_url  = "C:/Documents and Settings/...../xinha/"; 

and:

<script type="text/javascript" src="C:/Documents and Settings/......../xinha/XinhaCore.js"></script>

RESULTING IN:

Just as the page is loading, I get a javascript alert window that says "xinha *must* be installed on a web server to function properly."  Then the page loads with a Xinha editor attached to the textarea - only it's greyed out and doesn't work and the textarea itself has a "IE cannot display this webpage" error.

I am a little relieved to at least see something....

Offline

#10 2009-09-17 16:56:16

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Anyway, does this mean I can't run Xinha on a local machine while I am building the website and testing locally??


Also just tried on Firefox and dont get any editor at all still.

Offline

#11 2009-09-17 17:22:56

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

Put it up on a web server and it works with these paths:

_editor_url  = "/xinha/"; 

<script type="text/javascript" src="/xinha/XinhaCore.js"></script>

Ya know, it would have saved me two days and some frustration if the Newbie Guide stated plainly that Xinha will not run on a local machine.

Offline

#12 2009-09-18 02:48:15

rylan76
Xinha Community Member
Registered: 2009-02-26
Posts: 12

Re: setup

Is that a Windows web server it is now deployed on? 'cause most webserver I know of are Linux / BSD and their directory slashes are the "right" way around (/) instead of (\) windows slashes...

I. e. if you follow the newbie guide to a T, and you deploy locally on a WINDOWS machine, your paths won't work??

I. e. it is possible to run Xinha locally, but since you are on a windows machine, you might need to change the slashes around?

Offline

#13 2009-10-01 16:41:39

alex2go
Xinha Community Member
Registered: 2009-09-17
Posts: 11

Re: setup

thanks for your reply.

Yes it is a windows web server.  Server 2008 actually.  Paths work on server as posted at 13:22:56. 

Yes if I follow the newbie guide and deploy locally on a Windows machine (development computer running XP) doesn't run at all no matter which way I put the slashes or if the paths are hard coded or relative.

I could really use to run this on my local machine though.  Any suggestions would be appreciated.

Offline

#14 2009-10-02 11:02:17

ateslik
Xinha Community Member
Registered: 2009-07-16
Posts: 33

Re: setup

xinha doesn't work when run locally. This is clear in the documentation. It must be run from a webserver.

Offline

Board footer

Powered by FluxBB