www-thermferm/jqwidgets/jqxeditor.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
--- a/www-thermferm/jqwidgets/jqxeditor.js	Fri May 19 16:34:21 2017 +0200
+++ b/www-thermferm/jqwidgets/jqxeditor.js	Sun May 28 14:19:57 2017 +0200
@@ -1,7 +1,9 @@
 /*
-jQWidgets v3.8.0 (2015-Apr)
-Copyright (c) 2011-2015 jQWidgets.
+jQWidgets v4.5.2 (2017-May)
+Copyright (c) 2011-2017 jQWidgets.
 License: http://jqwidgets.com/license/
-*/
-
-(function(b){b.jqx.jqxWidget("jqxEditor","",{});b.extend(b.jqx._jqxEditor.prototype,{defineInstance:function(){var d={width:null,height:null,disabled:false,pasteMode:"html",editable:true,lineBreak:"default",toolbarPosition:"top",commands:{bold:{tooltip:"Bold",command:"bold",type:"toggleButton"},italic:{tooltip:"Italic",command:"italic",type:"toggleButton"},underline:{tooltip:"Underline",command:"underline",type:"toggleButton"},format:{placeHolder:"Format Block",tooltip:"Format Block",command:"formatblock",value:[{value:"p",label:"Paragraph"},{value:"h1",label:"Header 1"},{value:"h2",label:"Header 2"},{value:"h3",label:"Header 3"},{value:"h4",label:"Header 4"}],type:"list",width:120,dropDownWidth:190,height:25},font:{placeHolder:"Font",tooltip:"Font Name",command:"fontname",value:[{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Comic Sans MS",value:'"Comic Sans MS", cursive, sans-serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Georgia",value:"Georgia,serif"},{label:"Impact",value:"Impact,Charcoal,sans-serif"},{label:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{label:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{label:"Times New Roman",value:"'Times New Roman',Times,serif"},{label:"Trebuchet MS",value:'"Trebuchet MS",Helvetica,sans-serif'},{label:"Verdana",value:"Verdana,Geneva,sans-serif"}],type:"list",width:160,height:25,dropDownWidth:160},size:{placeHolder:"Size",tooltip:"Font Size",command:"fontsize",value:[{label:"1 (8pt)",value:"xx-small"},{label:"2 (10pt)",value:"x-small"},{label:"3 (12pt)",value:"small"},{label:"4 (14pt)",value:"medium"},{label:"5 (18pt)",value:"large"},{label:"6 (24pt)",value:"x-large"},{label:"7 (36pt)",value:"xx-large"}],type:"list",width:45,height:25,dropDownWidth:160},color:{tooltip:"Text Color",command:"forecolor",value:"#000",type:"colorPicker"},background:{tooltip:"Fill Color",command:"backcolor",value:"#fff",type:"colorPicker"},left:{tooltip:"Align Left",command:"justifyleft",type:"toggleButton"},center:{tooltip:"Align Center",command:"justifycenter",type:"toggleButton"},right:{tooltip:"Align Right",command:"justifyright",type:"toggleButton"},outdent:{tooltip:"Indent Less",command:"outdent",type:"button"},indent:{tooltip:"Indent More",command:"indent",type:"button"},ul:{tooltip:"Insert unordered list",command:"insertunorderedlist",type:"toggleButton"},ol:{tooltip:"Insert ordered list",command:"insertorderedlist",type:"toggleButton"},image:{tooltip:"Insert image",command:"insertimage",type:"button"},link:{tooltip:"Insert link",command:"createlink",type:"toggleButton"},html:{tooltip:"View source",command:"viewsource",type:"toggleButton"},clean:{tooltip:"Remove Formatting",command:"removeformat",type:"button"}},createCommand:null,defaultLocalization:{bold:"Bold",italic:"Italic",underline:"Underline",format:"Format Block",font:"Font Name",size:"Font Size",color:"Text Color",background:"Fill Color",left:"Align Left",center:"Align Center",right:"Align Right",outdent:"Indent Less",indent:"Indent More",ul:"Insert unordered list",ol:"Insert ordered list",image:"Insert image",link:"Insert link",html:"View source",clean:"Remove Formatting",Remove:"Remove",Ok:"Ok",Cancel:"Cancel",Change:"Change","Go to link":"Go to link","Open in a new window/tab":"Open in a new window/tab",Align:"Align",VSpace:"VSpace",HSpace:"HSpace",Width:"Width",Height:"Height",Title:"Title",URL:"URL","Insert Image":"Insert Image","Insert Link":"Insert Link","Alt Text":"Alt Text","not set":"&ltnot set&gt",Left:"Left",Right:"Right",Paragraph:"Paragraph",Header:"Header",Arial:"Arial","Comic Sans MS":"Comic Sans MS","Courier New":"Courier New",Georgia:"Georgia",Impact:"Impact","Lucida Console":"Lucida Console",Tahoma:"Tahoma","Times New Roman":"Times New Roman","Trebuchet MS":"Trebuchet MS",Verdana:"Verdana"},localization:null,tools:"bold italic underline | format font size | color background | left center right | outdent indent | ul ol | image | link | clean | html",readOnly:false,stylesheets:new Array(),rtl:false,colorPickerTemplate:'<div class="jqx-editor-color-picker"><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (0, 0, 0)"><div title="RGB (0, 0, 0)" style="background-color: rgb(0, 0, 0);"></div></td><td aria-label="RGB (68, 68, 68)"><div title="RGB (68, 68, 68)" style="background-color: rgb(68, 68, 68);"></div></td><td aria-label="RGB (102, 102, 102)"><div title="RGB (102, 102, 102)" style="background-color: rgb(102, 102, 102);"></div></td><td aria-label="RGB (153, 153, 153)"><div title="RGB (153, 153, 153)" style="background-color: rgb(153, 153, 153);"></div></td><td aria-label="RGB (204, 204, 204)"><div title="RGB (204, 204, 204)" style="background-color: rgb(204, 204, 204);"></div></td><td aria-label="RGB (238, 238, 238)"><div title="RGB (238, 238, 238)" style="background-color: rgb(238, 238, 238);"></div></td><td aria-label="RGB (243, 243, 243)"><div title="RGB (243, 243, 243)" style="background-color: rgb(243, 243, 243);"></div></td><td aria-label="RGB (255, 255, 255)"><div title="RGB (255, 255, 255)" style="background-color: rgb(255, 255, 255);"></div></td></tr></tbody></table></div><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (255, 0, 0)"><div title="RGB (255, 0, 0)" style="background-color: rgb(255, 0, 0);"></div></td><td aria-label="RGB (255, 153, 0)"><div title="RGB (255, 153, 0)" style="background-color: rgb(255, 153, 0);"></div></td><td aria-label="RGB (255, 255, 0)"><div title="RGB (255, 255, 0)" style="background-color: rgb(255, 255, 0);"></div></td><td aria-label="RGB (0, 255, 0)"><div title="RGB (0, 255, 0)" style="background-color: rgb(0, 255, 0);"></div></td><td aria-label="RGB (0, 255, 255)"><div title="RGB (0, 255, 255)" style="background-color: rgb(0, 255, 255);"></div></td><td aria-label="RGB (0, 0, 255)"><div title="RGB (0, 0, 255)" style="background-color: rgb(0, 0, 255);"></div></td><td aria-label="RGB (153, 0, 255)"><div title="RGB (153, 0, 255)" style="background-color: rgb(153, 0, 255);"></div></td><td aria-label="RGB (255, 0, 255)"><div title="RGB (255, 0, 255)" style="background-color: rgb(255, 0, 255);"></div></td></tr></tbody></table></div><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (244, 204, 204)"><div title="RGB (244, 204, 204)" style="background-color: rgb(244, 204, 204);"></div></td><td aria-label="RGB (252, 229, 205)"><div title="RGB (252, 229, 205)" style="background-color: rgb(252, 229, 205);"></div></td><td aria-label="RGB (255, 242, 204)"><div title="RGB (255, 242, 204)" style="background-color: rgb(255, 242, 204);"></div></td><td aria-label="RGB (217, 234, 211)"><div title="RGB (217, 234, 211)" style="background-color: rgb(217, 234, 211);"></div></td><td aria-label="RGB (208, 224, 227)"><div title="RGB (208, 224, 227)" style="background-color: rgb(208, 224, 227);"></div></td><td aria-label="RGB (207, 226, 243)"><div title="RGB (207, 226, 243)" style="background-color: rgb(207, 226, 243);"></div></td><td aria-label="RGB (217, 210, 233)"><div title="RGB (217, 210, 233)" style="background-color: rgb(217, 210, 233);"></div></td><td aria-label="RGB (234, 209, 220)"><div title="RGB (234, 209, 220)" style="background-color: rgb(234, 209, 220);"></div></td></tr><tr><td id="T-Kw-Jn88" aria-label="RGB (234, 153, 153)"><div title="RGB (234, 153, 153)" style="background-color: rgb(234, 153, 153);"></div></td><td aria-label="RGB (249, 203, 156)"><div title="RGB (249, 203, 156)" style="background-color: rgb(249, 203, 156);"></div></td><td aria-label="RGB (255, 229, 153)"><div title="RGB (255, 229, 153)" style="background-color: rgb(255, 229, 153);"></div></td><td aria-label="RGB (182, 215, 168)"><div title="RGB (182, 215, 168)" style="background-color: rgb(182, 215, 168);"></div></td><td aria-label="RGB (162, 196, 201)"><div title="RGB (162, 196, 201)" style="background-color: rgb(162, 196, 201);"></div></td><td aria-label="RGB (159, 197, 232)"><div title="RGB (159, 197, 232)" style="background-color: rgb(159, 197, 232);"></div></td><td aria-label="RGB (180, 167, 214)"><div title="RGB (180, 167, 214)" style="background-color: rgb(180, 167, 214);"></div></td><td aria-label="RGB (213, 166, 189)"><div title="RGB (213, 166, 189)" style="background-color: rgb(213, 166, 189);"></div></td></tr><tr><td aria-label="RGB (224, 102, 102)"><div title="RGB (224, 102, 102)" style="background-color: rgb(224, 102, 102);"></div></td><td aria-label="RGB (246, 178, 107)"><div title="RGB (246, 178, 107)" style="background-color: rgb(246, 178, 107);"></div></td><td aria-label="RGB (255, 217, 102)"><div title="RGB (255, 217, 102)" style="background-color: rgb(255, 217, 102);"></div></td><td aria-label="RGB (147, 196, 125)"><div title="RGB (147, 196, 125)" style="background-color: rgb(147, 196, 125);"></div></td><td aria-label="RGB (118, 165, 175)"><div title="RGB (118, 165, 175)" style="background-color: rgb(118, 165, 175);"></div></td><td aria-label="RGB (111, 168, 220)"><div title="RGB (111, 168, 220)" style="background-color: rgb(111, 168, 220);"></div></td><td aria-label="RGB (142, 124, 195)"><div title="RGB (142, 124, 195)" style="background-color: rgb(142, 124, 195);"></div></td><td aria-label="RGB (194, 123, 160)"><div title="RGB (194, 123, 160)" style="background-color: rgb(194, 123, 160);"></div></td></tr><tr><td id="T-Kw-Jn104" aria-label="RGB (204, 0, 0)"><div title="RGB (204, 0, 0)" style="background-color: rgb(204, 0, 0);"></div></td><td aria-label="RGB (230, 145, 56)"><div title="RGB (230, 145, 56)" style="background-color: rgb(230, 145, 56);"></div></td><td aria-label="RGB (241, 194, 50)"><div title="RGB (241, 194, 50)" style="background-color: rgb(241, 194, 50);"></div></td><td aria-label="RGB (106, 168, 79)"><div title="RGB (106, 168, 79)" style="background-color: rgb(106, 168, 79);"></div></td><td aria-label="RGB (69, 129, 142)"><div title="RGB (69, 129, 142)" style="background-color: rgb(69, 129, 142);"></div></td><td aria-label="RGB (61, 133, 198)"><div title="RGB (61, 133, 198)" style="background-color: rgb(61, 133, 198);"></div></td><td aria-label="RGB (103, 78, 167)"><div title="RGB (103, 78, 167)" style="background-color: rgb(103, 78, 167);"></div></td><td aria-label="RGB (166, 77, 121)"><div title="RGB (166, 77, 121)" style="background-color: rgb(166, 77, 121);"></div></td></tr><tr><td aria-label="RGB (153, 0, 0)"><div title="RGB (153, 0, 0)" style="background-color: rgb(153, 0, 0);"></div></td><td aria-label="RGB (180, 95, 6)"><div title="RGB (180, 95, 6)" style="background-color: rgb(180, 95, 6);"></div></td><td aria-label="RGB (191, 144, 0)"><div title="RGB (191, 144, 0)" style="background-color: rgb(191, 144, 0);"></div></td><td aria-label="RGB (56, 118, 29)"><div title="RGB (56, 118, 29)" style="background-color: rgb(56, 118, 29);"></div></td><td aria-label="RGB (19, 79, 92)"><div title="RGB (19, 79, 92)" style="background-color: rgb(19, 79, 92);"></div></td><td aria-label="RGB (11, 83, 148)"><div title="RGB (11, 83, 148)" style="background-color: rgb(11, 83, 148);"></div></td><td aria-label="RGB (53, 28, 117)"><div title="RGB (53, 28, 117)" style="background-color: rgb(53, 28, 117);"></div></td><td aria-label="RGB (116, 27, 71)"><div title="RGB (116, 27, 71)" style="background-color: rgb(116, 27, 71);"></div></td></tr><tr><td aria-label="RGB (102, 0, 0)"><div title="RGB (102, 0, 0)" style="background-color: rgb(102, 0, 0);"></div></td><td aria-label="RGB (120, 63, 4)"><div title="RGB (120, 63, 4)" style="background-color: rgb(120, 63, 4);"></div></td><td aria-label="RGB (127, 96, 0)"><div title="RGB (127, 96, 0)" style="background-color: rgb(127, 96, 0);"></div></td><td aria-label="RGB (39, 78, 19)"><div title="RGB (39, 78, 19)" style="background-color: rgb(39, 78, 19);"></div></td><td aria-label="RGB (12, 52, 61)"><div title="RGB (12, 52, 61)" style="background-color: rgb(12, 52, 61);"></div></td><td aria-label="RGB (7, 55, 99)"><div title="RGB (7, 55, 99)" style="background-color: rgb(7, 55, 99);"></div></td><td aria-label="RGB (32, 18, 77)"><div title="RGB (32, 18, 77)" style="background-color: rgb(32, 18, 77);"></div></td><td aria-label="RGB (76, 17, 48)"><div title="RGB (76, 17, 48)" style="background-color: rgb(76, 17, 48);"></div></td></tr></tbody></table></div></div>',touchMode:false,keyPressed:null,events:["change"]};b.extend(true,this,d);this.localization=this.defaultLocalization;return d},createInstance:function(f){var j=this;j.textArea=j.host;var d=j.host.attr("contenteditable");j.host.addClass(j.toThemeProperty("jqx-widget"));if(d==true||d=="true"){j.inline=true;j.widget=j.host;j.editorDocument=document;j.selection=new a(j.editorDocument);var i=b("<div class='jqx-editor-toolbar-container' unselectable='on' aria-label='Formatting options' role='toolbar'><div class='jqx-editor-toolbar'></div>");i.insertBefore(j.host);j.toolbarContainer=i;j.toolbar=i.find(".jqx-editor-toolbar");j.editor=j.host;j.contentEditableElement=j.element}else{var g=b("<div class='jqx-editor'><div class='jqx-editor-container'><div class='jqx-editor-toolbar-container' aria-label='Formatting options' role='toolbar'><div class='jqx-editor-toolbar'></div></div><div class='jqx-editor-content'><iframe  src='javascript:\"<html></html>\"' allowtransparency='true' frameborder='0'></iframe></div></div></div>");j.widget=g;j.widget[0].className=j.widget[0].className+" "+j.element.className;try{j.widget[0].style=j.element.style}catch(e){}var h=b.trim(j.host.html())+"&#8203;";if(j.lineBreak=="default"||j.lineBreak=="div"){h="<div>"+h+"</div>"}else{if(j.lineBreak=="p"){h="<p>"+h+"</p>"}}h=h.replace(/&lt;/ig,"<");h=h.replace(/&gt;/ig,">");j.host.css("display","none");j.host.after(g);g.find("iframe").after(j.host);j.container=g.find(".jqx-editor-container");j.toolbarContainer=g.find(".jqx-editor-toolbar-container");j.toolbar=g.find(".jqx-editor-toolbar");j.iframe=g.find("iframe");j.content=g.find(".jqx-editor-content");var k=function(){j.editorDocument=j.iframe[0].contentWindow.document;j.selection=new a(j.editorDocument);var o=0;j.addHandler(j.iframe,"load",function(){o++;if(o>1){j.iframe.off("load");j.content.find("iframe").remove();var q=b("<iframe  src='javascript:\"<html></html>\"' allowtransparency='true' frameborder='0'></iframe>").appendTo(j.content);j.iframe=g.find("iframe");k()}});if(!b.jqx.browser.mozilla){j.editorDocument.designMode="On"}j.editorDocument.open();var m=j.rtl?"direction:rtl;":"";var l=b.jqx.browser.msie?"::selection{color: #fff; background: #328EFD;};::-moz-selection{color: #fff; background: #328eD;};::selection:window-inactive {background: #c7c7c7; color: #000;}::-moz-selection:window-inactive {background: #c7c7c7; color: #000;}html{font-size:13px; height:100%;}body{padding-top:1px;margin-top:-1px; padding-right: 1px; overflow-x: hidden;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;":"";j.editorDocument.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0; margin:0; font-size: 13px; font-family:Verdana,Geneva,sans-serif; background:#fff; min-height:100%; "+m+"}"+l+"}h1{font-size:2em;margin:.67em 0}h2{font-size: 1.5em; margin: .75em 0}h3{font-size: 1.17em; margin: .83em 0}h4{font-size:1em; margin: 1.12em 0 }h5{font-size: .83em; margin: 1.5em 0}h6{font-size: .75em; margin: 1.67em 0}p{margin: 0px;padding:0 .2em}ul,ol{padding-left:2.5em}a{color:#00a}code{font-size:1.23em}.jqx-editor-paste-element {position: absolute; left: -1000px; height: 1px; overflow: hidden; top: -1000px;}.jqx-editor-focus {border: 1px solid #aaa !important;}</style>"+b.map(j.stylesheets,function(q){return"<link rel='stylesheet' href='"+q+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>");j.contentEditableElement=j.editorDocument.body;if(j.host.is("textarea")){j._textArea=j.element;var n=j.host.data();n.jqxEditor.host=g;n.jqxEditor.element=g[0];j.element=g[0];g[0].id=j._textArea.id;j._textArea.id=j._textArea.id+"TextArea";b(j.element).addClass(j.toThemeProperty("jqx-widget"));j.host=b(j.element);j.host.data(n)}else{var n=j.host.data();n.jqxEditor.host=g;n.jqxEditor.element=g[0];j.element=g[0];j.host=b(j.element);j.host.data(n)}try{j.editorDocument.execCommand("useCSS",false,false);j.editorDocument.execCommand("enableInlineTableEditing",null,false)}catch(p){}try{j.editorDocument.execCommand("styleWithCSS",0,true)}catch(p){}j.editorDocument.close();j.editor=b(j.editorDocument.body);j.editor.html(h).attr("spellcheck",false).attr("autocorrect","off")};k();b.jqx.utilities.resize(j.host,function(){j.widget.css("width",j.width);j.widget.css("height",j.height);j._arrange()})}},focus:function(){var e=this;if(b.jqx.browser.mozilla){if(!e.focused){if(e.iframe){e.iframe.focus()}e.selection.selectNode(e.editor[0].firstChild,true);e.selection.getRange().collapse(true)}}e.editor.focus();var d=e.range!=null?e.range:e.getRange();e.selectRange(d)},print:function(){var d=window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes");d.document.open();d.document.write('<!doctype html><html><head><title>Print</title></head><body onload="print();">'+this.val()+"</body></html>");d.document.close()},refresh:function(d){var m=this;b.each(this.defaultLocalization,function(i,r){if(!m.localization[i]){m.localization[i]=r}});m._removeHandlers();m.toolbar.addClass(m.toThemeProperty("jqx-widget-header"));if(m.content){m.widget.css("width",m.width);m.widget.css("height",m.height);m.widget.addClass(m.toThemeProperty("jqx-editor"));m.widget.addClass(m.toThemeProperty("jqx-widget"));m.widget.addClass(m.toThemeProperty("jqx-rc-all"));m.widget.addClass(m.toThemeProperty("jqx-widget-header"));m.content.addClass(m.toThemeProperty("jqx-widget-content"));m.container.addClass(m.toThemeProperty("jqx-editor-container"))}else{m.toolbarContainer.addClass(m.toThemeProperty("jqx-widget-header"));m.toolbarContainer.addClass(m.toThemeProperty("jqx-editor-toolbar-inline"));m.toolbarContainer.addClass(m.toThemeProperty("jqx-widget"));m.toolbarContainer.addClass(m.toThemeProperty("jqx-rc-all"));m.toolbarContainer.hide();m.toolbarContainer.css("position","absolute");m.editor.addClass(m.toThemeProperty("jqx-editor-inline"));m.toolbarContainer.css("width",m.host.outerWidth()+"px")}var n=m.toolbarContainer.index();if(m.toolbarPosition=="top"&&n!=0||m.toolbarPosition=="bottom"&&n!=1){switch(m.toolbarPosition){case"bottom":m.toolbarContainer.insertAfter(m.content);break;case"top":default:m.toolbarContainer.insertBefore(m.content);break}}var h=m.tools;if(h!==false){var l=h.split(" ");var p=h.split(" | ");var q=function(i,r){b.each(r,function(y,F){var u=m.commands[this];if(!u){if(m.createCommand){u=m.createCommand(this.toString());if(!u){return true}if(!m.commands[this]){m.commands[this]=u}}else{return true}}else{if(m.createCommand){var x=m.createCommand(this.toString());u=b.extend(u,x)}}if(m.localization[this]){u.tooltip=m.localization[this]}switch(u.type){case"list":if(u.widget){u.widget.jqxDropDownList("destroy")}var A=function(R,Q,S){if(u.command=="formatblock"){return"<"+S+' unselectable="on" style="padding: 0px; margin: 0px;">'+Q+"</"+S+">"}else{if(u.command=="fontname"){return'<span unselectable="on" style="font-family: '+S+';">'+Q+"<span>"}else{if(u.command=="fontsize"){return'<span unselectable="on" style="font-size: '+S+';">'+Q+"<span>"}}}};var t=function(){var Q=m.toThemeProperty("jqx-editor-toolbar-icon")+" "+m.toThemeProperty("jqx-editor-toolbar-icon-"+u.command);var R="<div unselectable='on' style='margin-top: 0px; padding:0px;' class='"+Q+"'></div>";return R};var C=u.command=="formatblock"||u.command=="fontname"||u.command=="fontsize";var z=u.value||[];var N=new Array();var J=u.placeHolder||"Please Choose:";if(u.command=="fontname"){b.each(z,function(){var Q=m.localization[this.label];N.push({label:Q,value:this.value})})}else{if(u.command=="formatblock"){J=m.localization.format;b.each(z,function(){if(this.label.indexOf("Header")>=0){var Q=this.label.replace("Header",m.localization.Header)}else{var Q=m.localization[this.label]}N.push({label:Q,value:this.value})})}else{N=z}}var P={enableBrowserBoundsDetection:true,touchMode:m.touchMode,width:u.width||100,height:u.height||25,dropDownWidth:u.dropDownWidth||"auto",autoDropDownHeight:(u.value&&u.value.length)<12?true:false,placeHolder:J,source:N,theme:m.theme,keyboardSelection:false,focusable:false,disabled:m.disabled,rtl:m.rtl,selectionRenderer:u.command=="fontsize"?t:null,renderer:C?A:null};var D="jqx-disableselect "+m.toThemeProperty("jqx-editor-dropdownlist")+" "+m.toThemeProperty("jqx-editor-toolbar-item");var w=b("<div unselectable='on' class='"+D+"'></div>");w.appendTo(i);w.jqxDropDownList(P);if(u.init){u.init(w)}var F=null;var E=null;var K="";m.addHandler(w,"mousedown",function(R){if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){var Q=b(".jqx-editor-dropdownlist");b.each(Q,function(S,T){if(T!=w[0]){b(T).jqxDropDownList("close")}})}});m.addHandler(w,"open",function(Q){if(!m.focused){m.focus()}m.updating=true;m.activeElement=w;F=w.val();K=""});m.addHandler(w,"change",function(Q){m.updating=false;m.activeElement=null;E=w.val();K=Q.args.type;if(b.jqx.browser.msie&&b.jqx.browser.version<9){m.focus()}});m.addHandler(w,"close",function(Q){m.updating=false;m.activeElement=null;if(F!=E){if(K=="mouse"||K=="keyboard"){m._refreshTools()}}});m._addCommandHandler(w,"change",u.command,null,u);break;case"colorPicker":if(u.widget){b(u.colorPicker).remove();u.widget.jqxDropDownButton("destroy")}var B=b('<div unselectable="on" style="padding-top: 4px;"></div>').attr("id","picker-"+u.command);var D="jqx-disableselect "+m.toThemeProperty("jqx-editor-dropdownpicker")+" "+m.toThemeProperty("jqx-editor-toolbar-item");var w=b("<div unselectable='on' class='"+D+"'></div>");w.appendTo(i);w.append(B);w.jqxDropDownButton({touchMode:m.touchMode,disabled:m.disabled,enableBrowserBoundsDetection:true,width:u.width||45,height:u.height||25,rtl:m.rtl,focusable:false,theme:m.theme});var I=b('<div unselectable="on" style="z-index: 55;">');var s=m.toThemeProperty("jqx-editor-toolbar-icon")+" "+m.toThemeProperty("jqx-editor-toolbar-icon-"+u.command);var O=b("<div unselectable='on' class='"+s+"'></div>");I.append(O);var L=b('<div unselectable="on" class="jqx-editor-color-bar">').attr("id","bar-"+u.command).css("background-color",u.value);I.append(L);w.jqxDropDownButton("setContent",I);B.append(b(m.colorPickerTemplate));u.colorPicker=B;if(u.init){u.init(w)}B.find("tr").attr("role","row").attr("unselectable","on");B.find("td").attr("role","gridcell").attr("unselectable","on").css("-webkit-user-select","none");B.find("div").attr("unselectable","on");m.addHandler(w,"mousedown",function(R){if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}if(b(".jqx-editor-dropdownpicker").length>0){var Q=b(".jqx-editor-dropdownpicker");b.each(Q,function(S,T){if(T!=w[0]){b(T).jqxDropDownButton("close")}})}});m.addHandler(w,"open",function(){if(!m.focused){m.focus()}m.updating=true;m.activeElement=B});m.addHandler(w,"close",function(Q){m.updating=false;m.activeElement=null;if(F!=E){if(K=="mouse"||K=="keyboard"){m._refreshTools()}}});m.addHandler(B,"keydown",function(Q){var Y=Q.keyCode;var V=b(B).find(".jqx-editor-color-picker-selected-cell");var aa=B.find("tr");var T=aa.length;var S=V.parent().children().length;var U=V.index();var W=-999;var Z=V.parent();b.each(aa,function(ab,ac){if(this==Z[0]){W=ab;return false}});switch(Y){case 27:w.jqxDropDownButton("close");break;case 13:b(V).trigger("mousedown");break;case 38:W--;break;case 40:W++;break;case 39:U++;break;case 37:U--;break}if(W>=0&&W<=T){if(U>=0&&U<=S){var Z=B.find("tr")[W];var X=b(Z).children()[U];var R=b(X).children().css("background-color");u.val(R)}}});var M=b(B).find("td");u.val=function(Q){var R=m._rgbToHex(Q);b.each(M,function(){var S=b(this).children().css("background-color");var T=m._rgbToHex(S);if(T==R){M.removeClass("jqx-editor-color-picker-selected-cell");b(this).addClass("jqx-editor-color-picker-selected-cell");b("#bar-"+u.command).css("background",S);return false}})};u.val(u.value);m._addCommandHandler(M,"mousedown",u.command,null,u);break;case"button":case"toggleButton":default:if(u.widget){if(u.type=="button"){u.widget.jqxButton("destroy")}else{u.widget.jqxToggleButton("destroy")}}var v=u.command;var H=u.action;var s=m.toThemeProperty("jqx-editor-toolbar-icon")+" "+m.toThemeProperty("jqx-editor-toolbar-icon-"+v);var O=b("<div unselectable='on' class='"+s+"'></div>");var w=b("<div unselectable='on'></div>").addClass("jqx-disableselect").addClass(m.toThemeProperty("jqx-editor-toolbar-button"));if(!u.init){w.append(O)}else{if(v){w.append(O)}}w.appendTo(i);if(u.type=="button"){w.jqxButton({disabled:m.disabled,rtl:m.rtl,theme:m.theme})}else{if(u.type=="toggleButton"){w.jqxToggleButton({disabled:m.disabled,rtl:m.rtl,uiToggle:false,theme:m.theme})}}if(u.init){u.init(w)}u.toggled=false;u.toggle=function(){u.toggled=!u.toggled};m.addHandler(w,"mousedown",function(Q){if(Q.preventDefault){Q.preventDefault()}if(Q.stopPropagation){Q.stopPropagation()}return false});if(!b.jqx.mobile.isTouchDevice()){m._addCommandHandler(w,"click",v,H,u)}else{m._addCommandHandler(w,"mousedown",v,H,u)}break}u.widget=w;if(w){try{if(u.tooltip!=""){u.widget.attr("title",u.tooltip);u.widget.attr("data-tooltip",u.tooltip)}if(u.command){u.widget.attr("data-command",u.command)}u.widget.attr("aria-label",u.tooltip)}catch(G){}if(u.type=="button"||u.type=="toggleButton"){if(r.length>2){if(y==0){w.css("border-right-radius","0px");w.addClass(m.toThemeProperty("jqx-rc-l"))}else{if(y==r.length-1){w.css("border-left-radius","0px");w.addClass(m.toThemeProperty("jqx-rc-r"))}}w.removeClass(m.toThemeProperty("jqx-rc-all"))}if(y!=0&&y!=r.length-1&&r.length>2){w.css("border-left-radius","0px");w.css("border-right-radius","0px");w.removeClass(m.toThemeProperty("jqx-rc-all"))}else{if(r.length==2){if(y==0){w.css("border-right-radius","0px");w.addClass(m.toThemeProperty("jqx-rc-l"))}else{w.css("border-left-radius","0px");w.addClass(m.toThemeProperty("jqx-rc-r"))}w.removeClass(m.toThemeProperty("jqx-rc-all"))}else{if(r.length==1){w.css("margin-right","0px")}}}}}})};m.toolbar.css("direction",!this.rtl?"ltr":"rtl");if(p.length==0){q(m.toolbar,l)}else{for(var j=0;j<p.length;j++){var f=p[j];var l=f.split(" ");var o=m.toThemeProperty("jqx-editor-toolbar-group")+" "+m.toThemeProperty("jqx-fill-state-normal");var k=b("<div class='"+o+"'></div>");k.addClass(m.toThemeProperty("jqx-rc-all"));m.toolbar.append(k);q(k,l)}var g=m.toolbar.find(".jqx-editor-toolbar-group");var e=g.length;for(var j=0;j<e;j++){if(b(g[j]).children().length==0){b(g[j]).remove()}}}if(b.jqx.browser.msie&&b.jqx.browser.version<8){b(".jqx-editor-toolbar-group").css("float","left");b(".jqx-editor-toolbar-group").children().css("float","left");b(".jqx-editor-toolbar-group").css("zoom","1");b(".jqx-editor-toolbar-group").children().css("zoom","1")}}m._arrange();m._addHandlers()},_arrange:function(){var d=this;if(d.content){if(d.tools==""||d.tools==false){d.content.height(d.container.outerHeight()-parseInt(d.container.css("padding-top"))-parseInt(d.container.css("padding-bottom"))-6);d.content.css("margin-top","4px");d.toolbar.hide()}else{d.toolbar.show();d.content.css("margin-top","0px");d.content.height(d.container.outerHeight()-d.toolbar.outerHeight()-parseInt(d.container.css("padding-top"))-parseInt(d.container.css("padding-bottom"))-2);if(d.toolbarPosition!="top"){d.content.css("margin-top","4px");d.content.css("margin-bottom","0px")}}if(b.jqx.browser.msie&&b.jqx.browser.version<8){d.content.css("margin-top","4px");d.content.height(d.container.height()-d.toolbar.outerHeight()-2*parseInt(d.container.css("padding-bottom"))-10);d.content.width(d.container.width()-2*parseInt(d.container.css("padding-left"))-2)}if(d.editor.height()<d.content.height()){d.editor.height(d.content.height())}}},propertyChangedHandler:function(d,e,h,g){var f=d;if(f.isInitialized==undefined||f.isInitialized==false){return}if(e=="pasteMode"||e=="lineBreak"||e=="editable"){return}if(e=="disabled"){d._refreshTools()}if(e=="width"||e=="height"||e=="toolbarPosition"){d._arrange();return}d.refresh()},selectRange:function(d){var e=this;if(!d){d=e.getRange()}e.selection.selectRange(d)},getRange:function(){var d=this;return d.selection.getRange()},getSelectedElement:function(){var h,k,d,g;var i=this;try{if(i.editorDocument.getSelection){var l=i.editorDocument.getSelection();h=l.getRangeAt(l.rangeCount-1);d=h.startContainer;g=h.endContainer;k=h.commonAncestorContainer;if(d.nodeName=="#text"){k=k.parentNode}if(d.nodeName=="#text"){d=d.parentNode}if(d.nodeName.toLowerCase()=="body"){d=d.firstChild}if(g.nodeName=="#text"){g=g.parentNode}if(g.nodeName.toLowerCase()=="body"){g=g.lastChild}if(d==g){k=d}return g}else{if(i.editorDocument.selection){h=i.editorDocument.selection.createRange();if(!h.duplicate){return null}k=h.parentElement();var f=h.duplicate();var e=h.duplicate();f.collapse(true);e.moveToElementText(f.parentElement());e.setEndPoint("EndToStart",f);d=f.parentElement();f=h.duplicate();e=h.duplicate();e.collapse(false);f.moveToElementText(e.parentElement());f.setEndPoint("StartToEnd",e);g=e.parentElement();if(d.nodeName.toLowerCase()=="body"){d=d.firstChild}if(g.nodeName.toLowerCase()=="body"){g=g.lastChild}if(d==g){k=d}return g}}}catch(j){return null}return null},_addHandlers:function(){var e=this;e.addHandler(e.toolbar,"mousedown.editor"+e.element.id,function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false});var f=function(){if(e._textArea){if(!e.updating){e._textArea.value=e.val()}}if(e.changed){e._raiseEvent("change");e.changed=false}e.focused=false;if(e.inline){e.host.removeClass(e.toThemeProperty("jqx-fill-state-focus"));e.host.removeClass(e.toThemeProperty("jqx-editor-inline-focus"));if(e.tools==""||e.tools==null){return}e.toolbarContainer.fadeOut("fast")}};var d=function(){e.focused=true;if(e.inline){e.host.addClass(e.toThemeProperty("jqx-fill-state-focus"));e.host.addClass(e.toThemeProperty("jqx-editor-inline-focus"));e.host.addClass(e.toThemeProperty("jqx-rc-all"));if(e.tools==""||e.tools==null){return}e.toolbarContainer.fadeIn("fast");var g=e.host.coord();if(e.toolbarPosition!="bottom"){e.toolbarContainer.offset({left:g.left,top:g.top-e.toolbarContainer.outerHeight()-5})}else{e.toolbarContainer.offset({left:g.left,top:g.top+5+e.host.height()})}}};if(b.jqx.browser.mozilla){this.addHandler(b(document),"mousedown.editor"+e.element.id,function(g){f()})}e.addHandler(e.editor,"blur.editor"+e.element.id,function(g){f()});e.addHandler(e.editor,"focus.editor"+e.element.id,function(g){d()});e.addHandler(e.editor,"beforedeactivate.editor"+e.element.id,function(g){e.range=e.getRange()});e.addHandler(e.editor,"mousedown.editor"+e.element.id,function(g){e.range=e.getRange();if(b.jqx.browser.mozilla){d();g.stopPropagation()}if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}if(e.inline){e.editor.focus()}});if(b.jqx.mobile.isTouchDevice()){e.addHandler(b(e.editorDocument),"selectionchange.editor"+e.element.id,function(){if(e.editorDocument.activeElement!=e.editor[0]){setTimeout(function(){if(e.iframe){e.iframe[0].contentWindow.focus()}},500)}});e.addHandler(b(e.editorDocument),"touchstart.editor"+e.element.id,function(){setTimeout(function(){if(e.iframe){e.iframe[0].contentWindow.focus()}},500)})}e.addHandler(e.editor,"mouseup.editor"+e.element.id,function(g){if(e._documentMode=="source"){return true}e.range=e.getRange();e._refreshTools(null,true)});e.addHandler(e.editor,"keydown.editor"+e.element.id,function(g){if(e.keyPressed){e.keyPressed(g)}if(e._documentMode=="source"){return true}if(b.jqx.browser.mozilla){if(!e.focused){d()}}if(e.disabled){if(g.preventDefault){g.preventDefault()}return false}if(e.updating){if(e.activeElement){var m=b.Event("keydown");b.extend(m,g);e.activeElement.trigger(m)}if(g.preventDefault){g.preventDefault()}return false}var n=g||window.event;var q=n.keyCode;var r=String.fromCharCode(q).toLowerCase();if(!e.editable){var l=[9,33,34,35,36,37,38,39,40,40,45];if(b.inArray(n.keyCode,l)==-1&&!(n.ctrlKey&&r=="c")&&!(n.ctrlKey&&r=="a")){g.preventDefault()}}if(e.selection.getText().length>0||e.linkPopup){var l=[8,9,13,33,34,35,36,37,38,39,40,40,45,46];if(!b.inArray(n.keyCode,l)!=-1||(n.keyCode==65&&n.ctrlKey&&!n.altKey&&!n.shiftKey)){if(e._refreshToolsTimer){clearTimeout(e._refreshToolsTimer)}e._refreshToolsTimer=setTimeout(function(){e._refreshTools(null,true,n.keyCode)},10)}}if(q==13&&e.lineBreak!="default"){var k=e.getSelectedElement();if(k){var o=k.nodeName.toLowerCase();switch(o){case"pre":case"li":case"ul":case"ol":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return true}var p=k;while(p!=null){if(p.nodeName=="#document"){p=e.editorDocument.body;break}if(p.parentNode==e.editorDocument.body||p==e.editorDocument.body){break}p=p.parentNode}}if(p){var j=e.getRange();if(e.editorDocument.body.innerHTML=="<div></div>"&&e.lineBreak!="br"){e.selection.insertContent("&#8203;")}if(e.lineBreak=="div"){if(p==e.editorDocument.body){b(p).append("<div>&#8203;</div><span id='INSERTION_MARKER'>&nbsp;</span>")}else{b("<div>&#8203;</div><span id='INSERTION_MARKER'>&nbsp;</span>").insertAfter(p)}}else{if(e.lineBreak=="p"){if(p==e.editorDocument.body){b(p).append("<p>&#8203;</p><span id='INSERTION_MARKER'>&nbsp;</span>")}else{b("<p>&#8203;</p><span id='INSERTION_MARKER'>&nbsp;</span>").insertAfter(p)}}else{e.execute("insertHTML","<br/>&#8203;<span id='INSERTION_MARKER'>&nbsp;</span>")}}e.selectRange(j);var i=b(e.editorDocument).find("#INSERTION_MARKER");if(e.lineBreak!="br"){e.selection.selectNode(b(i).prev()[0],true)}else{e.selection.selectNode(i[0],true);if(e.getRange().setStartAfter){e.getRange().setStartAfter(i[0])}}i.remove();e.selection.collapse(false);if(p&&p.nodeName&&e.lineBreak=="br"){if(p.nodeName.toLowerCase()!="#text"){e.selection.selectNode(p,true);if(e.getRange().setStartAfter){e.getRange().setStartAfter(p)}e.selection.collapse(false)}}if(e.lineBreak!="br"){j=e.getRange();if(j.select){j.select()}}if(g.preventDefault){g.preventDefault()}return false}}if(n.ctrlKey&&(r=="k"||r=="u"||r=="b"||r=="i")){if(g.preventDefault){g.preventDefault()}var h=null;switch(r){case"k":h="link";break;case"u":h="underline";break;case"b":h="bold";break;case"i":h="italic";break}if(e.commands[h].widget){e.commands[h].widget.trigger("click")}return false}});e.addHandler(e.editor,"paste.editor"+e.element.id,function(l){if(e._documentMode=="source"){return true}if(e.readOnly){return true}e.updating=true;e.readOnly=true;var m=l;var k=function(q,p){if(p){if(!e.paragraphise){q=q.replace(/\n/g,"<br />")}else{q="<p>"+q+"</p>";q=q.replace(/\n/g,"</p><p>");q=q.replace(/<p>\s<\/p>/gi,"")}}else{q=q.replace(/<html[^>]*?>(.*)/gim,"$1");q=q.replace(/<\/html>/gi,"");q=q.replace(/<body[^>]*?>(.*)/gi,"$1");q=q.replace(/<\/body>/gi,"");q=q.replace(/<style[^>]*?>[\s\S]*?<\/style[^>]*>/gi,"");q=q.replace(/<(?:meta|link)[^>]*>\s*/gi,"");q=q.replace(/<\\?\?xml[^>]*>/gi,"");q=q.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,"");q=q.replace(/<o:p>\s*<\/o:p>/g,"");q=q.replace(/<o:p>[\s\S]*?<\/o:p>/g,"&nbsp;");q=q.replace(/<\/?\w+:[^>]*>/gi,"");q=q.replace(/<\!--[\s\S]*?-->/g,"");q=q.replace(/<\!\[[\s\S]*?\]>/g,"");q=q.replace(/\s*mso-[^:]+:[^;"']+;?/gi,"");q=q.replace(/<(\w[^>]*) style='([^\']*)'([^>]*)/gim,"<$1$3");q=q.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gim,"<$1$3");q=q.replace(/\s*margin: 0cm 0cm 0pt\s*;/gi,"");q=q.replace(/\s*margin: 0cm 0cm 0pt\s*"/gi,'"');q=q.replace(/\s*text-indent: 0cm\s*;/gi,"");q=q.replace(/\s*text-indent: 0cm\s*"/gi,'"');q=q.replace(/\s*text-align: [^\s;]+;?"/gi,'"');q=q.replace(/\s*page-break-before: [^\s;]+;?"/gi,'"');q=q.replace(/\s*font-variant: [^\s;]+;?"/gi,'"');q=q.replace(/\s*tab-stops:[^;"']*;?/gi,"");q=q.replace(/\s*tab-stops:[^"']*/gi,"");q=q.replace(/\s*face="[^"']*"/gi,"");q=q.replace(/\s*face=[^ >]*/gi,"");q=q.replace(/\s*font-family:[^;"']*;?/gi,"");q=q.replace(/\s*font-size:[^;"']*;?/gi,"");q=q.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");q=q.replace(/<(\w+)[^>]*\sstyle="[^"']*display\s?:\s?none[\s \S]*?<\/\1>/ig,"");q=q.replace(/\s*style='\s*'/gi,"");q=q.replace(/\s*style="\s*"/gi,"");q=q.replace(/<span\s*[^>]*>\s*&nbsp;\s*<\/span>/gi,"&nbsp;");q=q.replace(/<span\s*[^>]*><\/span>/gi,"");q=q.replace(/<(\w[^>]*) align=([^ |>]*)([^>]*)/gi,"<$1$3");q=q.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");q=q.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,"$2");q=q.replace(/<font\s*>([\s\S]*?)<\/font>/gi,"$1");q=q.replace(/<(u|i|strike)>&nbsp;<\/\1>/gi,"&nbsp;");q=q.replace(/<h\d>\s*<\/h\d>/gi,"");q=q.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");q=q.replace(/<(\w[^>]*) onmouseover="([^\"']*)"([^>]*)/gi,"<$1$3");q=q.replace(/<(\w[^>]*) onmouseout="([^\"']*)"([^>]*)/gi,"<$1$3");q=q.replace(/<h(\d)([^>]*)>/gi,"<h$1>");q=q.replace(/<(h\d)><font[^>]*>([\s\S]*?)<\/font><\/\1>/gi,"<$1>$2</$1>");q=q.replace(/<(h\d)><em>([\s\S]*?)<\/em><\/\1>/gi,"<$1>$2</$1>");q=q.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/gi,"<strong>$1</strong>");q=q.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/gi,"<em>$1</em>");q=q.replace(/<\s+[^>]*>/gi,"");q=q.replace(/<span>([\s\S]*?)<\/span>/gi,"$1");q=q.replace(/<span>([\s\S]*?)<\/span>/gi,"$1");q=q.replace(/<div>([\s\S]*?)<\/div>/gi,"$1");q=q.replace(/<div>([\s\S]*?)<\/div>/gi,"$1");q=q.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");q=q.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");q=q.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");if(q.trim){q=q.trim()}if(!e.paragraphise){q.replace(/<p>/gi,"<br />");q.replace(/<\/p>/gi,"")}else{var o=q.substr(0,2);if("<p"!==o){q="<p>"+q+"</p>";q=q.replace(/\n/g,"</p><p>");q=q.replace(/<br[^>]*>/gi,"</p><p>")}}q=q.replace(/<br>/gi,"<br />");q=q.replace(/<br[^>]*><\/p>/gim,"</p>");q=q.replace(/<p>&nbsp;<\/p>/gi,"");q=q.replace(/<p>\s<\/p>/gi,"");q=q.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,"");q=q.replace(/MsoNormal/gi,"");q=q.replace(/<\/?meta[^>]*>/gi,"");q=q.replace(/<\/?xml[^>]*>/gi,"");q=q.replace(/<\?xml[^>]*\/>/gi,"");q=q.replace(/<!--(.*)-->/gi,"");q=q.replace(/<!--(.*)>/gi,"");q=q.replace(/<!(.*)-->/gi,"");q=q.replace(/<w:[^>]*>(.*)<\/w:[^>]*>/gi,"");q=q.replace(/<w:[^>]*\/>/gi,"");q=q.replace(/<\/?w:[^>]*>/gi,"");q=q.replace(/<m:[^>]*\/>/gi,"");q=q.replace(/<m:[^>]>(.*)<\/m:[^>]*>/gi,"");q=q.replace(/<o:[^>]*>(.*)<\/o:[^>]*>/gi,"");q=q.replace(/<o:[^>]*\/>/gi,"");q=q.replace(/<\/?m:[^>]*>/gi,"");q=q.replace(/style=\"([^>]*)\"/gi,"");q=q.replace(/style=\'([^>]*)\'/gi,"");q=q.replace(/class=\"(.*)\"/gi,"");q=q.replace(/class=\'(.*)\'/gi,"");q=q.replace(/<b>/gi,"<strong>");q=q.replace(/<\/b>/gi,"</strong>");q=q.replace(/<p[^>]*>/gi,"<p>");q=q.replace(/<\/p[^>]*>/gi,"</p>");q=q.replace(/<span[^>]*>/gi,"");q=q.replace(/<\/span[^>]*>/gi,"");q=q.replace(/<st1:[^>]*>/gi,"");q=q.replace(/<\/st1:[^>]*>/gi,"");q=q.replace(/<font[^>]*>/gi,"");q=q.replace(/<\/font[^>]*>/gi,"");q=q.replace("  ","");q=q.replace(/<strong><\/strong>/gi,"");q=q.replace(/<p><\/p>/gi,"");q=q.replace(/\/\*(.*)\*\//gi,"");q=q.replace(/<!--/gi,"");q=q.replace(/-->/gi,"");q=q.replace(/<style[^>]*>[^<]*<\/style[^>]*>/gi,"");q=q.trim()}return q};var n=e.getRange();if(e.pasteMode=="text"){e.selection.insertContent('<textarea cols="50" contenteditable="false" class="jqx-editor-paste-element"></textarea>')}else{e.selection.insertContent('<div class="jqx-editor-paste-element">&nbsp;</div>')}var g=b(window).scrollTop();var h=b(e.editorDocument).find(".jqx-editor-paste-element");h.css("top",g+"px");if(e.editor[0].createTextRange){l.preventDefault();var j=e.editor[0].createTextRange();j.moveToElementText(h[0]);j.execCommand("Paste")}else{var i=e.editorDocument.createRange();i.selectNodeContents(h[0]);e.selectRange(i)}if(e.pasteMode=="text"){h.select()}e.marker=h;setTimeout(function(){e.selectRange(n);var r=function(A){var y=e.editorDocument.createElement("div");var z=e.editorDocument.createDocumentFragment();y.innerHTML=A;while(y.firstChild){z.appendChild(y.firstChild)}return z};if(e.pasteMode!="text"){var x=r(e.marker.html());if(x.firstChild&&x.firstChild.className==="jqx-editor-paste-element"){var p=[];for(var u=0,s=x.childNodes.length;u<s;u++){p.push(x.childNodes[u].innerHTML)}x=r(p.join("<br />"))}var o=document.createElement("div");o.appendChild(x.cloneNode(true));var w=o.innerHTML}else{var w=e.marker.val();if(e.marker.html()!=""&&e.marker.val().indexOf("\n")==-1){var w=e.marker.html();w=w.replace(/&nbsp;/gm,"");w=w.replace(/\n\n/gm,"\n");w=w.replace(/<br[^>]*>/gi,"\n");e.marker.html(w);var w=e.marker.text()}}var q=k(w,e.pasteMode=="text");var v=e.getRange();e.selection.insertContent(q+"<span id='INSERTION_MARKER'>&nbsp;</span>");e.marker.remove();var t=b(e.editorDocument).find("#INSERTION_MARKER");e.selection.selectNode(t[0],true);if(e.getRange().setStartAfter){e.getRange().setStartAfter(t[0])}t.remove();e.selection.collapse(false);t.removeAttr("id");e._refreshTools();e.changed=true},100);e.updating=false;e.readOnly=false});e.addHandler(e.editor,"keyup.editor"+e.element.id,function(i){if(e._documentMode=="source"){return true}if(e.updating||e.disabled||!e.editable){if(i.preventDefault){i.preventDefault()}if(i.stopPropagation){i.stopPropagation()}return false}e.range=e.getRange();e.changed=true;var h=i||window.event;var g=h.keyCode;var j=[8,9,13,33,34,35,36,37,38,39,40,40,45,46];if(b.inArray(h.keyCode,j)!=-1||(h.keyCode==65&&h.ctrlKey&&!h.altKey&&!h.shiftKey)){e._refreshTools(null,true,h.keyCode)}});e.addHandler(e.editor,"click.editor"+e.element.id,function(g){if(e._documentMode=="source"){return true}if(e.editImage){b(e.editImage).removeClass("jqx-editor-focus");e.editImage=null}if(g.target.tagName.toLowerCase()=="img"){var h=g.target;e.editImage=h;b(e.editImage).addClass("jqx-editor-focus")}});e.addHandler(e.editor,"dblclick.editor"+e.element.id,function(g){if(e._documentMode=="source"){return true}if(g.target.tagName.toLowerCase()=="img"){var h=g.target;if(b(".jqx-editor-image-window").length>0){e.editImage=h;e._updateImageWindow()}}})},_updateLinkWindow:function(){var g=this;var i=b(".jqx-editor-link-window");i.jqxWindow({position:{center:g.widget}});i.jqxWindow("open");var e=i.find("input");var h=i.find(".jqx-editor-link-checkbox");var f=i.find("button:first");var d=b(i.find("button")[1]);if(g.editLink&&g.editLink.href){e[0].value=g.editLink.href||"";e[1].value=b(g.editLink).text()||g.editLink.href;h.val(b(g.editLink).attr("target")=="_blank");d.show()}else{e[0].value="";e[1].value="";if(!g.selection.isCollapsed()){var j=g.selection.getText();if(j.match(/^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$/i)){e[0].value=j}else{e[1].value=j}}h.val(false);d.hide()}if(e[0].value.length>0){f.jqxButton({disabled:false})}else{f.jqxButton({disabled:true})}},_updateImageWindow:function(){var g=this;var i=g.editImage;if(!i){i=b("<img>")[0]}var h=b(".jqx-editor-image-window");h.jqxWindow({position:{center:g.widget}});h.jqxWindow("open");var e=h.find("input");var d=b(h.find("button")[1]);if(g.editImage){d.show()}else{d.hide()}e[0].value=i.src;if(e[0].value==""){e[0].value=""}e[1].value=i.alt;if(i.style.width!="auto"){e[2].value=i.style.width}else{e[2].value=""}if(i.style.height!="auto"){e[3].value=i.style.height}else{e[3].value=""}if(i.style.marginLeft&&i.style.marginLeft!="0px"){e[4].value=i.style.marginLeft}else{e[4].value=""}if(i.style.marginTop&&i.style.marginTop!="0px"){e[5].value=i.style.marginTop}else{e[5].value=""}var j=h.find(".jqx-editor-align");var f=b(i).css("float");if(f=="left"){j.jqxDropDownList({selectedIndex:1})}else{if(f=="right"){j.jqxDropDownList({selectedIndex:2})}else{j.jqxDropDownList({selectedIndex:0})}}},_removeHandlers:function(){var d=this;if(d.editor){d.removeHandler(d.editor,"blur.editor"+d.element.id);d.removeHandler(d.editor,"focus.editor"+d.element.id);d.removeHandler(d.editor,"click.editor"+d.element.id);d.removeHandler(d.editor,"mousedown.editor"+d.element.id);d.removeHandler(d.editor,"mouseup.editor"+d.element.id);d.removeHandler(d.editor,"keyup.editor"+d.element.id);d.removeHandler(d.editor,"keydown.editor"+d.element.id);d.removeHandler(d.editor,"beforedeactivate.editor"+d.element.id);d.removeHandler(d.editor,"dblclick.editor"+d.element.id)}if(d.toolbar){d.removeHandler(d.toolbar,"mousedown.editor"+d.element.id)}},getParentByTag:function(e,d){var d=d.toLowerCase(),f=e;do{if(d==""||f.nodeName.toLowerCase()==d){return f}}while(f=f.parentNode);return e},isStyleProperty:function(g,f,j,i){var f=f.toLowerCase(),h=g;do{if(h.nodeName.toLowerCase()==f&&h.style[j]==i){return !0}}while(h=h.parentNode);return !1},setStyleProperty:function(e,d){this.style[d]=!1;var f=this.getParentByTag(e,d);f&&f.tagName.toLowerCase()==d&&(this.style[d]=!0);if(d=="del"&&this.getParentByTag(e,"strike")&&this.getParentByTag(e,"strike").tagName.toLowerCase()=="strike"){this.style.del=!0}},updateStyle:function(f){var g=this;var f=g.getSelectedElement()?g.getSelectedElement():f;if(!f||!g.setStyleProperty){return}try{if(window.getComputedStyle){if(f.nodeName.toLowerCase()=="#text"){f=g.editor[0]}var d=window.getComputedStyle(f,null);var i=((d.getPropertyValue("font-weight")==401)?700:d.getPropertyValue("font-weight"));g.style={fontStyle:d.getPropertyValue("font-style"),fontSize:d.getPropertyValue("font-size"),textDecoration:d.getPropertyValue("text-decoration"),fontWeight:i,fontFamily:d.getPropertyValue("font-family"),textAlign:d.getPropertyValue("text-align"),color:g._rgbToHex(d.color),backColor:g._rgbToHex(d.backgroundColor)};g.style.fontStyle=d.getPropertyValue("font-style");g.style.vAlign=d.getPropertyValue("vertical-align");g.style.del=g.isStyleProperty(f,"span","textDecoration","line-through");g.style.u=g.isStyleProperty(f,"span","textDecoration","underline");var h=function(l){var k="transparent";var e="rgba(0, 0, 0, 0)";while(l&&(window.getComputedStyle(l).backgroundColor==k||window.getComputedStyle(l).backgroundColor==e)){l=l.parentNode}return l?window.getComputedStyle(l).backgroundColor:k};if(!g.style.backColor){g.style.backColor=g._rgbToHex(h(f))}}else{var d=f.currentStyle;g.style={fontStyle:d.fontStyle,fontSize:d.fontSize,textDecoration:d.textDecoration,fontWeight:d.fontWeight,fontFamily:d.fontFamily,textAlign:d.textAlign,color:g._rgbToHex(d.color),backColor:g._rgbToHex(d.backgroundColor)}}g.setStyleProperty(f,"h1");g.setStyleProperty(f,"h2");g.setStyleProperty(f,"h3");g.setStyleProperty(f,"h4");g.setStyleProperty(f,"h5");g.setStyleProperty(f,"h6");g.setStyleProperty(f,"del");g.setStyleProperty(f,"sub");g.setStyleProperty(f,"sup");g.setStyleProperty(f,"u");if(f.nodeName.toLowerCase()=="a"){if(g.style.textDecoration=="underline"){g.style.u=true}}if(g.style.h1||g.style.h2||g.style.h3||g.style.h4||g.style.h5||g.style.h6){g.style.heading=true}}catch(j){return null}},_refreshTools:function(e,f,n){var k=this;if(k.updating){return}var e=k.getSelectedElement()?k.getSelectedElement():e;if(!e||!k.setStyleProperty){return}k.updateStyle(e);var o=k.readOnly;k.readOnly=true;if(k.tools!==false){var j=k.tools.split(" ");var l=k.tools.split(" | ");var m=function(i){b.each(i,function(q,r){var p=k.commands[this];if(!p){return true}switch(p.type){case"list":p.widget.jqxDropDownList("clearSelection");p.widget.jqxDropDownList({disabled:k.disabled});break;case"colorPicker":p.val(p.value);p.widget.jqxDropDownButton({disabled:k.disabled});break;case"toggleButton":p.widget.jqxToggleButton("unCheck");p.widget.jqxToggleButton({disabled:k.disabled});break;case"button":default:p.widget.jqxButton({disabled:k.disabled});break}})};if(l.length==0){m(j)}else{for(var h=0;h<l.length;h++){var d=l[h];var j=d.split(" ");m(j)}}if(k.style){var g=function(i){b.each(i,function(x,E){var t=k.commands[this];if(!t){return true}if(t.refresh){t.refresh(t.widget,k.style);return true}switch(t.type){case"list":if(t.command=="fontname"){var B=-1;var D=999;for(var H=0;H<t.value.length;H++){var E=t.value[H].label.toLowerCase();var w=k.style.fontFamily.toLowerCase().indexOf(E);if(w>=0){if(w<D){B=H}D=Math.min(D,w)}}t.widget.jqxDropDownList("selectIndex",B)}else{if(t.command=="formatblock"){var E=null;if(k.style.h1){E="h1"}else{if(k.style.h2){E="h2"}else{if(k.style.h3){E="h3"}else{if(k.style.h4){E="h4"}else{if(k.style.h5){E="h5"}else{if(k.style.h6){E="h6"}}}}}}t.widget.jqxDropDownList("selectItem",E)}else{if(t.command=="fontsize"){var A="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");var C=-1;try{var C=e.getAttribute("size")-1;if(C==-1){C=k.editorDocument.queryCommandValue(t.command)-1}}catch(I){}var s=A[C];t.widget.val(s)}}}break;case"colorPicker":var r=function(J){if(typeof J!="number"){return J}return"rgb("+(J&255)+", "+((J&65280)>>8)+", "+((J&16711680)>>16)+")"};var F=r(k.editorDocument.queryCommandValue(t.command));if(t.command=="backcolor"){if(k.style.backColor==null){F="#FFFFFF"}}var z=k._rgbToHex(F);if(z){t.val(z)}else{if(t.command=="forecolor"){t.val(k.style.color)}else{if(t.command=="backcolor"){t.val(k.style.backColor)}}}break;case"toggleButton":if(t.command=="viewsource"){return}if(!t.command){return}var q=false;var p=k.editorDocument.queryCommandState(t.command)&&k.editorDocument.queryCommandEnabled(t.command);if(t.command=="createlink"&&e.nodeName.toLowerCase()=="a"){var y=true;if(b(e).text().indexOf(k.selection.getText())==-1&&k.selection.getText()!=""){y=false}if(y){if(k.linkPopup){k.linkPopup.remove()}p=true;k.linkPopup=b("<div class='jqx-editor-link-popup' contentEditable='false' style='overflow: hidden; white-space: nowrap; padding: 5px; height: 17px; font-size: 12px; color: #222222; background: #F5F5F5; position: absolute; z-index: 9999;'>"+k.localization["Go to link"]+": <a target='_blank' style='color:#222222;' href='"+e.href+"'>"+e.href+"</a> - <a style='color:#222222;' href='#change'>"+k.localization.Change+"</a> - <a style='color:#222222;' href='#remove'>"+k.localization.Remove+"</a></div>").appendTo(k.editor);var u=b(e).coord();var v=u.left;if(u.left+k.linkPopup.width()>k.editor.width()){v=k.editor.width()-k.linkPopup.width()-15}k.linkPopup.offset({top:b(e).height()+u.top+5,left:v});k.addHandler(k.linkPopup,"mousedown",function(K){if(K.target&&K.target.href){var J=b(K.target).index();switch(J){case 1:k.editor.focus();k.selection.selectNode(e,true);k.commands.link.widget.trigger("click");break;case 2:try{k.editor.focus();k.selection.selectNode(e);k.execute("unlink");k.commands.underline.toggled=false;k.selection.collapse(false);k._refreshTools()}catch(L){}break;default:window.open(K.target.href,"_blank");break}}if(K.preventDefault){K.preventDefault()}if(K.stopPropagation){K.stopPropagation()}return false})}}if(t.command=="bold"){if(k.style.fontWeight&&(k.style.fontWeight>=600||k.style.fontWeight=="bold")){q=true}if(k.selection.isCollapsed()){t.toggled=p}else{t.toggled=p||q}p=t.toggled}else{if(t.command=="italic"){if(k.style.fontStyle&&k.style.fontStyle=="italic"){q=true}if(!f){p=t.toggled}else{t.toggled=p}}else{if(t.command=="underline"){if(k.style.u){q=true}if(!f){p=t.toggled}else{t.toggled=p}}else{if(t.command=="justifyleft"){if(k.style.textAlign=="left"){q=true}}else{if(t.command=="justifyright"){if(k.style.textAlign=="right"){q=true}}else{if(t.command=="justifycenter"){if(k.style.textAlign=="center"){q=true}}else{if(t.command=="justifyfull"){if(k.style.textAlign=="justify"){q=true}}else{b.each(k.style,function(J,K){if(t.command==J.toLowerCase()){q=true}})}}}}}}}var G=p;if(q&&t.command.indexOf("justify")!=-1){t.widget.jqxToggleButton("check")}else{if(G){t.widget.jqxToggleButton("check")}else{if(q&&k.range.collapsed===false){t.widget.jqxToggleButton("check")}else{if(b.jqx.browser.msie&&b.jqx.browser.version<9&&q&&!k.selection.isCollapsed()){t.widget.jqxToggleButton("check")}}}}break;case"button":default:if(t.refresh){t.refresh(t.widget,k.style)}break}})};if(l.length==0){g(j)}else{for(var h=0;h<l.length;h++){var d=l[h];var j=d.split(" ");g(j)}}}}k.readOnly=o},_rgbToHex:function(e){if(e){if(e.substr(0,1)==="#"){if(e.length==4){var h=e.substr(1,1);var f=e.substr(2,1);var d=e.substr(3,1);return"#"+h+h+f+f+d+d}return e}var i=/(.*?)rgb\((\d+),\s*(\d+),\s*(\d+)\)/i.exec(e);if(!i){return null}var h=parseInt(i[2],10).toString(16);var f=parseInt(i[3],10).toString(16);var d=parseInt(i[4],10).toString(16);return"#"+((h.length==1?"0"+h:h)+(f.length==1?"0"+f:f)+(d.length==1?"0"+d:d))}return null},_preventDefault:function(d,e){if(e!==false){if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}}if(d.preventDefault){d.preventDefault()}if(d.stopPropagation){d.stopPropagation()}d.cancelBubble=true;d.returnValue=false},_addCommandHandler:function(g,f,i,h,d){var e=this;if(!i&&d.init){i="custom"}switch(i){case"custom":switch(d.type){case"list":action=function(j){if(e._documentMode!="source"){if(j.args.type!="none"){d.value=b(this).val();e.execute("custom",d);if(!e.readOnly){e._refreshTools()}}}e._preventDefault(j,false)};break;case"colorPicker":action=function(l){if(e._documentMode!="source"){var j=b(d.colorPicker).find("td").removeClass("jqx-editor-color-picker-selected-cell");if(l.target.nodeName.toLowerCase()=="div"){var k=b(l.target).css("background-color");b(l.target).parent().addClass("jqx-editor-color-picker-selected-cell")}else{var k=b(l.target).find("div").css("background-color");b(l.target).addClass("jqx-editor-color-picker-selected-cell")}b("#bar-"+i).css("background",k);d.widget.val=function(){var n=function(p){if(typeof p!="number"){return p}return"rgb("+(p&255)+", "+((p&65280)>>8)+", "+((p&16711680)>>16)+")"};var o=n(k);var m=e._rgbToHex(o);return m};d.widget.jqxDropDownButton("close");e.execute("custom",d)}e._preventDefault(l);return false};break;case"button":case"toggleButton":default:action=function(j){if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}e._preventDefault(j);var l=b(this).attr("data-command");var k=this;if(e._documentMode!="source"){if(d.toggle){d.toggle()}e.execute("custom",d);e._refreshTools()}return false};break}break;case"formatblock":action=function(j){if(e._documentMode!="source"){if(j.args.type!="none"){e.execute(b(this).attr("data-command"),"<"+b(this).val()+">",d);if(!e.readOnly){e.commands.bold.toggled=false;e._refreshTools()}}}e._preventDefault(j,false)};break;case"fontsize":action=function(j){if(e._documentMode!="source"){if(j.args.type!="none"){var l=b(this).val();var m="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");var k=b(this).jqxDropDownList("getSelectedIndex")+1;var k=1+m.indexOf(l);e.execute(b(this).attr("data-command"),k,d)}}e._preventDefault(j,false)};break;case"fontname":action=function(j){if(e._documentMode!="source"){if(j.args.type!="none"){var k=b(this).val();e.execute(b(this).attr("data-command"),k,d)}}e._preventDefault(j,false)};break;case"forecolor":case"backcolor":action=function(l){if(e._documentMode!="source"){var j=b(d.colorPicker).find("td").removeClass("jqx-editor-color-picker-selected-cell");if(l.target.nodeName.toLowerCase()=="div"){var k=b(l.target).css("background-color");b(l.target).parent().addClass("jqx-editor-color-picker-selected-cell")}else{var k=b(l.target).find("div").css("background-color");b(l.target).addClass("jqx-editor-color-picker-selected-cell")}b("#bar-"+i).css("background",k);d.widget.jqxDropDownButton("close");e.execute(i,k,d)}e._preventDefault(l);return false};break;case"viewsource":action=function(j){if(e.linkPopup){e.linkPopup.remove()}d.toggle();e.setMode(d.toggled);if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}e._preventDefault(j);return false};break;case"insertimage":action=function(j){e._insertImageAction(j,e,d)};break;case"createlink":action=function(j){e._createLinkAction(j,e,d)};break;default:action=function(j){if(b(".jqx-editor-dropdownpicker").length>0){b(".jqx-editor-dropdownpicker").jqxDropDownButton("close")}if(b(".jqx-editor-dropdownlist").length>0){b(".jqx-editor-dropdownlist").jqxDropDownList("close")}e._preventDefault(j);var m=b(this).attr("data-command");var k=this;if(e._documentMode!="source"){if(m=="underline"){if(e.getSelectedElement()){var l=e.getSelectedElement();if(l&&l.nodeName.toLowerCase()=="a"){if(d.toggled){b(l).css("text-decoration","none")}else{b(l).css("text-decoration","underline")}d.toggle();e._refreshTools();return false}}}if(d.toggle){d.toggle()}e.execute(m,b(this).val(),d);e._refreshTools()}return false};break}e.addHandler(g,f,action);return false},_createLinkAction:function(d,k,l){var k=this;if(k._documentMode=="source"){k._preventDefault(d);return}if(!k.focused){k.editor.focus()}k.range=k.getRange();var e=k.getSelectedElement();if(e.nodeName.toLowerCase()=="a"){k.editLink=e}else{k.editLink=null}if(b(".jqx-editor-link-window").length>0){if(k.editLink){k.selection.selectNode(e,true)}k._updateLinkWindow();k._preventDefault(d);return false}var m=b("<div class='jqx-editor-window jqx-editor-link-window'><div>"+k.localization["Insert Link"]+"</div><div><table style='border-collapse: separate; border-spacing: 2px;'><tr><td align='right'>"+k.localization.URL+":</td><td><input style='width: 200px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+k.localization.Title+":</td><td><input style='width: 200px; height: 23px;' value=''/></td><tr/><tr><td align='right'></td><td><div class='jqx-editor-link-checkbox'>"+k.localization["Open in a new window/tab"]+"</div></td><tr/><tr><td align='right'></td><td align='right'><button>Ok</button><button style='margin-left: 5px;'>Remove</button><button style='margin-left: 5px;'>Cancel</button></td><tr/></table></div></div>");m[0].id="linkWindow"+this.element.id;var j=m.find("input");j.addClass(k.toThemeProperty("jqx-widget"));j.addClass(k.toThemeProperty("jqx-widget-content"));j.addClass(k.toThemeProperty("jqx-input"));var i=m.find(".jqx-editor-link-checkbox").jqxCheckBox({theme:k.theme,height:23,width:180});var g=m.find("button:first").jqxButton({theme:k.theme,disabled:true});var o=b(m.find("button")[1]).jqxButton({theme:k.theme});var h=m.find("button:last").jqxButton({theme:k.theme});g.val(k.localization.Ok);h.val(k.localization.Cancel);o.val(k.localization.Remove);k.addHandler(h,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(p){k.editor.focus();k.selectRange(k.range);k._refreshTools();k._preventDefault(p)});if(!k.editLink||(k.editLink&&!k.editLink.href)){o.hide()}var f=false;k.addHandler(b(j[0]),"focus",function(){if(j[1].value==""||j[1].value==j[0].value){f=true}else{f=false}});k.addHandler(b(j[1]),"keyup",function(p){if(p.keyCode){if(p.keyCode==13){g.trigger("click")}if(p.keyCode==27){h.trigger("click")}}});k.addHandler(b(j[0]),"keyup change",function(p){if(j[0].value.length>0){g.jqxButton({disabled:false})}else{g.jqxButton({disabled:true})}if(f){j[1].value=j[0].value}if(p.keyCode){if(p.keyCode==13){g.trigger("click")}if(p.keyCode==27){h.trigger("click")}}});k.addHandler(o,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(p){m.jqxWindow("close");try{k.editor.focus();k.selection.selectNode(k.editLink);k.execute("unlink");k.selection.collapse(false);k.commands.underline.toggled=false;k._refreshTools()}catch(q){}k._preventDefault(p)});k.addHandler(g,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(s){var q=m.find("input");var r=b("<a>"+(q[1].value||q[0].value)+"</a>");if(i.val()){r.attr("target","_blank")}r[0].href=b.trim(q[0].value);if(q[0].value.indexOf("http")==-1&&q[0].value.indexOf("mailto")==-1){r[0].href="http://"+b.trim(q[0].value)}if(!k.focused){k.editor.focus()}if(k.range){k.selectRange(k.range)}if(k.editLink){b(k.editLink).remove()}k.execute("insertHTML",""+r[0].outerHTML+"<span id='INSERTION_MARKER'>&nbsp;</span>",l);k.editor.focus();var p=b(k.editorDocument).find("#INSERTION_MARKER");k.selection.selectNode(p[0],true);if(k.getRange().setStartAfter){k.getRange().setStartAfter(p[0])}p.remove();k.selection.collapse(false);k._refreshTools();k._preventDefault(s)});k.updating=true;m.appendTo(document.body);k.addHandler(m,"open",function(){k.updating=true;setTimeout(function(){k.range=k.getRange();b(j[0]).focus()},25)});m.jqxWindow({resizable:false,width:280,okButton:g,cancelButton:h,theme:k.theme,isModal:true,position:{center:k.widget}});k.addHandler(m,"close",function(){k.updating=false});if(!k.focused){k.editor.focus();k.selectRange(k.range)}if(k.editLink){j[0].value=k.editLink.href||"";j[1].value=b(k.editLink).text();i.val(b(k.editLink).attr("target")=="_blank")}else{if(!k.selection.isCollapsed()){var n=k.selection.getText();if(n.match(/^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$/i)){j[0].value=n}else{j[1].value=n}}}if(j[0].value.length>0){g.jqxButton({disabled:false})}else{g.jqxButton({disabled:true})}k._preventDefault(d);return false},_insertImageAction:function(j,i,g){if(i._documentMode=="source"){i._preventDefault(j);return}if(!i.focused){i.editor.focus()}i.range=i.getRange();if(b(".jqx-editor-image-window").length>0){i._updateImageWindow();i._preventDefault(j);return false}var h=b("<div class='jqx-editor-window jqx-editor-image-window'><div>"+i.localization["Insert Image"]+"</div><div><table style='border-collapse: separate; border-spacing: 2px;'><tr><td align='right'>"+i.localization.URL+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+i.localization["Alt Text"]+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+i.localization.Width+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+i.localization.Height+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+i.localization.HSpace+":</td><td><input style='width: 180px; height: 23px;' class='jqx-editor-hspace'/></td><tr/><tr><td align='right'>"+i.localization.VSpace+":</td><td><input style='width: 180px; height: 23px;' class='jqx-editor-vspace'/></td><tr/><tr><td align='right'>"+i.localization.Align+":</td><td><div class='jqx-editor-align'></div></td><tr/><tr><td align='right'></td><td align='right'><button>Ok</button><button style='margin-left: 5px;'>Remove</button><button style='margin-left: 5px;'>Cancel</button></td><tr/></table></div></div>");h[0].id="imageWindow"+this.element.id;var e=h.find("input");e.addClass(i.toThemeProperty("jqx-widget"));e.addClass(i.toThemeProperty("jqx-widget-content"));e.addClass(i.toThemeProperty("jqx-input"));h.find(".jqx-editor-align").jqxDropDownList({autoDropDownHeight:true,selectedIndex:0,theme:i.theme,height:23,width:180,source:[i.localization["not set"],i.localization.Left,i.localization.Right]});var f=h.find("button:first").jqxButton({theme:i.theme});var k=h.find("button:last").jqxButton({theme:i.theme});var d=b(h.find("button")[1]).jqxButton({theme:i.theme});f.val(i.localization.Ok);k.val(i.localization.Cancel);d.val(i.localization.Remove);d.hide();i.addHandler(d,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(l){b(i.editImage).removeClass("jqx-editor-focus");b(i.editImage).remove();i.editImage=null;i._preventDefault(l);h.jqxWindow("close");i._raiseEvent("change")});i.addHandler(k,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(l){b(i.editImage).removeClass("jqx-editor-focus");i.editImage=null;i._preventDefault(l)});i.addHandler(f,!b.jqx.mobile.isTouchDevice()?"click":b.jqx.mobile.getTouchEventName("touchstart"),function(o){b(i.editImage).removeClass("jqx-editor-focus");var m=h.find("input");var p=i.editImage?b(i.editImage):b('<img style="border: 1px solid transparent;">');var n=p.attr("src",m[0].value).attr("unselectable","on");if(m[1].value){n.attr("alt",m[1].value).attr("title",m[1].value)}if(m[2].value&&!isNaN(parseInt(m[2].value))){n.width(m[2].value)}else{n.css("width","auto")}if(m[3].value&&!isNaN(parseInt(m[3].value))){n.height(m[3].value)}else{n.css("height","auto")}if(m[4].value){if(m[4].value.toString()=="auto"){n.css("margin-left","auto");n.css("margin-right","auto")}else{if(m[4].value.toString().indexOf("%")!=-1){n.css("margin-left",parseInt(m[4].value)+"%");n.css("margin-right",parseInt(m[4].value)+"%")}else{n.css("margin-left",parseInt(m[4].value)+"px");n.css("margin-right",parseInt(m[4].value)+"px")}}}else{n.css("margin-left","0px");n.css("margin-right","0px")}if(m[5].value){if(m[5].value.toString()=="auto"){n.css("margin-top","auto");n.css("margin-bottom","auto")}else{if(m[5].value.toString().indexOf("%")!=-1){n.css("margin-top",parseInt(m[5].value)+"%");n.css("margin-bottom",parseInt(m[5].value)+"%")}else{n.css("margin-top",parseInt(m[5].value)+"px");n.css("margin-bottom",parseInt(m[5].value)+"px")}}}else{n.css("margin-top","0px");n.css("margin-bottom","0px")}var q=h.find(".jqx-editor-align").jqxDropDownList("selectedIndex");if(q==1){n.css("float","left")}else{if(q==2){n.css("float","right")}else{if(q==0){n.css("float","none")}}}n.css("resize",false);n[0].oncontrolselect=function(){return false};n[0].selectstart=function(){return false};if(!i.editImage){if(!i.focused){i.editor.focus()}if(i.range){i.selectRange(i.range)}i.execute("insertHTML",n[0].outerHTML+"<span id='INSERTION_MARKER'>&nbsp;</span>",g);i.editor.focus();var l=b(i.editorDocument).find("#INSERTION_MARKER");i.selection.selectNode(l[0],true);if(i.getRange().setStartAfter){i.getRange().setStartAfter(l[0])}l.remove();i.selection.collapse(false);i._refreshTools();i._preventDefault(o)}i.editImage=null;i._preventDefault(o)});h.appendTo(document.body);i.updating=true;i.addHandler(h,"open",function(){i.updating=true;setTimeout(function(){i.range=i.getRange();b(e[0]).focus()},25)});h.jqxWindow({resizable:false,width:280,okButton:f,cancelButton:k,theme:i.theme,isModal:true,position:{center:i.widget}});i.addHandler(h,"close",function(){i.updating=false});if(!i.focused){i.editor.focus();i.selectRange(i.range)}i._preventDefault(j);return false},editmode:function(f){var e=this;if(!f&&!e.readOnly){e._removeHandlers();e.editor.attr("contentEditable",false);var d=document.createTextNode(e.editor.html());var g=b("<pre>");g.html(d).attr({id:"sourceText",contentEditable:true}).css("height","100%");e.editor.html(g);if(e.buttons.hasOwnProperty("html")){e.buttons.html.addClass("active")}g.focus()}else{if(f&&e.readOnly){var d=e.editor.find("#sourceText").text();e.editor.html(d);if(e.buttons.hasOwnProperty("html")){e.buttons.html.removeClass("active")}e.editor.attr("contentEditable",true);e._addHandlers()}}e.readOnly=!f},setMode:function(f){var i=this;if(!i.range){i.editor.focus();i.range=i.getRange()}var h;var e=i.editor[0];if(f){i._documentMode="source";var k=new c();var j=k.HTMLtoXML(e.innerHTML);j=k.FormatHTML(j);h=document.createTextNode(j);e.innerHTML="";var d=document.createElement("pre");e.contentEditable=false;d.style.height="100%";d.style.margin="0px";d.style.outline="none";d.style.display="block";d.id="sourceText";d.contentEditable=true;d.appendChild(h);e.appendChild(d);this.readOnly=true}else{this._documentMode="html";if(document.all){e.innerHTML=e.innerText}else{if(e.textContent){e.innerHTML=e.textContent}else{h=document.createRange();h.selectNodeContents(e.firstChild);e.innerHTML=h.toString()}}e.contentEditable=true;i.readOnly=false;i._refreshTools();i.editor.focus();i.selection.selectNode(i.editor[0]);i.editor.scrollTop(0);i.selection.collapse(true)}b.each(this.commands,function(){if(this.widget){if(this.command!="viewsource"){switch(this.type){case"list":this.widget.jqxDropDownList({disabled:f});break;case"colorPicker":this.widget.jqxDropDownButton({disabled:f});break;case"button":this.widget.jqxButton({disabled:f});break;case"toggleButton":this.widget.jqxToggleButton({toggled:false,disabled:f});break}}}});i.editor.focus();if(b.jqx.browser.mozilla){var g=b("<a href='#'>anchor</a>");i.editor.prepend(g);g.focus();g.remove();i.selection.collapse(true)}if(i.commands.html.widget){i.commands.html.widget.jqxToggleButton({toggled:f=="source"||f==true});i.commands.html.toggled=f=="source"||f==true}},execute:function(i,f,e){var g=this;if(!g.readOnly){var j=g.editorDocument;if(g._documentMode=="source"){return}if(g.linkPopup){g.linkPopup.remove()}g.editor.focus();if(b.jqx.browser.mozilla){}if(b.jqx.mobile.isTouchDevice()){setTimeout(function(){},25)}var d=function(m){try{if(m.command&&m.command.toLowerCase()=="inserthtml"){var l=g.getRange();var n=m.value;if(n.toString().indexOf("<")==-1){n="<span>"+m.value+"</span>"}g.selection.insertContent(""+n+"<span id='INSERTION_MARKER'>&nbsp;</span>");g.selectRange(l);setTimeout(function(){var p=b(g.editorDocument).find("#INSERTION_MARKER");g.selection.selectNode(b(p).prev()[0],true);p.remove();g.selection.collapse(false)},10)}else{if(m.command){if(j.queryCommandEnabled(m.command)){j.execCommand(m.command,false,m.value)}else{return false}}else{if(j.queryCommandEnabled(m)){j.execCommand(m,false,m)}else{return false}}}}catch(o){}};if(i=="custom"){var h=f.action(f.widget,g.editor);if(h){d(h)}}else{try{if(e&&e.action){var h=e.action(e.widget,g.editor);d(h)}else{if(j.queryCommandEnabled(i)){j.execCommand(i,false,f)}else{if(i=="insertHTML"){g.selection.insertContent(f)}else{return false}}}}catch(k){if(i=="insertHTML"){g.selection.insertContent(f)}else{return false}}}if(b.jqx.mobile.isTouchDevice()){setTimeout(function(){if(g.iframe){g.iframe[0].contentWindow.focus()}},500)}g._raiseEvent("change",{command:i,args:f});g.changed=true;g.range=g.getRange()}},destroy:function(){var h=this;h._removeHandlers();var l=h.tools.split(" ");var g=h.tools.split(" | ");var f=function(i){b.each(i,function(n,o){var m=h.commands[this];if(!m){return true}switch(m.type){case"list":m.widget.jqxDropDownList("destroy");break;case"colorPicker":m.colorPicker.remove();m.widget.jqxDropDownButton("destroy");break;case"toggleButton":m.widget.jqxToggleButton("destroy");break;case"custom":if(h.destroyTool){h.destroyTool(this)}break;case"button":default:m.widget.jqxToggleButton("destroy");if(m.command==="insertimage"){if(b("#imageWindow"+h.element.id).length>0){b("#imageWindow"+h.element.id).find(".jqx-editor-align").jqxDropDownList("destroy");b("#imageWindow"+h.element.id).find("button").jqxButton("destroy")}}else{if(m.command==="createlink"){if(b("#linkWindow"+h.element.id).length>0){b("#linkWindow"+h.element.id).find(".jqx-editor-align").jqxDropDownList("destroy");b("#linkWindow"+h.element.id).find("button").jqxButton("destroy");b("#linkWindow"+h.element.id).find(".jqx-editor-link-checkbox").jqxCheckBox("destroy")}}}break}})};if(g.length==0){f(l)}else{for(var e=0;e<g.length;e++){var d=g[e];var l=d.split(" ");f(l)}}var j=b(".jqx-editor-link-window");var k=b(".jqx-editor-image-window");if(j&&j.length>0){j.jqxWindow("destroy")}if(k&&k.length>0){k.jqxWindow("destroy")}if(h.inline){h.toolbar.remove()}else{h.widget.remove();h.host.remove()}h.iframe.remove();h.iframe=null;h.selection=null;h.editorDocument=null;h.contentEditableElement=null},val:function(d){if(d!=undefined&&typeof d!="object"){this.editor.html(d)}return this.editor.html()},_raiseEvent:function(h,e){if(e==undefined){e={owner:null}}if(this._documentMode=="source"){return true}var f=h;args=e;args.owner=this;var g=new b.Event(f);g.owner=this;g.args=args;if(this._textArea){var d=b(this._textArea).trigger(g)}else{var d=this.host.trigger(g)}e=g.args;return d}});var a=function(d){var e={initialize:function(f){this.document=f},getSelection:function(){return(this.document.getSelection)?this.document.getSelection():this.document.selection},getRange:function(){var f=this.getSelection();if(!f){return null}try{return f.rangeCount>0?f.getRangeAt(0):(this.document.createRange?this.document.createRange():this.document.selection.createRange())}catch(g){return this.document.body.createTextRange()}},selectRange:function(f){if(f.select){f.select()}else{var g=this.getSelection();if(g.addRange){g.removeAllRanges();g.addRange(f)}}},selectNode:function(i,j){var h=this.getRange();var g=this.getSelection();if(h.moveToElementText){h.moveToElementText(i);h.select()}else{if(g.addRange){try{j?h.selectNodeContents(i):h.selectNode(i);g.removeAllRanges();g.addRange(h)}catch(f){var k=f}}else{g.setBaseAndExtent(i,0,i,1)}}return i},isCollapsed:function(){var f=this.getRange();if(f.item){return false}return f.boundingWidth==0||this.getSelection().isCollapsed},collapse:function(f){var h=this.getRange();var g=this.getSelection();if(h.select){h.collapse(f);h.select()}else{f?g.collapseToStart():g.collapseToEnd()}},getContent:function(){var h=this.getRange();var f=b("<div>")[0];if(this.isCollapsed()){return""}if(h.cloneContents){f.appendChild(h.cloneContents())}else{if(h.item!=undefined||h.htmlText!=undefined){b(f).html(h.item?h.item(0).outerHTML:h.htmlText)}else{b(f).html(h.toString())}}var g=b(f).html();return g},getText:function(){var g=this.getRange();var f=this.getSelection();return this.isCollapsed()?"":g.text||(f.toString?f.toString():"")},getNode:function(){var g=this.getRange();if(!b.jqx.browser.msie||b.jqx.browser.version>=9){var f=null;if(g){f=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.startOffset-g.endOffset<2){if(g.startContainer.hasChildNodes()){f=g.startContainer.childNodes[g.startOffset]}}}}while(typeof(f)!="element"){f=f.parentNode}}return d.id(f)}return d.id(g.item?g.item(0):g.parentElement())},insertContent:function(i){var h=this.getRange();if(h.pasteHTML){h.pasteHTML(i);h.collapse(false);h.select()}else{if(h.insertNode){h.deleteContents();if(h.createContextualFragment){h.insertNode(h.createContextualFragment(i))}else{var j=this.document;var g=j.createDocumentFragment();var f=j.createElement("div");g.appendChild(f);f.outerHTML=i;h.insertNode(g)}}}}};e.initialize(d);return e};var c=function(){var n=/^<([-A-Za-z0-9_]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,f=/^<\/([-A-Za-z0-9_]+)[^>]*>/,j=/([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;var i=e("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");var d=e("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");var l=e("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");var g=e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var m=e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");var k=e("script,style");var h=this.HTMLParser=function(p,x){var s,t,q,u=[],v=p;u.last=function(){return this[this.length-1]};while(p){t=true;if(!u.last()||!k[u.last()]){if(p.indexOf("<!--")==0){s=p.indexOf("-->");if(s>=0){if(x.comment){x.comment(p.substring(4,s))}p=p.substring(s+3);t=false}}else{if(p.indexOf("</")==0){q=p.match(f);if(q){p=p.substring(q[0].length);q[0].replace(f,r);t=false}}else{if(p.indexOf("<")==0){q=p.match(n);if(q){p=p.substring(q[0].length);q[0].replace(n,o);t=false}}}}if(t){s=p.indexOf("<");var w=s<0?p:p.substring(0,s);p=s<0?"":p.substring(s);if(x.chars){x.chars(w)}}}else{p=p.replace(new RegExp("(.*)</"+u.last()+"[^>]*>"),function(y,z){z=z.replace(/<!--(.*?)-->/g,"$1").replace(/<!\[CDATA\[(.*?)]]>/g,"$1");if(x.chars){x.chars(z)}return""});r("",u.last())}v=p}r();function o(y,B,C,z){B=B.toLowerCase();if(d[B]){while(u.last()&&l[u.last()]){r("",u.last())}}if(g[B]&&u.last()==B){r("",B)}z=i[B]||!!z;if(!z){u.push(B)}if(x.start){var A=[];C.replace(j,function(E,D){var F=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:m[D]?D:"";A.push({name:D,value:F,escaped:F.replace(/(^|[^\\])"/g,'$1\\"')})});if(x.start){x.start(B,A,z)}}}function r(y,A){if(!A){var B=0}else{for(var B=u.length-1;B>=0;B--){if(u[B].toLowerCase()==A.toLowerCase()){break}}}if(B>=0){for(var z=u.length-1;z>=B;z--){if(x.end){x.end(u[z])}}u.length=B}}};this.HTMLtoXML=function(p){var o="";p=p.replace(/\r/ig,"");p=p.replace(/\n/ig,"");h(p,{start:function(q,s,r){o+="<"+q;for(var t=0;t<s.length;t++){o+=" "+s[t].name+'="'+s[t].escaped+'"'}o+=(r?"/":"")+">"},end:function(q){o+="</"+q+">\r\n"},chars:function(q){o+=q},comment:function(q){o+="<!--"+q+"-->"}});return o};this.FormatHTML=function(D,r){var H,C,A,u,v,G;r=r||{};C=r.indent_size||4;A=r.indent_char||" ";v=r.brace_style||"collapse";u=Infinity;G=r.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"];function q(){this.pos=0;this.token="";this.current_mode="CONTENT";this.tags={parent:"parent1",parentcount:1,parent1:""};this.tag_type="";this.token_text=this.last_token=this.last_text=this.token_type="";this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(J,t){for(var I=0;I<t.length;I++){if(J===t[I]){return true}}return false}};this.get_content=function(){var t="",J=[],K=false;while(this.input.charAt(this.pos)!=="<"){if(this.pos>=this.input.length){return J.length?J.join(""):["","TK_EOF"]}t=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(t,this.Utils.whitespace)){if(J.length){K=true}this.line_char_count--;continue}else{if(K){if(this.line_char_count>=this.max_char){J.push("\n");for(var I=0;I<this.indent_level;I++){J.push(this.indent_string)}this.line_char_count=0}else{J.push(" ");this.line_char_count++}K=false}}J.push(t)}return J.length?J.join(""):""};this.get_contents_to=function(J){if(this.pos==this.input.length){return["","TK_EOF"]}var t="";var K="";var L=new RegExp("</"+J+"\\s*>","igm");L.lastIndex=this.pos;var I=L.exec(this.input);var M=I?I.index:this.input.length;if(this.pos<M){K=this.input.substring(this.pos,M);this.pos=M}return K};this.record_tag=function(t){if(this.tags[t+"count"]){this.tags[t+"count"]++;this.tags[t+this.tags[t+"count"]]=this.indent_level}else{this.tags[t+"count"]=1;this.tags[t+this.tags[t+"count"]]=this.indent_level}this.tags[t+this.tags[t+"count"]+"parent"]=this.tags.parent;this.tags.parent=t+this.tags[t+"count"]};this.retrieve_tag=function(t){if(this.tags[t+"count"]){var I=this.tags.parent;while(I){if(t+this.tags[t+"count"]===I){break}I=this.tags[I+"parent"]}if(I){this.indent_level=this.tags[t+this.tags[t+"count"]];this.tags.parent=this.tags[I+"parent"]}delete this.tags[t+this.tags[t+"count"]+"parent"];delete this.tags[t+this.tags[t+"count"]];if(this.tags[t+"count"]==1){delete this.tags[t+"count"]}else{this.tags[t+"count"]--}}};this.get_tag=function(){var K="",M=[],t=false,O,J;do{if(this.pos>=this.input.length){return M.length?M.join(""):["","TK_EOF"]}K=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(K,this.Utils.whitespace)){t=true;this.line_char_count--;continue}if(K==="'"||K==='"'){if(!M[1]||M[1]!=="!"){K+=this.get_unformatted(K);t=true}}if(K==="="){t=false}if(M.length&&M[M.length-1]!=="="&&K!==">"&&t){if(this.line_char_count>=this.max_char){this.print_newline(false,M);this.line_char_count=0}else{M.push(" ");this.line_char_count++}t=false}if(K==="<"){O=this.pos-1}M.push(K)}while(K!==">");var P=M.join("");var I;if(P.indexOf(" ")!=-1){I=P.indexOf(" ")}else{I=P.indexOf(">")}var N=P.substring(1,I).toLowerCase();if(P.charAt(P.length-2)==="/"||this.Utils.in_array(N,this.Utils.single_token)){this.tag_type="SINGLE"}else{if(N==="script"){this.record_tag(N);this.tag_type="SCRIPT"}else{if(N==="style"){this.record_tag(N);this.tag_type="STYLE"}else{if(this.Utils.in_array(N,G)){var L=this.get_unformatted("</"+N+">",P);M.push(L);if(O>0&&this.Utils.in_array(this.input.charAt(O-1),this.Utils.whitespace)){M.splice(0,0,this.input.charAt(O-1))}J=this.pos-1;if(this.Utils.in_array(this.input.charAt(J+1),this.Utils.whitespace)){M.push(this.input.charAt(J+1))}this.tag_type="SINGLE"}else{if(N.charAt(0)==="!"){if(N.indexOf("[if")!=-1){if(P.indexOf("!IE")!=-1){var L=this.get_unformatted("-->",P);M.push(L)}this.tag_type="START"}else{if(N.indexOf("[endif")!=-1){this.tag_type="END";this.unindent()}else{if(N.indexOf("[cdata[")!=-1){var L=this.get_unformatted("]]>",P);M.push(L);this.tag_type="SINGLE"}else{var L=this.get_unformatted("-->",P);M.push(L);this.tag_type="SINGLE"}}}}else{if(N.charAt(0)==="/"){this.retrieve_tag(N.substring(1));this.tag_type="END"}else{this.record_tag(N);this.tag_type="START"}if(this.Utils.in_array(N,this.Utils.extra_liners)){this.print_newline(true,this.output)}}}}}}return M.join("")};this.get_unformatted=function(I,J){if(J&&J.indexOf(I)!=-1){return""}var t="";var K="";var L=true;do{if(this.pos>=this.input.length){return K}t=this.input.charAt(this.pos);this.pos++;if(this.Utils.in_array(t,this.Utils.whitespace)){if(!L){this.line_char_count--;continue}if(t==="\n"||t==="\r"){K+="\n";this.line_char_count=0;continue}}K+=t;this.line_char_count++;L=true}while(K.indexOf(I)==-1);return K};this.get_token=function(){var t;if(this.last_token==="TK_TAG_SCRIPT"||this.last_token==="TK_TAG_STYLE"){var I=this.last_token.substr(7);t=this.get_contents_to(I);if(typeof t!=="string"){return t}return[t,"TK_"+I]}if(this.current_mode==="CONTENT"){t=this.get_content();if(typeof t!=="string"){return t}else{return[t,"TK_CONTENT"]}}if(this.current_mode==="TAG"){t=this.get_tag();if(typeof t!=="string"){return t}else{var J="TK_TAG_"+this.tag_type;return[t,J]}}};this.get_full_indent=function(t){t=this.indent_level+t||0;if(t<1){return""}return Array(t+1).join(this.indent_string)};this.printer=function(K,J,t,M,L){this.input=K||"";this.output=[];this.indent_character=J;this.indent_string="";this.indent_size=t;this.brace_style=L;this.indent_level=0;this.max_char=M;this.line_char_count=0;for(var I=0;I<this.indent_size;I++){this.indent_string+=this.indent_character}this.print_newline=function(P,N){this.line_char_count=0;if(!N||!N.length){return}if(!P){while(this.Utils.in_array(N[N.length-1],this.Utils.whitespace)){N.pop()}}N.push("\n");for(var O=0;O<this.indent_level;O++){N.push(this.indent_string)}};this.print_token=function(N){this.output.push(N)};this.indent=function(){this.indent_level++};this.unindent=function(){if(this.indent_level>0){this.indent_level--}}};return this}H=new q();H.printer(D,A,C,u,v);while(true){var w=H.get_token();H.token_text=w[0];H.token_type=w[1];if(H.token_type==="TK_EOF"){break}switch(H.token_type){case"TK_TAG_START":H.print_newline(false,H.output);H.print_token(H.token_text);H.indent();H.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":H.print_newline(false,H.output);H.print_token(H.token_text);H.current_mode="CONTENT";break;case"TK_TAG_END":if(H.last_token==="TK_CONTENT"&&H.last_text===""){var F=H.token_text.match(/\w+/)[0];var y=H.output[H.output.length-1].match(/<\s*(\w+)/);if(y===null||y[1]!==F){H.print_newline(true,H.output)}}H.print_token(H.token_text);H.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var o=H.token_text.match(/^\s*<([a-z]+)/i);if(!o||!H.Utils.in_array(o[1],G)){H.print_newline(false,H.output)}H.print_token(H.token_text);H.current_mode="CONTENT";break;case"TK_CONTENT":if(H.token_text!==""){H.print_token(H.token_text)}H.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(H.token_text!==""){H.output.push("\n");var x=H.token_text;if(r.indent_scripts=="keep"){var z=0}else{if(r.indent_scripts=="separate"){var z=-H.indent_level}else{var z=1}}var p=H.get_full_indent(z);var s=x.match(/^\s*/)[0];var B=s.match(/[^\n\r]*$/)[0].split(H.indent_string).length-1;var E=H.get_full_indent(z-B);x=x.replace(/^\s*/,p).replace(/\r\n|\r|\n/g,"\n"+E).replace(/\s*$/,"");if(x){H.print_token(x);H.print_newline(true,H.output)}}H.current_mode="TAG";break}H.last_token=H.token_type;H.last_text=H.token_text}return H.output.join("")};function e(r){var q={},o=r.split(",");for(var p=0;p<o.length;p++){q[o[p]]=true}return q}}})(jqxBaseFramework);
\ No newline at end of file
+*/
+!function(a){a.jqx.jqxWidget("jqxEditor","",{}),a.extend(a.jqx._jqxEditor.prototype,{defineInstance:function(){var b={width:null,height:null,disabled:!1,pasteMode:"html",editable:!0,lineBreak:"default",changeType:null,toolbarPosition:"top",fontFamily:"sans-serif",commands:{bold:{tooltip:"Bold",command:"bold",type:"toggleButton"},italic:{tooltip:"Italic",command:"italic",type:"toggleButton"},underline:{tooltip:"Underline",command:"underline",type:"toggleButton"},format:{placeHolder:"Format Block",tooltip:"Format Block",command:"formatblock",value:[{value:"p",label:"Paragraph"},{value:"h1",label:"Header 1"},{value:"h2",label:"Header 2"},{value:"h3",label:"Header 3"},{value:"h4",label:"Header 4"}],type:"list",width:120,dropDownWidth:190,height:25},font:{placeHolder:"Font",tooltip:"Font Name",command:"fontname",value:[{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Comic Sans MS",value:'"Comic Sans MS", cursive, sans-serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Georgia",value:"Georgia,serif"},{label:"Impact",value:"Impact,Charcoal,sans-serif"},{label:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{label:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{label:"Times New Roman",value:"'Times New Roman',Times,serif"},{label:"Trebuchet MS",value:'"Trebuchet MS",Helvetica,sans-serif'},{label:"Verdana",value:"Verdana,Geneva,sans-serif"}],type:"list",width:160,height:25,dropDownWidth:160},size:{placeHolder:"Size",tooltip:"Font Size",command:"fontsize",value:[{label:"1 (8pt)",value:"xx-small"},{label:"2 (10pt)",value:"x-small"},{label:"3 (12pt)",value:"small"},{label:"4 (14pt)",value:"medium"},{label:"5 (18pt)",value:"large"},{label:"6 (24pt)",value:"x-large"},{label:"7 (36pt)",value:"xx-large"}],type:"list",width:45,height:25,dropDownWidth:160},color:{tooltip:"Text Color",command:"forecolor",value:"#000",type:"colorPicker"},background:{tooltip:"Fill Color",command:"backcolor",value:"#fff",type:"colorPicker"},left:{tooltip:"Align Left",command:"justifyleft",type:"toggleButton"},center:{tooltip:"Align Center",command:"justifycenter",type:"toggleButton"},right:{tooltip:"Align Right",command:"justifyright",type:"toggleButton"},outdent:{tooltip:"Indent Less",command:"outdent",type:"button"},indent:{tooltip:"Indent More",command:"indent",type:"button"},ul:{tooltip:"Insert unordered list",command:"insertunorderedlist",type:"toggleButton"},ol:{tooltip:"Insert ordered list",command:"insertorderedlist",type:"toggleButton"},image:{tooltip:"Insert image",command:"insertimage",type:"button"},link:{tooltip:"Insert link",command:"createlink",type:"toggleButton"},html:{tooltip:"View source",command:"viewsource",type:"toggleButton"},clean:{tooltip:"Remove Formatting",command:"removeformat",type:"button"}},createCommand:null,defaultLocalization:{bold:"Bold",italic:"Italic",underline:"Underline",format:"Format Block",font:"Font Name",size:"Font Size",color:"Text Color",background:"Fill Color",left:"Align Left",center:"Align Center",right:"Align Right",outdent:"Indent Less",indent:"Indent More",ul:"Insert unordered list",ol:"Insert ordered list",image:"Insert image",link:"Insert link",html:"View source",clean:"Remove Formatting",Remove:"Remove",Ok:"Ok",Cancel:"Cancel",Change:"Change","Go to link":"Go to link","Open in a new window/tab":"Open in a new window/tab",Align:"Align",VSpace:"VSpace",HSpace:"HSpace",Width:"Width",Height:"Height",Title:"Title",URL:"URL","Insert Image":"Insert Image","Insert Link":"Insert Link","Alt Text":"Alt Text","not set":"&ltnot set&gt",Left:"Left",Right:"Right",Paragraph:"Paragraph",Header:"Header",Arial:"Arial","Comic Sans MS":"Comic Sans MS","Courier New":"Courier New",Georgia:"Georgia",Impact:"Impact","Lucida Console":"Lucida Console",Tahoma:"Tahoma","Times New Roman":"Times New Roman","Trebuchet MS":"Trebuchet MS",Verdana:"Verdana"},localization:null,tools:"bold italic underline | format font size | color background | left center right | outdent indent | ul ol | image | link | clean | html",readOnly:!1,stylesheets:new Array,rtl:!1,colorPickerTemplate:'<div class="jqx-editor-color-picker"><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (0, 0, 0)"><div title="RGB (0, 0, 0)" style="background-color: rgb(0, 0, 0);"></div></td><td aria-label="RGB (68, 68, 68)"><div title="RGB (68, 68, 68)" style="background-color: rgb(68, 68, 68);"></div></td><td aria-label="RGB (102, 102, 102)"><div title="RGB (102, 102, 102)" style="background-color: rgb(102, 102, 102);"></div></td><td aria-label="RGB (153, 153, 153)"><div title="RGB (153, 153, 153)" style="background-color: rgb(153, 153, 153);"></div></td><td aria-label="RGB (204, 204, 204)"><div title="RGB (204, 204, 204)" style="background-color: rgb(204, 204, 204);"></div></td><td aria-label="RGB (238, 238, 238)"><div title="RGB (238, 238, 238)" style="background-color: rgb(238, 238, 238);"></div></td><td aria-label="RGB (243, 243, 243)"><div title="RGB (243, 243, 243)" style="background-color: rgb(243, 243, 243);"></div></td><td aria-label="RGB (255, 255, 255)"><div title="RGB (255, 255, 255)" style="background-color: rgb(255, 255, 255);"></div></td></tr></tbody></table></div><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (255, 0, 0)"><div title="RGB (255, 0, 0)" style="background-color: rgb(255, 0, 0);"></div></td><td aria-label="RGB (255, 153, 0)"><div title="RGB (255, 153, 0)" style="background-color: rgb(255, 153, 0);"></div></td><td aria-label="RGB (255, 255, 0)"><div title="RGB (255, 255, 0)" style="background-color: rgb(255, 255, 0);"></div></td><td aria-label="RGB (0, 255, 0)"><div title="RGB (0, 255, 0)" style="background-color: rgb(0, 255, 0);"></div></td><td aria-label="RGB (0, 255, 255)"><div title="RGB (0, 255, 255)" style="background-color: rgb(0, 255, 255);"></div></td><td aria-label="RGB (0, 0, 255)"><div title="RGB (0, 0, 255)" style="background-color: rgb(0, 0, 255);"></div></td><td aria-label="RGB (153, 0, 255)"><div title="RGB (153, 0, 255)" style="background-color: rgb(153, 0, 255);"></div></td><td aria-label="RGB (255, 0, 255)"><div title="RGB (255, 0, 255)" style="background-color: rgb(255, 0, 255);"></div></td></tr></tbody></table></div><div role="grid"><table class="jqx-editor-color-picker-table" cellspacing="0" cellpadding="0"><tbody><tr><td aria-label="RGB (244, 204, 204)"><div title="RGB (244, 204, 204)" style="background-color: rgb(244, 204, 204);"></div></td><td aria-label="RGB (252, 229, 205)"><div title="RGB (252, 229, 205)" style="background-color: rgb(252, 229, 205);"></div></td><td aria-label="RGB (255, 242, 204)"><div title="RGB (255, 242, 204)" style="background-color: rgb(255, 242, 204);"></div></td><td aria-label="RGB (217, 234, 211)"><div title="RGB (217, 234, 211)" style="background-color: rgb(217, 234, 211);"></div></td><td aria-label="RGB (208, 224, 227)"><div title="RGB (208, 224, 227)" style="background-color: rgb(208, 224, 227);"></div></td><td aria-label="RGB (207, 226, 243)"><div title="RGB (207, 226, 243)" style="background-color: rgb(207, 226, 243);"></div></td><td aria-label="RGB (217, 210, 233)"><div title="RGB (217, 210, 233)" style="background-color: rgb(217, 210, 233);"></div></td><td aria-label="RGB (234, 209, 220)"><div title="RGB (234, 209, 220)" style="background-color: rgb(234, 209, 220);"></div></td></tr><tr><td id="T-Kw-Jn88" aria-label="RGB (234, 153, 153)"><div title="RGB (234, 153, 153)" style="background-color: rgb(234, 153, 153);"></div></td><td aria-label="RGB (249, 203, 156)"><div title="RGB (249, 203, 156)" style="background-color: rgb(249, 203, 156);"></div></td><td aria-label="RGB (255, 229, 153)"><div title="RGB (255, 229, 153)" style="background-color: rgb(255, 229, 153);"></div></td><td aria-label="RGB (182, 215, 168)"><div title="RGB (182, 215, 168)" style="background-color: rgb(182, 215, 168);"></div></td><td aria-label="RGB (162, 196, 201)"><div title="RGB (162, 196, 201)" style="background-color: rgb(162, 196, 201);"></div></td><td aria-label="RGB (159, 197, 232)"><div title="RGB (159, 197, 232)" style="background-color: rgb(159, 197, 232);"></div></td><td aria-label="RGB (180, 167, 214)"><div title="RGB (180, 167, 214)" style="background-color: rgb(180, 167, 214);"></div></td><td aria-label="RGB (213, 166, 189)"><div title="RGB (213, 166, 189)" style="background-color: rgb(213, 166, 189);"></div></td></tr><tr><td aria-label="RGB (224, 102, 102)"><div title="RGB (224, 102, 102)" style="background-color: rgb(224, 102, 102);"></div></td><td aria-label="RGB (246, 178, 107)"><div title="RGB (246, 178, 107)" style="background-color: rgb(246, 178, 107);"></div></td><td aria-label="RGB (255, 217, 102)"><div title="RGB (255, 217, 102)" style="background-color: rgb(255, 217, 102);"></div></td><td aria-label="RGB (147, 196, 125)"><div title="RGB (147, 196, 125)" style="background-color: rgb(147, 196, 125);"></div></td><td aria-label="RGB (118, 165, 175)"><div title="RGB (118, 165, 175)" style="background-color: rgb(118, 165, 175);"></div></td><td aria-label="RGB (111, 168, 220)"><div title="RGB (111, 168, 220)" style="background-color: rgb(111, 168, 220);"></div></td><td aria-label="RGB (142, 124, 195)"><div title="RGB (142, 124, 195)" style="background-color: rgb(142, 124, 195);"></div></td><td aria-label="RGB (194, 123, 160)"><div title="RGB (194, 123, 160)" style="background-color: rgb(194, 123, 160);"></div></td></tr><tr><td id="T-Kw-Jn104" aria-label="RGB (204, 0, 0)"><div title="RGB (204, 0, 0)" style="background-color: rgb(204, 0, 0);"></div></td><td aria-label="RGB (230, 145, 56)"><div title="RGB (230, 145, 56)" style="background-color: rgb(230, 145, 56);"></div></td><td aria-label="RGB (241, 194, 50)"><div title="RGB (241, 194, 50)" style="background-color: rgb(241, 194, 50);"></div></td><td aria-label="RGB (106, 168, 79)"><div title="RGB (106, 168, 79)" style="background-color: rgb(106, 168, 79);"></div></td><td aria-label="RGB (69, 129, 142)"><div title="RGB (69, 129, 142)" style="background-color: rgb(69, 129, 142);"></div></td><td aria-label="RGB (61, 133, 198)"><div title="RGB (61, 133, 198)" style="background-color: rgb(61, 133, 198);"></div></td><td aria-label="RGB (103, 78, 167)"><div title="RGB (103, 78, 167)" style="background-color: rgb(103, 78, 167);"></div></td><td aria-label="RGB (166, 77, 121)"><div title="RGB (166, 77, 121)" style="background-color: rgb(166, 77, 121);"></div></td></tr><tr><td aria-label="RGB (153, 0, 0)"><div title="RGB (153, 0, 0)" style="background-color: rgb(153, 0, 0);"></div></td><td aria-label="RGB (180, 95, 6)"><div title="RGB (180, 95, 6)" style="background-color: rgb(180, 95, 6);"></div></td><td aria-label="RGB (191, 144, 0)"><div title="RGB (191, 144, 0)" style="background-color: rgb(191, 144, 0);"></div></td><td aria-label="RGB (56, 118, 29)"><div title="RGB (56, 118, 29)" style="background-color: rgb(56, 118, 29);"></div></td><td aria-label="RGB (19, 79, 92)"><div title="RGB (19, 79, 92)" style="background-color: rgb(19, 79, 92);"></div></td><td aria-label="RGB (11, 83, 148)"><div title="RGB (11, 83, 148)" style="background-color: rgb(11, 83, 148);"></div></td><td aria-label="RGB (53, 28, 117)"><div title="RGB (53, 28, 117)" style="background-color: rgb(53, 28, 117);"></div></td><td aria-label="RGB (116, 27, 71)"><div title="RGB (116, 27, 71)" style="background-color: rgb(116, 27, 71);"></div></td></tr><tr><td aria-label="RGB (102, 0, 0)"><div title="RGB (102, 0, 0)" style="background-color: rgb(102, 0, 0);"></div></td><td aria-label="RGB (120, 63, 4)"><div title="RGB (120, 63, 4)" style="background-color: rgb(120, 63, 4);"></div></td><td aria-label="RGB (127, 96, 0)"><div title="RGB (127, 96, 0)" style="background-color: rgb(127, 96, 0);"></div></td><td aria-label="RGB (39, 78, 19)"><div title="RGB (39, 78, 19)" style="background-color: rgb(39, 78, 19);"></div></td><td aria-label="RGB (12, 52, 61)"><div title="RGB (12, 52, 61)" style="background-color: rgb(12, 52, 61);"></div></td><td aria-label="RGB (7, 55, 99)"><div title="RGB (7, 55, 99)" style="background-color: rgb(7, 55, 99);"></div></td><td aria-label="RGB (32, 18, 77)"><div title="RGB (32, 18, 77)" style="background-color: rgb(32, 18, 77);"></div></td><td aria-label="RGB (76, 17, 48)"><div title="RGB (76, 17, 48)" style="background-color: rgb(76, 17, 48);"></div></td></tr></tbody></table></div></div>',touchMode:!1,keyPressed:null,events:["change"]};return this===a.jqx._jqxEditor.prototype?b:(a.extend(!0,this,b),this.localization=this.defaultLocalization,b)},createInstance:function(c){var d=this;d.textArea=d.host;var e=d.host.attr("contenteditable");if(d.host.addClass(d.toThemeProperty("jqx-widget")),1==e||"true"==e){d.inline=!0,d.widget=d.host,d.editorDocument=document,d.selection=new b(d.editorDocument);var f=a("<div class='jqx-editor-toolbar-container' unselectable='on' aria-label='Formatting options' role='toolbar'><div class='jqx-editor-toolbar'></div>");f.insertBefore(d.host),d.toolbarContainer=f,d.toolbar=f.find(".jqx-editor-toolbar"),d.editor=d.host,d.contentEditableElement=d.element}else{var g=a("<div class='jqx-editor'><div class='jqx-editor-container'><div class='jqx-editor-toolbar-container' aria-label='Formatting options' role='toolbar'><div class='jqx-editor-toolbar'></div></div><div class='jqx-editor-content'><iframe  src='javascript:\"<html></html>\"' allowtransparency='true' frameborder='0'></iframe></div></div></div>");d.widget=g,d.widget[0].className=d.widget[0].className+" "+d.element.className;try{d.widget[0].style=d.element.style}catch(a){}var h=a.trim(d.host.html())+"&#8203;";"default"==d.lineBreak||"div"==d.lineBreak?h="<div>"+h+"</div>":"p"==d.lineBreak&&(h="<p>"+h+"</p>"),h=h.replace(/&lt;/gi,"<"),h=h.replace(/&gt;/gi,">"),d.host.css("display","none"),d.host.after(g),g.find("iframe").after(d.host),d.container=g.find(".jqx-editor-container"),d.toolbarContainer=g.find(".jqx-editor-toolbar-container"),d.toolbar=g.find(".jqx-editor-toolbar"),d.iframe=g.find("iframe"),d.content=g.find(".jqx-editor-content");var i=function(){d.editorDocument=d.iframe[0].contentWindow.document,d.selection=new b(d.editorDocument);var c=0;d.addHandler(d.iframe,"load",function(){if(c++,c>1){d.iframe.off("load"),d.content.find("iframe").remove();a("<iframe  src='javascript:\"<html></html>\"' allowtransparency='true' frameborder='0'></iframe>").appendTo(d.content);d.iframe=g.find("iframe"),i()}}),a.jqx.browser.mozilla||(d.editorDocument.designMode="On"),d.editorDocument.open();var e=d.rtl?"direction:rtl;":"",f=a.jqx.browser.msie?"::selection{color: #fff; background: #328EFD;};::-moz-selection{color: #fff; background: #328eD;};::selection:window-inactive {background: #c7c7c7; color: #000;}::-moz-selection:window-inactive {background: #c7c7c7; color: #000;}html{font-size:13px; height:100%;}body{padding-top:1px;margin-top:-1px; padding-right: 1px; overflow-x: hidden;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;":"";if(d.editorDocument.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0; margin:0; font-size: 13px; font-family: "+d.fontFamily+"; background:#fff; min-height:100%; "+e+"}"+f+"}h1{font-size:2em;margin:.67em 0}h2{font-size: 1.5em; margin: .75em 0}h3{font-size: 1.17em; margin: .83em 0}h4{font-size:1em; margin: 1.12em 0 }h5{font-size: .83em; margin: 1.5em 0}h6{font-size: .75em; margin: 1.67em 0}p{margin: 0px;padding:0 .2em}ul,ol{padding-left:2.5em}a{color:#00a}code{font-size:1.23em}.jqx-editor-paste-element {position: absolute; left: -1000px; height: 1px; overflow: hidden; top: -1000px;}.jqx-editor-focus {border: 1px solid #aaa !important;}</style>"+a.map(d.stylesheets,function(a){return"<link rel='stylesheet' href='"+a+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),d.contentEditableElement=d.editorDocument.body,d.host.is("textarea")){d._textArea=d.element;var j=d.host.data();j.jqxEditor.host=g,j.jqxEditor.element=g[0],d.element=g[0],g[0].id=d._textArea.id,d._textArea.id=d._textArea.id+"TextArea",a(d.element).addClass(d.toThemeProperty("jqx-widget")),d.host=a(d.element),d.host.data(j)}else{var j=d.host.data();j.jqxEditor.host=g,j.jqxEditor.element=g[0],d.element=g[0],d.host=a(d.element),d.host.data(j)}try{d.editorDocument.execCommand("useCSS",!1,!1),d.editorDocument.execCommand("enableInlineTableEditing",null,!1)}catch(a){}try{d.editorDocument.execCommand("styleWithCSS",0,!0)}catch(a){}d.editorDocument.close(),d.editor=a(d.editorDocument.body),d.editor.html(h).attr("spellcheck",!1).attr("autocorrect","off")};i(),a.jqx.utilities.resize(d.host,function(){d.widget.css("width",d.width),d.widget.css("height",d.height),d._arrange()})}},focus:function(){var b=this;a.jqx.browser.mozilla&&(b.focused||(b.iframe&&b.iframe.focus(),b.selection.selectNode(b.editor[0].firstChild,!0),b.selection.getRange().collapse(!0))),b.editor.focus();var c=null!=b.range?b.range:b.getRange();b.selectRange(c)},print:function(){var a=window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes");a.document.open(),a.document.write('<!doctype html><html><head><title>Print</title></head><body onload="print();">'+this.val()+"</body></html>"),a.document.close()},refresh:function(b){var c=this;a.each(this.defaultLocalization,function(a,b){c.localization[a]||(c.localization[a]=b)}),c._removeHandlers(),c.toolbar.addClass(c.toThemeProperty("jqx-widget-header")),c.content?(c.widget.css("width",c.width),c.widget.css("height",c.height),c.widget.addClass(c.toThemeProperty("jqx-editor")),c.widget.addClass(c.toThemeProperty("jqx-widget")),c.widget.addClass(c.toThemeProperty("jqx-rc-all")),c.widget.addClass(c.toThemeProperty("jqx-widget-header")),c.content.addClass(c.toThemeProperty("jqx-widget-content")),c.container.addClass(c.toThemeProperty("jqx-editor-container"))):(c.toolbarContainer.addClass(c.toThemeProperty("jqx-widget-header")),c.toolbarContainer.addClass(c.toThemeProperty("jqx-editor-toolbar-inline")),c.toolbarContainer.addClass(c.toThemeProperty("jqx-widget")),c.toolbarContainer.addClass(c.toThemeProperty("jqx-rc-all")),c.toolbarContainer.hide(),c.toolbarContainer.css("position","absolute"),c.editor.addClass(c.toThemeProperty("jqx-editor-inline")),c.toolbarContainer.css("width",c.host.outerWidth()+"px"));var d=c.toolbarContainer.index();if("top"==c.toolbarPosition&&0!=d||"bottom"==c.toolbarPosition&&1!=d)switch(c.toolbarPosition){case"bottom":c.toolbarContainer.insertAfter(c.content);break;case"top":default:c.toolbarContainer.insertBefore(c.content)}var e=c.tools;if(e!==!1){var f=e.split(" "),g=e.split(" | "),h=function(b,d){a.each(d,function(e,f){var g=c.commands[this];if(g){if(c.createCommand){var h=c.createCommand(this.toString());g=a.extend(g,h)}}else{if(!c.createCommand)return!0;if(g=c.createCommand(this.toString()),!g)return!0;c.commands[this]||(c.commands[this]=g)}switch(c.localization[this]&&(g.tooltip=c.localization[this]),g.type){case"list":g.widget&&g.widget.jqxDropDownList("destroy");var i=function(a,b,c){return"formatblock"==g.command?"<"+c+' unselectable="on" style="padding: 0px; margin: 0px;">'+b+"</"+c+">":"fontname"==g.command?'<span unselectable="on" style="font-family: '+c+';">'+b+"<span>":"fontsize"==g.command?'<span unselectable="on" style="font-size: '+c+';">'+b+"<span>":void 0},j=function(){var a=c.toThemeProperty("jqx-editor-toolbar-icon")+" "+c.toThemeProperty("jqx-editor-toolbar-icon-"+g.command),b="<div unselectable='on' style='margin-top: 0px; padding:0px;' class='"+a+"'></div>";return b},k="formatblock"==g.command||"fontname"==g.command||"fontsize"==g.command,l=g.value||[],m=new Array,n=g.placeHolder||"Please Choose:";"fontname"==g.command?a.each(l,function(){var a=c.localization[this.label];m.push({label:a,value:this.value})}):"formatblock"==g.command?(n=c.localization.format,a.each(l,function(){if(this.label.indexOf("Header")>=0)var a=this.label.replace("Header",c.localization.Header);else var a=c.localization[this.label];m.push({label:a,value:this.value})})):m=l;var o={enableBrowserBoundsDetection:!0,touchMode:c.touchMode,width:g.width||100,height:g.height||25,dropDownWidth:g.dropDownWidth||"auto",autoDropDownHeight:(g.value&&g.value.length)<12,placeHolder:n,source:m,theme:c.theme,keyboardSelection:!1,focusable:!1,disabled:c.disabled,rtl:c.rtl,selectionRenderer:"fontsize"==g.command?j:null,renderer:k?i:null},p="jqx-disableselect "+c.toThemeProperty("jqx-editor-dropdownlist")+" "+c.toThemeProperty("jqx-editor-toolbar-item"),q=a("<div unselectable='on' class='"+p+"'></div>");q.appendTo(b),q.jqxDropDownList(o),g.init&&g.init(q);var f=null,r=null,s="";c.addHandler(q,"mousedown",function(b){if(a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0){var c=a(".jqx-editor-dropdownlist");a.each(c,function(b,c){c!=q[0]&&a(c).jqxDropDownList("close")})}}),c.addHandler(q,"open",function(a){c.focused||c.focus(),c.updating=!0,c.activeElement=q,f=q.val(),s=""}),c.addHandler(q,"change",function(b){c.updating=!1,c.activeElement=null,r=q.val(),s=b.args.type,a.jqx.browser.msie&&a.jqx.browser.version<9&&c.focus()}),c.addHandler(q,"close",function(a){c.updating=!1,c.activeElement=null,f!=r&&("mouse"!=s&&"keyboard"!=s||c._refreshTools())}),c._addCommandHandler(q,"change",g.command,null,g);break;case"colorPicker":g.widget&&(a(g.colorPicker).remove(),g.widget.jqxDropDownButton("destroy"));var t=a('<div unselectable="on" style="padding-top: 4px;"></div>').attr("id","picker-"+g.command),p="jqx-disableselect "+c.toThemeProperty("jqx-editor-dropdownpicker")+" "+c.toThemeProperty("jqx-editor-toolbar-item"),q=a("<div unselectable='on' class='"+p+"'></div>");q.appendTo(b),q.append(t),q.jqxDropDownButton({touchMode:c.touchMode,disabled:c.disabled,enableBrowserBoundsDetection:!0,width:g.width||45,height:g.height||25,rtl:c.rtl,focusable:!1,theme:c.theme});var u=a('<div unselectable="on" style="z-index: 55;">'),v=c.toThemeProperty("jqx-editor-toolbar-icon")+" "+c.toThemeProperty("jqx-editor-toolbar-icon-"+g.command),w=a("<div unselectable='on' class='"+v+"'></div>");u.append(w);var x=a('<div unselectable="on" class="jqx-editor-color-bar">').attr("id","bar-"+g.command).css("background-color",g.value);u.append(x),q.jqxDropDownButton("setContent",u),t.append(a(c.colorPickerTemplate)),g.colorPicker=t,g.init&&g.init(q),t.find("tr").attr("role","row").attr("unselectable","on"),t.find("td").attr("role","gridcell").attr("unselectable","on").css("-webkit-user-select","none"),t.find("div").attr("unselectable","on"),c.addHandler(q,"mousedown",function(b){if(a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close"),a(".jqx-editor-dropdownpicker").length>0){var c=a(".jqx-editor-dropdownpicker");a.each(c,function(b,c){c!=q[0]&&a(c).jqxDropDownButton("close")})}}),c.addHandler(q,"open",function(){c.focused||c.focus(),c.updating=!0,c.activeElement=t}),c.addHandler(q,"close",function(a){c.updating=!1,c.activeElement=null,f!=r&&("mouse"!=s&&"keyboard"!=s||c._refreshTools())}),c.addHandler(t,"keydown",function(b){var c=b.keyCode,d=a(t).find(".jqx-editor-color-picker-selected-cell"),e=t.find("tr"),f=e.length,h=d.parent().children().length,i=d.index(),j=-999,k=d.parent();switch(a.each(e,function(a,b){if(this==k[0])return j=a,!1}),c){case 27:q.jqxDropDownButton("close");break;case 13:a(d).trigger("mousedown");break;case 38:j--;break;case 40:j++;break;case 39:i++;break;case 37:i--}if(j>=0&&j<=f&&i>=0&&i<=h){var k=t.find("tr")[j],l=a(k).children()[i],m=a(l).children().css("background-color");g.val(m)}});var y=a(t).find("td");g.val=function(b){var d=c._rgbToHex(b);a.each(y,function(){var b=a(this).children().css("background-color"),e=c._rgbToHex(b);if(e==d)return y.removeClass("jqx-editor-color-picker-selected-cell"),a(this).addClass("jqx-editor-color-picker-selected-cell"),a("#bar-"+g.command).css("background",b),!1})},g.val(g.value),c._addCommandHandler(y,"mousedown",g.command,null,g);break;case"button":case"toggleButton":default:g.widget&&("button"==g.type?g.widget.jqxButton("destroy"):g.widget.jqxToggleButton("destroy"));var z=g.command,A=g.action,v=c.toThemeProperty("jqx-editor-toolbar-icon")+" "+c.toThemeProperty("jqx-editor-toolbar-icon-"+z),w=a("<div unselectable='on' class='"+v+"'></div>"),q=a("<div unselectable='on'></div>").addClass("jqx-disableselect").addClass(c.toThemeProperty("jqx-editor-toolbar-button"));g.init?z&&q.append(w):q.append(w),q.appendTo(b),"button"==g.type?q.jqxButton({disabled:c.disabled,rtl:c.rtl,theme:c.theme}):"toggleButton"==g.type&&q.jqxToggleButton({disabled:c.disabled,rtl:c.rtl,uiToggle:!1,theme:c.theme}),g.init&&g.init(q),g.toggled=!1,g.toggle=function(){g.toggled=!g.toggled},c.addHandler(q,"mousedown",function(a){return a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!1}),a.jqx.mobile.isTouchDevice()?c._addCommandHandler(q,"mousedown",z,A,g):c._addCommandHandler(q,"click",z,A,g)}if(g.widget=q,q){try{""!=g.tooltip&&(g.widget.attr("title",g.tooltip),g.widget.attr("data-tooltip",g.tooltip)),g.command&&g.widget.attr("data-command",g.command),g.widget.attr("aria-label",g.tooltip)}catch(a){}"button"!=g.type&&"toggleButton"!=g.type||(d.length>2&&(0==e?(q.css("border-right-radius","0px"),q.addClass(c.toThemeProperty("jqx-rc-l"))):e==d.length-1&&(q.css("border-left-radius","0px"),q.addClass(c.toThemeProperty("jqx-rc-r"))),q.removeClass(c.toThemeProperty("jqx-rc-all"))),0!=e&&e!=d.length-1&&d.length>2?(q.css("border-left-radius","0px"),q.css("border-right-radius","0px"),q.removeClass(c.toThemeProperty("jqx-rc-all"))):2==d.length?(0==e?(q.css("border-right-radius","0px"),q.addClass(c.toThemeProperty("jqx-rc-l"))):(q.css("border-left-radius","0px"),q.addClass(c.toThemeProperty("jqx-rc-r"))),q.removeClass(c.toThemeProperty("jqx-rc-all"))):1==d.length&&q.css("margin-right","0px"))}})};if(c.toolbar.css("direction",this.rtl?"rtl":"ltr"),0==g.length)h(c.toolbar,f);else{for(var i=0;i<g.length;i++){var j=g[i],f=j.split(" "),k=c.toThemeProperty("jqx-editor-toolbar-group")+" "+c.toThemeProperty("jqx-fill-state-normal"),l=a("<div class='"+k+"'></div>");l.addClass(c.toThemeProperty("jqx-rc-all")),c.toolbar.append(l),h(l,f)}for(var m=c.toolbar.find(".jqx-editor-toolbar-group"),n=m.length,i=0;i<n;i++)0==a(m[i]).children().length&&a(m[i]).remove()}a.jqx.browser.msie&&a.jqx.browser.version<8&&(a(".jqx-editor-toolbar-group").css("float","left"),a(".jqx-editor-toolbar-group").children().css("float","left"),a(".jqx-editor-toolbar-group").css("zoom","1"),a(".jqx-editor-toolbar-group").children().css("zoom","1"))}c._arrange(),c._addHandlers()},_arrange:function(){var b=this;b.content&&(""==b.tools||0==b.tools?(b.content.height(b.container.outerHeight()-parseInt(b.container.css("padding-top"))-parseInt(b.container.css("padding-bottom"))-6),b.content.css("margin-top","4px"),b.toolbar.hide()):(b.toolbar.show(),b.content.css("margin-top","0px"),b.content.height(b.container.outerHeight()-b.toolbar.outerHeight()-parseInt(b.container.css("padding-top"))-parseInt(b.container.css("padding-bottom"))-2),"top"!=b.toolbarPosition&&(b.content.css("margin-top","4px"),b.content.css("margin-bottom","0px"))),a.jqx.browser.msie&&a.jqx.browser.version<8&&(b.content.css("margin-top","4px"),b.content.height(b.container.height()-b.toolbar.outerHeight()-2*parseInt(b.container.css("padding-bottom"))-10),b.content.width(b.container.width()-2*parseInt(b.container.css("padding-left"))-2)),b.editor.height()<b.content.height()&&b.editor.height(b.content.height()))},propertyChangedHandler:function(b,c,d,e){var f=b;if(void 0!=f.isInitialized&&0!=f.isInitialized&&"pasteMode"!=c&&"lineBreak"!=c&&"editable"!=c){if("disabled"==c&&b._refreshTools(),"width"==c||"height"==c||"toolbarPosition"==c)return void b._arrange();"theme"==c&&a.jqx.utilities.setTheme(d,e,b.host),b.refresh()}},selectRange:function(a){var b=this;a||(a=b.getRange()),b.selection.selectRange(a)},getRange:function(){var a=this;return a.selection.getRange()},getSelectedElement:function(){var a,b,c,d,e=this;try{if(e.editorDocument.getSelection){var f=e.editorDocument.getSelection();return a=f.getRangeAt(f.rangeCount-1),c=a.startContainer,d=a.endContainer,b=a.commonAncestorContainer,"#text"==c.nodeName&&(b=b.parentNode),"#text"==c.nodeName&&(c=c.parentNode),"body"==c.nodeName.toLowerCase()&&(c=c.firstChild),"#text"==d.nodeName&&(d=d.parentNode),"body"==d.nodeName.toLowerCase()&&(d=d.lastChild),c==d&&(b=c),d}if(e.editorDocument.selection){if(a=e.editorDocument.selection.createRange(),!a.duplicate)return null;b=a.parentElement();var g=a.duplicate(),h=a.duplicate();return g.collapse(!0),h.moveToElementText(g.parentElement()),h.setEndPoint("EndToStart",g),c=g.parentElement(),g=a.duplicate(),h=a.duplicate(),h.collapse(!1),g.moveToElementText(h.parentElement()),g.setEndPoint("StartToEnd",h),d=h.parentElement(),"body"==c.nodeName.toLowerCase()&&(c=c.firstChild),"body"==d.nodeName.toLowerCase()&&(d=d.lastChild),c==d&&(b=c),d}}catch(a){return null}return null},_addHandlers:function(){var b=this;b.addHandler(b.toolbar,"mousedown.editor"+b.element.id,function(a){return a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!1});var c=function(){if(b._textArea&&(b.updating||(b._textArea.value=b.val())),b.changed&&(b._raiseEvent("change"),b.changed=!1),b.focused=!1,b.inline){if(b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.removeClass(b.toThemeProperty("jqx-editor-inline-focus")),""==b.tools||null==b.tools)return;b.toolbarContainer.fadeOut("fast")}},d=function(){if(b.focused=!0,b.inline){if(b.host.addClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.addClass(b.toThemeProperty("jqx-editor-inline-focus")),b.host.addClass(b.toThemeProperty("jqx-rc-all")),""==b.tools||null==b.tools)return;b.toolbarContainer.fadeIn("fast");var a=b.host.coord();"bottom"!=b.toolbarPosition?b.toolbarContainer.offset({left:a.left,top:a.top-b.toolbarContainer.outerHeight()-5}):b.toolbarContainer.offset({left:a.left,top:a.top+5+b.host.height()})}};a.jqx.browser.mozilla&&this.addHandler(a(document),"mousedown.editor"+b.element.id,function(a){c()}),b.addHandler(b.editor,"blur.editor"+b.element.id,function(a){c()}),b.addHandler(b.editor,"focus.editor"+b.element.id,function(a){d()}),b.addHandler(b.editor,"beforedeactivate.editor"+b.element.id,function(a){b.range=b.getRange()}),b.addHandler(b.editor,"mousedown.editor"+b.element.id,function(c){c.target.href||b.linkPopup&&b.linkPopup.remove(),b.range=b.getRange(),a.jqx.browser.mozilla&&(d(),c.stopPropagation()),a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close"),b.inline&&b.editor.focus()}),a.jqx.mobile.isTouchDevice()&&(b.addHandler(a(b.editorDocument),"selectionchange.editor"+b.element.id,function(){b.editorDocument.activeElement!=b.editor[0]&&setTimeout(function(){b.iframe&&b.iframe[0].contentWindow.focus()},500)}),b.addHandler(a(b.editorDocument),"touchstart.editor"+b.element.id,function(){setTimeout(function(){b.iframe&&b.iframe[0].contentWindow.focus()},500)})),b.addHandler(b.editor,"mouseup.editor"+b.element.id,function(a){return"source"==b._documentMode||(b.range=b.getRange(),void b._refreshTools(null,!0))}),b.addHandler(b.editor,"keydown.editor"+b.element.id,function(c){if(b.keyPressed&&b.keyPressed(c),"source"==b._documentMode)return!0;if(a.jqx.browser.mozilla&&(b.focused||d()),b.changeType="keyboard",b.disabled)return c.preventDefault&&c.preventDefault(),!1;if(b.updating){if(b.activeElement){var e=a.Event("keydown");a.extend(e,c),b.activeElement.trigger(e)}return c.preventDefault&&c.preventDefault(),!1}var f=c||window.event,g=f.keyCode,h=String.fromCharCode(g).toLowerCase();if(!b.editable){var i=[9,33,34,35,36,37,38,39,40,40,45];a.inArray(f.keyCode,i)!=-1||f.ctrlKey&&"c"==h||f.ctrlKey&&"a"==h||c.preventDefault();
+}if(b.selection.getText().length>0||b.linkPopup){var i=[8,9,13,33,34,35,36,37,38,39,40,40,45,46];(!a.inArray(f.keyCode,i)!=-1||65==f.keyCode&&f.ctrlKey&&!f.altKey&&!f.shiftKey)&&(b._refreshToolsTimer&&clearTimeout(b._refreshToolsTimer),b._refreshToolsTimer=setTimeout(function(){b._refreshTools(null,!0,f.keyCode)},10))}if(13==g&&"default"!=b.lineBreak){var j=b.getSelectedElement();if(j){var k=j.nodeName.toLowerCase();switch(k){case"pre":case"li":case"ul":case"ol":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return!0}for(var l=j;null!=l;){if("#document"==l.nodeName){l=b.editorDocument.body;break}if(l.parentNode==b.editorDocument.body||l==b.editorDocument.body)break;l=l.parentNode}}if(l){var m=b.getRange();"<div></div>"==b.editorDocument.body.innerHTML&&"br"!=b.lineBreak&&b.selection.insertContent("&#8203;"),"div"==b.lineBreak?l==b.editorDocument.body?a(l).append("<div>&#8203;</div><span id='INSERTION_MARKER'>&nbsp;</span>"):a("<div>&#8203;</div><span id='INSERTION_MARKER'>&nbsp;</span>").insertAfter(l):"p"==b.lineBreak?l==b.editorDocument.body?a(l).append("<p>&#8203;</p><span id='INSERTION_MARKER'>&nbsp;</span>"):a("<p>&#8203;</p><span id='INSERTION_MARKER'>&nbsp;</span>").insertAfter(l):b.execute("insertHTML","<br/>&#8203;<span id='INSERTION_MARKER'>&nbsp;</span>"),b.selectRange(m);var n=a(b.editorDocument).find("#INSERTION_MARKER");return"br"!=b.lineBreak?b.selection.selectNode(a(n).prev()[0],!0):(b.selection.selectNode(n[0],!0),b.getRange().setStartAfter&&b.getRange().setStartAfter(n[0])),n.remove(),b.selection.collapse(!1),l&&l.nodeName&&"br"==b.lineBreak&&"#text"!=l.nodeName.toLowerCase()&&(b.selection.selectNode(l,!0),b.getRange().setStartAfter&&b.getRange().setStartAfter(l),b.selection.collapse(!1)),"br"!=b.lineBreak&&(m=b.getRange(),m.select&&m.select()),c.preventDefault&&c.preventDefault(),!1}}if(f.ctrlKey&&("k"==h||"u"==h||"b"==h||"i"==h)){c.preventDefault&&c.preventDefault();var o=null;switch(h){case"k":o="link";break;case"u":o="underline";break;case"b":o="bold";break;case"i":o="italic"}return b.commands[o].widget&&b.commands[o].widget.trigger("click"),!1}}),b.addHandler(b.editor,"paste.editor"+b.element.id,function(c){if("source"==b._documentMode)return!0;if(b.readOnly)return!0;b.updating=!0,b.readOnly=!0;try{var d=function(a,c){if(c)b.paragraphise?(a="<p>"+a+"</p>",a=a.replace(/\n/g,"</p><p>"),a=a.replace(/<p>\s<\/p>/gi,"")):a=a.replace(/\n/g,"<br />");else{if(a=a.replace(/<html[^>]*?>(.*)/gim,"$1"),a=a.replace(/<\/html>/gi,""),a=a.replace(/<body[^>]*?>(.*)/gi,"$1"),a=a.replace(/<\/body>/gi,""),a=a.replace(/<style[^>]*?>[\s\S]*?<\/style[^>]*>/gi,""),a=a.replace(/<(?:meta|link)[^>]*>\s*/gi,""),a=a.replace(/<\\?\?xml[^>]*>/gi,""),a=a.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),a=a.replace(/<o:p>\s*<\/o:p>/g,""),a=a.replace(/<o:p>[\s\S]*?<\/o:p>/g,"&nbsp;"),a=a.replace(/<\/?\w+:[^>]*>/gi,""),a=a.replace(/<\!--[\s\S]*?-->/g,""),a=a.replace(/<\!\[[\s\S]*?\]>/g,""),a=a.replace(/\s*mso-[^:]+:[^;"']+;?/gi,""),a=a.replace(/<(\w[^>]*) style='([^\']*)'([^>]*)/gim,"<$1$3"),a=a.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gim,"<$1$3"),a=a.replace(/\s*margin: 0cm 0cm 0pt\s*;/gi,""),a=a.replace(/\s*margin: 0cm 0cm 0pt\s*"/gi,'"'),a=a.replace(/\s*text-indent: 0cm\s*;/gi,""),a=a.replace(/\s*text-indent: 0cm\s*"/gi,'"'),a=a.replace(/\s*text-align: [^\s;]+;?"/gi,'"'),a=a.replace(/\s*page-break-before: [^\s;]+;?"/gi,'"'),a=a.replace(/\s*font-variant: [^\s;]+;?"/gi,'"'),a=a.replace(/\s*tab-stops:[^;"']*;?/gi,""),a=a.replace(/\s*tab-stops:[^"']*/gi,""),a=a.replace(/\s*face="[^"']*"/gi,""),a=a.replace(/\s*face=[^ >]*/gi,""),a=a.replace(/\s*font-family:[^;"']*;?/gi,""),a=a.replace(/\s*font-size:[^;"']*;?/gi,""),a=a.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3"),a=a.replace(/<(\w+)[^>]*\sstyle="[^"']*display\s?:\s?none[\s \S]*?<\/\1>/gi,""),a=a.replace(/\s*style='\s*'/gi,""),a=a.replace(/\s*style="\s*"/gi,""),a=a.replace(/<span\s*[^>]*>\s*&nbsp;\s*<\/span>/gi,"&nbsp;"),a=a.replace(/<span\s*[^>]*><\/span>/gi,""),a=a.replace(/<(\w[^>]*) align=([^ |>]*)([^>]*)/gi,"<$1$3"),a=a.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3"),a=a.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,"$2"),a=a.replace(/<font\s*>([\s\S]*?)<\/font>/gi,"$1"),a=a.replace(/<(u|i|strike)>&nbsp;<\/\1>/gi,"&nbsp;"),a=a.replace(/<h\d>\s*<\/h\d>/gi,""),a=a.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3"),a=a.replace(/<(\w[^>]*) onmouseover="([^\"']*)"([^>]*)/gi,"<$1$3"),a=a.replace(/<(\w[^>]*) onmouseout="([^\"']*)"([^>]*)/gi,"<$1$3"),a=a.replace(/<h(\d)([^>]*)>/gi,"<h$1>"),a=a.replace(/<(h\d)><font[^>]*>([\s\S]*?)<\/font><\/\1>/gi,"<$1>$2</$1>"),a=a.replace(/<(h\d)><em>([\s\S]*?)<\/em><\/\1>/gi,"<$1>$2</$1>"),a=a.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/gi,"<strong>$1</strong>"),a=a.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/gi,"<em>$1</em>"),a=a.replace(/<\s+[^>]*>/gi,""),a=a.replace(/<span>([\s\S]*?)<\/span>/gi,"$1"),a=a.replace(/<span>([\s\S]*?)<\/span>/gi,"$1"),a=a.replace(/<div>([\s\S]*?)<\/div>/gi,"$1"),a=a.replace(/<div>([\s\S]*?)<\/div>/gi,"$1"),a=a.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,""),a=a.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,""),a=a.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,""),a.trim&&(a=a.trim()),b.paragraphise){var d=a.substr(0,2);"<p"!==d&&(a="<p>"+a+"</p>",a=a.replace(/\n/g,"</p><p>"),a=a.replace(/<br[^>]*>/gi,"</p><p>"))}else a.replace(/<p>/gi,"<br />"),a.replace(/<\/p>/gi,"");a=a.replace(/<br>/gi,"<br />"),a=a.replace(/<br[^>]*><\/p>/gim,"</p>"),a=a.replace(/<p>&nbsp;<\/p>/gi,""),a=a.replace(/<p>\s<\/p>/gi,""),a=a.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,""),a=a.replace(/MsoNormal/gi,""),a=a.replace(/<\/?meta[^>]*>/gi,""),a=a.replace(/<\/?xml[^>]*>/gi,""),a=a.replace(/<\?xml[^>]*\/>/gi,""),a=a.replace(/<!--(.*)-->/gi,""),a=a.replace(/<!--(.*)>/gi,""),a=a.replace(/<!(.*)-->/gi,""),a=a.replace(/<w:[^>]*>(.*)<\/w:[^>]*>/gi,""),a=a.replace(/<w:[^>]*\/>/gi,""),a=a.replace(/<\/?w:[^>]*>/gi,""),a=a.replace(/<m:[^>]*\/>/gi,""),a=a.replace(/<m:[^>]>(.*)<\/m:[^>]*>/gi,""),a=a.replace(/<o:[^>]*>(.*)<\/o:[^>]*>/gi,""),a=a.replace(/<o:[^>]*\/>/gi,""),a=a.replace(/<\/?m:[^>]*>/gi,""),a=a.replace(/style=\"([^>]*)\"/gi,""),a=a.replace(/style=\'([^>]*)\'/gi,""),a=a.replace(/class=\"(.*)\"/gi,""),a=a.replace(/class=\'(.*)\'/gi,""),a=a.replace(/<b>/gi,"<strong>"),a=a.replace(/<\/b>/gi,"</strong>"),a=a.replace(/<p[^>]*>/gi,"<p>"),a=a.replace(/<\/p[^>]*>/gi,"</p>"),a=a.replace(/<span[^>]*>/gi,""),a=a.replace(/<\/span[^>]*>/gi,""),a=a.replace(/<st1:[^>]*>/gi,""),a=a.replace(/<\/st1:[^>]*>/gi,""),a=a.replace(/<font[^>]*>/gi,""),a=a.replace(/<\/font[^>]*>/gi,""),a=a.replace("  ",""),a=a.replace(/<strong><\/strong>/gi,""),a=a.replace(/<p><\/p>/gi,""),a=a.replace(/\/\*(.*)\*\//gi,""),a=a.replace(/<!--/gi,""),a=a.replace(/-->/gi,""),a=a.replace(/<style[^>]*>[^<]*<\/style[^>]*>/gi,""),a=a.trim()}return a},e=b.getRange();"text"!=b.pasteMode||a.jqx.browser.mozilla?b.selection.insertContent('<div class="jqx-editor-paste-element">&nbsp;</div>'):b.selection.insertContent('<textarea cols="50" contenteditable="false" class="jqx-editor-paste-element"></textarea>');var f=a(window).scrollTop(),g=a(b.editorDocument).find(".jqx-editor-paste-element");if(g.css("top",f+"px"),b.editor[0].createTextRange){c.preventDefault();var h=b.editor[0].createTextRange();h.moveToElementText(g[0]),h.execCommand("Paste")}else{var i=b.editorDocument.createRange();i.selectNodeContents(g[0]),b.selectRange(i)}"text"!=b.pasteMode||a.jqx.browser.mozilla||g.select(),b.marker=g,setTimeout(function(){b.selectRange(e);var c=function(a){var c=b.editorDocument.createElement("div"),d=b.editorDocument.createDocumentFragment();for(c.innerHTML=a;c.firstChild;)d.appendChild(c.firstChild);return d};if("text"!=b.pasteMode){var f=c(b.marker.html());if(f.firstChild&&"jqx-editor-paste-element"===f.firstChild.className){for(var g=[],h=0,i=f.childNodes.length;h<i;h++)g.push(f.childNodes[h].innerHTML);f=c(g.join("<br />"))}var j=document.createElement("div");j.appendChild(f.cloneNode(!0));var k=j.innerHTML}else{var k=b.marker.val();if(""!=b.marker.html()&&b.marker.val().indexOf("\n")==-1){var k=b.marker.html();k=k.replace(/&nbsp;/gm,""),k=k.replace(/\n\n/gm,"\n"),k=k.replace(/<br[^>]*>/gi,"\n"),k=k.replace(/<li[^>]*>/gi,"\n"),k=k.replace(/<p[^>]*>/gi,"\n"),b.marker.html(k);var k=b.marker.text()}}var l=d(k,"text"==b.pasteMode);b.getRange();b.selection.insertContent(l+"<span id='INSERTION_MARKER'>&nbsp;</span>"),b.marker.remove();var m=a(b.editorDocument).find("#INSERTION_MARKER");b.selection.selectNode(m[0],!0),b.getRange().setStartAfter&&b.getRange().setStartAfter(m[0]),m.remove(),b.selection.collapse(!1),m.removeAttr("id"),b._refreshTools(),b.changed=!0},100),b.updating=!1,b.readOnly=!1}catch(a){console&&console.log(a)}}),b.addHandler(b.editor,"keyup.editor"+b.element.id,function(c){if("source"==b._documentMode)return!0;if(b.updating||b.disabled||!b.editable)return c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation(),!1;b.range=b.getRange(),b.changed=!0;var d=c||window.event,e=(d.keyCode,[8,9,13,33,34,35,36,37,38,39,40,40,45,46]);(a.inArray(d.keyCode,e)!=-1||65==d.keyCode&&d.ctrlKey&&!d.altKey&&!d.shiftKey)&&b._refreshTools(null,!0,d.keyCode)}),b.addHandler(b.editor,"click.editor"+b.element.id,function(c){if("source"==b._documentMode)return!0;if(b.editImage&&(a(b.editImage).removeClass("jqx-editor-focus"),b.editImage=null),"img"==c.target.tagName.toLowerCase()){var d=c.target;b.editImage=d,a(b.editImage).addClass("jqx-editor-focus")}}),b.addHandler(b.editor,"dblclick.editor"+b.element.id,function(c){if("source"==b._documentMode)return!0;if("img"==c.target.tagName.toLowerCase()){var d=c.target;a("#imageWindow"+this.element.id).length>0&&(b.editImage=d,b._updateImageWindow())}})},_updateLinkWindow:function(){var b=this,c=a("#linkWindow"+this.element.id);c.jqxWindow({position:{center:b.widget}}),c.jqxWindow("open");var d=c.find("input"),e=c.find(".jqx-editor-link-checkbox"),f=c.find("button:first"),g=a(c.find("button")[1]);if(b.editLink&&b.editLink.href)d[0].value=b.editLink.href||"",d[1].value=a(b.editLink).text()||b.editLink.href,e.val("_blank"==a(b.editLink).attr("target")),g.show();else{if(d[0].value="",d[1].value="",!b.selection.isCollapsed()){var h=b.selection.getText();h.match(/^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$/i)?d[0].value=h:d[1].value=h}e.val(!1),g.hide()}d[0].value.length>0?f.jqxButton({disabled:!1}):f.jqxButton({disabled:!0})},_updateImageWindow:function(){var b=this,c=b.editImage;c||(c=a("<img>")[0]);var d=a("#imageWindow"+this.element.id);d.jqxWindow({position:{center:b.widget}}),d.jqxWindow("open");var e=d.find("input"),f=a(d.find("button")[1]);b.editImage?f.show():f.hide(),e[0].value=c.src,""==e[0].value&&(e[0].value=""),e[1].value=c.alt,"auto"!=c.style.width?e[2].value=c.style.width:e[2].value="","auto"!=c.style.height?e[3].value=c.style.height:e[3].value="",c.style.marginLeft&&"0px"!=c.style.marginLeft?e[4].value=c.style.marginLeft:e[4].value="",c.style.marginTop&&"0px"!=c.style.marginTop?e[5].value=c.style.marginTop:e[5].value="";var g=d.find(".jqx-editor-align"),h=a(c).css("float");"left"==h?g.jqxDropDownList({selectedIndex:1}):"right"==h?g.jqxDropDownList({selectedIndex:2}):g.jqxDropDownList({selectedIndex:0})},_removeHandlers:function(){var a=this;a.editor&&(a.removeHandler(a.editor,"blur.editor"+a.element.id),a.removeHandler(a.editor,"focus.editor"+a.element.id),a.removeHandler(a.editor,"click.editor"+a.element.id),a.removeHandler(a.editor,"mousedown.editor"+a.element.id),a.removeHandler(a.editor,"mouseup.editor"+a.element.id),a.removeHandler(a.editor,"keyup.editor"+a.element.id),a.removeHandler(a.editor,"keydown.editor"+a.element.id),a.removeHandler(a.editor,"beforedeactivate.editor"+a.element.id),a.removeHandler(a.editor,"dblclick.editor"+a.element.id)),a.toolbar&&a.removeHandler(a.toolbar,"mousedown.editor"+a.element.id)},getParentByTag:function(a,b){var b=b.toLowerCase(),c=a;do if(""==b||c.nodeName.toLowerCase()==b)return c;while(c=c.parentNode);return a},isStyleProperty:function(a,b,c,d){var b=b.toLowerCase(),e=a;do if(e.nodeName.toLowerCase()==b&&e.style[c]==d)return!0;while(e=e.parentNode);return!1},setStyleProperty:function(a,b){this.style[b]=!1;var c=this.getParentByTag(a,b);c&&c.tagName.toLowerCase()==b&&(this.style[b]=!0),"del"==b&&this.getParentByTag(a,"strike")&&"strike"==this.getParentByTag(a,"strike").tagName.toLowerCase()&&(this.style.del=!0)},updateStyle:function(a){var b=this,a=b.getSelectedElement()?b.getSelectedElement():a;if(a&&b.setStyleProperty)try{if(window.getComputedStyle){"#text"==a.nodeName.toLowerCase()&&(a=b.editor[0]);var c=window.getComputedStyle(a,null),d=401==c.getPropertyValue("font-weight")?700:c.getPropertyValue("font-weight");b.style={fontStyle:c.getPropertyValue("font-style"),fontSize:c.getPropertyValue("font-size"),textDecoration:c.getPropertyValue("text-decoration"),fontWeight:d,fontFamily:c.getPropertyValue("font-family"),textAlign:c.getPropertyValue("text-align"),color:b._rgbToHex(c.color),backColor:b._rgbToHex(c.backgroundColor)},b.style.fontStyle=c.getPropertyValue("font-style"),b.style.vAlign=c.getPropertyValue("vertical-align"),b.style.del=b.isStyleProperty(a,"span","textDecoration","line-through"),b.style.u=b.isStyleProperty(a,"span","textDecoration","underline");var e=function(a){for(var b="transparent",c="rgba(0, 0, 0, 0)";a&&(window.getComputedStyle(a).backgroundColor==b||window.getComputedStyle(a).backgroundColor==c);)a=a.parentNode;return a?window.getComputedStyle(a).backgroundColor:b};b.style.backColor||(b.style.backColor=b._rgbToHex(e(a)))}else{var c=a.currentStyle;b.style={fontStyle:c.fontStyle,fontSize:c.fontSize,textDecoration:c.textDecoration,fontWeight:c.fontWeight,fontFamily:c.fontFamily,textAlign:c.textAlign,color:b._rgbToHex(c.color),backColor:b._rgbToHex(c.backgroundColor)}}b.setStyleProperty(a,"h1"),b.setStyleProperty(a,"h2"),b.setStyleProperty(a,"h3"),b.setStyleProperty(a,"h4"),b.setStyleProperty(a,"h5"),b.setStyleProperty(a,"h6"),b.setStyleProperty(a,"del"),b.setStyleProperty(a,"sub"),b.setStyleProperty(a,"sup"),b.setStyleProperty(a,"u"),"a"==a.nodeName.toLowerCase()&&"underline"==b.style.textDecoration&&(b.style.u=!0),(b.style.h1||b.style.h2||b.style.h3||b.style.h4||b.style.h5||b.style.h6)&&(b.style.heading=!0)}catch(a){return null}},_refreshTools:function(b,c,d){var e=this;if(!e.updating){var b=e.getSelectedElement()?e.getSelectedElement():b;if(b&&e.setStyleProperty){e.updateStyle(b);var f=e.readOnly;if(e.readOnly=!0,e.tools!==!1){var g=e.tools.split(" "),h=e.tools.split(" | "),i=function(b){a.each(b,function(a,b){var c=e.commands[this];if(!c)return!0;switch(c.type){case"list":c.widget.jqxDropDownList("clearSelection"),c.widget.jqxDropDownList({disabled:e.disabled});break;case"colorPicker":c.val(c.value),c.widget.jqxDropDownButton({disabled:e.disabled});break;case"toggleButton":c.widget.jqxToggleButton("unCheck"),c.widget.jqxToggleButton({disabled:e.disabled});break;case"button":default:c.widget.jqxButton({disabled:e.disabled})}})};if(0==h.length)i(g);else for(var j=0;j<h.length;j++){var k=h[j],g=k.split(" ");i(g)}if(e.style){var l=function(d){a.each(d,function(d,f){var g=e.commands[this];if(!g)return!0;if(g.refresh)return g.refresh(g.widget,e.style),!0;switch(g.type){case"list":if("fontname"==g.command){for(var h=-1,i=999,j=0;j<g.value.length;j++){var f=g.value[j].label.toLowerCase(),k=e.style.fontFamily.toLowerCase().indexOf(f);k>=0&&(k<i&&(h=j),i=Math.min(i,k))}g.widget.jqxDropDownList("selectIndex",h)}else if("formatblock"==g.command){var f=null;e.style.h1?f="h1":e.style.h2?f="h2":e.style.h3?f="h3":e.style.h4?f="h4":e.style.h5?f="h5":e.style.h6&&(f="h6"),g.widget.jqxDropDownList("selectItem",f)}else if("fontsize"==g.command){var l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),m=-1;try{var m=b.getAttribute("size")-1;m==-1&&(m=e.editorDocument.queryCommandValue(g.command)-1)}catch(a){}var n=l[m];g.widget.val(n)}break;case"colorPicker":var o=function(a){return"number"!=typeof a?a:"rgb("+(255&a)+", "+((65280&a)>>8)+", "+((16711680&a)>>16)+")"},p=o(e.editorDocument.queryCommandValue(g.command));"backcolor"==g.command&&null==e.style.backColor&&(p="#FFFFFF");var q=e._rgbToHex(p);q?g.val(q):"forecolor"==g.command?g.val(e.style.color):"backcolor"==g.command&&g.val(e.style.backColor);break;case"toggleButton":if("viewsource"==g.command)return;if(!g.command)return;var r=!1,s=e.editorDocument.queryCommandState(g.command)&&e.editorDocument.queryCommandEnabled(g.command);if("createlink"==g.command&&"a"==b.nodeName.toLowerCase()){var t=!0;if(a(b).text().indexOf(e.selection.getText())==-1&&""!=e.selection.getText()&&(t=!1),t){e.linkPopup&&e.linkPopup.remove(),s=!0,e.linkPopup=a("<div class='jqx-editor-link-popup' contentEditable='false' style='overflow: hidden; white-space: nowrap; padding: 5px; height: 17px; font-size: 12px; color: #222222; background: #F5F5F5; position: absolute; z-index: 9999;'>"+e.localization["Go to link"]+": <a target='_blank' style='color:#222222;' href='"+b.href+"'>"+b.href+"</a> - <a style='color:#222222;' href='#change'>"+e.localization.Change+"</a> - <a style='color:#222222;' href='#remove'>"+e.localization.Remove+"</a></div>").appendTo(e.editor);var u=a(b).coord(),v=u.left;u.left+e.linkPopup.width()>e.editor.width()&&(v=e.editor.width()-e.linkPopup.width()-15),e.linkPopup.offset({top:a(b).height()+u.top+5,left:v}),e.addHandler(e.linkPopup,"mousedown",function(c){if(c.target&&c.target.href){var d=a(c.target).index();switch(d){case 1:e.editor.focus(),e.selection.selectNode(b,!0),e.commands.link.widget.trigger("click");break;case 2:try{e.editor.focus(),e.selection.selectNode(b),e.execute("unlink"),e.commands.underline.toggled=!1,e.selection.collapse(!1),e._refreshTools()}catch(a){}break;default:window.open(c.target.href,"_blank")}}return c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation(),!1})}}"bold"==g.command?(e.style.fontWeight&&(e.style.fontWeight>=600||"bold"==e.style.fontWeight)&&(r=!0),e.selection.isCollapsed()?g.toggled=s:g.toggled=s||r,s=g.toggled):"italic"==g.command?(e.style.fontStyle&&"italic"==e.style.fontStyle&&(r=!0),c?g.toggled=s:s=g.toggled):"underline"==g.command?(e.style.u&&(r=!0),c?g.toggled=s:s=g.toggled):"justifyleft"==g.command?"left"==e.style.textAlign&&(r=!0):"justifyright"==g.command?"right"==e.style.textAlign&&(r=!0):"justifycenter"==g.command?"center"==e.style.textAlign&&(r=!0):"justifyfull"==g.command?"justify"==e.style.textAlign&&(r=!0):a.each(e.style,function(a,b){g.command==a.toLowerCase()&&(r=!0)});var w=s;r&&g.command.indexOf("justify")!=-1?g.widget.jqxToggleButton("check"):w?g.widget.jqxToggleButton("check"):r&&e.range.collapsed===!1?g.widget.jqxToggleButton("check"):a.jqx.browser.msie&&a.jqx.browser.version<9&&r&&!e.selection.isCollapsed()&&g.widget.jqxToggleButton("check");break;case"button":default:g.refresh&&g.refresh(g.widget,e.style)}})};if(0==h.length)l(g);else for(var j=0;j<h.length;j++){var k=h[j],g=k.split(" ");l(g)}}}e.readOnly=f}}},_rgbToHex:function(a){if(a){if("#"===a.substr(0,1)){if(4==a.length){var b=a.substr(1,1),c=a.substr(2,1),d=a.substr(3,1);return"#"+b+b+c+c+d+d}return a}var e=/(.*?)rgb\((\d+),\s*(\d+),\s*(\d+)\)/i.exec(a);if(!e)return null;var b=parseInt(e[2],10).toString(16),c=parseInt(e[3],10).toString(16),d=parseInt(e[4],10).toString(16);return"#"+((1==b.length?"0"+b:b)+(1==c.length?"0"+c:c)+(1==d.length?"0"+d:d))}return null},_preventDefault:function(b,c){c!==!1&&(a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close")),b.preventDefault&&b.preventDefault(),b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,b.returnValue=!1},_addCommandHandler:function(b,c,d,e,f){var g=this;switch(!d&&f.init&&(d="custom"),d){case"custom":switch(f.type){case"list":action=function(b){"source"!=g._documentMode&&"none"!=b.args.type&&(f.value=a(this).val(),g.execute("custom",f),g.readOnly||g._refreshTools()),g._preventDefault(b,!1)};break;case"colorPicker":action=function(b){if("source"!=g._documentMode){a(f.colorPicker).find("td").removeClass("jqx-editor-color-picker-selected-cell");if("div"==b.target.nodeName.toLowerCase()){var c=a(b.target).css("background-color");a(b.target).parent().addClass("jqx-editor-color-picker-selected-cell")}else{var c=a(b.target).find("div").css("background-color");a(b.target).addClass("jqx-editor-color-picker-selected-cell")}a("#bar-"+d).css("background",c),f.widget.val=function(){var a=function(a){return"number"!=typeof a?a:"rgb("+(255&a)+", "+((65280&a)>>8)+", "+((16711680&a)>>16)+")"},b=a(c),d=g._rgbToHex(b);return d},f.widget.jqxDropDownButton("close"),g.execute("custom",f)}return g._preventDefault(b),!1};break;case"button":case"toggleButton":default:action=function(b){a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close"),g._preventDefault(b);a(this).attr("data-command");return"source"!=g._documentMode&&(f.toggle&&f.toggle(),g.execute("custom",f),g._refreshTools()),!1}}break;case"formatblock":action=function(b){"source"!=g._documentMode&&"none"!=b.args.type&&(g.execute(a(this).attr("data-command"),"<"+a(this).val()+">",f),g.readOnly||(g.commands.bold.toggled=!1,g._refreshTools())),g._preventDefault(b,!1)};break;case"fontsize":action=function(b){if("source"!=g._documentMode&&"none"!=b.args.type){var c=a(this).val(),d="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),e=a(this).jqxDropDownList("getSelectedIndex")+1,e=1+d.indexOf(c);g.execute(a(this).attr("data-command"),e,f)}g._preventDefault(b,!1)};break;case"fontname":action=function(b){if("source"!=g._documentMode&&"none"!=b.args.type){var c=a(this).val();g.execute(a(this).attr("data-command"),c,f)}g._preventDefault(b,!1)};break;case"forecolor":case"backcolor":action=function(b){if("source"!=g._documentMode){a(f.colorPicker).find("td").removeClass("jqx-editor-color-picker-selected-cell");if("div"==b.target.nodeName.toLowerCase()){var c=a(b.target).css("background-color");a(b.target).parent().addClass("jqx-editor-color-picker-selected-cell")}else{var c=a(b.target).find("div").css("background-color");a(b.target).addClass("jqx-editor-color-picker-selected-cell")}a("#bar-"+d).css("background",c),f.widget.jqxDropDownButton("close"),g.execute(d,c,f)}return g._preventDefault(b),!1};break;case"viewsource":action=function(b){return g.linkPopup&&g.linkPopup.remove(),f.toggle(),g.setMode(f.toggled),a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close"),g._preventDefault(b),!1};break;case"insertimage":action=function(a){g._insertImageAction(a,g,f)};break;case"createlink":action=function(a){g._createLinkAction(a,g,f)};break;default:action=function(b){a(".jqx-editor-dropdownpicker").length>0&&a(".jqx-editor-dropdownpicker").jqxDropDownButton("close"),a(".jqx-editor-dropdownlist").length>0&&a(".jqx-editor-dropdownlist").jqxDropDownList("close"),g._preventDefault(b);var c=a(this).attr("data-command");if("source"!=g._documentMode){if("underline"==c&&g.getSelectedElement()){var d=g.getSelectedElement();if(d&&"a"==d.nodeName.toLowerCase())return f.toggled?a(d).css("text-decoration","none"):a(d).css("text-decoration","underline"),f.toggle(),g._refreshTools(),!1}f.toggle&&f.toggle(),g.execute(c,a(this).val(),f),g._refreshTools()}return!1}}return g.addHandler(b,c,action),!1},_createLinkAction:function(b,c,d){var c=this;if("source"==c._documentMode)return void c._preventDefault(b);c.focused||c.editor.focus(),c.range=c.getRange();var e=c.getSelectedElement();if("a"==e.nodeName.toLowerCase()?c.editLink=e:c.editLink=null,a("#linkWindow"+this.element.id).length>0)return c.editLink&&c.selection.selectNode(e,!0),c._updateLinkWindow(),c._preventDefault(b),!1;var f=a("<div class='jqx-editor-window jqx-editor-link-window'><div>"+c.localization["Insert Link"]+"</div><div><table style='border-collapse: separate; border-spacing: 2px;'><tr><td align='right'>"+c.localization.URL+":</td><td><input style='width: 200px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+c.localization.Title+":</td><td><input style='width: 200px; height: 23px;' value=''/></td><tr/><tr><td align='right'></td><td><div class='jqx-editor-link-checkbox'>"+c.localization["Open in a new window/tab"]+"</div></td><tr/><tr><td align='right'></td><td align='right'><button>Ok</button><button style='margin-left: 5px;'>Remove</button><button style='margin-left: 5px;'>Cancel</button></td><tr/></table></div></div>");f[0].id="linkWindow"+this.element.id;var g=f.find("input");g.addClass(c.toThemeProperty("jqx-widget")),g.addClass(c.toThemeProperty("jqx-widget-content")),g.addClass(c.toThemeProperty("jqx-input"));var h=f.find(".jqx-editor-link-checkbox").jqxCheckBox({theme:c.theme,height:23,width:180}),i=f.find("button:first").jqxButton({theme:c.theme,disabled:!0}),j=a(f.find("button")[1]).jqxButton({theme:c.theme}),k=f.find("button:last").jqxButton({theme:c.theme});i.val(c.localization.Ok),k.val(c.localization.Cancel),j.val(c.localization.Remove),c.addHandler(k,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(a){c.editor.focus(),c.selectRange(c.range),c._refreshTools(),c._preventDefault(a)}),(!c.editLink||c.editLink&&!c.editLink.href)&&j.hide();var l=!1;if(c.addHandler(a(g[0]),"focus",function(){l=""==g[1].value||g[1].value==g[0].value}),c.addHandler(a(g[1]),"keyup",function(a){a.keyCode&&(13==a.keyCode&&i.trigger("click"),27==a.keyCode&&k.trigger("click"))}),c.addHandler(a(g[0]),"keyup change",function(a){g[0].value.length>0?i.jqxButton({disabled:!1}):i.jqxButton({disabled:!0}),l&&(g[1].value=g[0].value),a.keyCode&&(13==a.keyCode&&i.trigger("click"),27==a.keyCode&&k.trigger("click"))}),c.addHandler(j,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(a){f.jqxWindow("close");try{c.editor.focus(),c.selection.selectNode(c.editLink),c.execute("unlink"),c.selection.collapse(!1),c.commands.underline.toggled=!1,c._refreshTools()}catch(a){}c._preventDefault(a)}),c.addHandler(i,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(b){var e=f.find("input"),g=a("<a>"+(e[1].value||e[0].value)+"</a>");h.val()&&g.attr("target","_blank"),g[0].href=a.trim(e[0].value),e[0].value.indexOf("http")==-1&&e[0].value.indexOf("mailto")==-1&&(g[0].href="http://"+a.trim(e[0].value)),c.focused||c.editor.focus(),c.range&&c.selectRange(c.range),c.editLink&&a(c.editLink).remove(),c.execute("insertHTML",""+g[0].outerHTML+"<span id='INSERTION_MARKER'>&nbsp;</span>",d),c.editor.focus();var i=a(c.editorDocument).find("#INSERTION_MARKER");c.selection.selectNode(i[0],!0),c.getRange().setStartAfter&&c.getRange().setStartAfter(i[0]),i.remove(),c.selection.collapse(!1),c._refreshTools(),c._preventDefault(b)}),c.updating=!0,f.appendTo(document.body),c.addHandler(f,"open",function(){c.updating=!0,setTimeout(function(){c.range=c.getRange(),a(g[0]).focus()},25)}),f.jqxWindow({resizable:!1,width:280,okButton:i,cancelButton:k,theme:c.theme,isModal:!0,position:{center:c.widget}}),c.addHandler(f,"close",function(){c.updating=!1}),c.focused||(c.editor.focus(),c.selectRange(c.range)),c.editLink)g[0].value=c.editLink.href||"",g[1].value=a(c.editLink).text(),h.val("_blank"==a(c.editLink).attr("target"));else if(!c.selection.isCollapsed()){var m=c.selection.getText();m.match(/^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$/i)?g[0].value=m:g[1].value=m}return g[0].value.length>0?i.jqxButton({disabled:!1}):i.jqxButton({disabled:!0}),c._preventDefault(b),!1},_insertImageAction:function(b,c,d){if("source"==c._documentMode)return void c._preventDefault(b);if(c.focused||c.editor.focus(),c.range=c.getRange(),a("#imageWindow"+this.element.id).length>0)return c._updateImageWindow(),c._preventDefault(b),!1;var e=a("<div class='jqx-editor-window jqx-editor-image-window'><div>"+c.localization["Insert Image"]+"</div><div><table style='border-collapse: separate; border-spacing: 2px;'><tr><td align='right'>"+c.localization.URL+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+c.localization["Alt Text"]+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+c.localization.Width+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+c.localization.Height+":</td><td><input style='width: 180px; height: 23px;' value=''/></td><tr/><tr><td align='right'>"+c.localization.HSpace+":</td><td><input style='width: 180px; height: 23px;' class='jqx-editor-hspace'/></td><tr/><tr><td align='right'>"+c.localization.VSpace+":</td><td><input style='width: 180px; height: 23px;' class='jqx-editor-vspace'/></td><tr/><tr><td align='right'>"+c.localization.Align+":</td><td><div class='jqx-editor-align'></div></td><tr/><tr><td align='right'></td><td align='right'><button>Ok</button><button style='margin-left: 5px;'>Remove</button><button style='margin-left: 5px;'>Cancel</button></td><tr/></table></div></div>");e[0].id="imageWindow"+this.element.id;var f=e.find("input");f.addClass(c.toThemeProperty("jqx-widget")),f.addClass(c.toThemeProperty("jqx-widget-content")),f.addClass(c.toThemeProperty("jqx-input")),e.find(".jqx-editor-align").jqxDropDownList({autoDropDownHeight:!0,selectedIndex:0,theme:c.theme,height:23,width:180,source:[c.localization["not set"],c.localization.Left,c.localization.Right]});var g=e.find("button:first").jqxButton({theme:c.theme}),h=e.find("button:last").jqxButton({theme:c.theme}),i=a(e.find("button")[1]).jqxButton({theme:c.theme});return g.val(c.localization.Ok),h.val(c.localization.Cancel),i.val(c.localization.Remove),i.hide(),c.addHandler(i,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(b){a(c.editImage).removeClass("jqx-editor-focus"),a(c.editImage).remove(),c.editImage=null,c._preventDefault(b),e.jqxWindow("close"),c._raiseEvent("change")}),c.addHandler(h,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(b){a(c.editImage).removeClass("jqx-editor-focus"),c.editImage=null,c._preventDefault(b)}),c.addHandler(g,a.jqx.mobile.isTouchDevice()?a.jqx.mobile.getTouchEventName("touchstart"):"click",function(b){a(c.editImage).removeClass("jqx-editor-focus");var f=e.find("input"),g=a(c.editImage?c.editImage:'<img style="border: 1px solid transparent;">'),h=g.attr("src",f[0].value).attr("unselectable","on");f[1].value&&h.attr("alt",f[1].value).attr("title",f[1].value),f[2].value&&!isNaN(parseInt(f[2].value))?h.width(f[2].value):h.css("width","auto"),f[3].value&&!isNaN(parseInt(f[3].value))?h.height(f[3].value):h.css("height","auto"),f[4].value?"auto"==f[4].value.toString()?(h.css("margin-left","auto"),h.css("margin-right","auto")):f[4].value.toString().indexOf("%")!=-1?(h.css("margin-left",parseInt(f[4].value)+"%"),h.css("margin-right",parseInt(f[4].value)+"%")):(h.css("margin-left",parseInt(f[4].value)+"px"),h.css("margin-right",parseInt(f[4].value)+"px")):(h.css("margin-left","0px"),h.css("margin-right","0px")),f[5].value?"auto"==f[5].value.toString()?(h.css("margin-top","auto"),h.css("margin-bottom","auto")):f[5].value.toString().indexOf("%")!=-1?(h.css("margin-top",parseInt(f[5].value)+"%"),h.css("margin-bottom",parseInt(f[5].value)+"%")):(h.css("margin-top",parseInt(f[5].value)+"px"),h.css("margin-bottom",parseInt(f[5].value)+"px")):(h.css("margin-top","0px"),h.css("margin-bottom","0px"));var i=e.find(".jqx-editor-align").jqxDropDownList("selectedIndex");if(1==i?h.css("float","left"):2==i?h.css("float","right"):0==i&&h.css("float","none"),h.css("resize",!1),h[0].oncontrolselect=function(){return!1},h[0].selectstart=function(){return!1},!c.editImage){c.focused||c.editor.focus(),c.range&&c.selectRange(c.range),
+c.execute("insertHTML",h[0].outerHTML+"<span id='INSERTION_MARKER'>&nbsp;</span>",d),c.editor.focus();var j=a(c.editorDocument).find("#INSERTION_MARKER");c.selection.selectNode(j[0],!0),c.getRange().setStartAfter&&c.getRange().setStartAfter(j[0]),j.remove(),c.selection.collapse(!1),c._refreshTools(),c._preventDefault(b)}c.editImage=null,c._preventDefault(b)}),e.appendTo(document.body),c.updating=!0,c.addHandler(e,"open",function(){c.updating=!0,setTimeout(function(){c.range=c.getRange(),a(f[0]).focus()},25)}),e.jqxWindow({resizable:!1,width:280,okButton:g,cancelButton:h,theme:c.theme,isModal:!0,position:{center:c.widget}}),c.addHandler(e,"close",function(){c.updating=!1}),c.focused||(c.editor.focus(),c.selectRange(c.range)),c._preventDefault(b),!1},editmode:function(b){var c=this;if(b||c.readOnly){if(b&&c.readOnly){var d=c.editor.find("#sourceText").text();c.editor.html(d),c.buttons.hasOwnProperty("html")&&c.buttons.html.removeClass("active"),c.editor.attr("contentEditable",!0),c._addHandlers()}}else{c._removeHandlers(),c.editor.attr("contentEditable",!1);var d=document.createTextNode(c.editor.html()),e=a("<pre>");e.html(d).attr({id:"sourceText",contentEditable:!0}).css("height","100%"),c.editor.html(e),c.buttons.hasOwnProperty("html")&&c.buttons.html.addClass("active"),e.focus()}c.readOnly=!b},setMode:function(b){var d=this;d.range||(d.editor.focus(),d.range=d.getRange());var e,f=d.editor[0];if(b){d._documentMode="source";var g=new c,h=g.HTMLtoXML(f.innerHTML);h=g.FormatHTML(h),e=document.createTextNode(h),f.innerHTML="";var i=document.createElement("pre");f.contentEditable=!1,i.style.height="100%",i.style.margin="0px",i.style.outline="none",i.style.display="block",i.id="sourceText",i.contentEditable=!0,i.appendChild(e),f.appendChild(i),this.readOnly=!0}else this._documentMode="html",document.all?f.innerHTML=f.innerText:f.textContent?f.innerHTML=f.textContent:(e=document.createRange(),e.selectNodeContents(f.firstChild),f.innerHTML=e.toString()),f.contentEditable=!0,d.readOnly=!1,d._refreshTools(),d.editor.focus(),d.selection.selectNode(d.editor[0]),d.editor.scrollTop(0),d.selection.collapse(!0);if(a.each(this.commands,function(){if(this.widget&&"viewsource"!=this.command)switch(this.type){case"list":this.widget.jqxDropDownList({disabled:b});break;case"colorPicker":this.widget.jqxDropDownButton({disabled:b});break;case"button":this.widget.jqxButton({disabled:b});break;case"toggleButton":this.widget.jqxToggleButton({toggled:!1,disabled:b})}}),d.editor.focus(),a.jqx.browser.mozilla){var j=a("<a href='#'>anchor</a>");d.editor.prepend(j),j.focus(),j.remove(),d.selection.collapse(!0)}d.commands.html.widget&&(d.commands.html.widget.jqxToggleButton({toggled:"source"==b||1==b}),d.commands.html.toggled="source"==b||1==b)},execute:function(b,c,d){var e=this;if(!e.readOnly){var f=e.editorDocument;if("source"==e._documentMode)return;e.changeType="mouse",e.linkPopup&&e.linkPopup.remove(),e.editor.focus(),a.jqx.browser.mozilla,a.jqx.mobile.isTouchDevice()&&setTimeout(function(){},25);var g=function(b){try{if(b.command&&"inserthtml"==b.command.toLowerCase()){var c=e.getRange(),d=b.value;d.toString().indexOf("<")==-1&&(d="<span>"+b.value+"</span>"),e.selection.insertContent(""+d+"<span id='INSERTION_MARKER'>&nbsp;</span>"),e.selectRange(c),setTimeout(function(){var b=a(e.editorDocument).find("#INSERTION_MARKER");e.selection.selectNode(a(b).prev()[0],!0),b.remove(),e.selection.collapse(!1)},10)}else if(b.command){if(!f.queryCommandEnabled(b.command))return!1;f.execCommand(b.command,!1,b.value)}else{if(!f.queryCommandEnabled(b))return!1;f.execCommand(b,!1,b)}}catch(a){}};if("custom"==b){var h=c.action(c.widget,e.editor);h&&g(h)}else try{if(d&&d.action){var h=d.action(d.widget,e.editor);g(h)}else if(f.queryCommandEnabled(b))f.execCommand(b,!1,c);else{if("insertHTML"!=b)return!1;e.selection.insertContent(c)}}catch(a){if("insertHTML"!=b)return!1;e.selection.insertContent(c)}a.jqx.mobile.isTouchDevice()&&setTimeout(function(){e.iframe&&e.iframe[0].contentWindow.focus()},500),e._raiseEvent("change",{command:b,args:c}),e.changed=!0,e.range=e.getRange()}},destroy:function(){var b=this;b._removeHandlers();var c=b.tools.split(" "),d=b.tools.split(" | ");a.jqx.utilities.resize(this.host,null,!0);var e=function(c){a.each(c,function(c,d){var e=b.commands[this];if(!e)return!0;switch(e.type){case"list":e.widget.jqxDropDownList("destroy");break;case"colorPicker":e.colorPicker.remove(),e.widget.jqxDropDownButton("destroy");break;case"toggleButton":e.widget.jqxToggleButton("destroy");break;case"custom":b.destroyTool&&b.destroyTool(this);break;case"button":default:e.widget.jqxToggleButton("destroy"),"insertimage"===e.command?a("#imageWindow"+b.element.id).length>0&&(a("#imageWindow"+b.element.id).find(".jqx-editor-align").jqxDropDownList("destroy"),a("#imageWindow"+b.element.id).find("button").jqxButton("destroy")):"createlink"===e.command&&a("#linkWindow"+b.element.id).length>0&&(a("#linkWindow"+b.element.id).find(".jqx-editor-align").jqxDropDownList("destroy"),a("#linkWindow"+b.element.id).find("button").jqxButton("destroy"),a("#linkWindow"+b.element.id).find(".jqx-editor-link-checkbox").jqxCheckBox("destroy"))}})};if(0==d.length)e(c);else for(var f=0;f<d.length;f++){var g=d[f],c=g.split(" ");e(c)}var h=a("#linkWindow"+this.element.id),i=a("#imageWindow"+this.element.id);h&&h.length>0&&h.jqxWindow("destroy"),i&&i.length>0&&i.jqxWindow("destroy"),b.inline?b.toolbar.remove():(b.widget.remove(),b.host.remove()),b.iframe.remove(),b.iframe=null,b.selection=null,b.editorDocument=null,b.contentEditableElement=null},val:function(a){if(void 0!==a&&"source"===a){var b=this.editor[0];"source"===this._documentMode&&(b=this.editor.find("pre:first")[0]);var d=new c,e=d.HTMLtoXML(b.innerHTML);return e=d.FormatHTML(e)}return void 0!=a&&"object"!=typeof a&&this.editor.html(a),"source"===this._documentMode?this.editor.find("pre:first").html():this.editor.html()},_raiseEvent:function(b,c){if(void 0==c&&(c={owner:null}),"source"==this._documentMode)return!0;var d=b;c.type=this.changeType,this.changeType=null,args=c,args.owner=this;var e=new a.Event(d);if(e.owner=this,e.args=args,this._textArea)var f=a(this._textArea).trigger(e);else var f=this.host.trigger(e);return c=e.args,f}});var b=function(b){var c={initialize:function(a){this.document=a},getSelection:function(){return this.document.getSelection?this.document.getSelection():this.document.selection},getRange:function(){var a=this.getSelection();if(!a)return null;try{return a.rangeCount>0?a.getRangeAt(0):this.document.createRange?this.document.createRange():this.document.selection.createRange()}catch(a){return this.document.body.createTextRange()}},selectRange:function(a){if(a.select)a.select();else{var b=this.getSelection();b.addRange&&(b.removeAllRanges(),b.addRange(a))}},selectNode:function(a,b){var c=this.getRange(),d=this.getSelection();if(c.moveToElementText)c.moveToElementText(a),c.select();else if(d.addRange)try{b?c.selectNodeContents(a):c.selectNode(a),d.removeAllRanges(),d.addRange(c)}catch(a){}else d.setBaseAndExtent(a,0,a,1);return a},isCollapsed:function(){var a=this.getRange();return!a.item&&(0==a.boundingWidth||this.getSelection().isCollapsed)},collapse:function(a){var b=this.getRange(),c=this.getSelection();b.select?(b.collapse(a),b.select()):a?c.collapseToStart():c.collapseToEnd()},getContent:function(){var b=this.getRange(),c=a("<div>")[0];if(this.isCollapsed())return"";b.cloneContents?c.appendChild(b.cloneContents()):void 0!=b.item||void 0!=b.htmlText?a(c).html(b.item?b.item(0).outerHTML:b.htmlText):a(c).html(b.toString());var d=a(c).html();return d},getText:function(){var a=this.getRange(),b=this.getSelection();return this.isCollapsed()?"":a.text||(b.toString?b.toString():"")},getNode:function(){var c=this.getRange();if(!a.jqx.browser.msie||a.jqx.browser.version>=9){var d=null;if(c)for(d=c.commonAncestorContainer,c.collapsed||c.startContainer==c.endContainer&&c.startOffset-c.endOffset<2&&c.startContainer.hasChildNodes()&&(d=c.startContainer.childNodes[c.startOffset]);"element"!=typeof d;)d=d.parentNode;return b.id(d)}return b.id(c.item?c.item(0):c.parentElement())},insertContent:function(a){var b=this.getRange();if(b.pasteHTML)b.pasteHTML(a),b.collapse(!1),b.select();else if(b.insertNode)if(b.deleteContents(),b.createContextualFragment)b.insertNode(b.createContextualFragment(a));else{var c=this.document,d=c.createDocumentFragment(),e=c.createElement("div");d.appendChild(e),e.outerHTML=a,b.insertNode(d)}}};return c.initialize(b),c},c=function(){function a(a){for(var b={},c=a.split(","),d=0;d<c.length;d++)b[c[d]]=!0;return b}var b=/^<([-A-Za-z0-9_]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,c=/^<\/([-A-Za-z0-9_]+)[^>]*>/,d=/([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,e=a("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),f=a("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul"),g=a("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),h=a("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),i=a("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),j=a("script,style"),k=this.HTMLParser=function(a,k){function l(a,b,c,j){if(b=b.toLowerCase(),f[b])for(;q.last()&&g[q.last()];)m("",q.last());if(h[b]&&q.last()==b&&m("",b),j=e[b]||!!j,j||q.push(b),k.start){var l=[];c.replace(d,function(a,b){var c=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:i[b]?b:"";l.push({name:b,value:c,escaped:c.replace(/(^|[^\\])"/g,'$1\\"')})}),k.start&&k.start(b,l,j)}}function m(a,b){if(b)for(var c=q.length-1;c>=0&&q[c].toLowerCase()!=b.toLowerCase();c--);else var c=0;if(c>=0){for(var d=q.length-1;d>=c;d--)k.end&&k.end(q[d]);q.length=c}}var n,o,p,q=[],r=a;for(q.last=function(){return this[this.length-1]};a;){if(o=!0,q.last()&&j[q.last()])a=a.replace(new RegExp("(.*)</"+q.last()+"[^>]*>"),function(a,b){return b=b.replace(/<!--(.*?)-->/g,"$1").replace(/<!\[CDATA\[(.*?)]]>/g,"$1"),k.chars&&k.chars(b),""}),m("",q.last());else if(0==a.indexOf("<!--")?(n=a.indexOf("-->"),n>=0&&(k.comment&&k.comment(a.substring(4,n)),a=a.substring(n+3),o=!1)):0==a.indexOf("</")?(p=a.match(c),p&&(a=a.substring(p[0].length),p[0].replace(c,m),o=!1)):0==a.indexOf("<")&&(p=a.match(b),p&&(a=a.substring(p[0].length),p[0].replace(b,l),o=!1)),o){n=a.indexOf("<");var s=n<0?a:a.substring(0,n);a=n<0?"":a.substring(n),k.chars&&k.chars(s)}r=a}m()};this.HTMLtoXML=function(a){var b="";return a=a.replace(/\r/gi,""),a=a.replace(/\n/gi,""),k(a,{start:function(a,c,d){b+="<"+a;for(var e=0;e<c.length;e++)b+=" "+c[e].name+'="'+c[e].escaped+'"';b+=(d?"/":"")+">"},end:function(a){b+="</"+a+">\r\n"},chars:function(a){b+=a},comment:function(a){b+="<!--"+a+"-->"}}),b},this.FormatHTML=function(a,b){function c(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(a,b){for(var c=0;c<b.length;c++)if(a===b[c])return!0;return!1}},this.get_content=function(){for(var a="",b=[],c=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return b.length?b.join(""):["","TK_EOF"];if(a=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(a,this.Utils.whitespace))b.length&&(c=!0),this.line_char_count--;else{if(c){if(this.line_char_count>=this.max_char){b.push("\n");for(var d=0;d<this.indent_level;d++)b.push(this.indent_string);this.line_char_count=0}else b.push(" "),this.line_char_count++;c=!1}b.push(a)}}return b.length?b.join(""):""},this.get_contents_to=function(a){if(this.pos==this.input.length)return["","TK_EOF"];var b="",c=new RegExp("</"+a+"\\s*>","igm");c.lastIndex=this.pos;var d=c.exec(this.input),e=d?d.index:this.input.length;return this.pos<e&&(b=this.input.substring(this.pos,e),this.pos=e),b},this.record_tag=function(a){this.tags[a+"count"]?(this.tags[a+"count"]++,this.tags[a+this.tags[a+"count"]]=this.indent_level):(this.tags[a+"count"]=1,this.tags[a+this.tags[a+"count"]]=this.indent_level),this.tags[a+this.tags[a+"count"]+"parent"]=this.tags.parent,this.tags.parent=a+this.tags[a+"count"]},this.retrieve_tag=function(a){if(this.tags[a+"count"]){for(var b=this.tags.parent;b&&a+this.tags[a+"count"]!==b;)b=this.tags[b+"parent"];b&&(this.indent_level=this.tags[a+this.tags[a+"count"]],this.tags.parent=this.tags[b+"parent"]),delete this.tags[a+this.tags[a+"count"]+"parent"],delete this.tags[a+this.tags[a+"count"]],1==this.tags[a+"count"]?delete this.tags[a+"count"]:this.tags[a+"count"]--}},this.get_tag=function(){var a,b,c="",d=[],e=!1;do{if(this.pos>=this.input.length)return d.length?d.join(""):["","TK_EOF"];c=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(c,this.Utils.whitespace)?(e=!0,this.line_char_count--):("'"!==c&&'"'!==c||d[1]&&"!"===d[1]||(c+=this.get_unformatted(c),e=!0),"="===c&&(e=!1),d.length&&"="!==d[d.length-1]&&">"!==c&&e&&(this.line_char_count>=this.max_char?(this.print_newline(!1,d),this.line_char_count=0):(d.push(" "),this.line_char_count++),e=!1),"<"===c&&(a=this.pos-1),d.push(c))}while(">"!==c);var f,g=d.join("");f=g.indexOf(" ")!=-1?g.indexOf(" "):g.indexOf(">");var h=g.substring(1,f).toLowerCase();if("/"===g.charAt(g.length-2)||this.Utils.in_array(h,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===h)this.record_tag(h),this.tag_type="SCRIPT";else if("style"===h)this.record_tag(h),this.tag_type="STYLE";else if(this.Utils.in_array(h,i)){var j=this.get_unformatted("</"+h+">",g);d.push(j),a>0&&this.Utils.in_array(this.input.charAt(a-1),this.Utils.whitespace)&&d.splice(0,0,this.input.charAt(a-1)),b=this.pos-1,this.Utils.in_array(this.input.charAt(b+1),this.Utils.whitespace)&&d.push(this.input.charAt(b+1)),this.tag_type="SINGLE"}else if("!"===h.charAt(0))if(h.indexOf("[if")!=-1){if(g.indexOf("!IE")!=-1){var j=this.get_unformatted("-->",g);d.push(j)}this.tag_type="START"}else if(h.indexOf("[endif")!=-1)this.tag_type="END",this.unindent();else if(h.indexOf("[cdata[")!=-1){var j=this.get_unformatted("]]>",g);d.push(j),this.tag_type="SINGLE"}else{var j=this.get_unformatted("-->",g);d.push(j),this.tag_type="SINGLE"}else"/"===h.charAt(0)?(this.retrieve_tag(h.substring(1)),this.tag_type="END"):(this.record_tag(h),this.tag_type="START"),this.Utils.in_array(h,this.Utils.extra_liners)&&this.print_newline(!0,this.output);return d.join("")},this.get_unformatted=function(a,b){if(b&&b.indexOf(a)!=-1)return"";var c="",d="",e=!0;do{if(this.pos>=this.input.length)return d;if(c=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(c,this.Utils.whitespace)){if(!e){this.line_char_count--;continue}if("\n"===c||"\r"===c){d+="\n",this.line_char_count=0;continue}}d+=c,this.line_char_count++,e=!0}while(d.indexOf(a)==-1);return d},this.get_token=function(){var a;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var b=this.last_token.substr(7);return a=this.get_contents_to(b),"string"!=typeof a?a:[a,"TK_"+b]}if("CONTENT"===this.current_mode)return a=this.get_content(),"string"!=typeof a?a:[a,"TK_CONTENT"];if("TAG"===this.current_mode){if(a=this.get_tag(),"string"!=typeof a)return a;var c="TK_TAG_"+this.tag_type;return[a,c]}},this.get_full_indent=function(a){return a=this.indent_level+a||0,a<1?"":Array(a+1).join(this.indent_string)},this.printer=function(a,b,c,d,e){this.input=a||"",this.output=[],this.indent_character=b,this.indent_string="",this.indent_size=c,this.brace_style=e,this.indent_level=0,this.max_char=d,this.line_char_count=0;for(var f=0;f<this.indent_size;f++)this.indent_string+=this.indent_character;this.print_newline=function(a,b){if(this.line_char_count=0,b&&b.length){if(!a)for(;this.Utils.in_array(b[b.length-1],this.Utils.whitespace);)b.pop();b.push("\n");for(var c=0;c<this.indent_level;c++)b.push(this.indent_string)}},this.print_token=function(a){this.output.push(a)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var d,e,f,g,h,i;for(b=b||{},e=b.indent_size||4,f=b.indent_char||" ",h=b.brace_style||"collapse",g=1/0,i=b.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],d=new c,d.printer(a,f,e,g,h);;){var j=d.get_token();if(d.token_text=j[0],d.token_type=j[1],"TK_EOF"===d.token_type)break;switch(d.token_type){case"TK_TAG_START":d.print_newline(!1,d.output),d.print_token(d.token_text),d.indent(),d.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":d.print_newline(!1,d.output),d.print_token(d.token_text),d.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===d.last_token&&""===d.last_text){var k=d.token_text.match(/\w+/)[0],l=d.output[d.output.length-1].match(/<\s*(\w+)/);null!==l&&l[1]===k||d.print_newline(!0,d.output)}d.print_token(d.token_text),d.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var m=d.token_text.match(/^\s*<([a-z]+)/i);m&&d.Utils.in_array(m[1],i)||d.print_newline(!1,d.output),d.print_token(d.token_text),d.current_mode="CONTENT";break;case"TK_CONTENT":""!==d.token_text&&d.print_token(d.token_text),d.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==d.token_text){d.output.push("\n");var n=d.token_text;if("keep"==b.indent_scripts)var o=0;else if("separate"==b.indent_scripts)var o=-d.indent_level;else var o=1;var p=d.get_full_indent(o),q=n.match(/^\s*/)[0],r=q.match(/[^\n\r]*$/)[0].split(d.indent_string).length-1,s=d.get_full_indent(o-r);n=n.replace(/^\s*/,p).replace(/\r\n|\r|\n/g,"\n"+s).replace(/\s*$/,""),n&&(d.print_token(n),d.print_newline(!0,d.output))}d.current_mode="TAG"}d.last_token=d.token_type,d.last_text=d.token_text}return d.output.join("")}}}(jqxBaseFramework);
+

mercurial