Addon Release: Generic Editor Adaptor (GEA) - Use Any Editor

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Addon Release: Generic Editor Adaptor (GEA) - Use Any Editor

Postby Jahandar » Sun Sep 11, 2005 9:13 am

Want to run one of those new fancy WYSIWYG HTML editors like Spaw, FCKeditor, RTE, htmlArea, and such? No problem. GEA will allow you to easily implant the code necessary to run these editors in Coranto for posting and modifying posts.

Download here!

Updated! Now version 1.2

Be sure to read the Addon Documentation.

-----------------------------------------------------

New in v1.2:

Okay, this new version adds a feature that is pretty neat, in my opinion.

There are many Coranto addons (like SelectPic and QuickTags) that do not work with html editors, like webwriter. Because people have gotten comfortable with those addons, I thought it would be nice if they could be made to work, not only for webwriter, but for any editor.

This new version creates a generic javascript function that will allow addon developers to send html/text to any editor, so long as GEA is enabled. All that has to be added is a check to see if GEA is enabled, if so, call the javascript function GIA_InsertContent(html) otherwise send it to the textarea element as usual.

Also, a minor bug was fixed.

By the way, if anyone has trouble getting an addon working, post here or in the Addon help forum, and I will gladly help. Plus once we get the solution, everyone else who wants to use that editor can just cut and paste it.

Eventually though, I would like the addon to include predefined profiles for all the most popular editors, so a user can just choose one and have it automatically set up. With that in mind, whenever one of you gets a new editor running, it would be nice if you post or PM the inner html, header html, and insertion method.

-----------------------------------------------------


Test Server:
I did my testing on a linux server with Perl, Coranto v1.24 and the following addons installed: Maginot, Multipart, News Categories, X MultiSubmit, Modify News: Include Field, Modify News: User Column

