From 82511a6fe2d29d50c1cdca4b2abb23ff681a1943 Mon Sep 17 00:00:00 2001 From: Sebastian Silva Date: Wed, 16 Nov 2011 07:56:19 +0000 Subject: Major improvements in IDE usability. --- (limited to 'app/static/js/wymeditor/plugins/tidy/.svn/text-base') diff --git a/app/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base new file mode 100644 index 0000000..acc7ffd --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base @@ -0,0 +1,19 @@ +WYMeditor : what you see is What You Mean web-based editor +Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ +Dual licensed under the MIT (MIT-license.txt) +and GPL (GPL-license.txt) licenses. + +For further information visit: + http://www.wymeditor.org/ + +File Name: + README - HTML Tidy plugin for WYMeditor + +File Authors: + Jean-François Hovinne (jf.hovinne a-t wymeditor dotorg) + +Credits: + 'HTML Tidy' by Dave Ragget - http://tidy.sourceforge.net/ + Icon 'wand' by Mark James - http://famfamfam.com/ + +WYMeditor documentation is available online at http://www.wymeditor.org/ diff --git a/app/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base new file mode 100644 index 0000000..bf30c4c --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base @@ -0,0 +1,82 @@ +/* + * WYMeditor : what you see is What You Mean web-based editor + * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ + * 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 a-t wymeditor dotorg) + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.tidy = function(options) { + var tidy = new WymTidy(options, this); + return(tidy); +}; + +//WymTidy constructor +function WymTidy(options, wym) { + + options = jQuery.extend({ + + sUrl: wym._options.basePath + "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(" 0) { + + // Specify configuration + $config = array( + 'bare' => true, + 'clean' => true, + 'doctype' => 'strict', + 'drop-empty-paras' => true, + 'drop-font-tags' => true, + 'drop-proprietary-attributes' => true, + 'enclose-block-text' => true, + 'indent' => false, + 'join-classes' => true, + 'join-styles' => true, + 'logical-emphasis' => true, + 'output-xhtml' => true, + 'show-body-only' => true, + 'wrap' => 0); + + // Tidy + $tidy = new tidy; + $tidy->parseString($html, $config, 'utf8'); + $tidy->cleanRepair(); + + // Output + echo $tidy; +} else { + +echo ('0'); +} +?> diff --git a/app/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base new file mode 100644 index 0000000..bb55eea --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base Binary files differ -- cgit v0.9.1