Lines Matching refs:getFirst

67 b(c)&&!f(c)&&!f(c,!0))return-1;do a&&c!=this.$&&c.nodeType==CKEDITOR.NODE_TEXT&&(l||b(c))||(e++,l=c.nodeType==CKEDITOR.NODE_TEXT);while(c=c.previousSibling);return e},getNextSourceNode:function(a,f,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getFirst&&this.getFirst();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getNext()}for(;!a&&(e=(e||this).getParent());){if(b&&!1===b(e,!0))return null;a=e.getNext()}return!a||b&&!1===b(a)?null:
73 f)},remove:function(a){var f=this.$,b=f.parentNode;if(b){if(a)for(;a=f.firstChild;)b.insertBefore(f.removeChild(a),f);b.removeChild(f)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(f)f.length<b&&(a.split(b-f.length),this.$.removeChild(this.$.firstChild));else{a.remove();continue}}break}},
83 a)&&(a.$?a:new CKEDITOR.dom.element(a))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(a,f){var b=new CKEDITOR.dom.element("div",f);b.setHtml(a);return b.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(a,f,b,c){var e=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),l=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");
89 new CKEDITOR.dom.element("div");e=g.getFirst();)e.$.style.backgroundColor&&(e.$.style.backgroundColor=e.$.style.backgroundColor),c.append(e);c.insertAfter(this);c.remove(!0)}else g.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$):b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(d){}}return function(b){b?
96 b&&(a=b.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var b=this.$.firstChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getNext(a));return b},getLast:function(a){var b=this.$.lastChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getPrevious(a));return b},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if("object"==typeof arguments[0])return!!arguments[0][a];
103 d=g?d.getNext():d.getPrevious(),!d||d.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(d)){for(var e=g?b.getLast():b.getFirst();c.length;)c.shift().move(b,!g);d.moveChildren(b,!g);d.remove();e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,
121 CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,
142 e=f;g.getText()?d+=e:(f=g.getPrevious(c),e?(d=e,g=f?f.getNext():g.getParent().getFirst()):(g=g.getParent(),d=f?f.getIndex(!0)+1:0))}b.container=g;b.offset=d}function b(a,g){var c=g.getCustomData("cke-fillingChar");if(c){var d=a.container;c.equals(d)&&(a.offset-=CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length,0>=a.offset&&(a.offset=d.getIndex(),a.container=d.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var d=this.collapsed,e={container:this.startContainer,
166 c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()||g.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||d.blockLimit,f;e&&!e.equals(d.root)&&!e.getFirst(a(e));)f=e.getParent(),this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=f;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,
172 this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,f=c,h=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(!1)&&(h=e[b?"getLast":"getFirst"](m));f||h||(h=e[b?"getPrevious":"getNext"](m));a=h}return!!c},moveToClosestEditablePosition:function(a,b){var c,d=0,e,f,m=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root),
186 v;b(this,a,g);break}else if(v.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){if("br"==z)B=1;else if(!f&&!v.getChildCount()&&"hr"!=z){g=v;k=v.equals(q);break}f&&(f.setEndAt(v,CKEDITOR.POSITION_BEFORE_START),"br"!=z&&(this._.nextNode=v));u=1}else{if(v.getFirst()){f||(f=this.range.clone(),f.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));v=v.getFirst();continue}B=1}}B&&!f&&(f=this.range.clone(),f.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));k=(!u||B)&&v.equals(q);if(f&&!u)for(;!v.getNext(d)&&!k;){z=
313 getFirst:function(b){if(!b)return this.children.length?this.children[0]:null;"function"!=typeof b&&(b=a(b));for(var e=0,f=this.children.length;e<f;++e)if(b(this.children[e]))return this.children[e];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children;for(var b=0,f=a.length;b<f;++b)a[b].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;
329 f.resetDirty();m?f.fire("unlockSnapshot"):"wysiwyg"==a&&f.fire("saveSnapshot");setTimeout(function(){f.fire("mode");b&&b.call(f)},0)})}};CKEDITOR.editor.prototype.resize=function(a,b,f,k){var d=this.container,h=this.ui.space("contents"),m=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;k=k?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):d;k.setSize("width",a,!0);m&&(m.style.width="1%");var g=(k.$.offsetHeight||0)-(h.$.clientHeight||
332 (b=b.getFirst(c))&&b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/)&&b.remove(),m=1,a.cancel());m&&h.select()}function f(a,b){if(a.isFake)return 0;var d=b.block||b.blockLimit,e=d&&d.getLast(c);if(!(!d||!d.isBlockBoundary()||e&&e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary()||d.is("pre")||d.getBogus()))return d}function b(a){var b=a.data.getTarget();b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function c(a){return g(a)&&
357 function(b){b.data.getKeystroke()in n&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",b);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();c.is("img","hr","input","textarea","select")&&
373 fixForBody:!1,protectedWhitespaces:!!Q,dontFilter:n.dontFilter,filter:n.editor.activeFilter,enterMode:n.editor.activeEnterMode});I=B.document.createElement("body");I.setHtml(x);Q&&(I.getFirst().remove(),I.getLast().remove());if((Q=B.startPath().block)&&(1!=Q.getChildCount()||!Q.getBogus()))a:{var R;if(1==I.getChildCount()&&a(R=I.getFirst())&&R.is(u)&&!R.hasAttribute("contenteditable")){Q=R.getElementsByTag("*");B=0;for(p=Q.count();B<p;B++)if(G=Q.getItem(B),!G.is(v))break a;R.moveChildren(R.getParent(1));
379 v=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;0<b--;)d=a.getItem(b),CKEDITOR.tools.trim(d.getHtml())||(d.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}
396 th:1},!0);d=CKEDITOR.tools.trim;c&&c.equals(g)&&!c.findOne("td, th, tr, tbody, table")?(e=e.cloneContents(),c=e.getFirst()?d(e.getFirst().getText())!==d(c.getText()):!0):c=!1}if(c)return!1;for(d=0;d<a.length;d++)if(c=a[d]._getTableElement(),!c)return!1;return!0}function f(a){function b(a){a=a.find("td, th");var c=[],d;for(d=0;d<a.count();d++)c.push(a.getItem(d));return c}var c=[],d,e;for(e=0;e<a.length;e++)d=a[e]._getTableElement(),d.is&&d.is({td:1,th:1})?c.push(d):c=c.concat(b(d));return c}function b(a){a=
416 c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&&(b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var d=y[a.data.keyCode];if(d)return d({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});
430 if((b=b.getChild(c.startOffset))&&b.type==CKEDITOR.NODE_ELEMENT)for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;)b=c,c=c.getFirst();else b=c.startContainer}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&!((c=a.getEnclosedNode())&&
454 " ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=p(c?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,m;(m=c.getPrevious(H))&&m.type==CKEDITOR.NODE_ELEMENT&&m.is("pre")&&(d=n(m.getHtml(),/\n$/,"")+"\n\n"+n(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e":
459 g;if(g=a.getAttribute(e)){var f=b[d][1];(null===f||f.test&&f.test(g)||"string"==typeof f&&g==f)&&a.removeAttribute(e)}}c||v(a)}function v(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(H),d=a.getNext(H);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br",1);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else c=a.getFirst(),d=a.getLast(),a.remove(!0),c&&(c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings(),
515 CKEDITOR.document.getById(this._.labelId);return!a||1>a.getChildCount()?"":a.getChild(0).getText()},eventProcessors:e},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var a=this.getElement();a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},
538 y.getChild(0).getFrameDocument();g.on("mousemove",b);g.on("mouseup",c)}f.data.preventDefault()},a)}function g(a){function b(c){var n="rtl"==f.lang.dir,r=l.width,u=l.height,x=r+(c.data.$.screenX-m.x)*(n?-1:1)*(a._.moved?1:2),v=u+(c.data.$.screenY-m.y)*(a._.moved?1:2),p=a._.element.getFirst(),p=n&&p.getComputedStyle("right"),B=a.getPosition();B.y+v>k.height&&(v=k.height-B.y);(n?p:B.x)+x>k.width&&(x=k.width-(n?p:B.x));if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(d.minWidth||
557 (a=x.onFocus.call(this))&&a.focus():k(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);m(this);g(this);(new CKEDITOR.dom.text(x.title,CKEDITOR.document)).appendTo(this.parts.title);for(q=0;q<x.contents.length;q++)(z=x.contents[q])&&this.addPage(z);this.parts.tabs.on("click",function(a){var b=a.data.getTarget();b.hasClass("cke_dialog_tab")&&(b=b.$.id,this.selectPage(b.substring(4,b.lastIndexOf("_"))),
559 a&&this._.contentSize.height==b||(CKEDITOR.dialog.fire("resize",{dialog:this,width:a,height:b},this._.editor),this.fire("resize",{width:a,height:b},this._.editor),this.parts.contents.setStyles({width:a+"px",height:b+"px"}),"rtl"==this._.editor.lang.dir&&this._.position&&(this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:a,height:b})}}(),getSize:function(){var a=this._.element.getFirst();
560 return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||0}},move:function(a,b,c){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir,f="fixed"==d.getComputedStyle("position");CKEDITOR.env.ie&&d.setStyle("zoom","100%");f&&this._.position&&this._.position.x==a&&this._.position.y==b||(this._.position={x:a,y:b},f||(f=CKEDITOR.document.getWindow().getScrollPosition(),a+=f.x,b+=f.y),e&&(f=this.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize().width-f.width-a),b={top:(0<b?b:0)+"px"},
562 null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,p(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this);
567 if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else t(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",C);a.removeListener("keyup",F);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;
617 0;d<k.length;d++)b=k[d],h=h.getCommonAncestor(b.getParent());for(b={table:1,tbody:1,tr:1,ol:1,ul:1};b[h.getName()];)h=h.getParent();for(d=null;0<k.length;){for(b=k.shift();!b.getParent().equals(h);)b=b.getParent();b.equals(d)||e.push(b);d=b}for(;0<e.length;)if(b=e.shift(),"blockquote"==b.getName()){for(d=new CKEDITOR.dom.documentFragment(a.document);b.getFirst();)d.append(b.getFirst().remove()),k.push(d.getLast());d.replace(b)}else k.push(b);e=a.document.createElement("blockquote");for(e.insertBefore(k[0]);0<
620 new CKEDITOR.dom.documentFragment(a.document);!e||!m.getPrevious()||m.getPrevious().type==CKEDITOR.NODE_ELEMENT&&m.getPrevious().isBlockBoundary()||d.append(a.document.createElement("br"));for(e=m.getNext()&&!(m.getNext().type==CKEDITOR.NODE_ELEMENT&&m.getNext().isBlockBoundary());m.getFirst();)m.getFirst().remove().appendTo(d);e&&d.append(a.document.createElement("br"));d.replace(m);e=!1}}c.selectBookmarks(l);a.focus()}},refresh:function(a,b){this.setState(a.elementPath(b.block||b.blockLimit).contains("blockquote",
627 l,this);a.on("mode",l,this);!this.readOnly&&a.on("readOnly",l,this)}else m&&(m=a.getCommand(m))&&(m.on("state",function(){this.setState(m.state)},this),h+=m.state==CKEDITOR.TRISTATE_ON?"on":m.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");if(this.directional)a.on("contentDirChanged",function(b){var d=CKEDITOR.document.getById(this._.id),e=d.getFirst();b=b.data;b!=a.lang.dir?d.addClass("cke_"+b):d.removeClass("cke_ltr").removeClass("cke_rtl");e.setAttribute("style",CKEDITOR.skin.getIconStyle(x,
642 b.getFirst().setText(h?"▲":"◀");d.setStyle("height",f-(e.$.offsetHeight-g)+"px");a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:d.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});e.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");m.push('\x3ca title\x3d"'+(f?e.lang.toolbar.toolbarCollapse:e.lang.toolbar.toolbarExpand)+'" id\x3d"'+e.ui.spaceId("toolbar_collapser")+'" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');
666 (CKEDITOR.document.getBody().$.scrollTop=u);h&&h.removeListener();CKEDITOR.env.ie&&e.focus();k.selectBookmarks(m);n.remove();var a;CKEDITOR.env.webkit&&(a=n.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(n=a);b.removeListener("selectionChange",f);c(n.getHtml())},0)}}function B(){if("paste"==D.mainPasteEvent)return b.fire("beforePaste",{type:"auto",method:"paste"}),!1;b.focus();f();var a=b.focusManager;a.lock();if(b.editable().fire(D.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();
683 -1<b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/<br>$/i,
702 e=this._.panelDefinition.block,l=c.parent||CKEDITOR.document.getBody(),k=this._.panel=new CKEDITOR.ui.floatPanel(a,l,c),c=k.addBlock(b.id,e),d=this;k.onShow=function(){d.className&&this.element.addClass(d.className+"_panel");d.setState(CKEDITOR.TRISTATE_ON);b.on=1;d.editorFocus&&a.focus();if(d.onOpen)d.onOpen()};k.onHide=function(c){d.className&&this.element.getFirst().removeClass(d.className+"_panel");d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);b.on=0;if(!c&&
715 b.name));var d=c.getDocument();f=a(b,d,c,e,f||0);var h=f.element,m=h.getFirst(),g=this;h.disableContextMenu();this.element=h;this._={editor:b,panel:f,parentElement:c,definition:e,document:d,iframe:m,children:[],dir:b.lang.dir,showBlockParams:null};b.on("mode",k);b.on("resize",k);d.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,c){return this._.panel.addBlock(a,c)},addListBlock:function(a,c){return this._.panel.addListBlock(a,c)},getBlock:function(a){return this._.panel.getBlock(a)},
717 {x:0,y:0},q="rtl"==this._.dir,v=w.x+(f||0)-p.x,u=w.y+(k||0)-p.y;!q||1!=e&&4!=e?q||2!=e&&3!=e||(v+=c.$.offsetWidth-1):v+=c.$.offsetWidth;if(3==e||4==e)u+=c.$.offsetHeight-1;this._.panel._.offsetParentId=c.getId();n.setStyles({top:u+"px",left:0,display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(g);this._.blurSet||(CKEDITOR.event.useCapture=!0,g.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&
721 a.top<e&&(u=c>e?u-e:b.height>e?u-a.bottom+b.height:u-a.top);CKEDITOR.env.ie&&(b=a=new CKEDITOR.dom.element(n.$.offsetParent),"html"==b.getName()&&(b=b.getDocument().getBody()),"rtl"==b.getComputedStyle("direction")&&(v=CKEDITOR.env.ie8Compat?v-2*n.getDocument().getDocumentElement().$.scrollLeft:v-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),k;(k=a.getCustomData("activePanel"))&&k.onHide&&k.onHide.call(this,1);a.setCustomData("activePanel",this);n.setStyles({top:u+"px",left:v+"px"});n.setOpacity(1);
724 a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var c=this._.panel;
798 p||r)B[p?"insertBefore":"insertAfter"](l);else u.breakParent(l),B.insertAfter(l);else if(u.appendBogus(!0),p||r)for(;t=u[p?"getFirst":"getLast"]();)t[p?"insertBefore":"insertAfter"](l);else for(u.breakParent(l);t=u.getLast();)t.insertAfter(l);u.remove()}x.selectBookmarks(z);return}if(u&&u.getParent().is("blockquote")){u.breakParent(u.getParent());u.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||u.getPrevious().remove();u.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||u.getNext().remove();
839 c;for(c in a){var d=a[c];b.getById(d).removeClass("cke_selected");b.getById(d+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),c,d=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a=b.getItem(++d);){if(a.equals(c)){this._.focusIndex=d;break}}else this.element.focus();
853 t[b].buildPreview(),b)}},onClick:function(c){a.focus();a.fire("saveSnapshot");var d=this.getValue(),e=t[c];if(d&&c!=d){var g=t[d],h=a.getSelection().getRanges()[0];if(h.collapsed){var k=a.elementPath(),m=k.contains(function(a){return g.checkElementRemovable(a)});if(m){var l=h.checkBoundaryOfElement(m,CKEDITOR.START),u=h.checkBoundaryOfElement(m,CKEDITOR.END);if(l&&u){for(l=h.createBookmark();k=m.getFirst();)k.insertBefore(m);m.remove();h.moveToBookmark(l)}else l||u?h.moveToPosition(m,l?CKEDITOR.POSITION_BEFORE_START:
895 w.push(C)}h&&h.listNode.replace(f);if(w&&w.length)for(l=0;l<w.length;l++){for(C=f=w[l];(C=C.getNext())&&C.is&&C.getName()in k;)CKEDITOR.env.needsNbspFiller&&!f.getFirst(b)&&f.append(t.document.createText(" ")),f.append(C);f.insertAfter(p)}h&&a.fire("contentDomInvalidated");return!0}for(var e=this,g=this.database,k=this.context,l=a.getSelection(),l=(l&&l.getRanges()).createIterator(),t;t=l.getNextRange();){for(var w=t.getCommonAncestor();w&&(w.type!=CKEDITOR.NODE_ELEMENT||!k[w.getName()]);){if(a.editable().equals(w)){w=
899 l:k},exec:CKEDITOR.tools.bind(a,this)}}var e=CKEDITOR.plugins.indent;e.registerCommands(b,{indentlist:new c(b,"indentlist",!0),outdentlist:new c(b,"outdentlist")});CKEDITOR.tools.extend(c.prototype,e.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,b,c){var e=b.contains(f);c||(c=b.contains(a));return c&&e&&e.equals(c.getFirst(f))}}(),function(){function a(a,b){b=void 0===b||b;var f;if(b)f=a.getComputedStyle("text-align");
932 d.remove(1);b.selectBookmarks(c)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})}(),function(){function a(a,b,c){function d(c){if(!(!(l=k[c?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})))a.document.createElement("br")[c?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],g=0;g<b.contents.length;g++){var h=
934 d(!0);d();k.replace(b.root);a.fire("contentDomInvalidated")}function f(a,b){this.name=a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function b(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](t);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d)}function c(a){function c(d){var e=a[d?"getPrevious":"getNext"](g);e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(a.getName())&&(b(a,e,null,!d),a.remove(),
936 z=z.contains(CKEDITOR.dtd.$list);m?(m=m.getBogus())&&m.remove():z&&(m=z.getPrevious(g))&&n(m)&&m.remove();(m=f.getLast())&&m.type==CKEDITOR.NODE_ELEMENT&&m.is("br")&&m.remove();(m=d.startContainer.getChild(d.startOffset))?f.insertBefore(m):d.startContainer.append(f);p&&(f=k(p))&&(l.contains(p)?(b(f,p.getParent(),p),f.remove()):l.append(f));for(;e.checkStartOfBlock()&&e.checkEndOfBlock();){z=e.startPath();f=z.block;if(!f)break;f.is("li")&&(l=f.getParent(),f.equals(l.getLast(g))&&f.equals(l.getFirst(g))&&
943 1))):C.append(J.clone(1,1));K&&((E||C).append(K),K=null);C.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&p!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(F=C.getLast())&&F.type==CKEDITOR.NODE_ELEMENT&&F.is("br")&&F.remove(),(F=C.getLast(g))&&F.type==CKEDITOR.NODE_ELEMENT&&F.is(CKEDITOR.dtd.$block)||C.append(k.createElement("br")));F=C.$.nodeName.toLowerCase();"div"!=F&&"p"!=F||C.appendBogus();l.append(C);n=null;p++}else return null;E=null;if(a.length<=p||Math.max(a[p].indent,0)<t)break}if(b)for(a=l.getFirst();a;){if(a.type==
945 b.editable();if(k.getFirst(g)){var l=1==h.length&&h[0];(e=l&&l.getEnclosedNode())&&e.is&&this.type==e.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else e.enterMode==CKEDITOR.ENTER_BR?k.appendBogus():h[0].fixBlock(1,e.enterMode==CKEDITOR.ENTER_P?"p":"div"),f.selectRanges(h)}for(var e=f.createBookmarks(!0),k=[],m={},h=h.createIterator(),n=0;(l=h.getNextRange())&&++n;){var A=l.getBoundaryNodes(),y=A.startNode,t=A.endNode;y.type==CKEDITOR.NODE_ELEMENT&&"td"==y.getName()&&l.setStartAt(A.startNode,CKEDITOR.POSITION_AFTER_START);
954 y.type==CKEDITOR.NODE_ELEMENT&&(y.getName()in d||y.is("li"))&&(y.is("li")||(A.range.selectNodeContents(y),A.reset(),A.evaluator=e,y=A.previous()),f=y,c.moveToElementEditEnd(f),c.moveToPosition(c.endPath().block,CKEDITOR.POSITION_BEFORE_END)));if(f)l(a,c,h),b.cancel();else{var t=m.contains(d);t&&h.checkBoundaryOfElement(t,CKEDITOR.START)&&(f=t.getFirst(g),h.checkBoundaryOfElement(f,CKEDITOR.START)&&(y=t.getPrevious(g),k(f)?y&&(h.moveToElementEditEnd(y),h.select()):a.execCommand("outdent"),b.cancel()))}}else if(f=
956 CKEDITOR.POSITION_BEFORE_END),h.endPath().block&&h.moveToPosition(h.endPath().block,CKEDITOR.POSITION_AFTER_START));l(a,c,h);b.cancel()}}else A.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),(y=A.next())&&y.type==CKEDITOR.NODE_ELEMENT&&y.is(d)&&(y=y.getFirst(g),m.block&&h.checkStartOfBlock()&&h.checkEndOfBlock()?(m.block.remove(),h.moveToElementEditStart(y),h.select()):k(y)?(h.moveToElementEditStart(y),h.select()):(h=h.clone(),h.moveToElementEditStart(y),l(a,c,h)),b.cancel());setTimeout(function(){a.selectionChange(1)})}}}))}})}(),
971 null}function q(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var f=a.tabuList.length;f--;)if(c[d].hasAttribute(a.tabuList[f]))return!0;return!1}function v(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(fa)});if(!b)return!1;r(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function u(a){var b=a.editable,c=a.mouse,d=a.view,e=a.triggerOffset;z(a);var h=c.y>(a.inInlineMode?d.editable.top+d.editable.height/2:Math.min(d.editable.height,d.pane.height)/
972 2),b=b[h?"getLast":"getFirst"](function(a){return!(Z(a)||aa(a))});if(!b)return null;g(a,b)&&(b=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(Z(a)||aa(a))}));if(!n(b)||p(b)||!w(a,b))return null;r(a,b);return!h&&0<=b.size.top&&l(c.y,0,b.size.top+e)?(a=a.inInlineMode||0===d.scroll.y?P:S,new f([null,b,N,J,a])):h&&b.size.bottom<=d.pane.height&&l(c.y,b.size.bottom-e,d.pane.height)?(a=a.inInlineMode||l(b.size.bottom,d.pane.height-e,d.pane.height)?K:S,new f([b,null,G,J,a])):null}function x(a){var c=
973 a.mouse,d=a.view,g=a.triggerOffset,h=b(a);if(!h)return null;r(a,h);var g=Math.min(g,0|h.size.outerHeight/2),k=[],m,q;if(l(c.y,h.size.top-1,h.size.top+g))q=!1;else if(l(c.y,h.size.bottom-g,h.size.bottom+1))q=!0;else return null;if(p(h)||v(a,h,q)||h.getParent().is(ca))return null;var u=e(a,h,!q);if(u){if(u&&u.type==CKEDITOR.NODE_TEXT)return null;if(n(u)){if(p(u)||!w(a,u)||u.getParent().is(ca))return null;k=[u,h][q?"reverse":"concat"]().concat([V,J])}}else h.equals(a.editable[q?"getLast":"getFirst"](a.isRelevant))?
974 (z(a),q&&l(c.y,h.size.bottom-g,d.pane.height)&&l(h.size.bottom,d.pane.height-g,d.pane.height)?m=K:l(c.y,0,h.size.top+g)&&(m=P)):m=S,k=[null,h][q?"reverse":"concat"]().concat([q?G:N,J,m,h.equals(a.editable[q?"getLast":"getFirst"](a.isRelevant))?q?K:P:S]);return 0 in k?new f(k):null}function B(a,b,c,d){for(var f=b.getDocumentPosition(),e={},g={},h={},k={},l=ba.length;l--;)e[ba[l]]=parseInt(b.getComputedStyle.call(b,"border-"+ba[l]+"-width"),10)||0,h[ba[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+
986 e.element,g,h,k;if(!n(f)||f.contains(e.editable)||f.isReadOnly())return null;k=y(e,function(a,b){return!b.equals(a)},function(a,b){return W(a,!0,b)},f);g=k.upper;h=k.lower;if(a(e,g,h))return k.set(V,8);if(g&&f.contains(g))for(;!g.getParent().equals(f);)g=g.getParent();else g=f.getFirst(function(a){return d(e,a)});if(h&&f.contains(h))for(;!h.getParent().equals(f);)h=h.getParent();else h=f.getLast(function(a){return d(e,a)});if(!g||!h)return null;r(e,g);r(e,h);if(!l(e.mouse.y,g.size.top,h.size.bottom))return null;
991 {modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var w=a.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}),q=a.ui.space("contents");if("wysiwyg"==a.mode){var v=a.getSelection();g=v&&v.getRanges();n=m.getScrollPosition()}else{var u=a.editable().$;g=!CKEDITOR.env.ie&&[u.selectionStart,u.selectionEnd];n=[u.scrollLeft,u.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){m.on("resize",f);p=m.getScrollPosition();
1091 b)for(d=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);d;){if(d.isVisible()&&0===d.getTabIndex()){l=d;break}d=d.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(d=this.getDocument().getBody().getFirst();d=d.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!c)if(!e&&d.equals(this)){if(e=!0,a){if(!(d=d.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;c=1}}else e&&!this.contains(d)&&(c=1);if(d.isVisible()&&!(0>(h=d.getTabIndex()))){if(c&&h==b){l=d;break}h>b&&(!l||!k||h<k)?(l=d,k=h):l||0!==h||
1106 e["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(t))}c=b.getDocument();var H=n,w=t=0,L=!d&&new CKEDITOR.dom.documentFragment(c),N=0;for(c=0;c<e.length;c++){g=e[c];var G=g.getParent(),V=g.getFirst(),J=g.$.colSpan,P=g.$.rowSpan,G=G.$.rowIndex,K=m(h,G,g),N=N+J*P,w=Math.max(w,K-p+J);t=Math.max(t,G-n+P);d||(J=g,(P=J.getBogus())&&P.remove(),J.trim(),g.getChildren().count()&&(G==H||!V||V.isBlockBoundary&&V.isBlockBoundary({br:1})||(H=L.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!H||H.is&&
1134 if(h.getRanges().length&&(h.isInTable()||(q=c(h)))&&(w=v(h),w.length)){b.stop();b=w[0].getAscendant("table");w=v(h,b);J=w[0];n=J.getParent();P=w[w.length-1];K=P.getParent();if(!q)for(O=0;O<w.length;O++)w[O].setHtml("");if(1<k.getChildCount()||!p)w[0].setHtml(k.getHtml()),g.fire("saveSnapshot");else{if(q){w=n.getChildCount();n=K=new CKEDITOR.dom.element("tr");n["insert"+(1===q?"Before":"After")](J.getParent());for(O=0;O<w;O++)J=new CKEDITOR.dom.element("td"),J.appendTo(n);J=n.getFirst();P=n.getLast();