(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);i.head=f.substring(0,a+1);var k=0,g;i.css="";while((k=i.head.indexOf("",k)+1;if((g=i.head.indexOf("\n'}i.head+=d.getParam("fullpage_default_doctype",'');i.head+="\n\n\n"+d.getParam("fullpage_default_title","Untitled document")+"\n";if(h=d.getParam("fullpage_default_encoding")){i.head+='\n'}if(h=d.getParam("fullpage_default_font_family")){j+="font-family: "+h+";"}if(h=d.getParam("fullpage_default_font_size")){j+="font-size: "+h+";"}if(h=d.getParam("fullpage_default_text_color")){j+="color: "+h+";"}i.head+="\n\n";i.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot);if(b.css){b._setStyle(a,b.css)}}},_setStyle:function(a,b){a.dom.remove("injectedCSS");var d=a.dom.doc,c=d.createElement("style");c.type="text/css";c.id="injectedCSS";if(c.styleSheet){c.styleSheet.cssText=b}else{c.appendChild(d.createTextNode(b))}d.getElementsByTagName("head")[0].appendChild(c)}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();