Plugin: SuperClean
The SuperClean plugin, developed by James Sleeman and improved by Niko Sams based on code by Udo Schmal provides a combined interface for HTMLTidy, Word cleaning, stripping out font typefaces, colours and sizes, and calling custom filter-functions.
For the tidy functionality it uses a PHP backend file.
Plugin-Setting filters:
Defines the avaliable filters
editor.config.SuperClean.filters = {
'tidy': HTMLArea._lc('General tidy up and correction of some problems.', 'SuperClean'),
'myfilter': 'My special Filter'
};
Avaliable built-in filters:
- tidy: calls HTMLTidy (through the php-backend)
- word_clean: calls the Xinha Word-Clean-Functions
- remove_faces: removes all font-faces
- remove_sizes: removes all font-sizes
- remove_colors: removes all font-colors
- remove_lang: removes all lang-attributes
Custom filters
Custom filters must be defined in plugins/Filter/filters/myfilter.js
example:
function(html, editor) {
//...do something fancy with html...
return(html);
}
Plugin-Setting show_dialog
If false all filters are applied on button click, if true a dialog asks which filters should be used
//example (=default) editor.config.SuperClean.show_dialog = true;
Plugin-Setting tidy_handler:
Set to the URL of a handler for html tidy, this handler (see tidy.php for an example) must that a single post variable "content" which contains the HTML to tidy, and return javascript like editor.setHTML('<strong>Tidied Html</strong>') it's called through XMLHTTPRequest
//example (=default setting) editor.config.SuperClean.tidy_handler = _editor_url + 'plugins/SuperClean/tidy.php'
