Suggestion: WYSIWYG Editor for Album Description Suggestion: WYSIWYG Editor for Album Description
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Suggestion: WYSIWYG Editor for Album Description

Started by pols1337, November 16, 2012, 05:56:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pols1337

Hi,

So I just found out today (after using Coppermine for a couple of years now, ha) that you allow BBCode in Album Description.  Can you think about integrating some WYSIWYG Editor in future Coppermine?

I know for the 'technical' folks the WYSIWYG Editor is simply one step removed from BBCode, but for normal people like me, an editor is what we've become accustomed to. 

Veronica

I have a WYSIWYG Editor Plugin for Category, Album, Edit file, Ecard and File upload Coppermine descriptions based on TinyMCE.
I have made the WYSIWYG Editor working on all textarea tags in Coppermine ie inputs where multilines are allowed.

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB http://www.tinymce.com/index.php

To get my TinyMCE Integration plugin working in the current cpg 1.5.21 I have made a lot of code changes like adding plugin hooks and a new TinyMCE class.
Plugin and TinyMCE work together and there are no changes to TinyMCE code which is downloaded from the source site and installed in a Coppermine root subfolder.
Updates are downloaded as is from the TinyMCE download site independent of the plugin which I have tested this week with the latest TinyMCE update.

If Coppermine development is interested in these code changes I can publish a tutorial on how to update for this type of WYSIWYG editors
and make the plugin available for public download if my code changes will be accepted for next Coppermine release.

See attached picture for an example of "WYSIWYG Editor for Album Description" like the thread creators subject.



Jeff Bailey

We are always looking for plugin hook suggestions. Fell free to post them.

As for the class, AFAIK you should be able to implement that in the codebase.php of your plugin.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Veronica

Overview of plugin hooks for TinyMCE

New:

themes.inc.php


2564: $params = CPGPluginAPI::filter('theme_cat_params', $params);
2574: $params = CPGPluginAPI::filter('theme_cat_params', $params);
2584: $params = CPGPluginAPI::filter('theme_cat_params', $params);
why:
html_entity_decode CAT_DESC

2782: $params = CPGPluginAPI::filter('theme_album_params_cat', $params);
why:
html_entity_decode ALB_DESC

ecard.php

225: $params = CPGPluginAPI::filter('ecard_params', $params);
314: $params = CPGPluginAPI::filter('ecard_params', $params);
why:
replace MESSAGE with html_entity_decoded POSTed message (escaped)
replace PLAINTEXT_MESSAGE with POSTed message (escaped)
html_entity_decode PIC_CAPTION

profile.php

789: $form_data = CPGPluginAPI::filter('profile_form_data', $form_data);
why:
html_entity_decode user_profile6

I'm also using these existing plugin hooks:

javascript_includes
page_html
file_data
theme_display_thumbnails_params
theme_album_params




Veronica

For the class name I will take a look at using codebase
but to be honest I must say adding a dummy class name
in 6 tags for making it possible to address all the multiline textareas
should be implemented in Coppermine core
and not being searched for by a user written plugin.

phill104

It would be superb if you could attach a zip of your plugin so we can test it and maybe introduce your ideas in a future release. Great work so far, keep it up.
It is a mistake to think you can solve any major problems just with potatoes.

pols1337

QuoteIt would be superb if you could attach a zip of your plugin so we can test it and maybe introduce your ideas in a future release. Great work so far, keep it up.

I second that  ;)

Veronica

Thanks for your reply Phill I have some more textareas to include in the plugin before you can have a test.

Veronica

Quote from: Phill Luckhurst on November 21, 2012, 11:12:11 AM
It would be superb if you could attach a zip of your plugin so we can test it and maybe introduce your ideas in a future release. Great work so far, keep it up.

TinyMCE Integration plugin for proof-of-concept

Current version is intended only for Coppermine development team to evaluate this concept.

There are 7 required new Plugin Hooks for installing this plugin and you will find documentation about these new hooks in codebase.
These new hooks should be easy to implement for a Coppermine developer.
Plugin manager page will guide you in the installation steps required.
I will not publish any details about how to implement these new hooks as it's Coppermine core functions.

There is no rollback or cleanup function when uninstalling the plugin.
All formatting tags will be shown as clear text after an uninstall.
You must remove this formatting yourself why a test installation of Coppermine 1.5.21 is the best test environment

For a future public available version of this plugin there must be a strategy on how to implement formatting
maybe save both unformatted and formatted text in the database
or decide that uninstalling the plugin is not an option ie more like a Coppermine core function then.

The TinyMCE required dummy textarea class will be searched for and updated by the plugin at runtime.
I'm still asking for this dummy class in all multiline texareas to be a Coppermine core class.
Consider also using the TinyMCE integration for picture title texts which is a single line standard format now.

The TinyMCE integration includes also an integration with the Coppermine core themes maybe not optimal but as a concept acceptable including all theme styles.

Formatting functions of TinyMCE I have choosen to go very advanced with many fancy functions.
For a later official version of the plugin it is ofcourse possible to make simpler menus and gallery owner easy selectable variants of the editing functions.

TinyMCE options configuration setup is available as a TinyMCE controlled textarea after installation in the Plugin Manager page.
Default configuration and backup of current configuration are available backup functions

Support for many of the Coppermine languages is included because TinyMCE and Coppermine language codes are in some cases different.

Read more about TinyMCE here: http://www.tinymce.com/index.php