Ticket #9774: bodywrap2.patch

File bodywrap2.patch, 20.3 KB (added by ElMoonLite, 11 years ago)

unified diff of /ckeditor.js (main combined minified file of v3.6.2)

  • .js

    old new  
    9797G=G.replace(/^[ \t]+|[ \t]+$/g,function(M,N,O){if(M.length==1)return '&nbsp;';else if(!N)return e.repeat('&nbsp;',M.length-1)+' ';else return ' '+e.repeat('&nbsp;',M.length-1);});G=G.replace(/[ \t]{2,}/g,function(M){return e.repeat('&nbsp;',M.length-1)+' ';});var H=E==1?'p':'div';if(!F)G=G.replace(/(\n{2})([\s\S]*?)(?:$|\1)/g,function(M,N,O){return '<'+H+'>'+O+'</'+H+'>';});G=G.replace(/\n/g,'<br>');if(!(F||c))G=G.replace(new RegExp('<br>(?=</'+H+'>)'),function(M){return e.repeat(M,2);});if(b.gecko||b.webkit){var I=new d.elementPath(D.getStartElement()),J=[];for(var K=0;K<I.elements.length;K++){var L=I.elements[K].getName();if(L in f.$inline)J.unshift(I.elements[K].getOuterHtml().match(/^<.*?>/));else if(L in f.$block)break;}G=J.join('')+G;}q.call(this,G);};function s(C){var D=this.getSelection(),E=D.getRanges(),F=C.getName(),G=f.$block[F],H=D.isLocked;if(H)D.unlock();var I,J,K,L;for(var M=E.length-1;M>=0;M--){I=E[M];if(!I.checkReadOnly()){I.deleteContents(1);J=!M&&C||C.clone(1);var N,O;if(G)while((N=I.getCommonAncestor(0,1))&&(O=f[N.getName()])&&!(O&&O[F])){if(N.getName() in f.span)I.splitElement(N);else if(I.checkStartOfBlock()&&I.checkEndOfBlock()){I.setStartBefore(N);I.collapse(true);N.remove();}else I.splitBlock();}I.insertNode(J);if(!K)K=J;}}if(K){I.moveToPosition(K,4);if(G){var P=K.getNext(n),Q=P&&P.type==1&&P.getName();if(Q&&f.$block[Q]&&f[Q]['#'])I.moveToElementEditStart(P);}}D.selectRanges([I]);if(H)this.getSelection().lock();};function t(C){if(!C.checkDirty())setTimeout(function(){C.resetDirty();},0);};var u=d.walker.whitespaces(true),v=d.walker.bookmark(false,true);function w(C){return u(C)&&v(C);};function x(C){return C.type==3&&e.trim(C.getText()).match(/^(?:&nbsp;|\xa0)$/);};function y(C){if(C.isLocked){C.unlock();setTimeout(function(){C.lock();},0);}};function z(C){return C.getOuterHtml().match(m);};u=d.walker.whitespaces(true);function A(C){var D=C.window,E=C.document,F=C.document.getBody(),G=F.getFirst(),H=F.getChildren().count();if(!H||H==1&&G.type==1&&G.hasAttribute('_moz_editor_bogus_node')){t(C);var I=C.element.getDocument(),J=I.getDocumentElement(),K=J.$.scrollTop,L=J.$.scrollLeft,M=E.$.createEvent('KeyEvents');M.initKeyEvent('keypress',true,true,D.$,false,false,false,false,0,32);E.$.dispatchEvent(M);if(K!=J.$.scrollTop||L!=J.$.scrollLeft)I.getWindow().$.scrollTo(L,K);H&&F.getFirst().remove();E.getBody().appendBogus();var N=new d.range(E);N.setStartAt(F,1);N.select();}};function B(C){var D=C.editor,E=C.data.path,F=E.blockLimit,G=C.data.selection,H=G.getRanges()[0],I=D.document.getBody(),J=D.config.enterMode;
    9898if(b.gecko){A(D);var K=E.block||E.blockLimit,L=K&&K.getLast(w);if(K&&K.isBlockBoundary()&&!(L&&L.type==1&&L.isBlockBoundary())&&!K.is('pre')&&!K.getBogus())K.appendBogus();}if(D.config.autoParagraph!==false&&J!=2&&H.collapsed&&F.getName()=='body'&&!E.block){var M=H.fixBlock(true,D.config.enterMode==3?'div':'p');if(c){var N=M.getFirst(w);N&&x(N)&&N.remove();}if(z(M)){var O=M.getNext(u);if(O&&O.type==1&&!o(O)){H.moveToElementEditStart(O);M.remove();}else{O=M.getPrevious(u);if(O&&O.type==1&&!o(O)){H.moveToElementEditEnd(O);M.remove();}}}H.select();C.cancel();}var P=new d.range(D.document);P.moveToElementEditEnd(D.document.getBody());var Q=new d.elementPath(P.startContainer);if(!Q.blockLimit.is('body')){var R;if(J!=2)R=I.append(D.document.createElement(J==1?'p':'div'));else R=I;if(!c)R.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(C){var D=C.config.enterMode!=2&&C.config.autoParagraph!==false?C.config.enterMode==3?'div':'p':false,E=C.lang.editorTitle.replace('%1',C.name),F;C.on('editingBlockReady',function(){var L,M,N,O,P,Q,R=b.isCustomDomain(),S=function(V){if(M)M.remove();var W='document.open();'+(R?'document.domain="'+document.domain+'";':'')+'document.close();';W=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(W)+'}())':'';M=h.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0" title="'+E+'"'+' src="'+W+'"'+' tabIndex="'+(b.webkit?-1:C.tabIndex)+'"'+' allowTransparency="true"'+'></iframe>');if(document.location.protocol=='chrome:')a.event.useCapture=true;M.on('load',function(X){P=1;X.removeListener();var Y=M.getFrameDocument();Y.write(V);b.air&&U(Y.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;L.append(M);};F=e.addFunction(U);var T='<script id="cke_actscrpt" type="text/javascript" data-cke-temp="1">'+(R?'document.domain="'+document.domain+'";':'')+'window.parent.CKEDITOR.tools.callFunction( '+F+', window );'+'</script>';function U(V){if(!P)return;P=0;C.fire('ariaWidget',M);var W=V.document,X=W.body,Y=W.getElementById('cke_actscrpt');Y&&Y.parentNode.removeChild(Y);X.spellcheck=!C.config.disableNativeSpellChecker;var Z=!C.readOnly;if(c){X.hideFocus=true;X.disabled=true;X.contentEditable=Z;X.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)W.$.body.contentEditable=Z;else if(b.webkit)W.$.body.parentNode.contentEditable=Z;else W.$.designMode=Z?'off':'on';},0);Z&&b.gecko&&e.setTimeout(A,0,null,C);V=C.window=new d.window(V);
    9999W=C.document=new g(W);Z&&W.on('dblclick',function(af){var ag=af.data.getTarget(),ah={element:ag,dialog:''};C.fire('doubleclick',ah);ah.dialog&&C.openDialog(ah.dialog);});c&&W.on('click',function(af){var ag=af.data.getTarget();if(ag.is('input')){var ah=ag.getAttribute('type');if(ah=='submit'||ah=='reset')af.data.preventDefault();}});if(!(c||b.opera))W.on('mousedown',function(af){var ag=af.data.getTarget();if(ag.is('img','hr','input','textarea','select'))C.getSelection().selectElement(ag);});if(b.gecko)W.on('mouseup',function(af){if(af.data.$.button==2){var ag=af.data.getTarget();if(!ag.getOuterHtml().replace(m,'')){var ah=new d.range(W);ah.moveToElementEditStart(ag);ah.select(true);}}});W.on('click',function(af){af=af.data;if(af.getTarget().is('a')&&af.$.button!=2)af.preventDefault();});if(b.webkit){W.on('mousedown',function(){ac=1;});W.on('click',function(af){if(af.data.getTarget().is('input','select'))af.data.preventDefault();});W.on('mouseup',function(af){if(af.data.getTarget().is('input','textarea'))af.data.preventDefault();});}if(Z&&c&&W.$.compatMode=='CSS1Compat'||b.gecko||b.opera){var aa=W.getDocumentElement();aa.on('mousedown',function(af){if(af.data.getTarget().equals(aa)){if(b.gecko&&b.version>=10900)J();K.focus();}});}var ab=c?M:V;ab.on('blur',function(){C.focusManager.blur();});var ac;ab.on('focus',function(){var af=C.document;if(Z&&b.gecko&&b.version>=10900)J();else if(b.opera)af.getBody().focus();else if(b.webkit)if(!ac){C.document.getDocumentElement().focus();ac=1;}C.focusManager.focus();});var ad=C.keystrokeHandler;ad.blockedKeystrokes[8]=!Z;ad.attach(W);W.getDocumentElement().addClass(W.$.compatMode);Z&&W.on('keydown',function(af){var ag=af.data.getKeystroke();if(ag in {8:1,46:1}){var ah=C.getSelection(),ai=ah.getSelectedElement(),aj=ah.getRanges()[0];if(ai){C.fire('saveSnapshot');aj.moveToPosition(ai,3);ai.remove();aj.select();C.fire('saveSnapshot');af.data.preventDefault();return;}}});if(c&&W.$.compatMode=='CSS1Compat'){var ae={33:1,34:1};W.on('keydown',function(af){if(af.data.getKeystroke() in ae)setTimeout(function(){C.getSelection().scrollIntoView();},0);});}if(c&&C.config.enterMode!=1)W.on('selectionchange',function(){var af=W.getBody(),ag=C.getSelection().getRanges()[0];if(af.getHtml().match(/^<p>&nbsp;<\/p>$/i)&&ag.startContainer.equals(af))setTimeout(function(){ag=C.getSelection().getRanges()[0];if(!ag.startContainer.equals('body')){af.getFirst().remove(1);ag.moveToElementEditEnd(af);ag.select(1);}},0);});if(C.contextMenu)C.contextMenu.addTarget(W,C.config.browserContextMenuOnCtrl!==false);
    100 setTimeout(function(){C.fire('contentDom');if(Q){C.mode='wysiwyg';C.fire('mode',{previousMode:C._.previousMode});Q=false;}N=false;if(O){C.focus();O=false;}setTimeout(function(){C.fire('dataReady');},0);try{C.document.$.execCommand('enableInlineTableEditing',false,!C.config.disableNativeTableHandles);}catch(af){}if(C.config.disableObjectResizing)try{C.document.$.execCommand('enableObjectResizing',false,false);}catch(ag){C.document.getBody().on(c?'resizestart':'resize',function(ah){ah.data.preventDefault();});}if(c)setTimeout(function(){if(C.document){var ah=C.document.$.body;ah.runtimeStyle.marginBottom='0px';ah.runtimeStyle.marginBottom='';}},1000);},0);};C.addMode('wysiwyg',{load:function(V,W,X){L=V;if(c&&b.quirks)V.setStyle('position','relative');C.mayBeDirty=true;Q=true;if(X)this.loadSnapshotData(W);else this.loadData(W);},loadData:function(V){N=true;C._.dataStore={id:1};var W=C.config,X=W.fullPage,Y=W.docType,Z='<style type="text/css" data-cke-temp="1">'+C._.styles.join('\n')+'</style>';!X&&(Z=e.buildStyleHtml(C.config.contentsCss)+Z);var aa=W.baseHref?'<base href="'+W.baseHref+'" data-cke-temp="1" />':'';if(X)V=V.replace(/<!DOCTYPE[^>]*>/i,function(ab){C.docType=Y=ab;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ab){C.xmlDeclaration=ab;return '';});if(C.dataProcessor)V=C.dataProcessor.toHtml(V,D);if(X){if(!/<body[\s|>]/.test(V))V='<body>'+V;if(!/<html[\s|>]/.test(V))V='<html>'+V+'</html>';if(!/<head[\s|>]/.test(V))V=V.replace(/<html[^>]*>/,'$&<head><title></title></head>');else if(!/<title[\s|>]/.test(V))V=V.replace(/<head[^>]*>/,'$&<title></title>');aa&&(V=V.replace(/<head>/,'$&'+aa));V=V.replace(/<\/head\s*>/,Z+'$&');V=Y+V;}else V=W.docType+'<html dir="'+W.contentsLangDirection+'"'+' lang="'+(W.contentsLanguage||C.langCode)+'">'+'<head>'+'<title>'+E+'</title>'+aa+Z+'</head>'+'<body'+(W.bodyId?' id="'+W.bodyId+'"':'')+(W.bodyClass?' class="'+W.bodyClass+'"':'')+'>'+V+'</html>';if(b.gecko)V=V.replace(/<br \/>(?=\s*<\/(:?html|body)>)/,'$&<br type="_moz" />');V+=T;this.onDispose();S(V);},getData:function(){var V=C.config,W=V.fullPage,X=W&&C.docType,Y=W&&C.xmlDeclaration,Z=M.getFrameDocument(),aa=W?Z.getDocumentElement().getOuterHtml():Z.getBody().getHtml();if(b.gecko)aa=aa.replace(/<br>(?=\s*(:?$|<\/body>))/,'');if(C.dataProcessor)aa=C.dataProcessor.toDataFormat(aa,D);if(V.ignoreEmptyParagraph)aa=aa.replace(m,function(ab,ac){return ac;});if(Y)aa=Y+'\n'+aa;if(X)aa=X+'\n'+aa;return aa;},getSnapshotData:function(){return M.getFrameDocument().getBody().getHtml();
     100setTimeout(function(){C.fire('contentDom');if(Q){C.mode='wysiwyg';C.fire('mode',{previousMode:C._.previousMode});Q=false;}N=false;if(O){C.focus();O=false;}setTimeout(function(){C.fire('dataReady');},0);try{C.document.$.execCommand('enableInlineTableEditing',false,!C.config.disableNativeTableHandles);}catch(af){}if(C.config.disableObjectResizing)try{C.document.$.execCommand('enableObjectResizing',false,false);}catch(ag){C.document.getBody().on(c?'resizestart':'resize',function(ah){ah.data.preventDefault();});}if(c)setTimeout(function(){if(C.document){var ah=C.document.$.body;ah.runtimeStyle.marginBottom='0px';ah.runtimeStyle.marginBottom='';}},1000);},0);};C.addMode('wysiwyg',{load:function(V,W,X){L=V;if(c&&b.quirks)V.setStyle('position','relative');C.mayBeDirty=true;Q=true;if(X)this.loadSnapshotData(W);else this.loadData(W);},loadData:function(V){N=true;C._.dataStore={id:1};var W=C.config,X=W.fullPage,Y=W.docType,Z='<style type="text/css" data-cke-temp="1">'+C._.styles.join('\n')+'</style>';!X&&(Z=e.buildStyleHtml(C.config.contentsCss)+Z);var aa=W.baseHref?'<base href="'+W.baseHref+'" data-cke-temp="1" />':'';if(X)V=V.replace(/<!DOCTYPE[^>]*>/i,function(ab){C.docType=Y=ab;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ab){C.xmlDeclaration=ab;return '';});if(C.dataProcessor)V=C.dataProcessor.toHtml(V,D);if(X){if(!/<body[\s|>]/.test(V))V='<body>'+V;if(!/<html[\s|>]/.test(V))V='<html>'+V+'</html>';if(!/<head[\s|>]/.test(V))V=V.replace(/<html[^>]*>/,'$&<head><title></title></head>');else if(!/<title[\s|>]/.test(V))V=V.replace(/<head[^>]*>/,'$&<title></title>');aa&&(V=V.replace(/<head>/,'$&'+aa));V=V.replace(/<\/head\s*>/,Z+'$&');V=Y+V;}else V=W.docType+'<html dir="'+W.contentsLangDirection+'"'+' lang="'+(W.contentsLanguage||C.langCode)+'">'+'<head>'+'<title>'+E+'</title>'+aa+Z+'</head>'+'<body'+(W.bodyId?' id="'+W.bodyId+'"':'')+(W.bodyClass?' class="'+W.bodyClass+'"':'')+'>'+(W.bodyPrepend?'<!--BODYPREPENDBEGIN-->'+W.bodyPrepend+'<!--BODYPREPENDEND-->':'')+V+(W.bodyAppend?'<!--BODYAPPENDBEGIN-->'+W.bodyAppend+'<!--BODYAPPENDEND-->':'')+'</html>';if(b.gecko)V=V.replace(/<br \/>(?=\s*<\/(:?html|body)>)/,'$&<br type="_moz" />');V+=T;this.onDispose();S(V);},getData:function(){var V=C.config,W=V.fullPage,X=W&&C.docType,Y=W&&C.xmlDeclaration,Z=M.getFrameDocument(),aa=W?Z.getDocumentElement().getOuterHtml():Z.getBody().getHtml();if(!W&&V.bodyPrepend)aa=aa.replace(/<!--BODYPREPENDBEGIN-->[\s\S]*<!--BODYPREPENDEND-->/,'');if(!W&&V.bodyAppend)aa=aa.replace(/<!--BODYAPPENDBEGIN-->[\s\S]*<!--BODYAPPENDEND-->/,'');if(b.gecko)aa=aa.replace(/<br>(?=\s*(:?$|<\/body>))/,'');if(C.dataProcessor)aa=C.dataProcessor.toDataFormat(aa,D);if(V.ignoreEmptyParagraph)aa=aa.replace(m,function(ab,ac){return ac;});if(Y)aa=Y+'\n'+aa;if(X)aa=X+'\n'+aa;return aa;},getSnapshotData:function(){return M.getFrameDocument().getBody().getHtml();
    101101},loadSnapshotData:function(V){M.getFrameDocument().getBody().setHtml(V);},onDispose:function(){if(!C.document)return;C.document.getDocumentElement().clearCustomData();C.document.getBody().clearCustomData();C.window.clearCustomData();C.document.clearCustomData();M.clearCustomData();M.remove();},unload:function(V){this.onDispose();C.window=C.document=M=L=O=null;C.fire('contentDomUnload');},focus:function(){var V=C.window;if(N)O=true;else if(V){b.air?setTimeout(function(){V.focus();},0):V.focus();C.selectionChange();}}});C.on('insertHtml',p(q),null,null,20);C.on('insertElement',p(s),null,null,20);C.on('insertText',p(r),null,null,20);C.on('selectionChange',function(V){if(C.readOnly)return;var W=C.getSelection();if(W&&!W.isLocked){var X=C.checkDirty();C.fire('saveSnapshot',{contentOnly:1});B.call(this,V);C.fire('updateSnapshot');!X&&C.resetDirty();}},null,null,1);});var G;C.on('contentDom',function(){var L=C.document.getElementsByTag('title').getItem(0);L.data('cke-title',C.document.$.title);C.document.$.title=E;});C.on('readOnly',function(){if(C.mode=='wysiwyg'){var L=C.getMode();L.loadData(L.getData());}});if(a.document.$.documentMode>=8){C.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var H=[];for(var I in f.$removeEmpty)H.push('html.CSS1Compat '+I+'[contenteditable=false]');C.addCss(H.join(',')+'{ display:inline-block;}');}else if(b.gecko){C.addCss('html { height: 100% !important; }');C.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\twidth : 24px; height : 24px; }');}C.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');C.addCss('img, input, textarea { cursor: default;}');function J(L){if(C.readOnly)return;e.tryThese(function(){C.document.$.designMode='on';setTimeout(function(){C.document.$.designMode='off';if(a.currentInstance==C)C.document.getBody().focus();},50);},function(){C.document.$.designMode='off';var M=C.document.getBody();M.setAttribute('contentEditable',false);M.setAttribute('contentEditable',true);!L&&J(1);});};if(b.gecko||c||b.opera){var K;C.on('uiReady',function(){K=C.container.append(h.createFromHtml('<span tabindex="-1" style="position:absolute;" role="presentation"></span>'));K.on('focus',function(){C.focus();});C.focusGrabber=K;});C.on('destroy',function(){e.removeFunction(F);K.clearCustomData();delete C.focusGrabber;});}C.on('insertElement',function(L){var M=L.data;if(M.type==1&&(M.is('input')||M.is('textarea'))){var N=M.getAttribute('contenteditable')=='false';if(!N){M.data('cke-editable',M.hasAttribute('contenteditable')?'true':'1');
    102102M.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var C=document.body;if(!C)window.addEventListener('load',arguments.callee,false);else{var D=C.getAttribute('onpageshow');C.setAttribute('onpageshow',(D?D+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(S){return!!this._.tabs[S][0].$.offsetHeight;};function o(){var W=this;var S=W._.currentTabId,T=W._.tabIdList.length,U=e.indexOf(W._.tabIdList,S)+T;for(var V=U-1;V>U-T;V--){if(n.call(W,W._.tabIdList[V%T]))return W._.tabIdList[V%T];}return null;};function p(){var W=this;var S=W._.currentTabId,T=W._.tabIdList.length,U=e.indexOf(W._.tabIdList,S);for(var V=U+1;V<U+T;V++){if(n.call(W,W._.tabIdList[V%T]))return W._.tabIdList[V%T];}return null;};function q(S,T){var U=S.$.getElementsByTagName('input');for(var V=0,W=U.length;V<W;V++){var X=new h(U[V]);if(X.getAttribute('type').toLowerCase()=='text')if(T){X.setAttribute('value',X.getCustomData('fake_value')||'');X.removeCustomData('fake_value');}else{X.setCustomData('fake_value',X.getAttribute('value'));X.setAttribute('value','');}}};function r(S,T){var V=this;var U=V.getInputElement();if(U)S?U.removeAttribute('aria-invalid'):U.setAttribute('aria-invalid',true);if(!S)if(V.select)V.select();else V.focus();T&&alert(T);V.fire('validated',{valid:S,msg:T});};function s(){var S=this.getInputElement();S&&S.removeAttribute('aria-invalid');};a.dialog=function(S,T){var U=a.dialog._.dialogDefinitions[T],V=e.clone(u),W=S.config.dialog_buttonsOrder||'OS',X=S.lang.dir;if(W=='OS'&&b.mac||W=='rtl'&&X=='ltr'||W=='ltr'&&X=='rtl')V.buttons.reverse();
    103103U=e.extend(U(S),V);U=e.clone(U);U=new y(this,U);var Y=a.document,Z=S.theme.buildDialog(S);this._={editor:S,element:Z.element,name:T,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=Z.parts;e.setTimeout(function(){S.fire('ariaWidget',this.parts.contents);},0,this);var aa={position:b.ie6Compat?'absolute':'fixed',top:0,visibility:'hidden'};aa[X=='rtl'?'right':'left']=0;this.parts.dialog.setStyles(aa);a.event.call(this);this.definition=U=a.fire('dialogDefinition',{name:T,definition:U},S).definition;var ab={};if(!('removeDialogTabs' in S._)&&S.config.removeDialogTabs){var ac=S.config.removeDialogTabs.split(';');for(i=0;i<ac.length;i++){var ad=ac[i].split(':');if(ad.length==2){var ae=ad[0];if(!ab[ae])ab[ae]=[];ab[ae].push(ad[1]);}}S._.removeDialogTabs=ab;}if(S._.removeDialogTabs&&(ab=S._.removeDialogTabs[T]))for(i=0;i<ab.length;i++)U.removeContents(ab[i]);if(U.onLoad)this.on('load',U.onLoad);if(U.onShow)this.on('show',U.onShow);if(U.onHide)this.on('hide',U.onHide);if(U.onOk)this.on('ok',function(ar){S.fire('saveSnapshot');setTimeout(function(){S.fire('saveSnapshot');},0);if(U.onOk.call(this,ar)===false)ar.data.hide=false;});if(U.onCancel)this.on('cancel',function(ar){if(U.onCancel.call(this,ar)===false)ar.data.hide=false;});var af=this,ag=function(ar){var as=af._.contents,at=false;for(var au in as)for(var av in as[au]){at=ar.call(this,as[au][av]);if(at)return;}};this.on('ok',function(ar){ag(function(as){if(as.validate){var at=as.validate(this),au=typeof at=='string'||at===false;if(au){ar.data.hide=false;ar.stop();}r.call(as,!au,typeof at=='string'?at:undefined);return au;}});},this,null,0);this.on('cancel',function(ar){ag(function(as){if(as.isChanged()){if(!confirm(S.lang.common.confirmCancel))ar.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(ar){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();ar.data.preventDefault();},this);function ah(){var ar=af._.focusList;ar.sort(function(au,av){if(au.tabIndex!=av.tabIndex)return av.tabIndex-au.tabIndex;else return au.focusIndex-av.focusIndex;});var as=ar.length;for(var at=0;at<as;at++)ar[at].focusIndex=at;};function ai(ar){var as=af._.focusList,at=ar?1:-1;if(as.length<1)return;var au=af._.currentFocusIndex;try{as[au].getInputElement().$.blur();}catch(ax){}var av=(au+at+as.length)%as.length,aw=av;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy