Bug 5401 - WYSWYG for Koha News
Summary: WYSWYG for Koha News
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: PATCH-Sent (DO NOT USE) enhancement (vote)
Assignee: Koustubha Kale
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 15:04 UTC by Koustubha Kale
Modified: 2012-10-25 23:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
A screenshot of the editor working on my system (122.13 KB, image/png)
2010-11-13 15:04 UTC, Koustubha Kale
Details
[PATCH 1/2] Bug 5401: WYSWYG for Koha News Patch 1 eltre-1.1 library (854.03 KB, patch)
2010-11-15 04:01 UTC, Koustubha Kale
Details | Diff | Splinter Review
[PATCH 2/2] Bug 5401: WYSWYG for Koha News Patch 2 Koha files (4.88 KB, patch)
2010-11-15 04:03 UTC, Koustubha Kale
Details | Diff | Splinter Review
Demonstrating TinyMCE integration (1.77 KB, patch)
2010-11-16 17:47 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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