{"version":3,"file":"kendo.editor.min.js","names":["global","factory","exports","module","require","define","amd","globalThis","self","kendoeditor","js","this","$","editorNS","Command","GenericCommand","registerTool","Tool","RestorePoint","extend","InsertHtmlCommand","InsertHtmlTool","kendo","UndoRedoStack","Observable","init","options","fn","call","clear","events","push","command","stack","slice","currentCommandIndex","undo","canUndo","trigger","redo","canRedo","length","deepExtend","util","undefined$1","window","Class","Widget","ui","os","support","mobileOS","browser","keys","outerWidth","_outerWidth","outerHeight","_outerHeight","SELECT","SELECT_OVERLAY_SELECTOR","PLACEHOLDER_CLASS","NATIVE_TOOLS","EditorUtils","editorWrapperTemplate","formatByName","name","format","i","inArray","tags","getToolCssClass","icon","cssClass","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","insertUpperRomanList","insertLowerRomanList","import","indent","outdent","createLink","unlink","insertImage","insertFile","viewHtml","foreColor","backColor","createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn","mergeCellsHorizontally","mergeCellsVertically","splitCellHorizontally","splitCellVertically","tableProperties","tableCellProperties","tableWizardInsert","tableAlignLeft","tableAlignCenter","tableAlignRight","cleanFormatting","copyFormat","applyFormat","nameToKebab","replace","toLowerCase","toolName","tool","Editor","defaultTools","registerFormat","formatName","formats","cacheComments","content","comments","index","retrieveComments","supportedContentEditable","document","documentElement","toolGroups","basic","scripts","alignment","links","lists","dent","tablesWizard","tablesInsert","tablesAddDelete","tablesMerge","tablesPosition","formatPainter","element","toolbarContainer","type","domElement","that","editor","dom","Dom","_registerHandler","closest","update","bind","_setupType","_initToolbar","_setupHeight","_resizable","_initializeContentElement","_setupKeyboard","clipboard","Clipboard","undoRedoStack","_populateValue","mousedown","_endTyping","mouseup","e","_mouseup","_initializeImmutables","_ariaLabel","wrapper","find","toolbar","resize","notify","messages","auto","bold","italic","underline","strikethrough","fitToCell","insertHtml","fontName","fontNameInherit","fontSize","fontSizeInherit","formatBlock","formatting","style","emptyFolder","editAreaTitle","uploadFile","overflowAnchor","orderBy","orderBySize","orderByName","invalidFileType","deleteFile","overwriteFile","directoryNotFound","imageWebAddress","imageAltText","imageWidth","imageHeight","fileWebAddress","fileTitle","fileText","linkWebAddress","linkText","linkToolTip","linkOpenInNewWindow","dialogUpdate","dialogInsert","dialogOk","dialogCancel","createTableHint","tableWizard","tableTab","cellTab","accessibilityTab","caption","summary","width","height","units","cellSpacing","cellPadding","cellMargin","captionAlignment","position","background","tableBackground","id","border","borderStyle","borderWidth","borderColor","collapseBorders","wrapText","associateCellsWithHeaders","alignLeft","alignCenter","alignRight","alignLeftTop","alignCenterTop","alignRightTop","alignLeftMiddle","alignCenterMiddle","alignRightMiddle","alignLeftBottom","alignCenterBottom","alignRightBottom","alignRemove","columns","rows","selectAllCells","applyToColumn","applyToRow","exportAs","print","headerRows","headerColumns","tableSummaryPlaceholder","associateNone","associateScope","associateIds","borderNone","placeholder","encoded","domain","resizable","deserialization","custom","serialization","entities","semantic","optimizeTags","keepEOL","pasteCleanup","all","css","keepNewLines","msAllFormatting","msConvertLists","msTags","none","span","stylesheets","dialogOptions","modal","draggable","animation","imageBrowser","fileBrowser","navigateOnTab","text","value","tools","destroy","_deregisterHandlers","clearTimeout","_spellCorrectTimeout","_focusOutside","windowInstance","tablePopup","_destroyUploadWidget","_destroyResizings","setOptions","_setOptionsTools","_initializePlaceholder","createRange","RangeUtils","encodedValue","encode","exec","params","range","Error","body","getAttribute","keyboard","isTypingInProgress","_focusBody","selectRange","_range","getRange","Object","map","key","immutables","test","execCommand","async","change","_selectionChange","managesUndoRedo","focus","restoreSelection","selection","getSelection","rangeCount","getRangeAt","doc","startContainer","endContainer","startOffset","endOffset","setStart","collapse","SelectionUtils","selectionFromDocument","paste","html","refresh","textarea","val","remove","selectionRestorePoint","toRange","saveSelection","container","commonAncestorContainer","contains","selectedHtml","Serializer","domToXhtml","cloneContents","removeAllRanges","addRange","state","textNodes","finder","collapsed","getFormat","isFormatted","_togglePlaceholder","trim","_oldValue","currentHtml","htmlToDom","_refreshTools","_bindTools","unbind","filter","el","each","initialize","_blur","old","_containsRange","isAncestorOrSelf","_createContentElement","iframe","wnd","lang","specifiedDomain","domainScript","src","hide","title","frameBorder","addClass","attr","tabIndex","insertBefore","location","hostname","contentWindow","contentDocument","one","_decorateFormatting","getElementsByTagName","open","write","isRtl","ios","edge","chrome","href","join","close","_deleteSavedRange","component","dataSource","items","tag","className","formattingElement","getKendoDropDownList","data","list","getEffectiveBackground","inlineStyle","handlers","_handlers","h","off","handler","_uploadWidget","endTyping","scrollTop","activeElement","_activeElement","scrollHeight","clientHeight","msie","left","top","opacity","appendTo","_handleToolbarClick","target","_immutablesContext","Immutables","immutablesContext","editableTextNodes","blurTrigger","mousedownTrigger","createElement","setAttribute","appendChild","interval","setInterval","last","clearInterval","setTimeout","_mousedown","touch","keydown","_spellCorrect","parentElement","nodeName","_cachedHeight","restoreHeight","keyCode","BACKSPACE","DELETE","F10","first","preventPopupHide","preventDefault","LEFT","RIGHT","offset","next","nextChar","nodeType","nodeValue","toolFromShortcut","toolOptions","keyPressCommand","_runPostContentKeyCommands","keypress","_showElementResizeHandles","keyup","selectionCodes","TAB","PAGEUP","PAGEDOWN","END","HOME","UP","DOWN","INSERT","ctrlKey","altKey","shiftKey","_refreshInterval","click","selectNode","focusin","hasAttribute","_showWindow","focusout","active","popup","toolbarContainerElement","get","_toolbarFocused","hasClass","removeClass","_hideWindow","_initializeColumnResizing","_initializeRowResizing","_initializeElementResizing","$head","head","append","assign","defaults","toolbarOptions","_processToolbarItems","_setNativeTools","parentMessages","toggle","ToolBar","on","_initToolbarWindow","toolbarEl","wrap","parent","prepend","kendoWindow","dragHandle","effects","minHeight","visible","autoFocus","actions","dragend","_moved","is","_selectionStarted","parents","stopPropagation","gecko","which","tagName","defaultValue","deserializedRoot","getAllComments","innerHTML","_resetGroups","current","result","optionsTools","assign$1","j","t","guidGroupName","flatDefaultTools","processedObject","currentGroups","Array","isArray","guid","_processToolOptions","gr","includes","values","group","g","to","_processDefaultTool","isPlainObject","view","shortcuts","uiOptions","palette","template","showText","showIcon","tooltip","attributes","ColorTool","componentOptions","views","preview","input","buttons","_shortcutSequence","nodes","filterBy","htmlIndentSpace","_updateImmutablesState","eventNames","NS","hasOwnProperty","applyEventMap","split","toolsFromShortcut","o","changesContent","empty","heightStyle","expectedHeight","parseInt","actualHeight","indexOf","isNaN","Keyboard","BackspaceHandler","TypingHandler","SystemHandler","SelectAllHandler","_wrapTextarea","res","ctrl","shift","alt","beforeCorrection","falseTrigger","contextmenu","mozilla","_finishUpdate","show","$body","toggleClass","overflowPopup","uiElement","trackImmutables","toolsToBeUpdated","w","editorWrap","editArea","draggableElement","insertAfter","kendoResizable","start","currentTarget","initialSize","delta","y","initialDelta","newSize","min","max","Infinity","Math","resizeend","getKendoResizable","ignore","_destroyElementResizing","ElementResizingFactory","dispose","_destroyRowResizing","RowResizing","_destroyColumnResizing","ColumnResizing","create","_showElementResizeHandlesProxy","elementResizing","parentNode","showResizeHandles","columnResizing","rowResizing","_getWindowWidth","editorElement","_overlapsWindow","box","toolbarWrapper","toolbarWrapperOffset","toolbarWrapperLeft","toolbarWrapperTop","boxOffset","boxOffsetLeft","boxOffsetTop","editorOffset","plugin","commandArguments","noop","UndoTool","enable","removeAttr","emptyElementContent","emptyTableCellContent","PDFMixin","prototype","_drawPDF","drawing","drawDOM","pdf","saveAsPDF","progress","Deferred","promise","args","then","root","exportPDF","done","dataURI","saveAs","fileName","proxyURL","proxyTarget","forceProxy","resolve","fail","err","reject","jQuery","STYLE","FLOAT","CSSFLOAT","STYLEFLOAT","CLASS","KMARKER","makeMap","len","obj","nonListBlockElements","blockElements","concat","block","selfClosing","inlineElements","inline","fillAttrs","nonEmptyNonTextContentElements","normalize","node","version","firstChild","prev","nextSibling","persistedScrollTop","whitespace","emptyspace","rgb","bom","whitespaceOrBom","cssAttributes","htmlRe","entityRe","entityTable","findNodeIndex","skipText","previousSibling","isDataNode","isAncestorOf","findClosestAncestor","rootElem","iterator","createNodeIterator","NodeFilter","SHOW_COMMENT","FILTER_ACCEPT","curNode","nextNode","getNodeLength","childNodes","splitDataNode","temp","newNode","cloneNode","denormalizedText","deleteData","attrEquals","cssFloat","blockParentOrBody","parentOfType","ownerDocument","blockParents","blocks","windowFromDocument","defaultView","parentWindow","nodeTypes","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","toHex","color","matches","x","toString","encodableChars","c","charCode","charCodeAt","entity","isBom","stripBom","stripBomNode","removeChild","insignificant","_moz_dirty","_moz_editor_bogus_node","tableCell","significantNodes","grep","child","emptyTextNode","emptyNode","significantChildNodes","isWhitespace","lastTextNode","lastChild","isMarker","allowsTextContent","every","allWhitespaceContent","isEmptyspace","sibling","direction","isBlock","isPrevBlock","isNextBlock","isSelfClosing","isEmpty","isInline","isBr","scrollContainer","compatMode","scrollingElement","scrollTo","toStart","elementTop","elementHeight","marker","windowHeight","innerHeight","offsetHeight","ceil","persistScrollTop","offsetParent","offsetTop","offsetLeft","restoreScrollTop","undefined","insertAt","newElement","referenceElement","removeChildren","removeTextSiblings","closestBy","condition","rootCondition","ofType","changeTag","skipAttributes","attribute","specified","cssText","editableParent","contentEditable","unwrap","createEmptyNode","removeAttribute","mergeAttributes","origin","traverseCss","unstyle","backgroundStyle","innerText","classNames","classes","commonAncestor","ancestors","arguments$1","arguments","count","paths","minPathLength","output","reverse","closestSplittableParent","apply","editableParents","editableAncestor","closestEditable","types","editable","closestEditableOfType","invert","match","ensureTrailingBreaks","elements","ensureTrailingBreak","removeTrailingBreak","br","reMapTableColumns","table","colAttr","_mapColIndices","clearTableMappings","registeredColumns","rowIndex","cells","colIndex","cellIndex","cell","rowSpan","_mapColspan","colSpan","ci","ri","associateWithIds","theadRows","numberOfTheadRows","tableRows","numberOfTableRows","theadMatrix","tbodyMatrix","tHead","_getNumberOfHeaderRows","_generateIdsForColumns","_generateIdsForRows","_assignIds","col","colspan","rowspan","k","l","timestamp","Date","getTime","row","headers","pushHeaderId","forEach","_onlyUnique","_getNumberOfColumns","currentIndex","numberOfCols","Number","_getNumberOfHeaderColumns","numberOfHeaderRows","number","fontSizeMappings","quoteRe","brRe","pixelRe","emptyPRe","cssDeclaration","sizzleAttr","scriptAttr","onerrorRe","bomSpan","div","supportsLeadingWhitespace","isFunction","toEditableHtml","_toEditableImmutables","immutable","prependTo","_fillEmptyElements","p","children","_removeSystemElements","_resetOrderedLists","ol","originalStart","ols","_preventScriptExecution","attributesToRemove","deserialize","semanticFilter","mapStart","tagMap","end","skipEncoding","canOptimize","semanticAttributes","specifiedAttributes","textDecoration","font","fontFamily","size","inlineStyles","ignoredStylePrefixes","prop","startsWith","strong","em","b","u","item","styleObj","splice","face","styleAttr","properties","property","lastIndex","cssProperties","$node","htmlEncode","skip","childNode","mapper","previous","jqNode","serialize","shouldOptimize","isEmptyBomNode","runCustom","script","childrenCount","textOnly","selectionFromWindow","W3CSelection","selectionFromRange","rangeDocument","documentFromRange","W3CRange","updateRangeProperties","fixIvalidRange","setEnd","setStartBefore","setStartAfter","setEndBefore","setEndAfter","selectNodeContents","deleteContents","cloneRange","deleteSubtree","hasPartialSubtree","getSubtreeIterator","RangeIterator","cloneSubtree","frag","createDocumentFragment","extractContents","extractSubtree","originalRange","insertNode","startNodeName","endNodeName","startAncestor","endAncestor","compareBoundaries","ex","isInvalidRange","fromNode","_current","_next","_end","hasNext","traverse","callback","inStartContainer","inEndContainer","nodeIndex","getSubRange","subRange","textRange","createTextRange","adoptContainer","select","duplicate","right","textRangeContainer","adoptEndPoint","compareEndPoints","movedStart","movedEnd","cursorNode","textOffset","isData","anchorNode","anchorParent","cursor","moveToElementText","setEndPoint","comparison","appended","RangeEnumerator","enumerate","visit","ImmutablesRangeIterator","ImmutablesRangeEnumerator","rootNode","getEditable","nodeToPath","serializedImmutables","removeImmutables","restoreImmutables","lastType","restoreHtml","path","toRangePoint","denormalizedOffset","Marker","caret","addCaret","removeCaret","containerIndex","textNode","add","expand","isExpandable","rangeBoundary","_removeDeadMarkers","createTextNode","_normalizedIndex","pointer","shouldNormalizeStart","shouldNormalizeEnd","isBomSelected","charAt","collapsedToStart","startParent","endParent","startIndex","endIndex","boundary","immutableParent","image","stringify","partition","partitionRange","contents","mapAll","mapped","getAll","predicate","selector","getMarkers","isStartOf","isEndOf","wrapSelectedElements","startEditable","endEditable","isEnd","beforeCaret","afterCaret","search","substring","complexBlocks","IMMUTABALE","IMMUTABALE_MARKER_SELECTOR","randomId","chars","round","random","updateToolOptions","_initOptions","_toHtml","replaceWith","isDeleting","_cancelDeleting","_cancelTyping","typingInProgress","isTypingKey","backspace","del","cancelDeleting","nextImmutable","closestSelectionLi","closestImmutableLi","_removeImmutable","forwards","commonContainer","_nextNode","startRestorePoint","expandImmutablesIn","startImmutableParent","endImmutableParent","serialized","restorePoint","formatter","lockRange","releaseRange","point","createDialog","_actionButtonsTemplate","ref","insertButtonIcon","cancelButtonIcon","renderButton","themeColor","endRestorePoint","ViewHtmlCommand","cmd","dialog","_footerTemplate","_footerMessages","center","FormatCommand","FormatTool","getKendoToolBar","getKendoToggleButton","MOUSEDOWN_NS","InlineFormatFinder","numberOfSiblings","referenceNode","textNodesCount","elementNodesCount","markerCount","findSuitable","sourceNode","findFormat","InlineFormatter","activate","formatNode","formatNodes","consolidate","outerMostInline","pop","GreedyInlineFormatFinder","greedyProperty","fontAttr","getInlineCssValue","attributeValue","pair","cssIndex","propertyAndValue","getFormatInner","parentsUntil","addBack","toArray","GreedyInlineFormatter","toCamelCase","action","InlineFormatTool","DelayedExecutionTool","FontTool","cssAttr","domAttr","widget","setDataSource","sender","newRange","ENTER","_widget","getKendoColorPicker","storedRange","_inputFocused","_popup","unselectable","_value","toCssRgba","fontWeight","togglable","fontStyle","overflow","toolIcon","commandOn","closeOnSelect","dataValueField","dataTextField","valuePrimitive","HTTP_PROTOCOL","protocolRegExp","endLinkCharsRegExp","LinkFormatFinder","LinkFormatter","markers","a","UnlinkCommand","LinkCommand","url","_initialText","img","minWidth","_close","_form","_createForm","_apply","_keydown","linkUrl","_dialog","formElement","form","kendoForm","renderButtons","field","label","editorOptions","after","ESC","textInput","anchor","AutoLinkCommand","detectedLink","detectLink","linkMarker","linkRange","_ensureWebProtocol","startNode","traverser","LeftDomTextTraverser","cancelAtNode","DomTextLinkDetection","_hasProtocolPrefix","_prefixWithWebProtocol","UnlinkTool","isLink","DomPos","_detectEnd","blank","clone","_detectStart","_isLinkDetected","puntuationOptions","extendOptions","RightDomTextTraverser","_skipStartPuntuation","lastIndexOfRegExp","ii","r","str","DomTextTraverser","cancel","_traverse","edgeNode","subText","splitIndex","SPACEBAR","BlockFormatFinder","candidate","suitable","f","_resolveListsItems","until","ImmutablesNS","BlockFormatter","ancestor","_handleImmutables","images","imageAttributes","nonImages","applyFormatting","immutableFormat","namedFormat","GreedyBlockFormatter","formatTag","ListFormatter","blockFormatter","BlockFormatTool","listElements","textAlign","float","display","marginLeft","marginRight","listStylePosition","ListFormatFinder","altAttr","matchesType","isList","unwrapTag","li","isImmutable","containsAny","_parentLists","merge","breakable","findSuitableNode","applyOnSection","section","pushAncestor","listStyleType","lastSection","lastNodes","sections","addLastSection","ul","fragment","ListCommand","ListTool","FormattingTool","toFormattingItem","dot","context","decorate","optionLabel","dataItem","toJSON","dataBound","getFormattingValue","n","selectBox","_ancestor","operator","CleanFormatCommand","tagsToClean","clean","listFormatter","unwrapListItem","highlightFirst","autoWidth","KEDITORIMAGEURL","KEDITORIMAGETITLE","KEDITORIMAGEWIDTH","KEDITORIMAGEHEIGHT","ImageCommand","removeIEAttributes","onload","onerror","applied","isIE","showBrowser","ImageBrowser","transport","read","_imageBrowser","ev","selected","dialogHeight","loadingOverlay","ImportCommand","_initializeUploadWidget","importOptions","upload","kendoUpload","success","_onUploadSuccess","_onUploadProgress","_onUploadSelect","error","_onUploadError","complete","_onUploadComplete","showFileList","multiple","saveUrl","autoUpload","saveField","validation","allowedExtensions","maxFileSize","getKendoUpload","_trigger","clearAllFiles","_removeLoadingOverlay","response","files","validationErrors","_initLoadingOverlay","eventType","uploadEvent","_iframeWrapper","_container","postProcess","genericCommand","initialValue","autoSize","ExportAsCommand","exportType","postToProxy","generateForm","submit","exportAsOptions","method","valueInput","exportTypeInput","fileNameInput","antiForgeryInput","csrf_param","ExportAsTool","changeHandler","_exec","itemTemplate","valueTemplate","iconClass","indentDirection","IndentFormatter","parentList","targets","mapImmutables","siblingList","nestedList","getListTypeAttr","targetIndex","styleType","targetNode","listParent","siblings","nextAll","IndentCommand","indentFormatter","OutdentCommand","OutdentTool","isOutdentable","listParentsCount","suitableNodes","ParagraphCommand","_insertMarker","_moveFocus","focusNode","shouldTrim","startInBlock","endInBlock","_blankAfter","paragraph","heading","tableNode","rng","emptyParagraphContent","parentChildrenLength","_insertParagraphAfter","NewLineCommand","filler","kbrParent","oldIE","KEDITORFILEURL","KEDITORFILETEXT","KEDITORFILETITLE","FileCommand","file","FileBrowser","_fileBrowser","ACTIVESTATE","SELECTEDSTATE","SCOPE","ROW","COL","ROWGROUP","COLGROUP","COLSPAN","ROWSPAN","TABLE","THEAD","TBODY","TR","TD","TH","getTouches","columnTemplate","tableFormatFinder","TableCommand","skipCleaners","_tableHtml","columnHtml","rowHeight","insertedTable","PopupTool","btn","popupTemplate","kendoPopup","copyAnchorStyles","_open","_activate","_toggle","_editor","TableWizardTool","TableWizardCommand","insertNewTable","kendoButton","_setTableSize","InsertTableTool","cols","cellWidth","cellHeight","firstCell","eq","lastCell","getOffset","tableFromLocation","floor","clientY","clientX","scrollLeft","offsetWidth","autoApplyNS","_valid","status","initiallyVisible","button","selectedRows","selectedColumns","changed","tableSize","stopImmediatePropagation","TableModificationCommand","_clearColIndexAttr","_findRowSpanCell","_resetElementResizing","_findNextTdInRow","td","lastTd","_adjustColgroups","colgroup","colElements","colgroupElements","numberOfCells","_associateHeaderIds","InsertRowCommand","cellCount","newRow","createdCell","_appendCell","newCell","InsertColumnCommand","columnIndex","_processForColSpan","_resizeCells","selectedCell","colSpanEffect","parsedWidth","unit","calculatedWidth","parseFloat","DeleteRowCommand","focusElement","rowParent","_focusElement","_handleRowSpanCells","adjacentCell","nextRow","firstRow","before","_reduceRowSpan","rowSpanValue","DeleteColumnCommand","columnCount","_handleColSpanCells","_reduceColSpan","colSpanValue","MergeCellsHorizontallyCommand","nextTd","_getColspan","MergeCellsVerticallyCommand","tr","targetRow","bottomTd","_getRowspan","SplitCellCommand","emptyTd","_splitCellHorizontally","_splitCellVertically","_getRowspanValue","_getColspanValue","tdToAdd","colSpanResult","rowSpanResult","TableModificationTool","commandsMap","insert","delete","column","TableFormatCommand","_showResizeHandles","TableFormatTool","isTable","align","cleaners","ScriptCleaner","TabCleaner","MSWordFormatCleaner","WebkitFormatCleaner","HtmlTagsCleaner","HtmlAttrCleaner","HtmlContentCleaner","CustomCleaner","htmlToFragment","_startModification","_inProgress","_endModification","modificationInfo","_contentModification","_removeBomNodes","_onBeforeCopy","oncopy","oncut","_fileToDataURL","blob","deferred","reader","FileReader","File","getAsFile","readAsDataURL","_triggerPaste","_handleImagePaste","clipboardData","originalEvent","_insertImages","when","results","onpaste","clipboardNode","_decoreateClipboardNode","webkit","_moveToCaretPosition","clipboardRange","containers","ondragover","ondrop","dataTransfer","margin","padding","fontVariant","lineSpacing","lineHeight","nodeOffset","caretOffset","_caretOffset","translate","transform","rangeChanged","isStartTextNode","prevLength","bomNode","splittableParent","applicable","splittable","fragmentsHtml","elm","rangeEnd","focusedTable","siblingNodes","lastSiblingIndex","lastSibling","Cleaner","replacements","customReplacements","junkReplacements","convertFontMatch","$0","$1","closing","family","stripEmptyAnchors","listType","listData","startingSymbol","matchSymbol","symbol","isNumber","trimStartText","_guessUnorderedListStyle","_guessOrderedListStyle","_convertToLi","_checkForBullet","_getHtmlNoBullet","extractListLevels","level","_createList","rootMargin","rootIndex","lastRootLi","isLastRootLi","rootList","blockChildren","lastMargin","levels","acceptedNameTags","listIndex","levelType","removeAttributes","significantStyles","addSignificantStyles","isSignificantCss","removeAttributeNode","createColGroup","convertHeaders","boldedCells","removeParagraphs","paragraphs","removeTextNodes","trs","currentNode","tables","longestRow","titles","removeFormatting","filters","DomCleaner","cleanDom","collectTags","collectAttr","TextContainer","HtmlTextLines","separators","line","lines","inlineBlockText","resetLine","appendText","textContainer","appendInlineBlockText","flashInlineBlockText","endLine","il","il1","jl","jl1","DomEnumerator","preventDown","hasText","enumerator","buildText","getDefaultSeparators","htmlLines","thead","tbody","cleaner","cellText","PREVIOUS_SIBLING","getSibling","tableCells","tableCellsWrappers","inTable","RemoveTableContent","cellsTypes","startCell","endCell","_removeContent","getNext","evt","Event","isDefaultPrevented","deleteSelection","startTyping","_removeBomSpan","textContent","_addCaret","_restoreCaret","_handleDelete","caretPlaceholder","_merge","_cleanBomBefore","_handleBackspace","startAtLi","liIndex","startAtNonFirstLi","rangeStartNode","previousNode","_handleSelection","parentElementOrNode","_surroundFullyContent","_surroundFullySelectedAnchor","toLocaleLowerCase","_join","startImmutable","endImmutable","_moveMarker","_root","dest","_mergeWithTextNode","appendedNode","_isCaret","systemCommandIsInProgress","createUndoCommand","isModifierKey","isSystem","_toSelectableImmutables","_selectEditorBody","isCharacter","String","fromCharCode","modifier","_getShortcutModifier","navigator","platform","toUpperCase","metaKey","found","matchKey","toolKey","onEndTyping","stopTyping","force","timeout","what","ExportPdfCommand","PrintCommand","CopyFormatCommand","blockStyles","collectStyles","rangeNodes","populateStyles","destination","styleValue","styleKey","attributeKey","styles","nodeStyles","ApplyFormatCommand","removeEmptyElementsFromRange","cleanInlineParents","applyBlockStyles","applyInlineStyles","emptyElements","blockParent","outerWrapper","previousNodes","nextNodes","prevWrapper","nextWrapper","listItems","currentStyle","createdNode","topNode","CopyFormatTool","ApplyFormatTool","math","REGEX_NUMBER_IN_PERCENTAGES","REGEX_NUMBER_IN_PIXELS","STRING","inPercentages","ResizingUtils","constrain","lowerBound","upperBound","getScrollBarWidth","scrollbar","calculatePercentageRatio","total","inPixels","toPercentages","toPixels","KEY_DOWN","MOUSE_LEAVE","MOUSE_UP","TableElementResizing","_attachEventHandlers","eventNamespace","rootElement","_destroyResizeHandle","rtl","handle","dataAttribute","detectElementBorderHovering","resizingInProgress","resizing","handleOptions","tableElement","resizeHandle","elementBorderHovered","showResizeHandle","_initResizeHandle","setResizeHandlePosition","setResizeHandleDimensions","setResizeHandleDataAttributes","_attachResizeHandleEventHandlers","_initResizable","_hideResizeMarker","markerClass","_destroyResizable","Resizable","onResizeStart","onResize","onResizeEnd","_disableKeyboard","setResizeHandleDragPosition","_enableKeyboard","_forceResizing","userEvents","ResizingFactory","resizingName","_destroyResizing","_initResizing","parentTable","resizingType","abs","RESIZE_HANDLE_CLASS","RESIZE_MARKER_CLASS","BODY","COLATTR","COMMA","handleWidth","borderOffset","mousePosition","tableInnerElement","tBodies","scrollTopOffset","scrollLeftOffset","columnWidthOffset","scrollBarWidth","columnOffsetLeft","innerElementOffsetTop","tableHead","tableBody","fullHeight","columnWidth","columnLeftOffset","adjacentColumnWidth","resizeHandleOffsetLeft","handleOffset","newWidth","initialAdjacentColumnWidth","initialColumnWidth","nextColumn","rtlModifier","initialDeltaX","_setTableComputedWidth","_setColumnsComputedWidth","_resizeColumn","_resizeTopAndBottomColumns","_resizeAdjacentColumns","innerElementWidth","currentColumnsWidths","topAndBottomColumns","innerTableElement","deltaWidth","adjacentColumns","_resizeAdjacentColumn","adjacentColumn","handleHeight","rowOffsetLeft","rowOffsetTop","topInnerTableElement","$row","tableTopOffset","resizeHandleOffsetTop","currentRowHeight","initialTableHeight","tableHeadHeight","tableBodyHeight","initialStyleHeight","newRowHeight","_setRowsHeightInPixels","_setTableHeight","_setRowsHeightInPercentages","currentRowsHeights","newHeight","Draggable","DRAG_START","DRAG","DRAG_END","HALF_INSIDE","MOUSE_OVER","MOUSE_OUT","EAST","NORTH","NORTHEAST","NORTHWEST","SOUTH","SOUTHEAST","SOUTHWEST","WEST","ElementResizeHandle","_addStyles","_initDraggable","_initPositioningStrategy","_initDraggingStrategy","resizableElement","_destroyDraggable","_setPosition","_positioningStrategy","getPosition","_onMouseOver","_onMouseOut","HandlePositioningStrategy","_draggable","dragstart","_onDragStart","drag","_onDrag","_onDragEnd","_draggingStrategy","adjustDragDelta","deltaX","deltaY","initialDeltaY","HandleDraggingStrategy","StrategyFactory","_items","register","itemsLength","PositioningStrategyFactory","calculatePosition","handleOffsetPosition","applyHandleOffset","applyScrollOffset","rootLeft","EastPositioningStrategy","NorthPositioningStrategy","NortheastPositioningStrategy","NorthwestPositioningStrategy","SouthPositioningStrategy","SoutheastPositioningStrategy","SouthwestPositioningStrategy","WestPositioningStrategy","DraggingStrategyFactory","adjustment","deltas","xAxisAdjustment","yAxisAdjustment","HorizontalDraggingStrategy","EastDraggingStrategy","WestDraggingStrategy","VerticalDraggingStrategy","NorthDraggingStrategy","SouthDraggingStrategy","HorizontalAndVerticalDraggingStrategy","NorthEastDraggingStrategy","NorthWestDraggingStrategy","SouthEastDraggingStrategy","SouthWestDraggingStrategy","RESIZE_HANDLE_WRAPPER_CLASS","ELEMENT_RESIZING_CLASS","MOUSE_DOWN","ELEMENT_TYPES","WIDTH","HEIGHT","isUndefined","ElementResizing","handles","_destroyResizeHandles","appendHandlesTo","_resizeWidth","_resizeHeight","_getMaxDimensionValue","dimension","dimensionLowercase","parentDimension","parentScrollOffset","_initResizeHandles","_bindToResizeHandlesEvents","_onResizeHandleDragStart","_initialElementHeight","_initialElementWidth","_onResizeHandleDrag","_onResizeHandleDragEnd","TableResizing","_hasRowsInPixels","ratioValue","ratioTotalValue","constrainedWidth","styleWidth","currentWidth","parentWidth","maxWidth","_setColumnsWidth","constrainedHeight","styleHeight","currentHeight","parentHeight","maxHeight","hasRowsInPixels","parentColumn","columnsLength","isWidthInPercentages","ImageResizing","_onResizeHandleDragVertical","_onResizeHandleDragHorizontal","_onResizeHandleDragLocked","_getDeltas","initialWidth","initialHeight","MAX_SAFE_INTEGER","hasImg","eventTarget","eventCurrentTarget","isResizeHandleOrChild","tableResizing","cellsFormatFinder","reUnit","COL_INDEX","isTableCellWizard","tableCellWizard","selectedTable","_sourceTable","_selectedTable","selectedCells","_selectedTableCells","_selectedCells","closeCallback","onDialogClose","parseTable","TableWizardDialog","insertTable","createNewTable","updateTable","_ensureFocusableAfterTable","lastSelectedRow","cellProp","tableProp","_lastInCollection","_deleteTableRows","_addRows","_updateColumns","_updateTableProperties","cellProperties","_updateCellProperties","_updateCaption","_updateHeadersWithThead","_updateHeadersNoThead","_updateHeaderAssociates","_isHeadingRow","_isHeadingCell","cellsWithHeadersAssociated","headingIds","checkHeader","header","headersArray","headersAttr","some","_insertCells","insertCell","createTHead","_createTableRows","createTBody","cellsWithHeaders","_addScopes","initialIndex","insertRow","cellsLength","newRowsCount","firstRowLastCell","numberOfColumns","lastCurrentCell","rowColumns","deleteCell","_getStylesData","captionContent","deleteCaption","createCaption","_getAlignmentData","verticalAlign","_swapToHeaderCells","deleteTHead","_removeScopes","_removeAssociates","headerCols","whiteSpace","widthUnit","heightUnit","backgroundColor","bgColor","borderCollapse","_getTablePositionData","tStyle","captionClone","tableAlignment","_getAlignment","tablePosition","_getTablePosition","numberOfHeaderColumns","tableJson","_getUnit","parseTableRows","rowData","cellData","parseCell","cStyle","horizontalOnly","hAlign","vAlign","collection","TableWizardEditTool","TableCellWizardEditTool","numericTextBoxSettings","borderStyles","textWrapDropDownSettings","tablePositionDropDownSettings","tableAlignmentDropDownSettings","cellAlignmentDropDownSettings","accessibilityAlignmentDropDownSettings","tablePropertiesDialogTemplate","cellPropertiesDialogTemplate","_openTablePropertiesDialog","tableData","closeHandler","_dialogTemplate","collectTableDialogValues","components","_initTabStripComponent","_tablePropertiesForm","_createTablePropertiesForm","_accessibilityPropertiesForm","_createAccessibilityPropertiesForm","_openCellPropertiesDialog","collectCellDialogValues","_cellPropertiesForm","_createCellPropertiesForm","isCellProperties","tabStrip","kendoTabStrip","_collectTableViewValues","_collectAccessibilityViewValues","_collectCellViewValues","tableView","check","cellView","wrapTextValue","accessibilityView","_addUnit","_initNumericTextbox","storage","settings","kendoNumericTextBox","_initDropDownList","kendoDropDownList","_setComponentValue","_initBorderStyleDropDown","_initTablePositionDropDown","_initPositionDropDown","_initTableAlignmentDropDown","_initAlignmentDropDown","_initCellAlignmentDropDown","_initAccessibilityAlignmentDropDown","_initTextWrapDropDown","_initAssociationDropDown","_initColorPicker","kendoColorPicker","clearButton","_initInput","kendoTextBox","_initCheckbox","kendoCheckBox","_initTextArea","kendoTextArea","_destroyComponents","dialogTemplate","_onColumnsNumberChange","headerColumnsNumeric","currentNumberOfColumnsHeaders","_onRowsNumberChange","headerRowsNumeric","currentNumberOfRowHeaders","numberOfRows","layout","grid","layoutWrapper","hint","optional","gutter"],"sources":["kendo.editor.js"],"mappings":"CAAA,SAAWA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBA,OAAOD,QAAUD,EAAQG,QAAQ,qBAAsBA,QAAQ,yBAA0BA,QAAQ,sBAAuBA,QAAQ,mBAAoBA,QAAQ,wBAAyBA,QAAQ,yBAA0BA,QAAQ,2BAA4BA,QAAQ,qBAAsBA,QAAQ,iBAAkBA,QAAQ,oBAAqBA,QAAQ,kBAAmBA,QAAQ,iBAAkBA,QAAQ,wBAAyBA,QAAQ,wBAAyBA,QAAQ,wBAAyBA,QAAQ,sBAC7hB,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,CAAC,qBAAsB,yBAA0B,sBAAuB,mBAAoB,wBAAyB,yBAA0B,2BAA4B,qBAAsB,iBAAkB,oBAAqB,kBAAmB,iBAAkB,wBAAyB,wBAAyB,wBAAyB,sBAAuBJ,KAClaD,EAA+B,oBAAfO,WAA6BA,WAAaP,GAAUQ,MAAcC,YAAcT,EAAOS,aAAe,GAAIT,EAAOS,YAAYC,GAAKT,KAHvJ,CAIGU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ypE,EACA,CACI7mD,IAAK5iB,EAAgByJ,SA5gCnB,MA+gCZ,CACE+pB,QAAS,EACTqX,MAAO,yBACPC,MAAOz9B,EAAO3I,EAASiE,2BACvB9F,OAAQ,SAASuN,EAAWlV,GACxB,IAAIsH,EAAUpI,EAAG,kGAAyGsK,EAAsB,cAAI,wEAA6EA,EAAuB,eAAI,sEAA2EA,EAAqB,aAAI,wDAAyDmR,SAASzF,GAElaxN,EAAK8nE,yBAAyBloE,EAAS,mBAAoB,CAAE4mC,gBAAgB,GAAQppC,EAAiBypE,KAE5G,CACEj2C,QAAS,OACTqX,MAAO,iCACPC,MAAO,CACH3+B,KAAMkB,EAAO3I,EAAS+C,SACtBwkE,UAAU,GAEdppE,OAAQ,SAASuN,EAAWlV,GACxB0H,EAAKsoE,cAAc9wE,EAAE,6DAA6Dyb,SAASzF,GAAY,UAAWpQ,EAAiBypE,EAAmB,CAClJ//D,KAAM,EACNa,YAAa7F,EAASwF,iCAO/CuK,KAAK,cAEHs3D,cAAcl5D,SAAS,aAErB63B,KAIf5vC,EAAM0B,GAAGqG,OAAOw/D,kBAAoBA,EAzjCpC,CA2jCGhmE,OAAOvB,MAAM+rB,QAgChB,OAFc/rB","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('kendo.combobox.js'), require('kendo.dropdownlist.js'), require('kendo.resizable.js'), require('kendo.window.js'), require('kendo.colorpicker.js'), require('kendo.imagebrowser.js'), require('kendo.numerictextbox.js'), require('kendo.textarea.js'), require('kendo.core.js'), require('kendo.toolbar.js'), require('kendo.icons.js'), require('kendo.form.js'), require('kendo.filebrowser.js'), require('kendo.draganddrop.js'), require('kendo.html.button.js'), require('kendo.tabstrip.js')) :\n typeof define === 'function' && define.amd ? define(['kendo.combobox', 'kendo.dropdownlist', 'kendo.resizable', 'kendo.window', 'kendo.colorpicker', 'kendo.imagebrowser', 'kendo.numerictextbox', 'kendo.textarea', 'kendo.core', 'kendo.toolbar', 'kendo.icons', 'kendo.form', 'kendo.filebrowser', 'kendo.draganddrop', 'kendo.html.button', 'kendo.tabstrip'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.kendoeditor = global.kendoeditor || {}, global.kendoeditor.js = factory()));\n})(this, (function () {\n (function(kendo) {\n var UndoRedoStack = kendo.Observable.extend({\n init: function(options) {\n kendo.Observable.fn.init.call(this, options);\n this.clear();\n },\n events: [ \"undo\", \"redo\" ],\n push: function (command) {\n this.stack = this.stack.slice(0, this.currentCommandIndex + 1);\n this.currentCommandIndex = this.stack.push(command) - 1;\n },\n undo: function () {\n if (this.canUndo()) {\n var command = this.stack[this.currentCommandIndex--];\n command.undo();\n this.trigger(\"undo\", { command: command });\n }\n },\n redo: function () {\n if (this.canRedo()) {\n var command = this.stack[++this.currentCommandIndex];\n command.redo();\n this.trigger(\"redo\", { command: command });\n }\n },\n clear: function() {\n this.stack = [];\n this.currentCommandIndex = -1;\n },\n canUndo: function () {\n return this.currentCommandIndex >= 0;\n },\n canRedo: function () {\n return this.currentCommandIndex != this.stack.length - 1;\n }\n });\n\n kendo.deepExtend(kendo, {\n util: {\n UndoRedoStack: UndoRedoStack\n }\n });\n })(kendo);\n\n (function($,undefined$1) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n Widget = kendo.ui.Widget,\n os = kendo.support.mobileOS,\n browser = kendo.support.browser,\n extend = $.extend,\n deepExtend = kendo.deepExtend,\n keys = kendo.keys,\n outerWidth = kendo._outerWidth,\n outerHeight = kendo._outerHeight,\n NS = \".kendoEditor\";\n\n var SELECT = \"select\";\n var SELECT_OVERLAY_SELECTOR = \"select.k-select-overlay\";\n var PLACEHOLDER_CLASS = \"k-placeholder\";\n var PLACEHOLDER_TAG_ID = \"placeholder\";\n var REFRESH_INTERVAL = 200;\n var DEFAULT_LANGUAGE = \"en\";\n\n var NATIVE_TOOLS = [\n \"insertLineBreak\",\n \"insertParagraph\",\n \"redo\",\n \"undo\",\n \"autoLink\"\n ];\n\n var EditorUtils = {\n editorWrapperTemplate: function () { return '
' +\n '
' +\n '
' +\n '
'; },\n\n formatByName: function(name, format) {\n for (var i = 0; i < format.length; i++) {\n if ($.inArray(name, format[i].tags) >= 0) {\n return format[i];\n }\n }\n },\n\n getToolCssClass: function(name, icon) {\n var toolCssClassNames = {\n superscript: \"supscript\",\n subscript: \"subscript\",\n justifyLeft: \"align-left\",\n justifyCenter: \"align-center\",\n justifyRight: \"align-right\",\n justifyFull: \"align-justify\",\n insertUnorderedList: \"list-unordered\",\n insertOrderedList: \"list-ordered\",\n insertUpperRomanList: \"list-roman-upper\",\n insertLowerRomanList: \"list-roman-lower\",\n \"import\": \"import\",\n indent: \"indent\",\n outdent: \"outdent\",\n createLink: \"link\",\n unlink: \"unlink\",\n insertImage: \"image\",\n insertFile: \"file-add\",\n viewHtml: \"code\",\n foreColor: \"foreground-color\",\n backColor: \"droplet\",\n createTable: \"table-add\",\n addColumnLeft: \"table-column-insert-left\",\n addColumnRight: \"table-column-insert-right\",\n addRowAbove: \"table-row-insert-above\",\n addRowBelow: \"table-row-insert-below\",\n deleteRow: \"table-row-delete\",\n deleteColumn: \"table-column-delete\",\n mergeCellsHorizontally: \"cells-merge-horizontally\",\n mergeCellsVertically: \"cells-merge-vertically\",\n splitCellHorizontally: \"cell-split-horizontally\",\n splitCellVertically: \"cell-split-vertically\",\n tableProperties: \"table-properties\",\n tableCellProperties: \"table-cell-properties\",\n tableWizardInsert: \"table-wizard\",\n tableAlignLeft: \"table-position-start\",\n tableAlignCenter: \"table-position-center\",\n tableAlignRight: \"table-position-end\",\n cleanFormatting: \"clear-css\",\n copyFormat: \"copy-format\",\n applyFormat: \"apply-format\"\n };\n\n var cssClass = toolCssClassNames[name];\n\n if (cssClass) {\n return cssClass;\n }\n\n if (icon) {\n return icon;\n }\n\n return EditorUtils.nameToKebab(name);\n },\n\n nameToKebab: function(name) {\n return name.replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n },\n\n registerTool: function(toolName, tool) {\n if (!tool.name) {\n tool.options.name = toolName;\n tool.name = toolName.toLowerCase();\n }\n\n if (!tool.options.ui) {\n tool.options.ui = {};\n }\n\n tool.options.ui.command = toolName;\n\n Editor.defaultTools[toolName] = tool;\n },\n\n registerFormat: function(formatName, format) {\n Editor.fn.options.formats[formatName] = format;\n },\n\n cacheComments: function(content, comments) {\n for (var index in comments) {\n content = content.replace(comments[index], \"{\" + index + \"}\");\n }\n return content;\n },\n\n retrieveComments: function(content, comments) {\n for (var index in comments) {\n content = content.replace(\"{\" + index + \"}\", comments[index]);\n }\n return content;\n }\n };\n\n var messages = {\n auto: \"Auto\",\n bold: \"Bold\",\n italic: \"Italic\",\n underline: \"Underline\",\n strikethrough: \"Strikethrough\",\n superscript: \"Superscript\",\n subscript: \"Subscript\",\n fitToCell: \"Fit to cell\",\n justifyCenter: \"Center text\",\n justifyLeft: \"Align text left\",\n justifyRight: \"Align text right\",\n justifyFull: \"Justify\",\n insertUnorderedList: \"Insert unordered list\",\n insertOrderedList: \"Insert ordered list\",\n indent: \"Indent\",\n outdent: \"Outdent\",\n createLink: \"Insert hyperlink\",\n unlink: \"Remove hyperlink\",\n insertImage: \"Insert image\",\n insertFile: \"Insert file\",\n insertHtml: \"Insert HTML\",\n viewHtml: \"View HTML\",\n fontName: \"Select font family\",\n fontNameInherit: \"(inherited font)\",\n fontSize: \"Select font size\",\n fontSizeInherit: \"(inherited size)\",\n formatBlock: \"Format\",\n formatting: \"Format\",\n foreColor: \"Color\",\n backColor: \"Background color\",\n style: \"Styles\",\n emptyFolder: \"Empty Folder\",\n editAreaTitle: \"Editable area. Press F10 for toolbar.\",\n uploadFile: \"Upload\",\n overflowAnchor: \"More tools\",\n orderBy: \"Arrange by:\",\n orderBySize: \"Size\",\n orderByName: \"Name\",\n invalidFileType: \"The selected file \\\"{0}\\\" is not valid. Supported file types are {1}.\",\n deleteFile: 'Are you sure you want to delete \"{0}\"?',\n overwriteFile: 'A file with name \"{0}\" already exists in the current directory. Do you want to overwrite it?',\n directoryNotFound: \"A directory with this name was not found.\",\n imageWebAddress: \"Web address\",\n imageAltText: \"Alternate text\",\n imageWidth: \"Width (px)\",\n imageHeight: \"Height (px)\",\n fileWebAddress: \"Web address\",\n fileTitle: \"Title\",\n fileText: \"Text\",\n linkWebAddress: \"Web address\",\n linkText: \"Text\",\n linkToolTip: \"ToolTip\",\n linkOpenInNewWindow: \"Open link in new window\",\n dialogUpdate: \"Update\",\n dialogInsert: \"Insert\",\n dialogOk: \"Confirm\",\n dialogCancel: \"Cancel\",\n cleanFormatting: \"Clean formatting\",\n createTable: \"Create a table\",\n createTableHint: \"Create a {0} x {1} table\",\n addColumnLeft: \"Add column on the left\",\n addColumnRight: \"Add column on the right\",\n addRowAbove: \"Add row above\",\n addRowBelow: \"Add row below\",\n deleteRow: \"Delete row\",\n deleteColumn: \"Delete column\",\n mergeCellsHorizontally: \"Merge cells horizontally\",\n mergeCellsVertically: \"Merge cells vertically\",\n splitCellHorizontally: \"Split cells horizontally\",\n splitCellVertically: \"Split cells vertically\",\n tableAlignLeft: \"Table Align Left\",\n tableAlignCenter: \"Table Align Center\",\n tableAlignRight: \"Table Align Right\",\n tableWizard: \"Table Wizard\",\n tableProperties: \"Table Properties\",\n tableCellProperties: \"Cell Properties\",\n tableTab: \"General\",\n cellTab: \"Cell\",\n accessibilityTab: \"Advanced\",\n caption: \"Caption\",\n summary: \"Summary\",\n width: \"Width\",\n height: \"Height\",\n units: \"Units\",\n cellSpacing: \"Cell Spacing\",\n cellPadding: \"Cell Padding\",\n cellMargin: \"Cell Margin\",\n alignment: \"Alignment\",\n captionAlignment: \"Caption alignment\",\n position: \"Position\",\n background: \"Background\",\n tableBackground: \"Table background\",\n cssClass: \"CSS Class\",\n id: \"ID\",\n border: \"Border\",\n borderStyle: \"Border Style\",\n borderWidth: \"Border Width\",\n borderColor: \"Border Color\",\n collapseBorders: \"Collapse borders\",\n wrapText: \"Wrap text\",\n associateCellsWithHeaders: \"Associate headers\",\n alignLeft: \"Align Left\",\n alignCenter: \"Align Center\",\n alignRight: \"Align Right\",\n alignLeftTop: \"Align Left Top\",\n alignCenterTop: \"Align Center Top\",\n alignRightTop: \"Align Right Top\",\n alignLeftMiddle: \"Align Left Middle\",\n alignCenterMiddle: \"Align Center Middle\",\n alignRightMiddle: \"Align Right Middle\",\n alignLeftBottom: \"Align Left Bottom\",\n alignCenterBottom: \"Align Center Bottom\",\n alignRightBottom: \"Align Right Bottom\",\n alignRemove: \"Remove Alignment\",\n columns: \"Columns\",\n rows: \"Rows\",\n selectAllCells: \"Apply to all cells\",\n applyToColumn: \"apply to column\",\n applyToRow: \"apply to row\",\n exportAs: \"Export As\",\n \"import\": \"Import\",\n print: \"Print\",\n headerRows: \"Header Rows\",\n headerColumns: \"Header Cols\",\n tableSummaryPlaceholder: \"Summary attribute is not HTML5 compatible.\",\n associateNone: \"None\",\n associateScope: \"Associate using 'scope' attribute\",\n associateIds: \"Associate using Ids\",\n copyFormat: \"Copy format\",\n applyFormat: \"Apply format\",\n borderNone: \"None\",\n undo: \"Undo\",\n redo: \"Redo\"\n };\n\n var supportedContentEditable = typeof(document.documentElement.contentEditable) != 'undefined';\n\n var toolGroups = {\n basic: [\"bold\", \"italic\", \"underline\", \"strikethrough\"],\n undo: [\"undo\", \"redo\"],\n scripts: [\"subscript\", \"superscript\" ],\n alignment: [\"justifyLeft\", \"justifyCenter\", \"justifyRight\", \"justifyFull\" ],\n links: [\"insertImage\", \"insertFile\", \"createLink\", \"unlink\"],\n lists: [\"insertUnorderedList\", \"insertOrderedList\", \"insertUpperRomanList\", \"insertLowerRomanList\" ],\n dent: [\"indent\", \"outdent\"],\n tablesWizard: [\"tableProperties\", \"tableCellProperties\"],\n tablesInsert: [\"createTable\"],\n tablesAddDelete: [ \"addColumnLeft\", \"addColumnRight\", \"addRowAbove\", \"addRowBelow\", \"deleteRow\", \"deleteColumn\" ],\n tablesMerge: [ \"mergeCellsHorizontally\", \"mergeCellsVertically\", \"splitCellHorizontally\", \"splitCellVertically\" ],\n tablesPosition: [ \"tableAlignLeft\", \"tableAlignCenter\", \"tableAlignRight\" ],\n formatPainter: [ \"copyFormat\", \"applyFormat\" ]\n };\n\n var Editor = Widget.extend({\n init: function(element, options) {\n var that = this,\n editorNS = kendo.ui.editor,\n dom = editorNS.Dom,\n toolbarContainer,\n type, domElement;\n\n /* suppress initialization in devices w/o proper contenteditable support */\n if (!supportedContentEditable) {\n return;\n }\n\n Widget.fn.init.call(that, element, options);\n\n that.options = deepExtend({}, that.options, options);\n\n element = that.element;\n domElement = element[0];\n type = dom.name(domElement);\n\n this._registerHandler(\n element.closest(\"form\"), \"submit\", that.update.bind(that, undefined$1)\n );\n\n toolbarContainer = that._setupType(element);\n\n that._initToolbar(toolbarContainer);\n that._setupHeight(type);\n that._resizable();\n that._initializeContentElement(that);\n that._setupKeyboard();\n\n that.clipboard = new editorNS.Clipboard(this);\n that.undoRedoStack = new kendo.util.UndoRedoStack();\n\n that._populateValue(options, domElement);\n\n that._registerHandler(document, {\n \"mousedown\": function() { that._endTyping(); },\n \"mouseup\": function(e) { that._mouseup(e); }\n });\n\n that._initializeImmutables();\n\n if (type == \"textarea\") {\n that._ariaLabel(that.wrapper.find(\"iframe\"));\n }\n\n that.toolbar.resize();\n\n kendo.notify(that);\n },\n\n events: [\n \"select\",\n \"change\",\n \"execute\",\n \"error\",\n \"paste\",\n \"keydown\",\n \"keyup\"\n ],\n\n options: {\n name: \"Editor\",\n messages: messages,\n placeholder: \"\",\n formats: {},\n encoded: true,\n domain: null,\n resizable: false,\n deserialization: {\n custom: null\n },\n serialization: {\n entities: true,\n semantic: true,\n scripts: false,\n optimizeTags: false,\n keepEOL: false\n },\n pasteCleanup: {\n all: false,\n css: false,\n custom: null,\n keepNewLines: false,\n msAllFormatting: false,\n msConvertLists: true,\n msTags: true,\n none: false,\n span: false\n },\n stylesheets: [],\n dialogOptions: {\n modal: true, resizable: false, draggable: true,\n animation: false\n },\n imageBrowser: null,\n fileBrowser: null,\n navigateOnTab: false,\n fontName: [\n { text: \"Arial\", value: \"Arial, Helvetica, sans-serif\" },\n { text: \"Courier New\", value: \"\\\"Courier New\\\", Courier, monospace\" },\n { text: \"Georgia\", value: \"Georgia, serif\" },\n { text: \"Impact\", value: \"Impact, Charcoal, sans-serif\" },\n { text: \"Lucida Console\", value: \"\\\"Lucida Console\\\", Monaco, monospace\" },\n { text: \"Tahoma\", value: \"Tahoma, Geneva, sans-serif\" },\n { text: \"Times New Roman\", value: \"\\\"Times New Roman\\\", Times, serif\" },\n { text: \"Trebuchet MS\", value: \"\\\"Trebuchet MS\\\", Helvetica, sans-serif\" },\n { text: \"Verdana\", value: \"Verdana, Geneva, sans-serif\" }\n ],\n fontSize: [\n { text: \"1 (8pt)\", value: \"xx-small\" },\n { text: \"2 (10pt)\", value: \"x-small\" },\n { text: \"3 (12pt)\", value: \"small\" },\n { text: \"4 (14pt)\", value: \"medium\" },\n { text: \"5 (18pt)\", value: \"large\" },\n { text: \"6 (24pt)\", value: \"x-large\" },\n { text: \"7 (36pt)\", value: \"xx-large\" }\n ],\n formatBlock: [\n { text: \"Paragraph\", value: \"p\" },\n { text: \"Quotation\", value: \"blockquote\" },\n { text: \"Heading 1\", value: \"h1\" },\n { text: \"Heading 2\", value: \"h2\" },\n { text: \"Heading 3\", value: \"h3\" },\n { text: \"Heading 4\", value: \"h4\" },\n { text: \"Heading 5\", value: \"h5\" },\n { text: \"Heading 6\", value: \"h6\" }\n ],\n tools: [\n \"formatting\",\n \"bold\",\n \"italic\",\n \"underline\",\n \"undo\",\n \"redo\",\n \"justifyLeft\",\n \"justifyCenter\",\n \"justifyRight\",\n \"copyFormat\",\n \"applyFormat\",\n \"insertUnorderedList\",\n \"insertOrderedList\",\n \"indent\",\n \"outdent\",\n \"createLink\",\n \"unlink\",\n \"insertImage\",\n \"tableProperties\",\n \"tableCellProperties\",\n \"createTable\",\n \"addRowAbove\",\n \"addRowBelow\",\n \"addColumnLeft\",\n \"addColumnRight\",\n \"deleteRow\",\n \"deleteColumn\",\n \"mergeCellsHorizontally\",\n \"mergeCellsVertically\",\n \"splitCellHorizontally\",\n \"splitCellVertically\",\n \"tableAlignLeft\",\n \"tableAlignCenter\",\n \"tableAlignRight\"\n ]\n },\n\n destroy: function() {\n var editor = this;\n\n Widget.fn.destroy.call(this);\n\n this._endTyping(true);\n\n this._deregisterHandlers();\n\n clearTimeout(this._spellCorrectTimeout);\n\n this._focusOutside();\n\n this.toolbar.destroy();\n\n if (this.windowInstance) {\n this.windowInstance.destroy();\n }\n if (this.tablePopup) {\n this.tablePopup.destroy();\n }\n\n editor._destroyUploadWidget();\n\n editor._destroyResizings();\n\n kendo.destroy(this.wrapper);\n },\n\n setOptions: function(options) {\n var editor = this;\n\n Widget.fn.setOptions.call(editor, options);\n\n if (options.tools) {\n this._setOptionsTools(options.tools);\n }\n\n this._initializePlaceholder();\n },\n\n createRange: function(document) {\n return kendo.ui.editor.RangeUtils.createRange(document || this.document);\n },\n\n encodedValue: function() {\n return kendo.ui.editor.Dom.encode(this.value());\n },\n\n exec: function(name, params) {\n var that = this;\n var command = null;\n var defaultTools = kendo.ui.Editor.defaultTools;\n var range, tool, prevented;\n\n if (!name) {\n throw new Error(\"kendoEditor.exec(): `name` parameter cannot be empty\");\n }\n\n if (that.body.getAttribute(\"contenteditable\") !== \"true\" &&\n name !== \"print\" &&\n name !== \"pdf\" &&\n name !== \"exportAs\") {\n return false;\n }\n\n if (!that.keyboard.isTypingInProgress()) {\n that._focusBody();\n that.selectRange(that._range || that.getRange());\n }\n\n tool = that.tools[name] || defaultTools[name];\n\n if (!tool) {\n Object.keys(defaultTools).map(function (key) {\n if (key.toLowerCase() === name) {\n tool = defaultTools[key];\n }\n });\n }\n\n if (tool) {\n range = that.getRange();\n\n if (tool.command) {\n command = tool.command(extend({ range: range, body: that.body, immutables: !!that.immutables }, params));\n }\n\n prevented = that.trigger(\"execute\", { name: name, command: command });\n\n if (prevented) {\n return;\n }\n\n if (/^(undo|redo)$/i.test(name)) {\n that.undoRedoStack[name]();\n } else if (command) {\n that.execCommand(command);\n\n if (command.async) {\n command.change = that._selectionChange.bind(that);\n return;\n }\n }\n\n that._selectionChange();\n }\n },\n\n execCommand: function(command) {\n if (!command.managesUndoRedo) {\n this.undoRedoStack.push(command);\n }\n\n command.editor = this;\n command.exec();\n },\n\n focus: function() {\n this.restoreSelection();\n },\n\n getRange: function() {\n var selection = this.getSelection(),\n range = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : this.createRange(),\n doc = this.document;\n\n if (range.startContainer == doc && range.endContainer == doc && !range.startOffset && !range.endOffset) {\n range.setStart(this.body, 0);\n range.collapse(true);\n }\n\n return range;\n },\n\n getSelection: function() {\n return kendo.ui.editor.SelectionUtils.selectionFromDocument(this.document);\n },\n\n paste: function(html, options) {\n this.focus();\n\n var command = new kendo.ui.editor.InsertHtmlCommand($.extend({\n range: this.getRange(),\n html: html\n }, options));\n\n command.editor = this;\n\n command.exec();\n },\n\n refresh: function() {\n var that = this;\n\n if (that.textarea) {\n that._destroyResizings();\n // preserve updated value before re-initializing\n // don't use update() to prevent the editor from encoding the content too early\n var value = that.value();\n that.textarea.val(value);\n that.wrapper.find(\"iframe\").remove();\n that._initializeContentElement(that);\n that.value(value);\n }\n },\n\n restoreSelection: function() {\n this._focusBody();\n\n if (this.selectionRestorePoint) {\n this.selectRange(this.selectionRestorePoint.toRange());\n }\n },\n\n saveSelection: function(range) {\n range = range || this.getRange();\n var container = range.commonAncestorContainer,\n body = this.body;\n\n if (container == body || $.contains(body, container)) {\n this.selectionRestorePoint = new kendo.ui.editor.RestorePoint(range, body);\n }\n },\n\n selectedHtml: function() {\n return kendo.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents());\n },\n\n selectRange: function(range) {\n this._focusBody();\n var selection = this.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n this.saveSelection(range);\n },\n\n state: function(toolName) {\n var tool = kendo.ui.Editor.defaultTools[toolName];\n var finder = tool && (tool.options.finder || tool.finder);\n var RangeUtils = kendo.ui.editor.RangeUtils;\n var range, textNodes;\n\n if (finder) {\n range = this.getRange();\n\n textNodes = RangeUtils.textNodes(range);\n\n if (!textNodes.length && range.collapsed) {\n textNodes = [range.startContainer];\n }\n\n return finder.getFormat ? finder.getFormat(textNodes) : finder.isFormatted(textNodes);\n }\n\n return false;\n },\n\n update: function(value) {\n value = value || this.options.encoded ? this.encodedValue() : this.value();\n\n if (this.textarea) {\n this.textarea.val(value);\n this._togglePlaceholder(!value.trim());\n } else {\n this._oldValue = value;\n }\n },\n\n value: function(html) {\n var body = this.body,\n editorNS = kendo.ui.editor,\n options = this.options,\n currentHtml = editorNS.Serializer.domToXhtml(body, options.serialization);\n\n if (html === undefined$1) {\n return currentHtml;\n }\n\n if (html == currentHtml) {\n return;\n }\n\n editorNS.Serializer.htmlToDom(html, body, options.deserialization);\n\n this.selectionRestorePoint = null;\n this.update();\n this._refreshTools();\n },\n\n _bindTools: function() {\n var that = this,\n defaultTools = this.tools;\n\n that.unbind(\"select\", that.toolbar.resize.bind(that.toolbar));\n\n that.toolbar.element.find(\"[data-command]\")\n .filter(function (i, el) { return $(el).find(\"[data-command]\").length === 0; })\n .each(function (i, el) {\n var toolName = el.getAttribute(\"data-command\"),\n tool = defaultTools[toolName];\n\n if (tool && tool.initialize) {\n tool.initialize($(el), that);\n }\n });\n\n that.bind(\"select\", that.toolbar.resize.bind(that.toolbar));\n },\n\n _blur: function() {\n var textarea = this.textarea;\n var old = textarea ? textarea.val() : this._oldValue;\n var value = this.options.encoded ? this.encodedValue() : this.value();\n\n this.update();\n\n if (textarea) {\n textarea.trigger(\"blur\");\n }\n\n if (value != old) {\n this.trigger(\"change\");\n if (textarea) {\n textarea.trigger(\"change\");\n }\n }\n },\n\n _containsRange: function(range) {\n var dom = kendo.ui.editor.Dom;\n var body = this.body;\n return range && dom.isAncestorOrSelf(body, range.startContainer) &&\n dom.isAncestorOrSelf(body, range.endContainer);\n },\n\n _createContentElement: function(stylesheets) {\n var editor = this;\n var iframe, wnd, doc;\n var textarea = editor.textarea;\n var specifiedDomain = editor.options.domain;\n var domain = specifiedDomain || document.domain;\n var domainScript = \"\";\n var src = 'javascript:\"\"';\n var lang = \"\";\n\n textarea.hide();\n\n iframe = $(\"'); }\n },\n 'k:script': {\n start: function(node) { mapStart(node, \"script\"); },\n end: function() { result.push(''); },\n skipEncoding: true\n },\n span: {\n canOptimize: true,\n semantic: true,\n start: function(node) {\n var style = node.style;\n\n var attributes = specifiedAttributes(node);\n var semanticAttributes = semanticFilter(attributes);\n\n if (semanticAttributes.length) {\n result.push(\"\");\n }\n\n if (style.textDecoration == \"underline\") {\n result.push(\"\");\n }\n\n var font = [];\n if (style.color) {\n font.push('color=\"' + dom.toHex(style.color) + '\"');\n }\n\n if (style.fontFamily) {\n font.push('face=\"' + style.fontFamily + '\"');\n }\n\n if (style.fontSize) {\n var size = $.inArray(style.fontSize, fontSizeMappings);\n font.push('size=\"' + size + '\"');\n }\n\n // Apply the rest of the inline styles back\n var inlineStyles = [];\n var ignoredStylePrefixes = [\"text-decoration\", \"color\", \"font\"];\n\n for (var i = 0; i < style.length; i++) {\n var inlineStyle = style[i];\n\n if (ignoredStylePrefixes.filter(function (prop) { return inlineStyle.startsWith(prop); }).length <= 0) {\n inlineStyles.push((inlineStyle + \": \" + (style[inlineStyle])));\n }\n }\n\n if (inlineStyles.length) {\n font.push('style=\"' + inlineStyles.join(\";\") + '\"');\n }\n\n if (font.length) {\n result.push(\"\");\n }\n },\n end: function(node) {\n var style = node.style;\n\n if (style.color || style.fontFamily || style.fontSize) {\n result.push(\"\");\n }\n\n if (style.textDecoration == \"underline\") {\n result.push(\"\");\n }\n\n if (semanticFilter(specifiedAttributes(node)).length) {\n result.push(\"\");\n }\n }\n },\n strong: {\n semantic: true,\n start: function(node) { mapStart(node, \"b\"); },\n end: function() { result.push(''); }\n },\n em: {\n semantic: true,\n start: function(node) { mapStart(node, \"i\"); },\n end: function() { result.push(''); }\n },\n b: {\n semantic: false,\n start: function(node) { mapStart(node, \"strong\"); },\n end: function() { result.push(''); }\n },\n i: {\n semantic: false,\n start: function(node) { mapStart(node, \"em\"); },\n end: function() { result.push(''); }\n },\n u: {\n semantic: false,\n start: function(node) {\n result.push('');\n },\n end: function() { result.push(''); }\n },\n font: {\n canOptimize: true,\n semantic: false,\n start: function(node) {\n result.push('');\n },\n end: function() {\n result.push('');\n }\n }\n };\n\n tagMap.script = tagMap[\"k:script\"];\n\n options = options || {};\n\n if (typeof options.semantic == \"undefined\") {\n options.semantic = true;\n }\n\n function cssProperties(cssText) {\n var trim = kendo.trim;\n var css = trim(cssText);\n var match;\n var property, value;\n var properties = [];\n\n cssDeclaration.lastIndex = 0;\n\n while (true) {\n match = cssDeclaration.exec(css);\n\n if (!match) {\n break;\n }\n\n property = trim(match[1].toLowerCase());\n value = trim(match[2]);\n\n if (property == \"font-size-adjust\" || property == \"font-stretch\") {\n continue;\n }\n\n if (property.indexOf('color') >= 0) {\n value = dom.toHex(value);\n } else if (property.indexOf('font') >= 0) {\n value = value.replace(quoteRe, \"'\");\n } else if (/\\burl\\(/g.test(value)) {\n value = value.replace(quoteRe, \"\");\n }\n\n properties.push({ property: property, value: value });\n }\n\n return properties;\n }\n\n function styleAttr(cssText) {\n var properties = cssProperties(cssText);\n var i;\n\n for (i = 0; i < properties.length; i++) {\n result.push(properties[i].property);\n result.push(':');\n result.push(properties[i].value);\n result.push(';');\n }\n }\n\n function specifiedAttributes(node) {\n var result = [];\n var attributes = node.attributes;\n var attribute, i, l;\n var name, value, specified;\n\n for (i = 0, l = attributes.length; i < l; i++) {\n attribute = attributes[i];\n\n name = attribute.nodeName;\n value = attribute.value;\n specified = attribute.specified;\n\n // In IE < 8 the 'value' attribute is not returned as 'specified'. The same goes for type=\"text\"\n if (name == 'value' && 'value' in node && node.value) {\n specified = true;\n } else if (name == 'type' && value == 'text') {\n specified = true;\n } else if (name == \"class\" && !value) {\n specified = false;\n } else if (sizzleAttr.test(name)) {\n specified = false;\n } else if (name == 'complete') {\n specified = false;\n } else if (name == 'altHtml') {\n specified = false;\n } else if (name == 'start' && dom.is(node, \"ul\")) {\n specified = false;\n } else if (name == 'start' && dom.is(node, \"ol\") && value == \"1\") {\n specified = false;\n } else if (name.indexOf('_moz') >= 0) {\n specified = false;\n } else if (scriptAttr.test(name)) {\n specified = !!options.scripts;\n } else if (name == 'data-role' && value == 'resizable' && (dom.is(node, \"tr\") || dom.is(node, \"td\"))) {\n specified = false;\n }\n\n if (specified) {\n result.push(attribute);\n }\n }\n\n return result;\n }\n\n function attr(node, attributes) {\n var i, l, attribute, name, value;\n\n attributes = attributes || specifiedAttributes(node);\n\n if (dom.is(node, 'img')) {\n var width = node.style.width,\n height = node.style.height,\n $node = $(node);\n\n if (width && pixelRe.test(width)) {\n $node.attr('width', parseInt(width, 10));\n dom.unstyle(node, { width: undefined$1 });\n }\n\n if (height && pixelRe.test(height)) {\n $node.attr('height', parseInt(height, 10));\n dom.unstyle(node, { height: undefined$1 });\n }\n }\n\n if (!attributes.length) {\n return;\n }\n\n // Remove the following if everything seems to be in order.\n // https://github.com/telerik/kendo-ui-core/issues/3639\n // attributes.sort(function (a, b) {\n // return a.nodeName > b.nodeName ? 1 : a.nodeName < b.nodeName ? -1 : 0;\n // });\n\n for (i = 0, l = attributes.length; i < l; i++) {\n attribute = attributes[i];\n name = attribute.nodeName;\n value = attribute.value;\n\n if (name == \"class\" && value == \"k-table\") {\n continue;\n }\n\n name = name.replace(scriptAttr, \"\");\n\n result.push(' ');\n result.push(name);\n result.push('=\"');\n\n if (name == 'style') {\n styleAttr(value || node.style.cssText);\n } else if (name == 'src' || name == 'href') {\n result.push(kendo.htmlEncode(node.getAttribute(name, 2)));\n } else {\n result.push(dom.fillAttrs[name] ? name : value);\n }\n\n result.push('\"');\n }\n }\n\n function children(node, skip, skipEncoding) {\n for (var childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {\n child(childNode, skip, skipEncoding);\n }\n }\n\n function text(node) {\n return node.nodeValue.replace(/\\ufeff/g, \"\");\n }\n\n function isEmptyBomNode(node) {\n if (dom.isBom(node)) {\n do {\n node = node.parentNode;\n\n if (dom.is(node, TD) && node.childNodes.length === 1) {\n return true;\n }\n\n if (node.childNodes.length !== 1) {\n return false;\n }\n } while (!dom.isBlock(node));\n\n return true;\n }\n\n return false;\n }\n\n function child(node, skip, skipEncoding) {\n var nodeType = node.nodeType,\n tagName, mapper,\n parent, value, previous, jqNode;\n\n if (immutables && Editor.Immutables.immutable(node)) {\n result.push(immutables.serialize(node));\n } else if (nodeType == 1) {\n tagName = dom.name(node);\n jqNode = $(node);\n\n if (jqNode.hasClass(\"k-element-resize-handle-wrapper\") || jqNode.hasClass(\"k-column-resize-handle-wrapper\") || jqNode.hasClass(\"k-row-resize-handle-wrapper\")) {\n return;\n }\n\n if (!tagName || dom.insignificant(node)) {\n return;\n }\n\n if (!options.scripts && (tagName == \"script\" || tagName == \"k:script\")) {\n return;\n }\n\n mapper = tagMap[tagName];\n\n if (mapper) {\n if (mapper.canOptimize &&\n options.optimizeTags &&\n shouldOptimize(node)) {\n children(node, false, mapper.skipEncoding);\n return;\n }\n\n if (typeof mapper.semantic == \"undefined\" ||\n (options.semantic ^ mapper.semantic)) {\n mapper.start(node);\n children(node, false, mapper.skipEncoding);\n mapper.end(node);\n return;\n }\n }\n\n result.push('<');\n result.push(tagName);\n\n attr(node);\n\n if (dom.empty[tagName]) {\n result.push(' />');\n } else {\n result.push('>');\n children(node, skip || dom.is(node, 'pre'));\n result.push('');\n }\n } else if (nodeType == 3) {\n if (isEmptyBomNode(node)) {\n result.push(' ');\n return;\n }\n\n value = text(node);\n\n if (!skip && supportsLeadingWhitespace) {\n parent = node.parentNode;\n previous = node.previousSibling;\n\n if (!previous) {\n previous = (dom.isInline(parent) ? parent : node).previousSibling;\n }\n\n if (!previous || previous.innerHTML === \"\" || dom.isBlock(previous)) {\n if (options.keepEOL) {\n value = value.replace(/[\\r\\n\\v\\f\\t ]+/, ' ');\n } else {\n value = value.replace(/^[\\r\\n\\v\\f\\t ]+/, '');\n }\n }\n\n value = value.replace(/ +/, ' ');\n }\n\n result.push(skipEncoding ? value : dom.encode(value, options));\n\n } else if (nodeType == 4) {\n result.push('');\n } else if (nodeType == 8) {\n if (node.data.indexOf('[CDATA[') < 0) {\n result.push('');\n } else {\n result.push('');\n }\n }\n }\n\n function shouldOptimize(node) {\n return node.attributes.length === 0;\n }\n\n function textOnly(root) {\n var childrenCount = root.childNodes.length;\n var textChild = childrenCount && root.firstChild.nodeType == 3;\n\n return textChild && (childrenCount == 1 || (childrenCount == 2 && dom.insignificant(root.lastChild)));\n }\n\n function runCustom() {\n if (kendo.isFunction(options.custom)) {\n result = options.custom(result) || result;\n }\n }\n\n if (textOnly(root)) {\n result = dom.encode(text(root.firstChild).replace(/[\\r\\n\\v\\f\\t ]+/, ' '), options);\n runCustom();\n\n return result;\n }\n\n children(root);\n result = result.join('');\n runCustom();\n\n // if serialized dom contains only whitespace elements, consider it empty (required field validation)\n if (result.replace(brRe, \"\").replace(emptyPRe, \"\") === \"\") {\n return \"\";\n }\n\n return result;\n }\n\n };\n\n extend(Editor, {\n Serializer: Serializer\n });\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n extend = $.extend,\n Editor = kendo.ui.editor,\n browser = kendo.support.browser,\n dom = Editor.Dom,\n findNodeIndex = dom.findNodeIndex,\n isDataNode = dom.isDataNode,\n findClosestAncestor = dom.findClosestAncestor,\n getNodeLength = dom.getNodeLength,\n normalize = dom.normalize;\n\n var SelectionUtils = {\n selectionFromWindow: function(window) {\n if (!window) {\n return;\n }\n\n if (!(\"getSelection\" in window)) {\n return new W3CSelection(window.document);\n }\n\n return window.getSelection();\n },\n\n selectionFromRange: function(range) {\n var rangeDocument = RangeUtils.documentFromRange(range);\n return SelectionUtils.selectionFromDocument(rangeDocument);\n },\n\n selectionFromDocument: function(document) {\n return SelectionUtils.selectionFromWindow(dom.windowFromDocument(document));\n }\n };\n\n var W3CRange = Class.extend({\n init: function(doc) {\n $.extend(this, {\n ownerDocument: doc, /* not part of the spec; used when cloning ranges, traversing the dom and creating fragments */\n startContainer: doc,\n endContainer: doc,\n commonAncestorContainer: doc,\n startOffset: 0,\n endOffset: 0,\n collapsed: true\n });\n },\n\n // Positioning Methods\n setStart: function(node, offset) {\n this.startContainer = node;\n this.startOffset = offset;\n updateRangeProperties(this);\n fixIvalidRange(this, true);\n },\n\n setEnd: function(node, offset) {\n this.endContainer = node;\n this.endOffset = offset;\n updateRangeProperties(this);\n fixIvalidRange(this, false);\n },\n\n setStartBefore: function(node) {\n this.setStart(node.parentNode, findNodeIndex(node));\n },\n\n setStartAfter: function(node) {\n this.setStart(node.parentNode, findNodeIndex(node) + 1);\n },\n\n setEndBefore: function(node) {\n this.setEnd(node.parentNode, findNodeIndex(node));\n },\n\n setEndAfter: function(node) {\n this.setEnd(node.parentNode, findNodeIndex(node) + 1);\n },\n\n selectNode: function(node) {\n this.setStartBefore(node);\n this.setEndAfter(node);\n },\n\n selectNodeContents: function(node) {\n this.setStart(node, 0);\n this.setEnd(node, node[node.nodeType === 1 ? 'childNodes' : 'nodeValue'].length);\n },\n\n collapse: function(toStart) {\n var that = this;\n\n if (toStart) {\n that.setEnd(that.startContainer, that.startOffset);\n } else {\n that.setStart(that.endContainer, that.endOffset);\n }\n },\n\n // Editing Methods\n\n deleteContents: function() {\n var that = this,\n range = that.cloneRange();\n\n if (that.startContainer != that.commonAncestorContainer) {\n that.setStartAfter(findClosestAncestor(that.commonAncestorContainer, that.startContainer));\n }\n\n that.collapse(true);\n\n (function deleteSubtree(iterator) {\n while (iterator.next()) {\n if (iterator.hasPartialSubtree()) {\n deleteSubtree(iterator.getSubtreeIterator());\n } else {\n iterator.remove();\n }\n }\n })(new RangeIterator(range));\n },\n\n cloneContents: function() {\n // clone subtree\n var document = RangeUtils.documentFromRange(this);\n return (function cloneSubtree(iterator) {\n var node, frag = document.createDocumentFragment();\n\n while (node = iterator.next()) {\n node = node.cloneNode(!iterator.hasPartialSubtree());\n\n if (iterator.hasPartialSubtree()) {\n node.appendChild(cloneSubtree(iterator.getSubtreeIterator()));\n }\n\n frag.appendChild(node);\n }\n\n return frag;\n })(new RangeIterator(this));\n },\n\n extractContents: function() {\n var that = this,\n range = that.cloneRange();\n\n if (that.startContainer != that.commonAncestorContainer) {\n that.setStartAfter(findClosestAncestor(that.commonAncestorContainer, that.startContainer));\n }\n\n that.collapse(true);\n\n var document = RangeUtils.documentFromRange(that);\n\n return (function extractSubtree(iterator) {\n var node, frag = document.createDocumentFragment();\n\n while (node = iterator.next()) {\n if (iterator.hasPartialSubtree()) {\n node = node.cloneNode(false);\n node.appendChild(extractSubtree(iterator.getSubtreeIterator()));\n } else {\n iterator.remove(that.originalRange);\n }\n\n frag.appendChild(node);\n }\n\n return frag;\n })(new RangeIterator(range));\n },\n\n insertNode: function(node) {\n var that = this;\n\n if (isDataNode(that.startContainer)) {\n if (that.startOffset != that.startContainer.nodeValue.length) {\n dom.splitDataNode(that.startContainer, that.startOffset);\n }\n\n dom.insertAfter(node, that.startContainer);\n } else {\n dom.insertAt(that.startContainer, node, that.startOffset);\n }\n\n that.setStart(that.startContainer, that.startOffset);\n },\n\n cloneRange: function() {\n // fast copy\n return $.extend(new W3CRange(this.ownerDocument), {\n startContainer: this.startContainer,\n endContainer: this.endContainer,\n commonAncestorContainer: this.commonAncestorContainer,\n startOffset: this.startOffset,\n endOffset: this.endOffset,\n collapsed: this.collapsed,\n\n originalRange: this /* not part of the spec; used to update the original range when calling extractContents() on clones */\n });\n },\n\n // used for debug purposes\n toString: function() {\n var startNodeName = this.startContainer.nodeName,\n endNodeName = this.endContainer.nodeName;\n\n return [startNodeName == \"#text\" ? this.startContainer.nodeValue : startNodeName, '(', this.startOffset, ') : ',\n endNodeName == \"#text\" ? this.endContainer.nodeValue : endNodeName, '(', this.endOffset, ')'].join('');\n }\n });\n\n W3CRange.fromNode = function(node) {\n return new W3CRange(node.ownerDocument);\n };\n\n /* can be used in Range.compareBoundaryPoints if we need it one day */\n function compareBoundaries(start, end, startOffset, endOffset) {\n if (start == end) {\n return endOffset - startOffset;\n }\n\n // end is child of start\n var container = end;\n while (container && container.parentNode != start) {\n container = container.parentNode;\n }\n\n if (container) {\n return findNodeIndex(container) - startOffset;\n }\n\n // start is child of end\n container = start;\n while (container && container.parentNode != end) {\n container = container.parentNode;\n }\n\n if (container) {\n return endOffset - findNodeIndex(container) - 1;\n }\n\n // deep traversal\n var root = dom.commonAncestor(start, end);\n var startAncestor = start;\n\n while (startAncestor && startAncestor.parentNode != root) {\n startAncestor = startAncestor.parentNode;\n }\n\n if (!startAncestor) {\n startAncestor = root;\n }\n\n var endAncestor = end;\n while (endAncestor && endAncestor.parentNode != root) {\n endAncestor = endAncestor.parentNode;\n }\n\n if (!endAncestor) {\n endAncestor = root;\n }\n\n if (startAncestor == endAncestor) {\n return 0;\n }\n\n return findNodeIndex(endAncestor) - findNodeIndex(startAncestor);\n }\n\n function fixIvalidRange(range, toStart) {\n function isInvalidRange(range) {\n try {\n return compareBoundaries(range.startContainer, range.endContainer, range.startOffset, range.endOffset) < 0;\n } catch (ex) {\n // range was initially invalid (e.g. when cloned from invalid range) - it must be fixed\n return true;\n }\n }\n\n if (isInvalidRange(range)) {\n if (toStart) {\n range.commonAncestorContainer = range.endContainer = range.startContainer;\n range.endOffset = range.startOffset;\n } else {\n range.commonAncestorContainer = range.startContainer = range.endContainer;\n range.startOffset = range.endOffset;\n }\n\n range.collapsed = true;\n }\n }\n\n function updateRangeProperties(range) {\n range.collapsed = range.startContainer == range.endContainer && range.startOffset == range.endOffset;\n\n var node = range.startContainer;\n while (node && node != range.endContainer && !dom.isAncestorOf(node, range.endContainer)) {\n node = node.parentNode;\n }\n\n range.commonAncestorContainer = node;\n }\n\n var RangeIterator = Class.extend({\n init: function(range) {\n $.extend(this, {\n range: range,\n _current: null,\n _next: null,\n _end: null\n });\n\n if (range.collapsed) {\n return;\n }\n\n var root = range.commonAncestorContainer;\n\n this._next = range.startContainer == root && !isDataNode(range.startContainer) ?\n range.startContainer.childNodes[range.startOffset] :\n findClosestAncestor(root, range.startContainer);\n\n this._end = range.endContainer == root && !isDataNode(range.endContainer) ?\n range.endContainer.childNodes[range.endOffset] :\n findClosestAncestor(root, range.endContainer).nextSibling;\n },\n\n hasNext: function() {\n return !!this._next;\n },\n\n next: function() {\n var that = this,\n current = that._current = that._next;\n that._next = that._current && that._current.nextSibling != that._end ?\n that._current.nextSibling : null;\n\n if (isDataNode(that._current)) {\n if (that.range.endContainer == that._current) {\n current = current.cloneNode(true);\n current.deleteData(that.range.endOffset, current.length - that.range.endOffset);\n }\n\n if (that.range.startContainer == that._current) {\n current = current.cloneNode(true);\n current.deleteData(0, that.range.startOffset);\n }\n }\n\n return current;\n },\n\n traverse: function(callback) {\n var that = this,\n current;\n\n function next() {\n that._current = that._next;\n that._next = that._current && that._current.nextSibling != that._end ? that._current.nextSibling : null;\n return that._current;\n }\n\n while (current = next()) {\n if (that.hasPartialSubtree()) {\n that.getSubtreeIterator().traverse(callback);\n } else {\n callback(current);\n }\n }\n\n return current;\n },\n\n remove: function(originalRange) {\n var that = this,\n inStartContainer = that.range.startContainer == that._current,\n inEndContainer = that.range.endContainer == that._current,\n start, end, delta;\n\n if (isDataNode(that._current) && (inStartContainer || inEndContainer)) {\n start = inStartContainer ? that.range.startOffset : 0;\n end = inEndContainer ? that.range.endOffset : that._current.length;\n delta = end - start;\n\n if (originalRange && (inStartContainer || inEndContainer)) {\n if (that._current == originalRange.startContainer && start <= originalRange.startOffset) {\n originalRange.startOffset -= delta;\n }\n\n if (that._current == originalRange.endContainer && end <= originalRange.endOffset) {\n originalRange.endOffset -= delta;\n }\n }\n\n that._current.deleteData(start, delta);\n } else {\n var parent = that._current.parentNode;\n\n if (originalRange && (that.range.startContainer == parent || that.range.endContainer == parent)) {\n var nodeIndex = findNodeIndex(that._current);\n\n if (parent == originalRange.startContainer && nodeIndex <= originalRange.startOffset) {\n originalRange.startOffset -= 1;\n }\n\n if (parent == originalRange.endContainer && nodeIndex < originalRange.endOffset) {\n originalRange.endOffset -= 1;\n }\n }\n\n dom.remove(that._current);\n }\n },\n\n hasPartialSubtree: function() {\n return !isDataNode(this._current) &&\n (dom.isAncestorOrSelf(this._current, this.range.startContainer) ||\n dom.isAncestorOrSelf(this._current, this.range.endContainer));\n },\n\n getSubtreeIterator: function() {\n return new RangeIterator(this.getSubRange());\n },\n\n getSubRange: function() {\n var that = this,\n subRange = that.range.cloneRange();\n subRange.selectNodeContents(that._current);\n if (dom.isAncestorOrSelf(that._current, that.range.startContainer)) {\n subRange.setStart(that.range.startContainer, that.range.startOffset);\n }\n if (dom.isAncestorOrSelf(that._current, that.range.endContainer)) {\n subRange.setEnd(that.range.endContainer, that.range.endOffset);\n }\n\n return subRange;\n }\n });\n\n var W3CSelection = Class.extend({\n init: function(doc) {\n this.ownerDocument = doc;\n this.rangeCount = 1;\n },\n\n addRange: function(range) {\n var textRange = this.ownerDocument.body.createTextRange();\n\n // end container should be adopted first in order to prevent selection with negative length\n adoptContainer(textRange, range, false);\n adoptContainer(textRange, range, true);\n\n textRange.select();\n },\n\n removeAllRanges: function() {\n var selection = this.ownerDocument.selection;\n\n if (selection.type != \"None\") {\n selection.empty();\n }\n },\n\n getRangeAt: function() {\n var textRange,\n range = new W3CRange(this.ownerDocument),\n selection = this.ownerDocument.selection,\n element, commonAncestor;\n\n try {\n textRange = selection.createRange();\n element = textRange.item ? textRange.item(0) : textRange.parentElement();\n if (element.ownerDocument != this.ownerDocument) {\n return range;\n }\n } catch (ex) {\n return range;\n }\n\n if (selection.type == \"Control\") {\n range.selectNode(textRange.item(0));\n } else {\n commonAncestor = textRangeContainer(textRange);\n adoptEndPoint(textRange, range, commonAncestor, true);\n adoptEndPoint(textRange, range, commonAncestor, false);\n\n if (range.startContainer.nodeType == 9) {\n range.setStart(range.endContainer, range.startOffset);\n }\n\n if (range.endContainer.nodeType == 9) {\n range.setEnd(range.startContainer, range.endOffset);\n }\n\n if (textRange.compareEndPoints(\"StartToEnd\", textRange) === 0) {\n range.collapse(false);\n }\n\n var startContainer = range.startContainer,\n endContainer = range.endContainer,\n body = this.ownerDocument.body;\n\n if (!range.collapsed && range.startOffset === 0 && range.endOffset == getNodeLength(range.endContainer) && // check for full body selection\n !(startContainer == endContainer && isDataNode(startContainer) && startContainer.parentNode == body)) { // but not when single textnode is selected\n var movedStart = false,\n movedEnd = false;\n\n while (findNodeIndex(startContainer) === 0 && startContainer == startContainer.parentNode.firstChild && startContainer != body) {\n startContainer = startContainer.parentNode;\n movedStart = true;\n }\n\n while (findNodeIndex(endContainer) == getNodeLength(endContainer.parentNode) - 1 && endContainer == endContainer.parentNode.lastChild && endContainer != body) {\n endContainer = endContainer.parentNode;\n movedEnd = true;\n }\n\n if (startContainer == body && endContainer == body && movedStart && movedEnd) {\n range.setStart(startContainer, 0);\n range.setEnd(endContainer, getNodeLength(body));\n }\n }\n }\n\n return range;\n }\n });\n\n function textRangeContainer(textRange) {\n var left = textRange.duplicate(),\n right = textRange.duplicate();\n\n left.collapse(true);\n right.collapse(false);\n\n return dom.commonAncestor(textRange.parentElement(), left.parentElement(), right.parentElement());\n }\n\n function adoptContainer(textRange, range, start) {\n // find anchor node and offset\n var container = range[start ? \"startContainer\" : \"endContainer\"],\n offset = range[start ? \"startOffset\" : \"endOffset\"],\n textOffset = 0,\n isData = isDataNode(container),\n anchorNode = isData ? container : container.childNodes[offset] || null,\n anchorParent = isData ? container.parentNode : container,\n doc = range.ownerDocument,\n cursor = doc.body.createTextRange(),\n cursorNode;\n\n // visible data nodes need a text offset\n if (container.nodeType == 3 || container.nodeType == 4) {\n textOffset = offset;\n }\n\n if (!anchorParent) {\n anchorParent = doc.body;\n }\n\n if (anchorParent.nodeName.toLowerCase() == \"img\") {\n cursor.moveToElementText(anchorParent);\n cursor.collapse(false);\n textRange.setEndPoint(start ? \"StartToStart\" : \"EndToStart\", cursor);\n } else {\n // create a cursor element node to position range (since we can't select text nodes)\n cursorNode = anchorParent.insertBefore(dom.create(doc, \"a\"), anchorNode);\n\n cursor.moveToElementText(cursorNode);\n dom.remove(cursorNode);\n cursor[start ? \"moveStart\" : \"moveEnd\"](\"character\", textOffset);\n cursor.collapse(false);\n textRange.setEndPoint(start ? \"StartToStart\" : \"EndToStart\", cursor);\n }\n }\n\n function adoptEndPoint(textRange, range, commonAncestor, start) {\n var cursorNode = dom.create(range.ownerDocument, \"a\"),\n cursor = textRange.duplicate(),\n comparison = start ? \"StartToStart\" : \"StartToEnd\",\n result, parent, target,\n previous, next,\n args, index,\n appended = false;\n\n cursorNode.innerHTML = \"\\ufeff\";\n cursor.collapse(start);\n\n parent = cursor.parentElement();\n\n if (!dom.isAncestorOrSelf(commonAncestor, parent)) {\n parent = commonAncestor;\n }\n\n // detect range end points\n // insert cursorNode within the textRange parent and move the cursor until it gets outside of the textRange\n do {\n if (appended) {\n parent.insertBefore(cursorNode, cursorNode.previousSibling);\n } else {\n parent.appendChild(cursorNode);\n appended = true;\n }\n cursor.moveToElementText(cursorNode);\n } while ((result = cursor.compareEndPoints(comparison, textRange)) > 0 && cursorNode.previousSibling);\n\n target = cursorNode.nextSibling;\n\n if (result == -1 && isDataNode(target)) {\n cursor.setEndPoint(start ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n dom.remove(cursorNode);\n\n args = [target, cursor.text.length];\n } else {\n previous = !start && cursorNode.previousSibling;\n next = start && cursorNode.nextSibling;\n\n if (isDataNode(next)) {\n args = [next, 0];\n } else if (isDataNode(previous)) {\n args = [previous, previous.length];\n } else {\n index = findNodeIndex(cursorNode);\n\n if (parent.nextSibling && index == parent.childNodes.length - 1) {\n args = [parent.nextSibling, 0];\n } else {\n args = [parent, index];\n }\n }\n\n dom.remove(cursorNode);\n }\n\n range[start ? \"setStart\" : \"setEnd\"].apply(range, args);\n }\n\n var RangeEnumerator = Class.extend({\n init: function(range) {\n this.enumerate = function() {\n var nodes = [];\n\n function visit(node) {\n if (dom.is(node, \"img\") || (node.nodeType == 3 && (!dom.isEmptyspace(node) || node.nodeValue == \"\\ufeff\"))) {\n nodes.push(node);\n } else {\n node = node.firstChild;\n while (node) {\n visit(node);\n node = node.nextSibling;\n }\n }\n }\n\n new RangeIterator(range).traverse(visit);\n\n return nodes;\n };\n }\n });\n\n var ImmutablesRangeIterator = RangeIterator.extend({\n hasPartialSubtree: function() {\n var immutable = Editor.Immutables && Editor.Immutables.immutable;\n return immutable && !immutable(this._current) && RangeIterator.fn.hasPartialSubtree.call(this);\n },\n\n getSubtreeIterator: function() {\n return new ImmutablesRangeIterator(this.getSubRange());\n }\n });\n\n var ImmutablesRangeEnumerator = Class.extend({\n init: function(range) {\n this.enumerate = function() {\n var nodes = [];\n var immutable = Editor.Immutables && Editor.Immutables.immutable;\n function visit(node) {\n if (immutable && !immutable(node)) {\n if (dom.is(node, \"img\") || (node.nodeType == 3 && (!dom.isEmptyspace(node) || node.nodeValue == \"\\ufeff\"))) {\n nodes.push(node);\n } else {\n node = node.firstChild;\n while (node) {\n visit(node);\n node = node.nextSibling;\n }\n }\n }\n }\n\n new ImmutablesRangeIterator(range).traverse(visit);\n\n return nodes;\n };\n }\n });\n\n var RestorePoint = Class.extend({\n init: function(range, body, options) {\n var that = this;\n that.range = range;\n that.rootNode = RangeUtils.documentFromRange(range);\n that.body = body || that.getEditable(range);\n if (dom.name(that.body) != \"body\") {\n that.rootNode = that.body;\n }\n\n that.startContainer = that.nodeToPath(range.startContainer);\n that.endContainer = that.nodeToPath(range.endContainer);\n that.startOffset = that.offset(range.startContainer, range.startOffset);\n that.endOffset = that.offset(range.endContainer, range.endOffset);\n\n that.immutables = options && options.immutables;\n\n if (that.immutables) {\n that.serializedImmutables = Editor.Immutables.removeImmutables(that.body);\n }\n\n that.html = that.body.innerHTML;\n\n if (that.immutables && !that.serializedImmutables.empty) {\n Editor.Immutables.restoreImmutables(that.body, that.serializedImmutables);\n }\n },\n\n index: function(node) {\n var result = 0,\n lastType = node.nodeType;\n\n while (node = node.previousSibling) {\n var nodeType = node.nodeType;\n\n if (nodeType != 3 || lastType != nodeType) {\n result ++;\n }\n\n lastType = nodeType;\n }\n\n return result;\n },\n\n getEditable: function(range) {\n var root = range.commonAncestorContainer;\n\n while (root && (root.nodeType == 3 || root.attributes && (!root.attributes.contentEditable || root.attributes.contentEditable.nodeValue.toLowerCase() == \"false\"))) {\n root = root.parentNode;\n }\n\n return root;\n },\n\n restoreHtml: function() {\n var that = this;\n\n dom.removeChildren(that.body);\n that.body.innerHTML = that.html;\n if (that.immutables && !that.serializedImmutables.empty) {\n Editor.Immutables.restoreImmutables(that.body, that.serializedImmutables);\n }\n },\n\n offset: function(node, value) {\n if (node.nodeType == 3) {\n while ((node = node.previousSibling) && node.nodeType == 3) {\n value += node.nodeValue.length;\n }\n }\n\n return value;\n },\n\n nodeToPath: function(node) {\n var path = [];\n\n while (node != this.rootNode) {\n path.push(this.index(node));\n node = node.parentNode;\n }\n\n return path;\n },\n\n toRangePoint: function(range, start, path, denormalizedOffset) {\n var node = this.rootNode,\n length = path.length,\n offset = denormalizedOffset;\n\n while (length-- && node) {\n node = node.childNodes[path[length]];\n }\n\n while (node && node.nodeType == 3 && node.nodeValue.length < offset) {\n offset -= node.nodeValue.length;\n node = node.nextSibling;\n }\n\n if (node && offset >= 0) {\n range[start ? 'setStart' : 'setEnd'](node, offset);\n }\n },\n\n toRange: function() {\n var that = this,\n result = that.range.cloneRange();\n\n that.toRangePoint(result, true, that.startContainer, that.startOffset);\n that.toRangePoint(result, false, that.endContainer, that.endOffset);\n\n return result;\n }\n\n });\n\n var Marker = Class.extend({\n init: function() {\n this.caret = null;\n },\n\n addCaret: function(range) {\n var that = this;\n var caret = that.caret = dom.create(RangeUtils.documentFromRange(range), 'span', { className: 'k-marker' });\n range.insertNode(caret);\n\n dom.stripBomNode(caret.previousSibling);\n dom.stripBomNode(caret.nextSibling);\n\n range.selectNode(caret);\n return caret;\n },\n\n removeCaret: function(range) {\n var that = this,\n previous = that.caret.previousSibling,\n startOffset = 0;\n\n if (previous) {\n startOffset = isDataNode(previous) ? previous.nodeValue.length : findNodeIndex(previous);\n }\n\n var container = that.caret.parentNode;\n var containerIndex = previous ? findNodeIndex(previous) : 0;\n\n dom.remove(that.caret);\n normalize(container);\n\n var node = container.childNodes[containerIndex];\n\n if (isDataNode(node)) {\n range.setStart(node, startOffset);\n } else if (node) {\n var textNode = dom.lastTextNode(node);\n if (textNode) {\n range.setStart(textNode, textNode.nodeValue.length);\n } else {\n range[previous ? 'setStartAfter' : 'setStartBefore'](node);\n }\n } else {\n if (!browser.msie && !container.innerHTML) {\n container.innerHTML = '
';\n }\n\n range.selectNodeContents(container);\n }\n range.collapse(true);\n },\n\n add: function(range, expand) {\n var that = this;\n\n var collapsed = range.collapsed && !RangeUtils.isExpandable(range);\n var doc = RangeUtils.documentFromRange(range);\n\n if (expand && range.collapsed) {\n that.addCaret(range);\n range = RangeUtils.expand(range);\n }\n\n var rangeBoundary = range.cloneRange();\n\n rangeBoundary.collapse(false);\n that.end = dom.create(doc, 'span', { className: 'k-marker' });\n rangeBoundary.insertNode(that.end);\n\n rangeBoundary = range.cloneRange();\n rangeBoundary.collapse(true);\n that.start = that.end.cloneNode(true);\n rangeBoundary.insertNode(that.start);\n\n that._removeDeadMarkers(that.start, that.end);\n\n if (collapsed) {\n var bom = doc.createTextNode(\"\\ufeff\");\n dom.insertAfter(bom.cloneNode(), that.start);\n dom.insertBefore(bom, that.end);\n }\n\n normalize(range.commonAncestorContainer);\n\n range.setStartBefore(that.start);\n range.setEndAfter(that.end);\n\n return range;\n },\n\n _removeDeadMarkers: function(start, end) {\n if (start.previousSibling && start.previousSibling.nodeValue == \"\\ufeff\") {\n dom.remove(start.previousSibling);\n }\n\n if (end.nextSibling && end.nextSibling.nodeValue == \"\\ufeff\") {\n dom.remove(end.nextSibling);\n }\n },\n\n _normalizedIndex: function(node) {\n var index = findNodeIndex(node);\n var pointer = node;\n\n while (pointer.previousSibling) {\n if (pointer.nodeType == 3 && pointer.previousSibling.nodeType == 3) {\n index--;\n }\n\n pointer = pointer.previousSibling;\n }\n\n return index;\n },\n\n remove: function(range) {\n var that = this,\n start = that.start,\n end = that.end,\n shouldNormalizeStart,\n shouldNormalizeEnd,\n shouldNormalize;\n\n normalize(range.commonAncestorContainer);\n\n while (!start.nextSibling && start.parentNode) {\n start = start.parentNode;\n }\n\n while (!end.previousSibling && end.parentNode) {\n end = end.parentNode;\n }\n\n // merely accessing the siblings will solve range issues in IE\n shouldNormalizeStart = (start.previousSibling && start.previousSibling.nodeType == 3) &&\n (start.nextSibling && start.nextSibling.nodeType == 3);\n\n shouldNormalizeEnd = (end.previousSibling && end.previousSibling.nodeType == 3) &&\n (end.nextSibling && end.nextSibling.nodeType == 3);\n\n shouldNormalize = shouldNormalizeStart && shouldNormalizeEnd;\n\n start = start.nextSibling;\n end = end.previousSibling;\n\n var isBomSelected = start === end && dom.isBom(start);\n if (isBomSelected && start.length > 1) {\n start.nodeValue = start.nodeValue.charAt(0);\n }\n\n var collapsed = isBomSelected;\n var collapsedToStart = false;\n // collapsed range\n if (start == that.end) {\n collapsedToStart = !!that.start.previousSibling;\n start = end = that.start.previousSibling || that.end.nextSibling;\n collapsed = true;\n }\n\n dom.remove(that.start);\n dom.remove(that.end);\n\n if (!start || !end) {\n range.selectNodeContents(range.commonAncestorContainer);\n range.collapse(true);\n return;\n }\n\n var startOffset = collapsed ? isDataNode(start) ? start.nodeValue.length : start.childNodes.length : 0;\n var endOffset = isDataNode(end) ? end.nodeValue.length : end.childNodes.length;\n\n if (start.nodeType == 3) {\n while (start.previousSibling && start.previousSibling.nodeType == 3) {\n start = start.previousSibling;\n startOffset += start.nodeValue.length;\n }\n }\n\n if (end.nodeType == 3) {\n while (end.previousSibling && end.previousSibling.nodeType == 3) {\n end = end.previousSibling;\n endOffset += end.nodeValue.length;\n }\n }\n\n var startParent = start.parentNode;\n var endParent = end.parentNode;\n var startIndex = this._normalizedIndex(start);\n var endIndex = this._normalizedIndex(end);\n\n normalize(startParent);\n if (start.nodeType == 3) {\n start = startParent.childNodes[startIndex];\n }\n\n normalize(endParent);\n if (end.nodeType == 3) {\n end = endParent.childNodes[endIndex];\n }\n\n if (collapsed) {\n if (start.nodeType == 3) {\n range.setStart(start, startOffset);\n } else {\n range[collapsedToStart ? 'setStartAfter' : 'setStartBefore'](start);\n }\n\n range.collapse(true);\n\n } else {\n if (start.nodeType == 3) {\n range.setStart(start, startOffset);\n } else {\n range.setStartBefore(start);\n }\n\n if (end.nodeType == 3) {\n range.setEnd(end, endOffset);\n } else {\n range.setEndAfter(end);\n }\n }\n\n if (that.caret) {\n that.removeCaret(range);\n }\n }\n });\n\n var boundary = /[\\u0009-\\u000d]|\\u0020|\\u00a0|\\ufeff|\\.|,|;|:|!|\\(|\\)|\\?/;\n\n var RangeUtils = {\n nodes: function(range) {\n var nodes = RangeUtils.textNodes(range);\n if (!nodes.length) {\n range.selectNodeContents(range.commonAncestorContainer);\n nodes = RangeUtils.textNodes(range);\n if (!nodes.length) {\n nodes = dom.significantChildNodes(range.commonAncestorContainer);\n }\n }\n return nodes;\n },\n\n textNodes: function(range) {\n var allNodes = new RangeEnumerator(range).enumerate(),\n result = allNodes.filter(function(node) {\n return dom.allowsTextContent(node.parentElement);\n });\n\n return result;\n },\n\n editableTextNodes: function(range) {\n var nodes = [],\n immutableParent = Editor.Immutables && Editor.Immutables.immutableParent,\n result = [];\n\n if (immutableParent && !immutableParent(range.commonAncestorContainer)) {\n nodes = new ImmutablesRangeEnumerator(range).enumerate();\n result = nodes.filter(function(node) {\n return dom.allowsTextContent(node.parentElement);\n });\n }\n\n return result;\n },\n\n documentFromRange: function(range) {\n var startContainer = range.startContainer;\n return startContainer.nodeType == 9 ? startContainer : startContainer.ownerDocument;\n },\n\n createRange: function(document) {\n return document.createRange();\n },\n\n selectRange: function(range) {\n var image = RangeUtils.image(range);\n if (image) {\n range.setStartAfter(image);\n range.setEndAfter(image);\n }\n var selection = SelectionUtils.selectionFromRange(range);\n selection.removeAllRanges();\n selection.addRange(range);\n },\n\n stringify: function(range) {\n return kendo.format(\n \"{0}:{1} - {2}:{3}\",\n dom.name(range.startContainer), range.startOffset,\n dom.name(range.endContainer), range.endOffset\n );\n },\n\n split: function(range, node, trim) {\n function partition(start) {\n var partitionRange = range.cloneRange();\n partitionRange.collapse(start);\n partitionRange[start ? 'setStartBefore' : 'setEndAfter'](node);\n var contents = partitionRange.extractContents();\n if (trim) {\n contents = dom.trim(contents);\n }\n dom[start ? 'insertBefore' : 'insertAfter'](contents, node);\n }\n partition(true);\n partition(false);\n },\n\n mapAll: function(range, map) {\n var nodes = [];\n\n new RangeIterator(range).traverse(function(node) {\n var mapped = map(node);\n\n if (mapped && $.inArray(mapped, nodes) < 0) {\n nodes.push(mapped);\n }\n });\n\n return nodes;\n },\n\n getAll: function(range, predicate) {\n var selector = predicate;\n\n if (typeof predicate == \"string\") {\n predicate = function(node) {\n return dom.is(node, selector);\n };\n }\n\n return RangeUtils.mapAll(range, function(node) {\n if (predicate(node)) {\n return node;\n }\n });\n },\n\n getMarkers: function(range) {\n return RangeUtils.getAll(range, function(node) {\n return node.className == 'k-marker';\n });\n },\n\n image: function(range) {\n var nodes = RangeUtils.getAll(range, \"img\");\n\n if (nodes.length == 1) {\n return nodes[0];\n }\n },\n\n isStartOf: function(originalRange, node) {\n if (originalRange.startOffset !== 0) {\n return false;\n }\n\n var range = originalRange.cloneRange();\n\n while (range.startOffset === 0 && range.startContainer != node) {\n var index = dom.findNodeIndex(range.startContainer);\n var parent = range.startContainer.parentNode;\n\n while (index > 0 && parent[index - 1] && dom.insignificant(parent[index - 1])) {\n index--;\n }\n\n range.setStart(parent, index);\n }\n\n return range.startOffset === 0 && range.startContainer == node;\n },\n\n isEndOf: function(originalRange, node) {\n var range = originalRange.cloneRange();\n\n range.collapse(false);\n\n var start = range.startContainer;\n\n if (dom.isDataNode(start) && range.startOffset == dom.getNodeLength(start)) {\n range.setStart(start.parentNode, dom.findNodeIndex(start) + 1);\n range.collapse(true);\n }\n\n range.setEnd(node, dom.getNodeLength(node));\n\n var nodes = [];\n\n function visit(node) {\n if (!dom.insignificant(node) && !(dom.isDataNode(node) && /^[\\ufeff]*$/.test(node.nodeValue))) {\n nodes.push(node);\n }\n }\n\n new RangeIterator(range).traverse(visit);\n\n return !nodes.length;\n },\n\n wrapSelectedElements: function(range) {\n var startEditable = dom.editableParent(range.startContainer);\n var endEditable = dom.editableParent(range.endContainer);\n\n while (range.startOffset === 0 && range.startContainer != startEditable) {\n range.setStart(range.startContainer.parentNode, dom.findNodeIndex(range.startContainer));\n }\n\n function isEnd(offset, container) {\n var length = dom.getNodeLength(container);\n\n if (offset == length) {\n return true;\n }\n\n for (var i = offset; i < length; i++) {\n if (!dom.insignificant(container.childNodes[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n while (isEnd(range.endOffset, range.endContainer) && range.endContainer != endEditable) {\n range.setEnd(range.endContainer.parentNode, dom.findNodeIndex(range.endContainer) + 1);\n }\n\n return range;\n },\n\n expand: function(range) {\n var result = range.cloneRange();\n\n var startContainer = result.startContainer.childNodes[result.startOffset === 0 ? 0 : result.startOffset - 1];\n var endContainer = result.endContainer.childNodes[result.endOffset];\n\n if (!isDataNode(startContainer) || !isDataNode(endContainer)) {\n return result;\n }\n\n var beforeCaret = startContainer.nodeValue;\n var afterCaret = endContainer.nodeValue;\n\n if (!beforeCaret || !afterCaret) {\n return result;\n }\n\n var startOffset = beforeCaret.split('').reverse().join('').search(boundary);\n var endOffset = afterCaret.search(boundary);\n\n if (!startOffset || !endOffset) {\n return result;\n }\n\n endOffset = endOffset == -1 ? afterCaret.length : endOffset;\n startOffset = startOffset == -1 ? 0 : beforeCaret.length - startOffset;\n\n result.setStart(startContainer, startOffset);\n result.setEnd(endContainer, endOffset);\n\n return result;\n },\n\n isExpandable: function(range) {\n var node = range.startContainer;\n var rangeDocument = RangeUtils.documentFromRange(range);\n\n if (node == rangeDocument || node == rangeDocument.body) {\n return false;\n }\n\n var result = range.cloneRange();\n\n var value = node.nodeValue;\n if (!value) {\n return false;\n }\n\n var beforeCaret = value.substring(0, result.startOffset);\n var afterCaret = value.substring(result.startOffset);\n\n var startOffset = 0, endOffset = 0;\n\n if (beforeCaret) {\n startOffset = beforeCaret.split('').reverse().join('').search(boundary);\n }\n\n if (afterCaret) {\n endOffset = afterCaret.search(boundary);\n }\n\n return startOffset && endOffset;\n }\n };\n\n extend(Editor, {\n SelectionUtils: SelectionUtils,\n W3CRange: W3CRange,\n RangeIterator: RangeIterator,\n W3CSelection: W3CSelection,\n RangeEnumerator: RangeEnumerator,\n RestorePoint: RestorePoint,\n Marker: Marker,\n RangeUtils: RangeUtils\n });\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n var kendo = window.kendo,\n Class = kendo.Class,\n Editor = kendo.ui.editor,\n dom = Editor.Dom,\n template = kendo.template,\n RangeUtils = Editor.RangeUtils,\n complexBlocks = [\"ul\", \"ol\", \"tbody\", \"thead\", \"table\"],\n toolsToBeUpdated = [\n \"bold\",\n \"italic\",\n \"underline\",\n \"strikethrough\",\n \"superscript\",\n \"subscript\",\n \"forecolor\",\n \"backcolor\",\n \"fontname\",\n \"fontsize\",\n \"createlink\",\n \"unlink\",\n \"autolink\",\n \"addcolumnleft\",\n \"addcolumnright\",\n \"addrowabove\",\n \"addrowbelow\",\n \"deleterow\",\n \"deletecolumn\",\n \"mergecells\",\n \"formatting\",\n \"cleanformatting\" ],\n IMMUTABALE = \"k-immutable\",\n IMMUTABALE_MARKER_SELECTOR = \"[\" + IMMUTABALE + \"]\",\n IMMUTABLE_SELECTOR = \"[contenteditable='false']\";\n\n var rootCondition = function(node) {\n return $(node).is(\"body,.k-editor\");\n };\n\n var immutable = function(node) {\n return node.getAttribute && node.getAttribute(\"contenteditable\") == \"false\";\n };\n\n var immutableParent = function(node) {\n return dom.closestBy(node, immutable, rootCondition);\n };\n\n var expandImmutablesIn = function(range) {\n var startImmutableParent = immutableParent(range.startContainer);\n var endImmutableParent = immutableParent(range.endContainer);\n\n if (startImmutableParent || endImmutableParent) {\n if (startImmutableParent) {\n range.setStartBefore(startImmutableParent);\n }\n if (endImmutableParent) {\n range.setEndAfter(endImmutableParent);\n }\n }\n };\n\n var immutablesContext = function(range) {\n if (immutableParent(range.commonAncestorContainer)) {\n return true;\n } else if (immutableParent(range.startContainer) || immutableParent(range.endContainer)) {\n var editableNodes = RangeUtils.editableTextNodes(range);\n if (editableNodes.length === 0) {\n return true;\n }\n }\n return false;\n };\n\n var randomId = function(length) {\n var result = '';\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (var i = length || 10; i > 0; --i) {\n result += chars.charAt(Math.round(Math.random() * (chars.length - 1)));\n }\n return result;\n };\n\n var removeImmutables = function(root) {\n var serializedImmutables = { empty: true }, nodeName, id, serialized;\n $(root).find(IMMUTABLE_SELECTOR).each(function(i, node) {\n nodeName = dom.name(node);\n id = randomId();\n serialized = \"<\" + nodeName + \" \" + IMMUTABALE + \"='\" + id + \"'>\";\n serializedImmutables[id] = { node: node, style: $(node).attr(\"style\") };\n serializedImmutables.empty = false;\n $(node).replaceWith(serialized);\n });\n\n return serializedImmutables;\n };\n\n var restoreImmutables = function(root, serializedImmutables) {\n var id, immutable;\n $(root).find(IMMUTABALE_MARKER_SELECTOR).each(function(i, node) {\n id = node.getAttribute(IMMUTABALE);\n immutable = serializedImmutables[id];\n $(node).replaceWith(immutable.node);\n if (immutable.style != $(immutable.node).attr(\"style\")) {\n $(immutable.node).removeAttr(\"style\").attr(\"style\", immutable.style);\n }\n });\n };\n\n var deletingKey = function(keyCode) {\n var keys = kendo.keys;\n return keyCode === keys.BACKSPACE || keyCode == keys.DELETE;\n };\n var updateToolOptions = function(tool) {\n var options = tool ? tool.options : undefined$1;\n if (options && options.finder) {\n options.finder._initOptions({ immutables: true });\n }\n };\n\n var Immutables = Class.extend({\n init: function(editor) {\n this.editor = editor;\n this.serializedImmutables = {};\n this.options = $.extend({}, editor && editor.options && editor.options.immutables);\n\n var tools = kendo.ui.Editor.defaultTools;\n updateToolOptions(tools.justifyLeft);\n updateToolOptions(tools.justifyCenter);\n updateToolOptions(tools.justifyRight);\n updateToolOptions(tools.justifyFull);\n },\n\n serialize: function(node) {\n var result = this._toHtml(node),\n id;\n\n if (result.indexOf(IMMUTABALE) === -1) {\n id = this.randomId();\n result = result.replace(/>/, ' ' + IMMUTABALE + '=\"' + id + '\">');\n } else {\n id = result.match(/k-immutable\\s*=\\s*['\"](.*)['\"]/)[1];\n }\n\n this.serializedImmutables[id] = node;\n return result;\n },\n\n _toHtml: function(node) {\n var serialization = this.options.serialization;\n var serializationType = typeof serialization;\n var nodeName;\n\n switch (serializationType) {\n case \"string\":\n return template(serialization)(node);\n case \"function\":\n return serialization(node);\n default:\n nodeName = dom.name(node);\n return \"<\" + nodeName + \">\";\n }\n },\n\n deserialize: function(node) {\n var that = this;\n var deserialization = this.options.deserialization;\n\n $(IMMUTABALE_MARKER_SELECTOR, node).each(function() {\n var id = this.getAttribute(IMMUTABALE);\n var immutable = that.serializedImmutables[id];\n if (kendo.isFunction(deserialization)) {\n deserialization(this, immutable);\n }\n $(this).replaceWith(immutable);\n });\n\n that.serializedImmutables = {};\n },\n\n randomId: function(length) {\n return randomId(length);\n },\n\n keydown: function(e, range) {\n var isDeleting = deletingKey(e.keyCode);\n var shouldCancelEvent = (isDeleting && this._cancelDeleting(e, range)) ||\n (!isDeleting && this._cancelTyping(e, range));\n\n if (shouldCancelEvent) {\n e.preventDefault();\n return true;\n }\n },\n\n _cancelTyping: function(e, range) {\n var editor = this.editor;\n var keyboard = editor.keyboard;\n\n return range.collapsed && !keyboard.typingInProgress &&\n keyboard.isTypingKey(e) && immutablesContext(range);\n },\n\n _cancelDeleting: function(e, range) {\n var keys = kendo.keys;\n var backspace = e.keyCode === keys.BACKSPACE;\n var del = e.keyCode == keys.DELETE;\n\n if (!backspace && !del) {\n return false;\n }\n var cancelDeleting = false;\n if (range.collapsed) {\n if (immutablesContext(range)) {\n return true;\n }\n var immutable = this.nextImmutable(range, del);\n if (immutable && backspace) {\n var closestSelectionLi = dom.closest(range.commonAncestorContainer, \"li\");\n if (closestSelectionLi) {\n var closestImmutableLi = dom.closest(immutable, \"li\");\n if (closestImmutableLi && closestImmutableLi !== closestSelectionLi) {\n return cancelDeleting;\n }\n }\n }\n if (immutable && !dom.tableCell(immutable)) {\n if (dom.parentOfType(immutable, complexBlocks) === dom.parentOfType(range.commonAncestorContainer, complexBlocks)) {\n while (immutable && immutable.parentNode.childNodes.length == 1) {\n immutable = immutable.parentNode;\n }\n if (dom.tableCell(immutable)) {\n return cancelDeleting;\n }\n this._removeImmutable(immutable, range);\n }\n cancelDeleting = true;\n }\n }\n return cancelDeleting;\n },\n\n nextImmutable: function(range, forwards) {\n var commonContainer = range.commonAncestorContainer;\n if (dom.isBom(commonContainer) || ((forwards && RangeUtils.isEndOf(range, commonContainer)) || (!forwards && RangeUtils.isStartOf(range, commonContainer)))) {\n var next = this._nextNode(commonContainer, forwards);\n if (next && dom.isBlock(next) && !immutableParent(next)) {\n while (next && next.children && next.children[forwards ? 0 : next.children.length - 1]) {\n next = next.children[forwards ? 0 : next.children.length - 1];\n }\n }\n return immutableParent(next);\n }\n },\n\n _removeImmutable: function(immutable, range) {\n var editor = this.editor;\n var startRestorePoint = new Editor.RestorePoint(range, editor.body);\n dom.remove(immutable);\n Editor._finishUpdate(editor, startRestorePoint);\n },\n\n _nextNode: function(node, forwards) {\n var sibling = forwards ? \"nextSibling\" : \"previousSibling\";\n var current = node, next;\n while (current && !next) {\n next = current[sibling];\n if (next && dom.isDataNode(next) && /^\\s|[\\ufeff]$/.test(next.nodeValue)) {\n current = next;\n next = current[sibling];\n }\n if (!next) {\n current = current.parentNode;\n }\n }\n return next;\n }\n });\n\n Immutables.immutable = immutable;\n Immutables.immutableParent = immutableParent;\n Immutables.expandImmutablesIn = expandImmutablesIn;\n Immutables.immutablesContext = immutablesContext;\n Immutables.toolsToBeUpdated = toolsToBeUpdated;\n Immutables.removeImmutables = removeImmutables;\n Immutables.restoreImmutables = restoreImmutables;\n\n Editor.Immutables = Immutables;\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n editorNS = kendo.ui.editor,\n dom = editorNS.Dom,\n RestorePoint = editorNS.RestorePoint,\n Marker = editorNS.Marker,\n extend = $.extend;\n\n function finishUpdate(editor, startRestorePoint) {\n var endRestorePoint = editor.selectionRestorePoint = new RestorePoint(editor.getRange(), editor.body);\n var command = new GenericCommand(startRestorePoint, endRestorePoint);\n command.editor = editor;\n\n editor.undoRedoStack.push(command);\n editor._refreshTools();\n\n return endRestorePoint;\n }\n\n var Command = Class.extend({\n init: function(options) {\n this.options = options;\n this.restorePoint = new RestorePoint(options.range, options.body, { immutables: options.immutables });\n this.marker = new Marker();\n this.formatter = options.formatter;\n },\n\n getRange: function() {\n return this.restorePoint.toRange();\n },\n\n lockRange: function(expand) {\n return this.marker.add(this.getRange(), expand);\n },\n\n releaseRange: function(range) {\n this.marker.remove(range);\n this.editor.selectRange(range);\n },\n\n undo: function() {\n var point = this.restorePoint;\n point.restoreHtml();\n this.editor.selectRange(point.toRange());\n },\n\n redo: function() {\n this.exec();\n },\n\n createDialog: function(content, options) {\n var editor = this.editor;\n\n return $(content).appendTo(document.body)\n .kendoWindow(extend({}, editor.options.dialogOptions, options))\n .closest(\".k-window\")\n .addClass(\"k-editor-window\")\n .toggleClass(\"k-rtl\", kendo.support.isRtl(editor.wrapper)).end();\n },\n\n exec: function() {\n var range = this.lockRange(true);\n this.formatter.editor = this.editor;\n this.formatter.toggle(range);\n this.releaseRange(range);\n },\n\n immutables: function() {\n return this.editor && this.editor.options.immutables;\n },\n\n expandImmutablesIn: function(range) {\n if (this.immutables()) {\n kendo.ui.editor.Immutables.expandImmutablesIn(range);\n this.restorePoint = new RestorePoint(range, this.editor.body);\n }\n },\n\n _actionButtonsTemplate: function(ref) {\n var messages = ref.messages;\n var insertButtonIcon = ref.insertButtonIcon;\n var cancelButtonIcon = ref.cancelButtonIcon;\n\n return '
' +\n kendo.html.renderButton((\"\"), { themeColor: \"primary\", icon: insertButtonIcon }) +\n kendo.html.renderButton((\"\"), { icon: cancelButtonIcon }) +\n '
';\n }\n });\n\n var GenericCommand = Class.extend({\n init: function(startRestorePoint, endRestorePoint) {\n this.body = startRestorePoint.body;\n this.startRestorePoint = startRestorePoint;\n this.endRestorePoint = endRestorePoint;\n },\n\n redo: function() {\n dom.removeChildren(this.body);\n\n this.body.innerHTML = this.endRestorePoint.html;\n this.editor.selectRange(this.endRestorePoint.toRange());\n },\n\n undo: function() {\n dom.removeChildren(this.body);\n\n this.body.innerHTML = this.startRestorePoint.html;\n this.editor.selectRange(this.startRestorePoint.toRange());\n }\n });\n\n extend(editorNS, {\n _finishUpdate: finishUpdate,\n Command: Command,\n GenericCommand: GenericCommand\n });\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n Command = Editor.Command,\n Tool = Editor.Tool,\n dom = Editor.Dom;\n\n var ViewHtmlCommand = Command.extend({\n init: function(options) {\n var cmd = this;\n cmd.options = options;\n Command.fn.init.call(cmd, options);\n cmd.attributes = null;\n cmd.async = true;\n },\n\n exec: function() {\n var that = this,\n editor = that.editor,\n options = editor.options,\n messages = editor.options.messages,\n dialog = $(kendo.template(ViewHtmlCommand.template)(messages)).appendTo(document.body),\n textarea = \".k-editor-textarea > textarea\",\n content, comments;\n\n options.serialization.immutables = editor.immutables;\n\n comments = dom.getAllComments(editor.body);\n\n content = EditorUtils.cacheComments(editor.value(), comments);\n content = ViewHtmlCommand.indent(content);\n content = EditorUtils.retrieveComments(content, comments);\n\n options.serialization.immutables = undefined$1;\n\n function apply(e) {\n options.deserialization.immutables = editor.immutables;\n editor.value(dialog.find(textarea).val());\n options.deserialization.immutables = undefined$1;\n\n close(e);\n\n if (that.change) {\n that.change();\n }\n\n editor.trigger(\"change\");\n }\n\n function close(e) {\n e.preventDefault();\n\n dialog.data(\"kendoWindow\").destroy();\n\n if (editor.immutables) {\n editor.immutables.serializedImmutables = {};\n }\n\n editor.focus();\n }\n\n var window = this.createDialog(dialog, {\n title: messages.viewHtml,\n _footerTemplate: ViewHtmlCommand._footerTemplate,\n _footerMessages: messages,\n width: 600,\n height: 400,\n resizable: true,\n close: close,\n visible: false\n })\n .find(textarea).val(content).end()\n .data(\"kendoWindow\");\n\n window.center().open();\n\n window.wrapper.find(\".k-dialog-update\").on(\"click\", apply).end();\n window.wrapper.find(\".k-dialog-close\").on(\"click\", close).end();\n dialog.find(textarea).trigger(\"focus\");\n }\n });\n\n extend(ViewHtmlCommand, {\n template: function () { return '
' +\n '' +\n '
'; },\n _footerTemplate: function (ref) {\n var dialogUpdate = ref.dialogUpdate;\n var dialogCancel = ref.dialogCancel;\n\n return \"
\" +\n kendo.html.renderButton((\"\"), { themeColor: \"primary\", icon: \"check\" }) +\n kendo.html.renderButton((\"\"), { icon: \"cancel-outline\" }) +\n \"
\";\n },\n indent: function(content) {\n return content.replace(/<\\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/ig, \"\\n\")\n .replace(/<(ul|ol)([^>]*)>
  • \\n/ig, \"
    \\n\")\n .replace(/\\n$/, \"\");\n }\n });\n\n kendo.ui.editor.ViewHtmlCommand = ViewHtmlCommand;\n\n Editor.EditorUtils.registerTool(\"viewHtml\", new Tool({ command: ViewHtmlCommand }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n var kendo = window.kendo,\n extend = $.extend,\n Editor = kendo.ui.editor,\n Tool = Editor.Tool,\n Command = Editor.Command,\n EditorUtils = Editor.EditorUtils;\n\n var FormatCommand = Command.extend({\n init: function(options) {\n options.formatter = options.formatter();\n var finder = options.formatter.finder;\n if (finder && EditorUtils.formatByName(\"immutable\", finder.format)) {\n finder._initOptions({ immutables: options.immutables });\n }\n Command.fn.init.call(this, options);\n }\n });\n\n var FormatTool = Tool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n },\n\n command: function(commandArguments) {\n var that = this;\n\n return new FormatCommand(extend(commandArguments, {\n formatter: that.options.formatter\n }));\n },\n\n update: function(ui, nodes) {\n var isFormatted = this.options.finder.isFormatted(nodes),\n toolbar = ui.closest(\".k-toolbar\").getKendoToolBar();\n\n if (toolbar && ui.getKendoToggleButton()) {\n toolbar.toggle(ui, isFormatted);\n }\n }\n });\n\n $.extend(Editor, {\n FormatCommand: FormatCommand,\n FormatTool: FormatTool\n });\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n var kendo = window.kendo,\n Class = kendo.Class,\n Editor = kendo.ui.editor,\n formats = kendo.ui.Editor.fn.options.formats,\n Tool = Editor.Tool,\n FormatTool = Editor.FormatTool,\n dom = Editor.Dom,\n RangeUtils = Editor.RangeUtils,\n extend = $.extend,\n registerTool = Editor.EditorUtils.registerTool,\n registerFormat = Editor.EditorUtils.registerFormat,\n MOUSEDOWN_NS = \"mousedown.kendoEditor\",\n KEYDOWN_NS = \"keydown.kendoEditor\",\n KMARKER = \"k-marker\";\n\n var InlineFormatFinder = Class.extend({\n init: function(format) {\n this.format = format;\n },\n\n numberOfSiblings: function(referenceNode) {\n var textNodesCount = 0,\n elementNodesCount = 0,\n markerCount = 0,\n parentNode = referenceNode.parentNode,\n node;\n\n for (node = parentNode.firstChild; node; node = node.nextSibling) {\n if (node != referenceNode) {\n if (node.className == KMARKER) {\n markerCount++;\n } else if (node.nodeType == 3) {\n textNodesCount++;\n } else {\n elementNodesCount++;\n }\n }\n }\n\n if (markerCount > 1 && parentNode.firstChild.className == KMARKER && parentNode.lastChild.className == KMARKER) {\n // full node selection\n return 0;\n } else {\n return elementNodesCount + textNodesCount;\n }\n },\n\n findSuitable: function(sourceNode, skip) {\n if (!skip && this.numberOfSiblings(sourceNode) > 0) {\n return null;\n }\n\n var node = sourceNode.parentNode;\n var tags = this.format[0].tags;\n\n while (!dom.ofType(node, tags)) {\n if (this.numberOfSiblings(node) > 0) {\n return null;\n }\n\n node = node.parentNode;\n }\n\n return node;\n },\n\n findFormat: function(sourceNode) {\n var format = this.format,\n attrEquals = dom.attrEquals,\n i, len, node, tags, attributes;\n\n for (i = 0, len = format.length; i < len; i++) {\n node = sourceNode;\n tags = format[i].tags;\n attributes = format[i].attr;\n\n if (node && dom.ofType(node, tags) && attrEquals(node, attributes)) {\n return node;\n }\n\n while (node) {\n node = dom.parentOfType(node, tags);\n if (node && attrEquals(node, attributes)) {\n return node;\n }\n }\n }\n\n return null;\n },\n\n isFormatted: function(nodes) {\n var i, len;\n\n for (i = 0, len = nodes.length; i < len; i++) {\n if (this.findFormat(nodes[i])) {\n return true;\n }\n }\n return false;\n }\n });\n\n var InlineFormatter = Class.extend({\n init: function(format, values) {\n this.finder = new InlineFormatFinder(format);\n this.attributes = extend({}, format[0].attr, values);\n this.tag = format[0].tags[0];\n },\n\n wrap: function(node) {\n return dom.wrap(node, dom.create(node.ownerDocument, this.tag, this.attributes));\n },\n\n activate: function(range, nodes) {\n if (this.finder.isFormatted(nodes)) {\n this.split(range);\n this.remove(nodes);\n } else {\n this.apply(nodes);\n }\n },\n\n toggle: function(range) {\n var textNodes = this.immutables() ? RangeUtils.editableTextNodes : RangeUtils.textNodes;\n var nodes = textNodes(range);\n\n if (nodes.length > 0) {\n this.activate(range, nodes);\n }\n },\n\n immutables: function() {\n return this.editor && this.editor.options.immutables;\n },\n\n apply: function(nodes) {\n var formatNodes = [];\n var i, l, node, formatNode;\n\n if (nodes.length > 1) {\n for (i = 0, l = nodes.length; i < l; i++) {\n node = nodes[i];\n formatNode = this.format(node, true);\n formatNodes.push(formatNode);\n\n }\n } else {\n node = nodes[0];\n formatNode = this.format(node, false);\n }\n\n this.consolidate(formatNodes);\n },\n\n format: function(node, outerMostInline) {\n var formatNode = this.finder.findSuitable(node);\n var attributes = this.attributes;\n var styleAttr = attributes ? attributes.style || {} : {};\n\n if (formatNode) {\n if (dom.is(formatNode, \"font\")) {\n if (styleAttr.color) {\n formatNode.removeAttribute(\"color\");\n }\n if (styleAttr.fontName) {\n formatNode.removeAttribute(\"face\");\n }\n if (styleAttr.fontSize) {\n formatNode.removeAttribute(\"size\");\n }\n }\n dom.attr(formatNode, attributes);\n } else {\n while (!dom.isBlock(node.parentNode) && node.parentNode.childNodes.length == 1 && node.parentNode.contentEditable !== 'true' && outerMostInline) {\n node = node.parentNode;\n }\n\n formatNode = this.wrap(node);\n }\n\n return formatNode;\n },\n\n remove: function(nodes) {\n var i, l, formatNode;\n\n for (i = 0, l = nodes.length; i < l; i++) {\n formatNode = this.finder.findFormat(nodes[i]);\n if (formatNode) {\n if (this.attributes && this.attributes.style) {\n dom.unstyle(formatNode, this.attributes.style);\n if (!formatNode.style.cssText && !formatNode.attributes[\"class\"]) {\n dom.unwrap(formatNode);\n }\n } else {\n dom.unwrap(formatNode);\n }\n }\n }\n },\n\n split: function(range) {\n var nodes = RangeUtils.textNodes(range);\n var l = nodes.length;\n var i, formatNode;\n\n if (l > 0) {\n for (i = 0; i < l; i++) {\n formatNode = this.finder.findFormat(nodes[i]);\n if (formatNode) {\n RangeUtils.split(range, formatNode, true);\n }\n }\n }\n },\n\n consolidate: function(nodes) {\n var node, last;\n\n while (nodes.length > 1) {\n node = nodes.pop();\n last = nodes[nodes.length - 1];\n\n if (node.previousSibling && node.previousSibling.className == KMARKER) {\n last.appendChild(node.previousSibling);\n }\n\n if (node.tagName == last.tagName &&\n node.previousSibling == last &&\n node.style.cssText == last.style.cssText &&\n node.className === last.className) {\n\n while (node.firstChild) {\n last.appendChild(node.firstChild);\n }\n\n dom.remove(node);\n }\n }\n }\n });\n\n var GreedyInlineFormatFinder = InlineFormatFinder.extend({\n init: function(format, greedyProperty, fontAttr) {\n this.format = format;\n this.greedyProperty = greedyProperty;\n this.fontAttr = fontAttr;\n InlineFormatFinder.fn.init.call(this, format);\n },\n\n getInlineCssValue: function(node) {\n var attributes = node.attributes;\n var trim = kendo.trim;\n var i, l, attribute, name, attributeValue, css, pair, cssIndex, len;\n var propertyAndValue, property, value;\n\n if (!attributes) {\n return;\n }\n\n for (i = 0, l = attributes.length; i < l; i++) {\n attribute = attributes[i];\n name = attribute.nodeName;\n attributeValue = attribute.nodeValue;\n\n if (attribute.specified && name == \"style\") {\n\n css = trim(attributeValue || node.style.cssText).split(\";\");\n\n for (cssIndex = 0, len = css.length; cssIndex < len; cssIndex++) {\n pair = css[cssIndex];\n if (pair.length) {\n propertyAndValue = pair.split(\":\");\n property = trim(propertyAndValue[0].toLowerCase());\n value = trim(propertyAndValue[1]);\n\n if (property != this.greedyProperty) {\n continue;\n }\n\n return property.indexOf(\"color\") >= 0 ? dom.toHex(value) : value;\n }\n }\n }\n\n if (this.fontAttr && attribute.specified && name == this.fontAttr) {\n property = attribute.nodeValue;\n value = attribute.nodeValue;\n\n return property.indexOf(\"color\") >= 0 ? dom.toHex(value) : value;\n }\n }\n },\n\n getFormatInner: function(node) {\n var $node = $(dom.isDataNode(node) ? node.parentNode : node);\n var parents = $node.parentsUntil(\"[contentEditable]\").addBack().toArray().reverse();\n var i, len, value;\n\n for (i = 0, len = parents.length; i < len; i++) {\n value = this.greedyProperty == \"className\" ? parents[i].className : this.getInlineCssValue(parents[i]);\n\n if (value) {\n return value;\n }\n }\n\n return \"inherit\";\n },\n\n getFormat: function(nodes) {\n var result = this.getFormatInner(nodes[0]), i, len;\n\n for (i = 1, len = nodes.length; i < len; i++) {\n if (result != this.getFormatInner(nodes[i])) {\n return \"\";\n }\n }\n\n return result;\n },\n\n isFormatted: function(nodes) {\n return this.getFormat(nodes) !== \"\";\n }\n });\n\n var GreedyInlineFormatter = InlineFormatter.extend({\n init: function(format, values, greedyProperty) {\n InlineFormatter.fn.init.call(this, format, values);\n\n this.values = values;\n this.finder = new GreedyInlineFormatFinder(format, greedyProperty);\n\n if (greedyProperty) {\n this.greedyProperty = kendo.toCamelCase(greedyProperty);\n }\n\n },\n\n activate: function(range, nodes) {\n var greedyProperty = this.greedyProperty;\n var action = \"apply\";\n\n this.split(range);\n\n if (greedyProperty && this.values.style[greedyProperty] == \"inherit\") {\n action = \"remove\";\n }\n\n this[action](nodes);\n }\n });\n\n var InlineFormatTool = FormatTool.extend({\n init: function(options) {\n FormatTool.fn.init.call(this, extend(options, {\n finder: new InlineFormatFinder(options.format),\n formatter: function() { return new InlineFormatter(options.format); }\n }));\n }\n });\n\n var DelayedExecutionTool = Tool.extend({\n update: function(ui, nodes) {\n var list = ui.data(this.type);\n\n list.close();\n list.value(this.finder.getFormat(nodes));\n }\n });\n\n var FontTool = DelayedExecutionTool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n\n // IE has single selection hence we are using select box instead of combobox\n this.type = \"kendoComboBox\";\n this.format = [{ tags: [\"span\", \"font\"] }];\n this.finder = new GreedyInlineFormatFinder(this.format, options.cssAttr, options.fontAttr);\n },\n\n command: function(commandArguments) {\n var options = this.options,\n format = this.format,\n style = {};\n\n return new Editor.FormatCommand(extend(commandArguments, {\n formatter: function() {\n style[options.domAttr] = commandArguments.value;\n\n return new GreedyInlineFormatter(format, { style: style }, options.cssAttr);\n }\n }));\n },\n\n initialize: function(ui, editor) {\n var options = this.options,\n toolName = options.name,\n dataSource,\n range,\n widget = ui.data(\"kendoComboBox\"),\n defaultValue = [];\n\n if (!widget) {\n return;\n }\n\n if (options.defaultValue) {\n defaultValue = [{\n text: editor.options.messages[options.defaultValue[0].text],\n value: options.defaultValue[0].value\n }];\n }\n\n dataSource = defaultValue.concat(options.items ? options.items : (editor.options[toolName] || [] ));\n widget.setDataSource(dataSource);\n\n widget.bind(\"change\", function (e) {\n editor._range = range;\n Tool.exec(editor, toolName, e.sender.value());\n });\n\n widget.bind(\"close\", function () {\n setTimeout(function() {\n editor._deleteSavedRange();\n },0);\n });\n\n widget.value(\"inherit\");\n\n widget.wrapper.on(MOUSEDOWN_NS, \".k-select,.k-input-button,.k-input\", function() {\n var newRange = editor.getRange();\n range = editor._containsRange(newRange) ? newRange : range;\n })\n .on(KEYDOWN_NS, function(e) {\n if (e.keyCode === kendo.keys.ENTER) {\n editor._deleteSavedRange();\n e.preventDefault();\n }\n });\n }\n\n });\n\n var ColorTool = Tool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n\n this.format = [{ tags: [\"span\",\"font\"] }];\n this.finder = new GreedyInlineFormatFinder(this.format, options.cssAttr);\n },\n\n options: {\n palette: \"websafe\",\n columns: 18\n },\n\n update: function() {\n this._widget.close();\n },\n\n command: function(commandArguments) {\n var options = this.options,\n format = this.format,\n style = {};\n\n return new Editor.FormatCommand(extend(commandArguments, {\n formatter: function() {\n style[options.domAttr] = commandArguments.value;\n\n return new GreedyInlineFormatter(format, { style: style }, options.cssAttr);\n }\n }));\n },\n\n initialize: function(ui, editor) {\n var that = this,\n toolName = that.options.name,\n component = this._widget = ui.getKendoColorPicker();\n\n if (!component) {\n return;\n }\n\n component.bind(\"change\", function () {\n var color = component.value();\n\n if (color) {\n Tool.exec(editor, toolName, color);\n }\n\n delete that.storedRange;\n delete that._inputFocused;\n\n editor.focus();\n });\n\n component.bind(\"open\", function () {\n that.storedRange = editor.getRange();\n\n component._popup.element.on(MOUSEDOWN_NS, function(e) {\n if (!$(e.target).is(\"input.k-color-value\")) {\n e.preventDefault();\n }\n });\n\n if (!component._popup.element.is(\"[unselectable='on']\")) {\n component._popup.element\n .attr({ unselectable: \"on\" })\n .find(\"*:not(input)\").attr(\"unselectable\", \"on\")\n .end().find(\"input\").on(\"focus\", function() {\n that._inputFocused = true;\n });\n }\n\n component._popup.one(\"activate\", function () {\n component._popup.element.find(\".k-colorpalette\").trigger(\"focus\");\n });\n });\n\n component.bind(\"close\", function (e) {\n component._popup.element.off(MOUSEDOWN_NS);\n });\n\n component.unbind(\"activate\").bind(\"activate\", function (e) {\n if (!component._value || component._value.toCssRgba() === \"rgba(255, 255, 255, 0)\") {\n return;\n }\n\n component.trigger(\"change\");\n });\n\n component.wrapper\n .attr({ unselectable: \"on\" })\n .find(\"*:not(input)\").attr(\"unselectable\", \"on\");\n\n component.value(\"transparent\");\n }\n });\n\n extend(Editor, {\n InlineFormatFinder: InlineFormatFinder,\n InlineFormatter: InlineFormatter,\n DelayedExecutionTool: DelayedExecutionTool,\n GreedyInlineFormatFinder: GreedyInlineFormatFinder,\n GreedyInlineFormatter: GreedyInlineFormatter,\n InlineFormatTool: InlineFormatTool,\n FontTool: FontTool,\n ColorTool: ColorTool\n });\n\n registerFormat(\"bold\", [ { tags: [\"strong\", \"b\"] }, { tags: [\"span\"], attr: { style: { fontWeight: \"bold\" } } } ]);\n registerTool(\"bold\", new InlineFormatTool({\n key: \"B\",\n ctrl: true,\n format: formats.bold,\n ui: {\n togglable: true\n }\n }));\n\n registerFormat(\"italic\", [ { tags: [\"em\", \"i\"] }, { tags: [\"span\"], attr: { style: { fontStyle: \"italic\" } } } ]);\n registerTool(\"italic\", new InlineFormatTool({\n key: \"I\",\n ctrl: true,\n format: formats.italic,\n ui: {\n togglable: true\n }\n }));\n\n registerFormat(\"underline\", [ { tags: [\"span\"], attr: { style: { textDecoration: \"underline\" } } }, { tags: [\"u\"] } ]);\n registerTool(\"underline\", new InlineFormatTool({\n key: \"U\",\n ctrl: true,\n format: formats.underline,\n ui: {\n togglable: true\n }\n }));\n\n registerFormat(\"strikethrough\", [ { tags: [\"del\", \"strike\"] }, { tags: [\"span\"], attr: { style: { textDecoration: \"line-through\" } } } ]);\n registerTool(\"strikethrough\", new InlineFormatTool({\n format: formats.strikethrough,\n ui: {\n togglable: true\n }\n }));\n\n registerFormat(\"superscript\", [ { tags: [\"sup\"] } ]);\n registerTool(\"superscript\", new InlineFormatTool({\n format: formats.superscript,\n ui: {\n togglable: true\n }\n }));\n\n registerFormat(\"subscript\", [ { tags: [\"sub\"] } ]);\n registerTool(\"subscript\", new InlineFormatTool({\n format: formats.subscript,\n ui: {\n togglable: true\n }\n }));\n\n registerTool(\"foreColor\", new ColorTool({\n cssAttr: \"color\",\n fontAttr: \"color\",\n domAttr: \"color\",\n name: \"foreColor\",\n ui: {\n type: \"component\",\n overflow: \"never\",\n component: \"ColorPicker\",\n componentOptions: {\n views: [\"palette\"],\n toolIcon: \"foreground-color\",\n palette: \"websafe\",\n columns: 18,\n preview: false,\n input: false,\n buttons: false,\n commandOn: \"change\",\n closeOnSelect: true\n }\n }\n }));\n\n registerTool(\"backColor\", new ColorTool({\n cssAttr: \"background-color\",\n domAttr: \"backgroundColor\",\n name: \"backColor\",\n ui: {\n type: \"component\",\n overflow: \"never\",\n component: \"ColorPicker\",\n componentOptions: {\n views: [\"palette\"],\n toolIcon: \"droplet\",\n palette: \"websafe\",\n columns: 18,\n preview: false,\n input: false,\n buttons: false,\n commandOn: \"change\",\n closeOnSelect: true\n }\n }\n }));\n\n registerTool(\"fontName\", new FontTool({\n cssAttr: \"font-family\",\n fontAttr: \"face\",\n domAttr: \"fontFamily\",\n name: \"fontName\",\n defaultValue: [{ text: \"fontNameInherit\", value: \"inherit\" }],\n ui: {\n type: \"component\",\n component: \"ComboBox\",\n componentOptions: {\n dataValueField: \"value\",\n dataTextField: \"text\",\n valuePrimitive: true\n },\n overflow: \"never\"\n }\n }));\n\n registerTool(\"fontSize\", new FontTool({\n cssAttr: \"font-size\",\n fontAttr: \"size\",\n domAttr: \"fontSize\",\n name: \"fontSize\",\n defaultValue: [{ text: \"fontSizeInherit\", value: \"inherit\" }],\n ui: {\n type: \"component\",\n component: \"ComboBox\",\n componentOptions: {\n dataValueField: \"value\",\n dataTextField: \"text\",\n valuePrimitive: true\n },\n overflow: \"never\"\n }\n }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n encode = kendo.htmlEncode,\n Class = kendo.Class,\n extend = $.extend,\n Editor = kendo.ui.editor,\n dom = Editor.Dom,\n RangeUtils = Editor.RangeUtils,\n Command = Editor.Command,\n Tool = Editor.Tool,\n InlineFormatter = Editor.InlineFormatter,\n InlineFormatFinder = Editor.InlineFormatFinder,\n textNodes = RangeUtils.textNodes,\n editableTextNodes = RangeUtils.editableTextNodes,\n registerTool = Editor.EditorUtils.registerTool,\n keys = kendo.keys;\n\n var HTTP_PROTOCOL = \"http://\";\n var protocolRegExp = /^\\w*:\\/\\//;\n var endLinkCharsRegExp = /[\\w\\/\\$\\-_\\*\\?]/i;\n\n var LinkFormatFinder = Class.extend({\n findSuitable: function(sourceNode) {\n return dom.parentOfType(sourceNode, [\"a\"]);\n }\n });\n\n var LinkFormatter = Class.extend({\n init: function() {\n this.finder = new LinkFormatFinder();\n },\n\n apply: function(range, attributes) {\n var nodes = this.immutables ? editableTextNodes(range) : textNodes(range);\n var markers, doc, formatter, a, parent;\n\n if (attributes.innerText) {\n doc = RangeUtils.documentFromRange(range);\n markers = RangeUtils.getMarkers(range);\n\n range.deleteContents();\n a = dom.create(doc, \"a\", attributes);\n range.insertNode(a);\n\n parent = a.parentNode;\n if (dom.name(parent) == \"a\") {\n dom.insertAfter(a, parent);\n }\n\n if (dom.emptyNode(parent)) {\n dom.remove(parent);\n }\n\n // move range and markers after inserted link\n var ref = a;\n for (var i = 0; i < markers.length; i++) {\n dom.insertAfter(markers[i], ref);\n ref = markers[i];\n }\n\n if (markers.length) {\n dom.insertBefore(doc.createTextNode(\"\\ufeff\"), markers[1] || markers[0]);\n dom.insertAfter(doc.createTextNode(\"\\ufeff\"), markers[1] || markers[0]);\n range.setStartBefore(markers[0]);\n range.setEndAfter(markers[markers.length - 1]);\n }\n } else {\n formatter = new InlineFormatter([{ tags: [\"a\"] }], attributes);\n formatter.finder = this.finder;\n formatter.apply(nodes);\n }\n }\n });\n\n var UnlinkCommand = Command.extend({\n init: function(options) {\n var that = this;\n options.formatter = /** @ignore */ {\n toggle: function(range) {\n var nodes = that.immutables() ? editableTextNodes(range) : textNodes(range);\n new InlineFormatter([{ tags: [\"a\"] }]).remove(nodes);\n }\n };\n this.options = options;\n Command.fn.init.call(this, options);\n }\n });\n\n var LinkCommand = Command.extend({\n init: function(options) {\n var that;\n this.options = options;\n Command.fn.init.call(this, options);\n this.formatter = new LinkFormatter();\n\n if (!options.url) {\n this.attributes = null;\n this.async = true;\n } else {\n this.exec = function() {\n this.formatter.immutables = that && that.immutables();\n this.formatter.apply(options.range, {\n href: options.url,\n innerText: options.text || options.url,\n target: options.target\n });\n };\n }\n },\n\n exec: function() {\n var messages = this.editor.options.messages;\n this._initialText = \"\";\n this._range = this.lockRange(true);\n this.formatter.immutables = this.immutables();\n\n var nodes = textNodes(this._range);\n var a = nodes.length ? this.formatter.finder.findSuitable(nodes[0]) : null;\n var img = nodes.length && dom.name(nodes[0]) == \"img\";\n\n var dialog = this.createDialog(\"
    \", {\n title: messages.createLink,\n minWidth: 340,\n close: this._close.bind(this),\n visible: false\n }).data(\"kendoWindow\");\n\n this._form = this._createForm(dialog);\n\n if (a) {\n this._range.selectNodeContents(a);\n nodes = textNodes(this._range);\n }\n\n this._initialText = this.linkText(nodes);\n\n dialog.wrapper\n .find(\".k-dialog-insert\").on(\"click\", this._apply.bind(this)).end()\n .find(\".k-dialog-close\").on(\"click\", this._close.bind(this)).end()\n .find(\".k-form-field input\").on(\"keydown\", this._keydown.bind(this)).end()\n .find(\"#k-editor-link-url\").val(this.linkUrl(a)).end()\n .find(\"#k-editor-link-text\").val(this._initialText).end()\n .find(\"#k-editor-link-title\").val(a ? a.title : \"\").end()\n .find(\"#k-editor-link-target\").prop(\"checked\", a ? a.target == \"_blank\" : false).end()\n .find(\".k-editor-link-text-row\").toggle(!img);\n\n this._dialog = dialog.center().open();\n\n $(\"#k-editor-link-url\", dialog.element).trigger(\"focus\").select();\n },\n\n _createForm: function(dialog) {\n var that = this;\n var formElement = $(\"
    \").appendTo(dialog.element);\n var messages = that.editor.options.messages;\n var form = formElement.kendoForm({\n renderButtons: false,\n items: [\n {\n field: \"k-editor-link-url\",\n label: encode(messages.linkWebAddress),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-link-text\",\n label: encode(messages.linkText),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-link-title\",\n label: encode(messages.linkToolTip),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-link-target\",\n editorOptions: {\n label: encode(messages.linkOpenInNewWindow)\n },\n label: \"\",\n editor: \"CheckBox\"\n }\n ]\n }).data(\"kendoForm\");\n\n formElement.find(\"#k-editor-link-text\").parents(\".k-form-field\").addClass(\"k-editor-link-text-row\");\n\n dialog.element.after($(that._actionButtonsTemplate({ messages: messages, insertButtonIcon: \"link\", cancelButtonIcon: \"cancel-outline\" })));\n\n return form;\n },\n\n _keydown: function(e) {\n var keys = kendo.keys;\n\n if (e.keyCode == keys.ENTER) {\n this._apply(e);\n } else if (e.keyCode == keys.ESC) {\n this._close(e);\n }\n },\n\n _apply: function(e) {\n var element = this._dialog.element;\n var href = $(\"#k-editor-link-url\", element).val();\n var title, text, target;\n var textInput = $(\"#k-editor-link-text\", element);\n\n if (href && href != HTTP_PROTOCOL) {\n\n if (href.indexOf(\"@\") > 0 && !/^(\\w+:)|(\\/\\/)/i.test(href)) {\n href = \"mailto:\" + href;\n }\n\n this.attributes = { href: href };\n\n title = $(\"#k-editor-link-title\", element).val();\n if (title) {\n this.attributes.title = title;\n }\n\n if (textInput.is(\":visible\")) {\n text = kendo.trim(textInput.val());\n if (!text && !this._initialText) {\n this.attributes.innerText = href;\n } else if (text && (text !== this._initialText)) {\n this.attributes.innerText = dom.stripBom(text);\n }\n }\n\n target = $(\"#k-editor-link-target\", element).is(\":checked\");\n this.attributes.target = target ? \"_blank\" : null;\n\n this.formatter.apply(this._range, this.attributes);\n }\n\n this._close(e);\n\n if (this.change) {\n this.change();\n }\n },\n\n _close: function(e) {\n e.preventDefault();\n this._form.destroy();\n this._dialog.destroy();\n\n dom.windowFromDocument(RangeUtils.documentFromRange(this._range)).focus();\n\n this.releaseRange(this._range);\n },\n\n linkUrl: function(anchor) {\n if (anchor) {\n // IE < 8 returns absolute url if getAttribute is not used\n return anchor.getAttribute(\"href\", 2);\n }\n\n return HTTP_PROTOCOL;\n },\n\n linkText: function(nodes) {\n var text = \"\";\n var i;\n\n for (i = 0; i < nodes.length; i++) {\n text += nodes[i].nodeValue;\n }\n\n return dom.stripBom(text || \"\");\n },\n\n redo: function() {\n var range = this.lockRange(true);\n\n this.formatter.apply(range, this.attributes);\n this.releaseRange(range);\n }\n\n });\n\n var AutoLinkCommand = Command.extend({\n init: function(options) {\n Command.fn.init.call(this, options);\n\n this.formatter = new LinkFormatter();\n },\n\n exec: function() {\n var detectedLink = this.detectLink();\n if (!detectedLink) {\n return;\n }\n\n var range = this.getRange();\n var linkMarker = new kendo.ui.editor.Marker();\n var linkRange = range.cloneRange();\n\n linkRange.setStart(detectedLink.start.node, detectedLink.start.offset);\n linkRange.setEnd(detectedLink.end.node, detectedLink.end.offset);\n\n range = this.lockRange();\n linkMarker.add(linkRange);\n\n this.formatter.apply(linkRange, {\n href: this._ensureWebProtocol(detectedLink.text)\n });\n\n linkMarker.remove(linkRange);\n this.releaseRange(range);\n },\n\n detectLink: function() {\n var range = this.getRange();\n var startNode = range.startContainer;\n var startOffset = range.startOffset;\n var prev = startNode.previousSibling;\n if (!prev && ((dom.isBom(startNode) && !startNode.nextSibling) || (!startOffset && dom.isDataNode(startNode)))) {\n startNode = startNode.parentNode;\n startOffset = 0;\n }\n var traverser = new LeftDomTextTraverser({\n node: startNode,\n offset: startOffset,\n cancelAtNode: function(node) { return node && dom.name(node) === \"a\"; }\n });\n\n var detection = new DomTextLinkDetection(traverser);\n return detection.detectLink();\n },\n\n changesContent: function() {\n return !!this.detectLink();\n },\n\n _ensureWebProtocol: function(linkText) {\n var hasProtocol = this._hasProtocolPrefix(linkText);\n return hasProtocol ? linkText : this._prefixWithWebProtocol(linkText);\n },\n\n _hasProtocolPrefix: function(linkText) {\n return protocolRegExp.test(linkText);\n },\n\n _prefixWithWebProtocol: function(linkText) {\n return HTTP_PROTOCOL + linkText;\n }\n });\n\n var UnlinkTool = Tool.extend({\n init: function(options) {\n this.options = options;\n this.finder = new InlineFormatFinder([{ tags: [\"a\"] }]);\n\n Tool.fn.init.call(this, $.extend(options, { command: UnlinkCommand }));\n },\n\n update: function(ui, nodes) {\n var isLink = this.finder.isFormatted(nodes),\n toolbar = ui.closest(\".k-toolbar\").data(\"kendoToolBar\");\n\n if (isLink) {\n toolbar.enable(ui, true);\n } else {\n toolbar.enable(ui, false);\n }\n }\n });\n\n var DomTextLinkDetection = Class.extend({\n init: function(traverser) {\n this.traverser = traverser;\n this.start = DomPos();\n this.end = DomPos();\n this.text = \"\";\n },\n\n detectLink: function() {\n var node = this.traverser.node;\n var offset = this.traverser.offset;\n if (dom.isDataNode(node)) {\n var text = node.data.substring(0, offset);\n if (/\\s{2}$/.test(dom.stripBom(text))) {\n return;\n }\n } else if (offset === 0) {//heuristic for new line\n var p = dom.closestEditableOfType(node, dom.blockElements);\n if (p && p.previousSibling) {\n this.traverser.init({\n node: p.previousSibling\n });\n }\n }\n\n this.traverser.traverse(this._detectEnd.bind(this));\n if (!this.end.blank()) {\n this.traverser = this.traverser.clone(this.end);\n this.traverser.traverse(this._detectStart.bind(this));\n\n if (!this._isLinkDetected()) {\n var puntuationOptions = this.traverser.extendOptions(this.start);\n var puntuationTraverser = new RightDomTextTraverser(puntuationOptions);\n puntuationTraverser.traverse(this._skipStartPuntuation.bind(this));\n if (!this._isLinkDetected()) {\n this.start = DomPos();\n }\n }\n }\n\n if (this.start.blank()) {\n return null;\n } else {\n return {\n start: this.start,\n end: this.end,\n text: this.text\n };\n }\n },\n\n _isLinkDetected: function() {\n return protocolRegExp.test(this.text) || /^w{3}\\./i.test(this.text);\n },\n\n _detectEnd: function(text, node) {\n var i = lastIndexOfRegExp(text, endLinkCharsRegExp);\n if (i > -1) {\n this.end.node = node;\n this.end.offset = i + 1;\n\n return false;\n }\n },\n\n _detectStart: function(text, node) {\n var i = lastIndexOfRegExp(text, /\\s/);\n var ii = i + 1;\n this.text = text.substring(ii) + this.text;\n\n this.start.node = node;\n this.start.offset = ii;\n\n if (i > -1) {\n return false;\n }\n },\n\n _skipStartPuntuation: function(text, node, offset) {\n var i = indexOfRegExp(text, /\\w/);\n var ii = i;\n if (i === -1) {\n ii = text.length;\n }\n\n this.text = this.text.substring(ii);\n this.start.node = node;\n this.start.offset = ii + (offset | 0);\n\n if (i > -1) {\n return false;\n }\n }\n });\n\n function lastIndexOfRegExp(str, search) {\n var i = str.length;\n while (i-- && !search.test(str[i])) {}\n\n return i;\n }\n function indexOfRegExp(str, search) {\n var r = search.exec(str);\n\n return r ? r.index : -1;\n }\n\n var DomPos = function() {\n return {\n node: null,\n offset: null,\n blank: function() {\n return this.node === null && this.offset === null;\n }\n };\n };\n\n var DomTextTraverser = Class.extend({\n init: function(options) {\n this.node = options.node;\n this.offset = options.offset === undefined$1 ? (dom.isDataNode(this.node) && this.node.length) || 0 : options.offset;\n this.cancelAtNode = options.cancelAtNode || this.cancelAtNode || $.noop;\n },\n\n traverse: function(callback) {\n if (!callback) {\n return;\n }\n this.cancel = false;\n this._traverse(callback, this.node, this.offset);\n },\n\n _traverse: function(callback, node, offset) {\n if (!node || this.cancel) {\n return;\n }\n if (node.nodeType === 3) {\n var text = node.data;\n if (offset !== undefined$1) {\n text = this.subText(text, offset);\n }\n this.cancel = (callback(text, node, offset) === false);\n }\n else {\n var edgeNode = this.edgeNode(node);\n this.cancel = this.cancel || this.cancelAtNode(edgeNode);\n return this._traverse(callback, edgeNode);\n }\n\n var next = this.next(node);\n if (!next) {\n var parent = node.parentNode;\n while (!next && dom.isInline(parent)) {\n next = this.next(parent);\n parent = parent.parentNode;\n }\n }\n this.cancel = this.cancel || this.cancelAtNode(next);\n this._traverse(callback, next);\n },\n\n extendOptions: function(o) {\n return $.extend({\n node: this.node,\n offset: this.offset,\n cancelAtNode: this.cancelAtNode\n }, o || {});\n },\n\n edgeNode: function(node) {},\n next: function(node) {},\n subText: function(text, offset) {}\n\n });\n\n var LeftDomTextTraverser = DomTextTraverser.extend({\n subText: function(text, splitIndex) {\n return text.substring(0, splitIndex);\n },\n\n next: function(node) {\n return node.previousSibling;\n },\n\n edgeNode: function(node) {\n return node.lastChild;\n },\n\n clone: function(options) {\n var o = this.extendOptions(options);\n return new LeftDomTextTraverser(o);\n }\n });\n\n var RightDomTextTraverser = DomTextTraverser.extend({\n subText: function(text, splitIndex) {\n return text.substring(splitIndex);\n },\n\n next: function(node) {\n return node.nextSibling;\n },\n\n edgeNode: function(node) {\n return node.firstChild;\n },\n\n clone: function(options) {\n var o = this.extendOptions(options);\n return new RightDomTextTraverser(o);\n }\n });\n\n extend(kendo.ui.editor, {\n LinkFormatFinder: LinkFormatFinder,\n LinkFormatter: LinkFormatter,\n UnlinkCommand: UnlinkCommand,\n LinkCommand: LinkCommand,\n AutoLinkCommand: AutoLinkCommand,\n UnlinkTool: UnlinkTool,\n DomTextLinkDetection: DomTextLinkDetection,\n LeftDomTextTraverser: LeftDomTextTraverser,\n RightDomTextTraverser: RightDomTextTraverser\n });\n\n registerTool(\"createLink\", new Tool({ key: \"K\", ctrl: true, command: LinkCommand }));\n registerTool(\"unlink\", new UnlinkTool({ key: \"K\", ctrl: true, shift: true, ui: { enable: false } }));\n registerTool(\"autoLink\", new Tool({ key: [keys.ENTER, keys.SPACEBAR], keyPressCommand: true, command: AutoLinkCommand }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n var kendo = window.kendo,\n Class = kendo.Class,\n extend = $.extend,\n Editor = kendo.ui.editor,\n formats = kendo.ui.Editor.fn.options.formats,\n dom = Editor.Dom,\n FormatTool = Editor.FormatTool,\n EditorUtils = Editor.EditorUtils,\n registerTool = EditorUtils.registerTool,\n registerFormat = EditorUtils.registerFormat,\n RangeUtils = Editor.RangeUtils;\n\n var BlockFormatFinder = Class.extend({\n init: function(format) {\n this.format = format;\n },\n\n contains: function(node, children) {\n var i, len, child;\n\n for (i = 0, len = children.length; i < len; i++) {\n child = children[i];\n if (!child || !dom.isAncestorOrSelf(node, child)) {\n return false;\n }\n }\n\n return true;\n },\n\n findSuitable: function(nodes) {\n var format = this.format,\n suitable = [],\n i, len, candidate;\n\n for (i = 0, len = nodes.length; i < len; i++) {\n for (var f = format.length - 1; f >= 0; f--) {\n candidate = dom.ofType(nodes[i], format[f].tags) ? nodes[i] : dom.closestEditableOfType(nodes[i], format[f].tags);\n if (candidate) {\n break;\n }\n }\n\n if (!candidate || candidate.contentEditable === 'true') {\n return [];\n }\n\n if ($.inArray(candidate, suitable) < 0) {\n suitable.push(candidate);\n }\n }\n\n this._resolveListsItems(suitable);\n\n for (i = 0, len = suitable.length; i < len; i++) {\n if (this.contains(suitable[i], suitable)) {\n return [suitable[i]];\n }\n }\n\n return suitable;\n },\n _resolveListsItems: function(nodes) {\n var i, node, wrapper;\n for (i = 0; i < nodes.length; i++) {\n node = nodes[i];\n wrapper = dom.is(node, \"li\") ? node : dom.wrapper(node);\n wrapper = wrapper && dom.list(wrapper) ? wrapper.children[0] : wrapper;\n if (dom.is(wrapper, \"li\")) {\n node = nodes[i] = wrapper;\n }\n }\n },\n\n findFormat: function(sourceNode, until) {\n var format = this.format,\n i, len, node, tags, attributes;\n var editableParent = dom.editableParent(sourceNode);\n var immutables = this.options && this.options.immutables;\n var ImmutablesNS = Editor.Immutables;\n\n for (i = 0, len = format.length; i < len; i++) {\n node = sourceNode;\n tags = format[i].tags;\n attributes = format[i].attr;\n\n if (immutables && tags && tags[0] == \"immutable\") {\n var immutable = ImmutablesNS.immutableParent(node);\n if (immutable && dom.attrEquals(immutable, attributes)) {\n return node;\n }\n }\n\n while (node && dom.isAncestorOf(editableParent, node)) {\n if (dom.ofType(node, tags) && dom.attrEquals(node, attributes)) {\n return node;\n }\n\n if (until && until(node)) {\n break;\n }\n\n node = node.parentNode;\n }\n }\n return null;\n },\n\n getFormat: function(nodes) {\n var that = this,\n findFormat = function(node) {\n return that.findFormat(dom.isDataNode(node) ? node.parentNode : node);\n },\n result = findFormat(nodes[0]),\n i, len;\n\n if (!result) {\n return \"\";\n }\n\n for (i = 1, len = nodes.length; i < len; i++) {\n if (result != findFormat(nodes[i])) {\n return \"\";\n }\n }\n\n return result.nodeName.toLowerCase();\n },\n\n isFormatted: function(nodes, until) {\n for (var i = 0, len = nodes.length; i < len; i++) {\n if (!this.findFormat(nodes[i], until)) {\n return false;\n }\n }\n\n return true;\n }\n });\n\n var BlockFormatter = Class.extend({\n init: function(format, values) {\n this.format = format;\n this.values = values;\n this.finder = new BlockFormatFinder(format);\n },\n\n wrap: function(tag, attributes, nodes) {\n\n var commonAncestor = nodes.length == 1 ? dom.blockParentOrBody(nodes[0]) : dom.commonAncestor.apply(null, nodes);\n\n if (dom.isInline(commonAncestor)) {\n commonAncestor = dom.blockParentOrBody(commonAncestor);\n }\n\n var ancestors = dom.significantChildNodes(commonAncestor),\n position = dom.findNodeIndex(ancestors[0]),\n wrapper = dom.create(commonAncestor.ownerDocument, tag, attributes),\n i, ancestor;\n\n for (i = 0; i < ancestors.length; i++) {\n ancestor = ancestors[i];\n if (dom.isBlock(ancestor)) {\n dom.attr(ancestor, attributes);\n\n if (wrapper.childNodes.length) {\n dom.insertBefore(wrapper, ancestor);\n wrapper = wrapper.cloneNode(false);\n }\n\n position = dom.findNodeIndex(ancestor) + 1;\n\n continue;\n }\n\n wrapper.appendChild(ancestor);\n }\n\n if (wrapper.firstChild) {\n dom.insertAt(commonAncestor, wrapper, position);\n }\n },\n\n apply: function(nodes) {\n var format, values = this.values;\n\n function attributes(format) {\n return extend({}, format && format.attr, values);\n }\n\n this._handleImmutables(nodes, true);\n\n var images = dom.filter(\"img\", nodes);\n var imageFormat = EditorUtils.formatByName(\"img\", this.format);\n var imageAttributes = attributes(imageFormat);\n $.each(images, function() {\n dom.attr(this, imageAttributes);\n });\n\n // only images were selected, no need to wrap\n if (images.length == nodes.length) {\n return;\n }\n\n var nonImages = dom.filter(\"img\", nodes, true);\n var formatNodes = this.finder.findSuitable(nonImages);\n\n if (formatNodes.length) {\n for (var i = 0, len = formatNodes.length; i < len; i++) {\n format = EditorUtils.formatByName(dom.name(formatNodes[i]), this.format);\n dom.attr(formatNodes[i], attributes(format));\n }\n } else {\n format = this.format[0];\n this.wrap(format.tags[0], attributes(format), nonImages);\n }\n },\n\n _handleImmutables: function(nodes, applyFormatting) {\n if (!this.immutables()) {\n return;\n }\n var immutableFormat = EditorUtils.formatByName(\"immutable\", this.format);\n if (!immutableFormat) {\n return;\n }\n var ImmutablesNS = Editor.Immutables;\n var l = nodes.length - 1;\n for (var i = l; i >= 0; i--) {\n var immutableParent = ImmutablesNS.immutableParent(nodes[i]);\n if (!immutableParent) {\n continue;\n }\n if (immutableParent !== nodes[i + 1]) {\n if (applyFormatting) {\n dom.attr(immutableParent, immutableFormat.attr);\n } else {\n dom.unstyle(immutableParent, immutableFormat.attr.style);\n }\n }\n nodes.splice(i, 1);\n }\n },\n\n immutables: function() {\n return this.editor && this.editor.options.immutables;\n },\n\n remove: function(nodes) {\n var i, l, formatNode, namedFormat, name;\n\n this._handleImmutables(nodes, false);\n\n for (i = 0, l = nodes.length; i < l; i++) {\n formatNode = this.finder.findFormat(nodes[i]);\n if (formatNode) {\n name = dom.name(formatNode);\n namedFormat = EditorUtils.formatByName(name, this.format);\n if (namedFormat.attr.style) {\n dom.unstyle(formatNode, namedFormat.attr.style);\n }\n if (namedFormat.attr.className) {\n dom.removeClass(formatNode, namedFormat.attr.className);\n }\n }\n }\n },\n\n toggle: function(range) {\n var that = this,\n nodes = dom.filterBy(RangeUtils.nodes(range), dom.htmlIndentSpace, true);\n\n if (that.finder.isFormatted(nodes)) {\n that.remove(nodes);\n } else {\n that.apply(nodes);\n }\n }\n });\n\n var GreedyBlockFormatter = Class.extend({\n init: function(format, values) {\n var that = this;\n that.format = format;\n that.values = values;\n that.finder = new BlockFormatFinder(format);\n },\n\n apply: function(nodes) {\n var format = this.format;\n var blocks = dom.blockParents(nodes);\n var formatTag = format[0].tags[0];\n var i, len, list, formatter, range;\n var element;\n var tagName;\n var block;\n var immutalbeParent;\n\n if (blocks.length) {\n for (i = 0, len = blocks.length; i < len; i++) {\n block = blocks[i];\n immutalbeParent = this.immutables() && Editor.Immutables.immutableParent(block);\n\n if (!immutalbeParent) {\n tagName = dom.name(block);\n\n if (tagName == \"li\") {\n list = block.parentNode;\n formatter = new Editor.ListFormatter(list.nodeName.toLowerCase(), formatTag);\n range = this.editor.createRange();\n range.selectNode(blocks[i]);\n formatter.toggle(range);\n } else if (formatTag && (tagName == \"td\" || block.attributes.contentEditable)) {\n new BlockFormatter(format, this.values).apply(block.childNodes);\n } else {\n element = dom.changeTag(block, formatTag);\n dom.attr(element, format[0].attr);\n }\n }\n }\n } else {\n var blockFormatter = new BlockFormatter(format, this.values);\n blockFormatter.editor = this.editor;\n blockFormatter.apply(nodes);\n }\n },\n\n toggle: function(range) {\n var nodes = RangeUtils.textNodes(range);\n if (!nodes.length) {\n range.selectNodeContents(range.commonAncestorContainer);\n nodes = RangeUtils.textNodes(range);\n if (!nodes.length) {\n nodes = dom.significantChildNodes(range.commonAncestorContainer);\n }\n }\n\n this.apply(nodes);\n },\n\n immutables: function() {\n return this.editor && this.editor.options.immutables;\n }\n });\n\n var BlockFormatTool = FormatTool.extend({ init: function(options) {\n FormatTool.fn.init.call(this, extend(options, {\n finder: new BlockFormatFinder(options.format),\n formatter: function() {\n return new BlockFormatter(options.format);\n }\n }));\n }\n });\n\n extend(Editor, {\n BlockFormatFinder: BlockFormatFinder,\n BlockFormatter: BlockFormatter,\n GreedyBlockFormatter: GreedyBlockFormatter,\n BlockFormatTool: BlockFormatTool\n });\n\n var listElements = [\"ul\",\"ol\",\"li\"];\n\n registerFormat(\"justifyLeft\", [\n { tags: dom.nonListBlockElements, attr: { style: { textAlign: \"left\" } } },\n { tags: [\"img\"], attr: { style: { \"float\": \"left\", display: \"\", marginLeft: \"\", marginRight: \"\" } } },\n { tags: [\"immutable\"], attr: { style: { \"float\": \"left\", display: \"\", marginLeft: \"\", marginRight: \"\" } } },\n { tags: listElements, attr: { style: { textAlign: \"left\", listStylePosition: \"\" } } }\n ]);\n registerTool(\"justifyLeft\", new BlockFormatTool({\n format: formats.justifyLeft,\n ui: {\n togglable: true,\n group: \"align\"\n }\n }));\n\n registerFormat(\"justifyCenter\", [\n { tags: dom.nonListBlockElements, attr: { style: { textAlign: \"center\" } } },\n { tags: [\"img\"], attr: { style: { display: \"block\", marginLeft: \"auto\", marginRight: \"auto\", \"float\": \"\" } } },\n { tags: [\"immutable\"], attr: { style: { display: \"block\", marginLeft: \"auto\", marginRight: \"auto\", \"float\": \"\" } } },\n { tags: listElements, attr: { style: { textAlign: \"center\", listStylePosition: \"inside\" } } }\n ]);\n registerTool(\"justifyCenter\", new BlockFormatTool({\n format: formats.justifyCenter,\n ui: {\n togglable: true,\n group: \"align\"\n }\n }));\n\n registerFormat(\"justifyRight\", [\n { tags: dom.nonListBlockElements, attr: { style: { textAlign: \"right\" } } },\n { tags: [\"img\"], attr: { style: { \"float\": \"right\", display: \"\", marginLeft: \"\", marginRight: \"\" } } },\n { tags: [\"immutable\"], attr: { style: { \"float\": \"right\", display: \"\", marginLeft: \"\", marginRight: \"\" } } },\n { tags: listElements, attr: { style: { textAlign: \"right\", listStylePosition: \"inside\" } } }\n ]);\n registerTool(\"justifyRight\", new BlockFormatTool({\n format: formats.justifyRight,\n ui: {\n togglable: true,\n group: \"align\"\n }\n }));\n\n registerFormat(\"justifyFull\", [\n { tags: dom.nonListBlockElements, attr: { style: { textAlign: \"justify\" } } },\n { tags: [\"img\"], attr: { style: { display: \"block\", marginLeft: \"auto\", marginRight: \"auto\", \"float\": \"\" } } },\n { tags: [\"immutable\"], attr: { style: { display: \"block\", marginLeft: \"auto\", marginRight: \"auto\", \"float\": \"\" } } },\n { tags: listElements, attr: { style: { textAlign: \"justify\", listStylePosition: \"\" } } }\n ]);\n registerTool(\"justifyFull\", new BlockFormatTool({\n format: formats.justifyFull,\n ui: {\n togglable: true,\n group: \"align\"\n }\n }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n extend = $.extend,\n Editor = kendo.ui.editor,\n dom = Editor.Dom,\n RangeUtils = Editor.RangeUtils,\n Command = Editor.Command,\n FormatTool = Editor.FormatTool,\n BlockFormatFinder = Editor.BlockFormatFinder,\n textNodes = RangeUtils.textNodes,\n registerTool = Editor.EditorUtils.registerTool;\n\n var ListFormatFinder = BlockFormatFinder.extend({\n init: function(options) {\n this.tag = options.tag;\n this.attr = options.attr;\n this.altAttr = options.altAttr;\n\n var tags = this.tags = [this.tag == 'ul' ? 'ol' : 'ul', this.tag];\n var format = [{ tags: tags, attr: this.attr }];\n\n if (this.altAttr) {\n format.push({\n tags: tags,\n attr: this.altAttr\n });\n }\n\n BlockFormatFinder.fn.init.call(this, format);\n },\n\n matchesType: function(node) {\n return dom.attrEquals(node, this.attr) || (this.altAttr && dom.attrEquals(node, this.altAttr));\n },\n\n isList: function(node) {\n return dom.list(node);\n },\n\n isFormatted: function(nodes) {\n var formatNodes = [];\n var formatNode, i;\n\n for (i = 0; i < nodes.length; i++) {\n formatNode = this.findFormat(nodes[i], this.isList);\n\n if (formatNode && dom.name(formatNode) == this.tag && this.matchesType(formatNode)) {\n formatNodes.push(formatNode);\n }\n }\n\n if (formatNodes.length < 1) {\n return false;\n }\n\n if (formatNodes.length != nodes.length) {\n return false;\n }\n\n // check if sequential lists are selected\n for (i = 0; i < formatNodes.length; i++) {\n if (formatNodes[i].parentNode != formatNode.parentNode) {\n break;\n }\n\n if (formatNodes[i] != formatNode) {\n return false;\n }\n }\n\n return true;\n },\n\n findSuitable: function(nodes) {\n var candidate = this.findFormat(nodes[0], this.isList);\n\n if (candidate && dom.name(candidate) == this.tag) {\n return candidate;\n }\n\n return null;\n }\n\n });\n\n var ListFormatter = Class.extend({\n init: function(options, unwrapTag) {\n var that = this;\n options = $.isPlainObject(options) ? options : { tag: options, attr: null };\n that.tag = options.tag;\n that.attr = options.attr;\n that.finder = new ListFormatFinder(options);\n that.unwrapTag = unwrapTag;\n },\n\n isList: function(node) {\n return dom.list(node);\n },\n\n immutables: function() {\n return this.editor && !!this.editor.options.immutables;\n },\n\n wrap: function(list, nodes) {\n var li = dom.create(list.ownerDocument, \"li\"),\n i, node,\n isImmutable = this.immutables() ? Editor.Immutables.immutable : $.noop;\n\n for (i = 0; i < nodes.length; i++) {\n node = nodes[i];\n\n if (dom.is(node, 'li')) {\n list.appendChild(node);\n continue;\n }\n\n if (this.isList(node)) {\n while (node.firstChild) {\n list.appendChild(node.firstChild);\n }\n continue;\n }\n\n if (dom.is(node, \"td\")) {\n while (node.firstChild) {\n li.appendChild(node.firstChild);\n }\n list.appendChild(li);\n node.appendChild(list);\n list = list.cloneNode(false);\n li = li.cloneNode(false);\n continue;\n }\n\n li.appendChild(node);\n\n if (dom.isBlock(node)) {\n list.appendChild(li);\n if (!isImmutable(node)) {\n dom.unwrap(node);\n }\n li = li.cloneNode(false);\n }\n }\n\n if (li.firstChild) {\n list.appendChild(li);\n }\n },\n\n containsAny: function(parent, nodes) {\n for (var i = 0; i < nodes.length; i++) {\n if (dom.isAncestorOrSelf(parent, nodes[i])) {\n return true;\n }\n }\n\n return false;\n },\n\n suitable: function(candidate, nodes) {\n if (candidate.className == \"k-marker\") {\n var sibling = candidate.nextSibling;\n\n if (sibling && dom.isBlock(sibling)) {\n return false;\n }\n\n sibling = candidate.previousSibling;\n\n if (sibling && dom.isBlock(sibling)) {\n return false;\n }\n }\n\n return this.containsAny(candidate, nodes) || dom.isInline(candidate) || candidate.nodeType == 3;\n },\n\n _parentLists: function(node) {\n var editable = dom.closestEditable(node);\n\n return $(node).parentsUntil(editable, \"ul,ol\");\n },\n\n split: function(range) {\n var nodes = textNodes(range);\n var start, end, parents;\n\n if (nodes.length) {\n start = dom.parentOfType(nodes[0], ['li']);\n end = dom.parentOfType(nodes[nodes.length - 1], ['li']);\n range.setStartBefore(start);\n range.setEndAfter(end);\n\n for (var i = 0, l = nodes.length; i < l; i++) {\n var formatNode = this.finder.findFormat(nodes[i]);\n if (formatNode) {\n parents = this._parentLists(formatNode);\n if (parents.length) {\n RangeUtils.split(range, parents.last()[0], true);\n } else {\n RangeUtils.split(range, formatNode, true);\n }\n }\n }\n }\n },\n\n merge: function(tag, formatNode) {\n var prev = formatNode.previousSibling, next;\n\n while (prev && (prev.className == \"k-marker\" || (prev.nodeType == 3 && dom.isWhitespace(prev)))) {\n prev = prev.previousSibling;\n }\n\n // merge with previous list\n if (prev && dom.name(prev) == tag && this.finder.matchesType(prev)) {\n while (formatNode.firstChild) {\n prev.appendChild(formatNode.firstChild);\n }\n dom.remove(formatNode);\n formatNode = prev;\n }\n\n next = formatNode.nextSibling;\n while (next && (next.className == \"k-marker\" || (next.nodeType == 3 && dom.isWhitespace(next)))) {\n next = next.nextSibling;\n }\n\n // merge with next list\n if (next && dom.name(next) == tag && this.finder.matchesType(next)) {\n while (formatNode.lastChild) {\n next.insertBefore(formatNode.lastChild, next.firstChild);\n }\n dom.remove(formatNode);\n }\n },\n\n breakable: function(node) {\n return (\n node != node.ownerDocument.body &&\n !/table|tbody|thead|tr|td/.test(dom.name(node)) &&\n !node.attributes.contentEditable\n );\n },\n\n findSuitableNode: function(nodes) {\n var that = this,\n finder = that.finder,\n tag = that.tag,\n formatNode;\n\n formatNode = finder.findSuitable(nodes);\n\n if (!formatNode) {\n // Find the opposite tag\n finder = new ListFormatFinder({ tag: tag == \"ul\" ? \"ol\" : \"ul\" });\n formatNode = finder.findSuitable(nodes);\n }\n\n if (!formatNode) {\n // Find the same tag\n finder = new ListFormatFinder({ tag: tag });\n formatNode = finder.findSuitable(nodes);\n formatNode = formatNode && that.finder.matchesType(formatNode) ? null : formatNode;\n }\n\n\n return formatNode;\n },\n\n applyOnSection: function(section, nodes) {\n var tag = this.tag;\n var attr = this.attr;\n var commonAncestor = dom.closestSplittableParent(nodes);\n\n var ancestors = [];\n var formatNode = this.findSuitableNode(nodes);\n\n var childNodes;\n\n if (/table|tbody|thead/.test(dom.name(commonAncestor))) {\n childNodes = $.map(nodes, function(node) {\n return dom.parentOfType(node, [\"td\"]);\n });\n } else {\n childNodes = dom.significantChildNodes(commonAncestor);\n\n if ($.grep(childNodes, dom.isBlock).length) {\n childNodes = $.grep(childNodes, (function(node) {\n return this.containsAny(node, nodes);\n }).bind(this));\n }\n\n if (!childNodes.length) {\n childNodes = nodes;\n }\n }\n\n function pushAncestor() {\n ancestors.push(this);\n }\n\n for (var i = 0; i < childNodes.length; i++) {\n var child = childNodes[i];\n var suitable = (!formatNode || !dom.isAncestorOrSelf(formatNode, child)) && this.suitable(child, nodes);\n\n if (!suitable) {\n continue;\n }\n\n if (formatNode && this.isList(child)) {\n // merging lists\n $.each(child.children, pushAncestor);\n dom.remove(child);\n } else {\n ancestors.push(child);\n }\n }\n\n if (ancestors.length == childNodes.length && this.breakable(commonAncestor)) {\n ancestors = [commonAncestor];\n }\n\n if (!formatNode) {\n formatNode = dom.create(commonAncestor.ownerDocument, tag, attr);\n if (dom.isBlock(ancestors[0])) {\n dom.mergeAttributes(ancestors[0], formatNode);\n }\n dom.insertBefore(formatNode, ancestors[0]);\n }\n\n this.wrap(formatNode, ancestors);\n\n while (dom.isBom(formatNode.nextSibling)) {\n dom.remove(formatNode.nextSibling);\n }\n\n if (!this.finder.matchesType(formatNode)) {\n formatNode.removeAttribute(\"type\");\n formatNode.style.listStyleType = \"\";\n dom.mergeAttributes(dom.create(commonAncestor.ownerDocument, tag, attr), formatNode, true);\n }\n\n if (formatNode && formatNode.getAttribute(\"type\") === \"\") {\n formatNode.removeAttribute(\"type\");\n }\n\n if (!dom.is(formatNode, tag)) {\n dom.changeTag(formatNode, tag);\n }\n\n this.merge(tag, formatNode);\n },\n\n apply: function(nodes) {\n var i = 0,\n sections = [],\n lastSection,\n lastNodes,\n section,\n node,\n l = nodes.length,\n immutableParent = this.immutables() ? Editor.Immutables.immutableParent : $.noop;\n\n function addLastSection() {\n if (lastSection) {\n sections.push({\n section: lastSection,\n nodes: lastNodes\n });\n }\n }\n\n // split nodes into sections that need to be different lists\n for (i = 0; i < l; i++) {\n node = immutableParent(nodes[i]) || nodes[i];\n section = dom.closestEditable(node, [\"td\",\"th\",\"body\"]);\n if (!lastSection || section != lastSection) {\n addLastSection();\n lastNodes = [node];\n lastSection = section;\n } else {\n lastNodes.push(node);\n }\n }\n\n addLastSection();\n\n for (i = 0; i < sections.length; i++) {\n this.applyOnSection(sections[i].section, sections[i].nodes);\n }\n },\n\n unwrap: function(ul) {\n var fragment = ul.ownerDocument.createDocumentFragment(),\n unwrapTag = this.unwrapTag,\n parents,\n li,\n p,\n child;\n\n for (li = ul.firstChild; li; li = li.nextSibling) {\n p = dom.create(ul.ownerDocument, unwrapTag || 'p');\n\n while (li.firstChild) {\n child = li.firstChild;\n\n if (dom.isBlock(child)) {\n\n if (p.firstChild) {\n fragment.appendChild(p);\n p = dom.create(ul.ownerDocument, unwrapTag || 'p');\n }\n\n fragment.appendChild(child);\n } else {\n p.appendChild(child);\n }\n }\n\n if (p.firstChild) {\n fragment.appendChild(p);\n }\n }\n\n parents = this._parentLists(ul);\n\n if (parents[0]) {\n dom.insertAfter(fragment, parents.last()[0]);\n parents.last().remove();\n } else {\n dom.insertAfter(fragment, ul);\n }\n\n dom.remove(ul);\n },\n\n remove: function(nodes) {\n var formatNode;\n for (var i = 0, l = nodes.length; i < l; i++) {\n formatNode = this.finder.findFormat(nodes[i]);\n\n if (formatNode) {\n this.unwrap(formatNode);\n }\n }\n },\n\n toggle: function(range) {\n var that = this,\n nodes = textNodes(range),\n ancestor = range.commonAncestorContainer;\n\n if (!nodes.length) {\n range.selectNodeContents(ancestor);\n nodes = textNodes(range);\n if (!nodes.length) {\n var text = ancestor.ownerDocument.createTextNode(\"\");\n range.startContainer.appendChild(text);\n nodes = [text];\n range.selectNode(text.parentNode);\n }\n }\n nodes = dom.filterBy(nodes, dom.htmlIndentSpace, true);\n if (that.finder.isFormatted(nodes)) {\n that.split(range);\n that.remove(nodes);\n } else {\n that.apply(nodes);\n }\n }\n\n });\n\n var ListCommand = Command.extend({\n init: function(options) {\n options.formatter = new ListFormatter({ tag: options.tag, attr: options.attr });\n Command.fn.init.call(this, options);\n }\n });\n\n var ListTool = FormatTool.extend({\n init: function(options) {\n this.options = options;\n\n FormatTool.fn.init.call(this, extend(options, {\n finder: new ListFormatFinder(options)\n }));\n },\n\n command: function(commandArguments) {\n return new ListCommand(extend(commandArguments, { tag: this.options.tag, attr: this.options.attr }));\n }\n });\n\n extend(Editor, {\n ListFormatFinder: ListFormatFinder,\n ListFormatter: ListFormatter,\n ListCommand: ListCommand,\n ListTool: ListTool\n });\n\n registerTool(\"insertUnorderedList\", new ListTool({ tag: 'ul', attr: { style: { listStyleType: \"\" }, type: \"\" }, ui: { togglable: true, group: \"lists\" } }));\n registerTool(\"insertOrderedList\", new ListTool({ tag: 'ol', attr: { style: { listStyleType: \"\" }, type: \"\" }, ui: { togglable: true, group: \"lists\" } }));\n registerTool(\"insertUpperRomanList\", new ListTool({ tag: 'ol', attr: { style: { listStyleType: \"upper-roman\" } }, altAttr: { type: \"I\" }, ui: { togglable: true, group: \"lists\" } }));\n registerTool(\"insertLowerRomanList\", new ListTool({ tag: 'ol', attr: { style: { listStyleType: \"lower-roman\" } }, altAttr: { type: \"i\" }, ui: { togglable: true, group: \"lists\" } }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n var kendo = window.kendo,\n Editor = kendo.ui.editor,\n Tool = Editor.Tool,\n DelayedExecutionTool = Editor.DelayedExecutionTool,\n Command = Editor.Command,\n dom = Editor.Dom,\n EditorUtils = Editor.EditorUtils,\n RangeUtils = Editor.RangeUtils,\n registerTool = EditorUtils.registerTool;\n\n\n var FormattingTool = DelayedExecutionTool.extend({\n init: function(options) {\n var that = this;\n Tool.fn.init.call(that, kendo.deepExtend({}, that.options, options));\n\n that.type = \"kendoDropDownList\";\n\n that.finder = {\n getFormat: function() { return \"\"; }\n };\n },\n\n options: {\n items: [\n { text: \"Paragraph\", value: \"p\" },\n { text: \"Quotation\", value: \"blockquote\" },\n { text: \"Heading 1\", value: \"h1\" },\n { text: \"Heading 2\", value: \"h2\" },\n { text: \"Heading 3\", value: \"h3\" },\n { text: \"Heading 4\", value: \"h4\" },\n { text: \"Heading 5\", value: \"h5\" },\n { text: \"Heading 6\", value: \"h6\" }\n ],\n width: 110\n },\n\n toFormattingItem: function(item) {\n var value = item.value;\n\n if (!value) {\n return item;\n }\n\n if (item.tag || item.className) {\n return item;\n }\n\n var dot = value.indexOf(\".\");\n\n if (dot === 0) {\n item.className = value.substring(1);\n } else if (dot == -1) {\n item.tag = value;\n } else {\n item.tag = value.substring(0, dot);\n item.className = value.substring(dot + 1);\n }\n\n return item;\n },\n\n command: function(args) {\n var that = this;\n var item = args.value;\n\n item = this.toFormattingItem(item);\n\n return new Editor.FormatCommand({\n range: args.range,\n formatter: function() {\n var formatter,\n tags = (item.tag || item.context || \"span\").split(\",\"),\n format = [{\n tags: tags,\n attr: { className: item.className || \"\" }\n }];\n\n if ($.inArray(tags[0], dom.inlineElements) >= 0) {\n formatter = new Editor.GreedyInlineFormatter(format);\n } else {\n formatter = new Editor.GreedyBlockFormatter(format);\n }\n\n formatter.editor = that.editor;\n return formatter;\n }\n });\n },\n\n decorate: function(body) {\n var component = this.component,\n dataSource = component.dataSource,\n items = dataSource.data(),\n i, tag, className, style;\n\n if (body) {\n component.list.css(\"background-color\", dom.getEffectiveBackground($(body)));\n }\n\n for (i = 0; i < items.length; i++) {\n tag = items[i].tag || \"span\";\n className = items[i].className;\n\n style = dom.inlineStyle(body, tag, { className: className });\n\n style = style.replace(/\"/g, \"'\");\n\n items[i].style = style + \";display:inline-block\";\n }\n\n dataSource.trigger(\"change\");\n },\n\n initialize: function(ui, editor) {\n var options = this.options;\n var toolName = options.name;\n var that = this;\n var component = ui.getKendoDropDownList();\n\n if (!component) {\n return;\n }\n\n that.editor = editor;\n that.component = component;\n\n // must be moved to themes\n ui.closest(\".k-dropdownlist\").width(options.width);\n\n component.setOptions({\n optionLabel: editor.options.messages.formatting,\n change: function () {\n var dataItem = component.dataItem();\n\n if (dataItem) {\n Tool.exec(editor, toolName, dataItem.toJSON());\n }\n },\n dataBound: function() {\n var i, items = component.dataSource.data(),\n optionLabel = component.list.parent().find(\".k-list-optionlabel\");\n\n for (i = 0; i < items.length; i++) {\n items[i] = that.toFormattingItem(items[i]);\n }\n\n if (optionLabel.length) {\n optionLabel.remove();\n }\n }\n });\n },\n\n getFormattingValue: function(items, nodes) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var tag = item.tag || item.context || \"\";\n var className = item.className ? \".\" + item.className : \"\";\n var selector = tag + className;\n\n var element = $(nodes[0]).closest(selector)[0];\n\n if (!element) {\n continue;\n }\n\n if (nodes.length == 1) {\n return item.value;\n }\n\n for (var n = 1; n < nodes.length; n++) {\n if (!$(nodes[n]).closest(selector)[0]) {\n break;\n } else if (n == nodes.length - 1) {\n return item.value;\n }\n }\n }\n\n return \"\";\n },\n\n update: function(ui, nodes) {\n var selectBox = $(ui).data(this.type);\n // necessary until formatBlock is deleted\n if (!selectBox) {\n return;\n }\n\n var dataSource = selectBox.dataSource,\n items = dataSource.data(),\n i, context,\n ancestor = dom.commonAncestor.apply(null, nodes);\n\n if (ancestor != dom.closestEditable(ancestor) && this._ancestor == ancestor) {\n return;\n } else {\n this._ancestor = ancestor;\n }\n\n for (i = 0; i < items.length; i++) {\n context = items[i].context;\n\n items[i].visible = !context || !!$(ancestor).closest(context).length;\n }\n\n dataSource.filter([{ field: \"visible\", operator: \"eq\", value: true }]);\n\n DelayedExecutionTool.fn.update.call(this, ui, nodes);\n\n selectBox.value(this.getFormattingValue(dataSource.view(), nodes));\n\n selectBox.wrapper.toggleClass(\"k-disabled\", !dataSource.view().length);\n },\n\n destroy: function() {\n this._ancestor = null;\n }\n });\n\n var CleanFormatCommand = Command.extend({\n exec: function() {\n var range = this.lockRange(true);\n this.tagsToClean = this.options.remove || \"strong,em,span,sup,sub,del,b,i,u,font\".split(\",\");\n\n RangeUtils.wrapSelectedElements(range);\n\n var nodes = RangeUtils.mapAll(range, function(node) {\n return node;\n });\n\n\n for (var c = nodes.length - 1; c >= 0; c--) {\n var node = nodes[c];\n if (!this.immutableParent(node)) {\n this.clean(node);\n }\n }\n\n this.releaseRange(range);\n },\n\n clean: function(node) {\n if (!node || dom.isMarker(node)) {\n return;\n }\n\n var name = dom.name(node);\n\n if (name == \"ul\" || name == \"ol\") {\n var listFormatter = new Editor.ListFormatter(name);\n var prev = node.previousSibling;\n var next = node.nextSibling;\n\n listFormatter.unwrap(node);\n\n // clean contents\n for (; prev && prev != next; prev = prev.nextSibling) {\n this.clean(prev);\n }\n } else if (name == \"blockquote\") {\n dom.changeTag(node, \"p\");\n } else if (node.nodeType == 1 && !dom.insignificant(node)) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n this.clean(node.childNodes[i]);\n }\n\n node.removeAttribute(\"style\");\n node.removeAttribute(\"class\");\n } else {\n unwrapListItem(node);\n }\n\n if ($.inArray(name, this.tagsToClean) > -1) {\n dom.unwrap(node);\n }\n },\n\n immutableParent: function(node) {\n return this.immutables() && Editor.Immutables.immutableParent(node);\n }\n });\n\n\n function unwrapListItem(node) {\n var li = dom.closestEditableOfType(node, [\"li\"]);\n if (li) {\n var listFormatter = new Editor.ListFormatter(dom.name(li.parentNode));\n var range = kendo.ui.editor.W3CRange.fromNode(node);\n range.selectNode(li);\n listFormatter.toggle(range);\n }\n }\n\n $.extend(Editor, {\n FormattingTool: FormattingTool,\n CleanFormatCommand: CleanFormatCommand\n });\n\n registerTool(\"formatting\", new FormattingTool({\n ui: {\n type: \"component\",\n component: \"DropDownList\",\n componentOptions: {\n dataTextField: \"text\",\n dataValueField: \"value\",\n highlightFirst: false,\n autoWidth: true,\n template: kendo.template(\n function (data) { return (\"\" + (kendo.htmlEncode(data.text)) + \"\"); }\n )\n },\n overflow: \"never\"\n }\n }));\n\n registerTool(\"cleanFormatting\", new Tool({ command: CleanFormatCommand }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n encode = kendo.htmlEncode,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n dom = Editor.Dom,\n registerTool = EditorUtils.registerTool,\n RangeUtils = Editor.RangeUtils,\n Command = Editor.Command,\n keys = kendo.keys,\n KEDITORIMAGEURL = \"#k-editor-image-url\",\n KEDITORIMAGETITLE = \"#k-editor-image-title\",\n KEDITORIMAGEWIDTH = \"#k-editor-image-width\",\n KEDITORIMAGEHEIGHT = \"#k-editor-image-height\";\n\n var ImageCommand = Command.extend({\n init: function(options) {\n var that = this;\n Command.fn.init.call(that, options);\n\n that.async = true;\n that.attributes = {};\n },\n\n insertImage: function(img, range) {\n var attributes = this.attributes;\n var doc = RangeUtils.documentFromRange(range);\n\n if (attributes.src && attributes.src != \"http://\") {\n\n var removeIEAttributes = function() {\n setTimeout(function() {\n if (!attributes.width) {\n img.removeAttribute(\"width\");\n }\n\n if (!attributes.height) {\n img.removeAttribute(\"height\");\n }\n\n img.removeAttribute(\"complete\");\n });\n };\n\n if (!img) {\n img = dom.create(doc, \"img\", attributes);\n img.onload = img.onerror = removeIEAttributes;\n\n range.deleteContents();\n range.insertNode(img);\n\n if (!img.nextSibling) {\n dom.insertAfter(doc.createTextNode(\"\\ufeff\"), img);\n }\n\n removeIEAttributes();\n\n range.setStartAfter(img);\n range.setEndAfter(img);\n RangeUtils.selectRange(range);\n return true;\n } else {\n img.onload = img.onerror = removeIEAttributes;\n dom.attr(img, attributes);\n removeIEAttributes();\n }\n }\n\n return false;\n },\n\n redo: function() {\n var that = this,\n range = that.lockRange();\n\n if (!that.insertImage(RangeUtils.image(range), range)) {\n that.releaseRange(range);\n }\n },\n\n exec: function() {\n var that = this,\n range = that.lockRange(),\n applied = false,\n img = RangeUtils.image(range),\n imageWidth = img && img.getAttribute(\"width\") || \"\",\n imageHeight = img && img.getAttribute(\"height\") || \"\",\n dialog,\n form,\n isIE = kendo.support.browser.msie,\n options = that.editor.options,\n messages = options.messages,\n imageBrowser = options.imageBrowser,\n showBrowser = !!(kendo.ui.ImageBrowser && imageBrowser && imageBrowser.transport && imageBrowser.transport.read !== undefined$1),\n dialogOptions = {\n title: messages.insertImage,\n visible: false,\n resizable: showBrowser\n };\n\n this.expandImmutablesIn(range);\n\n function apply(e) {\n var element = dialog.element,\n w = parseInt(element.find(KEDITORIMAGEWIDTH).val(), 10),\n h = parseInt(element.find(KEDITORIMAGEHEIGHT).val(), 10);\n\n that.attributes = {\n src: element.find(KEDITORIMAGEURL).val().replace(/ /g, \"%20\"),\n alt: element.find(KEDITORIMAGETITLE).val()\n };\n\n that.attributes.width = null;\n that.attributes.height = null;\n\n if (!isNaN(w) && w > 0) {\n that.attributes.width = w;\n }\n\n if (!isNaN(h) && h > 0) {\n that.attributes.height = h;\n }\n\n applied = that.insertImage(img, range);\n\n close(e);\n\n if (that.change) {\n that.change();\n }\n }\n\n function close(e) {\n e.preventDefault();\n form.destroy();\n dialog.destroy();\n\n dom.windowFromDocument(RangeUtils.documentFromRange(range)).focus();\n if (!applied) {\n that.releaseRange(range);\n }\n }\n\n function keyDown(e) {\n if (e.keyCode == keys.ENTER) {\n apply(e);\n } else if (e.keyCode == keys.ESC) {\n close(e);\n }\n }\n\n dialogOptions.close = close;\n\n if (showBrowser) {\n dialogOptions.width = 750;\n }\n dialogOptions.minWidth = 350;\n\n dialog = this.createDialog(\"
    \", dialogOptions).data(\"kendoWindow\");\n\n form = that._createForm(dialog, showBrowser);\n\n dialog.element.toggleClass(\"k-filebrowser-dialog\", showBrowser);\n dialog.wrapper\n .find(\".k-dialog-insert\").on(\"click\", apply).end()\n .find(\".k-dialog-close\").on(\"click\", close).end()\n .find(\".k-form-field input\").on(\"keydown\", keyDown).end()\n // IE < 8 returns absolute url if getAttribute is not used\n .find(KEDITORIMAGEURL).val(img ? img.getAttribute(\"src\", 2) : \"http://\").end()\n .find(KEDITORIMAGETITLE).val(img ? img.alt : \"\").end()\n .find(KEDITORIMAGEWIDTH).val(imageWidth).end()\n .find(KEDITORIMAGEHEIGHT).val(imageHeight).end();\n\n var element = dialog.element;\n if (showBrowser) {\n this._imageBrowser = new kendo.ui.ImageBrowser(\n element.find(\".k-imagebrowser\"),\n extend({}, imageBrowser)\n );\n\n this._imageBrowser.bind(\"change\", function(ev) {\n if (ev.selected.get(\"type\") === \"f\") {\n element.find(KEDITORIMAGEURL).val(this.value());\n }\n });\n\n this._imageBrowser.bind(\"apply\", apply);\n }\n\n if (isIE) {\n var dialogHeight = element.closest(\".k-window\").height();\n element.css(\"max-height\", dialogHeight);\n }\n dialog.center().open();\n element.find(KEDITORIMAGEURL).trigger(\"focus\").select();\n },\n\n _createForm: function(dialog, showBrowser) {\n var that = this;\n var formElement = $(\"
    \").appendTo(dialog.element);\n var messages = that.editor.options.messages;\n var form = formElement.kendoForm({\n renderButtons: false,\n items: [\n {\n field: \"k-editor-image-url\",\n label: encode(messages.imageWebAddress),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-image-title\",\n label: encode(messages.imageAltText),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-image-width\",\n label: encode(messages.imageWidth),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-image-height\",\n label: encode(messages.imageHeight),\n editor: \"TextBox\"\n }\n ]\n }).data(\"kendoForm\");\n\n if (showBrowser) {\n formElement.prepend($('
    '));\n }\n\n dialog.element.after($(that._actionButtonsTemplate({ messages: messages, insertButtonIcon: \"image-add\", cancelButtonIcon: \"cancel-outline\" })));\n\n return form;\n }\n\n });\n\n kendo.ui.editor.ImageCommand = ImageCommand;\n\n registerTool(\"insertImage\", new Editor.Tool({ command: ImageCommand }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n Command = Editor.Command,\n Tool = Editor.Tool,\n registerTool = EditorUtils.registerTool,\n loadingOverlay = '
    ';\n\n var ImportCommand = Command.extend({\n exec: function() {\n (this.editor._uploadWidget || this._initializeUploadWidget()).element.click();\n },\n\n _initializeUploadWidget: function() {\n var cmd = this;\n var editor = cmd.editor;\n var importOptions = editor.options[\"import\"];\n var upload = $('').kendoUpload({\n success: cmd._onUploadSuccess.bind(cmd),\n progress: cmd._onUploadProgress.bind(cmd),\n select: cmd._onUploadSelect.bind(cmd),\n error: cmd._onUploadError.bind(cmd),\n complete: cmd._onUploadComplete.bind(cmd),\n showFileList: false,\n multiple: false,\n async: {\n saveUrl: importOptions.proxyURL,\n autoUpload: true,\n saveField: \"file\"\n },\n validation: {\n allowedExtensions: importOptions.allowedExtensions,\n maxFileSize: importOptions.maxFileSize\n }\n }).getKendoUpload();\n\n editor._uploadWidget = upload;\n\n return upload;\n },\n _onUploadComplete: function(ev) {\n this._trigger(\"complete\", ev);\n ev.sender.clearAllFiles();\n\n this._removeLoadingOverlay();\n },\n _onUploadSuccess: function(ev) {\n this.editor.value(ev.response.html.replace(/<\\/?body>/ig, \"\"));\n this._trigger(\"success\", ev);\n },\n _onUploadProgress: function(ev) {\n this._trigger(\"progress\", ev);\n },\n _onUploadSelect: function(ev) {\n this._trigger(\"select\", ev);\n if (!ev.files[0].validationErrors) {\n this._initLoadingOverlay();\n }\n },\n _onUploadError: function(ev) {\n this._trigger(\"error\", ev);\n },\n\n _trigger: function(eventType, uploadEvent) {\n var editor = this.editor;\n var importOptions = editor.options[\"import\"];\n if (typeof importOptions[eventType] === \"function\") {\n importOptions[eventType].call(editor, uploadEvent);\n }\n },\n\n _initLoadingOverlay: function() {\n var editable = this.editor.body;\n if (Editor.Dom.is(editable, \"body\")) {\n this._iframeWrapper = this._container =\n this.editor.wrapper.find(\"iframe\").parent()\n .css({ position: \"relative\" }).append(loadingOverlay);\n } else {\n this._container = $(editable).append(loadingOverlay);\n }\n\n kendo.ui.progress(this._container, true);\n },\n\n _removeLoadingOverlay: function() {\n kendo.ui.progress(this._container, false);\n $(this._iframeWrapper).css({\n position: \"\"\n });\n\n delete this._container;\n delete this._iframeWrapper;\n }\n });\n\n extend(Editor, {\n ImportCommand: ImportCommand\n });\n\n registerTool(\"import\", new Tool({\n command: ImportCommand,\n ui: {\n showText: \"both\"\n }\n }));\n\n }(window.kendo.jQuery));\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n editorNS = kendo.ui.editor,\n Command = editorNS.Command,\n GenericCommand = editorNS.GenericCommand,\n EditorUtils = editorNS.EditorUtils,\n registerTool = EditorUtils.registerTool,\n Tool = editorNS.Tool,\n RestorePoint = editorNS.RestorePoint,\n extend = $.extend;\n\n var InsertHtmlCommand = Command.extend({\n init: function(options) {\n Command.fn.init.call(this, options);\n\n this.managesUndoRedo = true;\n },\n\n exec: function() {\n var editor = this.editor;\n var options = this.options;\n var range = options.range;\n var body = editor.body;\n var startRestorePoint = new RestorePoint(range, body);\n var html = options.html || options.value || '';\n\n editor.selectRange(range);\n\n editor.clipboard.paste(html, options);\n\n if (options.postProcess) {\n options.postProcess(editor, editor.getRange());\n }\n\n var genericCommand = new GenericCommand(startRestorePoint, new RestorePoint(editor.getRange(), body));\n genericCommand.editor = editor;\n editor.undoRedoStack.push(genericCommand);\n\n editor.focus();\n }\n });\n\n var InsertHtmlTool = Tool.extend({\n initialize: function(ui, editor) {\n var options = this.options,\n dataSource = options.items ? options.items : editor.options.insertHtml,\n component = ui.getKendoDropDownList();\n\n if (!component) {\n return;\n }\n\n component.one(\"open\", function () {\n var optionLabel = component.list.parent().find(\".k-list-optionlabel\");\n\n if (optionLabel.length) {\n optionLabel.remove();\n }\n });\n\n component.setOptions({\n dataSource: dataSource,\n optionLabel: editor.options.messages.insertHtml\n });\n component.bind(\"change\", function () {\n Tool.exec(editor, 'insertHtml', component.value());\n });\n },\n\n command: function(commandArguments) {\n return new InsertHtmlCommand(commandArguments);\n },\n\n update: function(ui) {\n var component = ui.data(\"kendoDropDownList\");\n component.close();\n component.value(null);\n }\n });\n\n extend(editorNS, {\n InsertHtmlCommand: InsertHtmlCommand,\n InsertHtmlTool: InsertHtmlTool\n });\n\n registerTool(\"insertHtml\", new InsertHtmlTool({\n ui: {\n initialValue: \"Insert HTML\",\n type: \"component\",\n component: \"DropDownList\",\n componentOptions: {\n dataTextField: \"text\",\n dataValueField: \"value\",\n autoSize: true,\n highlightFirst: false\n },\n overflow: \"never\"\n }\n }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n Command = Editor.Command,\n Tool = Editor.Tool,\n registerTool = EditorUtils.registerTool,\n defaultExportAsItems = [\n { text: 'Docx', value: 'docx' },\n { text: 'Rtf', value: 'rtf' },\n { text: 'Pdf', value: 'pdf' },\n { text: 'Html', value: 'html' },\n { text: 'Plain Text', value: 'txt' }\n ];\n\n var ExportAsCommand = Command.extend({\n init: function(options) {\n var cmd = this;\n cmd.options = options;\n Command.fn.init.call(cmd, options);\n cmd.attributes = null;\n cmd.exportType = options.exportType;\n },\n\n exec: function() {\n var cmd = this;\n var range = this.lockRange(true);\n cmd.postToProxy();\n cmd.releaseRange(range);\n },\n\n postToProxy: function() {\n this.generateForm().appendTo('body').submit().remove();\n },\n\n generateForm: function() {\n var cmd = this;\n var exportAsOptions = cmd.editor.options.exportAs;\n var form = $('
    ').attr({\n action: exportAsOptions && exportAsOptions.proxyURL || \"\",\n method: 'POST'\n });\n\n form.append([\n cmd.valueInput(),\n cmd.exportTypeInput(),\n cmd.fileNameInput(),\n cmd.antiForgeryInput()\n ]);\n\n return form;\n },\n\n valueInput: function() {\n var editor = this.editor;\n return $('').attr({\n value: editor.encodedValue(),\n name: 'value',\n type: 'hidden'\n });\n },\n\n exportTypeInput: function() {\n var cmd = this;\n return $('').attr({\n value: cmd.exportType,\n name: 'exportType',\n type: 'hidden'\n });\n\n },\n\n fileNameInput: function() {\n var editor = this.editor;\n var exportAsOptions = editor.options.exportAs;\n var fileName = exportAsOptions && exportAsOptions.fileName || editor.element.attr(\"id\") || \"editor\";\n return $('').attr({\n value: fileName,\n name: 'fileName',\n type: 'hidden'\n });\n },\n\n antiForgeryInput: function() {\n var csrf_param = $(\"meta[name=csrf-param],meta[name=_csrf_header]\").attr(\"content\");\n\n return $(\"input[name^='__RequestVerificationToken']\").clone()\n .add($(\"input[name^='\" + csrf_param + \"']\").clone());\n }\n });\n\n var ExportAsTool = Tool.extend({\n init: function(options) {\n var tool = this;\n Tool.fn.init.call(tool, kendo.deepExtend({}, tool.options, options));\n tool.type = 'kendoDropDownList';\n },\n\n options: {\n items: defaultExportAsItems\n },\n\n command: function(args) {\n var value = args.value;\n return new Editor.ExportAsCommand({\n range: args.range,\n exportType: value.exportType\n });\n },\n\n initialize: function(ui, editor) {\n var tool = this,\n component = ui.getKendoDropDownList();\n\n tool.editor = editor;\n\n component.bind(\"change\", this.changeHandler.bind(this));\n },\n\n changeHandler: function(e) {\n this._exec(e.sender.value());\n e.sender.value(null);\n e.sender.wrapper.find(\".k-export-tool-text\").text(kendo.htmlEncode(this.editor.options.messages.exportAs));\n },\n\n update: function(ui, editor) {\n var component = ui.data(\"kendoDropDownList\");\n\n component.close();\n component.value(null);\n ui.closest(\".k-dropdownlist\").find(\".k-export-tool-text\").text(kendo.htmlEncode(this.editor.options.messages.exportAs));\n },\n\n _exec: function(value) {\n if (value) {\n Tool.exec(this.editor, this.options.name, { exportType: value } );\n }\n },\n\n destroy: function() {\n this._ancestor = null;\n }\n });\n\n extend(Editor, {\n ExportAsTool: ExportAsTool,\n ExportAsCommand: ExportAsCommand\n });\n\n registerTool('exportAs', new ExportAsTool({\n ui: {\n type: \"component\",\n overflow: \"never\",\n component: \"DropDownList\",\n componentOptions: {\n dataTextField: \"text\",\n dataValueField: \"value\",\n valuePrimitive: true,\n value: null,\n width: \"140px\",\n highlightFirst: false,\n autoWidth: true,\n itemTemplate: function (data) { return (\"\" + (data.text) + \"\"); },\n icon: \"export\",\n valueTemplate: function () { return (\"\" + (kendo.ui.icon({ icon: \"export\", iconClass: \"k-button-icon\" })) + \"\"); }\n }\n }\n }));\n\n }(window.kendo.jQuery));\n\n (function($, undefined$1) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n extend = $.extend,\n Editor = kendo.ui.editor,\n dom = Editor.Dom,\n EditorUtils = Editor.EditorUtils,\n registerTool = EditorUtils.registerTool,\n Command = Editor.Command,\n Tool = Editor.Tool,\n RangeUtils = Editor.RangeUtils,\n blockElements = dom.blockElements,\n BlockFormatFinder = Editor.BlockFormatFinder,\n BlockFormatter = Editor.BlockFormatter;\n\n function indent(node, value) {\n var isRtl = $(node).css(\"direction\") == \"rtl\",\n indentDirection = isRtl ? \"Right\" : \"Left\",\n property = dom.name(node) != \"td\" ? \"margin\" + indentDirection : \"padding\" + indentDirection;\n if (value === undefined$1) {\n return node.style[property] || 0;\n } else {\n if (value > 0) {\n node.style[property] = value + \"px\";\n } else {\n node.style[property] = \"\";\n\n if (!node.style.cssText) {\n node.removeAttribute(\"style\");\n }\n }\n }\n }\n\n var IndentFormatter = Class.extend({\n init: function() {\n this.finder = new BlockFormatFinder([{ tags: dom.blockElements }]);\n },\n\n apply: function(nodes) {\n nodes = dom.filterBy(nodes, dom.htmlIndentSpace, true);\n var formatNodes = this.finder.findSuitable(nodes),\n targets = [],\n i, len, formatNode, parentList, sibling;\n\n formatNodes = this.mapImmutables(formatNodes);\n\n if (formatNodes.length) {\n for (i = 0, len = formatNodes.length; i < len; i++) {\n if (dom.is(formatNodes[i], \"li\")) {\n if (!$(formatNodes[i]).index()) {\n targets.push(formatNodes[i].parentNode);\n } else if ($.inArray(formatNodes[i].parentNode, targets) < 0) {\n targets.push(formatNodes[i]);\n }\n } else {\n targets.push(formatNodes[i]);\n }\n }\n\n while (targets.length) {\n formatNode = targets.shift();\n if (dom.is(formatNode, \"li\")) {\n parentList = formatNode.parentNode;\n sibling = $(formatNode).prev(\"li\");\n var siblingList = sibling.find(\"ul,ol\").last();\n\n var nestedList = $(formatNode).children(\"ul,ol\")[0];\n\n if (nestedList && sibling[0]) {\n if (siblingList[0]) {\n siblingList.append(formatNode);\n siblingList.append($(nestedList).children());\n dom.remove(nestedList);\n } else {\n sibling.append(nestedList);\n nestedList.insertBefore(formatNode, nestedList.firstChild);\n }\n } else {\n nestedList = sibling.children(\"ul,ol\")[0];\n if (!nestedList) {\n nestedList = dom.create(formatNode.ownerDocument, dom.name(parentList), this.getListTypeAttr(parentList));\n sibling.append(nestedList);\n }\n\n while (formatNode && formatNode.parentNode == parentList) {\n nestedList.appendChild(formatNode);\n formatNode = targets.shift();\n }\n }\n } else {\n var marginLeft = parseInt(indent(formatNode), 10) + 30;\n indent(formatNode, marginLeft);\n\n for (var targetIndex = 0; targetIndex < targets.length; targetIndex++) {\n if ($.contains(formatNode, targets[targetIndex])) {\n targets.splice(targetIndex, 1);\n }\n }\n }\n }\n } else {\n var formatter = new BlockFormatter([{ tags: [\"p\"] }], { style: { marginLeft: 30 } });\n\n formatter.apply(nodes);\n }\n },\n\n getListTypeAttr: function(list) {\n var type = list.getAttribute(\"type\");\n var styleType = list.style.listStyleType;\n\n return type ? { type: type } : { style: { listStyleType: styleType } };\n },\n\n mapImmutables: function(nodes) {\n if (!this.immutables) {\n return nodes;\n } else {\n var immutables = [];\n return $.map(nodes, function(node) {\n var immutable = Editor.Immutables.immutableParent(node);\n if (immutable) {\n if ($.inArray(immutable, immutables) === -1) {\n immutables.push(immutable);\n } else {\n return null;\n }\n }\n return immutable || node;\n });\n }\n },\n\n remove: function(nodes) {\n nodes = dom.filterBy(nodes, dom.htmlIndentSpace, true);\n var formatNodes = this.finder.findSuitable(nodes),\n targetNode, i, len, list, listParent, siblings,\n formatNode, marginLeft;\n\n formatNodes = this.mapImmutables(formatNodes);\n\n for (i = 0, len = formatNodes.length; i < len; i++) {\n formatNode = $(formatNodes[i]);\n\n if (formatNode.is(\"li\")) {\n list = formatNode.parent();\n listParent = list.parent();\n // listParent will be ul or ol in case of invalid dom -
    \n if (listParent.is(\"li,ul,ol\") && !indent(list[0])) {\n // skip already processed nodes\n if (targetNode && $.contains(targetNode, listParent[0])) {\n continue;\n }\n\n siblings = formatNode.nextAll(\"li\");\n if (siblings.length) {\n $(list[0].cloneNode(false)).appendTo(formatNode).append(siblings);\n }\n\n if (listParent.is(\"li\")) {\n formatNode.insertAfter(listParent);\n } else {\n formatNode.appendTo(listParent);\n }\n\n if (!list.children(\"li\").length) {\n list.remove();\n }\n\n continue;\n } else {\n if (targetNode == list[0]) {\n // removing format on sibling LI elements\n continue;\n }\n targetNode = list[0];\n }\n } else {\n targetNode = formatNodes[i];\n }\n\n marginLeft = parseInt(indent(targetNode), 10) - 30;\n indent(targetNode, marginLeft);\n }\n }\n\n });\n\n var IndentCommand = Command.extend({\n init: function(options) {\n var that = this;\n options.formatter = /** @ignore */ {\n toggle: (function(range) {\n var indentFormatter = new IndentFormatter();\n indentFormatter.immutables = this.editor && this.editor.options.immutables;\n indentFormatter.apply(RangeUtils.nodes(range));\n }).bind(that)\n };\n Command.fn.init.call(this, options);\n }\n });\n\n var OutdentCommand = Command.extend({\n init: function(options) {\n var that = this;\n options.formatter = {\n toggle: (function(range) {\n var indentFormatter = new IndentFormatter();\n indentFormatter.immutables = this.editor && this.editor.options.immutables;\n indentFormatter.remove(RangeUtils.nodes(range));\n }).bind(that)\n };\n Command.fn.init.call(this, options);\n }\n });\n\n var OutdentTool = Tool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n\n this.finder = new BlockFormatFinder([{ tags: blockElements }]);\n },\n\n initialize: function(ui, editor) {\n $.extend(this.options, {\n immutables: editor && editor.options.immutables\n });\n },\n\n update: function(ui, nodes) {\n var suitableNodes = this.finder.findSuitable(nodes),\n toolbar = ui.closest(\".k-toolbar\").data(\"kendoToolBar\"),\n isOutdentable, listParentsCount, i, len, suitable, immutableParent;\n\n for (i = 0, len = suitableNodes.length; i < len; i++) {\n suitable = suitableNodes[i];\n\n if (this.options.immutables) {\n immutableParent = Editor.Immutables.immutableParent(suitable);\n\n if (immutableParent) {\n suitable = immutableParent;\n }\n }\n\n isOutdentable = indent(suitable);\n\n if (!isOutdentable) {\n listParentsCount = $(suitable).parents(\"ul,ol\").length;\n isOutdentable = (dom.is(suitable, \"li\") && (listParentsCount > 1 || indent(suitable.parentNode))) ||\n (dom.ofType(suitable, [\"ul\",\"ol\"]) && listParentsCount > 0);\n }\n\n if (isOutdentable) {\n toolbar.enable(ui, true);\n return;\n }\n }\n\n toolbar.enable(ui, false);\n }\n });\n\n extend(Editor, {\n IndentFormatter: IndentFormatter,\n IndentCommand: IndentCommand,\n OutdentCommand: OutdentCommand,\n OutdentTool: OutdentTool\n });\n\n registerTool(\"indent\", new Tool({ command: IndentCommand }));\n registerTool(\"outdent\", new OutdentTool({ command: OutdentCommand, ui: { enable: false } }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n extend = $.extend,\n editorNS = kendo.ui.editor,\n dom = editorNS.Dom,\n Command = editorNS.Command,\n Tool = editorNS.Tool,\n BlockFormatter = editorNS.BlockFormatter,\n normalize = dom.normalize,\n RangeUtils = editorNS.RangeUtils,\n registerTool = editorNS.EditorUtils.registerTool;\n\n var ParagraphCommand = Command.extend({\n init: function(options) {\n this.options = options;\n Command.fn.init.call(this, options);\n },\n\n _insertMarker: function(doc, range) {\n var marker = dom.create(doc, 'a'), container;\n marker.className = \"k-marker\";\n\n range.insertNode(marker);\n\n if (!marker.parentNode) {\n // inserting paragraph in Firefox full body range\n container = range.commonAncestorContainer;\n container.innerHTML = \"\";\n container.appendChild(marker);\n }\n\n normalize(marker.parentNode);\n\n return marker;\n },\n\n _moveFocus: function(range, candidate) {\n if (dom.isEmpty(candidate)) {\n range.setStartBefore(candidate);\n } else {\n range.selectNodeContents(candidate);\n\n var focusNode = RangeUtils.textNodes(range)[0];\n\n if (!focusNode) {\n while (candidate.childNodes.length && !dom.is(candidate.firstChild, \"br\")) {\n candidate = candidate.firstChild;\n }\n\n focusNode = candidate;\n }\n\n if (dom.isEmpty(focusNode)) {\n range.setStartBefore(focusNode);\n } else {\n if (dom.emptyNode(focusNode)) {\n focusNode.innerHTML = \"\\ufeff\";\n }\n var startNode = focusNode.firstChild || focusNode;\n if (dom.isDataNode(startNode)) {\n range.setStart(startNode, 0);\n } else {\n range.setStartBefore(startNode);\n }\n }\n }\n },\n\n shouldTrim: function(range) {\n var blocks = 'p,h1,h2,h3,h4,h5,h6'.split(','),\n startInBlock = dom.parentOfType(range.startContainer, blocks),\n endInBlock = dom.parentOfType(range.endContainer, blocks);\n return (startInBlock && !endInBlock) || (!startInBlock && endInBlock);\n },\n\n _blankAfter: function(node) {\n while (node && (dom.isMarker(node) || dom.stripBom(node.nodeValue) === \"\")) {\n node = node.nextSibling;\n }\n\n return !node;\n },\n\n exec: function() {\n var range = this.getRange(),\n doc = RangeUtils.documentFromRange(range),\n parent, previous, next,\n emptyParagraphContent = editorNS.emptyElementContent,\n paragraph, marker, li, heading, tableNode, rng,\n shouldTrim;\n\n this.expandImmutablesIn(range);\n\n shouldTrim = this.shouldTrim(range);\n\n range.deleteContents();\n marker = this._insertMarker(doc, range);\n\n dom.stripBomNode(marker.previousSibling);\n dom.stripBomNode(marker.nextSibling);\n\n li = dom.closestEditableOfType(marker, ['li']);\n heading = dom.closestEditableOfType(marker, 'h1,h2,h3,h4,h5,h6'.split(','));\n tableNode = dom.is(marker.parentNode, 'table') && marker.parentNode;\n\n if (li) {\n // hitting 'enter' in empty li\n if (dom.emptyNode(li)) {\n paragraph = dom.create(doc, 'p');\n\n if (dom.next(li)) {\n rng = range.cloneRange();\n rng.selectNode(li);\n\n RangeUtils.split(rng, li.parentNode);\n }\n\n var br = $(\"br\", li);\n if (br.length == 1) {\n br.remove();\n }\n\n var parentNode = li.parentNode;\n var parentChildrenLength = li.parentNode.children.length;\n var firstChild = parentChildrenLength > 1 && li.childNodes.length == 1 && li.children[0];\n\n dom.insertAfter(paragraph, parentNode);\n dom.remove(parentChildrenLength == 1 ? li.parentNode : li);\n\n if (firstChild && firstChild !== marker) {\n paragraph.appendChild(firstChild);\n paragraph.appendChild(marker);\n } else {\n paragraph.innerHTML = emptyParagraphContent;\n }\n next = paragraph;\n }\n } else if (heading && this._blankAfter(marker)) {\n paragraph = this._insertParagraphAfter(heading);\n dom.remove(marker);\n next = paragraph;\n } else if (tableNode) {\n paragraph = this._insertParagraphAfter(tableNode);\n dom.remove(marker);\n next = paragraph;\n }\n\n if (!next) {\n if (!(li || heading)) {\n new BlockFormatter([{ tags: ['p'] }]).apply([marker]);\n }\n\n range.selectNode(marker);\n\n parent = dom.parentOfType(marker, [li ? 'li' : heading ? dom.name(heading) : 'p']);\n\n RangeUtils.split(range, parent, shouldTrim);\n\n previous = parent.previousSibling;\n\n if (dom.is(previous, 'li') && previous.firstChild && !dom.is(previous.firstChild, 'br')) {\n previous = previous.firstChild;\n }\n\n next = parent.nextSibling;\n\n this.clean(previous, { links: true });\n this.clean(next, { links: true });\n\n if (dom.is(next, 'li') && next.firstChild && !dom.is(next.firstChild, 'br')) {\n next = next.firstChild;\n }\n\n dom.remove(parent);\n\n // normalize updates the caret display in Gecko\n normalize(previous);\n }\n\n normalize(next);\n\n this._moveFocus(range, next);\n\n range.collapse(true);\n\n dom.scrollTo(next, true);\n\n RangeUtils.selectRange(range);\n },\n\n _insertParagraphAfter: function(node) {\n var range = this.getRange();\n var doc = RangeUtils.documentFromRange(range);\n var emptyElementContent = editorNS.emptyElementContent;\n var paragraph = dom.create(doc, 'p');\n\n dom.insertAfter(paragraph, node);\n paragraph.innerHTML = emptyElementContent;\n\n return paragraph;\n },\n\n clean: function(node, options) {\n var root = node;\n\n if (node.firstChild && dom.is(node.firstChild, 'br')) {\n dom.remove(node.firstChild);\n }\n\n if (dom.isDataNode(node) && !node.nodeValue) {\n node = node.parentNode;\n }\n\n if (node) {\n var siblings = false;\n while (node.firstChild && node.firstChild.nodeType == 1) {\n siblings = siblings || (dom.significantNodes(node.childNodes).length > 1);\n node = node.firstChild;\n }\n\n if (!dom.isEmpty(node) && node.className != \"k-br\" && /^\\s*$/.test(node.innerHTML) && !siblings) {\n $(root).find(\".k-br\").remove();\n node.innerHTML = editorNS.emptyElementContent;\n }\n\n if (options && options.links) {\n while (node != root) {\n if (dom.is(node, \"a\") && dom.emptyNode(node)) {\n dom.unwrap(node);\n break;\n }\n node = node.parentNode;\n }\n }\n }\n }\n });\n\n var NewLineCommand = Command.extend({\n init: function(options) {\n this.options = options;\n Command.fn.init.call(this, options);\n },\n\n exec: function() {\n var range = this.getRange();\n this.expandImmutablesIn(range);\n\n var br = dom.create(RangeUtils.documentFromRange(range), 'br');\n var node = range.startContainer;\n var filler;\n var browser = kendo.support.browser;\n var oldIE = browser.msie && browser.version < 11;\n var tableNode = dom.is(node, 'table') && node;\n var kbrParent;\n\n range.deleteContents();\n if (tableNode) {\n dom.insertAfter(br, tableNode);\n } else {\n kbrParent = $(node).closest('.k-br');\n range.insertNode(br);\n\n if (kbrParent.length) {\n // pressing enter in an k-br node\n dom.unwrap(kbrParent[0]);\n }\n }\n\n normalize(br.parentNode);\n\n if (!oldIE && (!br.nextSibling || dom.isWhitespace(br.nextSibling))) {\n // Gecko and WebKit cannot put the caret after only one br.\n if (!!br.nextSibling && dom.isWhitespace(br.nextSibling)) {\n $(br.nextSibling).remove();\n }\n filler = br.cloneNode(true);\n filler.className = 'k-br';\n dom.insertAfter(filler, br);\n }\n\n range.setStartAfter(br);\n range.collapse(true);\n\n dom.scrollTo(br.nextSibling || br, true);\n\n RangeUtils.selectRange(range);\n }\n });\n\n extend(editorNS, {\n ParagraphCommand: ParagraphCommand,\n NewLineCommand: NewLineCommand\n });\n\n registerTool(\"insertLineBreak\", new Tool({ key: 13, shift: true, command: NewLineCommand }));\n registerTool(\"insertParagraph\", new Tool({ key: 13, command: ParagraphCommand }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n encode = kendo.htmlEncode,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n dom = Editor.Dom,\n registerTool = EditorUtils.registerTool,\n RangeUtils = Editor.RangeUtils,\n Command = Editor.Command,\n LinkFormatter = Editor.LinkFormatter,\n textNodes = RangeUtils.textNodes,\n keys = kendo.keys,\n KEDITORFILEURL = \"#k-editor-file-url\",\n KEDITORFILETEXT = \"#k-editor-file-text\",\n KEDITORFILETITLE = \"#k-editor-file-title\";\n\n var FileCommand = Command.extend({\n init: function(options) {\n var that = this;\n Command.fn.init.call(that, options);\n\n that.formatter = new LinkFormatter();\n\n that.async = true;\n that.attributes = {};\n },\n\n insertFile: function(file, range) {\n var attributes = this.attributes;\n var doc = RangeUtils.documentFromRange(range);\n\n if (attributes.href && attributes.href != \"http://\") {\n\n if (!file) {\n file = dom.create(doc, \"a\", { href: attributes.href });\n file.innerHTML = attributes.innerHTML;\n file.title = attributes.title;\n\n range.deleteContents();\n range.insertNode(file);\n\n if (!file.nextSibling) {\n dom.insertAfter(doc.createTextNode(\"\\ufeff\"), file);\n }\n\n range.setStartAfter(file);\n range.setEndAfter(file);\n RangeUtils.selectRange(range);\n return true;\n } else {\n dom.attr(file, attributes);\n }\n }\n\n return false;\n },\n\n redo: function() {\n var that = this,\n range = that.lockRange();\n\n this.formatter.apply(range, this.attributes);\n that.releaseRange(range);\n },\n\n exec: function() {\n var that = this,\n range = that.lockRange(),\n nodes = textNodes(range),\n applied = false,\n file = nodes.length ? this.formatter.finder.findSuitable(nodes[0]) : null,\n dialog,\n form,\n isIE = kendo.support.browser.msie,\n options = that.editor.options,\n messages = options.messages,\n fileBrowser = options.fileBrowser,\n showBrowser = !!(kendo.ui.FileBrowser && fileBrowser && fileBrowser.transport && fileBrowser.transport.read !== undefined$1),\n dialogOptions = {\n title: messages.insertFile,\n visible: false,\n resizable: showBrowser\n };\n\n this.expandImmutablesIn(range);\n\n function apply(e) {\n var element = dialog.element,\n href = element.find(KEDITORFILEURL).val().replace(/ /g, \"%20\"),\n innerHTML = element.find(KEDITORFILETEXT).val(),\n title = element.find(KEDITORFILETITLE).val();\n\n that.attributes = {\n href: href,\n innerHTML: innerHTML !== \"\" ? innerHTML : href,\n title: title\n };\n\n applied = that.insertFile(file, range);\n\n close(e);\n\n if (that.change) {\n that.change();\n }\n }\n\n function close(e) {\n e.preventDefault();\n form.destroy();\n dialog.destroy();\n\n dom.windowFromDocument(RangeUtils.documentFromRange(range)).focus();\n if (!applied) {\n that.releaseRange(range);\n }\n }\n\n function keyDown(e) {\n if (e.keyCode == keys.ENTER) {\n apply(e);\n } else if (e.keyCode == keys.ESC) {\n close(e);\n }\n }\n\n dialogOptions.close = close;\n\n if (showBrowser) {\n dialogOptions.width = 750;\n }\n dialogOptions.minWidth = 350;\n\n dialog = this.createDialog(\"
    \", dialogOptions).data(\"kendoWindow\");\n form = that._createForm(dialog, showBrowser);\n\n dialog.element.toggleClass(\"k-filebrowser-dialog\", showBrowser);\n dialog.wrapper\n .find(\".k-dialog-insert\").on(\"click\", apply).end()\n .find(\".k-dialog-close\").on(\"click\", close).end()\n .find(\".k-form-field input\").on(\"keydown\", keyDown).end()\n // IE < 8 returns absolute url if getAttribute is not used\n .find(KEDITORFILEURL).val(file ? file.getAttribute(\"href\", 2) : \"http://\").end()\n .find(KEDITORFILETEXT).val(file ? file.innerText : \"\").end()\n .find(KEDITORFILETITLE).val(file ? file.title : \"\").end();\n\n var element = dialog.element;\n if (showBrowser) {\n that._fileBrowser = new kendo.ui.FileBrowser(\n element.find(\".k-filebrowser\"),\n extend({}, fileBrowser)\n );\n\n that._fileBrowser.bind(\"change\", function(ev) {\n if (ev.selected.get(\"type\") === \"f\") {\n element.find(KEDITORFILEURL).val(this.value());\n }\n } );\n\n that._fileBrowser.bind(\"apply\", apply);\n }\n\n if (isIE) {\n var dialogHeight = element.closest(\".k-window\").height();\n element.css(\"max-height\", dialogHeight);\n }\n dialog.center().open();\n element.find(KEDITORFILEURL).trigger(\"focus\").select();\n },\n\n _createForm: function(dialog, showBrowser) {\n var that = this;\n var formElement = $(\"
    \").appendTo(dialog.element);\n var messages = that.editor.options.messages;\n\n var form = formElement.kendoForm({\n renderButtons: false,\n items: [\n {\n field: \"k-editor-file-url\",\n label: encode(messages.fileWebAddress),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-file-text\",\n label: encode(messages.fileText),\n editor: \"TextBox\"\n },\n {\n field: \"k-editor-file-title\",\n label: encode(messages.fileTitle),\n editor: \"TextBox\"\n }\n ]\n }).data(\"kendoForm\");\n\n if (showBrowser) {\n formElement.prepend($('
    '));\n }\n\n dialog.element.after($(that._actionButtonsTemplate({ messages: messages, insertButtonIcon: \"file-add\", cancelButtonIcon: \"cancel-outline\" })));\n\n return form;\n }\n\n });\n\n kendo.ui.editor.FileCommand = FileCommand;\n\n registerTool(\"insertFile\", new Editor.Tool({ command: FileCommand }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n extend = $.extend,\n Editor = kendo.ui.editor,\n dom = Editor.Dom,\n RangeUtils = Editor.RangeUtils,\n Command = Editor.Command,\n\n NS = \"kendoEditor\",\n ACTIVESTATE = \"k-active\",\n SELECTEDSTATE = \"k-selected\",\n SCOPE = \"scope\",\n ROW = \"row\",\n COL = \"col\",\n ROWGROUP = \"rowgroup\",\n COLGROUP = \"colgroup\",\n COLSPAN = \"colspan\",\n ROWSPAN = \"rowspan\",\n TABLE = \"table\",\n THEAD = \"thead\",\n TBODY = \"tbody\",\n TR = \"tr\",\n TD = \"td\",\n TH = \"th\",\n\n Tool = Editor.Tool,\n InsertHtmlCommand = Editor.InsertHtmlCommand,\n BlockFormatFinder = Editor.BlockFormatFinder,\n BlockFormatTool = Editor.BlockFormatTool,\n FormatCommand = Editor.FormatCommand,\n registerTool = Editor.EditorUtils.registerTool,\n registerFormat = Editor.EditorUtils.registerFormat,\n formats = kendo.ui.Editor.fn.options.formats,\n getTouches = kendo.getTouches;\n var template = kendo.template;\n\n var columnTemplate = function (ref) {\n var width = ref.width;\n var content = ref.content;\n\n return (\"\" + content + \"\");\n };\n\n var tableFormatFinder = new BlockFormatFinder([{ tags: [TABLE] }]);\n\n var TableCommand = InsertHtmlCommand.extend({\n init: function(options) {\n var o = $.extend({\n postProcess: this.postProcess,\n skipCleaners: true\n }, options || {});\n\n InsertHtmlCommand.fn.init.call(this, o);\n },\n _tableHtml: function(rows, columns) {\n rows = rows || 1;\n columns = columns || 1;\n var columnHtml = template(columnTemplate)({ width: 100 / columns, content: Editor.emptyTableCellContent });\n var rowHeight = 100 / rows;\n\n return \"\" +\n new Array(rows + 1).join(\n \"\" +\n new Array(columns + 1).join(columnHtml) +\n \"\") +\n \"
    \";\n },\n\n postProcess: function(editor, range) {\n var insertedTable = $(\"table[data-last]\", editor.document).removeAttr(\"data-last\");\n\n range.setStart(insertedTable.find(TD)[0], 0);\n range.collapse(true);\n\n editor.selectRange(range);\n },\n\n exec: function() {\n var options = this.options;\n options.html = this._tableHtml(options.rows, options.columns);\n\n InsertHtmlCommand.fn.exec.call(this);\n }\n });\n\n var PopupTool = Tool.extend({\n initialize: function(ui, editor) {\n var that = this;\n var btn = $(\"\");\n var popup = $(this.options.popupTemplate).appendTo(\"body\").kendoPopup({\n anchor: ui,\n copyAnchorStyles: false,\n open: this._open.bind(this),\n activate: this._activate.bind(this),\n close: this._close.bind(this)\n }).data(\"kendoPopup\");\n\n ui.on(\"click\", this._toggle.bind(this))\n .on(\"keydown\", this._keydown.bind(this));\n\n this._editor = editor;\n this._popup = popup;\n\n editor.tablePopup = this._popup;\n\n var tableWizard = new Editor.TableWizardTool({\n command: Editor.TableWizardCommand,\n insertNewTable: true\n });\n\n registerTool(\"tableWizardInsert\", tableWizard);\n\n btn.appendTo(popup.element);\n btn.kendoButton({\n icon: \"table-wizard\"\n });\n\n btn.on(\"click\", function () {\n that._editor.exec(\"tableWizardInsert\");\n });\n },\n\n popup: function() {\n return this._popup;\n },\n\n _activate: $.noop,\n\n _open: function() {\n this._popup.options.anchor.addClass(ACTIVESTATE);\n },\n\n _close: function() {\n this._popup.options.anchor.removeClass(ACTIVESTATE);\n },\n\n _keydown: function(e) {\n var that = this,\n keys = kendo.keys,\n key = e.keyCode;\n\n if (key == keys.ESC) {\n that._popup.close();\n } else if (key == keys.DOWN && e.altKey) {\n that._popup.open();\n that._setTableSize({ row: 1, col: 1 });\n } else if (key === keys.ENTER) {\n setTimeout(function () {\n that._setTableSize({ row: 1, col: 1 });\n });\n }\n },\n\n _toggle: function(e) {\n var button = $(e.target).closest(\".k-tool\");\n\n if (!button.hasClass(\"k-disabled\")) {\n this.popup().toggle();\n }\n },\n\n update: function(ui) {\n var popup = this.popup();\n\n if (popup.wrapper && popup.wrapper.css(\"display\") == \"block\") {\n popup.close();\n }\n\n ui.removeClass(\"k-hover\");\n },\n\n destroy: function() {\n if (this._popup) {\n this._popup.destroy();\n }\n }\n });\n\n var InsertTableTool = PopupTool.extend({\n init: function(options) {\n this.cols = 8;\n this.rows = 6;\n\n PopupTool.fn.init.call(this, $.extend(options, {\n command: TableCommand,\n popupTemplate:\n \"
    \" +\n \"
    \" +\n new Array(this.cols * this.rows + 1).join(\"\") +\n \"
    \" +\n \"
    \" +\n \"
    \"\n }));\n },\n\n _activate: function() {\n var that = this,\n element = that._popup.element,\n cells = element.find(\".k-ct-cell\"),\n firstCell = cells.eq(0),\n lastCell = cells.eq(cells.length - 1),\n start = kendo.getOffset(firstCell),\n end = kendo.getOffset(lastCell),\n cols = that.cols,\n rows = that.rows,\n cellWidth, cellHeight;\n\n element.find(\"*\").addBack().attr(\"unselectable\", \"on\");\n\n end.left += lastCell[0].offsetWidth;\n end.top += lastCell[0].offsetHeight;\n\n cellWidth = (end.left - start.left) / cols;\n cellHeight = (end.top - start.top) / rows;\n\n function tableFromLocation(e) {\n var w = $(window);\n return {\n row: Math.floor((e.clientY + w.scrollTop() - start.top) / cellHeight) + 1,\n col: Math.floor((e.clientX + w.scrollLeft() - start.left) / cellWidth) + 1\n };\n }\n\n element.autoApplyNS(NS)\n .on(\"mousemove\", \".k-ct-cell\", function(e) {\n that._setTableSize(tableFromLocation(e));\n })\n .on(\"mouseleave\", \".k-ct-cell\", function() {\n that._setTableSize();\n })\n .on(\"down\", \".k-ct-cell\", function(e) {\n e.preventDefault();\n var touch = getTouches(e)[0];\n that._exec(tableFromLocation(touch.location));\n });\n },\n\n _valid: function(size) {\n return size && size.row > 0 && size.col > 0 && size.row <= this.rows && size.col <= this.cols;\n },\n\n _exec: function(size) {\n if (this._valid(size)) {\n this._editor.exec(\"createTable\", {\n rows: size.row,\n columns: size.col\n });\n this._popup.close();\n }\n },\n\n _setTableSize: function(size) {\n var element = this._popup.element;\n var status = element.find(\".k-status\");\n var cells = element.find(\".k-ct-cell\");\n var cols = this.cols;\n var messages = this._editor.options.messages;\n\n if (this._valid(size)) {\n status.text(kendo.format(messages.createTableHint, size.row, size.col));\n\n cells.each(function(i) {\n $(this).toggleClass(\n SELECTEDSTATE,\n i % cols < size.col && i / cols < size.row\n );\n });\n } else {\n status.text(messages.createTable);\n cells.removeClass(SELECTEDSTATE);\n }\n },\n\n _keydown: function(e) {\n var initiallyVisible = this._popup.visible();\n\n PopupTool.fn._keydown.call(this, e);\n\n if (!this._popup.visible()) {\n return;\n }\n\n var keys = kendo.keys;\n var key = e.keyCode;\n var cells = this._popup.element.find(\".k-ct-cell\");\n var focus = Math.max(cells.filter(\".k-selected\").last().index(), 0);\n var selectedRows = Math.floor(focus / this.cols);\n var selectedColumns = focus % this.cols;\n\n var changed = false,\n button;\n\n if (key == keys.DOWN && !e.altKey) {\n changed = true;\n selectedRows++;\n } else if (key == keys.UP) {\n changed = true;\n selectedRows--;\n } else if (key == keys.RIGHT) {\n changed = true;\n selectedColumns++;\n } else if (key == keys.LEFT) {\n changed = true;\n selectedColumns--;\n } else if (key == keys.TAB) {\n button = this._popup.element.find(\".k-button\");\n\n if (button.length > 0) {\n changed = true;\n button.trigger(\"focus\");\n }\n }\n\n var tableSize = {\n row: Math.max(1, Math.min(this.rows, selectedRows + 1)),\n col: Math.max(1, Math.min(this.cols, selectedColumns + 1))\n };\n\n if (key == keys.ENTER && initiallyVisible) {\n this._exec(tableSize);\n } else {\n this._setTableSize(tableSize);\n }\n\n if (changed) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n },\n\n _open: function() {\n var messages = this._editor.options.messages;\n\n PopupTool.fn._open.call(this);\n\n this.popup().element\n .find(\".k-status\").text(messages.createTable).end()\n .find(\".k-ct-cell\").removeClass(SELECTEDSTATE);\n },\n\n _close: function() {\n PopupTool.fn._close.call(this);\n this.popup().element.off(\".\" + NS);\n }\n });\n\n var TableModificationCommand = Command.extend({\n undo: function() {\n var point = this.restorePoint;\n point.restoreHtml();\n\n $(this.editor.body).find(\".k-element-resize-handle-wrapper\")\n .each(function(index,el) {\n el.remove();\n });\n\n this.editor.selectRange(point.toRange());\n },\n _clearColIndexAttr: function(table) {\n dom.clearTableMappings(table, \"col-index\");\n },\n _mapColIndices: function(table) {\n dom.reMapTableColumns(table, \"col-index\");\n },\n _findRowSpanCell: function(parent, rowIndex, colIndex) {\n var row, cell;\n\n for (var i = rowIndex; i >= 0; i--) {\n row = parent.rows[i];\n cell = $(row).find(\"[col-index=\" + colIndex + \"]\");\n\n if (cell.length) {\n return cell;\n }\n }\n },\n _resetElementResizing: function(editor) {\n editor._destroyResizings();\n editor._initializeColumnResizing();\n editor._initializeRowResizing();\n editor._initializeElementResizing();\n },\n _findNextTdInRow: function(row, colIndex) {\n var lastTd = row.find(\"td:last-child\"),\n lastIndex = parseInt(lastTd.attr(\"col-index\"), 10) + lastTd.prop(\"colSpan\") - 1,\n td;\n\n for (var i = colIndex; i <= lastIndex; i++) {\n td = row.find(\"[col-index=\" + i + \"]\");\n if (td.length) {\n return td;\n }\n }\n },\n _adjustColgroups: function(row, table) {\n var colElements = table.getElementsByTagName(COL),\n colgroupElements = table.getElementsByTagName(COLGROUP),\n cells = row.cells,\n numberOfCells = cells.length,\n i, colgroup, cell;\n\n while (colElements.length > 0) {\n colElements[0].remove();\n }\n while (colgroupElements.length > 0) {\n colgroupElements[0].remove();\n }\n\n for (i = numberOfCells - 1; i >= 0; i--) {\n cell = cells[i];\n if (cell.getAttribute(SCOPE) === COLGROUP) {\n colgroup = dom.createEmptyNode(this.editor.document, COLGROUP);\n colgroup.setAttribute(\"span\", cell.getAttribute(COLSPAN));\n table.prepend(colgroup);\n } else {\n table.prepend(dom.createEmptyNode(this.editor.document, COL));\n }\n }\n },\n _associateHeaderIds: function(table) {\n dom.clearTableMappings(table, \"col-index\");\n dom.reMapTableColumns(table, \"col-index\");\n $(table).find(\"th, td\").removeAttr(\"id headers\");\n dom.associateWithIds(table);\n },\n _getNumberOfColumns: function(table) {\n return dom._getNumberOfColumns(table, \"td, th\");\n }\n });\n\n var InsertRowCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(true),\n td = dom.closest(range.endContainer, [TD, TH]),\n table = dom.closest(td, TABLE),\n position = this.options.position || \"after\",\n cellCount, row, cell,\n newRow, rowIndex, rowSpanIndex, createdCell;\n\n if (!table || (this.immutables() && Editor.Immutables.immutableParent(td))) {\n this.releaseRange(range);\n return;\n }\n\n this._mapColIndices(table);\n\n row = td.parentNode;\n rowIndex = dom.findNodeIndex(row, true);\n\n if (td.rowSpan > 1 && position === \"after\") {\n row = table.rows[rowIndex + td.rowSpan - 1];\n }\n\n cellCount = this._getNumberOfColumns(table);\n newRow = row.cloneNode(true);\n $(newRow).empty();\n\n for (var i = 0; i < cellCount; i = i + cell.prop(\"colSpan\")) {\n cell = $(row).find(\"[col-index=\" + i + \"]\");\n\n if (cell.length) {\n if (cell.prop(\"rowSpan\") > 1 && position === \"after\" && cell) {\n cell.attr(ROWSPAN, cell.prop(\"rowSpan\") + 1);\n } else {\n this._appendCell(newRow, cell);\n }\n } else {\n rowIndex = dom.findNodeIndex(row, true);\n cell = this._findRowSpanCell(row.parentElement, rowIndex, i);\n rowSpanIndex = cell.closest(TR).index();\n\n if (rowSpanIndex + cell.prop(\"rowSpan\") - 1 === rowIndex && position === \"after\") {\n this._appendCell(newRow, cell);\n } else {\n cell.attr(ROWSPAN, cell.prop(\"rowSpan\") + 1);\n }\n }\n\n createdCell = $(newRow).find(\"[col-index=\" + i + \"]\");\n if (createdCell.attr(SCOPE) === ROWGROUP && !createdCell.attr(ROWSPAN)) {\n createdCell.attr(SCOPE, ROW);\n }\n }\n\n if (position == \"before\") {\n dom.insertBefore(newRow, row);\n } else {\n dom.insertAfter(newRow, row);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n\n this._resetElementResizing(this.editor);\n },\n _appendCell: function(row, cell) {\n var newCell;\n\n newCell = cell.clone();\n newCell.html(Editor.emptyTableCellContent);\n newCell.removeAttr(ROWSPAN);\n newCell.appendTo(row);\n }\n });\n\n var InsertColumnCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(true),\n td = dom.closest(range.endContainer, [TD, TH]),\n table = dom.closest(td, TABLE),\n colElements = table.getElementsByTagName(COL),\n colgroupElements = table.getElementsByTagName(COLGROUP),\n columnIndex,\n i,\n rows = table && table.rows,\n cell,\n newCell,\n position = this.options.position || \"after\";\n\n\n if (!td || (this.immutables() && Editor.Immutables.immutableParent(td))) {\n this.releaseRange(range);\n return;\n }\n\n this._mapColIndices(table);\n\n columnIndex = parseInt(td.getAttribute(\"col-index\"),10);\n\n if (td.colSpan > 1 && position === \"after\") {\n td.setAttribute(\"col-index\", columnIndex + td.colSpan - 1);\n columnIndex = columnIndex + td.colSpan - 1;\n }\n\n for (i = 0; i < rows.length; i++) {\n cell = this._processForColSpan(rows[i], columnIndex, position, td);\n\n if (!cell) {\n continue;\n }\n\n newCell = cell.cloneNode();\n newCell.innerHTML = Editor.emptyTableCellContent;\n newCell.removeAttribute(COLSPAN);\n\n if (newCell.getAttribute(SCOPE) && newCell.getAttribute(SCOPE) === COLGROUP) {\n newCell.setAttribute(SCOPE, COL);\n }\n\n if (position == \"before\") {\n dom.insertBefore(newCell, cell);\n } else {\n dom.insertAfter(newCell, cell);\n }\n\n this._resizeCells(newCell, cell);\n }\n\n if (colElements.length > 0 || colgroupElements.length > 0) {\n this._adjustColgroups(rows[0], table);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n\n this._resetElementResizing(this.editor);\n },\n _processForColSpan: function(row, columnIndex, position, selectedCell) {\n var cell,\n colSpanEffect,\n index = columnIndex - 1;\n\n cell = $(row).find(\"[col-index=\" + columnIndex + \"]\")[0];\n\n if (cell && cell.colSpan > 1 && position === \"after\" && cell !== selectedCell) {\n cell.colSpan += 1;\n return;\n }\n\n if (cell) {\n return cell;\n }\n\n for (index; index >= 0; index--) {\n cell = $(row).find(\"[col-index=\" + index + \"]\")[0];\n\n if (cell && cell.colSpan > 1) {\n break;\n }\n }\n\n if (!cell) {\n return;\n }\n\n colSpanEffect = parseInt(cell.getAttribute(\"col-index\"),10) + cell.colSpan - 1;\n\n if (colSpanEffect === columnIndex && position === \"after\") {\n return cell;\n } else if (columnIndex <= colSpanEffect) {\n cell.setAttribute(COLSPAN, cell.colSpan + 1);\n }\n },\n _resizeCells: function(newCell, cell) {\n var width = newCell.style.width,\n parsedWidth, unit, calculatedWidth;\n\n if (!width) {\n return;\n }\n\n parsedWidth = parseFloat(width);\n unit = width.slice(parsedWidth.toString().length);\n calculatedWidth = (parsedWidth / 2) + unit;\n\n newCell.style.width = calculatedWidth;\n cell.style.width = calculatedWidth;\n }\n });\n\n var DeleteRowCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange();\n var rows = RangeUtils.mapAll(range, function(node) {\n return $(node).closest(TR)[0];\n });\n var td = dom.closest(range.endContainer, [TD, TH]);\n var row = rows[0];\n var rowSpan = td ? td.rowSpan : 1;\n var rowIndex = $(rows[0]).index();\n var table = dom.closest(row, TABLE);\n var rowParent = row.parentElement;\n var focusElement;\n\n if (!table || (this.immutables() && Editor.Immutables.immutableParent(row))) {\n this.releaseRange(range);\n return;\n }\n\n for (var x = 0; x < rowSpan; x++) {\n if (rows.indexOf(rowParent.rows[rowIndex + x]) < 0) {\n rows.push(rowParent.rows[rowIndex + x]);\n }\n }\n\n if (table.rows.length <= rows.length) {\n focusElement = dom.next(table);\n if (!focusElement || dom.insignificant(focusElement)) {\n focusElement = dom.prev(table);\n }\n\n if (focusElement && focusElement.rows) {\n focusElement = focusElement.rows[0].cells[0];\n }\n\n dom.remove(table);\n this._resetElementResizing(this.editor);\n } else if (rowParent.rows.length <= rows.length) {\n focusElement = rowParent.nextSibling;\n\n if (!focusElement) {\n focusElement = rowParent.previousSibling;\n }\n\n dom.remove(rowParent);\n } else {\n this._mapColIndices(table);\n\n for (var i = 0; i < rows.length; i++) {\n row = rows[i];\n dom.removeTextSiblings(row);\n focusElement = dom.next(row) || dom.prev(row);\n focusElement = focusElement.cells[0];\n\n // IE needs to focus the new row before removing the old one\n this._focusElement(range, focusElement);\n focusElement = null;\n\n this._handleRowSpanCells(table, row);\n\n dom.remove(row);\n }\n\n this._clearColIndexAttr(table);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n } else if (dom.is(rowParent, THEAD) && $(table).find(\"[scope]\").length > 0) {\n this._adjustColgroups(rowParent.rows[0], table);\n }\n\n if (focusElement) {\n this._focusElement(range, focusElement);\n }\n\n this._resetElementResizing(this.editor);\n },\n _focusElement: function(range, node) {\n range.setStart(node, 0);\n range.collapse(true);\n this.editor.selectRange(range);\n },\n _handleRowSpanCells: function(table, row) {\n var index, cell, adjacentCell, nextRow, rowIndex = dom.findNodeIndex(row, true),\n firstRow = table.rows[0],\n lastCell = firstRow.cells[firstRow.cells.length - 1],\n lastIndex = parseInt(lastCell.getAttribute(\"col-index\"),10) + lastCell.colSpan - 1;\n\n for (index = 0; index <= lastIndex; index = index + cell.prop(\"colSpan\")) {\n cell = $(row).find(\"[col-index=\" + index + \"]\");\n\n if (cell.length && cell.prop(\"rowSpan\") > 1) {\n nextRow = table.rows[rowIndex + 1];\n adjacentCell = $(nextRow).find(\"[col-index=\" + (index + 1) + \"]\");\n\n if (adjacentCell.length) {\n adjacentCell.before(cell);\n } else {\n $(nextRow).append(cell);\n }\n this._reduceRowSpan(cell);\n }\n\n if (!cell.length) {\n cell = this._findRowSpanCell(row.parentElement, rowIndex, index);\n this._reduceRowSpan(cell);\n }\n }\n },\n _reduceRowSpan: function(td) {\n var rowSpanValue = td.prop(\"rowSpan\") - 1;\n\n if (rowSpanValue <= 1) {\n td.removeAttr(ROWSPAN);\n if (td.attr(SCOPE) === ROWGROUP) {\n td.attr(SCOPE, ROW);\n }\n } else {\n td.attr(ROWSPAN, rowSpanValue);\n }\n }\n });\n\n var DeleteColumnCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(),\n td = dom.closest(range.endContainer, [TD, TH]),\n table = dom.closest(td, TABLE),\n rows = table && table.rows,\n columnIndex = dom.findNodeIndex(td, true),\n columnCount = rows && rows[0].cells.length,\n colElements = table.getElementsByTagName(COL),\n colgroupElements = table.getElementsByTagName(COLGROUP),\n focusElement, i, cell, x;\n\n if (!td || (this.immutables() && Editor.Immutables.immutableParent(td))) {\n this.releaseRange(range);\n return;\n }\n\n if (columnCount == 1 || td.colSpan == columnCount) {\n focusElement = dom.next(table);\n if (!focusElement || dom.insignificant(focusElement)) {\n focusElement = dom.prev(table);\n }\n\n if (focusElement && focusElement.rows) {\n focusElement = focusElement.rows[0].cells[0];\n }\n\n dom.remove(table);\n this._resetElementResizing(this.editor);\n } else {\n dom.removeTextSiblings(td);\n\n focusElement = dom.next(td) || dom.prev(td);\n\n this._mapColIndices(table);\n\n columnIndex = parseInt(td.getAttribute(\"col-index\"), 10);\n\n for (x = 0; x < td.colSpan; x++) {\n for (i = 0; i < rows.length; i = i + (cell.prop(\"rowSpan\") || 1)) {\n cell = $(rows[i]).find(\"[col-index=\" + (columnIndex + x) + \"]\");\n\n if (cell.length && cell.prop(\"colSpan\") <= 1) {\n cell.remove();\n } else {\n this._handleColSpanCells(rows[i], columnIndex + x);\n }\n }\n }\n\n this._clearColIndexAttr(table);\n }\n\n if (colElements.length > 0 || colgroupElements.length > 0) {\n this._adjustColgroups(rows[0], table);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n if (focusElement) {\n range.setStart(focusElement, 0);\n range.collapse(true);\n this.editor.selectRange(range);\n }\n\n this._resetElementResizing(this.editor);\n },\n _handleColSpanCells: function(row, colIndex) {\n var cell = $(row).find(\"[col-index=\" + colIndex + \"]\");\n\n if (cell.length && cell.prop(\"colSpan\") > 1) {\n var clone = cell.clone(true);\n cell.after(clone);\n this._reduceColSpan(clone);\n clone.attr(\"col-index\", parseInt(cell.attr(\"col-index\"),10) + 1);\n cell.remove();\n return;\n }\n\n for (var i = colIndex; i >= 0; i--) {\n cell = $(row).find(\"[col-index=\" + i + \"]\");\n\n if (cell.length) {\n this._reduceColSpan(cell);\n cell.attr(\"col-index\", parseInt(cell.attr(\"col-index\"),10) + 1);\n return;\n }\n }\n },\n _reduceColSpan: function(td) {\n var colSpanValue = td.prop(\"colSpan\") - 1;\n\n if (colSpanValue <= 1) {\n td.removeAttr(COLSPAN);\n if (td.attr(SCOPE) === COLGROUP) {\n td.attr(SCOPE, COL);\n }\n } else {\n td.attr(COLSPAN, colSpanValue);\n }\n }\n });\n\n var MergeCellsHorizontallyCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(),\n td = dom.closest(range.endContainer, [TD, TH]),\n table, row, columnIndex, nextTd, colspan;\n\n if (!td) {\n this.releaseRange(range);\n return;\n }\n\n table = dom.closest(td, TABLE);\n row = td.parentNode;\n columnIndex = dom.findNodeIndex(td, true);\n nextTd = row.children[columnIndex + 1];\n\n if (this.immutables() && Editor.Immutables.immutableParent(td)) {\n this.releaseRange(range);\n return;\n }\n\n this._mapColIndices(table);\n\n columnIndex = parseInt($(td).attr(\"col-index\"), 10);\n nextTd = $(row).find(\"[col-index=\" + (columnIndex + 1 + this._getColspan(td) - 1) + \"]\").get(0);\n\n if (!nextTd || nextTd.rowSpan !== td.rowSpan || td.tagName !== nextTd.tagName) {\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n return;\n }\n\n colspan = this._getColspan(td) + this._getColspan(nextTd);\n\n $(td).prop(COLSPAN, colspan)\n .append(dom.emptyNode(nextTd) ? \"\" : \"
    \" + nextTd.innerHTML);\n\n $(td).width(td.offsetWidth);\n $(nextTd).remove();\n\n if (td.getAttribute(SCOPE) === COL) {\n td.setAttribute(SCOPE, COLGROUP);\n }\n if (td.getAttribute(SCOPE) === COLGROUP) {\n this._adjustColgroups(row, table);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n this._resetElementResizing(this.editor);\n },\n _getColspan: function(td) {\n return parseInt(td.getAttribute(COLSPAN), 10) || 1;\n }\n });\n\n var MergeCellsVerticallyCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(),\n td = dom.closest(range.endContainer, [TD, TH]),\n tr, parent, table, columnIndex, rowIndex, targetRow, bottomTd;\n\n if (!td) {\n this.releaseRange(range);\n return;\n }\n\n tr = dom.closest(td, TR);\n parent = dom.closest(td, [THEAD, TBODY]);\n table = dom.closest(td, TABLE);\n columnIndex = dom.findNodeIndex(td, true);\n rowIndex = dom.findNodeIndex(tr, true);\n\n if (rowIndex + 1 === parent.rows.length) {\n this.releaseRange(range);\n return;\n }\n\n targetRow = parent.rows[rowIndex + this._getRowspan(td)];\n bottomTd = targetRow && targetRow.children[columnIndex];\n\n if (this.immutables() && Editor.Immutables.immutableParent(td)) {\n this.releaseRange(range);\n return;\n }\n\n this._mapColIndices(table);\n\n columnIndex = $(td).attr(\"col-index\");\n bottomTd = $(targetRow).find(\"[col-index=\" + columnIndex + \"]\").get(0);\n\n if (!bottomTd || bottomTd.colSpan !== td.colSpan || td.tagName !== bottomTd.tagName) {\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n return;\n }\n\n $(td).prop(ROWSPAN, this._getRowspan(td) + this._getRowspan(bottomTd))\n .append(dom.emptyNode(bottomTd) ? \"\" : \"
    \" + bottomTd.innerHTML);\n\n if (td.getAttribute(SCOPE) === ROW) {\n td.setAttribute(SCOPE, ROWGROUP);\n }\n\n $(bottomTd).remove();\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n },\n _getRowspan: function(td) {\n return parseInt(td.getAttribute(ROWSPAN), 10) || 1;\n }\n });\n\n var SplitCellCommand = TableModificationCommand.extend({\n exec: function() {\n var range = this.lockRange(),\n type = this.options.type,\n attr = type === \"row\" ? COLSPAN : ROWSPAN,\n td = dom.closest(range.endContainer, [TD, TH]),\n parent = dom.closest(td, [THEAD, TBODY]),\n table = dom.closest(td, TABLE),\n emptyTd = dom.createEmptyNode(this.editor.document, td.nodeName.toLowerCase());\n\n if (!td || (this.immutables() && Editor.Immutables.immutableParent(td))) {\n this.releaseRange(range);\n return;\n }\n\n this._mapColIndices(table);\n\n if (type === \"row\" && $(td).is(\"[\" + attr + \"]\")) {\n this._splitCellHorizontally(td, parent, attr, emptyTd);\n } else if (type === \"column\" && $(td).is(\"[\" + attr + \"]\")) {\n this._splitCellVertically(td, parent, attr, emptyTd);\n }\n\n if ($(td).prop(attr.toLowerCase()) <= 1) {\n $(td).removeAttr(attr);\n }\n\n if ($(table).find(\"[headers]\").length > 0) {\n this._associateHeaderIds(table);\n }\n\n this._clearColIndexAttr(table);\n this.releaseRange(range);\n },\n _getRowspanValue: function(td) {\n return parseInt(td.getAttribute(ROWSPAN), 10);\n },\n _getColspanValue: function(td) {\n return parseInt(td.getAttribute(COLSPAN), 10);\n },\n _splitCellHorizontally: function(td, parent, attr, emptyTd) {\n var rowSpan = td.rowSpan,\n colSpan = td.colSpan,\n tdToAdd = $(emptyTd),\n colSpanResult = Math.floor(colSpan / 2);\n\n if (colSpanResult > 1) {\n tdToAdd.attr(COLSPAN, colSpanResult);\n }\n\n if (rowSpan > 1) {\n tdToAdd.attr(ROWSPAN, rowSpan);\n }\n\n $(td).prop(attr, colSpan - colSpanResult)\n .after(tdToAdd);\n\n $(td).width(td.offsetWidth);\n tdToAdd.width(tdToAdd[0].offsetWidth);\n\n if (td.hasAttribute(SCOPE)) {\n if (td.getAttribute(SCOPE) === COLGROUP) {\n tdToAdd.attr(SCOPE, COL);\n if (!td.getAttribute(COLSPAN) || td.getAttribute(COLSPAN) === \"1\") {\n td.setAttribute(SCOPE, COL);\n }\n\n this._adjustColgroups(td.parentNode, parent.parentNode);\n } else {\n tdToAdd.attr(SCOPE, td.getAttribute(SCOPE));\n }\n }\n },\n _splitCellVertically: function(td, parent, attr, emptyTd) {\n var tr = dom.closest(td,TR),\n columnIndex = parseInt($(td).attr(\"col-index\"), 10),\n rowIndex = dom.findNodeIndex(tr, true),\n rowSpan = td.rowSpan,\n colSpan = td.colSpan,\n rowSpanResult = Math.floor(rowSpan / 2),\n targetRow = $(parent).find(TR).eq(rowIndex + rowSpan - rowSpanResult),\n nextTd = this._findNextTdInRow(targetRow, columnIndex + colSpan),\n tdToAdd = $(emptyTd);\n\n if (rowSpanResult > 1) {\n tdToAdd.attr(ROWSPAN, rowSpanResult);\n }\n if (colSpan > 1) {\n tdToAdd.attr(COLSPAN, colSpan);\n }\n\n if (nextTd && nextTd.length) {\n nextTd.before(tdToAdd);\n } else {\n targetRow.append(tdToAdd);\n }\n\n $(td).prop(attr, rowSpan - rowSpanResult);\n\n if (td.hasAttribute(SCOPE)) {\n if (td.getAttribute(SCOPE) === ROWGROUP) {\n tdToAdd.attr(SCOPE, ROW);\n if (!td.getAttribute(ROWSPAN) || td.getAttribute(ROWSPAN) === \"1\") {\n td.setAttribute(SCOPE, ROW);\n }\n } else {\n tdToAdd.attr(SCOPE, td.getAttribute(SCOPE));\n }\n }\n }\n });\n\n var TableModificationTool = Tool.extend({\n command: function(options) {\n var commandsMap = {\n row: {\n insert: InsertRowCommand,\n \"delete\": DeleteRowCommand,\n merge: MergeCellsHorizontallyCommand,\n split: SplitCellCommand\n },\n column: {\n insert: InsertColumnCommand,\n \"delete\": DeleteColumnCommand,\n merge: MergeCellsVerticallyCommand,\n split: SplitCellCommand\n }\n };\n\n options = extend(options, this.options);\n options.action = options.action || \"insert\";\n\n return new commandsMap[options.type][options.action](options);\n },\n\n update: function(ui, nodes) {\n var isFormatted = !tableFormatFinder.isFormatted(nodes),\n toolbar = ui.closest(\".k-toolbar\").getKendoToolBar();\n\n if (isFormatted === true) {\n toolbar.hide(ui);\n } else {\n toolbar.show(ui);\n }\n }\n });\n\n var TableFormatCommand = FormatCommand.extend({\n exec: function() {\n var that = this;\n var editor = that.editor;\n\n FormatCommand.fn.exec.call(this);\n\n if (editor.elementResizing) {\n editor.elementResizing._showResizeHandles();\n }\n }\n });\n\n // var tableAlignFormatFinder = BlockFormatFinder.extend({\n\n // });\n\n var TableFormatTool = BlockFormatTool.extend({\n update: function(ui, nodes) {\n var isTable = !tableFormatFinder.isFormatted(nodes),\n isFormatted = this.options.finder.isFormatted(nodes, this.isTable),\n toolbar = ui.closest(\".k-toolbar\").getKendoToolBar();\n\n if (toolbar) {\n toolbar.toggle(ui, isFormatted);\n }\n\n if (isTable === true) {\n toolbar.hide(ui);\n } else {\n toolbar.show(ui);\n }\n },\n command: function(commandArguments) {\n var that = this;\n\n return new TableFormatCommand(extend(commandArguments, {\n formatter: that.options.formatter\n }));\n },\n isTable: function(node) {\n return dom.is(node, \"table\");\n }\n });\n\n extend(kendo.ui.editor, {\n PopupTool: PopupTool,\n TableCommand: TableCommand,\n InsertTableTool: InsertTableTool,\n TableFormatTool: TableFormatTool,\n TableFormatCommand: TableFormatCommand,\n TableModificationTool: TableModificationTool,\n InsertRowCommand: InsertRowCommand,\n InsertColumnCommand: InsertColumnCommand,\n DeleteRowCommand: DeleteRowCommand,\n DeleteColumnCommand: DeleteColumnCommand,\n MergeCellsHorizontallyCommand: MergeCellsHorizontallyCommand,\n MergeCellsVerticallyCommand: MergeCellsVerticallyCommand,\n SplitCellCommand: SplitCellCommand\n });\n\n\n registerTool(\"createTable\", new InsertTableTool({ ui: { popup: true, overflow: \"never\" } }));\n\n registerTool(\"addColumnLeft\", new TableModificationTool({ type: \"column\", position: \"before\" }));\n registerTool(\"addColumnRight\", new TableModificationTool({ type: \"column\" }));\n registerTool(\"addRowAbove\", new TableModificationTool({ type: \"row\", position: \"before\" }));\n registerTool(\"addRowBelow\", new TableModificationTool({ type: \"row\" }));\n registerTool(\"deleteRow\", new TableModificationTool({ type: \"row\", action: \"delete\" }));\n registerTool(\"deleteColumn\", new TableModificationTool({ type: \"column\", action: \"delete\" }));\n registerTool(\"mergeCellsHorizontally\", new TableModificationTool({ type: \"row\", action: \"merge\" }));\n registerTool(\"mergeCellsVertically\", new TableModificationTool({ type: \"column\", action: \"merge\" }));\n registerTool(\"splitCellHorizontally\", new TableModificationTool({ type: \"row\", action: \"split\" }));\n registerTool(\"splitCellVertically\", new TableModificationTool({ type: \"column\", action: \"split\" }));\n\n registerFormat(\"tableAlignLeft\", [\n { tags: [\"table\"], attr: { style: { marginLeft: \"\", marginRight: \"auto\" } } },\n { tags: [\"table\"], attr: { align: \"left\" } }\n ]);\n registerTool(\"tableAlignLeft\", new TableFormatTool({\n format: formats.tableAlignLeft,\n ui: {\n togglable: true,\n group: \"tableAlign\"\n }\n }));\n\n registerFormat(\"tableAlignCenter\", [\n { tags: [\"table\"], attr: { style: { marginLeft: \"auto\", marginRight: \"auto\" } } },\n { tags: [\"table\"], attr: { align: \"center\" } }\n ]);\n registerTool(\"tableAlignCenter\", new TableFormatTool({\n format: formats.tableAlignCenter,\n ui: {\n togglable: true,\n group: \"tableAlign\"\n }\n }));\n\n registerFormat(\"tableAlignRight\", [\n { tags: [\"table\"], attr: { style: { marginLeft: \"auto\", marginRight: \"\" } } },\n { tags: [\"table\"], attr: { align: \"right\" } }\n ]);\n registerTool(\"tableAlignRight\", new TableFormatTool({\n format: formats.tableAlignRight,\n ui: {\n togglable: true,\n group: \"tableAlign\"\n }\n }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n editorNS = kendo.ui.editor,\n RangeUtils = editorNS.RangeUtils,\n dom = editorNS.Dom,\n RestorePoint = editorNS.RestorePoint,\n Marker = editorNS.Marker,\n browser = kendo.support.browser,\n extend = $.extend;\n\n var Clipboard = Class.extend({\n init: function(editor) {\n this.editor = editor;\n var pasteCleanup = editor.options.pasteCleanup;\n this.cleaners = [\n new ScriptCleaner(pasteCleanup),\n new TabCleaner(pasteCleanup),\n new MSWordFormatCleaner(pasteCleanup),\n new WebkitFormatCleaner(pasteCleanup),\n new HtmlTagsCleaner(pasteCleanup),\n new HtmlAttrCleaner(pasteCleanup),\n new HtmlContentCleaner(pasteCleanup),\n new CustomCleaner(pasteCleanup) //always keep at end\n ];\n },\n\n htmlToFragment: function(html) {\n var editor = this.editor,\n doc = editor.document,\n container = dom.create(doc, 'div'),\n fragment = doc.createDocumentFragment();\n\n container.innerHTML = html;\n\n while (container.firstChild) {\n fragment.appendChild(container.firstChild);\n }\n\n return fragment;\n },\n\n isBlock: function(html) {\n return (/<(div|p|ul|ol|table|h[1-6])/i).test(html);\n },\n\n _startModification: function() {\n var range;\n var restorePoint;\n var editor = this.editor;\n\n if (this._inProgress) {\n return;\n }\n\n this._inProgress = true;\n\n range = editor.getRange();\n restorePoint = new RestorePoint(range, editor.body);\n\n dom.persistScrollTop(editor.document);\n\n return { range: range, restorePoint: restorePoint };\n },\n\n _endModification: function(modificationInfo) {\n editorNS._finishUpdate(this.editor, modificationInfo.restorePoint);\n\n this.editor._selectionChange();\n\n this._inProgress = false;\n },\n\n _contentModification: function(before, after) {\n var that = this;\n var editor = that.editor;\n var modificationInfo = that._startModification();\n\n if (!modificationInfo) {\n return;\n }\n\n before.call(that, editor, modificationInfo.range);\n\n setTimeout(function() {\n after.call(that, editor, modificationInfo.range);\n\n that._endModification(modificationInfo);\n });\n },\n\n _removeBomNodes: function(range) {\n var nodes = RangeUtils.textNodes(range);\n\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].nodeValue = dom.stripBom(nodes[i].nodeValue) || nodes[i].nodeValue;\n }\n },\n\n _onBeforeCopy: function(range) {\n var marker = new Marker();\n marker.add(range);\n\n this._removeBomNodes(range);\n\n marker.remove(range);\n\n this.editor.selectRange(range);\n },\n\n oncopy: function() {\n this._onBeforeCopy(this.editor.getRange());\n },\n\n oncut: function() {\n this._onBeforeCopy(this.editor.getRange());\n this._contentModification($.noop, $.noop);\n },\n\n _fileToDataURL: function(blob) {\n var deferred = $.Deferred();\n\n var reader = new FileReader();\n\n if (!(blob instanceof window.File) && blob.getAsFile) {\n blob = blob.getAsFile();\n }\n\n reader.onload = deferred.resolve.bind(deferred);\n\n reader.readAsDataURL(blob);\n\n return deferred.promise();\n },\n\n _triggerPaste: function(html, options) {\n var args = { html: html || \"\" };\n\n args.html = args.html.replace(/\\ufeff/g, \"\");\n\n this.editor.trigger(\"paste\", args);\n\n this.paste(args.html, options || {});\n },\n\n _handleImagePaste: function(e) {\n if (!('FileReader' in window) || (browser.msie && browser.version > 10)) {\n return;\n }\n\n var clipboardData = e.clipboardData || e.originalEvent.clipboardData ||\n window.clipboardData || {};\n\n var items = clipboardData.items || clipboardData.files;\n\n return this._insertImages(items);\n },\n\n _insertImages: function(items) {\n if (!items) {\n return;\n }\n\n var images = $.grep(items, function(item) { return (/^image\\//i).test(item.type); });\n var html = $.grep(items, function(item) { return (/^text\\/html/i).test(item.type); });\n\n if (html.length || !images.length) {\n return;\n }\n\n var modificationInfo = this._startModification();\n\n if (!modificationInfo) {\n return;\n }\n\n $.when.apply($, $.map(images, this._fileToDataURL))\n .done((function() {\n var results = Array.prototype.slice.call(arguments);\n var html = $.map(results, function(e) {\n return '';\n }).join(\"\");\n\n this._triggerPaste(html);\n\n this._endModification(modificationInfo);\n }).bind(this));\n\n return true;\n },\n\n onpaste: function(e) {\n if (this.editor.body.contentEditable === \"false\") {\n return;\n }\n\n if (this._handleImagePaste(e)) {\n e.preventDefault();\n return;\n }\n\n this.expandImmutablesIn();\n\n this._contentModification(\n function beforePaste(editor, range) {\n var clipboardNode = dom.create(editor.document, 'div', {\n className: 'k-paste-container',\n innerHTML: \"\\ufeff\"\n });\n var browser = kendo.support.browser;\n var body = editor.body;\n\n this._decoreateClipboardNode(clipboardNode, body);\n\n body.appendChild(clipboardNode);\n\n //Browser scrolls to clipboardNode\n if (browser.webkit) {\n this._moveToCaretPosition(clipboardNode, range);\n }\n\n // text ranges are slow in IE10-, DOM ranges are buggy in IE9-10\n if (browser.msie && browser.version < 11) {\n e.preventDefault();\n var r = editor.createRange();\n r.selectNodeContents(clipboardNode);\n editor.selectRange(r);\n var textRange = editor.document.body.createTextRange();\n textRange.moveToElementText(clipboardNode);\n $(body).off('paste');\n textRange.execCommand('Paste');\n $(body).on('paste', this.onpaste.bind(this));\n } else {\n var clipboardRange = editor.createRange();\n clipboardRange.selectNodeContents(clipboardNode);\n editor.selectRange(clipboardRange);\n }\n\n range.deleteContents();\n },\n function afterPaste(editor, range) {\n var html = \"\", containers;\n\n editor.selectRange(range);\n\n containers = $(editor.body).children(\".k-paste-container\");\n\n containers.each(function() {\n var lastChild = this.lastChild;\n\n if (lastChild && dom.is(lastChild, 'br')) {\n dom.remove(lastChild);\n }\n\n html += this.innerHTML;\n });\n\n containers.remove();\n\n this._triggerPaste(html, { clean: true });\n }\n );\n },\n ondragover: function(e) {\n if (browser.msie || browser.edge) {\n e.stopPropagation();\n e.preventDefault();\n }\n },\n ondrop: function(e) {\n if (!('FileReader' in window)) {\n return;\n }\n\n var dataTransfer = (e.originalEvent || e).dataTransfer || {};\n var items = dataTransfer.items || dataTransfer.files;\n\n if (this._insertImages(items)) {\n e.preventDefault();\n }\n },\n _decoreateClipboardNode: function(node, body) {\n if (!browser.msie && !browser.webkit) {\n return;\n }\n\n node = $(node);\n node.css({\n borderWidth: \"0px\",\n width: \"0px\",\n height: \"0px\",\n overflow: \"hidden\",\n margin: \"0\",\n padding: \"0\"\n });\n\n if (browser.msie) {\n //node inherits BODY styles and this causes the browser to add additional\n var documentElement = $(body.ownerDocument.documentElement);\n\n node.css({\n fontVariant: \"normal\",\n fontWeight: \"normal\",\n lineSpacing: \"normal\",\n lineHeight: \"normal\",\n textDecoration: \"none\"\n });\n var color = documentElement.css(\"color\");\n if (color) {\n node.css(\"color\", color);\n }\n var fontFamily = documentElement.css(\"fontFamily\");\n if (fontFamily) {\n node.css(\"fontFamily\", fontFamily);\n }\n var fontSize = documentElement.css(\"fontSize\");\n if (fontSize) {\n node.css(\"fontSize\", fontSize);\n }\n }\n },\n _moveToCaretPosition: function(node, range) {\n var that = this;\n var body = that.editor.body;\n var nodeOffset = dom.offset(node, body);\n var caretOffset = that._caretOffset(range, body);\n var translateX = caretOffset.left - nodeOffset.left;\n var translateY = caretOffset.top - nodeOffset.top;\n var translate = \"translate(\" + translateX + \"px,\" + translateY + \"px)\";\n\n $(node).css({\n \"-webkit-transform\": translate,\n \"transform\": translate\n });\n },\n _caretOffset: function(range, body) {\n var editor = this.editor;\n var caret = dom.create(editor.document, 'span', { innerHTML: \"\\ufeff\" });\n var startContainer = range.startContainer;\n var rangeChanged;\n\n if (range.collapsed) {\n var isStartTextNode = dom.isDataNode(startContainer);\n if (isStartTextNode && (dom.isBom(startContainer) || range.startOffset === 0)) {\n dom.insertBefore(caret, startContainer);\n } else if (isStartTextNode && range.startOffset === startContainer.length) {\n dom.insertAfter(caret, startContainer);\n } else {\n range.insertNode(caret);\n rangeChanged = true;\n }\n } else {\n startContainer = startContainer === body ?\n startContainer.childNodes[range.startOffset] : startContainer;\n dom.insertBefore(caret, startContainer);\n }\n\n var offset = dom.offset(caret, body);\n var prev = caret.previousSibling;\n var next = caret.nextSibling;\n\n dom.remove(caret);\n\n if (rangeChanged && dom.isDataNode(prev) && dom.isDataNode(next) && !dom.isBom(prev) && !dom.isBom(next)) {\n var prevLength = prev.length;\n next.data = prev.data + next.data;\n range.setStart(next, prevLength);\n dom.remove(prev);\n\n range.collapse(true);\n editor.selectRange(range);\n }\n\n return offset;\n },\n\n expandImmutablesIn: function(range) {\n var editor = this.editor;\n if (editor && editor.options.immutables) {\n var body = editor.body;\n range = range || editor.getRange();\n kendo.ui.editor.Immutables.expandImmutablesIn(range);\n if (range.startContainer === body && range.startOffset === 0) {\n var doc = body.ownerDocument;\n var bomNode = doc.createTextNode(\"\\ufeff\");\n body.insertBefore(bomNode, body.childNodes[0]);\n range.setStartBefore(bomNode);\n }\n editor.selectRange(range);\n }\n },\n\n splittableParent: function(block, node) {\n var parentNode, body;\n\n if (block) {\n return dom.closestEditableOfType(node, ['p', 'ul', 'ol']) || node.parentNode;\n }\n\n parentNode = node.parentNode;\n body = node.ownerDocument.body;\n\n if (dom.isInline(parentNode)) {\n while (parentNode.parentNode != body && !dom.isBlock(parentNode.parentNode)) {\n parentNode = parentNode.parentNode;\n }\n }\n\n return parentNode;\n },\n\n paste: function(html, options) {\n var editor = this.editor,\n i, l, childNodes;\n\n this.expandImmutablesIn();\n\n options = extend({ clean: false, split: true }, options);\n\n if (!options.skipCleaners) {\n for (i = 0, l = this.cleaners.length; i < l; i++) {\n if (this.cleaners[i].applicable(html)) {\n html = this.cleaners[i].clean(html);\n }\n }\n }\n\n if (options.clean) {\n // remove br elements which immediately precede block elements\n html = html.replace(/(
    (\\s| )*)+(<\\/?(div|p|li|col|t))/ig, \"$3\");\n // remove empty inline elements\n html = html.replace(/<(a|span)[^>]*><\\/\\1>/ig, \"\");\n }\n\n html = html.replace(/<(a|span|font)([^>]*)> <\\/\\1>/ig, \"<$1$2> \");\n\n // It is possible in IE to copy just
  • tags\n html = html.replace(/^
  • $/g, 'li>');\n\n var block = this.isBlock(html);\n\n editor.focus();\n var range = editor.getRange();\n range.deleteContents();\n\n if (range.startContainer == editor.document) {\n range.selectNodeContents(editor.body);\n }\n\n var marker = new Marker();\n var caret = marker.addCaret(range);\n\n var parent = this.splittableParent(block, caret);\n var unwrap = false;\n var splittable = parent != editor.body && !dom.is(parent, \"td\");\n\n if (options.split && splittable && (block || dom.isInline(parent))) {\n range.selectNode(caret);\n RangeUtils.split(range, parent, true);\n unwrap = true;\n }\n\n var fragment = this.htmlToFragment(html);\n\n if (fragment.firstChild && fragment.firstChild.className === \"k-paste-container\") {\n var fragmentsHtml = [];\n for (i = 0, l = fragment.childNodes.length; i < l; i++) {\n fragmentsHtml.push(fragment.childNodes[i].innerHTML);\n }\n\n fragment = this.htmlToFragment(fragmentsHtml.join('
    '));\n }\n\n childNodes = fragment.childNodes;\n\n $(childNodes)\n .filter(\"table\").addClass(\"k-table\").end()\n .find(\"table\").addClass(\"k-table\");\n\n $(childNodes).each(function(index, elm) {\n if (dom.isBlock(elm) && !dom.isSelfClosing(elm) && elm.innerHTML === \"\") {\n elm.appendChild(editor.document.createTextNode(\"\\ufeff\"));\n }\n });\n\n range.insertNode(fragment);\n\n parent = this.splittableParent(block, caret);\n if (unwrap) {\n while (caret.parentNode != parent) {\n dom.unwrap(caret.parentNode);\n }\n\n dom.unwrap(caret.parentNode);\n }\n\n dom.normalize(range.commonAncestorContainer);\n caret.style.display = 'inline';\n dom.restoreScrollTop(editor.document);\n dom.scrollTo(caret);\n marker.removeCaret(range);\n\n var rangeEnd = range.commonAncestorContainer.parentNode;\n if (range.collapsed && dom.name(rangeEnd) == \"tbody\" || range.collapsed && dom.name(rangeEnd) == \"thead\") {\n range.setStartAfter($(rangeEnd).closest(\"table\")[0]);\n range.collapse(true);\n }\n\n var focusedTable = $(range.commonAncestorContainer.parentNode).closest(\"table\");\n\n if (focusedTable.get(0)) {\n var siblingNodes = focusedTable.parent().contents();\n var lastSiblingIndex = siblingNodes.length - 1;\n var lastSibling = siblingNodes.get(lastSiblingIndex);\n\n while (lastSibling.nodeValue !== null && (lastSibling.nodeValue === \" \" || lastSibling.nodeValue === \"\")) {\n lastSiblingIndex -= 1;\n lastSibling = siblingNodes.get(lastSiblingIndex);\n }\n\n if (lastSibling === focusedTable.get(0) && !focusedTable.parents(\"table\").length) {\n dom.insertAfter(dom.createEmptyNode(editor.document, \"p\"), focusedTable[0]);\n }\n }\n\n editor.selectRange(range);\n }\n });\n\n var Cleaner = Class.extend({\n init: function(options) {\n this.options = options || {};\n this.replacements = [];\n },\n\n clean: function(html, customReplacements) {\n var that = this,\n replacements = customReplacements || that.replacements,\n i, l;\n\n for (i = 0, l = replacements.length; i < l; i += 2) {\n html = html.replace(replacements[i], replacements[i + 1]);\n }\n\n return html;\n }\n });\n\n var ScriptCleaner = Cleaner.extend({\n init: function(options) {\n Cleaner.fn.init.call(this, options);\n\n this.replacements = [\n /<(\\/?)script([^>]*)>/i, \"<$1telerik:script$2>\"\n ];\n },\n\n applicable: function(html) {\n return !this.options.none && (/]*>/i).test(html);\n }\n });\n\n var TabCleaner = Cleaner.extend({\n init: function(options) {\n Cleaner.fn.init.call(this, options);\n\n var replacement = ' ';\n this.replacements = [\n /]*>\\s*<\\/span>/gi, replacement,\n /\\t/gi, replacement,\n /    /gi, replacement\n ];\n },\n\n applicable: function(html) {\n return (/    |class=\"?Apple-tab-span/i).test(html);\n }\n });\n\n var MSWordFormatCleaner = Cleaner.extend({\n init: function(options) {\n Cleaner.fn.init.call(this, options);\n\n this.junkReplacements = [\n /<\\?xml[^>]*>/gi, '',\n //g, '', /* comments */\n /"/g, \"'\", /* encoded quotes (in attributes) */\n / <\\/o:p>/ig, ' ',\n /<\\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\\n)*?<\\/(meta|link|style|o:|v:|x:)[^>]*>)?/ig, '', /* external references and namespaced tags */\n /<\\/o>/g, ''\n ];\n this.replacements = this.junkReplacements.concat([\n /(?:
     [\\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',\n /

    /g, '

    ',\n /
    \\n/g, '
    ',\n /
    (?!\\n)/g, ' ',\n /]*)>(\\s| )+]*>(\\s| )*<\\/tr>/gi, '',\n /]*>(\\s| )*<\\/tbody>/gi, '',\n /]*>(\\s| )*<\\/table>/gi, '',\n /

    /g, '
    ',\n /^\\s*( )+/gi, '',\n /( |]*>)+\\s*$/gi, '',\n /mso-[^;\"]*;?/ig, '', /* office-related CSS attributes */\n /<(\\/?)b(\\s[^>]*)?>/ig, '<$1strong$2>',\n /<(\\/?)font(\\s[^>]*)?>/ig, this.convertFontMatch,\n /<(\\/?)i(\\s[^>]*)?>/ig, '<$1em$2>',\n /style=([\"|'])\\s*\\1/g, '', /* empty style attributes */\n /(]*>)?\\n/g, function($0, $1) { return $1 ? $0 : ' '; } /* phantom extra line feeds */\n ]);\n },\n\n convertFontMatch: function(match, closing, args) {\n var faceRe = /face=['\"]([^'\"]+)['\"]/i;\n var face = faceRe.exec(args);\n var family = args && face && face[1];\n\n if (closing) {\n return '';\n } else if (family) {\n return '';\n } else {\n return '';\n }\n },\n\n applicable: function(html) {\n return (/class=\"?Mso/i).test(html) ||\n (/style=\"[^\"]*mso-/i).test(html) ||\n (/urn:schemas-microsoft-com:office/).test(html);\n },\n\n stripEmptyAnchors: function(html) {\n return html.replace(/]*)>\\s*<\\/a>/ig, function(a, attributes) {\n if (!attributes || attributes.indexOf(\"href\") < 0) {\n return \"\";\n }\n\n return a;\n });\n },\n\n listType: function(p, listData) {\n var html = p.innerHTML;\n var text = dom.innerText(p);\n\n var startingSymbol;\n var matchSymbol = html.match(/^(?:]*texhtml[^>]*>)?]*(?:Symbol|Wingdings)[^>]*>([^<]+)/i);\n var symbol = matchSymbol && matchSymbol[1];\n var isNumber = /^[a-z\\d]/i.test(symbol);//including alpha-numeric and roman numerals\n\n var trimStartText = function(text) {\n return text.replace(/^(?: |[\\u00a0\\n\\r\\s])+/, '');\n };\n\n if (matchSymbol) {\n startingSymbol = true;\n }\n\n html = html.replace(/<\\/?\\w+[^>]*>/g, '').replace(/ /g, '\\u00a0');\n\n if ((!startingSymbol && /^[\\u2022\\u00b7\\u00a7\\u00d8o]\\u00a0+/.test(html)) ||\n (startingSymbol && /^.\\u00a0+/.test(html)) ||\n (symbol && !isNumber && listData)) {\n return {\n tag: 'ul',\n style: this._guessUnorderedListStyle(trimStartText(text))\n };\n }\n\n if (/^\\s*\\w+[\\.\\)][\\u00a0 ]{2,}/.test(html)) {\n return {\n tag: 'ol',\n style: this._guessOrderedListStyle(trimStartText(text))\n };\n }\n },\n\n _convertToLi: function(p) {\n var content;\n\n if (p.childNodes.length == 1) {\n content = p.firstChild.nodeType === dom.nodeTypes.TEXT_NODE ? dom.innerText(p) : p.firstChild.innerHTML.replace(/^\\w+[\\.\\)]( )+ /, \"\");\n content = this._checkForBullet(content);\n } else {\n content = this._getHtmlNoBullet(p);\n }\n\n dom.remove(p);\n\n return dom.create(document, 'li', { innerHTML: content });\n },\n\n _checkForBullet: function(html) {\n var p = dom.create(document, 'p', { innerHTML: html });\n var bulletRgx = /^\\s*\\w+[\\.\\)]\\s+/;\n\n if (bulletRgx.test(p.innerText)) {\n return this._getHtmlNoBullet(p);\n }\n\n return html;\n },\n\n _getHtmlNoBullet: function(element) {\n var content,\n name = dom.name(element);\n\n dom.remove(element.firstChild);\n\n // check for roman numerals\n if (element.firstChild.nodeType == 3) {\n if (/^[ivxlcdm]+\\.$/i.test(element.firstChild.nodeValue)) {\n dom.remove(element.firstChild);\n }\n }\n\n if (/^( |\\s)+$/i.test(element.firstChild.innerHTML)) {\n dom.remove(element.firstChild);\n }\n\n if (name != \"p\") {\n content = \"<\" + name + \">\" + element.innerHTML + \"\";\n } else {\n content = element.innerHTML;\n }\n\n return content;\n },\n\n _guessUnorderedListStyle: function(symbol) {\n if (/^[\\u2022\\u00b7\\u00FC\\u00D8\\u002dv-]/.test(symbol)) {\n return null;//return \"disc\"; //default CSS value\n } else if (/^o/.test(symbol)) {\n return \"circle\";\n } else {\n return \"square\";\n }\n },\n _guessOrderedListStyle: function(symbol) {\n var listType = null;\n if (!/^\\d/.test(symbol)) {\n listType = (/^[a-z]/.test(symbol) ? 'lower-' : 'upper-') +\n (/^[ivxlcdm]/i.test(symbol) ? 'roman' : 'alpha');\n }\n\n return listType;\n },\n\n extractListLevels: function(html) {\n var msoListRegExp = /style=['\"]?[^'\"]*?mso-list:\\s?[a-zA-Z]+(\\d+)\\s[a-zA-Z]+(\\d+)\\s(\\w+)/gi;\n\n html = html.replace(msoListRegExp, function(match, list, level) {\n return kendo.format('data-list=\"{0}\" data-level=\"{1}\" {2}', list, level, match);\n });\n\n return html;\n },\n\n _createList: function(type, styleType) {\n return dom.create(document, type, {\n style: { listStyleType: styleType }\n });\n },\n\n lists: function(placeholder) {\n var blockChildren = $(placeholder).find(dom.blockElements.join(',')),\n lastMargin = -1,\n name,\n levels = {},\n li,\n rootMargin,\n rootIndex,\n lastRootLi,\n isLastRootLi,\n rootList,\n i, p, type, margin, list, listData,\n acceptedNameTags = [\"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"],\n isParentTable = false;\n\n for (i = 0; i < blockChildren.length; i++) {\n p = blockChildren[i];\n listData = $(p).data();\n var listIndex = listData.list;\n name = dom.name(p);\n isParentTable = !!$(p).parents(\"table\").length;\n\n if (isParentTable) {\n continue;\n }\n\n var listType = this.listType(p, listData);\n type = listType && listType.tag;\n\n if (!type || acceptedNameTags.indexOf(name) < 0) {\n if (!p.innerHTML) {\n dom.remove(p);\n } else if (li && !isLastRootLi) {\n li.appendChild(p);\n }\n continue;\n }\n\n // not supported list levels in ie\n if (browser.msie) {\n continue;\n }\n\n margin = listData.level || parseFloat(p.style.marginLeft || 0);\n\n var levelType = type + listIndex;\n if (!levels[margin]) {\n levels[margin] = {};\n }\n\n if (!rootMargin || rootMargin < 0) {\n rootMargin = margin;\n rootIndex = listIndex;\n lastRootLi = $(placeholder).find(\"[data-list='\" + rootIndex + \"']\").last()[0];\n rootList = this._createList(type, listType.style);\n dom.insertBefore(rootList, p);\n lastMargin = margin;\n levels[margin][levelType] = rootList;\n }\n\n isLastRootLi = lastRootLi === p;\n\n list = levels[margin][levelType];\n\n if (margin > lastMargin || !list) {\n list = this._createList(type, listType.style);\n levels[margin][levelType] = list;\n li.appendChild(list);\n }\n\n li = this._convertToLi(p);\n list.appendChild(li);\n\n if (isLastRootLi) {\n rootMargin = lastMargin = -1;\n } else {\n lastMargin = margin;\n }\n }\n },\n\n removeAttributes: function(element) {\n var attributes = element.attributes,\n i = attributes.length,\n significantStyles = [],\n isSignificantCss = function(val) {\n var significantCss = [\"border\", \"background\", \"padding\"];\n\n return significantCss.filter(function(cssAttr) {\n return val.trim().indexOf(cssAttr) === 0;\n }).length > 0;\n },\n addSignificantStyles = function(val) {\n if (isSignificantCss(val)) {\n significantStyles.push(val.trim());\n }\n },\n attr, attributeName, attributeValues;\n\n while (i--) {\n if (dom.name(attributes[i]) != \"colspan\") {\n attr = attributes[i];\n attributeName = attr.name;\n\n if (attributeName === \"style\" && (element.nodeName === \"TD\" || element.nodeName === \"TH\")) {\n attributeValues = attr.value.split(\";\");\n attributeValues.forEach(addSignificantStyles);\n }\n\n element.removeAttributeNode(attributes[i]);\n }\n }\n\n if (significantStyles.length > 0) {\n element.setAttribute(\"style\", significantStyles.join(\";\"));\n }\n },\n\n createColGroup: function(row) {\n var cells = row.cells;\n var table = $(row).closest(\"table\");\n var colgroup = table.children(\"colgroup\");\n\n if (cells.length < 2) {\n return;\n } else if (colgroup.length) {\n cells = colgroup.children();\n colgroup[0].parentNode.removeChild(colgroup[0]);\n }\n\n colgroup = $($.map(cells, function(cell) {\n var width = cell.width;\n if (width && parseInt(width, 10) !== 0) {\n return kendo.format('', width);\n }\n\n return \"\";\n }).join(\"\"));\n\n // jquery 1.9/2.0 discrepancy\n if (!colgroup.is(\"colgroup\")) {\n colgroup = $(\"\").append(colgroup);\n }\n\n colgroup.prependTo(table);\n },\n\n convertHeaders: function(row) {\n var cells = row.cells,\n i,\n boldedCells = $.map(cells, function(cell) {\n var child = $(cell).children(\"p\").children(\"strong\")[0];\n\n if (child && dom.name(child) == \"strong\") {\n return child;\n }\n });\n\n if (boldedCells.length == cells.length) {\n for (i = 0; i < boldedCells.length; i++) {\n dom.unwrap(boldedCells[i]);\n }\n\n $(row).closest(\"table\")\n .find(\"colgroup\").after(\"\").end()\n .find(\"thead\").append(row);\n\n for (i = 0; i < cells.length; i++) {\n dom.changeTag(cells[i], \"th\");\n }\n }\n },\n\n removeParagraphs: function(cells) {\n var i, j, len, cell, paragraphs;\n\n for (i = 0; i < cells.length; i++) {\n this.removeAttributes(cells[i]);\n\n // remove paragraphs and insert line breaks between them\n cell = $(cells[i]);\n paragraphs = cell.children(\"p\");\n\n for (j = 0, len = paragraphs.length; j < len; j++) {\n if (j < len - 1) {\n dom.insertAfter(dom.create(document, \"br\"), paragraphs[j]);\n }\n\n dom.unwrap(paragraphs[j]);\n }\n }\n },\n\n removeTextNodes: function(trs) {\n var i, j, childNodes, currentNode, row;\n\n for (i = 0; i < trs.length; i++) {\n row = trs[i];\n childNodes = row.childNodes;\n\n for (j = 0; j < childNodes.length; j++) {\n currentNode = childNodes[j];\n\n if (currentNode.nodeType === dom.nodeTypes.TEXT_NODE) {\n row.removeChild(currentNode);\n }\n }\n }\n },\n\n tables: function(placeholder) {\n var tables = $(placeholder).find(\"table\"),\n that = this,\n rows,\n firstRow, longestRow, i, j;\n\n for (i = 0; i < tables.length; i++) {\n rows = tables[i].rows;\n longestRow = firstRow = rows[0];\n\n for (j = 1; j < rows.length; j++) {\n if (rows[j].cells.length > longestRow.cells.length) {\n longestRow = rows[j];\n }\n }\n\n that.createColGroup(longestRow);\n that.convertHeaders(firstRow);\n\n that.removeAttributes(tables[i]);\n\n that.removeParagraphs(tables.eq(i).find(\"td,th\"));\n\n that.removeTextNodes(tables.eq(i).find(\"tr\"));\n }\n },\n\n headers: function(placeholder) {\n var titles = $(placeholder).find(\"p.MsoTitle\");\n\n for (var i = 0; i < titles.length; i++) {\n dom.changeTag(titles[i], \"h1\");\n }\n },\n\n removeFormatting: function(placeholder) {\n $(placeholder).find(\"*\").each(function() {\n $(this).css({\n fontSize: \"\",\n fontFamily: \"\"\n });\n\n if (!this.getAttribute(\"style\") && !this.style.cssText) {\n this.removeAttribute(\"style\");\n }\n });\n },\n\n clean: function(html) {\n var that = this, placeholder;\n var filters = this.options;\n\n if (filters.none) {\n html = Cleaner.fn.clean.call(that, html, this.junkReplacements);\n html = that.stripEmptyAnchors(html);\n } else {\n\n html = filters.msConvertLists ? this.extractListLevels(html) : html;\n html = Cleaner.fn.clean.call(that, html);\n html = that.stripEmptyAnchors(html);\n\n placeholder = dom.create(document, 'div', { innerHTML: html });\n that.headers(placeholder);\n\n if (filters.msConvertLists) {\n that.lists(placeholder);\n }\n that.tables(placeholder);\n\n if (filters.msAllFormatting) {\n that.removeFormatting(placeholder);\n }\n\n html = placeholder.innerHTML.replace(/(<[^>]*)\\s+class=\"?[^\"\\s>]*\"?/ig, '$1');\n }\n\n return html;\n }\n });\n\n var WebkitFormatCleaner = Cleaner.extend({\n init: function(options) {\n Cleaner.fn.init.call(this, options);\n\n this.replacements = [\n /\\s+class=\"Apple-style-span[^\"]*\"/gi, '',\n /<(div|p|h[1-6])\\s+style=\"[^\"]*\"/gi, '<$1',\n /^
    (.*)<\\/div>$/, '$1'\n ];\n },\n\n applicable: function(html) {\n return (/class=\"?Apple-style-span|style=\"[^\"]*-webkit-nbsp-mode/i).test(html);\n }\n });\n\n var DomCleaner = Cleaner.extend({\n clean: function(html) {\n var container = dom.create(document, 'div', { innerHTML: html });\n container = this.cleanDom(container);\n return container.innerHTML;\n },\n\n cleanDom: function(container) {\n return container;\n }\n });\n\n var HtmlTagsCleaner = DomCleaner.extend({\n cleanDom: function(container) {\n var tags = this.collectTags();\n\n $(container).find(tags).each(function() {\n dom.unwrap(this);\n });\n\n return container;\n },\n\n collectTags: function() {\n if (this.options.span) {\n return \"span\";\n }\n },\n\n applicable: function() {\n return this.options.span;\n }\n });\n\n var HtmlAttrCleaner = DomCleaner.extend({\n cleanDom: function(container) {\n var attributes = this.collectAttr();\n var nodes = $(container).find(\"[\" + attributes.join(\"],[\") + \"]\");\n nodes.removeAttr(attributes.join(\" \"));\n\n return container;\n },\n\n collectAttr: function() {\n if (this.options.css) {\n return [\"class\", \"style\"];\n }\n\n return [];\n },\n\n applicable: function() {\n return this.options.css;\n }\n });\n\n var TextContainer = function() {\n this.text = \"\";\n this.add = function(text) {\n this.text += text;\n };\n };\n\n var HtmlTextLines = Class.extend({\n init: function(separators) {\n this.separators = separators || {\n text: \" \",\n line: \"
    \"\n };\n this.lines = [];\n this.inlineBlockText = [];\n this.resetLine();\n },\n\n appendText: function(text) {\n if (text.nodeType === 3) {\n text = text.nodeValue;\n }\n\n this.textContainer.add(text);\n },\n\n appendInlineBlockText: function(text) {\n this.inlineBlockText.push(text);\n },\n\n flashInlineBlockText: function() {\n if (this.inlineBlockText.length) {\n this.appendText(this.inlineBlockText.join(\" \"));\n this.inlineBlockText = [];\n }\n },\n\n endLine: function() {\n this.flashInlineBlockText();\n this.resetLine();\n },\n\n html: function() {\n var separators = this.separators;\n var result = \"\";\n var lines = this.lines;\n\n this.flashInlineBlockText();\n\n for (var i = 0, il = lines.length, il1 = il - 1; i < il; i++) {\n var line = lines[i];\n for (var j = 0, jl = line.length, jl1 = jl - 1; j < jl; j++) {\n var text = line[j].text;\n result += text;\n if (j !== jl1) {\n result += separators.text;\n }\n }\n if (i !== il1) {\n result += separators.line;\n }\n }\n\n return result;\n },\n\n resetLine: function() {\n this.textContainer = new TextContainer();\n this.line = [];\n this.line.push(this.textContainer);\n this.lines.push(this.line);\n }\n });\n\n var DomEnumerator = Class.extend({\n init: function(callback) {\n this.callback = callback;\n },\n enumerate: function(node) {\n if (!node) {\n return;\n }\n\n var preventDown = this.callback(node);\n\n var child = node.firstChild;\n if (!preventDown && child) {\n this.enumerate(child);\n }\n\n this.enumerate(node.nextSibling);\n }\n });\n\n var HtmlContentCleaner = Cleaner.extend({\n init: function(options) {\n Cleaner.fn.init.call(this, options);\n this.hasText = false; //unpleasant flag to prevent an empty line at the beginning of the generated content.\n this.enumerator = new DomEnumerator(this.buildText.bind(this));\n },\n\n clean: function(html) {\n var container = dom.create(document, 'div', { innerHTML: html });\n\n return this.cleanDom(container);\n },\n\n cleanDom: function(container) {\n this.separators = this.getDefaultSeparators();\n this.htmlLines = new HtmlTextLines(this.separators);\n this.enumerator.enumerate(container.firstChild);\n this.hasText = false;\n\n return this.htmlLines.html();\n },\n\n buildText: function(node) {\n if (dom.isDataNode(node)) {\n if (dom.isEmptyspace(node)) {\n return;\n }\n this.htmlLines.appendText(node.nodeValue.replace('\\n', this.separators.line));\n this.hasText = true;\n } else if (dom.isBlock(node) && this.hasText) {\n var action = this.actions[dom.name(node)] || this.actions.block;\n return action(this, node);\n } else if (dom.isBr(node)) {\n this.htmlLines.appendText(this.separators.line);\n }\n },\n\n applicable: function() {\n var o = this.options;\n return o.all || o.keepNewLines;\n },\n\n getDefaultSeparators: function() {\n if (this.options.all) {\n return { text: \" \", line: \" \" };\n } else {\n return { text: \" \", line: \"
    \" };\n }\n },\n\n actions: {\n ul: $.noop,\n ol: $.noop,\n table: $.noop,\n thead: $.noop,\n tbody: $.noop,\n td: function(cleaner, node) {\n var tdCleaner = new HtmlContentCleaner({ all: true });\n\n var cellText = tdCleaner.cleanDom(node);\n cleaner.htmlLines.appendInlineBlockText(cellText);\n\n return true;\n },\n\n block: function(cleaner) {\n cleaner.htmlLines.endLine();\n }\n }\n });\n\n var CustomCleaner = Cleaner.extend({\n clean: function(html) {\n return this.options.custom(html);\n },\n\n applicable: function() {\n return typeof(this.options.custom) === \"function\";\n }\n });\n\n extend(editorNS, {\n Clipboard: Clipboard,\n Cleaner: Cleaner,\n ScriptCleaner: ScriptCleaner,\n TabCleaner: TabCleaner,\n MSWordFormatCleaner: MSWordFormatCleaner,\n WebkitFormatCleaner: WebkitFormatCleaner,\n HtmlTagsCleaner: HtmlTagsCleaner,\n HtmlAttrCleaner: HtmlAttrCleaner,\n HtmlContentCleaner: HtmlContentCleaner,\n HtmlTextLines: HtmlTextLines,\n CustomCleaner: CustomCleaner\n });\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n Class = kendo.Class,\n editorNS = kendo.ui.editor,\n RangeUtils = editorNS.RangeUtils,\n dom = editorNS.Dom,\n RestorePoint = editorNS.RestorePoint,\n Marker = editorNS.Marker,\n browser = kendo.support.browser,\n bomSpan = \"\\ufeff\",\n extend = $.extend;\n var nodeTypes = dom.nodeTypes;\n var PREVIOUS_SIBLING = \"previousSibling\";\n\n function selected(node, range) {\n return range.startContainer === node && range.endContainer === node &&\n range.startOffset === 0 && range.endOffset == node.childNodes.length;\n }\n\n function getSibling(node, direction, condition) {\n var sibling = node ? node[direction] : null;\n\n while (sibling && !condition(sibling)) {\n sibling = sibling[direction];\n }\n\n return sibling;\n }\n\n var tableCells = \"td,th,caption\";\n var tableCellsWrappers = \"table,tbody,thead,tfoot,tr\";\n var tableElements = tableCellsWrappers + \",\" + tableCells;\n var inTable = function(range) { return !range.collapsed && $(range.commonAncestorContainer).is(tableCellsWrappers); };\n\n var RemoveTableContent = Class.extend({\n remove: function(range) {\n var that = this;\n var marker = new Marker();\n marker.add(range, false);\n\n var nodes = RangeUtils.getAll(range, function(node) { return $(node).is(tableElements); });\n var doc = RangeUtils.documentFromRange(range);\n var start = marker.start;\n var end = marker.end;\n var cellsTypes = tableCells.split(\",\");\n var startCell = dom.parentOfType(start, cellsTypes);\n var endCell = dom.parentOfType(end, cellsTypes);\n that._removeContent(start, startCell, true);\n that._removeContent(end, endCell, false);\n $(nodes).each(function(i, node) {\n node = $(node);\n (node.is(tableCells) ? node : node.find(tableCells)).each(function(j, cell) {\n cell.innerHTML = \"\";\n });\n });\n if (startCell && !start.previousSibling) {\n dom.insertBefore(doc.createTextNode(\"\\ufeff\"), start);\n }\n if (endCell && !end.nextSibling) {\n dom.insertAfter(doc.createTextNode(\"\\ufeff\"), end);\n }\n if (startCell) {\n range.setStartBefore(start);\n } else if (nodes[0]) {\n startCell = $(nodes[0]);\n startCell = startCell.is(tableCells) ? startCell : startCell.find(tableCells).first();\n if (startCell.length) {\n range.setStart(startCell.get(0), 0);\n }\n }\n\n range.collapse(true);\n\n dom.remove(start);\n dom.remove(end);\n },\n _removeContent: function(start, top, forwards) {\n if (top) {\n var sibling = forwards ? \"nextSibling\" : \"previousSibling\",\n next,\n getNext = function(node) {\n while (node && !node[sibling]) {\n node = node.parentNode;\n }\n return node && $.contains(top, node) ? node[sibling] : null;\n };\n start = getNext(start);\n while (start) {\n next = getNext(start);\n dom.remove(start);\n start = next;\n }\n }\n }\n });\n\n var TypingHandler = Class.extend({\n init: function(editor) {\n this.editor = editor;\n },\n\n keydown: function(e) {\n var that = this,\n editor = that.editor,\n keyboard = editor.keyboard,\n isTypingKey = keyboard.isTypingKey(e),\n evt = extend($.Event(), e);\n\n that.editor.trigger(\"keydown\", evt);\n\n if (evt.isDefaultPrevented()) {\n e.preventDefault();\n return true;\n }\n\n if (!evt.isDefaultPrevented() && isTypingKey && !keyboard.isTypingInProgress()) {\n var range = editor.getRange();\n var body = editor.body;\n that.startRestorePoint = new RestorePoint(range, body);\n\n if (inTable(range)) {\n var removeTableContent = new RemoveTableContent(editor);\n removeTableContent.remove(range);\n editor.selectRange(range);\n }\n\n if (browser.webkit && !range.collapsed && selected(body, range)) {\n body.innerHTML = \"\";\n }\n\n if (editor.immutables && editorNS.Immutables.immutablesContext(range)) {\n var backspaceHandler = new editorNS.BackspaceHandler(editor);\n backspaceHandler.deleteSelection(range);\n }\n\n keyboard.startTyping(function() {\n that._removeBomSpan();\n that.endRestorePoint = editorNS._finishUpdate(editor, that.startRestorePoint);\n });\n\n return true;\n }\n\n return false;\n },\n\n keyup: function(e) {\n var keyboard = this.editor.keyboard;\n\n this.editor.trigger(\"keyup\", e);\n\n if (keyboard.isTypingInProgress()) {\n keyboard.endTyping();\n return true;\n }\n\n return false;\n },\n\n _removeBomSpan: function() {\n var node = this.editor.getRange().commonAncestorContainer;\n\n if (!dom.emptyNode(node)) {\n if (node.nodeType === 3) {\n node = node.parentNode;\n }\n\n if (dom.insignificant(node)) {\n // typing in an insignificant node\n // make it significant\n node.textContent = dom.stripBom(node.textContent);\n dom.unwrap(node);\n }\n }\n }\n });\n\n var BackspaceHandler = Class.extend({\n init: function(editor) {\n this.editor = editor;\n },\n _addCaret: function(container) {\n var caret = dom.create(this.editor.document, \"a\");\n\n // Only if not Chrome: Make sure to include cared in the formatted inline node\n if (!kendo.support.browser.chrome && container.firstChild &&\n container.firstChild.nodeType === nodeTypes.ELEMENT_NODE) {\n\n container = container.firstChild;\n }\n\n dom.insertAt(container, caret, 0);\n dom.stripBomNode(caret.previousSibling);\n dom.stripBomNode(caret.nextSibling);\n return caret;\n },\n _restoreCaret: function(caret) {\n var range = this.editor.createRange();\n\n if (!caret.nextSibling && dom.isDataNode(caret.previousSibling)) {\n range.setStart(caret.previousSibling, caret.previousSibling.length);\n } else {\n range.setStartAfter(caret);\n }\n\n range.collapse(true);\n this.editor.selectRange(range);\n dom.remove(caret);\n },\n _handleDelete: function(range) {\n var node = range.endContainer;\n var block = dom.closestEditableOfType(node, dom.blockElements);\n\n if (block && editorNS.RangeUtils.isEndOf(range, block)) {\n // join with next sibling\n var next = dom.next(block);\n if (!next || dom.name(next) != \"p\") {\n return false;\n }\n\n var caretPlaceholder = dom.significantChildNodes(next)[0];\n caretPlaceholder = (caretPlaceholder && dom.isInline(caretPlaceholder)) ? caretPlaceholder : next;\n var caret = this._addCaret(caretPlaceholder);\n\n this._merge(block, next);\n\n this._restoreCaret(caret);\n\n return true;\n }\n\n return false;\n },\n _cleanBomBefore: function(range) {\n var offset = range.startOffset;\n var node = range.startContainer;\n var text = node.nodeValue;\n var count = 0;\n while (offset - count >= 0 && text[offset - count - 1] == \"\\ufeff\") {\n count++;\n }\n\n if (count > 0) {\n node.deleteData(offset - count, count);\n\n range.setStart(node, Math.max(0, offset - count));\n range.collapse(true);\n\n this.editor.selectRange(range);\n }\n },\n _handleBackspace: function(range) {\n var node = range.startContainer;\n var li = dom.closestEditableOfType(node, ['li']);\n var block = dom.closestEditableOfType(node, 'p,h1,h2,h3,h4,h5,h6'.split(','));\n var editor = this.editor;\n var previousSibling;\n\n if (dom.isDataNode(node)) {\n if (range.collapsed && /^\\s[\\ufeff]+$/.test(node.nodeValue)) {\n range.setStart(node, 0);\n range.setEnd(node, node.length);\n editor.selectRange(range);\n return false;\n }\n this._cleanBomBefore(range);\n }\n\n previousSibling = getSibling(block, PREVIOUS_SIBLING, function(sibling) {\n return !dom.htmlIndentSpace(sibling);\n });\n\n //deleting the first list item with empty content in IE results in invalid range\n if (range.collapsed && range.startOffset !== range.endOffset && range.startOffset < 0) {\n range.startOffset = 0;\n range.endOffset = 0;\n editor.selectRange(range);\n }\n\n var startAtLi = li && editorNS.RangeUtils.isStartOf(range, li);\n var liIndex = li && $(li).index();\n var startAtNonFirstLi = startAtLi && liIndex > 0;\n if (startAtNonFirstLi) {\n block = li;\n previousSibling = dom.prev(li);\n }\n\n if (block && previousSibling && dom.is(previousSibling, 'table') && editorNS.RangeUtils.isStartOf(range, block)) {\n if (block.innerText === '') {\n block.innerHTML = '\\ufeff';\n }\n return true;\n }\n\n // outdent\n if (editorNS.RangeUtils.isStartOf(range, block) && parseInt(block.style.marginLeft,10) > 0) {\n editor.exec(\"outdent\");\n return true;\n }\n\n // unwrap block\n if ((block && previousSibling && editorNS.RangeUtils.isStartOf(range, block)) || startAtNonFirstLi) {\n var caretPlaceholder = dom.significantChildNodes(block)[0];\n caretPlaceholder = (caretPlaceholder && dom.isInline(caretPlaceholder)) ? caretPlaceholder : block;\n var caret = this._addCaret(caretPlaceholder);\n this._merge(previousSibling, block);\n this._restoreCaret(caret);\n\n return true;\n }\n\n // unwrap li element\n if (startAtLi && liIndex === 0) {\n var child = li.firstChild;\n if (!child) {\n li.innerHTML = editorNS.emptyElementContent;\n child = li.firstChild;\n }\n\n var formatter = new editorNS.ListFormatter(dom.name(li.parentNode), \"p\");\n range.selectNodeContents(li);\n formatter.toggle(range);\n\n if (dom.insignificant(child)) {\n range.setStartBefore(child);\n } else {\n range.setStart(child, 0);\n }\n\n editor.selectRange(range);\n\n return true;\n }\n\n var rangeStartNode = node.childNodes[range.startOffset - 1];\n var linkRange = range;\n var anchor = rangeStartNode && dom.closestEditableOfType(rangeStartNode, ['a']);\n var previousNode = getSibling(rangeStartNode || node, PREVIOUS_SIBLING, function(sibling) {\n return !dom.isDataNode(sibling) || (!dom.isBom(sibling) && sibling.length > 0);\n });\n if (anchor || ((range.startOffset === 0 || rangeStartNode) && dom.is(previousNode, \"a\"))) {\n anchor = anchor || previousNode;\n linkRange = editor.createRange();\n linkRange.setStart(anchor, anchor.childNodes.length);\n linkRange.collapse(true);\n }\n\n anchor = anchor || dom.closestEditableOfType(rangeStartNode || linkRange.startContainer, ['a']);\n var isEndOfLink = anchor && editorNS.RangeUtils.isEndOf(linkRange, anchor);\n if (isEndOfLink) {\n var command = new editorNS.UnlinkCommand({ range: linkRange, body: editor.body, immutables: !!editor.immutables });\n editor.execCommand(command);\n editor._selectionChange();\n }\n return false;\n },\n _handleSelection: function(range) {\n var ancestor = range.commonAncestorContainer;\n var table = dom.closest(ancestor, \"table\");\n var emptyParagraphContent = editorNS.emptyElementContent;\n var editor = this.editor;\n var parentElementOrNode;\n\n if (inTable(range)) {\n var removeTableContent = new RemoveTableContent(editor);\n removeTableContent.remove(range);\n editor.selectRange(range);\n return true;\n }\n\n var marker = new Marker();\n marker.add(range, false);\n\n if (range.commonAncestorContainer === editor.body) {\n this._surroundFullyContent(marker, range);\n }\n\n if (editor.immutables) {\n this._handleImmutables(marker);\n }\n\n this._surroundFullySelectedAnchor(marker, range);\n\n range.setStartAfter(marker.start);\n range.setEndBefore(marker.end);\n\n var start = range.startContainer;\n var end = range.endContainer;\n\n range.deleteContents();\n\n if (end.tagName.toLocaleLowerCase() === \"li\" && dom.emptyNode(end)) {\n range.selectNode(end);\n range.deleteContents();\n }\n\n if (table && $(table).text() === \"\") {\n range.selectNode(table);\n range.deleteContents();\n }\n\n ancestor = range.commonAncestorContainer;\n\n if (dom.name(ancestor) === \"p\" && ancestor.innerHTML === \"\") {\n ancestor.innerHTML = emptyParagraphContent;\n range.setStart(ancestor, 0);\n }\n\n this._join(start, end);\n\n dom.insertAfter(editor.document.createTextNode(\"\\ufeff\"), marker.start);\n marker.remove(range);\n\n start = range.startContainer;\n if (dom.name(start) == \"tr\") {\n start = start.childNodes[Math.max(0, range.startOffset - 1)];\n range.setStart(start, dom.getNodeLength(start));\n }\n\n range.collapse(true);\n\n editor.selectRange(range);\n\n parentElementOrNode = start.parentElement || start.parentNode;\n\n if (dom.isDataNode(start) && !dom.emptyNode(parentElementOrNode)) {\n this._cleanBomBefore(range);\n }\n\n return true;\n },\n _handleImmutables: function(marker) {\n var immutableParent = editorNS.Immutables.immutableParent;\n var startImmutable = immutableParent(marker.start);\n var endImmutable = immutableParent(marker.start);\n if (startImmutable) {\n dom.insertBefore(marker.start, startImmutable);\n }\n if (endImmutable) {\n dom.insertAfter(marker.end, endImmutable);\n }\n if (startImmutable) {\n dom.remove(startImmutable);\n }\n if (endImmutable && endImmutable.parentNode) {\n dom.remove(endImmutable);\n }\n },\n _surroundFullyContent: function(marker, range) {\n var children = range.commonAncestorContainer.children,\n startParent = children[0],\n endParent = children[children.length - 1];\n\n this._moveMarker(marker, range, startParent, endParent);\n },\n _surroundFullySelectedAnchor: function(marker, range) {\n var start = marker.start,\n startParent = $(start).closest(\"a\").get(0),\n end = marker.end,\n endParent = $(end).closest(\"a\").get(0);\n\n this._moveMarker(marker, range, startParent, endParent);\n },\n _moveMarker: function(marker, range, startParent, endParent) {\n var start = marker.start,\n end = marker.end;\n\n if (startParent && RangeUtils.isStartOf(range, startParent)) {\n dom.insertBefore(start, startParent);\n }\n\n if (endParent && RangeUtils.isEndOf(range, endParent)) {\n dom.insertAfter(end, endParent);\n }\n },\n _root: function(node) {\n while (node && dom.name(node) != \"body\" && node.parentNode && dom.name(node.parentNode) != \"body\") {\n node = node.parentNode;\n }\n\n return node;\n },\n _join: function(start, end) {\n start = this._root(start);\n end = this._root(end);\n\n if (start != end && dom.is(end, \"p\")) {\n this._merge(start, end);\n }\n },\n _merge: function(dest, src) {\n dom.removeTrailingBreak(dest);\n\n while (dest && src.firstChild) {\n if (dest.nodeType == 1) {\n dest = dom.list(dest) ? dest.children[dest.children.length - 1] : dest;\n\n if (dest) {\n dest.appendChild(src.firstChild);\n }\n } else if (dest.nodeType === nodeTypes.TEXT_NODE) {\n this._mergeWithTextNode(dest, src.firstChild);\n } else {\n dest.parentNode.appendChild(src.firstChild);\n }\n }\n\n dom.remove(src);\n },\n\n _mergeWithTextNode: function(textNode, appendedNode) {\n if (textNode && textNode.nodeType === nodeTypes.TEXT_NODE) {\n if (textNode.nextSibling && this._isCaret(textNode.nextSibling)) {\n dom.insertAfter(appendedNode, textNode.nextSibling);\n }\n else {\n dom.insertAfter(appendedNode, textNode);\n }\n }\n },\n\n _isCaret: function(element) {\n return $(element).is(\"a\");\n },\n\n keydown: function(e) {\n var method, startRestorePoint;\n var editor = this.editor;\n var range = editor.getRange();\n var keyCode = e.keyCode;\n var keys = kendo.keys;\n var backspace = keyCode === keys.BACKSPACE;\n var del = keyCode == keys.DELETE;\n\n if (editor.immutables && editor.immutables.keydown(e, range)) {\n return;\n }\n\n if ((backspace || del) && !range.collapsed) {\n method = \"_handleSelection\";\n } else if (backspace) {\n method = \"_handleBackspace\";\n } else if (del) {\n method = \"_handleDelete\";\n }\n\n if (!method) {\n return;\n }\n\n startRestorePoint = new RestorePoint(range, editor.body);\n\n if (this[method](range)) {\n e.preventDefault();\n\n editorNS._finishUpdate(editor, startRestorePoint);\n }\n },\n deleteSelection: function(range) {\n this._handleSelection(range);\n },\n keyup: $.noop\n });\n\n var SystemHandler = Class.extend({\n init: function(editor) {\n this.editor = editor;\n this.systemCommandIsInProgress = false;\n },\n\n createUndoCommand: function() {\n this.startRestorePoint = this.endRestorePoint = editorNS._finishUpdate(this.editor, this.startRestorePoint);\n },\n\n changed: function() {\n if (this.startRestorePoint) {\n return this.startRestorePoint.html != this.editor.body.innerHTML;\n }\n\n return false;\n },\n\n keydown: function(e) {\n var that = this,\n editor = that.editor,\n keyboard = editor.keyboard;\n\n if (keyboard.isModifierKey(e)) {\n\n if (keyboard.isTypingInProgress()) {\n keyboard.endTyping(true);\n }\n\n that.startRestorePoint = new RestorePoint(editor.getRange(), editor.body);\n return true;\n }\n\n if (keyboard.isSystem(e)) {\n that.systemCommandIsInProgress = true;\n\n if (that.changed()) {\n that.systemCommandIsInProgress = false;\n that.createUndoCommand();\n }\n\n return true;\n }\n\n return false;\n },\n\n keyup: function() {\n var that = this;\n\n if (that.systemCommandIsInProgress && that.changed()) {\n that.systemCommandIsInProgress = false;\n that.createUndoCommand();\n return true;\n }\n\n return false;\n }\n });\n\n var SelectAllHandler = Class.extend({\n init: function(editor) {\n this.editor = editor;\n },\n\n keydown: function(e) {\n if (!browser.webkit || e.isDefaultPrevented() ||\n !(e.ctrlKey && e.keyCode == 65 && !e.altKey && !e.shiftKey)) {\n return;\n }\n if (this.editor.options.immutables) {\n this._toSelectableImmutables();\n }\n this._selectEditorBody();\n },\n\n _selectEditorBody: function() {\n var editor = this.editor;\n var range = editor.getRange();\n range.selectNodeContents(editor.body);\n\n setTimeout(function() {\n editor.selectRange(range);\n });\n },\n\n _toSelectableImmutables: function() {\n var editor = this.editor,\n body = editor.body,\n immutable = editorNS.Immutables.immutable,\n emptyTextNode = dom.emptyTextNode,\n first = body.firstChild,\n last = body.lastChild;\n\n while (emptyTextNode(first)) {\n first = first.nextSibling;\n }\n\n while (emptyTextNode(last)) {\n last = last.previousSibling;\n }\n\n if (first && immutable(first)) {\n $(bomSpan).prependTo(body);\n }\n\n if (last && immutable(last)) {\n $(bomSpan).appendTo(body);\n }\n },\n\n keyup: $.noop\n });\n\n var Keyboard = Class.extend({\n init: function(handlers) {\n this.handlers = handlers;\n this.typingInProgress = false;\n },\n\n isCharacter: function(keyCode) {\n return (keyCode >= 48 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) ||\n (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222) ||\n keyCode == 229;\n },\n\n toolFromShortcut: function(tools, e) {\n var key = String.fromCharCode(e.keyCode),\n toolName,\n toolOptions,\n modifier = this._getShortcutModifier(e, navigator.platform);\n\n for (toolName in tools) {\n toolOptions = $.extend({ ctrl: false, alt: false, shift: false }, tools[toolName].options);\n\n if ((toolOptions.key == key || toolOptions.key == e.keyCode) &&\n toolOptions.ctrl == modifier &&\n toolOptions.alt == e.altKey &&\n toolOptions.shift == e.shiftKey) {\n return toolName;\n }\n }\n },\n\n _getShortcutModifier: function(e, platform) {\n var mac = platform.toUpperCase().indexOf('MAC') >= 0;\n return mac ? e.metaKey : e.ctrlKey;\n },\n\n toolsFromShortcut: function(tools, e) {\n var key = String.fromCharCode(e.keyCode),\n toolName,\n o,\n matchesKey,\n found = [];\n var matchKey = function(toolKey) { return toolKey == key || toolKey == e.keyCode || toolKey == e.charCode; };\n\n for (toolName in tools) {\n o = $.extend({ ctrl: false, alt: false, shift: false }, tools[toolName].options);\n\n matchesKey = Array.isArray(o.key) ? $.grep(o.key, matchKey).length > 0 : matchKey(o.key);\n if (matchesKey &&\n o.ctrl == e.ctrlKey &&\n o.alt == e.altKey &&\n o.shift == e.shiftKey) {\n found.push(tools[toolName]);\n }\n }\n\n return found;\n },\n\n isTypingKey: function(e) {\n var keyCode = e.keyCode;\n return (this.isCharacter(keyCode) && !e.ctrlKey && !e.altKey) ||\n keyCode == 32 || keyCode == 13 || keyCode == 8 ||\n (keyCode == 46 && !e.shiftKey && !e.ctrlKey && !e.altKey);\n },\n\n isModifierKey: function(e) {\n var keyCode = e.keyCode;\n return (keyCode == 17 && !e.shiftKey && !e.altKey) ||\n (keyCode == 16 && !e.ctrlKey && !e.altKey) ||\n (keyCode == 18 && !e.ctrlKey && !e.shiftKey);\n },\n\n isSystem: function(e) {\n return e.keyCode == 46 && e.ctrlKey && !e.altKey && !e.shiftKey;\n },\n\n startTyping: function(callback) {\n this.onEndTyping = callback;\n this.typingInProgress = true;\n },\n\n stopTyping: function() {\n if (this.typingInProgress && this.onEndTyping) {\n this.onEndTyping();\n }\n this.typingInProgress = false;\n },\n\n endTyping: function(force) {\n var that = this;\n that.clearTimeout();\n if (force) {\n that.stopTyping();\n } else {\n that.timeout = window.setTimeout(that.stopTyping.bind(that), 1000);\n }\n },\n\n isTypingInProgress: function() {\n return this.typingInProgress;\n },\n\n clearTimeout: function() {\n window.clearTimeout(this.timeout);\n },\n\n notify: function(e, what) {\n var i, handlers = this.handlers;\n\n for (i = 0; i < handlers.length; i++) {\n if (handlers[i][what](e)) {\n break;\n }\n }\n },\n\n keydown: function(e) {\n this.notify(e, 'keydown');\n },\n\n keyup: function(e) {\n this.notify(e, 'keyup');\n }\n });\n\n extend(editorNS, {\n TypingHandler: TypingHandler,\n SystemHandler: SystemHandler,\n BackspaceHandler: BackspaceHandler,\n SelectAllHandler: SelectAllHandler,\n Keyboard: Keyboard\n });\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n editorNS = kendo.ui.editor,\n Command = editorNS.Command,\n EditorUtils = editorNS.EditorUtils,\n registerTool = EditorUtils.registerTool,\n Tool = editorNS.Tool,\n extend = $.extend;\n\n var ExportPdfCommand = Command.extend({\n init: function(options) {\n this.async = true;\n Command.fn.init.call(this, options);\n },\n\n exec: function() {\n var that = this;\n var range = that.lockRange(true);\n var editor = that.editor;\n\n editor._destroyResizings();\n\n editor.saveAsPDF().then(function() {\n that.releaseRange(range);\n editor._initializeColumnResizing();\n editor._initializeRowResizing();\n editor._initializeElementResizing();\n });\n }\n });\n\n extend(editorNS, {\n ExportPdfCommand: ExportPdfCommand\n });\n\n registerTool(\"pdf\", new Tool({ command: ExportPdfCommand }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n // Imports ================================================================\n var kendo = window.kendo,\n editorNS = kendo.ui.editor,\n Command = editorNS.Command,\n EditorUtils = editorNS.EditorUtils,\n registerTool = EditorUtils.registerTool,\n Tool = editorNS.Tool,\n extend = $.extend;\n\n var PrintCommand = Command.extend({\n init: function(options) {\n Command.fn.init.call(this, options);\n\n this.managesUndoRedo = true;\n },\n\n exec: function() {\n var editor = this.editor;\n\n if (kendo.support.browser.msie) {\n editor.document.execCommand(\"print\", false, null);\n } else if (editor.window.print) {\n editor.window.print();\n }\n }\n });\n\n extend(editorNS, {\n PrintCommand: PrintCommand\n });\n\n registerTool(\"print\", new Tool({ command: PrintCommand }));\n\n })(window.kendo.jQuery);\n\n (function($) {\n\n var kendo = window.kendo,\n Editor = kendo.ui.editor,\n Tool = Editor.Tool,\n Command = Editor.Command,\n EditorUtils = Editor.EditorUtils,\n dom = Editor.Dom,\n RangeUtils = Editor.RangeUtils,\n registerTool = EditorUtils.registerTool;\n\n var CopyFormatCommand = Command.extend({\n init: function(options) {\n Command.fn.init.call(this, options);\n },\n\n exec: function() {\n var range = this.lockRange(true);\n this.inlineStyles = [];\n this.blockStyles = [];\n this.collectStyles(range);\n this.editor.inlineStyles = this.inlineStyles;\n this.editor.blockStyles = this.blockStyles;\n this.releaseRange(range);\n },\n\n collectStyles: function(range) {\n var rangeNodes = RangeUtils.nodes(range);\n var node;\n\n if (rangeNodes.length === 1) {\n node = rangeNodes[0].parentNode;\n } else {\n node = range.startContainer;\n }\n\n while (node && !dom.is(node, \"body\") && node.getAttribute(\"data-role\") !== \"editor\") {\n if (dom.isBlock(node)) {\n this.populateStyles(node, \"blockStyles\");\n if (dom.is(node, \"li\")) {\n node = node.parentNode;\n } else {\n node = null;\n }\n } else {\n this.populateStyles(node, \"inlineStyles\");\n node = node.parentNode;\n }\n }\n },\n\n populateStyles: function(node, destination) {\n var styles = node.style;\n var attributes = node.attributes;\n var nodeStyles = {\n tags: [ node.tagName ],\n attr: {\n style: {}\n }\n };\n var styleValue, styleKey, attributeKey, attributeValue, i;\n\n for (i = 0; styles && i < styles.length; i++) {\n styleKey = styles[i];\n styleValue = styles[styleKey];\n nodeStyles.attr.style[styleKey] = styleValue;\n }\n\n for (i = 0; attributes && i < attributes.length; i++) {\n attributeKey = attributes[i].nodeName;\n attributeValue = attributes[i].nodeValue;\n if (attributeKey === \"style\") {\n continue;\n } else if (attributeKey === \"class\") {\n nodeStyles.attr.className = attributeValue;\n } else {\n nodeStyles.attr[attributeKey] = attributeValue;\n }\n }\n\n this[destination].push(nodeStyles);\n }\n });\n\n var ApplyFormatCommand = Command.extend({\n init: function(options) {\n Command.fn.init.call(this, options);\n },\n\n exec: function() {\n var range = this.lockRange(true);\n var markers = RangeUtils.getMarkers(range);\n var editor = this.editor;\n var inlineStyles = editor.inlineStyles;\n var blockStyles = editor.blockStyles;\n var nodes;\n\n if ((!inlineStyles || inlineStyles.length === 0) && (!blockStyles || blockStyles.length === 0)) {\n return;\n }\n\n if (markers.length === 3) {\n this.marker.removeCaret(range);\n this.marker.caret = null;\n }\n\n this.removeEmptyElementsFromRange(range);\n nodes = RangeUtils.nodes(range);\n this.cleanInlineParents(nodes);\n dom.normalize(range.commonAncestorContainer);\n\n if (markers.length === 2) {\n range.setStartAfter(markers[0]);\n range.setEndBefore(markers[1]);\n } else {\n range.setStartBefore(nodes[0]);\n range.setEndAfter(nodes[0]);\n }\n\n nodes = RangeUtils.nodes(range);\n\n if (nodes && blockStyles && blockStyles.length) {\n this.applyBlockStyles(nodes, blockStyles);\n }\n\n if (nodes && inlineStyles && inlineStyles.length) {\n this.applyInlineStyles(nodes, inlineStyles);\n }\n\n this.releaseRange(range);\n },\n\n removeEmptyElementsFromRange: function(range) {\n var isEmptyInline = function(node) {\n return dom.isInline(node) && !node.firstChild && !dom.isMarker(node);\n };\n var emptyElements, i;\n\n emptyElements = RangeUtils.getAll(range, isEmptyInline);\n\n if (emptyElements && emptyElements.length > 0) {\n for (i = 0; i < emptyElements.length; i++) {\n emptyElements[i].parentNode.removeChild(emptyElements[i]);\n }\n }\n },\n\n cleanInlineParents: function(nodes) {\n var i, node, parent, children, j, child, newNode;\n\n for (i = 0; i < nodes.length; i++) {\n node = nodes[i];\n parent = node.parentNode;\n\n if (this.immutableParent(node)) {\n continue;\n }\n\n while (parent && dom.isInline(parent)) {\n children = parent.childNodes;\n\n for (j = 0; j < children.length; j++) {\n child = children[j];\n\n if (!dom.isMarker(child) && child !== node) {\n newNode = parent.cloneNode(true);\n newNode.innerHTML = \"\";\n dom.wrap(child, newNode);\n }\n }\n\n dom.unwrap(parent);\n parent = node.parentNode;\n }\n }\n },\n\n applyBlockStyles: function(nodes, blockStyles) {\n var formatTag = blockStyles[0].tags[0];\n var attr = blockStyles[0].attr;\n var document = this.editor.document;\n var i, len, node, wrapper, blockParent, outerWrapper;\n var previousNodes, nextNodes, previous, next, prevWrapper, nextWrapper, child, j, listItems;\n\n for (i = 0, len = nodes.length; i < len; i++) {\n node = nodes[i];\n\n if (dom.isWhitespace(node) || this.immutableParent(node)) {\n continue;\n }\n\n blockParent = dom.blockParentOrBody(node);\n\n if (blockParent.tagName !== \"BODY\" && blockParent.tagName !== formatTag) {\n if (blockParent.tagName !== \"LI\" && blockParent.tagName !== \"TD\" && blockParent.tagName !== \"TH\") {\n previousNodes = [];\n nextNodes = [];\n previous = node.previousSibling;\n next = node.nextSibling;\n\n while (previous) {\n if (!dom.isMarker(previous)) {\n previousNodes.push(previous);\n }\n\n previous = previous.previousSibling;\n }\n\n if (previousNodes.length) {\n prevWrapper = blockParent.cloneNode(true);\n prevWrapper.innerHTML = \"\";\n dom.insertBefore(prevWrapper, previousNodes[0]);\n\n for (j = 0; j < previousNodes.length; j++) {\n child = previousNodes[j];\n dom.insertAt(prevWrapper, child, 0);\n }\n }\n\n while (next) {\n if (!dom.isMarker(next)) {\n nextNodes.push(next);\n }\n\n next = next.nextSibling;\n }\n\n if (nextNodes.length) {\n nextWrapper = blockParent.cloneNode(true);\n nextWrapper.innerHTML = \"\";\n dom.insertBefore(nextWrapper, nextNodes[0]);\n\n for (j = 0; j < nextNodes.length; j++) {\n child = nextNodes[j];\n nextWrapper.appendChild(child);\n }\n }\n\n dom.unwrap(blockParent);\n }\n\n wrapper = dom.create(document, formatTag, attr);\n dom.wrap(node, wrapper);\n } else if (blockParent.tagName === formatTag) {\n dom.attr(blockParent, attr);\n }\n }\n\n if (blockParent && blockStyles.length === 2 && blockParent.tagName !== \"LI\" && formatTag === \"LI\") {\n listItems = [];\n\n while (dom.is(wrapper, \"li\")) {\n listItems.push(wrapper);\n wrapper = dom.prev(wrapper);\n }\n\n outerWrapper = dom.create(document, blockStyles[1].tags[0], blockStyles[1].attr);\n dom.insertBefore(outerWrapper, listItems[listItems.length - 1]);\n outerWrapper.appendChild(listItems[0]);\n\n for (i = 1, len = listItems.length; i < len; i++) {\n dom.insertBefore(listItems[i], outerWrapper.firstChild);\n }\n } else if (blockParent && blockStyles.length === 2 && blockParent.tagName !== \"LI\") {\n outerWrapper = dom.create(document, blockStyles[1].tags[0], blockStyles[1].attr);\n dom.wrap(wrapper, outerWrapper);\n }\n },\n\n applyInlineStyles: function(nodes, inlineStyles) {\n var document = this.editor.document;\n var currentStyle, createdNode, topNode, i, newNode, node;\n\n for (i = 0; i < inlineStyles.length; i++) {\n currentStyle = inlineStyles[i];\n createdNode = dom.create(document, currentStyle.tags[0], currentStyle.attr);\n\n if (topNode) {\n createdNode.appendChild(topNode);\n }\n\n topNode = createdNode;\n }\n\n if (topNode) {\n for (i = 0; i < nodes.length; i++) {\n node = nodes[i];\n if (dom.isWhitespace(node) || this.immutableParent(node)) {\n continue;\n }\n newNode = topNode.cloneNode(true);\n dom.insertBefore(newNode, node);\n\n while (newNode.children && newNode.children.length) {\n newNode = newNode.children[0];\n }\n\n newNode.appendChild(node);\n }\n }\n },\n\n immutables: function() {\n return this.editor && this.editor.options.immutables;\n },\n\n immutableParent: function(node) {\n return this.immutables() && Editor.Immutables.immutableParent(node);\n }\n });\n\n var CopyFormatTool = Tool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n },\n\n command: function(commandArguments) {\n return new CopyFormatCommand(commandArguments);\n }\n });\n\n var ApplyFormatTool = Tool.extend({\n init: function(options) {\n Tool.fn.init.call(this, options);\n },\n\n command: function(commandArguments) {\n return new ApplyFormatCommand(commandArguments);\n }\n });\n\n $.extend(Editor, {\n CopyFormatCommand: CopyFormatCommand,\n ApplyFormatCommand: ApplyFormatCommand,\n CopyFormatTool: CopyFormatTool,\n ApplyFormatTool: ApplyFormatTool\n });\n\n registerTool(\"copyFormat\", new CopyFormatTool({ }));\n registerTool(\"applyFormat\", new ApplyFormatTool({ }));\n\n })(window.kendo.jQuery);\n\n (function(kendo, undefined$1) {\n var global = window;\n var math = global.Math;\n var min = math.min;\n var max = math.max;\n var parseFloat = global.parseFloat;\n\n var $ = kendo.jQuery;\n var extend = $.extend;\n\n var Editor = kendo.ui.editor;\n\n var PERCENTAGE = \"%\";\n var PIXEL = \"px\";\n var REGEX_NUMBER_IN_PERCENTAGES = /(\\d+)(\\.?)(\\d*)%/;\n var REGEX_NUMBER_IN_PIXELS = /(\\d+)(\\.?)(\\d*)px/;\n var STRING = \"string\";\n\n function constrain(options) {\n var value = options.value;\n var lowerBound = options.min;\n var upperBound = options.max;\n\n return max(min(parseFloat(value), parseFloat(upperBound)), parseFloat(lowerBound));\n }\n\n function getScrollBarWidth(element) {\n if (element && !$(element).is(\"body\") && element.scrollHeight > element.clientHeight) {\n return kendo.support.scrollbar();\n }\n\n return 0;\n }\n\n function calculatePercentageRatio(value, total) {\n if (inPercentages(value)) {\n return parseFloat(value);\n }\n else {\n return ((parseFloat(value) / total) * 100);\n }\n }\n\n function inPercentages(value) {\n return (typeof(value) === STRING && REGEX_NUMBER_IN_PERCENTAGES.test(value));\n }\n\n function inPixels(value) {\n return (typeof(value) === STRING && REGEX_NUMBER_IN_PIXELS.test(value));\n }\n\n function toPercentages(value) {\n return (parseFloat(value) + PERCENTAGE);\n }\n\n function toPixels(value) {\n return (parseFloat(value) + PIXEL);\n }\n\n var ResizingUtils = {\n constrain: constrain,\n getScrollBarWidth: getScrollBarWidth,\n calculatePercentageRatio: calculatePercentageRatio,\n inPercentages: inPercentages,\n inPixels: inPixels,\n toPercentages: toPercentages,\n toPixels: toPixels\n };\n\n extend(Editor, {\n ResizingUtils: ResizingUtils\n });\n })(window.kendo);\n\n (function(kendo, undefined$1) {\n var $ = kendo.jQuery;\n var extend = $.extend;\n var noop = $.noop;\n\n var Editor = kendo.ui.editor;\n var Class = kendo.Class;\n\n var KEY_DOWN = \"keydown\";\n var MOUSE_DOWN = \"mousedown\";\n var MOUSE_ENTER = \"mouseenter\";\n var MOUSE_LEAVE = \"mouseleave\";\n var MOUSE_MOVE = \"mousemove\";\n var MOUSE_UP = \"mouseup\";\n\n var COMMA = \",\";\n var DOT = \".\";\n var LAST_CHILD = \":last-child\";\n\n var TABLE = \"table\";\n\n var TableElementResizing = Class.extend({\n init: function(element, options) {\n var that = this;\n\n that.options = extend({}, that.options, options);\n\n that.options.tags = Array.isArray(that.options.tags) ? that.options.tags : [that.options.tags];\n\n if ($(element).is(TABLE)) {\n that.element = element;\n that._attachEventHandlers();\n }\n },\n\n destroy: function() {\n var that = this;\n var eventNamespace = that.options.eventNamespace;\n\n if (that.element) {\n $(that.element).off(eventNamespace);\n that.element = null;\n }\n\n $(that.options.rootElement).off(KEY_DOWN + eventNamespace);\n\n that._destroyResizeHandle();\n },\n\n options: {\n tags: [],\n min: 0,\n rootElement: null,\n eventNamespace: \"\",\n rtl: false,\n handle: {\n dataAttribute: \"\",\n height: 0,\n width: 0,\n classNames: {},\n template: \"\"\n }\n },\n\n _attachEventHandlers: function() {\n var that = this;\n var options = that.options;\n\n $(that.element).on(MOUSE_MOVE + options.eventNamespace, options.tags.join(COMMA), that.detectElementBorderHovering.bind(that));\n },\n\n resizingInProgress: function() {\n var that = this;\n var resizable = that._resizable;\n\n if (resizable) {\n return !!resizable.resizing;\n }\n\n return false;\n },\n\n resize: noop,\n\n detectElementBorderHovering: function(e) {\n var that = this;\n var options = that.options;\n var handleOptions = options.handle;\n var tableElement = $(e.currentTarget);\n var resizeHandle = that.resizeHandle;\n var dataAttribute = handleOptions.dataAttribute;\n\n if (!that.resizingInProgress()) {\n if (!tableElement.is(LAST_CHILD) && that.elementBorderHovered(tableElement, e)) {\n if (resizeHandle) {\n if (resizeHandle.data(dataAttribute) && resizeHandle.data(dataAttribute) !== tableElement[0]) {\n that.showResizeHandle(tableElement, e);\n }\n }\n else {\n that.showResizeHandle(tableElement, e);\n }\n }\n else {\n if (resizeHandle) {\n that._destroyResizeHandle();\n }\n }\n }\n },\n\n elementBorderHovered: noop,\n\n showResizeHandle: function(tableElement, e) {\n var that = this;\n\n if (e.buttons !== 0) {\n //prevent showing when a mouse button is still being pressed\n return;\n }\n\n that._initResizeHandle();\n that.setResizeHandlePosition(tableElement);\n that.setResizeHandleDimensions();\n that.setResizeHandleDataAttributes(tableElement[0]);\n that._attachResizeHandleEventHandlers();\n\n that._initResizable(tableElement);\n\n that._hideResizeMarker();\n that.resizeHandle.show();\n },\n\n _initResizeHandle: function() {\n var that = this;\n var options = that.options;\n\n that._destroyResizeHandle();\n\n that.resizeHandle = $(options.handle.template).appendTo(options.rootElement);\n },\n\n setResizeHandlePosition: noop,\n\n setResizeHandleDimensions: noop,\n\n setResizeHandleDataAttributes: function(tableElement) {\n var that = this;\n\n that.resizeHandle.data(that.options.handle.dataAttribute, tableElement);\n },\n\n _attachResizeHandleEventHandlers: function() {\n var that = this;\n var options = that.options;\n var eventNamespace = options.eventNamespace;\n var markerClass = options.handle.classNames.marker;\n var resizeHandle = that.resizeHandle;\n\n that.resizeHandle\n .on(MOUSE_DOWN + eventNamespace, function() {\n resizeHandle.find(DOT + markerClass).show();\n })\n .on(MOUSE_UP + eventNamespace, function() {\n resizeHandle.find(DOT + markerClass).hide();\n });\n },\n\n _hideResizeMarker: function() {\n var that = this;\n\n that.resizeHandle.find(DOT + that.options.handle.classNames.marker).hide();\n },\n\n _destroyResizeHandle: function() {\n var that = this;\n\n if (that.resizeHandle) {\n that._destroyResizable();\n that.resizeHandle.off(that.options.eventNamespace).remove();\n that.resizeHandle = null;\n }\n },\n\n _initResizable: function(tableElement) {\n var that = this;\n\n if (!that.resizeHandle) {\n return;\n }\n\n that._destroyResizable();\n\n that._resizable = new kendo.ui.Resizable(tableElement, {\n draggableElement: that.resizeHandle[0],\n start: that.onResizeStart.bind(that),\n resize: that.onResize.bind(that),\n resizeend: that.onResizeEnd.bind(that)\n });\n },\n\n _destroyResizable: function() {\n var that = this;\n\n if (that._resizable) {\n that._resizable.destroy();\n that._resizable = null;\n }\n },\n\n onResizeStart: function() {\n this._disableKeyboard();\n },\n\n onResize: function(e) {\n this.setResizeHandleDragPosition(e);\n },\n\n setResizeHandleDragPosition: noop,\n\n onResizeEnd: function(e) {\n var that = this;\n\n that.resize(e);\n that._destroyResizeHandle();\n that._enableKeyboard();\n },\n\n _enableKeyboard: function() {\n var options = this.options;\n\n $(options.rootElement).off(KEY_DOWN + options.eventNamespace);\n },\n\n _disableKeyboard: function() {\n var options = this.options;\n\n $(options.rootElement).on(KEY_DOWN + options.eventNamespace, function(e) {\n e.preventDefault();\n });\n },\n\n _forceResizing: function(e) {\n var resizable = this._resizable;\n\n if (resizable && resizable.userEvents) {\n resizable.userEvents._end(e);\n }\n }\n });\n\n var ResizingFactory = Class.extend({\n create: function(editor, options) {\n var that = this;\n var resizingName = options.name;\n var NS = options.eventNamespace;\n\n $(editor.body)\n .on(MOUSE_ENTER + NS, TABLE, function(e) {\n var table = e.currentTarget;\n var resizing = editor[resizingName];\n\n e.stopPropagation();\n\n if (resizing) {\n if (resizing.element !== table && !resizing.resizingInProgress()) {\n that._destroyResizing(editor, options);\n that._initResizing(editor, table, options);\n }\n }\n else {\n that._initResizing(editor, table, options);\n }\n })\n .on(MOUSE_LEAVE + NS, TABLE, function(e) {\n var parentTable;\n var resizing = editor[resizingName];\n\n e.stopPropagation();\n\n if (resizing && !resizing.resizingInProgress() && !resizing.resizeHandle) {\n parentTable = $(resizing.element).parents(TABLE)[0];\n\n if (parentTable) {\n that._destroyResizing(editor, options);\n that._initResizing(editor, parentTable, options);\n }\n }\n })\n .on(MOUSE_LEAVE + NS, function() {\n var resizing = editor[resizingName];\n\n if (resizing && !resizing.resizingInProgress()) {\n that._destroyResizing(editor, options);\n }\n })\n .on(MOUSE_UP + NS, function(e) {\n var resizing = editor[resizingName];\n var parentTable;\n\n if (resizing && resizing.resizingInProgress()) {\n parentTable = $(e.target).parents(TABLE)[0];\n\n if (parentTable) {\n resizing._forceResizing(e);\n that._destroyResizing(editor, options);\n that._initResizing(editor, parentTable, options);\n }\n }\n });\n },\n\n dispose: function(editor, options) {\n $(editor.body).off(options.eventNamespace);\n },\n\n _initResizing: function(editor, tableElement, options) {\n var resizingName = options.name;\n var resizingType = options.type;\n\n editor[resizingName] = new resizingType(tableElement, {\n rtl: kendo.support.isRtl(editor.element),\n rootElement: editor.body\n });\n },\n\n _destroyResizing: function(editor, options) {\n var resizingName = options.name;\n\n if (editor[resizingName]) {\n editor[resizingName].destroy();\n editor[resizingName] = null;\n }\n }\n });\n ResizingFactory.current = new ResizingFactory();\n\n TableElementResizing.create = function(editor, options) {\n ResizingFactory.current.create(editor, options);\n };\n\n TableElementResizing.dispose = function(editor, options) {\n ResizingFactory.current.dispose(editor, options);\n };\n\n extend(Editor, {\n TableElementResizing: TableElementResizing\n });\n\n })(window.kendo);\n\n (function(kendo, undefined$1) {\n var global = window;\n var math = global.Math;\n var abs = math.abs;\n\n var $ = kendo.jQuery;\n var extend = $.extend;\n\n var Editor = kendo.ui.editor;\n var dom = Editor.Dom;\n var TableElementResizing = Editor.TableElementResizing;\n var ResizingUtils = Editor.ResizingUtils;\n var constrain = ResizingUtils.constrain;\n var calculatePercentageRatio = ResizingUtils.calculatePercentageRatio;\n var getScrollBarWidth = ResizingUtils.getScrollBarWidth;\n var inPercentages = ResizingUtils.inPercentages;\n var toPercentages = ResizingUtils.toPercentages;\n var toPixels = ResizingUtils.toPixels;\n var outerWidth = kendo._outerWidth;\n\n var NS = \".kendoEditorColumnResizing\";\n var RESIZE_HANDLE_CLASS = \"k-column-resize-handle\";\n var RESIZE_MARKER_CLASS = \"k-column-resize-marker\";\n\n var BODY = \"body\";\n var TBODY = \"tbody\";\n var THEAD = \"thead\";\n var TD = \"td\";\n var TH = \"th\";\n var TR = \"tr\";\n\n var COLATTR = \"col-index\";\n\n var COMMA = \",\";\n var WIDTH = \"width\";\n\n var ColumnResizing = TableElementResizing.extend({\n options: {\n tags: [TD, TH],\n min: 20,\n rootElement: null,\n eventNamespace: NS,\n rtl: false,\n handle: {\n dataAttribute: \"column\",\n width: 10,\n height: 0,\n classNames: {\n handle: RESIZE_HANDLE_CLASS,\n marker: RESIZE_MARKER_CLASS\n },\n template:\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    '\n }\n },\n\n elementBorderHovered: function(column, e) {\n var that = this;\n var options = that.options;\n var handleWidth = options.handle.width;\n var borderOffset = column.offset().left + (options.rtl ? 0 : outerWidth(column));\n\n\n var mousePosition = e.clientX + $(column[0].ownerDocument).scrollLeft();\n\n if ((mousePosition > (borderOffset - handleWidth)) && (mousePosition < (borderOffset + handleWidth))) {\n return true;\n }\n else {\n return false;\n }\n },\n\n setResizeHandlePosition: function(column) {\n var that = this;\n var tableInnerElement = $(that.element.tHead || that.element.tBodies[0]);\n var options = that.options;\n var rtl = options.rtl;\n var handleWidth = options.handle.width;\n var rootElement = $(options.rootElement);\n var scrollTopOffset = rootElement.is(BODY) ? 0 : rootElement.scrollTop();\n var scrollLeftOffset = rootElement.is(BODY) ? 0 : kendo.scrollLeft(rootElement);\n var columnWidthOffset = rtl ? 0 : outerWidth(column);\n var scrollBarWidth = rtl ? getScrollBarWidth(rootElement[0]) : 0;\n var columnOffsetLeft = column.offset().left -\n (rootElement.offset().left + parseFloat(rootElement.css(\"borderLeftWidth\"))) -\n parseFloat(column.css(\"marginLeft\"));\n var innerElementOffsetTop = tableInnerElement.offset().top -\n (rootElement.offset().top + parseFloat(rootElement.css(\"borderTopWidth\"))) -\n parseFloat(tableInnerElement.css(\"marginTop\"));\n var browser = kendo.support.browser;\n\n if (rtl && (browser.mozilla || (browser.webkit && browser.version >= 85))) {\n scrollLeftOffset = scrollLeftOffset * -1;\n }\n\n that.resizeHandle.css({\n top: innerElementOffsetTop + scrollTopOffset,\n left: columnOffsetLeft + columnWidthOffset + (scrollLeftOffset - scrollBarWidth) - (handleWidth / 2),\n position: \"absolute\"\n });\n },\n\n setResizeHandleDimensions: function() {\n var that = this;\n var tableHead = $(that.element).children(THEAD);\n var tableBody = $(that.element).children(TBODY);\n var fullHeight = tableHead.length > 0 ? tableHead.height() + tableBody.height() : tableBody.height();\n\n that.resizeHandle.css({\n width: that.options.handle.width,\n height: fullHeight\n });\n },\n\n setResizeHandleDragPosition: function(e) {\n var that = this;\n var column = $($(e.currentTarget).data(that.options.handle.dataAttribute));\n var options = that.options;\n var rootElement = $(options.rootElement);\n var handleWidth = options.handle ? options.handle.width : 0;\n var min = options.min;\n var rtl = options.rtl;\n var columnWidth = outerWidth(column);\n var columnLeftOffset = column.offset().left -\n (rootElement.offset().left + parseFloat(rootElement.css(\"borderLeftWidth\"))) -\n parseFloat(column.css(\"marginLeft\"));\n var adjacentColumnWidth = outerWidth(column.next());\n var resizeHandle = $(that.resizeHandle);\n var scrollLeftOffset = rootElement.is(BODY) ? 0 : kendo.scrollLeft(rootElement);\n var scrollBarWidth = rtl ? getScrollBarWidth(rootElement[0]) : 0;\n var resizeHandleOffsetLeft = resizeHandle.offset().left -\n (rootElement.offset().left + parseFloat(rootElement.css(\"borderLeftWidth\"))) -\n parseFloat(resizeHandle.css(\"marginLeft\"));\n var browser = kendo.support.browser;\n\n if (rtl && (browser.mozilla || (browser.webkit && browser.version >= 85))) {\n scrollLeftOffset = scrollLeftOffset * -1;\n }\n\n var handleOffset = constrain({\n value: resizeHandleOffsetLeft + (scrollLeftOffset - scrollBarWidth) + e.x.delta,\n min: columnLeftOffset + (scrollLeftOffset - scrollBarWidth) - (rtl ? adjacentColumnWidth : 0) + min,\n max: columnLeftOffset + columnWidth + (scrollLeftOffset - scrollBarWidth) + (rtl ? 0 : adjacentColumnWidth) - handleWidth - min\n });\n\n resizeHandle.css({ left: handleOffset });\n },\n\n resize: function(e) {\n var that = this;\n var column = $($(e.currentTarget).data(that.options.handle.dataAttribute));\n var options = that.options;\n var rtlModifier = options.rtl ? (-1) : 1;\n var min = options.min;\n var initialDeltaX = rtlModifier * e.x.initialDelta;\n var newWidth;\n var initialAdjacentColumnWidth;\n var initialColumnWidth;\n var colIndex;\n var nextColumn;\n\n dom.reMapTableColumns(that.element, COLATTR);\n\n colIndex = parseInt(column.attr(COLATTR), 10);\n\n if (column.prop(\"colSpan\") > 1) {\n column = $(that.element).find(\"[\" + COLATTR + \"=\" + (colIndex + column.prop(\"colSpan\") - 1) + \"]\").eq(0);\n colIndex = parseInt(column.attr(COLATTR), 10);\n }\n\n nextColumn = $(that.element).find(\"[\" + COLATTR + \"=\" + (colIndex + 1) + \"]:not([colspan])\");\n\n that._setTableComputedWidth();\n that._setColumnsComputedWidth();\n\n initialColumnWidth = outerWidth(column);\n initialAdjacentColumnWidth = outerWidth(nextColumn);\n\n newWidth = constrain({\n value: initialColumnWidth + initialDeltaX,\n min: min,\n max: initialColumnWidth + initialAdjacentColumnWidth - min\n });\n\n that._resizeColumn(column[0], newWidth);\n that._resizeTopAndBottomColumns(column[0], newWidth);\n that._resizeAdjacentColumns(parseInt(column.attr(COLATTR),10), initialAdjacentColumnWidth, initialColumnWidth, (initialColumnWidth - newWidth));\n\n dom.clearTableMappings(that.element, COLATTR);\n },\n\n _setTableComputedWidth: function() {\n var element = this.element;\n\n if (element.style[WIDTH] === \"\") {\n element.style[WIDTH] = toPixels(outerWidth($(element)));\n }\n },\n\n _setColumnsComputedWidth: function() {\n var that = this;\n var tableInnerElement = $(that.element.tHead || that.element.tBodies[0]);\n var innerElementWidth = outerWidth(tableInnerElement);\n var columns = tableInnerElement.children(TR).children(TD);\n var length = columns.length;\n var currentColumnsWidths = columns.map(function() {\n return outerWidth($(this));\n });\n var i;\n\n for (i = 0; i < length; i++) {\n if (inPercentages(columns[i].style[WIDTH])) {\n columns[i].style[WIDTH] = toPercentages(calculatePercentageRatio(currentColumnsWidths[i], innerElementWidth));\n }\n else {\n columns[i].style[WIDTH] = toPixels(currentColumnsWidths[i]);\n }\n }\n },\n\n _resizeTopAndBottomColumns: function(column, newWidth) {\n var that = this;\n var columnIndex = $(column).attr(COLATTR);\n var topAndBottomColumns = $(that.element).children(TBODY + COMMA + THEAD).children(TR).children(that.options.tags.join(COMMA))\n .filter(function() {\n var cell = this;\n return ($(cell).attr(COLATTR) === columnIndex && cell !== column);\n });\n var length = topAndBottomColumns.length;\n var i;\n\n for (i = 0; i < length; i++) {\n that._resizeColumn(topAndBottomColumns[i], newWidth);\n }\n },\n\n _resizeColumn: function(column, newWidth) {\n var innerTableElement = $(this.element.tHead || this.element.tBodies[0]);\n if (inPercentages(column.style[WIDTH])) {\n column.style[WIDTH] = toPercentages(calculatePercentageRatio(newWidth, outerWidth(innerTableElement)));\n }\n else {\n column.style[WIDTH] = toPixels(newWidth);\n }\n },\n\n _resizeAdjacentColumns: function(columnIndex, initialAdjacentColumnWidth, initialColumnWidth, deltaWidth) {\n var that = this;\n var adjacentColumns = $(that.element).children(TBODY + COMMA + THEAD).children(TR).children(that.options.tags.join(COMMA))\n .filter(function() {\n return (parseInt($(this).attr(COLATTR),10) === (columnIndex + 1));\n });\n var length = adjacentColumns.length;\n var i;\n\n for (i = 0; i < length; i++) {\n that._resizeAdjacentColumn(adjacentColumns[i], initialAdjacentColumnWidth, initialColumnWidth, deltaWidth);\n }\n },\n\n _resizeAdjacentColumn: function(adjacentColumn, initialAdjacentColumnWidth, initialColumnWidth, deltaWidth) {\n var that = this;\n var min = that.options.min;\n var newWidth;\n\n newWidth = constrain({\n value: initialAdjacentColumnWidth + deltaWidth,\n min: min,\n max: abs(initialColumnWidth + initialAdjacentColumnWidth - min)\n });\n\n that._resizeColumn(adjacentColumn, newWidth);\n }\n });\n\n ColumnResizing.create = function(editor) {\n TableElementResizing.create(editor, {\n name: \"columnResizing\",\n type: ColumnResizing,\n eventNamespace: NS\n });\n };\n\n ColumnResizing.dispose = function(editor) {\n TableElementResizing.dispose(editor, {\n eventNamespace: NS\n });\n };\n\n extend(Editor, {\n ColumnResizing: ColumnResizing\n });\n\n })(window.kendo);\n\n (function(kendo, undefined$1) {\n var math = window.Math;\n var abs = math.abs;\n\n var $ = kendo.jQuery;\n var extend = $.extend;\n\n var Editor = kendo.ui.editor;\n var TableElementResizing = Editor.TableElementResizing;\n var ResizingUtils = Editor.ResizingUtils;\n var getScrollBarWidth = ResizingUtils.getScrollBarWidth;\n var constrain = ResizingUtils.constrain;\n var calculatePercentageRatio = ResizingUtils.calculatePercentageRatio;\n var inPercentages = ResizingUtils.inPercentages;\n var toPercentages = ResizingUtils.toPercentages;\n var toPixels = ResizingUtils.toPixels;\n var outerHeight = kendo._outerHeight;\n\n var NS = \".kendoEditorRowResizing\";\n var RESIZE_HANDLE_CLASS = \"k-row-resize-handle\";\n var RESIZE_HANDLE_MARKER_WRAPPER_CLASS = \"k-row-resize-marker-wrapper\";\n var RESIZE_MARKER_CLASS = \"k-row-resize-marker\";\n\n var BODY = \"body\";\n var TR = \"tr\";\n var TBODY = \"tbody\";\n var THEAD = \"thead\";\n\n var COMMA = \",\";\n var HEIGHT = \"height\";\n\n var RowResizing = TableElementResizing.extend({\n options: {\n tags: [TR],\n min: 20,\n rootElement: null,\n eventNamespace: NS,\n rtl: false,\n handle: {\n dataAttribute: \"row\",\n width: 0,\n height: 10,\n classNames: {\n handle: RESIZE_HANDLE_CLASS,\n marker: RESIZE_MARKER_CLASS\n },\n template:\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    '\n }\n },\n\n elementBorderHovered: function(tableElement, e) {\n var that = this;\n var handleHeight = that.options.handle[HEIGHT];\n var borderOffset = tableElement.offset().top + outerHeight(tableElement);\n var mousePosition = e.clientY + $(tableElement[0].ownerDocument).scrollTop();\n\n if ((mousePosition > (borderOffset - handleHeight)) && (mousePosition < (borderOffset + handleHeight))) {\n return true;\n }\n else {\n return false;\n }\n },\n\n setResizeHandlePosition: function(row) {\n var that = this;\n var options = that.options;\n var handleHeight = options.handle[HEIGHT];\n var rootElement = $(options.rootElement);\n var scrollTopOffset = rootElement.is(BODY) ? 0 : rootElement.scrollTop();\n var scrollLeftOffset = rootElement.is(BODY) ? 0 : kendo.scrollLeft(rootElement);\n var scrollBarWidth = options.rtl ? getScrollBarWidth(rootElement[0]) : 0;\n\n var rowOffsetLeft = row.offset().left -\n (rootElement.offset().left + parseFloat(rootElement.css(\"borderLeftWidth\"))) -\n parseFloat(row.css(\"marginLeft\"));\n var rowOffsetTop = row.offset().top -\n (rootElement.offset().top + parseFloat(rootElement.css(\"borderTopWidth\"))) -\n parseFloat(row.css(\"marginTop\"));\n var browser = kendo.support.browser;\n\n if (options.rtl && (browser.mozilla || (browser.webkit && browser.version >= 85))) {\n scrollLeftOffset = scrollLeftOffset * -1;\n }\n\n that.resizeHandle.css({\n top: rowOffsetTop + outerHeight(row) + scrollTopOffset - (handleHeight / 2),\n left: rowOffsetLeft + (scrollLeftOffset - scrollBarWidth),\n position: \"absolute\"\n });\n },\n\n setResizeHandleDimensions: function() {\n var that = this;\n var innerTableElement = $(that.element.tHead || that.element.tBodies[0]);\n\n that.resizeHandle.css({\n width: innerTableElement.width(),\n height: that.options.handle[HEIGHT]\n });\n },\n\n setResizeHandleDragPosition: function(e) {\n var that = this;\n var options = that.options;\n var min = options.min;\n var tableHead = $(that.element).children(THEAD);\n var tableBody = $(that.element).children(TBODY);\n var topInnerTableElement = tableHead.length > 0 ? tableHead : tableBody;\n var resizeHandle = $(that.resizeHandle);\n var row = $(e.currentTarget).data(options.handle.dataAttribute);\n var $row = $(row);\n var rootElement = $(options.rootElement);\n var scrollTopOffset = rootElement.is(BODY) ? 0 : rootElement.scrollTop();\n var tableTopOffset = topInnerTableElement.offset().top -\n (rootElement.offset().top + parseFloat(rootElement.css(\"borderTopWidth\"))) -\n parseFloat(topInnerTableElement.css(\"marginTop\"));\n\n var rowOffsetTop = $row.offset().top -\n (rootElement.offset().top + parseFloat(rootElement.css(\"borderTopWidth\"))) -\n parseFloat($row.css(\"marginTop\"));\n\n var resizeHandleOffsetTop = resizeHandle.offset().top -\n (Math.max(0 , rootElement.offset().top) + parseFloat(rootElement.css(\"borderTopWidth\"))) -\n parseFloat(resizeHandle.css(\"marginTop\"));\n\n var handleOffset = constrain({\n value: resizeHandleOffsetTop + scrollTopOffset + e.y.delta,\n min: rowOffsetTop + scrollTopOffset + min,\n max: tableTopOffset + outerHeight(tableHead) + outerHeight(tableBody) + scrollTopOffset - options.handle[HEIGHT] - min\n });\n\n resizeHandle.css({ top: handleOffset });\n },\n\n resize: function(e) {\n var that = this;\n var options = that.options;\n var row = $(e.currentTarget).data(options.handle.dataAttribute);\n var currentRowHeight = outerHeight($(row));\n var element = $(that.element);\n var initialTableHeight = outerHeight(element);\n var tableHead = element.children(THEAD);\n var tableHeadHeight = tableHead.length > 0 ? tableHead.height() : 0;\n var tableBody = element.children(TBODY);\n var tableBodyHeight = tableBody.height();\n var initialStyleHeight = row.style[HEIGHT];\n var newRowHeight = constrain({\n value: currentRowHeight + e.y.initialDelta,\n min: options.min,\n max: abs(tableHeadHeight + tableBodyHeight - options.min)\n });\n\n that._setRowsHeightInPixels();\n row.style[HEIGHT] = toPixels(newRowHeight);\n that._setTableHeight(initialTableHeight + (newRowHeight - currentRowHeight));\n\n if (inPercentages(initialStyleHeight)) {\n //resize rows in percentages as late as possible to prevent incorrect precision calculations\n that._setRowsHeightInPercentages();\n }\n },\n\n _setRowsHeightInPixels: function() {\n var that = this;\n var rows = $(that.element).children(TBODY + COMMA + THEAD).children(TR);\n var length = rows.length;\n var currentRowsHeights = rows.map(function() {\n return outerHeight($(this));\n });\n var i;\n\n for (i = 0; i < length; i++) {\n rows[i].style[HEIGHT] = toPixels(currentRowsHeights[i]);\n }\n },\n\n _setRowsHeightInPercentages: function() {\n var that = this;\n var tableHead = $(that.element).children(THEAD);\n var tableHeadHeight = tableHead.length > 0 ? tableHead.height() : 0;\n var tableBody = $(that.element).children(TBODY);\n var tableBodyHeight = tableBody.height();\n var rows = $(that.element).children(THEAD + COMMA + TBODY).children(TR);\n var length = rows.length;\n var currentRowsHeights = rows.map(function() {\n return outerHeight($(this));\n });\n var i;\n\n for (i = 0; i < length; i++) {\n rows[i].style[HEIGHT] = toPercentages(calculatePercentageRatio(currentRowsHeights[i], tableHeadHeight + tableBodyHeight));\n }\n },\n\n _setTableHeight: function(newHeight) {\n var element = this.element;\n\n if (inPercentages(element.style[HEIGHT])) {\n element.style[HEIGHT] = toPercentages(calculatePercentageRatio(newHeight, $(element).parent().height()));\n }\n else {\n element.style[HEIGHT] = toPixels(newHeight);\n }\n }\n });\n\n RowResizing.create = function(editor) {\n TableElementResizing.create(editor, {\n name: \"rowResizing\",\n type: RowResizing,\n eventNamespace: NS\n });\n };\n\n RowResizing.dispose = function(editor) {\n TableElementResizing.dispose(editor, {\n eventNamespace: NS\n });\n };\n\n extend(Editor, {\n RowResizing: RowResizing\n });\n\n })(window.kendo);\n\n (function(kendo, undefined$1) {\n var $ = kendo.jQuery;\n var extend = $.extend;\n var noop = $.noop;\n\n var Editor = kendo.ui.editor;\n var Class = kendo.Class;\n var Draggable = kendo.ui.Draggable;\n var Observable = kendo.Observable;\n var getScrollBarWidth = Editor.ResizingUtils.getScrollBarWidth;\n var outerWidth = kendo._outerWidth;\n var outerHeight = kendo._outerHeight;\n\n var NS = \".kendoEditorElementResizeHandle\";\n var RESIZE_HANDLE_CLASS = \"k-element-resize-handle\";\n\n var DRAG_START = \"dragStart\";\n var DRAG = \"drag\";\n var DRAG_END = \"dragEnd\";\n var HALF_INSIDE = \"halfInside\";\n var MOUSE_OVER = \"mouseover\";\n var MOUSE_OUT = \"mouseout\";\n\n var BODY = \"body\";\n var TABLE = \"table\";\n\n var EAST = \"east\";\n var NORTH = \"north\";\n var NORTHEAST = \"northeast\";\n var NORTHWEST = \"northwest\";\n var SOUTH = \"south\";\n var SOUTHEAST = \"southeast\";\n var SOUTHWEST = \"southwest\";\n var WEST = \"west\";\n\n var DOT = \".\";\n\n var ElementResizeHandle = Observable.extend({\n init: function(options) {\n var that = this;\n\n Observable.fn.init.call(that);\n\n that.options = extend({}, that.options, options);\n that.element = $(that.options.template).appendTo(that.options.appendTo)[0];\n\n that._attachEventHandlers();\n that._addStyles();\n that._initDraggable();\n that._initPositioningStrategy();\n that._initDraggingStrategy();\n\n $(that.element).data(TABLE, that.options.resizableElement);\n },\n\n destroy: function() {\n var that = this;\n\n $(that.element).off(NS).remove();\n that.element = null;\n\n that._destroyDraggable();\n\n that.unbind();\n },\n\n options: {\n appendTo: null,\n direction: SOUTHEAST,\n resizableElement: null,\n rtl: false,\n template:\n \"
    \" +\n \"
    \" +\n \"
    \"\n },\n\n events: [\n DRAG_START,\n DRAG,\n DRAG_END,\n MOUSE_OVER,\n MOUSE_OUT\n ],\n\n show: function() {\n this._setPosition();\n },\n\n _setPosition: function() {\n var that = this;\n var position = that._positioningStrategy.getPosition();\n\n $(that.element).css({\n top: position.top,\n left: position.left,\n position: \"absolute\"\n });\n },\n\n _attachEventHandlers: function() {\n var that = this;\n\n $(that.element)\n .on(MOUSE_OVER + NS, that._onMouseOver.bind(that))\n .on(MOUSE_OUT + NS, that._onMouseOut.bind(that));\n },\n\n _onMouseOver: function() {\n this.trigger(MOUSE_OVER);\n },\n\n _onMouseOut: function() {\n this.trigger(MOUSE_OUT);\n },\n\n _addStyles: function() {\n var that = this;\n $(that.element).children(DOT + RESIZE_HANDLE_CLASS).addClass(\"k-resize-\" + that.options.direction);\n },\n\n _initPositioningStrategy: function() {\n var that = this;\n var options = that.options;\n\n that._positioningStrategy = HandlePositioningStrategy.create({\n name: options.direction,\n handle: that.element,\n resizableElement: options.resizableElement,\n rootElement: options.rootElement,\n rtl: options.rtl\n });\n },\n\n _initDraggable: function() {\n var that = this;\n var element = that.element;\n\n if (that._draggable || !element) {\n return;\n }\n\n that._draggable = new Draggable(element, {\n dragstart: that._onDragStart.bind(that),\n drag: that._onDrag.bind(that),\n dragend: that._onDragEnd.bind(that)\n });\n },\n\n _onDragStart: function() {\n this.trigger(DRAG_START);\n },\n\n _onDrag: function(e) {\n var that = this;\n\n that.trigger(DRAG, that._draggingStrategy.adjustDragDelta({\n deltaX: e.x.delta,\n deltaY: e.y.delta,\n initialDeltaX: e.x.initialDelta,\n initialDeltaY: e.y.initialDelta\n }));\n },\n\n _onDragEnd: function() {\n this.trigger(DRAG_END);\n },\n\n _destroyDraggable: function() {\n var that = this;\n\n if (that._draggable) {\n that._draggable.destroy();\n that._draggable = null;\n }\n },\n\n _initDraggingStrategy: function() {\n var that = this;\n\n that._draggingStrategy = HandleDraggingStrategy.create({\n name: that.options.direction\n });\n }\n });\n\n var StrategyFactory = Class.extend({\n init: function() {\n this._items = [];\n },\n\n register: function(name, type) {\n this._items.push({\n name: name,\n type: type\n });\n },\n\n create: function(options) {\n var items = this._items;\n var itemsLength = items.length;\n var name = options.name ? options.name.toLowerCase() : \"\";\n var match;\n var item;\n var i;\n\n for (i = 0; i < itemsLength; i++) {\n item = items[i];\n\n if (item.name.toLowerCase() === name) {\n match = item;\n break;\n }\n }\n\n if (match) {\n return new match.type(options);\n }\n }\n });\n\n var PositioningStrategyFactory = StrategyFactory.extend({});\n PositioningStrategyFactory.current = new PositioningStrategyFactory();\n\n var HandlePositioningStrategy = Class.extend({\n init: function(options) {\n var that = this;\n that.options = extend({}, that.options, options);\n },\n\n options: {\n handle: null,\n offset: HALF_INSIDE,\n resizableElement: null,\n rootElement: null,\n rtl: false\n },\n\n getPosition: function() {\n var that = this;\n\n var position = that.calculatePosition();\n var handleOffsetPosition = that.applyHandleOffset(position);\n var scrollOffsetPosition = that.applyScrollOffset(handleOffsetPosition);\n\n return scrollOffsetPosition;\n },\n\n calculatePosition: noop,\n\n applyHandleOffset: function(position) {\n var options = this.options;\n var handle = $(options.handle);\n\n if (options.offset === HALF_INSIDE) {\n return {\n top: position.top - (outerHeight(handle) / 2),\n left: position.left - (outerWidth(handle) / 2)\n };\n }\n\n return position;\n },\n\n applyScrollOffset: function(position) {\n var options = this.options;\n var rootElement = $(options.rootElement);\n var scrollBarWidth = options.rtl ? getScrollBarWidth(rootElement[0]) : 0;\n var browser = kendo.support.browser;\n var rootLeft;\n\n if (!rootElement.is(BODY)) {\n rootLeft = kendo.scrollLeft(rootElement) || 0;\n\n if (options.rtl && (browser.mozilla || (browser.webkit && browser.version >= 85))) {\n rootLeft = rootLeft * -1;\n }\n\n return {\n top: position.top + (rootElement.scrollTop() || 0),\n left: position.left + rootLeft - scrollBarWidth\n };\n }\n\n return position;\n }\n });\n\n HandlePositioningStrategy.create = function(options) {\n return PositioningStrategyFactory.current.create(options);\n };\n\n var EastPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top + (outerHeight(resizableElement) / 2),\n left: offset.left + outerWidth(resizableElement) + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(EAST, EastPositioningStrategy);\n\n var NorthPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top,\n left: offset.left + (outerWidth(resizableElement) / 2) + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(NORTH, NorthPositioningStrategy);\n\n var NortheastPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top,\n left: offset.left + outerWidth(resizableElement) + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(NORTHEAST, NortheastPositioningStrategy);\n\n var NorthwestPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top,\n left: offset.left + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(NORTHWEST, NorthwestPositioningStrategy);\n\n var SouthPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top + outerHeight(resizableElement),\n left: offset.left + (outerWidth(resizableElement) / 2) + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(SOUTH, SouthPositioningStrategy);\n\n var SoutheastPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top + outerHeight(resizableElement),\n left: offset.left + outerWidth(resizableElement) + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(SOUTHEAST, SoutheastPositioningStrategy);\n\n var SouthwestPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top + outerHeight(resizableElement),\n left: offset.left + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(SOUTHWEST, SouthwestPositioningStrategy);\n\n var WestPositioningStrategy = HandlePositioningStrategy.extend({\n calculatePosition: function() {\n var resizableElement = $(this.options.resizableElement);\n var offset = resizableElement.position();\n var marginLeft = parseInt(resizableElement.css(\"marginLeft\"), 10);\n\n return {\n top: offset.top + (outerHeight(resizableElement) / 2),\n left: offset.left + marginLeft\n };\n }\n });\n PositioningStrategyFactory.current.register(WEST, WestPositioningStrategy);\n\n var DraggingStrategyFactory = StrategyFactory.extend({});\n DraggingStrategyFactory.current = new DraggingStrategyFactory();\n\n var HandleDraggingStrategy = Class.extend({\n init: function(options) {\n var that = this;\n that.options = extend({}, that.options, options);\n },\n\n options: {\n deltaX: {\n adjustment: null,\n modifier: null\n },\n deltaY: {\n adjustment: null,\n modifier: null\n }\n },\n\n adjustDragDelta: function(deltas) {\n var options = this.options;\n var xAxisAdjustment = options.deltaX.adjustment * options.deltaX.modifier;\n var yAxisAdjustment = options.deltaY.adjustment * options.deltaY.modifier;\n\n return {\n deltaX: deltas.deltaX * xAxisAdjustment,\n deltaY: deltas.deltaY * yAxisAdjustment,\n initialDeltaX: deltas.initialDeltaX * xAxisAdjustment,\n initialDeltaY: deltas.initialDeltaY * yAxisAdjustment\n };\n }\n });\n\n HandleDraggingStrategy.create = function(options) {\n return DraggingStrategyFactory.current.create(options);\n };\n\n var HorizontalDraggingStrategy = HandleDraggingStrategy.extend({\n options: {\n deltaX: {\n adjustment: 1,\n modifier: 1\n },\n deltaY: {\n adjustment: 0,\n modifier: 0\n }\n }\n });\n\n var EastDraggingStrategy = HorizontalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: 1\n }\n }\n });\n DraggingStrategyFactory.current.register(EAST, EastDraggingStrategy);\n\n var WestDraggingStrategy = HorizontalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: (-1)\n }\n }\n });\n DraggingStrategyFactory.current.register(WEST, WestDraggingStrategy);\n\n var VerticalDraggingStrategy = HandleDraggingStrategy.extend({\n options: {\n deltaX: {\n adjustment: 0,\n modifier: 0\n },\n deltaY: {\n adjustment: 1,\n modifier: 1\n }\n }\n });\n\n var NorthDraggingStrategy = VerticalDraggingStrategy.extend({\n options: {\n deltaY: {\n modifier: (-1)\n }\n }\n });\n DraggingStrategyFactory.current.register(NORTH, NorthDraggingStrategy);\n\n var SouthDraggingStrategy = VerticalDraggingStrategy.extend({\n options: {\n deltaY: {\n modifier: 1\n }\n }\n });\n DraggingStrategyFactory.current.register(SOUTH, SouthDraggingStrategy);\n\n var HorizontalAndVerticalDraggingStrategy = HandleDraggingStrategy.extend({\n options: {\n deltaX: {\n adjustment: 1,\n modifier: 1\n },\n deltaY: {\n adjustment: 1,\n modifier: 1\n }\n }\n });\n\n var NorthEastDraggingStrategy = HorizontalAndVerticalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: 1\n },\n deltaY: {\n modifier: (-1)\n }\n }\n });\n DraggingStrategyFactory.current.register(NORTHEAST, NorthEastDraggingStrategy);\n\n var NorthWestDraggingStrategy = HorizontalAndVerticalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: (-1)\n },\n deltaY: {\n modifier: (-1)\n }\n }\n });\n DraggingStrategyFactory.current.register(NORTHWEST, NorthWestDraggingStrategy);\n\n var SouthEastDraggingStrategy = HorizontalAndVerticalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: 1\n },\n deltaY: {\n modifier: 1\n }\n }\n });\n DraggingStrategyFactory.current.register(SOUTHEAST, SouthEastDraggingStrategy);\n\n var SouthWestDraggingStrategy = HorizontalAndVerticalDraggingStrategy.extend({\n options: {\n deltaX: {\n modifier: (-1)\n },\n deltaY: {\n modifier: 1\n }\n }\n });\n DraggingStrategyFactory.current.register(SOUTHWEST, SouthWestDraggingStrategy);\n\n extend(Editor, {\n ElementResizeHandle: ElementResizeHandle\n });\n })(window.kendo);\n\n (function(kendo, undefined$1) {\n var global = window;\n var math = global.Math;\n var min = math.min;\n var max = math.max;\n\n var $ = kendo.jQuery;\n var contains = $.contains;\n var extend = $.extend;\n\n var browser = kendo.support.browser;\n var Editor = kendo.ui.editor;\n var Class = kendo.Class;\n var ElementResizeHandle = Editor.ElementResizeHandle;\n var ResizingUtils = Editor.ResizingUtils;\n var calculatePercentageRatio = ResizingUtils.calculatePercentageRatio;\n var constrain = ResizingUtils.constrain;\n var inPercentages = ResizingUtils.inPercentages;\n var inPixels = ResizingUtils.inPixels;\n var toPercentages = ResizingUtils.toPercentages;\n var toPixels = ResizingUtils.toPixels;\n var outerWidth = kendo._outerWidth;\n var outerHeight = kendo._outerHeight;\n var RangeUtils = Editor.RangeUtils;\n\n var NS = \".kendoEditorElementResizing\";\n var RESIZE_HANDLE_WRAPPER_CLASS = \"k-element-resize-handle-wrapper\";\n var TABLE_CLASS = \"k-table\";\n var ELEMENT_RESIZING_CLASS = \"k-element-resizing\";\n\n var DRAG_START = \"dragStart\";\n var DRAG = \"drag\";\n var DRAG_END = \"dragEnd\";\n var KEY_DOWN = \"keydown\";\n var MOUSE_DOWN = \"mousedown\";\n var SELECT = \"select\";\n var DROP = \"drop\";\n\n var COLUMN = \"td\";\n var ROW = \"tr\";\n var TBODY = \"tbody\";\n var THEAD = \"thead\";\n var TABLE = \"table\";\n var IMG = \"img\";\n var ELEMENT_TYPES = [\"TABLE\", \"IMG\"];\n\n var COMMA = \",\";\n var WIDTH = \"width\";\n var HEIGHT = \"height\";\n\n var EAST = \"east\";\n var NORTH = \"north\";\n var NORTHEAST = \"northeast\";\n var NORTHWEST = \"northwest\";\n var SOUTH = \"south\";\n var SOUTHEAST = \"southeast\";\n var SOUTHWEST = \"southwest\";\n var WEST = \"west\";\n\n var DOT = \".\";\n\n function isUndefined(value) {\n return typeof(value) === \"undefined\";\n }\n\n var ElementResizing = Class.extend({\n init: function(element, options) {\n var that = this;\n\n that.options = extend({}, that.options, options);\n that.handles = [];\n\n // Check whether the element is TABLE or IMG\n if (ELEMENT_TYPES.indexOf(element.nodeName) >= 0) {\n that.element = element;\n }\n },\n\n destroy: function() {\n var that = this;\n\n $(that.element).off(NS);\n that.element = null;\n\n $(that.options.rootElement).off(KEY_DOWN + NS);\n\n that._destroyResizeHandles();\n },\n\n options: {\n appendHandlesTo: null,\n rtl: false,\n rootElement: null,\n minWidth: 10,\n minHeight: 10,\n handles: [{\n direction: NORTHWEST\n }, {\n direction: NORTH\n }, {\n direction: NORTHEAST\n }, {\n direction: EAST\n }, {\n direction: SOUTHEAST\n }, {\n direction: SOUTH\n }, {\n direction: SOUTHWEST\n }, {\n direction: WEST\n }]\n },\n\n resize: function(args) {\n var that = this;\n var deltas = extend({}, {\n deltaX: 0,\n deltaY: 0,\n initialDeltaX: 0,\n initialDeltaY: 0\n }, args);\n\n that._resizeWidth(deltas.deltaX, deltas.initialDeltaX);\n that._resizeHeight(deltas.deltaY, deltas.initialDeltaY);\n\n that.showResizeHandles();\n },\n\n _resizeWidth: function() {\n return false;\n },\n\n _resizeHeight: function() {\n return false;\n },\n\n _getMaxDimensionValue: function(dimension) {\n var that = this;\n var element = $(that.element);\n var dimensionLowercase = dimension.toLowerCase();\n var rtlModifier = that.options.rtl ? (-1) : 1;\n var parent = $(that.element).parent();\n var parentElement = parent[0];\n var parentDimension = parent[dimensionLowercase]();\n var parentScrollOffset = rtlModifier * (dimension === WIDTH ? kendo.scrollLeft(parent) : parent.scrollTop());\n\n if (parentElement && parentElement === element.closest(COLUMN)[0]) {\n if (parentElement.style[dimensionLowercase] === \"\" && !inPercentages(that.element.style[dimensionLowercase])) {\n return Infinity;\n }\n else {\n return (parentDimension + parentScrollOffset);\n }\n }\n else {\n return (parentDimension + parentScrollOffset);\n }\n },\n\n showResizeHandles: function() {\n var that = this;\n\n that._initResizeHandles();\n that._showResizeHandles();\n },\n\n _initResizeHandles: function() {\n var that = this;\n var handles = that.handles;\n var options = that.options;\n var handleOptions = that.options.handles;\n var length = handleOptions.length;\n var i;\n\n if (handles && handles.length > 0) {\n return;\n }\n\n for (i = 0; i < length; i++) {\n that.handles.push(new ElementResizeHandle(extend({\n appendTo: options.appendHandlesTo,\n resizableElement: that.element,\n rootElement: options.rootElement,\n rtl: options.rtl\n }, handleOptions[i])));\n }\n\n that._bindToResizeHandlesEvents();\n },\n\n _destroyResizeHandles: function() {\n var that = this;\n var length = that.handles ? that.handles.length : 0;\n\n for (var i = 0; i < length; i++) {\n that.handles[i].destroy();\n }\n\n that.handles = [];\n },\n\n _showResizeHandles: function() {\n var that = this;\n var handles = that.handles || [];\n var length = handles.length;\n var i;\n\n for (i = 0; i < length; i++) {\n that.handles[i].show();\n }\n },\n\n _bindToResizeHandlesEvents: function() {\n return false;\n },\n\n _onResizeHandleDragStart: function() {\n var that = this;\n var element = $(that.element);\n\n element.addClass(ELEMENT_RESIZING_CLASS);\n\n that._initialElementHeight = outerHeight(element);\n that._initialElementWidth = outerWidth(element);\n that._disableKeyboard();\n },\n\n _onResizeHandleDrag: function(e) {\n this.resize(e);\n },\n\n _onResizeHandleDragEnd: function() {\n var that = this;\n $(that.element).removeClass(ELEMENT_RESIZING_CLASS);\n that._enableKeyboard();\n },\n\n _enableKeyboard: function() {\n $(this.options.rootElement).off(KEY_DOWN + NS);\n },\n\n _disableKeyboard: function() {\n $(this.options.rootElement).on(KEY_DOWN + NS, function(e) {\n e.preventDefault();\n });\n }\n });\n\n var TableResizing = ElementResizing.extend({\n _bindToResizeHandlesEvents: function() {\n var that = this;\n var handles = that.handles || [];\n var length = handles.length;\n var i;\n var handle;\n\n for (i = 0; i < length; i++) {\n handle = handles[i];\n handle.bind(DRAG_START, that._onResizeHandleDragStart.bind(that));\n handle.bind(DRAG, that._onResizeHandleDrag.bind(that));\n handle.bind(DRAG_END, that._onResizeHandleDragEnd.bind(that));\n }\n },\n\n _hasRowsInPixels: function() {\n var that = this;\n var rows = $(that.element).children(THEAD + COMMA + TBODY).children(ROW);\n\n for (var i = 0; i < rows.length; i++) {\n if (rows[i].style.height === \"\" || inPixels(rows[i].style.height)) {\n return true;\n }\n }\n\n return false;\n },\n\n _resizeWidth: function(delta, initialDelta) {\n var that = this;\n var element = $(that.element);\n var styleWidth = element[0].style[WIDTH];\n var currentWidth = outerWidth(element);\n var parentWidth = element.parent().width();\n var maxWidth = that._getMaxDimensionValue(WIDTH);\n var newWidth;\n var ratioValue;\n var ratioTotalValue;\n var constrainedWidth;\n\n if (delta === 0) {\n return;\n }\n\n if (isUndefined(that._initialElementWidth)) {\n that._initialElementWidth = currentWidth;\n }\n\n //use initial delta instead of delta as changing the width with a small value (e.g. 1px)\n //on each drag does not work due to browser calculation of computed styles\n constrainedWidth = constrain({\n value: that._initialElementWidth + initialDelta,\n min: that.options.minWidth,\n max: maxWidth\n });\n\n if (inPercentages(styleWidth)) {\n //detect resizing greater than 100%\n if (currentWidth + delta > parentWidth) {\n ratioValue = max(constrainedWidth, parentWidth);\n ratioTotalValue = min(constrainedWidth, parentWidth);\n }\n else {\n ratioValue = min(constrainedWidth, parentWidth);\n ratioTotalValue = max(constrainedWidth, parentWidth);\n }\n\n newWidth = toPercentages(calculatePercentageRatio(ratioValue, ratioTotalValue));\n }\n else {\n newWidth = toPixels(constrainedWidth);\n }\n\n that._setColumnsWidth();\n\n element[0].style[WIDTH] = newWidth;\n },\n\n _resizeHeight: function(delta, initialDelta) {\n var that = this;\n var element = $(that.element);\n var styleHeight = element[0].style[HEIGHT];\n var currentHeight = outerHeight(element);\n var parent = element.parent();\n var parentHeight = parent.height();\n var maxHeight = that._getMaxDimensionValue(HEIGHT);\n var newHeight;\n var ratioValue;\n var ratioTotalValue;\n var constrainedHeight;\n var minHeight = that.options.minHeight;\n var hasRowsInPixels = that._hasRowsInPixels();\n\n if (delta === 0) {\n return;\n }\n\n if (isUndefined(that._initialElementHeight)) {\n that._initialElementHeight = currentHeight;\n }\n\n //use initial delta instead of delta as changing the height with a small value (e.g. 1px)\n //on each drag does not work due to browser calculation of computed styles\n constrainedHeight = constrain({\n value: that._initialElementHeight + initialDelta,\n min: minHeight,\n max: maxHeight\n });\n\n if (hasRowsInPixels && delta < 0) {\n //decreasing table height when rows are sized in pixels is not possible\n that._setRowsHeightInPercentages();\n }\n\n if (inPercentages(styleHeight)) {\n //detect resizing greater than 100%\n if (currentHeight + delta > parentHeight) {\n ratioValue = max(constrainedHeight, parentHeight);\n ratioTotalValue = min(constrainedHeight, parentHeight);\n }\n else {\n ratioValue = min(constrainedHeight, parentHeight);\n ratioTotalValue = max(constrainedHeight, parentHeight);\n }\n\n newHeight = toPercentages(calculatePercentageRatio(ratioValue, ratioTotalValue));\n }\n else {\n newHeight = toPixels(constrainedHeight);\n }\n\n element[0].style[HEIGHT] = newHeight;\n\n if (hasRowsInPixels && delta < 0) {\n //restore original rows height unit\n that._setRowsHeightInPixels();\n }\n },\n\n _setColumnsWidth: function() {\n var that = this;\n var element = $(that.element);\n var parentElement = element.parent()[0];\n var parentColumn = element.closest(COLUMN);\n var columns = parentColumn.closest(ROW).children();\n var columnsLength = columns.length;\n var i;\n\n function isWidthInPercentages(element) {\n var styleWidth = element.style.width;\n\n if (styleWidth !== \"\") {\n return inPercentages(styleWidth) ? true : false;\n }\n else {\n return $(element).hasClass(TABLE_CLASS) ? true : false;\n }\n }\n\n if (isWidthInPercentages(element[0]) && parentElement === parentColumn[0] && parentElement.style[WIDTH] === \"\") {\n for (i = 0; i < columnsLength; i++) {\n columns[i].style[WIDTH] = toPixels($(columns[i]).width());\n }\n }\n },\n\n _setRowsHeightInPercentages: function() {\n var that = this;\n var tableHead = $(that.element).children(THEAD);\n var tableHeadHeight = tableHead.length > 0 ? tableHead.height() : 0;\n var tableBody = $(that.element).children(TBODY);\n var tableBodyHeight = tableBody.height();\n var rows = $(that.element).children(THEAD + COMMA + TBODY).children(ROW);\n var length = rows.length;\n var currentRowsHeights = rows.map(function() {\n return outerHeight($(this));\n });\n var i;\n\n for (i = 0; i < length; i++) {\n rows[i].style[HEIGHT] = toPercentages(calculatePercentageRatio(currentRowsHeights[i], tableHeadHeight + tableBodyHeight));\n }\n },\n\n _setRowsHeightInPixels: function() {\n var that = this;\n var rows = $(that.element).children(THEAD + COMMA + TBODY).children(ROW);\n var length = rows.length;\n var currentRowsHeights = rows.map(function() {\n return outerHeight($(this));\n });\n var i;\n\n for (i = 0; i < length; i++) {\n rows[i].style[HEIGHT] = toPixels(currentRowsHeights[i]);\n }\n }\n });\n\n var ImageResizing = ElementResizing.extend({\n _bindToResizeHandlesEvents: function() {\n var that = this;\n var handles = that.handles || [];\n var length = handles.length;\n var i;\n var handle;\n\n for (i = 0; i < length; i++) {\n handle = handles[i];\n handle.bind(DRAG_START, that._onResizeHandleDragStart.bind(that));\n\n if (handle.options.direction === \"north\" || handle.options.direction === \"south\") {\n handle.bind(DRAG, that._onResizeHandleDragVertical.bind(that));\n } else if (handle.options.direction === \"east\" || handle.options.direction === \"west\") {\n handle.bind(DRAG, that._onResizeHandleDragHorizontal.bind(that));\n } else {\n handle.bind(DRAG, that._onResizeHandleDragLocked.bind(that));\n }\n\n handle.bind(DRAG_END, that._onResizeHandleDragEnd.bind(that));\n }\n },\n\n _getDeltas: function(args) {\n return extend({}, {\n deltaX: 0,\n deltaY: 0,\n initialDeltaX: 0,\n initialDeltaY: 0\n }, args);\n },\n\n _onResizeHandleDragVertical: function(args) {\n var deltas = this._getDeltas(args);\n\n this._resizeHeight(deltas.deltaY, deltas.initialDeltaY);\n this.showResizeHandles();\n },\n\n _onResizeHandleDragHorizontal: function(args) {\n var deltas = this._getDeltas(args);\n\n this._resizeWidth(deltas.deltaX, deltas.initialDeltaX);\n this.showResizeHandles();\n },\n\n _onResizeHandleDragLocked: function(args) {\n var min = Math.min(Math.abs(args.initialDeltaX), Math.abs(args.initialDeltaY)),\n initialWidth = this._initialElementWidth,\n initialHeight = this._initialElementHeight,\n deltas;\n\n if (min === args.initialDeltaX || min === args.initialDeltaX * -1) {\n args.initialDeltaY = args.initialDeltaX * initialHeight / initialWidth;\n args.deltaY = args.deltaX;\n } else if (min === args.initialDeltaY || min === args.initialDeltaY * -1) {\n args.initialDeltaX = args.initialDeltaY * initialWidth / initialHeight;\n args.deltaX = args.deltaY;\n }\n\n deltas = this._getDeltas(args);\n\n this._resizeWidth(deltas.deltaX, deltas.initialDeltaX);\n this._resizeHeight(deltas.deltaY, deltas.initialDeltaY);\n\n this.showResizeHandles();\n },\n\n _resizeWidth: function(delta, initialDelta) {\n var that = this;\n var element = $(that.element);\n var currentWidth = outerWidth(element);\n var newWidth;\n var constrainedWidth;\n\n if (delta === 0) {\n return;\n }\n\n if (isUndefined(that._initialElementWidth)) {\n that._initialElementWidth = currentWidth;\n }\n\n //use initial delta instead of delta as changing the width with a small value (e.g. 1px)\n //on each drag does not work due to browser calculation of computed styles\n constrainedWidth = constrain({\n value: that._initialElementWidth + initialDelta,\n min: that.options.minWidth,\n max: that._getMaxDimensionValue(WIDTH)\n });\n\n newWidth = toPixels(constrainedWidth);\n element[0].style[WIDTH] = newWidth;\n element.attr(WIDTH, Math.floor(constrainedWidth));\n },\n\n _resizeHeight: function(delta, initialDelta) {\n var that = this;\n var element = $(that.element);\n var currentHeight = outerHeight(element);\n var newHeight;\n var constrainedHeight;\n\n if (delta === 0) {\n return;\n }\n\n if (isUndefined(that._initialElementHeight)) {\n that._initialElementHeight = currentHeight;\n }\n\n //use initial delta instead of delta as changing the height with a small value (e.g. 1px)\n //on each drag does not work due to browser calculation of computed styles\n constrainedHeight = constrain({\n value: that._initialElementHeight + initialDelta,\n min: that.options.minHeight,\n max: Number.MAX_SAFE_INTEGER\n });\n\n newHeight = toPixels(constrainedHeight);\n element[0].style[HEIGHT] = newHeight;\n element.attr(HEIGHT, Math.floor(constrainedHeight));\n }\n });\n\n var ElementResizingFactory = Class.extend({\n create: function(editor) {\n var factory = this;\n\n $(editor.body)\n .on(\"dragstart\" + NS, function() {\n var nodes = RangeUtils.nodes(editor.getRange()),\n hasImg = false;\n\n nodes.forEach(function(node) {\n if (node.nodeName === \"IMG\") {\n hasImg = true;\n }\n });\n\n if (hasImg && nodes.length > 1) {\n editor.elementResizing._destroyResizeHandles();\n }\n })\n .on(DROP + NS, function() {\n setTimeout(function() {\n var image = RangeUtils.image(editor.getRange());\n\n if (image) {\n editor.elementResizing._destroyResizeHandles();\n editor.elementResizing.element = image;\n editor.elementResizing.showResizeHandles();\n }\n });\n })\n .on(MOUSE_DOWN + NS, TABLE + COMMA + IMG, function(e) {\n var eventTarget = e.target;\n var eventCurrentTarget = e.currentTarget;\n var elementResizing = editor.elementResizing;\n var element = elementResizing ? elementResizing.element : null;\n\n if (elementResizing) {\n if (element && eventCurrentTarget !== element) {\n if (contains(eventCurrentTarget, element) && element !== eventTarget && contains(element, eventTarget)) {\n //prevent a parent table resizing init when clicking on a nested table when the event bubbles\n //instead of stopping event propagation\n return;\n }\n else {\n if (element !== eventTarget) {\n editor._destroyElementResizing();\n factory._initResizing(editor, eventCurrentTarget);\n }\n }\n }\n }\n else {\n factory._initResizing(editor, eventCurrentTarget);\n }\n\n editor._showElementResizeHandles();\n })\n .on(MOUSE_DOWN + NS, function(e) {\n var elementResizing = editor.elementResizing;\n var element = elementResizing ? elementResizing.element : null;\n var target = e.target;\n var isResizeHandleOrChild = $(target).hasClass(RESIZE_HANDLE_WRAPPER_CLASS) || $(target).parents(DOT + RESIZE_HANDLE_WRAPPER_CLASS).length > 0;\n\n if (elementResizing && element !== target && !contains(element, target) && !isResizeHandleOrChild) {\n editor._destroyElementResizing();\n }\n });\n },\n\n dispose: function(editor) {\n $(editor.body).off(NS);\n },\n\n _initResizing: function(editor, element) {\n // table and image resizing is natively supported in IE\n // https://stackoverflow.com/questions/53831846/resizing-images-in-contenteditable-div-stopped-working-in-firefox\n // Enable custom resize handlers for FF too\n if (!browser.msie) {\n if ($(element).is(TABLE)) {\n editor.elementResizing = editor.tableResizing = new TableResizing(element, {\n appendHandlesTo: editor.body,\n rtl: kendo.support.isRtl(editor.element),\n rootElement: editor.body\n });\n } else if ($(element).is(IMG)) {\n editor.elementResizing = new ImageResizing(element, {\n appendHandlesTo: editor.body,\n rtl: kendo.support.isRtl(editor.element),\n rootElement: editor.body\n });\n }\n\n if (editor._showElementResizeHandlesProxy) {\n editor.unbind(SELECT, editor._showElementResizeHandlesProxy);\n editor.bind(SELECT, editor._showElementResizeHandlesProxy);\n }\n }\n }\n });\n\n ElementResizingFactory.current = new ElementResizingFactory();\n\n extend(Editor, {\n TableResizing: TableResizing,\n ImageResizing: ImageResizing,\n ElementResizing: ElementResizing,\n ElementResizingFactory: ElementResizingFactory\n });\n\n })(window.kendo);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n Editor = kendo.ui.editor,\n EditorUtils = Editor.EditorUtils,\n RangeUtils = Editor.RangeUtils,\n dom = Editor.Dom,\n registerTool = EditorUtils.registerTool,\n Command = Editor.Command;\n\n var tableFormatFinder = new Editor.BlockFormatFinder([{ tags: [\"table\"] }]);\n var cellsFormatFinder = new Editor.BlockFormatFinder([{ tags: [\"td\",\"th\"] }]);\n var reUnit = /([a-z]+|%)$/i;\n\n var COL = \"col\";\n var ROW = \"row\";\n var COLGROUP = \"colgroup\";\n var SCOPE = \"scope\";\n var COL_INDEX = \"col-index\";\n var TH = \"th\";\n var TD = \"td\";\n var THEAD = \"thead\";\n var HEADERS = \"headers\";\n var TABLE = \"table\";\n\n var TableWizardCommand = Command.extend({\n exec: function() {\n var cmd = this;\n var editor = cmd.editor;\n var range = cmd.range = cmd.lockRange();\n var isTableCellWizard = cmd.options.tableCellWizard;\n var selectedTable = cmd._sourceTable = !cmd.options.insertNewTable ? cmd._selectedTable(range) : undefined$1;\n var selectedCells = cmd._selectedTableCells = selectedTable ? cmd._selectedCells(range) : undefined$1;\n var options = {\n visible: false,\n messages: editor.options.messages,\n closeCallback: cmd.onDialogClose.bind(cmd),\n table: cmd.parseTable(selectedTable, selectedCells),\n dialogOptions: editor.options.dialogOptions,\n isRtl: kendo.support.isRtl(editor.wrapper)\n };\n\n var dialog = new Editor.TableWizardDialog(options);\n dialog.open(isTableCellWizard);\n },\n\n onDialogClose: function(data) {\n var cmd = this;\n cmd.releaseRange(cmd.range);\n\n if (data) { //Ok button pressed\n if (cmd.options.insertNewTable) {\n cmd.insertTable(cmd.createNewTable(data));\n } else {\n cmd.updateTable(data, cmd._sourceTable, cmd._selectedTableCells);\n }\n }\n },\n releaseRange: function(range) {\n var cmd = this;\n var doc = cmd.editor.document;\n dom.windowFromDocument(doc).focus();\n Command.fn.releaseRange.call(cmd, range);\n },\n insertTable: function(table) {\n var range = this.range;\n\n range.insertNode(table);\n range.collapse(true);\n this.editor.selectRange(range);\n\n this._ensureFocusableAfterTable(table);\n },\n _ensureFocusableAfterTable: function(table) {\n var siblingNodes = $(table).parent().contents();\n var lastSiblingIndex = siblingNodes.length - 1;\n var lastSibling = siblingNodes.get(lastSiblingIndex);\n\n while (lastSibling.nodeValue !== null && (lastSibling.nodeValue === \" \" || lastSibling.nodeValue === \"\")) {\n lastSiblingIndex -= 1;\n lastSibling = siblingNodes.get(lastSiblingIndex);\n }\n\n if (lastSibling === table) {\n dom.insertAfter(dom.createEmptyNode(this.editor.document, \"p\"), table);\n }\n },\n updateTable: function(data, table, selectedCells) {\n var cmd = this;\n var tableRows = $(table.rows).toArray();\n var tableProp = data.tableProperties;\n var rows = tableProp.rows;\n var tHead = table.tHead;\n var last = cmd._lastInCollection;\n var lastSelectedRow, cellProp;\n\n //Leave only first selected cell\n while (selectedCells.length > 1) {\n selectedCells.pop();\n }\n\n lastSelectedRow = selectedCells.length ? last(selectedCells).parentNode : last(tableRows);\n\n cmd._deleteTableRows(tableRows, tableRows.length - rows);\n\n if (tableRows.length < rows) {\n cmd._addRows(lastSelectedRow, rows, tableRows);\n }\n\n dom.reMapTableColumns(table, COL_INDEX);\n cmd._updateColumns(tableRows, tableProp.columns, selectedCells, lastSelectedRow);\n cmd._updateTableProperties(table, tableProp);\n\n cellProp = data.cellProperties;\n if (selectedCells[0]) {\n dom.attr(selectedCells[0], { id: (cellProp || {}).id || null });\n }\n if (cellProp) {\n (cellProp.selectAllCells ? $(tableRows).children() : $(selectedCells)).each(function(i, cell) {\n cmd._updateCellProperties(cell, cellProp);\n });\n }\n\n cmd._updateCaption(table, tableProp);\n\n if (tHead) {\n cmd._updateHeadersWithThead(table, data);\n } else {\n cmd._updateHeadersNoThead(table, data);\n }\n\n cmd._updateHeaderAssociates(table, tableProp);\n dom.clearTableMappings(table, COL_INDEX);\n },\n _isHeadingRow: function(row) {\n return dom.is(row.cells[0], TH) && dom.is(row.parentNode, THEAD);\n },\n _isHeadingCell: function(cell) {\n return dom.is(cell, TH);\n },\n cellsWithHeadersAssociated: function(table) {\n var cells = $(table.rows).children();\n var headingIds = [];\n var checkHeader = function(header) {\n return headingIds.indexOf(header) > -1;\n };\n\n cells.each(function(c, cell) {\n if (cell.id && dom.is(cell, TH)) {\n headingIds.push(cell.id);\n }\n });\n\n var associatedCells = cells.filter(function(c, cell) {\n var headersAttr = cell.getAttribute(HEADERS);\n var headersArray;\n\n if (headersAttr && !dom.is(cell, TH)) {\n headersArray = headersAttr.split(\" \");\n\n if (headersArray && headersArray.length > 0) {\n return headersArray.some(checkHeader);\n }\n }\n\n return false;\n });\n\n return !!associatedCells.length;\n },\n _insertCells: function(count, row, index) {\n index = isNaN(index) ? -1 : index;\n for (var i = 0, cell; i < count; i++) {\n cell = row.insertCell(index);\n cell.innerHTML = \" \";\n }\n },\n _deleteTableRows: function(rows, count) {\n for (var i = 0, row, rowParent; i < count; i++) {\n row = rows.pop();\n rowParent = row.parentNode;\n rowParent.removeChild(row);\n if (!rowParent.rows.length) {\n dom.remove(rowParent);\n }\n }\n },\n createNewTable: function(data) {\n var cmd = this;\n var doc = cmd.editor.document;\n var tableProp = data.tableProperties;\n var table = dom.create(doc, TABLE);\n var rowIndex = 0;\n var thead;\n\n cmd._updateTableProperties(table, tableProp);\n cmd._updateCaption(table, tableProp);\n\n if (tableProp.headerRows && tableProp.headerRows > 0) {\n thead = table.createTHead();\n cmd._createTableRows(data, thead, rowIndex, true);\n rowIndex += tableProp.headerRows;\n }\n\n var tbody = table.createTBody();\n cmd._createTableRows(data, tbody, rowIndex, false);\n\n dom.reMapTableColumns(table, COL_INDEX);\n\n if (tableProp.cellsWithHeaders === \"ids\") {\n dom.associateWithIds(table);\n } else if (tableProp.cellsWithHeaders === \"scope\") {\n cmd._addScopes(table, tableProp.headerRows, tableProp.headerColumns);\n }\n\n dom.clearTableMappings(table, COL_INDEX);\n\n return table;\n },\n _createTableRows: function(data, container, initialIndex, headerRows) {\n var cmd = this;\n var tableProp = data.tableProperties;\n var cellProp = data.cellProperties;\n var columns = tableProp.columns;\n var rows = headerRows ? tableProp.headerRows : tableProp.rows;\n var headerColumns = tableProp.headerColumns;\n\n for (var r = initialIndex, row; r < rows; r++) {\n row = container.insertRow();\n\n for (var c = 0, cell; c < columns; c++) {\n if (headerRows || headerColumns > c) {\n cell = document.createElement(TH);\n } else {\n cell = document.createElement(TD);\n }\n\n row.appendChild(cell);\n cell.innerHTML = \" \";\n if (cellProp && r === 0 && c === 0 && cellProp.id) {\n cell.id = cellProp.id;\n }\n\n cmd._updateCellProperties(cell, cellProp && (cellProp.selectAllCells || (r === 0 && c === 0)) ? cellProp : {});\n }\n }\n },\n _addRows: function(lastSelectedRow, rows, tableRows) {\n var cmd = this;\n var rowIndex = $(lastSelectedRow).index();\n var cellsLength = lastSelectedRow.cells.length;\n var newRowsCount = rows - tableRows.length;\n var parent = lastSelectedRow.parentNode;\n var row;\n\n while (newRowsCount) {\n row = parent.insertRow(rowIndex + 1);\n cmd._insertCells(cellsLength - row.cells.length, row);\n newRowsCount--;\n }\n },\n _updateColumns: function(tableRows, columns, selectedCells, lastSelectedRow) {\n var cmd = this;\n var last = cmd._lastInCollection;\n var firstRowLastCell = last(tableRows[0].cells);\n var numberOfColumns = Number(firstRowLastCell.getAttribute(COL_INDEX)) + firstRowLastCell.colSpan;\n\n if (numberOfColumns > columns) {\n $(tableRows).each(function(i, row) {\n var lastCurrentCell = last(row.cells);\n var rowColumns = Number(lastCurrentCell.getAttribute(COL_INDEX)) + lastCurrentCell.colSpan;\n\n while (rowColumns > columns) {\n if (lastCurrentCell.colSpan && lastCurrentCell.colSpan > 1) {\n lastCurrentCell.colSpan -= 1;\n } else {\n row.deleteCell(-1);\n }\n\n lastCurrentCell = last(row.cells);\n rowColumns = Number(lastCurrentCell.getAttribute(COL_INDEX)) + lastCurrentCell.colSpan;\n }\n });\n }\n\n if (numberOfColumns < columns) {\n var cellIndex = $(last(selectedCells) || last(lastSelectedRow.cells)).index();\n $(tableRows).each(function(i, row) {\n var lastCurrentCell = last(row.cells);\n cmd._insertCells(columns - Number(lastCurrentCell.getAttribute(COL_INDEX)) - lastCurrentCell.colSpan, row, cellIndex + 1);\n });\n }\n },\n _updateTableProperties: function(table, data) {\n var style = this._getStylesData(data);\n dom.attr(table, {\n cellSpacing: data.cellSpacing || null,\n cellPadding: data.cellPadding || null,\n className: data.className || null,\n id: data.id || null,\n summary: data.summary || null,\n style: style || null\n });\n $(table).addClass(\"k-table\");\n },\n _updateCellProperties: function(cell, data) {\n var style = this._getStylesData(data);\n style.padding = data.cellPadding || null;\n style.margin = data.cellMargin || null;\n dom.attr(cell, {\n style: style || null,\n className: data.className || null\n });\n },\n _updateCaption: function(table, data) {\n if (table.caption && !data.captionContent) {\n table.deleteCaption();\n } else if (data.captionContent) {\n var caption = table.createCaption();\n caption.innerHTML = data.captionContent;\n var alignment = this._getAlignmentData(data.captionAlignment);\n dom.attr(caption, {\n style: {\n textAlign: alignment.textAlign,\n verticalAlign: alignment.verticalAlign\n }\n });\n }\n },\n _updateHeadersNoThead: function(table, data) {\n var cmd = this;\n var tableProp = data.tableProperties;\n var rows = table.rows;\n var row, cells, cell, i, j;\n\n for (i = 0; i < rows.length; i++) {\n row = rows[i];\n cells = row.cells;\n\n for (j = 0; j < cells.length; j++) {\n cell = cells[j];\n if (!cmd._isHeadingCell(cell) && (i < tableProp.headerRows || tableProp.headerColumns > cell.getAttribute(COL_INDEX))) {\n dom.changeTag(cell, TH, false);\n } else if (cmd._isHeadingCell(cell) && i >= tableProp.headerRows && tableProp.headerColumns <= cell.getAttribute(COL_INDEX)) {\n dom.changeTag(cell, TD, false);\n }\n }\n }\n },\n _updateHeadersWithThead: function(table, data) {\n var cmd = this;\n var tableProp = data.tableProperties;\n var thead = table.tHead;\n var rowIndex = 0;\n var tbody = table.tBodies[0];\n var row, cell, i;\n\n if (!tbody) {\n tbody = table.createTBody();\n }\n\n if (tableProp.headerRows && tableProp.headerRows > 0) {\n if (!thead) {\n thead = table.createTHead();\n }\n\n while (thead.rows.length < tableProp.headerRows) {\n thead.appendChild(tbody.rows[0]);\n }\n\n while (thead.rows.length > tableProp.headerRows) {\n tbody.appendChild(thead.rows[0]);\n }\n\n cmd._swapToHeaderCells(thead);\n } else if (thead) {\n while (thead.rows.length > 0) {\n tbody.appendChild(thead.rows[thead.rows.length - 1]);\n }\n\n table.deleteTHead();\n }\n\n while (tbody.rows.length > rowIndex) {\n row = tbody.rows[rowIndex];\n for (i = 0; i < row.cells.length; i++) {\n cell = row.cells[i];\n if (cmd._isHeadingCell(cell) && tableProp.headerColumns <= cell.getAttribute(COL_INDEX)) {\n dom.changeTag(cell, TD, false);\n } else if (!cmd._isHeadingCell(cell) && tableProp.headerColumns > cell.getAttribute(COL_INDEX)) {\n dom.changeTag(cell, TH, false);\n }\n }\n rowIndex += 1;\n }\n },\n _updateHeaderAssociates: function(table, tableProp) {\n var cmd = this;\n\n if (tableProp.cellsWithHeaders === \"ids\") {\n if (!cmd.cellsWithHeadersAssociated(table)) {\n cmd._removeScopes(table);\n }\n dom.associateWithIds(table);\n } else if (tableProp.cellsWithHeaders === \"scope\") {\n if (cmd.cellsWithHeadersAssociated(table)) {\n cmd._removeAssociates(table);\n }\n cmd._addScopes(table, tableProp.headerRows, tableProp.headerColumns);\n } else {\n if (cmd.cellsWithHeadersAssociated(table)) {\n cmd._removeAssociates(table);\n } else {\n cmd._removeScopes(table);\n }\n }\n },\n _addScopes: function(table, headerRows, headerCols) {\n var rows = table.rows;\n var i, j, row, cell;\n\n for (i = 0; i < rows.length; i++) {\n row = rows[i];\n\n for (j = 0; j < row.cells.length; j++) {\n cell = row.cells[j];\n\n if (i < headerRows) {\n cell.setAttribute(SCOPE, COL);\n } else if (cell.getAttribute(COL_INDEX) < headerCols) {\n cell.setAttribute(SCOPE, ROW);\n }\n }\n }\n },\n _removeScopes: function(table) {\n $(table).find(TH).removeAttr(SCOPE);\n $(table).find(COL).remove();\n $(table).find(COLGROUP).remove();\n },\n _removeAssociates: function(table) {\n $(table).find(\"th, td\").removeAttr(\"id headers\");\n },\n _swapToHeaderCells: function(thead) {\n var tds = $(thead).find(\"td\");\n var swapCell = function(index, cell) {\n dom.changeTag(cell, TH, false);\n };\n tds.each(swapCell);\n },\n _getStylesData: function(data) {\n var that = this;\n var alignment = this._getAlignmentData(data.alignment);\n var whiteSpace = \"wrapText\" in data ? (data.wrapText ? \"\" : \"nowrap\") : null;\n\n return $.extend({\n width: data.width ? data.width + data.widthUnit : null,\n height: data.height ? data.height + data.heightUnit : null,\n textAlign: alignment.textAlign,\n verticalAlign: alignment.verticalAlign,\n backgroundColor: data.bgColor || \"\",\n borderWidth: data.borderWidth,\n borderStyle: data.borderStyle,\n borderColor: data.borderColor || \"\",\n borderCollapse: data.collapseBorders ? \"collapse\" : null,\n whiteSpace: whiteSpace\n }, that._getTablePositionData(data.position));\n },\n _getAlignmentData: function(alignment) {\n var textAlign = \"\";\n var verticalAlign = textAlign;\n\n if (alignment) {\n if (alignment.indexOf(\" \") != -1) {\n var align = alignment.split(\" \");\n textAlign = align[0];\n verticalAlign = align[1];\n } else {\n textAlign = alignment;\n }\n }\n return { textAlign: textAlign, verticalAlign: verticalAlign };\n },\n _getTablePositionData: function(position) {\n if (!position) {\n return {};\n }\n\n return { marginLeft: position != \"left\" ? \"auto\" : \"\", marginRight: position != \"right\" ? \"auto\" : \"\" };\n },\n parseTable: function(table, selectedCells) {\n if (!table) {\n return { tableProperties: {}, selectedCells: [] };\n }\n\n var cmd = this;\n var tStyle = table.style;\n var rows = table.rows;\n var caption = table.caption;\n var captionClone = $(caption ? caption.cloneNode(true) : undefined$1);\n captionClone.find(\".k-marker\").remove();\n\n var cssClass = table.className;\n cssClass = cssClass.replace(/^k-table\\s|\\sk-table$/, \"\");\n cssClass = cssClass.replace(/\\sk-table\\s/, \" \");\n cssClass = cssClass.replace(/^k-table$/, \"\");\n\n var tableAlignment = cmd._getAlignment(table, true);\n var tablePosition = cmd._getTablePosition(table);\n var captionAlignment = caption ? cmd._getAlignment(caption) : undefined$1;\n var numberOfHeaderRows = dom._getNumberOfHeaderRows(table);\n\n var cellsWithHeaders;\n if (cmd.cellsWithHeadersAssociated(table)) {\n cellsWithHeaders = \"ids\";\n } else if ($(table).find(\"th[scope]\").length > 0) {\n cellsWithHeaders = \"scope\";\n } else {\n cellsWithHeaders = \"none\";\n }\n\n dom.reMapTableColumns(table, COL_INDEX);\n var numberOfColumns = dom._getNumberOfColumns(table);\n var numberOfHeaderColumns = dom._getNumberOfHeaderColumns(table, numberOfHeaderRows);\n dom.clearTableMappings(table, COL_INDEX);\n\n var tableJson = {\n tableProperties: {\n width: tStyle.width || table.width ? parseFloat(tStyle.width || table.width) : null,\n height: tStyle.height || table.height ? parseFloat(tStyle.height || table.height) : null,\n columns: numberOfColumns,\n rows: rows.length,\n widthUnit: cmd._getUnit(tStyle.width),\n heightUnit: cmd._getUnit(tStyle.height),\n cellSpacing: table.cellSpacing,\n cellPadding: table.cellPadding,\n alignment: tableAlignment.textAlign,\n position: tablePosition,\n bgColor: tStyle.backgroundColor || table.bgColor,\n className: cssClass,\n id: table.id,\n borderWidth: tStyle.borderWidth || table.border,\n borderColor: tStyle.borderColor,\n borderStyle: tStyle.borderStyle || \"\",\n collapseBorders: !!tStyle.borderCollapse,\n summary: table.summary,\n captionContent: caption ? captionClone.html() : \"\",\n captionAlignment: caption && captionAlignment.textAlign ? captionAlignment.textAlign + \" \" + captionAlignment.verticalAlign : \"\",\n headerRows: numberOfHeaderRows,\n headerColumns: numberOfHeaderColumns,\n cellsWithHeaders: cellsWithHeaders\n },\n selectedCells: []\n };\n\n tableJson.rows = cmd.parseTableRows(rows, selectedCells, tableJson);\n\n return tableJson;\n },\n parseTableRows: function(rows, selectedCells, tableJson) {\n var cmd = this;\n var data = [], row, rowData, cells, cell, cellData;\n for (var i = 0; i < rows.length; i++) {\n row = rows[i];\n rowData = { cells: [] };\n cells = row.cells;\n data.push(rowData);\n for (var j = 0; j < cells.length; j++) {\n cell = cells[j];\n cellData = cmd.parseCell(cell);\n if ($.inArray(cell, selectedCells) != -1) {\n tableJson.selectedCells.push(cellData);\n }\n rowData.cells.push(cellData);\n }\n }\n return data;\n },\n parseCell: function(cell) {\n var cmd = this;\n var cStyle = cell.style;\n var alignment = cmd._getAlignment(cell);\n alignment = alignment.textAlign ? alignment.textAlign + \" \" + alignment.verticalAlign : \"\";\n\n var data = {\n width: cStyle.width || cell.width ? parseFloat(cStyle.width || cell.width) : null,\n height: cStyle.height || cell.height ? parseFloat(cStyle.height || cell.height) : null,\n widthUnit: cmd._getUnit(cStyle.width),\n heightUnit: cmd._getUnit(cStyle.height),\n cellMargin: cStyle.margin,\n cellPadding: cStyle.padding,\n alignment: alignment,\n bgColor: cStyle.backgroundColor || cell.bgColor,\n className: cell.className,\n id: cell.id,\n borderWidth: cStyle.borderWidth || cell.border,\n borderColor: cStyle.borderColor,\n borderStyle: cStyle.borderStyle,\n wrapText: cStyle.whiteSpace != \"nowrap\"\n };\n\n return data;\n },\n _getTablePosition: function(element) {\n var style = element.style;\n if (style.marginLeft == \"auto\" && style.marginRight == \"auto\") {\n return \"center\";\n }\n\n if (style.marginLeft == \"auto\") {\n return \"right\";\n }\n\n return \"left\";\n },\n _getAlignment: function(element, horizontalOnly) {\n var style = element.style;\n var hAlign = style.textAlign || element.align || \"\";\n if (horizontalOnly) {\n return { textAlign: hAlign };\n }\n var vAlign = style.verticalAlign || element.vAlign || \"\";\n if (hAlign && vAlign) {\n return { textAlign: hAlign, verticalAlign: vAlign };\n }\n if (!hAlign && vAlign) {\n return { textAlign: \"left\", verticalAlign: vAlign };\n }\n if (hAlign && !vAlign) {\n return { textAlign: hAlign, verticalAlign: \"top\" };\n }\n return { textAlign: \"\", verticalAlign: \"\" };\n },\n _getUnit: function(value) {\n var unit = (value || \"\").match(reUnit);\n return unit ? unit[0] : \"px\";\n },\n _selectedTable: function(range) {\n var nodes = dom.filterBy(RangeUtils.nodes(range), dom.htmlIndentSpace, true);\n return tableFormatFinder.findSuitable(nodes)[0];\n },\n _selectedCells: function(range) {\n var nodes = dom.filterBy(RangeUtils.nodes(range), dom.htmlIndentSpace, true);\n return cellsFormatFinder.findSuitable(nodes);\n },\n _lastInCollection: function(collection) {\n return collection[collection.length - 1];\n }\n });\n\n var TableWizardTool = Editor.Tool.extend({\n command: function(options) {\n options.insertNewTable = this.options.insertNewTable;\n options.tableCellWizard = !!this.options.tableCellWizard;\n return new TableWizardCommand(options);\n }\n });\n\n var TableWizardEditTool = TableWizardTool.extend({\n update: function(ui, nodes) {\n var isFormatted = !tableFormatFinder.isFormatted(nodes),\n toolbar = ui.closest(\".k-toolbar\").getKendoToolBar();\n\n if (isFormatted === true) {\n toolbar.hide(ui);\n } else {\n toolbar.show(ui);\n }\n }\n });\n\n var TableCellWizardEditTool = TableWizardTool.extend({\n update: function(ui, nodes) {\n var isFormatted = !tableFormatFinder.isFormatted(nodes),\n toolbar = ui.closest(\".k-toolbar\").getKendoToolBar();\n\n if (isFormatted === true) {\n toolbar.hide(ui);\n } else {\n toolbar.show(ui);\n }\n }\n });\n\n kendo.ui.editor.TableWizardTool = TableWizardTool;\n kendo.ui.editor.TableWizardCommand = TableWizardCommand;\n\n registerTool(\"tableProperties\", new TableWizardEditTool({ command: TableWizardCommand, insertNewTable: false, property: \"tableProperties\" }));\n registerTool(\"tableCellProperties\", new TableCellWizardEditTool({ command: TableWizardCommand, tableCellWizard: true, insertNewTable: false, property: \"tableCellProperties\" }));\n\n })(window.kendo.jQuery);\n\n (function($, undefined$1) {\n\n var kendo = window.kendo,\n encode = kendo.htmlEncode,\n numericTextBoxSettings = { format: \"0\", min: 0 },\n units = [\"px\", \"em\"],\n borderStyles = [\"solid\", \"dotted\", \"dashed\", \"double\", \"groove\", \"ridge\", \"inset\", \"outset\", \"initial\", \"inherit\", \"none\", \"hidden\"];\n\n var DEFAULT_NUMBER_OF_COLS_AND_ROWS = 4;\n\n var textWrapDropDownSettings = {\n dataSource: [{\n className: \"text-wrap\",\n value: \"wrap\"\n }, {\n className: \"parameter-string\",\n value: \"nowrap\"\n }],\n dataTextField: \"className\",\n dataValueField: \"value\",\n template: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className) }) + encode(tooltip);\n },\n valueTemplate: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className), iconClass: \"k-text-wrap\" }) + encode(tooltip);\n }\n };\n\n var tablePositionDropDownSettings = {\n dataSource: [{\n className: \"table-position-start\",\n value: \"left\"\n }, {\n className: \"table-position-center\",\n value: \"center\"\n }, {\n className: \"table-position-end\",\n value: \"right\"\n }],\n dataTextField: \"className\",\n dataValueField: \"value\",\n template: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className) }) + encode(tooltip);\n },\n valueTemplate: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className), iconClass: \"k-align-group\" }) + encode(tooltip);\n }\n };\n\n var tableAlignmentDropDownSettings = {\n dataSource: [{\n className: \"table-align-middle-left\",\n value: \"left\"\n }, {\n className: \"table-align-middle-center\",\n value: \"center\"\n }, {\n className: \"table-align-middle-right\",\n value: \"right\"\n }, {\n className: \"align-remove\",\n value: \"\"\n }],\n dataTextField: \"className\",\n dataValueField: \"value\",\n template: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className) }) + encode(tooltip);\n },\n valueTemplate: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className), iconClass: \"k-align-group\" }) + encode(tooltip);\n }\n };\n\n var cellAlignmentDropDownSettings = {\n dataSource: [{\n className: \"table-align-top-left\",\n value: \"left top\"\n }, {\n className: \"table-align-top-center\",\n value: \"center top\"\n }, {\n className: \"table-align-top-right\",\n value: \"right top\"\n }, {\n className: \"table-align-middle-left\",\n value: \"left middle\"\n }, {\n className: \"table-align-middle-center\",\n value: \"center middle\"\n }, {\n className: \"table-align-middle-right\",\n value: \"right middle\"\n }, {\n className: \"table-align-bottom-left\",\n value: \"left bottom\"\n }, {\n className: \"table-align-bottom-center\",\n value: \"center bottom\"\n }, {\n className: \"table-align-bottom-right\",\n value: \"right bottom\"\n }, {\n className: \"align-remove\",\n value: \"\"\n }],\n dataTextField: \"className\",\n dataValueField: \"value\",\n template: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className) }) + encode(tooltip);\n },\n valueTemplate: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className), iconClass: \"k-align-group\" }) + encode(tooltip);\n }\n };\n\n var accessibilityAlignmentDropDownSettings = {\n dataSource: [{\n className: \"table-align-top-left\",\n value: \"left top\"\n }, {\n className: \"table-align-top-center\",\n value: \"center top\"\n }, {\n className: \"table-align-top-right\",\n value: \"right top\"\n }, {\n className: \"table-align-bottom-left\",\n value: \"left bottom\"\n }, {\n className: \"table-align-bottom-center\",\n value: \"center bottom\"\n }, {\n className: \"table-align-bottom-right\",\n value: \"right bottom\"\n }, {\n className: \"align-remove\",\n value: \"\"\n }],\n dataTextField: \"className\",\n dataValueField: \"value\",\n template: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className) });\n },\n valueTemplate: function (ref) {\n var className = ref.className;\n var tooltip = ref.tooltip;\n\n return kendo.ui.icon($((\"\")), { icon: encode(className), iconClass: \"k-align-group\" });\n }\n };\n\n var tablePropertiesDialogTemplate = function (ref) {\n var messages = ref.messages;\n\n return '
    ' +\n '
    ' +\n '
      ' +\n \"
    • \" + (messages.tableTab) + \"
    • \" +\n \"
    • \" + (messages.accessibilityTab) + \"
    • \" +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n kendo.html.renderButton((\"\"), {\n icon: 'check',\n themeColor: \"primary\"\n }) +\n kendo.html.renderButton((\"\"), {\n icon: 'cancel-outline'\n }) +\n '
    ' +\n '
    ';\n };\n var cellPropertiesDialogTemplate = function (ref) {\n var messages = ref.messages;\n\n return '
    ' +\n '
    ' +\n '
    ' +\n kendo.html.renderButton((\"\"), {\n icon: 'check',\n themeColor: \"primary\"\n }) +\n kendo.html.renderButton((\"\"), {\n icon: 'cancel-outline'\n }) +\n '
    ' +\n '
    ';\n };\n\n var TableWizardDialog = kendo.Class.extend({\n init: function(options) {\n this.options = options;\n },\n _openTablePropertiesDialog: function() {\n var that = this,\n options = that.options,\n dialogOptions = options.dialogOptions,\n tableData = options.table,\n dialog,\n messages = options.messages,\n isIE = kendo.support.browser.msie;\n\n function close(e) {\n e.preventDefault();\n that.destroy();\n dialog.destroy();\n }\n\n function okHandler(e) {\n that.collectTableDialogValues(tableData);\n\n close(e);\n\n if (that.change) {\n that.change();\n }\n\n options.closeCallback(tableData);\n }\n\n function closeHandler(e) {\n close(e);\n options.closeCallback();\n }\n\n dialogOptions.close = closeHandler;\n dialogOptions.minWidth = 400;\n dialogOptions.title = messages.tableProperties;\n dialogOptions.visible = options.visible;\n\n dialog = $(that._dialogTemplate(messages)).appendTo(document.body)\n .kendoWindow(dialogOptions)\n .addClass(\"k-editor-window\")\n .closest(\".k-window\").toggleClass(\"k-rtl\", options.isRtl).end()\n .find(\".k-dialog-ok\").on(\"click\", okHandler).end()\n .find(\".k-dialog-close\").on(\"click\", closeHandler).end()\n .data(\"kendoWindow\");\n\n var element = dialog.element;\n this.components = {};\n that._initTabStripComponent(element);\n that._tablePropertiesForm = that._createTablePropertiesForm(dialog, messages);\n that._accessibilityPropertiesForm = that._createAccessibilityPropertiesForm(dialog, messages);\n\n dialog.center();\n dialog.open();\n\n if (isIE) {\n var dialogHeight = element.closest(\".k-window\").height();\n element.css(\"max-height\", dialogHeight);\n }\n },\n _openCellPropertiesDialog: function() {\n var that = this,\n options = that.options,\n dialogOptions = options.dialogOptions,\n tableData = options.table,\n dialog,\n messages = options.messages,\n isIE = kendo.support.browser.msie;\n\n function close(e) {\n e.preventDefault();\n that.destroy();\n dialog.destroy();\n }\n\n function okHandler(e) {\n that.collectCellDialogValues(tableData);\n\n close(e);\n\n if (that.change) {\n that.change();\n }\n\n options.closeCallback(tableData);\n }\n\n function closeHandler(e) {\n close(e);\n options.closeCallback();\n }\n\n dialogOptions.close = closeHandler;\n dialogOptions.minWidth = 400;\n dialogOptions.title = messages.tableCellProperties;\n dialogOptions.visible = options.visible;\n\n dialog = $(that._dialogTemplate(messages, cellPropertiesDialogTemplate)).appendTo(document.body)\n .kendoWindow(dialogOptions)\n .addClass(\"k-editor-window\")\n .closest(\".k-window\").toggleClass(\"k-rtl\", options.isRtl).end()\n .find(\".k-dialog-ok\").on(\"click\", okHandler).end()\n .find(\".k-dialog-close\").on(\"click\", closeHandler).end()\n .data(\"kendoWindow\");\n\n var element = dialog.element;\n that._cellPropertiesForm = that._createCellPropertiesForm(dialog, messages);\n\n dialog.center();\n dialog.open();\n\n if (isIE) {\n var dialogHeight = element.closest(\".k-window\").height();\n element.css(\"max-height\", dialogHeight);\n }\n },\n open: function(isCellProperties) {\n if (!isCellProperties) {\n this._openTablePropertiesDialog();\n } else {\n this._openCellPropertiesDialog();\n }\n },\n\n _initTabStripComponent: function(element) {\n var components = this.components = {};\n components.tabStrip = element.find(\"#k-table-wizard-tabs\").kendoTabStrip({\n animation: false\n }).data(\"kendoTabStrip\");\n },\n\n collectTableDialogValues: function() {\n var that = this;\n var data = that.options.table;\n that._collectTableViewValues(data);\n that._collectAccessibilityViewValues(data);\n },\n\n collectCellDialogValues: function() {\n var that = this;\n var data = that.options.table;\n that._collectCellViewValues(data);\n },\n\n _collectTableViewValues: function(tableData) {\n var tableView = this.components.tableView;\n var tableProperties = tableData.tableProperties;\n var cellData = tableData.cellProperties = tableData.cellProperties || {};\n tableProperties.width = tableView.width.value();\n tableProperties.widthUnit = tableView.widthUnit.value();\n tableProperties.height = tableView.height.value();\n tableProperties.columns = tableView.columns.value();\n tableProperties.rows = tableView.rows.value();\n tableProperties.heightUnit = tableView.heightUnit.value();\n tableProperties.cellSpacing = tableView.cellSpacing.value();\n tableProperties.cellPadding = tableView.cellPadding.value();\n tableProperties.alignment = tableView.alignment.value();\n tableProperties.position = tableView.position.value();\n tableProperties.bgColor = tableView.bgColor.value();\n tableProperties.borderWidth = tableView.borderWidth.value();\n tableProperties.borderColor = tableView.borderColor.value();\n tableProperties.borderStyle = tableView.borderStyle.value();\n tableProperties.collapseBorders = tableView.collapseBorders.check();\n\n if (!cellData.width) {\n cellData.selectAllCells = true;\n cellData.width = 100 / tableData.tableProperties.columns;\n cellData.widthUnit = \"%\";\n }\n },\n\n _collectCellViewValues: function(table) {\n var cellData = table.cellProperties = table.cellProperties || {};\n var cellView = this.components.cellView;\n\n cellData.selectAllCells = cellView.selectAllCells.check();\n cellData.width = cellView.width.value();\n cellData.widthUnit = cellView.widthUnit.value();\n cellData.height = cellView.height.value();\n cellData.heightUnit = cellView.heightUnit.value();\n cellData.cellMargin = cellView.cellMargin.value();\n cellData.cellPadding = cellView.cellPadding.value();\n cellData.alignment = cellView.alignment.value();\n cellData.bgColor = cellView.bgColor.value();\n cellData.className = cellView.className.value();\n cellData.id = cellView.id.value();\n cellData.borderWidth = cellView.borderWidth.value();\n cellData.borderColor = cellView.borderColor.value();\n cellData.borderStyle = cellView.borderStyle.value();\n cellData.wrapText = cellView.wrapTextValue.value() == \"wrap\";\n\n if (!cellData.width) {\n cellData.selectAllCells = true;\n cellData.width = 100 / table.tableProperties.columns;\n cellData.widthUnit = \"%\";\n }\n },\n\n _collectAccessibilityViewValues: function(table) {\n var tableProperties = table.tableProperties;\n var accessibilityView = this.components.accessibilityView;\n tableProperties.captionContent = accessibilityView.captionContent.value();\n tableProperties.captionAlignment = accessibilityView.captionAlignment.value();\n tableProperties.summary = accessibilityView.summary.value();\n tableProperties.cellsWithHeaders = accessibilityView.cellsWithHeaders.value();\n tableProperties.className = accessibilityView.className.value();\n tableProperties.id = accessibilityView.id.value();\n tableProperties.headerRows = accessibilityView.headerRows.value();\n tableProperties.headerColumns = accessibilityView.headerColumns.value();\n },\n _addUnit: function(units, value) {\n if (value && $.inArray(value, units) == -1) {\n units.push(value);\n }\n },\n\n _initNumericTextbox: function(element, property, data, storage, settings) {\n var component = storage[property] = element.kendoNumericTextBox(\n settings ? $.extend({}, numericTextBoxSettings, settings) : numericTextBoxSettings\n ).data(\"kendoNumericTextBox\");\n if (property in data) {\n component.value(parseInt(data[property], 10));\n }\n },\n\n _initDropDownList: function(element, property, data, storage, dataSource) {\n var component = storage[property] = element.kendoDropDownList({\n dataSource: dataSource\n }).data(\"kendoDropDownList\");\n this._setComponentValue(component, data, property);\n },\n\n _initBorderStyleDropDown: function(element, property, data, storage, dataSource) {\n var component = storage[property] = element.kendoDropDownList({\n dataSource: dataSource,\n optionLabel: this.options.messages.borderNone\n }).data(\"kendoDropDownList\");\n this._setComponentValue(component, data, property);\n },\n\n _initTablePositionDropDown: function(element, data) {\n var messages = this.options.messages;\n var tableView = this.components.tableView;\n var dataSource = tablePositionDropDownSettings.dataSource;\n dataSource[0].tooltip = messages.tableAlignLeft;\n dataSource[1].tooltip = messages.tableAlignCenter;\n dataSource[2].tooltip = messages.tableAlignRight;\n\n this._initPositionDropDown(element, tablePositionDropDownSettings, \"position\", data, tableView);\n },\n\n _initTableAlignmentDropDown: function(element, data) {\n var messages = this.options.messages;\n var tableView = this.components.tableView;\n var dataSource = tableAlignmentDropDownSettings.dataSource;\n dataSource[0].tooltip = messages.alignLeft;\n dataSource[1].tooltip = messages.alignCenter;\n dataSource[2].tooltip = messages.alignRight;\n dataSource[3].tooltip = messages.alignRemove;\n\n this._initAlignmentDropDown(element, tableAlignmentDropDownSettings, \"alignment\", data, tableView);\n },\n\n _initCellAlignmentDropDown: function(element, data) {\n var messages = this.options.messages;\n var cellView = this.components.cellView;\n var dataSource = cellAlignmentDropDownSettings.dataSource;\n dataSource[0].tooltip = messages.alignLeftTop;\n dataSource[1].tooltip = messages.alignCenterTop;\n dataSource[2].tooltip = messages.alignRightTop;\n dataSource[3].tooltip = messages.alignLeftMiddle;\n dataSource[4].tooltip = messages.alignCenterMiddle;\n dataSource[5].tooltip = messages.alignRightMiddle;\n dataSource[6].tooltip = messages.alignLeftBottom;\n dataSource[7].tooltip = messages.alignCenterBottom;\n dataSource[8].tooltip = messages.alignRightBottom;\n dataSource[9].tooltip = messages.alignRemove;\n\n this._initAlignmentDropDown(element, cellAlignmentDropDownSettings, \"alignment\", data, cellView);\n },\n\n _initAccessibilityAlignmentDropDown: function(element, data) {\n var messages = this.options.messages;\n var accessibilityView = this.components.accessibilityView;\n var dataSource = accessibilityAlignmentDropDownSettings.dataSource;\n dataSource[0].tooltip = messages.alignLeftTop;\n dataSource[1].tooltip = messages.alignCenterTop;\n dataSource[2].tooltip = messages.alignRightTop;\n dataSource[3].tooltip = messages.alignLeftBottom;\n dataSource[4].tooltip = messages.alignCenterBottom;\n dataSource[5].tooltip = messages.alignRightBottom;\n dataSource[6].tooltip = messages.alignRemove;\n\n this._initAlignmentDropDown(element, accessibilityAlignmentDropDownSettings, \"captionAlignment\", data, accessibilityView);\n },\n _initTextWrapDropDown: function(element, data) {\n var messages = this.options.messages;\n var name = \"wrapTextValue\";\n data.wrapTextValue = data.wrapText ? \"wrap\" : \"nowrap\";\n\n var cellView = this.components.cellView;\n var dataSource = textWrapDropDownSettings.dataSource;\n dataSource[0].tooltip = messages.wrapText;\n dataSource[1].tooltip = messages.fitToCell;\n var component = cellView[name] =\n element.kendoDropDownList(textWrapDropDownSettings).data(\"kendoDropDownList\");\n\n component.list.addClass('k-text-wrap');\n this._setComponentValue(component, data, name);\n },\n _initPositionDropDown: function(element, settings, name, data, storage) {\n var component = storage[name] =\n element.kendoDropDownList(settings).data(\"kendoDropDownList\");\n\n component.list.addClass('k-position');\n this._setComponentValue(component, data, name);\n },\n _initAlignmentDropDown: function(element, settings, name, data, storage) {\n var component = storage[name] =\n element.kendoDropDownList(settings).data(\"kendoDropDownList\");\n\n component.list.addClass('k-align');\n this._setComponentValue(component, data, name);\n },\n _initAssociationDropDown: function(element, name, settings, data, storage) {\n var component = storage[name] =\n element.kendoDropDownList(settings).data(\"kendoDropDownList\");\n\n this._setComponentValue(component, data, name);\n },\n _setComponentValue: function(component, data, property) {\n if (property in data) {\n component.value(data[property]);\n }\n },\n\n _initColorPicker: function(element, property, data, storage) {\n var component = storage[property] =\n element.kendoColorPicker({ buttons: false, clearButton: true }).data(\"kendoColorPicker\");\n\n if (data[property]) {\n component.value(data[property]);\n }\n },\n _initInput: function(element, property, data, storage, settings) {\n var component = storage[property] = element.kendoTextBox(settings || {}).data(\"kendoTextBox\");\n if (property in data) {\n component.value(data[property]);\n }\n },\n\n _initCheckbox: function(element, property, data, storage, settings) {\n var component = storage[property] = element.kendoCheckBox(settings || {}).data(\"kendoCheckBox\");\n if (property in data) {\n component.check(data[property]);\n }\n },\n\n _initTextArea: function(element, property, data, storage, settings) {\n var component = storage[property] = element.kendoTextArea(settings || {}).data(\"kendoTextArea\");\n if (property in data) {\n component.value(data[property]);\n }\n },\n\n destroy: function() {\n var that = this;\n that._destroyComponents(this.components);\n\n delete that.components;\n },\n _destroyComponents: function(components) {\n for (var widget in components) {\n if (components[widget].destroy) {\n components[widget].destroy();\n }\n delete components[widget];\n }\n },\n\n _dialogTemplate: function(messages, dialogTemplate) {\n return kendo.template(dialogTemplate || tablePropertiesDialogTemplate)({ messages: messages });\n },\n\n _onColumnsNumberChange: function(args) {\n var that = this;\n var accessibilityView = that.components.accessibilityView;\n var headerColumnsNumeric = accessibilityView.headerColumns;\n var currentNumberOfColumnsHeaders = headerColumnsNumeric.value();\n var numberOfColumns = args.sender.value();\n\n if (numberOfColumns < currentNumberOfColumnsHeaders) {\n headerColumnsNumeric.value(numberOfColumns);\n }\n\n headerColumnsNumeric.max(numberOfColumns);\n },\n\n _onRowsNumberChange: function(args) {\n var that = this;\n var accessibilityView = that.components.accessibilityView;\n var headerRowsNumeric = accessibilityView.headerRows;\n var currentNumberOfRowHeaders = headerRowsNumeric.value();\n var numberOfRows = args.sender.value();\n\n if (numberOfRows < currentNumberOfRowHeaders) {\n headerRowsNumeric.value(numberOfRows);\n }\n\n headerRowsNumeric.max(numberOfRows);\n },\n\n _createTablePropertiesForm: function(dialog, messages) {\n var that = this;\n var table = that.options.table;\n var formElement = dialog.element.find(\"#k-table-properties\");\n var components = that.components;\n var tableView = components.tableView = {};\n var tableProperties = table.tableProperties = table.tableProperties || {};\n var form;\n\n that._addUnit(units, tableProperties.widthUnit);\n that._addUnit(units, tableProperties.heightUnit);\n tableProperties.borderStyle = tableProperties.borderStyle || \"\";\n form = formElement.kendoForm({\n renderButtons: false,\n layout: \"grid\",\n grid: {\n cols: 4\n },\n items: [\n {\n colSpan: 2,\n field: \"k-editor-table-columns\",\n label: encode(messages.columns),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container),\n \"columns\",\n tableProperties,\n tableView,\n {\n min: 1,\n value: DEFAULT_NUMBER_OF_COLS_AND_ROWS,\n change: that._onColumnsNumberChange.bind(that)\n });\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-rows\",\n label: encode(messages.rows),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container),\n \"rows\",\n tableProperties,\n tableView,\n {\n min: 1,\n value: DEFAULT_NUMBER_OF_COLS_AND_ROWS,\n change: that._onRowsNumberChange.bind(that)\n });\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-width\",\n label: encode(messages.width),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"width\", tableProperties, tableView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-width-type\",\n label: {\n encoded: false,\n text: ' '\n },\n editor: function(container, options) {\n that._initDropDownList($((\"\")).appendTo(container),\n \"widthUnit\",\n tableProperties,\n tableView,\n units);\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-height\",\n label: encode(messages.height),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"height\", tableProperties, tableView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-height-type\",\n label: {\n encoded: false,\n text: ' '\n },\n editor: function(container, options) {\n that._initDropDownList($((\"\")).appendTo(container),\n \"heightUnit\",\n tableProperties,\n tableView,\n units);\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-position\",\n label: encode(messages.position),\n editor: function(container, options) {\n that._initTablePositionDropDown($('').appendTo(container), tableProperties);\n }\n },\n {\n colSpan: 2,\n field: \"k-editor-table-alignment\",\n label: encode(messages.alignment),\n editor: function(container, options) {\n that._initTableAlignmentDropDown($('').appendTo(container), tableProperties);\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-cell-spacing\",\n label: encode(messages.cellSpacing),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"cellSpacing\", tableProperties, tableView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-cell-padding\",\n label: encode(messages.cellPadding),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"cellPadding\", tableProperties, tableView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-table-bg\",\n label: encode(messages.tableBackground),\n editor: function(container, options) {\n that._initColorPicker($('').appendTo(container), \"bgColor\", tableProperties, tableView);\n }\n },{\n colSpan: 1,\n field: \"k-editor-border-width\",\n label: encode(messages.borderWidth),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"borderWidth\", tableProperties, tableView);\n }\n },{\n colSpan: 1,\n field: \"k-editor-border-color\",\n label: encode(messages.borderColor),\n editor: function(container, options) {\n that._initColorPicker($('').appendTo(container), \"borderColor\", tableProperties, tableView);\n }\n },{\n colSpan: 2,\n field: \"k-editor-border-style\",\n label: encode(messages.borderStyle),\n editor: function(container, options) {\n that._initBorderStyleDropDown($('').appendTo(container),\n \"borderStyle\",\n tableProperties,\n tableView,\n borderStyles);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-collapse-borders\",\n label: \"\",\n editor: function(container, options) {\n that._initCheckbox($('').appendTo(container), \"collapseBorders\", tableProperties, tableView, { label: encode(messages.collapseBorders) });\n }\n } ]\n }).data(\"kendoForm\");\n form.layoutWrapper.addClass(\"k-gap-x-4\");\n\n return form;\n },\n\n _createCellPropertiesForm: function(dialog, messages) {\n var that = this;\n var table = that.options.table;\n var formElement = dialog.element.find(\"#k-cell-properties\");\n var components = that.components = that.components || {};\n var cellView = components.cellView = {};\n var cellProperties = (table.selectedCells && table.selectedCells[0]) || { borderStyle: \"\", wrapText: true };\n var form;\n\n that._addUnit(units, cellProperties.widthUnit);\n that._addUnit(units, cellProperties.heightUnit);\n form = formElement.kendoForm({\n renderButtons: false,\n layout: \"grid\",\n grid: {\n cols: 4\n },\n items: [\n {\n colSpan: \"full\",\n field: \"k-editor-selectAllCells\",\n label: \"\",\n editor: function(container, options) {\n that._initCheckbox($('').appendTo(container), \"selectAllCells\", table.tableProperties, cellView, { label: encode(messages.selectAllCells) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-width\",\n label: encode(messages.width),\n hint: encode(messages.applyToColumn),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"width\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-width-type\",\n label: {\n encoded: false,\n text: ' '\n },\n editor: function(container, options) {\n that._initDropDownList($((\"\")).appendTo(container),\n \"widthUnit\",\n cellProperties,\n cellView,\n units);\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-height\",\n label: encode(messages.height),\n hint: encode(messages.applyToRow),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"height\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-height-type\",\n label: {\n encoded: false,\n text: ' '\n },\n editor: function(container, options) {\n that._initDropDownList($((\"\")).appendTo(container),\n \"heightUnit\",\n cellProperties,\n cellView,\n units);\n }\n },{\n colSpan: 2,\n field: \"k-editor-cell-alignment\",\n label: encode(messages.alignment),\n editor: function(container, options) {\n that._initCellAlignmentDropDown($('').appendTo(container), cellProperties);\n }\n },{\n colSpan: 2,\n field: \"k-editor-wrap-text\",\n label: \"Text control\",\n editor: function(container, options) {\n that._initTextWrapDropDown($('').appendTo(container),\n cellProperties);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-cell-bg\",\n label: encode(messages.background),\n editor: function(container, options) {\n that._initColorPicker($('').appendTo(container), \"bgColor\", cellProperties, cellView);\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-cell-margin\",\n label: encode(messages.cellMargin),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"cellMargin\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 2,\n field: \"k-editor-table-cells-padding\",\n label: encode(messages.cellPadding),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"cellPadding\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-border-width\",\n label: encode(messages.borderWidth),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container), \"borderWidth\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 1,\n field: \"k-editor-cell-border-color\",\n label: encode(messages.borderColor),\n editor: function(container, options) {\n that._initColorPicker($('').appendTo(container), \"borderColor\", cellProperties, cellView, { placeholder: encode(messages.auto) });\n }\n },{\n colSpan: 2,\n field: \"k-editor-cell-border-style\",\n label: encode(messages.borderStyle),\n editor: function(container, options) {\n that._initBorderStyleDropDown($('').appendTo(container),\n \"borderStyle\",\n cellProperties,\n cellView,\n borderStyles);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-cell-id\",\n label: {\n text: encode(messages.id),\n optional: true\n },\n editor: function(container, options) {\n that._initInput($('').appendTo(container), \"id\", cellProperties, cellView);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-cell-css-class\",\n label: {\n text: encode(messages.cssClass),\n optional: true\n },\n editor: function(container, options) {\n that._initInput($('').appendTo(container), \"className\", cellProperties, cellView);\n }\n }\n ]\n }).data(\"kendoForm\");\n form.layoutWrapper.addClass(\"k-gap-x-4\");\n\n return form;\n },\n\n _createAccessibilityPropertiesForm: function(dialog, messages) {\n var that = this;\n var table = that.options.table;\n var formElement = dialog.element.find(\"#k-accessibility-properties\");\n var components = that.components;\n var accessibilityView = components.accessibilityView = {};\n var tableProperties = table.tableProperties;\n var form;\n\n form = formElement.kendoForm({\n renderButtons: false,\n layout: \"grid\",\n grid: {\n cols: 4\n },\n items: [\n {\n colSpan: \"full\",\n field: \"k-editor-id\",\n label: {\n text: encode(messages.id),\n optional: true\n },\n editor: function(container, options) {\n that._initInput($('').appendTo(container), \"id\", tableProperties, accessibilityView);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-css-class\",\n label: {\n text: encode(messages.cssClass),\n optional: true\n },\n editor: function(container, options) {\n that._initInput($('').appendTo(container), \"className\", tableProperties, accessibilityView);\n }\n },\n {\n layout: \"grid\",\n grid: {\n cols: 4,\n gutter: 16\n },\n colSpan: \"full\",\n type: \"group\",\n label: \"Accessibility\",\n items: [\n {\n colSpan: 2,\n field: \"k-editor-table-caption\",\n label: {\n text: encode(messages.caption),\n optional: true\n },\n editor: function(container, options) {\n that._initInput($('').appendTo(container), \"captionContent\", tableProperties, accessibilityView);\n }\n },{\n colSpan: 2,\n field: \"k-editor-accessibility-alignment\",\n label: encode(messages.captionAlignment),\n editor: function(container, options) {\n that._initAccessibilityAlignmentDropDown($('').appendTo(container), tableProperties);\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-header-rows\",\n label: encode(messages.headerRows),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container),\n \"headerRows\",\n tableProperties,\n accessibilityView,\n {\n max: tableProperties.rows || DEFAULT_NUMBER_OF_COLS_AND_ROWS\n });\n }\n },{\n colSpan: 1,\n field: \"k-editor-table-header-columns\",\n label: encode(messages.headerColumns),\n editor: function(container, options) {\n that._initNumericTextbox($('').appendTo(container),\n \"headerColumns\",\n tableProperties,\n accessibilityView,\n {\n max: tableProperties.columns || DEFAULT_NUMBER_OF_COLS_AND_ROWS\n });\n }\n },{\n colSpan: 2,\n field: \"k-editor-cells-headers\",\n label: encode(messages.associateCellsWithHeaders),\n editor: function(container, options) {\n var element = $((\"\")).appendTo(container);\n\n that._initAssociationDropDown(element, \"cellsWithHeaders\", { valuePrimitive: true }, tableProperties, accessibilityView);\n }\n },{\n colSpan: \"full\",\n field: \"k-editor-accessibility-summary\",\n label: {\n text: encode(messages.summary),\n optional: true\n },\n editor: function(container, options) {\n that._initTextArea($('').appendTo(container), \"summary\", tableProperties, accessibilityView, {\n rows: 5,\n placeholder: messages.tableSummaryPlaceholder\n });\n }\n }\n ]\n }\n ]\n }).data(\"kendoForm\");\n\n form.layoutWrapper.addClass(\"k-gap-x-4\");\n\n return form;\n }\n });\n\n kendo.ui.editor.TableWizardDialog = TableWizardDialog;\n\n })(window.kendo.jQuery);\n\n var __meta__ = {\n id: \"editor\",\n name: \"Editor\",\n category: \"web\",\n description: \"Rich text editor component\",\n depends: [ \"combobox\", \"dropdownlist\", \"window\", \"colorpicker\", \"toolbar\", \"icons\" ],\n features: [ {\n id: \"editor-imagebrowser\",\n name: \"Image Browser\",\n description: \"Support for uploading and inserting images\",\n depends: [ \"imagebrowser\" ]\n }, {\n id: \"editor-resizable\",\n name: \"Resize handle\",\n description: \"Support for resizing the content area via a resize handle\",\n depends: [ \"resizable\" ]\n }, {\n id: \"editor-tablewizard\",\n name: \"Table wizard dialog\",\n description: \"Support for table properties configuration\",\n depends: [ \"tabstrip\", \"button\", \"numerictextbox\", \"textarea\" ]\n }, {\n id: \"editor-pdf-export\",\n name: \"PDF export\",\n description: \"Export Editor content as PDF\",\n depends: [ \"pdf\", \"drawing\" ]\n }]\n };\n var kendo$1 = kendo;\n\n return kendo$1;\n\n}));\n"]}