/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('smiley',function(a){var b=a.config,c=a.lang.smiley,d=b.smiley_images,e=8,f,g,h=function(m){var n=m.data.getTarget(),o=n.getName();if(o=='td')n=n.getChild([0,0]);else if(o=='a')n=n.getChild(0);else if(o!='img')return;var p=n.getAttribute('cke_src'),q=n.getAttribute('title'),r=a.document.createElement('img',{attributes:{src:p,_cke_saved_src:p,title:q,alt:q}});a.insertElement(r);g.hide();m.data.preventDefault();},i=CKEDITOR.tools.addFunction(function(m,n){m=new CKEDITOR.dom.event(m);n=new CKEDITOR.dom.element(n);var o,p,q=m.getKeystroke(),r=a.lang.dir=='rtl';switch(q){case 38:if(o=n.getParent().getParent().getPrevious()){p=o.getChild([n.getParent().getIndex(),0]);p.focus();}m.preventDefault();break;case 40:if(o=n.getParent().getParent().getNext()){p=o.getChild([n.getParent().getIndex(),0]);if(p)p.focus();}m.preventDefault();break;case 32:h({data:m});m.preventDefault();break;case r?37:39:case 9:if(o=n.getParent().getNext()){p=o.getChild(0);p.focus();m.preventDefault(true);}else if(o=n.getParent().getParent().getNext()){p=o.getChild([0,0]);if(p)p.focus();m.preventDefault(true);}break;case r?39:37:case CKEDITOR.SHIFT+9:if(o=n.getParent().getPrevious()){p=o.getChild(0);p.focus();m.preventDefault(true);}else if(o=n.getParent().getParent().getPrevious()){p=o.getLast().getChild(0);p.focus();m.preventDefault(true);}break;default:return;}}),j=['
'+c.options+'',''],k=d.length;for(f=0;f');j.push('');if(f%e==e-1)j.push(''); }if(f');j.push('');}j.push('
','',b.smiley_descriptions[f],''+b.smiley_descriptions[f]+''+'','
');var l={type:'html',html:j.join(''),onLoad:function(m){g=m.sender;},focus:function(){var m=this.getElement().getElementsByTag('a').getItem(0);m.focus();},onClick:h,style:'width: 100%; border-collapse: separate;'};return{title:a.lang.smiley.title,minWidth:270,minHeight:120,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[l]}],buttons:[CKEDITOR.dialog.cancelButton]};});