Extra functionality for Whizzywig module
palazis - September 24, 2007 - 19:09
| Project: | Whizzywig |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Thanks for a really great module!
Is there an easy way to add more buttons?
Which file(s) should I change and how?
For example button for subscript, superscript and full justification would be very useful.
Integration of the IMCE module (for images and other files) would be great also.
Thank you in advance.

#1
Hi,
The whizzywig editor does indeed allows to be extended with extra buttons and an image/file browser.
However i have no experience with doing that, so i will have to investigate it further.
If this involves changes to the whizzywig.js file, it could not be made a part of this module, as the JS is not included in this module.
Ofcourse then i could still document how it could be achieved through customisation, but that's not the primary goal right now.
My first concern right now is to make sure that all standard functionality of the whizzywig editor is working fine in Drupal.
I'll keep you updated if i find a way to achieve this without breaking current behaviour.
#2
By the way: If you don't mind digging into some code yourself, have a look at this page:
http://www.unverse.net/customize-whizzywig.html
There's a mentioning of an extended demo (http://www.unverse.net/wysiwyg-extended.html) which allows superscript.
If you do wish to experiment with it, let me know your findings.
I'll have a look at it myself if i find the time.
#3
Hello
Thanks for both answers. I can understand that standard functionality of the whizzywig editor is a priority.
But I think that you have already done a great job and everything works fine!
Myself I am not an expert in coding... But yes perhaps i could start digging into some code...
I have seen http://www.unverse.net/customize-whizzywig.html and http://www.unverse.net/wysiwyg-extended.html
But I am not sure which file or files should I change..... And how...
whizzywig.js? or whizzywig.htm? or maybe another file?
In the meantime, all i can contribute is 3 extra language files in UTF-8 format: greek.js, deutsch.js and english.js (useful if someone wants to change the defaults).
PS I am new here so I haven't realized that files with .js extensions cannot be uploaded.
Perhaps there is another way
#4
Thanks for the follow up. To contribute the language files (.js), you better contact the author of Whizzywig editor through http://www.unverse.net/reachus.html. This way everyone using this editor can make use of your translations, not only Drupal users.
Furthermore I am glad to announce that i have managed to integrate Whizzywig with IMCE, so file browsing will be possible!
Also i am halfway through adding an interface to add custom buttons to the Whizzywig editor.
The IMCE settings will be available for testing by downloading the 5.x-1.x-dev Development Snapshot.
However the current snapshot was made on September 24th, while it should be the one from today (September 25th).
I'm not yet too sure how this works, but if the -dev version of September 25th should be available, you can test the IMCE integration.
Kind regards,
svendecabooter
#5
Wow! Not only you're efficient, but also very fast! Congratulations!
I believe that this small editor is very powerful. Much better than heavy and buggy editors like tinymce or fckeditor.
Maybe we should all support this effort to integrate whizzywig into drupal.
Some advertising won't be a bad idea! Perhaps this module one day becomes very successful!
And one day such a strong and light editor is included in drupal core...
Unfortunately the link http://www.unverse.net/contact.html that should be used to send translation files seems to be broken.
So I have used the contact form http://www.unverse.net/reachus.html to send them an email. Perhaps they're interested in UTF-8 translation files.
I will definitely try 5.x-1.x-dev with all the new goodies! Thank you!
In the meantime, I can share some new ideas and thoughts with you and all the rest of drupalers.
1) Editor profiles and roles. Perhaps it would be useful for admins to define different editor profiles by role. For example, a simple (authenticated) user might have access to only a few buttons and a moderator or administration might have access to all editor functionality.
2) Default buttons (tool bar settings). I believe that the default value "All" in the "Buttons to show on tool bar" option may not be such a good idea... Drupal is minimalistic anyway! Perhaps 4-5 basic buttons are enough! No fonts, no font sizes, no colors! No HTML source button!
3) Theming and CSS. I have seen a simple.css file in the whizzywig package. Perhaps it would be useful for admins to define somehow that the file style.css from the current theme should be loaded and used.
4) State(s) of editor. Default editor state (e.g. enabled/disabled) could be an option for administrators. If enabled --> show editor, else show default drupal text area. In addition, allowing users to choose editor state (e.g. enabled/disabled) could be another admin option, so that users themselves can choose to show the editor (or not) from "my account" page. Finally, a "toggle editor state" link (or button) below the text area is another useful admin option so that users can disable/enable the editor on line.
5) Input formats. Well, I don't know - we can't use the standard filtered html format... With your experience, what is best? Allow full html for all users (as default format), or maybe create another new format with more "loose" filtering and use that as a default format? Or perhaps another idea?
I hope that some of my thoughts above might be creative...
Thank you
Vassilis
#6
I have now added functionality which allows for custom buttons.
I have updated the official release to 5.x-1.1, which includes this functionality + IMCE support.
Thanks for your thoughts about the functionality that this module should provide.
I have made the title of this issue more general, to reflect the contents of this issue.
Most of your ideas make absolutely sense to me and would make good features for this editor. I will be implementing most of them at one point, but it's hard to say when. I feel like most of these things have already been implemented numerous times for other WYSIWYG editors before, and i'm starting to wonder if it wouldn't be more efficient to have some kind of API which takes care of tasks that are common for all WYSIWYG editors... Ofcourse that's just a vague idea and maybe practically not easy to accomplish...
We'll see how things go i guess. If i find the time, i will increase the functionality of this module based on what people want most. For now i think the module is working fine for general use.
#7
I have now tried all the new functionality - this is a very powerful editor now.
And of course I agree. For the time being, the module is working fine for general use.
The API idea seems also OK... But I don't know, there aren't so many editors out there and some
developers might have other ideas. Anyway....
Is there some way that the editor can support smilies?
Sorry if I have bothered you too much!!
#8
Another thing...
How does Whizzywig generally interact with various input filters?
I had some thoughts about this in my previous comments here...
But yesterday I had some problems to use the PHP input filter with whizzywig - the code wouldn't execute.
Any ideas?
#9
It is recommended to disable the HTML filter, or better yet: adjust the list of allowed tags so the tags specified by the buttons you selected, are allowed. Using PHP code in the Whizzywig editor (or in an editor for that matter), is not recommended, because it will almost always mess things up.
That's at least what my experience is regarding the input filters. Other opinions are ofcourse always welcome :)
#10
Thank you once again. I have already adjusted the list of allowed tags in the HTML filter.
As for PHP code I have found a temporary solution:
I have created a new content type called phppage and granted access to administrators only. I also deactivated whizzywig for all node/add/php* pages. The only problem this solution does not solve is when I EDIT a phppage...
Another thing: I have "touched" the .js file of whizzywig in order to add 4 more buttons for select all, cut, copy and paste operations.
It works but only in Internet Explored! In Firefox only the select all button is OK...
Why? Any ideas?
#11
This bug has been fixed on Drupal 6.x-1.0-ALPHA1.
Please upgrade to Drupal 6 if possible, we're now in Drupal 6 (and Drupal 7 already in code freeze stage!).
We will make Whizzywig become the BEST editor for Drupal and will include File/Image Browser, File Resize, File Delete, Create Folder, support pre-define folder, etc!
Please open NEW ticket if you find any bugs, I really want to hear you!