(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}});u(o,{Command:f,GenericCommand:p,InsertHtmlCommand:m,InsertHtmlTool:h,UndoRedoStack:g,TypingHandler:v,SystemHandler:b,Keyboard:y,Clipboard:k,Cleaner:w,MSWordFormatCleaner:C,WebkitFormatCleaner:x}),r("insertHtml",new h({template:new l({template:i.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=t.ui.editor,i=t.ui.Editor.fn.options.formats,r=o.EditorUtils,a=o.Tool,s=o.ToolTemplate,l=o.FormatTool,d=o.Dom,c=o.RangeUtils,u=e.extend,f=o.EditorUtils.registerTool,p=o.EditorUtils.registerFormat,m="k-marker",h=n.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==m?i++:3==t.nodeType?n++:o++);return i>1&&r.firstChild.className==m&&r.lastChild.className==m?0:o+n},findSuitable:function(e,t){return!t&&this.numberOfSiblings(e)>0?null:d.parentOfType(e,this.format[0].tags)},findFormat:function(e){var t,n,o,i,r,a=this.format,s=d.attrEquals;for(t=0,n=a.length;n>t;t++){if(o=e,i=a[t].tags,r=a[t].attr,o&&d.ofType(o,i)&&s(o,r))return o;for(;o;)if(o=d.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}}),g=n.extend({init:function(e,t){var n=this;n.finder=new h(e),n.attributes=u({},e[0].attr,t),n.tag=e[0].tags[0]},wrap:function(e){return d.wrap(e,d.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=c.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?d.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?(d.unstyle(o,i.attributes.style),o.style.cssText||o.attributes["class"]||d.unwrap(o)):d.unwrap(o))},split:function(e){var t,n,o=c.textNodes(e),i=o.length;if(i>0)for(t=0;i>t;t++)n=this.finder.findFormat(o[t]),n&&c.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==m&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);d.remove(t)}}}),v=h.extend({init:function(e,t){var n=this;n.format=e,n.greedyProperty=t,h.fn.init.call(n,e)},getInlineCssValue:function(t){var n,o,i,r,a,s,l,c,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(";"),c=0,u=s.length;u>c;c++)if(l=s[c],l.length){if(f=l.split(":"),p=g(f[0].toLowerCase()),m=g(f[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?d.toHex(m):m}},getFormatInner:function(t){var n,o,i,r=e(d.isDataNode(t)?t.parentNode:t),a=r.parentsUntil("[contentEditable]").addBack();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=g.extend({init:function(e,t,n){var o=this;g.fn.init.call(o,e,t),o.greedyProperty=n,o.values=t,o.finder=new v(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)}}),y=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new h(e.format),formatter:function(){return new g(e.format)}}))}}),k=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),w=k.extend({init:function(e){var n=this;a.fn.init.call(n,e),n.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",n.format=[{tags:["span"]}],n.finder=new v(n.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(u(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},initialize:function(e,t){var n,o=t.editor,i=this.options,r=i.name,s=[];i.defaultValue&&(s=[{text:o.options.messages[i.defaultValue[0].text],value:i.defaultValue[0].value}]),n=s.concat(i.items?i.items:o.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(o,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),C=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}]},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(u(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},initialize:function(n,o){var i=o.editor,r=this.name,s=u({},C.fn.options,this.options),l=s.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+s.name,palette:l,change:function(){var e=n.value();e&&a.exec(i,r,e),i.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:o.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(o,{InlineFormatFinder:h,InlineFormatter:g,DelayedExecutionTool:k,GreedyInlineFormatFinder:v,GreedyInlineFormatter:b,InlineFormatTool:y,FontTool:w,ColorTool:C}),p("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),f("bold",new y({key:"B",ctrl:!0,format:i.bold,template:new s({template:r.buttonTemplate,title:"Bold"})})),p("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),f("italic",new y({key:"I",ctrl:!0,format:i.italic,template:new s({template:r.buttonTemplate,title:"Italic"})})),p("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),f("underline",new y({key:"U",ctrl:!0,format:i.underline,template:new s({template:r.buttonTemplate,title:"Underline"})})),p("strikethrough",[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),f("strikethrough",new y({format:i.strikethrough,template:new s({template:r.buttonTemplate,title:"Strikethrough"})})),p("superscript",[{tags:["sup"]}]),f("superscript",new y({format:i.superscript,template:new s({template:r.buttonTemplate,title:"Superscript"})})),p("subscript",[{tags:["sub"]}]),f("subscript",new y({format:i.subscript,template:new s({template:r.buttonTemplate,title:"Subscript"})})),f("foreColor",new C({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:r.colorPickerTemplate,title:"Color"})})),f("backColor",new C({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:r.colorPickerTemplate,title:"Background Color"})})),f("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Name"})})),f("fontSize",new w({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:r.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.ToolTemplate,d=i.FormatTool,c=i.EditorUtils,u=c.registerTool,f=c.registerFormat,p=i.RangeUtils,m=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[];e.inArray(i,s)<0&&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}}),h=n.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new m(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;o
i;i++)a.attr(l[i],n);else s.wrap(t,n,e)},remove:function(e){var t,n,o,i,r;for(t=0,n=e.length;n>t;t++)o=this.finder.findFormat(e[t]),o&&(r=a.name(o),"div"!=r||o.getAttribute("class")?(i=c.formatByName(r,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=p.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),g=n.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new m(e)},apply:function(e){var t,n,o,r,s,l,d=this.format,c=a.blockParents(e),u=d[0].tags[0];if(c.length&&c[0].attributes.contentEditable&&(c=[]),c.length)for(t=0,n=c.length;n>t;t++)a.is(c[t],"li")?(o=c[t].parentNode,r=new i.ListFormatter(o.nodeName.toLowerCase(),u),s=this.editor.createRange(),s.selectNode(c[t]),r.toggle(s)):(l=a.changeTag(c[t],u),a.attr(l,d[0].attr));else new h(d,this.values).apply(e)},toggle:function(e){var t=p.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=p.textNodes(e),t.length||(t=a.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),v=s.extend({init:function(e){e.formatter=e.formatter(),s.fn.init.call(this,e)}}),b=d.extend({init:function(e){d.fn.init.call(this,o(e,{finder:new m(e.format),formatter:function(){return new h(e.format)}}))}});o(i,{BlockFormatFinder:m,BlockFormatter:h,GreedyBlockFormatter:g,FormatCommand:v,BlockFormatTool:b}),f("justifyLeft",[{tags:a.blockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}]),u("justifyLeft",new b({format:r.justifyLeft,template:new l({template:c.buttonTemplate,title:"Justify Left"})})),f("justifyCenter",[{tags:a.blockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}]),u("justifyCenter",new b({format:r.justifyCenter,template:new l({template:c.buttonTemplate,title:"Justify Center"})})),f("justifyRight",[{tags:a.blockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}]),u("justifyRight",new b({format:r.justifyRight,template:new l({template:c.buttonTemplate,title:"Justify Right"})})),f("justifyFull",[{tags:a.blockElements,attr:{style:{textAlign:"justify"}}}]),u("justifyFull",new b({format:r.justifyFull,template:new l({template:c.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)},_insertMarker:function(e,t){var n,o=i.create(e,"a");return t.insertNode(o),o.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(o)),l(o.parentNode),o},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=i.parentOfType(e.startContainer,t),o=i.parentOfType(e.endContainer,t);return n&&!o||!n&&o},exec:function(){var e,t,n,r,a,c,u,f,p,m=this.getRange(),h=d.documentFromRange(m),g=o.emptyElementContent,v=this.shouldTrim(m);m.deleteContents(),a=this._insertMarker(h,m),c=i.parentOfType(a,["li"]),u=i.parentOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),c?(f=m.cloneRange(),f.selectNode(c),d.textNodes(f).length||(r=i.create(h,"p"),c.nextSibling&&d.split(f,c.parentNode),i.insertAfter(r,c.parentNode),i.remove(1==c.parentNode.childNodes.length?c.parentNode:c),r.innerHTML=g,n=r)):u&&!a.nextSibling&&(r=i.create(h,"p"),i.insertAfter(r,u),r.innerHTML=g,i.remove(a),n=r),n||(c||u||new s([{tags:["p"]}]).apply([a]),m.selectNode(a),e=i.parentOfType(a,[c?"li":u?i.name(u):"p"]),d.split(m,e,v),t=e.previousSibling,i.is(t,"li")&&t.firstChild&&!i.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,i.is(n,"li")&&n.firstChild&&!i.is(n.firstChild,"br")&&(n=n.firstChild),i.remove(e),this.clean(t),this.clean(n),l(t)),l(n),i.is(n,"img")?m.setStartBefore(n):(m.selectNodeContents(n),p=d.textNodes(m)[0],p&&m.selectNodeContents(p)),m.collapse(!0),i.scrollTo(n),d.selectRange(m)},clean:function(e){if(e.firstChild&&i.is(e.firstChild,"br")&&i.remove(e.firstChild),i.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;!i.is(e,"img")&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=o.emptyElementContent)}}}),f=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),o=i.create(d.documentFromRange(n),"br");n.deleteContents(),n.insertNode(o),l(o.parentNode),t.support.browser.msie||o.nextSibling&&!i.isWhitespace(o.nextSibling)||(e=o.cloneNode(!0),e.setAttribute("_moz_dirty",""),i.insertAfter(e,o)),n.setStartAfter(o),n.collapse(!0),i.scrollTo(o.nextSibling||o),d.selectRange(n)}});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;ni;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(){u.push(this)}var i,a,s,l,d=this.tag,c=r.closestSplittableParent(n),u=[],f=this.finder.findSuitable(n);for(f||(f=new m("ul"==d?"ol":"ul").findSuitable(n)),i=r.significantChildNodes(c),i.length||(i=n),/table|tbody/.test(r.name(c))&&(i=e.map(n,function(e){return r.parentOfType(e,["td"])})),a=0;an;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)}}),b=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(){return t.template("")({messages:this.editor.options.messages})},exec:function(){function n(t){var n,a,s,u=l.element,p=e("#k-editor-link-url",u).val();p&&"http://"!=p&&(p.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(p)&&(p="mailto:"+p),d.attributes={href:p},n=e("#k-editor-link-title",u).val(),n&&(d.attributes.title=n),a=e("#k-editor-link-text",u).val(),a===f||!a&&0!==i.length||(d.attributes.innerHTML=r.stripBom(a)||p),s=e("#k-editor-link-target",u).is(":checked"),d.attributes.target=s?"_blank":null,d.formatter.apply(c,d.attributes)),o(t),d.change&&d.change()}function o(e){e.preventDefault(),l.destroy(),r.windowFromDocument(a.documentFromRange(c)).focus(),d.releaseRange(c)}var i,s,l,d=this,c=d.getRange(),u=c.collapsed,f=null,m=d.editor.options.messages;c=d.lockRange(!0),i=p(c),s=i.length?d.formatter.finder.findSuitable(i[0]):null,l=this.createDialog(d._dialogTemplate(),{title:m.createLink,close:o,visible:!1}).find(".k-dialog-insert").click(n).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(function(e){var i=t.keys;e.keyCode==i.ENTER?n(e):e.keyCode==i.ESC&&o(e)}).end().find("#k-editor-link-url").val(s?s.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(i.length>0?1==i.length?i[0].nodeValue:i[0].nodeValue+i[1].nodeValue:"").end().find("#k-editor-link-title").val(s?s.title:"").end().find("#k-editor-link-target").attr("checked",s?"_blank"==s.target:!1).end().data("kendoWindow").center().open(),i.length>0&&!u&&(f=e("#k-editor-link-text",l.element).val()),e("#k-editor-link-url",l.element).focus().select()},redo:function(){var e=this,t=e.lockRange(!0);e.formatter.apply(t,e.attributes),e.releaseRange(t)}}),y=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:b,UnlinkTool:y}),m("createLink",new d({key:"K",ctrl:!0,command:b,template:new c({template:s.buttonTemplate,title:"Create Link"})})),m("unlink",new y({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,o=d.documentFromRange(t);if(n.src&&"http://"!=n.src){if(!e)return e=a.create(o,"img",n),e.onload=e.onerror=function(){e.removeAttribute("complete"),e.removeAttribute("width"),e.removeAttribute("height")},t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(o.createTextNode(""),e),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('')({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=l.element;c.attributes={src:t.find(f).val().replace(/ /g,"%20"),alt:t.find(p).val()},h=c.insertImage(g,m),r(e),c.change&&c.change()}function r(e){e.preventDefault(),l.destroy(),a.windowFromDocument(d.documentFromRange(m)).focus(),h||c.releaseRange(m)}function s(e){e.keyCode==u.ENTER?i(e):e.keyCode==u.ESC&&r(e)}var l,c=this,m=c.lockRange(),h=!1,g=d.image(m),v=c.editor.options,b=v.messages,y=v.imageBrowser,k=!!(n.ui.ImageBrowser&&y&&y.transport&&y.transport.read!==t);l=this.createDialog(c._dialogTemplate(k),{title:b.insertImage,close:r,visible:!1,resizable:k,activate:function(){if(k){var e=this;new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"),o({},y,{change:function(){e.element.find(f).val(this.value())},apply:i}))}}}).toggleClass("k-imagebrowser-dialog",k).find(".k-dialog-insert").click(i).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(s).end().find(f).val(g?g.getAttribute("src",2):"http://").end().find(p).val(g?g.alt:"").end().data("kendoWindow").center().open(),e(f,l.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=n.ui.editor.Dom,r=o.extend({init:function(e,t){var i=this;o.fn.init.call(i,e,t),i.value(i.options.title),n.support.mobileOS.ios&&i._initSelectOverlay(e),i.bind("open",function(){if(i.options.autoSize){var e,t=i.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=i._listWidth,t.css("width",e+n.support.scrollbar()),i._listWidth=e}})},options:{name:"SelectBox"},_initSelectOverlay:function(t){var n,o,i;t=e(t),n=e(" "),o=t.closest(".k-widget"),i=t.data(this.type).kendoSelectBox,n.on("change",function(){i.value(this.value),i.trigger("change")}),this.bind("dataBound",function(){var e,t,o=i.value(),r=this.dataSource.view(),a="";for(t=0;t"+e.text+"";n.html(a)}),n.insertAfter(o)},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&&n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)},decorate:function(e){var t,n,o,r=this.dataSource.data();for(t=0;t0?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()?e.inArray(m[o].parentNode,h)<0&&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;fi;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)}}}),b=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(p.nodes(e))}},c.fn.init.call(this,e)}}),y=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}])},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},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:b,OutdentCommand:y,OutdentTool:k}),d("indent",new u({command:b,template:new f({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new k({command:y,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 n(e){s.value(u.find(p).val()),o(e),a.change&&a.change(),s.trigger("change")}function o(e){e.preventDefault(),u.data("kendoWindow").destroy();try{i.windowFromDocument(r.documentFromRange(l)).focus()}catch(t){}}var a=this,s=a.editor,l=s.getRange(),d=s.options.messages,u=e(t.template(c.template)(d)).appendTo(document.body),f=c.indent(s.value()),p=".k-editor-textarea";this.createDialog(u,{title:d.viewHtml,close:o,visible:!1}).find(p).val(f).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(o).end().data("kendoWindow").center().open(),u.find(p).focus()}});n(c,{template:"",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"$1>\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){function t(t,n,o){return c.extend({init:function(e){c.fn.init.call(this,e),this.finder=o},command:function(t){var o=t.value;return e.isPlainObject(o)?o[n]=o.value:(t.value={},t.value[n]=o),c.fn.command.call(this,t)},initialize:function(e,t){var o,i=window.console,r=this.options.items;for(o=0;o=0?new o.GreedyInlineFormatter(i):new o.GreedyBlockFormatter(i)}})},initialize:function(e,t){var o=t.editor,r=this.options,a=r.name,s=this;e.width(r.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:r.items||o.options[a],title:o.options.messages[a],autoSize:!0,change:function(){i.exec(o,a,this.dataItem().toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;e#:data.text#')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+a).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var o,i,r,a,s,l,d;for(o=0;o").parent().prepend(" ").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){e(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},items:function(){return this.element.children().find("> *, select")},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,o=this.groups;for(n in o)if(e.inArray(t,o[n])>=0)return n},bindTo:function(t){var n=this,o=n.window;n._editor&&n._editor.unbind("select",a(n._update,n)),n._editor=t,n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),o=t.keyCode;o==s.RIGHT||o==s.LEFT?n.close():o==s.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var o,i=n._toolFromClassName(this),r=n.tools[i],a=t.options.messages,s=a[i],l=e(this);r&&r.initialize&&(("fontSize"==i||"fontName"==i)&&(o=a[i+"Inherit"],l.find("input").val(o).end().find("span.k-input").text(o).end()),r.initialize(l,{title:n._appendShortcutSequence(s,r),editor:n._editor}))}),t.bind("select",a(n._update,n)),n._updateContext(),n.updateGroups(),o&&o.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n=this,o=n.window,i=n.options.editor;o&&(e=o.wrapper,t=i.element,e.is(":visible")&&n.window.options.visible||(e[0].style.width||e.width(t.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),o._moved||(e.css("top",parseInt(t.offset().top,10)-e.outerHeight()-parseInt(n.window.element.css("padding-bottom"),10)),e.css("left",parseInt(t.offset().left,10))),o.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this._editor.element,n=t.attr(e);t.attr(e,n||0).focus().find("li:has("+d+")").first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(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+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},expandTools:function(n){var i,a,s,l,d=this._nativeTools,c=t.deepExtend({},t.ui.Editor.defaultTools),u={};for(a=0;a"+o+""),i=e(o).appendTo(d),"button"==n.type&&n.exec&&i.find(".k-tool-icon").click(a(n.exec,l[0])))},updateGroups:function(){var t,n,o,i,r=this,a=r.element,s=/k-group-end/,l=!1;a.children().filter(".k-group-break").remove(),i=a.children().filter(function(){return!e(this).children(".k-state-disabled").length}),i.each(function(a,s){var d,c,u;s=e(s),d=r._toolFromClassName(s.children()[0]),c=r.toolGroupFor(d),u=a==i.length-1,o=n!=c,n=c,t&&o&&t.addClass("k-group-end"),l=l||o,s.toggleClass("k-group-start",o||!l&&u).toggleClass("k-group-end",u),t=s}),r.element.children(".k-group-start").each(function(){for(var t,n=this;!s.test(n.className);)n=n.nextSibling,t=n.offsetLeft+n.offsetWidth;t>this.parentNode.offsetWidth&&e(this).before(" ")})},_attachEvents:function(){var t=this,n=".k-editor-button .k-tool-icon",o=n+":not(.k-state-disabled)",i=n+".k-state-disabled";t.element.off(l).on("mouseenter"+l,o,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+l,o,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+l,n,!1).on("keydown"+l,d,function(n){var o,i=e(this).closest("li"),r="li:has("+d+")",a=n.keyCode;if(a==s.RIGHT)o=i.nextAll(r).first().find(d);else if(a==s.LEFT)o=i.prevAll(r).first().find(d);
else if(a==s.ESC)o=t;else if(a==s.TAB&&!n.ctrlKey&&!n.altKey)if(n.shiftKey){if(o=i.prevAll(r).first().find(d),!o.length)return;n.preventDefault()}else n.preventDefault(),o=i.nextAll(r).first().find(d),o.length||(o=t);o&&o.focus()}).on("click"+l,o,function(n){var o=e(this);n.preventDefault(),n.stopPropagation(),o.removeClass("k-state-hover"),o.is("[data-popup]")||t._editor.exec(t._toolFromClassName(this))}).on("click"+l,i,function(e){e.preventDefault()})},_toolFromClassName:function(t){if(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"}},_update:function(){var n=this,o=n._editor,i=o.getRange(),r=t.ui.editor.RangeUtils.textNodes(i);r.length||(r=[i.startContainer]),n.items().each(function(){var t=n.tools[n._toolFromClassName(this)];t&&t.update&&t.update(e(this),r)}),this._updateContext(),n.updateGroups()},_updateContext:function(){this.element.children().show().filter(":has(.k-state-disabled)").hide()}});e.extend(o,{Toolbar:c})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,o=e.proxy,i=t.ui.editor,r=i.Dom,a=i.EditorUtils,s=i.Command,l=".kendoEditor",d="k-state-active",c="k-state-selected",u=i.Tool,f=i.ToolTemplate,p=i.BlockFormatFinder,m=i.EditorUtils.registerTool,h=""+i.emptyElementContent+" ",g=new p([{tags:["table"]}]),v=s.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,""+Array(e+1).join(""+Array(t+1).join(h)+" ")+"
"},exec:function(){var t,n,o=this.options,i=this.editor,r=this._tableHtml(o.rows,o.columns);i.selectRange(o.range),i.clipboard.paste(r),t=i.getRange(),n=e("table[data-last]",i.document).removeAttr("data-last"),t.selectNodeContents(n.find("td")[0]),i.selectRange(t)}}),b=u.extend({initialize:function(t,n){u.fn.initialize.call(this,t,n);var i=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:o(this._open,this),activate:o(this._activate,this),close:o(this._close,this)}).data("kendoPopup");t.click(o(this._toggle,this)),this._editor=n.editor,this._popup=i},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(d)},_close:function(){this._popup.options.anchor.removeClass(d)},_toggle:function(t){var n=e(t.target).closest(".k-tool-icon");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){this.popup().close(),e.removeClass("k-state-hover")}}),y=b.extend({init:function(t){this.cols=8,this.rows=6,b.fn.init.call(this,e.extend(t,{command:v,popupTemplate:""}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-m.top)/r)+1,col:Math.floor((t.clientX+n.scrollLeft()-m.left)/i)+1}}function o(e){return e.row>0&&e.col>0&&e.row<=v&&e.col<=g}var i,r,a=this,s=a._popup.element,d=s.find(".k-status"),u=s.find(".k-ct-cell"),f=u.eq(0),p=u.eq(u.length-1),m=t.getOffset(f),h=t.getOffset(p),g=a.cols,v=a.rows;h.left+=p[0].offsetWidth,h.top+=p[0].offsetHeight,i=(h.left-m.left)/g,r=(h.top-m.top)/v,s.on("mousemove"+l,function(i){var r=n(i);o(r)?(d.text(t.format("Create a {0} x {1} table",r.row,r.col)),u.each(function(t){e(this).toggleClass(c,t%g