1 of 4
1
Xinha WYSIWYG Editor Extension Release v1.0
Posted: 30 May 2006 12:34 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

Attached is the v1.0 release of the Xinha WYSIWYG Editor Extension. Thanks to all who beta tested.

This extension requires ExpressionEngine 1.4.2 or later.

(For those who have beta tested, no changes have been made since the v0.0.4 beta release.)

Update 8-30-06: attached is version, 1.0.1, of the Xinha extension. It now supports the Disable_Extension function, which tidies things up when the extension is disabled.

Update 10-25-06: attached is the latest version, 1.0.3. It now avoids warning messages that appeared during installation on systems that had PHP 5.

Update 12-14-06: attached is the latest version, 1.0.4. It now supports the recently added HtmlEntities plugin.

File Attachments
Xinha Extension v1_0_4.zip  (File Size: 7KB - Downloads: 503)
Xinha Extension v1_0_3.zip  (File Size: 8KB - Downloads: 313)
 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 07 August 2006 11:37 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  342
Joined  10-25-2005

I apologize for not replying to your previous thread… Below is the code I use - with context to see where I put it.

/** STEP 2 ***************************************************************
                    * Set which fields will get Xinha
                    ************************************************************************/
                
                    
var textareas = document.getElementsByTagName("textarea");
                    var
xinha_editors = new Array();
                    
                    for (var
i in textareas) {
                        
                            
if ((textareas[i].id) && (textareas[i].id != "field_id_7" && textareas[i].id != "field_id_18")) {
                                
                                xinha_editors
.push(textareas[i].id);
                                
                            
}
                    }
                        
        
                    

Since your plugin does not pick up custom fields in the CP area of the extenstion, this code runs through all textareas on the page and pushes them into the xinha_editors array. I have a couple textareas that I want to exclude from this (ids 7 and 18). You might be able to accomplish this in your plugin by letting people type in or choose which textareas they want to exclude.

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 07 August 2006 12:24 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

Nice code, jtnt!

Using this approach, I might be able to put all the custom fields into the extension’s preferences pane.

It seems that some of the fields have two names, e.g.:

field_id_1 - Summmary Field
field_id_2 - Body Field
field_id_3 - Extended Text Field

Is there a way to use getElementsByTagName to retrieve both names for each field?

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 07 August 2006 12:39 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  342
Joined  10-25-2005

Not sure why you’d need that. At the extension prefs level, you should get the field names/ids from the database, since you want to list them ALL.

What the code above does, is at run time, it loops through all the textareas on a Publish/Edit scren, and applies the xinha editor to them.

So, if you could in the preferences list ALL of the fields in the db that are textareas then allow people to choose them, that’s one way - and you wouldn’t need to use my code.

Or, you could essentially just do the opposite. Use my code (which I pulled/edited from somewhere else, but can’t remember where now) and in your prefs, the people would then choose which textareas they did NOT want xinha applied to, and you could write these dynamically into the if statement of my code.

Understand? Either way, you have to list all the textareas in your preferences to be able to make this easier for the end-user.

 Signature 

DeGeeked: Simple answers to tech questions.

Profile
 
 
Posted: 30 August 2006 03:54 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

The Xinha extension has been updated to version 1.0.1. It now supports the Disable_Extension function, which tidies things up when the extension is disabled. See the first post in this thread, to download it.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 06 September 2006 03:16 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  203
Joined  02-10-2006

I have installed and followed the directions but when I go to a publish page, I still see no editor….here is a snippet from my source code, which indicates its trying to load (all of my paths are correct):

// INSTALL XINHA WYSIWYG EDITOR
                
_editor_url  = "http://www.domain.com/xinha/"
                
_editor_lang = "en";      // And the language we need to use in the editor.
            
</script>
            
            
<!-- Load up the actual editor core -->
            
</script>

            
<!-- Load user preferences -->
                        
                
xinha_editors = null;
                
xinha_init    = null;
                
xinha_config  = null;
                
xinha_plugins = null;
                
                
// Initialize
                
xinha_init = xinha_init ? xinha_init : function()
                
{
                    
/** STEP 1 ***************************************************************
                    * Load desired plugins.
                    ************************************************************************/
                    
                    
xinha_plugins = xinha_plugins ? xinha_plugins :
                    
[ "CharacterMap",
                    
"FindReplace",
                    
"FullScreen",
                    
"InsertPicture",
                    
"PasteText",
                    
"SpellChecker",
                    
"SuperClean"
                    
];
                
                    
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
                    
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
                    
                    
/** STEP 2 ***************************************************************
                    * Set which fields will get Xinha
                    ************************************************************************/
                    
                    
xinha_editors = xinha_editors ? xinha_editors :
                    
[ "field_id_1",
                    
"field_id_2",
                    
"field_id_3"
                    
];
                    
                    
/** STEP 3 ***************************************************************
                    * Configure.
                    *************************************************************************/
                    
                    
xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
                    
                    
/** STEP 4 ***************************************************************
                    * Create editors for the textareas.
                    ************************************************************************/
                    
                    
xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
                    
                    
/** STEP 5 ***************************************************************
                    * "Start" the editors, this turns the textareas into
                    * Xinha editors.
                    ************************************************************************/
                    
                    
HTMLArea.startEditors(xinha_editors);        
                
}
            </script>

thank you for the help?

Profile
 
 
Posted: 06 September 2006 04:25 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

Hi bjsteiger,

It’s likely a matter of the paths. Make sure you’ve:

- Downloaded Xinha from the link noted in the Read Me file for the extension
- Used the right path in the Xinha extension preferences, including captalization
- If you initially installed EE on a brand-new domain name, make sure your EE paths, in your EE preferences, show your ascii URL, rather than your IP url. (This can happen if you install EE on a site before your URL has finished propagating via your domain name registration.)

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 06 September 2006 04:53 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  203
Joined  02-10-2006

Downloaded Xinha from the link noted in the Read Me file for the extension

DONE

Used the right path in the Xinha extension preferences, including captalization

DOUBLE CHECK AND DONE RIGHT

If you initially installed EE on a brand-new domain name, make sure your EE paths, in your EE preferences, show your ascii URL, rather than your IP url.

DOUBLE CHECK AND NO IP IS USED

——-

Still no luck

Profile
 
 
Posted: 06 September 2006 05:48 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

Have you used any other publish page extensions before? Some of them don’t deinstall themselves correctly.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 07 September 2006 06:56 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  203
Joined  02-10-2006

Up to this point I have not used any other publush page extension. Since this does not work I tried installing TinyMCE and it worked right away. I disabled TinyMCE (verified in the DB as well) and then tried Xinha again. Still Xinha doesn’t work….

This is where I have Xinha installed…

http://www.domain.com/editors/xinha

I set the setting in Extension settings to http://www.domain.com/editors/

When looking in the source code it looks like the path is correct because I can use the full path to find the .js file

Profile
 
 
Posted: 07 September 2006 09:40 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

This is where I have Xinha installed…

http
://www.domain.com/editors/xinha

I set the setting in Extension settings to http://www.domain.com/editors/

Did you change the extensions prefs for Xinha since your earlier posting? When you posted a snippet of the source from the publish page, you posted:

// INSTALL XINHA WYSIWYG EDITOR
                
_editor_url  = "http://www.domain.com/xinha/"

The _editor_url is taken from the path in the Xinha extension prefs.

The snippet you posted shows that the extension is modifying your publish page source code as expected. If you’ve supplied the correct path, then something about your installation is preventing Xinha from being able to find, or execute, the Xinha code.

I just checked the version of the TinyEdit extension (v1.0.0) that is downloadable from the eeWiki, and it does not appear to contain the Disable_Extension function so as to uninstall itself correctly.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 07 September 2006 10:31 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  203
Joined  02-10-2006

Did you change the extensions prefs for Xinha since your earlier posting?

Yes I did…I ended up installing it in a different location to see if it work and it didn’t. I even saw the javascript load in the source and all of the pathings were correct. In addition I checked the db to very that tinymce was uninstalled (which it was).

