/* * Kendo UI Web v2013.1.319 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * 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"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.combobox.min","./kendo.dropdownlist.min","./kendo.window.min","./kendo.colorpicker.min"],function(){(function(e,t){var n,o,i=window.kendo,r=i.Class,a=i.ui.Widget,s=i.support.mobileOS,l=i.support.browser,d=e.extend,c=i.deepExtend,u=".kendoEditor",f=i.keys,p=r.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return i.template(e.template)({cssClass:e.cssClass,tooltip:e.title,initialValue:e.initialValue})}}),m={select:function(e){e.trigger("select",{})},editorWrapperTemplate:'',buttonTemplate:'',colorPickerTemplate:'',comboBoxTemplate:'
  • ',dropDownListTemplate:'
  • ',separatorTemplate:'
  • ',focusable:".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",wrapTextarea:function(t){var n=t[0].style.width,o=t[0].style.height,i=m.editorWrapperTemplate,r=e(i).insertBefore(t).width(n).height(o),a=r.find(".k-editable-area");return t.appendTo(a).addClass("k-content k-raw-content").hide(),t.closest(".k-editor")},renderTools:function(t,n){var o,r,a,s,l,c={},u=t._nativeTools,f=e(t.element).closest(".k-editor").find(".k-editor-toolbar");if(n)for(a=0;n.length>a;a++)o=n[a],l=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],l=c[o.name].options):(l=d({cssClass:"k-i-custom",type:"button",tooltip:""},o),l.name&&(l.cssClass="k-"+("custom"==l.name?"i-custom":l.name)),l.template||"button"==l.type&&(l.template=m.buttonTemplate)):t.tools[o]&&(c[o]=t.tools[o],l=c[o].options),l&&(s=l.template,s&&(s.getHtml?s=s.getHtml():(e.isFunction(s)||(s=i.template(s)),s=s(l)),0!==s.indexOf(""+s+""),r=e(s).appendTo(f),"button"==l.type&&l.exec&&r.find(".k-tool-icon").click(e.proxy(l.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 n,o=t.data.closest(".k-editor").find(".k-style").data("kendoSelectBox");o&&(n=o.dataSource.view(),o.list.find(".k-item").each(function(o,r){var a=e(r),s=a.text(),l=i.ui.editor.Dom.inlineStyle(t.data.data("kendoEditor").document,"span",{className:n[o].value});a.html(''+s+"")}))},createContentElement:function(t,n){var o,r,a,s=i.support.isRtl(t)?"direction:rtl;":"";return t.hide(),o=e("")}},font:{start:function(e){var t,n,o;f.push('')},end:function(){f.push("")}}};return r(n),f=f.join(""),""===f.replace(l,"").replace(d,"")?"":f}};r(o,{Serializer:u})}(window.kendo.jQuery),function(e){function t(e,t,n,o){var i,r,a,s;if(e==t)return o-n;for(i=t;i&&i.parentNode!=e;)i=i.parentNode;if(i)return f(i)-n;for(i=e;i&&i.parentNode!=t;)i=i.parentNode;if(i)return o-f(i)-1;for(r=u.commonAncestor(e,t),a=e;a&&a.parentNode!=r;)a=a.parentNode;for(a||(a=r),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 o(e){try{return 0>t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)}catch(n){return!0}}o(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 o(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 i(e,t,n){var o,i,r=t[n?"startContainer":"endContainer"],a=t[n?"startOffset":"endOffset"],s=0,l=p(r)?r:r.childNodes[a]||null,d=p(r)?r.parentNode:r;(3==r.nodeType||4==r.nodeType)&&(s=a),o=d.insertBefore(u.create(t.ownerDocument,"a"),l),i=t.ownerDocument.body.createTextRange(),i.moveToElementText(o),u.remove(o),i[n?"moveStart":"moveEnd"]("character",s),i.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",i)}function r(e,t,n){var o,i,r=u.create(t.ownerDocument,"a"),a=e.duplicate();a.collapse(n),o=a.parentElement();do o.insertBefore(r,r.previousSibling),a.moveToElementText(r);while(a.compareEndPoints(n?"StartToStart":"StartToEnd",e)>0&&r.previousSibling);return a.setEndPoint(n?"EndToStart":"EndToEnd",e),(i=r.nextSibling)?(u.remove(r),p(i)?t[n?"setStart":"setEnd"](i,a.text.length):t[n?"setStartBefore":"setEndBefore"](i),void 0):(i=r.previousSibling,i&&p(i)?(t.setEnd(i,i.nodeValue.length),u.remove(r)):(t.selectNodeContents(o),u.remove(r),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"getSelection"in e?e.getSelection():new k(e.document)},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,o(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,o(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 o,i=e.createDocumentFragment();o=n.next();)o=o.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&o.appendChild(t(n.getSubtreeIterator())),i.appendChild(o);return i}(new b(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(m(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=N.documentFromRange(t),function o(n){for(var i,r=e.createDocumentFragment();i=n.next();)n.hasPartialSubtree()?(i=i.cloneNode(!1),i.appendChild(o(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(i);return r}(new b(n))},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 o._current=o._next,o._next=o._current&&o._current.nextSibling!=o._end?o._current.nextSibling:null,o._current}for(var n,o=this;n=t();)o.hasPartialSubtree()?o.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,o,i,r,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;p(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,o=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=o),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=o)),a._current.deleteData(t,o)):(i=a._current.parentNode,!e||a.range.startContainer!=i&&a.range.endContainer!=i||(r=f(a._current),i==e.startContainer&&e.startOffset>=r&&(e.startOffset-=1),i==e.endContainer&&e.endOffset>r&&(e.endOffset-=1)),u.remove(a._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();i(t,e,!1),i(t,e,!0),t.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var e,t,n,o,i,a,s,l=new y(this.ownerDocument),d=this.ownerDocument.selection;try{if(e=d.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return l}catch(c){return l}if("Control"==d.type)l.selectNode(e.item(0));else if(r(e,l,!0),r(e,l,!1),9==l.startContainer.nodeType&&l.setStart(l.endContainer,l.startOffset),9==l.endContainer.nodeType&&l.setEnd(l.startContainer,l.endOffset),0===e.compareEndPoints("StartToEnd",e)&&l.collapse(!1),n=l.startContainer,o=l.endContainer,i=this.ownerDocument.body,!(l.collapsed||0!==l.startOffset||l.endOffset!=h(l.endContainer)||n==o&&p(n)&&n.parentNode==i)){for(a=!1,s=!1;0===f(n)&&n==n.parentNode.firstChild&&n!=i;)n=n.parentNode,a=!0;for(;f(o)==h(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=i;)o=o.parentNode,s=!0;n==i&&o==i&&a&&s&&(l.setStart(n,0),l.setEnd(o,h(i)))}return l}}),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,n=0,o=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||o!=t)&&n++,o=t;return n},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,o){for(var i=this.rootNode,r=n.length,a=o;r--;)i=i.childNodes[n[r]];for(;3==i.nodeType&&a>i.nodeValue.length;)a-=i.nodeValue.length,i=i.nextSibling;e[t?"setStart":"setEnd"](i,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,n,o,i,r=this,a=r.caret.previousSibling,s=0;a&&(s=p(a)?a.nodeValue.length:f(a)),t=r.caret.parentNode,n=a?f(a):0,u.remove(r.caret),g(t),o=t.childNodes[n],p(o)?e.setStart(o,s):o?(i=u.lastTextNode(o),i?e.setStart(i,i.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](o)):(c.msie||t.innerHTML||(t.innerHTML='
    '),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,o=this;return t&&e.collapsed&&(o.addCaret(e),e=N.expand(e)),n=e.cloneRange(),n.collapse(!1),o.end=u.create(N.documentFromRange(e),"span",{className:"k-marker"}),n.insertNode(o.end),n=e.cloneRange(),n.collapse(!0),o.start=o.end.cloneNode(!0),n.insertNode(o.start),e.setStartBefore(o.start),e.setEndAfter(o.end),g(e.commonAncestorContainer),e},remove:function(e){var t,n,o,i,r,a,s,l,d,c,m,h,v,y=this,b=y.start,k=y.end;for(g(e.commonAncestorContainer);!b.nextSibling&&b.parentNode;)b=b.parentNode;for(;!k.previousSibling&&k.parentNode;)k=k.parentNode;if(t=b.previousSibling&&3==b.previousSibling.nodeType&&b.nextSibling&&3==b.nextSibling.nodeType,n=k.previousSibling&&3==k.previousSibling.nodeType&&k.nextSibling&&3==k.nextSibling.nodeType,o=t&&n,b=b.nextSibling,k=k.previousSibling,i=!1,r=!1,b==y.end&&(r=!!y.start.previousSibling,b=k=y.start.previousSibling||y.end.nextSibling,i=!0),u.remove(y.start),u.remove(y.end),!b||!k)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;if(a=i?p(b)?b.nodeValue.length:b.childNodes.length:0,s=p(k)?k.nodeValue.length:k.childNodes.length,3==b.nodeType)for(;b.previousSibling&&3==b.previousSibling.nodeType;)b=b.previousSibling,a+=b.nodeValue.length;if(3==k.nodeType)for(;k.previousSibling&&3==k.previousSibling.nodeType;)k=k.previousSibling,s+=k.nodeValue.length;for(l=f(b),d=b.parentNode,c=f(k),m=k.parentNode,h=b;h.previousSibling;h=h.previousSibling)3==h.nodeType&&3==h.previousSibling.nodeType&&l--;for(v=k;v.previousSibling;v=v.previousSibling)3==v.nodeType&&3==v.previousSibling.nodeType&&c--;g(d),3==b.nodeType&&(b=d.childNodes[l]),g(m),3==k.nodeType&&(k=m.childNodes[c]),i?(3==b.nodeType?e.setStart(b,a):e[r?"setStartAfter":"setStartBefore"](b),e.collapse(!0)):(3==b.nodeType?e.setStart(b,a):e.setStartBefore(b),3==k.nodeType?e.setEnd(k,s):e.setEndAfter(k)),y.caret&&y.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=N.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=v.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},split:function(e,t,n){function o(o){var i,r=e.cloneRange();r.collapse(o),r[o?"setStartBefore":"setEndAfter"](t),i=r.extractContents(),n&&(i=u.trim(i)),u[o?"insertBefore":"insertAfter"](i,t)}o(!0),o(!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,n,o,i,r=e.cloneRange(),a=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],s=r.endContainer.childNodes[r.endOffset];return p(a)&&p(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(o=t.split("").reverse().join("").search(T),i=n.search(T),o&&i?(i=-1==i?n.length:i,o=-1==o?0:t.length-o,r.setStart(a,o),r.setEnd(s,i),r):r):r):r},isExpandable:function(e){var t,n,o,i,r,a,s=e.startContainer,l=N.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(o=n.substring(0,t.startOffset),i=n.substring(t.startOffset),r=0,a=0,o&&(r=o.split("").reverse().join("").search(T)),i&&(a=i.search(T)),r&&a):!1)}};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,o=t.ui.editor,i=o.EditorUtils,r=i.registerTool,a=o.Dom,s=o.RangeUtils,l=s.selectRange,d=o.Tool,c=o.ToolTemplate,u=o.RestorePoint,f=o.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,i=this.options,r=i.items?i.items:n.options.insertHtml;new o.SelectBox(e,{dataSource:r,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,o=this,i=o.editor,r=i.keyboard,a=r.isTypingKey(t),s=p(e.Event(),t);return o.editor.trigger("keydown",s),s.isDefaultPrevented()&&t.preventDefault(),s.isDefaultPrevented()||!a||r.isTypingInProgress()?!1:(n=i.getRange(),o.startRestorePoint=new u(n),r.startTyping(function(){i.selectionRestorePoint=o.endRestorePoint=new u(i.getRange()),i.undoRedoStack.push(new h(o.startRestorePoint,o.endRestorePoint))}),!0)},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,o=n.keyboard;return o.isModifierKey(e)?(o.isTypingInProgress()&&o.endTyping(!0),t.startRestorePoint=new u(n.getRange()),!0):o.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 o,i,r=String.fromCharCode(n.keyCode);for(o in t)if(i=e.extend({ctrl:!1,alt:!1,shift:!1},t[o].options),(i.key==r||i.key==n.keyCode)&&i.ctrl==n.ctrlKey&&i.alt==n.altKey&&i.shift==n.shiftKey)return o},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,o=this.handlers;for(n=0;o.length>n&&!o[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,new T]},htmlToFragment:function(e){var t=this.editor,n=t.document,o=a.create(n,"div"),i=n.createDocumentFragment();for(o.innerHTML=e;o.firstChild;)i.appendChild(o.firstChild);return i},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,i,r,s=this.editor,d=s.getRange(),c="",f=new u(d),p=a.create(s.document,"div",{className:"k-paste-container",innerHTML:c});a.persistScrollTop(s.document),s.body.appendChild(p),s.body.createTextRange?(t.preventDefault(),n=s.createRange(),n.selectNodeContents(p),s.selectRange(n),i=s.body.createTextRange(),i.moveToElementText(p),e(s.body).unbind("paste"),i.execCommand("Paste"),e(s.body).bind("paste",e.proxy(arguments.callee,this))):(r=s.createRange(),r.selectNodeContents(p),l(r)),d.deleteContents(),setTimeout(function(){var e,t={html:""};l(d),p.parentNode||(p=s.body.lastChild),a.remove(p),p.lastChild&&a.is(p.lastChild,"br")&&a.remove(p.lastChild),e=p.innerHTML,e!=c&&(t.html=e),s.trigger("paste",t),s.clipboard.paste(t.html,!0),s.undoRedoStack.push(new h(f,new u(s.getRange()))),o.EditorUtils.select(s)})},splittableParent:function(e,t){var n,o;if(e)return a.parentOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,o=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=o&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(e,t){var n,o,i,r,d,c,u,p,m,h,g=this.editor;for(n=0,o=this.cleaners.length;o>n;n++)this.cleaners[n].applicable(e)&&(e=this.cleaners[n].clean(e));if(t&&(e=e.replace(/(
    (\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),e=e.replace(/<(a|span)[^>]*><\/\1>/gi,"")),e=e.replace(/^
  • $/g,"li>"),i=this.isBlock(e),r=g.getRange(),r.deleteContents(),r.startContainer==g.document&&r.selectNodeContents(g.body),d=new f,c=d.addCaret(r),u=this.splittableParent(i,c),p=!1,/body|td/.test(a.name(u))||!i&&!a.isInline(u)||(r.selectNode(c),s.split(r,u,!0),p=!0),m=this.htmlToFragment(e),m.firstChild&&"k-paste-container"===m.firstChild.className){for(h=[],n=0,o=m.childNodes.length;o>n;n++)h.push(m.childNodes[n].innerHTML);m=this.htmlToFragment(h.join("
    "))}if(r.insertNode(m),u=this.splittableParent(i,c),p){for(;c.parentNode!=u;)a.unwrap(c.parentNode);a.unwrap(c.parentNode)}a.normalize(r.commonAncestorContainer),c.style.display="inline",a.restoreScrollTop(g.document),a.scrollTo(c),d.removeCaret(r),l(r)}}),x=n.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",//g,"",/"/g,"'",/(?:
     [\s\r\n]+|
    )*(<\/?(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)[^>]*>)(?:
     [\s\r\n]+|
    )*/g,"$1",/

    /g,"

    ",/
    /g," ",/]*)>(\s| )+]*>(\s| )*<\/tr>/gi,"",/]*>(\s| )*<\/tbody>/gi,"",/]*>(\s| )*<\/table>/gi,"",/

    /g,"
    ",/^\s*( )+/gi,"",/( |]*>)+\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){var n,o,i,r,s,l,d,c,u=a.create(document,"div",{innerHTML:t}),f=e(a.blockElements.join(","),u),p=-1,m={ul:{},ol:{}},h=u;for(o=0;f.length>o;o++)if(i=f[o],t=i.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),r=this.listType(t),r&&"p"==a.name(i)){if(s=parseFloat(i.style.marginLeft||0),l=m[r][s],(s>p||!l)&&(l=a.create(document,r),h==u?a.insertBefore(l,i):h.appendChild(l),m[r][s]=l),n!=r)for(d in m)for(c in m[d])e.contains(l,m[d][c])&&delete m[d][c];a.remove(i.firstChild),h=a.create(document,"li",{innerHTML:i.innerHTML}),l.appendChild(h),a.remove(i),p=s,n=r}else i.innerHTML?(m={ul:{},ol:{}},h=u,p=-1):a.remove(i);return u.innerHTML},stripEmptyAnchors:function(e){return e.replace(/]*)>\s*<\/a>/gi,function(e,t){return!t||0>t.indexOf("href")?"":e})},clean:function(e){var t,n,o=this,i=o.replacements;for(t=0,n=i.length;n>t;t+=2)e=e.replace(i[t],i[t+1]);return e=o.stripEmptyAnchors(e),e=o.lists(e),e=e.replace(/\s+class="?[^"\s>]*"?/gi,"")}}),T=n.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^
    (.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)},clean:function(e){var t,n,o=this,i=o.replacements;for(t=0,n=i.length;n>t;t+=2)e=e.replace(i[t],i[t+1]);return e}});p(o,{Command:m,GenericCommand:h,InsertHtmlCommand:g,InsertHtmlTool:v,UndoRedoStack:y,TypingHandler:b,SystemHandler:k,Keyboard:w,Clipboard:C,MSWordFormatCleaner:x,WebkitFormatCleaner:T}),r("insertHtml",new v({template:new c({template:i.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,o=n.Class,i=n.ui.editor,r=n.ui.Editor.fn.options.formats,a=i.EditorUtils,s=i.Tool,l=i.ToolTemplate,d=i.FormatTool,c=i.Dom,u=i.RangeUtils,f=e.extend,p=i.EditorUtils.registerTool,m=i.EditorUtils.registerFormat,h="k-marker",g=o.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,o=0,i=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==h?i++:3==t.nodeType?n++:o++);return i>1&&r.firstChild.className==h&&r.lastChild.className==h?0:o+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,o,i,r,a=this.format,s=c.attrEquals;for(t=0,n=a.length;n>t;t++){if(o=e,i=a[t].tags,r=a[t].attr,o&&c.ofType(o,i)&&s(o,r))return o;for(;o;)if(o=c.parentOfType(o,i),o&&s(o,r))return o}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=o.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,o,i,r=this,a=[];for(t=0,n=e.length;n>t;t++)o=e[t],i=r.finder.findSuitable(o),i?c.attr(i,r.attributes):i=r.wrap(o),a.push(i);r.consolidate(a)},remove:function(e){var t,n,o,i=this;for(t=0,n=e.length;n>t;t++)o=i.finder.findFormat(e[t]),o&&(i.attributes&&i.attributes.style?(c.unstyle(o,i.attributes.style),o.style.cssText||c.unwrap(o)):c.unwrap(o))},split:function(e){var t,n,o=u.textNodes(e),i=o.length;if(i>0)for(t=0;i>t;t++)n=this.finder.findFormat(o[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,o,i,r,a,s,l,d,u,f,p,m,h=t.attributes,g=e.trim;if(h)for(n=0,o=h.length;o>n;n++)if(i=h[n],r=i.nodeName,a=i.nodeValue,i.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,o,i,r=e(c.isDataNode(t)?t.parentNode:t),a=r.parents().andSelf();for(n=0,o=a.length;o>n;n++)if(i="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return i;return"inherit"},getFormat:function(e){var t,n,o=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(o!=this.getFormatInner(e[t]))return"";return o},isFormatted:function(e){return""!==this.getFormat(e)}}),b=v.extend({init:function(e,t,n){var o=this;v.fn.init.call(o,e,t),o.greedyProperty=n,o.values=t,o.finder=new y(e,n)},activate:function(e,t){var n,o=this,i=o.greedyProperty,r="apply";o.split(e),i&&(n=i.replace(/-([a-z])/,function(e,t){return t.toUpperCase()}),"inherit"==o.values.style[n]&&(r="remove")),o[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({willDelayExecution:t,update:function(e,t,n){var o,i=e.data(this.type),r=n.getPending(this.name);o=r&&r.options.params?r.options.params.value:this.finder.getFormat(t),i.close(),i.value(o)}}),C=w.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,o={};return new i.FormatCommand(f(e,{formatter:function(){return o[t.domAttr]=e.value,new b(n,{style:o},t.cssAttr)}}))},initialize:function(e,t){var n,o=t.editor,i=this.options,r=i.name,a=[];i.defaultValue&&(a=[{text:o.options.messages[i.defaultValue[0].text],value:i.defaultValue[0].value}]),n=a.concat(i.items?i.items:o.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){s.exec(o,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").andSelf().attr("unselectable","on"),e.data(this.type).value("inherit")}}),x=s.extend({init:function(e){s.fn.init.call(this,e),this.options=e,this.format=[{tags:["span"]}]},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(f(e,{formatter:function(){return o[t.domAttr]=e.value,new b(n,{style:o},t.cssAttr)}}))},willDelayExecution:t,initialize:function(e,t){var o=t.editor,i=this.name;e=this._widget=new n.ui.ColorPicker(e,{value:"#000",toolIcon:"k-"+this.options.name,palette:"websafe",change:function(){var t=e.value();t&&s.exec(o,i,t)}}),e.bind("activate",function(t){t.preventDefault(),e.trigger("change"),o.focus()}),e.element.attr("title",t.title)}}),T=w.extend({init:function(e){var t=this;s.fn.init.call(t,e),t.type="kendoSelectBox",t.format=[{tags:["span"]}],t.finder=new y(t.format,"className")},command:function(e){var t=this.format;return new i.FormatCommand(f(e,{formatter:function(){return new b(t,{className:e.value})}}))},initialize:function(e,t){var n=t.editor,o=this.options;new i.SelectBox(e,{dataTextField:"text",dataValueField:"value",dataSource:o.items||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(i,{InlineFormatFinder:g,InlineFormatter:v,GreedyInlineFormatFinder:y,GreedyInlineFormatter:b,InlineFormatTool:k,FontTool:C,ColorTool:x,StyleTool:T}),p("style",new i.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 x({cssAttr:"color",domAttr:"color",name:"foreColor",template:new l({template:a.colorPickerTemplate,title:"Color"})})),p("backColor",new x({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new l({template:a.colorPickerTemplate,title:"Background Color"})})),p("fontName",new C({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new l({template:a.comboBoxTemplate,title:"Font Name"})})),p("fontSize",new C({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,o=e.extend,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,a=i.Dom,s=i.Command,l=i.Tool,d=i.ToolTemplate,c=i.FormatTool,u=i.EditorUtils,f=u.registerTool,p=u.registerFormat,m=i.RangeUtils,h=n.extend({init:function(e){this.format=e},contains:function(e,t){var n,o,i;for(n=0,o=t.length;o>n;n++)if(i=t[n],!i||!a.isAncestorOrSelf(e,i))return!1;return!0},findSuitable:function(t){var n,o,i,r=this.format,s=[];for(n=0,o=t.length;o>n;n++){if(i=a.ofType(t[n],r[0].tags)?t[n]:a.parentOfType(t[n],r[0].tags),!i)return[];0>e.inArray(i,s)&&s.push(i)}for(n=0,o=s.length;o>n;n++)if(this.contains(s[n],s))return[s[n]];return s},findFormat:function(e){var t,n,o,i,r,s=this.format;for(t=0,n=s.length;n>t;t++)for(o=e,i=s[t].tags,r=s[t].attr;o;){if(a.ofType(o,i)&&a.attrEquals(o,r))return o;o=o.parentNode}return null},getFormat:function(e){var t,n,o=this,i=function(e){return o.findFormat(a.isDataNode(e)?e.parentNode:e)},r=i(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=i(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 o,i,r,s,l,d=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);for(a.isInline(d)&&(d=a.blockParentOrBody(d)),r=a.significantChildNodes(d),s=a.findNodeIndex(r[0]),l=a.create(d.ownerDocument,e,t),o=0;r.length>o;o++)i=r[o],a.isBlock(i)?(a.attr(i,t),l.childNodes.length&&(a.insertBefore(l,i),l=l.cloneNode(!1)),s=a.findNodeIndex(i)+1):l.appendChild(i);l.firstChild&&a.insertAt(d,l,s)},apply:function(e){var t,n,i=this,r=a.is(e[0],"img")?[e[0]]:i.finder.findSuitable(e),s=r.length?u.formatByName(a.name(r[0]),i.format):i.format[0],l=s.tags[0],d=o({},s.attr,i.values);if(r.length)for(t=0,n=r.length;n>t;t++)a.attr(r[t],d);else i.wrap(l,d,e)},remove:function(e){var t,n,o,i;for(t=0,n=e.length;n>t;t++)o=this.finder.findFormat(e[t]),o&&(a.ofType(o,["p","img","li"])?(i=u.formatByName(a.name(o),this.format),i.attr.style&&a.unstyle(o,i.attr.style),i.attr.className&&a.removeClass(o,i.attr.className)):a.unwrap(o))},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,o,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")?(o=d[t].parentNode,r=new i.ListFormatter(o.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,o(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(o(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,o="formatBlock";new i.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,o,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+o).find("*").andSelf().attr("unselectable","on")}});o(i,{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,o=t.ui.editor,i=o.Dom,r=o.Command,a=o.Tool,s=o.BlockFormatter,l=i.normalize,d=o.RangeUtils,c=o.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&&i.is(e.firstChild,"br")&&i.remove(e.firstChild),i.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e&&!i.is(e,"img")){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;""===e.innerHTML&&(e.innerHTML=y)}}var n,o,r,a,c,u,f,p,m,h,g=this.getRange(),v=d.documentFromRange(g),y=t.support.browser.msie?"":'
    ',b="p,h1,h2,h3,h4,h5,h6".split(","),k=i.parentOfType(g.startContainer,b),w=i.parentOfType(g.endContainer,b),C=k&&!w||!k&&w;g.deleteContents(),u=i.create(v,"a"),g.insertNode(u),u.parentNode||(a=g.commonAncestorContainer,a.innerHTML="",a.appendChild(u)),l(u.parentNode),f=i.parentOfType(u,["li"]),p=i.parentOfType(u,"h1,h2,h3,h4,h5,h6".split(",")),f?(m=g.cloneRange(),m.selectNode(f),d.textNodes(m).length||(c=i.create(v,"p"),f.nextSibling&&d.split(m,f.parentNode),i.insertAfter(c,f.parentNode),i.remove(1==f.parentNode.childNodes.length?f.parentNode:f),c.innerHTML=y,r=c)):p&&!u.nextSibling&&(c=i.create(v,"p"),i.insertAfter(c,p),c.innerHTML=y,i.remove(u),r=c),r||(f||p||new s([{tags:["p"]}]).apply([u]),g.selectNode(u),n=i.parentOfType(u,[f?"li":p?i.name(p):"p"]),d.split(g,n,C),o=n.previousSibling,i.is(o,"li")&&o.firstChild&&!i.is(o.firstChild,"br")&&(o=o.firstChild),r=n.nextSibling,i.is(r,"li")&&r.firstChild&&!i.is(r.firstChild,"br")&&(r=r.firstChild),i.remove(n),e(o),e(r),l(o)),l(r),i.is(r,"img")?g.setStartBefore(r):(g.selectNodeContents(r),h=d.textNodes(g)[0],h&&g.selectNodeContents(h)),g.collapse(!0),i.scrollTo(r),d.selectRange(g) }}),f=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n,o=this.getRange();o.deleteContents(),e=i.create(d.documentFromRange(o),"br"),o.insertNode(e),l(e.parentNode),t.support.browser.msie||e.nextSibling&&!i.isWhitespace(e.nextSibling)||(n=e.cloneNode(!0),n.setAttribute("_moz_dirty",""),i.insertAfter(n,e)),o.setStartAfter(e),o.collapse(!0),i.scrollTo(e.nextSibling),d.selectRange(o)}});n(o,{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,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.ToolTemplate,c=i.FormatTool,u=i.BlockFormatFinder,f=a.textNodes,p=i.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){var t,n,o=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&r.name(t)==this.tag&&o.push(t);if(1>o.length)return!1;if(o.length!=e.length)return!1;for(n=0;o.length>n&&o[n].parentNode==t.parentNode;n++)if(o[n]!=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,o,i=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(o=t[n],r.is(o,"li"))e.appendChild(o);else if(r.is(o,"ul")||r.is(o,"ol"))for(;o.firstChild;)e.appendChild(o.firstChild);else if(r.is(o,"td")){for(;o.firstChild;)i.appendChild(o.firstChild);e.appendChild(i),o.appendChild(e),e=e.cloneNode(!1),i=i.cloneNode(!1)}else i.appendChild(o),r.isBlock(o)&&(e.appendChild(i),r.unwrap(o),i=i.cloneNode(!1));i.firstChild&&e.appendChild(i)},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,o,i,s,l,d,c=f(t);if(c.length)for(n=r.parentOfType(c[0],["li"]),o=r.parentOfType(c[c.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(o),i=0,s=c.length;s>i;i++)l=this.finder.findFormat(c[i]),l&&(d=e(l).parents("ul,ol"),d[0]?a.split(t,d.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,o=t.previousSibling;o&&("k-marker"==o.className||3==o.nodeType&&r.isWhitespace(o));)o=o.previousSibling;if(o&&r.name(o)==e){for(;t.firstChild;)o.appendChild(t.firstChild);r.remove(t),t=o}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 o(){a.push(this)}var i,a,s,l,d,c,u,f=this.tag;for(i=1==n.length?r.parentOfType(n[0],["ul","ol"]):r.commonAncestor.apply(null,n),i||(i=r.parentOfType(n[0],["p","td"])||n[0].ownerDocument.body),r.isInline(i)&&(i=r.blockParentOrBody(i)),a=[],s=this.finder.findSuitable(n),s||(s=new m("ul"==f?"ol":"ul").findSuitable(n)),l=r.significantChildNodes(i),l.length||(l=n),/table|tbody/.test(r.name(i))&&(l=e.map(n,function(e){return r.parentOfType(e,["td"])})),d=0;l.length>d;d++)c=l[d],u=r.name(c),!this.suitable(c,n)||s&&r.isAncestorOrSelf(s,c)||(!s||"ul"!=u&&"ol"!=u?a.push(c):(e.each(c.childNodes,o),r.remove(c)));a.length!=l.length||i==n[0].ownerDocument.body||/table|tbody|tr|td/.test(r.name(i))||(a=[i]),s||(s=r.create(i.ownerDocument,f),r.insertBefore(s,a[0])),this.wrap(s,a),r.is(s,f)||r.changeTag(s,f),this.merge(f,s)},apply:function(e){var t,n,o,i=0,a=[];do o=r.parentOfType(e[i],["td","body"]),t&&o==t?n.push(e[i]):(t&&a.push({section:t,nodes:n}),n=[e[i]],t=o),i++;while(e.length>i);for(a.push({section:t,nodes:n}),i=0;a.length>i;i++)this.applyOnSection(a[i].section,a[i].nodes)},unwrap:function(t){var n,o,i,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(o=t.firstChild;o;o=o.nextSibling){for(i=r.create(t.ownerDocument,l||"p");o.firstChild;)a=o.firstChild,r.isBlock(a)?(i.firstChild&&(s.appendChild(i),i=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):i.appendChild(a);i.firstChild&&s.appendChild(i)}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){var t,n,o;for(n=0,o=e.length;o>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,o=f(e),i=e.commonAncestorContainer;o.length||(e.selectNodeContents(i),o=f(e),o.length||(t=i.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),o=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(o)?(n.split(e),n.remove(o)):n.apply(o)}}),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,o(e,{finder:new m(e.tag)}))},command:function(e){return new g(o(e,{tag:this.options.tag}))}});o(i,{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,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.Tool,c=i.ToolTemplate,u=i.InlineFormatter,f=i.InlineFormatFinder,p=a.textNodes,m=i.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,o,i,s,l=p(e);t.innerHTML?(n=a.getMarkers(e),o=a.documentFromRange(e),e.deleteContents(),s=r.create(o,"a",t),e.insertNode(s),"a"==r.name(s.parentNode)&&r.insertAfter(s,s.parentNode),n.length>1&&(r.insertAfter(n[n.length-1],s),r.insertAfter(n[1],s),r[l.length>0?"insertBefore":"insertAfter"](n[0],s))):(i=new u([{tags:["a"]}],t),i.finder=this.finder,i.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.formatter=new g,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(t.attributes=null,t.async=!0)},_dialogTemplate:function(e){return t.template("
    1. # if (showText) { #
    2. # } #
     #: messages.dialogButtonSeparator # #: messages.dialogCancel #
    ")({messages:this.editor.options.messages,showText:e})},exec:function(){function n(t){var n,o,r,a=u.element,s=e("#k-editor-link-url",a).val();s&&"http://"!=s&&(f.attributes={href:s},n=e("#k-editor-link-title",a).val(),n&&(f.attributes.title=n),o=e("#k-editor-link-text",a).val(),o!==g&&(f.attributes.innerHTML=o||s),r=e("#k-editor-link-target",a).is(":checked"),f.attributes.target=r?"_blank":null,f.formatter.apply(m,f.attributes)),i(t),f.change&&f.change()}function i(e){e.preventDefault(),u.destroy(),r.windowFromDocument(a.documentFromRange(m)).focus(),f.releaseRange(m)}var l,d,c,u,f=this,m=f.getRange(),h=m.collapsed,g=null,v=f.editor.options.messages;m=f.lockRange(!0),l=p(m),d=l.length?f.formatter.finder.findSuitable(l[0]):null,c=1>=l.length||2==l.length&&h,u=s.createDialog(f._dialogTemplate(c),f.editor,o({},f.editor.options.dialogOptions,{title:v.createLink,close:i,visible:!1})).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(d?d.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(l.length>0?1==l.length?l[0].nodeValue:l[0].nodeValue+l[1].nodeValue:"").end().find("#k-editor-link-title").val(d?d.title:"").end().find("#k-editor-link-target").attr("checked",d?"_blank"==d.target:!1).end().data("kendoWindow").center().open(),c&&l.length>0&&(g=e("#k-editor-link-text",u.element).val()),e("#k-editor-link-url",u.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,t){d.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});o(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,o=e.extend,i=n.ui.editor,r=i.EditorUtils,a=i.Dom,s=r.registerTool,l=i.ToolTemplate,d=i.RangeUtils,c=i.Command,u=n.keys,f="#k-editor-image-url",p="#k-editor-image-title",m=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('
    # if (showBrowser) { #
    # } #
     #: messages.dialogButtonSeparator # #: messages.dialogCancel #
    ')({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 i(e){var t=c.element;h.attributes={src:t.find(f).val().replace(/ /g,"%20"),alt:t.find(p).val()},v=h.insertImage(y,g),s(e),h.change&&h.change()}function s(e){e.preventDefault(),c.destroy(),a.windowFromDocument(d.documentFromRange(g)).focus(),v||h.releaseRange(g)}function l(e){e.keyCode==u.ENTER?i(e):e.keyCode==u.ESC&&s(e)}var c,m,h=this,g=h.lockRange(),v=!1,y=d.image(g),b=h.editor.options,k=b.messages,w=b.imageBrowser,C=!!(n.ui.ImageBrowser&&w&&w.transport&&w.transport.read!==t);m=C?{width:"960px",height:"650px"}:{},c=r.createDialog(h._dialogTemplate(C),h.editor,o(m,b.dialogOptions,{title:k.insertImage,close:s,visible:!1,resizable:C,activate:function(){if(C){var e=this;new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"),o({},w,{change:function(){e.element.find(f).val(this.value())},apply:i}))}}})).find(".k-dialog-insert").click(i).end().find(".k-dialog-close").click(s).end().find(".k-form-text-row input").keydown(l).end().find(f).val(y?y.getAttribute("src",2):"http://").end().find(p).val(y?y.alt:"").end().data("kendoWindow").center().open(),e(f,c.element).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new i.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=n.ui.DropDownList,i=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.plugin(i),n.ui.editor.SelectBox=i}(window.kendo.jQuery),function(e,t){function n(n,o){var i="rtl"==e(n).css("direction"),r=i?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return o===t?n.style[a]||0:(o>0?n.style[a]=o+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var o=window.kendo,i=o.Class,r=e.extend,a=o.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=i.extend({init:function(){this.finder=new h([{tags:s.blockElements}])},apply:function(t){var o,i,r,a,l,d,c,u,f,p,m=this.finder.findSuitable(t),h=[];if(m.length){for(o=0,i=m.length;i>o;o++)s.is(m[o],"li")?e(m[o]).index()?0>e.inArray(m[o].parentNode,h)&&h.push(m[o]):h.push(m[o].parentNode):h.push(m[o]);for(;h.length;)if(r=h.shift(),s.is(r,"li"))if(a=r.parentNode,l=e(r).prev("li"),d=l.find("ul,ol").last(),c=e(r).children("ul,ol")[0],c&&l[0])d[0]?(d.append(r),d.append(e(c).children()),s.remove(c)):(l.append(c),c.insertBefore(r,c.firstChild));else for(c=l.children("ul,ol")[0],c||(c=s.create(r.ownerDocument,s.name(a)),l.append(c));r&&r.parentNode==a;)c.appendChild(r),r=h.shift();else for(u=parseInt(n(r),10)+30,n(r,u),f=0;h.length>f;f++)e.contains(r,h[f])&&h.splice(f,1)}else p=new g([{tags:"p"}],{style:{marginLeft:30}}),p.apply(t)},remove:function(t){var o,i,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(i=0,r=u.length;r>i;i++){if(d=e(u[i]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(o&&e.contains(o,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(o==a[0])continue;o=a[0]}else o=u[i];c=parseInt(n(o),10)-30,n(o,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,e),this.finder=new h([{tags:m}])},update:function(o,i){var r,a,l,d,c=this.finder.findSuitable(i);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 o.removeClass("k-state-disabled"),t;o.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({command:b,template:new f({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,o=t.ui.editor,i=o.Dom,r=o.RangeUtils,a=o.EditorUtils,s=o.Command,l=o.Tool,d=o.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()),o(e),a.change&&a.change(),s.trigger("change")}function o(e){e.preventDefault(),d.data("kendoWindow").destroy(),i.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",p=s.options.messages;d.kendoWindow(n({},s.options.dialogOptions,{title:p.viewHtml,close:o})).hide().find(f).val(u).end().find(".k-dialog-update").click(t).end().find(".k-dialog-close").click(o).end().show().data("kendoWindow").center(),d.find(f).focus()}});n(c,{template:"
     or Close
    ",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"\n").replace(/<(ul|ol)([^>]*)>
  • \n/gi,"
    \n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=c,o.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,o=e.extend,i=t.ui.editor,r=i.RangeUtils,a=i.Marker,s=n.extend({init:function(e){this.editor=e,this.formats=[]},apply:function(e){var t,n,i,s,l,d,c,u;if(this.hasPending()){if(t=new a,t.addCaret(e),n=e.startContainer.childNodes[e.startOffset],i=n.previousSibling,i?(i.nodeValue||(i=i.previousSibling),e.setStart(i,i.nodeValue.length-1)):e.setStart(e.startContainer,e.startOffset),t.add(e),!r.textNodes(e).length)return t.remove(e),e.collapse(!0),this.editor.selectRange(e),void 0;for(s=t.end.previousSibling.previousSibling,d=this.formats,c=0;d.length>c;c++)l=d[c],u=l.command(o({range:e},l.options.params)),u.editor=this.editor,u.exec(),e.selectNode(s);t.remove(e),s.parentNode&&(e.setStart(s,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){var t,n=this.formats;for(t=0;n.length>t;t++)if(n[t].name==e)return n[t]},toggle:function(e){var t,n=this.formats;for(t=0;n.length>t;t++)if(n[t].name==e.name)return n[t].params&&n[t].params.value!=e.params.value?n[t].params.value=e.params.value:n.splice(t,1),void 0;n.push(e)},clear:function(){this.formats=[]}});o(i,{PendingFormats:s})}(window.kendo.jQuery)});{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);