Lines Matching refs:getCommand

241 function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this},CKEDITOR.ui.prototype={add:function(a,f,b){b.name=a.toLowerCase();var c=this.items[a]={type:f,command:b.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(c,b)},get:function(a){return this.instances[a]},create:function(a){var f=this.items[a],b=f&&this._.handlers[f.type],c=f&&f.command&&this.editor.getCommand(f.command),b=b&&b.create.apply(this,f.args);this.instances[a]=
257 new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b||{},command:c};return c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&!1!==this.fire("beforeCommandExec",d)&&(d.returnValue=c.exec(d.commandData),!c.async&&!1!==this.fire("afterCommandExec",d))?d.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");
262 (d=c[1],c=c[0]),d?a[c]=d:delete a[c]},getCommandKeystroke:function(a){if(a="string"===typeof a?this.getCommand(a):a){var b=a&&a.name,c=this.keystrokeHandler.keystrokes,d;if(a.fakeKeystroke)return a.fakeKeystroke;for(d in c)if(c.hasOwnProperty(d)&&c[d]==b)return d}return null},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){a||(a=this.filter);this.activeFilter!==a&&(this.activeFilter=a,this.fire("activeFilterChange"),a===this.filter?this.setActiveEnterMode(null,
604 a.attachStyleStateChange(m,function(b){!a.readOnly&&a.getCommand(e).setState(b)});a.addCommand(e,new CKEDITOR.styleCommand(m,{contentForms:g}));a.ui.addButton&&a.ui.addButton(b,{label:d,command:e,toolbar:"basicstyles,"+(f+=10)})}},c={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s",
609 attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var c=a.config.useComputedState,d,c=void 0===c||c;if(!c){d=b.lastElement;for(var e=a.editable();d&&!(d.getName()in k||d.equals(e));){var f=d.getParent();if(!f)break;d=f}}d=d||b.block||b.blockLimit;d.equals(a.editable())&&(e=a.getSelection().getRanges()[0].getEnclosedNode())&&e.type==CKEDITOR.NODE_ELEMENT&&(d=e);d&&(c=c?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==
610 c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));c=(b.block||b.blockLimit||a.editable()).getDirection(1);c!=(a._.selDir||a.lang.dir)&&(a._.selDir=c,a.fire("contentDirChanged",c))},exec:function(c){var d=c.getSelection(),h=c.config.enterMode,k=d.getRanges();if(k&&k.length){for(var m={},v=d.createBookmarks(),k=k.createIterator(),u,x=0;u=k.getNextRange(1);){var B=u.getEnclosedNode();B&&(!B||B.type==CKEDITOR.NODE_ELEMENT&&
615 "setAttribute","removeAttribute"],m=0;m<h.length;m++)d[h[m]]=CKEDITOR.tools.override(d[h[m]],c)}(),function(){var a={exec:function(a){var b=a.getCommand("blockquote").state,c=a.getSelection(),e=c&&c.getRanges()[0];if(e){var l=c.createBookmarks();if(CKEDITOR.env.ie){var k=l[0].startNode,d=l[0].endNode,h;if(k&&"blockquote"==k.getParent().getName())for(h=k;h=h.getNext();)if(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary()){k.move(h,!0);break}if(d&&"blockquote"==d.getParent().getName())for(h=d;h=h.getPrevious();)if(h.type==
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,
630 this.hasArrow?(a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(a)):a==CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=
668 b)?(c.data.preventDefault(),setTimeout(function(){a(b,d)},0)):l(c,function(c){d.dataValue=c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");e&&a(b,d)})}function A(){if("wysiwyg"==b.mode){var a=y("paste");b.getCommand("cut").setState(y("cut"));b.getCommand("copy").setState(y("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function y(a){if(E&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();var c=a.getRanges();
742 c.ui.addButton("CopyFormatting",{label:c.lang.copyformatting.label,command:"copyFormatting",toolbar:"cleanup,0"});c.on("contentDom",function(){var b=c.editable(),d=b.isInline()?b:c.document,e=c.ui.get("CopyFormatting");b.attachListener(d,"mouseup",function(b){a(b)&&c.execCommand("applyFormatting")});b.attachListener(CKEDITOR.document,"mouseup",function(d){var e=c.getCommand("copyFormatting");a(d)&&e.state===CKEDITOR.TRISTATE_ON&&!b.contains(d.data.getTarget())&&c.execCommand("copyFormatting")});e&&
743 (d=CKEDITOR.document.getById(e._.id),b.attachListener(d,"dblclick",function(){c.execCommand("copyFormatting",{sticky:!0})}),b.attachListener(d,"mouseup",function(a){a.data.stopPropagation()}))});c.config.copyFormatting_keystrokeCopy&&c.setKeystroke(c.config.copyFormatting_keystrokeCopy,"copyFormatting");c.on("key",function(a){var b=c.getCommand("copyFormatting");a=a.data.domEvent;a.getKeystroke&&27===a.getKeystroke()&&b.state===CKEDITOR.TRISTATE_ON&&c.execCommand("copyFormatting")});c.copyFormatting.on("extractFormatting",
749 a.config.copyFormatting_outerCursor&&t.addClass("cke_copyformatting_disabled"));e.sticky=l;c._putScreenReaderMessage(a,"copied");c._attachPasteKeystrokeHandler(a)}},applyFormatting:{editorFocus:!1,exec:function(a,b){var c=a.getCommand("copyFormatting"),e=b?"keystrokeHandler"==b.from:!1,f=CKEDITOR.plugins.copyformatting,l=a.copyFormatting,p=f._getCursorContainer(a),t=CKEDITOR.document.getDocumentElement();if(e||c.state===CKEDITOR.TRISTATE_ON){if(e&&!l.styles)return f._putScreenReaderMessage(a,"failed"),
767 level:this._.level-1,block:{}}),e=c.block.attributes=c.attributes||{};!e.role&&(e.role="menu");this._.panelDefinition=c},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),c=this.editor.elementPath(),e=this._.listeners;this.removeAll();for(var f=0;f<e.length;f++){var g=e[f](b,a,c);if(g)for(var n in g){var p=this.editor.getMenuItem(n);!p||p.command&&!this.editor.getCommand(p.command).state||(p.state=g[n],this.add(p))}}},onClick:function(a){this.hide();if(a.onClick)a.onClick();
775 "\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",u=this.name;this.icon&&!/\./.test(this.icon)&&(u=this.icon);this.command&&(p=n.getCommand(this.command),(p=n.getCommandKeystroke(p))&&(t=CKEDITOR.tools.keystrokeToString(n.lang.common.keyboard,p)));a={id:h,name:this.name,iconName:u,label:this.label,cls:this.className||"",state:w,hasPopup:q?"true":"false",disabled:m==CKEDITOR.TRISTATE_DISABLED,title:this.label+(t?" ("+t.display+")":""),ariaShortcut:t?n.lang.common.keyboardShortcut+" "+t.aria:
881 command:"image",group:"image"}});b.contextMenu&&b.contextMenu.addListener(function(c){if(a(b,c))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(b){function c(c){var l=b.getCommand("justify"+c);if(l){if("left"==c||"right"==c)l.on("exec",function(k){var d=a(b),h;d&&(h=f(d),h==c?(d.removeStyle("float"),c==f(d)&&d.removeAttribute("align")):d.setStyle("float",c),k.cancel())});l.on("refresh",function(k){var d=a(b);d&&(d=f(d),this.setState(d==c?CKEDITOR.TRISTATE_ON:"right"==c||"left"==c?CKEDITOR.TRISTATE_OFF:
886 b){var c=a.getCommand(b.relatedGlobal),e;for(e in b.jobs)c.on("exec",function(c){c.data.done||(a.fire("lockSnapshot"),b.execJob(a,e)&&(c.data.done=!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,e),c.on("refresh",function(c){c.data.states||(c.data.states={});c.data.states[b.name+"@"+e]=b.refreshJob(a,e,c.data.path)},this,null,e);a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype=
907 this.command?a.getCommand(this.command).modes:this.modes;this.setState(!c||c[a.mode]?b.previousState:CKEDITOR.TRISTATE_DISABLED);b.on=0},this),this.onMenu&&c.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),b.on=1,setTimeout(function(){c.show(CKEDITOR.document.getById(b.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(f){delete f.panel;this.base(f);this.hasArrow=!0;this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},
996 this.state)},canUndo:!1});a.ui.addButton&&a.ui.addButton("Maximize",{label:d.maximize.maximize,command:"maximize",toolbar:"tools,10"});a.on("mode",function(){var b=a.getCommand("maximize");b.setState(b.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:t)},null,null,100)}}})}(),CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(a){var b=this;a.setData(a.config.newpage_html||"",function(){a.focus();setTimeout(function(){a.fire("afterCommandExec",
1005 86;f.addCommand("pastetext",a);f.setKeystroke(b,"pastetext");f.ui.addButton&&f.ui.addButton("PasteText",{label:f.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(f.config.forcePasteAsPlainText)f.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")});f.on("pasteState",function(a){f.getCommand("pastetext").setState(a.data)})}})}(),function(){var a,f={modes:{wysiwyg:1,source:1},canUndo:!1,readOnly:1,exec:function(b){var c,e=b.config,f=e.baseHref?'\x3cbase href\x3d"'+
1071 "cke_show_border").replace(/%1/g,"cke_show_borders ");CKEDITOR.addCss(a)},init:function(f){var b=f.addCommand("showborders",a);b.canUndo=!1;!1!==f.config.startupShowBorders&&b.setState(CKEDITOR.TRISTATE_ON);f.on("mode",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(f)},null,null,100);f.on("contentDom",function(){b.state!=CKEDITOR.TRISTATE_DISABLED&&b.refresh(f)});f.on("removeFormatCleanup",function(a){a=a.data;f.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&a.is("table")&&(!a.hasAttribute("border")||
1078 e));e.setData(f.getData(1));CKEDITOR.env.ie&&(e.attachListener(f,"resize",b,e),e.attachListener(CKEDITOR.document.getWindow(),"resize",b,e),CKEDITOR.tools.setTimeout(b,0,e));f.fire("ariaWidget",this);c()});f.addCommand("source",c.commands.source);f.ui.addButton&&f.ui.addButton("Source",{label:f.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});f.on("mode",function(){f.getCommand("source").setState("source"==f.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var e=CKEDITOR.env.ie&&9==
1080 source:1},editorFocus:!1,readOnly:1,exec:function(a){"wysiwyg"==a.mode&&a.fire("saveSnapshot");a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);a.setMode("source"==a.mode?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,