2 of 4
2
Xinha WYSIWYG Editor Extension Release v1.0
Posted: 02 October 2006 03:18 PM   [ Ignore ]   [ # 19 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1477
Joined  09-16-2004

Speaking of TinyMCE, has anyone compared Xinha with Tiny regarding the HTML it outputs?
Which one outputs the cleanest code in your opinion?

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 03 October 2006 03:20 AM   [ Ignore ]   [ # 20 ]  
Research Assistant
RankRankRank
Total Posts:  332
Joined  10-11-2004

Re output.  Xinha looks very clean to me.  Just tried to do a test and TinyMCe playing up on my mac only able to say Xinha appears better so far.

Trying to use the Image Manager with Xinha.  Does anyone know where I can change the image URL setting.  Is there a config file somewhere?

Profile
 
 
Posted: 25 October 2006 06:40 PM   [ Ignore ]   [ # 21 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

bjsteiger, I encountered an anomaly that sounds like exactly what you described. With great advice from the tech support forum here, I fixed it by just deleting all cache files.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 26 October 2006 01:33 PM   [ Ignore ]   [ # 22 ]  
Research Assistant
RankRankRank
Total Posts:  332
Joined  10-11-2004

I want to use either the Stylist Plugin or the Dynamic CSS Plugin but can’t workout where I put the configuration command to point to the stylesheet.  Have tried fiddling with the extension code but only succeeded in breaking it!

This is the page that describes the config setting http://xinha.python-hosting.com/wiki/Stylist

Any ideas?

Profile
 
 
Posted: 14 December 2006 01:16 PM   [ Ignore ]   [ # 23 ]  
Research Assistant
RankRankRank
Total Posts:  347
Joined  10-25-2005

Anyone using this extension will likely want to add the following line of code in the list of Xinha plugins in the $settings[‘Plugins_To_Use_With_Xinha’] array in ext.xinha.php:

'HtmlEntities' => "HtmlEntities",

And enable this plugin in the Xinha extension settings.

What this plugin does is convert any special characters into their HTML-safe (and encoding agnostic) equivalent (e.g. &trade). Me, I’d prefer if it used the number format (e.g. ®), but that’s just a nit-pick (and something I could manually change in the plugin if I had the time).

We had major troubles with the UTF-8 special characters when doing SQL exports and imports. This should take care of any of those problems.

You’ll also want to make sure to download a recent version of Xinha, as I think this plugin was only introduced sometime in the last little while.


———-

Edit: Phoebe, input the following code anywhere in Step 3 in ext.xinha.php to load the stylist style sheet:

xinha_config.stylistLoadStylesheet("/_res/css/xinha-styles.css");

If it helps, here’s my entire step 3:

/** STEP 3 ***************************************************************
* Configure.
*************************************************************************/

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

';

if (strlen($this->settings['
CSS_url']) > 0) {

$r = $r . '
xinha_config.pageStyle = "@import url(' . $this->settings['CSS_url'] . ');";

';
}
    

$r = $r .



'
xinha_config.stripBaseHref = true;
xinha_config.baseHref = "http://thedomaintobestripped.com";

xinha_config.toolbar = [
[
"undo","redo","separator", "formatblock","bold","italic"],
["separator","justifyleft","justifycenter"],
["separator","insertorderedlist","insertunorderedlist","separator","outdent","indent"],
["separator","createlink","insertimage"], ["separator","htmlmode"]
]
;

xinha_config.formatblock = {
"— format —"  : "",
"Normal"   : "p",
"Heading 1": "h1",
"Heading 2": "h2",
"Heading 3": "h3",
};

xinha_config.stylistLoadStylesheet("/xres/css/xinha-styles.css");

xinha_config.pageStyle = "body { font-family: Verdana, sans-serif; font-size: .9em; }";

'.


'

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 14 December 2006 03:28 PM   [ Ignore ]   [ # 24 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

jtnt, I’ve just posted an update of the Xinha extension, with support for the HtmlEntities extension. Thanks very much for your additions.

(The extension can be downloaded from the first post in this thread).

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 15 December 2006 09:34 AM   [ Ignore ]   [ # 25 ]  
Research Assistant
RankRankRank
Total Posts:  347
Joined  10-25-2005

No problem. Thanks for the initial work on the extension!

Also, shouldn’t this thread be moved to the Extensions forum?

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 06 February 2007 11:37 PM   [ Ignore ]   [ # 26 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  684
Joined  08-19-2006

I’m having the same issues as bjsteiger… just installed, set the paths, viewing source code all seems good. Amended the code in the extension as per reply 1 to put it on all textareas, but nothing.

Have cleared cache, still nothing…

Any other pitfalls? Doe everyone have issues installing this?

Also, I am using standalone forms on this site to allow various user groups to add and modify the site without having to log in to the cp. I would also like this RTE to work on those forms. Does anyone know how I would do that? Would I just include the same javascript as is found in the extension?

Thanks

Patrick

 Signature 

Patrick TT
Aussie Freelancer

Profile
 
 
Posted: 07 February 2007 07:17 PM   [ Ignore ]   [ # 27 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  684
Joined  08-19-2006

Woohoo… I had some help from the xinha forums, and I now have the rte applied to my standalone entry and edit forms. Phew! Thought I was about to come unstuck there… thanks Lisa for the suggestion of using this particular rte…

Patrick

 Signature 

Patrick TT
Aussie Freelancer

Profile
 
 
Posted: 08 February 2007 03:37 AM   [ Ignore ]   [ # 28 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

AussieFreelancer, can you tell us how you got your installation working with the Xinha extension? I can add your notes to the docs.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 08 February 2007 04:33 AM   [ Ignore ]   [ # 29 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  684
Joined  08-19-2006

Hi Vik,

As I say, I got it working on the standalone forms, in a similar way to how it works in teh plugins. In the head of the document, I put the following code:

<!-- rte -->
        
        
        
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.
        *
        * The list of plugins below is a good starting point, but if you prefer
        * a must 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',
        
'ExtendedFileManager',
        
'FullScreen',
        
'ImageManager',
        
'ListType',
        
'SpellChecker',
        
'Stylist',
        
'SuperClean',
        
'TableOperations'
        
];
             
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
             
if(!Xinha.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 :
        //[
        //'field_id_5'
        //];

        
var textareas = document.getElementsByTagName("textarea");
        var
xinha_editors = new Array();
                    
        for (var
i in textareas) {
                        
            
if (textareas[i].id) {xinha_editors.push(textareas[i].id);}
        }

        
/** 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();

        
xinha_config = new Xinha.Config();
        
xinha_config.width  = '700px';
        
xinha_config.height = '420px';

        
/** 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','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   = 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
.addDom0Event(window,'load',startList);
        
Xinha.addDom0Event(window,'load',xinha_init);
        
        
</script>
        
<!-- eof rte -->

And then copied all the xinha files and folders into the root directory of my site. And that was it.. :D I ran into a few issues with having more than one onload event, but there is something built in to Xinha to deal with that, so as above, both startList and xinha_init are loaded when the page loads. I guess you would just add more of those for any other functions you need to run at startup.

I am also currently having an issue where on the edit form, in that the paragraph and linebreaks are not appearing in the textarea. Not sure if that is to do with how EE inserts into the db and pulls out again, but hoping that I can resolve it asap.

Apart from that though, I didnt do anything more than what the plugin already does smile

Thanks

Patrick

 Signature 

Patrick TT
Aussie Freelancer

Profile
 
 
Posted: 08 February 2007 11:11 AM   [ Ignore ]   [ # 30 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

Excellent. Thanks very much for the info.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 09 February 2007 01:35 PM   [ Ignore ]   [ # 31 ]  
Research Assistant
RankRankRank
Total Posts:  347
Joined  10-25-2005

Time for a new version… The latest version of Xinha has some pretty extensive changes. The ones that affect your plugin are:

1) htmlarea.js is now XinhaCore.js
2) All old calls like “HTMLArea.xxx” are now “Xinha.xxx” (e.g. Xinha.Config, Xinha.startEditors, etc.)

They seem to have left htmlarea.js in the file structure for now, I guess for backward compatibility, but you have to guess that this will go away at some point.

The changes are pretty simple - a quick find/replace in BBEdit solves them in seconds - but I figured others should know about these changes. Also, Vik, you may want to look at the latest Xinha to see if there are any other changes (e.g. new/outdated plugins, etc.) that you might need to account for in your extension.

Edit: Also… They seemed to have done some work on documentation, which previously was atrocious, if available at all. The best new help page I can find, and oh it’s a godsend it the Config Variables List.

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 12 February 2007 02:26 PM   [ Ignore ]   [ # 32 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

Thanks for the heads up, jtnt.  I’ll check it out.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 12 February 2007 02:32 PM   [ Ignore ]   [ # 33 ]  
Research Assistant
RankRankRank
Total Posts:  347
Joined  10-25-2005

NP. And in fact, there may be other changes required than the ones I listed above. Those are just the ones I had to make to make your extension work for me. Furthermore, in the absence of any actual full-on testing, there may be other changes required to make everything work 100%. This is both a heads up for you and a CYA for me. smile

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 12 February 2007 03:29 PM   [ Ignore ]   [ # 34 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

smile Okay, very good. I just installed the latest Xinha, and I’ll try it out for a few days to see if any other changes show up.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 14 February 2007 11:17 AM   [ Ignore ]   [ # 35 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  09-16-2006

I just found and installed this extension and it looks great. I have it working as it should in the Publish area of the EE CP but was wondering if I could make it work with the Wiki module?

I saw this thread http://expressionengine.com/forums/viewthread/43464/ which was what lead me to the plugin in the first place, but I don’t really understand what I am suppose to do to get it working with the textareas in the Wiki. Anyone have any suggestions? Sorry if this is mentioned somewhere else but I didn’t see it (or I didn’t understand what I was seeing grin  ).  Thanks again for the great extension.

Profile
 
 
Posted: 14 February 2007 12:43 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
RankRankRank
Total Posts:  744
Joined  05-15-2004

You’re very welcome. I’m very glad you like it.

A separate extension would have to be written to support Xinha with the wiki module.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
   
2 of 4
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66467 Total Logged-in Users: 33
Total Topics: 84862 Total Anonymous Users: 14
Total Replies: 455349 Total Guests: 187
Total Posts: 540211    
Members ( View Memberlist )