/*! * froala_editor v1.2.7 (https://www.froala.com/wysiwyg-editor) * License https://www.froala.com/wysiwyg-editor/terms * Copyright 2014-2015 Froala Labs */ !function(a){a.Editable.prototype.refreshInlineStyles=function(){var b=this.getSelectionElements()[0],c=b.tagName.toLowerCase();this.$bttn_wrapper.find(".fr-block-style").empty();var d=this.options.blockStyles[c];if(void 0===d&&(d=this.options.defaultBlockStyle),void 0!==d){this.$bttn_wrapper.find('.fr-dropdown > button[data-name="blockStyle"].fr-trigger').removeAttr("disabled");for(var e in d){var f=d[e],g="";a(b).hasClass(e)&&(g=' class="active"'),this.$bttn_wrapper.find(".fr-block-style").append(a("").append(a('').text(f).addClass(e)).attr("data-cmd","blockStyle").attr("data-val",e))}}},a.Editable.commands=a.extend(a.Editable.commands,{inlineStyle:{title:"Inline Style",icon:"fa fa-paint-brush",refreshOnShow:a.Editable.prototype.refreshInlineStyles,callback:function(a,b){this.applyInlineStyles(b)},callbackWithoutSelection:function(a,b){this.applyInlineStyles(b)}}}),a.Editable.DEFAULTS=a.extend(a.Editable.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),a.Editable.prototype.command_dispatcher=a.extend(a.Editable.prototype.command_dispatcher,{inlineStyle:function(a){var b=this.buildDropdownInlineStyle(),c=this.buildDropdownButton(a,b);return c}}),a.Editable.prototype.buildDropdownInlineStyle=function(){var a='"},a.Editable.prototype.applyInlineStyles=function(b){this.insertHTML(""!==this.text()?this.start_marker+''+this.text()+""+this.end_marker:''+this.markers_html+a.Editable.INVISIBLE_SPACE+""),this.restoreSelectionByMarkers(),this.triggerEvent("inlineStyle")},a.Editable.prototype.startInInlineStyles=function(a){for(var b in this.options.inlineStyles[a])this._startInFontExec(b.replace(/([A-Z])/g,"-$1").toLowerCase(),null,this.options.inlineStyles[a][b]);this.triggerEvent("inlineStyle")}}(jQuery);