Note: While I tried to make this as generic as possible, and it should work for most editors (every one that I've ever looked at will work), if you happen to find an incompatibility with a certain editor, report it and I'll see what I can do.

Please report any bugs, suggestions, improvements, questions, comments, compatibility confirmations, and such here. Feedback is important because I like to know when my work is of value to others.
Last edited by Jahandar on Mon Oct 03, 2005 6:15 pm, edited 11 times in total.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Jahandar » Sun Sep 11, 2005 5:53 pm

My next step should be to add hooks to allow people to hook into this mod for more flexibility, should you need it. I just have to figure out how, not sure if its just as simple as # HOOK: HookName
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby bozoka45 » Sun Sep 11, 2005 6:27 pm

Code: Select all
#HOOK: HookName


Should work fine, but I would prefix it with the name of your addon.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby Jahandar » Sun Sep 11, 2005 6:32 pm

bozoka45 wrote:
Code: Select all
#HOOK: HookName


Should work fine, but I would prefix it with the name of your addon.


I had planned to. Thanks for the info, you've saved me some time. :)

Just to be sure, will they work anywhere in the addon, or only in code that will be hooked into the core?

Edit: Nevermind, from what I can see it will, I just include the line after the hook declaration comment to run each hook:

if($Addons{'Addon_MyHook'}){my $w;foreach $w (@{$Addons{'Addon_MyHook'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Parahead » Sun Sep 11, 2005 8:03 pm

Jahandar wrote:Edit: Nevermind, from what I can see it will, I just include the line after the hook declaration comment to run each hook:

if($Addons{'Addon_MyHook'}){my $w;foreach $w (@{$Addons{'Addon_MyHook'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}
You got it right. The 'hook declaration' (#HOOK: Hookname) is just what you say, a comment, nothing else. That is just for easier maintanance of the code, it is the line above you have quoted which does the actual hook-work...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Update! GEA v1.1

Postby Jahandar » Sun Sep 11, 2005 9:09 pm

New version ready, this just adds code hooks and some more content in the documentation.

Use the download link in the first post.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Jahandar » Sun Sep 11, 2005 11:07 pm

Err, whoops... Slight fix, if anyone downloaded this between my last post and this one, either comment out line 92 or download the new version from the link in the first post.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Jahandar » Sun Sep 11, 2005 11:44 pm

Note: I've been going back and forth between editors, trying to catch any problems. One thing I have noticed is that comments in your javascript can cause issues, because Coranto removes all newlines from the settings textbox. I'll see what I can do about preventing that, but in the mean time be aware of this.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Jahandar » Thu Sep 15, 2005 2:58 am

I see people have been downloading this, and a few posted that they were anxious to try it. I'm curious about your experiences with this addon, and if it has met expectations. Keep in mind that I do not have beta testers like many addon authors, so feedback posted here is very important to me.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby muttly » Thu Sep 15, 2005 6:15 am

I took a really quick stab at it and it was more work than I anticipated or had time to take on. Not complaining, I just tend to be too optimistic about what I'm going to get done.

From your Docs

This addon allows you to setup Coranto to work with most HTML editor form elements, including RTE, Spaw, FCKeditor, htmlArea, etc.


<lazy web>Links to RTE, Spaw, FCKeditor, htmlArea would be a nice addition. A paragraph or two on why I might pick one over another would also be nice. I know that to a large extent it depends on my specific situation, but there's got to be something general that can be said about those that seem popular enough to mention by name. </lazyweb>
muttly
 
Posts: 178
Joined: Mon Jun 10, 2002 8:19 pm

Postby Jahandar » Thu Sep 15, 2005 7:27 am

muttly wrote:I took a really quick stab at it and it was more work than I anticipated or had time to take on. Not complaining, I just tend to be too optimistic about what I'm going to get done.

From your Docs

This addon allows you to setup Coranto to work with most HTML editor form elements, including RTE, Spaw, FCKeditor, htmlArea, etc.


<lazy web>Links to RTE, Spaw, FCKeditor, htmlArea would be a nice addition. A paragraph or two on why I might pick one over another would also be nice. I know that to a large extent it depends on my specific situation, but there's got to be something general that can be said about those that seem popular enough to mention by name. </lazyweb>


Well, there are literally hundreds of editors out there, so I certainly won't cover them all, but I can give a run-down of the ones I mentioned, RTE I mentioned because I know it well, and some version run in Safari (not sure on details -- check the RTE website), FCKeditor is my new favorite, for its wide range of features, and Spaw I don't care for but I mentioned because it does have some advanced features, and someone mentioned it by name in my RTE thread. Other popular editors include TinyMCE which also claims to work in Safari, and of course htmlArea, which is used by WebWriter. There is a whole website devoted them, so you can search there for more... http://www.htmlarea.com

Every editor I've looked into work using my addon to the best of my knowledge, assuming the editor is properly installed and the addon is properly configured.


By the way, stay tuned.. I'm about to post an update to this addon.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

New Version! 1.2

Postby Jahandar » Thu Sep 15, 2005 7:59 am

Okay, this new version adds a feature that is pretty neat, in my opinion.

There are many Coranto addons (like SelectPic and QuickTags) that do not work with html editors, like webwriter. Because people have gotten comfortable with those addons, I thought it would be nice if they could be made to work, not only for webwriter, but for any editor.

This new version creates a generic javascript function that will allow addon developers to send html/text to any editor, so long as GEA is enabled. All that has to be added is a check to see if GEA is enabled, if so, call the javascript function GIA_InsertContent(html) otherwise send it to the textarea element as usual.

Also, a minor bug was fixed.

By the way, if anyone has trouble getting an addon working, post here or in the Addon help forum, and I will gladly help. Plus once we get the solution, everyone else who wants to use that editor can just cut and paste it.

Eventually though, I would like the addon to include predefined profiles for all the most popular editors, so a user can just choose one and have it automatically set up. With that in mind, whenever one of you gets a new editor running, it would be nice if you post or PM the inner html, header html, and insertion method.

To download, use the URL in the first post.
Last edited by Jahandar on Thu Sep 15, 2005 8:35 am, edited 3 times in total.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

FCKEditor GEA

Postby Jahandar » Thu Sep 15, 2005 8:12 am

To help people get started with the new version, here are the codes for FCKeditor. You should be able to just copy and paste them right into the configuration page.

Header HTML:
<script type="text/javascript" src="[GEA: Path]fckeditor.js"></script>

Inline HTML:
<script type="text/javascript">var oFCKeditor = new FCKeditor( '[GEA: FieldName]' ) ;oFCKeditor.BasePath = '[GEA: Path]';oFCKeditor.Value = "[GEA: Content]";oFCKeditor.Create();</script>

Editor Insertion Function:
FCKeditorAPI.GetInstance('[GEA: FieldName]').InsertHtml

Make sure your path begins and ends with a slash, and set the Field Name to Text. The others options you can leave alone.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Parahead » Thu Sep 15, 2005 6:15 pm

Jahandar wrote:I see people have been downloading this, and a few posted that they were anxious to try it. I'm curious about your experiences with this addon, and if it has met expectations. Keep in mind that I do not have beta testers like many addon authors, so feedback posted here is very important to me.
I am in no way trying to discourage you, but as a regular addon developer, I would say to treat no news as good news. ;-) And I really would like to know which addon authors you refer to that has a staff of beta testers, I would like to get in contact with them too... :roll:

And oh, I almost forgot, good work! We need more addon developers! :-D
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Jahandar » Thu Sep 15, 2005 7:44 pm

Parahead wrote:I am in no way trying to discourage you, but as a regular addon developer, I would say to treat no news as good news. ;-) And I really would like to know which addon authors you refer to that has a staff of beta testers, I would like to get in contact with them too... :roll:

And oh, I almost forgot, good work! We need more addon developers! :-D


Sorry, I didn't mean that in a negative way at all, it was just the impression I got from reading threads like this. On the other hand, I see here that even the core suffers from a lack of testing and feedback, so perhaps you're right. I'll keep going, and just take the feedback as it comes. Thanks for the advice. :)
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Jahandar
 
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Next

Return to Addon Release and Support

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron