/*! * froala_editor v1.2.4 (http://editor.froala.com) * Copyright 2014-2014 Froala */ !function(a){a.Editable.DEFAULTS=a.extend(a.Editable.DEFAULTS,{colors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],colorsStep:7}),a.Editable.prototype.refreshColors=function(){var a=this.getSelectionElement();this.$editor.find(".fr-color-picker button.fr-color-bttn").removeClass("active"),this.refreshColor(a,"background-color","backColor"),this.refreshColor(a,"color","foreColor")},a.Editable.prototype.refreshColor=function(b,c,d){for(;a(b).get(0)!=this.$element.get(0);){if("transparent"!==a(b).css(c)&&"rgba(0, 0, 0, 0)"!==a(b).css(c)){this.$editor.find('.fr-color-picker button.fr-color-bttn[data-param="'+d+'"][data-val="'+a.Editable.RGBToHex(a(b).css(c))+'"]').addClass("active");break}b=a(b).parent()}},a.Editable.commands=a.extend(a.Editable.commands,{color:{icon:"fa fa-tint",title:"Color",refreshOnShow:a.Editable.prototype.refreshColors,seed:[{cmd:"backColor"},{cmd:"foreColor"}],callback:function(a,b,c){this[c].apply(this,[b])},callbackWithoutSelection:function(b,c,d){"backColor"===d&&(d="background-color"),"foreColor"===d&&(d="color"),this._startInFontExec(d,b,c),"#123456"===c&&""===this.text()&&(this.cleanify(!0,!1),this.$element.find("span").each(function(b,c){var d=a(c),e=d.css("background-color");("#123456"===e||"#123456"===a.Editable.RGBToHex(e))&&d.css("background-color",""),e=d.css("color"),("#123456"===e||"#123456"===a.Editable.RGBToHex(e))&&d.css("color","")}))},undo:!0}}),a.Editable.prototype.command_dispatcher=a.extend(a.Editable.prototype.command_dispatcher,{color:function(a){var b=this.buildDropdownColor(a),c=this.buildDropdownButton(a,b,"fr-color-picker");return c}}),a.Editable.prototype.buildDropdownColor=function(){for(var b='
",this.$bttn_wrapper.on(this.mousedown,".fr-choose-color",function(a){return a.preventDefault(),a.stopPropagation(),"mousedown"===a.type&&1!==a.which?!0:void 0});var f=this;return this.$bttn_wrapper.on(this.mouseup,".fr-choose-color",function(b){if(b.preventDefault(),b.stopPropagation(),"mouseup"===b.type&&1!==b.which)return!0;var c=a(this);c.siblings().removeClass("active"),c.addClass("active"),c.parents(".fr-dropdown-menu").find("button").attr("data-param",c.attr("data-param")),f.refreshColors()}),b},a.Editable.prototype.backColor=function(b){this.inlineStyle("background-color","backColor",b),this.saveSelectionByMarkers(),this.$element.find("span").each(function(b,c){var d=a(c),e=d.css("background-color");("#123456"===e||"#123456"===a.Editable.RGBToHex(e))&&d.css("background-color",""),""!==d.attr("style")||d.hasClass("f-marker")||d.replaceWith(d.contents())}),this.restoreSelectionByMarkers();var c=this.$editor.find('button.fr-color-bttn[data-cmd="backColor"][data-val="'+b+'"]');c.addClass("active"),c.siblings().removeClass("active")},a.Editable.prototype.foreColor=function(b){this.inlineStyle("color","foreColor",b),this.saveSelectionByMarkers(),this.$element.find("span").each(function(b,c){var d=a(c),e=d.css("color");("#123456"===e||"#123456"===a.Editable.RGBToHex(e))&&d.css("color",""),""!==d.attr("style")||d.hasClass("f-marker")||d.replaceWith(d.contents())}),this.restoreSelectionByMarkers();var c=this.$editor.find('button.fr-color-bttn[data-cmd="foreColor"][data-val="'+b+'"]');c.addClass("active"),c.siblings().removeClass("active")}}(jQuery);