app/assets/javascripts/plugins/fonts/fonts.min.js in wysiwyg-rails-1.1.6 vs app/assets/javascripts/plugins/fonts/fonts.min.js in wysiwyg-rails-1.1.7

- old
+ new

@@ -1,5 +1,5 @@ /*! - * froala_editor v1.1.6 (http://editor.froala.com) + * froala_editor v1.1.7 (http://editor.froala.com) * Copyright 2014-2014 Froala */ -$.Editable.prototype.fontExec=function(a,b,c){document.execCommand("fontSize",!1,1),this.saveSelectionByMarkers();var d=[];this.$element.find("font").each(function(b,e){var f=$("<span>").attr("data-font",a).css(a,c).html($(e).html());0===$(e).parents("font").length&&d.push(f),$(e).replaceWith(f)});for(var e=function(b,c){$(c).css(a,"")},f=0;f<d.length;f++){var g=d[f];$(g).find("*").each(e)}this.$element.find('span[data-font="'+a+'"] > span[data-font="'+a+'"]').each(function(b,c){$(c).attr("style")&&($(c).before('<span class="close-span"></span>'),$(c).after('<span data-font="'+a+'" style="'+a+": "+$(c).parent().css(a)+';" data-open="true"></span>'))});var h=this.$element.html();h=h.replace(new RegExp('<span class="close-span"></span>',"g"),"</span>"),h=h.replace(new RegExp('data-open="true"></span>',"g"),">"),this.$element.html(h),this.beautifyFont(a),this.$element.find('span[style=""]').each(function(a,b){$(b).replaceWith($(b).html())}),this.$element.find('span[data-font="'+a+'"]').each(function(b,c){$(c).css(a)==$(c).parent().css(a)&&$(c).replaceWith($(c).html())}),this.$element.find('span[data-font="'+a+'"]').each(function(a,b){""===$(b).text()&&$(b).replaceWith($(b).html())}),this.beautifyFont(a),this.restoreSelectionByMarkers(),this.repositionEditor(),this.callback(b,[c])},$.Editable.prototype.beautifyFont=function(a){for(var b=!0,c=$.proxy(function(){this.$element.find('span[data-font="'+a+'"] + span[data-font="'+a+'"]').each(function(c,d){$(d).css(a)==$(d).prev().css(a)&&d.previousSibling&&"SPAN"==d.previousSibling.tagName&&($(d).prepend($(d).prev().html()),$(d).prev().remove(),b=!0)}),this.$element.find('span[data-font="'+a+'"] + span#marker-true + span[data-font="'+a+'"], span[data-font="'+a+'"] + span#marker-false + span[data-font="'+a+'"]').each(function(c,d){$(d).css(a)==$(d).prev().prev().css(a)&&d.previousSibling&&"SPAN"==d.previousSibling.tagName&&d.previousSibling.previousSibling&&"SPAN"==d.previousSibling.previousSibling.tagName&&($(d).prepend($(d).prev().clone()),$(d).prepend($(d).prev().prev().html()),$(d).prev().prev().remove(),$(d).prev().remove(),b=!0)})},this);b;)b=!1,c()}; +$.Editable.prototype.fontExec=function(a,b,c){document.execCommand("fontSize",!1,1),this.saveSelectionByMarkers();var d=[];this.$element.find("font").each(function(b,e){var f=$("<span>").attr("data-font",a).css(a,c).html($(e).html());0===$(e).parents("font").length&&d.push(f),$(e).replaceWith(f)});for(var e=function(b,c){$(c).css(a,"")},f=0;f<d.length;f++){var g=d[f];$(g).find("*").each(e)}this.$element.find('span[data-font="'+a+'"] > span[data-font="'+a+'"]').each(function(b,c){$(c).attr("style")&&($(c).before('<span class="close-span"></span>'),$(c).after('<span data-font="'+a+'" style="'+a+": "+$(c).parent().css(a)+';" data-open="true"></span>'))});var h=this.$element.html();h=h.replace(new RegExp('<span class="close-span"></span>',"g"),"</span>"),h=h.replace(new RegExp('data-open="true"></span>',"g"),">"),this.$element.html(h),this.beautifyFont(a),this.$element.find('span[style=""]').each(function(a,b){$(b).replaceWith($(b).html())}),this.$element.find('span[data-font="'+a+'"]').each(function(b,c){$(c).css(a)==$(c).parent().css(a)&&$(c).replaceWith($(c).html())}),this.$element.find('span[data-font="'+a+'"]').each(function(a,b){""===$(b).text()&&$(b).replaceWith($(b).html())}),this.beautifyFont(a),this.restoreSelectionByMarkers(),this.repositionEditor(),this.callback(b,[c])},$.Editable.prototype.beautifyFont=function(a){for(var b=!0,c=$.proxy(function(){this.$element.find('span[data-font="'+a+'"] + span[data-font="'+a+'"]').each(function(c,d){$(d).css(a)==$(d).prev().css(a)&&d.previousSibling&&"SPAN"==d.previousSibling.tagName&&($(d).prepend($(d).prev().html()),$(d).prev().remove(),b=!0)}),this.$element.find('span[data-font="'+a+'"] + span.f-marker[data-type="true"] + span[data-font="'+a+'"], span[data-font="'+a+'"] + span.f-marker[data-type="false"] + span[data-font="'+a+'"]').each(function(c,d){$(d).css(a)==$(d).prev().prev().css(a)&&d.previousSibling&&"SPAN"==d.previousSibling.tagName&&d.previousSibling.previousSibling&&"SPAN"==d.previousSibling.previousSibling.tagName&&($(d).prepend($(d).prev().clone()),$(d).prepend($(d).prev().prev().html()),$(d).prev().prev().remove(),$(d).prev().remove(),b=!0)})},this);b;)b=!1,c()}; \ No newline at end of file