JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.5
[ckeditor.git] / plugins / autogrow / plugin.js
index e40289b..98bf893 100644 (file)
@@ -3,4 +3,4 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
-(function(){function a(c){var d=c.getStyle('overflow-y'),e=c.getDocument(),f=CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(CKEDITOR.env.webkit?'&nbsp;':'')+'</span>',e);e[CKEDITOR.env.ie?'getBody':'getDocumentElement']().append(f);var g=f.getDocumentPosition(e).y+f.$.offsetHeight;f.remove();c.setStyle('overflow-y',d);return g;};var b=function(c){if(!c.window)return;var d=c.document,e=new CKEDITOR.dom.element(d.getWindow().$.frameElement),f=d.getBody(),g=d.getDocumentElement(),h=c.window.getViewPaneSize().height,i=d.$.compatMode=='BackCompat'?f:g,j=a(i);j+=c.config.autoGrow_bottomSpace||0;var k=c.config.autoGrow_minHeight!=undefined?c.config.autoGrow_minHeight:200,l=c.config.autoGrow_maxHeight||Infinity;j=Math.max(j,k);j=Math.min(j,l);if(j!=h){j=c.fire('autoGrow',{currentHeight:h,newHeight:j}).newHeight;c.resize(c.container.getStyle('width'),j,true);}if(i.$.scrollHeight>i.$.clientHeight&&j<l)i.setStyle('overflow-y','hidden');else i.removeStyle('overflow-y');};CKEDITOR.plugins.add('autogrow',{init:function(c){c.addCommand('autogrow',{exec:b,modes:{wysiwyg:1},readOnly:1,canUndo:false,editorFocus:false});var d={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1};c.config.autoGrow_onStartup&&(d.instanceReady=1);for(var e in d)c.on(e,function(f){var g=c.getCommand('maximize');if(f.editor.mode=='wysiwyg'&&(!g||g.state!=CKEDITOR.TRISTATE_ON))setTimeout(function(){b(f.editor);b(f.editor);},100);});}});})();\r
+(function(){function a(d){var e=d.getStyle('overflow-y'),f=d.getDocument(),g=CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(CKEDITOR.env.webkit?'&nbsp;':'')+'</span>',f);f[CKEDITOR.env.ie?'getBody':'getDocumentElement']().append(g);var h=g.getDocumentPosition(f).y+g.$.offsetHeight;g.remove();d.setStyle('overflow-y',e);return h;};function b(d){var e=d.document,f=e.getBody(),g=e.getDocumentElement();return e.$.compatMode=='BackCompat'?f:g;};var c=function(d){if(!d.window)return;var e=b(d),f=d.window.getViewPaneSize().height,g=a(e);g+=d.config.autoGrow_bottomSpace||0;var h=d.config.autoGrow_minHeight!=undefined?d.config.autoGrow_minHeight:200,i=d.config.autoGrow_maxHeight||Infinity;g=Math.max(g,h);g=Math.min(g,i);if(g!=f){g=d.fire('autoGrow',{currentHeight:f,newHeight:g}).newHeight;d.resize(d.container.getStyle('width'),g,true);}if(e.$.scrollHeight>e.$.clientHeight&&g<i)e.setStyle('overflow-y','hidden');else e.removeStyle('overflow-y');};CKEDITOR.plugins.add('autogrow',{init:function(d){d.addCommand('autogrow',{exec:c,modes:{wysiwyg:1},readOnly:1,canUndo:false,editorFocus:false});var e={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1};d.config.autoGrow_onStartup&&(e.instanceReady=1);for(var f in e)d.on(f,function(g){var h=d.getCommand('maximize');if(g.editor.mode=='wysiwyg'&&(!h||h.state!=CKEDITOR.TRISTATE_ON))setTimeout(function(){c(g.editor);c(g.editor);},100);});d.on('beforeCommandExec',function(g){if(g.data.name=='maximize'&&g.editor.mode=='wysiwyg')if(g.data.command.state==CKEDITOR.TRISTATE_OFF){var h=b(d);h.removeStyle('overflow');}else c(d);});}});})();\r