Bug 5401

Summary: WYSWYG for Koha News
Product: Koha Reporter: Koustubha Kale <kmkale>
Component: ToolsAssignee: Koustubha Kale <kmkale>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: PATCH-Sent (DO NOT USE) CC: chris, julian.maurice, magnus
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: A screenshot of the editor working on my system
[PATCH 1/2] Bug 5401: WYSWYG for Koha News Patch 1 eltre-1.1 library
[PATCH 2/2] Bug 5401: WYSWYG for Koha News Patch 2 Koha files
Demonstrating TinyMCE integration

Description Koustubha Kale 2010-11-13 15:04:59 UTC
Created attachment 2746 [details]
A screenshot of the editor working on my system

A WYSWYG editor for Koha news.

Will be submitting a patch which adds this functionality using elRTE editor from elrte.org which is BSD style licensed. Had to tweak its default css file a little for it to play with Koha.

A screenshot is attached.
Comment 1 Owen Leonard 2010-11-13 18:11:33 UTC
TinyMCE is already used by Koha for editing inline help. We should either use TinyMCE everywhere or we should agree on another choice. I think WYSIWYG is a nice idea for News, but I don't want to see two competing editors.
Comment 2 Koustubha Kale 2010-11-15 03:57:47 UTC
(In reply to comment #1)


As it happens I am aware of TinyMCE being already in Koha. But try as I might I could not get it to play nice ( read - at all ) with the News page.
I tried the jquery varient of TinyMCE too and no go.
Also I dont like the fact that the imagemanager etc of TinyMCE are only for paid customers. 

elRTE worked pretty well. Had to do some tweaks to its css etc.

I have cleaned up the patch. Divided it into two separate patches. One for the elRTE library and one for the Koha changes I did.
Now both apply squeaky clean. Got all features like image, media insert etc working now.

Attaching both the patches here.
Comment 3 Koustubha Kale 2010-11-15 04:01:06 UTC
Created attachment 2749 [details] [review]
[PATCH 1/2] Bug 5401: WYSWYG for Koha News Patch 1 eltre-1.1 library

This patch adds the eltre-1.1 library from elrte.org which is BSD style licensed.
This library is for use in WYSWYG editor for Koha staff client news editor.
I have tweaked the eltre css file elrte.full.css to get the buttons to display properly in Koha.
I have also removed the src directory, the changelog, readme and eltre.html files to reduce patch size and get rid of whitespace errors.
I have also used a sed one liner on the eltre dir to get rid of trailing whitespace errors.
Comment 4 Koustubha Kale 2010-11-15 04:03:01 UTC
Created attachment 2750 [details] [review]
[PATCH 2/2] Bug 5401: WYSWYG for Koha News Patch 2 Koha files

This patch adds WYSWYG editor functionality to Koha news in staff client using elRTE editor from elrte.org which is BSD style licensed.
elrte.inc file to configure the elRTE WYSWYG editor from elrte.org
By using the opts array you can control the appearance of the buttons as well as size of the text area.
For options of the opts array and others to control the appearance of the editor, refer to eltre.org.
This header file is inserted in the koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
Comment 5 Owen Leonard 2010-11-15 17:14:39 UTC
Some more thoughts about these patches:

- This introduces another copy of jQuery, version 1.4.2. We should coordinate this patch with a Koha-wide upgrade of jQuery (Bug 5184). Having two copies of jQuery is not desirable.

- This adds the jQueryUI library is a "custom" form, but it's not clear what dependencies are included. jQueryUI is on the list for inclusion in 3.4+, but we still need to have a discussion out in the open about what components to include by default.
Comment 6 Owen Leonard 2010-11-16 17:40:46 UTC
I see now that the inclusion of jquery and jqueryUI are the result of the way the editor is distributed. The elRTE site says that the jqueryUI components which are required are dialog and tabs, which I'm sure we'll include in any Koha-wide jqueryUI implementation.

I note that it is not required that you use the bundled versions of jquery and jqueryUI, although the elRTE site doesn't explicitly say what versions are required.

On the other hand, I was able to get TinyMCE running just fine on the Koha News page by doing a simple cut and paste from the edithelp template. For me that's a big plus for TinyMCE: Why switch when broader integration isn't a problem?
Comment 7 Owen Leonard 2010-11-16 17:47:57 UTC
Created attachment 2763 [details] [review]
Demonstrating TinyMCE integration

This patch demonstrates that a cut and paste of TinyMCE integration code from edithelp.tmpl adds a rich text editor to Koha News with no configuration changes.
Comment 8 Koustubha Kale 2010-11-17 04:06:17 UTC
(In reply to comment #7)
> Created attachment 2763 [details] [review]
> Demonstrating TinyMCE integration
> 
> This patch demonstrates that a cut and paste of TinyMCE integration code from
> edithelp.tmpl adds a rich text editor to Koha News with no configuration
> changes.

Nice. ( Why didn't I think of copy paste? )

The only objection I have is TinyMCE's policy of having some of their code such as Image insert as commercial only.
Comment 10 Magnus Enger 2011-03-30 10:42:58 UTC
I have tested the TinyMCE patch from Owen, and it works like a charm.
Comment 11 Chris Cormack 2011-04-01 07:39:11 UTC
Pushed, please test
Comment 12 MJ Ray (software.coop) 2011-04-08 06:29:41 UTC
This bug is mentioned in:
Bug 5401,	WYSIWYG for Koha news: Testing TinyMCE http://lists.koha-community.org/pipermail/koha-patches/2011-March/014347.html