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.
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();
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.
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.
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.
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>
// 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 ************************************************************************/
/** STEP 5 *************************************************************** * "Start" the editors, this turns the textareas into * Xinha editors. ************************************************************************/
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.)
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.
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
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.
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.
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.
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.
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. =)
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
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.