/*! * froala_editor v1.1.6 (http://editor.froala.com) * Copyright 2014-2014 Froala */ $.Editable.commands=$.extend($.Editable.commands,{table:{title:"Table",icon:"fa fa-table"}}),$.Editable.DEFAULTS.buttons[$.Editable.DEFAULTS.buttons.indexOf("insertHorizontalRule")]="table",$.Editable.prototype.execCommand=$.extend($.Editable.prototype.execCommand,{insertTable:function(a,b,c){this.insertTable(b,c)},insertRowAbove:function(){this.insertRow("above")},insertRowBelow:function(){this.insertRow("below")},insertColumnBefore:function(){this.insertColumn("before")},insertColumnAfter:function(){this.insertColumn("after")},deleteColumn:function(){this.deleteColumn()},deleteRow:function(){this.deleteRow()},insertCellBefore:function(){this.insertCell("before")},insertCellAfter:function(){this.insertCell("after")},mergeCells:function(){this.mergeCells()},deleteCell:function(){this.deleteCell()},splitVertical:function(){this.splitVertical()},splitHorizontal:function(){this.splitHorizontal()},insertHeader:function(){this.insertHeader()},deleteHeader:function(){this.deleteHeader()},deleteTable:function(){this.deleteTable()}}),$.Editable.prototype.command_dispatcher=$.extend($.Editable.prototype.command_dispatcher,{table:function(a){var b=this.buildDropdownTable(),c=this.buildDropdownButton(a,b,"fr-table");this.$bttn_wrapper.append(c),this.bindTableDropdownEvents()}}),$.Editable.prototype.buildDropdownTable=function(){var a='
"},$.Editable.prototype.bindTableDropdownEvents=function(){var a=this;this.$bttn_wrapper.on("mouseenter",".fr-table .select-table > span",function(){var b=$(this).data("val"),c=$(this).data("param");a.$bttn_wrapper.find(".fr-table .select-table .fr-t-info").text(b+" x "+c),a.$bttn_wrapper.find(".fr-table .select-table > span").removeClass("hover");for(var d=1;10>=d;d++)for(var e=0;10>=e;e++){var f=a.$bttn_wrapper.find('.fr-table .select-table > span[data-val="'+d+'"][data-param="'+e+'"]');b>=d&&c>=e?f.addClass("hover"):(b+1>=d||5>=d)&&(c+1>=e||5>=e)?f.css("display","inline-block"):(d>5||e>5)&&f.css("display","none")}}),this.$bttn_wrapper.on("mouseleave",".fr-table .select-table",function(){a.$bttn_wrapper.find('.fr-table .select-table > span[data-val="1"][data-param="1"]').trigger("mouseenter")})},$.Editable.prototype.tableMap=function(){var a=this.currentTable(),b=[];return a&&a.find("tr").each(function(a,c){var d=$(c),e=0;d.find("td").each(function(c,d){for(var f=$(d),g=parseInt(f.attr("colspan"))||1,h=parseInt(f.attr("rowspan"))||1,i=a;a+h>i;i++)for(var j=e;e+g>j;j++)b[i]||(b[i]=[]),b[i][j]?e++:b[i][j]=d;e+=g})}),b},$.Editable.prototype.cellOrigin=function(a,b){for(var c=0;c