diff --git a/dist/wysiwyg.min.js b/dist/wysiwyg.min.js
index b27636c..37739e6 100644
--- a/dist/wysiwyg.min.js
+++ b/dist/wysiwyg.min.js
@@ -1 +1 @@
-"use strict";!function(e){var t=function(e,t){var n,o,i=null,r=e.document;return r.selection?(n=r.selection.createRange(),n.collapse(t),n.parentElement()):(r.getSelection?(o=r.getSelection(),o.rangeCount>0&&(n=o.getRangeAt(0),i=n[t?"startContainer":"endContainer"],3===i.nodeType&&(i=i.parentNode))):e.getSelection&&(o=e.getSelection(),o.rangeCount>0&&(n=o.getRangeAt(0),i=n[t?"startContainer":"endContainer"],3===i.nodeType&&(i=i.parentNode))),i)};e.module("ngWYSIWYG",["ngSanitize"]);var n='
';e.module("ngWYSIWYG").config(["$provide",function(e){e.decorator("$sanitize",["$delegate","$log",function(e,t){return function(t,n){var o=e(t,n);return o}}])}]),e.module("ngWYSIWYG").directive("wframe",["$compile","$timeout","$sanitize",function(n,o,i){var r=function(n,r,a,s){var l=r[0].contentDocument;l.open(),l.write(''),l.close(),l.designMode="On";var c=e.element(r[0].contentDocument.body),d=e.element(r[0].contentDocument.head);c.attr("contenteditable","true"),l.addEventListener("click",function(e){"HTML"===e.target.tagName&&e.target.querySelector("body").focus()}),a.contentStyle&&d.append(' '),s.$render=function(){console.log(n.config),c[0].innerHTML=s.$viewValue?n.config&&n.config.sanitize?i(s.$viewValue):s.$viewValue:""},n.sync=function(){n.$evalAsync(function(e){s.$setViewValue(c.html())})};var u=null;c.bind("click keyup change paste",function(){u&&o.cancel(u),u=o(function(){s.$setViewValue(c.html());var e=t(r[0].contentWindow,!0);if(e){var o=r[0].contentWindow.getComputedStyle(e),i={bold:"bold"==o.getPropertyValue("font-weight")||parseInt(o.getPropertyValue("font-weight"))>=700,italic:"italic"==o.getPropertyValue("font-style"),underline:"underline"==o.getPropertyValue("text-decoration"),strikethrough:"line-through"==o.getPropertyValue("text-decoration"),font:o.getPropertyValue("font-family"),size:parseInt(o.getPropertyValue("font-size")),color:o.getPropertyValue("color"),sub:"sub"==o.getPropertyValue("vertical-align"),"super":"super"==o.getPropertyValue("vertical-align"),background:o.getPropertyValue("background-color"),alignment:o.getPropertyValue("text-align")};n.$emit("cursor-position",i)}},100,!0)}),n.range=null,n.getSelection=function(){if(l.getSelection){var e=l.getSelection();e.getRangeAt&&e.rangeCount&&(n.range=e.getRangeAt(0))}},n.restoreSelection=function(){if(n.range&&l.getSelection){var e=l.getSelection();e.removeAllRanges(),e.addRange(n.range)}},n.$on("execCommand",function(e,t){console.log("execCommand: "),console.log(t),r[0].contentDocument.body.focus();var o=l.selection;if(o){var i=o.createRange();l.execCommand(t.command,0,t.arg),i.collapse(!1),i.select()}else l.execCommand(t.command,0,t.arg);l.body.focus(),n.sync()}),n.$on("insertElement",function(e,t){var o,i;if(l.defaultView.getSelection){if(o=l.defaultView.getSelection(),o.getRangeAt&&o.rangeCount){i=o.getRangeAt(0),i.deleteContents();var r=l.createElement("div");r.innerHTML=t;for(var a,s,c=l.createDocumentFragment();a=r.firstChild;)s=c.appendChild(a);c.firstChild;i.insertNode(c),s&&(i=i.cloneRange(),i.setStartAfter(s),i.collapse(!0),o.removeAllRanges(),o.addRange(i))}}else l.selection&&"Control"!=l.selection.type&&l.selection.createRange().pasteHTML(t);n.sync()}),n.$on("$destroy",function(){});try{l.execCommand("styleWithCSS",0,0),l.execCommand("enableObjectResizing",0,!0),l.execCommand("contentReadOnly",0,"false")}catch(g){try{l.execCommand("useCSS",0,1)}catch(g){}}};return{link:r,require:"ngModel",scope:{config:"=wframe"},replace:!0,restrict:"AE"}}]),e.module("ngWYSIWYG").directive("colorsGrid",["$compile","$document",function(e,t){var n=function(e,n,o,i){t.on("click",function(){e.$apply(function(){e.show=!1})}),n.parent().bind("click",function(e){e.stopPropagation()}),e.colors=["#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333","#800000","#FF6600","#808000","#008000","#008080","#0000FF","#666699","#808080","#FF0000","#FF9900","#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999","#FF00FF","#FFCC00","#FFFF00","#00FF00","#00FFFF","#00CCFF","#993366","#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF","#99CCFF","#CC99FF","#FFFFFF"],e.pick=function(t){e.onPick({color:t})},n.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;t '}}]),e.module("ngWYSIWYG").directive("symbolsGrid",["$compile","$document","$sce",function(e,t,n){var o=function(e,n,o,i){t.on("click",function(){e.$apply(function(){e.show=!1})}),n.parent().bind("click",function(e){e.stopPropagation()}),e.symbols=["¡","¿","–","—","»","«","©","÷","µ","¶","±","¢","€","£","®","§","™","¥","°","∀","∂","∃","∅","∇","∈","∉","∋","∏","∑","↑","→","↓","♠","♣","♥","♦","á","à","â","å","ã","ä","æ","ç","é","è","ê","ë","í","ì","î","ï","ñ","ó","ò","ô","ø","õ","ö","ß","ú","ù","û","ü","ÿ"],e.pick=function(t){e.onPick({symbol:t})},n.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;t '}}]),e.module("ngWYSIWYG").directive("wysiwygEdit",["$compile","$timeout","$q",function(o,i,r){var a=function(i,a,s,l){function c(){null==g&&(g=document.querySelector("wysiwyg-edit").querySelector("iframe"),m=g.contentDocument,p=m.defaultView)}function d(e){i.$broadcast("insertElement",e)}function u(e){var t="<"+e.type;if(t+=' class="'+e["class"],f&&(t+=" tinyeditor-control-fa"),t+='" ',"div"==e.type){if(e.title&&(t+='title="'+e.title+'" '),e.backgroundPos&&!f&&(t+='style="background-position: '+e.backgroundPos+'; position: relative;" '),e.pressed&&(t+="ng-class=\"{'pressed': cursorStyle."+e.pressed+'}" '),e.command){var n="'"+e.command+"'";e.commandParameter&&(n+=", '"+e.commandParameter+"'"),t+='ng-click="execCommand('+n+')" '}else e.specialCommand&&(t+='ng-click="'+e.specialCommand+'" ');t+=">",e.faIcon&&f&&"-"!=e.faIcon&&(t+=' '),e.faIcon&&f&&"-"==e.faIcon&&(t+='
'),e.inner&&(t+=e.inner)}else"select"==e.type&&(t+='ng-model="'+e.model+'" ',t+='ng-options="'+e.options+'" ',t+='ng-change="'+e.change+'" ',t+=''+e.title+" ");return t+=""+e.type+">"}i.editMode=!1,i.cursorStyle={};var g=null,m=null,p=null;i.panelButtons={"-":{type:"div","class":"tinyeditor-divider"},bold:{type:"div",title:"Bold","class":"tinyeditor-control",faIcon:"bold",backgroundPos:"34px -120px",pressed:"bold",command:"bold"},italic:{type:"div",title:"Italic","class":"tinyeditor-control",faIcon:"italic",backgroundPos:"34px -150px",pressed:"italic",command:"italic"},underline:{type:"div",title:"Underline","class":"tinyeditor-control",faIcon:"underline",backgroundPos:"34px -180px",pressed:"underline",command:"underline"},strikethrough:{type:"div",title:"Strikethrough","class":"tinyeditor-control",faIcon:"strikethrough",backgroundPos:"34px -210px",pressed:"strikethrough",command:"strikethrough"},subscript:{type:"div",title:"Subscript","class":"tinyeditor-control",faIcon:"subscript",backgroundPos:"34px -240px",pressed:"sub",command:"subscript"},superscript:{type:"div",title:"Superscript","class":"tinyeditor-control",faIcon:"superscript",backgroundPos:"34px -270px",pressed:"super",command:"superscript"},leftAlign:{type:"div",title:"Left Align","class":"tinyeditor-control",faIcon:"align-left",backgroundPos:"34px -420px",pressed:"alignmet == 'left'",command:"justifyleft"},centerAlign:{type:"div",title:"Center Align","class":"tinyeditor-control",faIcon:"align-center",backgroundPos:"34px -450px",pressed:"alignment == 'center'",command:"justifycenter"},rightAlign:{type:"div",title:"Right Align","class":"tinyeditor-control",faIcon:"align-right",backgroundPos:"34px -480px",pressed:"alignment == 'right'",command:"justifyright"},blockJustify:{type:"div",title:"Block Justify","class":"tinyeditor-control",faIcon:"align-justify",backgroundPos:"34px -510px",pressed:"alignment == 'justify'",command:"justifyfull"},orderedList:{type:"div",title:"Insert Ordered List","class":"tinyeditor-control",faIcon:"list-ol",backgroundPos:"34px -300px",command:"insertorderedlist"},unorderedList:{type:"div",title:"Insert Unordered List","class":"tinyeditor-control",faIcon:"list-ul",backgroundPos:"34px -330px",command:"insertunorderedlist"},outdent:{type:"div",title:"Outdent","class":"tinyeditor-control",faIcon:"outdent",backgroundPos:"34px -360px",command:"outdent"},indent:{type:"div",title:"Indent","class":"tinyeditor-control",faIcon:"indent",backgroundPos:"34px -390px",command:"indent"},removeFormatting:{type:"div",title:"Remove Formatting","class":"tinyeditor-control",faIcon:"eraser",backgroundPos:"34px -720px",command:"removeformat"},undo:{type:"div",title:"Undo","class":"tinyeditor-control",faIcon:"undo",backgroundPos:"34px -540px",command:"undo"},redo:{type:"div",title:"Redo","class":"tinyeditor-control",faIcon:"repeat",backgroundPos:"34px -570px",command:"redo"},fontColor:{type:"div",title:"Font Color","class":"tinyeditor-control",faIcon:"font",backgroundPos:"34px -779px",specialCommand:"showFontColors = !showFontColors",inner:''},backgroundColor:{type:"div",title:"Background Color","class":"tinyeditor-control",faIcon:"paint-brush",backgroundPos:"34px -808px",specialCommand:"showBgColors = !showBgColors",inner:''},image:{type:"div",title:"Insert Image","class":"tinyeditor-control",faIcon:"picture-o",backgroundPos:"34px -600px",specialCommand:"insertImage()"},hr:{type:"div",title:"Insert Horizontal Rule","class":"tinyeditor-control",faIcon:"-",backgroundPos:"34px -630px",command:"inserthorizontalrule"},symbols:{type:"div",title:"Insert Special Symbol","class":"tinyeditor-control",faIcon:"cny",backgroundPos:"34px -838px",specialCommand:"showSpecChars = !showSpecChars",inner:''},link:{type:"div",title:"Insert Hyperlink","class":"tinyeditor-control",faIcon:"link",backgroundPos:"34px -660px",specialCommand:"insertLink()"},unlink:{type:"div",title:"Remove Hyperlink","class":"tinyeditor-control",faIcon:"chain-broken",backgroundPos:"34px -690px",command:"unlink"},print:{type:"div",title:"Print","class":"tinyeditor-control",faIcon:"print",backgroundPos:"34px -750px",command:"print"},font:{type:"select",title:"Font","class":"tinyeditor-font",model:"font",options:"a as a for a in fonts",change:"fontChange()"},size:{type:"select",title:"Size","class":"tinyeditor-size",model:"fontsize",options:"a.key as a.name for a in fontsizes",change:"sizeChange()"},format:{type:"select",title:"Style","class":"tinyeditor-size",model:"textstyle",options:"s.key as s.name for s in styles",change:"styleChange()"}};var f=i.config&&i.config.fontAwesome;i.toolbar=i.config&&i.config.toolbar?i.config.toolbar:[{name:"basicStyling",items:["bold","italic","underline","strikethrough","subscript","superscript","leftAlign","centerAlign","rightAlign","blockJustify","-"]},{name:"paragraph",items:["orderedList","unorderedList","outdent","indent","-"]},{name:"doers",items:["removeFormatting","undo","redo","-"]},{name:"colors",items:["fontColor","backgroundColor","-"]},{name:"links",items:["image","hr","symbols","link","unlink","-"]},{name:"tools",items:["print","-"]},{name:"styling",items:["font","size","format"]}];var y=[];e.forEach(i.toolbar,function(t,n){var o=[];e.forEach(t.items,function(e,t){var n=i.panelButtons[e];n||(n=i.config.buttons[e]),this.push(u(n))},o),this.push(''+o.join("")+"
")},y);var h=n.replace("{toolbar}",y.join(""));h=h.replace("{contentStyle}",s.contentStyle||""),a.html(h),o(a.contents())(i),i.execCommand=function(e,t){switch(e){case"bold":i.cursorStyle.bold=!i.cursorStyle.bold;break;case"italic":i.cursorStyle.italic=!i.cursorStyle.italic;break;case"underline":i.cursorStyle.underline=!i.cursorStyle.underline;break;case"strikethrough":i.cursorStyle.strikethrough=!i.cursorStyle.strikethrough;break;case"subscript":i.cursorStyle.sub=!i.cursorStyle.sub;break;case"superscript":i.cursorStyle["super"]=!i.cursorStyle["super"];break;case"justifyleft":i.cursorStyle.alignment="left";break;case"justifycenter":i.cursorStyle.alignment="center";break;case"justifyright":i.cursorStyle.alignment="right";break;case"justifyfull":i.cursorStyle.alignment="justify"}i.$broadcast("execCommand",{command:e,arg:t})},i.fonts=["Verdana","Arial","Arial Black","Arial Narrow","Courier New","Century Gothic","Comic Sans MS","Georgia","Impact","Tahoma","Times","Times New Roman","Webdings","Trebuchet MS"],i.fontChange=function(){i.execCommand("fontname",i.font)},i.fontsizes=[{key:1,name:"x-small"},{key:2,name:"small"},{key:3,name:"normal"},{key:4,name:"large"},{key:5,name:"x-large"},{key:6,name:"xx-large"},{key:7,name:"xxx-large"}],i.mapFontSize={10:1,13:2,16:3,18:4,24:5,32:6,48:7},i.sizeChange=function(){i.execCommand("fontsize",i.fontsize)},i.styles=[{name:"Paragraph",key:""},{name:"Header 1",key:"
"},{name:"Header 2",key:""},{name:"Header 3",key:""},{name:"Header 4",key:""},{name:"Header 5",key:""},{name:"Header 6",key:""}],i.styleChange=function(){i.execCommand("formatblock",i.textstyle)},i.showFontColors=!1,i.setFontColor=function(e){i.execCommand("foreColor",e)},i.showBgColors=!1,i.setBgColor=function(e){i.execCommand("hiliteColor",e)},i.showSpecChars=!1,i.insertSpecChar=function(e){d(e)},i.insertLink=function(){if(c(),null!=p.getSelection().focusNode){var n=t(p,!0),o="http://";if(n&&"A"==n.nodeName){o=n.href;var a=m.createRange();a.setStart(n.firstChild,0),a.setEnd(n.firstChild,n.firstChild.length);var s=p.getSelection();s.removeAllRanges(),s.addRange(a)}var l;l=i.api&&i.api.insertLink&&e.isFunction(i.api.insertLink)?i.api.insertLink.apply(i.api.scope||null,[o]):prompt("Please enter the URL","http://"),r.when(l).then(function(e){i.execCommand("createlink",e)})}},i.insertImage=function(){var t;i.api&&i.api.insertImage&&e.isFunction(i.api.insertImage)?t=i.api.insertImage.apply(i.api.scope||null):(t=prompt("Please enter the picture URL","http://"),t=' '),r.when(t).then(function(e){d(e)})},a.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;ti?i:e.pageY,a=o.top-r+o.height;n.css({top:r+"px",height:a+"px"})},r=function(e){var t=50,o=n[0].offsetTop+t,i=e.pageY>o?e.pageY-n[0].offsetTop:t;n.css({height:i+"px"})},a=angular.element(' ');n.append(a),a.on("mousedown",function(t){function a(e){e.preventDefault(),r(e),i(e)}function s(){e.off("mousemove",a),e.off("mouseup",s)}e.on("mousemove",a),e.on("mouseup",s),o=t,o.top=n[0].offsetTop,o.left=n[0].offsetLeft,o.width=n[0].offsetWidth,o.height=n[0].offsetHeight})}}])}();
\ No newline at end of file
+"use strict";!function(e){var t=function(e,t){var n,o,i=null,r=e.document;return r.selection?(n=r.selection.createRange(),n.collapse(t),n.parentElement()):(r.getSelection?(o=r.getSelection(),o.rangeCount>0&&(n=o.getRangeAt(0),i=n[t?"startContainer":"endContainer"],3===i.nodeType&&(i=i.parentNode))):e.getSelection&&(o=e.getSelection(),o.rangeCount>0&&(n=o.getRangeAt(0),i=n[t?"startContainer":"endContainer"],3===i.nodeType&&(i=i.parentNode))),i)};e.module("ngWYSIWYG",["ngSanitize"]);var n='';e.module("ngWYSIWYG").config(["$provide",function(e){e.decorator("$sanitize",["$delegate","$log",function(e,t){return function(t,n){var o=e(t,n);return o}}])}]),e.module("ngWYSIWYG").directive("wframe",["$compile","$timeout","$sanitize",function(n,o,i){var r=function(n,r,a,s){var l=r[0].contentDocument;l.open(),l.write(''),l.close(),l.designMode="On";var c=e.element(r[0].contentDocument.body),d=e.element(r[0].contentDocument.head);c.attr("contenteditable","true"),l.addEventListener("click",function(e){"HTML"===e.target.tagName&&e.target.querySelector("body").focus()}),a.contentStyle&&d.append(' '),s.$render=function(){console.log(n.config),c[0].innerHTML=s.$viewValue?n.config&&n.config.sanitize?i(s.$viewValue):s.$viewValue:""},n.sync=function(){n.$evalAsync(function(e){s.$setViewValue(c.html())})};var u=null;c.bind("click keyup change paste",function(){u&&o.cancel(u),u=o(function(){s.$setViewValue(c.html());var e=t(r[0].contentWindow,!0);if(e){var o=r[0].contentWindow.getComputedStyle(e),i={bold:"bold"==o.getPropertyValue("font-weight")||parseInt(o.getPropertyValue("font-weight"))>=700,italic:"italic"==o.getPropertyValue("font-style"),underline:"underline"==o.getPropertyValue("text-decoration"),strikethrough:"line-through"==o.getPropertyValue("text-decoration"),font:o.getPropertyValue("font-family"),size:parseInt(o.getPropertyValue("font-size")),color:o.getPropertyValue("color"),sub:"sub"==o.getPropertyValue("vertical-align"),"super":"super"==o.getPropertyValue("vertical-align"),background:o.getPropertyValue("background-color"),alignment:o.getPropertyValue("text-align")};n.$emit("cursor-position",i)}},100,!0)}),n.range=null,n.getSelection=function(){if(l.getSelection){var e=l.getSelection();e.getRangeAt&&e.rangeCount&&(n.range=e.getRangeAt(0))}},n.restoreSelection=function(){if(n.range&&l.getSelection){var e=l.getSelection();e.removeAllRanges(),e.addRange(n.range)}},n.$on("execCommand",function(e,t){console.log("execCommand: "),console.log(t),r[0].contentDocument.body.focus();var o=l.selection;if(o){var i=o.createRange();l.execCommand(t.command,0,t.arg),i.collapse(!1),i.select()}else l.execCommand(t.command,0,t.arg);l.body.focus(),n.sync()}),n.$on("insertElement",function(e,t){var o,i;if(l.defaultView.getSelection){if(o=l.defaultView.getSelection(),o.getRangeAt&&o.rangeCount){i=o.getRangeAt(0),i.deleteContents();var r=l.createElement("div");r.innerHTML=t;for(var a,s,c=l.createDocumentFragment();a=r.firstChild;)s=c.appendChild(a);c.firstChild;i.insertNode(c),s&&(i=i.cloneRange(),i.setStartAfter(s),i.collapse(!0),o.removeAllRanges(),o.addRange(i))}}else l.selection&&"Control"!=l.selection.type&&l.selection.createRange().pasteHTML(t);n.sync()}),n.$on("$destroy",function(){});try{l.execCommand("styleWithCSS",0,0),l.execCommand("enableObjectResizing",0,!0),l.execCommand("contentReadOnly",0,"false")}catch(m){try{l.execCommand("useCSS",0,1)}catch(m){}}};return{link:r,require:"ngModel",scope:{config:"=wframe"},replace:!0,restrict:"AE"}}]),e.module("ngWYSIWYG").directive("colorsGrid",["$compile","$document",function(e,t){var n=function(e,n,o,i){t.on("click",function(){e.$apply(function(){e.show=!1})}),n.parent().bind("click",function(e){e.stopPropagation()}),e.colors=["#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333","#800000","#FF6600","#808000","#008000","#008080","#0000FF","#666699","#808080","#FF0000","#FF9900","#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999","#FF00FF","#FFCC00","#FFFF00","#00FF00","#00FFFF","#00CCFF","#993366","#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF","#99CCFF","#CC99FF","#FFFFFF"],e.pick=function(t){e.onPick({color:t})},n.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;t '}}]),e.module("ngWYSIWYG").directive("symbolsGrid",["$compile","$document","$sce",function(e,t,n){var o=function(e,n,o,i){t.on("click",function(){e.$apply(function(){e.show=!1})}),n.parent().bind("click",function(e){e.stopPropagation()}),e.symbols=["¡","¿","–","—","»","«","©","÷","µ","¶","±","¢","€","£","®","§","™","¥","°","∀","∂","∃","∅","∇","∈","∉","∋","∏","∑","↑","→","↓","♠","♣","♥","♦","á","à","â","å","ã","ä","æ","ç","é","è","ê","ë","í","ì","î","ï","ñ","ó","ò","ô","ø","õ","ö","ß","ú","ù","û","ü","ÿ"],e.pick=function(t){e.onPick({symbol:t})},n.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;t '}}]),e.module("ngWYSIWYG").directive("wysiwygEdit",["$compile","$timeout","$q",function(o,i,r){var a=function(i,a,s,l){function c(){null==m&&(m=document.querySelector("wysiwyg-edit").querySelector("iframe"),g=m.contentDocument,p=g.defaultView)}function d(e){i.$broadcast("insertElement",e)}function u(e){var t="<"+e.type;if(t+=' class="'+e["class"],f&&(t+=" tinyeditor-control-fa"),t+='" ',"div"==e.type){if(e.title&&(t+='title="'+e.title+'" '),e.backgroundPos&&!f&&(t+='style="background-position: '+e.backgroundPos+'; position: relative;" '),e.pressed&&(t+="ng-class=\"{'pressed': cursorStyle."+e.pressed+'}" '),e.command){var n="'"+e.command+"'";e.commandParameter&&(n+=", '"+e.commandParameter+"'"),t+='ng-click="execCommand('+n+')" '}else e.specialCommand&&(t+='ng-click="'+e.specialCommand+'" ');t+=">",e.faIcon&&f&&"-"!=e.faIcon&&(t+=' '),e.faIcon&&f&&"-"==e.faIcon&&(t+='
'),e.inner&&(t+=e.inner)}else"select"==e.type&&(t+='ng-model="'+e.model+'" ',t+='ng-options="'+e.options+'" ',t+='ng-change="'+e.change+'" ',t+=''+e.title+" ");return t+=""+e.type+">"}i.editMode=!1,i.cursorStyle={};var m=null,g=null,p=null;i.panelButtons={"-":{type:"div","class":"tinyeditor-divider"},bold:{type:"div",title:"Bold","class":"tinyeditor-control",faIcon:"bold",backgroundPos:"34px -120px",pressed:"bold",command:"bold"},italic:{type:"div",title:"Italic","class":"tinyeditor-control",faIcon:"italic",backgroundPos:"34px -150px",pressed:"italic",command:"italic"},underline:{type:"div",title:"Underline","class":"tinyeditor-control",faIcon:"underline",backgroundPos:"34px -180px",pressed:"underline",command:"underline"},strikethrough:{type:"div",title:"Strikethrough","class":"tinyeditor-control",faIcon:"strikethrough",backgroundPos:"34px -210px",pressed:"strikethrough",command:"strikethrough"},subscript:{type:"div",title:"Subscript","class":"tinyeditor-control",faIcon:"subscript",backgroundPos:"34px -240px",pressed:"sub",command:"subscript"},superscript:{type:"div",title:"Superscript","class":"tinyeditor-control",faIcon:"superscript",backgroundPos:"34px -270px",pressed:"super",command:"superscript"},leftAlign:{type:"div",title:"Left Align","class":"tinyeditor-control",faIcon:"align-left",backgroundPos:"34px -420px",pressed:"alignmet == 'left'",command:"justifyleft"},centerAlign:{type:"div",title:"Center Align","class":"tinyeditor-control",faIcon:"align-center",backgroundPos:"34px -450px",pressed:"alignment == 'center'",command:"justifycenter"},rightAlign:{type:"div",title:"Right Align","class":"tinyeditor-control",faIcon:"align-right",backgroundPos:"34px -480px",pressed:"alignment == 'right'",command:"justifyright"},blockJustify:{type:"div",title:"Block Justify","class":"tinyeditor-control",faIcon:"align-justify",backgroundPos:"34px -510px",pressed:"alignment == 'justify'",command:"justifyfull"},orderedList:{type:"div",title:"Insert Ordered List","class":"tinyeditor-control",faIcon:"list-ol",backgroundPos:"34px -300px",command:"insertorderedlist"},unorderedList:{type:"div",title:"Insert Unordered List","class":"tinyeditor-control",faIcon:"list-ul",backgroundPos:"34px -330px",command:"insertunorderedlist"},outdent:{type:"div",title:"Outdent","class":"tinyeditor-control",faIcon:"outdent",backgroundPos:"34px -360px",command:"outdent"},indent:{type:"div",title:"Indent","class":"tinyeditor-control",faIcon:"indent",backgroundPos:"34px -390px",command:"indent"},removeFormatting:{type:"div",title:"Remove Formatting","class":"tinyeditor-control",faIcon:"eraser",backgroundPos:"34px -720px",command:"removeformat"},undo:{type:"div",title:"Undo","class":"tinyeditor-control",faIcon:"undo",backgroundPos:"34px -540px",command:"undo"},redo:{type:"div",title:"Redo","class":"tinyeditor-control",faIcon:"repeat",backgroundPos:"34px -570px",command:"redo"},fontColor:{type:"div",title:"Font Color","class":"tinyeditor-control",faIcon:"font",backgroundPos:"34px -779px",specialCommand:"showFontColors = !showFontColors",inner:''},backgroundColor:{type:"div",title:"Background Color","class":"tinyeditor-control",faIcon:"paint-brush",backgroundPos:"34px -808px",specialCommand:"showBgColors = !showBgColors",inner:''},image:{type:"div",title:"Insert Image","class":"tinyeditor-control",faIcon:"picture-o",backgroundPos:"34px -600px",specialCommand:"insertImage()"},hr:{type:"div",title:"Insert Horizontal Rule","class":"tinyeditor-control",faIcon:"-",backgroundPos:"34px -630px",command:"inserthorizontalrule"},symbols:{type:"div",title:"Insert Special Symbol","class":"tinyeditor-control",faIcon:"cny",backgroundPos:"34px -838px",specialCommand:"showSpecChars = !showSpecChars",inner:''},link:{type:"div",title:"Insert Hyperlink","class":"tinyeditor-control",faIcon:"link",backgroundPos:"34px -660px",specialCommand:"insertLink()"},unlink:{type:"div",title:"Remove Hyperlink","class":"tinyeditor-control",faIcon:"chain-broken",backgroundPos:"34px -690px",command:"unlink"},print:{type:"div",title:"Print","class":"tinyeditor-control",faIcon:"print",backgroundPos:"34px -750px",command:"print"},font:{type:"select",title:"Font","class":"tinyeditor-font",model:"font",options:"a as a for a in fonts",change:"fontChange()"},size:{type:"select",title:"Size","class":"tinyeditor-size",model:"fontsize",options:"a.key as a.name for a in fontsizes",change:"sizeChange()"},format:{type:"select",title:"Style","class":"tinyeditor-size",model:"textstyle",options:"s.key as s.name for s in styles",change:"styleChange()"}};var f=i.config&&i.config.fontAwesome;i.toolbar=i.config&&i.config.toolbar?i.config.toolbar:[{name:"basicStyling",items:["bold","italic","underline","strikethrough","subscript","superscript","leftAlign","centerAlign","rightAlign","blockJustify","-"]},{name:"paragraph",items:["orderedList","unorderedList","outdent","indent","-"]},{name:"doers",items:["removeFormatting","undo","redo","-"]},{name:"colors",items:["fontColor","backgroundColor","-"]},{name:"links",items:["image","hr","symbols","link","unlink","-"]},{name:"tools",items:["print","-"]},{name:"styling",items:["font","size","format"]}];var y=[];e.forEach(i.toolbar,function(t,n){var o=[];e.forEach(t.items,function(e,t){var n=i.panelButtons[e];n||(n=i.config.buttons[e]),this.push(u(n))},o),this.push(''+o.join("")+"
")},y);var h=n.replace("{toolbar}",y.join(""));h=h.replace("{contentStyle}",s.contentStyle||""),a.html(h),o(a.contents())(i),i.execCommand=function(e,t){switch(e){case"bold":i.cursorStyle.bold=!i.cursorStyle.bold;break;case"italic":i.cursorStyle.italic=!i.cursorStyle.italic;break;case"underline":i.cursorStyle.underline=!i.cursorStyle.underline;break;case"strikethrough":i.cursorStyle.strikethrough=!i.cursorStyle.strikethrough;break;case"subscript":i.cursorStyle.sub=!i.cursorStyle.sub;break;case"superscript":i.cursorStyle["super"]=!i.cursorStyle["super"];break;case"justifyleft":i.cursorStyle.alignment="left";break;case"justifycenter":i.cursorStyle.alignment="center";break;case"justifyright":i.cursorStyle.alignment="right";break;case"justifyfull":i.cursorStyle.alignment="justify"}i.$broadcast("execCommand",{command:e,arg:t})},i.fonts=["Verdana","Arial","Arial Black","Arial Narrow","Courier New","Century Gothic","Comic Sans MS","Georgia","Impact","Tahoma","Times","Times New Roman","Webdings","Trebuchet MS"],i.fontChange=function(){i.execCommand("fontname",i.font)},i.fontsizes=[{key:1,name:"x-small"},{key:2,name:"small"},{key:3,name:"normal"},{key:4,name:"large"},{key:5,name:"x-large"},{key:6,name:"xx-large"},{key:7,name:"xxx-large"}],i.mapFontSize={10:1,13:2,16:3,18:4,24:5,32:6,48:7},i.sizeChange=function(){i.execCommand("fontsize",i.fontsize)},i.styles=[{name:"Paragraph",key:""},{name:"Header 1",key:"
"},{name:"Header 2",key:""},{name:"Header 3",key:""},{name:"Header 4",key:""},{name:"Header 5",key:""},{name:"Header 6",key:""}],i.styleChange=function(){i.execCommand("formatblock",i.textstyle)},i.showFontColors=!1,i.setFontColor=function(e){i.execCommand("foreColor",e)},i.showBgColors=!1,i.setBgColor=function(e){i.execCommand("hiliteColor",e)},i.showSpecChars=!1,i.insertSpecChar=function(e){d(e)},i.insertLink=function(){if(c(),null!=p.getSelection().focusNode){var n=t(p,!0),o="http://";if(n&&"A"==n.nodeName){o=n.href;var a=g.createRange();a.setStart(n.firstChild,0),a.setEnd(n.firstChild,n.firstChild.length);var s=p.getSelection();s.removeAllRanges(),s.addRange(a)}var l;l=i.api&&i.api.insertLink&&e.isFunction(i.api.insertLink)?i.api.insertLink.apply(i.api.scope||null,[o]):prompt("Please enter the URL","http://"),r.when(l).then(function(e){i.execCommand("createlink",e)})}},i.insertImage=function(){var t;i.api&&i.api.insertImage&&e.isFunction(i.api.insertImage)?t=i.api.insertImage.apply(i.api.scope||null):(t=prompt("Please enter the picture URL","http://"),t=' '),r.when(t).then(function(e){d(e)})},a.ready(function(){function e(t){1==t.nodeType&&(t.setAttribute("unselectable","on"),t.unselectable="on");for(var n=t.firstChild;n;)e(n),n=n.nextSibling}for(var t=0;tr&&window.innerHeight-e.clientY<=45&&o.defaultView.scrollBy(0,n-r),i.style.height=n+"px"}function t(){o.removeEventListener("mousemove",e),o.removeEventListener("mouseup",t);for(var n=o.querySelectorAll("iframe"),i=0;i