vendor/assets/javascripts/kendo/kendo.editor.min.js in kendoui-rails-0.0.8 vs vendor/assets/javascripts/kendo/kendo.editor.min.js in kendoui-rails-0.0.9
- old
+ new
@@ -1,10 +1,13 @@
/*
-* Kendo UI Web v2012.2.710 (http://kendoui.com)
+* Kendo UI Web v2012.3.1114 (http://kendoui.com)
* Copyright 2012 Telerik AD. All rights reserved.
*
-* Kendo UI Web commercial licenses may be obtained at http://kendoui.com/web-license
+* Kendo UI Web commercial licenses may be obtained at
+* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
-;(function(a,b){var c=window.kendo,d=c.Class,e=c.ui.Widget,f=c.support.mobileOS,g=a.extend,h=c.deepExtend,i=c.keys,j=d.extend({init:function(a){var b=this;b.options=a},getHtml:function(){var a=this.options;return c.template(a.template)({cssClass:a.cssClass,tooltip:a.title,initialValue:a.initialValue})}}),k={select:function(a){a.trigger("select",{})},editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header"><tbody><tr><td class="k-editor-toolbar-wrap"><ul class="k-editor-toolbar"></ul></td></tr><tr><td class="k-editable-area"></td></tr></tbody></table>',buttonTemplate:'<li class="k-editor-button"><a href="" class="k-tool-icon #= cssClass #" unselectable="on" title="#= tooltip #">#= tooltip #</a></li>',colorPickerTemplate:'<li class="k-editor-colorpicker"><div class="k-widget k-colorpicker k-header #= cssClass #"><span class="k-tool-icon"><span class="k-selected-color"></span></span><span class="k-icon k-i-arrow-s"></span></div></li>',comboBoxTemplate:'<li class="k-editor-combobox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',dropDownListTemplate:'<li class="k-editor-selectbox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',focusable:".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",wrapTextarea:function(b){var c=b.width(),d=b.height(),e=k.editorWrapperTemplate,f=a(e).insertBefore(b).width(c).height(d),g=f.find(".k-editable-area");b.appendTo(g).addClass("k-content k-raw-content").hide();return b.closest(".k-editor")},renderTools:function(b,d){var e={},f,h,i,j=b._nativeTools,l,m,n=a(b.element).closest(".k-editor").find(".k-editor-toolbar");if(d)for(i=0;i<d.length;i++){f=d[i],a.isPlainObject(f)?f.name&&b.tools[f.name]?(a.extend(b.tools[f.name].options,f),e[f.name]=b.tools[f.name],m=e[f.name].options):(m=g({cssClass:"k-i-custom",type:"button",tooltip:""},f),m.name&&(m.cssClass="k-"+(m.name=="custom"?"i-custom":m.name)),m.template||m.type=="button"&&(m.template=k.buttonTemplate)):b.tools[f]&&(e[f]=b.tools[f],m=e[f].options);if(!m)continue;l=m.template,l&&(l.getHtml?l=l.getHtml():(a.isFunction(l)||(l=c.template(l)),l=l(m)),l.indexOf("<li")!==0&&(l="<li class='k-editor-template'>"+l+"</li>"),h=a(l).appendTo(n),m.type=="button"&&m.exec&&h.find(".k-tool-icon").click(a.proxy(m.exec,b.element[0])))}for(i=0;i<j.length;i++)e[j[i]]||(e[j[i]]=b.tools[j[i]]);b.options.tools=e},decorateStyleToolItems:function(b){var d=b.data.closest(".k-editor").find(".k-style").data("kendoSelectBox");if(!!d){var e=d.dataSource.view();d.list.find(".k-item").each(function(d,f){var g=a(f),h=g.text(),i=c.ui.editor.Dom.inlineStyle(b.data.data("kendoEditor").document,"span",{className:e[d].value});g.html('<span unselectable="on" style="display:block;'+i+'">'+h+"</span>")})}},createContentElement:function(b,c){var d,e,f,g=b.closest(".k-rtl").length?"direction:rtl;":"";b.hide(),d=a("<iframe />",{src:'javascript:"<html></html>"',frameBorder:"0"}).css("display","").addClass("k-content").insertBefore(b)[0],e=d.contentWindow||d,c.length>0&&a(d).one("load",b,k.decorateStyleToolItems),f=e.document||d.contentDocument,f.designMode="On",f.open(),f.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;font-family:Verdana,Geneva,sans-serif;background:#fff;}html{font-size:100%}body{font-size:.75em;line-height:1.5;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+g+"}"+"h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}"+"p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}"+"ul,ol{padding-left:2.5em}"+"a{color:#00a}"+"code{font-size:1.23em}"+"</style>"+a.map(c,function(a){return"<link rel='stylesheet' href='"+a+"'>"}).join("")+"</head><body></body></html>"),f.close();return e},initializeContentElement:function(b){var c=!0;b.window=k.createContentElement(a(b.textarea),b.options.stylesheets),b.document=b.window.contentDocument||b.window.document,b.body=b.document.body,a(b.document).bind({keydown:function(a){if(a.keyCode===i.F10)setTimeout(function(){var a="tabIndex",c=b.wrapper,d=c.attr(a);c.attr(a,d||0).focus().find("li:has("+m+")").first().focus(),!d&&d!==0&&c.removeAttr(a)},100),a.preventDefault();else{var d=b.keyboard.toolFromShortcut(b.options.tools,a);if(d){a.preventDefault(),/undo|redo/.test(d)||b.keyboard.endTyping(!0),b.exec(d);return!1}if(b.keyboard.isTypingKey(a)&&b.pendingFormats.hasPending())if(c)c=!1;else{var e=b.getRange();b.pendingFormats.apply(e),b.selectRange(e)}b.keyboard.clearTimeout(),b.keyboard.keydown(a)}},keyup:function(d){var e=[8,9,33,34,35,36,37,38,39,40,40,45,46];if(a.inArray(d.keyCode,e)>-1||d.keyCode==65&&d.ctrlKey&&!d.altKey&&!d.shiftKey)b.pendingFormats.clear(),l(b);if(b.keyboard.isTypingKey(d)){if(b.pendingFormats.hasPending()){var f=b.getRange();b.pendingFormats.apply(f),b.selectRange(f)}}else c=!0;b.keyboard.keyup(d)},mousedown:function(c){b.pendingFormats.clear();var d=a(c.target);!a.browser.gecko&&c.which==2&&d.is("a[href]")&&window.open(d.attr("href"),"_new")},mouseup:function(){l(b)}}),a(b.window).bind("blur",function(){var a=b.textarea.value,c=b.encodedValue();b.update(),c!=a&&b.trigger("change")}),a(b.body).bind("cut paste",function(a){b.clipboard["on"+a.type](a)})},formatByName:function(b,c){for(var d=0;d<c.length;d++)if(a.inArray(b,c[d].tags)>=0)return c[d]},registerTool:function(a,b){var c=s.fn._tools;c[a]=b,c[a].options&&c[a].options.template&&(c[a].options.template.options.cssClass="k-"+a)},registerFormat:function(a,b){c.ui.Editor.fn.options.formats[a]=b}},l=k.select,m=k.focusable,n=k.wrapTextarea,o=k.renderTools,p=k.initializeContentElement,q={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found."},r=!f||f.ios&&f.flatVersion>=500||!f.ios&&typeof document.documentElement.contentEditable!="undefined",s=e.extend({init:function(b,d){function t(a,b){if(!b.key)return a;var c=a+" (";b.ctrl&&(c+="Ctrl + "),b.shift&&(c+="Shift + "),b.alt&&(c+="Alt + "),c+=b.key+")";return c}function s(b){var c=a.grep(b.className.split(" "),function(a){return!/^k-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(a)});return c[0]?c[0].substring(c[0].lastIndexOf("-")+1):"custom"}if(!!r){var f=this,g,j,k=c.ui.editor;e.fn.init.call(f,b,d),f.tools=h({},c.ui.Editor.fn._tools),f.options=h({},f.options,d),b=a(b),b.closest("form").bind("submit",function(){f.update()});for(var l in f.tools)f.tools[l].name=l.toLowerCase();f.textarea=b.attr("autocomplete","off")[0],g=f.wrapper=n(b),o(f,f.options.tools),p(f),f.keyboard=new k.Keyboard([new k.TypingHandler(f),new k.SystemHandler(f)]),f.clipboard=new k.Clipboard(this),f.pendingFormats=new k.PendingFormats(this),f.undoRedoStack=new k.UndoRedoStack,d&&d.value?j=d.value:j=b.val().replace(/[\r\n\v\f\t ]+/ig," "),f.value(j);var u=".k-editor-toolbar > li > *, .k-editor-toolbar > li select",v=".k-editor-button .k-tool-icon",w=v+":not(.k-state-disabled)",x=v+".k-state-disabled";g.find(".k-combobox .k-input").keydown(function(b){var c=a(this).closest(".k-combobox").data("kendoComboBox"),d=b.keyCode;d==i.RIGHT||d==i.LEFT?c.close():d==i.DOWN&&(c.dropDown.isOpened()||(b.stopImmediatePropagation(),c.open()))}),g.delegate(w,"mouseenter",function(){a(this).addClass("k-state-hover")}).delegate(w,"mouseleave",function(){a(this).removeClass("k-state-hover")}).delegate(v,"mousedown",!1).delegate(m,"keydown",function(b){var c=a(this).closest("li"),d="li:has("+m+")",e,g=b.keyCode;if(g==i.RIGHT)e=c.nextAll(d).first().find(m);else if(g==i.LEFT)e=c.prevAll(d).last().find(m);else if(g==i.ESC)e=f;else if(g==i.TAB&&!b.ctrlKey&&!b.altKey)if(b.shiftKey){e=c.prevAll(d).last().find(m);if(e.length)b.preventDefault();else return}else b.preventDefault(),e=c.nextAll(d).first().find(m),e.length||(e=f);e&&e.focus()}).delegate(w,"click",function(a){a.preventDefault(),a.stopPropagation(),f.exec(s(this))}).delegate(x,"click",function(a){a.preventDefault()}).find(u).each(function(){var b=s(this),c=f.options,d=c.tools[b],e=c.messages[b],g=a(this);if(!!d){if(b=="fontSize"||b=="fontName"){var h=c.messages[b+"Inherit"]||q[b+"Inherit"];g.find("input").val(h).end().find("span.k-input").text(h).end()}d.initialize(g,{title:t(e,d),editor:f})}}),f.bind("select",function(){var b=f.getRange(),c=k.RangeUtils.textNodes(b);c.length||(c=[b.startContainer]),g.find(u).each(function(){var b=f.options.tools[s(this)];b&&b.update(a(this),c,f.pendingFormats)})}),a(document).bind("DOMNodeInserted",function(b){var c=f.wrapper;if(a.contains(b.target,c[0])||c[0]==b.target)f.textarea.value=f.value(),c.find("iframe").remove(),p(f)}).bind("mousedown",function(a){try{f.keyboard.isTypingInProgress()&&f.keyboard.endTyping(!0),f.selectionRestorePoint||(f.selectionRestorePoint=new k.RestorePoint(f.getRange()))}catch(a){}}),c.notify(f)}},events:["select","change","execute","error","paste"],options:{name:"Editor",messages:q,formats:{},encoded:!0,stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:["bold","italic","underline","strikethrough","fontName","fontSize","foreColor","backColor","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","indent","outdent","formatBlock","createLink","unlink","insertImage"]},_nativeTools:["insertLineBreak","insertParagraph","redo","undo","insertHtml"],_tools:{undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},tools:{},value:function(d){var e=this.body,f=c.ui.editor.Dom;if(d===b)return c.ui.editor.Serializer.domToXhtml(e);this.pendingFormats.clear(),d=(d||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/ig,"<telerik:script $1>$2</telerik:script>").replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1"),a.browser.msie||(d=d.replace(/<p([^>]*)>(\s*)?<\/p>/ig,'<p $1><br _moz_dirty="" /></p>'));if(a.browser.msie&&parseInt(a.browser.version,10)<9){d="<br/>"+d;var g="originalsrc",h="originalhref";d=d.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,h+'="$1"'),d=d.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,g+'="$1"'),e.innerHTML=d,f.remove(e.firstChild),a(e).find("telerik\\:script,script,link,img,a").each(function(){var a=this;a[h]&&(a.setAttribute("href",a[h]),a.removeAttribute(h)),a[g]&&(a.setAttribute("src",a[g]),a.removeAttribute(g))})}else e.innerHTML=d,a.browser.msie&&f.normalize(e);this.selectionRestorePoint=null,this.update()},focus:function(){this.window.focus()},update:function(a){this.textarea.value=a||this.options.encoded?this.encodedValue():this.value()},encodedValue:function(){return c.ui.editor.Dom.encode(this.value())},createRange:function(a){return c.ui.editor.RangeUtils.createRange(a||this.document)},getSelection:function(){return c.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(a){this.focus();var b=this.getSelection();b.removeAllRanges(),b.addRange(a)},getRange:function(){var a=this.getSelection(),b=a.rangeCount>0?a.getRangeAt(0):this.createRange(),c=this.document;b.startContainer==c&&b.endContainer==c&&!b.startOffset&&!b.endOffset&&(b.setStart(this.body,0),b.collapse(!0));return b},selectedHtml:function(){return c.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(a){this.clipboard.paste(a)},exec:function(b,c){var d=this,e,f,h,i="",j;b=b.toLowerCase(),d.keyboard.isTypingInProgress()||(d.focus(),e=d.getRange(),f=d.document.body);for(h in d.options.tools)if(h.toLowerCase()==b){i=d.options.tools[h];break}if(i){e=d.getRange();if(!/undo|redo/i.test(b)&&i.willDelayExecution(e)){j=a.extend({},i),a.extend(j.options,{params:c}),d.pendingFormats.toggle(j),l(d);return}var k=i.command?i.command(g({range:e},c)):null;d.trigger("execute",{name:b,command:k});if(/undo|redo/i.test(b))d.undoRedoStack[b]();else if(k){k.managesUndoRedo||d.undoRedoStack.push(k),k.editor=d,k.exec();if(k.async){k.change=a.proxy(function(){l(d)},d);return}}l(d)}}});c.ui.plugin(s);var t=d.extend({init:function(a){this.options=a},initialize:function(a,b){a.attr({unselectable:"on",title:b.title})},command:function(a){return new this.options.command(a)},update:function(){},willDelayExecution:function(){return!1}});t.exec=function(a,b,c){a.exec(b,{value:c})};var u=t.extend({init:function(a){t.fn.init.call(this,a)},command:function(a){var b=this;return new c.ui.editor.FormatCommand(g(a,{formatter:b.options.formatter}))},update:function(a,b,c){var d=c.isPending(this.name),e=this.options.finder.isFormatted(b),f=d?!e:e;a.toggleClass("k-state-active",f)}});g(c.ui,{editor:{ToolTemplate:j,EditorUtils:k,Tool:t,FormatTool:u}})})(jQuery),function(a){function k(a){var b={},c,d;for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var b=window.kendo,c=a.map,d=a.extend,e="style",f="float",g="cssFloat",h="styleFloat",i="class",j="k-marker",l=k("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),m="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,pre,script,table,tbody,td,tfoot,th,thead,tr,ul".split(","),n=k(m),o="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var".split(","),p=k(o),q=k("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),r=function(a){a.nodeType==1&&a.normalize()};a.browser.msie&&parseInt(a.browser.version,10)>=8&&(r=function(a){if(a.nodeType==1&&a.firstChild){var b=a.firstChild,c=b;for(;;){c=c.nextSibling;if(!c)break;c.nodeType==3&&b.nodeType==3&&(c.nodeValue=b.nodeValue+c.nodeValue,A.remove(b)),b=c}}});var s=/^\s+$/,t=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,u=/&/g,v=/</g,w=/>/g,x=/\u00a0/g,y=/\ufeff/g,z="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),A={findNodeIndex:function(a){var b=0;for(;;){a=a.previousSibling;if(!a)break;b++}return b},isDataNode:function(a){return a&&a.nodeValue!==null&&a.data!==null},isAncestorOf:function(b,c){try{return!A.isDataNode(b)&&(a.contains(b,A.isDataNode(c)?c.parentNode:c)||c.parentNode==b)}catch(d){return!1}},isAncestorOrSelf:function(a,b){return A.isAncestorOf(a,b)||a==b},findClosestAncestor:function(a,b){if(A.isAncestorOf(a,b))while(b&&b.parentNode!=a)b=b.parentNode;return b},getNodeLength:function(a){return A.isDataNode(a)?a.length:a.childNodes.length},splitDataNode:function(a,b){var c=a.cloneNode(!1);a.deleteData(b,a.length),c.deleteData(0,b),A.insertAfter(c,a)},attrEquals:function(b,c){for(var d in c){var e=b[d];d==f&&(e=b[a.support.cssFloat?g:h]);if(typeof e=="object"){if(!A.attrEquals(e,c[d]))return!1}else if(e!=c[d])return!1}return!0},blockParentOrBody:function(a){return A.parentOfType(a,m)||a.ownerDocument.body},blockParents:function(b){var c=[],d,e;for(d=0,e=b.length;d<e;d++){var f=A.parentOfType(b[d],A.blockElements);f&&a.inArray(f,c)<0&&c.push(f)}return c},windowFromDocument:function(a){return a.defaultView||a.parentWindow},normalize:r,blockElements:m,inlineElements:o,empty:l,fillAttrs:q,toHex:function(a){var b=t.exec(a);if(!b)return a;return"#"+c(b.slice(1),function(a){a=parseInt(a,10).toString(16);return a.length>1?a:"0"+a}).join("")},encode:function(a){return a.replace(u,"&").replace(v,"<").replace(w,">").replace(x," ")},name:function(a){return a.nodeName.toLowerCase()},significantChildNodes:function(b){return a.grep(b.childNodes,function(a){return a.nodeType!=3||!A.isWhitespace(a)})},lastTextNode:function(a){var b=null;if(a.nodeType==3)return a;for(var c=a.lastChild;c;c=c.previousSibling){b=A.lastTextNode(c);if(b)return b}return b},is:function(a,b){return A.name(a)==b},isMarker:function(a){return a.className==j},isWhitespace:function(a){return s.test(a.nodeValue)},isBlock:function(a){return n[A.name(a)]},isEmpty:function(a){return l[A.name(a)]},isInline:function(a){return p[A.name(a)]},scrollTo:function(b){b.ownerDocument.body.scrollTop=a(A.isDataNode(b)?b.parentNode:b).offset().top},insertAt:function(a,b,c){a.insertBefore(b,a.childNodes[c]||null)},insertBefore:function(a,b){return b.parentNode?b.parentNode.insertBefore(a,b):b},insertAfter:function(a,b){return b.parentNode.insertBefore(a,b.nextSibling)},remove:function(a){a.parentNode.removeChild(a)},trim:function(a){for(var b=a.childNodes.length-1;b>=0;b--){var c=a.childNodes[b];A.isDataNode(c)?(c.nodeValue.replace(y,"").length||A.remove(c),A.isWhitespace(c)&&A.insertBefore(c,a)):c.className!=j&&(A.trim(c),!c.childNodes.length&&!A.isEmpty(c)&&A.remove(c))}return a},parentOfType:function(a,b){do a=a.parentNode;while(a&&!A.ofType(a,b));return a},ofType:function(b,c){return a.inArray(A.name(b),c)>=0},changeTag:function(a,b){var c=A.create(a.ownerDocument,b),d=a.attributes,f,g,h,j,k;for(f=0,g=d.length;f<g;f++)k=d[f],k.specified&&(h=k.nodeName,j=k.nodeValue,h==i?c.className=j:h==e?c.style.cssText=a.style.cssText:c.setAttribute(h,j));while(a.firstChild)c.appendChild(a.firstChild);A.insertBefore(c,a),A.remove(a);return c},wrap:function(a,b){A.insertBefore(b,a),b.appendChild(a);return b},unwrap:function(a){var b=a.parentNode;while(a.firstChild)b.insertBefore(a.firstChild,a);b.removeChild(a)},create:function(a,b,c){return A.attr(a.createElement(b),c)},attr:function(a,b){b=d({},b),b&&e in b&&(A.style(a,b.style),delete b.style);return d(a,b)},style:function(b,c){a(b).css(c||{})},unstyle:function(b,c){for(var d in c)d==f&&(d=a.support.cssFloat?g:h),b.style[d]="";b.style.cssText===""&&b.removeAttribute(e)},inlineStyle:function(b,d,e){var f=a(A.create(b,d,e)),g;b.body.appendChild(f[0]),g=c(z,function(b){return a.browser.msie&&b=="line-height"&&f.css(b)=="1px"?"line-height:1.5":b+":"+f.css(b)}).join(";"),f.remove();return g},removeClass:function(b,c){var d=" "+b.className+" ",e=c.split(" "),f,g;for(f=0,g=e.length;f<g;f++)d=d.replace(" "+e[f]+" "," ");d=a.trim(d),d.length?b.className=d:b.removeAttribute(i)},commonAncestor:function(){var a=arguments.length,b=[],c=Infinity,d=null,e,f,g,h,i;if(!a)return null;if(a==1)return arguments[0];for(e=0;e<a;e++){f=[],g=arguments[e];while(g)f.push(g),g=g.parentNode;b.push(f.reverse()),c=Math.min(c,f.length)}if(a==1)return b[0][0];for(e=0;e<c;e++){h=b[0][e];for(i=1;i<a;i++)if(h!=b[i][e])return d;d=h}return d}};b.ui.editor.Dom=A}(jQuery),function(a,b){var c=window.kendo,d=c.ui.editor,e=d.Dom,f=a.extend,g="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),h=/"/g,i=/<br[^>]*>/i,j=/<p><\/p>/i,k={domToXhtml:function(c){function m(b,c){var g=b.nodeType,h,i,j,m,n;if(g==1){h=e.name(b);if(!h||b.attributes._moz_dirty&&e.is(b,"br"))return;i=f[h];if(i){i.start(b),l(b),i.end(b);return}d.push("<"),d.push(h),k(b),e.empty[h]?d.push(" />"):(d.push(">"),l(b,c||e.is(b,"pre")),d.push("</"),d.push(h),d.push(">"))}else if(g==3){m=b.nodeValue;if(!c&&a.support.leadingWhitespace){j=b.parentNode,n=b.previousSibling,n||(n=(e.isInline(j)?j:b).previousSibling);if(!n||n.innerHTML===""||e.isBlock(n))m=m.replace(/^[\r\n\v\f\t ]+/,"");m=m.replace(/ +/," ")}d.push(e.encode(m))}else g==4?(d.push("<![CDATA["),d.push(b.data),d.push("]]>")):g==8&&(b.data.indexOf("[CDATA[")<0?(d.push("<!--"),d.push(b.data),d.push("-->")):(d.push("<!"),d.push(b.data),d.push(">")))}function l(a,b){for(var c=a.firstChild;c;c=c.nextSibling)m(c,b)}function k(c){var f=[],g=c.attributes,i,j,k,l=a.trim;if(e.is(c,"img")){var m=c.style.width,n=c.style.height,o=a(c);m&&(o.attr("width",parseInt(m,10)),e.unstyle(c,{width:b})),n&&(o.attr("height",parseInt(n,10)),e.unstyle(c,{height:b}))}for(j=0,k=g.length;j<k;j++){i=g[j];var p=i.nodeName;(i.specified||p=="value"&&!c.value||p=="type"&&i.nodeValue=="text")&&p.indexOf("_moz")<0&&p!="complete"&&p!="altHtml"&&f.push(i)}if(!!f.length){f.sort(function(a,b){return a.nodeName>b.nodeName?1:a.nodeName<b.nodeName?-1:0});for(j=0,k=f.length;j<k;j++){i=f[j];var q=i.nodeName,r=i.nodeValue;d.push(" "),d.push(q),d.push('="');if(q=="style"){var s=l(r||c.style.cssText).split(";");for(var t=0,u=s.length;t<u;t++){var v=s[t];if(v.length){var w=v.split(":"),x=l(w[0].toLowerCase()),y=l(w[1]);if(x=="font-size-adjust"||x=="font-stretch")continue;x.indexOf("color")>=0&&(y=e.toHex(y)),x.indexOf("font")>=0&&(y=y.replace(h,"'")),d.push(x),d.push(":"),d.push(y),d.push(";")}}}else q=="src"||q=="href"?d.push(c.getAttribute(q,2)):d.push(e.fillAttrs[q]?q:r);d.push('"')}}}var d=[],f={"telerik:script":{start:function(a){d.push("<script"),k(a),d.push(">")},end:function(){d.push("</script>")}},b:{start:function(){d.push("<strong>")},end:function(){d.push("</strong>")}},i:{start:function(){d.push("<em>")},end:function(){d.push("</em>")}},u:{start:function(){d.push('<span style="text-decoration:underline;">')},end:function(){d.push("</span>")}},iframe:{start:function(a){d.push("<iframe"),k(a),d.push(">")},end:function(){d.push("</iframe>")}},font:{start:function(a){d.push('<span style="');var b=a.getAttribute("color"),c=g[a.getAttribute("size")],f=a.getAttribute("face");b&&(d.push("color:"),d.push(e.toHex(b)),d.push(";")),f&&(d.push("font-face:"),d.push(f),d.push(";")),c&&(d.push("font-size:"),d.push(c),d.push(";")),d.push('">')},end:function(a){d.push("</span>")}}};l(c),d=d.join("");if(d.replace(i,"").replace(j,"")==="")return"";return d}};f(d,{Serializer:k})}(jQuery),function(a){function t(a,b,c){var d=f.create(b.ownerDocument,"a"),e=a.duplicate();e.collapse(c);var g=e.parentElement();do g.insertBefore(d,d.previousSibling),e.moveToElementText(d);while(e.compareEndPoints(c?"StartToStart":"StartToEnd",a)>0&&d.previousSibling);e.setEndPoint(c?"EndToStart":"EndToEnd",a);var i=d.nextSibling;i?(f.remove(d),h(i)?b[c?"setStart":"setEnd"](i,e.text.length):b[c?"setStartBefore":"setEndBefore"](i)):(i=d.previousSibling,i&&h(i)?(b.setEnd(i,i.nodeValue.length),f.remove(d)):(b.selectNodeContents(g),f.remove(d),b.endOffset-=1))}function s(a,b,c){var d=b[c?"startContainer":"endContainer"],e=b[c?"startOffset":"endOffset"],g=0,i=h(d)?d:d.childNodes[e]||null,j=h(d)?d.parentNode:d;if(d.nodeType==3||d.nodeType==4)g=e;var k=j.insertBefore(f.create(b.ownerDocument,"a"),i),l=b.ownerDocument.body.createTextRange();l.moveToElementText(k),f.remove(k),l[c?"moveStart":"moveEnd"]("character",g),l.collapse(!1),a.setEndPoint(c?"StartToStart":"EndToStart",l)}function p(a){a.collapsed=a.startContainer==a.endContainer&&a.startOffset==a.endOffset;var b=a.startContainer;while(b&&b!=a.endContainer&&!f.isAncestorOf(b,a.endContainer))b=b.parentNode;a.commonAncestorContainer=b}function o(a,b){function c(a){try{return n(a.startContainer,a.endContainer,a.startOffset,a.endOffset)<0}catch(b){return!0}}c(a)&&(b?(a.commonAncestorContainer=a.endContainer=a.startContainer,a.endOffset=a.startOffset):(a.commonAncestorContainer=a.startContainer=a.endContainer,a.startOffset=a.endOffset),a.collapsed=!0)}function n(a,b,c,d){if(a==b)return d-c;var e=b;while(e&&e.parentNode!=a)e=e.parentNode;if(e)return g(e)-c;e=a;while(e&&e.parentNode!=b)e=e.parentNode;if(e)return d-g(e)-1;var h=f.commonAncestor(a,b),i=a;while(i&&i.parentNode!=h)i=i.parentNode;i||(i=h);var j=b;while(j&&j.parentNode!=h)j=j.parentNode;j||(j=h);if(i==j)return 0;return g(j)-g(i)}var b=window.kendo,c=b.Class,d=a.extend,e=b.ui.editor,f=e.Dom,g=f.findNodeIndex,h=f.isDataNode,i=f.findClosestAncestor,j=f.getNodeLength,k=f.normalize,l={selectionFromWindow:function(b){if(a.browser.msie&&a.browser.version<9)return new r(b.document);return b.getSelection()},selectionFromRange:function(a){var b=y.documentFromRange(a);return l.selectionFromDocument(b)},selectionFromDocument:function(a){return l.selectionFromWindow(f.windowFromDocument(a))}},m=c.extend({init:function(b){a.extend(this,{ownerDocument:b,startContainer:b,endContainer:b,commonAncestorContainer:b,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(a,b){this.startContainer=a,this.startOffset=b,p(this),o(this,!0)},setEnd:function(a,b){this.endContainer=a,this.endOffset=b,p(this),o(this,!1)},setStartBefore:function(a){this.setStart(a.parentNode,g(a))},setStartAfter:function(a){this.setStart(a.parentNode,g(a)+1)},setEndBefore:function(a){this.setEnd(a.parentNode,g(a))},setEndAfter:function(a){this.setEnd(a.parentNode,g(a)+1)},selectNode:function(a){this.setStartBefore(a),this.setEndAfter(a)},selectNodeContents:function(a){this.setStart(a,0),this.setEnd(a,a[a.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(a){var b=this;a?b.setEnd(b.startContainer,b.startOffset):b.setStart(b.endContainer,b.endOffset)},deleteContents:function(){var a=this,b=a.cloneRange();a.startContainer!=a.commonAncestorContainer&&a.setStartAfter(i(a.commonAncestorContainer,a.startContainer)),a.collapse(!0),function c(a){while(a.next())a.hasPartialSubtree()?c(a.getSubtreeIterator()):a.remove()}(new q(b))},cloneContents:function(){var a=y.documentFromRange(this);return function b(c){var d,e=a.createDocumentFragment();while(d=c.next())d=d.cloneNode(!c.hasPartialSubtree()),c.hasPartialSubtree()&&d.appendChild(b(c.getSubtreeIterator())),e.appendChild(d);return e}(new q(this))},extractContents:function(){var a=this,b=a.cloneRange();a.startContainer!=a.commonAncestorContainer&&a.setStartAfter(i(a.commonAncestorContainer,a.startContainer)),a.collapse(!0);var c=y.documentFromRange(a);return function d(b){var e,f=c.createDocumentFragment();while(e=b.next())b.hasPartialSubtree()?(e=e.cloneNode(!1),e.appendChild(d(b.getSubtreeIterator()))):b.remove(a.originalRange),f.appendChild(e);return f}(new q(b))},insertNode:function(a){var b=this;h(b.startContainer)?(b.startOffset!=b.startContainer.nodeValue.length&&f.splitDataNode(b.startContainer,b.startOffset),f.insertAfter(a,b.startContainer)):f.insertAt(b.startContainer,a,b.startOffset),b.setStart(b.startContainer,b.startOffset)},cloneRange:function(){return a.extend(new m(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var a=this.startContainer.nodeName,b=this.endContainer.nodeName;return[a=="#text"?this.startContainer.nodeValue:a,"(",this.startOffset,") : ",b=="#text"?this.endContainer.nodeValue:b,"(",this.endOffset,")"].join("")}}),q=c.extend({init:function(b){a.extend(this,{range:b,_current:null,_next:null,_end:null});if(!b.collapsed){var c=b.commonAncestorContainer;this._next=b.startContainer==c&&!h(b.startContainer)?b.startContainer.childNodes[b.startOffset]:i(c,b.startContainer),this._end=b.endContainer==c&&!h(b.endContainer)?b.endContainer.childNodes[b.endOffset]:i(c,b.endContainer).nextSibling}},hasNext:function(){return!!this._next},next:function(){var a=this,b=a._current=a._next;a._next=a._current&&a._current.nextSibling!=a._end?a._current.nextSibling:null,h(a._current)&&(a.range.endContainer==a._current&&(b=b.cloneNode(!0),b.deleteData(a.range.endOffset,b.length-a.range.endOffset)),a.range.startContainer==a._current&&(b=b.cloneNode(!0),b.deleteData(0,a.range.startOffset)));return b},traverse:function(a){function d(){b._current=b._next,b._next=b._current&&b._current.nextSibling!=b._end?b._current.nextSibling:null;return b._current}var b=this,c;while(c=d())b.hasPartialSubtree()?b.getSubtreeIterator().traverse(a):a(c);return c},remove:function(a){var b=this,c=b.range.startContainer==b._current,d=b.range.endContainer==b._current,e,i,j;if(h(b._current)&&(c||d))e=c?b.range.startOffset:0,i=d?b.range.endOffset:b._current.length,j=i-e,a&&(c||d)&&(b._current==a.startContainer&&e<=a.startOffset&&(a.startOffset-=j),b._current==a.endContainer&&i<=a.endOffset&&(a.endOffset-=j)),b._current.deleteData(e,j);else{var k=b._current.parentNode;if(a&&(b.range.startContainer==k||b.range.endContainer==k)){var l=g(b._current);k==a.startContainer&&l<=a.startOffset&&(a.startOffset-=1),k==a.endContainer&&l<a.endOffset&&(a.endOffset-=1)}f.remove(b._current)}},hasPartialSubtree:function(){return!h(this._current)&&(f.isAncestorOrSelf(this._current,this.range.startContainer)||f.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var a=this,b=a.range.cloneRange();b.selectNodeContents(a._current),f.isAncestorOrSelf(a._current,a.range.startContainer)&&b.setStart(a.range.startContainer,a.range.startOffset),f.isAncestorOrSelf(a._current,a.range.endContainer)&&b.setEnd(a.range.endContainer,a.range.endOffset);return new q(b)}}),r=c.extend({init:function(a){this.ownerDocument=a,this.rangeCount=1},addRange:function(a){var b=this.ownerDocument.body.createTextRange();s(b,a,!1),s(b,a,!0),b.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var a,b=new m(this.ownerDocument),c=this.ownerDocument.selection,d;try{a=c.createRange(),d=a.item?a.item(0):a.parentElement();if(d.ownerDocument!=this.ownerDocument)return b}catch(e){return b}if(c.type=="Control")b.selectNode(a.item(0));else{t(a,b,!0),t(a,b,!1),b.startContainer.nodeType==9&&b.setStart(b.endContainer,b.startOffset),b.endContainer.nodeType==9&&b.setEnd(b.startContainer,b.endOffset),a.compareEndPoints("StartToEnd",a)===0&&b.collapse(!1);var f=b.startContainer,i=b.endContainer,k=this.ownerDocument.body;if(!b.collapsed&&b.startOffset===0&&b.endOffset==j(b.endContainer)&&(f!=i||!h(f)||f.parentNode!=k)){var l=!1,n=!1;while(g(f)===0&&f==f.parentNode.firstChild&&f!=k)f=f.parentNode,l=!0;while(g(i)==j(i.parentNode)-1&&i==i.parentNode.lastChild&&i!=k)i=i.parentNode,n=!0;f==k&&i==k&&l&&n&&(b.setStart(f,0),b.setEnd(i,j(k)))}}return b}}),u=c.extend({init:function(a){this.enumerate=function(){function c(a){if(f.is(a,"img")||a.nodeType==3&&!f.isWhitespace(a))b.push(a);else{a=a.firstChild;while(a)c(a),a=a.nextSibling}}var b=[];(new q(a)).traverse(c);return b}}}),v=c.extend({init:function(a){var b=this;b.range=a,b.rootNode=y.documentFromRange(a),b.body=b.rootNode.body,b.html=b.body.innerHTML,b.startContainer=b.nodeToPath(a.startContainer),b.endContainer=b.nodeToPath(a.endContainer),b.startOffset=b.offset(a.startContainer,a.startOffset),b.endOffset=b.offset(a.endContainer,a.endOffset)},index:function(a){var b=0,c=a.nodeType;while(a=a.previousSibling){var d=a.nodeType;(d!=3||c!=d)&&b++,c=d}return b},offset:function(a,b){if(a.nodeType==3)while((a=a.previousSibling)&&a.nodeType==3)b+=a.nodeValue.length;return b},nodeToPath:function(a){var b=[];while(a!=this.rootNode)b.push(this.index(a)),a=a.parentNode;return b},toRangePoint:function(a,b,c,d){var e=this.rootNode,f=c.length,g=d;while(f--)e=e.childNodes[c[f]];while(e.nodeType==3&&e.nodeValue.length<g)g-=e.nodeValue.length,e=e.nextSibling;a[b?"setStart":"setEnd"](e,g)},toRange:function(){var a=this,b=a.range.cloneRange();a.toRangePoint(b,!0,a.startContainer,a.startOffset),a.toRangePoint(b,!1,a.endContainer,a.endOffset);return b}}),w=c.extend({init:function(){this.caret=null},addCaret:function(a){var b=this;b.caret=f.create(y.documentFromRange(a),"span",{className:"k-marker"}),a.insertNode(b.caret),a.selectNode(b.caret);return b.caret},removeCaret:function(b){var c=this,d=c.caret.previousSibling,e=0;d&&(e=h(d)?d.nodeValue.length:g(d));var i=c.caret.parentNode,j=d?g(d):0;f.remove(c.caret),k(i);var l=i.childNodes[j];if(h(l))b.setStart(l,e);else if(l){var m=f.lastTextNode(l);m?b.setStart(m,m.nodeValue.length):b[d?"setStartAfter":"setStartBefore"](l)}else!a.browser.msie&&!i.innerHTML&&(i.innerHTML='<br _moz_dirty="" />'),b.selectNodeContents(i);b.collapse(!0)},add:function(a,b){var c=this;b&&a.collapsed&&(c.addCaret(a),a=y.expand(a));var d=a.cloneRange();d.collapse(!1),c.end=f.create(y.documentFromRange(a),"span",{className:"k-marker"}),d.insertNode(c.end),d=a.cloneRange(),d.collapse(!0),c.start=c.end.cloneNode(!0),d.insertNode(c.start),a.setStartBefore(c.start),a.setEndAfter(c.end),k(a.commonAncestorContainer);return a},remove:function(a){var b=this,c=b.start,d=b.end,e,i,j;k(a.commonAncestorContainer);while(!c.nextSibling&&c.parentNode)c=c.parentNode;while(!d.previousSibling&&d.parentNode)d=d.parentNode;e=c.previousSibling&&c.previousSibling.nodeType==3&&c.nextSibling&&c.nextSibling.nodeType==3,i=d.previousSibling&&d.previousSibling.nodeType==3&&d.nextSibling&&d.nextSibling.nodeType==3,j=e&&i,c=c.nextSibling,d=d.previousSibling;var l=!1,m=!1;c==b.end&&(m=!!b.start.previousSibling,c=d=b.start.previousSibling||b.end.nextSibling,l=!0),f.remove(b.start),f.remove(b.end);if(!c||!d)a.selectNodeContents(a.commonAncestorContainer),a.collapse(!0);else{var n=l?h(c)?c.nodeValue.length:c.childNodes.length:0,o=h(d)?d.nodeValue.length:d.childNodes.length;if(c.nodeType==3)while(c.previousSibling&&c.previousSibling.nodeType==3)c=c.previousSibling,n+=c.nodeValue.length;if(d.nodeType==3)while(d.previousSibling&&d.previousSibling.nodeType==3)d=d.previousSibling,o+=d.nodeValue.length;var p=g(c),q=c.parentNode,r=g(d),s=d.parentNode;for(var t=c;t.previousSibling;t=t.previousSibling)t.nodeType==3&&t.previousSibling.nodeType==3&&p--;for(var u=d;u.previousSibling;u=u.previousSibling)u.nodeType==3&&u.previousSibling.nodeType==3&&r--;k(q),c.nodeType==3&&(c=q.childNodes[p]),k(s),d.nodeType==3&&(d=s.childNodes[r]),l?(c.nodeType==3?a.setStart(c,n):a[m?"setStartAfter":"setStartBefore"](c),a.collapse(!0)):(c.nodeType==3?a.setStart(c,n):a.setStartBefore(c),d.nodeType==3?a.setEnd(d,o):a.setEndAfter(d)),b.caret&&b.removeCaret(a)}}}),x=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,y={nodes:function(a){var b=y.textNodes(a);b.length||(a.selectNodeContents(a.commonAncestorContainer),b=y.textNodes(a),b.length||(b=f.significantChildNodes(a.commonAncestorContainer)));return b},textNodes:function(a){return(new u(a)).enumerate()},documentFromRange:function(a){var b=a.startContainer;return b.nodeType==9?b:b.ownerDocument},createRange:function(b){if(a.browser.msie&&a.browser.version<9)return new m(b);return b.createRange()},selectRange:function(a){var b=y.image(a);b&&(a.setStartAfter(b),a.setEndAfter(b));var c=l.selectionFromRange(a);c.removeAllRanges(),c.addRange(a)},split:function(a,b,c){function d(d){var e=a.cloneRange();e.collapse(d),e[d?"setStartBefore":"setEndAfter"](b);var g=e.extractContents();c&&(g=f.trim(g)),f[d?"insertBefore":"insertAfter"](g,b)}d(!0),d(!1)},getMarkers:function(a){var b=[];(new q(a)).traverse(function(a){a.className=="k-marker"&&b.push(a)});return b},image:function(a){var b=[];(new q(a)).traverse(function(a){f.is(a,"img")&&b.push(a)});if(b.length==1)return b[0]},expand:function(a){var b=a.cloneRange(),c=b.startContainer.childNodes[b.startOffset===0?0:b.startOffset-1],d=b.endContainer.childNodes[b.endOffset];if(!h(c)||!h(d))return b;var e=c.nodeValue,f=d.nodeValue;if(!e||!f)return b;var g=e.split("").reverse().join("").search(x),i=f.search(x);if(!g||!i)return b;i=i==-1?f.length:i,g=g==-1?0:e.length-g,b.setStart(c,g),b.setEnd(d,i);return b},isExpandable:function(a){var b=a.startContainer,c=y.documentFromRange(a);if(b==c||b==c.body)return!1;var d=a.cloneRange(),e=b.nodeValue;if(!e)return!1;var f=e.substring(0,d.startOffset),g=e.substring(d.startOffset),h=0,i=0;f&&(h=f.split("").reverse().join("").search(x)),g&&(i=g.search(x));return h&&i}};d(e,{SelectionUtils:l,W3CRange:m,RangeIterator:q,W3CSelection:r,RangeEnumerator:u,RestorePoint:v,Marker:w,RangeUtils:y})}(jQuery),function(a){var b=window.kendo,c=b.Class,d=b.ui.editor,e=d.EditorUtils,f=e.registerTool,g=d.Dom,h=d.RangeUtils,i=h.selectRange,j=d.Tool,k=d.ToolTemplate,l=d.RestorePoint,m=d.Marker,n=a.extend,o=c.extend({init:function(a){var b=this;b.options=a,b.restorePoint=new l(a.range),b.marker=new m,b.formatter=a.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(a){return this.marker.add(this.getRange(),a)},releaseRange:function(a){this.marker.remove(a),i(a)},undo:function(){var a=this.restorePoint;a.body.innerHTML=a.html,i(a.toRange())},redo:function(){this.exec()},exec:function(){var a=this,b=a.lockRange(!0);a.formatter.editor=a.editor,a.formatter.toggle(b),a.releaseRange(b)}}),p=c.extend({init:function(a,b){this.body=a.body,this.startRestorePoint=a,this.endRestorePoint=b},redo:function(){this.body.innerHTML=this.endRestorePoint.html,i(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,i(this.startRestorePoint.toRange())}}),q=o.extend({init:function(a){o.fn.init.call(this,a),this.managesUndoRedo=!0},exec:function(){var a=this.editor,b=a.getRange(),c=new l(b);a.clipboard.paste(this.options.value||""),a.undoRedoStack.push(new p(c,new l(a.getRange()))),a.focus()}}),r=j.extend({initialize:function(a,b){var c=b.editor;new d.SelectBox(a,{dataSource:c.options.insertHtml||[],dataTextField:"text",dataValueField:"value",change:function(a){j.exec(c,"insertHtml",this.value())},title:c.options.messages.insertHtml,highlightFirst:!1})},command:function(a){return new q(a)},update:function(a,b){var c=a.data("kendoSelectBox")||a.find("select").data("kendoSelectBox");c.close(),c.value(c.options.title)}}),s=c.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(a){var b=this;b.stack=b.stack.slice(0,b.currentCommandIndex+1),b.currentCommandIndex=b.stack.push(a)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),t=c.extend({init:function(a){this.editor=a},keydown:function(a){var b=this,c=b.editor,d=c.keyboard,e=d.isTypingKey(a);if(e&&!d.isTypingInProgress()){var f=c.getRange();b.startRestorePoint=new l(f),d.startTyping(function(){c.selectionRestorePoint=b.endRestorePoint=new l(c.getRange()),c.undoRedoStack.push(new p(b.startRestorePoint,b.endRestorePoint))});return!0}return!1},keyup:function(a){var b=this.editor.keyboard;if(b.isTypingInProgress()){b.endTyping();return!0}return!1}}),u=c.extend({init:function(a){this.editor=a,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var a=this;a.endRestorePoint=new l(a.editor.getRange()),a.editor.undoRedoStack.push(new p(a.startRestorePoint,a.endRestorePoint)),a.startRestorePoint=a.endRestorePoint},changed:function(){if(this.startRestorePoint)return this.startRestorePoint.html!=this.editor.body.innerHTML;return!1},keydown:function(a){var b=this,c=b.editor,d=c.keyboard;if(d.isModifierKey(a)){d.isTypingInProgress()&&d.endTyping(!0),b.startRestorePoint=new l(c.getRange());return!0}if(d.isSystem(a)){b.systemCommandIsInProgress=!0,b.changed()&&(b.systemCommandIsInProgress=!1,b.createUndoCommand());return!0}return!1},keyup:function(a){var b=this;if(b.systemCommandIsInProgress&&b.changed()){b.systemCommandIsInProgress=!1,b.createUndoCommand(a);return!0}return!1}}),v=c.extend({init:function(a){this.handlers=a,this.typingInProgress=!1},isCharacter:function(a){return a>=48&&a<=90||a>=96&&a<=111||a>=186&&a<=192||a>=219&&a<=222},toolFromShortcut:function(b,c){var d=String.fromCharCode(c.keyCode),e,f;for(e in b){f=a.extend({ctrl:!1,alt:!1,shift:!1},b[e].options);if((f.key==d||f.key==c.keyCode)&&f.ctrl==c.ctrlKey&&f.alt==c.altKey&&f.shift==c.shiftKey)return e}},isTypingKey:function(a){var b=a.keyCode;return this.isCharacter(b)&&!a.ctrlKey&&!a.altKey||b==32||b==13||b==8||b==46&&!a.shiftKey&&!a.ctrlKey&&!a.altKey},isModifierKey:function(a){var b=a.keyCode;return b==17&&!a.shiftKey&&!a.altKey||b==16&&!a.ctrlKey&&!a.altKey||b==18&&!a.ctrlKey&&!a.shiftKey},isSystem:function(a){return a.keyCode==46&&a.ctrlKey&&!a.altKey&&!a.shiftKey},startTyping:function(a){this.onEndTyping=a,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress=!1,this.onEndTyping&&this.onEndTyping()},endTyping:function(b){var c=this;c.clearTimeout(),b?c.stopTyping():c.timeout=window.setTimeout(a.proxy(c.stopTyping,c),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(a,b){var c,d=this.handlers;for(c=0;c<d.length;c++)if(d[c][b](a))break},keydown:function(a){this.notify(a,"keydown")},keyup:function(a){this.notify(a,"keyup")}}),w=c.extend({init:function(a){this.editor=a,this.cleaners=[new x]},htmlToFragment:function(a){var b=this.editor,c=b.document,d=g.create(c,"div"),e=c.createDocumentFragment();d.innerHTML=a;while(d.firstChild)e.appendChild(d.firstChild);return e},isBlock:function(a){return/<(div|p|ul|ol|table|h[1-6])/i.test(a)},oncut:function(a){var b=this.editor,c=new l(b.getRange());setTimeout(function(){b.undoRedoStack.push(new p(c,new l(b.getRange())))})},onpaste:function(b){var c=this.editor,e=c.getRange(),f="",h=new l(e),j=g.create(c.document,"div",{className:"k-paste-container",innerHTML:f});c.body.appendChild(j);if(c.body.createTextRange){b.preventDefault();var k=c.createRange();k.selectNodeContents(j),c.selectRange(k);var m=c.body.createTextRange();m.moveToElementText(j),a(c.body).unbind("paste"),m.execCommand("Paste"),a(c.body).bind("paste",a.proxy(arguments.callee,this))}else{var n=c.createRange();n.selectNodeContents(j),i(n)}setTimeout(function(){var a,b={html:""};i(e),g.remove(j),j.lastChild&&g.is(j.lastChild,"br")&&g.remove(j.lastChild),a=j.innerHTML,a!=f&&(b.html=a),c.trigger("paste",b),c.clipboard.paste(b.html,!0),c.undoRedoStack.push(new p(h,new l(c.getRange()))),d.EditorUtils.select(c)})},splittableParent:function(a,b){var c,d;if(a)return g.parentOfType(b,["p","ul","ol"])||b.parentNode;c=b.parentNode,d=b.ownerDocument.body;if(g.isInline(c))while(c.parentNode!=d&&!g.isBlock(c.parentNode))c=c.parentNode;return c},paste:function(a,b){var c=this.editor,d,e;for(d=0,e=this.cleaners.length;d<e;d++)this.cleaners[d].applicable(a)&&(a=this.cleaners[d].clean(a));b&&(a=a.replace(/(<br>(\s| )*)+(<\/?(div|p|li|col|t))/ig,"$3"),a=a.replace(/<(a|span)[^>]*><\/\1>/ig,"")),a=a.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>");var f=this.isBlock(a),j=c.getRange();j.deleteContents(),j.startContainer==c.document&&j.selectNodeContents(c.body);var k=new m,l=k.addCaret(j),n=this.splittableParent(f,l),o=!1;!/body|td/.test(g.name(n))&&(f||g.isInline(n))&&(j.selectNode(l),h.split(j,n,!0),o=!0);var p=this.htmlToFragment(a);if(p.firstChild&&p.firstChild.className==="k-paste-container"){var q=[];for(d=0,e=p.childNodes.length;d<e;d++)q.push(p.childNodes[d].innerHTML);p=this.htmlToFragment(q.join("<br />"))}j.insertNode(p),n=this.splittableParent(f,l);if(o){while(l.parentNode!=n)g.unwrap(l.parentNode);g.unwrap(l.parentNode)}g.normalize(j.commonAncestorContainer),l.style.display="inline",g.scrollTo(l),k.removeCaret(j),i(j)}}),x=c.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/"/g,"'",/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>/g," ",/<table([^>]*)>(\s| )+<t/gi,"<table$1><t",/<tr[^>]*>(\s| )*<\/tr>/gi,"",/<tbody[^>]*>(\s| )*<\/tbody>/gi,"",/<table[^>]*>(\s| )*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*( )+/gi,"",/( |<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/ig,"",/<(\/?)b(\s[^>]*)?>/ig,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/ig,"<$1em$2>",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/ig,"",/style=(["|'])\s*\1/g,""]},applicable:function(a){return/class="?Mso|style="[^"]*mso-/i.test(a)},listType:function(a){if(/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(a))return"ul";if(/^\s*\w+[\.\)]\u00a0{2,}/.test(a))return"ol"},lists:function(b){var c=g.create(document,"div",{innerHTML:b}),d=a(g.blockElements.join(","),c),e=-1,f,h={ul:{},ol:{}},i=c;for(var j=0;j<d.length;j++){var k=d[j];b=k.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," ");var l=this.listType(b);if(!l||g.name(k)!="p"){k.innerHTML?(h={ul:{},ol:{}},i=c,e=-1):g.remove(k);continue}var m=parseFloat(k.style.marginLeft||0),n=h[l][m];if(m>e||!n)n=g.create(document,l),i==c?g.insertBefore(n,k):i.appendChild(n),h[l][m]=n;if(f!=l)for(var o in h)for(var p in h[o])a.contains(n,h[o][p])&&delete h[o][p];g.remove(k.firstChild),i=g.create(document,"li",{innerHTML:k.innerHTML}),n.appendChild(i),g.remove(k),e=m,f=l}return c.innerHTML},stripEmptyAnchors:function(a){return a.replace(/<a([^>]*)>\s*<\/a>/ig,function(a,b){if(!b||b.indexOf("href")<0)return"";return a})},clean:function(a){var b=this,c=b.replacements,d,e;for(d=0,e=c.length;d<e;d+=2)a=a.replace(c[d],c[d+1]);a=b.stripEmptyAnchors(a),a=b.lists(a),a=a.replace(/\s+class="?[^"\s>]*"?/ig,"");return a}});n(d,{Command:o,GenericCommand:p,InsertHtmlCommand:q,InsertHtmlTool:r,UndoRedoStack:s,TypingHandler:t,SystemHandler:u,Keyboard:v,Clipboard:w,MSWordFormatCleaner:x}),f("insertHtml",new r({template:new k({template:e.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(jQuery),function(a){function t(a){return a.collapsed&&!k.isExpandable(a)}var b=window.kendo,c=b.Class,d=b.ui.editor,e=b.ui.Editor.fn.options.formats,f=d.EditorUtils,g=d.Tool,h=d.ToolTemplate,i=d.FormatTool,j=d.Dom,k=d.RangeUtils,l=a.extend,m=d.EditorUtils.registerTool,n=d.EditorUtils.registerFormat,o="k-marker",p=c.extend({init:function(a){this.format=a},numberOfSiblings:function(a){var b=0,c=0,d=0,e=a.parentNode,f;for(f=e.firstChild;f;f=f.nextSibling)f!=a&&(f.className==o?d++:f.nodeType==3?b++:c++);return d>1&&e.firstChild.className==o&&e.lastChild.className==o?0:c+b},findSuitable:function(a,b){if(!b&&this.numberOfSiblings(a)>0)return null;return j.parentOfType(a,this.format[0].tags)},findFormat:function(a){var b=this.format,c=j.attrEquals,d,e,f,g,h;for(d=0,e=b.length;d<e;d++){f=a,g=b[d].tags,h=b[d].attr;if(f&&j.ofType(f,g)&&c(f,h))return f;while(f){f=j.parentOfType(f,g);if(f&&c(f,h))return f}}return null},isFormatted:function(a){var b,c;for(b=0,c=a.length;b<c;b++)if(this.findFormat(a[b]))return!0;return!1}}),q=c.extend({init:function(a,b){var c=this;c.finder=new p(a),c.attributes=l({},a[0].attr,b),c.tag=a[0].tags[0]},wrap:function(a){return j.wrap(a,j.create(a.ownerDocument,this.tag,this.attributes))},activate:function(a,b){var c=this;c.finder.isFormatted(b)?(c.split(a),c.remove(b)):c.apply(b)},toggle:function(a){var b=k.textNodes(a);b.length>0&&this.activate(a,b)},apply:function(a){var b=this,c=[],d,e,f,g;for(d=0,e=a.length;d<e;d++)f=a[d],g=b.finder.findSuitable(f),g?j.attr(g,b.attributes):g=b.wrap(f),c.push(g);b.consolidate(c)},remove:function(a){var b=this,c,d,e;for(c=0,d=a.length;c<d;c++)e=b.finder.findFormat(a[c]),e&&(b.attributes&&b.attributes.style?(j.unstyle(e,b.attributes.style),e.style.cssText||j.unwrap(e)):j.unwrap(e))},split:function(a){var b=k.textNodes(a),c=b.length,d,e;if(c>0)for(d=0;d<c;d++)e=this.finder.findFormat(b[d]),e&&k.split(a,e,!0)},consolidate:function(a){var b,c;while(a.length>1){b=a.pop(),c=a[a.length-1],b.previousSibling&&b.previousSibling.className==o&&c.appendChild(b.previousSibling);if(b.tagName==c.tagName&&b.previousSibling==c&&b.style.cssText==c.style.cssText){while(b.firstChild)c.appendChild(b.firstChild);j.remove(b)}}}}),r=p.extend({init:function(a,b){var c=this;c.format=a,c.greedyProperty=b,p.fn.init.call(c,a)},getInlineCssValue:function(b){var c=b.attributes,d=a.trim,e,f,g,h,i,k,l,m,n,o,p,q;if(!!c){for(e=0,f=c.length;e<f;e++){g=c[e],h=g.nodeName,i=g.nodeValue;if(g.specified&&h=="style"){k=d(i||b.style.cssText).split(";");for(m=0,n=k.length;m<n;m++){l=k[m];if(l.length){o=l.split(":"),p=d(o[0].toLowerCase()),q=d(o[1]);if(p!=this.greedyProperty)continue;return p.indexOf("color")>=0?j.toHex(q):q}}}}return}},getFormatInner:function(b){var c=a(j.isDataNode(b)?b.parentNode:b),d=c.parents().andSelf(),e,f,g;for(e=0,f=d.length;e<f;e++){g=this.greedyProperty=="className"?d[e].className:this.getInlineCssValue(d[e]);if(g)return g}return"inherit"},getFormat:function(a){var b=this.getFormatInner(a[0]),c,d;for(c=1,d=a.length;c<d;c++)if(b!=this.getFormatInner(a[c]))return"";return b},isFormatted:function(a){return this.getFormat(a)!==""}}),s=q.extend({init:function(a,b,c){var d=this;q.fn.init.call(d,a,b),d.greedyProperty=c,d.values=b,d.finder=new r(a,c)},activate:function(a,b){var c=this,d,e=c.greedyProperty,f="apply";c.split(a),e&&(d=e.replace(/-([a-z])/,function(a,b){return b.toUpperCase()}),c.values.style[d]=="inherit"&&(f="remove")),c[f](b)}}),u=i.extend({init:function(a){i.fn.init.call(this,l(a,{finder:new p(a.format),formatter:function(){return new q(a.format)}})),this.willDelayExecution=t}}),v=g.extend({init:function(c){var d=this;g.fn.init.call(d,c),d.type=a.browser.msie||b.support.touch?"kendoDropDownList":"kendoComboBox",d.format=[{tags:["span"]}],d.finder=new r(d.format,c.cssAttr)},command:function(a){var b=this.options,c=this.format,e={};return new d.FormatCommand(l(a,{formatter:function(){e[b.domAttr]=a.value;return new s(c,{style:e},b.cssAttr)}}))},willDelayExecution:t,update:function(a,b,c){var d=this,e=a.data(d.type),f=c.getPending(d.name),g=f&&f.params?f.params.value:d.finder.getFormat(b);e.close(),e.value(g)},initialize:function(a,b){var c=b.editor,d=this.options,e=d.name,f,h=[];d.defaultValue&&(h=[{text:c.options.messages[d.defaultValue[0].text],value:d.defaultValue[0].value}]),f=h.concat(d.items?d.items:c.options[e]),a[this.type]({dataTextField:"text",dataValueField:"value",dataSource:f,change:function(a){g.exec(c,e,this.value())},highlightFirst:!1}),a.closest(".k-widget").removeClass("k-"+e).find("*").andSelf().attr("unselectable","on"),a.data(this.type).value("inherit")}}),w=g.extend({init:function(a){g.fn.init.call(this,a),this.options=a,this.format=[{tags:["span"]}]},update:function(a){a.data("kendoColorPicker").close()},command:function(a){var b=this.options,c=this.format,e={};return new d.FormatCommand(l(a,{formatter:function(){e[b.domAttr]=a.value;return new s(c,{style:e},b.cssAttr)}}))},willDelayExecution:t,initialize:function(a,b){var c=b.editor,e=this.name;new d.ColorPicker(a,{value:"#000000",change:function(a){g.exec(c,e,a.value)}})}}),x=g.extend({init:function(a){var b=this;g.fn.init.call(b,a),b.format=[{tags:["span"]}],b.finder=new r(b.format,"className")},command:function(a){var b=this.format;return new d.FormatCommand(l(a,{formatter:function(){return new s(b,{className:a.value})}}))},update:function(a,b){var c=a.data("kendoSelectBox");c.close(),c.value(this.finder.getFormat(b))},initialize:function(a,b){var c=b.editor;new d.SelectBox(a,{dataTextField:"text",dataValueField:"value",dataSource:c.options.style,title:c.options.messages.style,change:function(a){g.exec(c,"style",this.value())},highlightFirst:!1}),a.closest(".k-widget").removeClass("k-"+this.name).find("*").andSelf().attr("unselectable","on")}});l(d,{InlineFormatFinder:p,InlineFormatter:q,GreedyInlineFormatFinder:r,GreedyInlineFormatter:s,InlineFormatTool:u,FontTool:v,ColorTool:w,StyleTool:x}),m("style",new d.StyleTool({template:new h({template:f.dropDownListTemplate,title:"Styles"})})),n("bold",[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),m("bold",new u({key:"B",ctrl:!0,format:e.bold,template:new h({template:f.buttonTemplate,title:"Bold"})})),n("italic",[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),m("italic",new u({key:"I",ctrl:!0,format:e.italic,template:new h({template:f.buttonTemplate,title:"Italic"})})),n("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}}]),m("underline",new u({key:"U",ctrl:!0,format:e.underline,template:new h({template:f.buttonTemplate,title:"Underline"})})),n("strikethrough",[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),m("strikethrough",new u({format:e.strikethrough,template:new h({template:f.buttonTemplate,title:"Strikethrough"})})),n("superscript",[{tags:["sup"]}]),m("superscript",new u({format:e.superscript,template:new h({template:f.buttonTemplate,title:"Superscript"})})),n("subscript",[{tags:["sub"]}]),m("subscript",new u({format:e.subscript,template:new h({template:f.buttonTemplate,title:"Subscript"})})),m("foreColor",new w({cssAttr:"color",domAttr:"color",name:"foreColor",template:new h({template:f.colorPickerTemplate,title:"Color"})})),m("backColor",new w({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new h({template:f.colorPickerTemplate,title:"Background Color"})})),m("fontName",new v({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new h({template:f.comboBoxTemplate,title:"Font Name"})})),m("fontSize",new v({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new h({template:f.comboBoxTemplate,title:"Font Size"})}))}(jQuery),function(a){var b=window.kendo,c=b.Class,d=a.extend,e=b.ui.editor,f=b.ui.Editor.fn.options.formats,g=e.Dom,h=e.Command,i=e.Tool,j=e.ToolTemplate,k=e.FormatTool,l=e.EditorUtils,m=l.registerTool,n=l.registerFormat,o=e.RangeUtils,p=c.extend({init:function(a){this.format=a},contains:function(a,b){var c,d,e;for(c=0,d=b.length;c<d;c++){e=b[c];if(!e||!g.isAncestorOrSelf(a,e))return!1}return!0},findSuitable:function(b){var c=this.format,d=[],e,f,h;for(e=0,f=b.length;e<f;e++){h=g.ofType(b[e],c[0].tags)?b[e]:g.parentOfType(b[e],c[0].tags);if(!h)return[];a.inArray(h,d)<0&&d.push(h)}for(e=0,f=d.length;e<f;e++)if(this.contains(d[e],d))return[d[e]];return d},findFormat:function(a){var b=this.format,c,d,e,f,h;for(c=0,d=b.length;c<d;c++){e=a,f=b[c].tags,h=b[c].attr;while(e){if(g.ofType(e,f)&&g.attrEquals(e,h))return e;e=e.parentNode}}return null},getFormat:function(a){var b=this,c=function(a){return b.findFormat(g.isDataNode(a)?a.parentNode:a)},d=c(a[0]),e,f;if(!d)return"";for(e=1,f=a.length;e<f;e++)if(d!=c(a[e]))return"";return d.nodeName.toLowerCase()},isFormatted:function(a){for(var b=0,c=a.length;b<c;b++)if(!this.findFormat(a[b]))return!1;return!0}}),q=c.extend({init:function(a,b){this.format=a,this.values=b,this.finder=new p(a)},wrap:function(a,b,c){var d=c.length==1?g.blockParentOrBody(c[0]):g.commonAncestor.apply(null,c);g.isInline(d)&&(d=g.blockParentOrBody(d));var e=g.significantChildNodes(d),f=g.findNodeIndex(e[0]),h=g.create(d.ownerDocument,a,b),i,j;for(i=0;i<e.length;i++){j=e[i];if(g.isBlock(j)){g.attr(j,b),h.childNodes.length&&(g.insertBefore(h,j),h=h.cloneNode(!1)),f=g.findNodeIndex(j)+1;continue}h.appendChild(j)}h.firstChild&&g.insertAt(d,h,f)},apply:function(a){var b=this,c=g.is(a[0],"img")?[a[0]]:b.finder.findSuitable(a),e=c.length?l.formatByName(g.name(c[0]),b.format):b.format[0],f=e.tags[0],h=d({},e.attr,b.values),i,j;if(c.length)for(i=0,j=c.length;i<j;i++)g.attr(c[i],h);else b.wrap(f,h,a)},remove:function(a){var b,c,d,e;for(b=0,c=a.length;b<c;b++)d=this.finder.findFormat(a[b]),d&&(g.ofType(d,["p","img","li"])?(e=l.formatByName(g.name(d),this.format),e.attr.style&&g.unstyle(d,e.attr.style),e.attr.className&&g.removeClass(d,e.attr.className)):g.unwrap(d))},toggle:function(a){var b=this,c=o.nodes(a);b.finder.isFormatted(c)?b.remove(c):b.apply(c)}}),r=c.extend({init:function(a,b){var c=this;c.format=a,c.values=b,c.finder=new p(a)},apply:function(a){var b=this.format,c=g.blockParents(a),d=b[0].tags[0],f,h,i,j,k;if(c.length)for(f=0,h=c.length;f<h;f++)g.is(c[f],"li")?(i=c[f].parentNode,j=new e.ListFormatter(i.nodeName.toLowerCase(),d),k=this.editor.createRange(),k.selectNode(c[f]),j.toggle(k)):g.changeTag(c[f],d);else(new q(b,this.values)).apply(a)},toggle:function(a){var b=o.textNodes(a);b.length||(a.selectNodeContents(a.commonAncestorContainer),b=o.textNodes(a),b.length||(b=g.significantChildNodes(a.commonAncestorContainer))),this.apply(b)}}),s=h.extend({init:function(a){a.formatter=a.formatter(),h.fn.init.call(this,a)}}),t=k.extend({init:function(a){k.fn.init.call(this,d(a,{finder:new p(a.format),formatter:function(){return new q(a.format)}}))}}),u=i.extend({init:function(a){i.fn.init.call(this,a),this.finder=new p([{tags:g.blockElements}])},command:function(a){return new s(d(a,{formatter:function(){return new r([{tags:[a.value]}],{})}}))},update:function(a,b){var c;a.is("select")?c=a.data("kendoSelectBox"):c=a.find("select").data("kendoSelectBox"),c.close(),c.value(this.finder.getFormat(b))},initialize:function(a,b){var c=b.editor,d="formatBlock";new e.SelectBox(a,{dataTextField:"text",dataValueField:"value",dataSource:this.options.items?this.options.items:c.options.formatBlock,title:c.options.messages.formatBlock,change:function(a){i.exec(c,d,this.value())},highlightFirst:!1}),a.closest(".k-widget").removeClass("k-"+d).find("*").andSelf().attr("unselectable","on")}});d(e,{BlockFormatFinder:p,BlockFormatter:q,GreedyBlockFormatter:r,FormatCommand:s,BlockFormatTool:t,FormatBlockTool:u}),m("formatBlock",new u({template:new j({template:l.dropDownListTemplate})})),n("justifyLeft",[{tags:g.blockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}]),m("justifyLeft",new t({format:f.justifyLeft,template:new j({template:l.buttonTemplate,title:"Justify Left"})})),n("justifyCenter",[{tags:g.blockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}]),m("justifyCenter",new t({format:f.justifyCenter,template:new j({template:l.buttonTemplate,title:"Justify Center"})})),n("justifyRight",[{tags:g.blockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}]),m("justifyRight",new t({format:f.justifyRight,template:new j({template:l.buttonTemplate,title:"Justify Right"})})),n("justifyFull",[{tags:g.blockElements,attr:{style:{textAlign:"justify"}}}]),m("justifyFull",new t({format:f.justifyFull,template:new j({template:l.buttonTemplate,title:"Justify Full"})}))}(jQuery),function(a){var b=window.kendo,c=a.extend,d=b.ui.editor,e=d.Dom,f=d.Command,g=d.Tool,h=d.BlockFormatter,i=e.normalize,j=d.RangeUtils,k=d.EditorUtils.registerTool,l=f.extend({init:function(a){this.options=a,f.fn.init.call(this,a)},exec:function(){function v(a){a.firstChild&&e.is(a.firstChild,"br")&&e.remove(a.firstChild),e.isDataNode(a)&&!a.nodeValue&&(a=a.parentNode);if(a&&!e.is(a,"img")){while(a.firstChild&&a.firstChild.nodeType==1)a=a.firstChild;a.innerHTML||(a.innerHTML=l)}}var b=this.getRange(),c=j.documentFromRange(b),d,f,g,k,l=a.browser.msie?"":'<br _moz_dirty="" />',m,n,o,p,q,r="p,h1,h2,h3,h4,h5,h6".split(","),s=e.parentOfType(b.startContainer,r),t=e.parentOfType(b.endContainer,r),u=s&&!t||!s&&t;b.deleteContents(),n=e.create(c,"a"),b.insertNode(n),n.parentNode||(k=b.commonAncestorContainer,k.innerHTML="",k.appendChild(n)),i(n.parentNode),o=e.parentOfType(n,["li"]),p=e.parentOfType(n,"h1,h2,h3,h4,h5,h6".split(",")),o?(q=b.cloneRange(),q.selectNode(o),j.textNodes(q).length||(m=e.create(c,"p"),o.nextSibling&&j.split(q,o.parentNode),e.insertAfter(m,o.parentNode),e.remove(o.parentNode.childNodes.length==1?o.parentNode:o),m.innerHTML=l,g=m)):p&&!n.nextSibling&&(m=e.create(c,"p"),e.insertAfter(m,p),m.innerHTML=l,e.remove(n),g=m),g||(!o&&!p&&(new h([{tags:["p"]}])).apply([n]),b.selectNode(n),d=e.parentOfType(n,[o?"li":p?e.name(p):"p"]),j.split(b,d,u),f=d.previousSibling,e.is(f,"li")&&f.firstChild&&!e.is(f.firstChild,"br")&&(f=f.firstChild),g=d.nextSibling,e.is(g,"li")&&g.firstChild&&!e.is(g.firstChild,"br")&&(g=g.firstChild),e.remove(d),v(f),v(g),i(f)),i(g);if(e.is(g,"img"))b.setStartBefore(g);else{b.selectNodeContents(g);var w=j.textNodes(b)[0];w&&b.selectNodeContents(w)}b.collapse(!0),e.scrollTo(g),j.selectRange(b)}}),m=f.extend({init:function(a){this.options=a,f.fn.init.call(this,a)},exec:function(){var b=this.getRange();b.deleteContents();var c=e.create(j.documentFromRange(b),"br");b.insertNode(c),i(c.parentNode);if(!a.browser.msie&&(!c.nextSibling||e.isWhitespace(c.nextSibling))){var d=c.cloneNode(!0);d.setAttribute("_moz_dirty",""),e.insertAfter(d,c)}b.setStartAfter(c),b.collapse(!0),j.selectRange(b)}});c(d,{ParagraphCommand:l,NewLineCommand:m}),k("insertLineBreak",new g({key:13,shift:!0,command:m})),k("insertParagraph",new g({key:13,command:l}))}(jQuery),function(a){var b=window.kendo,c=b.Class,d=a.extend,e=b.ui.editor,f=e.Dom,g=e.RangeUtils,h=e.EditorUtils,i=e.Command,j=e.ToolTemplate,k=e.FormatTool,l=e.BlockFormatFinder,m=g.textNodes,n=e.EditorUtils.registerTool,o=l.extend({init:function(a){this.tag=a;var b=this.tags=[a=="ul"?"ol":"ul",a];l.fn.init.call(this,[{tags:b}])},isFormatted:function(a){var b=[],c;for(var d=0;d<a.length;d++)(c=this.findFormat(a[d]))&&f.name(c)==this.tag&&b.push(c);if(b.length<1)return!1;if(b.length!=a.length)return!1;for(d=0;d<b.length;d++){if(b[d].parentNode!=c.parentNode)break;if(b[d]!=c)return!1}return!0},findSuitable:function(a){var b=f.parentOfType(a[0],this.tags);if(b&&f.name(b)==this.tag)return b;return null}}),p=c.extend({init:function(a,b){var c=this;c.finder=new o(a),c.tag=a,c.unwrapTag=b},wrap:function(a,b){var c=f.create(a.ownerDocument,"li"),d,e;for(d=0;d<b.length;d++){e=b[d];if(f.is(e,"li")){a.appendChild(e);continue}if(f.is(e,"ul")||f.is(e,"ol")){while(e.firstChild)a.appendChild(e.firstChild);continue}if(f.is(e,"td")){while(e.firstChild)c.appendChild(e.firstChild);a.appendChild(c),e.appendChild(a),a=a.cloneNode(!1),c=c.cloneNode(!1);continue}c.appendChild(e),f.isBlock(e)&&(a.appendChild(c),f.unwrap(e),c=c.cloneNode(!1))}c.firstChild&&a.appendChild(c)},containsAny:function(a,b){for(var c=0;c<b.length;c++)if(f.isAncestorOrSelf(a,b[c]))return!0;return!1},suitable:function(a,b){if(a.className=="k-marker"){var c=a.nextSibling;if(c&&f.isBlock(c))return!1;c=a.previousSibling;if(c&&f.isBlock(c))return!1}return this.containsAny(a,b)||f.isInline(a)||a.nodeType==3},split:function(b){var c=m(b),d,e;if(c.length){d=f.parentOfType(c[0],["li"]),e=f.parentOfType(c[c.length-1],["li"]),b.setStartBefore(d),b.setEndAfter(e);for(var h=0,i=c.length;h<i;h++){var j=this.finder.findFormat(c[h]);if(j){var k=a(j).parents("ul,ol");k[0]?g.split(b,k.last()[0],!0):g.split(b,j,!0)}}}},merge:function(a,b){var c=b.previousSibling,d;while(c&&(c.className=="k-marker"||c.nodeType==3&&f.isWhitespace(c)))c=c.previousSibling;if(c&&f.name(c)==a){while(b.firstChild)c.appendChild(b.firstChild);f.remove(b),b=c}d=b.nextSibling;while(d&&(d.className=="k-marker"||d.nodeType==3&&f.isWhitespace(d)))d=d.nextSibling;if(d&&f.name(d)==a){while(b.lastChild)d.insertBefore(b.lastChild,d.firstChild);f.remove(b)}},applyOnSection:function(b,c){function j(){g.push(this)}var d=this.tag,e;c.length==1?e=f.parentOfType(c[0],["ul","ol"]):e=f.commonAncestor.apply(null,c),e||(e=f.parentOfType(c[0],["td"])||c[0].ownerDocument.body),f.isInline(e)&&(e=f.blockParentOrBody(e));var g=[],h=this.finder.findSuitable(c);h||(h=(new o(d=="ul"?"ol":"ul")).findSuitable(c));var i=f.significantChildNodes(e);i.length||(i=c),/table|tbody/.test(f.name(e))&&(i=a.map(c,function(a){return f.parentOfType(a,["td"])}));for(var k=0;k<i.length;k++){var l=i[k],m=f.name(l);this.suitable(l,c)&&(!h||!f.isAncestorOrSelf(h,l))&&(!h||m!="ul"&&m!="ol"?g.push(l):(a.each(l.childNodes,j),f.remove(l)))}g.length==i.length&&e!=c[0].ownerDocument.body&&!/table|tbody|tr|td/.test(f.name(e))&&(g=[e]),h||(h=f.create(e.ownerDocument,d),f.insertBefore(h,g[0])),this.wrap(h,g),f.is(h,d)||f.changeTag(h,d),this.merge(d,h)},apply:function(a){var b=0,c=[],d,e,g;do g=f.parentOfType(a[b],["td","body"]),!d||g!=d?(d&&c.push({section:d,nodes:e}),e=[a[b]],d=g):e.push(a[b]),b++;while(b<a.length);c.push({section:d,nodes:e});for(b=0;b<c.length;b++)this.applyOnSection(c[b].section,c[b].nodes)},unwrap:function(b){var c=b.ownerDocument.createDocumentFragment(),d=this.unwrapTag,e,g,h,i;for(g=b.firstChild;g;g=g.nextSibling){h=f.create(b.ownerDocument,d||"p");while(g.firstChild)i=g.firstChild,f.isBlock(i)?(h.firstChild&&(c.appendChild(h),h=f.create(b.ownerDocument,d||"p")),c.appendChild(i)):h.appendChild(i);h.firstChild&&c.appendChild(h)}e=a(b).parents("ul,ol"),e[0]?(f.insertAfter(c,e.last()[0]),e.last().remove()):f.insertAfter(c,b),f.remove(b)},remove:function(a){var b;for(var c=0,d=a.length;c<d;c++)b=this.finder.findFormat(a[c]),b&&this.unwrap(b)},toggle:function(a){var b=this,c=m(a),d=a.commonAncestorContainer;if(!c.length){a.selectNodeContents(d),c=m(a);if(!c.length){var e=d.ownerDocument.createTextNode("");a.startContainer.appendChild(e),c=[e],a.selectNode(e.parentNode)}}b.finder.isFormatted(c)?(b.split(a),b.remove(c)):b.apply(c)}}),q=i.extend({init:function(a){a.formatter=new p(a.tag),i.fn.init.call(this,a)}}),r=k.extend({init:function(a){this.options=a,k.fn.init.call(this,d(a,{finder:new o(a.tag)}))},command:function(a){return new q(d(a,{tag:this.options.tag}))}});d(e,{ListFormatFinder:o,ListFormatter:p,ListCommand:q,ListTool:r}),n("insertUnorderedList",new r({tag:"ul",template:new j({template:h.buttonTemplate,title:"Remove Link"})})),n("insertOrderedList",new r({tag:"ol",template:new j({template:h.buttonTemplate,title:"Remove Link"})}))}(jQuery),function(a,b){var c=window.kendo,d=c.Class,e=a.extend,f=c.ui.editor,g=f.Dom,h=f.RangeUtils,i=f.EditorUtils,j=f.Command,k=f.Tool,l=f.ToolTemplate,m=f.InlineFormatter,n=f.InlineFormatFinder,o=h.textNodes,p=f.EditorUtils.registerTool,q=d.extend({findSuitable:function(a){return g.parentOfType(a,["a"])}}),r=d.extend({init:function(){this.finder=new q},apply:function(a,b){var c=o(a);if(b.innerHTML){var d=h.getMarkers(a),e=h.documentFromRange(a);a.deleteContents();var f=g.create(e,"a",b);a.insertNode(f),d.length>1&&(g.insertAfter(d[d.length-1],f),g.insertAfter(d[1],f),g[c.length>0?"insertBefore":"insertAfter"](d[0],f))}else{var i=new m([{tags:["a"]}],b);i.finder=this.finder,i.apply(c)}}}),s=j.extend({init:function(a){a.formatter={toggle:function(a){(new m([{tags:["a"]}])).remove(o(a))}},this.options=a,j.fn.init.call(this,a)}}),t=j.extend({init:function(a){var b=this;b.options=a,j.fn.init.call(b,a),b.attributes=null,b.async=!0,b.formatter=new r},exec:function(){function j(a){a.preventDefault(),n.destroy(),g.windowFromDocument(h.documentFromRange(b)).focus(),f.releaseRange(b)}function i(c){var d=a("#k-editor-link-url",n.element).val();if(d&&d!="http://"){f.attributes={href:d};var g=a("#k-editor-link-title",n.element).val();g&&(f.attributes.title=g);var h=a("#k-editor-link-text",n.element).val();h!==e&&(f.attributes.innerHTML=h||d);var i=a("#k-editor-link-target",n.element).is(":checked");i&&(f.attributes.target="_blank"),f.formatter.apply(b,f.attributes)}j(c),f.change&&f.change()}var b=this.getRange(),c=b.collapsed;b=this.lockRange(!0);var d=o(b),e=null,f=this,k=d.length?f.formatter.finder.findSuitable(d[0]):null,l=d.length<=1||d.length==2&&c,m='<div class="k-editor-dialog"><ol><li class="k-form-text-row"><label for="k-editor-link-url">Web address</label><input type="text" class="k-input" id="k-editor-link-url"/></li>'+(l?'<li class="k-form-text-row"><label for="k-editor-link-text">Text</label><input type="text" class="k-input" id="k-editor-link-text"/></li>':"")+'<li class="k-form-text-row"><label for="k-editor-link-title">Tooltip</label><input type="text" class="k-input" id="k-editor-link-title"/></li>'+'<li class="k-form-checkbox-row"><input type="checkbox" id="k-editor-link-target"/><label for="k-editor-link-target">Open link in new window</label></li>'+"</ol>"+'<div class="k-button-wrapper">'+'<button class="k-dialog-insert k-button">Insert</button>'+" or "+'<a href="#" class="k-dialog-close k-link">Close</a>'+"</div>"+"</div>",n=a(m).appendTo(document.body).kendoWindow(a.extend({},this.editor.options.dialogOptions,{title:"Insert link",close:j})).hide().find(".k-dialog-insert").click(i).end().find(".k-dialog-close").click(j).end().find(".k-form-text-row input").keydown(function(a){a.keyCode==13?i(a):a.keyCode==27&&j(a)}).end().find("#k-editor-link-url").val(k?k.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(d.length>0?d.length==1?d[0].nodeValue:d[0].nodeValue+d[1].nodeValue:"").end().find("#k-editor-link-title").val(k?k.title:"").end().find("#k-editor-link-target").attr("checked",k?k.target=="_blank":!1).end().show().data("kendoWindow").center();l&&d.length>0&&(e=a("#k-editor-link-text",n.element).val()),a("#k-editor-link-url",n.element).focus().select()},redo:function(){var a=this,b=a.lockRange(!0);a.formatter.apply(b,a.attributes),a.releaseRange(b)}}),u=k.extend({init:function(b){this.options=b,this.finder=new n([{tags:["a"]}]),k.fn.init.call(this,a.extend(b,{command:s}))},initialize:function(a){a.attr("unselectable","on").addClass("k-state-disabled")},update:function(a,b){a.toggleClass("k-state-disabled",!this.finder.isFormatted(b)).removeClass("k-state-hover")}});e(c.ui.editor,{LinkFormatFinder:q,LinkFormatter:r,UnlinkCommand:s,LinkCommand:t,UnlinkTool:u}),p("createLink",new k({key:"K",ctrl:!0,command:t,template:new l({template:i.buttonTemplate,title:"Create Link"})})),p("unlink",new u({key:"K",ctrl:!0,shift:!0,template:new l({template:i.buttonTemplate,title:"Remove Link"})}))}(jQuery),function(a,b){var c=window.kendo,d=a.extend,e=c.ui.editor,f=e.EditorUtils,g=e.Dom,h=f.registerTool,i=e.ToolTemplate,j=e.RangeUtils,k=e.Command,l=c.keys,m="Insert Image",n="#k-editor-image-url",o="#k-editor-image-title",p=k.extend({init:function(a){var b=this;k.fn.init.call(b,a),b.async=!0,b.attributes={}},insertImage:function(a,b){var c=this.attributes;if(c.src&&c.src!="http://"){if(!a){a=g.create(j.documentFromRange(b),"img",c),a.onload=a.onerror=function(){a.removeAttribute("complete"),a.removeAttribute("width"),a.removeAttribute("height")},b.deleteContents(),b.insertNode(a),b.setStartAfter(a),b.setEndAfter(a),j.selectRange(b);return!0}g.attr(a,c)}return!1},redo:function(){var a=this,b=a.lockRange();a.insertImage(j.image(b),b)||a.releaseRange(b)},exec:function(){function q(a){a.keyCode==l.ENTER?k(a):a.keyCode==l.ESC&&p(a)}function p(a){a.preventDefault(),i.destroy(),g.windowFromDocument(j.documentFromRange(c)).focus(),e||b.releaseRange(c)}function k(d){b.attributes={src:a(n,i.element).val(),alt:a(o,i.element).val()},e=b.insertImage(f,c),p(d),b.change&&b.change()}var b=this,c=b.lockRange(),e=!1,f=j.image(c),h,i;h='<div class="k-editor-dialog"><ol><li class="k-form-text-row"><label for="k-editor-image-url">Web address</label><input type="text" class="k-input" id="k-editor-image-url"/></li><li class="k-form-text-row"><label for="k-editor-image-title">Tooltip</label><input type="text" class="k-input" id="k-editor-image-title"/></li></ol><div class="k-button-wrapper"><button class="k-dialog-insert k-button">Insert</button> or <a href="#" class="k-dialog-close k-link">Close</a></div></div>',i=a(h).appendTo(document.body).kendoWindow(d({},b.editor.options.dialogOptions,{title:m,close:p,activate:function(){}})).hide().find(".k-dialog-insert").click(k).end().find(".k-dialog-close").click(p).end().find(".k-form-text-row input").keydown(q).end().find(n).val(f?f.getAttribute("src",2):"http://").end().find(o).val(f?f.alt:"").end().show().data("kendoWindow").center(),a(n,i.element).focus().select()}});c.ui.editor.ImageCommand=p,h("insertImage",new e.Tool({command:p,template:new i({template:f.buttonTemplate,title:m})}))}(jQuery),function(a,b){var c=window.kendo,d=c.ui.Widget,e=c.ui.DropDownList,f=c.ui.editor,g=f.Dom,h="change",i="k-state-selected",j="."+i,k=".k-selected-color",l="unselectable",m="background-color",n=c.keys,o=c.template('<div class="k-colorpicker-popup"><ul class="k-reset"># for(var i = 0; i < colors.length; i++) { #<li class="k-item #= colors[i] == value ? "k-state-selected" : "" #"><div style="background-color:\\##= colors[i] #"></div></li># } #</ul></div>'),p=d.extend({init:function(b,c){var e=this;d.fn.init.call(e,b,c),b=e.element,c=e.options,e._value=c.value,e.popup=a(o({colors:c.colors,value:c.value.substring(1)})).kendoPopup({anchor:b,toggleTarget:b.find(".k-icon")}).delegate(".k-item","click",function(b){e.select(a(b.currentTarget).find("div").css(m))}).find("*").attr(l,"on").end().data("kendoPopup"),b.attr("tabIndex",0).keydown(function(a){e.keydown(a)}).focus(function(){b.css("outline","1px dotted #000")}).blur(function(){b.css("outline","")}).delegate(".k-tool-icon","click",function(){e.select()}).find("*").attr(l,"on"),e._value&&b.find(k).css(m,e._value)},options:{name:"ColorPicker",colors:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7".split(","),value:null},events:[h],select:function(a){var b=this;a?(a=g.toHex(a),b.trigger(h,{value:a})||(b.value(a),b.close())):b.trigger(h,{value:b._value})},open:function(){this.popup.open()},close:function(){this.popup.close()},toggle:function(){this.popup.toggle()},keydown:function(a){var b=this,c=b.popup.element,d=b.popup.visible(),e,f,g,h=!1,k=a.keyCode;k==n.DOWN?(d?(e=c.find(j),e[0]?f=e.next():f=c.find("li:first"),f[0]&&(e.removeClass(i),f.addClass(i))):b.open(),h=!0):k==n.UP?(d&&(e=c.find(j),g=e.prev(),g[0]&&(e.removeClass(i),g.addClass(i))),h=!0):k==n.TAB||k==n.RIGHT||k==n.LEFT?b.close():k==n.ENTER&&(c.find(j).click(),h=!0),h&&a.preventDefault()},value:function(a){var c=this;if(a===b)return c._value;a=g.toHex(a),c._value=a,c.element.find(k).css(m,a)}}),q=e.extend({init:function(a,b){var c=this;e.fn.init.call(c,a,b),c.value(c.options.title)},options:{name:"SelectBox"},value:function(a){var c=this,d=e.fn.value.call(c,a);if(a===b)return d;a!==e.fn.value.call(c)&&(c.text(c.options.title),c._current.removeClass("k-state-selected"),c.current(null),c._oldIndex=c.selectedIndex=-1)}});c.ui.editor.ColorPicker=p,c.ui.editor.SelectBox=q}(jQuery),function(a,b){function q(a,c){var d=g.name(a)!="td"?"marginLeft":"paddingLeft";if(c===b)return a.style[d]||0;c>0?a.style[d]=c+"px":(a.style[d]="",a.style.cssText||a.removeAttribute("style"))}var c=window.kendo,d=c.Class,e=a.extend,f=c.ui.editor,g=f.Dom,h=f.EditorUtils,i=h.registerTool,j=f.Command,k=f.Tool,l=f.ToolTemplate,m=f.RangeUtils,n=g.blockElements,o=f.BlockFormatFinder,p=f.BlockFormatter,r=d.extend({init:function(){this.finder=new o([{tags:g.blockElements}])},apply:function(b){var c=this.finder.findSuitable(b),d=[],e,f,h,i,j;if(c.length){for(e=0,f=c.length;e<f;e++)g.is(c[e],"li")?a(c[e]).index()?a.inArray(c[e].parentNode,d)<0&&d.push(c[e]):d.push(c[e].parentNode):d.push(c[e]);while(d.length){h=d.shift();if(g.is(h,"li")){i=h.parentNode,j=a(h).prev("li");var k=j.find("ul,ol").last(),l=a(h).children("ul,ol")[0];if(l&&j[0])k[0]?(k.append(h),k.append(a(l).children()),g.remove(l)):(j.append(l),l.insertBefore(h,l.firstChild));else{l=j.children("ul,ol")[0],l||(l=g.create(h.ownerDocument,g.name(i)),j.append(l));while(h&&h.parentNode==i)l.appendChild(h),h=d.shift()}}else{var m=parseInt(q(h),10)+30;q(h,m);for(var n=0;n<d.length;n++)a.contains(h,d[n])&&d.splice(n,1)}}}else{var o=new p([{tags:"p"}],{style:{marginLeft:30}});o.apply(b)}},remove:function(b){var c=this.finder.findSuitable(b),d,e,f,g,h,i,j,k;for(e=0,f=c.length;e<f;e++){j=a(c[e]);if(j.is("li")){g=j.parent(),h=g.parent();if(h.is("li,ul,ol")&&!q(g[0])){if(d&&a.contains(d,h[0]))continue;i=j.nextAll("li"),i.length&&a(g[0].cloneNode(!1)).appendTo(j).append(i),h.is("li")?j.insertAfter(h):j.appendTo(h),g.children("li").length||g.remove();continue}if(d==g[0])continue;d=g[0]}else d=c[e];k=parseInt(q(d),10)-30,q(d,k)}}}),s=j.extend({init:function(a){a.formatter={toggle:function(a){(new r).apply(m.nodes(a))}},j.fn.init.call(this,a)}}),t=j.extend({init:function(a){a.formatter={toggle:function(a){(new r).remove(m.nodes(a))}},j.fn.init.call(this,a)}}),u=k.extend({init:function(a){k.fn.init.call(this,e(a,{command:t})),this.finder=new o([{tags:n}])},initialize:function(a){a.attr("unselectable","on").addClass("k-state-disabled")},update:function(b,c){var d=this.finder.findSuitable(c),e,f,h,i;for(h=0,i=d.length;h<i;h++){e=q(d[h]),e||(f=a(d[h]).parents("ul,ol").length,e=g.is(d[h],"li")&&(f>1||q(d[h].parentNode))||g.ofType(d[h],["ul","ol"])&&f>0);if(e){b.removeClass("k-state-disabled");return}}b.addClass("k-state-disabled").removeClass("k-state-hover")}});e(f,{IndentFormatter:r,IndentCommand:s,OutdentCommand:t,OutdentTool:u}),i("indent",new k({command:s,template:new l({template:h.buttonTemplate,title:"Indent"})})),i("outdent",new u({template:new l({template:h.buttonTemplate,title:"Outdent"})}))}(jQuery),function(a,b){var c=window.kendo,d=a.extend,e=c.ui.editor,f=e.Dom,g=e.RangeUtils,h=e.EditorUtils,i=e.Command,j=e.Tool,k=e.ToolTemplate,l=i.extend({init:function(a){var b=this;b.options=a,i.fn.init.call(b,a),b.attributes=null,b.async=!0},exec:function(){function m(a){a.preventDefault(),h.data("kendoWindow").destroy(),f.windowFromDocument(g.documentFromRange(e)).focus()}function k(a){c.value(h.find(j).val()),m(a),b.change&&b.change()}var b=this,c=b.editor,e=c.getRange(),h=a(l.template).appendTo(document.body),i=l.indent(c.value()),j=".k-editor-textarea";h.kendoWindow(d({},c.options.dialogOptions,{title:"View HTML",close:m})).hide().find(j).val(i).end().find(".k-dialog-update").click(k).end().find(".k-dialog-close").click(m).end().show().data("kendoWindow").center(),h.find(j).focus()}});d(l,{template:"<div class='k-editor-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-button-wrapper'><button class='k-dialog-update k-button'>Update</button> or <a href='#' class='k-dialog-close k-link'>Close</a></div></div>",indent:function(a){return a.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/ig,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/ig,"<$1$2>\n<li").replace(/<br \/>/ig,"<br />\n").replace(/\n$/,"")}}),c.ui.editor.ViewHtmlCommand=l,e.EditorUtils.registerTool("viewHtml",new j({command:l,template:new k({template:h.buttonTemplate,title:"View HTML"})}))}(jQuery),function(a){var b=window.kendo,c=b.Class,d=a.extend,e=b.ui.editor,f=e.RangeUtils,g=e.Marker,h=c.extend({init:function(a){this.editor=a,this.formats=[]},apply:function(a){if(!!this.hasPending()){var b=new g;b.addCaret(a);var c=a.startContainer.childNodes[a.startOffset],e=c.previousSibling;e.nodeValue||(e=e.previousSibling),a.setStart(e,e.nodeValue.length-1),b.add(a);if(!f.textNodes(a).length){b.remove(a),a.collapse(!0),this.editor.selectRange(a);return}var h=b.end.previousSibling.previousSibling,i,j=this.formats;for(var k=0;k<j.length;k++){i=j[k];var l=i.command(d({range:a},i.options.params));l.editor=this.editor,l.exec(),a.selectNode(h)}b.remove(a),h.parentNode&&(a.setStart(h,1),a.collapse(!0)),this.clear(),this.editor.selectRange(a)}},hasPending:function(){return this.formats.length>0},isPending:function(a){return!!this.getPending(a)},getPending:function(a){var b=this.formats;for(var c=0;c<b.length;c++)if(b[c].name==a)return b[c];return},toggle:function(a){var b=this.formats;for(var c=0;c<b.length;c++)if(b[c].name==a.name){b[c].params&&b[c].params.value!=a.params.value?b[c].params.value=a.params.value:b.splice(c,1);return}b.push(a)},clear:function(){this.formats=[]}});d(e,{PendingFormats:h})}(jQuery);
+(function(e,t){var n=window.kendo,i=n.Class,o=n.ui.Widget,r=n.support.mobileOS,a=n.support.browser,s=e.extend,l=n.deepExtend,d=".kendoEditor",c=n.keys,u=i.extend({init:function(e){var t=this;t.options=e},getHtml:function(){var e=this.options;return n.template(e.template)({cssClass:e.cssClass,tooltip:e.title,initialValue:e.initialValue})}}),f={select:function(e){e.trigger("select",{})},editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar"></ul></td></tr><tr><td class="k-editable-area"></td></tr></tbody></table>',buttonTemplate:'<li class="k-editor-button" role="presentation"><a href="" role="button" class="k-tool-icon #= cssClass #" unselectable="on" title="#= tooltip #">#= tooltip #</a></li>',colorPickerTemplate:'<li class="k-editor-colorpicker" role="presentation"><div class="k-widget k-colorpicker k-header #= cssClass #" role="combobox" title="#=tooltip#"><span class="k-tool-icon"><span class="k-selected-color"></span></span><span class="k-icon k-i-arrow-s"></span></div></li>',comboBoxTemplate:'<li class="k-editor-combobox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',dropDownListTemplate:'<li class="k-editor-selectbox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',separatorTemplate:'<li class="k-separator"></li>',focusable:".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",wrapTextarea:function(t){var n=t.width(),i=t.height(),o=f.editorWrapperTemplate,r=e(o).insertBefore(t).width(n).height(i),a=r.find(".k-editable-area");return t.appendTo(a).addClass("k-content k-raw-content").hide(),t.closest(".k-editor")},renderTools:function(t,i){var o,r,a,l,d,c={},u=t._nativeTools,p=e(t.element).closest(".k-editor").find(".k-editor-toolbar");if(i)for(a=0;i.length>a;a++)o=i[a],d=null,e.isPlainObject(o)?o.name&&t.tools[o.name]?(e.extend(t.tools[o.name].options,o),c[o.name]=t.tools[o.name],d=c[o.name].options):(d=s({cssClass:"k-i-custom",type:"button",tooltip:""},o),d.name&&(d.cssClass="k-"+("custom"==d.name?"i-custom":d.name)),d.template||"button"==d.type&&(d.template=f.buttonTemplate)):t.tools[o]&&(c[o]=t.tools[o],d=c[o].options),d&&(l=d.template,l&&(l.getHtml?l=l.getHtml():(e.isFunction(l)||(l=n.template(l)),l=l(d)),0!==l.indexOf("<li")&&(l="<li class='k-editor-template'>"+l+"</li>"),r=e(l).appendTo(p),"button"==d.type&&d.exec&&r.find(".k-tool-icon").click(e.proxy(d.exec,t.element[0]))));for(a=0;u.length>a;a++)c[u[a]]||(c[u[a]]=t.tools[u[a]]);t.options.tools=c},decorateStyleToolItems:function(t){var i=t.data.closest(".k-editor").find(".k-style").data("kendoSelectBox");if(i){var o=i.dataSource.view();i.list.find(".k-item").each(function(i,r){var a=e(r),s=a.text(),l=n.ui.editor.Dom.inlineStyle(t.data.data("kendoEditor").document,"span",{className:o[i].value});a.html('<span unselectable="on" style="display:block;'+l+'">'+s+"</span>")})}},createContentElement:function(t,i){var o,r,a,s=n.support.isRtl(t)?"direction:rtl;":"";return t.hide(),o=e("<iframe />",{src:'javascript:""',frameBorder:"0"}).css("display","").addClass("k-content").insertBefore(t)[0],r=o.contentWindow||o,i.length>0&&e(o).one("load",t,f.decorateStyleToolItems),a=r.document||o.contentDocument,a.open(),a.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;font-family:Verdana,Geneva,sans-serif;background:#fff;height:100%;min-height:100%;}html{font-size:100%}body{font-size:.75em;line-height:1.5;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+s+"}"+"h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}"+"p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}"+"ul,ol{padding-left:2.5em}"+"a{color:#00a}"+"code{font-size:1.23em}"+"</style>"+e.map(i,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body contenteditable='true'></body></html>"),a.close(),r},initializeContentElement:function(n){var i=!0;n.window=f.createContentElement(e(n.textarea),n.options.stylesheets),n.document=n.window.contentDocument||n.window.document,n.body=n.document.body,e(n.document).on("keydown"+d,function(e){if(e.keyCode===c.F10)return setTimeout(function(){var e="tabIndex",t=n.wrapper,i=t.attr(e);t.attr(e,i||0).focus().find("li:has("+m+")").first().focus(),i||0===i||t.removeAttr(e)},100),e.preventDefault(),t;var o=n.keyboard.toolFromShortcut(n.options.tools,e);if(o)return e.preventDefault(),/undo|redo/.test(o)||n.keyboard.endTyping(!0),n.exec(o),!1;if(n.keyboard.isTypingKey(e)&&n.pendingFormats.hasPending())if(i)i=!1;else{var r=n.getRange();n.pendingFormats.apply(r),n.selectRange(r)}n.keyboard.clearTimeout(),n.keyboard.keydown(e)}).on("keyup"+d,function(t){var o=[8,9,33,34,35,36,37,38,39,40,40,45,46];if((e.inArray(t.keyCode,o)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&(n.pendingFormats.clear(),p(n)),n.keyboard.isTypingKey(t)){if(n.pendingFormats.hasPending()){var r=n.getRange();n.pendingFormats.apply(r),n.selectRange(r)}}else i=!0;n.keyboard.keyup(t)}).on("mousedown"+d,function(t){n.pendingFormats.clear();var i=e(t.target);!a.gecko&&2==t.which&&i.is("a[href]")&&window.open(i.attr("href"),"_new")}).on("mouseup"+d,function(){p(n)}),e(n.window).on("blur"+d,function(){var e=n.textarea.value,t=n.encodedValue();n.update(),t!=e&&n.trigger("change")}),e(n.body).on("cut"+d+" paste"+d,function(e){n.clipboard["on"+e.type](e)})},formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=k.fn._tools;n[e]=t,n[e].options&&n[e].options.template&&(n[e].options.template.options.cssClass="k-"+e)},registerFormat:function(e,t){n.ui.Editor.fn.options.formats[e]=t},createDialog:function(t,i,o){var r=n.support.isRtl(i.wrapper),a=e(t).appendTo(document.body).kendoWindow(o);return r&&a.closest(".k-window").addClass("k-rtl"),a}},p=f.select,m=f.focusable,h=f.wrapTextarea,g=f.renderTools,v=f.initializeContentElement,y={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",dialogInsert:"Insert",dialogButtonSeparator:"or",dialogCancel:"Cancel"},b=!r||r.ios&&r.flatVersion>=500||!r.ios&&document.documentElement.contentEditable!==t,k=o.extend({init:function(t,i){function r(t){var n=e.grep(t.className.split(" "),function(e){return!/^k-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)});return n[0]?n[0].substring(n[0].lastIndexOf("-")+1):"custom"}function a(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"}if(b){var s,u,f=this,p=n.ui.editor;o.fn.init.call(f,t,i),f.tools=l({},n.ui.Editor.fn._tools),f.options=l({},f.options,i),t=e(t),t.closest("form").on("submit"+d,function(){f.update()});for(var k in f.tools)f.tools[k].name=k.toLowerCase();f.textarea=t.attr("autocomplete","off")[0],s=f.wrapper=h(t),f.textarea.id&&s.find(".k-editor-toolbar").attr("aria-controls",f.textarea.id),g(f,f.options.tools),v(f),f.keyboard=new p.Keyboard([new p.TypingHandler(f),new p.SystemHandler(f)]),f.clipboard=new p.Clipboard(this),f.pendingFormats=new p.PendingFormats(this),f.undoRedoStack=new p.UndoRedoStack,u=i&&i.value?i.value:t.val().replace(/[\r\n\v\f\t ]+/gi," "),f.value(u);var w=".k-editor-toolbar > li > *, .k-editor-toolbar > li select",C=".k-editor-button .k-tool-icon",x=C+":not(.k-state-disabled)",T=C+".k-state-disabled";s.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),i=t.keyCode;i==c.RIGHT||i==c.LEFT?n.close():i==c.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),s.on("mouseenter"+d,x,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+d,x,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+d,C,!1).on("keydown"+d,m,function(t){var n,i=e(this).closest("li"),o="li:has("+m+")",r=t.keyCode;if(r==c.RIGHT)n=i.nextAll(o).first().find(m);else if(r==c.LEFT)n=i.prevAll(o).first().find(m);else if(r==c.ESC)n=f;else if(r==c.TAB&&!t.ctrlKey&&!t.altKey)if(t.shiftKey){if(n=i.prevAll(o).first().find(m),!n.length)return;t.preventDefault()}else t.preventDefault(),n=i.nextAll(o).first().find(m),n.length||(n=f);n&&n.focus()}).on("click"+d,x,function(e){e.preventDefault(),e.stopPropagation(),f.exec(r(this))}).on("click"+d,T,function(e){e.preventDefault()}).find(w).each(function(){var t=r(this),n=f.options,i=n.tools[t],o=n.messages[t],s=e(this);if(i){if("fontSize"==t||"fontName"==t){var l=n.messages[t+"Inherit"]||y[t+"Inherit"];s.find("input").val(l).end().find("span.k-input").text(l).end()}i.initialize(s,{title:a(o,i),editor:f})}}),f.bind("select",function(){var t=f.getRange(),n=p.RangeUtils.textNodes(t);n.length||(n=[t.startContainer]),s.find(w).each(function(){var t=f.options.tools[r(this)];t&&t.update(e(this),n,f.pendingFormats)})}),f._DOMNodeInsertedHandler=function(e){f._DOMNodeInserted(e)},f._endTypingHandler=function(){f._endTyping()},e(document).on("DOMNodeInserted",f._DOMNodeInsertedHandler).on("mousedown",f._endTypingHandler),n.notify(f)}},_endTyping:function(){var e=this;try{e.keyboard.isTypingInProgress()&&e.keyboard.endTyping(!0),e.selectionRestorePoint||(e.selectionRestorePoint=new n.ui.editor.RestorePoint(e.getRange()))}catch(t){}},_DOMNodeInserted:function(t){var n=this,i=n.wrapper;(e.contains(t.target,i[0])||i[0]==t.target)&&(n.textarea.value=n.value(),i.find("iframe").remove(),v(n),n.value(n.textarea.value))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:y,formats:{},encoded:!0,stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:["bold","italic","underline","strikethrough","fontName","fontSize","foreColor","backColor","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","indent","outdent","formatBlock","createLink","unlink","insertImage"]},destroy:function(){var t=this;o.fn.destroy.call(t),e(t.window).add(t.document).add(t.wrapper).add(t.element.closest("form")).off(d),e(document).off("DOMNodeInserted",t._DOMNodeInsertedHandler).off("mousedown",t._endTypingHandler),n.destroy(t.wrapper)},_nativeTools:["insertLineBreak","insertParagraph","redo","undo","insertHtml"],_tools:{undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},tools:{},value:function(i){var o=this.body,r=n.ui.editor.Dom,s=n.ui.editor.Serializer.domToXhtml(o);if(i===t)return s;if(i!=s){if(this.pendingFormats.clear(),i=(i||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script $1>$2</telerik:script>").replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1"),a.msie||(i=i.replace(/<p([^>]*)>(\s*)?<\/p>/gi,'<p $1><br _moz_dirty="" /></p>')),a.msie&&9>parseInt(a.version,10)){i="<br/>"+i;var l="originalsrc",d="originalhref";i=i.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,d+'="$1"'),i=i.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,l+'="$1"'),o.innerHTML=i,r.remove(o.firstChild),e(o).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[d]&&(e.setAttribute("href",e[d]),e.removeAttribute(d)),e[l]&&(e.setAttribute("src",e[l]),e.removeAttribute(l))})}else o.innerHTML=i,a.msie&&(r.normalize(o),setTimeout(function(){var e,t,n,i=o.getElementsByTagName("ol");for(e=0;i.length>e;e++)t=i[e],n=t.getAttribute("start"),t.setAttribute("start",1),n?t.setAttribute("start",n):t.removeAttribute(n)},1));this.selectionRestorePoint=null,this.update()}},focus:function(){this.window.focus()},update:function(e){this.textarea.value=e||this.options.encoded?this.encodedValue():this.value()},encodedValue:function(){return n.ui.editor.Dom.encode(this.value())},createRange:function(e){return n.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return n.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this.focus();var t=this.getSelection();t.removeAllRanges(),t.addRange(e)},getRange:function(){var e=this.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return n.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e){this.clipboard.paste(e)},exec:function(n,i){var o,r,a,l,d=this,c="";n=n.toLowerCase(),d.keyboard.isTypingInProgress()||(d.focus(),o=d.getRange(),r=d.document.body);for(a in d.options.tools)if(a.toLowerCase()==n){c=d.options.tools[a];break}if(c){if(o=d.getRange(),!/undo|redo/i.test(n)&&c.willDelayExecution(o))return l=e.extend({},c),e.extend(l.options,{params:i}),d.pendingFormats.toggle(l),p(d),t;var u=c.command?c.command(s({range:o},i)):null;if(d.trigger("execute",{name:n,command:u}),/undo|redo/i.test(n))d.undoRedoStack[n]();else if(u&&(u.managesUndoRedo||d.undoRedoStack.push(u),u.editor=d,u.exec(),u.async))return u.change=e.proxy(function(){p(d)},d),t;p(d)}}});n.ui.plugin(k);var w=i.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:function(){},willDelayExecution:function(){return!1}});w.exec=function(e,t,n){e.exec(t,{value:n})};var C=w.extend({init:function(e){w.fn.init.call(this,e)},command:function(e){var t=this;return new n.ui.editor.FormatCommand(s(e,{formatter:t.options.formatter}))},update:function(e,t,n){var i=n.isPending(this.name),o=this.options.finder.isFormatted(t),r=i?!o:o;e.toggleClass("k-state-active",r),e.attr("aria-pressed",r)}});f.registerTool("separator",new w({template:new u({template:f.separatorTemplate})})),s(n.ui,{editor:{ToolTemplate:u,EditorUtils:f,Tool:w,FormatTool:C}})})(window.kendo.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n=window.kendo,i=e.map,o=e.extend,r=n.support.browser,a="style",s="float",l="cssFloat",d="styleFloat",c="class",u="k-marker",f=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),p="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,pre,script,table,tbody,td,tfoot,th,thead,tr,ul".split(","),m=t(p),h="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var".split(","),g=t(h),v=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),y=function(e){1==e.nodeType&&e.normalize()};r.msie&&parseInt(r.version,10)>=8&&(y=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,R.remove(t)),t=n}});var b=/^\s+$/,k=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,w=/&/g,C=/</g,x=/>/g,T=/\u00a0/g,N=/\ufeff/g,S="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),R={findNodeIndex:function(e){for(var t=0;;){if(e=e.previousSibling,!e)break;t++}return t},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!R.isDataNode(t)&&(e.contains(t,R.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return R.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(R.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return R.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),i="",o=e;o.nextSibling&&3==o.nextSibling.nodeType&&o.nextSibling.nodeValue;)i+=o.nextSibling.nodeValue,o=o.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=i,R.insertAfter(n,e)},attrEquals:function(t,n){for(var i in n){var o=t[i];if(i==s&&(o=t[e.support.cssFloat?l:d]),"object"==typeof o){if(!R.attrEquals(o,n[i]))return!1}else if(o!=n[i])return!1}return!0},blockParentOrBody:function(e){return R.parentOfType(e,p)||e.ownerDocument.body},blockParents:function(t){var n,i,o=[];for(n=0,i=t.length;i>n;n++){var r=R.parentOfType(t[n],R.blockElements);r&&0>e.inArray(r,o)&&o.push(r)}return o},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:y,blockElements:p,inlineElements:h,empty:f,fillAttrs:v,toHex:function(e){var t=k.exec(e);return t?"#"+i(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e){return e.replace(w,"&").replace(C,"<").replace(x,">").replace(T," ")},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!R.isWhitespace(e)})},lastTextNode:function(e){var t=null;if(3==e.nodeType)return e;for(var n=e.lastChild;n;n=n.previousSibling)if(t=R.lastTextNode(n))return t;return t},is:function(e,t){return R.name(e)==t},isMarker:function(e){return e.className==u},isWhitespace:function(e){return b.test(e.nodeValue)},isBlock:function(e){return m[R.name(e)]},isEmpty:function(e){return f[R.name(e)]},isInline:function(e){return g[R.name(e)]},scrollTo:function(t){var n,i,o=t.ownerDocument.body,r=e(R.isDataNode(t)?t.parentNode:t),a=R.windowFromDocument(t.ownerDocument).innerHeight;"br"==R.name(r[0])&&(r=r.parent()),n=r.offset().top,i=r[0].offsetHeight,i+n>o.scrollTop+a&&(o.scrollTop=i+n-a)},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},trim:function(e){for(var t=e.childNodes.length-1;t>=0;t--){var n=e.childNodes[t];R.isDataNode(n)?(n.nodeValue.replace(N,"").length||R.remove(n),R.isWhitespace(n)&&R.insertBefore(n,e)):n.className!=u&&(R.trim(n),n.childNodes.length||R.isEmpty(n)||R.remove(n))}return e},parentOfType:function(e,t){do e=e.parentNode;while(e&&!R.ofType(e,t));return e},ofType:function(t,n){return e.inArray(R.name(t),n)>=0},changeTag:function(e,t){var n,i,o,r,s,l=R.create(e.ownerDocument,t),d=e.attributes;for(n=0,i=d.length;i>n;n++)s=d[n],s.specified&&(o=s.nodeName,r=s.nodeValue,o==c?l.className=r:o==a?l.style.cssText=e.style.cssText:l.setAttribute(o,r));for(;e.firstChild;)l.appendChild(e.firstChild);return R.insertBefore(l,e),R.remove(e),l},wrap:function(e,t){return R.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return R.attr(e.createElement(t),n)},attr:function(e,t){return t=o({},t),t&&a in t&&(R.style(e,t.style),delete t.style),o(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(t,n){for(var i in n)i==s&&(i=e.support.cssFloat?l:d),t.style[i]="";""===t.style.cssText&&t.removeAttribute(a)},inlineStyle:function(t,n,o){var a,s=e(R.create(t,n,o));return t.body.appendChild(s[0]),a=i(S,function(e){return r.msie&&"line-height"==e&&"1px"==s.css(e)?"line-height:1.5":e+":"+s.css(e)}).join(";"),s.remove(),a},removeClass:function(t,n){var i,o,r=" "+t.className+" ",a=n.split(" ");for(i=0,o=a.length;o>i;i++)r=r.replace(" "+a[i]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(c)},commonAncestor:function(){var e,t,n,i,o,r=arguments.length,a=[],s=1/0,l=null;if(!r)return null;if(1==r)return arguments[0];for(e=0;r>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==r)return a[0][0];for(e=0;s>e;e++){for(i=a[0][e],o=1;r>o;o++)if(i!=a[o][e])return l;l=i}return l}};n.ui.editor.Dom=R}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.editor,o=i.Dom,r=e.extend,a="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),s=/"/g,l=/<br[^>]*>/i,d=/<p><\/p>/i,c=/([\w|\-]+)\s*:\s*([^;]+);?/i,u={domToXhtml:function(n){function i(n){var i,r,a,l=[],d=n.attributes,u=e.trim;if(o.is(n,"img")){var p=n.style.width,m=n.style.height,h=e(n);p&&(h.attr("width",parseInt(p,10)),o.unstyle(n,{width:t})),m&&(h.attr("height",parseInt(m,10)),o.unstyle(n,{height:t}))}for(r=0,a=d.length;a>r;r++){i=d[r];var g=i.nodeName;(i.specified||"value"==g&&!n.value||"type"==g&&"text"==i.nodeValue)&&0>g.indexOf("_moz")&&"complete"!=g&&"altHtml"!=g&&l.push(i)}if(l.length)for(l.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),r=0,a=l.length;a>r;r++){i=l[r];var v=i.nodeName,y=i.nodeValue;if(f.push(" "),f.push(v),f.push('="'),"style"==v)for(var b=u(y||n.style.cssText).split(";"),k=0,w=b.length;w>k;k++){var C=b[k];if(C.length){var x=c.exec(C),T=u(x[1].toLowerCase()),N=u(x[2]);if("font-size-adjust"==T||"font-stretch"==T)continue;T.indexOf("color")>=0&&(N=o.toHex(N)),T.indexOf("font")>=0&&(N=N.replace(s,"'")),f.push(T),f.push(":"),f.push(N),f.push(";")}}else"src"==v||"href"==v?f.push(n.getAttribute(v,2)):f.push(o.fillAttrs[v]?v:y);f.push('"')}}function r(e,t){for(var n=e.firstChild;n;n=n.nextSibling)u(n,t)}function u(n,a){var s,l,d,c,u,m=n.nodeType;if(1==m){if(s=o.name(n),!s||(n.attributes._moz_dirty||n.attributes._moz_editor_bogus_node)&&o.is(n,"br")||"k-marker"==n.className)return;if(l=p[s])return l.start(n),r(n),l.end(n),t;f.push("<"),f.push(s),i(n),o.empty[s]?f.push(" />"):(f.push(">"),r(n,a||o.is(n,"pre")),f.push("</"),f.push(s),f.push(">"))}else 3==m?(c=n.nodeValue,!a&&e.support.leadingWhitespace&&(d=n.parentNode,u=n.previousSibling,u||(u=(o.isInline(d)?d:n).previousSibling),(!u||""===u.innerHTML||o.isBlock(u))&&(c=c.replace(/^[\r\n\v\f\t ]+/,"")),c=c.replace(/ +/," ")),f.push(o.encode(c))):4==m?(f.push("<![CDATA["),f.push(n.data),f.push("]]>")):8==m&&(0>n.data.indexOf("[CDATA[")?(f.push("<!--"),f.push(n.data),f.push("-->")):(f.push("<!"),f.push(n.data),f.push(">")))}var f=[],p={"telerik:script":{start:function(e){f.push("<script"),i(e),f.push(">")},end:function(){f.push("</script>")}},b:{start:function(){f.push("<strong>")},end:function(){f.push("</strong>")}},i:{start:function(){f.push("<em>")},end:function(){f.push("</em>")}},u:{start:function(){f.push('<span style="text-decoration:underline;">')},end:function(){f.push("</span>")}},iframe:{start:function(e){f.push("<iframe"),i(e),f.push(">")},end:function(){f.push("</iframe>")}},font:{start:function(e){f.push('<span style="');var t=e.getAttribute("color"),n=a[e.getAttribute("size")],i=e.getAttribute("face");t&&(f.push("color:"),f.push(o.toHex(t)),f.push(";")),i&&(f.push("font-face:"),f.push(i),f.push(";")),n&&(f.push("font-size:"),f.push(n),f.push(";")),f.push('">')},end:function(){f.push("</span>")}}};return r(n),f=f.join(""),""===f.replace(l,"").replace(d,"")?"":f}};r(i,{Serializer:u})}(window.kendo.jQuery),function(e){function t(e,t,n,i){if(e==t)return i-n;for(var o=t;o&&o.parentNode!=e;)o=o.parentNode;if(o)return f(o)-n;for(o=e;o&&o.parentNode!=t;)o=o.parentNode;if(o)return i-f(o)-1;for(var r=u.commonAncestor(e,t),a=e;a&&a.parentNode!=r;)a=a.parentNode;a||(a=r);for(var s=t;s&&s.parentNode!=r;)s=s.parentNode;return s||(s=r),a==s?0:f(s)-f(a)}function n(e,n){function i(e){try{return 0>t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!u.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function o(e,t,n){var i=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],r=0,a=p(i)?i:i.childNodes[o]||null,s=p(i)?i.parentNode:i;(3==i.nodeType||4==i.nodeType)&&(r=o);var l=s.insertBefore(u.create(t.ownerDocument,"a"),a),d=t.ownerDocument.body.createTextRange();d.moveToElementText(l),u.remove(l),d[n?"moveStart":"moveEnd"]("character",r),d.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",d)}function r(e,t,n){var i=u.create(t.ownerDocument,"a"),o=e.duplicate();o.collapse(n);var r=o.parentElement();do r.insertBefore(i,i.previousSibling),o.moveToElementText(i);while(o.compareEndPoints(n?"StartToStart":"StartToEnd",e)>0&&i.previousSibling);o.setEndPoint(n?"EndToStart":"EndToEnd",e);var a=i.nextSibling;return a?(u.remove(i),p(a)?t[n?"setStart":"setEnd"](a,o.text.length):t[n?"setStartBefore":"setEndBefore"](a),void 0):(a=i.previousSibling,a&&p(a)?(t.setEnd(a,a.nodeValue.length),u.remove(i)):(t.selectNodeContents(r),u.remove(i),t.endOffset-=1),void 0)}var a=window.kendo,s=a.Class,l=e.extend,d=a.ui.editor,c=a.support.browser,u=d.Dom,f=u.findNodeIndex,p=u.isDataNode,m=u.findClosestAncestor,h=u.getNodeLength,g=u.normalize,v={selectionFromWindow:function(e){return c.msie&&9>c.version?new k(e.document):e.getSelection()},selectionFromRange:function(e){var t=N.documentFromRange(e);return v.selectionFromDocument(t)},selectionFromDocument:function(e){return v.selectionFromWindow(u.windowFromDocument(e))}},y=s.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,f(e))},setStartAfter:function(e){this.setStart(e.parentNode,f(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,f(e))},setEndAfter:function(e){this.setEnd(e.parentNode,f(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(m(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new b(t))},cloneContents:function(){var e=N.documentFromRange(this);return function t(n){for(var i,o=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),o.appendChild(i);return o}(new b(this))},extractContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(m(e.commonAncestorContainer,e.startContainer)),e.collapse(!0);var n=N.documentFromRange(e);return function i(t){for(var o,r=n.createDocumentFragment();o=t.next();)t.hasPartialSubtree()?(o=o.cloneNode(!1),o.appendChild(i(t.getSubtreeIterator()))):t.remove(e.originalRange),r.appendChild(o);return r}(new b(t))},insertNode:function(e){var t=this;p(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&u.splitDataNode(t.startContainer,t.startOffset),u.insertAfter(e,t.startContainer)):u.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new y(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return["#text"==e?this.startContainer.nodeValue:e,"(",this.startOffset,") : ","#text"==t?this.endContainer.nodeValue:t,"(",this.endOffset,")"].join("")}}),b=s.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||p(t.startContainer)?m(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||p(t.endContainer)?m(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,p(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,o=this,r=o.range.startContainer==o._current,a=o.range.endContainer==o._current;if(p(o._current)&&(r||a))t=r?o.range.startOffset:0,n=a?o.range.endOffset:o._current.length,i=n-t,e&&(r||a)&&(o._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),o._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),o._current.deleteData(t,i);else{var s=o._current.parentNode;if(e&&(o.range.startContainer==s||o.range.endContainer==s)){var l=f(o._current);
+s==e.startContainer&&e.startOffset>=l&&(e.startOffset-=1),s==e.endContainer&&e.endOffset>l&&(e.endOffset-=1)}u.remove(o._current)}},hasPartialSubtree:function(){return!p(this._current)&&(u.isAncestorOrSelf(this._current,this.range.startContainer)||u.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),u.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),u.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new b(t)}}),k=s.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();o(t,e,!1),o(t,e,!0),t.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var e,t,n=new y(this.ownerDocument),i=this.ownerDocument.selection;try{if(e=i.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return n}catch(o){return n}if("Control"==i.type)n.selectNode(e.item(0));else{r(e,n,!0),r(e,n,!1),9==n.startContainer.nodeType&&n.setStart(n.endContainer,n.startOffset),9==n.endContainer.nodeType&&n.setEnd(n.startContainer,n.endOffset),0===e.compareEndPoints("StartToEnd",e)&&n.collapse(!1);var a=n.startContainer,s=n.endContainer,l=this.ownerDocument.body;if(!(n.collapsed||0!==n.startOffset||n.endOffset!=h(n.endContainer)||a==s&&p(a)&&a.parentNode==l)){for(var d=!1,c=!1;0===f(a)&&a==a.parentNode.firstChild&&a!=l;)a=a.parentNode,d=!0;for(;f(s)==h(s.parentNode)-1&&s==s.parentNode.lastChild&&s!=l;)s=s.parentNode,c=!0;a==l&&s==l&&d&&c&&(n.setStart(a,0),n.setEnd(s,h(l)))}}return n}}),w=s.extend({init:function(e){this.enumerate=function(){function t(e){if(u.is(e,"img")||3==e.nodeType&&!u.isWhitespace(e))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new b(e).traverse(t),n}}}),C=s.extend({init:function(e){var t=this;t.range=e,t.rootNode=N.documentFromRange(e),t.body=t.rootNode.body,t.html=t.body.innerHTML,t.startContainer=t.nodeToPath(e.startContainer),t.endContainer=t.nodeToPath(e.endContainer),t.startOffset=t.offset(e.startContainer,e.startOffset),t.endOffset=t.offset(e.endContainer,e.endOffset)},index:function(e){for(var t=0,n=e.nodeType;e=e.previousSibling;){var i=e.nodeType;(3!=i||n!=i)&&t++,n=i}return t},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var o=this.rootNode,r=n.length,a=i;r--;)o=o.childNodes[n[r]];for(;3==o.nodeType&&a>o.nodeValue.length;)a-=o.nodeValue.length,o=o.nextSibling;e[t?"setStart":"setEnd"](o,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),x=s.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=u.create(N.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t=this,n=t.caret.previousSibling,i=0;n&&(i=p(n)?n.nodeValue.length:f(n));var o=t.caret.parentNode,r=n?f(n):0;u.remove(t.caret),g(o);var a=o.childNodes[r];if(p(a))e.setStart(a,i);else if(a){var s=u.lastTextNode(a);s?e.setStart(s,s.nodeValue.length):e[n?"setStartAfter":"setStartBefore"](a)}else c.msie||o.innerHTML||(o.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(o);e.collapse(!0)},add:function(e,t){var n=this;t&&e.collapsed&&(n.addCaret(e),e=N.expand(e));var i=e.cloneRange();return i.collapse(!1),n.end=u.create(N.documentFromRange(e),"span",{className:"k-marker"}),i.insertNode(n.end),i=e.cloneRange(),i.collapse(!0),n.start=n.end.cloneNode(!0),i.insertNode(n.start),e.setStartBefore(n.start),e.setEndAfter(n.end),g(e.commonAncestorContainer),e},remove:function(e){var t,n,i,o=this,r=o.start,a=o.end;for(g(e.commonAncestorContainer);!r.nextSibling&&r.parentNode;)r=r.parentNode;for(;!a.previousSibling&&a.parentNode;)a=a.parentNode;t=r.previousSibling&&3==r.previousSibling.nodeType&&r.nextSibling&&3==r.nextSibling.nodeType,n=a.previousSibling&&3==a.previousSibling.nodeType&&a.nextSibling&&3==a.nextSibling.nodeType,i=t&&n,r=r.nextSibling,a=a.previousSibling;var s=!1,l=!1;if(r==o.end&&(l=!!o.start.previousSibling,r=a=o.start.previousSibling||o.end.nextSibling,s=!0),u.remove(o.start),u.remove(o.end),!r||!a)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;var d=s?p(r)?r.nodeValue.length:r.childNodes.length:0,c=p(a)?a.nodeValue.length:a.childNodes.length;if(3==r.nodeType)for(;r.previousSibling&&3==r.previousSibling.nodeType;)r=r.previousSibling,d+=r.nodeValue.length;if(3==a.nodeType)for(;a.previousSibling&&3==a.previousSibling.nodeType;)a=a.previousSibling,c+=a.nodeValue.length;for(var m=f(r),h=r.parentNode,v=f(a),y=a.parentNode,b=r;b.previousSibling;b=b.previousSibling)3==b.nodeType&&3==b.previousSibling.nodeType&&m--;for(var k=a;k.previousSibling;k=k.previousSibling)3==k.nodeType&&3==k.previousSibling.nodeType&&v--;g(h),3==r.nodeType&&(r=h.childNodes[m]),g(y),3==a.nodeType&&(a=y.childNodes[v]),s?(3==r.nodeType?e.setStart(r,d):e[l?"setStartAfter":"setStartBefore"](r),e.collapse(!0)):(3==r.nodeType?e.setStart(r,d):e.setStartBefore(r),3==a.nodeType?e.setEnd(a,c):e.setEndAfter(a)),o.caret&&o.removeCaret(e)}}),T=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,N={nodes:function(e){var t=N.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=N.textNodes(e),t.length||(t=u.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new w(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return c.msie&&9>c.version?new y(e):e.createRange()},selectRange:function(e){var t=N.image(e);t&&(e.setStartAfter(t),e.setEndAfter(t));var n=v.selectionFromRange(e);n.removeAllRanges(),n.addRange(e)},split:function(e,t,n){function i(i){var o=e.cloneRange();o.collapse(i),o[i?"setStartBefore":"setEndAfter"](t);var r=o.extractContents();n&&(r=u.trim(r)),u[i?"insertBefore":"insertAfter"](r,t)}i(!0),i(!1)},getMarkers:function(e){var t=[];return new b(e).traverse(function(e){"k-marker"==e.className&&t.push(e)}),t},image:function(e){var t=[];return new b(e).traverse(function(e){u.is(e,"img")&&t.push(e)}),1==t.length?t[0]:void 0},expand:function(e){var t=e.cloneRange(),n=t.startContainer.childNodes[0===t.startOffset?0:t.startOffset-1],i=t.endContainer.childNodes[t.endOffset];if(!p(n)||!p(i))return t;var o=n.nodeValue,r=i.nodeValue;if(!o||!r)return t;var a=o.split("").reverse().join("").search(T),s=r.search(T);return a&&s?(s=-1==s?r.length:s,a=-1==a?0:o.length-a,t.setStart(n,a),t.setEnd(i,s),t):t},isExpandable:function(e){var t=e.startContainer,n=N.documentFromRange(e);if(t==n||t==n.body)return!1;var i=e.cloneRange(),o=t.nodeValue;if(!o)return!1;var r=o.substring(0,i.startOffset),a=o.substring(i.startOffset),s=0,l=0;return r&&(s=r.split("").reverse().join("").search(T)),a&&(l=a.search(T)),s&&l}};l(d,{SelectionUtils:v,W3CRange:y,RangeIterator:b,W3CSelection:k,RangeEnumerator:w,RestorePoint:C,Marker:x,RangeUtils:N})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=i.EditorUtils,r=o.registerTool,a=i.Dom,s=i.RangeUtils,l=s.selectRange,d=i.Tool,c=i.ToolTemplate,u=i.RestorePoint,f=i.Marker,p=e.extend,m=n.extend({init:function(e){var t=this;t.options=e,t.restorePoint=new u(e.range),t.marker=new f,t.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),l(e)},undo:function(){var e=this.restorePoint;e.body.innerHTML=e.html,l(e.toRange())},redo:function(){this.exec()},exec:function(){var e=this,t=e.lockRange(!0);e.formatter.editor=e.editor,e.formatter.toggle(t),e.releaseRange(t)}}),h=n.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,l(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,l(this.startRestorePoint.toRange())}}),g=m.extend({init:function(e){m.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e=this.editor,t=e.getRange(),n=new u(t);e.clipboard.paste(this.options.value||""),e.undoRedoStack.push(new h(n,new u(e.getRange()))),e.focus()}}),v=d.extend({initialize:function(e,t){var n=t.editor;new i.SelectBox(e,{dataSource:n.options.insertHtml||[],dataTextField:"text",dataValueField:"value",change:function(){d.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new g(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),y=n.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){var t=this;t.stack=t.stack.slice(0,t.currentCommandIndex+1),t.currentCommandIndex=t.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),b=n.extend({init:function(e){this.editor=e},keydown:function(t){var n=this,i=n.editor,o=i.keyboard,r=o.isTypingKey(t),a=p(e.Event(),t);if(n.editor.trigger("keydown",a),a.isDefaultPrevented()&&t.preventDefault(),!a.isDefaultPrevented()&&r&&!o.isTypingInProgress()){var s=i.getRange();return n.startRestorePoint=new u(s),o.startTyping(function(){i.selectionRestorePoint=n.endRestorePoint=new u(i.getRange()),i.undoRedoStack.push(new h(n.startRestorePoint,n.endRestorePoint))}),!0}return!1},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),k=n.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var e=this;e.endRestorePoint=new u(e.editor.getRange()),e.editor.undoRedoStack.push(new h(e.startRestorePoint,e.endRestorePoint)),e.startRestorePoint=e.endRestorePoint},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new u(n.getRange()),!0):i.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(e){var t=this;return t.systemCommandIsInProgress&&t.changed()?(t.systemCommandIsInProgress=!1,t.createUndoCommand(e),!0):!1}}),w=n.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e},toolFromShortcut:function(t,n){var i,o,r=String.fromCharCode(n.keyCode);for(i in t)if(o=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(o.key==r||o.key==n.keyCode)&&o.ctrl==n.ctrlKey&&o.alt==n.altKey&&o.shift==n.shiftKey)return i},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress=!1,this.onEndTyping&&this.onEndTyping()},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),C=n.extend({init:function(e){this.editor=e,this.cleaners=[new x]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=a.create(n,"div"),o=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)o.appendChild(i.firstChild);return o},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},oncut:function(){var e=this.editor,t=new u(e.getRange());setTimeout(function(){e.undoRedoStack.push(new h(t,new u(e.getRange())))})},onpaste:function(t){var n=this.editor,o=n.getRange(),r="",s=new u(o),d=a.create(n.document,"div",{className:"k-paste-container",innerHTML:r});if(n.body.appendChild(d),n.body.createTextRange){t.preventDefault();var c=n.createRange();c.selectNodeContents(d),n.selectRange(c);var f=n.body.createTextRange();f.moveToElementText(d),e(n.body).unbind("paste"),f.execCommand("Paste"),e(n.body).bind("paste",e.proxy(arguments.callee,this))}else{var p=n.createRange();p.selectNodeContents(d),l(p)}setTimeout(function(){var e,t={html:""};l(o),a.remove(d),d.lastChild&&a.is(d.lastChild,"br")&&a.remove(d.lastChild),e=d.innerHTML,e!=r&&(t.html=e),n.trigger("paste",t),n.clipboard.paste(t.html,!0),n.undoRedoStack.push(new h(s,new u(n.getRange()))),i.EditorUtils.select(n)})},splittableParent:function(e,t){var n,i;if(e)return a.parentOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=i&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(e,t){var n,i,o=this.editor;for(n=0,i=this.cleaners.length;i>n;n++)this.cleaners[n].applicable(e)&&(e=this.cleaners[n].clean(e));t&&(e=e.replace(/(<br>(\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),e=e.replace(/<(a|span)[^>]*><\/\1>/gi,"")),e=e.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>");var r=this.isBlock(e),d=o.getRange();d.deleteContents(),d.startContainer==o.document&&d.selectNodeContents(o.body);var c=new f,u=c.addCaret(d),p=this.splittableParent(r,u),m=!1;/body|td/.test(a.name(p))||!r&&!a.isInline(p)||(d.selectNode(u),s.split(d,p,!0),m=!0);var h=this.htmlToFragment(e);if(h.firstChild&&"k-paste-container"===h.firstChild.className){var g=[];for(n=0,i=h.childNodes.length;i>n;n++)g.push(h.childNodes[n].innerHTML);h=this.htmlToFragment(g.join("<br />"))}if(d.insertNode(h),p=this.splittableParent(r,u),m){for(;u.parentNode!=p;)a.unwrap(u.parentNode);a.unwrap(u.parentNode)}a.normalize(d.commonAncestorContainer),u.style.display="inline",a.scrollTo(u),c.removeCaret(d),l(d)}}),x=n.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/"/g,"'",/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>/g," ",/<table([^>]*)>(\s| )+<t/gi,"<table$1><t",/<tr[^>]*>(\s| )*<\/tr>/gi,"",/<tbody[^>]*>(\s| )*<\/tbody>/gi,"",/<table[^>]*>(\s| )*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*( )+/gi,"",/( |<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/style=(["|'])\s*\1/g,""]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)},listType:function(e){return/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},lists:function(t){for(var n,i=a.create(document,"div",{innerHTML:t}),o=e(a.blockElements.join(","),i),r=-1,s={ul:{},ol:{}},l=i,d=0;o.length>d;d++){var c=o[d];t=c.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," ");var u=this.listType(t);if(u&&"p"==a.name(c)){var f=parseFloat(c.style.marginLeft||0),p=s[u][f];if((f>r||!p)&&(p=a.create(document,u),l==i?a.insertBefore(p,c):l.appendChild(p),s[u][f]=p),n!=u)for(var m in s)for(var h in s[m])e.contains(p,s[m][h])&&delete s[m][h];a.remove(c.firstChild),l=a.create(document,"li",{innerHTML:c.innerHTML}),p.appendChild(l),a.remove(c),r=f,n=u}else c.innerHTML?(s={ul:{},ol:{}},l=i,r=-1):a.remove(c)}return i.innerHTML},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||0>t.indexOf("href")?"":e})},clean:function(e){var t,n,i=this,o=i.replacements;for(t=0,n=o.length;n>t;t+=2)e=e.replace(o[t],o[t+1]);return e=i.stripEmptyAnchors(e),e=i.lists(e),e=e.replace(/\s+class="?[^"\s>]*"?/gi,"")}});p(i,{Command:m,GenericCommand:h,InsertHtmlCommand:g,InsertHtmlTool:v,UndoRedoStack:y,TypingHandler:b,SystemHandler:k,Keyboard:w,Clipboard:C,MSWordFormatCleaner:x}),r("insertHtml",new v({template:new c({template:o.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){function t(e){return e.collapsed&&!u.isExpandable(e)}var n=window.kendo,i=n.Class,o=n.ui.editor,r=n.ui.Editor.fn.options.formats,a=o.EditorUtils,s=o.Tool,l=o.ToolTemplate,d=o.FormatTool,c=o.Dom,u=o.RangeUtils,f=e.extend,p=o.EditorUtils.registerTool,m=o.EditorUtils.registerFormat,h="k-marker",g=i.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,o=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==h?o++:3==t.nodeType?n++:i++);return o>1&&r.firstChild.className==h&&r.lastChild.className==h?0:i+n},findSuitable:function(e,t){return!t&&this.numberOfSiblings(e)>0?null:c.parentOfType(e,this.format[0].tags)},findFormat:function(e){var t,n,i,o,r,a=this.format,s=c.attrEquals;for(t=0,n=a.length;n>t;t++){if(i=e,o=a[t].tags,r=a[t].attr,i&&c.ofType(i,o)&&s(i,r))return i;for(;i;)if(i=c.parentOfType(i,o),i&&s(i,r))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),v=i.extend({init:function(e,t){var n=this;n.finder=new g(e),n.attributes=f({},e[0].attr,t),n.tag=e[0].tags[0]},wrap:function(e){return c.wrap(e,c.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){var n=this;n.finder.isFormatted(t)?(n.split(e),n.remove(t)):n.apply(t)},toggle:function(e){var t=u.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,i,o,r=this,a=[];for(t=0,n=e.length;n>t;t++)i=e[t],o=r.finder.findSuitable(i),o?c.attr(o,r.attributes):o=r.wrap(i),a.push(o);r.consolidate(a)},remove:function(e){var t,n,i,o=this;for(t=0,n=e.length;n>t;t++)i=o.finder.findFormat(e[t]),i&&(o.attributes&&o.attributes.style?(c.unstyle(i,o.attributes.style),i.style.cssText||c.unwrap(i)):c.unwrap(i))},split:function(e){var t,n,i=u.textNodes(e),o=i.length;if(o>0)for(t=0;o>t;t++)n=this.finder.findFormat(i[t]),n&&u.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==h&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);c.remove(t)}}}),y=g.extend({init:function(e,t){var n=this;n.format=e,n.greedyProperty=t,g.fn.init.call(n,e)},getInlineCssValue:function(t){var n,i,o,r,a,s,l,d,u,f,p,m,h=t.attributes,g=e.trim;if(h)for(n=0,i=h.length;i>n;n++)if(o=h[n],r=o.nodeName,a=o.nodeValue,o.specified&&"style"==r)for(s=g(a||t.style.cssText).split(";"),d=0,u=s.length;u>d;d++)if(l=s[d],l.length){if(f=l.split(":"),p=g(f[0].toLowerCase()),m=g(f[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?c.toHex(m):m}},getFormatInner:function(t){var n,i,o,r=e(c.isDataNode(t)?t.parentNode:t),a=r.parents().andSelf();for(n=0,i=a.length;i>n;n++)if(o="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return o;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),b=v.extend({init:function(e,t,n){var i=this;v.fn.init.call(i,e,t),i.greedyProperty=n,i.values=t,i.finder=new y(e,n)},activate:function(e,t){var n,i=this,o=i.greedyProperty,r="apply";i.split(e),o&&(n=o.replace(/-([a-z])/,function(e,t){return t.toUpperCase()}),"inherit"==i.values.style[n]&&(r="remove")),i[r](t)}}),k=d.extend({init:function(e){d.fn.init.call(this,f(e,{finder:new g(e.format),formatter:function(){return new v(e.format)}})),this.willDelayExecution=t}}),w=s.extend({init:function(e){var t=this;s.fn.init.call(t,e),t.type=n.support.browser.msie||n.support.touch?"kendoDropDownList":"kendoComboBox",t.format=[{tags:["span"]}],t.finder=new y(t.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(f(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},willDelayExecution:t,update:function(e,t,n){var i=this,o=e.data(i.type),r=n.getPending(i.name),a=r&&r.params?r.params.value:i.finder.getFormat(t);o.close(),o.value(a)},initialize:function(e,t){var n,i=t.editor,o=this.options,r=o.name,a=[];o.defaultValue&&(a=[{text:i.options.messages[o.defaultValue[0].text],value:o.defaultValue[0].value}]),n=a.concat(o.items?o.items:i.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){s.exec(i,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").andSelf().attr("unselectable","on"),e.data(this.type).value("inherit")}}),C=s.extend({init:function(e){s.fn.init.call(this,e),this.options=e,this.format=[{tags:["span"]}]},update:function(e){e.data("kendoColorPicker").close()},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(f(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},willDelayExecution:t,initialize:function(e,t){var i=t.editor,r=this.name;e.attr("title",t.title),new o.ColorPicker(e,{value:"#000000",ariaId:i.element[0].id?n.format("{0}_{1}_cp",i.element[0].id,r):"",change:function(e){s.exec(i,r,e.value)}})}}),x=s.extend({init:function(e){var t=this;s.fn.init.call(t,e),t.format=[{tags:["span"]}],t.finder=new y(t.format,"className")},command:function(e){var t=this.format;return new o.FormatCommand(f(e,{formatter:function(){return new b(t,{className:e.value})}}))},update:function(e,t){var n=e.data("kendoSelectBox");n.close(),n.value(this.finder.getFormat(t))},initialize:function(e,t){var n=t.editor;new o.SelectBox(e,{dataTextField:"text",dataValueField:"value",dataSource:n.options.style,title:n.options.messages.style,change:function(){s.exec(n,"style",this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+this.name).find("*").andSelf().attr("unselectable","on")}});f(o,{InlineFormatFinder:g,InlineFormatter:v,GreedyInlineFormatFinder:y,GreedyInlineFormatter:b,InlineFormatTool:k,FontTool:w,ColorTool:C,StyleTool:x}),p("style",new o.StyleTool({template:new l({template:a.dropDownListTemplate,title:"Styles"})})),m("bold",[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),p("bold",new k({key:"B",ctrl:!0,format:r.bold,template:new l({template:a.buttonTemplate,title:"Bold"})})),m("italic",[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),p("italic",new k({key:"I",ctrl:!0,format:r.italic,template:new l({template:a.buttonTemplate,title:"Italic"})})),m("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}}]),p("underline",new k({key:"U",ctrl:!0,format:r.underline,template:new l({template:a.buttonTemplate,title:"Underline"})})),m("strikethrough",[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),p("strikethrough",new k({format:r.strikethrough,template:new l({template:a.buttonTemplate,title:"Strikethrough"})})),m("superscript",[{tags:["sup"]}]),p("superscript",new k({format:r.superscript,template:new l({template:a.buttonTemplate,title:"Superscript"})})),m("subscript",[{tags:["sub"]}]),p("subscript",new k({format:r.subscript,template:new l({template:a.buttonTemplate,title:"Subscript"})})),p("foreColor",new C({cssAttr:"color",domAttr:"color",name:"foreColor",template:new l({template:a.colorPickerTemplate,title:"Color"})})),p("backColor",new C({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new l({template:a.colorPickerTemplate,title:"Background Color"})})),p("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new l({template:a.comboBoxTemplate,title:"Font Name"})})),p("fontSize",new w({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new l({template:a.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=t.ui.Editor.fn.options.formats,a=o.Dom,s=o.Command,l=o.Tool,d=o.ToolTemplate,c=o.FormatTool,u=o.EditorUtils,f=u.registerTool,p=u.registerFormat,m=o.RangeUtils,h=n.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,o;for(n=0,i=t.length;i>n;n++)if(o=t[n],!o||!a.isAncestorOrSelf(e,o))return!1;return!0},findSuitable:function(t){var n,i,o,r=this.format,s=[];for(n=0,i=t.length;i>n;n++){if(o=a.ofType(t[n],r[0].tags)?t[n]:a.parentOfType(t[n],r[0].tags),!o)return[];0>e.inArray(o,s)&&s.push(o)}for(n=0,i=s.length;i>n;n++)if(this.contains(s[n],s))return[s[n]];return s},findFormat:function(e){var t,n,i,o,r,s=this.format;for(t=0,n=s.length;n>t;t++)for(i=e,o=s[t].tags,r=s[t].attr;i;){if(a.ofType(i,o)&&a.attrEquals(i,r))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,o=function(e){return i.findFormat(a.isDataNode(e)?e.parentNode:e)},r=o(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=o(e[t]))return"";return r.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),g=n.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new h(e)},wrap:function(e,t,n){var i=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);a.isInline(i)&&(i=a.blockParentOrBody(i));var o,r,s=a.significantChildNodes(i),l=a.findNodeIndex(s[0]),d=a.create(i.ownerDocument,e,t);for(o=0;s.length>o;o++)r=s[o],a.isBlock(r)?(a.attr(r,t),d.childNodes.length&&(a.insertBefore(d,r),d=d.cloneNode(!1)),l=a.findNodeIndex(r)+1):d.appendChild(r);d.firstChild&&a.insertAt(i,d,l)},apply:function(e){var t,n,o=this,r=a.is(e[0],"img")?[e[0]]:o.finder.findSuitable(e),s=r.length?u.formatByName(a.name(r[0]),o.format):o.format[0],l=s.tags[0],d=i({},s.attr,o.values);if(r.length)for(t=0,n=r.length;n>t;t++)a.attr(r[t],d);else o.wrap(l,d,e)},remove:function(e){var t,n,i,o;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(a.ofType(i,["p","img","li"])?(o=u.formatByName(a.name(i),this.format),o.attr.style&&a.unstyle(i,o.attr.style),o.attr.className&&a.removeClass(i,o.attr.className)):a.unwrap(i))},toggle:function(e){var t=this,n=m.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=n.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new h(e)},apply:function(e){var t,n,i,r,s,l=this.format,d=a.blockParents(e),c=l[0].tags[0];if(d.length)for(t=0,n=d.length;n>t;t++)a.is(d[t],"li")?(i=d[t].parentNode,r=new o.ListFormatter(i.nodeName.toLowerCase(),c),s=this.editor.createRange(),s.selectNode(d[t]),r.toggle(s)):a.changeTag(d[t],c);else new g(l,this.values).apply(e)},toggle:function(e){var t=m.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=m.textNodes(e),t.length||(t=a.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),y=s.extend({init:function(e){e.formatter=e.formatter(),s.fn.init.call(this,e)}}),b=c.extend({init:function(e){c.fn.init.call(this,i(e,{finder:new h(e.format),formatter:function(){return new g(e.format)}}))}}),k=l.extend({init:function(e){l.fn.init.call(this,e),this.finder=new h([{tags:a.blockElements}])},command:function(e){return new y(i(e,{formatter:function(){return new v([{tags:[e.value]}],{})}}))},update:function(e,t){var n;n=e.is("select")?e.data("kendoSelectBox"):e.find("select").data("kendoSelectBox"),n.close(),n.value(this.finder.getFormat(t))},initialize:function(e,t){var n=t.editor,i="formatBlock";new o.SelectBox(e,{dataTextField:"text",dataValueField:"value",dataSource:this.options.items?this.options.items:n.options.formatBlock,title:n.options.messages.formatBlock,change:function(){l.exec(n,i,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+i).find("*").andSelf().attr("unselectable","on")}});i(o,{BlockFormatFinder:h,BlockFormatter:g,GreedyBlockFormatter:v,FormatCommand:y,BlockFormatTool:b,FormatBlockTool:k}),f("formatBlock",new k({template:new d({template:u.dropDownListTemplate})})),p("justifyLeft",[{tags:a.blockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}]),f("justifyLeft",new b({format:r.justifyLeft,template:new d({template:u.buttonTemplate,title:"Justify Left"})})),p("justifyCenter",[{tags:a.blockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}]),f("justifyCenter",new b({format:r.justifyCenter,template:new d({template:u.buttonTemplate,title:"Justify Center"})})),p("justifyRight",[{tags:a.blockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}]),f("justifyRight",new b({format:r.justifyRight,template:new d({template:u.buttonTemplate,title:"Justify Right"})})),p("justifyFull",[{tags:a.blockElements,attr:{style:{textAlign:"justify"}}}]),f("justifyFull",new b({format:r.justifyFull,template:new d({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.Dom,r=i.Command,a=i.Tool,s=i.BlockFormatter,l=o.normalize,d=i.RangeUtils,c=i.EditorUtils.registerTool,u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){function e(e){if(e.firstChild&&o.is(e.firstChild,"br")&&o.remove(e.firstChild),o.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e&&!o.is(e,"img")){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;""===e.innerHTML&&(e.innerHTML=v)}}var n,i,r,a,c,u,f,p,m,h=this.getRange(),g=d.documentFromRange(h),v=t.support.browser.msie?"":'<br _moz_dirty="" />',y="p,h1,h2,h3,h4,h5,h6".split(","),b=o.parentOfType(h.startContainer,y),k=o.parentOfType(h.endContainer,y),w=b&&!k||!b&&k;if(h.deleteContents(),u=o.create(g,"a"),h.insertNode(u),u.parentNode||(a=h.commonAncestorContainer,a.innerHTML="",a.appendChild(u)),l(u.parentNode),f=o.parentOfType(u,["li"]),p=o.parentOfType(u,"h1,h2,h3,h4,h5,h6".split(",")),f?(m=h.cloneRange(),m.selectNode(f),d.textNodes(m).length||(c=o.create(g,"p"),f.nextSibling&&d.split(m,f.parentNode),o.insertAfter(c,f.parentNode),o.remove(1==f.parentNode.childNodes.length?f.parentNode:f),c.innerHTML=v,r=c)):p&&!u.nextSibling&&(c=o.create(g,"p"),o.insertAfter(c,p),c.innerHTML=v,o.remove(u),r=c),r||(f||p||new s([{tags:["p"]}]).apply([u]),h.selectNode(u),n=o.parentOfType(u,[f?"li":p?o.name(p):"p"]),d.split(h,n,w),i=n.previousSibling,o.is(i,"li")&&i.firstChild&&!o.is(i.firstChild,"br")&&(i=i.firstChild),r=n.nextSibling,o.is(r,"li")&&r.firstChild&&!o.is(r.firstChild,"br")&&(r=r.firstChild),o.remove(n),e(i),e(r),l(i)),l(r),o.is(r,"img"))h.setStartBefore(r);else{h.selectNodeContents(r);var C=d.textNodes(h)[0];C&&h.selectNodeContents(C)}h.collapse(!0),o.scrollTo(r),d.selectRange(h)}}),f=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e=this.getRange();e.deleteContents();var n=o.create(d.documentFromRange(e),"br");if(e.insertNode(n),l(n.parentNode),!t.support.browser.msie&&(!n.nextSibling||o.isWhitespace(n.nextSibling))){var i=n.cloneNode(!0);i.setAttribute("_moz_dirty",""),o.insertAfter(i,n)}e.setStartAfter(n),e.collapse(!0),o.scrollTo(n.nextSibling),d.selectRange(e)
+}});n(i,{ParagraphCommand:u,NewLineCommand:f}),c("insertLineBreak",new a({key:13,shift:!0,command:f})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.Dom,a=o.RangeUtils,s=o.EditorUtils,l=o.Command,d=o.ToolTemplate,c=o.FormatTool,u=o.BlockFormatFinder,f=a.textNodes,p=o.EditorUtils.registerTool,m=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){for(var t,n=[],i=0;e.length>i;i++)(t=this.findFormat(e[i]))&&r.name(t)==this.tag&&n.push(t);if(1>n.length)return!1;if(n.length!=e.length)return!1;for(i=0;n.length>i&&n[i].parentNode==t.parentNode;i++)if(n[i]!=t)return!1;return!0},findSuitable:function(e){var t=r.parentOfType(e[0],this.tags);return t&&r.name(t)==this.tag?t:null}}),h=n.extend({init:function(e,t){var n=this;n.finder=new m(e),n.tag=e,n.unwrapTag=t},wrap:function(e,t){var n,i,o=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],r.is(i,"li"))e.appendChild(i);else if(r.is(i,"ul")||r.is(i,"ol"))for(;i.firstChild;)e.appendChild(i.firstChild);else if(r.is(i,"td")){for(;i.firstChild;)o.appendChild(i.firstChild);e.appendChild(o),i.appendChild(e),e=e.cloneNode(!1),o=o.cloneNode(!1)}else o.appendChild(i),r.isBlock(i)&&(e.appendChild(o),r.unwrap(i),o=o.cloneNode(!1));o.firstChild&&e.appendChild(o)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(r.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&r.isBlock(n))return!1;if(n=e.previousSibling,n&&r.isBlock(n))return!1}return this.containsAny(e,t)||r.isInline(e)||3==e.nodeType},split:function(t){var n,i,o=f(t);if(o.length){n=r.parentOfType(o[0],["li"]),i=r.parentOfType(o[o.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(i);for(var s=0,l=o.length;l>s;s++){var d=this.finder.findFormat(o[s]);if(d){var c=e(d).parents("ul,ol");c[0]?a.split(t,c.last()[0],!0):a.split(t,d,!0)}}}},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&r.isWhitespace(i));)i=i.previousSibling;if(i&&r.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);r.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&r.isWhitespace(n));)n=n.nextSibling;if(n&&r.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);r.remove(t)}},applyOnSection:function(t,n){function i(){s.push(this)}var o,a=this.tag;o=1==n.length?r.parentOfType(n[0],["ul","ol"]):r.commonAncestor.apply(null,n),o||(o=r.parentOfType(n[0],["td"])||n[0].ownerDocument.body),r.isInline(o)&&(o=r.blockParentOrBody(o));var s=[],l=this.finder.findSuitable(n);l||(l=new m("ul"==a?"ol":"ul").findSuitable(n));var d=r.significantChildNodes(o);d.length||(d=n),/table|tbody/.test(r.name(o))&&(d=e.map(n,function(e){return r.parentOfType(e,["td"])}));for(var c=0;d.length>c;c++){var u=d[c],f=r.name(u);!this.suitable(u,n)||l&&r.isAncestorOrSelf(l,u)||(!l||"ul"!=f&&"ol"!=f?s.push(u):(e.each(u.childNodes,i),r.remove(u)))}s.length!=d.length||o==n[0].ownerDocument.body||/table|tbody|tr|td/.test(r.name(o))||(s=[o]),l||(l=r.create(o.ownerDocument,a),r.insertBefore(l,s[0])),this.wrap(l,s),r.is(l,a)||r.changeTag(l,a),this.merge(a,l)},apply:function(e){var t,n,i,o=0,a=[];do i=r.parentOfType(e[o],["td","body"]),t&&i==t?n.push(e[o]):(t&&a.push({section:t,nodes:n}),n=[e[o]],t=i),o++;while(e.length>o);for(a.push({section:t,nodes:n}),o=0;a.length>o;o++)this.applyOnSection(a[o].section,a[o].nodes)},unwrap:function(t){var n,i,o,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(i=t.firstChild;i;i=i.nextSibling){for(o=r.create(t.ownerDocument,l||"p");i.firstChild;)a=i.firstChild,r.isBlock(a)?(o.firstChild&&(s.appendChild(o),o=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):o.appendChild(a);o.firstChild&&s.appendChild(o)}n=e(t).parents("ul,ol"),n[0]?(r.insertAfter(s,n.last()[0]),n.last().remove()):r.insertAfter(s,t),r.remove(t)},remove:function(e){for(var t,n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t=this,n=f(e),i=e.commonAncestorContainer;if(!n.length&&(e.selectNodeContents(i),n=f(e),!n.length)){var o=i.ownerDocument.createTextNode("");e.startContainer.appendChild(o),n=[o],e.selectNode(o.parentNode)}t.finder.isFormatted(n)?(t.split(e),t.remove(n)):t.apply(n)}}),g=l.extend({init:function(e){e.formatter=new h(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,i(e,{finder:new m(e.tag)}))},command:function(e){return new g(i(e,{tag:this.options.tag}))}});i(o,{ListFormatFinder:m,ListFormatter:h,ListCommand:g,ListTool:v}),p("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Remove Link"})})),p("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.Dom,a=o.RangeUtils,s=o.EditorUtils,l=o.Command,d=o.Tool,c=o.ToolTemplate,u=o.InlineFormatter,f=o.InlineFormatFinder,p=a.textNodes,m=o.EditorUtils.registerTool,h=n.extend({findSuitable:function(e){return r.parentOfType(e,["a"])}}),g=n.extend({init:function(){this.finder=new h},apply:function(e,t){var n,i,o,s,l=p(e);t.innerHTML?(n=a.getMarkers(e),i=a.documentFromRange(e),e.deleteContents(),s=r.create(i,"a",t),e.insertNode(s),n.length>1&&(r.insertAfter(n[n.length-1],s),r.insertAfter(n[1],s),r[l.length>0?"insertBefore":"insertAfter"](n[0],s))):(o=new u([{tags:["a"]}],t),o.finder=this.finder,o.apply(l))}}),v=l.extend({init:function(e){e.formatter={toggle:function(e){new u([{tags:["a"]}]).remove(p(e))}},this.options=e,l.fn.init.call(this,e)}}),y=l.extend({init:function(e){var t=this;t.options=e,l.fn.init.call(t,e),t.attributes=null,t.async=!0,t.formatter=new g},exec:function(){function n(t){var n,o,r,a=e("#k-editor-link-url",g.element).val();a&&"http://"!=a&&(l.attributes={href:a},n=e("#k-editor-link-title",g.element).val(),n&&(l.attributes.title=n),o=e("#k-editor-link-text",g.element).val(),o!==u&&(l.attributes.innerHTML=o||a),r=e("#k-editor-link-target",g.element).is(":checked"),r&&(l.attributes.target="_blank"),l.formatter.apply(d,l.attributes)),i(t),l.change&&l.change()}function i(e){e.preventDefault(),g.destroy(),r.windowFromDocument(a.documentFromRange(d)).focus(),l.releaseRange(d)}var o,l=this,d=l.getRange(),c=d.collapsed,u=null;d=l.lockRange(!0),o=p(d);var f=o.length?l.formatter.finder.findSuitable(o[0]):null,m=1>=o.length||2==o.length&&c,h="<div class='k-editor-dialog'><ol><li class='k-form-text-row'><label for='k-editor-link-url'>Web address</label><input type='text' class='k-input' id='k-editor-link-url'></li>"+(m?"<li class='k-form-text-row'><label for='k-editor-link-text'>Text</label><input type='text' class='k-input' id='k-editor-link-text'></li>":"")+"<li class='k-form-text-row'><label for='k-editor-link-title'>Tooltip</label><input type='text' class='k-input' id='k-editor-link-title'></li>"+"<li class='k-form-checkbox-row'><input type='checkbox' id='k-editor-link-target'><label for='k-editor-link-target'>Open link in new window</label></li>"+"</ol>"+"<div class='k-button-wrapper'>"+"<button class='k-dialog-insert k-button'>Insert</button>"+" or "+"<a href='#' class='k-dialog-close k-link'>Close</a>"+"</div>"+"</div>",g=s.createDialog(h,l.editor,e.extend({},l.editor.options.dialogOptions,{title:"Insert link",close:i})).hide().find(".k-dialog-insert").click(n).end().find(".k-dialog-close").click(i).end().find(".k-form-text-row input").keydown(function(e){var o=t.keys;e.keyCode==o.ENTER?n(e):e.keyCode==o.ESC&&i(e)}).end().find("#k-editor-link-url").val(f?f.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(o.length>0?1==o.length?o[0].nodeValue:o[0].nodeValue+o[1].nodeValue:"").end().find("#k-editor-link-title").val(f?f.title:"").end().find("#k-editor-link-target").attr("checked",f?"_blank"==f.target:!1).end().show().data("kendoWindow").center();m&&o.length>0&&(u=e("#k-editor-link-text",g.element).val()),e("#k-editor-link-url",g.element).focus().select()},redo:function(){var e=this,t=e.lockRange(!0);e.formatter.apply(t,e.attributes),e.releaseRange(t)}}),b=d.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),d.fn.init.call(this,e.extend(t,{command:v}))},initialize:function(e){e.attr("unselectable","on").addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});i(t.ui.editor,{LinkFormatFinder:h,LinkFormatter:g,UnlinkCommand:v,LinkCommand:y,UnlinkTool:b}),m("createLink",new d({key:"K",ctrl:!0,command:y,template:new c({template:s.buttonTemplate,title:"Create Link"})})),m("unlink",new b({key:"K",ctrl:!0,shift:!0,template:new c({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,o=n.ui.editor,r=o.EditorUtils,a=o.Dom,s=r.registerTool,l=o.ToolTemplate,d=o.RangeUtils,c=o.Command,u=n.keys,f="Insert Image",p="#k-editor-image-url",m="#k-editor-image-title",h=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n=this.attributes;if(n.src&&"http://"!=n.src){if(!e)return e=a.create(d.documentFromRange(t),"img",n),e.onload=e.onerror=function(){e.removeAttribute("complete"),e.removeAttribute("width"),e.removeAttribute("height")},t.deleteContents(),t.insertNode(e),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog"># if (showBrowser) { #<div class="k-imagebrowser"></div># } #<ol><li class="k-form-text-row"><label for="k-editor-image-url">#: messages.imageWebAddress #</label><input type="text" class="k-input" id="k-editor-image-url"></li><li class="k-form-text-row"><label for="k-editor-image-title">#: messages.imageAltText #</label><input type="text" class="k-input" id="k-editor-image-title"></li></ol><div class="k-button-wrapper"><button class="k-dialog-insert k-button">#: messages.dialogInsert #</button> #: messages.dialogButtonSeparator # <a href="\\#" class="k-dialog-close k-link">#: messages.dialogCancel #</a></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(d.image(t),t)||e.releaseRange(t)},exec:function(){function o(t){g.attributes={src:e(p,c.element).val(),alt:e(m,c.element).val()},y=g.insertImage(b,v),s(t),g.change&&g.change()}function s(e){e.preventDefault(),c.destroy(),a.windowFromDocument(d.documentFromRange(v)).focus(),y||g.releaseRange(v)}function l(e){e.keyCode==u.ENTER?o(e):e.keyCode==u.ESC&&s(e)}var c,h,g=this,v=g.lockRange(),y=!1,b=d.image(v),k=g.editor.options,w=k.imageBrowser,C=!!(n.ui.ImageBrowser&&w&&w.transport&&w.transport.read!==t);h=C?{width:"960px"}:{},c=r.createDialog(g._dialogTemplate(C),g.editor,i(h,k.dialogOptions,{title:f,close:s,resizable:C,activate:function(){if(C){var e=this;new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"),i({},w,{change:function(){e.element.find(p).val(this.value())},apply:o}))}}})).hide().find(".k-dialog-insert").click(o).end().find(".k-dialog-close").click(s).end().find(".k-form-text-row input").keydown(l).end().find(p).val(b?b.getAttribute("src",2):"http://").end().find(m).val(b?b.alt:"").end().show().data("kendoWindow").center(),e(p,c.element).focus().select()}});n.ui.editor.ImageCommand=h,s("insertImage",new o.Tool({command:h,template:new l({template:r.buttonTemplate,title:f})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.Widget,o=n.ui.DropDownList,r=n.ui.editor,a=r.Dom,s="change",l="k-state-selected",d="."+l,c=".k-selected-color",u="unselectable",f="background-color",p="aria-selected",m="aria-labelledby",h=n.keys,g=n.template('<div class="k-colorpicker-popup"><ul class="k-reset"># for(var i = 0; i < colors.length; i++) { #<li #=(id && i === 0) ? "id=\\""+id+"\\" aria-selected=\\"true\\"" : "" # class="k-item #= colors[i] == value ? "k-state-selected" : "" #" aria-label="\\##= colors[i]#"><div style="background-color:\\##= colors[i] #"></div></li># } #</ul></div>'),v=i.extend({init:function(t,n){var o,r=this;i.fn.init.call(r,t,n),t=r.element,n=r.options,r._value=n.value,r._ariaId=o=n.ariaId,o&&t.attr(m,o),r.popup=e(g({colors:n.colors,value:n.value.substring(1),id:o})).kendoPopup({anchor:t,toggleTarget:t.find(".k-icon")}).delegate(".k-item","click",function(t){r.select(e(t.currentTarget).find("div").css(f))}).find("*").attr(u,"on").end().data("kendoPopup"),t.attr("tabIndex",0).keydown(function(e){r.keydown(e)}).focus(function(){t.css("outline","1px dotted #000")}).blur(function(){t.css("outline","")}).delegate(".k-tool-icon","click",function(){r.select()}).find("*").attr(u,"on"),r._value&&t.find(c).css(f,r._value)},options:{name:"ColorPicker",colors:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7".split(","),value:null},events:[s],select:function(e){var t=this;e?(e=a.toHex(e),t.trigger(s,{value:e})||(t.value(e),t.close())):t.trigger(s,{value:t._value})},open:function(){this.popup.open()},close:function(){this.popup.close()},toggle:function(){this.popup.toggle()},_applyAriaAttributes:function(e,t){var n=this;n.element.removeAttr(m),n.element.attr(m,n._ariaId),e.removeAttr("id"),e.attr(p,!1),t.attr({id:n._ariaId,"aria-selected":!0})},keydown:function(e){var t,n,i,o=this,r=o.popup.element,a=o.popup.visible(),s=!1,c=e.keyCode;c==h.DOWN?(a?(t=r.find(d),n=t[0]?t.next():r.find("li:first"),n[0]&&(t.removeClass(l),n.addClass(l),o._applyAriaAttributes(t,n))):o.open(),s=!0):c==h.UP?(a&&(t=r.find(d),i=t.prev(),i[0]&&(t.removeClass(l),i.addClass(l),o._applyAriaAttributes(t,i))),s=!0):c==h.TAB||c==h.RIGHT||c==h.LEFT?o.close():c==h.ENTER&&(r.find(d).click(),s=!0),s&&e.preventDefault()},value:function(e){var n=this;return e===t?n._value:(e=a.toHex(e),n._value=e,n.element.find(c).css(f,e),t)}}),y=o.extend({init:function(e,t){var n=this;o.fn.init.call(n,e,t),n.value(n.options.title)},options:{name:"SelectBox"},value:function(e){var n=this,i=o.fn.value.call(n,e);return e===t?i:(e!==o.fn.value.call(n)&&(n.text(n.options.title),n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)}});n.ui.editor.ColorPicker=v,n.ui.editor.SelectBox=y}(window.kendo.jQuery),function(e,t){function n(n,i){var o="rtl"==e(n).css("direction"),r=o?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return i===t?n.style[a]||0:(i>0?n.style[a]=i+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,o=i.Class,r=e.extend,a=i.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,f=a.ToolTemplate,p=a.RangeUtils,m=s.blockElements,h=a.BlockFormatFinder,g=a.BlockFormatter,v=o.extend({init:function(){this.finder=new h([{tags:s.blockElements}])},apply:function(t){var i,o,r,a,l,d=this.finder.findSuitable(t),c=[];if(d.length){for(i=0,o=d.length;o>i;i++)s.is(d[i],"li")?e(d[i]).index()?0>e.inArray(d[i].parentNode,c)&&c.push(d[i]):c.push(d[i].parentNode):c.push(d[i]);for(;c.length;)if(r=c.shift(),s.is(r,"li")){a=r.parentNode,l=e(r).prev("li");var u=l.find("ul,ol").last(),f=e(r).children("ul,ol")[0];if(f&&l[0])u[0]?(u.append(r),u.append(e(f).children()),s.remove(f)):(l.append(f),f.insertBefore(r,f.firstChild));else for(f=l.children("ul,ol")[0],f||(f=s.create(r.ownerDocument,s.name(a)),l.append(f));r&&r.parentNode==a;)f.appendChild(r),r=c.shift()}else{var p=parseInt(n(r),10)+30;n(r,p);for(var m=0;c.length>m;m++)e.contains(r,c[m])&&c.splice(m,1)}}else{var h=new g([{tags:"p"}],{style:{marginLeft:30}});h.apply(t)}},remove:function(t){var i,o,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(o=0,r=u.length;r>o;o++){if(d=e(u[o]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(i&&e.contains(i,s[0]))continue;l=d.nextAll("li"),l.length&&e(a[0].cloneNode(!1)).appendTo(d).append(l),s.is("li")?d.insertAfter(s):d.appendTo(s),a.children("li").length||a.remove();continue}if(i==a[0])continue;i=a[0]}else i=u[o];c=parseInt(n(i),10)-30,n(i,c)}}}),y=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(p.nodes(e))}},c.fn.init.call(this,e)}}),b=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(p.nodes(e))}},c.fn.init.call(this,e)}}),k=u.extend({init:function(e){u.fn.init.call(this,r(e,{command:b})),this.finder=new h([{tags:m}])},initialize:function(e){e.attr("unselectable","on").addClass("k-state-disabled")},update:function(i,o){var r,a,l,d,c=this.finder.findSuitable(o);for(l=0,d=c.length;d>l;l++)if(r=n(c[l]),r||(a=e(c[l]).parents("ul,ol").length,r=s.is(c[l],"li")&&(a>1||n(c[l].parentNode))||s.ofType(c[l],["ul","ol"])&&a>0),r)return i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});r(a,{IndentFormatter:v,IndentCommand:y,OutdentCommand:b,OutdentTool:k}),d("indent",new u({command:y,template:new f({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new k({template:new f({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.Dom,r=i.RangeUtils,a=i.EditorUtils,s=i.Command,l=i.Tool,d=i.ToolTemplate,c=s.extend({init:function(e){var t=this;t.options=e,s.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function t(e){s.value(d.find(f).val()),i(e),a.change&&a.change(),s.trigger("change")}function i(e){e.preventDefault(),d.data("kendoWindow").destroy(),o.windowFromDocument(r.documentFromRange(l)).focus()}var a=this,s=a.editor,l=s.getRange(),d=e(c.template).appendTo(document.body),u=c.indent(s.value()),f=".k-editor-textarea";d.kendoWindow(n({},s.options.dialogOptions,{title:"View HTML",close:i})).hide().find(f).val(u).end().find(".k-dialog-update").click(t).end().find(".k-dialog-close").click(i).end().show().data("kendoWindow").center(),d.find(f).focus()}});n(c,{template:"<div class='k-editor-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-button-wrapper'><button class='k-dialog-update k-button'>Update</button> or <a href='#' class='k-dialog-close k-link'>Close</a></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=c,i.EditorUtils.registerTool("viewHtml",new l({command:c,template:new d({template:a.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.RangeUtils,a=o.Marker,s=n.extend({init:function(e){this.editor=e,this.formats=[]},apply:function(e){if(this.hasPending()){var t=new a;t.addCaret(e);var n=e.startContainer.childNodes[e.startOffset],o=n.previousSibling;if(o.nodeValue||(o=o.previousSibling),e.setStart(o,o.nodeValue.length-1),t.add(e),!r.textNodes(e).length)return t.remove(e),e.collapse(!0),this.editor.selectRange(e),void 0;for(var s,l=t.end.previousSibling.previousSibling,d=this.formats,c=0;d.length>c;c++){s=d[c];var u=s.command(i({range:e},s.options.params));u.editor=this.editor,u.exec(),e.selectNode(l)}t.remove(e),l.parentNode&&(e.setStart(l,1),e.collapse(!0)),this.clear(),this.editor.selectRange(e)}},hasPending:function(){return this.formats.length>0},isPending:function(e){return!!this.getPending(e)},getPending:function(e){for(var t=this.formats,n=0;t.length>n;n++)if(t[n].name==e)return t[n]},toggle:function(e){for(var t=this.formats,n=0;t.length>n;n++)if(t[n].name==e.name)return t[n].params&&t[n].params.value!=e.params.value?t[n].params.value=e.params.value:t.splice(n,1),void 0;t.push(e)},clear:function(){this.formats=[]}});i(o,{PendingFormats:s})}(window.kendo.jQuery);
\ No newline at end of file