Opened 14 years ago

Closed 14 years ago

#357 closed defect (invalid)

Problems installing and getting xinha to work - textarea has no properties and _editor_skin is not defined

Reported by: RampantRab Owned by: gogo
Priority: highest Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:
Cc:

Description

Hi, I’m having trouble with Xinha. I am pretty sure that I have everything set up ok but I am getting error messages. The main one is “Error: textarea has no properties
Source File: http://127.0.0.1/Experimental/Xinha/xinha/htmlarea.js
Line: 98”

If I remove one of the xinha_editors from the array then I get “Error: _editor_skin is not defined
Source File: http://127.0.0.1/Experimental/Xinha/xinha/htmlarea.js
Line: 1134”

Intuition leads me to suspect that xinha is having trouble with getting the right textarea.

Any help in this matter would be greatly appreciated.

Thanks

Robert


<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>XINHA</title>


<script type="text/javascript">

_editor_url = "http://127.0.0.1/Experimental/Xinha/xinha/" (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en";
And the language we need to use in the editor.


</script>
<script type="text/javascript" src="http://127.0.0.1/Experimental/Xinha/xinha/htmlarea.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, 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. /

xinha_plugins = xinha_plugins ? xinha_plugins :
[

'CharacterMap?',
'ContextMenu?',
'FullScreen?',
'ListType?',
'SpellChecker?',
'Stylist',
'SuperClean?',
'TableOperations?'

];

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

/ STEP 2 *

  • Now, what are the names of the textareas you will be turning into
  • editors? /

xinha_editors = xinha_editors ? xinha_editors :
[

'newbiearea1'

];

/ 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 HTMLArea.Config();
  • xinha_config.width = '640px';
  • xinha_config.height = '420px'; * */

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

xinha_config = new HTMLArea.Config();

xinha_config.width = 640;
xinha_config.height = 420;


/ STEP 4 *

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

xinha_editors = HTMLArea.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. /

HTMLArea.startEditors(xinha_editors);

}

window.onload = xinha_init;


</script>


<link type="text/css" rel="stylesheet" title="blue-look" href="/skins/blue-look/skin.css" />

<link type="text/css" rel="alternate stylesheet" title="green-look" href="/skins/green-look/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="xp-blue" href="/skins/xp-blue/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="xp-green" href="/skins/xp-green/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="inditreuse" href="/skins/inditreuse/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="/skins/blue-metallic/skin.css" />

</head>

<body>

<form action="javascript:var x = document.getElementById('editors_here');alert(x.myTextArea.value);" id="editors_here" onsubmit="alert(this.myTextArea.value);">

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%">x</textarea>
<!--<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%">

&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
ante elementum turpis. Aliquam nisl. Nulla posuere neque non
tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
Curabitur pharetra bibendum lectus.&lt;/p&gt;

</textarea>-->

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

</form>

</body>
</html>


Change History (4)

comment:1 Changed 14 years ago by gocher

_editor_skin is now defined
fixed in changeset 245

comment:2 Changed 14 years ago by gocher

better to read

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

<html>
<head>
<title>XINHA</title>


  	

  	<script type="text/javascript">
    	_editor_url  = "http://127.0.0.1/Experimental/Xinha/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    	_editor_lang = "en";      // And the language we need to use in the editor.
  	
	</script>
	<script type="text/javascript" src="http://127.0.0.1/Experimental/Xinha/xinha/htmlarea.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, 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.
       ************************************************************************/

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

      /** STEP 2 ***************************************************************
       * Now, what are the names of the textareas you will be turning into
       * editors?
       ************************************************************************/

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

      /** 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 HTMLArea.Config();
       *   xinha_config.width  = '640px';
       *   xinha_config.height = '420px';
       *
       *************************************************************************/

       //xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();

		 xinha_config = new HTMLArea.Config();
       xinha_config.width  = 640;
       xinha_config.height = 420;
		 
      /** STEP 4 ***************************************************************
       * We first create editors for the textareas.
       *
       * You can do this in two ways, either
       *
       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
       *
       * if you want all the editor objects to use the same set of plugins, OR;
       *
       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
       *   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   = HTMLArea.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.
       ************************************************************************/

      HTMLArea.startEditors(xinha_editors);
    }

    window.onload = xinha_init;
	 
	 </script>
	
	<link type="text/css" rel="stylesheet" title="blue-look" href="/skins/blue-look/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="green-look" href="/skins/green-look/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="xp-blue" href="/skins/xp-blue/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="xp-green" href="/skins/xp-green/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="inditreuse" href="/skins/inditreuse/skin.css" />
<link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="/skins/blue-metallic/skin.css" />

</head>

<body>
  <form action="javascript:var x = document.getElementById('editors_here');alert(x.myTextArea.value);" id="editors_here" onsubmit="alert(this.myTextArea.value);">

	<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%">x</textarea>
	<!--<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%">
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
ante elementum turpis. Aliquam nisl. Nulla posuere neque non
tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
Curabitur pharetra bibendum lectus.&lt;/p&gt;

</textarea>-->
	<!--<textarea id="anotherOne" name="anotherOne" rows="10" cols="50" style="width: 100%"></textarea>-->
</form>


</body>
</html>

comment:3 Changed 14 years ago by gocher

If I change the following lines and copy your file to my xinha\examples folder it works without mistake!

    	_editor_url  = "../"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    	_editor_lang = "en";      // And the language we need to use in the editor.
  	
	</script>
	<script type="text/javascript" src="../htmlarea.js"></script>

comment:4 Changed 14 years ago by gogo

  • Resolution set to invalid
  • Status changed from new to closed

Not a bug - please ask in the forums.

Note: See TracTickets for help on using tickets.