diff options
Diffstat (limited to 'build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins')
10 files changed, 588 insertions, 0 deletions
diff --git a/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/embed/jquery.wymeditor.embed.js b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/embed/jquery.wymeditor.embed.js new file mode 100644 index 00000000..e553c3e5 --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif Binary files differnew file mode 100644 index 00000000..d2a8b0ab --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/fullscreen/icon_fullscreen.gif diff --git a/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js new file mode 100644 index 00000000..275c8169 --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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 = "<li class='wym_tools_fullscreen'>" + + "<a name='Fullscreen' href='#'" + + " style='background-image:" + + " url(" + wym._options.basePath +"plugins/fullscreen/icon_fullscreen.gif)'>" + + "Fullscreen" + + "</a></li>"; + + //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('<div id="wym-fullscreen-overlay"></div>') + .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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js new file mode 100644 index 00000000..2c71ba53 --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js new file mode 100644 index 00000000..1ba2d2eb --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/resizable/readme.txt b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/resizable/readme.txt new file mode 100644 index 00000000..2a0444ec --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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`_):: + + <script type="text/javascript" + src="/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js"> + </script> + +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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/README b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/README new file mode 100644 index 00000000..acc7ffd4 --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js new file mode 100644 index 00000000..bf30c4cb --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/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: "<li class='wym_tools_tidy'>" + + "<a name='CleanUp' href='#'" + + " style='background-image:" + + " url(" + wym._options.basePath + "plugins/tidy/wand.png)'>" + + "Clean up HTML" + + "</a></li>", + + 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 = "<html><body>" + wym.xhtml() + "</body></html>"; + + jQuery.post(this._options.sUrl, { html: html}, function(data) { + + if(data.length > 0 && data != '0') { + if(data.indexOf("<?php") == 0) { + wym.status("Ooops... Is PHP installed?"); + } else { + wym.html(data); + wym.status("HTML has been cleaned up."); + } + } else { + wym.status("An error occurred."); + } + }); +}; diff --git a/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/tidy.php b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/tidy.php new file mode 100644 index 00000000..23b9bec2 --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/tidy.php @@ -0,0 +1,36 @@ +<?php + +if (get_magic_quotes_gpc()) $html = stripslashes($_REQUEST['html']); +else $html = $_REQUEST['html']; + +if(strlen($html) > 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/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/wand.png b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/wand.png Binary files differnew file mode 100644 index 00000000..bb55eeab --- /dev/null +++ b/build/lib.linux-i686-2.6/gstudio/static/gstudio/js/wymeditor/plugins/tidy/wand.png |