Index: openacs-4/packages/xowiki/www/resources/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js,v diff -u -N --- openacs-4/packages/xowiki/www/resources/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js 27 Jul 2007 01:15:21 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,82 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (C) 2007 H.O.net - http://www.honet.be/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.tidy.js - * HTML Tidy plugin for WYMeditor - * - * File Authors: - * Jean-Francois Hovinne (jf.hovinne@wymeditor.org) - */ - -//Extend WYMeditor -Wymeditor.prototype.tidy = function(options) { - var tidy = new WymTidy(options, this); - return(tidy); -}; - -//WymTidy constructor -function WymTidy(options, wym) { - - options = jQuery.extend({ - - sUrl: "wymeditor/plugins/tidy/tidy.php", - sButtonHtml: "
  • " - + "" - + "Clean up HTML" - + "
  • ", - - sButtonSelector: "li.wym_tools_tidy a" - - }, options); - - this._options = options; - this._wym = wym; - -}; - -//WymTidy initialization -WymTidy.prototype.init = function() { - - var tidy = this; - - jQuery(this._wym._box).find( - this._wym._options.toolsSelector + this._wym._options.toolsListSelector) - .append(this._options.sButtonHtml); - - //handle click event - jQuery(this._wym._box).find(this._options.sButtonSelector).click(function() { - tidy.cleanup(); - return(false); - }); - -}; - -//WymTidy cleanup -WymTidy.prototype.cleanup = function() { - - var wym = this._wym; - var html = "" + wym.xhtml() + ""; - - jQuery.post(this._options.sUrl, { html: html}, function(data) { - - if(data.length > 0 && data != '0') { - if(data.indexOf("