FYI - I even installed Xinha on my local box and tested it there and I still couldn’t see the editor.

Thank you for the support

Profile
 
 
Posted: 09 September 2006 06:59 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  84
Joined  05-15-2004

Hi Vik,

Downloaded Xinha and uploaded to \xinha on my webserver.
Installed the extension within EE v1.50
Edited the pathsetting to htp://www.webserver.com/xinha/

Looked through the source of the loaded page and it came up with:
http://www.webserver.com/xinha/xinha

Then I adjusted the path setting to just http://www.webserver.com

And until now it works like a charm. Boy, Xinha is lightning fast in presenting the menubars.

Thanks Vik, Great work!!

Profile
 
 
Posted: 09 September 2006 10:59 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

You’re very welcome, Steef!

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 10 September 2006 06:50 AM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  84
Joined  05-15-2004

Vik,

still pleased with it but one of my installs uses only custom fields. How to add Xinha to Customf Textarea Field?

I changed the ext_xinha.php file:

$settings['Text_Fields_To_Use_With_Xinha']    = array('ms', array('field_id_1' => "Summmary Field",
                                                                        
'field_id_2' => "Body Field",
                                                                        
'field_id_3' => "Extended Text Field"), array('field_id_1', 'field_id_2', 'field_id_3'));

   

to

$settings['Text_Fields_To_Use_With_Xinha']    = array('ms', array('field_id_1' => "Summmary Field",
                                                                        
'field_id_2' => "Body Field",
                                                                        
'field_id_3' => "Extended Text Field", 'field_id_4' => "ko-description"), array('field_id_1', 'field_id_2', 'field_id_3', 'field_id_4'));

The fieldname does show up in the Xinha Extension Settings but the Textarea field isn’t updated with Xinha WYSIWYG editor.

Profile
 
 
Posted: 13 September 2006 02:21 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
RankRankRank
Total Posts:  754
Joined  05-15-2004

Hi Steef,

The extension doesn’t currently support custom fields. It’s a feature that has been requested before. I haven’t even studied yet to determine the correct way to add it to the extension.

 Signature 

http://www.FlavorZoom.com

Profile
 
 
Posted: 13 September 2006 03:12 AM   [ Ignore ]   [ # 16 ]  
Grad Student
Rank
Total Posts:  84
Joined  05-15-2004

Hi Vik,

Keep up the good work. The ability for custom fields would be a great addition to the extension.

Profile
 
 
Posted: 13 September 2006 07:30 AM   [ Ignore ]   [ # 17 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

Just as a note, for Vik and anyone else: the default fields - {body}, {summary}, and {extended} are all custom fields.  So if this extension supports those - then it does, in fact, support custom fields.  Just only the ones that EE sets up for you at install. =)

 Signature 
Profile
MSG
 
 
Posted: 02 October 2006 04:50 AM   [ Ignore ]   [ # 18 ]  
Research Assistant
RankRankRank
Total Posts:  332
Joined  10-11-2004

Just installed this extension as I was having lots of little niggles with TinyMCE.  Looks very promising!

Just a few small things that might help others installing this.

1. When entering the path for xinha, it is very particular.  (correct me if I’m wrong!)
  - xinha must be in a folder called xinha
  - path must have a trailing /
  - path must NOT include the xinha folder name, so if in the root directory of the domain, put www.mydomain.com/
To check if the path is correct, use the view source option on the publish page and look for

// INSTALL XINHA WYSIWYG EDITOR
                
_editor_url  = "http://www.clonakilty.ie/xinha/"

2. Doesn’t work with Safari

3. When using the hack in #comment 1 above, thanks jtnt, don’t forget to remove hidden formatting if you copy and paste from this page!  Use Remove ASCII in BBedit.

Profile
 
 
   
1 of 4
1
 
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: 64535 Total Logged-in Users: 24
Total Topics: 81113 Total Anonymous Users: 15
Total Replies: 436444 Total Guests: 173
Total Posts: 517557    
Members ( View Memberlist )
Newest Members:  marlusbluespotmusicvolandspinhirnetheminiokostiamasterjeMBossbchaleyalvonsius