X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fmaximize%2Fplugin.js;h=ccd01c356ff6db479e03fa76443d6fa285ba3c96;hp=614d6ea50b4c35e64616abc4b9a830e4a4e4acb3;hb=8761695d9b70afe75905deaac88f78c1f8aeb32d;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/plugins/maximize/plugin.js b/plugins/maximize/plugin.js index 614d6ea..ccd01c3 100644 --- a/plugins/maximize/plugin.js +++ b/plugins/maximize/plugin.js @@ -3,5 +3,5 @@ Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -(function(){function a(f){if(!f||f.type!=CKEDITOR.NODE_ELEMENT||f.getName()!='form')return[];var g=[],h=['style','className'];for(var i=0;i0)for(var h=g.length-1;h>=0;h--){var i=g[h][0],j=g[h][1];if(j)i.insertBefore(j);else i.appendTo(f);}};function c(f,g){var h=a(f),i={},j=f.$;if(!g){i['class']=j.className||'';j.className='';}i.inline=j.style.cssText||'';if(!g)j.style.cssText='position: static; overflow: visible';b(h);return i;};function d(f,g){var h=a(f),i=f.$;if('class' in g)i.className=g['class'];if('inline' in g)i.style.cssText=g.inline;b(h);};function e(f,g){return function(){var h=f.getViewPaneSize();g.resize(h.width,h.height,null,true);};};CKEDITOR.plugins.add('maximize',{init:function(f){var g=f.lang,h=CKEDITOR.document,i=h.getWindow(),j,k,l,m=e(i,f),n=CKEDITOR.TRISTATE_OFF;f.addCommand('maximize',{modes:{wysiwyg:1,source:1},exec:function(){var x=this;var o=f.container.getChild([0,0]),p=f.getThemeSpace('contents');if(f.mode=='wysiwyg'){j=f.getSelection().getRanges();k=i.getScrollPosition();}else{var q=f.textarea.$;j=!CKEDITOR.env.ie&&[q.selectionStart,q.selectionEnd];k=[q.scrollLeft,q.scrollTop];}if(x.state==CKEDITOR.TRISTATE_OFF){i.on('resize',m);l=i.getScrollPosition();var r=f.container;while(r=r.getParent()){r.setCustomData('maximize_saved_styles',c(r));r.setStyle('z-index',f.config.baseFloatZIndex-1);}p.setCustomData('maximize_saved_styles',c(p,true));o.setCustomData('maximize_saved_styles',c(o,true));if(CKEDITOR.env.ie)h.$.documentElement.style.overflow=h.getBody().$.style.overflow='hidden';else h.getBody().setStyles({overflow:'hidden',width:'0px',height:'0px'});i.$.scrollTo(0,0);var s=i.getViewPaneSize();o.setStyle('position','absolute');o.$.offsetLeft;o.setStyles({'z-index':f.config.baseFloatZIndex-1,left:'0px',top:'0px'});f.resize(s.width,s.height,null,true);var t=o.getDocumentPosition();o.setStyles({left:-1*t.x+'px',top:-1*t.y+'px'});o.addClass('cke_maximized');}else if(x.state==CKEDITOR.TRISTATE_ON){i.removeListener('resize',m);var u=[p,o];for(var v=0;v0)for(var h=g.length-1;h>=0;h--){var i=g[h][0],j=g[h][1];if(j)i.insertBefore(j);else i.appendTo(f);}};function c(f,g){var h=a(f),i={},j=f.$;if(!g){i['class']=j.className||'';j.className='';}i.inline=j.style.cssText||'';if(!g)j.style.cssText='position: static; overflow: visible';b(h);return i;};function d(f,g){var h=a(f),i=f.$;if('class' in g)i.className=g['class'];if('inline' in g)i.style.cssText=g.inline;b(h);};function e(f,g){return function(){var h=f.getViewPaneSize();g.resize(h.width,h.height,null,true);};};CKEDITOR.plugins.add('maximize',{init:function(f){var g=f.lang,h=CKEDITOR.document,i=h.getWindow(),j,k,l,m=e(i,f),n=CKEDITOR.TRISTATE_OFF;f.addCommand('maximize',{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var B=this;var o=f.container.getChild([0,0]),p=f.getThemeSpace('contents');if(f.mode=='wysiwyg'){var q=f.getSelection();j=q&&q.getRanges();k=i.getScrollPosition();}else{var r=f.textarea.$;j=!CKEDITOR.env.ie&&[r.selectionStart,r.selectionEnd];k=[r.scrollLeft,r.scrollTop];}if(B.state==CKEDITOR.TRISTATE_OFF){i.on('resize',m);l=i.getScrollPosition();var s=f.container;while(s=s.getParent()){s.setCustomData('maximize_saved_styles',c(s));s.setStyle('z-index',f.config.baseFloatZIndex-1);}p.setCustomData('maximize_saved_styles',c(p,true));o.setCustomData('maximize_saved_styles',c(o,true));if(CKEDITOR.env.ie)h.$.documentElement.style.overflow=h.getBody().$.style.overflow='hidden';else h.getBody().setStyles({overflow:'hidden',width:'0px',height:'0px'});i.$.scrollTo(0,0);var t=i.getViewPaneSize();o.setStyle('position','absolute');o.$.offsetLeft;o.setStyles({'z-index':f.config.baseFloatZIndex-1,left:'0px',top:'0px'});f.resize(t.width,t.height,null,true);var u=o.getDocumentPosition();o.setStyles({left:-1*u.x+'px',top:-1*u.y+'px'});o.addClass('cke_maximized');}else if(B.state==CKEDITOR.TRISTATE_ON){i.removeListener('resize',m);var v=[p,o];for(var w=0;w