tinymce.create("tinymce.plugins.wpFullscreenPlugin",{resize_timeout:!1,init:function(c,e){var l=this,t={},n=tinymce.DOM;function o(e,n){var t=tinymce.DOM,o=c.getBody(),i=t.get(c.id+"_ifr"),s=c.dom.win.scrollY;l.resize_timeout||(l.resize_timeout=!0,setTimeout(function(){l.resize_timeout=!1},500),(o=300<o.scrollHeight?o.scrollHeight:300)!=i.scrollHeight&&(t.setStyle(i,"height",o+"px"),c.getWin().scrollTo(0,0)),n&&"paste"==n.type&&tinymce.isWebKit&&setTimeout(function(){c.dom.win.scrollTo(0,s)},40))}c.addCommand("wpFullScreenClose",function(){c.getParam("wp_fullscreen_is_enabled")&&n.win.setTimeout(function(){tinyMCE.remove(c),n.remove("wp_mce_fullscreen_parent"),tinyMCE.settings=tinyMCE.oldSettings},10)}),c.addCommand("wpFullScreenSave",function(){var e=tinyMCE.get("wp_mce_fullscreen");e.focus(),tinyMCE.get(e.getParam("wp_fullscreen_editor_id")).setContent(e.getContent({format:"raw"}),{format:"raw"})}),c.addCommand("wpFullScreenInit",function(){var e=(c=tinyMCE.activeEditor).getDoc().body;tinyMCE.oldSettings=tinyMCE.settings,tinymce.each(c.settings,function(e,n){t[n]=e}),t.id="wp_mce_fullscreen",t.wp_fullscreen_is_enabled=!0,t.wp_fullscreen_editor_id=c.id,t.theme_advanced_resizing=!1,t.theme_advanced_statusbar_location="none",t.content_css=t.content_css?t.content_css+","+t.wp_fullscreen_content_css:t.wp_fullscreen_content_css,t.height=tinymce.isIE?e.scrollHeight:e.offsetHeight,tinymce.each(c.getParam("wp_fullscreen_settings"),function(e,n){t[n]=e}),(e=new tinymce.Editor("wp_mce_fullscreen",t)).onInit.add(function(e){var o=tinymce.DOM,i=o.select("a.mceButton",o.get("wp-fullscreen-buttons"));c.isHidden()?e.setContent(switchEditors.wpautop(e.getElement().value)):e.setContent(c.getContent()),setTimeout(function(){e.onNodeChange.add(function(e,n,t){tinymce.each(i,function(e){var n,t;(n=o.get("wp_mce_fullscreen_"+e.id.substr(6)))&&(t=n.className)&&(e.className=t)})})},1e3),e.dom.addClass(e.getBody(),"wp-fullscreen-editor"),e.focus()}),e.render(),"undefined"!=fullscreen&&e.dom.bind(e.dom.doc,"mousemove",function(e){fullscreen.bounder("showToolbar","hideToolbar",2e3,e)})}),c.addCommand("wpFullScreen",function(){"undefined"!=typeof fullscreen&&("wp_mce_fullscreen"==c.id?fullscreen.off():fullscreen.on())}),c.addButton("wp_fullscreen",{title:"wordpress.wp_fullscreen_desc",cmd:"wpFullScreen"}),!c.getParam("fullscreen_is_enabled")&&c.getParam("wp_fullscreen_is_enabled")&&(c.onInit.add(function(e,n){e.onChange.add(o),e.onSetContent.add(o),e.onPaste.add(o),e.onKeyUp.add(o),e.onPostRender.add(o),e.getBody().style.overflowY="hidden"}),c.getParam("autoresize_on_init",!0)&&c.onLoadContent.add(function(e,n){setTimeout(function(){o()},1200)}),c.addCommand("wpAutoResize",o))},getInfo:function(){return{longname:"WP Fullscreen",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}}),tinymce.PluginManager.add("wpfullscreen",tinymce.plugins.wpFullscreenPlugin);