more wym hacking

Oleg committed Jun 01, 2011
commit 5c467ce8bf385e199d6896356e5357b93bc4d08d
Showing 20 changed files with 174 additions and 863 deletions
app/assets/images/comfortable_mexican_sofa/wym_icons.png +0 -0
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/wymiframe.css +30 -85
@@ @@ -1,90 +1,35 @@
- /*
- * 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:
- * wymeditor.css
- * Main editor css file.
- * See the documentation for more info.
- *
- * File Authors:
- * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
- * Daniel Reszka (d.reszka a-t wymeditor dotorg)
- */
+ /* Reset */
+ html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
- /* VISUAL FEEDBACK */
-
- /* basic */
- body { background: #e1e8f1;}
+ body {
+ padding: 5px;
+ background: #fff;
+ font: 14px Arial, sans-serif;
+ }
- /* make HTML blocs visible */
- p,
- h1,
- h2,
- h3,
- h4,
- h5,
- h6,
- ul,
- ol,
- table,
- blockquote,
- pre { background: #FFFFFF no-repeat 2px 2px;
- padding:8px 5px 5px;
- margin:10px; }
- td { background: #F0F4F8; }
- th { background: #ffffcc; }
- ul,
- ol { border-left:20px solid #B9C4D0; padding:0px 5px; }
- caption { background: #E4E4B0; padding: 5px; font-weight: bold; }
- table { font-size: 12px; width: 500px; }
- td { width: 25%; }
- blockquote { margin-left: 30px; }
- pre { background-color:transparent; border: 1px solid white; }
+ p, h1, h2, h3, h4, h5, h6, ul, ol, table, blockquote, pre {
+ outline: 1px dotted #e1e1e1;
+ background: #fff no-repeat 2px 2px;
+ padding: 5px;
+ margin-bottom: 10px;
+ }
- /* Gecko min height fix */
- p { min-height: 1em; } /*min-height is needed under Firefox, because empty parargraphs */
- *+html p { min-height: auto; } /* but we have to remove it under IE7 because it triggers the 'haslayout' mode */
- td { height: 1.6em; }
-
- /* labels */
- p { background-image: url(lbl-p.png); }
- h1 { background-image: url(lbl-h1.png); }
- h2 { background-image: url(lbl-h2.png); }
- h3 { background-image: url(lbl-h3.png); }
- h4 { background-image: url(lbl-h4.png); }
- h5 { background-image: url(lbl-h5.png); }
- h6 { background-image: url(lbl-h6.png); }
- blockquote{ background-image: url(lbl-blockquote.png); }
- pre { background-image: url(lbl-pre.png); }
+ h1 { font: bold 24px Times, serif }
+ h2 { font: bold 20px Times, serif }
+ h3 { font: bold 16px Times, serif }
+
+ p { letter-spacing: 0.5px }
- /* specific HTML elements */
- caption { text-align: left; }
- img { margin-right: 5px;
- border-style: solid;
- border-color: gray;
- border-width: 0; }
- a img { border-width: 1px; border-color: blue; }
- acronym { border: 1px solid gray; }
- span { background-color: #eef; }
+ ul, ol { margin-left: 25px }
+ ul li { list-style: disc }
+ ol li { list-style: decimal }
- /* visual feedback for non-valid nesting of elements*/
- h1 h1, h1 h2, h1 h3, h1 h4, h1 h5, h1 h6, h1 p, h1 pre, h1 address,
- h2 h1, h2 h2, h2 h3, h2 h4, h2 h5, h2 h6, h2 p, h2 pre, h2 address,
- h3 h1, h3 h2, h3 h3, h3 h4, h3 h5, h3 h6, h3 p, h3 pre, h3 address,
- h4 h1, h4 h2, h4 h3, h4 h4, h4 h5, h4 h6, h4 p, h4 pre, h4 address,
- h5 h1, h5 h2, h5 h3, h5 h4, h5 h5, h5 h6, h5 p, h5 pre, h5 address,
- h6 h1, h6 h2, h6 h3, h6 h4, h6 h4, h6 h6, h6 p, h6 pre, h6 address,
- p h1, p h2, p h3, p h4, p h5, p h6, p pre, p address,
- pre h1, pre h2, pre h3, pre h4, pre h5, pre h6, pre p, pre pre, pre address,
- address h1, address h2, address h3, address h4, address h5, address h6,
- address p, address pre, address address
- { background-color: #ff9999 !important;
- border: 1px solid red !important;
- font-size: 12px !important;
- font-weight: normal; }
+ p { background-image: url(lbl-p.png); }
+ h1 { background-image: url(lbl-h1.png); }
+ h2 { background-image: url(lbl-h2.png); }
+ h3 { background-image: url(lbl-h3.png); }
+ h4 { background-image: url(lbl-h4.png); }
+ h5 { background-image: url(lbl-h5.png); }
+ h6 { background-image: url(lbl-h6.png); }
+ blockquote { background-image: url(lbl-blockquote.png); }
+ pre { background-image: url(lbl-pre.png); }
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js +61 -1
@@ @@ -1,7 +1,67 @@
// Options overrides
var cms_wym_options = {
+
initSkin: false,
- boxHtml: 'wymeditor goes here',
+ lang: 'en',
+
+ updateSelector: 'form',
+ updateEvent: 'submit',
+
+ containersItems: [
+ { 'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1' },
+ { 'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2' },
+ { 'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3' },
+ { 'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p' },
+ { 'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre' }
+ ],
+
+ toolsItems: [
+ { 'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong' },
+ { 'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis' },
+ { 'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list' },
+ { 'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list' },
+ { 'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table' },
+ { 'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link' },
+ { 'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink' },
+ { 'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image' },
+ { 'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste' },
+ { 'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html' }
+ ],
+
+ classesItems: [
+ { 'name': 'AlignLeft', 'title': 'Align_Left', 'css': 'align_left' },
+ { 'name': 'AlignCenter', 'title': 'Align_Center', 'css': 'align_center' },
+ { 'name': 'AlignRight', 'title': 'Align_Left', 'css': 'align_right' }
+ ],
+
+ boxHtml: '<div class="wym_box">'
+ + '<div class="wym_toolbar">'
+ + WYMeditor.CONTAINERS
+ + WYMeditor.CLASSES
+ + WYMeditor.TOOLS
+ + '</div>'
+ + '<div class="wym_area_main">'
+ + WYMeditor.HTML
+ + WYMeditor.IFRAME
+ + '</div>'
+ + '</div>',
+
+ containersHtml: '<ul class="wym_containers wym_toolbar_section">'
+ + WYMeditor.CONTAINERS_ITEMS
+ + '</ul>',
+
+ toolsHtml: '<ul class="wym_tools wym_toolbar_section">'
+ + WYMeditor.TOOLS_ITEMS
+ + '</ul>',
+
+ classesHtml: '<ul class="wym_classes wym_toolbar_section">'
+ + WYMeditor.CLASSES_ITEMS
+ + '</ul>',
+
+ htmlHtml: '<div class="wym_html">'
+ + '<textarea class="wym_html_val code"></textarea>'
+ + '</div>',
+
dialogLinkHtml: 'Link Dialog',
dialogImageHtml: 'Image Dialog',
dialogTableHtml: 'Table Dialog',
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/embed/jquery.wymeditor.embed.js +0 -52
@@ @@ -1,52 +0,0 @@
- /*
- * 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;
- }
- })();
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/fullscreen/icon_fullscreen.gif +0 -0
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js +0 -127
@@ @@ -1,127 +0,0 @@
- /*
- * 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;
- });
- };
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js +0 -57
@@ @@ -1,57 +0,0 @@
- /*
- * 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('&nbsp;');
- }
- );
-
- //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');
- }
- );
-
- };
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +0 -91
@@ @@ -1,91 +0,0 @@
- /*
- * 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.');
-
- };
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/resizable/readme.txt +0 -124
@@ @@ -1,124 +0,0 @@
-
-
- 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
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/tidy/README +0 -19
@@ @@ -1,19 +0,0 @@
- 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/
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +0 -82
@@ @@ -1,82 +0,0 @@
- /*
- * 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.");
- }
- });
- };
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/tidy/tidy.php +0 -36
@@ @@ -1,36 +0,0 @@
- <?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');
- }
- ?>
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/plugins/tidy/wand.png +0 -0
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/skins/sofa/icons.png +0 -0
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/skins/sofa/skin.css +0 -134
@@ @@ -1,134 +0,0 @@
- /*
- * 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:
- * screen.css
- * main stylesheet for the WYMeditor skin
- * See the documentation for more info.
- *
- * File Authors:
- * Daniel Reszka (d.reszka a-t wymeditor dotorg)
- * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
- */
-
- /*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/
- .wym_skin_sofa p, .wym_skin_sofa h2, .wym_skin_sofa h3,
- .wym_skin_sofa ul, .wym_skin_sofa li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; }
-
-
- /*HIDDEN BY DEFAULT*/
- .wym_skin_sofa .wym_area_left { display: none; }
- .wym_skin_sofa .wym_area_right { display: none; }
-
-
- /*TYPO*/
- .wym_skin_sofa { font-size: 10px; font-family: Verdana, Arial, sans-serif; }
- .wym_skin_sofa h2 { font-size: 110%; /* = 11px */}
- .wym_skin_sofa h3 { font-size: 100%; /* = 10px */}
- .wym_skin_sofa li { font-size: 100%; /* = 10px */}
-
-
- /*WYM_BOX*/
- .wym_skin_sofa { border: 1px solid gray; padding: 5px}
-
- /*auto-clear the wym_box*/
- .wym_skin_sofa:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
- * html .wym_skin_sofa { height: 1%;}
-
-
- /*WYM_HTML*/
- .wym_skin_sofa .wym_html { width: 98%;}
- .wym_skin_sofa .wym_html textarea { font-size: 120%; width: 100%; height: 200px; border: 1px solid gray; background: white; }
-
-
- /*WYM_IFRAME*/
- .wym_skin_sofa .wym_iframe { width: 98%;}
- .wym_skin_sofa .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white }
-
-
- /*AREAS*/
- .wym_skin_sofa .wym_area_left { width: 100px; float: left;}
- .wym_skin_sofa .wym_area_right { width: 150px; float: right;}
- .wym_skin_sofa .wym_area_bottom { height: 1%; clear: both;}
- * html .wym_skin_sofa .wym_area_main { height: 1%;}
- * html .wym_skin_sofa .wym_area_top { height: 1%;}
- *+html .wym_skin_sofa .wym_area_top { height: 1%;}
-
- /*SECTIONS SYSTEM*/
-
- /*common defaults for all sections*/
- .wym_skin_sofa .wym_section { margin-bottom: 5px; }
- .wym_skin_sofa .wym_section h2,
- .wym_skin_sofa .wym_section h3 { padding: 1px 3px; margin: 0; }
- .wym_skin_sofa .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; }
- .wym_skin_sofa .wym_section a:hover { background-color: yellow; }
- /*hide section titles by default*/
- .wym_skin_sofa .wym_section h2 { display: none; }
- /*disable any margin-collapse*/
- .wym_skin_sofa .wym_section { padding-top: 1px; padding-bottom: 1px; }
- /*auto-clear sections*/
- .wym_skin_sofa .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
- * html .wym_skin_sofa .wym_section ul { height: 1%;}
-
- /*option: add this class to a section to make it render as a panel*/
- .wym_skin_sofa .wym_panel { }
- .wym_skin_sofa .wym_panel h2 { display: block; }
-
- /*option: add this class to a section to make it render as a dropdown menu*/
- .wym_skin_sofa .wym_dropdown h2 { display: block; }
- .wym_skin_sofa .wym_dropdown ul { display: none; position: absolute; background: white; }
- .wym_skin_sofa .wym_dropdown:hover ul,
- .wym_skin_sofa .wym_dropdown.hover ul { display: block; }
-
- /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/
- .wym_skin_sofa .wym_buttons li { float:left;}
- .wym_skin_sofa .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px }
- /*image replacements*/
- .wym_skin_sofa .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_link a { background-position: 0 -96px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_image a { background-position: 0 -121px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_table a { background-position: 0 -144px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_html a { background-position: 0 -193px;}
- .wym_skin_sofa .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;}
-
- /*DECORATION*/
- .wym_skin_sofa .wym_section h2 { background: #f0f0f0; border: solid gray; border-width: 0 0 1px;}
- .wym_skin_sofa .wym_section h2 span { color: gray;}
- .wym_skin_sofa .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;}
- .wym_skin_sofa .wym_panel ul { margin: 2px 0 5px; }
- .wym_skin_sofa .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; }
- .wym_skin_sofa .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;}
-
- /*DIALOGS*/
- .wym_dialog div.row { margin-bottom: 5px;}
- .wym_dialog div.row input { margin-right: 5px;}
- .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; }
- .wym_dialog div.row-indent { padding-left: 160px; }
- /*autoclearing*/
- .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
- .wym_dialog div.row { display: inline-block; }
- /* Hides from IE-mac \*/
- * html .wym_dialog div.row { height: 1%; }
- .wym_dialog div.row { display: block; }
- /* End hide from IE-mac */
-
- /*WYMEDITOR_LINK*/
- a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; }
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/skins/sofa/skin.js +0 -35
@@ @@ -1,35 +0,0 @@
- WYMeditor.SKINS['sofa'] = {
-
- init: function(wym) {
-
- //move the containers panel to the top area
- jQuery(wym._options.containersSelector + ', '
- + wym._options.classesSelector, wym._box)
- .appendTo( jQuery("div.wym_area_top", wym._box) )
- .addClass("wym_dropdown")
- .css({"margin-right": "10px", "width": "120px", "float": "left"});
-
- //render following sections as buttons
- jQuery(wym._options.toolsSelector, wym._box)
- .addClass("wym_buttons")
- .css({"margin-right": "10px", "float": "left"});
-
- //make hover work under IE < 7
- jQuery(".wym_section", wym._box).hover(function(){
- jQuery(this).addClass("hover");
- },function(){
- jQuery(this).removeClass("hover");
- });
-
- var postInit = wym._options.postInit;
- wym._options.postInit = function(wym) {
-
- if(postInit) postInit.call(wym, wym);
- var rule = {
- name: 'body',
- css: 'background-color: #f0f0f0;'
- };
- wym.addCssRule( wym._doc.styleSheets[0], rule);
- };
- }
- };
app/assets/javascripts/comfortable_mexican_sofa/wymeditor/skins/wymeditor_icon.png +0 -0
app/assets/stylesheets/comfortable_mexican_sofa/application.css +1 -0
@@ @@ -4,4 +4,5 @@
= require comfortable_mexican_sofa/structure.css
= require comfortable_mexican_sofa/form.css
= require comfortable_mexican_sofa/content.css
+ = require comfortable_mexican_sofa/widgets.css
*/
\ No newline at end of file
app/assets/stylesheets/comfortable_mexican_sofa/content.css +0 -20
@@ @@ -178,24 +178,4 @@ ul.list li .item:hover {
}
.c_cms_admin_revisions.a_show .revisions a:last-child {
margin-bottom: 0px;
- }
- /* -- Dialog Box --------------------------------------------------------- */
- #cms_dialog {
- border: 4px solid #9f9f9f;
- border-radius: 5px;
- background-color: #d8d8d8;
- padding: 10px;
- }
- .ui-widget-overlay {
- position: absolute;
- top: 0px;
- background: rgba(0,0,0,0.4);
- }
- .ui-dialog-title {
- display: none;
- }
- a.ui-dialog-titlebar-close {
- position: absolute;
- top: 5px;
- right: 5px;
}
\ No newline at end of file
app/assets/stylesheets/comfortable_mexican_sofa/widgets.css +82 -0
@@ @@ -0,0 +1,82 @@
+ /* -- Dialog Box --------------------------------------------------------- */
+ #cms_dialog {
+ border: 4px solid #9f9f9f;
+ border-radius: 5px;
+ background-color: #d8d8d8;
+ padding: 10px;
+ }
+ .ui-widget-overlay {
+ position: absolute;
+ top: 0px;
+ background: rgba(0,0,0,0.4);
+ }
+ .ui-dialog-title {
+ display: none;
+ }
+ a.ui-dialog-titlebar-close {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+ }
+
+ /* -- WYMeditor ---------------------------------------------------------- */
+ .wym_box {
+ background: #f1f1f1;
+ border-radius: 3px;
+ padding: 3px;
+ }
+ .wym_box .wym_toolbar {
+ overflow: hidden;
+ margin-bottom: 2px;
+ }
+ .wym_box .wym_toolbar .wym_toolbar_section li:last-child a {
+ margin-right: 10px;
+ }
+ .wym_box .wym_toolbar a {
+ display: block;
+ float: left;
+ margin-right: 2px;
+ height: 20px;
+ width: 20px;
+ background: #fff url(/assets/comfortable_mexican_sofa/wym_icons.png) no-repeat;
+ border: 1px solid #fff;
+ border-radius: 3px;
+ text-indent: -9999px;
+ }
+ .wym_box .wym_toolbar a:hover {
+ border: 1px solid #d8d8d8;
+ }
+ .wym_box .wym_toolbar li.wym_containers_h2 a { background-position: -20px 0px }
+ .wym_box .wym_toolbar li.wym_containers_h3 a { background-position: -40px 0px }
+ .wym_box .wym_toolbar li.wym_containers_p a { background-position: -60px 0px }
+ .wym_box .wym_toolbar li.wym_containers_pre a { background-position: -80px 0px }
+
+ .wym_box .wym_toolbar li.wym_tools_strong a { background-position: -100px 0px }
+ .wym_box .wym_toolbar li.wym_tools_emphasis a { background-position: -120px 0px }
+ .wym_box .wym_toolbar li.wym_tools_ordered_list a { background-position: -140px 0px }
+ .wym_box .wym_toolbar li.wym_tools_unordered_list a { background-position: -160px 0px }
+ .wym_box .wym_toolbar li.wym_tools_table a { background-position: -180px 0px }
+ .wym_box .wym_toolbar li.wym_tools_link a { background-position: -200px 0px }
+ .wym_box .wym_toolbar li.wym_tools_unlink a { background-position: -220px 0px }
+ .wym_box .wym_toolbar li.wym_tools_image a { background-position: -240px 0px }
+ .wym_box .wym_toolbar li.wym_tools_paste a { background-position: -260px 0px }
+ .wym_box .wym_toolbar li.wym_tools_html a { background-position: -280px 0px }
+
+ .wym_box .wym_toolbar li.wym_classes_AlignLeft a { background-position: -300px 0px }
+ .wym_box .wym_toolbar li.wym_classes_AlignCenter a { background-position: -320px 0px }
+ .wym_box .wym_toolbar li.wym_classes_AlignRight a { background-position: -340px 0px }
+
+ .wym_box .wym_html,
+ .wym_box .wym_iframe {
+ background: #fff;
+ border: 1px solid #d8d8d8;
+ }
+ .wym_box .wym_html {
+ margin-bottom: 5px;
+ }
+ .wym_box iframe {
+ display: block;
+ height: 350px;
+ width: 100%;
+ border: 0px;
+ }
\ No newline at end of file