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') diff --git a/app/static/js/wymeditor/plugins/.svn/entries b/app/static/js/wymeditor/plugins/.svn/entries new file mode 100644 index 0000000..e6a5e96 --- /dev/null +++ b/app/static/js/wymeditor/plugins/.svn/entries @@ -0,0 +1,43 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins +svn://svn.wymeditor.org/wymeditor + + + +2010-04-11T19:53:07.572530Z +659 +mr_lundis + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +resizable +dir + +fullscreen +dir + +hovertools +dir + +tidy +dir + +embed +dir + diff --git a/app/static/js/wymeditor/plugins/embed/.svn/entries b/app/static/js/wymeditor/plugins/embed/.svn/entries new file mode 100644 index 0000000..20f177e --- /dev/null +++ b/app/static/js/wymeditor/plugins/embed/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/embed +svn://svn.wymeditor.org/wymeditor + + + +2010-04-11T12:17:24.397707Z +655 +mr_lundis + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +jquery.wymeditor.embed.js +file + + + + +2011-07-13T16:45:39.000000Z +9a97b387093aa3d7406470f11d31a9c9 +2010-04-11T12:17:24.397707Z +655 +mr_lundis + + + + + + + + + + + + + + + + + + + + + +1517 + diff --git a/app/static/js/wymeditor/plugins/embed/.svn/text-base/jquery.wymeditor.embed.js.svn-base b/app/static/js/wymeditor/plugins/embed/.svn/text-base/jquery.wymeditor.embed.js.svn-base new file mode 100644 index 0000000..e553c3e --- /dev/null +++ b/app/static/js/wymeditor/plugins/embed/.svn/text-base/jquery.wymeditor.embed.js.svn-base @@ -0,0 +1,52 @@ +/* + * 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.embed.js + * Experimental embed plugin + * + * File Authors: + * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) + */ + +/* + * ISSUES: + * - The closing object tag seems to be stripped out... + */ +(function() { + if (WYMeditor && WYMeditor.XhtmlValidator['_tags']['param']['attributes']) { + + WYMeditor.XhtmlValidator['_tags']["embed"] = { + "attributes":[ + "allowscriptaccess", + "allowfullscreen", + "height", + "src", + "type", + "width" + ] + }; + + WYMeditor.XhtmlValidator['_tags']['param']['attributes'] = { + '0':'name', + '1':'type', + 'valuetype':/^(data|ref|object)$/, + '2':'valuetype', + '3':'value' + }; + + var XhtmlSaxListener = WYMeditor.XhtmlSaxListener; + WYMeditor.XhtmlSaxListener = function () { + var listener = XhtmlSaxListener.call(this); + listener.block_tags.push('embed'); + return listener; + }; + WYMeditor.XhtmlSaxListener.prototype = XhtmlSaxListener.prototype; + } +})(); diff --git a/app/static/js/wymeditor/plugins/embed/jquery.wymeditor.embed.js b/app/static/js/wymeditor/plugins/embed/jquery.wymeditor.embed.js new file mode 100644 index 0000000..e553c3e --- /dev/null +++ b/app/static/js/wymeditor/plugins/embed/jquery.wymeditor.embed.js @@ -0,0 +1,52 @@ +/* + * 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.embed.js + * Experimental embed plugin + * + * File Authors: + * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) + */ + +/* + * ISSUES: + * - The closing object tag seems to be stripped out... + */ +(function() { + if (WYMeditor && WYMeditor.XhtmlValidator['_tags']['param']['attributes']) { + + WYMeditor.XhtmlValidator['_tags']["embed"] = { + "attributes":[ + "allowscriptaccess", + "allowfullscreen", + "height", + "src", + "type", + "width" + ] + }; + + WYMeditor.XhtmlValidator['_tags']['param']['attributes'] = { + '0':'name', + '1':'type', + 'valuetype':/^(data|ref|object)$/, + '2':'valuetype', + '3':'value' + }; + + var XhtmlSaxListener = WYMeditor.XhtmlSaxListener; + WYMeditor.XhtmlSaxListener = function () { + var listener = XhtmlSaxListener.call(this); + listener.block_tags.push('embed'); + return listener; + }; + WYMeditor.XhtmlSaxListener.prototype = XhtmlSaxListener.prototype; + } +})(); diff --git a/app/static/js/wymeditor/plugins/fullscreen/.svn/entries b/app/static/js/wymeditor/plugins/fullscreen/.svn/entries new file mode 100644 index 0000000..c18dcf7 --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/fullscreen +svn://svn.wymeditor.org/wymeditor + + + +2010-04-11T19:53:07.572530Z +659 +mr_lundis + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +jquery.wymeditor.fullscreen.js +file + + + + +2011-07-13T16:45:39.000000Z +503112698b04abb0774b8697d6309576 +2010-04-11T19:53:07.572530Z +659 +mr_lundis + + + + + + + + + + + + + + + + + + + + + +4383 + +icon_fullscreen.gif +file + + + + +2011-07-13T16:45:39.000000Z +f443297ce16c5a70b10874e2a3e90b0a +2009-02-07T19:29:43.660231Z +576 +jf.hovinne +has-props + + + + + + + + + + + + + + + + + + + + +509 + diff --git a/app/static/js/wymeditor/plugins/fullscreen/.svn/prop-base/icon_fullscreen.gif.svn-base b/app/static/js/wymeditor/plugins/fullscreen/.svn/prop-base/icon_fullscreen.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/.svn/prop-base/icon_fullscreen.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/icon_fullscreen.gif.svn-base b/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/icon_fullscreen.gif.svn-base new file mode 100644 index 0000000..d2a8b0a --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/icon_fullscreen.gif.svn-base Binary files differ diff --git a/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/jquery.wymeditor.fullscreen.js.svn-base b/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/jquery.wymeditor.fullscreen.js.svn-base new file mode 100644 index 0000000..275c816 --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/.svn/text-base/jquery.wymeditor.fullscreen.js.svn-base @@ -0,0 +1,127 @@ +/* + * 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.fullscreen.js + * Fullscreen plugin for WYMeditor + * + * File Authors: + * Luis Santos (luis.santos a-t openquest dotpt) + * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) + * Gerd Riesselmann (gerd a-t gyro-php dot org) : Fixed issue with new skin layout + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.fullscreen = function() { + var wym = this, + $box = jQuery(this._box), + $iframe = jQuery(this._iframe), + $overlay = null, + $window = jQuery(window), + + editorMargin = 15; // Margin from window (without padding) + + + //construct the button's html + var html = "
  • " + + "" + + "Fullscreen" + + "
  • "; + + //add the button to the tools box + $box.find(wym._options.toolsSelector + wym._options.toolsListSelector) + .append(html); + + function resize () { + // Calculate margins + var uiHeight = $box.outerHeight(true) + - $iframe.outerHeight(true), + editorPadding = $box.outerWidth() - $box.width(), + + // Calculate heights + screenHeight = $window.height(), + iframeHeight = (screenHeight + - uiHeight + - (editorMargin * 2)) + 'px', + + // Calculate witdths + screenWidth = $window.width(), + boxWidth = (screenWidth + - editorPadding + - (editorMargin * 2)) + 'px'; + + $box.css('width', boxWidth); + $iframe.css('height', iframeHeight); + $overlay.css({ + 'height': screenHeight + 'px', + 'width': screenWidth + 'px' + }); + }; + + //handle click event + $box.find('li.wym_tools_fullscreen a').click(function() { + if ($box.css('position') != 'fixed') { + // Store previous inline styles + $box.data('wym-inline-css', $box.attr('style')); + $iframe.data('wym-inline-css', $iframe.attr('style')); + + // Create overlay + $overlay = jQuery('
    ') + .appendTo('body').css({ + 'position': 'fixed', + 'background-color': 'rgb(0, 0, 0)', + 'opacity': '0.75', + 'z-index': '98', + 'top': '0px', + 'left': '0px' + }); + + // Possition the editor + $box.css({ + 'position': 'fixed', + 'z-index': '99', + 'top': editorMargin + 'px', + 'left': editorMargin + 'px' + }); + + // Bind event listeners + $window.bind('resize', resize); + $box.find('li.wym_tools_html a').bind('click', resize); + + // Force resize + resize(); + } else { + // Unbind event listeners + $window.unbind('resize', resize); + $box.find('li.wym_tools_html a').unbind('click', resize); + + // Remove inline styles + $box.css({ + 'position': 'static', + 'z-index': '', + 'width': '', + 'top': '', + 'left': '' + }); + $iframe.css('height', ''); + + // Remove overlay + $overlay.remove(); + $overlay = null; + + // Retore previous inline styles + $box.attr('style', $box.data('wym-inline-css')); + $iframe.attr('style', $iframe.data('wym-inline-css')); + } + + return false; + }); +}; diff --git a/app/static/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif b/app/static/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif new file mode 100644 index 0000000..d2a8b0a --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif Binary files differ diff --git a/app/static/js/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js b/app/static/js/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js new file mode 100644 index 0000000..275c816 --- /dev/null +++ b/app/static/js/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js @@ -0,0 +1,127 @@ +/* + * 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.fullscreen.js + * Fullscreen plugin for WYMeditor + * + * File Authors: + * Luis Santos (luis.santos a-t openquest dotpt) + * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) + * Gerd Riesselmann (gerd a-t gyro-php dot org) : Fixed issue with new skin layout + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.fullscreen = function() { + var wym = this, + $box = jQuery(this._box), + $iframe = jQuery(this._iframe), + $overlay = null, + $window = jQuery(window), + + editorMargin = 15; // Margin from window (without padding) + + + //construct the button's html + var html = "
  • " + + "" + + "Fullscreen" + + "
  • "; + + //add the button to the tools box + $box.find(wym._options.toolsSelector + wym._options.toolsListSelector) + .append(html); + + function resize () { + // Calculate margins + var uiHeight = $box.outerHeight(true) + - $iframe.outerHeight(true), + editorPadding = $box.outerWidth() - $box.width(), + + // Calculate heights + screenHeight = $window.height(), + iframeHeight = (screenHeight + - uiHeight + - (editorMargin * 2)) + 'px', + + // Calculate witdths + screenWidth = $window.width(), + boxWidth = (screenWidth + - editorPadding + - (editorMargin * 2)) + 'px'; + + $box.css('width', boxWidth); + $iframe.css('height', iframeHeight); + $overlay.css({ + 'height': screenHeight + 'px', + 'width': screenWidth + 'px' + }); + }; + + //handle click event + $box.find('li.wym_tools_fullscreen a').click(function() { + if ($box.css('position') != 'fixed') { + // Store previous inline styles + $box.data('wym-inline-css', $box.attr('style')); + $iframe.data('wym-inline-css', $iframe.attr('style')); + + // Create overlay + $overlay = jQuery('
    ') + .appendTo('body').css({ + 'position': 'fixed', + 'background-color': 'rgb(0, 0, 0)', + 'opacity': '0.75', + 'z-index': '98', + 'top': '0px', + 'left': '0px' + }); + + // Possition the editor + $box.css({ + 'position': 'fixed', + 'z-index': '99', + 'top': editorMargin + 'px', + 'left': editorMargin + 'px' + }); + + // Bind event listeners + $window.bind('resize', resize); + $box.find('li.wym_tools_html a').bind('click', resize); + + // Force resize + resize(); + } else { + // Unbind event listeners + $window.unbind('resize', resize); + $box.find('li.wym_tools_html a').unbind('click', resize); + + // Remove inline styles + $box.css({ + 'position': 'static', + 'z-index': '', + 'width': '', + 'top': '', + 'left': '' + }); + $iframe.css('height', ''); + + // Remove overlay + $overlay.remove(); + $overlay = null; + + // Retore previous inline styles + $box.attr('style', $box.data('wym-inline-css')); + $iframe.attr('style', $iframe.data('wym-inline-css')); + } + + return false; + }); +}; diff --git a/app/static/js/wymeditor/plugins/hovertools/.svn/entries b/app/static/js/wymeditor/plugins/hovertools/.svn/entries new file mode 100644 index 0000000..dcb85a5 --- /dev/null +++ b/app/static/js/wymeditor/plugins/hovertools/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/hovertools +svn://svn.wymeditor.org/wymeditor + + + +2009-05-27T19:20:55.910061Z +632 +jf.hovinne + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +jquery.wymeditor.hovertools.js +file + + + + +2011-07-13T16:45:39.000000Z +9128791ae94a2438f6f6f751204e9827 +2009-05-27T19:20:55.910061Z +632 +jf.hovinne + + + + + + + + + + + + + + + + + + + + + +1644 + diff --git a/app/static/js/wymeditor/plugins/hovertools/.svn/text-base/jquery.wymeditor.hovertools.js.svn-base b/app/static/js/wymeditor/plugins/hovertools/.svn/text-base/jquery.wymeditor.hovertools.js.svn-base new file mode 100644 index 0000000..2c71ba5 --- /dev/null +++ b/app/static/js/wymeditor/plugins/hovertools/.svn/text-base/jquery.wymeditor.hovertools.js.svn-base @@ -0,0 +1,57 @@ +/* + * 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.hovertools.js + * hovertools plugin for WYMeditor + * + * File Authors: + * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.hovertools = function() { + + var wym = this; + + //bind events on buttons + jQuery(this._box).find(this._options.toolSelector).hover( + function() { + wym.status(jQuery(this).html()); + }, + function() { + wym.status(' '); + } + ); + + //classes: add/remove a style attr to matching elems + //while mouseover/mouseout + jQuery(this._box).find(this._options.classSelector).hover( + function() { + var aClasses = eval(wym._options.classesItems); + var sName = jQuery(this).attr(WYMeditor.NAME); + var oClass = WYMeditor.Helper.findByName(aClasses, sName); + + if(oClass){ + jqexpr = oClass.expr; + //don't use jQuery.find() on the iframe body + //because of MSIE + jQuery + expando issue (#JQ1143) + if(!jQuery.browser.msie) + jQuery(wym._doc).find(jqexpr).css('background-color','#cfc'); + } + }, + function() { + //don't use jQuery.find() on the iframe body + //because of MSIE + jQuery + expando issue (#JQ1143) + if(!jQuery.browser.msie) + jQuery(wym._doc).find('*').removeAttr('style'); + } + ); + +}; diff --git a/app/static/js/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js b/app/static/js/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js new file mode 100644 index 0000000..2c71ba5 --- /dev/null +++ b/app/static/js/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js @@ -0,0 +1,57 @@ +/* + * 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.hovertools.js + * hovertools plugin for WYMeditor + * + * File Authors: + * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) + */ + +//Extend WYMeditor +WYMeditor.editor.prototype.hovertools = function() { + + var wym = this; + + //bind events on buttons + jQuery(this._box).find(this._options.toolSelector).hover( + function() { + wym.status(jQuery(this).html()); + }, + function() { + wym.status(' '); + } + ); + + //classes: add/remove a style attr to matching elems + //while mouseover/mouseout + jQuery(this._box).find(this._options.classSelector).hover( + function() { + var aClasses = eval(wym._options.classesItems); + var sName = jQuery(this).attr(WYMeditor.NAME); + var oClass = WYMeditor.Helper.findByName(aClasses, sName); + + if(oClass){ + jqexpr = oClass.expr; + //don't use jQuery.find() on the iframe body + //because of MSIE + jQuery + expando issue (#JQ1143) + if(!jQuery.browser.msie) + jQuery(wym._doc).find(jqexpr).css('background-color','#cfc'); + } + }, + function() { + //don't use jQuery.find() on the iframe body + //because of MSIE + jQuery + expando issue (#JQ1143) + if(!jQuery.browser.msie) + jQuery(wym._doc).find('*').removeAttr('style'); + } + ); + +}; diff --git a/app/static/js/wymeditor/plugins/resizable/.svn/entries b/app/static/js/wymeditor/plugins/resizable/.svn/entries new file mode 100644 index 0000000..8afaf68 --- /dev/null +++ b/app/static/js/wymeditor/plugins/resizable/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/resizable +svn://svn.wymeditor.org/wymeditor + + + +2009-04-28T19:42:37.044706Z +614 +jf.hovinne + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +jquery.wymeditor.resizable.js +file + + + + +2011-07-13T16:45:39.000000Z +dfe19ff3f55ea32c465ecd64c8b4b8bc +2009-04-28T19:42:37.044706Z +614 +jf.hovinne + + + + + + + + + + + + + + + + + + + + + +2913 + +readme.txt +file + + + + +2011-07-13T16:45:39.000000Z +779875a11fe8526a6d246829afda4f1c +2008-07-05T12:52:55.176122Z +510 +jf.hovinne + + + + + + + + + + + + + + + + + + + + + +4273 + diff --git a/app/static/js/wymeditor/plugins/resizable/.svn/text-base/jquery.wymeditor.resizable.js.svn-base b/app/static/js/wymeditor/plugins/resizable/.svn/text-base/jquery.wymeditor.resizable.js.svn-base new file mode 100644 index 0000000..1ba2d2e --- /dev/null +++ b/app/static/js/wymeditor/plugins/resizable/.svn/text-base/jquery.wymeditor.resizable.js.svn-base @@ -0,0 +1,91 @@ +/* + * 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.resizable.js + * resize plugin for WYMeditor + * + * File Authors: + * Peter Eschler (peschler _at_ gmail.com) + * Jean-Francois Hovinne - http://www.hovinne.com/ + * + * Version: + * 0.4 + * + * Changelog: + * + * 0.4 + * - Removed UI and UI.resizable scripts loading - see #167 (jfh). + * + * 0.3 + * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh). + * + * 0.2 + * - Added full support for all jQueryUI resizable plugin options. + * - Refactored and documented code. + * 0.1 + * - Initial release. + */ + +/** + * The resizable plugin makes the wymeditor box vertically resizable. + * It it based on the ui.resizable.js plugin of the jQuery UI library. + * + * The WYMeditor resizable plugin supports all parameters of the jQueryUI + * resizable plugin. The parameters are passed like this: + * + * wym.resizable({ handles: "s,e", + * maxHeight: 600 }); + * + * DEPENDENCIES: jQuery UI, jQuery UI resizable + * + * @param options options for the plugin + */ +WYMeditor.editor.prototype.resizable = function(options) { + + var wym = this; + var iframe = jQuery(wym._box).find('iframe'); + var iframeOriginalSize = {}; + + // Define some default options + var default_options = { + start: function(e, ui) { + iframeOriginalSize = { + width: jQuery(iframe).width(), + height: jQuery(iframe).height() + } + }, + + // resize is called by the jQuery resizable plugin whenever the + // client area was resized. + resize: function(e, ui) { + var diff = ui.size.height - ui.originalSize.height; + jQuery(iframe).height( iframeOriginalSize.height + diff ); + + // If the plugin has horizontal resizing disabled we need to + // adjust the "width" attribute of the area css, because the + // resizing will set a fixed width (which breaks liquid layout + // of the wymeditor area). + if( !ui.options.handles['w'] && !ui.options.handles['e'] ) { + ui.size.width = "inherit"; + } + }, + handles: "s,e,se", + minHeight: 250, + maxHeight: 600 + }; + + // Merge given options with default options. Given options override + // default ones. + var final_options = jQuery.extend(default_options, options); + + if(jQuery.isFunction( jQuery.fn.resizable )) jQuery(wym._box).resizable(final_options); + else WYMeditor.console.error('Oops, jQuery UI.resizable unavailable.'); + +}; diff --git a/app/static/js/wymeditor/plugins/resizable/.svn/text-base/readme.txt.svn-base b/app/static/js/wymeditor/plugins/resizable/.svn/text-base/readme.txt.svn-base new file mode 100644 index 0000000..2a0444e --- /dev/null +++ b/app/static/js/wymeditor/plugins/resizable/.svn/text-base/readme.txt.svn-base @@ -0,0 +1,124 @@ + + +resizable plugin for WYMeditor +############################## + +The ``resizable`` plugin for WYMeditor_ enables vertical resizing of the +editor area. The plugin is based on the jQuery UI library. + +Requirements +============ +The following packages are required for using the WYMeditor ``resizable`` +plugin: + +* jQuery (tested with jQuery ``jquery-1.2.4a.js`` from ``jquery.ui`` package) +* WYMeditor SVN trunk (Revision: 482) +* jQuery-UI (tested with ``jquery.ui-1.5b2``) + +It should be possible to use this plugin with ``WYMeditor-0.4`` but I have not +tried. + +Download +======== +You can download the WYMeditor ``resizable`` plugin here: + +* wymeditor-resizable-plugin-0.2.tgz_ +* wymeditor-resizable-plugin-0.1.tgz_ + +See the Changelog_ for more infos about the releases. + +.. _wymeditor-resizable-plugin-0.2.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.2.tgz +.. _wymeditor-resizable-plugin-0.1.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.1.tgz + +Installation +============ +Just extract the downloaded archive into your WYMeditor's ``plugin`` +directory. + +Usage +===== +For general instructions on WYMeditor plugins please refer to the `WYMeditor +plugin page`_. + +To use the ``resizable`` plugin simply include the plugin's JavaScript file in +your code. You **do not** need to include the jQuery UI files - this is done +automatically by the plugin (see `Internals`_):: + + + +Make sure to adjust the ``src`` attribute to your needs, then initialize the +plugin in WYMeditor's ``postInit`` function:: + + wymeditor({postInit: function(wym) { + wym.hovertools(); // other plugins... + wym.resizable({handles: "s,e", + maxHeight: 600}); + } + }) + +The ``resizable`` plugin takes exactly one parameter, which is an object literal +containing the options of the plugin. The WYMeditor ``resizable`` plugin +supports all options of the jQuery UI ``resizable`` plugin. These are the +default values used by the plugin:: + + handles: "s,e,se", + minHeight: 250, + maxHeight: 600 + +See the `jQuery UI resizable plugin docs`_ for a list of all options. + +That's it! You are now able to resize the WYMeditor vertically, horizontally or +both, depending on your options. + +.. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables + +Internals +========= +The plugin takes care of loading the necessary jQuery UI files (``base`` and +``resizable``) from the same path the jQuery library was loaded. Here's how +it's done:: + + // Get the jQuery path from the editor, stripping away the jQuery file. + // see http://www.oreilly.com/catalog/regex/chapter/ch04.html + // The match result array contains the path and the filename. + var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; + + // Make an array of the external JavaScript files required by the plugin. + var jQueryPlugins = [jQueryPath + '/ui.base.js', + jQueryPath + '/ui.resizable.js']; + + // First get the jQuery UI base file + $.getScript(jQueryPlugins[0]); + + // Get the jQuery UI resizeable plugin and then init the wymeditor resizable + // plugin. It is import to do the initialisation after loading the + // necessary jQuery UI files has finished, otherwise the "resizable" method + // would not be available. + $.getScript(jQueryPlugins[1], function() { + jQuery(wym._box).resizable(final_options); + }); + +An alternative approach would be to use an AJAX queue when getting the script +files to ensure that all jQuery files are loaded before the initialisation code +of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does +that. + +.. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue + +Changelog +========= + +0.2 +--- +- Added full support for all jQuery UI resizable plugin options. +- Refactored and documented code. +- Now contains a packed version (775 bytes). + +0.1 +--- +- Initial release. + +.. _WYMeditor: http://www.wymeditor.org/ +.. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins diff --git a/app/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js b/app/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js new file mode 100644 index 0000000..1ba2d2e --- /dev/null +++ b/app/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js @@ -0,0 +1,91 @@ +/* + * 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.resizable.js + * resize plugin for WYMeditor + * + * File Authors: + * Peter Eschler (peschler _at_ gmail.com) + * Jean-Francois Hovinne - http://www.hovinne.com/ + * + * Version: + * 0.4 + * + * Changelog: + * + * 0.4 + * - Removed UI and UI.resizable scripts loading - see #167 (jfh). + * + * 0.3 + * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh). + * + * 0.2 + * - Added full support for all jQueryUI resizable plugin options. + * - Refactored and documented code. + * 0.1 + * - Initial release. + */ + +/** + * The resizable plugin makes the wymeditor box vertically resizable. + * It it based on the ui.resizable.js plugin of the jQuery UI library. + * + * The WYMeditor resizable plugin supports all parameters of the jQueryUI + * resizable plugin. The parameters are passed like this: + * + * wym.resizable({ handles: "s,e", + * maxHeight: 600 }); + * + * DEPENDENCIES: jQuery UI, jQuery UI resizable + * + * @param options options for the plugin + */ +WYMeditor.editor.prototype.resizable = function(options) { + + var wym = this; + var iframe = jQuery(wym._box).find('iframe'); + var iframeOriginalSize = {}; + + // Define some default options + var default_options = { + start: function(e, ui) { + iframeOriginalSize = { + width: jQuery(iframe).width(), + height: jQuery(iframe).height() + } + }, + + // resize is called by the jQuery resizable plugin whenever the + // client area was resized. + resize: function(e, ui) { + var diff = ui.size.height - ui.originalSize.height; + jQuery(iframe).height( iframeOriginalSize.height + diff ); + + // If the plugin has horizontal resizing disabled we need to + // adjust the "width" attribute of the area css, because the + // resizing will set a fixed width (which breaks liquid layout + // of the wymeditor area). + if( !ui.options.handles['w'] && !ui.options.handles['e'] ) { + ui.size.width = "inherit"; + } + }, + handles: "s,e,se", + minHeight: 250, + maxHeight: 600 + }; + + // Merge given options with default options. Given options override + // default ones. + var final_options = jQuery.extend(default_options, options); + + if(jQuery.isFunction( jQuery.fn.resizable )) jQuery(wym._box).resizable(final_options); + else WYMeditor.console.error('Oops, jQuery UI.resizable unavailable.'); + +}; diff --git a/app/static/js/wymeditor/plugins/resizable/readme.txt b/app/static/js/wymeditor/plugins/resizable/readme.txt new file mode 100644 index 0000000..2a0444e --- /dev/null +++ b/app/static/js/wymeditor/plugins/resizable/readme.txt @@ -0,0 +1,124 @@ + + +resizable plugin for WYMeditor +############################## + +The ``resizable`` plugin for WYMeditor_ enables vertical resizing of the +editor area. The plugin is based on the jQuery UI library. + +Requirements +============ +The following packages are required for using the WYMeditor ``resizable`` +plugin: + +* jQuery (tested with jQuery ``jquery-1.2.4a.js`` from ``jquery.ui`` package) +* WYMeditor SVN trunk (Revision: 482) +* jQuery-UI (tested with ``jquery.ui-1.5b2``) + +It should be possible to use this plugin with ``WYMeditor-0.4`` but I have not +tried. + +Download +======== +You can download the WYMeditor ``resizable`` plugin here: + +* wymeditor-resizable-plugin-0.2.tgz_ +* wymeditor-resizable-plugin-0.1.tgz_ + +See the Changelog_ for more infos about the releases. + +.. _wymeditor-resizable-plugin-0.2.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.2.tgz +.. _wymeditor-resizable-plugin-0.1.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.1.tgz + +Installation +============ +Just extract the downloaded archive into your WYMeditor's ``plugin`` +directory. + +Usage +===== +For general instructions on WYMeditor plugins please refer to the `WYMeditor +plugin page`_. + +To use the ``resizable`` plugin simply include the plugin's JavaScript file in +your code. You **do not** need to include the jQuery UI files - this is done +automatically by the plugin (see `Internals`_):: + + + +Make sure to adjust the ``src`` attribute to your needs, then initialize the +plugin in WYMeditor's ``postInit`` function:: + + wymeditor({postInit: function(wym) { + wym.hovertools(); // other plugins... + wym.resizable({handles: "s,e", + maxHeight: 600}); + } + }) + +The ``resizable`` plugin takes exactly one parameter, which is an object literal +containing the options of the plugin. The WYMeditor ``resizable`` plugin +supports all options of the jQuery UI ``resizable`` plugin. These are the +default values used by the plugin:: + + handles: "s,e,se", + minHeight: 250, + maxHeight: 600 + +See the `jQuery UI resizable plugin docs`_ for a list of all options. + +That's it! You are now able to resize the WYMeditor vertically, horizontally or +both, depending on your options. + +.. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables + +Internals +========= +The plugin takes care of loading the necessary jQuery UI files (``base`` and +``resizable``) from the same path the jQuery library was loaded. Here's how +it's done:: + + // Get the jQuery path from the editor, stripping away the jQuery file. + // see http://www.oreilly.com/catalog/regex/chapter/ch04.html + // The match result array contains the path and the filename. + var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; + + // Make an array of the external JavaScript files required by the plugin. + var jQueryPlugins = [jQueryPath + '/ui.base.js', + jQueryPath + '/ui.resizable.js']; + + // First get the jQuery UI base file + $.getScript(jQueryPlugins[0]); + + // Get the jQuery UI resizeable plugin and then init the wymeditor resizable + // plugin. It is import to do the initialisation after loading the + // necessary jQuery UI files has finished, otherwise the "resizable" method + // would not be available. + $.getScript(jQueryPlugins[1], function() { + jQuery(wym._box).resizable(final_options); + }); + +An alternative approach would be to use an AJAX queue when getting the script +files to ensure that all jQuery files are loaded before the initialisation code +of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does +that. + +.. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue + +Changelog +========= + +0.2 +--- +- Added full support for all jQuery UI resizable plugin options. +- Refactored and documented code. +- Now contains a packed version (775 bytes). + +0.1 +--- +- Initial release. + +.. _WYMeditor: http://www.wymeditor.org/ +.. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins diff --git a/app/static/js/wymeditor/plugins/tidy/.svn/entries b/app/static/js/wymeditor/plugins/tidy/.svn/entries new file mode 100644 index 0000000..3acea50 --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +677 +svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/tidy +svn://svn.wymeditor.org/wymeditor + + + +2010-04-11T19:34:57.530630Z +658 +mr_lundis + + + + + + + + + + + + + + +89e89e35-0a13-0410-8f61-920bba073fa9 + +tidy.php +file + + + + +2011-07-13T16:45:39.000000Z +3355fbc23378052db8213dbdcd4fe31f +2007-04-26T12:45:23.848206Z +245 +jf.hovinne + + + + + + + + + + + + + + + + + + + + + +1052 + +jquery.wymeditor.tidy.js +file + + + + +2011-07-13T16:45:39.000000Z +3a2dee9a16df26d6d1b36886f77880c8 +2010-04-11T19:34:57.530630Z +658 +mr_lundis + + + + + + + + + + + + + + + + + + + + + +2157 + +wand.png +file + + + + +2011-07-13T16:45:39.000000Z +22d8038ebf5ac63b0062ebf361e8261c +2007-04-23T11:42:06.279227Z +233 +d.reszka +has-props + + + + + + + + + + + + + + + + + + + + +715 + +README +file + + + + +2011-07-13T16:45:39.000000Z +b31aaf6b3928608a98b2028c2d9f523e +2009-05-27T19:20:55.910061Z +632 +jf.hovinne + + + + + + + + + + + + + + + + + + + + + +607 + diff --git a/app/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base b/app/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END 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 diff --git a/app/static/js/wymeditor/plugins/tidy/README b/app/static/js/wymeditor/plugins/tidy/README new file mode 100644 index 0000000..acc7ffd --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/README @@ -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/jquery.wymeditor.tidy.js b/app/static/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js new file mode 100644 index 0000000..bf30c4c --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js @@ -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/wand.png b/app/static/js/wymeditor/plugins/tidy/wand.png new file mode 100644 index 0000000..bb55eea --- /dev/null +++ b/app/static/js/wymeditor/plugins/tidy/wand.png Binary files differ -- cgit v0.9.1