diff --git a/lib/wysihtml5x/rails/version.rb b/lib/wysihtml5x/rails/version.rb index 1c02fdf..739e8bb 100644 --- a/lib/wysihtml5x/rails/version.rb +++ b/lib/wysihtml5x/rails/version.rb @@ -1,5 +1,5 @@ module Wysihtml5x module Rails - VERSION = "0.4.0" + VERSION = "0.4.1" end end diff --git a/vendor/assets/javascripts/parser_rules/advanced_unwrap.js b/vendor/assets/javascripts/parser_rules/advanced_unwrap.js index 69e523e..2f5e13d 100644 --- a/vendor/assets/javascripts/parser_rules/advanced_unwrap.js +++ b/vendor/assets/javascripts/parser_rules/advanced_unwrap.js @@ -171,6 +171,7 @@ var wysihtml5ParserRules = { * - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg" * - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML) * - numbers: ensures that the attribute only contains numeric characters + * - any: allows anything to pass */ "tags": { "tr": { @@ -323,7 +324,9 @@ var wysihtml5ParserRules = { "td": { "check_attributes": { "rowspan": "numbers", - "colspan": "numbers" + "colspan": "numbers", + "valign": "any", + "align": "any" }, "add_class": { "align": "align_text" @@ -646,4 +649,4 @@ var wysihtml5ParserRules = { "rename_tag": "div" } } -}; \ No newline at end of file +}; diff --git a/vendor/assets/javascripts/wysihtml5x-toolbar.js b/vendor/assets/javascripts/wysihtml5x-toolbar.js index 0f418d0..48470d6 100644 --- a/vendor/assets/javascripts/wysihtml5x-toolbar.js +++ b/vendor/assets/javascripts/wysihtml5x-toolbar.js @@ -1,5 +1,5 @@ /** - * @license wysihtml5x v0.4.0 + * @license wysihtml5x v0.4.1 * https://github.com/Edicy/wysihtml5 * * Author: Christopher Blum (https://github.com/tiff) @@ -10,8 +10,8 @@ * */ var wysihtml5 = { - version: "0.4.0", - + version: "0.4.1", + // namespaces commands: {}, dom: {}, @@ -20,20 +20,21 @@ var wysihtml5 = { lang: {}, selection: {}, views: {}, - + INVISIBLE_SPACE: "\uFEFF", - + EMPTY_FUNCTION: function() {}, - + ELEMENT_NODE: 1, TEXT_NODE: 3, - + BACKSPACE_KEY: 8, ENTER_KEY: 13, ESCAPE_KEY: 27, SPACE_KEY: 32, DELETE_KEY: 46 -};/* +}; +/* Rangy, a cross-browser JavaScript range and selection library http://code.google.com/p/rangy/ @@ -127,143 +128,143 @@ h;++d)b[d]=""+this._ranges[d];return b.join("")};g.collapse=function(b,d){q(this };g.selectAllChildren=function(b){q(this,b);var d=l.createRange(c.getDocument(b));d.selectNodeContents(b);this.removeAllRanges();this.addRange(d)};g.deleteFromDocument=function(){if(M&&V&&this.docSelection.type=="Control"){for(var b=this.docSelection.createRange(),d;b.length;){d=b.item(0);b.remove(d);d.parentNode.removeChild(d)}this.refresh()}else if(this.rangeCount){b=this.getAllRanges();this.removeAllRanges();d=0;for(var h=b.length;d 1) { // extending with a name/value pair - var ancestor = this[source]; - if (ancestor && (typeof value == "function") && // overriding a method? - // the valueOf() comparison is to avoid circular references - (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && - /\bbase\b/.test(value)) { - // get the underlying method - var method = value.valueOf(); - // override - value = function() { - var previous = this.base || Base.prototype.base; - this.base = ancestor; - var returnValue = method.apply(this, arguments); - this.base = previous; - return returnValue; - }; - // point to the underlying method - value.valueOf = function(type) { - return (type == "object") ? value : method; - }; - value.toString = Base.toString; - } - this[source] = value; - } else if (source) { // extending with an object literal - var extend = Base.prototype.extend; - // if this object has a customised extend method then use it - if (!Base._prototyping && typeof this != "function") { - extend = this.extend || extend; - } - var proto = {toSource: null}; - // do the "toString" and other methods manually - var hidden = ["constructor", "toString", "valueOf"]; - // if we are prototyping then include the constructor - var i = Base._prototyping ? 0 : 1; - while (key = hidden[i++]) { - if (source[key] != proto[key]) { - extend.call(this, key, source[key]); - - } - } - // copy each of the source object's properties to this object - for (var key in source) { - if (!proto[key]) extend.call(this, key, source[key]); - } - } - return this; - } +Base.prototype = { + extend: function(source, value) { + if (arguments.length > 1) { // extending with a name/value pair + var ancestor = this[source]; + if (ancestor && (typeof value == "function") && // overriding a method? + // the valueOf() comparison is to avoid circular references + (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && + /\bbase\b/.test(value)) { + // get the underlying method + var method = value.valueOf(); + // override + value = function() { + var previous = this.base || Base.prototype.base; + this.base = ancestor; + var returnValue = method.apply(this, arguments); + this.base = previous; + return returnValue; + }; + // point to the underlying method + value.valueOf = function(type) { + return (type == "object") ? value : method; + }; + value.toString = Base.toString; + } + this[source] = value; + } else if (source) { // extending with an object literal + var extend = Base.prototype.extend; + // if this object has a customised extend method then use it + if (!Base._prototyping && typeof this != "function") { + extend = this.extend || extend; + } + var proto = {toSource: null}; + // do the "toString" and other methods manually + var hidden = ["constructor", "toString", "valueOf"]; + // if we are prototyping then include the constructor + var i = Base._prototyping ? 0 : 1; + while (key = hidden[i++]) { + if (source[key] != proto[key]) { + extend.call(this, key, source[key]); + + } + } + // copy each of the source object's properties to this object + for (var key in source) { + if (!proto[key]) extend.call(this, key, source[key]); + } + } + return this; + } }; // initialise Base = Base.extend({ - constructor: function() { - this.extend(arguments[0]); - } + constructor: function() { + this.extend(arguments[0]); + } }, { - ancestor: Object, - version: "1.1", - - forEach: function(object, block, context) { - for (var key in object) { - if (this.prototype[key] === undefined) { - block.call(context, object[key], key, object); - } - } - }, - - implement: function() { - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] == "function") { - // if it's a function, call it - arguments[i](this.prototype); - } else { - // add the interface using the extend method - this.prototype.extend(arguments[i]); - } - } - return this; - }, - - toString: function() { - return String(this.valueOf()); - } + ancestor: Object, + version: "1.1", + + forEach: function(object, block, context) { + for (var key in object) { + if (this.prototype[key] === undefined) { + block.call(context, object[key], key, object); + } + } + }, + + implement: function() { + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] == "function") { + // if it's a function, call it + arguments[i](this.prototype); + } else { + // add the interface using the extend method + this.prototype.extend(arguments[i]); + } + } + return this; + }, + + toString: function() { + return String(this.valueOf()); + } });/** * Detect browser support for specific features */ @@ -276,19 +277,19 @@ wysihtml5.browser = (function() { isWebKit = userAgent.indexOf("AppleWebKit/") !== -1, isChrome = userAgent.indexOf("Chrome/") !== -1, isOpera = userAgent.indexOf("Opera/") !== -1; - + function iosVersion(userAgent) { return +((/ipad|iphone|ipod/.test(userAgent) && userAgent.match(/ os (\d+).+? like mac os x/)) || [undefined, 0])[1]; } - + function androidVersion(userAgent) { return +(userAgent.match(/android (\d+)/) || [undefined, 0])[1]; } - + return { // Static variable needed, publicly accessible, to be able override it in unit tests USER_AGENT: userAgent, - + /** * Exclude browsers that are not capable of displaying and handling * contentEditable as desired: @@ -312,19 +313,19 @@ wysihtml5.browser = (function() { && hasQuerySelectorSupport && !isIncompatibleMobileBrowser; }, - + isTouchDevice: function() { return this.supportsEvent("touchmove"); }, - + isIos: function() { return (/ipad|iphone|ipod/i).test(this.USER_AGENT); }, - + isAndroid: function() { return this.USER_AGENT.indexOf("Android") !== -1; }, - + /** * Whether the browser supports sandboxed iframes * Currently only IE 6+ offers such feature