versions of the editor.
\r
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {\r
if (!f.alt.value) {\r
- tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
+ tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
if (s)\r
t.insertAndClose();\r
});\r
var target = getSelectValue(formObj, 'targetlist');\r
\r
setAttrib(elm, 'href', href);\r
- setAttrib(elm, 'mce_href', href);\r
setAttrib(elm, 'title');\r
setAttrib(elm, 'target', target == '_self' ? '' : target);\r
setAttrib(elm, 'id');\r
function getSelectValue(form_obj, field_name) {\r
var elm = form_obj.elements[field_name];\r
\r
- if (elm == null || elm.options == null)\r
+ if (!elm || elm.options == null || elm.selectedIndex == -1)\r
return "";\r
\r
return elm.options[elm.selectedIndex].value;\r
-(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},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(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content,v,st='';c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='';if(ed.getParam('fullpage_default_xml_pi'))t.head+='<?xml version="1.0" encoding="'+ed.getParam('fullpage_default_encoding','ISO-8859-1')+'" ?>\n';t.head+=ed.getParam('fullpage_default_doctype','<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');t.head+='\n<html>\n<head>\n<title>'+ed.getParam('fullpage_default_title','Untitled document')+'</title>\n';if(v=ed.getParam('fullpage_default_encoding'))t.head+='<meta http-equiv="Content-Type" content="'+v+'" />\n';if(v=ed.getParam('fullpage_default_font_family'))st+='font-family: '+v+';';if(v=ed.getParam('fullpage_default_font_size'))st+='font-size: '+v+';';if(v=ed.getParam('fullpage_default_text_color'))st+='color: '+v+';';t.head+='</head>\n<body'+(st?' style="'+st+'"':'')+'>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})();
\ No newline at end of file
+(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},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(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(bdattr){for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content,v,st='';c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='';if(ed.getParam('fullpage_default_xml_pi'))t.head+='<?xml version="1.0" encoding="'+ed.getParam('fullpage_default_encoding','ISO-8859-1')+'" ?>\n';t.head+=ed.getParam('fullpage_default_doctype','<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');t.head+='\n<html>\n<head>\n<title>'+ed.getParam('fullpage_default_title','Untitled document')+'</title>\n';if(v=ed.getParam('fullpage_default_encoding'))t.head+='<meta http-equiv="Content-Type" content="'+v+'" />\n';if(v=ed.getParam('fullpage_default_font_family'))st+='font-family: '+v+';';if(v=ed.getParam('fullpage_default_font_size'))st+='font-size: '+v+';';if(v=ed.getParam('fullpage_default_text_color'))st+='color: '+v+';';t.head+='</head>\n<body'+(st?' style="'+st+'"':'')+'>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})();
\ No newline at end of file
if (attr && attr[1]) {\r
bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);\r
\r
- for(i = 0, len = bdattr.length; i < len; i++) {\r
- kv = bdattr[i].split('=');\r
- k = kv[0].replace(/\s/,'');\r
- v = kv[1];\r
-\r
- if (v) {\r
- v = v.replace(/^\s+/,'').replace(/\s+$/,'');\r
- t = v.match(/^["'](.*)["']$/);\r
-\r
- if (t)\r
- v = t[1];\r
- } else\r
- v = k;\r
-\r
- ed.dom.setAttrib(ed.getBody(), 'style', v);\r
+ if (bdattr) {\r
+ for(i = 0, len = bdattr.length; i < len; i++) {\r
+ kv = bdattr[i].split('=');\r
+ k = kv[0].replace(/\s/,'');\r
+ v = kv[1];\r
+\r
+ if (v) {\r
+ v = v.replace(/^\s+/,'').replace(/\s+$/,'');\r
+ t = v.match(/^["'](.*)["']$/);\r
+\r
+ if (t)\r
+ v = t[1];\r
+ } else\r
+ v = k;\r
+\r
+ ed.dom.setAttrib(ed.getBody(), 'style', v);\r
+ }\r
}\r
}\r
},\r
\r
switch (eq.toLowerCase()) {\r
case "content-type":\r
- tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, value, 1);\r
+ tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);\r
\r
// Override XML encoding\r
if (tmp != "")\r
}\r
\r
function changedStyleField(field) {\r
- //alert(field.id);\r
}\r
\r
function setMeta(he, k, v) {\r
-(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
\ No newline at end of file
+(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(tinymce.isIE&&(s.fullscreen_html_overflow=='visible'||s.fullscreen_html_overflow=='scroll'))s.fullscreen_html_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:'+(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel)?'absolute':'fixed')+';top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
\ No newline at end of file
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')\r
s.fullscreen_overflow = 'auto';\r
\r
+ // Fixes an IE bug where the scrollbars doesn't reappear\r
+ if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))\r
+ s.fullscreen_html_overflow = 'auto'; \r
+\r
if (s.fullscreen_overflow == '0px')\r
s.fullscreen_overflow = '';\r
\r
if (tinymce.isIE)\r
vp.h -= 1;\r
\r
- n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:absolute;top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});\r
+ n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});\r
DOM.add(n, 'div', {id : 'mce_fullscreen'});\r
\r
tinymce.each(ed.settings, function(v, n) {\r
settings[key] = "window.opener." + settings[key];\r
}\r
\r
- var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings;\r
+ var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;\r
\r
// Clone array\r
for (var n in paSe)\r
settings['ask'] = false;\r
settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();\r
settings['fullscreen_is_enabled'] = true;\r
- settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id;\r
+ settings['fullscreen_editor_id'] = oeID;\r
settings['theme_advanced_resizing'] = false;\r
settings['strict_loading_mode'] = true;\r
\r
settings.save_onsavecallback = function() {\r
- window.opener.tinyMCE.activeEditor.setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});\r
- window.opener.tinyMCE.activeEditor.execCommand('mceSave');\r
+ window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});\r
+ window.opener.tinyMCE.get(oeID).execCommand('mceSave');\r
window.close();\r
};\r
\r
}\r
\r
function moveContent() {\r
- window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());\r
+ window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());\r
}\r
\r
function closeFullscreen() {\r
function render() {\r
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;\r
\r
- e.value = window.opener.tinyMCE.activeEditor.getContent();\r
+ e.value = window.opener.tinyMCE.get(oeID).getContent();\r
\r
vp = dom.getViewPort();\r
settings.width = vp.w;\r
-(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{left:vp.x,top:vp.y,zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{left:vp.x,top:vp.y,zIndex:t.zIndex+1}});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw,id;id=t._findId(id||win);t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(!id&&win){t.parent(win);return;}if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();
\ No newline at end of file
+(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;t.windows={};},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type','modal')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceModalBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w;if(w=t.windows[id]){w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;}},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{zIndex:t.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceEventBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw,id;id=t._findId(id||win);if(!t.windows[id]){t.parent(win);return;}t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();
\ No newline at end of file
t.parent(ed);\r
t.zIndex = 300000;\r
t.count = 0;\r
+ t.windows = {};\r
},\r
\r
open : function(f, p) {\r
});\r
\r
// Add window\r
- t.windows = t.windows || {};\r
w = t.windows[id] = {\r
id : id,\r
mousedown_func : mdf,\r
});\r
\r
// Setup blocker\r
- if (t.count == 0 && t.editor.getParam('dialog_type') == 'modal') {\r
+ if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {\r
DOM.add(DOM.doc.body, 'div', {\r
id : 'mceModalBlocker',\r
'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',\r
- style : {left : vp.x, top : vp.y, zIndex : t.zIndex - 1}\r
+ style : {zIndex : t.zIndex - 1}\r
});\r
\r
DOM.show('mceModalBlocker'); // Reduces flicker in IE\r
} else\r
DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);\r
\r
+ if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))\r
+ DOM.setStyles('mceModalBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2});\r
+\r
t.focus(id);\r
t._fixIELayout(id, 1);\r
\r
},\r
\r
focus : function(id) {\r
- var t = this, w = t.windows[id];\r
-\r
- w.zIndex = this.zIndex++;\r
- w.element.setStyle('zIndex', w.zIndex);\r
- w.element.update();\r
+ var t = this, w;\r
\r
- id = id + '_wrapper';\r
- DOM.removeClass(t.lastId, 'mceFocus');\r
- DOM.addClass(id, 'mceFocus');\r
- t.lastId = id;\r
+ if (w = t.windows[id]) {\r
+ w.zIndex = this.zIndex++;\r
+ w.element.setStyle('zIndex', w.zIndex);\r
+ w.element.update();\r
+\r
+ id = id + '_wrapper';\r
+ DOM.removeClass(t.lastId, 'mceFocus');\r
+ DOM.addClass(id, 'mceFocus');\r
+ t.lastId = id;\r
+ }\r
},\r
\r
_addAll : function(te, ne) {\r
DOM.add(d.body, 'div', {\r
id : 'mceEventBlocker',\r
'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),\r
- style : {left : vp.x, top : vp.y, zIndex : t.zIndex + 1}\r
+ style : {zIndex : t.zIndex + 1}\r
});\r
+\r
+ if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))\r
+ DOM.setStyles('mceEventBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2});\r
+\r
eb = new Element('mceEventBlocker');\r
eb.update();\r
\r
\r
id = t._findId(id || win);\r
\r
- t.count--;\r
-\r
- if (t.count == 0)\r
- DOM.remove('mceModalBlocker');\r
-\r
// Probably not inline\r
- if (!id && win) {\r
+ if (!t.windows[id]) {\r
t.parent(win);\r
return;\r
}\r
\r
+ t.count--;\r
+\r
+ if (t.count == 0)\r
+ DOM.remove('mceModalBlocker');\r
+\r
if (w = t.windows[id]) {\r
t.onClose.dispatch(t);\r
Event.remove(d, 'mousedown', w.mousedownFunc);\r
/* General */
.clearlooks2 {position:absolute; direction:ltr}
.clearlooks2 .mceWrapper {position:static}
-.mceEventBlocker {position:absolute; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
+.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50)}
-.clearlooks2_modalBlocker {position:absolute; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; filter:alpha(opacity=60); display:none}
+.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; filter:alpha(opacity=60); display:none}
/* Top */
.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
-(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object|embed)([^>]*)>/gi,'</span>');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(!/^(width|height|codebase|classid)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});}});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align','flashvars','src','wmode'],function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})();
\ No newline at end of file
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.onPreInit.add(function(){ed.serializer.addRules('param[name|value|_value]');});ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};ed.selection.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.selection.onBeforeSetContent.add(t._objectsToSpans,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(t._objectsToSpans,t);ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_objectsToSpans:function(ed,o){var t=this,h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+t.url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object)([^>]*)>/gi,'</span>');h=h.replace(/<\/embed>/gi,'');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';if(v)dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});}});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align','flashvars','src','wmode','allowfullscreen','quality'],function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})();
\ No newline at end of file
return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);\r
};\r
\r
+ ed.onPreInit.add(function() {\r
+ // Force in _value parameter this extra parameter is required for older Opera versions\r
+ ed.serializer.addRules('param[name|value|_value]');\r
+ });\r
+\r
// Register commands\r
ed.addCommand('mceMedia', function() {\r
ed.windowManager.open({\r
mceItemRealMedia : 'realmedia'\r
};\r
\r
+ ed.selection.onSetContent.add(function() {\r
+ t._spansToImgs(ed.getBody());\r
+ });\r
+\r
+ ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);\r
+\r
if (ed.settings.content_css !== false)\r
ed.dom.loadCSS(url + "/css/content.css");\r
\r
}\r
});\r
\r
- ed.onBeforeSetContent.add(function(ed, o) {\r
- var h = o.content;\r
-\r
- h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {\r
- var o = t._parse(c);\r
-\r
- return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'\r
- });\r
-\r
- h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');\r
- h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');\r
- h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>');\r
- h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'});\r
- h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');\r
-\r
- o.content = h;\r
- });\r
+ ed.onBeforeSetContent.add(t._objectsToSpans, t);\r
\r
ed.onSetContent.add(function() {\r
t._spansToImgs(ed.getBody());\r
},\r
\r
// Private methods\r
+ _objectsToSpans : function(ed, o) {\r
+ var t = this, h = o.content;\r
+\r
+ h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {\r
+ var o = t._parse(c);\r
+\r
+ return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'\r
+ });\r
+\r
+ h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');\r
+ h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');\r
+ h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');\r
+ h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');\r
+ h = h.replace(/<\/embed>/gi, '');\r
+ h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'});\r
+ h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');\r
+\r
+ o.content = h;\r
+ },\r
\r
_buildObj : function(o, n) {\r
var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title);\r
p.src = ed.convertURL(p.src, 'src', n);\r
\r
each (p, function(v, k) {\r
- if (!/^(width|height|codebase|classid)$/.test(k)) {\r
+ if (!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)) {\r
// Use url instead of src in IE for Windows media\r
if (o.type == 'application/x-mplayer2' && k == 'src')\r
k = 'url';\r
\r
- dom.add(ob, 'span', {mce_name : 'param', name : k, '_value' : v});\r
+ if (v)\r
+ dom.add(ob, 'span', {mce_name : 'param', name : k, '_value' : v});\r
}\r
});\r
\r
});\r
\r
// Setup base parameters\r
- each(['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode'], function(na) {\r
+ each(['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality'], function(na) {\r
var v = dom.getAttrib(n, na);\r
\r
if (v)\r
tinyMCEPopup.restoreSelection();\r
\r
if (!AutoValidator.validate(f)) {\r
- alert(ed.getLang('invalid_data'));\r
+ tinyMCEPopup.alert(ed.getLang('invalid_data'));\r
return false;\r
}\r
\r
-(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,this.editor.dom.encode(content));}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p> <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]> <\/h[1-6]>/gi,'<p> </p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b> <\/b>/gi,'<b> </b>');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+| )').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})();
\ No newline at end of file
+(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(!this.editor.selection.isCollapsed())this.editor.execCommand("Delete");if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g,"");content=content.replace(/<(meta|link)[^>]+>/g,"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p> <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]> <\/h[1-6]>/gi,'<p> </p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b> <\/b>/gi,'<b> </b>');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+| )').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})();
\ No newline at end of file
return Event.cancel(e);\r
},\r
\r
- _insertText : function(content, bLinebreaks) { \r
+ _insertText : function(content, bLinebreaks) {\r
+ content = this.editor.dom.encode(content);\r
+\r
if (content && content.length > 0) {\r
+ // Delete any highlighted text before pasting\r
+ if (!this.editor.selection.isCollapsed())\r
+ this.editor.execCommand("Delete"); \r
+\r
if (bLinebreaks) { \r
// Special paragraph treatment \r
if (this.editor.getParam("paste_create_paragraphs", true)) {\r
content = content.replace(/\n/g, '<br />');\r
}\r
} \r
- \r
- this.editor.execCommand("mceInsertRawHTML", false, this.editor.dom.encode(content)); \r
+\r
+ this.editor.execCommand("mceInsertRawHTML", false, content); \r
}\r
},\r
\r
if (ed.getParam('paste_insert_word_content_callback'))\r
content = ed.execCallback('paste_insert_word_content_callback', 'before', content);\r
\r
- var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');\r
+ var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');\r
for (var i=0; i<rl.length; i+=2)\r
content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);\r
\r
content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list\r
content = content.replace(/<o:p><\/o:p>/gi, "");\r
content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks\r
- content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments\r
+ content = content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g, ""); // Word comments\r
+ content = content.replace(/<(meta|link)[^>]+>/g, ""); // Header elements\r
\r
if (this.editor.getParam("paste_remove_spans", true))\r
content = content.replace(/<\/?span[^>]*>/gi, "");\r
-(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePreview',t._preview,t);ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_preview:function(){var ed=this.editor,win,html,c,pos,pos2,css,i,page=ed.getParam("plugin_preview_pageurl",null),w=ed.getParam("plugin_preview_width","550"),h=ed.getParam("plugin_preview_height","600");if(page){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",null),width:w,height:h},{resizable:"yes",scrollbars:"yes",inline:1});}else{win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+w+",height="+h);html="";c=ed.getContent();pos=c.indexOf('<body');css=ed.getParam("content_css",'').split(',');tinymce.map(css,function(u){return ed.documentBaseURI.toAbsolute(u);});if(pos!=-1){pos=c.indexOf('>',pos);pos2=c.lastIndexOf('</body>');c=c.substring(pos+1,pos2);}html+=ed.getParam('doctype');html+='<html xmlns="http://www.w3.org/1999/xhtml">';html+='<head>';html+='<title>'+ed.getLang('preview.preview_desc')+'</title>';html+='<base href="'+ed.documentBaseURI.getURI()+'" />';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(i=0;i<css.length;i++)html+='<link href="'+css[i]+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body dir="'+ed.getParam("directionality")+'" onload="window.opener.tinymce.EditorManager.get(\''+ed.id+'\').plugins[\'preview\']._onLoad(window,document);">';html+=c;html+='</body>';html+='</html>';win.document.write(html);win.document.close();}},_onLoad:function(w,d){var t=this,nl,i,el=[],sv,ne;t._doc=d;w.writeFlash=t._writeFlash;w.writeShockWave=t._writeShockWave;w.writeQuickTime=t._writeQuickTime;w.writeRealMedia=t._writeRealMedia;w.writeWindowsMedia=t._writeWindowsMedia;w.writeEmbed=t._writeEmbed;nl=d.getElementsByTagName("script");for(i=0;i<nl.length;i++){sv=tinymce.isIE?nl[i].innerHTML:nl[i].firstChild.nodeValue;if(new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*','g').test(sv))el[el.length]=nl[i];}for(i=0;i<el.length;i++){ne=d.createElement("div");ne.innerHTML=d._embeds[i];el[i].parentNode.insertBefore(ne.firstChild,el[i]);}},_writeFlash:function(p){p.src=this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('D27CDB6E-AE6D-11cf-96B8-444553540000','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','application/x-shockwave-flash',p);},_writeShockWave:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('166B1BCA-3F9C-11CF-8075-444553540000','http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0','application/x-director',p);},_writeQuickTime:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('02BF25D5-8C17-4B23-BC80-D3488ABDDC6B','http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0','video/quicktime',p);},_writeRealMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','audio/x-pn-realaudio-plugin',p);},_writeWindowsMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);p.url=p.src;TinyMCE_PreviewPlugin._writeEmbed('6BF52A52-394A-11D3-B153-00C04F79FAA6','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701','application/x-mplayer2',p);},_writeEmbed:function(cls,cb,mt,p){var h='',n,d=t._doc,ne,c;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?'id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?'name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?'width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?'height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?'align="'+p.align+'"':'';h+='>';for(n in p)h+='<param name="'+n+'" value="'+p[n]+'">';h+='<embed type="'+mt+'"';for(n in p)h+=n+'="'+p[n]+'" ';h+='></embed></object>';d._embeds[d._embeds.length]=h;}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})();
\ No newline at end of file
+(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;tinymce.each(css,function(u,k){css[k]=ed.documentBaseURI.toAbsolute(u);});ed.addCommand('mcePreview',function(){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",url+"/preview.html"),width:parseInt(ed.getParam("plugin_preview_width","550")),height:parseInt(ed.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:css.join(','),inline:ed.getParam("plugin_preview_inline",1)},{base:ed.documentBaseURI.getURI()});});ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})();
\ No newline at end of file
(function() {
tinymce.create('tinymce.plugins.Preview', {
init : function(ed, url) {
- var t = this;
+ var t = this, css = tinymce.explode(ed.settings.content_css);
t.editor = ed;
- ed.addCommand('mcePreview', t._preview, t);
+ // Force absolute CSS urls
+ tinymce.each(css, function(u, k) {
+ css[k] = ed.documentBaseURI.toAbsolute(u);
+ });
+
+ ed.addCommand('mcePreview', function() {
+ ed.windowManager.open({
+ file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
+ width : parseInt(ed.getParam("plugin_preview_width", "550")),
+ height : parseInt(ed.getParam("plugin_preview_height", "600")),
+ resizable : "yes",
+ scrollbars : "yes",
+ popup_css : css.join(','),
+ inline : ed.getParam("plugin_preview_inline", 1)
+ }, {
+ base : ed.documentBaseURI.getURI()
+ });
+ });
+
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
},
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
- },
-
- // Private methods
-
- _preview : function() {
- var ed = this.editor, win, html, c, pos, pos2, css, i, page = ed.getParam("plugin_preview_pageurl", null), w = ed.getParam("plugin_preview_width", "550"), h = ed.getParam("plugin_preview_height", "600");
-
- // Use a custom preview page
- if (page) {
- ed.windowManager.open({
- file : ed.getParam("plugin_preview_pageurl", null),
- width : w,
- height : h
- }, {
- resizable : "yes",
- scrollbars : "yes",
- inline : 1
- });
- } else {
- win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + w + ",height=" + h);
- html = "";
- c = ed.getContent();
- pos = c.indexOf('<body');
- css = ed.getParam("content_css", '').split(',');
-
- tinymce.map(css, function(u) {
- return ed.documentBaseURI.toAbsolute(u);
- });
-
- if (pos != -1) {
- pos = c.indexOf('>', pos);
- pos2 = c.lastIndexOf('</body>');
- c = c.substring(pos + 1, pos2);
- }
-
- html += ed.getParam('doctype');
- html += '<html xmlns="http://www.w3.org/1999/xhtml">';
- html += '<head>';
- html += '<title>' + ed.getLang('preview.preview_desc') + '</title>';
- html += '<base href="' + ed.documentBaseURI.getURI() + '" />';
- html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
-
- for (i=0; i<css.length; i++)
- html += '<link href="' + css[i] + '" rel="stylesheet" type="text/css" />';
-
- html += '</head>';
- html += '<body dir="' + ed.getParam("directionality") + '" onload="window.opener.tinymce.EditorManager.get(\'' + ed.id + '\').plugins[\'preview\']._onLoad(window,document);">';
- html += c;
- html += '</body>';
- html += '</html>';
-
- win.document.write(html);
- win.document.close();
- }
- },
-
- _onLoad : function(w, d) {
- var t = this, nl, i, el = [], sv, ne;
-
- t._doc = d;
- w.writeFlash = t._writeFlash;
- w.writeShockWave = t._writeShockWave;
- w.writeQuickTime = t._writeQuickTime;
- w.writeRealMedia = t._writeRealMedia;
- w.writeWindowsMedia = t._writeWindowsMedia;
- w.writeEmbed = t._writeEmbed;
-
- nl = d.getElementsByTagName("script");
- for (i=0; i<nl.length; i++) {
- sv = tinymce.isIE ? nl[i].innerHTML : nl[i].firstChild.nodeValue;
-
- if (new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*', 'g').test(sv))
- el[el.length] = nl[i];
- }
-
- for (i=0; i<el.length; i++) {
- ne = d.createElement("div");
- ne.innerHTML = d._embeds[i];
- el[i].parentNode.insertBefore(ne.firstChild, el[i]);
- }
- },
-
- _writeFlash : function(p) {
- p.src = this.editor.documentBaseURI.toAbsolute(p.src);
- TinyMCE_PreviewPlugin._writeEmbed(
- 'D27CDB6E-AE6D-11cf-96B8-444553540000',
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
- 'application/x-shockwave-flash',
- p
- );
- },
-
- _writeShockWave : function(p) {
- this.editor.documentBaseURI.toAbsolute(p.src);
- TinyMCE_PreviewPlugin._writeEmbed(
- '166B1BCA-3F9C-11CF-8075-444553540000',
- 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
- 'application/x-director',
- p
- );
- },
-
- _writeQuickTime : function(p) {
- this.editor.documentBaseURI.toAbsolute(p.src);
- TinyMCE_PreviewPlugin._writeEmbed(
- '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
- 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
- 'video/quicktime',
- p
- );
- },
-
- _writeRealMedia : function(p) {
- this.editor.documentBaseURI.toAbsolute(p.src);
- TinyMCE_PreviewPlugin._writeEmbed(
- 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
- 'audio/x-pn-realaudio-plugin',
- p
- );
- },
-
- _writeWindowsMedia : function(p) {
- this.editor.documentBaseURI.toAbsolute(p.src);
- p.url = p.src;
- TinyMCE_PreviewPlugin._writeEmbed(
- '6BF52A52-394A-11D3-B153-00C04F79FAA6',
- 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
- 'application/x-mplayer2',
- p
- );
- },
-
- _writeEmbed : function(cls, cb, mt, p) {
- var h = '', n, d = t._doc, ne, c;
-
- h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
- h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
- h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
- h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
- h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
- h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
- h += '>';
-
- for (n in p)
- h += '<param name="' + n + '" value="' + p[n] + '">';
-
- h += '<embed type="' + mt + '"';
-
- for (n in p)
- h += n + '="' + p[n] + '" ';
-
- h += '></embed></object>';
-
- d._embeds[d._embeds.length] = h;
}
});
-(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&(e.shiftKey||ed.settings.force_br_newlines&&ed.selection.getNode().nodeName!='LI')){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})();
\ No newline at end of file
+(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})();
\ No newline at end of file
(function() {\r
var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit;\r
\r
+ function isEmpty(d, e, f) {\r
+ var w, n;\r
+\r
+ w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false);\r
+ while (n = w.nextNode()) {\r
+ // Filter func\r
+ if (f) {\r
+ if (!f(n))\r
+ return false;\r
+ }\r
+\r
+ // Non whitespace text node\r
+ if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue))\r
+ return false;\r
+\r
+ // Is non text element byt still content\r
+ if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName))\r
+ return false;\r
+ }\r
+\r
+ return true;\r
+ };\r
+\r
tinymce.create('tinymce.plugins.Safari', {\r
init : function(ed) {\r
var t = this, dom;\r
t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];\r
t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];\r
\r
- // Safari will crash if the build in createlink command is used\r
-/* ed.addCommand('CreateLink', function(u, v) {\r
- ed.execCommand("mceInsertContent", false, '<a href="' + dom.encode(v) + '">' + ed.selection.getContent() + '</a>');\r
- });*/\r
+ // Safari CreateLink command will not work correctly on images that is aligned\r
+ ed.addCommand('CreateLink', function(u, v) {\r
+ var n = ed.selection.getNode(), dom = ed.dom, a;\r
+\r
+ if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) {\r
+ a = dom.create('a', {href : v}, n.cloneNode());\r
+ n.parentNode.replaceChild(a, n);\r
+ ed.selection.select(a);\r
+ } else\r
+ ed.getDoc().execCommand("CreateLink", false, v);\r
+ });\r
\r
ed.onPaste.add(function(ed, e) {\r
function removeStyles(e) {\r
ed.getDoc().execCommand("Delete", false, ' ');\r
});\r
\r
- // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973\r
ed.onKeyPress.add(function(ed, e) {\r
- if (e.keyCode == 13 && (e.shiftKey || ed.settings.force_br_newlines && ed.selection.getNode().nodeName != 'LI')) {\r
- t._insertBR(ed);\r
- Event.cancel(e);\r
+ var se, li, lic, r1, r2, n, sel, doc, be, af, pa;\r
+\r
+ if (e.keyCode == 13) {\r
+ sel = ed.selection;\r
+ se = sel.getNode();\r
+\r
+ // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973\r
+ if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') {\r
+ t._insertBR(ed);\r
+ Event.cancel(e);\r
+ }\r
+\r
+ // Workaround for DIV elements produced by Safari\r
+ if (li = dom.getParent(se, 'LI')) {\r
+ lic = dom.getParent(li, 'OL,UL');\r
+ doc = ed.getDoc();\r
+\r
+ pa = dom.create('p');\r
+ dom.add(pa, 'br', {mce_bogus : "1"});\r
+\r
+ if (isEmpty(doc, li)) {\r
+ // If list in list then use browser default behavior\r
+ if (n = dom.getParent(lic.parentNode, 'LI,OL,UL'))\r
+ return;\r
+\r
+ n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic;\r
+\r
+ // Create range from the start of block element to the list item\r
+ r1 = doc.createRange();\r
+ r1.setStartBefore(n);\r
+ r1.setEndBefore(li);\r
+\r
+ // Create range after the list to the end of block element\r
+ r2 = doc.createRange();\r
+ r2.setStartAfter(li);\r
+ r2.setEndAfter(n);\r
+\r
+ be = r1.cloneContents();\r
+ af = r2.cloneContents();\r
+\r
+ if (!isEmpty(doc, af))\r
+ dom.insertAfter(af, n);\r
+\r
+ dom.insertAfter(pa, n);\r
+\r
+ if (!isEmpty(doc, be))\r
+ dom.insertAfter(be, n);\r
+\r
+ dom.remove(n);\r
+\r
+ n = pa.firstChild;\r
+ r1 = doc.createRange();\r
+ r1.setStartBefore(n);\r
+ r1.setEndBefore(n);\r
+ sel.setRng(r1);\r
+\r
+ return Event.cancel(e);\r
+ }\r
+ }\r
}\r
});\r
\r
// Safari returns incorrect values\r
- ed.addQueryValueHandler('FontSize', function(u, v) {\r
+/* ed.addQueryValueHandler('Fo2ntSize', function(u, v) {\r
var e, v;\r
\r
// Check for the real font size at the start of selection\r
});\r
\r
// Safari returns incorrect values\r
- ed.addQueryValueHandler('FontName', function(u, v) {\r
+ ed.addQueryValueHandler('Fo2ntName', function(u, v) {\r
var e, v;\r
\r
// Check for the real font name at the start of selection\r
if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontFamily))\r
- return v.replace(/, /g, ',');\r
+ return v.replace(/\'/g, '').replace(/, /g, ',');\r
\r
// Check for the real font name at the end of selection\r
if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontFamily))\r
- return v.replace(/, /g, ',');\r
+ return v.replace(/\'/g, '').replace(/, /g, ',');\r
\r
// Return default value it's better than nothing right!\r
return ed.getDoc().queryCommandValue('FontName');\r
- });\r
+ });*/\r
\r
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
ed.onClick.add(function(ed, e) {\r
ca = f[m + '_panel_casesensitivebox'].checked;\r
rs = f['replace_panel_replacestring'].value;\r
\r
+ if (s == '')\r
+ return;\r
+\r
function fix() {\r
// Correct Firefox graphics glitches\r
r = se.getRng().cloneRange();\r
\r
switch (a) {\r
case 'all':\r
+ // Move caret to beginning of text\r
+ ed.execCommand('SelectAll');\r
+ ed.selection.collapse(true);\r
+\r
if (tinymce.isIE) {\r
while (r.findText(s, b ? -1 : 1, fl)) {\r
r.scrollIntoView();\r
}\r
\r
if (fo)\r
- wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));\r
else\r
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
\r
return;\r
\r
case 'current':\r
- replace();\r
+ if (!ed.selection.isCollapsed())\r
+ replace();\r
+\r
break;\r
}\r
\r
r.scrollIntoView();\r
r.select();\r
} else\r
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
\r
tinyMCEPopup.storeSelection();\r
} else {\r
if (!w.find(s, ca, b, false, false, false, false))\r
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
else\r
fix();\r
}\r
+++ /dev/null
-(function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.StandardMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.addShortcut('ctrl+l','standardmenu.justifyleft_desc','JustifyLeft');ed.addShortcut('ctrl+e','standardmenu.justifycenter_desc','JustifyCenter');ed.addShortcut('ctrl+r','standardmenu.justifyright_desc','JustifyRight');ed.addShortcut('ctrl+j','standardmenu.justifyfull_desc','JustifyFull');ed.addShortcut('ctrl+alt+o','standardmenu.numlist_desc','InsertOrderedList');ed.addShortcut('ctrl+alt+u','standardmenu.bullist_desc','InsertUnorderedList');ed.addShortcut('ctrl+s','standardmenu.striketrough_desc','Strikethrough');ed.addShortcut('ctrl+alt+a','standardmenu.anchor_desc','mceInsertAnchor');ed.addShortcut('ctrl+alt+d','standardmenu.unlink_desc','unlink');ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(document,'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(document,'click',hide);}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);},getInfo:function(){return{longname:'Contextmenu',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x,offset_y:p1.y,constrain:1});t._menu=m;m.add({title:'standard.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'standard.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'standard.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'standard.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'standard.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'standard.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('standardmenu',tinymce.plugins.StandardMenu);})();
\ No newline at end of file
+++ /dev/null
-/**\r
- * $Id$\r
- *\r
- * @author Moxiecode\r
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
- */\r
-\r
-(function() {\r
- var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;\r
-\r
- tinymce.create('tinymce.plugins.StandardMenu', {\r
- init : function(ed) {\r
- var t = this;\r
-\r
- t.editor = ed;\r
- t.onContextMenu = new tinymce.util.Dispatcher(this);\r
-ed.addShortcut('ctrl+l', 'standardmenu.justifyleft_desc', 'JustifyLeft');\r
-ed.addShortcut('ctrl+e', 'standardmenu.justifycenter_desc', 'JustifyCenter');\r
-ed.addShortcut('ctrl+r', 'standardmenu.justifyright_desc', 'JustifyRight');\r
-ed.addShortcut('ctrl+j', 'standardmenu.justifyfull_desc', 'JustifyFull');\r
-ed.addShortcut('ctrl+alt+o', 'standardmenu.numlist_desc', 'InsertOrderedList');\r
-ed.addShortcut('ctrl+alt+u', 'standardmenu.bullist_desc', 'InsertUnorderedList');\r
-ed.addShortcut('ctrl+s', 'standardmenu.striketrough_desc', 'Strikethrough');\r
-ed.addShortcut('ctrl+alt+a', 'standardmenu.anchor_desc', 'mceInsertAnchor');\r
-ed.addShortcut('ctrl+alt+d', 'standardmenu.unlink_desc', 'unlink');\r
-\r
- ed.onContextMenu.add(function(ed, e) {\r
- if (!e.ctrlKey) {\r
- t._getMenu(ed).showMenu(e.clientX, e.clientY);\r
- Event.add(document, 'click', hide);\r
- Event.cancel(e);\r
- }\r
- });\r
-\r
- function hide() {\r
- if (t._menu) {\r
- t._menu.removeAll();\r
- t._menu.destroy();\r
- Event.remove(document, 'click', hide);\r
- }\r
- };\r
-\r
- ed.onMouseDown.add(hide);\r
- ed.onKeyDown.add(hide);\r
- },\r
-\r
- getInfo : function() {\r
- return {\r
- longname : 'Contextmenu',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- },\r
-\r
- _getMenu : function(ed) {\r
- var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;\r
-\r
- if (m) {\r
- m.removeAll();\r
- m.destroy();\r
- }\r
-\r
- p1 = DOM.getPos(ed.getContentAreaContainer());\r
- p2 = DOM.getPos(ed.getContainer());\r
-\r
- m = ed.controlManager.createDropMenu('contextmenu', {\r
- offset_x : p1.x,\r
- offset_y : p1.y,\r
-/* vp_offset_x : p2.x,\r
- vp_offset_y : p2.y,*/\r
- constrain : 1\r
- });\r
-\r
- t._menu = m;\r
-\r
- m.add({title : 'standard.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);\r
- m.add({title : 'standard.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);\r
- m.add({title : 'standard.paste_desc', icon : 'paste', cmd : 'Paste'});\r
-\r
- if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {\r
- m.addSeparator();\r
- m.add({title : 'standard.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
- m.add({title : 'standard.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
- }\r
-\r
- m.addSeparator();\r
- m.add({title : 'standard.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
-\r
- m.addSeparator();\r
- am = m.addMenu({title : 'contextmenu.align'});\r
- am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});\r
- am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});\r
- am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});\r
- am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});\r
-\r
- t.onContextMenu.dispatch(t, m, el, col);\r
-\r
- return m;\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('standardmenu', tinymce.plugins.StandardMenu);\r
-})();
\ No newline at end of file
-(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2> </$1>':'<$1$2><br mce_bogus="1" /></$1>');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getNextCell(table,cell){var cells=[],x=0,i,j,cell,nextCell;for(i=0;i<table.rows.length;i++)for(j=0;j<table.rows[i].cells.length;j++,x++)cells[x]=table.rows[i].cells[j];for(i=0;i<cells.length;i++)if(cells[i]==cell)if(nextCell=cells[i+1])return nextCell;}function getTableGrid(table){var grid=[],rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=[];for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=[];for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD"||tdElm.nodeName=="TH")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=[];for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})();
\ No newline at end of file
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2> </$1>':'<$1$2><br mce_bogus="1" /></$1>');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getNextCell(table,cell){var cells=[],x=0,i,j,cell,nextCell;for(i=0;i<table.rows.length;i++)for(j=0;j<table.rows[i].cells.length;j++,x++)cells[x]=table.rows[i].cells[j];for(i=0;i<cells.length;i++)if(cells[i]==cell)if(nextCell=cells[i+1])return nextCell;}function getTableGrid(table){var grid=[],rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=[];for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=[];for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD"||tdElm.nodeName=="TH")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=[];for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})();
\ No newline at end of file
if (!trElm || !tdElm)\r
return true;\r
\r
- var grid = getTableGrid(tableElm);\r
+ var grid = getTableGrid(inst.dom.getParent(tableElm, "table"));\r
var cpos = getCellPos(grid, tdElm);\r
var lastTDElm = null;\r
\r
if (!trElm || !tdElm)\r
return true;\r
\r
- var grid = getTableGrid(tableElm);\r
+ var grid = getTableGrid(inst.dom.getParent(tableElm, "table"));\r
var cpos = getCellPos(grid, tdElm);\r
var lastTDElm = null;\r
\r
var celltype = getSelectValue(formObj, 'celltype');\r
var scope = getSelectValue(formObj, 'scope');\r
\r
- if (ed.getParam("accessibility_warnings")) {\r
+ function doUpdate(s) {\r
+ if (s) {\r
+ updateCell(tdElm);\r
+\r
+ ed.addVisual();\r
+ ed.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+ }\r
+ };\r
+\r
+ if (ed.getParam("accessibility_warnings", 1)) {\r
if (celltype == "th" && scope == "")\r
- var answer = confirm(ed.getLang('table_dlg.missing_scope', '', true));\r
+ tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);\r
else\r
- var answer = true;\r
+ doUpdate(1);\r
\r
- if (!answer)\r
- return;\r
+ return;\r
}\r
\r
updateCell(tdElm);\r
tinyMCEPopup.restoreSelection();\r
\r
if (!AutoValidator.validate(f)) {\r
- alert(tinyMCEPopup.getLang('invalid_data'));\r
+ tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data'));\r
return false;\r
}\r
\r
tinyMCEPopup.restoreSelection();\r
\r
if (!AutoValidator.validate(formObj)) {\r
- alert(inst.getLang('invalid_data'));\r
+ tinyMCEPopup.alert(inst.getLang('invalid_data'));\r
return false;\r
}\r
\r
\r
// Validate table size\r
if (colLimit && cols > colLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
return false;\r
} else if (rowLimit && rows > rowLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
return false;\r
} else if (cellLimit && cols * rows > cellLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
return false;\r
}\r
\r
+++ /dev/null
-ins {\r
- border-bottom: 1px solid green;\r
- text-decoration: none;\r
- color: green;\r
-}\r
-\r
-del {\r
- color: Red;\r
- text-decoration: line-through;\r
-}\r
-\r
-cite {\r
- border-bottom: 1px dashed blue;\r
-}\r
-\r
-acronym {\r
- border-bottom: 1px dotted #CCC;\r
- cursor: help;\r
-}\r
-\r
-abbr, html\:abbr {\r
- border-bottom: 1px dashed #CCC;\r
- cursor: help;\r
-}\r
-(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');if(n){cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}else{cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})();
\ No newline at end of file
+(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})();
\ No newline at end of file
cm.setDisabled('del', co);\r
cm.setDisabled('ins', co);\r
cm.setDisabled('attribs', n && n.nodeName == 'BODY');\r
+ cm.setActive('cite', 0);\r
+ cm.setActive('acronym', 0);\r
+ cm.setActive('abbr', 0);\r
+ cm.setActive('del', 0);\r
+ cm.setActive('ins', 0);\r
\r
+ // Activate all\r
if (n) {\r
- cm.setDisabled(n.nodeName.toLowerCase(), 0);\r
- cm.setActive(n.nodeName.toLowerCase(), 1);\r
- } else {\r
- cm.setActive('cite', 0);\r
- cm.setActive('acronym', 0);\r
- cm.setActive('abbr', 0);\r
- cm.setActive('del', 0);\r
- cm.setActive('ins', 0);\r
+ do {\r
+ cm.setDisabled(n.nodeName.toLowerCase(), 0);\r
+ cm.setActive(n.nodeName.toLowerCase(), 1);\r
+ } while (n = n.parentNode);\r
}\r
});\r
},\r
if (elm == null) {\r
var s = SXE.inst.selection.getContent();\r
if(s.length > 0) {\r
- tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');\r
+ insertInlineElement('del');\r
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});\r
for (var i=0; i<elementArray.length; i++) {\r
var elm = elementArray[i];\r
tinyMCEPopup.close();\r
}\r
\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en), n, 1);\r
+ });\r
+}\r
+\r
function removeDel() {\r
SXE.removeElement('del');\r
tinyMCEPopup.close();\r
if (tinymce.isIE && element_name.indexOf('html:') == 0)\r
element_name = element_name.substring(5).toLowerCase();\r
\r
- h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';\r
-\r
- tinyMCEPopup.execCommand('mceInsertContent', false, h);\r
-\r
- var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});\r
+ insertInlineElement(element_name);\r
+ var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));\r
for (var i=0; i<elementArray.length; i++) {\r
var elm = elementArray[i];\r
\r
SXE.addClass = function(elm,cl) {\r
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;\r
return true;\r
-}
\ No newline at end of file
+}\r
+\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en), n, 1);\r
+ });\r
+}\r
if (elm == null) {\r
var s = SXE.inst.selection.getContent();\r
if(s.length > 0) {\r
- tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');\r
+ insertInlineElement('INS');\r
var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});\r
for (var i=0; i<elementArray.length; i++) {\r
var elm = elementArray[i];\r
tinyMCEPopup.close();\r
}\r
\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en), n, 1);\r
+ });\r
+}\r
+\r
tinyMCEPopup.onInit.add(init);\r
-(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));if(s.skin_variant)DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});if(c){each(ed.getParam('theme_advanced_font_sizes',t.settings.theme_advanced_font_sizes,'hash'),function(v,k){c.add(k!=v?k:lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'mceFontSize'+v});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(''+ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}());
\ No newline at end of file
+(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{sizes:[8,10,12,14,18,24,36],controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v,o;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:ed.settings.readonly},ed.settings);if(!s.font_size_style_values)s.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt";if(tinymce.is(s.theme_advanced_font_sizes,'string')){s.font_size_style_values=tinymce.explode(s.font_size_style_values);s.font_size_classes=tinymce.explode(s.font_size_classes||'');o={};ed.settings.theme_advanced_font_sizes=s.theme_advanced_font_sizes;each(ed.getParam('theme_advanced_font_sizes','','hash'),function(v,k){var cl;if(k==v&&v>=1&&v<=7){k=v+' ('+t.sizes[v-1]+'pt)';if(ed.settings.convert_fonts_to_spans){cl=s.font_size_classes[v-1];v=s.font_size_style_values[v-1]||(t.sizes[v-1]+'pt');}}if(/\s*\./.test(v))cl=v.replace(/\./g,'');o[k]=cl?{'class':cl}:{fontSize:v};});s.theme_advanced_font_sizes=o;}if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):url+"/skins/"+ed.settings.skin+"/ui.css");if(s.skin_variant)DOM.loadCSS(url+"/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css");},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){if(!c.NativeListBox){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);Event.add(n.id+'_open','focus',t._importClasses,t);Event.add(n.id+'_open','mousedown',t._importClasses,t);}else Event.add(n.id,'focus',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,i=0,cl=[];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',onselect:function(v){if(v.fontSize)ed.execCommand('FontSize',false,v.fontSize);else{each(t.settings.theme_advanced_font_sizes,function(v,k){if(v['class'])cl.push(v['class']);});ed.editorCommands._applyInlineStyle('span',{'class':v['class']},{check_classes:cl});}}});if(c){each(t.settings.theme_advanced_font_sizes,function(v,k){var fz=v.fontSize;if(fz>=1&&fz<=7)fz=t.sizes[parseInt(fz)-1]+'pt';c.add(k,v,{'style':'font-size:'+fz,'class':'mceFontSize'+(i++)+(' '+(v['class']||''))});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(s.readonly){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});return ic;}if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings,cl,fz,fn;if(s.readonly)return;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(ed.settings.convert_fonts_to_spans){ed.dom.getParent(n,function(n){if(n.nodeName==='SPAN'){if(!cl&&n.className)cl=n.className;if(!fz&&n.style.fontSize)fz=n.style.fontSize;if(!fn&&n.style.fontFamily)fn=n.style.fontFamily.replace(/[\"\']+/g,'').replace(/^([^,]+).*/,'$1').toLowerCase();}return false;});if(c=cm.get('fontselect')){c.select(function(v){return v.replace(/^([^,]+).*/,'$1').toLowerCase()==fn;});}if(c=cm.get('fontsizeselect')){c.select(function(v){if(v.fontSize&&v.fontSize===fz)return true;if(v['class']&&v['class']===cl)return true;});}}else{if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect')){v=ed.queryCommandValue('FontSize');c.select(function(iv){return iv.fontSize==v;});}}if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||n.nodeName==='BR'||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}());
\ No newline at end of file
tinymce.ThemeManager.requireLangPack('advanced');\r
\r
tinymce.create('tinymce.themes.AdvancedTheme', {\r
+ sizes : [8, 10, 12, 14, 18, 24, 36],\r
+\r
// Control name lookup, format: title, command\r
controls : {\r
bold : ['bold_desc', 'Bold'],\r
stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],\r
\r
init : function(ed, url) {\r
- var t = this, s, v;\r
+ var t = this, s, v, o;\r
\r
t.editor = ed;\r
t.url = url;\r
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",\r
theme_advanced_toolbar_align : "center",\r
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",\r
- theme_advanced_font_sizes : "1,2,3,4,5,6,7",\r
theme_advanced_more_colors : 1,\r
theme_advanced_row_height : 23,\r
theme_advanced_resize_horizontal : 1,\r
- theme_advanced_resizing_use_cookie : 1\r
+ theme_advanced_resizing_use_cookie : 1,\r
+ theme_advanced_font_sizes : "1,2,3,4,5,6,7",\r
+ readonly : ed.settings.readonly\r
}, ed.settings);\r
\r
+ // Setup default font_size_style_values\r
+ if (!s.font_size_style_values)\r
+ s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";\r
+\r
+ if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {\r
+ s.font_size_style_values = tinymce.explode(s.font_size_style_values);\r
+ s.font_size_classes = tinymce.explode(s.font_size_classes || '');\r
+\r
+ // Parse string value\r
+ o = {};\r
+ ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;\r
+ each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {\r
+ var cl;\r
+\r
+ if (k == v && v >= 1 && v <= 7) {\r
+ k = v + ' (' + t.sizes[v - 1] + 'pt)';\r
+\r
+ if (ed.settings.convert_fonts_to_spans) {\r
+ cl = s.font_size_classes[v - 1];\r
+ v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');\r
+ }\r
+ }\r
+\r
+ if (/\s*\./.test(v))\r
+ cl = v.replace(/\./g, '');\r
+\r
+ o[k] = cl ? {'class' : cl} : {fontSize : v};\r
+ });\r
+\r
+ s.theme_advanced_font_sizes = o;\r
+ }\r
+\r
if ((v = s.theme_advanced_path_location) && v != 'none')\r
s.theme_advanced_statusbar_location = s.theme_advanced_path_location;\r
\r
}\r
});\r
\r
- DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css || "themes/advanced/skins/" + ed.settings.skin + "/ui.css"));\r
+ DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");\r
\r
if (s.skin_variant)\r
- DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css || "themes/advanced/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"));\r
+ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");\r
},\r
\r
createControl : function(n, cf) {\r
});\r
\r
c.onPostRender.add(function(ed, n) {\r
- Event.add(n.id + '_text', 'focus', t._importClasses, t);\r
- Event.add(n.id + '_text', 'mousedown', t._importClasses, t);\r
+ if (!c.NativeListBox) {\r
+ Event.add(n.id + '_text', 'focus', t._importClasses, t);\r
+ Event.add(n.id + '_text', 'mousedown', t._importClasses, t);\r
+ Event.add(n.id + '_open', 'focus', t._importClasses, t);\r
+ Event.add(n.id + '_open', 'mousedown', t._importClasses, t);\r
+ } else\r
+ Event.add(n.id, 'focus', t._importClasses, t);\r
});\r
}\r
\r
},\r
\r
_createFontSizeSelect : function() {\r
- var t = this, ed = t.editor, c, lo = [\r
- "1 (8 pt)",\r
- "2 (10 pt)",\r
- "3 (12 pt)",\r
- "4 (14 pt)",\r
- "5 (18 pt)",\r
- "6 (24 pt)",\r
- "7 (36 pt)"\r
- ], fz = [8, 10, 12, 14, 18, 24, 36];\r
-\r
- c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', cmd : 'FontSize'});\r
+ var t = this, ed = t.editor, c, i = 0, cl = [];\r
+\r
+ c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {\r
+ if (v.fontSize)\r
+ ed.execCommand('FontSize', false, v.fontSize);\r
+ else {\r
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
+ if (v['class'])\r
+ cl.push(v['class']);\r
+ });\r
+\r
+ ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});\r
+ }\r
+ }});\r
+\r
if (c) {\r
- each(ed.getParam('theme_advanced_font_sizes', t.settings.theme_advanced_font_sizes, 'hash'), function(v, k) {\r
- c.add(k != v ? k : lo[parseInt(v) - 1], v, {'style' : 'font-size:' + fz[v - 1] + 'pt', 'class' : 'mceFontSize' + v});\r
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
+ var fz = v.fontSize;\r
+\r
+ if (fz >= 1 && fz <= 7)\r
+ fz = t.sizes[parseInt(fz) - 1] + 'pt';\r
+\r
+ c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});\r
});\r
}\r
\r
_simpleLayout : function(s, tb, o, p) {\r
var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;\r
\r
+ if (s.readonly) {\r
+ n = DOM.add(tb, 'tr');\r
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+ return ic;\r
+ }\r
+\r
// Create toolbar container at top\r
if (lo == 'top')\r
t._addToolbars(tb, o);\r
},\r
\r
_nodeChanged : function(ed, cm, n, co) {\r
- var t = this, p, de = 0, v, c, s = t.settings;\r
+ var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn;\r
+\r
+ if (s.readonly)\r
+ return;\r
\r
tinymce.each(t.stateControls, function(c) {\r
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));\r
c.select(p.nodeName.toLowerCase());\r
}\r
\r
- if (c = cm.get('fontselect'))\r
- c.select(ed.queryCommandValue('FontName'));\r
+ if (ed.settings.convert_fonts_to_spans) {\r
+ ed.dom.getParent(n, function(n) {\r
+ if (n.nodeName === 'SPAN') {\r
+ if (!cl && n.className)\r
+ cl = n.className;\r
+\r
+ if (!fz && n.style.fontSize)\r
+ fz = n.style.fontSize;\r
+\r
+ if (!fn && n.style.fontFamily)\r
+ fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();\r
+ }\r
+\r
+ return false;\r
+ });\r
+\r
+ if (c = cm.get('fontselect')) {\r
+ c.select(function(v) {\r
+ return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;\r
+ });\r
+ }\r
\r
- if (c = cm.get('fontsizeselect'))\r
- c.select('' + ed.queryCommandValue('FontSize'));\r
+ if (c = cm.get('fontsizeselect')) {\r
+ c.select(function(v) {\r
+ if (v.fontSize && v.fontSize === fz)\r
+ return true;\r
+\r
+ if (v['class'] && v['class'] === cl)\r
+ return true;\r
+ });\r
+ }\r
+ } else {\r
+ if (c = cm.get('fontselect'))\r
+ c.select(ed.queryCommandValue('FontName'));\r
+\r
+ if (c = cm.get('fontsizeselect')) {\r
+ v = ed.queryCommandValue('FontSize');\r
+ c.select(function(iv) {\r
+ return iv.fontSize == v;\r
+ });\r
+ }\r
+ }\r
\r
if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {\r
p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});\r
var na = n.nodeName.toLowerCase(), u, pi, ti = '';\r
\r
// Ignore non element and hidden elements\r
- if (n.nodeType != 1 || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))\r
+ if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))\r
return;\r
\r
// Fake name\r
if (v = DOM.getAttrib(n, 'mce_name'))\r
na = v;\r
- \r
+\r
// Handle prefix\r
if (tinymce.isIE && n.scopeName !== 'HTML')\r
na = n.scopeName + ':' + na;\r
ed = tinyMCEPopup.editor;\r
\r
// Give FF some time\r
- window.setTimeout('insertHelpIFrame();', 10);\r
+ window.setTimeout(insertHelpIFrame, 10);\r
\r
tcont = document.getElementById('plugintablecontainer');\r
document.getElementById('plugins_tab').style.display = 'none';\r
-(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.baseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,deltaHeight:-20};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add('simple',tinymce.themes.SimpleTheme);})();
\ No newline at end of file
+(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,deltaHeight:-20};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add('simple',tinymce.themes.SimpleTheme);})();
\ No newline at end of file
ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");\r
});\r
\r
- DOM.loadCSS((s.editor_css ? ed.baseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");\r
+ DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");\r
},\r
\r
renderUI : function(o) {\r
-var tinymce={majorVersion:"3",minorVersion:"0.9",releaseDate:"2008-06-02",_init:function(){var L=this,I=document,J=window,H=navigator,B=H.userAgent,G,A,F,E,D,K;L.isOpera=J.opera&&opera.buildNumber;L.isWebKit=/WebKit/.test(B);L.isOldWebKit=L.isWebKit&&!J.getSelection().getRangeAt;L.isIE=!L.isWebKit&&!L.isOpera&&(/MSIE/gi).test(B)&&(/Explorer/gi).test(H.appName);L.isIE6=L.isIE&&/MSIE [56]/.test(B);L.isGecko=!L.isWebKit&&/Gecko/.test(B);L.isMac=B.indexOf("Mac")!=-1;if(J.tinyMCEPreInit){L.suffix=tinyMCEPreInit.suffix;L.baseURL=tinyMCEPreInit.base;L.query=tinyMCEPreInit.query;return }L.suffix="";A=I.getElementsByTagName("base");for(G=0;G<A.length;G++){if(K=A[G].href){if(/^https?:\/\/[^\/]+$/.test(K)){K+="/"}E=K?K.match(/.*\//)[0]:""}}function C(M){if(M.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(M.src)){if(/_(src|dev)\.js/g.test(M.src)){L.suffix="_src"}if((D=M.src.indexOf("?"))!=-1){L.query=M.src.substring(D+1)}L.baseURL=M.src.substring(0,M.src.lastIndexOf("/"));if(E&&L.baseURL.indexOf("://")==-1){L.baseURL=E+L.baseURL}return L.baseURL}return null}A=I.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}F=I.getElementsByTagName("head")[0];if(F){A=F.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}}return },is:function(B,A){var C=typeof (B);if(!A){return C!="undefined"}if(A=="array"&&(B instanceof Array)){return true}return C==A},each:function(D,A,C){var E,B;if(!D){return 0}C=C||D;if(typeof (D.length)!="undefined"){for(E=0,B=D.length;E<B;E++){if(A.call(C,D[E],E,D)===false){return 0}}}else{for(E in D){if(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1},map:function(A,B){var C=[];tinymce.each(A,function(D){C.push(B(D))});return C},grep:function(A,B){var C=[];tinymce.each(A,function(D){if(!B||B(D)){C.push(D)}});return C},inArray:function(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1},extend:function(D,C){var B,A=arguments;for(B=1;B<A.length;B++){C=A[B];tinymce.each(C,function(E,F){if(typeof (E)!=="undefined"){D[F]=E}})}return D},trim:function(A){return(A?""+A:"").replace(/^\s*|\s*$/g,"")},create:function(I,A){var H=this,B,D,E,F,C,G=0;I=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(I);E=I[3].match(/(^|\.)(\w+)$/i)[2];D=H.createNS(I[3].replace(/\.\w+$/,""));if(D[E]){return }if(I[2]=="static"){D[E]=A;if(this.onCreate){this.onCreate(I[2],I[3],D[E])}return }if(!A[E]){A[E]=function(){};G=1}D[E]=A[E];H.extend(D[E].prototype,A);if(I[5]){B=H.resolve(I[5]).prototype;F=I[5].match(/\.(\w+)$/i)[1];C=D[E];if(G){D[E]=function(){return B[F].apply(this,arguments)}}else{D[E]=function(){this.parent=B[F];return C.apply(this,arguments)}}D[E].prototype[E]=D[E];H.each(B,function(J,K){D[E].prototype[K]=B[K]});H.each(A,function(J,K){if(B[K]){D[E].prototype[K]=function(){this.parent=B[K];return J.apply(this,arguments)}}else{if(K!=E){D[E].prototype[K]=J}}})}H.each(A["static"],function(J,K){D[E][K]=J});if(this.onCreate){this.onCreate(I[2],I[3],D[E].prototype)}},walk:function(C,B,D,A){A=A||this;if(C){if(D){C=C[D]}tinymce.each(C,function(F,E){if(B.call(A,F,E,D)===false){return false}tinymce.walk(F,B,D,A)})}},createNS:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0;B<D.length;B++){A=D[B];if(!C[A]){C[A]={}}C=C[A]}return C},resolve:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0,A=D.length;B<A;B++){C=C[D[B]];if(!C){break}}return C},addUnload:function(E,D){var C=this,A=window;E={func:E,scope:D||this};if(!C.unloads){function B(){var G=C.unloads,H,I;if(G){for(I in G){H=G[I];if(H&&H.func){H.func.call(H.scope,1)}}if(A.detachEvent){A.detachEvent("onbeforeunload",F);A.detachEvent("onunload",B)}else{if(A.removeEventListener){A.removeEventListener("unload",B,false)}}C.unloads=H=G=A=B=null;if(window.CollectGarbage){window.CollectGarbage()}}}function F(){var H=document;if(H.readyState=="interactive"){function G(){H.detachEvent("onstop",G);B();H=null}H.attachEvent("onstop",G);window.setTimeout(function(){H.detachEvent("onstop",G)},0)}}if(A.attachEvent){A.attachEvent("onunload",B);A.attachEvent("onbeforeunload",F)}else{if(A.addEventListener){A.addEventListener("unload",B,false)}}C.unloads=[E]}else{C.unloads.push(E)}return E},removeUnload:function(C){var A=this.unloads,B=null;tinymce.each(A,function(E,D){if(E&&E.func==C){A.splice(D,1);B=C;return false}});return B},explode:function(A,B){return A?tinymce.map(A.split(B||","),tinymce.trim):A},_addVer:function(B){var A;if(!this.query){return B}A=(B.indexOf("?")==-1?"?":"&")+this.query;if(B.indexOf("#")==-1){return B+A}return B.replace("#",A+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(A){this.scope=A||this;this.listeners=[]},add:function(A,B){this.listeners.push({cb:A,scope:B||this.scope});return A},addToTop:function(A,B){this.listeners.unshift({cb:A,scope:B||this.scope});return A},remove:function(A){var B=this.listeners,C=null;tinymce.each(B,function(E,D){if(A==E.cb){C=A;B.splice(D,1);return false}});return C},dispatch:function(){var D,B=arguments,C,A=this.listeners,E;for(C=0;C<A.length;C++){E=A[C];D=E.cb.apply(E.scope,B);if(D===false){break}}return D}});(function(){var A=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(D,F){var E=this,G,C,B;F=E.settings=F||{};if(/^(mailto|news|javascript|about):/i.test(D)||/^\s*#/.test(D)){E.source=D;return }if(D.indexOf("/")===0&&D.indexOf("//")!==0){D=(F.base_uri?F.base_uri.protocol||"http":"http")+"://mce_host"+D}if(D.indexOf("://")===-1&&D.indexOf("//")!==0){D=(F.base_uri.protocol||"http")+"://mce_host"+E.toAbsPath(F.base_uri.path,D)}D=D.replace(/@@/g,"(mce_at)");D=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(D);A(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(H,I){var J=D[I];if(J){J=J.replace(/\(mce_at\)/g,"@@")}E[H]=J});if(B=F.base_uri){if(!E.protocol){E.protocol=B.protocol}if(!E.userInfo){E.userInfo=B.userInfo}if(!E.port&&E.host=="mce_host"){E.port=B.port}if(!E.host||E.host=="mce_host"){E.host=B.host}E.source=""}},setPath:function(C){var B=this;C=/^(.*?)\/?(\w+)?$/.exec(C);B.path=C[0];B.directory=C[1];B.file=C[2];B.source="";B.getURI()},toRelative:function(B){var C=this,D;B=new tinymce.util.URI(B,{base_uri:C});if((B.host!="mce_host"&&C.host!=B.host&&B.host)||C.port!=B.port||C.protocol!=B.protocol){return B.getURI()}D=C.toRelPath(C.path,B.path);if(B.query){D+="?"+B.query}if(B.anchor){D+="#"+B.anchor}return D},toAbsolute:function(B,C){var B=new tinymce.util.URI(B,{base_uri:this});return B.getURI(this.host==B.host?C:0)},toRelPath:function(F,G){var B,E=0,C="",D;F=F.substring(0,F.lastIndexOf("/"));F=F.split("/");B=G.split("/");if(F.length>=B.length){for(D=0;D<F.length;D++){if(D>=B.length||F[D]!=B[D]){E=D+1;break}}}if(F.length<B.length){for(D=0;D<B.length;D++){if(D>=F.length||F[D]!=B[D]){E=D+1;break}}}if(E==1){return G}for(D=0;D<F.length-(E-1);D++){C+="../"}for(D=E-1;D<B.length;D++){if(D!=E-1){C+="/"+B[D]}else{C+=B[D]}}return C},toAbsPath:function(D,E){var C,B=0,F=[];D=D.split("/");E=E.split("/");A(D,function(G){if(G){F.push(G)}});D=F;for(C=E.length-1,F=[];C>=0;C--){if(E[C].length==0||E[C]=="."){continue}if(E[C]==".."){B++;continue}if(B>0){B--;continue}F.push(E[C])}C=D.length-B;if(C<=0){return"/"+F.reverse().join("/")}return"/"+D.slice(0,C).join("/")+"/"+F.reverse().join("/")},getURI:function(D){var C,B=this;if(!B.source||D){C="";if(!D){if(B.protocol){C+=B.protocol+"://"}if(B.userInfo){C+=B.userInfo+"@"}if(B.host){C+=B.host}if(B.port){C+=":"+B.port}}if(B.path){C+=B.path}if(B.query){C+="?"+B.query}if(B.anchor){C+="#"+B.anchor}B.source=C}return B.source}})})();(function(){var A=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(D){var B=this.get(D),C;if(B){A(B.split("&"),function(E){E=E.split("=");C=C||{};C[unescape(E[0])]=unescape(E[1])})}return C},setHash:function(H,B,E,D,G,C){var F="";A(B,function(J,I){F+=(!F?"":"&")+escape(I)+"="+escape(J)});this.set(H,F,E,D,G,C)},get:function(F){var E=document.cookie,D,C=F+"=",B;if(!E){return }B=E.indexOf("; "+C);if(B==-1){B=E.indexOf(C);if(B!=0){return null}}else{B+=2}D=E.indexOf(";",B);if(D==-1){D=E.length}return unescape(E.substring(B+C.length,D))},set:function(G,B,E,D,F,C){document.cookie=G+"="+escape(B)+((E)?"; expires="+E.toGMTString():"")+((D)?"; path="+escape(D):"")+((F)?"; domain="+F:"")+((C)?"; secure":"")},remove:function(D,B){var C=new Date();C.setTime(C.getTime()-1000);this.set(D,"",C,B,C)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(E){var C,A,D=tinymce.util.JSON.serialize,B;if(E==null){return"null"}B=typeof E;if(B=="string"){A="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+E.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(G,F){C=A.indexOf(F);if(C+1){return"\\"+A.charAt(C+1)}G=F.charCodeAt().toString(16);return"\\u"+"0000".substring(G.length)+G})+'"'}if(B=="object"){if(E instanceof Array){for(C=0,A="[";C<E.length;C++){A+=(C>0?",":"")+D(E[C])}return A+"]"}A="{";for(C in E){A+=typeof E[C]!="function"?(A.length>1?',"':'"')+C+'":'+D(E[C]):""}return A+"}"}return""+E},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(F){var A,D,B=window,G=0;F.scope=F.scope||this;F.success_scope=F.success_scope||F.scope;F.error_scope=F.error_scope||F.scope;F.async=F.async===false?false:true;F.data=F.data||"";function C(I){A=0;try{A=new ActiveXObject(I)}catch(H){}return A}A=B.XMLHttpRequest?new XMLHttpRequest():C("Microsoft.XMLHTTP")||C("Msxml2.XMLHTTP");if(A){if(A.overrideMimeType){A.overrideMimeType(F.content_type)}A.open(F.type||(F.data?"POST":"GET"),F.url,F.async);if(F.content_type){A.setRequestHeader("Content-Type",F.content_type)}A.send(F.data);function E(){if(!F.async||A.readyState==4||G++>10000){if(F.success&&G<10000&&A.status==200){F.success.call(F.success_scope,""+A.responseText,A,F)}else{if(F.error){F.error.call(F.error_scope,G>10000?"TIMED_OUT":"GENERAL",A,F)}}A=null}else{B.setTimeout(E,10)}}if(!F.async){return E()}D=B.setTimeout(E,10)}}});(function(){var C=tinymce.extend,B=tinymce.util.JSON,A=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(D){this.settings=C({},D);this.count=0},send:function(F){var E=F.error,D=F.success;F=C(this.settings,F);F.success=function(H,G){H=B.parse(H);if(typeof (H)=="undefined"){H={error:"JSON Parse error."}}if(H.error){E.call(F.error_scope||F.scope,H.error,G)}else{D.call(F.success_scope||F.scope,H.result)}};F.error=function(H,G){E.call(F.error_scope||F.scope,H,G)};F.data=B.serialize({id:F.id||"c"+(this.count++),method:F.method,params:F.params});F.content_type="application/json";A.send(F)},"static":{sendRPC:function(D){return new tinymce.util.JSONRequest().send(D)}}})}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand("BackgroundImageCache",false,true)}catch(e){t.cssFlicker=true}}tinymce.addUnload(t.destroy,t)},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight}},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,"width");h=t.getStyle(e,"height");if(w.indexOf("px")===-1){w=0}if(h.indexOf("px")===-1){h=0}return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight}},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root){r=r||this.getRoot()}if(is(f,"string")){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==="*"){s=true;return false}each(na.split(","),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false}});return s}}while(n){if(n==r){return null}if(f(n)){return n}n=n.parentNode}return null},get:function(e){var n;if(e&&this.doc&&typeof (e)=="string"){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n){return this.doc.getElementsByName(n)[1]}}return e},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id="_mc_tmp";pa="#_mc_tmp "+pa}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase())}}else{function get(s,n){return s.getElementsByTagName(n)}}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++){o.push(x[i])}return o}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||"*");c=" "+pl[2]+" ";for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(" "+n.className+" ").indexOf(c)!==-1){o.push(n)}}return o}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n)}}function collectIE(n){if(!n.getAttribute("mce_save")){n.setAttribute("mce_save","1");o.push(n)}}function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++){f(nl[i])}}each(pa.split(","),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n)});return }if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2])){collect(n)}});return }if(!(cs=t.cache[pa])){cs="x=(function(cf, s) {";pl=v.split(" ");each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||"*";cs+='find("'+p[1]+'", function(n) {';if(p[2]){cs+='if (n.id !== "'+p[2]+'") return;'}if(p[3]){cs+='var c = " " + n.className + " ";';cs+="if (";c="";each(p[3].split("."),function(v){if(v){c+=(c?"||":"")+'c.indexOf(" '+v+' ") === -1'}});cs+=c+") return;"}});cs+="cf(n);";for(i=pl.length-1;i>=0;i--){cs+="}, "+(i?"n":"s")+");"}cs+="})";t.cache[pa]=cs=eval(cs)}cs(isIE?collectIE:collect,s)});each(o,function(n){if(isIE){n.removeAttribute("mce_save")}else{delete n.mce_save}});return o},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,"string")?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],"object")){t.setAttrib(e,k,""+a[k])}}if(a.style&&!is(a.style,"string")){each(a.style,function(v,n){t.setStyle(e,n,v)})}}if(h){if(h.nodeType){e.appendChild(h)}else{t.setHTML(e,h)}}return !c?p.appendChild(e):e})},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1)},createHTML:function(n,a,h){var o="",t=this,k;o+="<"+n;for(k in a){if(a.hasOwnProperty(k)){o+=" "+k+'="'+t.encode(a[k])+'"'}}if(tinymce.is(h)){return o+">"+h+"</"+n+">"}return o+" />"},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p){return null}if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n)})}return p.removeChild(n)})},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(t.pixelStyles.test(na)&&(tinymce.is(v,"number")||/^[\-0-9\.]+$/.test(v))){v+="px"}switch(na){case"opacity":if(isIE){s.filter=v===""?"":"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout){s.display="inline-block"}}s[na]=s["-moz-opacity"]=s["-khtml-opacity"]=v||"";break;case"float":isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||""}if(t.settings.update_styles){t.setAttrib(e,"mce_style")}})},getStyle:function(n,na,c){n=this.get(n);if(!n){return false}if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return"-"+a});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(ex){return null}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(na=="float"){na=isIE?"styleFloat":"cssFloat"}if(n.currentStyle&&c){return n.currentStyle[na]}return n.style[na]},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v)});s.update_styles=ol;if(s.update_styles){t.setAttrib(e,s.cssText)}},setAttrib:function(e,n,v){var t=this;if(t.settings.strict){n=n.toLowerCase()}return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v&&!t._isRes(v)){e.setAttribute("mce_style",v,2)}else{e.removeAttribute("mce_style",2)}}e.style.cssText=v;break;case"class":e.className=v||"";break;case"src":case"href":if(s.keep_values){if(s.url_converter){v=s.url_converter.call(s.url_converter_scope||t,v,n,e)}t.setAttrib(e,"mce_"+n,v,2)}break}if(is(v)&&v!==null&&v.length!==0){e.setAttribute(n,""+v,2)}else{e.removeAttribute(n,2)}})},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v)})})},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1){return false}if(!is(dv)){dv=""}if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v){return v}}v=e.getAttribute(n,2);if(!v){switch(n){case"class":v=e.className;break;default:if(isIE&&n==="name"&&e.nodeName==="A"){v=e.name;break}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v}}switch(n){case"style":v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v)){e.setAttribute("mce_style",v)}}break}if(isWebKit&&n==="class"&&v){v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(isIE){switch(n){case"rowspan":case"colspan":if(v===1){v=""}break;case"size":if(v==="+0"){v=""}break;case"hspace":if(v===-1){v=""}break;case"tabindex":if(v===32768){v=""}break;case"shape":v=v.toLowerCase();break;default:if(n.indexOf("on")===0&&v){v=(""+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(v&&v!="")?""+v:dv},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select("html")[0],"borderWidth");x=(x=="medium"||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x}}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0}r=r.parentNode;if(r==d.body){break}}return{x:x,y:y}},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st){return o}function compress(p,s,ot){var t,r,b,l;t=o[p+"-top"+s];if(!t){return }r=o[p+"-right"+s];if(t!=r){return }b=o[p+"-bottom"+s];if(r!=b){return }l=o[p+"-left"+s];if(b!=l){return }o[ot]=l;delete o[p+"-top"+s];delete o[p+"-right"+s];delete o[p+"-bottom"+s];delete o[p+"-left"+s]}function compress2(ta,a,b,c){var t;t=o[a];if(!t){return }t=o[b];if(!t){return }t=o[c];if(!t){return }o[ta]=o[a]+" "+o[b]+" "+o[c];delete o[a];delete o[b];delete o[c]}each(st.split(";"),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return"url("+ur.length+")"});v=v.split(":");sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1]});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),"style",null))+")"})}o[tinymce.trim(v[0]).toLowerCase()]=sv}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2("border","border-width","border-style","border-color");if(isIE){if(o.border=="medium none"){o.border=""}}return o},serializeStyle:function(o){var s="";each(o,function(v,k){if(k&&v){switch(k){case"color":case"background-color":v=v.toLowerCase();break}s+=(s?" ":"")+k+": "+v+";"}});return s},loadCSS:function(u){var t=this,d=t.doc;if(!u){u=""}each(u.split(","),function(u){if(t.files[u]){return }t.files[u]=true;t.add(t.select("head")[0],"link",{rel:"stylesheet",href:tinymce._addVer(u)})})},addClass:function(e,c){return this.run(e,function(e){var o;if(!c){return 0}if(this.hasClass(e,c)){return e.className}o=this.removeClass(e,c);return e.className=(o!=""?(o+" "):"")+c})},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re){re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g")}v=e.className.replace(re," ");return e.className=tinymce.trim(v!=" "?v:"")}return e.className})},hasClass:function(n,c){n=this.get(n);if(!n||!c){return false}return(" "+n.className+" ").indexOf(" "+c+" ")!==-1},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){e=this.get(e);return e.style.display=="none"||this.getStyle(e,"display")=="none"},uniqueId:function(p){return(!p?"mce_":p)+(this.counter++)},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML="<br />"+h;e.removeChild(e.firstChild)}catch(ex){while(e.firstChild){e.firstChild.removeNode()}x=t.create("div");x.innerHTML="<br />"+h;each(x.childNodes,function(n,i){if(i){e.appendChild(n)}})}}if(t.settings.fix_ie_paragraphs){h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break}n.removeAttribute("mce_keep")}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,"</div>");set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement("p");n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=="mce_tmp"){v=n.getAttribute(b);if(!v&&b==="class"){v=n.className}p.setAttribute(b,v)}});for(x=0;x<n.childNodes.length;x++){p.appendChild(n.childNodes[x].cloneNode(true))}n.swapNode(p)}}}}}else{e.innerHTML=h}return h})},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html){return h}if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(isIE){h=h.replace(/'/g,"'")}}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(s.keep_values){if(h.indexOf("<script")!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,"<mce:script$1><!--\n");h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,"\n// --></mce:script>");h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,"<mce:script$1></mce:script>")}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf("mce_"+b)!=-1){return m}if(b=="style"){if(t._isRes(c)){return m}if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)})}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+")"})}}else{if(b!="coords"){if(s.url_converter){u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))}}}return" "+b+'="'+c+'" mce_'+b+'="'+u+'"'}a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle)})}return h},getOuterHTML:function(e){var d;e=this.get(e);if(!e){return null}if(isIE){return e.outerHTML}d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1){e.outerHTML=h}else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling}t.remove(e)}})},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return !e.firstChild?s:e.firstChild.nodeValue}return s},encode:function(s){return s?(""+s).replace(/[<>&\"]/g,function(c,b){switch(c){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return c}):s},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns){p.insertBefore(n,ns)}else{p.appendChild(n)}return n})},isBlock:function(n){if(n.nodeType&&n.nodeType!==1){return false}n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n)},replace:function(n,o,k){if(is(o,"array")){n=n.cloneNode(true)}return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true))})}return o.parentNode.replaceChild(n,o)})},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:"0"+s}if(c){s="#"+hex(c[1])+hex(c[2])+hex(c[3]);return s}return s},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes){return t.classes}function addClasses(s){each(s.imports,function(r){addClasses(r)});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(","),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v)){return }ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(f&&!(v=f(v,ov))){return }if(!lo[v]){cl.push({"class":v});lo[v]=1}})}break;case 3:addClasses(r.styleSheet);break}})}try{each(t.doc.styleSheets,addClasses)}catch(ex){}if(cl.length>0){t.classes=cl}return cl},run:function(e,f,s){var t=this,o;if(t.doc&&typeof (e)==="string"){e=t.doc.getElementById(e)}if(!e){return false}s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof (e)=="string"){e=t.doc.getElementById(e)}o.push(f.call(s,e,i))}});return o}return f.call(s,e)},getAttribs:function(n){var o;n=this.get(n);if(!n){return[]}if(isIE){o=[];if(n.nodeName=="OBJECT"){return n.attributes}n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b})});return o}return n.attributes},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s){tinymce.removeUnload(t.destroy)}},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c)}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0})})();(function(){var E=tinymce.each,C=tinymce.DOM,B=tinymce.isIE,D=tinymce.isWebKit,A;tinymce.create("static tinymce.dom.Event",{inits:[],events:[],add:function(L,M,K,I){var F,G=this,H=G.events,J;if(L&&L instanceof Array){J=[];E(L,function(N){N=C.get(N);J.push(G.add(N,M,K,I))});return J}L=C.get(L);if(!L){return }F=function(N){N=N||window.event;if(N&&!N.target&&B){N.target=N.srcElement}if(!I){return K(N)}return K.call(I,N)};if(M=="unload"){tinymce.unloads.unshift({func:F});return F}if(M=="init"){if(G.domLoaded){F()}else{G.inits.push(F)}return F}H.push({obj:L,name:M,func:K,cfunc:F,scope:I});G._add(L,M,F);return K},remove:function(K,L,J){var G=this,F=G.events,H=false,I;if(K&&K instanceof Array){I=[];E(K,function(M){M=C.get(M);I.push(G.remove(M,L,J))});return I}K=C.get(K);E(F,function(N,M){if(N.obj==K&&N.name==L&&(!J||(N.func==J||N.cfunc==J))){F.splice(M,1);G._remove(K,L,N.cfunc);H=true;return false}});return H},clear:function(J){var H=this,F=H.events,G,I;if(J){J=C.get(J);for(G=F.length-1;G>=0;G--){I=F[G];if(I.obj===J){H._remove(I.obj,I.name,I.cfunc);I.obj=I.cfunc=null;F.splice(G,1)}}}},cancel:function(F){if(!F){return false}this.stop(F);return this.prevent(F)},stop:function(F){if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}return false},prevent:function(F){if(F.preventDefault){F.preventDefault()}else{F.returnValue=false}return false},_unload:function(){var F=A;E(F.events,function(H,G){F._remove(H.obj,H.name,H.cfunc);H.obj=H.cfunc=null});F.events=[];F=null},_add:function(G,H,F){if(G.attachEvent){G.attachEvent("on"+H,F)}else{if(G.addEventListener){G.addEventListener(H,F,false)}else{G["on"+H]=F}}},_remove:function(H,I,G){if(H){try{if(H.detachEvent){H.detachEvent("on"+I,G)}else{if(H.removeEventListener){H.removeEventListener(I,G,false)}else{H["on"+I]=null}}}catch(F){}}},_pageInit:function(){var F=A;F._remove(window,"DOMContentLoaded",F._pageInit);F.domLoaded=true;E(F.inits,function(G){G()});F.inits=[]},_wait:function(){var F;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){A.domLoaded=1;return }if(B&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src='javascript:\"\"';><\/script>");C.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){A._pageInit();C.get("__ie_onload").onreadystatechange=null}}}else{A._add(window,"DOMContentLoaded",A._pageInit,A);if(B||D){F=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(F);A._pageInit()}},10)}}}});A=tinymce.dom.Event;A._wait();tinymce.addUnload(A._unload)})();(function(){var A=tinymce.each;tinymce.create("tinymce.dom.Element",{Element:function(F,D){var B=this,E,C;D=D||{};B.id=F;B.dom=E=D.dom||tinymce.DOM;B.settings=D;if(!tinymce.isIE){C=B.dom.get(B.id)}A(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(G){B[G]=function(){var H=arguments,I;if(tinymce.isOpera){H=[F];A(arguments,function(J){H.push(J)})}else{Array.prototype.unshift.call(H,C||F)}I=E[G].apply(E,H);B.update(G);return I}})},on:function(D,C,B){return tinymce.dom.Event.add(this.id,D,C,B)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var B=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||B.clientWidth),h:parseInt(this.getStyle("height")||B.clientHeight)}},moveTo:function(B,C){this.setStyles({left:B,top:C})},moveBy:function(B,D){var C=this.getXY();this.moveTo(C.x+B,C.y+D)},resizeTo:function(B,C){this.setStyles({width:B,height:C})},resizeBy:function(B,D){var C=this.getSize();this.resizeTo(C.w+B,C.h+D)},update:function(C){var D=this,B,E=D.dom;if(tinymce.isIE6&&D.settings.blocker){C=C||"";if(C.indexOf("get")===0||C.indexOf("has")===0||C.indexOf("is")===0){return }if(C=="remove"){E.remove(D.blocker);return }if(!D.blocker){D.blocker=E.uniqueId();B=E.add(D.settings.container||E.getRoot(),"iframe",{id:D.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});E.setStyle(B,"opacity",0)}else{B=E.get(D.blocker)}E.setStyle(B,"left",D.getStyle("left",1));E.setStyle(B,"top",D.getStyle("top",1));E.setStyle(B,"width",D.getStyle("width",1));E.setStyle(B,"height",D.getStyle("height",1));E.setStyle(B,"display",D.getStyle("display",1));E.setStyle(B,"zIndex",parseInt(D.getStyle("zIndex",1)||0)-1)}}})})();(function(){function D(E){return E.replace(/[\n\r]+/g,"")}var B=tinymce.is,A=tinymce.isIE,C=tinymce.each;tinymce.create("tinymce.dom.Selection",{Selection:function(H,G,F){var E=this;E.dom=H;E.win=G;E.serializer=F;tinymce.addUnload(E.destroy,E)},getContent:function(F){var E=this,G=E.getRng(),K=E.dom.create("body"),I=E.getSel(),H,J,L;F=F||{};H=J="";F.get=true;F.format=F.format||"html";if(F.format=="text"){return E.isCollapsed()?"":(G.text||(I.toString?I.toString():""))}if(G.cloneContents){L=G.cloneContents();if(L){K.appendChild(L)}}else{if(B(G.item)||B(G.htmlText)){K.innerHTML=G.item?G.item(0).outerHTML:G.htmlText}else{K.innerHTML=G.toString()}}if(/^\s/.test(K.innerHTML)){H=" "}if(/\s+$/.test(K.innerHTML)){J=" "}F.getInner=true;return E.isCollapsed()?"":H+E.serializer.serialize(K,F)+J},setContent:function(H,G){var F=this,I=F.getRng(),J=F.win.document;G=G||{format:"html"};G.set=true;H=F.dom.processHTML(H);if(I.insertNode){if(tinymce.isGecko&&H.indexOf("<")==-1){I.deleteContents();I.insertNode(F.getRng().createContextualFragment(H+'<span id="__caret">_</span>'));F.select(F.dom.get("__caret"));F.getRng().deleteContents();return }try{if(J.queryCommandEnabled("InsertHTML")){return J.execCommand("InsertHTML",false,H)}}catch(E){I.deleteContents();I.insertNode(F.getRng().createContextualFragment(H))}}else{if(I.item){J.execCommand("Delete",false,null);I=F.getRng()}I.pasteHTML(H)}},getStart:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(1);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.firstChild}return G}else{G=F.startContainer;if(G.nodeName=="BODY"){return G.firstChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getEnd:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(0);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.lastChild}return G}else{G=F.endContainer;if(G.nodeName=="BODY"){return G.lastChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getBookmark:function(T){var I=this,L=I.getRng(),E,M,K,Q=I.dom.getViewPort(I.win),R,O,V,N,S=-16777215,J,G=I.dom.getRoot(),F=0,H=0,U;M=Q.x;K=Q.y;if(T=="simple"){return{rng:L,scrollX:M,scrollY:K}}if(A){if(L.item){R=L.item(0);C(I.dom.select(R.nodeName),function(X,W){if(R==X){O=W;return false}});return{tag:R.nodeName,index:O,scrollX:M,scrollY:K}}E=I.dom.doc.body.createTextRange();E.moveToElementText(G);E.collapse(true);V=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(true);O=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(false);N=Math.abs(E.move("character",S))-O;return{start:O-V,length:N,scrollX:M,scrollY:K}}R=I.getNode();J=I.getSel();if(!J){return null}if(R&&R.nodeName=="IMG"){return{scrollX:M,scrollY:K}}function P(Y,b,X){var W=I.dom.doc.createTreeWalker(Y,NodeFilter.SHOW_TEXT,null,false),c,Z=0,a={};while((c=W.nextNode())!=null){if(c==b){a.start=Z}if(c==X){a.end=Z;return a}Z+=D(c.nodeValue||"").length}return null}if(J.anchorNode==J.focusNode&&J.anchorOffset==J.focusOffset){R=P(G,J.anchorNode,J.focusNode);if(!R){return{scrollX:M,scrollY:K}}D(J.anchorNode.nodeValue||"").replace(/^\s+/,function(W){F=W.length});return{start:Math.max(R.start+J.anchorOffset-F,0),end:Math.max(R.end+J.focusOffset-F,0),scrollX:M,scrollY:K,beg:J.anchorOffset-F==0}}else{R=P(G,L.startContainer,L.endContainer);if(!R){return{scrollX:M,scrollY:K}}return{start:Math.max(R.start+L.startOffset-F,0),end:Math.max(R.end+L.endOffset-H,0),scrollX:M,scrollY:K,beg:L.startOffset-F==0}}},moveToBookmark:function(M){var N=this,F=N.getRng(),O=N.getSel(),I=N.dom.getRoot(),L,G,J;function H(P,R,Z){var X=N.dom.doc.createTreeWalker(P,NodeFilter.SHOW_TEXT,null,false),T,Q=0,W={},S,Y,V,U;while((T=X.nextNode())!=null){V=U=0;J=T.nodeValue||"";G=D(J).length;Q+=G;if(Q>=R&&!W.startNode){S=R-(Q-G);if(M.beg&&S>=G){continue}W.startNode=T;W.startOffset=S+U}if(Q>=Z){W.endNode=T;W.endOffset=Z-(Q-G)+U;return W}}return null}if(!M){return false}N.win.scrollTo(M.scrollX,M.scrollY);if(A){if(F=M.rng){try{F.select()}catch(K){}return true}N.win.focus();if(M.tag){F=I.createControlRange();C(N.dom.select(M.tag),function(Q,P){if(P==M.index){F.addElement(Q)}})}else{try{if(M.start<0){return true}F=O.createRange();F.moveToElementText(I);F.collapse(true);F.moveStart("character",M.start);F.moveEnd("character",M.length)}catch(E){return true}}try{F.select()}catch(K){}return true}if(!O){return false}if(M.rng){O.removeAllRanges();O.addRange(M.rng)}else{if(B(M.start)&&B(M.end)){try{L=H(I,M.start,M.end);if(L){F=N.dom.doc.createRange();F.setStart(L.startNode,L.startOffset);F.setEnd(L.endNode,L.endOffset);O.removeAllRanges();O.addRange(F)}if(!tinymce.isOpera){N.win.focus()}}catch(K){}}}},select:function(F,K){var O=this,E=O.getRng(),P=O.getSel(),M,L,J,I=O.win.document;function G(Q){return Q?I.createTreeWalker(Q,NodeFilter.SHOW_TEXT,null,false).nextNode():null}function N(T){var S,R,Q;if(!T){return null}Q=I.createTreeWalker(T,NodeFilter.SHOW_TEXT,null,false);while(S=Q.nextNode()){R=S}return R}if(A){try{M=I.body;if(/^(IMG|TABLE)$/.test(F.nodeName)){E=M.createControlRange();E.addElement(F)}else{E=M.createTextRange();E.moveToElementText(F)}E.select()}catch(H){}}else{if(K){L=G(F);J=N(F);if(L&&J){E=I.createRange();E.setStart(L,0);E.setEnd(J,J.nodeValue.length)}else{E.selectNode(F)}}else{E.selectNode(F)}O.setRng(E)}return F},isCollapsed:function(){var E=this,G=E.getRng(),F=E.getSel();if(!G||G.item){return false}return !F||G.boundingWidth==0||F.isCollapsed},collapse:function(E){var F=this,G=F.getRng(),H;if(G.item){H=G.item(0);G=this.win.document.body.createTextRange();G.moveToElementText(H)}G.collapse(!!E);F.setRng(G)},getSel:function(){var F=this,E=this.win;return E.getSelection?E.getSelection():E.document.selection},getRng:function(){var F=this,G=F.getSel(),H;try{if(G){H=G.rangeCount>0?G.getRangeAt(0):(G.createRange?G.createRange():F.win.document.createRange())}}catch(E){}if(!H){H=A?F.win.document.body.createTextRange():F.win.document.createRange()}return H},setRng:function(G){var F;if(!A){F=this.getSel();if(F){F.removeAllRanges();F.addRange(G)}}else{try{G.select()}catch(E){}}},setNode:function(F){var E=this;E.setContent(E.dom.getOuterHTML(F));return F},getNode:function(){var E=this,G=E.getRng(),F=E.getSel(),H;if(!A){if(!G){return E.dom.getRoot()}H=G.commonAncestorContainer;if(!G.collapsed){if(G.startContainer==G.endContainer||(tinymce.isWebKit&&G.startContainer==G.endContainer.parentNode)){if(G.startOffset-G.endOffset<2||tinymce.isWebKit){if(G.startContainer.hasChildNodes()){H=G.startContainer.childNodes[G.startOffset]}}}}return E.dom.getParent(H,function(I){return I.nodeType==1})}return G.item?G.item(0):G.parentElement()},destroy:function(F){var E=this;E.win=null;if(!F){tinymce.removeUnload(E.destroy)}}})})();(function(){tinymce.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(B){function A(){var D=document.implementation;if(!D||!D.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(C){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(C){}}else{return D.createDocument("","",null)}}this.doc=A();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset()},reset:function(){var A=this,B=A.doc;if(B.firstChild){B.removeChild(B.firstChild)}A.node=B.appendChild(B.createElement("html"))},writeStartElement:function(B){var A=this;A.node=A.node.appendChild(A.doc.createElement(B))},writeAttribute:function(B,A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.setAttribute(B,A)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var A=this,B=A.node;B.appendChild(A.doc.createTextNode(""));A.node=B.parentNode},writeText:function(A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(A))},writeCDATA:function(A){this.node.appendChild(this.doc.createCDATA(A))},writeComment:function(A){this.node.appendChild(this.doc.createComment(A.replace(/\-\-/g," ")))},getContent:function(){var A;A=this.doc.xml||new XMLSerializer().serializeToString(this.doc);A=A.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");A=A.replace(/ ?\/>/g," />");if(this.valid){A=A.replace(/\%MCGT%/g,">")}return A}})})();(function(){tinymce.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(A){this.settings=tinymce.extend({indent_char:" ",indentation:1},A);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(A){this._writeAttributesEnd();this.writeRaw("<"+A);this.tags.push(A);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(C,A){var B=this;B.writeRaw(" "+B.encode(C)+'="'+B.encode(A)+'"')},writeEndElement:function(){var A;if(this.tags.length>0){A=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+A+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(A){this._writeAttributesEnd();this.writeRaw(this.encode(A));this.count++},writeCDATA:function(A){this._writeAttributesEnd();this.writeRaw("<![CDATA["+A+"]]>");this.count++},writeComment:function(A){this._writeAttributesEnd();this.writeRaw("<!-- "+A+"-->");this.count++},writeRaw:function(A){this.str+=A},encode:function(A){return A.replace(/[<>&"]/g,function(B){switch(B){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return B})},getContent:function(){return this.str},_writeAttributesEnd:function(A){if(!this.inAttr){return }this.inAttr=false;if(A&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})();(function(){var G=tinymce.extend,E=tinymce.each,B=tinymce.util.Dispatcher,D=tinymce.isIE,A=tinymce.isGecko;function F(I){var H=[];if(I.nodeName=="OBJECT"){return I.attributes}I.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(K,J){H.push({specified:1,nodeName:J})});return H}function C(H){return H.replace(/([?+*])/g,".$1")}tinymce.create("tinymce.dom.Serializer",{Serializer:function(J){var I=this;I.key=0;I.onPreProcess=new B(I);I.onPostProcess=new B(I);if(tinymce.relaxedDomain&&tinymce.isGecko){I.writer=new tinymce.dom.StringWriter()}else{try{I.writer=new tinymce.dom.XMLWriter()}catch(H){I.writer=new tinymce.dom.StringWriter()}}I.settings=J=G({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1},J);I.dom=J.dom;if(J.fix_list_elements){I.onPreProcess.add(function(R,O){var L,T,S=["ol","ul"],Q,P,N,K=/^(OL|UL)$/,U;function M(X,Y){var V=Y.split(","),W;while((X=X.previousSibling)!=null){for(W=0;W<V.length;W++){if(X.nodeName==V[W]){return X}}}return null}for(T=0;T<S.length;T++){L=I.dom.select(S[T],O.node);for(Q=0;Q<L.length;Q++){P=L[Q];N=P.parentNode;if(K.test(N.nodeName)){U=M(P,"LI");if(!U){U=I.dom.create("li");U.innerHTML=" ";U.appendChild(P);N.insertBefore(U,N.firstChild)}else{U.appendChild(P)}}}}})}if(J.fix_table_elements){I.onPreProcess.add(function(K,L){E(I.dom.select("table",L.node),function(S){var R=I.dom.getParent(S,"H1,H2,H3,H4,H5,H6,P"),N,T,M,Q=[],O,P;if(R){N=R.cloneNode(false);Q.push(S);for(T=S;T=T.parentNode;){Q.push(T);if(T==R){break}}M=N;for(O=Q.length-1;O>=0;O--){if(O==Q.length-1){while(P=Q[O-1].nextSibling){M.appendChild(P.parentNode.removeChild(P))}}else{T=Q[O].cloneNode(false);if(O!=0){while(P=Q[O-1].nextSibling){T.appendChild(P.parentNode.removeChild(P))}}M=M.appendChild(T)}}S=I.dom.insertAfter(S.parentNode.removeChild(S),R);I.dom.insertAfter(S,R);I.dom.insertAfter(N,S)}})})}},setEntities:function(N){var L=this,I,K,H={},M="",J;if(L.entityLookup){return }I=N.split(",");for(K=0;K<I.length;K+=2){J=I[K];if(J==34||J==38||J==60||J==62){continue}H[String.fromCharCode(I[K])]=I[K+1];J=parseInt(I[K]).toString(16);M+="\\u"+"0000".substring(J.length)+J}if(!M){L.settings.entity_encoding="raw";return }L.entitiesRE=new RegExp("["+M+"]","g");L.entityLookup=H},setValidChildRules:function(H){this.childRules=null;this.addValidChildRules(H)},addValidChildRules:function(K){var J=this,L,H,I;if(!K){return }L="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";H="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";I="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";E(K.split(","),function(N){var O=N.split(/\[|\]/),M;N="";E(O[1].split("|"),function(P){if(N){N+="|"}switch(P){case"%itrans":P=H;break;case"%itrans_na":P=H.substring(2);break;case"%istrict":P=L;break;case"%istrict_na":P=L.substring(2);break;case"%btrans":P=I;break;case"%bstrict":P=I;break}N+=P});M=new RegExp("^("+N.toLowerCase()+")$","i");E(O[0].split("/"),function(P){J.childRules=J.childRules||{};J.childRules[P]=M})});K="";E(J.childRules,function(N,M){if(K){K+="|"}K+=M});J.parentElementsRE=new RegExp("^("+K.toLowerCase()+")$","i")},setRules:function(I){var H=this;H._setup();H.rules={};H.wildRules=[];H.validElements={};return H.addRules(I)},addRules:function(I){var H=this,J;if(!I){return }H._setup();E(I.split(","),function(M){var P=M.split(/\[|\]/),L=P[0].split("/"),Q,K,O,N=[];if(J){K=tinymce.extend([],J.attribs)}if(P.length>1){E(P[1].split("|"),function(T){var R={},S;K=K||[];T=T.replace(/::/g,"~");T=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(T);T[2]=T[2].replace(/~/g,":");if(T[1]=="!"){Q=Q||[];Q.push(T[2])}if(T[1]=="-"){for(S=0;S<K.length;S++){if(K[S].name==T[2]){K.splice(S,1);return }}}switch(T[3]){case"=":R.defaultVal=T[4]||"";break;case":":R.forcedVal=T[4];break;case"<":R.validVals=T[4].split("?");break}if(/[*.?]/.test(T[2])){O=O||[];R.nameRE=new RegExp("^"+C(T[2])+"$");O.push(R)}else{R.name=T[2];K.push(R)}N.push(T[2])})}E(L,function(U,T){var V=U.charAt(0),S=1,R={};if(J){if(J.noEmpty){R.noEmpty=J.noEmpty}if(J.fullEnd){R.fullEnd=J.fullEnd}if(J.padd){R.padd=J.padd}}switch(V){case"-":R.noEmpty=true;break;case"+":R.fullEnd=true;break;case"#":R.padd=true;break;default:S=0}L[T]=U=U.substring(S);H.validElements[U]=1;if(/[*.?]/.test(L[0])){R.nameRE=new RegExp("^"+C(L[0])+"$");H.wildRules=H.wildRules||{};H.wildRules.push(R)}else{R.name=L[0];if(L[0]=="@"){J=R}H.rules[U]=R}R.attribs=K;if(Q){R.requiredAttribs=Q}if(O){U="";E(N,function(W){if(U){U+="|"}U+="("+C(W)+")"});R.validAttribsRE=new RegExp("^"+U.toLowerCase()+"$");R.wildAttribs=O}})});I="";E(H.validElements,function(L,K){if(I){I+="|"}if(K!="@"){I+=K}});H.validElementsRE=new RegExp("^("+C(I.toLowerCase())+")$")},findRule:function(L){var I=this,K=I.rules,H,J;I._setup();J=K[L];if(J){return J}K=I.wildRules;for(H=0;H<K.length;H++){if(K[H].nameRE.test(L)){return K[H]}}return null},findAttribRule:function(H,K){var I,J=H.wildAttribs;for(I=0;I<J.length;I++){if(J[I].nameRE.test(K)){return J[I]}}return null},serialize:function(K,J){var I,H=this;H._setup();J=J||{};J.format=J.format||"html";H.processObj=J;K=K.cloneNode(true);H.key=""+(parseInt(H.key)+1);if(!J.no_events){J.node=K;H.onPreProcess.dispatch(H,J)}H.writer.reset();H._serializeNode(K,J.getInner);J.content=H.writer.getContent();if(!J.no_events){H.onPostProcess.dispatch(H,J)}H._postProcess(J);J.node=null;return tinymce.trim(J.content)},_postProcess:function(M){var H=this,J=H.settings,I=M.content,L=[],K;if(M.format=="html"){K=H._protect({content:I,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});I=K.content;if(J.entity_encoding!=="raw"){I=H._encode(I)}if(!M.set){I=I.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,J.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(J.remove_linebreaks){I=I.replace(/\r?\n|\r/g," ");I=I.replace(/(<[^>]+>)\s+/g,"$1 ");I=I.replace(/\s+(<\/[^>]+>)/g," $1");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");I=I.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(J.apply_source_formatting&&J.indent_mode=="simple"){I=I.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");I=I.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");I=I.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");I=I.replace(/\n\n/g,"\n")}}I=H._unprotect(I,K);if(J.entity_encoding=="raw"){I=I.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}}M.content=I},_serializeNode:function(V,K){var R=this,S=R.settings,P=R.writer,M,I,O,X,W,Y,T,H,Q,J,N,U,L;if(!S.node_filter||S.node_filter(V)){switch(V.nodeType){case 1:if(V.hasAttribute?V.hasAttribute("mce_bogus"):V.getAttribute("mce_bogus")){return }L=false;M=V.hasChildNodes();J=V.getAttribute("mce_name")||V.nodeName.toLowerCase();if(D){if(V.scopeName!=="HTML"&&V.scopeName!=="html"){J=V.scopeName+":"+J}}if(J.indexOf("mce:")===0){J=J.substring(4)}if(!R.validElementsRE.test(J)||(R.invalidElementsRE&&R.invalidElementsRE.test(J))||K){L=true;break}if(D){if(S.fix_content_duplication){if(V.mce_serialized==R.key){return }V.mce_serialized=R.key}if(J.charAt(0)=="/"){J=J.substring(1)}}else{if(A){if(V.nodeName==="BR"&&V.getAttribute("type")=="_moz"){return }}}if(R.childRules){if(R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(J)){L=true;break}}R.elementName=J}N=R.findRule(J);J=N.name||J;if((!M&&N.noEmpty)||(D&&!J)){L=true;break}if(N.requiredAttribs){Y=N.requiredAttribs;for(X=Y.length-1;X>=0;X--){if(this.dom.getAttrib(V,Y[X])!==""){break}}if(X==-1){L=true;break}}P.writeStartElement(J);if(N.attribs){for(X=0,T=N.attribs,W=T.length;X<W;X++){Y=T[X];Q=R._getAttrib(V,Y);if(Q!==null){P.writeAttribute(Y.name,Q)}}}if(N.validAttribsRE){T=D?F(V):V.attributes;for(X=T.length-1;X>-1;X--){H=T[X];if(H.specified){Y=H.nodeName.toLowerCase();if(S.invalid_attrs.test(Y)||!N.validAttribsRE.test(Y)){continue}U=R.findAttribRule(N,Y);Q=R._getAttrib(V,U,Y);if(Q!==null){P.writeAttribute(Y,Q)}}}}if(!M&&N.padd){P.writeText("\u00a0")}break;case 3:if(R.childRules&&R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(V.nodeName)){return }}return P.writeText(V.nodeValue);case 4:return P.writeCDATA(V.nodeValue);case 8:return P.writeComment(V.nodeValue)}}else{if(V.nodeType==1){M=V.hasChildNodes()}}if(M){O=V.firstChild;while(O){R._serializeNode(O);R.elementName=J;O=O.nextSibling}}if(!L){if(M||!S.closed.test(J)){P.writeFullEndElement()}else{P.writeEndElement()}}},_protect:function(J){var I=this;J.items=J.items||[];function H(L){return L.replace(/[\r\n\\]/g,function(M){if(M==="\n"){return"\\n"}else{if(M==="\\"){return"\\\\"}}return"\\r"})}function K(L){return L.replace(/\\[\\rn]/g,function(M){if(M==="\\n"){return"\n"}else{if(M==="\\\\"){return"\\"}}return"\r"})}E(J.patterns,function(L){J.content=K(H(J.content).replace(L.pattern,function(N,O,M,P){M=K(M);if(L.encode){M=I._encode(M)}J.items.push(M);return O+"<!--mce:"+(J.items.length-1)+"-->"+P}))});return J},_unprotect:function(H,I){H=H.replace(/\<!--mce:([0-9]+)--\>/g,function(K,J){return I.items[parseInt(J)]});I.items=[];return H},_encode:function(K){var I=this,J=I.settings,H;if(J.entity_encoding!=="raw"){if(J.entity_encoding.indexOf("named")!=-1){I.setEntities(J.entities);H=I.entityLookup;K=K.replace(I.entitiesRE,function(L){var M;if(M=H[L]){L="&"+M+";"}return L})}if(J.entity_encoding.indexOf("numeric")!=-1){K=K.replace(/[\u007E-\uFFFF]/g,function(L){return"&#"+L.charCodeAt(0)+";"})}}return K},_setup:function(){var H=this,I=this.settings;if(H.done){return }H.done=1;H.setRules(I.valid_elements);H.addRules(I.extended_valid_elements);H.addValidChildRules(I.valid_child_elements);if(I.invalid_elements){H.invalidElementsRE=new RegExp("^("+C(I.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(I.attrib_value_filter){H.attribValueFilter=I.attribValueFilter}},_getAttrib:function(L,I,H){var K,J;H=H||I.name;if(I.forcedVal&&(J=I.forcedVal)){if(J==="{$uid}"){return this.dom.uniqueId()}return J}J=this.dom.getAttrib(L,H);switch(H){case"rowspan":case"colspan":if(J=="1"){J=""}break}if(this.attribValueFilter){J=this.attribValueFilter(H,J,L)}if(I.validVals){for(K=I.validVals.length-1;K>=0;K--){if(J==I.validVals[K]){break}}if(K==-1){return null}}if(J===""&&typeof (I.defaultVal)!="undefined"){J=I.defaultVal;if(J==="{$uid}"){return this.dom.uniqueId()}return J}else{if(H=="class"&&this.processObj.get){J=J.replace(/\s?mceItem\w+\s?/g,"")}}if(J===""){return null}return J}})})();(function(){var each=tinymce.each;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return }o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone()}})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return }if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})();(function(){var B=tinymce.DOM,A=tinymce.is;tinymce.create("tinymce.ui.Control",{Control:function(D,C){this.id=D;this.settings=C=C||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix="";this.scope=C.scope||this;this.disabled=0;this.active=0},setDisabled:function(C){var D;if(C!=this.disabled){D=B.get(this.id);if(D&&this.settings.unavailable_prefix){if(C){this.prevTitle=D.title;D.title=this.settings.unavailable_prefix+": "+D.title}else{D.title=this.prevTitle}}this.setState("Disabled",C);this.setState("Enabled",!C);this.disabled=C}},isDisabled:function(){return this.disabled},setActive:function(C){if(C!=this.active){this.setState("Active",C);this.active=C}},isActive:function(){return this.active},setState:function(E,C){var D=B.get(this.id);E=this.classPrefix+E;if(C){B.addClass(D,E)}else{B.removeClass(D,E)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(C){B.setHTML(C,this.renderHTML())},postRender:function(){var D=this,C;if(A(D.disabled)){C=D.disabled;D.disabled=-1;D.setDisabled(C)}if(A(D.active)){C=D.active;D.active=-1;D.setActive(C)}},remove:function(){B.remove(this.id);this.destroy()},destroy:function(){tinymce.dom.Event.clear(this.id)}})})();tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(B,A){this.parent(B,A);this.controls=[];this.lookup={}},add:function(A){this.lookup[A.id]=A;this.controls.push(A);return A},get:function(A){return this.lookup[A]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(B,A){this.parent(B,A);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(F,E){this.parent(F,E);this.classPrefix="mceMenuItem"},setSelected:function(E){this.setState("Selected",E);this.selected=E},isSelected:function(){return this.selected},postRender:function(){var E=this;E.parent();if(C(E.selected)){E.setSelected(E.selected)}}})})();(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(G,F){var E=this;E.parent(G,F);E.items={};E.collapsed=false;E.menuCount=0;E.onAddItem=new tinymce.util.Dispatcher(this)},expand:function(F){var E=this;if(F){A(E,function(G){if(G.expand){G.expand()}},"items",E)}E.collapsed=false},collapse:function(F){var E=this;if(F){A(E,function(G){if(G.collapse){G.collapse()}},"items",E)}E.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(E){if(!E.settings){E=new tinymce.ui.MenuItem(E.id||B.uniqueId(),E)}this.onAddItem.dispatch(this,E);return this.items[E.id]=E},addSeparator:function(){return this.add({separator:true})},addMenu:function(E){if(!E.collapse){E=this.createMenu(E)}this.menuCount++;return this.add(E)},hasMenus:function(){return this.menuCount!==0},remove:function(E){delete this.items[E.id]},removeAll:function(){var E=this;A(E,function(F){if(F.removeAll){F.removeAll()}else{F.remove()}F.destroy()},"items",E);E.items={}},createMenu:function(F){var E=new tinymce.ui.Menu(F.id||B.uniqueId(),F);E.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return E}})})();(function(){var D=tinymce.is,C=tinymce.DOM,E=tinymce.each,A=tinymce.dom.Event,B=tinymce.dom.Element;tinymce.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(G,F){F=F||{};F.container=F.container||C.doc.body;F.offset_x=F.offset_x||0;F.offset_y=F.offset_y||0;F.vp_offset_x=F.vp_offset_x||0;F.vp_offset_y=F.vp_offset_y||0;if(D(F.icons)&&!F.icons){F["class"]+=" mceNoIcons"}this.parent(G,F);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(I){var G=this,H=G.settings,F;I.container=I.container||H.container;I.parent=G;I.constrain=I.constrain||H.constrain;I["class"]=I["class"]||H["class"];I.vp_offset_x=I.vp_offset_x||H.vp_offset_x;I.vp_offset_y=I.vp_offset_y||H.vp_offset_y;F=new tinymce.ui.DropMenu(I.id||C.uniqueId(),I);F.onAddItem.add(G.onAddItem.dispatch,G.onAddItem);return F},update:function(){var H=this,I=H.settings,F=C.get("menu_"+H.id+"_tbl"),K=C.get("menu_"+H.id+"_co"),G,J;G=I.max_width?Math.min(F.clientWidth,I.max_width):F.clientWidth;J=I.max_height?Math.min(F.clientHeight,I.max_height):F.clientHeight;if(!C.boxModel){H.element.setStyles({width:G+2,height:J+2})}else{H.element.setStyles({width:G,height:J})}if(I.max_width){C.setStyle(K,"width",G)}if(I.max_height){C.setStyle(K,"height",J);if(F.clientHeight<I.max_height){C.setStyle(K,"overflow","hidden")}}},showMenu:function(N,L,P){var S=this,T=S.settings,M,F=C.getViewPort(),Q,J,R,O,G=2,I,H,K=S.classPrefix;S.collapse(1);if(S.isMenuVisible){return }if(!S.rendered){M=C.add(S.settings.container,S.renderNode());E(S.items,function(U){U.postRender()});S.element=new B("menu_"+S.id,{blocker:1,container:T.container})}else{M=C.get("menu_"+S.id)}if(!tinymce.isOpera){C.setStyles(M,{left:-65535,top:-65535})}C.show(M);S.update();N+=T.offset_x||0;L+=T.offset_y||0;F.w-=4;F.h-=4;if(T.constrain){Q=M.clientWidth-G;J=M.clientHeight-G;R=F.x+F.w;O=F.y+F.h;if((N+T.vp_offset_x+Q)>R){N=P?P-Q:Math.max(0,(R-T.vp_offset_x)-Q)}if((L+T.vp_offset_y+J)>O){L=Math.max(0,(O-T.vp_offset_y)-J)}}C.setStyles(M,{left:N,top:L});S.element.update();S.isMenuVisible=1;S.mouseClickFunc=A.add(M,"click",function(V){var U;V=V.target;if(V&&(V=C.getParent(V,"TR"))&&!C.hasClass(V,K+"ItemSub")){U=S.items[V.id];if(U.isDisabled()){return }I=S;while(I){if(I.hideMenu){I.hideMenu()}I=I.settings.parent}if(U.settings.onclick){U.settings.onclick(V)}return A.cancel(V)}});if(S.hasMenus()){S.mouseOverFunc=A.add(M,"mouseover",function(X){var U,W,V;X=X.target;if(X&&(X=C.getParent(X,"TR"))){U=S.items[X.id];if(S.lastMenu){S.lastMenu.collapse(1)}if(U.isDisabled()){return }if(X&&C.hasClass(X,K+"ItemSub")){W=C.getRect(X);U.showMenu((W.x+W.w-G),W.y-G,W.x);S.lastMenu=U;C.addClass(C.get(U.id).firstChild,K+"ItemActive")}}})}S.onShowMenu.dispatch(S);if(T.keyboard_focus){A.add(M,"keydown",S._keyHandler,S);C.select("a","menu_"+S.id)[0].focus();S._focusIdx=0}},hideMenu:function(I){var F=this,H=C.get("menu_"+F.id),G;if(!F.isMenuVisible){return }A.remove(H,"mouseover",F.mouseOverFunc);A.remove(H,"click",F.mouseClickFunc);A.remove(H,"keydown",F._keyHandler);C.hide(H);F.isMenuVisible=0;if(!I){F.collapse(1)}if(F.element){F.element.hide()}if(G=C.get(F.id)){C.removeClass(G.firstChild,F.classPrefix+"ItemActive")}F.onHideMenu.dispatch(F)},add:function(H){var F=this,G;H=F.parent(H);if(F.isRendered&&(G=C.get("menu_"+F.id))){F._add(C.select("tbody",G)[0],H)}return H},collapse:function(F){this.parent(F);this.hideMenu(1)},remove:function(F){C.remove(F.id);this.destroy();return this.parent(F)},destroy:function(){var F=this,G=C.get("menu_"+F.id);A.remove(G,"mouseover",F.mouseOverFunc);A.remove(G,"click",F.mouseClickFunc);if(F.element){F.element.remove()}C.remove(G)},renderNode:function(){var H=this,I=H.settings,K,G,J,F;F=C.create("div",{id:"menu_"+H.id,"class":I["class"],style:"position:absolute;left:0;top:0;z-index:200000"});J=C.add(F,"div",{id:"menu_"+H.id+"_co","class":H.classPrefix+(I["class"]?" "+I["class"]:"")});H.element=new B("menu_"+H.id,{blocker:1,container:I.container});if(I.menu_line){C.add(J,"span",{"class":H.classPrefix+"Line"})}K=C.add(J,"table",{id:"menu_"+H.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});G=C.add(K,"tbody");E(H.items,function(L){H._add(G,L)});H.rendered=true;return F},_keyHandler:function(I){var H=this,G=I.keyCode;function F(L){var J=H._focusIdx+L,K=C.select("a","menu_"+H.id)[J];if(K){H._focusIdx=J;K.focus()}}switch(G){case 38:F(-1);return ;case 40:F(1);return ;case 13:return ;case 27:return this.hideMenu()}},_add:function(G,L){var M,I=L.settings,F,J,H,K=this.classPrefix;if(I.separator){J=C.add(G,"tr",{id:L.id,"class":K+"ItemSeparator"});C.add(J,"td",{"class":K+"ItemSeparator"});if(M=J.previousSibling){C.addClass(M,"mceLast")}return }M=J=C.add(G,"tr",{id:L.id,"class":K+"Item "+K+"ItemEnabled"});M=H=C.add(M,"td");M=F=C.add(M,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});C.addClass(H,I["class"]);C.add(M,"span",{"class":"mceIcon"+(I.icon?" mce_"+I.icon:"")});M=C.add(M,I.element||"span",{"class":"mceText",title:L.settings.title},L.settings.title);if(L.settings.style){C.setAttrib(M,"style",L.settings.style)}if(G.childNodes.length==1){C.addClass(J,"mceFirst")}if((M=J.previousSibling)&&C.hasClass(M,K+"ItemSeparator")){C.addClass(J,"mceFirst")}if(L.collapse){C.addClass(J,K+"ItemSub")}if(M=J.previousSibling){C.removeClass(M,"mceLast")}C.addClass(J,"mceLast")}})})();(function(){var A=tinymce.DOM;tinymce.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(C,B){this.parent(C,B);this.classPrefix="mceButton"},renderHTML:function(){var E=this.classPrefix,D=this.settings,C,B;B=A.encode(D.label||"");C='<a id="'+this.id+'" href="javascript:;" class="'+E+" "+E+"Enabled "+D["class"]+(B?" "+E+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+A.encode(D.title)+'">';if(D.image){C+='<img class="mceIcon" src="'+D.image+'" />'+B+"</a>"}else{C+='<span class="mceIcon '+D["class"]+'"></span>'+(B?'<span class="'+E+'Label">'+B+"</span>":"")+"</a>"}return C},postRender:function(){var B=this,C=B.settings;tinymce.dom.Event.add(B.id,"click",function(D){if(!B.isDisabled()){return C.onclick.call(C.scope,D)}})}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(G,F){var E=this;E.parent(G,F);E.items=[];E.onChange=new A(E);E.onPostRender=new A(E);E.onAdd=new A(E);E.onRenderMenu=new tinymce.util.Dispatcher(this);E.classPrefix="mceListBox"},select:function(E){var F=this,H,G;if(E!=F.selectedValue){H=C.get(F.id+"_text");F.selectedValue=E;D(F.items,function(I){if(I.value==E){C.setHTML(H,C.encode(I.title));G=1;return false}});if(!G){C.setHTML(H,C.encode(F.settings.title));C.addClass(H,"mceTitle");H=0;return }else{C.removeClass(H,"mceTitle")}}H=0},add:function(H,E,G){var F=this;G=G||{};G=tinymce.extend(G,{title:H,value:E});F.items.push(G);F.onAdd.dispatch(F,G)},getLength:function(){return this.items.length},renderHTML:function(){var G="",E=this,F=E.settings,H=E.classPrefix;G='<table id="'+E.id+'" cellpadding="0" cellspacing="0" class="'+H+" "+H+"Enabled"+(F["class"]?(" "+F["class"]):"")+'"><tbody><tr>';G+="<td>"+C.createHTML("a",{id:E.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},C.encode(E.settings.title))+"</td>";G+="<td>"+C.createHTML("a",{id:E.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";G+="</tr></tbody></table>";return G},showMenu:function(){var F=this,I,H,G=C.get(this.id),E;if(F.isDisabled()||F.items.length==0){return }if(F.menu&&F.menu.isMenuVisible){return F.hideMenu()}if(!F.isMenuRendered){F.renderMenu();F.isMenuRendered=true}I=C.getPos(this.settings.menu_container);H=C.getPos(G);E=F.menu;E.settings.offset_x=H.x;E.settings.offset_y=H.y;E.settings.keyboard_focus=!tinymce.isOpera;if(F.oldID){E.items[F.oldID].setSelected(0)}D(F.items,function(J){if(J.value===F.selectedValue){E.items[J.id].setSelected(1);F.oldID=J.id}});E.showMenu(0,G.clientHeight);B.add(C.doc,"mousedown",F.hideMenu,F);C.addClass(F.id,F.classPrefix+"Selected")},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&(F.target.id==E.id+"_text"||F.target.id==E.id+"_open")){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceMenu")})){C.removeClass(E.id,E.classPrefix+"Selected");B.remove(C.doc,"mousedown",E.hideMenu,E);if(E.menu){E.menu.hideMenu()}}},renderMenu:function(){var F=this,E;E=F.settings.control_manager.createDropMenu(F.id+"_menu",{menu_line:1,"class":F.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});E.onHideMenu.add(F.hideMenu,F);E.add({title:F.settings.title,"class":"mceMenuItemTitle"}).setDisabled(1);D(F.items,function(G){G.id=C.uniqueId();G.onclick=function(){if(F.settings.onselect(G.value)!==false){F.select(G.value)}};E.add(G)});F.onRenderMenu.dispatch(F,E);F.menu=E},postRender:function(){var E=this,F=E.classPrefix;B.add(E.id,"click",E.showMenu,E);B.add(E.id+"_text","focus",function(G){if(!E._focused){E.keyDownHandler=B.add(E.id+"_text","keydown",function(K){var H=-1,I,J=K.keyCode;D(E.items,function(L,M){if(E.selectedValue==L.value){H=M}});if(J==38){I=E.items[H-1]}else{if(J==40){I=E.items[H+1]}else{if(J==13){I=E.selectedValue;E.selectedValue=null;E.settings.onselect(I);return B.cancel(K)}}}if(I){E.hideMenu();E.select(I.value)}})}E._focused=1});B.add(E.id+"_text","blur",function(){B.remove(E.id+"_text","keydown",E.keyDownHandler);E._focused=0});if(tinymce.isIE6||!C.boxModel){B.add(E.id,"mouseover",function(){if(!C.hasClass(E.id,F+"Disabled")){C.addClass(E.id,F+"Hover")}});B.add(E.id,"mouseout",function(){if(!C.hasClass(E.id,F+"Disabled")){C.removeClass(E.id,F+"Hover")}})}E.onPostRender.dispatch(E,C.get(E.id))},destroy:function(){this.parent();B.clear(this.id+"_text")}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(F,E){this.parent(F,E);this.classPrefix="mceNativeListBox"},setDisabled:function(E){C.get(this.id).disabled=E},isDisabled:function(){return C.get(this.id).disabled},select:function(E){var G=C.get(this.id),F=G.options;E=""+(E||"");G.selectedIndex=0;D(F,function(I,H){if(I.value==E){G.selectedIndex=H;return false}})},add:function(I,F,E){var H,G=this;E=E||{};E.value=F;if(G.isRendered()){C.add(C.get(this.id),"option",E,I)}H={title:I,value:F,attribs:E};G.items.push(H);G.onAdd.dispatch(G,H)},getLength:function(){return C.get(this.id).options.length-1},renderHTML:function(){var F,E=this;F=C.createHTML("option",{value:""},"-- "+E.settings.title+" --");D(E.items,function(G){F+=C.createHTML("option",{value:G.value},G.title)});F=C.createHTML("select",{id:E.id,"class":"mceNativeListBox"},F);return F},postRender:function(){var F=this,G;F.rendered=true;function E(I){var H=I.target.options[I.target.selectedIndex].value;F.onChange.dispatch(F,H);if(F.settings.onselect){F.settings.onselect(H)}}B.add(F.id,"change",E);B.add(F.id,"keydown",function(I){var H;B.remove(F.id,"change",G);H=B.add(F.id,"blur",function(){B.add(F.id,"change",E);B.remove(F.id,"blur",H)});if(I.keyCode==13||I.keyCode==32){E(I);return B.cancel(I)}});F.onPostRender.dispatch(F,C.get(F.id))}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(E,D){this.parent(E,D);this.onRenderMenu=new tinymce.util.Dispatcher(this);D.menu_container=D.menu_container||B.doc.body},showMenu:function(){var E=this,H,G,F=B.get(E.id),D;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=B.getPos(E.settings.menu_container);G=B.getPos(F);D=E.menu;D.settings.offset_x=G.x;D.settings.offset_y=G.y;D.settings.vp_offset_x=G.x;D.settings.vp_offset_y=G.y;D.settings.keyboard_focus=E._focused;D.showMenu(0,F.clientHeight);A.add(B.doc,"mousedown",E.hideMenu,E);E.setState("Selected",1);E.isMenuVisible=1},renderMenu:function(){var E=this,D;D=E.settings.control_manager.createDropMenu(E.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:E.settings.icons});D.onHideMenu.add(E.hideMenu,E);E.onRenderMenu.dispatch(E,D);E.menu=D},hideMenu:function(E){var D=this;if(E&&E.type=="mousedown"&&B.getParent(E.target,function(F){return F.id===D.id||F.id===D.id+"_open"})){return }if(!E||!B.getParent(E.target,function(F){return B.hasClass(F,"mceMenu")})){D.setState("Selected",0);A.remove(B.doc,"mousedown",D.hideMenu,D);if(D.menu){D.menu.hideMenu()}}D.isMenuVisible=0},postRender:function(){var D=this,E=D.settings;A.add(D.id,"click",function(){if(!D.isDisabled()){if(E.onclick){E.onclick(D.value)}D.showMenu()}})}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(E,D){this.parent(E,D);this.classPrefix="mceSplitButton"},renderHTML:function(){var G,E=this,F=E.settings,D;G="<tbody><tr>";if(F.image){D=B.createHTML("img ",{src:F.image,"class":"mceAction "+F["class"]})}else{D=B.createHTML("span",{"class":"mceAction "+F["class"]},"")}G+="<td>"+B.createHTML("a",{id:E.id+"_action",href:"javascript:;","class":"mceAction "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";D=B.createHTML("span",{"class":"mceOpen "+F["class"]});G+="<td>"+B.createHTML("a",{id:E.id+"_open",href:"javascript:;","class":"mceOpen "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";G+="</tr></tbody>";return B.createHTML("table",{id:E.id,"class":"mceSplitButton mceSplitButtonEnabled "+F["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:F.title},G)},postRender:function(){var D=this,E=D.settings;if(E.onclick){A.add(D.id+"_action","click",function(){if(!D.isDisabled()){E.onclick(D.value)}})}A.add(D.id+"_open","click",D.showMenu,D);A.add(D.id+"_open","focus",function(){D._focused=1});A.add(D.id+"_open","blur",function(){D._focused=0});if(tinymce.isIE6||!B.boxModel){A.add(D.id,"mouseover",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.addClass(D.id,"mceSplitButtonHover")}});A.add(D.id,"mouseout",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.removeClass(D.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();A.clear(this.id+"_action");A.clear(this.id+"_open")}})})();(function(){var C=tinymce.DOM,A=tinymce.dom.Event,B=tinymce.is,D=tinymce.each;tinymce.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(G,F){var E=this;E.parent(G,F);E.settings=F=tinymce.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},E.settings);E.onShowMenu=new tinymce.util.Dispatcher(E);E.onHideMenu=new tinymce.util.Dispatcher(E);E.value=F.default_color},showMenu:function(){var E=this,F,I,H,G;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=C.get(E.id);C.show(E.id+"_menu");C.addClass(H,"mceSplitButtonSelected");G=C.getPos(H);C.setStyles(E.id+"_menu",{left:G.x,top:G.y+H.clientHeight,zIndex:200000});H=0;A.add(C.doc,"mousedown",E.hideMenu,E);if(E._focused){E._keyHandler=A.add(E.id+"_menu","keydown",function(J){if(J.keyCode==27){E.hideMenu()}});C.select("a",E.id+"_menu")[0].focus()}E.onShowMenu.dispatch(E);E.isMenuVisible=1},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&C.getParent(F.target,function(G){return G.id===E.id+"_open"})){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceSplitButtonMenu")})){C.removeClass(E.id,"mceSplitButtonSelected");A.remove(C.doc,"mousedown",E.hideMenu,E);A.remove(E.id+"_menu","keydown",E._keyHandler);C.hide(E.id+"_menu")}E.onHideMenu.dispatch(E);E.isMenuVisible=0},renderMenu:function(){var I=this,E,H=0,J=I.settings,L,G,K,F;F=C.add(J.menu_container,"div",{id:I.id+"_menu","class":J.menu_class+" "+J["class"],style:"position:absolute;left:0;top:-1000px;"});E=C.add(F,"div",{"class":J["class"]+" mceSplitButtonMenu"});C.add(E,"span",{"class":"mceMenuLine"});L=C.add(E,"table",{"class":"mceColorSplitMenu"});G=C.add(L,"tbody");H=0;D(B(J.colors,"array")?J.colors:J.colors.split(","),function(M){M=M.replace(/^#/,"");if(!H--){K=C.add(G,"tr");H=J.grid_width-1}L=C.add(K,"td");L=C.add(L,"a",{href:"javascript:;",style:{backgroundColor:"#"+M},mce_color:"#"+M})});if(J.more_colors_func){L=C.add(G,"tr");L=C.add(L,"td",{colspan:J.grid_width,"class":"mceMoreColors"});L=C.add(L,"a",{id:I.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},J.more_colors_title);A.add(L,"click",function(M){J.more_colors_func.call(J.more_colors_scope||this);return A.cancel(M)})}C.addClass(E,"mceColorSplitMenu");A.add(I.id+"_menu","click",function(M){var N;M=M.target;if(M.nodeName=="A"&&(N=M.getAttribute("mce_color"))){I.setColor(N)}return A.cancel(M)});return F},setColor:function(F){var E=this;C.setStyle(E.id+"_preview","backgroundColor",F);E.value=F;E.hideMenu();E.settings.onselect(F)},postRender:function(){var E=this,F=E.id;E.parent();C.add(F+"_action","div",{id:F+"_preview","class":"mceColorPreview"})},destroy:function(){this.parent();A.clear(this.id+"_menu");A.clear(this.id+"_more");C.remove(this.id+"_menu")}})})();tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var I=this,D="",F,G,B=tinymce.DOM,J=I.settings,C,A,E,H;H=I.controls;for(C=0;C<H.length;C++){G=H[C];A=H[C-1];E=H[C+1];if(C===0){F="mceToolbarStart";if(G.Button){F+=" mceToolbarStartButton"}else{if(G.SplitButton){F+=" mceToolbarStartSplitButton"}else{if(G.ListBox){F+=" mceToolbarStartListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"))}if(A&&G.ListBox){if(A.Button||A.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarEnd"},B.createHTML("span",null,"<!-- IE -->"))}}if(B.stdMode){D+='<td style="position: relative">'+G.renderHTML()+"</td>"}else{D+="<td>"+G.renderHTML()+"</td>"}if(E&&G.ListBox){if(E.Button||E.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarStart"},B.createHTML("span",null,"<!-- IE -->"))}}}F="mceToolbarEnd";if(G.Button){F+=" mceToolbarEndButton"}else{if(G.SplitButton){F+=" mceToolbarEndSplitButton"}else{if(G.ListBox){F+=" mceToolbarEndListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"));return B.createHTML("table",{id:I.id,"class":"mceToolbar"+(J["class"]?" "+J["class"]:""),cellpadding:"0",cellspacing:"0",align:I.settings.align||""},"<tbody><tr>"+D+"</tr></tbody>")}});(function(){var A=tinymce.util.Dispatcher,B=tinymce.each;tinymce.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new A(this),get:function(C){return this.lookup[C]},requireLangPack:function(E){var C,D;if(tinymce.EditorManager.settings){l=tinyMCE.settings.language;C=tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0&context="+this.urls[E];D=tinymce.EditorManager.settings;if(D){if(!tinymce.dom.Event.domLoaded&&!D.strict_mode){tinymce.ScriptLoader.load(C)}else{tinymce.ScriptLoader.add(C)}}}},add:function(D,C){this.items.push(C);this.lookup[D]=C;this.onAdd.dispatch(this,D,C);return C},load:function(G,D,C,F){var E=this;if(E.urls[G]){return }if(D.indexOf("/")!=0&&D.indexOf("://")==-1){D=tinymce.baseURL+"/"+D}E.urls[G]=D.substring(0,D.lastIndexOf("/"));tinymce.ScriptLoader.add(D,C,F)}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager()}());(function(){var F=tinymce.each,G=tinymce.extend,E=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.ThemeManager,B=tinymce.PluginManager,D=tinymce.explode;tinymce.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var H=this,I=window.location;tinymce.documentBaseURL=I.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(tinymce.documentBaseURL)){tinymce.documentBaseURL+="/"}tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=I.hostname&&I.hostname){document.domain=tinymce.relaxedDomain=I.hostname.replace(/.*\.(.+\..+)$/,"$1")}H.onBeforeUnload=new tinymce.util.Dispatcher(H);A.add(window,"beforeunload",function(J){H.onBeforeUnload.dispatch(H,J)})},init:function(K){var I=this,J,H=tinymce.ScriptLoader,N,M;function L(Q,R,O){var P=Q[R];if(!P){return }if(tinymce.is(P,"string")){O=P.replace(/\.\w+$/,"");O=O?tinymce.resolve(O):0;P=tinymce.resolve(P)}return P.apply(O||this,Array.prototype.slice.call(arguments,2))}K=G({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},K);I.settings=K;if(!A.domLoaded&&!K.strict_loading_mode){if(K.language){l=tinyMCE.settings.language;H.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(K.theme&&K.theme.charAt(0)!="-"&&!C.urls[K.theme]){C.load(K.theme,"themes/"+K.theme+"/editor_template"+tinymce.suffix+".js")}if(K.plugins){J=D(K.plugins);if(tinymce.inArray(J,"compat2x")!=-1){B.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js")}F(J,function(O){if(O&&O.charAt(0)!="-"&&!B.urls[O]){if(!tinymce.isWebKit&&O=="safari"){return }B.load(O,"plugins/"+O+"/editor_plugin"+tinymce.suffix+".js")}})}H.loadQueue()}A.add(document,"init",function(){var O,Q;L(K,"onpageload");if(K.browsers){O=false;F(D(K.browsers),function(R){switch(R){case"ie":case"msie":if(tinymce.isIE){O=true}break;case"gecko":if(tinymce.isGecko){O=true}break;case"safari":case"webkit":if(tinymce.isWebKit){O=true}break;case"opera":if(tinymce.isOpera){O=true}break}});if(!O){return }}switch(K.mode){case"exact":O=K.elements||"";if(O.length>0){F(D(O),function(R){if(E.get(R)){new tinymce.Editor(R,K).render(1)}else{N=0;F(document.forms,function(S){F(S.elements,function(T){if(T.name===R){R="mce_editor_"+N;E.setAttrib(T,"id",R);new tinymce.Editor(R,K).render(1)}})})}})}break;case"textareas":case"specific_textareas":function P(S,R){return R.constructor===RegExp?R.test(S.className):E.hasClass(S,R)}F(E.select("textarea"),function(R){if(K.editor_deselector&&P(R,K.editor_deselector)){return }if(!K.editor_selector||P(R,K.editor_selector)){M=E.get(R.name);if(!R.id&&!M){R.id=R.name}if(!R.id||I.get(R.id)){R.id=E.uniqueId()}new tinymce.Editor(R.id,K).render(1)}});break}if(K.oninit){O=Q=0;F(I.editors,function(R){Q++;if(!R.initialized){R.onInit.add(function(){O++;if(O==Q){L(K,"oninit")}})}else{O++}if(O==Q){L(K,"oninit")}})}})},get:function(H){return this.editors[H]},getInstanceById:function(H){return this.get(H)},add:function(H){this.editors[H.id]=H;this._setActive(H);return H},remove:function(I){var H=this;if(!H.editors[I.id]){return null}delete H.editors[I.id];if(H.activeEditor==I){F(H.editors,function(J){H._setActive(J);return false})}I.destroy();return I},execCommand:function(N,L,K){var M=this,J=M.get(K),H;switch(N){case"mceFocus":J.focus();return true;case"mceAddEditor":case"mceAddControl":if(!M.get(K)){new tinymce.Editor(K,M.settings).render()}return true;case"mceAddFrameControl":H=K.window;H.tinyMCE=tinyMCE;H.tinymce=tinymce;tinymce.DOM.doc=H.document;tinymce.DOM.win=H;J=new tinymce.Editor(K.element_id,K);J.render();if(tinymce.isIE){function I(){J.destroy();H.detachEvent("onunload",I);H=H.tinyMCE=H.tinymce=null}H.attachEvent("onunload",I)}K.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":J.remove();return true;case"mceToggleEditor":if(!J){M.execCommand("mceAddControl",0,K);return true}if(J.isHidden()){J.show()}else{J.hide()}return true}if(M.activeEditor){return M.activeEditor.execCommand(N,L,K)}return false},execInstanceCommand:function(L,K,J,I){var H=this.get(L);if(H){return H.execCommand(K,J,I)}return false},triggerSave:function(){F(this.editors,function(H){H.save()})},addI18n:function(J,K){var H,I=this.i18n;if(!tinymce.is(J,"string")){F(J,function(M,L){F(M,function(O,N){F(O,function(Q,P){if(N==="common"){I[L+"."+P]=Q}else{I[L+"."+N+"."+P]=Q}})})})}else{F(K,function(M,L){I[J+"."+L]=M})}},_setActive:function(H){this.selectedInstance=this.activeEditor=H}});tinymce.EditorManager.preInit()})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var N=tinymce.DOM,K=tinymce.dom.Event,F=tinymce.extend,L=tinymce.util.Dispatcher;var J=tinymce.each,A=tinymce.isGecko,B=tinymce.isIE,E=tinymce.isWebKit;var D=tinymce.is,H=tinymce.ThemeManager,C=tinymce.PluginManager,I=tinymce.EditorManager;var O=tinymce.inArray,M=tinymce.grep,G=tinymce.explode;tinymce.create("tinymce.Editor",{Editor:function(R,Q){var P=this;P.id=P.editorId=R;P.execCommands={};P.queryStateCommands={};P.queryValueCommands={};P.plugins={};J(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(S){P[S]=new L(P)});P.settings=Q=F({id:R,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px"},Q);P.documentBaseURI=new tinymce.util.URI(Q.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});P.baseURI=I.baseURI;P.execCallback("setup",P)},render:function(R){var S=this,T=S.settings,U=S.id,P=tinymce.ScriptLoader;if(!K.domLoaded){K.add(document,"init",function(){S.render()});return }if(!R){T.strict_loading_mode=1;tinyMCE.settings=T}if(!S.getElement()){return }if(T.strict_loading_mode){P.settings.strict_mode=T.strict_loading_mode;tinymce.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(S.getElement().nodeName)&&T.hidden_input&&N.getParent(U,"form")){N.insertAfter(N.create("input",{type:"hidden",name:U}),U)}S.windowManager=new tinymce.WindowManager(S);if(T.encoding=="xml"){S.onGetContent.add(function(V,W){if(W.save){W.content=N.encode(W.content)}})}if(T.add_form_submit_trigger){S.onSubmit.addToTop(function(){if(S.initialized){S.save();S.isNotDirty=1}})}if(T.add_unload_trigger&&!T.ask){S._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(S.initialized&&!S.destroyed&&!S.isHidden()){S.save({format:"raw",no_events:true})}})}tinymce.addUnload(S.destroy,S);if(T.submit_patch){S.onBeforeRenderUI.add(function(){var V=S.getElement().form;if(!V){return }if(V._mceOldSubmit){return }if(!V.submit.nodeType&&!V.submit.length){S.formElement=V;V._mceOldSubmit=V.submit;V.submit=function(){I.triggerSave();S.isNotDirty=1;return this._mceOldSubmit(this)}}V=null})}function Q(){if(T.language){l=tinyMCE.settings.language;P.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(T.theme.charAt(0)!="-"&&!H.urls[T.theme]){H.load(T.theme,"themes/"+T.theme+"/editor_template"+tinymce.suffix+".js")}J(G(T.plugins),function(V){if(V&&V.charAt(0)!="-"&&!C.urls[V]){if(!E&&V=="safari"){return }C.load(V,"plugins/"+V+"/editor_plugin"+tinymce.suffix+".js")}});P.loadQueue(function(){if(T.ask){function V(){window.setTimeout(function(){K.remove(S.id,"focus",V);S.windowManager.confirm(S.getLang("edit_confirm"),function(W){if(W){S.init()}})},0)}K.add(S.id,"focus",V);return }if(!S.removed){S.init()}})}if(T.plugins.indexOf("compat2x")!=-1){C.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js");P.loadQueue(Q)}else{Q()}},init:function(){var R,a=this,b=a.settings,X,U,W=a.getElement(),Q,P,Y,T,V,Z;I.add(a);b.theme=b.theme.replace(/-/,"");Q=H.get(b.theme);a.theme=new Q();if(a.theme.init&&b.init_theme){a.theme.init(a,H.urls[b.theme]||tinymce.documentBaseURL.replace(/\/$/,""))}J(G(b.plugins.replace(/\-/g,"")),function(f){var g=C.get(f),e=C.urls[f]||tinymce.documentBaseURL.replace(/\/$/,""),d;if(g){d=new g(a,e);a.plugins[f]=d;if(d.init){d.init(a,e)}}});if(b.popup_css){b.popup_css=a.documentBaseURI.toAbsolute(b.popup_css)}else{b.popup_css=a.baseURI.toAbsolute("themes/"+b.theme+"/skins/"+b.skin+"/dialog.css")}if(b.popup_css_add){b.popup_css+=","+a.documentBaseURI.toAbsolute(b.popup_css_add)}a.controlManager=new tinymce.ControlManager(a);a.undoManager=new tinymce.UndoManager(a);a.undoManager.onAdd.add(function(d,c){if(!c.initial){return a.onChange.dispatch(a,c,d)}});a.undoManager.onUndo.add(function(d,c){return a.onUndo.dispatch(a,c,d)});a.undoManager.onRedo.add(function(d,c){return a.onRedo.dispatch(a,c,d)});if(b.custom_undo_redo){a.onExecCommand.add(function(d,f,e,g,c){if(f!="Undo"&&f!="Redo"&&f!="mceRepaint"&&(!c||!c.skip_undo)){a.undoManager.add()}})}a.onExecCommand.add(function(d,e){if(!/^(FontName|FontSize)$/.test(e)){a.nodeChanged()}});if(A){function S(c,d){if(!d||!d.initial){a.execCommand("mceRepaint")}}a.onUndo.add(S);a.onRedo.add(S);a.onSetContent.add(S)}a.onBeforeRenderUI.dispatch(a,a.controlManager);if(b.render_ui){X=b.width||W.style.width||W.offsetWidth;U=b.height||W.style.height||W.offsetHeight;a.orgDisplay=W.style.display;Z=/^[0-9\.]+(|px)$/i;if(Z.test(""+X)){X=Math.max(parseInt(X)+(Q.deltaWidth||0),100)}if(Z.test(""+U)){U=Math.max(parseInt(U)+(Q.deltaHeight||0),100)}Q=a.theme.renderUI({targetNode:W,width:X,height:U,deltaWidth:b.delta_width,deltaHeight:b.delta_height});a.editorContainer=Q.editorContainer}N.setStyles(Q.sizeContainer||Q.editorContainer,{width:X,height:U});U=(Q.iframeHeight||U)+((U+"").indexOf("%")==-1?(Q.deltaHeight||0):"");if(U<100){U=100}a.iframeHTML=b.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+a.documentBaseURI.getURI()+'"></base>';a.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain){a.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";<\/script>'}T=b.body_id||"tinymce";if(T.indexOf("=")!=-1){T=a.getParam("body_id","","hash");T=T[a.id]||T}V=b.body_class||"";if(V.indexOf("=")!=-1){V=a.getParam("body_class","","hash");V=V[a.id]||""}a.iframeHTML+='</head><body id="'+T+'" class="mceContentBody '+V+'"></body></html>';if(tinymce.relaxedDomain){if(B){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+a.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(tinymce.isOpera){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}R=N.add(Q.iframeContainer,"iframe",{id:a.id+"_ifr",src:Y||'javascript:""',frameBorder:"0",style:{width:"100%",height:U}});a.contentAreaContainer=Q.iframeContainer;N.get(Q.editorContainer).style.display=a.orgDisplay;N.get(a.id).style.display="none";if(tinymce.isOldWebKit){K.add(R,"load",a.setupIframe,a);R.src=tinymce.baseURL+"/plugins/safari/blank.htm"}else{if(!B||!tinymce.relaxedDomain){a.setupIframe()}W=R=Q=null}},setupIframe:function(){var S=this,U=S.settings,V=N.get(S.id),W=S.getDoc(),T,Q;if(!B||!tinymce.relaxedDomain){W.open();W.write(S.iframeHTML);W.close()}if(!B){try{W.designMode="On"}catch(R){}}if(B){Q=S.getBody();N.hide(Q);Q.contentEditable=true;N.show(Q)}S.dom=new tinymce.DOM.DOMUtils(S.getDoc(),{keep_values:true,url_converter:S.convertURL,url_converter_scope:S,hex_colors:U.force_hex_style_colors,class_filter:U.class_filter,update_styles:1,fix_ie_paragraphs:1});S.serializer=new tinymce.dom.Serializer({entity_encoding:U.entity_encoding,entities:U.entities,valid_elements:U.verify_html===false?"*[*]":U.valid_elements,extended_valid_elements:U.extended_valid_elements,valid_child_elements:U.valid_child_elements,invalid_elements:U.invalid_elements,fix_table_elements:U.fix_table_elements,fix_list_elements:U.fix_list_elements,fix_content_duplication:U.fix_content_duplication,convert_fonts_to_spans:U.convert_fonts_to_spans,font_size_classes:U.font_size_classes,font_size_style_values:U.font_size_style_values,apply_source_formatting:U.apply_source_formatting,remove_linebreaks:U.remove_linebreaks,dom:S.dom});S.selection=new tinymce.dom.Selection(S.dom,S.getWin(),S.serializer);S.forceBlocks=new tinymce.ForceBlocks(S,{forced_root_block:U.forced_root_block});S.editorCommands=new tinymce.EditorCommands(S);S.serializer.onPreProcess.add(function(X,Y){return S.onPreProcess.dispatch(S,Y,X)});S.serializer.onPostProcess.add(function(X,Y){return S.onPostProcess.dispatch(S,Y,X)});S.onPreInit.dispatch(S);if(!U.gecko_spellcheck){S.getBody().spellcheck=0}S._addEvents();S.controlManager.onPostRender.dispatch(S,S.controlManager);S.onPostRender.dispatch(S);if(U.directionality){S.getBody().dir=U.directionality}if(U.nowrap){S.getBody().style.whiteSpace="nowrap"}if(U.auto_resize){S.onNodeChange.add(S.resizeToContent,S)}if(U.custom_elements){function P(X,Y){J(G(U.custom_elements),function(Z){var a;if(Z.indexOf("~")===0){Z=Z.substring(1);a="span"}else{a="div"}Y.content=Y.content.replace(new RegExp("<("+Z+")([^>]*)>","g"),"<"+a+' mce_name="$1"$2>');Y.content=Y.content.replace(new RegExp("</("+Z+")>","g"),"</"+a+">")})}S.onBeforeSetContent.add(P);S.onPostProcess.add(function(X,Y){if(Y.set){P(X,Y)}})}if(U.handle_node_change_callback){S.onNodeChange.add(function(Y,X,Z){S.execCallback("handle_node_change_callback",S.id,Z,-1,-1,true,S.selection.isCollapsed())})}if(U.save_callback){S.onSaveContent.add(function(X,Z){var Y=S.execCallback("save_callback",S.id,Z.content,S.getBody());if(Y){Z.content=Y}})}if(U.onchange_callback){S.onChange.add(function(Y,X){S.execCallback("onchange_callback",S,X)})}if(U.convert_newlines_to_brs){S.onBeforeSetContent.add(function(X,Y){if(Y.initial){Y.content=Y.content.replace(/\r?\n/g,"<br />")}})}if(U.fix_nesting&&B){S.onBeforeSetContent.add(function(X,Y){Y.content=S._fixNesting(Y.content)})}if(U.preformatted){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^\s*<pre.*?>/,"");Y.content=Y.content.replace(/<\/pre>\s*$/,"");if(Y.set){Y.content='<pre class="mceItemHidden">'+Y.content+"</pre>"}})}if(U.verify_css_classes){S.serializer.attribValueFilter=function(a,Y){var Z,X;if(a=="class"){if(!S.classesRE){X=S.dom.getClasses();if(X.length>0){Z="";J(X,function(b){Z+=(Z?"|":"")+b["class"]});S.classesRE=new RegExp("("+Z+")","gi")}}return !S.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(Y)||S.classesRE.test(Y)?Y:""}return Y}}if(U.convert_fonts_to_spans){S._convertFonts()}if(U.inline_styles){S._convertInlineElements()}if(U.cleanup_callback){S.onBeforeSetContent.add(function(X,Y){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)});S.onPreProcess.add(function(X,Y){if(Y.set){S.execCallback("cleanup_callback","insert_to_editor_dom",Y.node,Y)}if(Y.get){S.execCallback("cleanup_callback","get_from_editor_dom",Y.node,Y)}});S.onPostProcess.add(function(X,Y){if(Y.set){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)}if(Y.get){Y.content=S.execCallback("cleanup_callback","get_from_editor",Y.content,Y)}})}if(U.save_callback){S.onGetContent.add(function(X,Y){if(Y.save){Y.content=S.execCallback("save_callback",S.id,Y.content,S.getBody())}})}if(U.handle_event_callback){S.onEvent.add(function(X,Y,Z){if(S.execCallback("handle_event_callback",Y,X,Z)===false){K.cancel(Y)}})}S.onSetContent.add(function(){S.addVisual(S.getBody())});if(U.padd_empty_editor){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^(<p>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(A){try{W.designMode="Off";W.designMode="On"}catch(R){}}setTimeout(function(){if(S.removed){return }S.load({initial:true,format:(U.cleanup_on_startup?"html":"raw")});S.startContent=S.getContent({format:"raw"});S.undoManager.add({initial:true});S.initialized=true;S.onInit.dispatch(S);S.execCallback("setupcontent_callback",S.id,S.getBody(),S.getDoc());S.execCallback("init_instance_callback",S);S.focus(true);S.nodeChanged({initial:1});if(U.content_css){tinymce.each(G(U.content_css),function(X){S.dom.loadCSS(S.documentBaseURI.toAbsolute(X))})}if(U.auto_focus){setTimeout(function(){var X=I.get(U.auto_focus);X.selection.select(X.getBody(),1);X.selection.collapse(1);X.getWin().focus()},100)}},1);V=null},focus:function(Q){var S,P=this,R=P.settings.content_editable;if(!Q){if(!R){P.getWin().focus()}}if(I.activeEditor!=P){if((S=I.activeEditor)!=null){S.onDeactivate.dispatch(S,P)}P.onActivate.dispatch(P,S)}I._setActive(P)},execCallback:function(S){var P=this,R=P.settings[S],Q;if(!R){return }if(P.callbackLookup&&(Q=P.callbackLookup[S])){R=Q.func;Q=Q.scope}if(D(R,"string")){Q=R.replace(/\.\w+$/,"");Q=Q?tinymce.resolve(Q):0;R=tinymce.resolve(R);P.callbackLookup=P.callbackLookup||{};P.callbackLookup[S]={func:R,scope:Q}}return R.apply(Q||P,Array.prototype.slice.call(arguments,1))},translate:function(P){var R=this.settings.language,Q=I.i18n;if(!P){return""}return Q[R+"."+P]||P.replace(/{\#([^}]+)\}/g,function(T,S){return Q[R+"."+S]||"{#"+S+"}"})},getLang:function(Q,P){return I.i18n[this.settings.language+"."+Q]||(D(P)?P:"{#"+Q+"}")},getParam:function(U,R,P){var S=tinymce.trim,Q=D(this.settings[U])?this.settings[U]:R,T;if(P==="hash"){T={};if(D(Q,"string")){J(Q.indexOf("=")>0?Q.split(/[;,](?![^=;,]*(?:[;,]|$))/):Q.split(","),function(V){V=V.split("=");if(V.length>1){T[S(V[0])]=S(V[1])}else{T[S(V[0])]=S(V)}})}else{T=Q}return T}return Q},nodeChanged:function(R){var P=this,Q=P.selection,S=Q.getNode()||P.getBody();if(P.initialized){P.onNodeChange.dispatch(P,R?R.controlManager||P.controlManager:P.controlManager,B&&S.ownerDocument!=P.getDoc()?P.getBody():S,Q.isCollapsed(),R)}},addButton:function(R,Q){var P=this;P.buttons=P.buttons||{};P.buttons[R]=Q},addCommand:function(R,Q,P){this.execCommands[R]={func:Q,scope:P||this}},addQueryStateHandler:function(R,Q,P){this.queryStateCommands[R]={func:Q,scope:P||this}},addQueryValueHandler:function(R,Q,P){this.queryValueCommands[R]={func:Q,scope:P||this}},addShortcut:function(R,T,P,S){var Q=this,U;if(!Q.settings.custom_shortcuts){return false}Q.shortcuts=Q.shortcuts||{};if(D(P,"string")){U=P;P=function(){Q.execCommand(U,false,null)}}if(D(P,"object")){U=P;P=function(){Q.execCommand(U[0],U[1],U[2])}}J(G(R),function(V){var W={func:P,scope:S||this,desc:T,alt:false,ctrl:false,shift:false};J(G(V,"+"),function(X){switch(X){case"alt":case"ctrl":case"shift":W[X]=true;break;default:W.charCode=X.charCodeAt(0);W.keyCode=X.toUpperCase().charCodeAt(0)}});Q.shortcuts[(W.ctrl?"ctrl":"")+","+(W.alt?"alt":"")+","+(W.shift?"shift":"")+","+W.keyCode]=W});return true},execCommand:function(U,T,W,P){var R=this,S=0,V,Q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(U)&&(!P||!P.skip_focus)){R.focus()}V={};R.onBeforeExecCommand.dispatch(R,U,T,W,V);if(V.terminate){return false}if(R.execCallback("execcommand_callback",R.id,R.selection.getNode(),U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(V=R.execCommands[U]){Q=V.func.call(V.scope,T,W);if(Q!==true){R.onExecCommand.dispatch(R,U,T,W,P);return Q}}J(R.plugins,function(X){if(X.execCommand&&X.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);S=1;return false}});if(S){return true}if(R.theme.execCommand&&R.theme.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(R.editorCommands.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}R.getDoc().execCommand(U,T,W);R.onExecCommand.dispatch(R,U,T,W,P)},queryCommandState:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryStateCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandState(T);if(S!==-1){return S}try{return this.getDoc().queryCommandState(T)}catch(P){}},queryCommandValue:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryValueCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandValue(T);if(D(S)){return S}try{return this.getDoc().queryCommandValue(T)}catch(P){}},show:function(){var P=this;N.show(P.getContainer());N.hide(P.id);P.load()},hide:function(){var P=this,Q=P.getDoc();if(B&&Q){Q.execCommand("SelectAll")}P.save();N.hide(P.getContainer());N.setStyle(P.id,"display",P.orgDisplay)},isHidden:function(){return !N.isHidden(this.id)},setProgressState:function(P,Q,R){this.onSetProgressState.dispatch(this,P,Q,R);return P},resizeToContent:function(){var P=this;N.setStyle(P.id+"_ifr","height",P.getBody().scrollHeight)},load:function(S){var P=this,R=P.getElement(),Q;S=S||{};S.load=true;Q=P.setContent(D(R.value)?R.value:R.innerHTML,S);S.element=R;if(!S.no_events){P.onLoadContent.dispatch(P,S)}S.element=R=null;return Q},save:function(T){var P=this,S=P.getElement(),Q,R;if(!P.initialized){return }T=T||{};T.save=true;if(!T.no_events){P.undoManager.typing=0;P.undoManager.add()}T.element=S;Q=T.content=P.getContent(T);if(!T.no_events){P.onSaveContent.dispatch(P,T)}Q=T.content;if(!/TEXTAREA|INPUT/i.test(S.nodeName)){S.innerHTML=Q;if(R=N.getParent(P.id,"form")){J(R.elements,function(U){if(U.name==P.id){U.value=Q;return false}})}}else{S.value=Q}T.element=S=null;return Q},setContent:function(Q,R){var P=this;R=R||{};R.format=R.format||"html";R.set=true;R.content=Q;if(!R.no_events){P.onBeforeSetContent.dispatch(P,R)}if(!tinymce.isIE&&(Q.length===0||/^\s+$/.test(Q))){R.content=P.dom.setHTML(P.getBody(),'<br mce_bogus="1" />');R.format="raw"}R.content=P.dom.setHTML(P.getBody(),tinymce.trim(R.content));if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;R.content=P.dom.setHTML(P.getBody(),P.serializer.serialize(P.getBody(),R))}if(!R.no_events){P.onSetContent.dispatch(P,R)}return R.content},getContent:function(R){var P=this,Q;R=R||{};R.format=R.format||"html";R.get=true;if(!R.no_events){P.onBeforeGetContent.dispatch(P,R)}if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;Q=P.serializer.serialize(P.getBody(),R)}else{Q=P.getBody().innerHTML}Q=Q.replace(/^\s*|\s*$/g,"");R.content=Q;if(!R.no_events){P.onGetContent.dispatch(P,R)}return R.content},isDirty:function(){var P=this;return tinymce.trim(P.startContent)!=tinymce.trim(P.getContent({format:"raw",no_events:1}))&&!P.isNotDirty},getContainer:function(){var P=this;if(!P.container){P.container=N.get(P.editorContainer||P.id+"_parent")}return P.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return N.get(this.settings.content_element||this.id)},getWin:function(){var P=this,Q;if(!P.contentWindow){Q=N.get(P.id+"_ifr");if(Q){P.contentWindow=Q.contentWindow}}return P.contentWindow},getDoc:function(){var Q=this,P;if(!Q.contentDocument){P=Q.getWin();if(P){Q.contentDocument=P.document}}return Q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(P,T,S){var Q=this,R=Q.settings;if(R.urlconverter_callback){return Q.execCallback("urlconverter_callback",P,S,true,T)}if(!R.convert_urls||(S&&S.nodeName=="LINK")||P.indexOf("file:")===0){return P}if(R.relative_urls){return Q.documentBaseURI.toRelative(P)}P=Q.documentBaseURI.toAbsolute(P,R.remove_script_host);return P},addVisual:function(R){var P=this,Q=P.settings;R=R||P.getBody();if(!D(P.hasVisual)){P.hasVisual=Q.visual}J(P.dom.select("table,a",R),function(T){var S;switch(T.nodeName){case"TABLE":S=P.dom.getAttrib(T,"border");if(!S||S=="0"){if(P.hasVisual){P.dom.addClass(T,Q.visual_table_class)}else{P.dom.removeClass(T,Q.visual_table_class)}}return ;case"A":S=P.dom.getAttrib(T,"name");if(S){if(P.hasVisual){P.dom.addClass(T,"mceItemAnchor")}else{P.dom.removeClass(T,"mceItemAnchor")}}return }});P.onVisualAid.dispatch(P,R,P.hasVisual)},remove:function(){var P=this,Q=P.getContainer();P.removed=1;P.hide();P.execCallback("remove_instance_callback",P);P.onRemove.dispatch(P);P.onExecCommand.listeners=[];I.remove(P);N.remove(Q)},destroy:function(Q){var P=this;if(P.destroyed){return }if(!Q){tinymce.removeUnload(P.destroy);tinyMCE.onBeforeUnload.remove(P._beforeUnload);if(P.theme.destroy){P.theme.destroy()}P.controlManager.destroy();P.selection.destroy();P.dom.destroy();if(!P.settings.content_editable){K.clear(P.getWin());K.clear(P.getDoc())}K.clear(P.getBody());K.clear(P.formElement)}if(P.formElement){P.formElement.submit=P.formElement._mceOldSubmit;P.formElement._mceOldSubmit=null}P.contentAreaContainer=P.formElement=P.container=P.settings.content_element=P.bodyElement=P.contentDocument=P.contentWindow=null;if(P.selection){P.selection=P.selection.win=P.selection.dom=P.selection.dom.doc=null}P.destroyed=1},_addEvents:function(){var W=this,Q,X=W.settings,T={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function P(a,b){var Z=a.type;if(W.removed){return }if(W.onEvent.dispatch(W,a,b)!==false){W[T[a.fakeType||a.type]].dispatch(W,a,b)}}J(T,function(a,Z){switch(Z){case"contextmenu":if(tinymce.isOpera){K.add(W.getBody(),"mousedown",function(b){if(b.ctrlKey){b.fakeType="contextmenu";P(b)}})}else{K.add(W.getBody(),Z,P)}break;case"paste":K.add(W.getBody(),Z,function(g){var b,d,c,f;if(g.clipboardData){b=g.clipboardData.getData("text/plain")}else{if(tinymce.isIE){b=W.getWin().clipboardData.getData("Text")}}P(g,{text:b,html:d})});break;case"submit":case"reset":K.add(W.getElement().form||N.getParent(W.id,"form"),Z,P);break;default:K.add(X.content_editable?W.getBody():W.getDoc(),Z,P)}});K.add(X.content_editable?W.getBody():(A?W.getDoc():W.getWin()),"focus",function(Z){W.focus(true)});if(tinymce.isGecko){K.add(W.getDoc(),"DOMNodeInserted",function(a){var Z;a=a.target;if(a.nodeType===1&&a.nodeName==="IMG"&&(Z=a.getAttribute("mce_src"))){a.src=W.documentBaseURI.toAbsolute(Z)}})}if(A){function R(){var a=this,c=a.getDoc(),b=a.settings;if(A){if(a._isHidden()){try{if(!b.content_editable){c.designMode="On"}}catch(Z){}}try{c.execCommand("styleWithCSS",0,false)}catch(Z){if(!a._isHidden()){try{c.execCommand("useCSS",0,true)}catch(Z){}}}if(!b.table_inline_editing){try{c.execCommand("enableInlineTableEditing",false,false)}catch(Z){}}if(!b.object_resizing){try{c.execCommand("enableObjectResizing",false,false)}catch(Z){}}}}W.onBeforeExecCommand.add(R);W.onMouseDown.add(R)}W.onMouseUp.add(W.nodeChanged);W.onClick.add(W.nodeChanged);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.keyCode==46||a.keyCode==8||a.ctrlKey){W.nodeChanged()}});W.onReset.add(function(){W.setContent(W.startContent,{format:"raw"})});if(W.getParam("tab_focus")){function Y(Z,a){if(a.keyCode===9){return K.cancel(a)}}function U(b,h){var Z,c,g,d,a;function j(e){g=N.getParent(b.id,"form");d=g.elements;if(g){J(d,function(k,f){if(k.id==b.id){Z=f;return false}});if(e>0){for(c=Z+1;c<d.length;c++){if(d[c].type!="hidden"){return d[c]}}}else{for(c=Z-1;c>=0;c--){if(d[c].type!="hidden"){return d[c]}}}}return null}if(h.keyCode===9){a=G(b.getParam("tab_focus"));if(a.length==1){a[1]=a[0];a[0]=":prev"}if(h.shiftKey){if(a[0]==":prev"){d=j(-1)}else{d=N.get(a[0])}}else{if(a[1]==":next"){d=j(1)}else{d=N.get(a[1])}}if(d){if(b=I.get(d.id||d.name)){b.focus()}else{window.setTimeout(function(){window.focus();d.focus()},10)}return K.cancel(h)}}}W.onKeyUp.add(Y);if(A){W.onKeyPress.add(U);W.onKeyDown.add(Y)}else{W.onKeyDown.add(U)}}if(X.custom_shortcuts){if(X.custom_undo_redo_keyboard_shortcuts){W.addShortcut("ctrl+z",W.getLang("undo_desc"),"Undo");W.addShortcut("ctrl+y",W.getLang("redo_desc"),"Redo")}if(A){W.addShortcut("ctrl+b",W.getLang("bold_desc"),"Bold");W.addShortcut("ctrl+i",W.getLang("italic_desc"),"Italic");W.addShortcut("ctrl+u",W.getLang("underline_desc"),"Underline")}for(Q=1;Q<=6;Q++){W.addShortcut("ctrl+"+Q,"",["FormatBlock",false,"<h"+Q+">"])}W.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);W.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);W.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function S(a){var Z=null;if(!a.altKey&&!a.ctrlKey&&!a.metaKey){return Z}J(W.shortcuts,function(b){if(b.ctrl!=a.ctrlKey&&(!tinymce.isMac||b.ctrl==a.metaKey)){return }if(b.alt!=a.altKey){return }if(b.shift!=a.shiftKey){return }if(a.keyCode==b.keyCode||(a.charCode&&a.charCode==b.charCode)){Z=b;return false}});return Z}W.onKeyUp.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyPress.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyDown.add(function(Z,a){var b=S(a);if(b){b.func.call(b.scope);return K.cancel(a)}})}if(tinymce.isIE){K.add(W.getDoc(),"controlselect",function(b){var a=W.resizeInfo,Z;b=b.target;if(b.nodeName!=="IMG"){return }if(a){K.remove(a.node,a.ev,a.cb)}if(!W.dom.hasClass(b,"mceItemNoResize")){ev="resizeend";Z=K.add(b,ev,function(d){var c;d=d.target;if(c=W.dom.getStyle(d,"width")){W.dom.setAttrib(d,"width",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"width","")}if(c=W.dom.getStyle(d,"height")){W.dom.setAttrib(d,"height",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"height","")}})}else{ev="resizestart";Z=K.add(b,"resizestart",K.cancel,K)}a=W.resizeInfo={node:b,ev:ev,cb:Z}});W.onKeyDown.add(function(Z,a){switch(a.keyCode){case 8:if(W.selection.getRng().item){W.selection.getRng().item(0).removeNode();return K.cancel(a)}}})}if(tinymce.isOpera){W.onClick.add(function(Z,a){K.prevent(a)})}if(X.custom_undo_redo){function V(){W.undoManager.typing=0;W.undoManager.add()}if(tinymce.isIE){K.add(W.getWin(),"blur",function(Z){var a;if(W.selection){a=W.selection.getNode();if(!W.removed&&a.ownerDocument&&a.ownerDocument!=W.getDoc()){V()}}})}else{K.add(W.getDoc(),"blur",function(){if(W.selection&&!W.removed){V()}})}W.onMouseDown.add(V);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.ctrlKey){W.undoManager.typing=0;W.undoManager.add()}});W.onKeyDown.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45){if(W.undoManager.typing){W.undoManager.add();W.undoManager.typing=0}return }if(!W.undoManager.typing){W.undoManager.add();W.undoManager.typing=1}})}},_convertInlineElements:function(){var V=this,X=V.settings,Q=V.dom,U,S,R,W,P;function T(Y,Z){if(!X.inline_styles){return }if(Z.get){J(V.dom.select("table,u,strike",Z.node),function(a){switch(a.nodeName){case"TABLE":if(U=Q.getAttrib(a,"height")){Q.setStyle(a,"height",U);Q.setAttrib(a,"height","")}break;case"U":case"STRIKE":a.style.textDecoration=a.nodeName=="U"?"underline":"line-through";Q.setAttrib(a,"mce_style","");Q.setAttrib(a,"mce_name","span");break}})}else{if(Z.set){J(V.dom.select("table,span",Z.node).reverse(),function(a){if(a.nodeName=="TABLE"){if(U=Q.getStyle(a,"height")){Q.setAttrib(a,"height",U.replace(/[^0-9%]+/g,""))}}else{if(a.style.textDecoration=="underline"){R="u"}else{if(a.style.textDecoration=="line-through"){R="strike"}else{R=""}}if(R){a.style.textDecoration="";Q.setAttrib(a,"mce_style","");S=Q.create(R,{style:Q.getAttrib(a,"style")});Q.replace(S,a,1)}}})}}}V.onPreProcess.add(T);if(!X.cleanup_on_startup){V.onSetContent.add(function(Y,Z){if(Z.initial){T(V,{node:V.getBody(),set:1})}})}},_convertFonts:function(){var U=this,V=U.settings,W=U.dom,T,Q,P,S;if(!V.inline_styles){return }T=[8,10,12,14,18,24,36];Q=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(P=V.font_size_style_values){P=G(P)}if(S=V.font_size_classes){S=G(S)}function R(d){var e,c,Y,X,b,Z,a;if(tinymce.isWebKit||!V.inline_styles){return }Y=U.dom.select("span",d);for(X=Y.length-1;X>=0;X--){e=Y[X];c=W.create("font",{color:W.toHex(W.getStyle(e,"color")),face:W.getStyle(e,"fontFamily"),style:W.getAttrib(e,"style"),"class":W.getAttrib(e,"class")});a=c.style;if(a.color||a.fontFamily){a.color=a.fontFamily="";W.setAttrib(c,"mce_style","")}if(P){b=O(P,W.getStyle(e,"fontSize"));if(b!=-1){W.setAttrib(c,"size",""+(b+1||1))}}else{if(S){b=O(S,W.getAttrib(e,"class"));Z=W.getStyle(e,"fontSize");if(b==-1&&Z.indexOf("pt")>0){b=O(T,parseInt(Z))}if(b==-1){b=O(Q,Z)}if(b!=-1){W.setAttrib(c,"size",""+(b+1||1));c.style.fontSize=""}}}if(c.color||c.face||c.size){c.style.fontFamily="";W.setAttrib(c,"mce_style","");W.replace(c,e,1)}c=e=null}}U.onSetContent.add(function(X,Y){R(X.getBody())});U.onPreProcess.add(function(Z,b){var c,a,Y,X;if(!V.inline_styles){return }if(b.get){Y=U.dom.select("font",b.node);for(X=Y.length-1;X>=0;X--){c=Y[X];a=W.create("span",{style:W.getAttrib(c,"style"),"class":W.getAttrib(c,"class")});W.setStyles(a,{fontFamily:W.getAttrib(c,"face"),color:W.getAttrib(c,"color"),backgroundColor:c.style.backgroundColor});if(c.size){if(P){W.setStyle(a,"fontSize",P[parseInt(c.size)-1])}else{W.setAttrib(a,"class",S[parseInt(c.size)-1])}}W.setAttrib(a,"mce_style","");W.replace(a,c,1)}}})},_isHidden:function(){var P;if(!A){return 0}P=this.selection.getSel();return(!P||!P.rangeCount||P.rangeCount==0)},_fixNesting:function(Q){var R=[],P;Q=Q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(T,S,V){var U;if(S==="/"){if(!R.length){return""}if(V!==R[R.length-1].tag){for(P=R.length-1;P>=0;P--){if(R[P].tag===V){R[P].close=1;break}}return""}else{R.pop();if(R.length&&R[R.length-1].close){T=T+"</"+R[R.length-1].tag+">";R.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(V)){return T}if(/\/>$/.test(T)){return T}R.push({tag:V})}return T});for(P=R.length-1;P>=0;P--){Q+="</"+R[P].tag+">"}return Q}})})();(function(){var E=tinymce.each,C=tinymce.isIE,A=tinymce.isGecko,B=tinymce.isOpera,D=tinymce.isWebKit;tinymce.create("tinymce.EditorCommands",{EditorCommands:function(F){this.editor=F},execCommand:function(K,J,L){var H=this,F=H.editor,I;switch(K){case"Cut":case"Copy":case"Paste":try{F.getDoc().execCommand(K,J,L)}catch(G){if(A){F.windowManager.confirm(F.getLang("clipboard_msg"),function(M){if(M){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","mceExternal")}})}else{F.windowManager.alert(F.getLang("clipboard_no_support"))}}return true;case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":H.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":H.mceJustify(K,K.substring(7).toLowerCase());return true;case"mceEndUndoLevel":case"mceAddUndoLevel":F.undoManager.add();return true;default:I=this[K];if(I){I.call(this,J,L);return true}}return false},Indent:function(){var F=this.editor,K=F.dom,I=F.selection,J,G,H;G=F.settings.indentation;H=/[a-z%]+$/i.exec(G);G=parseInt(G);if(F.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(L){K.setStyle(L,"paddingLeft",(parseInt(L.style.paddingLeft||0)+G)+H)});return }F.getDoc().execCommand("Indent",false,null);if(C){K.getParent(I.getNode(),function(L){if(L.nodeName=="BLOCKQUOTE"){L.dir=L.style.cssText=""}})}},Outdent:function(){var G=this.editor,L=G.dom,J=G.selection,K,F,H,I;H=G.settings.indentation;I=/[a-z%]+$/i.exec(H);H=parseInt(H);if(G.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(M){F=Math.max(0,parseInt(M.style.paddingLeft||0)-H);L.setStyle(M,"paddingLeft",F?F+I:"")});return }G.getDoc().execCommand("Outdent",false,null)},mceSetAttribute:function(H,G){var F=this.editor,J=F.dom,I;if(I=J.getParent(F.selection.getNode(),J.isBlock)){J.setAttrib(I,G.name,G.value)}},mceSetContent:function(G,F){this.editor.setContent(F)},mceToggleVisualAid:function(){var F=this.editor;F.hasVisual=!F.hasVisual;F.addVisual()},mceReplaceContent:function(G,F){var H=this.editor.selection;H.setContent(F.replace(/\{\$selection\}/g,H.getContent({format:"text"})))},mceInsertLink:function(H,G){var F=this.editor,I=F.selection,J=F.dom.getParent(I.getNode(),"A");if(tinymce.is(G,"string")){G={href:G}}function K(L){E(G,function(N,M){F.dom.setAttrib(L,M,N)})}if(!J){F.execCommand("CreateLink",false,"javascript:mctmp(0);");E(F.dom.select("a"),function(L){if(L.href=="javascript:mctmp(0);"){K(L)}})}else{if(G.href){K(J)}else{F.dom.remove(J,1)}}},UnLink:function(){var F=this.editor,G=F.selection;if(G.isCollapsed()){G.select(G.getNode())}F.getDoc().execCommand("unlink",false,null);G.collapse(0)},FontName:function(H,G){var I=this,F=I.editor,J=F.selection,K;if(!G){if(J.isCollapsed()){J.select(J.getNode())}I.RemoveFormat()}else{F.getDoc().execCommand("FontName",false,G)}},FontSize:function(I,H){var G=this.editor,L=G.settings,J=tinymce.explode(L.font_size_style_values),F=tinymce.explode(L.font_size_classes),K,M;E(G.dom.select("font"),function(N){N.style.fontSize=""});G.getDoc().execCommand("FontSize",false,H);if(L.inline_styles){E(G.dom.select("font"),function(N){if(!N.size||N.parentNode.nodeName=="FONT"&&N.size==N.parentNode.size){if(!M){M=G.selection.getBookmark()}G.dom.remove(N,1);return }if(H=N.size){if(F&&F.length>0){G.dom.setAttrib(N,"class",F[parseInt(H)-1])}else{G.dom.setStyle(N,"fontSize",J[parseInt(H)-1])}}})}G.selection.moveToBookmark(M)},queryCommandValue:function(G){var F=this["queryValue"+G];if(F){return F.call(this,G)}return false},queryCommandState:function(G){var F;switch(G){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(G,G.substring(7).toLowerCase());default:if(F=this["queryState"+G]){return F.call(this,G)}}return -1},_queryState:function(G){try{return this.editor.getDoc().queryCommandState(G)}catch(F){}},_queryVal:function(G){try{return this.editor.getDoc().queryCommandValue(G)}catch(F){}},queryValueFontSize:function(){var G=this.editor,F=0,H;if(B||D){if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.size}return F}return this._queryVal("FontSize")},queryValueFontName:function(){var G=this.editor,F=0,H;if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.face}if(!F){F=this._queryVal("FontName")}return F},mceJustify:function(M,N){var J=this.editor,L=J.selection,F=L.getNode(),O=F.nodeName,G,I,H=J.dom,K;if(J.settings.inline_styles&&this.queryStateJustify(M,N)){K=1}G=H.getParent(F,J.dom.isBlock);if(O=="IMG"){if(N=="full"){return }if(K){if(N=="center"){H.setStyle(F.parentNode,"textAlign","")}H.setStyle(F,"float","");this.mceRepaint();return }if(N=="center"){if(/^(TD|TH)$/.test(G.nodeName)){G=0}if(!G||G.childNodes.length>1){I=H.create("p");I.appendChild(F.cloneNode(false));if(G){H.insertAfter(I,G)}else{H.insertAfter(I,F)}H.remove(F);F=I.firstChild;G=I}H.setStyle(G,"textAlign",N);H.setStyle(F,"float","")}else{H.setStyle(F,"float",N);H.setStyle(F.parentNode,"textAlign","")}this.mceRepaint();return }if(J.settings.inline_styles&&J.settings.forced_root_block){if(K){N=""}E(this._getSelectedBlocks(H.getParent(L.getStart(),H.isBlock),H.getParent(L.getEnd(),H.isBlock)),function(P){H.setAttrib(P,"align","");H.setStyle(P,"textAlign",N=="full"?"justify":N)});return }else{if(!K){J.getDoc().execCommand(M,false,null)}}if(J.settings.inline_styles){if(K){H.getParent(J.selection.getNode(),function(P){if(P.style&&P.style.textAlign){H.setStyle(P,"textAlign","")}});return }E(H.select("*"),function(Q){var P=Q.align;if(P){if(P=="full"){P="justify"}H.setStyle(Q,"textAlign",P);H.setAttrib(Q,"align","")}})}},mceSetCSSClass:function(G,F){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:F})},getSelectedElement:function(){var T=this,N=T.editor,M=N.dom,Q=N.selection,G=Q.getRng(),K,J,R,O,I,F,P,H,U,S;if(Q.isCollapsed()||G.item){return Q.getNode()}S=N.settings.merge_styles_invalid_parents;if(tinymce.is(S,"string")){S=new RegExp(S,"i")}if(C){K=G.duplicate();K.collapse(true);R=K.parentElement();J=G.duplicate();J.collapse(false);O=J.parentElement();if(R!=O){K.move("character",1);R=K.parentElement()}if(R==O){K=G.duplicate();K.moveToElementText(R);if(K.compareEndPoints("StartToStart",G)==0&&K.compareEndPoints("EndToEnd",G)==0){return S&&S.test(R.nodeName)?null:R}}}else{function L(V){return M.getParent(V,function(W){return W.nodeType==1})}R=G.startContainer;O=G.endContainer;I=G.startOffset;F=G.endOffset;if(!G.collapsed){if(R==O){if(I-F<2){if(R.hasChildNodes()){H=R.childNodes[I];return S&&S.test(H.nodeName)?null:H}}}}if(R.nodeType!=3||O.nodeType!=3){return null}if(I==0){H=L(R);if(H&&H.firstChild!=R){H=null}}if(I==R.nodeValue.length){P=R.nextSibling;if(P&&P.nodeType==1){H=R.nextSibling}}if(F==0){P=O.previousSibling;if(P&&P.nodeType==1){U=P}}if(F==O.nodeValue.length){U=L(O);if(U&&U.lastChild!=O){U=null}}if(H==U){return S&&H&&S.test(H.nodeName)?null:H}}return null},InsertHorizontalRule:function(){if(A||C){this.editor.selection.setContent("<hr />")}else{this.editor.getDoc().execCommand("InsertHorizontalRule",false,"")}},RemoveFormat:function(){var H=this,G=H.editor,I=G.selection,F;if(D){I.setContent(I.getContent({format:"raw"}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,""),{format:"raw"})}else{G.getDoc().execCommand("RemoveFormat",false,null)}H.mceSetStyleInfo(0,{command:"removeformat"});G.addVisual()},mceSetStyleInfo:function(M,L){var P=this,G=P.editor,I=G.getDoc(),F=G.dom,H,J,Q=G.selection,O=L.wrapper||"span",J=Q.getBookmark(),N;function K(S,R){if(S.nodeType==1){switch(L.command){case"setattrib":return F.setAttrib(S,L.name,L.value);case"setstyle":return F.setStyle(S,L.name,L.value);case"removeformat":return F.setAttrib(S,"class","")}}}N=G.settings.merge_styles_invalid_parents;if(tinymce.is(N,"string")){N=new RegExp(N,"i")}if(H=P.getSelectedElement()){K(H,1)}else{I.execCommand("FontName",false,"__");E(D?F.select("span"):F.select("font"),function(T){var R,S;if(F.getAttrib(T,"face")=="__"||T.style.fontFamily==="__"){R=F.create(O,{mce_new:"1"});K(R);E(T.childNodes,function(U){R.appendChild(U.cloneNode(true))});F.replace(R,T)}})}E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!F.getAttrib(S,"mce_new")){R=F.getParent(S,function(T){return T.nodeType==1&&F.getAttrib(T,"mce_new")});if(R){F.remove(S,1)}}});E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!R||!F.getAttrib(S,"mce_new")){return }if(R.nodeName==O.toUpperCase()&&R.childNodes.length==1){return F.remove(R,1)}if(S.nodeType==1&&(!N||!N.test(R.nodeName))&&R.childNodes.length==1){K(R);F.setAttrib(S,"class","")}});E(F.select(O).reverse(),function(R){if(F.getAttrib(R,"mce_new")||(F.getAttribs(R).length<=1&&R.className==="")){if(!F.getAttrib(R,"class")&&!F.getAttrib(R,"style")){return F.remove(R,1)}F.setAttrib(R,"mce_new","")}});Q.moveToBookmark(J)},queryStateJustify:function(J,G){var F=this.editor,I=F.selection.getNode(),H=F.dom;if(I&&I.nodeName=="IMG"){if(H.getStyle(I,"float")==G){return 1}return I.parentNode.style.textAlign==G}I=H.getParent(F.selection.getStart(),function(K){return K.nodeType==1&&K.style.textAlign});if(G=="full"){G="justify"}if(F.settings.inline_styles){return(I&&I.style.textAlign==G)}return this._queryState(J)},HiliteColor:function(H,J){var G=this,F=G.editor,I=F.getDoc();function K(M){if(!A){return }try{I.execCommand("styleWithCSS",0,M)}catch(L){I.execCommand("useCSS",0,!M)}}if(A||B){K(true);I.execCommand("hilitecolor",false,J);K(false)}else{I.execCommand("BackColor",false,J)}},Undo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.undo();F.nodeChanged()}else{F.getDoc().execCommand("Undo",false,null)}},Redo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.redo();F.nodeChanged()}else{F.getDoc().execCommand("Redo",false,null)}},FormatBlock:function(M,G){var N=this,K=N.editor,O=K.selection,I=K.dom,F,J,L;function H(P){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(P.nodeName)}F=I.getParent(O.getNode(),function(P){return H(P)});if(F){if((C&&H(F.parentNode))||F.nodeName=="DIV"){J=K.dom.create(G);E(I.getAttribs(F),function(P){I.setAttrib(J,P.nodeName,I.getAttrib(F,P.nodeName))});L=O.getBookmark();I.replace(J,F,1);O.moveToBookmark(L);K.nodeChanged();return }}G=K.settings.forced_root_block?(G||"<p>"):G;if(G.indexOf("<")==-1){G="<"+G+">"}if(tinymce.isGecko){G=G.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}K.getDoc().execCommand("FormatBlock",false,G)},mceCleanup:function(){var G=this.editor,H=G.selection,F=H.getBookmark();G.setContent(G.getContent());H.moveToBookmark(F)},mceRemoveNode:function(I,J){var G=this.editor,H=G.selection,F,K=J||H.getNode();if(K==G.getBody()){return }F=H.getBookmark();G.dom.remove(K,1);H.moveToBookmark(F);G.nodeChanged()},mceSelectNodeDepth:function(H,I){var F=this.editor,G=F.selection,J=0;F.dom.getParent(G.getNode(),function(K){if(K.nodeType==1&&J++==I){G.select(K);F.nodeChanged();return false}},F.getBody())},mceSelectNode:function(G,F){this.editor.selection.select(F)},mceInsertContent:function(F,G){this.editor.selection.setContent(G)},mceInsertRawHTML:function(G,H){var F=this.editor;F.selection.setContent("tiny_mce_marker");F.setContent(F.getContent().replace(/tiny_mce_marker/g,H))},mceRepaint:function(){var H,F,I=this.editor;if(tinymce.isGecko){try{H=I.selection;F=H.getBookmark(true);if(H.getSel()){H.getSel().selectAllChildren(I.getBody())}H.collapse(true);H.moveToBookmark(F)}catch(G){}}},queryStateUnderline:function(){var F=this.editor,G=F.selection.getNode();if(G&&G.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var F=this.editor,G;if(F.settings.inline_styles){if((G=F.dom.getParent(F.selection.getStart(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}if((G=F.dom.getParent(F.selection.getEnd(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}}else{return !!F.dom.getParent(F.selection.getNode(),"BLOCKQUOTE")}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(F){return F.nodeName==="BLOCKQUOTE"})},mceBlockQuote:function(){var Q=this,M=Q.editor,S=M.selection,J=M.dom,O,N,I,H,R,G,P,L,F;function K(T){return J.getParent(T,function(U){return U.nodeName==="BLOCKQUOTE"})}O=J.getParent(S.getStart(),J.isBlock);N=J.getParent(S.getEnd(),J.isBlock);if(R=K(O)){if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}if(K(N)){P=R.cloneNode(false);while(I=N.nextSibling){P.appendChild(I.parentNode.removeChild(I))}}if(P){J.insertAfter(P,R)}F=Q._getSelectedBlocks(O,N);for(L=F.length-1;L>=0;L--){J.insertAfter(F[L],R)}if(/^\s*$/.test(R.innerHTML)){J.remove(R,1)}if(P&&/^\s*$/.test(P.innerHTML)){J.remove(P,1)}if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(0);if(J.getParent(S.getStart(),J.isBlock)!=O){G=S.getRng();G.move("character",-1);G.select()}}}else{Q.editor.selection.moveToBookmark(H)}return }if(C&&!O&&!N){Q.editor.getDoc().execCommand("Indent");I=K(S.getNode());I.style.margin=I.dir="";return }if(!O||!N){return }if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}E(Q._getSelectedBlocks(K(S.getStart()),K(S.getEnd())),function(T){if(T.nodeName=="BLOCKQUOTE"&&!R){R=T;return }if(!R){R=J.create("blockquote");T.parentNode.insertBefore(R,T)}if(T.nodeName=="BLOCKQUOTE"&&R){I=T.firstChild;while(I){R.appendChild(I.cloneNode(true));I=I.nextSibling}J.remove(T);return }R.appendChild(J.remove(T))});if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(1)}}else{S.moveToBookmark(H)}},_getSelectedBlocks:function(M,F){var J=this.editor,I=J.dom,N=J.selection,L,K,H,G=[];L=I.getParent(M||N.getStart(),I.isBlock);K=I.getParent(F||N.getEnd(),I.isBlock);if(L){G.push(L)}if(L&&K&&L!=K){H=L;while((H=H.nextSibling)&&H!=K){if(I.isBlock(H)){G.push(H)}}}if(K&&L!=K){G.push(K)}return G}})})();tinymce.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(B){var C=this,A=tinymce.util.Dispatcher;C.editor=B;C.data=[];C.onAdd=new A(this);C.onUndo=new A(this);C.onRedo=new A(this)},add:function(B){var E=this,D,C=E.editor,A,F=C.settings,G;B=B||{};B.content=B.content||C.getContent({format:"raw",no_events:1});B.content=B.content.replace(/^\s*|\s*$/g,"");G=E.data[E.index>0&&(E.index==0||E.index==E.data.length)?E.index-1:E.index];if(!B.initial&&G&&B.content==G.content){return null}if(F.custom_undo_redo_levels){if(E.data.length>F.custom_undo_redo_levels){for(D=0;D<E.data.length-1;D++){E.data[D]=E.data[D+1]}E.data.length--;E.index=E.data.length}}if(F.custom_undo_redo_restore_selection&&!B.initial){B.bookmark=A=B.bookmark||C.selection.getBookmark()}if(E.index<E.data.length){E.index++}if(E.data.length===0&&!B.initial){return null}E.data.length=E.index+1;E.data[E.index++]=B;if(B.initial){E.index=0}if(E.data.length==2&&E.data[0].initial){E.data[0].bookmark=A}E.onAdd.dispatch(E,B);C.isNotDirty=0;return B},undo:function(){var D=this,B=D.editor,A=A,C;if(D.typing){D.add();D.typing=0}if(D.index>0){if(D.index==D.data.length&&D.index>1){C=D.index;D.typing=0;if(!D.add()){D.index=C}--D.index}A=D.data[--D.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);D.onUndo.dispatch(D,A)}return A},redo:function(){var C=this,B=C.editor,A=null;if(C.index<C.data.length-1){A=C.data[++C.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);C.onRedo.dispatch(C,A)}return A},clear:function(){var A=this;A.data=[];A.index=0;A.typing=0;A.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}});(function(){var B,D,A,C,E,F;B=tinymce.dom.Event;D=tinymce.isIE;A=tinymce.isGecko;C=tinymce.isOpera;E=tinymce.each;F=tinymce.extend;tinymce.create("tinymce.ForceBlocks",{ForceBlocks:function(H){var I=this,J=H.settings,K;I.editor=H;I.dom=H.dom;K=(J.forced_root_block||"p").toLowerCase();J.element=K.toUpperCase();H.onPreInit.add(I.setup,I);I.reOpera=new RegExp("(\\u00a0| | )</"+K+">","gi");I.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR2=new RegExp("<p( )([^>]+)>( | )<\\/p>|<p>( | )<\\/p>".replace(/p/g,K),"gi");I.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");I.reTrailBr=new RegExp("\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");function G(L,M){if(C){M.content=M.content.replace(I.reOpera,"</"+K+">")}M.content=M.content.replace(I.rePadd,"<"+K+"$1$2$3$4$5$6>\u00a0</"+K+">");if(!D&&!C&&M.set){M.content=M.content.replace(I.reNbsp2BR1,"<"+K+"$1$2><br /></"+K+">");M.content=M.content.replace(I.reNbsp2BR2,"<"+K+"$1$2><br /></"+K+">")}else{M.content=M.content.replace(I.reBR2Nbsp,"<"+K+"$1$2>\u00a0</"+K+">");M.content=M.content.replace(I.reTrailBr,"</"+K+">")}}H.onBeforeSetContent.add(G);H.onPostProcess.add(G);if(J.forced_root_block){H.onInit.add(I.forceRoots,I);H.onSetContent.add(I.forceRoots,I);H.onBeforeGetContent.add(I.forceRoots,I)}},setup:function(){var H=this,G=H.editor,I=G.settings;if(I.forced_root_block){G.onKeyUp.add(H.forceRoots,H);G.onPreProcess.add(H.forceRoots,H)}if(I.force_br_newlines){if(D){G.onKeyPress.add(function(K,M){var N,L=K.selection;if(M.keyCode==13&&L.getNode().nodeName!="LI"){L.setContent('<br id="__" /> ',{format:"raw"});N=K.dom.get("__");N.removeAttribute("id");L.select(N);L.collapse();return B.cancel(M)}})}return }if(!D&&I.force_p_newlines){G.onKeyPress.add(function(K,L){if(L.keyCode==13&&!L.shiftKey){if(!H.insertPara(L)){B.cancel(L)}}});if(A){G.onKeyDown.add(function(K,L){if((L.keyCode==8||L.keyCode==46)&&!L.shiftKey){H.backspaceDelete(L,L.keyCode==8)}})}}function J(L,K){var M=G.dom.create(K);E(L.attributes,function(N){if(N.specified&&N.nodeValue){M.setAttribute(N.nodeName.toLowerCase(),N.nodeValue)}});E(L.childNodes,function(N){M.appendChild(N.cloneNode(true))});L.parentNode.replaceChild(M,L);return M}if(D&&I.element!="P"){G.onKeyPress.add(function(K,L){H.lastElm=K.selection.getNode().nodeName});G.onKeyUp.add(function(L,N){var P,M=L.selection,O=M.getNode(),K=L.getBody();if(K.childNodes.length===1&&O.nodeName=="P"){O=J(O,I.element);M.select(O);M.collapse();L.nodeChanged()}else{if(N.keyCode==13&&!N.shiftKey&&H.lastElm!="P"){P=L.dom.getParent(O,"P");if(P){J(P,I.element);L.nodeChanged()}}}})}},find:function(L,I,J){var H=this.editor,G=H.getDoc().createTreeWalker(L,4,null,false),K=-1;while(L=G.nextNode()){K++;if(I==0&&L==J){return K}if(I==1&&K==J){return L}}return -1},forceRoots:function(L,U){var M=this,L=M.editor,Y=L.getBody(),V=L.getDoc(),f=L.selection,N=f.getSel(),O=f.getRng(),Z=-2,K,S,G,H,W=-16777215;var X,I,a,R,P,J=Y.childNodes,Q;if(U&&U.keyCode==13){return true}for(Q=J.length-1;Q>=0;Q--){X=J[Q];if(X.nodeType==3||(!M.dom.isBlock(X)&&X.nodeType!=8)){if(!I){if(X.nodeType!=3||/[^\s]/g.test(X.nodeValue)){if(Z==-2&&O){if(!D){if(L.dom.getParent(O.startContainer,function(b){return b===Y})){S=O.startOffset;G=O.endOffset;Z=M.find(Y,0,O.startContainer);K=M.find(Y,0,O.endContainer)}}else{H=V.body.createTextRange();H.moveToElementText(Y);H.collapse(1);a=H.move("character",W)*-1;H=O.duplicate();H.collapse(1);R=H.move("character",W)*-1;H=O.duplicate();H.collapse(0);P=(H.move("character",W)*-1)-R;Z=R-a;K=P}}I=L.dom.create(L.settings.forced_root_block);I.appendChild(X.cloneNode(1));X.parentNode.replaceChild(I,X)}}else{if(I.hasChildNodes()){I.insertBefore(X,I.firstChild)}else{I.appendChild(X)}}}else{I=null}}if(Z!=-2){if(!D){I=Y.getElementsByTagName(L.settings.element)[0];O=V.createRange();if(Z!=-1){O.setStart(M.find(Y,1,Z),S)}else{O.setStart(I,0)}if(K!=-1){O.setEnd(M.find(Y,1,K),G)}else{O.setEnd(I,0)}if(N){N.removeAllRanges();N.addRange(O)}}else{try{O=N.createRange();O.moveToElementText(Y);O.collapse(1);O.moveStart("character",Z);O.moveEnd("character",K);O.select()}catch(T){}}}},getParentBlock:function(H){var G=this.dom;return G.getParent(H,G.isBlock)},insertPara:function(i){var S=this,L=S.editor,c=L.dom,j=L.getDoc(),o=L.settings,U=L.selection.getSel(),V=U.getRangeAt(0),m=j.body;var Y,Z,W,g,f,J,H,K,N,G,Q,k,I,M,X,a=c.getViewPort(L.getWin()),P,R;function T(b){b=b.innerHTML;b=b.replace(/<(img|hr|table)/gi,"-");b=b.replace(/<[^>]+>/g,"");return b.replace(/[ \t\r\n]+/g,"")==""}Y=j.createRange();Y.setStart(U.anchorNode,U.anchorOffset);Y.collapse(true);Z=j.createRange();Z.setStart(U.focusNode,U.focusOffset);Z.collapse(true);W=Y.compareBoundaryPoints(Y.START_TO_END,Z)<0;g=W?U.anchorNode:U.focusNode;f=W?U.anchorOffset:U.focusOffset;J=W?U.focusNode:U.anchorNode;H=W?U.focusOffset:U.anchorOffset;if(g===J&&/^(TD|TH)$/.test(g.nodeName)){c.remove(g.firstChild);L.dom.add(g,o.element,null,"<br />");k=L.dom.add(g,o.element,null,"<br />");V=j.createRange();V.selectNodeContents(k);V.collapse(1);L.selection.setRng(V);return false}if(g==m&&J==m&&m.firstChild&&L.dom.isBlock(m.firstChild)){g=J=g.firstChild;f=H=0;Y=j.createRange();Y.setStart(g,0);Z=j.createRange();Z.setStart(J,0)}g=g.nodeName=="HTML"?j.body:g;g=g.nodeName=="BODY"?g.firstChild:g;J=J.nodeName=="HTML"?j.body:J;J=J.nodeName=="BODY"?J.firstChild:J;K=S.getParentBlock(g);N=S.getParentBlock(J);G=K?K.nodeName:o.element;if(S.dom.getParent(K,function(b){return/OL|UL|PRE/.test(b.nodeName)})){return true}if(K&&(K.nodeName=="CAPTION"||/absolute|relative|static/gi.test(K.style.position))){G=o.element;K=null}if(N&&(N.nodeName=="CAPTION"||/absolute|relative|static/gi.test(N.style.position))){G=o.element;N=null}if(/(TD|TABLE|TH|CAPTION)/.test(G)||(K&&G=="DIV"&&/left|right/gi.test(K.style.cssFloat))){G=o.element;K=N=null}Q=(K&&K.nodeName==G)?K.cloneNode(0):L.dom.create(G);k=(N&&N.nodeName==G)?N.cloneNode(0):L.dom.create(G);k.removeAttribute("id");if(/^(H[1-6])$/.test(G)&&g.nodeValue&&f==g.nodeValue.length){k=L.dom.create(o.element)}X=I=g;do{if(X==m||X.nodeType==9||S.dom.isBlock(X)||/(TD|TABLE|TH|CAPTION)/.test(X.nodeName)){break}I=X}while((X=X.previousSibling?X.previousSibling:X.parentNode));X=M=J;do{if(X==m||X.nodeType==9||S.dom.isBlock(X)||/(TD|TABLE|TH|CAPTION)/.test(X.nodeName)){break}M=X}while((X=X.nextSibling?X.nextSibling:X.parentNode));if(I.nodeName==G){Y.setStart(I,0)}else{Y.setStartBefore(I)}Y.setEnd(g,f);Q.appendChild(Y.cloneContents()||j.createTextNode(""));try{Z.setEndAfter(M)}catch(h){}Z.setStart(J,H);k.appendChild(Z.cloneContents()||j.createTextNode(""));V=j.createRange();if(!I.previousSibling&&I.parentNode.nodeName==G){V.setStartBefore(I.parentNode)}else{if(Y.startContainer.nodeName==G&&Y.startOffset==0){V.setStartBefore(Y.startContainer)}else{V.setStart(Y.startContainer,Y.startOffset)}}if(!M.nextSibling&&M.parentNode.nodeName==G){V.setEndAfter(M.parentNode)}else{V.setEnd(Z.endContainer,Z.endOffset)}V.deleteContents();if(C){L.getWin().scrollTo(0,a.y)}if(Q.firstChild&&Q.firstChild.nodeName==G){Q.innerHTML=Q.firstChild.innerHTML}if(k.firstChild&&k.firstChild.nodeName==G){k.innerHTML=k.firstChild.innerHTML}if(T(Q)){Q.innerHTML="<br />"}if(T(k)){k.innerHTML=C?" ":"<br />"}if(C){V.insertNode(Q);V.insertNode(k)}else{V.insertNode(k);V.insertNode(Q)}k.normalize();Q.normalize();function O(b){return j.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,false).nextNode()||b}V=j.createRange();V.selectNodeContents(A?O(k):k);V.collapse(1);U.removeAllRanges();U.addRange(V);P=L.dom.getPos(k).y;R=k.clientHeight;if(P<a.y||P+R>a.y+a.h){L.getWin().scrollTo(0,P<a.y?P:P-a.h+R)}return false},backspaceDelete:function(J,P){var R=this,I=R.editor,M=I.getBody(),H,K=I.selection,G=K.getRng(),L=G.startContainer,H,N,O;if(L&&I.dom.isBlock(L)&&!/^(TD|TH)$/.test(L.nodeName)&&P){if(L.childNodes.length==0||(L.childNodes.length==1&&L.firstChild.nodeName=="BR")){H=L;while((H=H.previousSibling)&&!I.dom.isBlock(H)){}if(H){if(L!=M.firstChild){N=I.dom.doc.createTreeWalker(H,NodeFilter.SHOW_TEXT,null,false);while(O=N.nextNode()){H=O}G=I.getDoc().createRange();G.setStart(H,H.nodeValue?H.nodeValue.length:0);G.setEnd(H,H.nodeValue?H.nodeValue.length:0);K.setRng(G);I.dom.remove(L)}return B.cancel(J)}}}function Q(S){S=S.target;if(S&&S.parentNode&&S.nodeName=="BR"&&(H=R.getParentBlock(S))){B.remove(M,"DOMNodeInserted",Q);if(S.previousSibling||S.nextSibling){I.dom.remove(S)}}}B._add(M,"DOMNodeInserted",Q);window.setTimeout(function(){B._remove(M,"DOMNodeInserted",Q)},1)}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each,D=tinymce.extend;tinymce.create("tinymce.ControlManager",{ControlManager:function(E,H){var G=this,F;H=H||{};G.editor=E;G.controls={};G.onAdd=new tinymce.util.Dispatcher(G);G.onPostRender=new tinymce.util.Dispatcher(G);G.prefix=H.prefix||E.id+"_";G._cls={};G.onPostRender.add(function(){C(G.controls,function(I){I.postRender()})})},get:function(E){return this.controls[this.prefix+E]||this.controls[E]},setActive:function(G,E){var F=null;if(F=this.get(G)){F.setActive(E)}return F},setDisabled:function(G,E){var F=null;if(F=this.get(G)){F.setDisabled(E)}return F},add:function(F){var E=this;if(F){E.controls[F.id]=F;E.onAdd.dispatch(F,E)}return F},createControl:function(H){var G,F=this,E=F.editor;C(E.plugins,function(I){if(I.createControl){G=I.createControl(H,F);if(G){return false}}});switch(H){case"|":case"separator":return F.createSeparator()}if(!G&&E.buttons&&(G=E.buttons[H])){return F.createButton(H,G)}return F.add(G)},createDropMenu:function(E,M,G){var L=this,H=L.editor,I,F,J,K;M=D({"class":"mceDropDown",constrain:H.settings.constrain_menus},M);M["class"]=M["class"]+" "+H.getParam("skin")+"Skin";if(J=H.getParam("skin_variant")){M["class"]+=" "+H.getParam("skin")+"Skin"+J.substring(0,1).toUpperCase()+J.substring(1)}E=L.prefix+E;K=G||L._cls.dropmenu||tinymce.ui.DropMenu;I=L.controls[E]=new K(E,M);I.onAddItem.add(function(P,O){var N=O.settings;N.title=H.getLang(N.title,N.title);if(!N.onclick){N.onclick=function(Q){H.execCommand(N.cmd,N.ui||false,N.value)}}});H.onRemove.add(function(){I.destroy()});if(tinymce.isIE){I.onShowMenu.add(function(){F=H.selection.getBookmark(1)});I.onHideMenu.add(function(){if(F){H.selection.moveToBookmark(F)}})}return L.add(I)},createListBox:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;if(F.settings.use_native_selects){J=new tinymce.ui.NativeListBox(L,H)}else{E=K||G._cls.listbox||tinymce.ui.ListBox;J=new E(L,H)}G.controls[L]=J;if(tinymce.isWebKit){J.onPostRender.add(function(N,M){A.add(M,"mousedown",function(){F.bookmark=F.selection.getBookmark("simple")});A.add(M,"focus",function(){F.selection.moveToBookmark(F.bookmark);F.bookmark=null})})}if(J.hideMenu){F.onMouseDown.add(J.hideMenu,J)}return G.add(J)},createButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.label=F.translate(H.label);H.scope=H.scope||F;if(!H.onclick&&!H.menu_button){H.onclick=function(){F.execCommand(H.cmd,H.ui||false,H.value)}}H=D({title:H.title,"class":"mce_"+L,unavailable_prefix:F.getLang("unavailable",""),scope:H.scope,control_manager:G},H);L=G.prefix+L;if(H.menu_button){E=K||G._cls.menubutton||tinymce.ui.MenuButton;J=new E(L,H);F.onMouseDown.add(J.hideMenu,J)}else{E=G._cls.button||tinymce.ui.Button;J=new E(L,H)}return G.add(J)},createMenuButton:function(F,E){E=E||{};E.menu_button=1;return this.createButton(F,E)},createSplitButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onclick){H.onclick=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;E=K||G._cls.splitbutton||tinymce.ui.SplitButton;J=G.add(new E(L,H));F.onMouseDown.add(J.hideMenu,J);return J},createColorSplitButton:function(E,M,G){var K=this,I=K.editor,H,J,L,F;if(K.get(E)){return null}M.title=I.translate(M.title);M.scope=M.scope||I;if(!M.onclick){M.onclick=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}if(!M.onselect){M.onselect=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}M=D({title:M.title,"class":"mce_"+E,menu_class:I.getParam("skin")+"Skin",scope:M.scope,more_colors_title:I.getLang("more_colors")},M);E=K.prefix+E;L=G||K._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;J=new L(E,M);I.onMouseDown.add(J.hideMenu,J);I.onRemove.add(function(){J.destroy()});if(tinymce.isIE){J.onShowMenu.add(function(){F=I.selection.getBookmark(1)});J.onHideMenu.add(function(){if(F){I.selection.moveToBookmark(F)}})}return K.add(J)},createToolbar:function(J,G,I){var H,F=this,E;J=F.prefix+J;E=I||F._cls.toolbar||tinymce.ui.Toolbar;H=new E(J,G);if(F.get(J)){return null}return F.add(H)},createSeparator:function(F){var E=F||this._cls.separator||tinymce.ui.Separator;return new E()},setControlType:function(F,E){return this._cls[F.toLowerCase()]=E},destroy:function(){C(this.controls,function(E){E.destroy()});this.controls=null}})})();(function(){var A=tinymce.util.Dispatcher,D=tinymce.each,C=tinymce.isIE,B=tinymce.isOpera;tinymce.create("tinymce.WindowManager",{WindowManager:function(E){var F=this;F.editor=E;F.onOpen=new A(F);F.onClose=new A(F);F.params={};F.features={}},open:function(Q,F){var P=this,I="",L,K,G=P.editor.settings.dialog_type=="modal",N,M,H,E=tinymce.DOM.getViewPort(),O;Q=Q||{};F=F||{};M=B?E.w:screen.width;H=B?E.h:screen.height;Q.name=Q.name||"mc_"+new Date().getTime();Q.width=parseInt(Q.width||320);Q.height=parseInt(Q.height||240);Q.resizable=true;Q.left=Q.left||parseInt(M/2)-(Q.width/2);Q.top=Q.top||parseInt(H/2)-(Q.height/2);F.inline=false;F.mce_width=Q.width;F.mce_height=Q.height;F.mce_auto_focus=Q.auto_focus;if(G){if(C){Q.center=true;Q.help=false;Q.dialogWidth=Q.width+"px";Q.dialogHeight=Q.height+"px";Q.scroll=Q.scrollbars||false}}D(Q,function(S,R){if(tinymce.is(S,"boolean")){S=S?"yes":"no"}if(!/^(name|url)$/.test(R)){if(C&&G){I+=(I?";":"")+R+":"+S}else{I+=(I?",":"")+R+"="+S}}});P.features=Q;P.params=F;P.onOpen.dispatch(P,Q,F);O=Q.url||Q.file;if(tinymce.relaxedDomain){O+=(O.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}O=tinymce._addVer(O);try{if(C&&G){N=1;window.showModalDialog(O,window,I)}else{N=window.open(O,Q.name,I)}}catch(J){}if(!N){alert(P.editor.getLang("popup_blocked"))}},close:function(E){E.close();this.onClose.dispatch(this)},createInstance:function(G,F,E,K,J,I){var H=tinymce.resolve(G);return new H(F,E,K,J,I)},confirm:function(F,E,G){E.call(G||this,confirm(this._decode(this.editor.getLang(F,F))))},alert:function(F,E,H){var G=this;alert(G._decode(G.editor.getLang(F,F)));if(E){E.call(H||G)}},_decode:function(E){return tinymce.DOM.decode(E).replace(/\\n/g,"\n")}})}());
\ No newline at end of file
+var tinymce={majorVersion:"3",minorVersion:"2.0.1",releaseDate:"2008-09-17",_init:function(){var L=this,I=document,J=window,H=navigator,B=H.userAgent,G,A,F,E,D,K;L.isOpera=J.opera&&opera.buildNumber;L.isWebKit=/WebKit/.test(B);L.isOldWebKit=L.isWebKit&&!J.getSelection().getRangeAt;L.isIE=!L.isWebKit&&!L.isOpera&&(/MSIE/gi).test(B)&&(/Explorer/gi).test(H.appName);L.isIE6=L.isIE&&/MSIE [56]/.test(B);L.isGecko=!L.isWebKit&&/Gecko/.test(B);L.isMac=B.indexOf("Mac")!=-1;L.isAir=/adobeair/i.test(B);if(J.tinyMCEPreInit){L.suffix=tinyMCEPreInit.suffix;L.baseURL=tinyMCEPreInit.base;L.query=tinyMCEPreInit.query;return }L.suffix="";A=I.getElementsByTagName("base");for(G=0;G<A.length;G++){if(K=A[G].href){if(/^https?:\/\/[^\/]+$/.test(K)){K+="/"}E=K?K.match(/.*\//)[0]:""}}function C(M){if(M.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(M.src)){if(/_(src|dev)\.js/g.test(M.src)){L.suffix="_src"}if((D=M.src.indexOf("?"))!=-1){L.query=M.src.substring(D+1)}L.baseURL=M.src.substring(0,M.src.lastIndexOf("/"));if(E&&L.baseURL.indexOf("://")==-1){L.baseURL=E+L.baseURL}return L.baseURL}return null}A=I.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}F=I.getElementsByTagName("head")[0];if(F){A=F.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}}return },is:function(B,A){var C=typeof (B);if(!A){return C!="undefined"}if(A=="array"&&(B instanceof Array)){return true}return C==A},each:function(D,A,C){var E,B;if(!D){return 0}C=C||D;if(typeof (D.length)!="undefined"){for(E=0,B=D.length;E<B;E++){if(A.call(C,D[E],E,D)===false){return 0}}}else{for(E in D){if(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1},map:function(A,B){var C=[];tinymce.each(A,function(D){C.push(B(D))});return C},grep:function(A,B){var C=[];tinymce.each(A,function(D){if(!B||B(D)){C.push(D)}});return C},inArray:function(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1},extend:function(D,C){var B,A=arguments;for(B=1;B<A.length;B++){C=A[B];tinymce.each(C,function(E,F){if(typeof (E)!=="undefined"){D[F]=E}})}return D},trim:function(A){return(A?""+A:"").replace(/^\s*|\s*$/g,"")},create:function(I,A){var H=this,B,D,E,F,C,G=0;I=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(I);E=I[3].match(/(^|\.)(\w+)$/i)[2];D=H.createNS(I[3].replace(/\.\w+$/,""));if(D[E]){return }if(I[2]=="static"){D[E]=A;if(this.onCreate){this.onCreate(I[2],I[3],D[E])}return }if(!A[E]){A[E]=function(){};G=1}D[E]=A[E];H.extend(D[E].prototype,A);if(I[5]){B=H.resolve(I[5]).prototype;F=I[5].match(/\.(\w+)$/i)[1];C=D[E];if(G){D[E]=function(){return B[F].apply(this,arguments)}}else{D[E]=function(){this.parent=B[F];return C.apply(this,arguments)}}D[E].prototype[E]=D[E];H.each(B,function(J,K){D[E].prototype[K]=B[K]});H.each(A,function(J,K){if(B[K]){D[E].prototype[K]=function(){this.parent=B[K];return J.apply(this,arguments)}}else{if(K!=E){D[E].prototype[K]=J}}})}H.each(A["static"],function(J,K){D[E][K]=J});if(this.onCreate){this.onCreate(I[2],I[3],D[E].prototype)}},walk:function(C,B,D,A){A=A||this;if(C){if(D){C=C[D]}tinymce.each(C,function(F,E){if(B.call(A,F,E,D)===false){return false}tinymce.walk(F,B,D,A)})}},createNS:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0;B<D.length;B++){A=D[B];if(!C[A]){C[A]={}}C=C[A]}return C},resolve:function(D,C){var B,A;C=C||window;D=D.split(".");for(B=0,A=D.length;B<A;B++){C=C[D[B]];if(!C){break}}return C},addUnload:function(E,D){var C=this,A=window;E={func:E,scope:D||this};if(!C.unloads){function B(){var G=C.unloads,H,I;if(G){for(I in G){H=G[I];if(H&&H.func){H.func.call(H.scope,1)}}if(A.detachEvent){A.detachEvent("onbeforeunload",F);A.detachEvent("onunload",B)}else{if(A.removeEventListener){A.removeEventListener("unload",B,false)}}C.unloads=H=G=A=B=null;if(window.CollectGarbage){window.CollectGarbage()}}}function F(){var H=document;if(H.readyState=="interactive"){function G(){H.detachEvent("onstop",G);B();H=null}H.attachEvent("onstop",G);window.setTimeout(function(){H.detachEvent("onstop",G)},0)}}if(A.attachEvent){A.attachEvent("onunload",B);A.attachEvent("onbeforeunload",F)}else{if(A.addEventListener){A.addEventListener("unload",B,false)}}C.unloads=[E]}else{C.unloads.push(E)}return E},removeUnload:function(C){var A=this.unloads,B=null;tinymce.each(A,function(E,D){if(E&&E.func==C){A.splice(D,1);B=C;return false}});return B},explode:function(A,B){return A?tinymce.map(A.split(B||","),tinymce.trim):A},_addVer:function(B){var A;if(!this.query){return B}A=(B.indexOf("?")==-1?"?":"&")+this.query;if(B.indexOf("#")==-1){return B+A}return B.replace("#",A+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(A){this.scope=A||this;this.listeners=[]},add:function(A,B){this.listeners.push({cb:A,scope:B||this.scope});return A},addToTop:function(A,B){this.listeners.unshift({cb:A,scope:B||this.scope});return A},remove:function(A){var B=this.listeners,C=null;tinymce.each(B,function(E,D){if(A==E.cb){C=A;B.splice(D,1);return false}});return C},dispatch:function(){var D,B=arguments,C,A=this.listeners,E;for(C=0;C<A.length;C++){E=A[C];D=E.cb.apply(E.scope,B);if(D===false){break}}return D}});(function(){var A=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(D,F){var E=this,G,C,B;F=E.settings=F||{};if(/^(mailto|news|javascript|about):/i.test(D)||/^\s*#/.test(D)){E.source=D;return }if(D.indexOf("/")===0&&D.indexOf("//")!==0){D=(F.base_uri?F.base_uri.protocol||"http":"http")+"://mce_host"+D}if(D.indexOf(":/")===-1&&D.indexOf("//")!==0){D=(F.base_uri.protocol||"http")+"://mce_host"+E.toAbsPath(F.base_uri.path,D)}D=D.replace(/@@/g,"(mce_at)");D=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(D);A(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(H,I){var J=D[I];if(J){J=J.replace(/\(mce_at\)/g,"@@")}E[H]=J});if(B=F.base_uri){if(!E.protocol){E.protocol=B.protocol}if(!E.userInfo){E.userInfo=B.userInfo}if(!E.port&&E.host=="mce_host"){E.port=B.port}if(!E.host||E.host=="mce_host"){E.host=B.host}E.source=""}},setPath:function(C){var B=this;C=/^(.*?)\/?(\w+)?$/.exec(C);B.path=C[0];B.directory=C[1];B.file=C[2];B.source="";B.getURI()},toRelative:function(B){var C=this,D;if(B==="./"){return B}B=new tinymce.util.URI(B,{base_uri:C});if((B.host!="mce_host"&&C.host!=B.host&&B.host)||C.port!=B.port||C.protocol!=B.protocol){return B.getURI()}D=C.toRelPath(C.path,B.path);if(B.query){D+="?"+B.query}if(B.anchor){D+="#"+B.anchor}return D},toAbsolute:function(B,C){var B=new tinymce.util.URI(B,{base_uri:this});return B.getURI(this.host==B.host?C:0)},toRelPath:function(G,H){var C,F=0,D="",E,B;G=G.substring(0,G.lastIndexOf("/"));G=G.split("/");C=H.split("/");if(G.length>=C.length){for(E=0,B=G.length;E<B;E++){if(E>=C.length||G[E]!=C[E]){F=E+1;break}}}if(G.length<C.length){for(E=0,B=C.length;E<B;E++){if(E>=G.length||G[E]!=C[E]){F=E+1;break}}}if(F==1){return H}for(E=0,B=G.length-(F-1);E<B;E++){D+="../"}for(E=F-1,B=C.length;E<B;E++){if(E!=F-1){D+="/"+C[E]}else{D+=C[E]}}return D},toAbsPath:function(D,E){var C,B=0,F=[];D=D.split("/");E=E.split("/");A(D,function(G){if(G){F.push(G)}});D=F;for(C=E.length-1,F=[];C>=0;C--){if(E[C].length==0||E[C]=="."){continue}if(E[C]==".."){B++;continue}if(B>0){B--;continue}F.push(E[C])}C=D.length-B;if(C<=0){return"/"+F.reverse().join("/")}return"/"+D.slice(0,C).join("/")+"/"+F.reverse().join("/")},getURI:function(D){var C,B=this;if(!B.source||D){C="";if(!D){if(B.protocol){C+=B.protocol+"://"}if(B.userInfo){C+=B.userInfo+"@"}if(B.host){C+=B.host}if(B.port){C+=":"+B.port}}if(B.path){C+=B.path}if(B.query){C+="?"+B.query}if(B.anchor){C+="#"+B.anchor}B.source=C}return B.source}})})();(function(){var A=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(D){var B=this.get(D),C;if(B){A(B.split("&"),function(E){E=E.split("=");C=C||{};C[unescape(E[0])]=unescape(E[1])})}return C},setHash:function(H,B,E,D,G,C){var F="";A(B,function(J,I){F+=(!F?"":"&")+escape(I)+"="+escape(J)});this.set(H,F,E,D,G,C)},get:function(F){var E=document.cookie,D,C=F+"=",B;if(!E){return }B=E.indexOf("; "+C);if(B==-1){B=E.indexOf(C);if(B!=0){return null}}else{B+=2}D=E.indexOf(";",B);if(D==-1){D=E.length}return unescape(E.substring(B+C.length,D))},set:function(G,B,E,D,F,C){document.cookie=G+"="+escape(B)+((E)?"; expires="+E.toGMTString():"")+((D)?"; path="+escape(D):"")+((F)?"; domain="+F:"")+((C)?"; secure":"")},remove:function(D,B){var C=new Date();C.setTime(C.getTime()-1000);this.set(D,"",C,B,C)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(E){var C,A,D=tinymce.util.JSON.serialize,B;if(E==null){return"null"}B=typeof E;if(B=="string"){A="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+E.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(G,F){C=A.indexOf(F);if(C+1){return"\\"+A.charAt(C+1)}G=F.charCodeAt().toString(16);return"\\u"+"0000".substring(G.length)+G})+'"'}if(B=="object"){if(E instanceof Array){for(C=0,A="[";C<E.length;C++){A+=(C>0?",":"")+D(E[C])}return A+"]"}A="{";for(C in E){A+=typeof E[C]!="function"?(A.length>1?',"':'"')+C+'":'+D(E[C]):""}return A+"}"}return""+E},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(F){var A,D,B=window,G=0;F.scope=F.scope||this;F.success_scope=F.success_scope||F.scope;F.error_scope=F.error_scope||F.scope;F.async=F.async===false?false:true;F.data=F.data||"";function C(I){A=0;try{A=new ActiveXObject(I)}catch(H){}return A}A=B.XMLHttpRequest?new XMLHttpRequest():C("Microsoft.XMLHTTP")||C("Msxml2.XMLHTTP");if(A){if(A.overrideMimeType){A.overrideMimeType(F.content_type)}A.open(F.type||(F.data?"POST":"GET"),F.url,F.async);if(F.content_type){A.setRequestHeader("Content-Type",F.content_type)}A.send(F.data);function E(){if(!F.async||A.readyState==4||G++>10000){if(F.success&&G<10000&&A.status==200){F.success.call(F.success_scope,""+A.responseText,A,F)}else{if(F.error){F.error.call(F.error_scope,G>10000?"TIMED_OUT":"GENERAL",A,F)}}A=null}else{B.setTimeout(E,10)}}if(!F.async){return E()}D=B.setTimeout(E,10)}}});(function(){var C=tinymce.extend,B=tinymce.util.JSON,A=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(D){this.settings=C({},D);this.count=0},send:function(F){var E=F.error,D=F.success;F=C(this.settings,F);F.success=function(H,G){H=B.parse(H);if(typeof (H)=="undefined"){H={error:"JSON Parse error."}}if(H.error){E.call(F.error_scope||F.scope,H.error,G)}else{D.call(F.success_scope||F.scope,H.result)}};F.error=function(H,G){E.call(F.error_scope||F.scope,H,G)};F.data=B.serialize({id:F.id||"c"+(this.count++),method:F.method,params:F.params});F.content_type="application/json";A.send(F)},"static":{sendRPC:function(D){return new tinymce.util.JSONRequest().send(D)}}})}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value"},DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand("BackgroundImageCache",false,true)}catch(e){t.cssFlicker=true}}tinymce.addUnload(t.destroy,t)},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight}},getRect:function(e){var p,t=this,sr;e=t.get(e);p=t.getPos(e);sr=t.getSize(e);return{x:p.x,y:p.y,w:sr.w,h:sr.h}},getSize:function(e){var t=this,w,h;e=t.get(e);w=t.getStyle(e,"width");h=t.getStyle(e,"height");if(w.indexOf("px")===-1){w=0}if(h.indexOf("px")===-1){h=0}return{w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight}},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root){r=r||this.getRoot()}if(is(f,"string")){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==="*"){s=true;return false}each(na.split(","),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false}});return s}}while(n){if(n==r){return null}if(f(n)){return n}n=n.parentNode}return null},get:function(e){var n;if(e&&this.doc&&typeof (e)=="string"){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n){return this.doc.getElementsByName(n)[1]}}return e},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n,xp;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id="_mc_tmp";pa="#_mc_tmp "+pa}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l}if(!t.selectorRe){t.selectorRe=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i}if(tinymce.isAir){each(tinymce.explode(pa),function(v){if(!(xp=t.cache[v])){xp="";each(v.split(" "),function(v){v=t.selectorRe.exec(v);xp+=v[1]?"//"+v[1]:"//*";if(v[2]){xp+="[@id='"+v[2]+"']"}if(v[3]){each(v[3].split("."),function(n){xp+="[@class = '"+n+"' or contains(concat(' ', @class, ' '), ' "+n+" ')]"})}});t.cache[v]=xp}xp=t.doc.evaluate(xp,s,null,4,null);while(n=xp.iterateNext()){o.push(n)}});return o}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase())}}else{function get(s,n){return s.getElementsByTagName(n)}}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++){o.push(x[i])}return o}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||"*");c=" "+pl[2]+" ";for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(" "+n.className+" ").indexOf(c)!==-1){o.push(n)}}return o}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n)}}function collectIE(n){if(!n.getAttribute("mce_save")){n.setAttribute("mce_save","1");o.push(n)}}function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++){f(nl[i])}}each(pa.split(","),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n)});return }if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2])){collect(n)}});return }if(!(cs=t.cache[pa])){cs="x=(function(cf, s) {";pl=v.split(" ");each(pl,function(v){var p=t.selectorRe.exec(v);p[1]=p[1]||"*";cs+='find("'+p[1]+'", function(n) {';if(p[2]){cs+='if (n.id !== "'+p[2]+'") return;'}if(p[3]){cs+='var c = " " + n.className + " ";';cs+="if (";c="";each(p[3].split("."),function(v){if(v){c+=(c?"||":"")+'c.indexOf(" '+v+' ") === -1'}});cs+=c+") return;"}});cs+="cf(n);";for(i=pl.length-1;i>=0;i--){cs+="}, "+(i?"n":"s")+");"}cs+="})";t.cache[pa]=cs=eval(cs)}cs(isIE?collectIE:collect,s)});each(o,function(n){if(isIE){n.removeAttribute("mce_save")}else{delete n.mce_save}});return o},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,"string")?t.doc.createElement(n):n;t.setAttribs(e,a);if(h){if(h.nodeType){e.appendChild(h)}else{t.setHTML(e,h)}}return !c?p.appendChild(e):e})},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1)},createHTML:function(n,a,h){var o="",t=this,k;o+="<"+n;for(k in a){if(a.hasOwnProperty(k)){o+=" "+k+'="'+t.encode(a[k])+'"'}}if(tinymce.is(h)){return o+">"+h+"</"+n+">"}return o+" />"},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p){return null}if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n)})}return p.removeChild(n)})},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(t.pixelStyles.test(na)&&(tinymce.is(v,"number")||/^[\-0-9\.]+$/.test(v))){v+="px"}switch(na){case"opacity":if(isIE){s.filter=v===""?"":"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout){s.display="inline-block"}}s[na]=s["-moz-opacity"]=s["-khtml-opacity"]=v||"";break;case"float":isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||""}if(t.settings.update_styles){t.setAttrib(e,"mce_style")}})},getStyle:function(n,na,c){n=this.get(n);if(!n){return false}if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return"-"+a});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(ex){return null}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(na=="float"){na=isIE?"styleFloat":"cssFloat"}if(n.currentStyle&&c){return n.currentStyle[na]}return n.style[na]},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v)});s.update_styles=ol;if(s.update_styles){t.setAttrib(e,s.cssText)}},setAttrib:function(e,n,v){var t=this;if(!e||!n){return }if(t.settings.strict){n=n.toLowerCase()}return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(!is(v,"string")){each(v,function(v,n){t.setStyle(e,n,v)});return }if(s.keep_values){if(v&&!t._isRes(v)){e.setAttribute("mce_style",v,2)}else{e.removeAttribute("mce_style",2)}}e.style.cssText=v;break;case"class":e.className=v||"";break;case"src":case"href":if(s.keep_values){if(s.url_converter){v=s.url_converter.call(s.url_converter_scope||t,v,n,e)}t.setAttrib(e,"mce_"+n,v,2)}break;case"shape":e.setAttribute("mce_style",v);break}if(is(v)&&v!==null&&v.length!==0){e.setAttribute(n,""+v,2)}else{e.removeAttribute(n,2)}})},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v)})})},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1){return false}if(!is(dv)){dv=""}if(/^(src|href|style|coords|shape)$/.test(n)){v=e.getAttribute("mce_"+n);if(v){return v}}if(isIE&&t.props[n]){v=e[t.props[n]];v=v&&v.nodeValue?v.nodeValue:v}if(!v){v=e.getAttribute(n,2)}if(n==="style"){v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v)){e.setAttribute("mce_style",v)}}}if(isWebKit&&n==="class"&&v){v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(isIE){switch(n){case"rowspan":case"colspan":if(v===1){v=""}break;case"size":if(v==="+0"||v===20){v=""}break;case"width":case"height":case"vspace":if(v===0){v=""}break;case"hspace":if(v===-1){v=""}break;case"maxlength":case"tabindex":if(v===32768||v===2147483647){v=""}break;case"compact":case"noshade":if(v===65535){return n}return dv;case"shape":v=v.toLowerCase();break;default:if(n.indexOf("on")===0&&v){v=(""+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(v!==undefined&&v!==null&&v!=="")?""+v:dv},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select("html")[0],"borderWidth");x=(x=="medium"||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x}}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0}r=r.parentNode;if(r==d.body){break}}return{x:x,y:y}},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st){return o}function compress(p,s,ot){var t,r,b,l;t=o[p+"-top"+s];if(!t){return }r=o[p+"-right"+s];if(t!=r){return }b=o[p+"-bottom"+s];if(r!=b){return }l=o[p+"-left"+s];if(b!=l){return }o[ot]=l;delete o[p+"-top"+s];delete o[p+"-right"+s];delete o[p+"-bottom"+s];delete o[p+"-left"+s]}function compress2(ta,a,b,c){var t;t=o[a];if(!t){return }t=o[b];if(!t){return }t=o[c];if(!t){return }o[ta]=o[a]+" "+o[b]+" "+o[c];delete o[a];delete o[b];delete o[c]}st=st.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");each(st.split(";"),function(v){var sv,ur=[];if(v){v=v.replace(/_MCE_SEMI_/g,";");v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return"url("+ur.length+")"});v=v.split(":");sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1]});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return"url("+s.url_converter.call(s.url_converter_scope||t,t.decode(c),"style",null)+")"})}o[tinymce.trim(v[0]).toLowerCase()]=sv}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2("border","border-width","border-style","border-color");if(isIE){if(o.border=="medium none"){o.border=""}}return o},serializeStyle:function(o){var s="";each(o,function(v,k){if(k&&v){if(tinymce.isGecko&&k.indexOf("-moz-")===0){return }switch(k){case"color":case"background-color":v=v.toLowerCase();break}s+=(s?" ":"")+k+": "+v+";"}});return s},loadCSS:function(u){var t=this,d=t.doc;if(!u){u=""}each(u.split(","),function(u){if(t.files[u]){return }t.files[u]=true;t.add(t.select("head")[0],"link",{rel:"stylesheet",href:tinymce._addVer(u)})})},addClass:function(e,c){return this.run(e,function(e){var o;if(!c){return 0}if(this.hasClass(e,c)){return e.className}o=this.removeClass(e,c);return e.className=(o!=""?(o+" "):"")+c})},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re){re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g")}v=e.className.replace(re," ");return e.className=tinymce.trim(v!=" "?v:"")}return e.className})},hasClass:function(n,c){n=this.get(n);if(!n||!c){return false}return(" "+n.className+" ").indexOf(" "+c+" ")!==-1},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){e=this.get(e);return e.style.display=="none"||this.getStyle(e,"display")=="none"},uniqueId:function(p){return(!p?"mce_":p)+(this.counter++)},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML="<br />"+h;e.removeChild(e.firstChild)}catch(ex){while(e.firstChild){e.firstChild.removeNode()}x=t.create("div");x.innerHTML="<br />"+h;each(x.childNodes,function(n,i){if(i){e.appendChild(n)}})}}if(t.settings.fix_ie_paragraphs){h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break}n.removeAttribute("mce_keep")}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,"</div>");set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement("p");n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=="mce_tmp"){v=n.getAttribute(b);if(!v&&b==="class"){v=n.className}p.setAttribute(b,v)}});for(x=0;x<n.childNodes.length;x++){p.appendChild(n.childNodes[x].cloneNode(true))}n.swapNode(p)}}}}}else{e.innerHTML=h}return h})},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html){return h}if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(isIE){h=h.replace(/'/g,"'")}}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(s.keep_values){h=h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");if(/<script|style/.test(h)){function trim(s){s=s.replace(/^[\r\n]*|[\r\n]*$/g,"");s=s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<\[CDATA\[|<!--|<\[CDATA\[)[\r\n]*/g,"");s=s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->)\s*$/g,"");return s}h=h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(v,a,b){b=trim(b);if(!a){a=' type="text/javascript"'}if(b){b="<!--\n"+b+"\n// -->"}return"<mce:script"+a+">"+b+"</mce:script>"});h=h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(v,a,b){b=trim(b);return"<mce:style"+a+"><!--\n"+b+"\n--></mce:style><style"+a+' mce_bogus="1">'+b+"</style>"})}h=h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf("mce_"+b)!=-1){return m}if(b=="style"){if(t._isRes(c)){return m}if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)})}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+")"})}}else{if(b!="coords"&&b!="shape"){if(s.url_converter){u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))}}}return" "+b+'="'+c+'" mce_'+b+'="'+u+'"'}a=a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,handle)})}return h},getOuterHTML:function(e){var d;e=this.get(e);if(!e){return null}if(isIE){return e.outerHTML}d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1){e.outerHTML=h}else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling}t.remove(e)}})},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return !e.firstChild?s:e.firstChild.nodeValue}return s},encode:function(s){return s?(""+s).replace(/[<>&\"]/g,function(c,b){switch(c){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return c}):s},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns){p.insertBefore(n,ns)}else{p.appendChild(n)}return n})},isBlock:function(n){if(n.nodeType&&n.nodeType!==1){return false}n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n)},replace:function(n,o,k){if(is(o,"array")){n=n.cloneNode(true)}return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true))})}return o.parentNode.replaceChild(n,o)})},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:"0"+s}if(c){s="#"+hex(c[1])+hex(c[2])+hex(c[3]);return s}return s},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes){return t.classes}function addClasses(s){each(s.imports,function(r){addClasses(r)});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(","),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v)){return }ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(f&&!(v=f(v,ov))){return }if(!lo[v]){cl.push({"class":v});lo[v]=1}})}break;case 3:addClasses(r.styleSheet);break}})}try{each(t.doc.styleSheets,addClasses)}catch(ex){}if(cl.length>0){t.classes=cl}return cl},run:function(e,f,s){var t=this,o;if(t.doc&&typeof (e)==="string"){e=t.get(e)}if(!e){return false}s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof (e)=="string"){e=t.doc.getElementById(e)}o.push(f.call(s,e,i))}});return o}return f.call(s,e)},getAttribs:function(n){var o;n=this.get(n);if(!n){return[]}if(isIE){o=[];if(n.nodeName=="OBJECT"){return n.attributes}n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b})});return o}return n.attributes},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s){tinymce.removeUnload(t.destroy)}},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c)}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0})})();(function(){var E=tinymce.each,C=tinymce.DOM,B=tinymce.isIE,D=tinymce.isWebKit,A;tinymce.create("static tinymce.dom.Event",{inits:[],events:[],add:function(L,M,K,I){var F,G=this,H=G.events,J;if(L&&L instanceof Array){J=[];E(L,function(N){N=C.get(N);J.push(G.add(N,M,K,I))});return J}L=C.get(L);if(!L){return }F=function(N){N=N||window.event;if(N&&!N.target&&B){N.target=N.srcElement}if(!I){return K(N)}return K.call(I,N)};if(M=="unload"){tinymce.unloads.unshift({func:F});return F}if(M=="init"){if(G.domLoaded){F()}else{G.inits.push(F)}return F}H.push({obj:L,name:M,func:K,cfunc:F,scope:I});G._add(L,M,F);return K},remove:function(K,L,J){var G=this,F=G.events,H=false,I;if(K&&K instanceof Array){I=[];E(K,function(M){M=C.get(M);I.push(G.remove(M,L,J))});return I}K=C.get(K);E(F,function(N,M){if(N.obj==K&&N.name==L&&(!J||(N.func==J||N.cfunc==J))){F.splice(M,1);G._remove(K,L,N.cfunc);H=true;return false}});return H},clear:function(J){var H=this,F=H.events,G,I;if(J){J=C.get(J);for(G=F.length-1;G>=0;G--){I=F[G];if(I.obj===J){H._remove(I.obj,I.name,I.cfunc);I.obj=I.cfunc=null;F.splice(G,1)}}}},cancel:function(F){if(!F){return false}this.stop(F);return this.prevent(F)},stop:function(F){if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}return false},prevent:function(F){if(F.preventDefault){F.preventDefault()}else{F.returnValue=false}return false},_unload:function(){var F=A;E(F.events,function(H,G){F._remove(H.obj,H.name,H.cfunc);H.obj=H.cfunc=null});F.events=[];F=null},_add:function(G,H,F){if(G.attachEvent){G.attachEvent("on"+H,F)}else{if(G.addEventListener){G.addEventListener(H,F,false)}else{G["on"+H]=F}}},_remove:function(H,I,G){if(H){try{if(H.detachEvent){H.detachEvent("on"+I,G)}else{if(H.removeEventListener){H.removeEventListener(I,G,false)}else{H["on"+I]=null}}}catch(F){}}},_pageInit:function(){var F=A;F._remove(window,"DOMContentLoaded",F._pageInit);F.domLoaded=true;E(F.inits,function(G){G()});F.inits=[]},_wait:function(){var F;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){A.domLoaded=1;return }if(B&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src='javascript:\"\"';><\/script>");C.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){A._pageInit();C.get("__ie_onload").onreadystatechange=null}}}else{A._add(window,"DOMContentLoaded",A._pageInit,A);if(B||D){F=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(F);A._pageInit()}},10)}}}});A=tinymce.dom.Event;A._wait();tinymce.addUnload(A._unload)})();(function(){var A=tinymce.each;tinymce.create("tinymce.dom.Element",{Element:function(F,D){var B=this,E,C;D=D||{};B.id=F;B.dom=E=D.dom||tinymce.DOM;B.settings=D;if(!tinymce.isIE){C=B.dom.get(B.id)}A(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(G){B[G]=function(){var H=arguments,I;if(tinymce.isOpera){H=[F];A(arguments,function(J){H.push(J)})}else{Array.prototype.unshift.call(H,C||F)}I=E[G].apply(E,H);B.update(G);return I}})},on:function(D,C,B){return tinymce.dom.Event.add(this.id,D,C,B)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var B=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||B.clientWidth),h:parseInt(this.getStyle("height")||B.clientHeight)}},moveTo:function(B,C){this.setStyles({left:B,top:C})},moveBy:function(B,D){var C=this.getXY();this.moveTo(C.x+B,C.y+D)},resizeTo:function(B,C){this.setStyles({width:B,height:C})},resizeBy:function(B,D){var C=this.getSize();this.resizeTo(C.w+B,C.h+D)},update:function(C){var D=this,B,E=D.dom;if(tinymce.isIE6&&D.settings.blocker){C=C||"";if(C.indexOf("get")===0||C.indexOf("has")===0||C.indexOf("is")===0){return }if(C=="remove"){E.remove(D.blocker);return }if(!D.blocker){D.blocker=E.uniqueId();B=E.add(D.settings.container||E.getRoot(),"iframe",{id:D.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});E.setStyle(B,"opacity",0)}else{B=E.get(D.blocker)}E.setStyle(B,"left",D.getStyle("left",1));E.setStyle(B,"top",D.getStyle("top",1));E.setStyle(B,"width",D.getStyle("width",1));E.setStyle(B,"height",D.getStyle("height",1));E.setStyle(B,"display",D.getStyle("display",1));E.setStyle(B,"zIndex",parseInt(D.getStyle("zIndex",1)||0)-1)}}})})();(function(){function D(E){return E.replace(/[\n\r]+/g,"")}var B=tinymce.is,A=tinymce.isIE,C=tinymce.each;tinymce.create("tinymce.dom.Selection",{Selection:function(H,G,F){var E=this;E.dom=H;E.win=G;E.serializer=F;C(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(I){E[I]=new tinymce.util.Dispatcher(E)});tinymce.addUnload(E.destroy,E)},getContent:function(F){var E=this,G=E.getRng(),K=E.dom.create("body"),I=E.getSel(),H,J,L;F=F||{};H=J="";F.get=true;F.format=F.format||"html";E.onBeforeGetContent.dispatch(E,F);if(F.format=="text"){return E.isCollapsed()?"":(G.text||(I.toString?I.toString():""))}if(G.cloneContents){L=G.cloneContents();if(L){K.appendChild(L)}}else{if(B(G.item)||B(G.htmlText)){K.innerHTML=G.item?G.item(0).outerHTML:G.htmlText}else{K.innerHTML=G.toString()}}if(/^\s/.test(K.innerHTML)){H=" "}if(/\s+$/.test(K.innerHTML)){J=" "}F.getInner=true;F.content=E.isCollapsed()?"":H+E.serializer.serialize(K,F)+J;E.onGetContent.dispatch(E,F);return F.content},setContent:function(G,F){var E=this,H=E.getRng(),J,I=E.win.document;F=F||{format:"html"};F.set=true;G=F.content=E.dom.processHTML(G);E.onBeforeSetContent.dispatch(E,F);G=F.content;if(H.insertNode){G+='<span id="__caret">_</span>';H.deleteContents();H.insertNode(E.getRng().createContextualFragment(G));J=E.dom.get("__caret");H=I.createRange();H.setStartBefore(J);H.setEndAfter(J);E.setRng(H);I.execCommand("Delete",false,null);E.dom.remove("__caret")}else{if(H.item){I.execCommand("Delete",false,null);H=E.getRng()}H.pasteHTML(G)}E.onSetContent.dispatch(E,F)},getStart:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(1);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.firstChild}return G}else{G=F.startContainer;if(G.nodeName=="BODY"){return G.firstChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getEnd:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(0);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.lastChild}return G}else{G=F.endContainer;if(G.nodeName=="BODY"){return G.lastChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getBookmark:function(T){var I=this,L=I.getRng(),E,M,K,Q=I.dom.getViewPort(I.win),R,O,V,N,S=-16777215,J,G=I.dom.getRoot(),F=0,H=0,U;M=Q.x;K=Q.y;if(T=="simple"){return{rng:L,scrollX:M,scrollY:K}}if(A){if(L.item){R=L.item(0);C(I.dom.select(R.nodeName),function(X,W){if(R==X){O=W;return false}});return{tag:R.nodeName,index:O,scrollX:M,scrollY:K}}E=I.dom.doc.body.createTextRange();E.moveToElementText(G);E.collapse(true);V=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(true);O=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(false);N=Math.abs(E.move("character",S))-O;return{start:O-V,length:N,scrollX:M,scrollY:K}}R=I.getNode();J=I.getSel();if(!J){return null}if(R&&R.nodeName=="IMG"){return{scrollX:M,scrollY:K}}function P(Y,b,X){var W=I.dom.doc.createTreeWalker(Y,NodeFilter.SHOW_TEXT,null,false),c,Z=0,a={};while((c=W.nextNode())!=null){if(c==b){a.start=Z}if(c==X){a.end=Z;return a}Z+=D(c.nodeValue||"").length}return null}if(J.anchorNode==J.focusNode&&J.anchorOffset==J.focusOffset){R=P(G,J.anchorNode,J.focusNode);if(!R){return{scrollX:M,scrollY:K}}D(J.anchorNode.nodeValue||"").replace(/^\s+/,function(W){F=W.length});return{start:Math.max(R.start+J.anchorOffset-F,0),end:Math.max(R.end+J.focusOffset-F,0),scrollX:M,scrollY:K,beg:J.anchorOffset-F==0}}else{R=P(G,L.startContainer,L.endContainer);if(!R){return{scrollX:M,scrollY:K}}return{start:Math.max(R.start+L.startOffset-F,0),end:Math.max(R.end+L.endOffset-H,0),scrollX:M,scrollY:K,beg:L.startOffset-F==0}}},moveToBookmark:function(M){var N=this,F=N.getRng(),O=N.getSel(),I=N.dom.getRoot(),L,G,J;function H(P,R,Z){var X=N.dom.doc.createTreeWalker(P,NodeFilter.SHOW_TEXT,null,false),T,Q=0,W={},S,Y,V,U;while((T=X.nextNode())!=null){V=U=0;J=T.nodeValue||"";G=D(J).length;Q+=G;if(Q>=R&&!W.startNode){S=R-(Q-G);if(M.beg&&S>=G){continue}W.startNode=T;W.startOffset=S+U}if(Q>=Z){W.endNode=T;W.endOffset=Z-(Q-G)+U;return W}}return null}if(!M){return false}N.win.scrollTo(M.scrollX,M.scrollY);if(A){if(F=M.rng){try{F.select()}catch(K){}return true}N.win.focus();if(M.tag){F=I.createControlRange();C(N.dom.select(M.tag),function(Q,P){if(P==M.index){F.addElement(Q)}})}else{try{if(M.start<0){return true}F=O.createRange();F.moveToElementText(I);F.collapse(true);F.moveStart("character",M.start);F.moveEnd("character",M.length)}catch(E){return true}}try{F.select()}catch(K){}return true}if(!O){return false}if(M.rng){O.removeAllRanges();O.addRange(M.rng)}else{if(B(M.start)&&B(M.end)){try{L=H(I,M.start,M.end);if(L){F=N.dom.doc.createRange();F.setStart(L.startNode,L.startOffset);F.setEnd(L.endNode,L.endOffset);O.removeAllRanges();O.addRange(F)}if(!tinymce.isOpera){N.win.focus()}}catch(K){}}}},select:function(F,K){var O=this,E=O.getRng(),P=O.getSel(),M,L,J,I=O.win.document;function G(Q){return Q?I.createTreeWalker(Q,NodeFilter.SHOW_TEXT,null,false).nextNode():null}function N(T){var S,R,Q;if(!T){return null}Q=I.createTreeWalker(T,NodeFilter.SHOW_TEXT,null,false);while(S=Q.nextNode()){R=S}return R}if(A){try{M=I.body;if(/^(IMG|TABLE)$/.test(F.nodeName)){E=M.createControlRange();E.addElement(F)}else{E=M.createTextRange();E.moveToElementText(F)}E.select()}catch(H){}}else{if(K){L=G(F);J=N(F);if(L&&J){E=I.createRange();E.setStart(L,0);E.setEnd(J,J.nodeValue.length)}else{E.selectNode(F)}}else{E.selectNode(F)}O.setRng(E)}return F},isCollapsed:function(){var E=this,G=E.getRng(),F=E.getSel();if(!G||G.item){return false}return !F||G.boundingWidth==0||G.collapsed},collapse:function(E){var F=this,G=F.getRng(),H;if(G.item){H=G.item(0);G=this.win.document.body.createTextRange();G.moveToElementText(H)}G.collapse(!!E);F.setRng(G)},getSel:function(){var F=this,E=this.win;return E.getSelection?E.getSelection():E.document.selection},getRng:function(){var F=this,G=F.getSel(),H;try{if(G){H=G.rangeCount>0?G.getRangeAt(0):(G.createRange?G.createRange():F.win.document.createRange())}}catch(E){}if(!H){H=A?F.win.document.body.createTextRange():F.win.document.createRange()}return H},setRng:function(G){var F;if(!A){F=this.getSel();if(F){F.removeAllRanges();F.addRange(G)}}else{try{G.select()}catch(E){}}},setNode:function(F){var E=this;E.setContent(E.dom.getOuterHTML(F));return F},getNode:function(){var E=this,G=E.getRng(),F=E.getSel(),H;if(!A){if(!G){return E.dom.getRoot()}H=G.commonAncestorContainer;if(!G.collapsed){if(tinymce.isWebKit&&F.anchorNode&&F.anchorNode.nodeType==1){return F.anchorNode.childNodes[F.anchorOffset]}if(G.startContainer==G.endContainer){if(G.startOffset-G.endOffset<2){if(G.startContainer.hasChildNodes()){H=G.startContainer.childNodes[G.startOffset]}}}}return E.dom.getParent(H,function(I){return I.nodeType==1})}return G.item?G.item(0):G.parentElement()},destroy:function(F){var E=this;E.win=null;if(!F){tinymce.removeUnload(E.destroy)}}})})();(function(){tinymce.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(B){function A(){var D=document.implementation;if(!D||!D.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(C){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(C){}}else{return D.createDocument("","",null)}}this.doc=A();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset()},reset:function(){var A=this,B=A.doc;if(B.firstChild){B.removeChild(B.firstChild)}A.node=B.appendChild(B.createElement("html"))},writeStartElement:function(B){var A=this;A.node=A.node.appendChild(A.doc.createElement(B))},writeAttribute:function(B,A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.setAttribute(B,A)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var A=this,B=A.node;B.appendChild(A.doc.createTextNode(""));A.node=B.parentNode},writeText:function(A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(A))},writeCDATA:function(A){this.node.appendChild(this.doc.createCDATA(A))},writeComment:function(A){if(tinymce.isIE){A=A.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(A.replace(/\-\-/g," ")))},getContent:function(){var A;A=this.doc.xml||new XMLSerializer().serializeToString(this.doc);A=A.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");A=A.replace(/ ?\/>/g," />");if(this.valid){A=A.replace(/\%MCGT%/g,">")}return A}})})();(function(){tinymce.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(A){this.settings=tinymce.extend({indent_char:" ",indentation:1},A);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(A){this._writeAttributesEnd();this.writeRaw("<"+A);this.tags.push(A);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(C,A){var B=this;B.writeRaw(" "+B.encode(C)+'="'+B.encode(A)+'"')},writeEndElement:function(){var A;if(this.tags.length>0){A=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+A+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(A){this._writeAttributesEnd();this.writeRaw(this.encode(A));this.count++},writeCDATA:function(A){this._writeAttributesEnd();this.writeRaw("<![CDATA["+A+"]]>");this.count++},writeComment:function(A){this._writeAttributesEnd();this.writeRaw("<!-- "+A+"-->");this.count++},writeRaw:function(A){this.str+=A},encode:function(A){return A.replace(/[<>&"]/g,function(B){switch(B){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return B})},getContent:function(){return this.str},_writeAttributesEnd:function(A){if(!this.inAttr){return }this.inAttr=false;if(A&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})();(function(){var G=tinymce.extend,E=tinymce.each,B=tinymce.util.Dispatcher,D=tinymce.isIE,A=tinymce.isGecko;function F(I){var H=[];if(I.nodeName=="OBJECT"){return I.attributes}I.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(K,J){H.push({specified:1,nodeName:J})});return H}function C(H){return H.replace(/([?+*])/g,".$1")}tinymce.create("tinymce.dom.Serializer",{Serializer:function(J){var I=this;I.key=0;I.onPreProcess=new B(I);I.onPostProcess=new B(I);if(tinymce.relaxedDomain&&tinymce.isGecko){I.writer=new tinymce.dom.StringWriter()}else{try{I.writer=new tinymce.dom.XMLWriter()}catch(H){I.writer=new tinymce.dom.StringWriter()}}I.settings=J=G({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},J);I.dom=J.dom;if(J.remove_redundant_brs){I.onPostProcess.add(function(K,L){L.content=L.content.replace(/<br \/>(\s*<\/li>)/g,"$1")})}if(J.element_format=="html"){I.onPostProcess.add(function(K,L){L.content=L.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(J.fix_list_elements){I.onPreProcess.add(function(R,O){var L,T,S=["ol","ul"],Q,P,N,K=/^(OL|UL)$/,U;function M(X,Y){var V=Y.split(","),W;while((X=X.previousSibling)!=null){for(W=0;W<V.length;W++){if(X.nodeName==V[W]){return X}}}return null}for(T=0;T<S.length;T++){L=I.dom.select(S[T],O.node);for(Q=0;Q<L.length;Q++){P=L[Q];N=P.parentNode;if(K.test(N.nodeName)){U=M(P,"LI");if(!U){U=I.dom.create("li");U.innerHTML=" ";U.appendChild(P);N.insertBefore(U,N.firstChild)}else{U.appendChild(P)}}}}})}if(J.fix_table_elements){I.onPreProcess.add(function(K,L){E(I.dom.select("table",L.node),function(S){var R=I.dom.getParent(S,"H1,H2,H3,H4,H5,H6,P"),N,T,M,Q=[],O,P;if(R){N=R.cloneNode(false);Q.push(S);for(T=S;T=T.parentNode;){Q.push(T);if(T==R){break}}M=N;for(O=Q.length-1;O>=0;O--){if(O==Q.length-1){while(P=Q[O-1].nextSibling){M.appendChild(P.parentNode.removeChild(P))}}else{T=Q[O].cloneNode(false);if(O!=0){while(P=Q[O-1].nextSibling){T.appendChild(P.parentNode.removeChild(P))}}M=M.appendChild(T)}}S=I.dom.insertAfter(S.parentNode.removeChild(S),R);I.dom.insertAfter(S,R);I.dom.insertAfter(N,S)}})})}},setEntities:function(N){var L=this,I,K,H={},M="",J;if(L.entityLookup){return }I=N.split(",");for(K=0;K<I.length;K+=2){J=I[K];if(J==34||J==38||J==60||J==62){continue}H[String.fromCharCode(I[K])]=I[K+1];J=parseInt(I[K]).toString(16);M+="\\u"+"0000".substring(J.length)+J}if(!M){L.settings.entity_encoding="raw";return }L.entitiesRE=new RegExp("["+M+"]","g");L.entityLookup=H},setValidChildRules:function(H){this.childRules=null;this.addValidChildRules(H)},addValidChildRules:function(K){var J=this,L,H,I;if(!K){return }L="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";H="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";I="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";E(K.split(","),function(N){var O=N.split(/\[|\]/),M;N="";E(O[1].split("|"),function(P){if(N){N+="|"}switch(P){case"%itrans":P=H;break;case"%itrans_na":P=H.substring(2);break;case"%istrict":P=L;break;case"%istrict_na":P=L.substring(2);break;case"%btrans":P=I;break;case"%bstrict":P=I;break}N+=P});M=new RegExp("^("+N.toLowerCase()+")$","i");E(O[0].split("/"),function(P){J.childRules=J.childRules||{};J.childRules[P]=M})});K="";E(J.childRules,function(N,M){if(K){K+="|"}K+=M});J.parentElementsRE=new RegExp("^("+K.toLowerCase()+")$","i")},setRules:function(I){var H=this;H._setup();H.rules={};H.wildRules=[];H.validElements={};return H.addRules(I)},addRules:function(I){var H=this,J;if(!I){return }H._setup();E(I.split(","),function(M){var P=M.split(/\[|\]/),L=P[0].split("/"),Q,K,O,N=[];if(J){K=tinymce.extend([],J.attribs)}if(P.length>1){E(P[1].split("|"),function(T){var R={},S;K=K||[];T=T.replace(/::/g,"~");T=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(T);T[2]=T[2].replace(/~/g,":");if(T[1]=="!"){Q=Q||[];Q.push(T[2])}if(T[1]=="-"){for(S=0;S<K.length;S++){if(K[S].name==T[2]){K.splice(S,1);return }}}switch(T[3]){case"=":R.defaultVal=T[4]||"";break;case":":R.forcedVal=T[4];break;case"<":R.validVals=T[4].split("?");break}if(/[*.?]/.test(T[2])){O=O||[];R.nameRE=new RegExp("^"+C(T[2])+"$");O.push(R)}else{R.name=T[2];K.push(R)}N.push(T[2])})}E(L,function(U,T){var V=U.charAt(0),S=1,R={};if(J){if(J.noEmpty){R.noEmpty=J.noEmpty}if(J.fullEnd){R.fullEnd=J.fullEnd}if(J.padd){R.padd=J.padd}}switch(V){case"-":R.noEmpty=true;break;case"+":R.fullEnd=true;break;case"#":R.padd=true;break;default:S=0}L[T]=U=U.substring(S);H.validElements[U]=1;if(/[*.?]/.test(L[0])){R.nameRE=new RegExp("^"+C(L[0])+"$");H.wildRules=H.wildRules||{};H.wildRules.push(R)}else{R.name=L[0];if(L[0]=="@"){J=R}H.rules[U]=R}R.attribs=K;if(Q){R.requiredAttribs=Q}if(O){U="";E(N,function(W){if(U){U+="|"}U+="("+C(W)+")"});R.validAttribsRE=new RegExp("^"+U.toLowerCase()+"$");R.wildAttribs=O}})});I="";E(H.validElements,function(L,K){if(I){I+="|"}if(K!="@"){I+=K}});H.validElementsRE=new RegExp("^("+C(I.toLowerCase())+")$")},findRule:function(L){var I=this,K=I.rules,H,J;I._setup();J=K[L];if(J){return J}K=I.wildRules;for(H=0;H<K.length;H++){if(K[H].nameRE.test(L)){return K[H]}}return null},findAttribRule:function(H,K){var I,J=H.wildAttribs;for(I=0;I<J.length;I++){if(J[I].nameRE.test(K)){return J[I]}}return null},serialize:function(K,J){var I,H=this;H._setup();J=J||{};J.format=J.format||"html";H.processObj=J;K=K.cloneNode(true);H.key=""+(parseInt(H.key)+1);if(!J.no_events){J.node=K;H.onPreProcess.dispatch(H,J)}H.writer.reset();H._serializeNode(K,J.getInner);J.content=H.writer.getContent();if(!J.no_events){H.onPostProcess.dispatch(H,J)}H._postProcess(J);J.node=null;return tinymce.trim(J.content)},_postProcess:function(M){var H=this,J=H.settings,I=M.content,L=[],K;if(M.format=="html"){K=H._protect({content:I,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});I=K.content;if(J.entity_encoding!=="raw"){I=H._encode(I)}if(!M.set){I=I.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,J.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(J.remove_linebreaks){I=I.replace(/\r?\n|\r/g," ");I=I.replace(/(<[^>]+>)\s+/g,"$1 ");I=I.replace(/\s+(<\/[^>]+>)/g," $1");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");I=I.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");I=I.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(J.apply_source_formatting&&J.indent_mode=="simple"){I=I.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");I=I.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");I=I.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");I=I.replace(/\n\n/g,"\n")}}I=H._unprotect(I,K);I=I.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(J.entity_encoding=="raw"){I=I.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}}M.content=I},_serializeNode:function(V,K){var R=this,S=R.settings,P=R.writer,M,I,O,X,W,Y,T,H,Q,J,N,U,L;if(!S.node_filter||S.node_filter(V)){switch(V.nodeType){case 1:if(V.hasAttribute?V.hasAttribute("mce_bogus"):V.getAttribute("mce_bogus")){return }L=false;M=V.hasChildNodes();J=V.getAttribute("mce_name")||V.nodeName.toLowerCase();if(D){if(V.scopeName!=="HTML"&&V.scopeName!=="html"){J=V.scopeName+":"+J}}if(J.indexOf("mce:")===0){J=J.substring(4)}if(!R.validElementsRE.test(J)||(R.invalidElementsRE&&R.invalidElementsRE.test(J))||K){L=true;break}if(D){if(S.fix_content_duplication){if(V.mce_serialized==R.key){return }V.mce_serialized=R.key}if(J.charAt(0)=="/"){J=J.substring(1)}}else{if(A){if(V.nodeName==="BR"&&V.getAttribute("type")=="_moz"){return }}}if(R.childRules){if(R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(J)){L=true;break}}R.elementName=J}N=R.findRule(J);J=N.name||J;if((!M&&N.noEmpty)||(D&&!J)){L=true;break}if(N.requiredAttribs){Y=N.requiredAttribs;for(X=Y.length-1;X>=0;X--){if(this.dom.getAttrib(V,Y[X])!==""){break}}if(X==-1){L=true;break}}P.writeStartElement(J);if(N.attribs){for(X=0,T=N.attribs,W=T.length;X<W;X++){Y=T[X];Q=R._getAttrib(V,Y);if(Q!==null){P.writeAttribute(Y.name,Q)}}}if(N.validAttribsRE){T=D?F(V):V.attributes;for(X=T.length-1;X>-1;X--){H=T[X];if(H.specified){Y=H.nodeName.toLowerCase();if(S.invalid_attrs.test(Y)||!N.validAttribsRE.test(Y)){continue}U=R.findAttribRule(N,Y);Q=R._getAttrib(V,U,Y);if(Q!==null){P.writeAttribute(Y,Q)}}}}if(N.padd){if(M&&(O=V.firstChild)&&O.nodeType===1&&V.childNodes.length===1){if(O.hasAttribute?O.hasAttribute("mce_bogus"):O.getAttribute("mce_bogus")){P.writeText("\u00a0")}}else{if(!M){P.writeText("\u00a0")}}}break;case 3:if(R.childRules&&R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(V.nodeName)){return }}return P.writeText(V.nodeValue);case 4:return P.writeCDATA(V.nodeValue);case 8:return P.writeComment(V.nodeValue)}}else{if(V.nodeType==1){M=V.hasChildNodes()}}if(M){O=V.firstChild;while(O){R._serializeNode(O);R.elementName=J;O=O.nextSibling}}if(!L){if(M||!S.closed.test(J)){P.writeFullEndElement()}else{P.writeEndElement()}}},_protect:function(J){var I=this;J.items=J.items||[];function H(L){return L.replace(/[\r\n\\]/g,function(M){if(M==="\n"){return"\\n"}else{if(M==="\\"){return"\\\\"}}return"\\r"})}function K(L){return L.replace(/\\[\\rn]/g,function(M){if(M==="\\n"){return"\n"}else{if(M==="\\\\"){return"\\"}}return"\r"})}E(J.patterns,function(L){J.content=K(H(J.content).replace(L.pattern,function(N,O,M,P){M=K(M);if(L.encode){M=I._encode(M)}J.items.push(M);return O+"<!--mce:"+(J.items.length-1)+"-->"+P}))});return J},_unprotect:function(H,I){H=H.replace(/\<!--mce:([0-9]+)--\>/g,function(K,J){return I.items[parseInt(J)]});I.items=[];return H},_encode:function(K){var I=this,J=I.settings,H;if(J.entity_encoding!=="raw"){if(J.entity_encoding.indexOf("named")!=-1){I.setEntities(J.entities);H=I.entityLookup;K=K.replace(I.entitiesRE,function(L){var M;if(M=H[L]){L="&"+M+";"}return L})}if(J.entity_encoding.indexOf("numeric")!=-1){K=K.replace(/[\u007E-\uFFFF]/g,function(L){return"&#"+L.charCodeAt(0)+";"})}}return K},_setup:function(){var H=this,I=this.settings;if(H.done){return }H.done=1;H.setRules(I.valid_elements);H.addRules(I.extended_valid_elements);H.addValidChildRules(I.valid_child_elements);if(I.invalid_elements){H.invalidElementsRE=new RegExp("^("+C(I.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(I.attrib_value_filter){H.attribValueFilter=I.attribValueFilter}},_getAttrib:function(L,I,H){var K,J;H=H||I.name;if(I.forcedVal&&(J=I.forcedVal)){if(J==="{$uid}"){return this.dom.uniqueId()}return J}J=this.dom.getAttrib(L,H);switch(H){case"rowspan":case"colspan":if(J=="1"){J=""}break}if(this.attribValueFilter){J=this.attribValueFilter(H,J,L)}if(I.validVals){for(K=I.validVals.length-1;K>=0;K--){if(J==I.validVals[K]){break}}if(K==-1){return null}}if(J===""&&typeof (I.defaultVal)!="undefined"){J=I.defaultVal;if(J==="{$uid}"){return this.dom.uniqueId()}return J}else{if(H=="class"&&this.processObj.get){J=J.replace(/\s?mceItem\w+\s?/g,"")}}if(J===""){return null}return J}})})();(function(){var each=tinymce.each;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return }o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone()}})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return }if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})();(function(){var B=tinymce.DOM,A=tinymce.is;tinymce.create("tinymce.ui.Control",{Control:function(D,C){this.id=D;this.settings=C=C||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix="";this.scope=C.scope||this;this.disabled=0;this.active=0},setDisabled:function(C){var D;if(C!=this.disabled){D=B.get(this.id);if(D&&this.settings.unavailable_prefix){if(C){this.prevTitle=D.title;D.title=this.settings.unavailable_prefix+": "+D.title}else{D.title=this.prevTitle}}this.setState("Disabled",C);this.setState("Enabled",!C);this.disabled=C}},isDisabled:function(){return this.disabled},setActive:function(C){if(C!=this.active){this.setState("Active",C);this.active=C}},isActive:function(){return this.active},setState:function(E,C){var D=B.get(this.id);E=this.classPrefix+E;if(C){B.addClass(D,E)}else{B.removeClass(D,E)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(C){B.setHTML(C,this.renderHTML())},postRender:function(){var D=this,C;if(A(D.disabled)){C=D.disabled;D.disabled=-1;D.setDisabled(C)}if(A(D.active)){C=D.active;D.active=-1;D.setActive(C)}},remove:function(){B.remove(this.id);this.destroy()},destroy:function(){tinymce.dom.Event.clear(this.id)}})})();tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(B,A){this.parent(B,A);this.controls=[];this.lookup={}},add:function(A){this.lookup[A.id]=A;this.controls.push(A);return A},get:function(A){return this.lookup[A]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(B,A){this.parent(B,A);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(F,E){this.parent(F,E);this.classPrefix="mceMenuItem"},setSelected:function(E){this.setState("Selected",E);this.selected=E},isSelected:function(){return this.selected},postRender:function(){var E=this;E.parent();if(C(E.selected)){E.setSelected(E.selected)}}})})();(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(G,F){var E=this;E.parent(G,F);E.items={};E.collapsed=false;E.menuCount=0;E.onAddItem=new tinymce.util.Dispatcher(this)},expand:function(F){var E=this;if(F){A(E,function(G){if(G.expand){G.expand()}},"items",E)}E.collapsed=false},collapse:function(F){var E=this;if(F){A(E,function(G){if(G.collapse){G.collapse()}},"items",E)}E.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(E){if(!E.settings){E=new tinymce.ui.MenuItem(E.id||B.uniqueId(),E)}this.onAddItem.dispatch(this,E);return this.items[E.id]=E},addSeparator:function(){return this.add({separator:true})},addMenu:function(E){if(!E.collapse){E=this.createMenu(E)}this.menuCount++;return this.add(E)},hasMenus:function(){return this.menuCount!==0},remove:function(E){delete this.items[E.id]},removeAll:function(){var E=this;A(E,function(F){if(F.removeAll){F.removeAll()}else{F.remove()}F.destroy()},"items",E);E.items={}},createMenu:function(F){var E=new tinymce.ui.Menu(F.id||B.uniqueId(),F);E.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return E}})})();(function(){var D=tinymce.is,C=tinymce.DOM,E=tinymce.each,A=tinymce.dom.Event,B=tinymce.dom.Element;tinymce.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(G,F){F=F||{};F.container=F.container||C.doc.body;F.offset_x=F.offset_x||0;F.offset_y=F.offset_y||0;F.vp_offset_x=F.vp_offset_x||0;F.vp_offset_y=F.vp_offset_y||0;if(D(F.icons)&&!F.icons){F["class"]+=" mceNoIcons"}this.parent(G,F);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(I){var G=this,H=G.settings,F;I.container=I.container||H.container;I.parent=G;I.constrain=I.constrain||H.constrain;I["class"]=I["class"]||H["class"];I.vp_offset_x=I.vp_offset_x||H.vp_offset_x;I.vp_offset_y=I.vp_offset_y||H.vp_offset_y;F=new tinymce.ui.DropMenu(I.id||C.uniqueId(),I);F.onAddItem.add(G.onAddItem.dispatch,G.onAddItem);return F},update:function(){var H=this,I=H.settings,F=C.get("menu_"+H.id+"_tbl"),K=C.get("menu_"+H.id+"_co"),G,J;G=I.max_width?Math.min(F.clientWidth,I.max_width):F.clientWidth;J=I.max_height?Math.min(F.clientHeight,I.max_height):F.clientHeight;if(!C.boxModel){H.element.setStyles({width:G+2,height:J+2})}else{H.element.setStyles({width:G,height:J})}if(I.max_width){C.setStyle(K,"width",G)}if(I.max_height){C.setStyle(K,"height",J);if(F.clientHeight<I.max_height){C.setStyle(K,"overflow","hidden")}}},showMenu:function(N,L,P){var S=this,T=S.settings,M,F=C.getViewPort(),Q,J,R,O,G=2,I,H,K=S.classPrefix;S.collapse(1);if(S.isMenuVisible){return }if(!S.rendered){M=C.add(S.settings.container,S.renderNode());E(S.items,function(U){U.postRender()});S.element=new B("menu_"+S.id,{blocker:1,container:T.container})}else{M=C.get("menu_"+S.id)}if(!tinymce.isOpera){C.setStyles(M,{left:-65535,top:-65535})}C.show(M);S.update();N+=T.offset_x||0;L+=T.offset_y||0;F.w-=4;F.h-=4;if(T.constrain){Q=M.clientWidth-G;J=M.clientHeight-G;R=F.x+F.w;O=F.y+F.h;if((N+T.vp_offset_x+Q)>R){N=P?P-Q:Math.max(0,(R-T.vp_offset_x)-Q)}if((L+T.vp_offset_y+J)>O){L=Math.max(0,(O-T.vp_offset_y)-J)}}C.setStyles(M,{left:N,top:L});S.element.update();S.isMenuVisible=1;S.mouseClickFunc=A.add(M,"click",function(V){var U;V=V.target;if(V&&(V=C.getParent(V,"TR"))&&!C.hasClass(V,K+"ItemSub")){U=S.items[V.id];if(U.isDisabled()){return }I=S;while(I){if(I.hideMenu){I.hideMenu()}I=I.settings.parent}if(U.settings.onclick){U.settings.onclick(V)}return A.cancel(V)}});if(S.hasMenus()){S.mouseOverFunc=A.add(M,"mouseover",function(X){var U,W,V;X=X.target;if(X&&(X=C.getParent(X,"TR"))){U=S.items[X.id];if(S.lastMenu){S.lastMenu.collapse(1)}if(U.isDisabled()){return }if(X&&C.hasClass(X,K+"ItemSub")){W=C.getRect(X);U.showMenu((W.x+W.w-G),W.y-G,W.x);S.lastMenu=U;C.addClass(C.get(U.id).firstChild,K+"ItemActive")}}})}S.onShowMenu.dispatch(S);if(T.keyboard_focus){A.add(M,"keydown",S._keyHandler,S);C.select("a","menu_"+S.id)[0].focus();S._focusIdx=0}},hideMenu:function(I){var F=this,H=C.get("menu_"+F.id),G;if(!F.isMenuVisible){return }A.remove(H,"mouseover",F.mouseOverFunc);A.remove(H,"click",F.mouseClickFunc);A.remove(H,"keydown",F._keyHandler);C.hide(H);F.isMenuVisible=0;if(!I){F.collapse(1)}if(F.element){F.element.hide()}if(G=C.get(F.id)){C.removeClass(G.firstChild,F.classPrefix+"ItemActive")}F.onHideMenu.dispatch(F)},add:function(H){var F=this,G;H=F.parent(H);if(F.isRendered&&(G=C.get("menu_"+F.id))){F._add(C.select("tbody",G)[0],H)}return H},collapse:function(F){this.parent(F);this.hideMenu(1)},remove:function(F){C.remove(F.id);this.destroy();return this.parent(F)},destroy:function(){var F=this,G=C.get("menu_"+F.id);A.remove(G,"mouseover",F.mouseOverFunc);A.remove(G,"click",F.mouseClickFunc);if(F.element){F.element.remove()}C.remove(G)},renderNode:function(){var H=this,I=H.settings,K,G,J,F;F=C.create("div",{id:"menu_"+H.id,"class":I["class"],style:"position:absolute;left:0;top:0;z-index:200000"});J=C.add(F,"div",{id:"menu_"+H.id+"_co","class":H.classPrefix+(I["class"]?" "+I["class"]:"")});H.element=new B("menu_"+H.id,{blocker:1,container:I.container});if(I.menu_line){C.add(J,"span",{"class":H.classPrefix+"Line"})}K=C.add(J,"table",{id:"menu_"+H.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});G=C.add(K,"tbody");E(H.items,function(L){H._add(G,L)});H.rendered=true;return F},_keyHandler:function(I){var H=this,G=I.keyCode;function F(L){var J=H._focusIdx+L,K=C.select("a","menu_"+H.id)[J];if(K){H._focusIdx=J;K.focus()}}switch(G){case 38:F(-1);return ;case 40:F(1);return ;case 13:return ;case 27:return this.hideMenu()}},_add:function(G,L){var M,I=L.settings,F,J,H,K=this.classPrefix;if(I.separator){J=C.add(G,"tr",{id:L.id,"class":K+"ItemSeparator"});C.add(J,"td",{"class":K+"ItemSeparator"});if(M=J.previousSibling){C.addClass(M,"mceLast")}return }M=J=C.add(G,"tr",{id:L.id,"class":K+"Item "+K+"ItemEnabled"});M=H=C.add(M,"td");M=F=C.add(M,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});C.addClass(H,I["class"]);C.add(M,"span",{"class":"mceIcon"+(I.icon?" mce_"+I.icon:"")});M=C.add(M,I.element||"span",{"class":"mceText",title:L.settings.title},L.settings.title);if(L.settings.style){C.setAttrib(M,"style",L.settings.style)}if(G.childNodes.length==1){C.addClass(J,"mceFirst")}if((M=J.previousSibling)&&C.hasClass(M,K+"ItemSeparator")){C.addClass(J,"mceFirst")}if(L.collapse){C.addClass(J,K+"ItemSub")}if(M=J.previousSibling){C.removeClass(M,"mceLast")}C.addClass(J,"mceLast")}})})();(function(){var A=tinymce.DOM;tinymce.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(C,B){this.parent(C,B);this.classPrefix="mceButton"},renderHTML:function(){var E=this.classPrefix,D=this.settings,C,B;B=A.encode(D.label||"");C='<a id="'+this.id+'" href="javascript:;" class="'+E+" "+E+"Enabled "+D["class"]+(B?" "+E+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+A.encode(D.title)+'">';if(D.image){C+='<img class="mceIcon" src="'+D.image+'" />'+B+"</a>"}else{C+='<span class="mceIcon '+D["class"]+'"></span>'+(B?'<span class="'+E+'Label">'+B+"</span>":"")+"</a>"}return C},postRender:function(){var B=this,C=B.settings;tinymce.dom.Event.add(B.id,"click",function(D){if(!B.isDisabled()){return C.onclick.call(C.scope,D)}})}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(G,F){var E=this;E.parent(G,F);E.items=[];E.onChange=new A(E);E.onPostRender=new A(E);E.onAdd=new A(E);E.onRenderMenu=new tinymce.util.Dispatcher(this);E.classPrefix="mceListBox"},select:function(F){var E=this,H,G;if(F==undefined){return }if(F&&F.call){G=F}else{G=function(I){return I==F}}if(F!=E.selectedValue){D(E.items,function(J,I){if(G(J.value)){H=1;E.selectByIndex(I);return false}});if(!H){E.selectByIndex(-1)}}},selectByIndex:function(E){var F=this,G,H;if(E!=F.selectedIndex){G=C.get(F.id+"_text");H=F.items[E];if(H){F.selectedValue=H.value;F.selectedIndex=E;C.setHTML(G,C.encode(H.title));C.removeClass(G,"mceTitle")}else{C.setHTML(G,C.encode(F.settings.title));C.addClass(G,"mceTitle");F.selectedValue=F.selectedIndex=null}G=0}else{F.selectedValue=F.selectedIndex=null}},add:function(H,E,G){var F=this;G=G||{};G=tinymce.extend(G,{title:H,value:E});F.items.push(G);F.onAdd.dispatch(F,G)},getLength:function(){return this.items.length},renderHTML:function(){var G="",E=this,F=E.settings,H=E.classPrefix;G='<table id="'+E.id+'" cellpadding="0" cellspacing="0" class="'+H+" "+H+"Enabled"+(F["class"]?(" "+F["class"]):"")+'"><tbody><tr>';G+="<td>"+C.createHTML("a",{id:E.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},C.encode(E.settings.title))+"</td>";G+="<td>"+C.createHTML("a",{id:E.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";G+="</tr></tbody></table>";return G},showMenu:function(){var F=this,I,H,G=C.get(this.id),E;if(F.isDisabled()||F.items.length==0){return }if(F.menu&&F.menu.isMenuVisible){return F.hideMenu()}if(!F.isMenuRendered){F.renderMenu();F.isMenuRendered=true}I=C.getPos(this.settings.menu_container);H=C.getPos(G);E=F.menu;E.settings.offset_x=H.x;E.settings.offset_y=H.y;E.settings.keyboard_focus=!tinymce.isOpera;if(F.oldID){E.items[F.oldID].setSelected(0)}D(F.items,function(J){if(J.value===F.selectedValue){E.items[J.id].setSelected(1);F.oldID=J.id}});E.showMenu(0,G.clientHeight);B.add(C.doc,"mousedown",F.hideMenu,F);C.addClass(F.id,F.classPrefix+"Selected")},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&(F.target.id==E.id+"_text"||F.target.id==E.id+"_open")){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceMenu")})){C.removeClass(E.id,E.classPrefix+"Selected");B.remove(C.doc,"mousedown",E.hideMenu,E);if(E.menu){E.menu.hideMenu()}}},renderMenu:function(){var F=this,E;E=F.settings.control_manager.createDropMenu(F.id+"_menu",{menu_line:1,"class":F.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});E.onHideMenu.add(F.hideMenu,F);E.add({title:F.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(F.settings.onselect("")!==false){F.select("")}}});D(F.items,function(G){G.id=C.uniqueId();G.onclick=function(){if(F.settings.onselect(G.value)!==false){F.select(G.value)}};E.add(G)});F.onRenderMenu.dispatch(F,E);F.menu=E},postRender:function(){var E=this,F=E.classPrefix;B.add(E.id,"click",E.showMenu,E);B.add(E.id+"_text","focus",function(G){if(!E._focused){E.keyDownHandler=B.add(E.id+"_text","keydown",function(K){var H=-1,I,J=K.keyCode;D(E.items,function(L,M){if(E.selectedValue==L.value){H=M}});if(J==38){I=E.items[H-1]}else{if(J==40){I=E.items[H+1]}else{if(J==13){I=E.selectedValue;E.selectedValue=null;E.settings.onselect(I);return B.cancel(K)}}}if(I){E.hideMenu();E.select(I.value)}})}E._focused=1});B.add(E.id+"_text","blur",function(){B.remove(E.id+"_text","keydown",E.keyDownHandler);E._focused=0});if(tinymce.isIE6||!C.boxModel){B.add(E.id,"mouseover",function(){if(!C.hasClass(E.id,F+"Disabled")){C.addClass(E.id,F+"Hover")}});B.add(E.id,"mouseout",function(){if(!C.hasClass(E.id,F+"Disabled")){C.removeClass(E.id,F+"Hover")}})}E.onPostRender.dispatch(E,C.get(E.id))},destroy:function(){this.parent();B.clear(this.id+"_text")}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(F,E){this.parent(F,E);this.classPrefix="mceNativeListBox"},setDisabled:function(E){C.get(this.id).disabled=E},isDisabled:function(){return C.get(this.id).disabled},select:function(F){var E=this,H,G;if(F==undefined){return }if(F&&F.call){G=F}else{G=function(I){return I==F}}if(F!=E.selectedValue){D(E.items,function(J,I){if(G(J.value)){H=1;E.selectByIndex(I);return false}});if(!H){E.selectByIndex(-1)}}},selectByIndex:function(E){C.get(this.id).selectedIndex=E+1;this.selectedValue=this.items[E]?this.items[E].value:null},add:function(I,F,E){var H,G=this;E=E||{};E.value=F;if(G.isRendered()){C.add(C.get(this.id),"option",E,I)}H={title:I,value:F,attribs:E};G.items.push(H);G.onAdd.dispatch(G,H)},getLength:function(){return C.get(this.id).options.length-1},renderHTML:function(){var F,E=this;F=C.createHTML("option",{value:""},"-- "+E.settings.title+" --");D(E.items,function(G){F+=C.createHTML("option",{value:G.value},G.title)});F=C.createHTML("select",{id:E.id,"class":"mceNativeListBox"},F);return F},postRender:function(){var F=this,G;F.rendered=true;function E(I){var H=F.items[I.target.selectedIndex-1];if(H=H.value){F.onChange.dispatch(F,H);if(F.settings.onselect){F.settings.onselect(H)}}}B.add(F.id,"change",E);B.add(F.id,"keydown",function(I){var H;B.remove(F.id,"change",G);H=B.add(F.id,"blur",function(){B.add(F.id,"change",E);B.remove(F.id,"blur",H)});if(I.keyCode==13||I.keyCode==32){E(I);return B.cancel(I)}});F.onPostRender.dispatch(F,C.get(F.id))}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(E,D){this.parent(E,D);this.onRenderMenu=new tinymce.util.Dispatcher(this);D.menu_container=D.menu_container||B.doc.body},showMenu:function(){var E=this,H,G,F=B.get(E.id),D;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=B.getPos(E.settings.menu_container);G=B.getPos(F);D=E.menu;D.settings.offset_x=G.x;D.settings.offset_y=G.y;D.settings.vp_offset_x=G.x;D.settings.vp_offset_y=G.y;D.settings.keyboard_focus=E._focused;D.showMenu(0,F.clientHeight);A.add(B.doc,"mousedown",E.hideMenu,E);E.setState("Selected",1);E.isMenuVisible=1},renderMenu:function(){var E=this,D;D=E.settings.control_manager.createDropMenu(E.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:E.settings.icons});D.onHideMenu.add(E.hideMenu,E);E.onRenderMenu.dispatch(E,D);E.menu=D},hideMenu:function(E){var D=this;if(E&&E.type=="mousedown"&&B.getParent(E.target,function(F){return F.id===D.id||F.id===D.id+"_open"})){return }if(!E||!B.getParent(E.target,function(F){return B.hasClass(F,"mceMenu")})){D.setState("Selected",0);A.remove(B.doc,"mousedown",D.hideMenu,D);if(D.menu){D.menu.hideMenu()}}D.isMenuVisible=0},postRender:function(){var D=this,E=D.settings;A.add(D.id,"click",function(){if(!D.isDisabled()){if(E.onclick){E.onclick(D.value)}D.showMenu()}})}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(E,D){this.parent(E,D);this.classPrefix="mceSplitButton"},renderHTML:function(){var G,E=this,F=E.settings,D;G="<tbody><tr>";if(F.image){D=B.createHTML("img ",{src:F.image,"class":"mceAction "+F["class"]})}else{D=B.createHTML("span",{"class":"mceAction "+F["class"]},"")}G+="<td>"+B.createHTML("a",{id:E.id+"_action",href:"javascript:;","class":"mceAction "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";D=B.createHTML("span",{"class":"mceOpen "+F["class"]});G+="<td>"+B.createHTML("a",{id:E.id+"_open",href:"javascript:;","class":"mceOpen "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";G+="</tr></tbody>";return B.createHTML("table",{id:E.id,"class":"mceSplitButton mceSplitButtonEnabled "+F["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:F.title},G)},postRender:function(){var D=this,E=D.settings;if(E.onclick){A.add(D.id+"_action","click",function(){if(!D.isDisabled()){E.onclick(D.value)}})}A.add(D.id+"_open","click",D.showMenu,D);A.add(D.id+"_open","focus",function(){D._focused=1});A.add(D.id+"_open","blur",function(){D._focused=0});if(tinymce.isIE6||!B.boxModel){A.add(D.id,"mouseover",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.addClass(D.id,"mceSplitButtonHover")}});A.add(D.id,"mouseout",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.removeClass(D.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();A.clear(this.id+"_action");A.clear(this.id+"_open")}})})();(function(){var C=tinymce.DOM,A=tinymce.dom.Event,B=tinymce.is,D=tinymce.each;tinymce.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(G,F){var E=this;E.parent(G,F);E.settings=F=tinymce.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},E.settings);E.onShowMenu=new tinymce.util.Dispatcher(E);E.onHideMenu=new tinymce.util.Dispatcher(E);E.value=F.default_color},showMenu:function(){var E=this,F,I,H,G;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=C.get(E.id);C.show(E.id+"_menu");C.addClass(H,"mceSplitButtonSelected");G=C.getPos(H);C.setStyles(E.id+"_menu",{left:G.x,top:G.y+H.clientHeight,zIndex:200000});H=0;A.add(C.doc,"mousedown",E.hideMenu,E);if(E._focused){E._keyHandler=A.add(E.id+"_menu","keydown",function(J){if(J.keyCode==27){E.hideMenu()}});C.select("a",E.id+"_menu")[0].focus()}E.onShowMenu.dispatch(E);E.isMenuVisible=1},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&C.getParent(F.target,function(G){return G.id===E.id+"_open"})){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceSplitButtonMenu")})){C.removeClass(E.id,"mceSplitButtonSelected");A.remove(C.doc,"mousedown",E.hideMenu,E);A.remove(E.id+"_menu","keydown",E._keyHandler);C.hide(E.id+"_menu")}E.onHideMenu.dispatch(E);E.isMenuVisible=0},renderMenu:function(){var I=this,E,H=0,J=I.settings,L,G,K,F;F=C.add(J.menu_container,"div",{id:I.id+"_menu","class":J.menu_class+" "+J["class"],style:"position:absolute;left:0;top:-1000px;"});E=C.add(F,"div",{"class":J["class"]+" mceSplitButtonMenu"});C.add(E,"span",{"class":"mceMenuLine"});L=C.add(E,"table",{"class":"mceColorSplitMenu"});G=C.add(L,"tbody");H=0;D(B(J.colors,"array")?J.colors:J.colors.split(","),function(M){M=M.replace(/^#/,"");if(!H--){K=C.add(G,"tr");H=J.grid_width-1}L=C.add(K,"td");L=C.add(L,"a",{href:"javascript:;",style:{backgroundColor:"#"+M},mce_color:"#"+M})});if(J.more_colors_func){L=C.add(G,"tr");L=C.add(L,"td",{colspan:J.grid_width,"class":"mceMoreColors"});L=C.add(L,"a",{id:I.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},J.more_colors_title);A.add(L,"click",function(M){J.more_colors_func.call(J.more_colors_scope||this);return A.cancel(M)})}C.addClass(E,"mceColorSplitMenu");A.add(I.id+"_menu","click",function(M){var N;M=M.target;if(M.nodeName=="A"&&(N=M.getAttribute("mce_color"))){I.setColor(N)}return A.cancel(M)});return F},setColor:function(F){var E=this;C.setStyle(E.id+"_preview","backgroundColor",F);E.value=F;E.hideMenu();E.settings.onselect(F)},postRender:function(){var E=this,F=E.id;E.parent();C.add(F+"_action","div",{id:F+"_preview","class":"mceColorPreview"})},destroy:function(){this.parent();A.clear(this.id+"_menu");A.clear(this.id+"_more");C.remove(this.id+"_menu")}})})();tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var I=this,D="",F,G,B=tinymce.DOM,J=I.settings,C,A,E,H;H=I.controls;for(C=0;C<H.length;C++){G=H[C];A=H[C-1];E=H[C+1];if(C===0){F="mceToolbarStart";if(G.Button){F+=" mceToolbarStartButton"}else{if(G.SplitButton){F+=" mceToolbarStartSplitButton"}else{if(G.ListBox){F+=" mceToolbarStartListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"))}if(A&&G.ListBox){if(A.Button||A.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarEnd"},B.createHTML("span",null,"<!-- IE -->"))}}if(B.stdMode){D+='<td style="position: relative">'+G.renderHTML()+"</td>"}else{D+="<td>"+G.renderHTML()+"</td>"}if(E&&G.ListBox){if(E.Button||E.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarStart"},B.createHTML("span",null,"<!-- IE -->"))}}}F="mceToolbarEnd";if(G.Button){F+=" mceToolbarEndButton"}else{if(G.SplitButton){F+=" mceToolbarEndSplitButton"}else{if(G.ListBox){F+=" mceToolbarEndListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"));return B.createHTML("table",{id:I.id,"class":"mceToolbar"+(J["class"]?" "+J["class"]:""),cellpadding:"0",cellspacing:"0",align:I.settings.align||""},"<tbody><tr>"+D+"</tr></tbody>")}});(function(){var A=tinymce.util.Dispatcher,B=tinymce.each;tinymce.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new A(this),get:function(C){return this.lookup[C]},requireLangPack:function(E){var C,D=tinymce.EditorManager.settings;if(D&&D.language){l=tinyMCE.settings.language;C=tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0&context="+this.urls[E];if(!tinymce.dom.Event.domLoaded&&!D.strict_mode){tinymce.ScriptLoader.load(C)}else{tinymce.ScriptLoader.add(C)}}},add:function(D,C){this.items.push(C);this.lookup[D]=C;this.onAdd.dispatch(this,D,C);return C},load:function(G,D,C,F){var E=this;if(E.urls[G]){return }if(D.indexOf("/")!=0&&D.indexOf("://")==-1){D=tinymce.baseURL+"/"+D}E.urls[G]=D.substring(0,D.lastIndexOf("/"));tinymce.ScriptLoader.add(D,C,F)}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager()}());(function(){var F=tinymce.each,G=tinymce.extend,E=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.ThemeManager,B=tinymce.PluginManager,D=tinymce.explode;tinymce.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var H=this,I=window.location;tinymce.documentBaseURL=I.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(tinymce.documentBaseURL)){tinymce.documentBaseURL+="/"}tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(document.domain&&I.hostname!=document.domain){tinymce.relaxedDomain=document.domain}if(!tinymce.relaxedDomain&&tinymce.EditorManager.baseURI.host!=I.hostname&&I.hostname){document.domain=tinymce.relaxedDomain=I.hostname.replace(/.*\.(.+\..+)$/,"$1")}H.onBeforeUnload=new tinymce.util.Dispatcher(H);A.add(window,"beforeunload",function(J){H.onBeforeUnload.dispatch(H,J)})},init:function(P){var O=this,K,J=tinymce.ScriptLoader,N,M,H=[],L;function I(S,T,Q){var R=S[T];if(!R){return }if(tinymce.is(R,"string")){Q=R.replace(/\.\w+$/,"");Q=Q?tinymce.resolve(Q):0;R=tinymce.resolve(R)}return R.apply(Q||this,Array.prototype.slice.call(arguments,2))}P=G({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},P);O.settings=P;if(!A.domLoaded&&!P.strict_loading_mode){if(P.language){l=tinyMCE.settings.language;J.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(P.theme&&P.theme.charAt(0)!="-"&&!C.urls[P.theme]){C.load(P.theme,"themes/"+P.theme+"/editor_template"+tinymce.suffix+".js")}if(P.plugins){K=D(P.plugins);if(tinymce.inArray(K,"compat2x")!=-1){B.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js")}F(K,function(Q){if(Q&&Q.charAt(0)!="-"&&!B.urls[Q]){if(!tinymce.isWebKit&&Q=="safari"){return }B.load(Q,"plugins/"+Q+"/editor_plugin"+tinymce.suffix+".js")}})}J.loadQueue()}A.add(document,"init",function(){var Q,S;I(P,"onpageload");if(P.browsers){Q=false;F(D(P.browsers),function(T){switch(T){case"ie":case"msie":if(tinymce.isIE){Q=true}break;case"gecko":if(tinymce.isGecko){Q=true}break;case"safari":case"webkit":if(tinymce.isWebKit){Q=true}break;case"opera":if(tinymce.isOpera){Q=true}break}});if(!Q){return }}switch(P.mode){case"exact":Q=P.elements||"";if(Q.length>0){F(D(Q),function(T){if(E.get(T)){L=new tinymce.Editor(T,P);H.push(L);L.render(1)}else{N=0;F(document.forms,function(U){F(U.elements,function(V){if(V.name===T){T="mce_editor_"+N;E.setAttrib(V,"id",T);L=new tinymce.Editor(T,P);H.push(L);L.render(1)}})})}})}break;case"textareas":case"specific_textareas":function R(U,T){return T.constructor===RegExp?T.test(U.className):E.hasClass(U,T)}F(E.select("textarea"),function(T){if(P.editor_deselector&&R(T,P.editor_deselector)){return }if(!P.editor_selector||R(T,P.editor_selector)){M=E.get(T.name);if(!T.id&&!M){T.id=T.name}if(!T.id||O.get(T.id)){T.id=E.uniqueId()}L=new tinymce.Editor(T.id,P);H.push(L);L.render(1)}});break}if(P.oninit){Q=S=0;F(H,function(T){S++;if(!T.initialized){T.onInit.add(function(){Q++;if(Q==S){I(P,"oninit")}})}else{Q++}if(Q==S){I(P,"oninit")}})}})},get:function(H){return this.editors[H]},getInstanceById:function(H){return this.get(H)},add:function(H){this.editors[H.id]=H;this._setActive(H);return H},remove:function(I){var H=this;if(!H.editors[I.id]){return null}delete H.editors[I.id];if(H.activeEditor==I){F(H.editors,function(J){H._setActive(J);return false})}I.destroy();return I},execCommand:function(N,L,K){var M=this,J=M.get(K),H;switch(N){case"mceFocus":J.focus();return true;case"mceAddEditor":case"mceAddControl":if(!M.get(K)){new tinymce.Editor(K,M.settings).render()}return true;case"mceAddFrameControl":H=K.window;H.tinyMCE=tinyMCE;H.tinymce=tinymce;tinymce.DOM.doc=H.document;tinymce.DOM.win=H;J=new tinymce.Editor(K.element_id,K);J.render();if(tinymce.isIE){function I(){J.destroy();H.detachEvent("onunload",I);H=H.tinyMCE=H.tinymce=null}H.attachEvent("onunload",I)}K.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(J){J.remove()}return true;case"mceToggleEditor":if(!J){M.execCommand("mceAddControl",0,K);return true}if(J.isHidden()){J.show()}else{J.hide()}return true}if(M.activeEditor){return M.activeEditor.execCommand(N,L,K)}return false},execInstanceCommand:function(L,K,J,I){var H=this.get(L);if(H){return H.execCommand(K,J,I)}return false},triggerSave:function(){F(this.editors,function(H){H.save()})},addI18n:function(J,K){var H,I=this.i18n;if(!tinymce.is(J,"string")){F(J,function(M,L){F(M,function(O,N){F(O,function(Q,P){if(N==="common"){I[L+"."+P]=Q}else{I[L+"."+N+"."+P]=Q}})})})}else{F(K,function(M,L){I[J+"."+L]=M})}},_setActive:function(H){this.selectedInstance=this.activeEditor=H}});tinymce.EditorManager.preInit()})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var N=tinymce.DOM,K=tinymce.dom.Event,F=tinymce.extend,L=tinymce.util.Dispatcher;var J=tinymce.each,A=tinymce.isGecko,B=tinymce.isIE,E=tinymce.isWebKit;var D=tinymce.is,H=tinymce.ThemeManager,C=tinymce.PluginManager,I=tinymce.EditorManager;var O=tinymce.inArray,M=tinymce.grep,G=tinymce.explode;tinymce.create("tinymce.Editor",{Editor:function(R,Q){var P=this;P.id=P.editorId=R;P.execCommands={};P.queryStateCommands={};P.queryValueCommands={};P.plugins={};J(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(S){P[S]=new L(P)});P.settings=Q=F({id:R,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1},Q);P.documentBaseURI=new tinymce.util.URI(Q.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});P.baseURI=I.baseURI;P.execCallback("setup",P)},render:function(R){var S=this,T=S.settings,U=S.id,P=tinymce.ScriptLoader;if(!K.domLoaded){K.add(document,"init",function(){S.render()});return }if(!R){T.strict_loading_mode=1;tinyMCE.settings=T}if(!S.getElement()){return }if(T.strict_loading_mode){P.settings.strict_mode=T.strict_loading_mode;tinymce.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(S.getElement().nodeName)&&T.hidden_input&&N.getParent(U,"form")){N.insertAfter(N.create("input",{type:"hidden",name:U}),U)}S.windowManager=new tinymce.WindowManager(S);if(T.encoding=="xml"){S.onGetContent.add(function(V,W){if(W.save){W.content=N.encode(W.content)}})}if(T.add_form_submit_trigger){S.onSubmit.addToTop(function(){if(S.initialized){S.save();S.isNotDirty=1}})}if(T.add_unload_trigger&&!T.ask){S._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(S.initialized&&!S.destroyed&&!S.isHidden()){S.save({format:"raw",no_events:true})}})}tinymce.addUnload(S.destroy,S);if(T.submit_patch){S.onBeforeRenderUI.add(function(){var V=S.getElement().form;if(!V){return }if(V._mceOldSubmit){return }if(!V.submit.nodeType&&!V.submit.length){S.formElement=V;V._mceOldSubmit=V.submit;V.submit=function(){I.triggerSave();S.isNotDirty=1;return this._mceOldSubmit(this)}}V=null})}function Q(){if(T.language){l=tinyMCE.settings.language;P.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(T.theme.charAt(0)!="-"&&!H.urls[T.theme]){H.load(T.theme,"themes/"+T.theme+"/editor_template"+tinymce.suffix+".js")}J(G(T.plugins),function(V){if(V&&V.charAt(0)!="-"&&!C.urls[V]){if(!E&&V=="safari"){return }C.load(V,"plugins/"+V+"/editor_plugin"+tinymce.suffix+".js")}});P.loadQueue(function(){if(T.ask){function V(){window.setTimeout(function(){K.remove(S.id,"focus",V);S.windowManager.confirm(S.getLang("edit_confirm"),function(W){if(W){S.init()}})},0)}K.add(S.id,"focus",V);return }if(!S.removed){S.init()}})}if(T.plugins.indexOf("compat2x")!=-1){C.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js");P.loadQueue(Q)}else{Q()}},init:function(){var R,a=this,b=a.settings,X,U,W=a.getElement(),Q,P,Y,T,V,Z;I.add(a);b.theme=b.theme.replace(/-/,"");Q=H.get(b.theme);a.theme=new Q();if(a.theme.init&&b.init_theme){a.theme.init(a,H.urls[b.theme]||tinymce.documentBaseURL.replace(/\/$/,""))}J(G(b.plugins.replace(/\-/g,"")),function(f){var g=C.get(f),e=C.urls[f]||tinymce.documentBaseURL.replace(/\/$/,""),d;if(g){d=new g(a,e);a.plugins[f]=d;if(d.init){d.init(a,e)}}});if(b.popup_css){b.popup_css=a.documentBaseURI.toAbsolute(b.popup_css)}else{b.popup_css=a.baseURI.toAbsolute("themes/"+b.theme+"/skins/"+b.skin+"/dialog.css")}if(b.popup_css_add){b.popup_css+=","+a.documentBaseURI.toAbsolute(b.popup_css_add)}a.controlManager=new tinymce.ControlManager(a);a.undoManager=new tinymce.UndoManager(a);a.undoManager.onAdd.add(function(d,c){if(!c.initial){return a.onChange.dispatch(a,c,d)}});a.undoManager.onUndo.add(function(d,c){return a.onUndo.dispatch(a,c,d)});a.undoManager.onRedo.add(function(d,c){return a.onRedo.dispatch(a,c,d)});if(b.custom_undo_redo){a.onExecCommand.add(function(d,f,e,g,c){if(f!="Undo"&&f!="Redo"&&f!="mceRepaint"&&(!c||!c.skip_undo)){a.undoManager.add()}})}a.onExecCommand.add(function(d,e){if(!/^(FontName|FontSize)$/.test(e)){a.nodeChanged()}});if(A){function S(c,d){if(!d||!d.initial){a.execCommand("mceRepaint")}}a.onUndo.add(S);a.onRedo.add(S);a.onSetContent.add(S)}a.onBeforeRenderUI.dispatch(a,a.controlManager);if(b.render_ui){X=b.width||W.style.width||W.offsetWidth;U=b.height||W.style.height||W.offsetHeight;a.orgDisplay=W.style.display;Z=/^[0-9\.]+(|px)$/i;if(Z.test(""+X)){X=Math.max(parseInt(X)+(Q.deltaWidth||0),100)}if(Z.test(""+U)){U=Math.max(parseInt(U)+(Q.deltaHeight||0),100)}Q=a.theme.renderUI({targetNode:W,width:X,height:U,deltaWidth:b.delta_width,deltaHeight:b.delta_height});a.editorContainer=Q.editorContainer}N.setStyles(Q.sizeContainer||Q.editorContainer,{width:X,height:U});U=(Q.iframeHeight||U)+((U+"").indexOf("%")==-1?(Q.deltaHeight||0):"");if(U<100){U=100}a.iframeHTML=b.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+a.documentBaseURI.getURI()+'" />';a.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain){a.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";<\/script>'}T=b.body_id||"tinymce";if(T.indexOf("=")!=-1){T=a.getParam("body_id","","hash");T=T[a.id]||T}V=b.body_class||"";if(V.indexOf("=")!=-1){V=a.getParam("body_class","","hash");V=V[a.id]||""}a.iframeHTML+='</head><body id="'+T+'" class="mceContentBody '+V+'"></body></html>';if(tinymce.relaxedDomain){if(B||(tinymce.isOpera&&parseFloat(opera.version())>=9.5)){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+a.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(tinymce.isOpera){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}R=N.add(Q.iframeContainer,"iframe",{id:a.id+"_ifr",src:Y||'javascript:""',frameBorder:"0",style:{width:"100%",height:U}});a.contentAreaContainer=Q.iframeContainer;N.get(Q.editorContainer).style.display=a.orgDisplay;N.get(a.id).style.display="none";if(tinymce.isOldWebKit){K.add(R,"load",a.setupIframe,a);R.src=tinymce.baseURL+"/plugins/safari/blank.htm"}else{if(!B||!tinymce.relaxedDomain){a.setupIframe()}W=R=Q=null}},setupIframe:function(){var S=this,U=S.settings,V=N.get(S.id),W=S.getDoc(),T,Q;if(!B||!tinymce.relaxedDomain){W.open();W.write(S.iframeHTML);W.close()}if(!B){try{if(!U.readonly){W.designMode="On"}}catch(R){}}if(B){Q=S.getBody();N.hide(Q);if(!U.readonly){Q.contentEditable=true}N.show(Q)}S.dom=new tinymce.DOM.DOMUtils(S.getDoc(),{keep_values:true,url_converter:S.convertURL,url_converter_scope:S,hex_colors:U.force_hex_style_colors,class_filter:U.class_filter,update_styles:1,fix_ie_paragraphs:1});S.serializer=new tinymce.dom.Serializer({entity_encoding:U.entity_encoding,entities:U.entities,valid_elements:U.verify_html===false?"*[*]":U.valid_elements,extended_valid_elements:U.extended_valid_elements,valid_child_elements:U.valid_child_elements,invalid_elements:U.invalid_elements,fix_table_elements:U.fix_table_elements,fix_list_elements:U.fix_list_elements,fix_content_duplication:U.fix_content_duplication,convert_fonts_to_spans:U.convert_fonts_to_spans,font_size_classes:U.font_size_classes,font_size_style_values:U.font_size_style_values,apply_source_formatting:U.apply_source_formatting,remove_linebreaks:U.remove_linebreaks,element_format:U.element_format,dom:S.dom});S.selection=new tinymce.dom.Selection(S.dom,S.getWin(),S.serializer);S.forceBlocks=new tinymce.ForceBlocks(S,{forced_root_block:U.forced_root_block});S.editorCommands=new tinymce.EditorCommands(S);S.serializer.onPreProcess.add(function(X,Y){return S.onPreProcess.dispatch(S,Y,X)});S.serializer.onPostProcess.add(function(X,Y){return S.onPostProcess.dispatch(S,Y,X)});S.onPreInit.dispatch(S);if(!U.gecko_spellcheck){S.getBody().spellcheck=0}if(!U.readonly){S._addEvents()}S.controlManager.onPostRender.dispatch(S,S.controlManager);S.onPostRender.dispatch(S);if(U.directionality){S.getBody().dir=U.directionality}if(U.nowrap){S.getBody().style.whiteSpace="nowrap"}if(U.auto_resize){S.onNodeChange.add(S.resizeToContent,S)}if(U.custom_elements){function P(X,Y){J(G(U.custom_elements),function(Z){var a;if(Z.indexOf("~")===0){Z=Z.substring(1);a="span"}else{a="div"}Y.content=Y.content.replace(new RegExp("<("+Z+")([^>]*)>","g"),"<"+a+' mce_name="$1"$2>');Y.content=Y.content.replace(new RegExp("</("+Z+")>","g"),"</"+a+">")})}S.onBeforeSetContent.add(P);S.onPostProcess.add(function(X,Y){if(Y.set){P(X,Y)}})}if(U.handle_node_change_callback){S.onNodeChange.add(function(Y,X,Z){S.execCallback("handle_node_change_callback",S.id,Z,-1,-1,true,S.selection.isCollapsed())})}if(U.save_callback){S.onSaveContent.add(function(X,Z){var Y=S.execCallback("save_callback",S.id,Z.content,S.getBody());if(Y){Z.content=Y}})}if(U.onchange_callback){S.onChange.add(function(Y,X){S.execCallback("onchange_callback",S,X)})}if(U.convert_newlines_to_brs){S.onBeforeSetContent.add(function(X,Y){if(Y.initial){Y.content=Y.content.replace(/\r?\n/g,"<br />")}})}if(U.fix_nesting&&B){S.onBeforeSetContent.add(function(X,Y){Y.content=S._fixNesting(Y.content)})}if(U.preformatted){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^\s*<pre.*?>/,"");Y.content=Y.content.replace(/<\/pre>\s*$/,"");if(Y.set){Y.content='<pre class="mceItemHidden">'+Y.content+"</pre>"}})}if(U.verify_css_classes){S.serializer.attribValueFilter=function(a,Y){var Z,X;if(a=="class"){if(!S.classesRE){X=S.dom.getClasses();if(X.length>0){Z="";J(X,function(b){Z+=(Z?"|":"")+b["class"]});S.classesRE=new RegExp("("+Z+")","gi")}}return !S.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(Y)||S.classesRE.test(Y)?Y:""}return Y}}if(U.convert_fonts_to_spans){S._convertFonts()}if(U.inline_styles){S._convertInlineElements()}if(U.cleanup_callback){S.onBeforeSetContent.add(function(X,Y){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)});S.onPreProcess.add(function(X,Y){if(Y.set){S.execCallback("cleanup_callback","insert_to_editor_dom",Y.node,Y)}if(Y.get){S.execCallback("cleanup_callback","get_from_editor_dom",Y.node,Y)}});S.onPostProcess.add(function(X,Y){if(Y.set){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)}if(Y.get){Y.content=S.execCallback("cleanup_callback","get_from_editor",Y.content,Y)}})}if(U.save_callback){S.onGetContent.add(function(X,Y){if(Y.save){Y.content=S.execCallback("save_callback",S.id,Y.content,S.getBody())}})}if(U.handle_event_callback){S.onEvent.add(function(X,Y,Z){if(S.execCallback("handle_event_callback",Y,X,Z)===false){K.cancel(Y)}})}S.onSetContent.add(function(){S.addVisual(S.getBody())});if(U.padd_empty_editor){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^(<p>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(A&&!U.readonly){try{W.designMode="Off";W.designMode="On"}catch(R){}}setTimeout(function(){if(S.removed){return }S.load({initial:true,format:(U.cleanup_on_startup?"html":"raw")});S.startContent=S.getContent({format:"raw"});S.undoManager.add({initial:true});S.initialized=true;S.onInit.dispatch(S);S.execCallback("setupcontent_callback",S.id,S.getBody(),S.getDoc());S.execCallback("init_instance_callback",S);S.focus(true);S.nodeChanged({initial:1});if(U.content_css){tinymce.each(G(U.content_css),function(X){S.dom.loadCSS(S.documentBaseURI.toAbsolute(X))})}if(U.auto_focus){setTimeout(function(){var X=I.get(U.auto_focus);X.selection.select(X.getBody(),1);X.selection.collapse(1);X.getWin().focus()},100)}},1);V=null},focus:function(Q){var S,P=this,R=P.settings.content_editable;if(!Q){if(!R&&(!B||P.selection.getNode().ownerDocument!=P.getDoc())){P.getWin().focus()}}if(I.activeEditor!=P){if((S=I.activeEditor)!=null){S.onDeactivate.dispatch(S,P)}P.onActivate.dispatch(P,S)}I._setActive(P)},execCallback:function(S){var P=this,R=P.settings[S],Q;if(!R){return }if(P.callbackLookup&&(Q=P.callbackLookup[S])){R=Q.func;Q=Q.scope}if(D(R,"string")){Q=R.replace(/\.\w+$/,"");Q=Q?tinymce.resolve(Q):0;R=tinymce.resolve(R);P.callbackLookup=P.callbackLookup||{};P.callbackLookup[S]={func:R,scope:Q}}return R.apply(Q||P,Array.prototype.slice.call(arguments,1))},translate:function(P){var R=this.settings.language||"en",Q=I.i18n;if(!P){return""}return Q[R+"."+P]||P.replace(/{\#([^}]+)\}/g,function(T,S){return Q[R+"."+S]||"{#"+S+"}"})},getLang:function(Q,P){return I.i18n[(this.settings.language||"en")+"."+Q]||(D(P)?P:"{#"+Q+"}")},getParam:function(U,R,P){var S=tinymce.trim,Q=D(this.settings[U])?this.settings[U]:R,T;if(P==="hash"){T={};if(D(Q,"string")){J(Q.indexOf("=")>0?Q.split(/[;,](?![^=;,]*(?:[;,]|$))/):Q.split(","),function(V){V=V.split("=");if(V.length>1){T[S(V[0])]=S(V[1])}else{T[S(V[0])]=S(V)}})}else{T=Q}return T}return Q},nodeChanged:function(R){var P=this,Q=P.selection,S=Q.getNode()||P.getBody();if(P.initialized){P.onNodeChange.dispatch(P,R?R.controlManager||P.controlManager:P.controlManager,B&&S.ownerDocument!=P.getDoc()?P.getBody():S,Q.isCollapsed(),R)}},addButton:function(R,Q){var P=this;P.buttons=P.buttons||{};P.buttons[R]=Q},addCommand:function(R,Q,P){this.execCommands[R]={func:Q,scope:P||this}},addQueryStateHandler:function(R,Q,P){this.queryStateCommands[R]={func:Q,scope:P||this}},addQueryValueHandler:function(R,Q,P){this.queryValueCommands[R]={func:Q,scope:P||this}},addShortcut:function(R,T,P,S){var Q=this,U;if(!Q.settings.custom_shortcuts){return false}Q.shortcuts=Q.shortcuts||{};if(D(P,"string")){U=P;P=function(){Q.execCommand(U,false,null)}}if(D(P,"object")){U=P;P=function(){Q.execCommand(U[0],U[1],U[2])}}J(G(R),function(V){var W={func:P,scope:S||this,desc:T,alt:false,ctrl:false,shift:false};J(G(V,"+"),function(X){switch(X){case"alt":case"ctrl":case"shift":W[X]=true;break;default:W.charCode=X.charCodeAt(0);W.keyCode=X.toUpperCase().charCodeAt(0)}});Q.shortcuts[(W.ctrl?"ctrl":"")+","+(W.alt?"alt":"")+","+(W.shift?"shift":"")+","+W.keyCode]=W});return true},execCommand:function(U,T,W,P){var R=this,S=0,V,Q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(U)&&(!P||!P.skip_focus)){R.focus()}V={};R.onBeforeExecCommand.dispatch(R,U,T,W,V);if(V.terminate){return false}if(R.execCallback("execcommand_callback",R.id,R.selection.getNode(),U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(V=R.execCommands[U]){Q=V.func.call(V.scope,T,W);if(Q!==true){R.onExecCommand.dispatch(R,U,T,W,P);return Q}}J(R.plugins,function(X){if(X.execCommand&&X.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);S=1;return false}});if(S){return true}if(R.theme.execCommand&&R.theme.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(R.editorCommands.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}R.getDoc().execCommand(U,T,W);R.onExecCommand.dispatch(R,U,T,W,P)},queryCommandState:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryStateCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandState(T);if(S!==-1){return S}try{return this.getDoc().queryCommandState(T)}catch(P){}},queryCommandValue:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryValueCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandValue(T);if(D(S)){return S}try{return this.getDoc().queryCommandValue(T)}catch(P){}},show:function(){var P=this;N.show(P.getContainer());N.hide(P.id);P.load()},hide:function(){var P=this,Q=P.getDoc();if(B&&Q){Q.execCommand("SelectAll")}P.save();N.hide(P.getContainer());N.setStyle(P.id,"display",P.orgDisplay)},isHidden:function(){return !N.isHidden(this.id)},setProgressState:function(P,Q,R){this.onSetProgressState.dispatch(this,P,Q,R);return P},resizeToContent:function(){var P=this;N.setStyle(P.id+"_ifr","height",P.getBody().scrollHeight)},load:function(S){var P=this,R=P.getElement(),Q;S=S||{};S.load=true;Q=P.setContent(D(R.value)?R.value:R.innerHTML,S);S.element=R;if(!S.no_events){P.onLoadContent.dispatch(P,S)}S.element=R=null;return Q},save:function(T){var P=this,S=P.getElement(),Q,R;if(!P.initialized){return }T=T||{};T.save=true;if(!T.no_events){P.undoManager.typing=0;P.undoManager.add()}T.element=S;Q=T.content=P.getContent(T);if(!T.no_events){P.onSaveContent.dispatch(P,T)}Q=T.content;if(!/TEXTAREA|INPUT/i.test(S.nodeName)){S.innerHTML=Q;if(R=N.getParent(P.id,"form")){J(R.elements,function(U){if(U.name==P.id){U.value=Q;return false}})}}else{S.value=Q}T.element=S=null;return Q},setContent:function(Q,R){var P=this;R=R||{};R.format=R.format||"html";R.set=true;R.content=Q;if(!R.no_events){P.onBeforeSetContent.dispatch(P,R)}if(!tinymce.isIE&&(Q.length===0||/^\s+$/.test(Q))){R.content=P.dom.setHTML(P.getBody(),'<br mce_bogus="1" />');R.format="raw"}R.content=P.dom.setHTML(P.getBody(),tinymce.trim(R.content));if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;R.content=P.dom.setHTML(P.getBody(),P.serializer.serialize(P.getBody(),R))}if(!R.no_events){P.onSetContent.dispatch(P,R)}return R.content},getContent:function(R){var P=this,Q;R=R||{};R.format=R.format||"html";R.get=true;if(!R.no_events){P.onBeforeGetContent.dispatch(P,R)}if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;Q=P.serializer.serialize(P.getBody(),R)}else{Q=P.getBody().innerHTML}Q=Q.replace(/^\s*|\s*$/g,"");R.content=Q;if(!R.no_events){P.onGetContent.dispatch(P,R)}return R.content},isDirty:function(){var P=this;return tinymce.trim(P.startContent)!=tinymce.trim(P.getContent({format:"raw",no_events:1}))&&!P.isNotDirty},getContainer:function(){var P=this;if(!P.container){P.container=N.get(P.editorContainer||P.id+"_parent")}return P.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return N.get(this.settings.content_element||this.id)},getWin:function(){var P=this,Q;if(!P.contentWindow){Q=N.get(P.id+"_ifr");if(Q){P.contentWindow=Q.contentWindow}}return P.contentWindow},getDoc:function(){var Q=this,P;if(!Q.contentDocument){P=Q.getWin();if(P){Q.contentDocument=P.document}}return Q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(P,T,S){var Q=this,R=Q.settings;if(R.urlconverter_callback){return Q.execCallback("urlconverter_callback",P,S,true,T)}if(!R.convert_urls||(S&&S.nodeName=="LINK")||P.indexOf("file:")===0){return P}if(R.relative_urls){return Q.documentBaseURI.toRelative(P)}P=Q.documentBaseURI.toAbsolute(P,R.remove_script_host);return P},addVisual:function(R){var P=this,Q=P.settings;R=R||P.getBody();if(!D(P.hasVisual)){P.hasVisual=Q.visual}J(P.dom.select("table,a",R),function(T){var S;switch(T.nodeName){case"TABLE":S=P.dom.getAttrib(T,"border");if(!S||S=="0"){if(P.hasVisual){P.dom.addClass(T,Q.visual_table_class)}else{P.dom.removeClass(T,Q.visual_table_class)}}return ;case"A":S=P.dom.getAttrib(T,"name");if(S){if(P.hasVisual){P.dom.addClass(T,"mceItemAnchor")}else{P.dom.removeClass(T,"mceItemAnchor")}}return }});P.onVisualAid.dispatch(P,R,P.hasVisual)},remove:function(){var P=this,Q=P.getContainer();P.removed=1;P.hide();P.execCallback("remove_instance_callback",P);P.onRemove.dispatch(P);P.onExecCommand.listeners=[];I.remove(P);N.remove(Q)},destroy:function(Q){var P=this;if(P.destroyed){return }if(!Q){tinymce.removeUnload(P.destroy);tinyMCE.onBeforeUnload.remove(P._beforeUnload);if(P.theme.destroy){P.theme.destroy()}P.controlManager.destroy();P.selection.destroy();P.dom.destroy();if(!P.settings.content_editable){K.clear(P.getWin());K.clear(P.getDoc())}K.clear(P.getBody());K.clear(P.formElement)}if(P.formElement){P.formElement.submit=P.formElement._mceOldSubmit;P.formElement._mceOldSubmit=null}P.contentAreaContainer=P.formElement=P.container=P.settings.content_element=P.bodyElement=P.contentDocument=P.contentWindow=null;if(P.selection){P.selection=P.selection.win=P.selection.dom=P.selection.dom.doc=null}P.destroyed=1},_addEvents:function(){var W=this,Q,X=W.settings,T={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function P(a,b){var Z=a.type;if(W.removed){return }if(W.onEvent.dispatch(W,a,b)!==false){W[T[a.fakeType||a.type]].dispatch(W,a,b)}}J(T,function(a,Z){switch(Z){case"contextmenu":if(tinymce.isOpera){K.add(W.getBody(),"mousedown",function(b){if(b.ctrlKey){b.fakeType="contextmenu";P(b)}})}else{K.add(W.getBody(),Z,P)}break;case"paste":K.add(W.getBody(),Z,function(g){var b,d,c,f;if(g.clipboardData){b=g.clipboardData.getData("text/plain")}else{if(tinymce.isIE){b=W.getWin().clipboardData.getData("Text")}}P(g,{text:b,html:d})});break;case"submit":case"reset":K.add(W.getElement().form||N.getParent(W.id,"form"),Z,P);break;default:K.add(X.content_editable?W.getBody():W.getDoc(),Z,P)}});K.add(X.content_editable?W.getBody():(A?W.getDoc():W.getWin()),"focus",function(Z){W.focus(true)});if(tinymce.isGecko){K.add(W.getDoc(),"DOMNodeInserted",function(a){var Z;a=a.target;if(a.nodeType===1&&a.nodeName==="IMG"&&(Z=a.getAttribute("mce_src"))){a.src=W.documentBaseURI.toAbsolute(Z)}})}if(A){function R(){var a=this,c=a.getDoc(),b=a.settings;if(A&&!b.readonly){if(a._isHidden()){try{if(!b.content_editable){c.designMode="On"}}catch(Z){}}try{c.execCommand("styleWithCSS",0,false)}catch(Z){if(!a._isHidden()){try{c.execCommand("useCSS",0,true)}catch(Z){}}}if(!b.table_inline_editing){try{c.execCommand("enableInlineTableEditing",false,false)}catch(Z){}}if(!b.object_resizing){try{c.execCommand("enableObjectResizing",false,false)}catch(Z){}}}}W.onBeforeExecCommand.add(R);W.onMouseDown.add(R)}W.onMouseUp.add(W.nodeChanged);W.onClick.add(W.nodeChanged);W.onKeyUp.add(function(Z,a){var b=a.keyCode;if((b>=33&&b<=36)||(b>=37&&b<=40)||b==13||b==45||b==46||b==8||(tinymce.isMac&&(b==91||b==93))||a.ctrlKey){W.nodeChanged()}});W.onReset.add(function(){W.setContent(W.startContent,{format:"raw"})});if(W.getParam("tab_focus")){function Y(Z,a){if(a.keyCode===9){return K.cancel(a)}}function U(b,h){var Z,c,g,d,a;function j(e){g=N.getParent(b.id,"form");d=g.elements;if(g){J(d,function(k,f){if(k.id==b.id){Z=f;return false}});if(e>0){for(c=Z+1;c<d.length;c++){if(d[c].type!="hidden"){return d[c]}}}else{for(c=Z-1;c>=0;c--){if(d[c].type!="hidden"){return d[c]}}}}return null}if(h.keyCode===9){a=G(b.getParam("tab_focus"));if(a.length==1){a[1]=a[0];a[0]=":prev"}if(h.shiftKey){if(a[0]==":prev"){d=j(-1)}else{d=N.get(a[0])}}else{if(a[1]==":next"){d=j(1)}else{d=N.get(a[1])}}if(d){if(b=I.get(d.id||d.name)){b.focus()}else{window.setTimeout(function(){window.focus();d.focus()},10)}return K.cancel(h)}}}W.onKeyUp.add(Y);if(A){W.onKeyPress.add(U);W.onKeyDown.add(Y)}else{W.onKeyDown.add(U)}}if(X.custom_shortcuts){if(X.custom_undo_redo_keyboard_shortcuts){W.addShortcut("ctrl+z",W.getLang("undo_desc"),"Undo");W.addShortcut("ctrl+y",W.getLang("redo_desc"),"Redo")}if(A){W.addShortcut("ctrl+b",W.getLang("bold_desc"),"Bold");W.addShortcut("ctrl+i",W.getLang("italic_desc"),"Italic");W.addShortcut("ctrl+u",W.getLang("underline_desc"),"Underline")}for(Q=1;Q<=6;Q++){W.addShortcut("ctrl+"+Q,"",["FormatBlock",false,"<h"+Q+">"])}W.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);W.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);W.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function S(a){var Z=null;if(!a.altKey&&!a.ctrlKey&&!a.metaKey){return Z}J(W.shortcuts,function(b){if(b.ctrl!=a.ctrlKey&&(!tinymce.isMac||b.ctrl==a.metaKey)){return }if(b.alt!=a.altKey){return }if(b.shift!=a.shiftKey){return }if(a.keyCode==b.keyCode||(a.charCode&&a.charCode==b.charCode)){Z=b;return false}});return Z}W.onKeyUp.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyPress.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyDown.add(function(Z,a){var b=S(a);if(b){b.func.call(b.scope);return K.cancel(a)}})}if(tinymce.isIE){K.add(W.getDoc(),"controlselect",function(b){var a=W.resizeInfo,Z;b=b.target;if(b.nodeName!=="IMG"){return }if(a){K.remove(a.node,a.ev,a.cb)}if(!W.dom.hasClass(b,"mceItemNoResize")){ev="resizeend";Z=K.add(b,ev,function(d){var c;d=d.target;if(c=W.dom.getStyle(d,"width")){W.dom.setAttrib(d,"width",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"width","")}if(c=W.dom.getStyle(d,"height")){W.dom.setAttrib(d,"height",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"height","")}})}else{ev="resizestart";Z=K.add(b,"resizestart",K.cancel,K)}a=W.resizeInfo={node:b,ev:ev,cb:Z}});W.onKeyDown.add(function(Z,a){switch(a.keyCode){case 8:if(W.selection.getRng().item){W.selection.getRng().item(0).removeNode();return K.cancel(a)}}})}if(tinymce.isOpera){W.onClick.add(function(Z,a){K.prevent(a)})}if(X.custom_undo_redo){function V(){W.undoManager.typing=0;W.undoManager.add()}if(tinymce.isIE){K.add(W.getWin(),"blur",function(Z){var a;if(W.selection){a=W.selection.getNode();if(!W.removed&&a.ownerDocument&&a.ownerDocument!=W.getDoc()){V()}}})}else{K.add(W.getDoc(),"blur",function(){if(W.selection&&!W.removed){V()}})}W.onMouseDown.add(V);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.ctrlKey){W.undoManager.typing=0;W.undoManager.add()}});W.onKeyDown.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45){if(W.undoManager.typing){W.undoManager.add();W.undoManager.typing=0}return }if(!W.undoManager.typing){W.undoManager.add();W.undoManager.typing=1}})}},_convertInlineElements:function(){var V=this,X=V.settings,Q=V.dom,U,S,R,W,P;function T(Y,Z){if(!X.inline_styles){return }if(Z.get){J(V.dom.select("table,u,strike",Z.node),function(a){switch(a.nodeName){case"TABLE":if(U=Q.getAttrib(a,"height")){Q.setStyle(a,"height",U);Q.setAttrib(a,"height","")}break;case"U":case"STRIKE":a.style.textDecoration=a.nodeName=="U"?"underline":"line-through";Q.setAttrib(a,"mce_style","");Q.setAttrib(a,"mce_name","span");break}})}else{if(Z.set){J(V.dom.select("table,span",Z.node).reverse(),function(a){if(a.nodeName=="TABLE"){if(U=Q.getStyle(a,"height")){Q.setAttrib(a,"height",U.replace(/[^0-9%]+/g,""))}}else{if(a.style.textDecoration=="underline"){R="u"}else{if(a.style.textDecoration=="line-through"){R="strike"}else{R=""}}if(R){a.style.textDecoration="";Q.setAttrib(a,"mce_style","");S=Q.create(R,{style:Q.getAttrib(a,"style")});Q.replace(S,a,1)}}})}}}V.onPreProcess.add(T);if(!X.cleanup_on_startup){V.onSetContent.add(function(Y,Z){if(Z.initial){T(V,{node:V.getBody(),set:1})}})}},_convertFonts:function(){var T=this,U=T.settings,V=T.dom,S,Q,P,R;if(!U.inline_styles){return }S=[8,10,12,14,18,24,36];Q=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(P=U.font_size_style_values){P=G(P)}if(R=U.font_size_classes){R=G(R)}T.onPreProcess.add(function(Y,a){var b,Z,X,W;if(!U.inline_styles){return }if(a.get){X=T.dom.select("font",a.node);for(W=X.length-1;W>=0;W--){b=X[W];Z=V.create("span",{style:V.getAttrib(b,"style"),"class":V.getAttrib(b,"class")});V.setStyles(Z,{fontFamily:V.getAttrib(b,"face"),color:V.getAttrib(b,"color"),backgroundColor:b.style.backgroundColor});if(b.size){if(P){V.setStyle(Z,"fontSize",P[parseInt(b.size)-1])}else{V.setAttrib(Z,"class",R[parseInt(b.size)-1])}}V.setAttrib(Z,"mce_style","");V.replace(Z,b,1)}}})},_isHidden:function(){var P;if(!A){return 0}P=this.selection.getSel();return(!P||!P.rangeCount||P.rangeCount==0)},_fixNesting:function(Q){var R=[],P;Q=Q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(T,S,V){var U;if(S==="/"){if(!R.length){return""}if(V!==R[R.length-1].tag){for(P=R.length-1;P>=0;P--){if(R[P].tag===V){R[P].close=1;break}}return""}else{R.pop();if(R.length&&R[R.length-1].close){T=T+"</"+R[R.length-1].tag+">";R.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(V)){return T}if(/\/>$/.test(T)){return T}R.push({tag:V})}return T});for(P=R.length-1;P>=0;P--){Q+="</"+R[P].tag+">"}return Q}})})();(function(){var F=tinymce.each,D=tinymce.isIE,B=tinymce.isGecko,C=tinymce.isOpera,E=tinymce.isWebKit;function A(G){return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(G.nodeName)}tinymce.create("tinymce.EditorCommands",{EditorCommands:function(G){this.editor=G},execCommand:function(L,K,M){var I=this,G=I.editor,J;switch(L){case"Cut":case"Copy":case"Paste":try{G.getDoc().execCommand(L,K,M)}catch(H){if(B){G.windowManager.confirm(G.getLang("clipboard_msg"),function(N){if(N){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","mceExternal")}})}else{G.windowManager.alert(G.getLang("clipboard_no_support"))}}return true;case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":I.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":I.mceJustify(L,L.substring(7).toLowerCase());return true;case"mceEndUndoLevel":case"mceAddUndoLevel":G.undoManager.add();return true;default:J=this[L];if(J){J.call(this,K,M);return true}}return false},Indent:function(){var G=this.editor,L=G.dom,J=G.selection,K,H,I;H=G.settings.indentation;I=/[a-z%]+$/i.exec(H);H=parseInt(H);if(G.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){F(this._getSelectedBlocks(),function(M){L.setStyle(M,"paddingLeft",(parseInt(M.style.paddingLeft||0)+H)+I)});return }G.getDoc().execCommand("Indent",false,null);if(D){L.getParent(J.getNode(),function(M){if(M.nodeName=="BLOCKQUOTE"){M.dir=M.style.cssText=""}})}},Outdent:function(){var H=this.editor,M=H.dom,K=H.selection,L,G,I,J;I=H.settings.indentation;J=/[a-z%]+$/i.exec(I);I=parseInt(I);if(H.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){F(this._getSelectedBlocks(),function(N){G=Math.max(0,parseInt(N.style.paddingLeft||0)-I);M.setStyle(N,"paddingLeft",G?G+J:"")});return }H.getDoc().execCommand("Outdent",false,null)},mceSetAttribute:function(I,H){var G=this.editor,K=G.dom,J;if(J=K.getParent(G.selection.getNode(),K.isBlock)){K.setAttrib(J,H.name,H.value)}},mceSetContent:function(H,G){this.editor.setContent(G)},mceToggleVisualAid:function(){var G=this.editor;G.hasVisual=!G.hasVisual;G.addVisual()},mceReplaceContent:function(H,G){var I=this.editor.selection;I.setContent(G.replace(/\{\$selection\}/g,I.getContent({format:"text"})))},mceInsertLink:function(I,H){var G=this.editor,J=G.selection,K=G.dom.getParent(J.getNode(),"A");if(tinymce.is(H,"string")){H={href:H}}function L(M){F(H,function(O,N){G.dom.setAttrib(M,N,O)})}if(!K){G.execCommand("CreateLink",false,"javascript:mctmp(0);");F(G.dom.select("a"),function(M){if(M.href=="javascript:mctmp(0);"){L(M)}})}else{if(H.href){L(K)}else{G.dom.remove(K,1)}}},UnLink:function(){var G=this.editor,H=G.selection;if(H.isCollapsed()){H.select(H.getNode())}G.getDoc().execCommand("unlink",false,null);H.collapse(0)},FontName:function(I,H){var J=this,G=J.editor,K=G.selection,L;if(!H){if(K.isCollapsed()){K.select(K.getNode())}J.RemoveFormat()}else{if(G.settings.convert_fonts_to_spans){J._applyInlineStyle("span",{style:{fontFamily:H}})}else{G.getDoc().execCommand("FontName",false,H)}}},FontSize:function(J,I){var H=this.editor,L=H.settings,K,G;if(L.convert_fonts_to_spans&&I>=1&&I<=7){G=tinymce.explode(L.font_size_style_values);K=tinymce.explode(L.font_size_classes);if(K){I=K[I-1]||I}else{I=G[I-1]||I}}if(I>=1&&I<=7){H.getDoc().execCommand("FontSize",false,I)}else{this._applyInlineStyle("span",{style:{fontSize:I}})}},queryCommandValue:function(H){var G=this["queryValue"+H];if(G){return G.call(this,H)}return false},queryCommandState:function(H){var G;switch(H){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(H,H.substring(7).toLowerCase());default:if(G=this["queryState"+H]){return G.call(this,H)}}return -1},_queryState:function(H){try{return this.editor.getDoc().queryCommandState(H)}catch(G){}},_queryVal:function(H){try{return this.editor.getDoc().queryCommandValue(H)}catch(G){}},queryValueFontSize:function(){var H=this.editor,G=0,I;if(I=H.dom.getParent(H.selection.getNode(),"SPAN")){G=I.style.fontSize}if(!G&&(C||E)){if(I=H.dom.getParent(H.selection.getNode(),"FONT")){G=I.size}return G}return G||this._queryVal("FontSize")},queryValueFontName:function(){var H=this.editor,G=0,I;if(I=H.dom.getParent(H.selection.getNode(),"FONT")){G=I.face}if(I=H.dom.getParent(H.selection.getNode(),"SPAN")){G=I.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!G){G=this._queryVal("FontName")}return G},mceJustify:function(N,O){var K=this.editor,M=K.selection,G=M.getNode(),P=G.nodeName,H,J,I=K.dom,L;if(K.settings.inline_styles&&this.queryStateJustify(N,O)){L=1}H=I.getParent(G,K.dom.isBlock);if(P=="IMG"){if(O=="full"){return }if(L){if(O=="center"){I.setStyle(H||G.parentNode,"textAlign","")}I.setStyle(G,"float","");this.mceRepaint();return }if(O=="center"){if(H&&/^(TD|TH)$/.test(H.nodeName)){H=0}if(!H||H.childNodes.length>1){J=I.create("p");J.appendChild(G.cloneNode(false));if(H){I.insertAfter(J,H)}else{I.insertAfter(J,G)}I.remove(G);G=J.firstChild;H=J}I.setStyle(H,"textAlign",O);I.setStyle(G,"float","")}else{I.setStyle(G,"float",O);I.setStyle(H||G.parentNode,"textAlign","")}this.mceRepaint();return }if(K.settings.inline_styles&&K.settings.forced_root_block){if(L){O=""}F(this._getSelectedBlocks(I.getParent(M.getStart(),I.isBlock),I.getParent(M.getEnd(),I.isBlock)),function(Q){I.setAttrib(Q,"align","");I.setStyle(Q,"textAlign",O=="full"?"justify":O)});return }else{if(!L){K.getDoc().execCommand(N,false,null)}}if(K.settings.inline_styles){if(L){I.getParent(K.selection.getNode(),function(Q){if(Q.style&&Q.style.textAlign){I.setStyle(Q,"textAlign","")}});return }F(I.select("*"),function(R){var Q=R.align;if(Q){if(Q=="full"){Q="justify"}I.setStyle(R,"textAlign",Q);I.setAttrib(R,"align","")}})}},mceSetCSSClass:function(H,G){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:G})},getSelectedElement:function(){var U=this,O=U.editor,N=O.dom,R=O.selection,H=R.getRng(),L,K,S,P,J,G,Q,I,V,T;if(R.isCollapsed()||H.item){return R.getNode()}T=O.settings.merge_styles_invalid_parents;if(tinymce.is(T,"string")){T=new RegExp(T,"i")}if(D){L=H.duplicate();L.collapse(true);S=L.parentElement();K=H.duplicate();K.collapse(false);P=K.parentElement();if(S!=P){L.move("character",1);S=L.parentElement()}if(S==P){L=H.duplicate();L.moveToElementText(S);if(L.compareEndPoints("StartToStart",H)==0&&L.compareEndPoints("EndToEnd",H)==0){return T&&T.test(S.nodeName)?null:S}}}else{function M(W){return N.getParent(W,function(X){return X.nodeType==1})}S=H.startContainer;P=H.endContainer;J=H.startOffset;G=H.endOffset;if(!H.collapsed){if(S==P){if(J-G<2){if(S.hasChildNodes()){I=S.childNodes[J];return T&&T.test(I.nodeName)?null:I}}}}if(S.nodeType!=3||P.nodeType!=3){return null}if(J==0){I=M(S);if(I&&I.firstChild!=S){I=null}}if(J==S.nodeValue.length){Q=S.nextSibling;if(Q&&Q.nodeType==1){I=S.nextSibling}}if(G==0){Q=P.previousSibling;if(Q&&Q.nodeType==1){V=Q}}if(G==P.nodeValue.length){V=M(P);if(V&&V.lastChild!=P){V=null}}if(I==V){return T&&I&&T.test(I.nodeName)?null:I}}return null},InsertHorizontalRule:function(){if(B||D){this.editor.selection.setContent("<hr />")}else{this.editor.getDoc().execCommand("InsertHorizontalRule",false,"")}},RemoveFormat:function(){var I=this,H=I.editor,J=H.selection,G;if(E){J.setContent(J.getContent({format:"raw"}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,""),{format:"raw"})}else{H.getDoc().execCommand("RemoveFormat",false,null)}I.mceSetStyleInfo(0,{command:"removeformat"});H.addVisual()},mceSetStyleInfo:function(N,M){var Q=this,H=Q.editor,J=H.getDoc(),G=H.dom,I,K,R=H.selection,P=M.wrapper||"span",K=R.getBookmark(),O;function L(T,S){if(T.nodeType==1){switch(M.command){case"setattrib":return G.setAttrib(T,M.name,M.value);case"setstyle":return G.setStyle(T,M.name,M.value);case"removeformat":return G.setAttrib(T,"class","")}}}O=H.settings.merge_styles_invalid_parents;if(tinymce.is(O,"string")){O=new RegExp(O,"i")}if((I=Q.getSelectedElement())&&!H.settings.force_span_wrappers){L(I,1)}else{J.execCommand("FontName",false,"__");F(E?G.select("span"):G.select("font"),function(U){var S,T;if(G.getAttrib(U,"face")=="__"||U.style.fontFamily==="__"){S=G.create(P,{mce_new:"1"});L(S);F(U.childNodes,function(V){S.appendChild(V.cloneNode(true))});G.replace(S,U)}})}F(G.select(P).reverse(),function(T){var S=T.parentNode;if(!G.getAttrib(T,"mce_new")){S=G.getParent(T,function(U){return U.nodeType==1&&G.getAttrib(U,"mce_new")});if(S){G.remove(T,1)}}});F(G.select(P).reverse(),function(T){var S=T.parentNode;if(!S||!G.getAttrib(T,"mce_new")){return }if(H.settings.force_span_wrappers&&S.nodeName!="SPAN"){return }if(S.nodeName==P.toUpperCase()&&S.childNodes.length==1){return G.remove(S,1)}if(T.nodeType==1&&(!O||!O.test(S.nodeName))&&S.childNodes.length==1){L(S);G.setAttrib(T,"class","")}});F(G.select(P).reverse(),function(S){if(G.getAttrib(S,"mce_new")||(G.getAttribs(S).length<=1&&S.className==="")){if(!G.getAttrib(S,"class")&&!G.getAttrib(S,"style")){return G.remove(S,1)}G.setAttrib(S,"mce_new","")}});R.moveToBookmark(K)},queryStateJustify:function(K,H){var G=this.editor,J=G.selection.getNode(),I=G.dom;if(J&&J.nodeName=="IMG"){if(I.getStyle(J,"float")==H){return 1}return J.parentNode.style.textAlign==H}J=I.getParent(G.selection.getStart(),function(L){return L.nodeType==1&&L.style.textAlign});if(H=="full"){H="justify"}if(G.settings.inline_styles){return(J&&J.style.textAlign==H)}return this._queryState(K)},ForeColor:function(I,H){var G=this.editor;if(G.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:H}});return }else{G.getDoc().execCommand("ForeColor",false,H)}},HiliteColor:function(I,K){var H=this,G=H.editor,J=G.getDoc();if(G.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:K}});return }function L(N){if(!B){return }try{J.execCommand("styleWithCSS",0,N)}catch(M){J.execCommand("useCSS",0,!N)}}if(B||C){L(true);J.execCommand("hilitecolor",false,K);L(false)}else{J.execCommand("BackColor",false,K)}},Undo:function(){var G=this.editor;if(G.settings.custom_undo_redo){G.undoManager.undo();G.nodeChanged()}else{G.getDoc().execCommand("Undo",false,null)}},Redo:function(){var G=this.editor;if(G.settings.custom_undo_redo){G.undoManager.redo();G.nodeChanged()}else{G.getDoc().execCommand("Redo",false,null)}},FormatBlock:function(N,H){var O=this,L=O.editor,P=L.selection,J=L.dom,G,K,M;function I(Q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(Q.nodeName)}G=J.getParent(P.getNode(),function(Q){return I(Q)});if(G){if((D&&I(G.parentNode))||G.nodeName=="DIV"){K=L.dom.create(H);F(J.getAttribs(G),function(Q){J.setAttrib(K,Q.nodeName,J.getAttrib(G,Q.nodeName))});M=P.getBookmark();J.replace(K,G,1);P.moveToBookmark(M);L.nodeChanged();return }}H=L.settings.forced_root_block?(H||"<p>"):H;if(H.indexOf("<")==-1){H="<"+H+">"}if(tinymce.isGecko){H=H.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}L.getDoc().execCommand("FormatBlock",false,H)},mceCleanup:function(){var H=this.editor,I=H.selection,G=I.getBookmark();H.setContent(H.getContent());I.moveToBookmark(G)},mceRemoveNode:function(J,K){var H=this.editor,I=H.selection,G,L=K||I.getNode();if(L==H.getBody()){return }G=I.getBookmark();H.dom.remove(L,1);I.moveToBookmark(G);H.nodeChanged()},mceSelectNodeDepth:function(I,J){var G=this.editor,H=G.selection,K=0;G.dom.getParent(H.getNode(),function(L){if(L.nodeType==1&&K++==J){H.select(L);G.nodeChanged();return false}},G.getBody())},mceSelectNode:function(H,G){this.editor.selection.select(G)},mceInsertContent:function(G,H){this.editor.selection.setContent(H)},mceInsertRawHTML:function(H,I){var G=this.editor;G.selection.setContent("tiny_mce_marker");G.setContent(G.getContent().replace(/tiny_mce_marker/g,I))},mceRepaint:function(){var I,G,J=this.editor;if(tinymce.isGecko){try{I=J.selection;G=I.getBookmark(true);if(I.getSel()){I.getSel().selectAllChildren(J.getBody())}I.collapse(true);I.moveToBookmark(G)}catch(H){}}},queryStateUnderline:function(){var G=this.editor,H=G.selection.getNode();if(H&&H.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var G=this.editor,H;if(G.settings.inline_styles){if((H=G.dom.getParent(G.selection.getStart(),G.dom.isBlock))&&parseInt(H.style.paddingLeft)>0){return true}if((H=G.dom.getParent(G.selection.getEnd(),G.dom.isBlock))&&parseInt(H.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!G.settings.inline_styles&&!!G.dom.getParent(G.selection.getNode(),"BLOCKQUOTE"))},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(G){return G.nodeName==="BLOCKQUOTE"})},mceBlockQuote:function(){var R=this,N=R.editor,T=N.selection,K=N.dom,P,O,J,I,S,H,Q,M,G;function L(U){return K.getParent(U,function(V){return V.nodeName==="BLOCKQUOTE"})}P=K.getParent(T.getStart(),A);O=K.getParent(T.getEnd(),A);if(S=L(P)){if(P!=O||P.childNodes.length>1||(P.childNodes.length==1&&P.firstChild.nodeName!="BR")){I=T.getBookmark()}if(L(O)){Q=S.cloneNode(false);while(J=O.nextSibling){Q.appendChild(J.parentNode.removeChild(J))}}if(Q){K.insertAfter(Q,S)}G=R._getSelectedBlocks(P,O);for(M=G.length-1;M>=0;M--){K.insertAfter(G[M],S)}if(/^\s*$/.test(S.innerHTML)){K.remove(S,1)}if(Q&&/^\s*$/.test(Q.innerHTML)){K.remove(Q,1)}if(!I){if(!D){H=N.getDoc().createRange();H.setStart(P,0);H.setEnd(P,0);T.setRng(H)}else{T.select(P);T.collapse(0);if(K.getParent(T.getStart(),A)!=P){H=T.getRng();H.move("character",-1);H.select()}}}else{R.editor.selection.moveToBookmark(I)}return }if(D&&!P&&!O){R.editor.getDoc().execCommand("Indent");J=L(T.getNode());J.style.margin=J.dir="";return }if(!P||!O){return }if(P!=O||P.childNodes.length>1||(P.childNodes.length==1&&P.firstChild.nodeName!="BR")){I=T.getBookmark()}F(R._getSelectedBlocks(L(T.getStart()),L(T.getEnd())),function(U){if(U.nodeName=="BLOCKQUOTE"&&!S){S=U;return }if(!S){S=K.create("blockquote");U.parentNode.insertBefore(S,U)}if(U.nodeName=="BLOCKQUOTE"&&S){J=U.firstChild;while(J){S.appendChild(J.cloneNode(true));J=J.nextSibling}K.remove(U);return }S.appendChild(K.remove(U))});if(!I){if(!D){H=N.getDoc().createRange();H.setStart(P,0);H.setEnd(P,0);T.setRng(H)}else{T.select(P);T.collapse(1)}}else{T.moveToBookmark(I)}},_applyInlineStyle:function(N,I,L){var P=this,M=P.editor,K=M.dom,H,O={},J;N=N.toUpperCase();if(L&&L.check_classes&&I["class"]){L.check_classes.push(I["class"])}function G(){var Q;F(K.select(tinymce.isWebKit?"span":"font"),function(R){if(R.style.fontFamily=="mceinline"||R.face=="mceinline"){if(!Q){Q=M.selection.getBookmark()}I._mce_new="1";K.replace(K.create(N,I),R,1)}});F(K.select(N),function(S){if(S.getAttribute("_mce_new")){function R(T){if(T.nodeType==1){F(I.style,function(V,U){K.setStyle(T,U,"")});if(I["class"]&&T.className&&L){F(L.check_classes,function(U){if(K.hasClass(T,U)){K.removeClass(T,U)}})}}}F(K.select(N,S),R);if(S.parentNode&&S.parentNode.nodeType==1&&S.parentNode.childNodes.length==1){R(S.parentNode)}K.getParent(S.parentNode,function(T){if(T.nodeType==1){if(I.style){F(I.style,function(W,V){var U;if(!O[V]&&(U=K.getStyle(T,V))){if(U===W){K.setStyle(S,V,"")}O[V]=1}})}if(I["class"]&&T.className&&L){F(L.check_classes,function(U){if(K.hasClass(T,U)){K.removeClass(S,U)}})}}return false});S.removeAttribute("_mce_new")}});F(K.select(N).reverse(),function(S){var R=0;F(K.getAttribs(S),function(T){if(T.nodeName.substring(0,1)!="_"&&K.getAttrib(S,T.nodeName)!=""){R++}});if(R==0){K.remove(S,1)}});M.selection.moveToBookmark(Q);return !!Q}M.focus();M.getDoc().execCommand("FontName",false,"mceinline");G();if(J=P._applyInlineStyle.keyhandler){M.onKeyUp.remove(J);M.onKeyDown.remove(J)}if(M.selection.isCollapsed()){P._applyInlineStyle.keyhandler=J=function(Q){if(G()){M.onKeyDown.remove(P._applyInlineStyle.keyhandler);M.onKeyPress.remove(P._applyInlineStyle.keyhandler)}if(Q.type=="keyup"){M.onKeyUp.remove(P._applyInlineStyle.keyhandler)}};M.onKeyDown.add(J);M.onKeyPress.add(J);M.onKeyUp.add(J)}},_getSelectedBlocks:function(N,G){var K=this.editor,J=K.dom,O=K.selection,M,L,I,H=[];M=J.getParent(N||O.getStart(),A);L=J.getParent(G||O.getEnd(),A);if(M){H.push(M)}if(M&&L&&M!=L){I=M;while((I=I.nextSibling)&&I!=L){if(A(I)){H.push(I)}}}if(L&&M!=L){H.push(L)}return H}})})();tinymce.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(B){var C=this,A=tinymce.util.Dispatcher;C.editor=B;C.data=[];C.onAdd=new A(this);C.onUndo=new A(this);C.onRedo=new A(this)},add:function(B){var E=this,D,C=E.editor,A,F=C.settings,G;B=B||{};B.content=B.content||C.getContent({format:"raw",no_events:1});B.content=B.content.replace(/^\s*|\s*$/g,"");G=E.data[E.index>0&&(E.index==0||E.index==E.data.length)?E.index-1:E.index];if(!B.initial&&G&&B.content==G.content){return null}if(F.custom_undo_redo_levels){if(E.data.length>F.custom_undo_redo_levels){for(D=0;D<E.data.length-1;D++){E.data[D]=E.data[D+1]}E.data.length--;E.index=E.data.length}}if(F.custom_undo_redo_restore_selection&&!B.initial){B.bookmark=A=B.bookmark||C.selection.getBookmark()}if(E.index<E.data.length){E.index++}if(E.data.length===0&&!B.initial){return null}E.data.length=E.index+1;E.data[E.index++]=B;if(B.initial){E.index=0}if(E.data.length==2&&E.data[0].initial){E.data[0].bookmark=A}E.onAdd.dispatch(E,B);C.isNotDirty=0;return B},undo:function(){var D=this,B=D.editor,A=A,C;if(D.typing){D.add();D.typing=0}if(D.index>0){if(D.index==D.data.length&&D.index>1){C=D.index;D.typing=0;if(!D.add()){D.index=C}--D.index}A=D.data[--D.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);D.onUndo.dispatch(D,A)}return A},redo:function(){var C=this,B=C.editor,A=null;if(C.index<C.data.length-1){A=C.data[++C.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);C.onRedo.dispatch(C,A)}return A},clear:function(){var A=this;A.data=[];A.index=0;A.typing=0;A.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}});(function(){var B,D,A,C,E,F;B=tinymce.dom.Event;D=tinymce.isIE;A=tinymce.isGecko;C=tinymce.isOpera;E=tinymce.each;F=tinymce.extend;tinymce.create("tinymce.ForceBlocks",{ForceBlocks:function(H){var I=this,J=H.settings,K;I.editor=H;I.dom=H.dom;K=(J.forced_root_block||"p").toLowerCase();J.element=K.toUpperCase();H.onPreInit.add(I.setup,I);I.reOpera=new RegExp("(\\u00a0| | )</"+K+">","gi");I.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR2=new RegExp("<p( )([^>]+)>( | )<\\/p>|<p>( | )<\\/p>".replace(/p/g,K),"gi");I.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");I.reTrailBr=new RegExp("\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");function G(L,M){if(C){M.content=M.content.replace(I.reOpera,"</"+K+">")}M.content=M.content.replace(I.rePadd,"<"+K+"$1$2$3$4$5$6>\u00a0</"+K+">");if(!D&&!C&&M.set){M.content=M.content.replace(I.reNbsp2BR1,"<"+K+"$1$2><br /></"+K+">");M.content=M.content.replace(I.reNbsp2BR2,"<"+K+"$1$2><br /></"+K+">")}else{M.content=M.content.replace(I.reBR2Nbsp,"<"+K+"$1$2>\u00a0</"+K+">");M.content=M.content.replace(I.reTrailBr,"</"+K+">")}}H.onBeforeSetContent.add(G);H.onPostProcess.add(G);if(J.forced_root_block){H.onInit.add(I.forceRoots,I);H.onSetContent.add(I.forceRoots,I);H.onBeforeGetContent.add(I.forceRoots,I)}},setup:function(){var H=this,G=H.editor,I=G.settings;if(I.forced_root_block){G.onKeyUp.add(H.forceRoots,H);G.onPreProcess.add(H.forceRoots,H)}if(I.force_br_newlines){if(D){G.onKeyPress.add(function(K,M){var N,L=K.selection;if(M.keyCode==13&&L.getNode().nodeName!="LI"){L.setContent('<br id="__" /> ',{format:"raw"});N=K.dom.get("__");N.removeAttribute("id");L.select(N);L.collapse();return B.cancel(M)}})}return }if(!D&&I.force_p_newlines){G.onKeyPress.add(function(K,L){if(L.keyCode==13&&!L.shiftKey){if(!H.insertPara(L)){B.cancel(L)}}});if(A){G.onKeyDown.add(function(K,L){if((L.keyCode==8||L.keyCode==46)&&!L.shiftKey){H.backspaceDelete(L,L.keyCode==8)}})}}function J(L,K){var M=G.dom.create(K);E(L.attributes,function(N){if(N.specified&&N.nodeValue){M.setAttribute(N.nodeName.toLowerCase(),N.nodeValue)}});E(L.childNodes,function(N){M.appendChild(N.cloneNode(true))});L.parentNode.replaceChild(M,L);return M}if(D&&I.element!="P"){G.onKeyPress.add(function(K,L){H.lastElm=K.selection.getNode().nodeName});G.onKeyUp.add(function(L,N){var P,M=L.selection,O=M.getNode(),K=L.getBody();if(K.childNodes.length===1&&O.nodeName=="P"){O=J(O,I.element);M.select(O);M.collapse();L.nodeChanged()}else{if(N.keyCode==13&&!N.shiftKey&&H.lastElm!="P"){P=L.dom.getParent(O,"P");if(P){J(P,I.element);L.nodeChanged()}}}})}},find:function(L,I,J){var H=this.editor,G=H.getDoc().createTreeWalker(L,4,null,false),K=-1;while(L=G.nextNode()){K++;if(I==0&&L==J){return K}if(I==1&&K==J){return L}}return -1},forceRoots:function(L,V){var M=this,L=M.editor,Z=L.getBody(),W=L.getDoc(),g=L.selection,N=g.getSel(),O=g.getRng(),a=-2,K,T,G,H,X=-16777215;var Y,I,f,S,P,J=Z.childNodes,R,Q;for(R=J.length-1;R>=0;R--){Y=J[R];if(Y.nodeType==3||(!M.dom.isBlock(Y)&&Y.nodeType!=8)){if(!I){if(Y.nodeType!=3||/[^\s]/g.test(Y.nodeValue)){if(a==-2&&O){if(!D){if(O.startContainer.nodeType==1&&(Q=O.startContainer.childNodes[O.startOffset])&&Q.nodeType==1){Q.setAttribute("id","__mce")}else{if(L.dom.getParent(O.startContainer,function(b){return b===Z})){T=O.startOffset;G=O.endOffset;a=M.find(Z,0,O.startContainer);K=M.find(Z,0,O.endContainer)}}}else{H=W.body.createTextRange();H.moveToElementText(Z);H.collapse(1);f=H.move("character",X)*-1;H=O.duplicate();H.collapse(1);S=H.move("character",X)*-1;H=O.duplicate();H.collapse(0);P=(H.move("character",X)*-1)-S;a=S-f;K=P}}I=L.dom.create(L.settings.forced_root_block);I.appendChild(Y.cloneNode(1));Y.parentNode.replaceChild(I,Y)}}else{if(I.hasChildNodes()){I.insertBefore(Y,I.firstChild)}else{I.appendChild(Y)}}}else{I=null}}if(a!=-2){if(!D){I=Z.getElementsByTagName(L.settings.element)[0];O=W.createRange();if(a!=-1){O.setStart(M.find(Z,1,a),T)}else{O.setStart(I,0)}if(K!=-1){O.setEnd(M.find(Z,1,K),G)}else{O.setEnd(I,0)}if(N){N.removeAllRanges();N.addRange(O)}}else{try{O=N.createRange();O.moveToElementText(Z);O.collapse(1);O.moveStart("character",a);O.moveEnd("character",K);O.select()}catch(U){}}}else{if(!D&&(Q=L.dom.get("__mce"))){Q.removeAttribute("id");O=W.createRange();O.setStartBefore(Q);O.setEndBefore(Q);g.setRng(O)}}},getParentBlock:function(H){var G=this.dom;return G.getParent(H,G.isBlock)},insertPara:function(j){var T=this,L=T.editor,f=L.dom,k=L.getDoc(),q=L.settings,V=L.selection.getSel(),W=V.getRangeAt(0),p=k.body;var Z,a,X,h,g,J,H,K,N,G,R,o,I,M,Y,c=f.getViewPort(L.getWin()),Q,S,P;function U(b){b=b.innerHTML;b=b.replace(/<(img|hr|table)/gi,"-");b=b.replace(/<[^>]+>/g,"");return b.replace(/[ \t\r\n]+/g,"")==""}Z=k.createRange();Z.setStart(V.anchorNode,V.anchorOffset);Z.collapse(true);a=k.createRange();a.setStart(V.focusNode,V.focusOffset);a.collapse(true);X=Z.compareBoundaryPoints(Z.START_TO_END,a)<0;h=X?V.anchorNode:V.focusNode;g=X?V.anchorOffset:V.focusOffset;J=X?V.focusNode:V.anchorNode;H=X?V.focusOffset:V.anchorOffset;if(h===J&&/^(TD|TH)$/.test(h.nodeName)){f.remove(h.firstChild);L.dom.add(h,q.element,null,"<br />");o=L.dom.add(h,q.element,null,"<br />");W=k.createRange();W.selectNodeContents(o);W.collapse(1);L.selection.setRng(W);return false}if(h==p&&J==p&&p.firstChild&&L.dom.isBlock(p.firstChild)){h=J=h.firstChild;g=H=0;Z=k.createRange();Z.setStart(h,0);a=k.createRange();a.setStart(J,0)}h=h.nodeName=="HTML"?k.body:h;h=h.nodeName=="BODY"?h.firstChild:h;J=J.nodeName=="HTML"?k.body:J;J=J.nodeName=="BODY"?J.firstChild:J;K=T.getParentBlock(h);N=T.getParentBlock(J);G=K?K.nodeName:q.element;if(T.dom.getParent(K,function(b){return/OL|UL|PRE/.test(b.nodeName)})){return true}if(K&&(K.nodeName=="CAPTION"||/absolute|relative|static/gi.test(K.style.position))){G=q.element;K=null}if(N&&(N.nodeName=="CAPTION"||/absolute|relative|static/gi.test(N.style.position))){G=q.element;N=null}if(/(TD|TABLE|TH|CAPTION)/.test(G)||(K&&G=="DIV"&&/left|right/gi.test(K.style.cssFloat))){G=q.element;K=N=null}R=(K&&K.nodeName==G)?K.cloneNode(0):L.dom.create(G);o=(N&&N.nodeName==G)?N.cloneNode(0):L.dom.create(G);o.removeAttribute("id");if(/^(H[1-6])$/.test(G)&&h.nodeValue&&g==h.nodeValue.length){o=L.dom.create(q.element)}Y=I=h;do{if(Y==p||Y.nodeType==9||T.dom.isBlock(Y)||/(TD|TABLE|TH|CAPTION)/.test(Y.nodeName)){break}I=Y}while((Y=Y.previousSibling?Y.previousSibling:Y.parentNode));Y=M=J;do{if(Y==p||Y.nodeType==9||T.dom.isBlock(Y)||/(TD|TABLE|TH|CAPTION)/.test(Y.nodeName)){break}M=Y}while((Y=Y.nextSibling?Y.nextSibling:Y.parentNode));if(I.nodeName==G){Z.setStart(I,0)}else{Z.setStartBefore(I)}Z.setEnd(h,g);R.appendChild(Z.cloneContents()||k.createTextNode(""));try{a.setEndAfter(M)}catch(i){}a.setStart(J,H);o.appendChild(a.cloneContents()||k.createTextNode(""));W=k.createRange();if(!I.previousSibling&&I.parentNode.nodeName==G){W.setStartBefore(I.parentNode)}else{if(Z.startContainer.nodeName==G&&Z.startOffset==0){W.setStartBefore(Z.startContainer)}else{W.setStart(Z.startContainer,Z.startOffset)}}if(!M.nextSibling&&M.parentNode.nodeName==G){W.setEndAfter(M.parentNode)}else{W.setEnd(a.endContainer,a.endOffset)}W.deleteContents();if(C){L.getWin().scrollTo(0,c.y)}if(R.firstChild&&R.firstChild.nodeName==G){R.innerHTML=R.firstChild.innerHTML}if(o.firstChild&&o.firstChild.nodeName==G){o.innerHTML=o.firstChild.innerHTML}if(U(R)){R.innerHTML="<br />"}function m(s,d){var b=[],u,t,r;s.innerHTML="";if(q.keep_styles){t=d;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){u=t.cloneNode(false);f.setAttrib(u,"id","");b.push(u)}}while(t=t.parentNode)}if(b.length>0){for(r=b.length-1,u=s;r>=0;r--){u=u.appendChild(b[r])}b[0].innerHTML=C?" ":"<br />";return b[0]}else{s.innerHTML=C?" ":"<br />"}}if(U(o)){P=m(o,J)}if(C&&parseFloat(opera.version())<9.5){W.insertNode(R);W.insertNode(o)}else{W.insertNode(o);W.insertNode(R)}o.normalize();R.normalize();function O(b){return k.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,false).nextNode()||b}W=k.createRange();W.selectNodeContents(A?O(P||o):P||o);W.collapse(1);V.removeAllRanges();V.addRange(W);Q=L.dom.getPos(o).y;S=o.clientHeight;if(Q<c.y||Q+S>c.y+c.h){L.getWin().scrollTo(0,Q<c.y?Q:Q-c.h+25)}return false},backspaceDelete:function(J,P){var R=this,I=R.editor,M=I.getBody(),H,K=I.selection,G=K.getRng(),L=G.startContainer,H,N,O;if(L&&I.dom.isBlock(L)&&!/^(TD|TH)$/.test(L.nodeName)&&P){if(L.childNodes.length==0||(L.childNodes.length==1&&L.firstChild.nodeName=="BR")){H=L;while((H=H.previousSibling)&&!I.dom.isBlock(H)){}if(H){if(L!=M.firstChild){N=I.dom.doc.createTreeWalker(H,NodeFilter.SHOW_TEXT,null,false);while(O=N.nextNode()){H=O}G=I.getDoc().createRange();G.setStart(H,H.nodeValue?H.nodeValue.length:0);G.setEnd(H,H.nodeValue?H.nodeValue.length:0);K.setRng(G);I.dom.remove(L)}return B.cancel(J)}}}function Q(S){var T;S=S.target;if(S&&S.parentNode&&S.nodeName=="BR"&&(H=R.getParentBlock(S))){T=S.previousSibling;B.remove(M,"DOMNodeInserted",Q);if(T&&T.nodeType==3&&/\s+$/.test(T.nodeValue)){return }if(S.previousSibling||S.nextSibling){I.dom.remove(S)}}}B._add(M,"DOMNodeInserted",Q);window.setTimeout(function(){B._remove(M,"DOMNodeInserted",Q)},1)}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each,D=tinymce.extend;tinymce.create("tinymce.ControlManager",{ControlManager:function(E,H){var G=this,F;H=H||{};G.editor=E;G.controls={};G.onAdd=new tinymce.util.Dispatcher(G);G.onPostRender=new tinymce.util.Dispatcher(G);G.prefix=H.prefix||E.id+"_";G._cls={};G.onPostRender.add(function(){C(G.controls,function(I){I.postRender()})})},get:function(E){return this.controls[this.prefix+E]||this.controls[E]},setActive:function(G,E){var F=null;if(F=this.get(G)){F.setActive(E)}return F},setDisabled:function(G,E){var F=null;if(F=this.get(G)){F.setDisabled(E)}return F},add:function(F){var E=this;if(F){E.controls[F.id]=F;E.onAdd.dispatch(F,E)}return F},createControl:function(H){var G,F=this,E=F.editor;C(E.plugins,function(I){if(I.createControl){G=I.createControl(H,F);if(G){return false}}});switch(H){case"|":case"separator":return F.createSeparator()}if(!G&&E.buttons&&(G=E.buttons[H])){return F.createButton(H,G)}return F.add(G)},createDropMenu:function(E,M,G){var L=this,H=L.editor,I,F,J,K;M=D({"class":"mceDropDown",constrain:H.settings.constrain_menus},M);M["class"]=M["class"]+" "+H.getParam("skin")+"Skin";if(J=H.getParam("skin_variant")){M["class"]+=" "+H.getParam("skin")+"Skin"+J.substring(0,1).toUpperCase()+J.substring(1)}E=L.prefix+E;K=G||L._cls.dropmenu||tinymce.ui.DropMenu;I=L.controls[E]=new K(E,M);I.onAddItem.add(function(P,O){var N=O.settings;N.title=H.getLang(N.title,N.title);if(!N.onclick){N.onclick=function(Q){H.execCommand(N.cmd,N.ui||false,N.value)}}});H.onRemove.add(function(){I.destroy()});if(tinymce.isIE){I.onShowMenu.add(function(){F=H.selection.getBookmark(1)});I.onHideMenu.add(function(){if(F){H.selection.moveToBookmark(F)}})}return L.add(I)},createListBox:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;if(F.settings.use_native_selects){J=new tinymce.ui.NativeListBox(L,H)}else{E=K||G._cls.listbox||tinymce.ui.ListBox;J=new E(L,H)}G.controls[L]=J;if(tinymce.isWebKit){J.onPostRender.add(function(N,M){A.add(M,"mousedown",function(){F.bookmark=F.selection.getBookmark("simple")});A.add(M,"focus",function(){F.selection.moveToBookmark(F.bookmark);F.bookmark=null})})}if(J.hideMenu){F.onMouseDown.add(J.hideMenu,J)}return G.add(J)},createButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.label=F.translate(H.label);H.scope=H.scope||F;if(!H.onclick&&!H.menu_button){H.onclick=function(){F.execCommand(H.cmd,H.ui||false,H.value)}}H=D({title:H.title,"class":"mce_"+L,unavailable_prefix:F.getLang("unavailable",""),scope:H.scope,control_manager:G},H);L=G.prefix+L;if(H.menu_button){E=K||G._cls.menubutton||tinymce.ui.MenuButton;J=new E(L,H);F.onMouseDown.add(J.hideMenu,J)}else{E=G._cls.button||tinymce.ui.Button;J=new E(L,H)}return G.add(J)},createMenuButton:function(G,E,F){E=E||{};E.menu_button=1;return this.createButton(G,E,F)},createSplitButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onclick){H.onclick=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;E=K||G._cls.splitbutton||tinymce.ui.SplitButton;J=G.add(new E(L,H));F.onMouseDown.add(J.hideMenu,J);return J},createColorSplitButton:function(E,M,G){var K=this,I=K.editor,H,J,L,F;if(K.get(E)){return null}M.title=I.translate(M.title);M.scope=M.scope||I;if(!M.onclick){M.onclick=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}if(!M.onselect){M.onselect=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}M=D({title:M.title,"class":"mce_"+E,menu_class:I.getParam("skin")+"Skin",scope:M.scope,more_colors_title:I.getLang("more_colors")},M);E=K.prefix+E;L=G||K._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;J=new L(E,M);I.onMouseDown.add(J.hideMenu,J);I.onRemove.add(function(){J.destroy()});if(tinymce.isIE){J.onShowMenu.add(function(){F=I.selection.getBookmark(1)});J.onHideMenu.add(function(){if(F){I.selection.moveToBookmark(F);F=0}})}return K.add(J)},createToolbar:function(J,G,I){var H,F=this,E;J=F.prefix+J;E=I||F._cls.toolbar||tinymce.ui.Toolbar;H=new E(J,G);if(F.get(J)){return null}return F.add(H)},createSeparator:function(F){var E=F||this._cls.separator||tinymce.ui.Separator;return new E()},setControlType:function(F,E){return this._cls[F.toLowerCase()]=E},destroy:function(){C(this.controls,function(E){E.destroy()});this.controls=null}})})();(function(){var A=tinymce.util.Dispatcher,D=tinymce.each,C=tinymce.isIE,B=tinymce.isOpera;tinymce.create("tinymce.WindowManager",{WindowManager:function(E){var F=this;F.editor=E;F.onOpen=new A(F);F.onClose=new A(F);F.params={};F.features={}},open:function(Q,F){var P=this,I="",L,K,G=P.editor.settings.dialog_type=="modal",N,M,H,E=tinymce.DOM.getViewPort(),O;Q=Q||{};F=F||{};M=B?E.w:screen.width;H=B?E.h:screen.height;Q.name=Q.name||"mc_"+new Date().getTime();Q.width=parseInt(Q.width||320);Q.height=parseInt(Q.height||240);Q.resizable=true;Q.left=Q.left||parseInt(M/2)-(Q.width/2);Q.top=Q.top||parseInt(H/2)-(Q.height/2);F.inline=false;F.mce_width=Q.width;F.mce_height=Q.height;F.mce_auto_focus=Q.auto_focus;if(G){if(C){Q.center=true;Q.help=false;Q.dialogWidth=Q.width+"px";Q.dialogHeight=Q.height+"px";Q.scroll=Q.scrollbars||false}}D(Q,function(S,R){if(tinymce.is(S,"boolean")){S=S?"yes":"no"}if(!/^(name|url)$/.test(R)){if(C&&G){I+=(I?";":"")+R+":"+S}else{I+=(I?",":"")+R+"="+S}}});P.features=Q;P.params=F;P.onOpen.dispatch(P,Q,F);O=Q.url||Q.file;if(tinymce.relaxedDomain){O+=(O.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}O=tinymce._addVer(O);try{if(C&&G){N=1;window.showModalDialog(O,window,I)}else{N=window.open(O,Q.name,I)}}catch(J){}if(!N){alert(P.editor.getLang("popup_blocked"))}},close:function(E){E.close();this.onClose.dispatch(this)},createInstance:function(G,F,E,K,J,I){var H=tinymce.resolve(G);return new H(F,E,K,J,I)},confirm:function(G,E,H,F){F=F||window;E.call(H||this,F.confirm(this._decode(this.editor.getLang(G,G))))},alert:function(G,E,I,F){var H=this;F=F||window;F.alert(H._decode(H.editor.getLang(G,G)));if(E){E.call(I||H)}},_decode:function(E){return tinymce.DOM.decode(E).replace(/\\n/g,"\n")}})}());
\ No newline at end of file
tinyMCE = w.tinyMCE;\r
t.editor = tinymce.EditorManager.activeEditor;\r
t.params = t.editor.windowManager.params;\r
+ t.features = t.editor.windowManager.features;\r
\r
// Setup local DOM\r
t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);\r
- t.dom.loadCSS(t.editor.settings.popup_css);\r
+\r
+ // Enables you to skip loading the default css\r
+ if (t.features.popup_css !== false)\r
+ t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css);\r
\r
// Setup on init listeners\r
t.listeners = [];\r
this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);\r
},\r
\r
+ confirm : function(t, cb, s) {\r
+ this.editor.windowManager.confirm(t, cb, s, window);\r
+ },\r
+\r
+ alert : function(tx, cb, s) {\r
+ this.editor.windowManager.alert(tx, cb, s, window);\r
+ },\r
+\r
close : function() {\r
var t = this;\r
\r
},*/\r
\r
_onDOMLoaded : function() {\r
- var t = this, ti = document.title, bm, h;\r
+ var t = this, ti = document.title, bm, h, nv;\r
\r
// Translate page\r
- h = document.body.innerHTML;\r
+ if (t.features.translate_i18n !== false) {\r
+ h = document.body.innerHTML;\r
\r
- // Replace a=x with a="x" in IE\r
- if (tinymce.isIE)\r
- h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')\r
+ // Replace a=x with a="x" in IE\r
+ if (tinymce.isIE)\r
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')\r
+\r
+ document.dir = t.editor.getParam('directionality','');\r
+\r
+ if ((nv = t.editor.translate(h)) && nv != h)\r
+ document.body.innerHTML = nv;\r
+\r
+ if ((nv = t.editor.translate(ti)) && nv != ti)\r
+ document.title = ti = nv;\r
+ }\r
\r
- document.dir = t.editor.getParam('directionality','');\r
- document.body.innerHTML = t.editor.translate(h);\r
- document.title = ti = t.editor.translate(ti);\r
document.body.style.display = '';\r
\r
// Restore selection in IE when focus is placed on a non textarea or input element of the type text\r
\r
var tinymce = {\r
majorVersion : '3',\r
- minorVersion : '0.9',\r
- releaseDate : '2008-06-02',\r
+ minorVersion : '2.0.1',\r
+ releaseDate : '2008-09-17',\r
\r
_init : function() {\r
var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;\r
t.isIE6 = t.isIE && /MSIE [56]/.test(ua);\r
t.isGecko = !t.isWebKit && /Gecko/.test(ua);\r
t.isMac = ua.indexOf('Mac') != -1;\r
+ t.isAir = /adobeair/i.test(ua);\r
\r
// TinyMCE .NET webcontrol might be setting the values for TinyMCE\r
if (w.tinyMCEPreInit) {\r
u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;\r
\r
// Relative path\r
- if (u.indexOf('://') === -1 && u.indexOf('//') !== 0)\r
+ if (u.indexOf(':/') === -1 && u.indexOf('//') !== 0)\r
u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);\r
\r
// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)\r
toRelative : function(u) {\r
var t = this, o;\r
\r
+ if (u === "./")\r
+ return u;\r
+\r
u = new tinymce.util.URI(u, {base_uri : t});\r
\r
// Not on same domain/port or protocol\r
},\r
\r
toRelPath : function(base, path) {\r
- var items, bp = 0, out = '', i;\r
+ var items, bp = 0, out = '', i, l;\r
\r
// Split the paths\r
base = base.substring(0, base.lastIndexOf('/'));\r
items = path.split('/');\r
\r
if (base.length >= items.length) {\r
- for (i = 0; i < base.length; i++) {\r
+ for (i = 0, l = base.length; i < l; i++) {\r
if (i >= items.length || base[i] != items[i]) {\r
bp = i + 1;\r
break;\r
}\r
\r
if (base.length < items.length) {\r
- for (i = 0; i < items.length; i++) {\r
+ for (i = 0, l = items.length; i < l; i++) {\r
if (i >= base.length || base[i] != items[i]) {\r
bp = i + 1;\r
break;\r
if (bp == 1)\r
return path;\r
\r
- for (i = 0; i < base.length - (bp - 1); i++)\r
+ for (i = 0, l = base.length - (bp - 1); i < l; i++)\r
out += "../";\r
\r
- for (i = bp - 1; i < items.length; i++) {\r
+ for (i = bp - 1, l = items.length; i < l; i++) {\r
if (i != bp - 1)\r
out += "/" + items[i];\r
else\r
if (t == 'string') {\r
v = '\bb\tt\nn\ff\rr\""\'\'\\\\';\r
\r
- return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g, function(a, b) {\r
+ return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {\r
i = v.indexOf(b);\r
\r
if (i + 1)\r
idPattern : /^#[\w]+$/,\r
elmPattern : /^[\w_*]+$/,\r
elmClassPattern : /^([\w_]*)\.([\w_]+)$/,\r
+ props : {\r
+ "for" : "htmlFor",\r
+ "class" : "className",\r
+ className : "className",\r
+ checked : "checked",\r
+ disabled : "disabled",\r
+ maxlength : "maxLength",\r
+ readonly : "readOnly",\r
+ selected : "selected",\r
+ value : "value"\r
+ },\r
\r
DOMUtils : function(d, s) {\r
var t = this;\r
},\r
\r
getRect : function(e) {\r
- var p, t = this, w, h;\r
+ var p, t = this, sr;\r
\r
e = t.get(e);\r
p = t.getPos(e);\r
+ sr = t.getSize(e);\r
+\r
+ return {\r
+ x : p.x,\r
+ y : p.y,\r
+ w : sr.w,\r
+ h : sr.h\r
+ };\r
+ },\r
+\r
+ getSize : function(e) {\r
+ var t = this, w, h;\r
+\r
+ e = t.get(e);\r
w = t.getStyle(e, 'width');\r
h = t.getStyle(e, 'height');\r
\r
h = 0;\r
\r
return {\r
- x : p.x,\r
- y : p.y,\r
w : parseInt(w) || e.offsetWidth || e.clientWidth,\r
h : parseInt(h) || e.offsetHeight || e.clientHeight\r
};\r
// #if !jquery\r
\r
select : function(pa, s) {\r
- var t = this, cs, c, pl, o = [], x, i, l, n;\r
+ var t = this, cs, c, pl, o = [], x, i, l, n, xp;\r
\r
s = t.get(s) || t.doc;\r
\r
return l;\r
}\r
\r
+ if (!t.selectorRe)\r
+ t.selectorRe = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i;;\r
+\r
+ // Air doesn't support eval due to security sandboxing and querySelectorAll isn't supported yet\r
+ if (tinymce.isAir) {\r
+ each(tinymce.explode(pa), function(v) {\r
+ if (!(xp = t.cache[v])) {\r
+ xp = '';\r
+\r
+ each(v.split(' '), function(v) {\r
+ v = t.selectorRe.exec(v);\r
+\r
+ xp += v[1] ? '//' + v[1] : '//*';\r
+\r
+ // Id\r
+ if (v[2])\r
+ xp += "[@id='" + v[2] + "']";\r
+\r
+ // Class\r
+ if (v[3]) {\r
+ each(v[3].split('.'), function(n) {\r
+ xp += "[@class = '" + n + "' or contains(concat(' ', @class, ' '), ' " + n + " ')]";\r
+ });\r
+ }\r
+ });\r
+\r
+ t.cache[v] = xp;\r
+ }\r
+\r
+ xp = t.doc.evaluate(xp, s, null, 4, null);\r
+\r
+ while (n = xp.iterateNext())\r
+ o.push(n);\r
+ });\r
+\r
+ return o;\r
+ }\r
+\r
if (t.settings.strict) {\r
function get(s, n) {\r
return s.getElementsByTagName(n.toLowerCase());\r
pl = v.split(' ');\r
\r
each(pl, function(v) {\r
- var p = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);\r
+ var p = t.selectorRe.exec(v);\r
\r
// Find elements\r
p[1] = p[1] || '*';\r
var e, k;\r
\r
e = is(n, 'string') ? t.doc.createElement(n) : n;\r
-\r
- if (a) {\r
- for (k in a) {\r
- if (a.hasOwnProperty(k) && !is(a[k], 'object'))\r
- t.setAttrib(e, k, '' + a[k]);\r
- }\r
-\r
- if (a.style && !is(a.style, 'string')) {\r
- each(a.style, function(v, n) {\r
- t.setStyle(e, n, v);\r
- });\r
- }\r
- }\r
+ t.setAttribs(e, a);\r
\r
if (h) {\r
if (h.nodeType)\r
setAttrib : function(e, n, v) {\r
var t = this;\r
\r
+ // Whats the point\r
+ if (!e || !n)\r
+ return;\r
+\r
// Strict XML mode\r
if (t.settings.strict)\r
n = n.toLowerCase();\r
\r
switch (n) {\r
case "style":\r
+ if (!is(v, 'string')) {\r
+ each(v, function(v, n) {\r
+ t.setStyle(e, n, v);\r
+ });\r
+\r
+ return;\r
+ }\r
+\r
// No mce_style for elements with these since they might get resized by the user\r
if (s.keep_values) {\r
if (v && !t._isRes(v))\r
}\r
\r
break;\r
+ \r
+ case "shape":\r
+ e.setAttribute('mce_style', v);\r
+ break;\r
}\r
\r
if (is(v) && v !== null && v.length !== 0)\r
return false;\r
\r
if (!is(dv))\r
- dv = "";\r
+ dv = '';\r
\r
// Try the mce variant for these\r
- if (/^(src|href|style|coords)$/.test(n)) {\r
+ if (/^(src|href|style|coords|shape)$/.test(n)) {\r
v = e.getAttribute("mce_" + n);\r
\r
if (v)\r
return v;\r
}\r
\r
- v = e.getAttribute(n, 2);\r
-\r
- if (!v) {\r
- switch (n) {\r
- case 'class':\r
- v = e.className;\r
- break;\r
-\r
- default:\r
- // Fix for IE crash Bug: #1884376 probably due to invalid DOM structure\r
- if (isIE && n === 'name' && e.nodeName === 'A') {\r
- v = e.name;\r
- break;\r
- }\r
-\r
- v = e.attributes[n];\r
- v = v && is(v.nodeValue) ? v.nodeValue : v;\r
- }\r
+ if (isIE && t.props[n]) {\r
+ v = e[t.props[n]];\r
+ v = v && v.nodeValue ? v.nodeValue : v;\r
}\r
\r
- switch (n) {\r
- case 'style':\r
- v = v || e.style.cssText;\r
+ if (!v)\r
+ v = e.getAttribute(n, 2);\r
\r
- if (v) {\r
- v = t.serializeStyle(t.parseStyle(v));\r
+ if (n === 'style') {\r
+ v = v || e.style.cssText;\r
\r
- if (t.settings.keep_values && !t._isRes(v))\r
- e.setAttribute('mce_style', v);\r
- }\r
+ if (v) {\r
+ v = t.serializeStyle(t.parseStyle(v));\r
\r
- break;\r
+ if (t.settings.keep_values && !t._isRes(v))\r
+ e.setAttribute('mce_style', v);\r
+ }\r
}\r
\r
// Remove Apple and WebKit stuff\r
\r
case 'size':\r
// IE returns +0 as default value for size\r
- if (v === '+0')\r
+ if (v === '+0' || v === 20)\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'width':\r
+ case 'height':\r
+ case 'vspace':\r
+ if (v === 0)\r
v = '';\r
\r
break;\r
\r
break;\r
\r
+ case 'maxlength':\r
case 'tabindex':\r
- // IE returns 32768 as default value\r
- if (v === 32768)\r
+ // IE returns default value\r
+ if (v === 32768 || v === 2147483647)\r
v = '';\r
\r
break;\r
\r
+ case 'compact':\r
+ case 'noshade':\r
+ if (v === 65535)\r
+ return n;\r
+\r
+ return dv;\r
+\r
case 'shape':\r
v = v.toLowerCase();\r
break;\r
}\r
}\r
\r
- return (v && v != '') ? '' + v : dv;\r
+ return (v !== undefined && v !== null && v !== '') ? '' + v : dv;\r
},\r
\r
getPos : function(n) {\r
delete o[c];\r
};\r
\r
+ st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities\r
+\r
each(st.split(';'), function(v) {\r
var sv, ur = [];\r
\r
if (v) {\r
+ v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities\r
v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});\r
v = v.split(':');\r
sv = tinymce.trim(v[1]);\r
\r
if (s.url_converter) {\r
sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {\r
- return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null)) + ')';\r
+ return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')';\r
});\r
}\r
\r
\r
each(o, function(v, k) {\r
if (k && v) {\r
+ if (tinymce.isGecko && k.indexOf('-moz-') === 0)\r
+ return;\r
+\r
switch (k) {\r
case 'color':\r
case 'background-color':\r
\r
// Store away src and href in mce_src and mce_href since browsers mess them up\r
if (s.keep_values) {\r
- // Wrap scripts in comments for serialization purposes\r
- if (h.indexOf('<script') !== -1) {\r
- h = h.replace(/<script>/g, '<script type="text/javascript">');\r
- h = h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g, '<mce:script$1><!--\n');\r
- h = h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g, '\n// --></mce:script>');\r
- h = h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g, '<mce:script$1></mce:script>');\r
+ h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');\r
+\r
+ // Wrap scripts and styles in comments for serialization purposes\r
+ if (/<script|style/.test(h)) {\r
+ function trim(s) {\r
+ // Remove prefix and suffix code for element\r
+ s = s.replace(/^[\r\n]*|[\r\n]*$/g, '');\r
+ s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<\[CDATA\[|<!--|<\[CDATA\[)[\r\n]*/g, '');\r
+ s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->)\s*$/g, '');\r
+\r
+ return s;\r
+ };\r
+\r
+ // Preserve script elements\r
+ h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g, function(v, a, b) {\r
+ // Remove prefix and suffix code for script element\r
+ b = trim(b);\r
+\r
+ // Force type attribute\r
+ if (!a)\r
+ a = ' type="text/javascript"';\r
+\r
+ // Wrap contents in a comment\r
+ if (b)\r
+ b = '<!--\n' + b + '\n// -->';\r
+\r
+ // Output fake element\r
+ return '<mce:script' + a + '>' + b + '</mce:script>';\r
+ });\r
+\r
+ // Preserve style elements\r
+ h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g, function(v, a, b) {\r
+ b = trim(b);\r
+ return '<mce:style' + a + '><!--\n' + b + '\n--></mce:style><style' + a + ' mce_bogus="1">' + b + '</style>';\r
+ });\r
}\r
\r
// Process all tags with src, href or style\r
- h = h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi, function(a, n) {\r
+ h = h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi, function(a, n) {\r
function handle(m, b, c) {\r
var u = c;\r
\r
return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)) + ')';\r
});\r
}\r
- } else if (b != 'coords') {\r
+ } else if (b != 'coords' && b != 'shape') {\r
if (s.url_converter)\r
u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n));\r
}\r
return ' ' + b + '="' + c + '" mce_' + b + '="' + u + '"';\r
};\r
\r
- a = a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi, handle); // W3C\r
- a = a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi, handle); // W3C\r
+ a = a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi, handle); // W3C\r
+ a = a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi, handle); // W3C\r
\r
- return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi, handle); // IE\r
+ return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi, handle); // IE\r
});\r
}\r
\r
\r
n = n.nodeName || n;\r
\r
- return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);\r
+ return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);\r
},\r
\r
// #if !jquery\r
var t = this, o;\r
\r
if (t.doc && typeof(e) === 'string')\r
- e = t.doc.getElementById(e);\r
+ e = t.get(e);\r
\r
if (!e)\r
return false;\r
t.win = win;\r
t.serializer = serializer;\r
\r
+ // Add events\r
+ each([\r
+ 'onBeforeSetContent',\r
+ 'onBeforeGetContent',\r
+ 'onSetContent',\r
+ 'onGetContent'\r
+ ], function(e) {\r
+ t[e] = new tinymce.util.Dispatcher(t);\r
+ });\r
+\r
// Prevent leaks\r
tinymce.addUnload(t.destroy, t);\r
},\r
wb = wa = '';\r
s.get = true;\r
s.format = s.format || 'html';\r
+ t.onBeforeGetContent.dispatch(t, s);\r
\r
if (s.format == 'text')\r
return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));\r
\r
s.getInner = true;\r
\r
- return t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;\r
+ s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;\r
+ t.onGetContent.dispatch(t, s);\r
+\r
+ return s.content;\r
},\r
\r
setContent : function(h, s) {\r
- var t = this, r = t.getRng(), d = t.win.document;\r
+ var t = this, r = t.getRng(), c, d = t.win.document;\r
\r
s = s || {format : 'html'};\r
s.set = true;\r
- h = t.dom.processHTML(h);\r
+ h = s.content = t.dom.processHTML(h);\r
+\r
+ // Dispatch before set content event\r
+ t.onBeforeSetContent.dispatch(t, s);\r
+ h = s.content;\r
\r
if (r.insertNode) {\r
- // Gecko has a bug where if you insert using InsertHTML it will insert a space instead\r
- // So we simply check if the input is HTML or text and then insert text using the insertNode method\r
- if (tinymce.isGecko && h.indexOf('<') == -1) {\r
- r.deleteContents();\r
- r.insertNode(t.getRng().createContextualFragment(h + '<span id="__caret">_</span>'));\r
- t.select(t.dom.get('__caret'));\r
- t.getRng().deleteContents();\r
- return;\r
- }\r
+ // Make caret marker since insertNode places the caret in the beginning of text after insert\r
+ h += '<span id="__caret">_</span>';\r
\r
- // Use insert HTML if it exists (places cursor after content)\r
- try {\r
- // This might fail with an exception see bug #1893736\r
- if (d.queryCommandEnabled('InsertHTML'))\r
- return d.execCommand('InsertHTML', false, h);\r
- } catch (ex) {\r
- // Use old school method\r
- r.deleteContents();\r
- r.insertNode(t.getRng().createContextualFragment(h));\r
- }\r
+ // Delete and insert new node\r
+ r.deleteContents();\r
+ r.insertNode(t.getRng().createContextualFragment(h));\r
+\r
+ // Move to caret marker\r
+ c = t.dom.get('__caret');\r
+\r
+ // Make sure we wrap it compleatly, Opera fails with a simple select call\r
+ r = d.createRange();\r
+ r.setStartBefore(c);\r
+ r.setEndAfter(c);\r
+ t.setRng(r);\r
+\r
+ // Delete the marker, and hopefully the caret gets placed in the right location\r
+ d.execCommand('Delete', false, null);\r
+\r
+ // In case it's still there\r
+ t.dom.remove('__caret');\r
} else {\r
if (r.item) {\r
// Delete content and get caret text selection\r
\r
r.pasteHTML(h);\r
}\r
+\r
+ // Dispatch set content event\r
+ t.onSetContent.dispatch(t, s);\r
},\r
\r
getStart : function() {\r
if (!r || r.item)\r
return false;\r
\r
- return !s || r.boundingWidth == 0 || s.isCollapsed;\r
+ return !s || r.boundingWidth == 0 || r.collapsed;\r
},\r
\r
collapse : function(b) {\r
\r
// Handle selection a image or other control like element such as anchors\r
if (!r.collapsed) {\r
- if (r.startContainer == r.endContainer || (tinymce.isWebKit && r.startContainer == r.endContainer.parentNode)) {\r
- if (r.startOffset - r.endOffset < 2 || tinymce.isWebKit) {\r
+ // If the anchor node is a element instead of a text node then return this element\r
+ if (tinymce.isWebKit && s.anchorNode && s.anchorNode.nodeType == 1) \r
+ return s.anchorNode.childNodes[s.anchorOffset]; \r
+\r
+ if (r.startContainer == r.endContainer) {\r
+ if (r.startOffset - r.endOffset < 2) {\r
if (r.startContainer.hasChildNodes())\r
e = r.startContainer.childNodes[r.startOffset];\r
}\r
},\r
\r
writeComment : function(v) {\r
+ // Fix for bug #2035694\r
+ if (tinymce.isIE)\r
+ v = v.replace(/^\-|\-$/g, ' ');\r
+\r
this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));\r
},\r
\r
indent_mode : 'simple',\r
indent_char : '\t',\r
indent_levels : 1,\r
- remove_linebreaks : 1\r
+ remove_linebreaks : 1,\r
+ remove_redundant_brs : 1,\r
+ element_format : 'xhtml'\r
}, s);\r
\r
t.dom = s.dom;\r
\r
+ if (s.remove_redundant_brs) {\r
+ t.onPostProcess.add(function(se, o) {\r
+ // Remove BR elements at end of list elements since they get rendered in IE\r
+ o.content = o.content.replace(/<br \/>(\s*<\/li>)/g, '$1');\r
+ });\r
+ }\r
+\r
+ // Remove XHTML element endings i.e. produce crap :) XHTML is better\r
+ if (s.element_format == 'html') {\r
+ t.onPostProcess.add(function(se, o) {\r
+ o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>');\r
+ });\r
+ }\r
+\r
if (s.fix_list_elements) {\r
t.onPreProcess.add(function(se, o) {\r
var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;\r
patterns : [\r
{pattern : /(<script[^>]*>)(.*?)(<\/script>)/g},\r
{pattern : /(<style[^>]*>)(.*?)(<\/style>)/g},\r
- {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1}\r
+ {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1},\r
+ {pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g}\r
]\r
});\r
\r
\r
h = t._unprotect(h, p);\r
\r
+ // Restore CDATA sections\r
+ h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');\r
+\r
// Restore the \u00a0 character if raw mode is enabled\r
if (s.entity_encoding == 'raw')\r
h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>');\r
}\r
\r
// Padd empty nodes with a \r
- if (!hc && ru.padd)\r
- w.writeText('\u00a0');\r
+ if (ru.padd) {\r
+ // If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug\r
+ if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) {\r
+ if (cn.hasAttribute ? cn.hasAttribute('mce_bogus') : cn.getAttribute('mce_bogus'))\r
+ w.writeText('\u00a0');\r
+ } else if (!hc)\r
+ w.writeText('\u00a0'); // No children then padd it\r
+ }\r
\r
break;\r
\r
t.classPrefix = 'mceListBox';\r
},\r
\r
- select : function(v) {\r
- var t = this, e, fv;\r
+ select : function(va) {\r
+ var t = this, fv, f;\r
\r
- // Do we need to do something?\r
- if (v != t.selectedValue) {\r
- e = DOM.get(t.id + '_text');\r
- t.selectedValue = v;\r
+ if (va == undefined)\r
+ return;\r
\r
+ // Is string or number make function selector\r
+ if (va && va.call)\r
+ f = va;\r
+ else {\r
+ f = function(v) {\r
+ return v == va;\r
+ };\r
+ }\r
+\r
+ // Do we need to do something?\r
+ if (va != t.selectedValue) {\r
// Find item\r
- each(t.items, function(o) {\r
- if (o.value == v) {\r
- DOM.setHTML(e, DOM.encode(o.title));\r
+ each(t.items, function(o, i) {\r
+ if (f(o.value)) {\r
fv = 1;\r
+ t.selectByIndex(i);\r
return false;\r
}\r
});\r
\r
- // If no item was found then present title\r
- if (!fv) {\r
+ if (!fv)\r
+ t.selectByIndex(-1);\r
+ }\r
+ },\r
+\r
+ selectByIndex : function(idx) {\r
+ var t = this, e, o;\r
+\r
+ if (idx != t.selectedIndex) {\r
+ e = DOM.get(t.id + '_text');\r
+ o = t.items[idx];\r
+\r
+ if (o) {\r
+ t.selectedValue = o.value;\r
+ t.selectedIndex = idx;\r
+ DOM.setHTML(e, DOM.encode(o.title));\r
+ DOM.removeClass(e, 'mceTitle');\r
+ } else {\r
DOM.setHTML(e, DOM.encode(t.settings.title));\r
DOM.addClass(e, 'mceTitle');\r
- e = 0;\r
- return;\r
- } else\r
- DOM.removeClass(e, 'mceTitle');\r
- }\r
+ t.selectedValue = t.selectedIndex = null;\r
+ }\r
\r
- e = 0;\r
+ e = 0;\r
+ } else\r
+ t.selectedValue = t.selectedIndex = null;\r
},\r
\r
add : function(n, v, o) {\r
\r
m.add({\r
title : t.settings.title,\r
- 'class' : 'mceMenuItemTitle'\r
- }).setDisabled(1);\r
+ 'class' : 'mceMenuItemTitle',\r
+ onclick : function() {\r
+ if (t.settings.onselect('') !== false)\r
+ t.select(''); // Must be runned after\r
+ }\r
+ });\r
\r
each(t.items, function(o) {\r
o.id = DOM.uniqueId();\r
return DOM.get(this.id).disabled;\r
},\r
\r
- select : function(v) {\r
- var e = DOM.get(this.id), ol = e.options;\r
+ select : function(va) {\r
+ var t = this, fv, f;\r
\r
- v = '' + (v || '');\r
+ if (va == undefined)\r
+ return;\r
\r
- e.selectedIndex = 0;\r
- each(ol, function(o, i) {\r
- if (o.value == v) {\r
- e.selectedIndex = i;\r
- return false;\r
- }\r
- });\r
+ // Is string or number make function selector\r
+ if (va && va.call)\r
+ f = va;\r
+ else {\r
+ f = function(v) {\r
+ return v == va;\r
+ };\r
+ }\r
+\r
+ // Do we need to do something?\r
+ if (va != t.selectedValue) {\r
+ // Find item\r
+ each(t.items, function(o, i) {\r
+ if (f(o.value)) {\r
+ fv = 1;\r
+ t.selectByIndex(i);\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (!fv)\r
+ t.selectByIndex(-1);\r
+ }\r
+ },\r
+\r
+ selectByIndex : function(idx) {\r
+ DOM.get(this.id).selectedIndex = idx + 1;\r
+ this.selectedValue = this.items[idx] ? this.items[idx].value : null;\r
},\r
\r
add : function(n, v, a) {\r
t.rendered = true;\r
\r
function onChange(e) {\r
- var v = e.target.options[e.target.selectedIndex].value;\r
+ var v = t.items[e.target.selectedIndex - 1];\r
\r
- t.onChange.dispatch(t, v);\r
+ if (v = v.value) {\r
+ t.onChange.dispatch(t, v);\r
\r
- if (t.settings.onselect)\r
- t.settings.onselect(v);\r
+ if (t.settings.onselect)\r
+ t.settings.onselect(v);\r
+ }\r
};\r
\r
Event.add(t.id, 'change', onChange);\r
},\r
\r
requireLangPack : function(n) {\r
- var u, s;\r
+ var u, s = tinymce.EditorManager.settings;\r
\r
- if (tinymce.EditorManager.settings) {\r
+ if (s && s.language) {\r
l = tinyMCE.settings['language'];\r
- u = tinyMCE.settings['document_base_url'] + '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=0&context=' + this.urls[n]; \r
- s = tinymce.EditorManager.settings;\r
+ u = tinyMCE.settings['document_base_url'] + '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=0&context=' + this.urls[n];\r
\r
- if (s) {\r
- if (!tinymce.dom.Event.domLoaded && !s.strict_mode)\r
- tinymce.ScriptLoader.load(u);\r
- else\r
- tinymce.ScriptLoader.add(u);\r
- }\r
+ if (!tinymce.dom.Event.domLoaded && !s.strict_mode)\r
+ tinymce.ScriptLoader.load(u);\r
+ else\r
+ tinymce.ScriptLoader.add(u);\r
}\r
},\r
\r
tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);\r
tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL);\r
\r
- // Setup document domain\r
- if (tinymce.EditorManager.baseURI.host != lo.hostname && lo.hostname)\r
+ // User already specified a document.domain value\r
+ if (document.domain && lo.hostname != document.domain)\r
+ tinymce.relaxedDomain = document.domain;\r
+\r
+ // Setup document domain if tinymce is loaded from other domain\r
+ if (!tinymce.relaxedDomain && tinymce.EditorManager.baseURI.host != lo.hostname && lo.hostname)\r
document.domain = tinymce.relaxedDomain = lo.hostname.replace(/.*\.(.+\..+)$/, '$1');\r
\r
// Add before unload listener\r
},\r
\r
init : function(s) {\r
- var t = this, pl, sl = tinymce.ScriptLoader, c, e;\r
+ var t = this, pl, sl = tinymce.ScriptLoader, c, e, el = [], ed;\r
\r
function execCallback(se, n, s) {\r
var f = se[n];\r
\r
if(l.length > 0) {\r
each(explode(l), function(v) {\r
- if (DOM.get(v))\r
- new tinymce.Editor(v, s).render(1);\r
- else {\r
+ if (DOM.get(v)) {\r
+ ed = new tinymce.Editor(v, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
+ } else {\r
c = 0;\r
\r
each(document.forms, function(f) {\r
if (e.name === v) {\r
v = 'mce_editor_' + c;\r
DOM.setAttrib(e, 'id', v);\r
- new tinymce.Editor(v, s).render(1);\r
+\r
+ ed = new tinymce.Editor(v, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
}\r
});\r
});\r
if (!v.id || t.get(v.id))\r
v.id = DOM.uniqueId();\r
\r
- new tinymce.Editor(v.id, s).render(1);\r
+ ed = new tinymce.Editor(v.id, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
}\r
});\r
break;\r
if (s.oninit) {\r
l = co = 0;\r
\r
- each (t.editors, function(ed) {\r
+ each (el, function(ed) {\r
co++;\r
\r
if (!ed.initialized) {\r
\r
case "mceRemoveEditor":\r
case "mceRemoveControl":\r
- ed.remove();\r
+ if (ed)\r
+ ed.remove();\r
+\r
return true;\r
\r
case 'mceToggleEditor':\r
apply_source_formatting : 1,\r
directionality : 'ltr',\r
forced_root_block : 'p',\r
- valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',\r
+ valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',\r
hidden_input : 1,\r
padd_empty_editor : 1,\r
render_ui : 1,\r
init_theme : 1,\r
force_p_newlines : 1,\r
- indentation : '30px'\r
+ indentation : '30px',\r
+ keep_styles : 1\r
}, s);\r
\r
// Setup URIs\r
if (h < 100)\r
h = 100;\r
\r
- t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + t.documentBaseURI.getURI() + '"></base>';\r
+ t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + t.documentBaseURI.getURI() + '" />';\r
t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';\r
\r
if (tinymce.relaxedDomain)\r
// Domain relaxing enabled, then set document domain\r
if (tinymce.relaxedDomain) {\r
// We need to write the contents here in IE since multiple writes messes up refresh button and back button\r
- if (isIE)\r
+ if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5))\r
u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';\r
else if (tinymce.isOpera)\r
u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; \r
// Design mode needs to be added here Ctrl+A will fail otherwise\r
if (!isIE) {\r
try {\r
- d.designMode = 'On';\r
+ if (!s.readonly)\r
+ d.designMode = 'On';\r
} catch (ex) {\r
// Will fail on Gecko if the editor is placed in an hidden container element\r
// The design mode will be set ones the editor is focused\r
// It will not steal focus if we hide it while setting contentEditable\r
b = t.getBody();\r
DOM.hide(b);\r
- b.contentEditable = true;\r
+\r
+ if (!s.readonly)\r
+ b.contentEditable = true;\r
+\r
DOM.show(b);\r
}\r
\r
font_size_style_values : s.font_size_style_values,\r
apply_source_formatting : s.apply_source_formatting,\r
remove_linebreaks : s.remove_linebreaks,\r
+ element_format : s.element_format,\r
dom : t.dom\r
});\r
\r
if (!s.gecko_spellcheck)\r
t.getBody().spellcheck = 0;\r
\r
- t._addEvents();\r
+ if (!s.readonly)\r
+ t._addEvents();\r
\r
t.controlManager.onPostRender.dispatch(t, t.controlManager);\r
t.onPostRender.dispatch(t);\r
});\r
}\r
\r
- if (isGecko) {\r
+ if (isGecko && !s.readonly) {\r
try {\r
// Design mode must be set here once again to fix a bug where\r
// Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again\r
var oed, t = this, ce = t.settings.content_editable;\r
\r
if (!sf) {\r
- if (!ce)\r
+ // Is not content editable or the selection is outside the area in IE\r
+ // the IE statement is needed to avoid bluring if element selections inside layers since\r
+ // the layer is like it's own document in IE\r
+ if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc()))\r
t.getWin().focus();\r
\r
}\r
},\r
\r
translate : function(s) {\r
- var c = this.settings.language, i18n = EditorManager.i18n;\r
+ var c = this.settings.language || 'en', i18n = EditorManager.i18n;\r
\r
if (!s)\r
return '';\r
},\r
\r
getLang : function(n, dv) {\r
- return EditorManager.i18n[this.settings.language + '.' + n] || (is(dv) ? dv : '{#' + n + '}');\r
+ return EditorManager.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');\r
},\r
\r
getParam : function(n, dv, ty) {\r
function setOpts() {\r
var t = this, d = t.getDoc(), s = t.settings;\r
\r
- if (isGecko) {\r
+ if (isGecko && !s.readonly) {\r
if (t._isHidden()) {\r
try {\r
if (!s.content_editable)\r
t.onMouseUp.add(t.nodeChanged);\r
t.onClick.add(t.nodeChanged);\r
t.onKeyUp.add(function(ed, e) {\r
- if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.keyCode == 46 || e.keyCode == 8 || e.ctrlKey)\r
+ var c = e.keyCode;\r
+\r
+ if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey)\r
t.nodeChanged();\r
});\r
\r
\r
if (cl = s.font_size_classes)\r
cl = explode(cl);\r
-\r
+/*\r
function convertToFonts(no) {\r
var n, f, nl, x, i, v, st;\r
\r
t.onSetContent.add(function(ed, o) {\r
convertToFonts(ed.getBody());\r
});\r
-\r
+*/\r
// Run on cleanup\r
t.onPreProcess.add(function(ed, o) {\r
var n, sp, nl, x;\r
(function() {\r
var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit;\r
\r
+ function isBlock(n) {\r
+ return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n.nodeName);\r
+ };\r
+\r
tinymce.create('tinymce.EditorCommands', {\r
EditorCommands : function(ed) {\r
this.editor = ed;\r
s.select(s.getNode());\r
\r
t.RemoveFormat();\r
- } else\r
- ed.getDoc().execCommand('FontName', false, v);\r
+ } else {\r
+ if (ed.settings.convert_fonts_to_spans)\r
+ t._applyInlineStyle('span', {style : {fontFamily : v}});\r
+ else\r
+ ed.getDoc().execCommand('FontName', false, v);\r
+ }\r
},\r
\r
FontSize : function(u, v) {\r
- var ed = this.editor, s = ed.settings, fz = tinymce.explode(s.font_size_style_values), fzc = tinymce.explode(s.font_size_classes), h, bm;\r
-\r
- // Remove style sizes\r
- each(ed.dom.select('font'), function(e) {\r
- e.style.fontSize = '';\r
- });\r
-\r
- // Let the browser add new size it will remove unneded ones in some browsers\r
- ed.getDoc().execCommand('FontSize', false, v);\r
+ var ed = this.editor, s = ed.settings, fc, fs;\r
\r
- // Add style values\r
- if (s.inline_styles) {\r
- each(ed.dom.select('font'), function(e) {\r
- // Try remove redundant font elements\r
- if (!e.size || e.parentNode.nodeName == 'FONT' && e.size == e.parentNode.size) {\r
- if (!bm)\r
- bm = ed.selection.getBookmark();\r
-\r
- ed.dom.remove(e, 1);\r
- return;\r
- }\r
+ // Use style options instead\r
+ if (s.convert_fonts_to_spans && v >= 1 && v <= 7) {\r
+ fs = tinymce.explode(s.font_size_style_values);\r
+ fc = tinymce.explode(s.font_size_classes);\r
\r
- // Setup font size based on font size value\r
- if (v = e.size) {\r
- if (fzc && fzc.length > 0)\r
- ed.dom.setAttrib(e, 'class', fzc[parseInt(v) - 1]);\r
- else\r
- ed.dom.setStyle(e, 'fontSize', fz[parseInt(v) - 1]);\r
- }\r
- });\r
+ if (fc)\r
+ v = fc[v - 1] || v;\r
+ else\r
+ v = fs[v - 1] || v;\r
}\r
\r
- ed.selection.moveToBookmark(bm);\r
+ if (v >= 1 && v <= 7)\r
+ ed.getDoc().execCommand('FontSize', false, v);\r
+ else\r
+ this._applyInlineStyle('span', {style : {fontSize : v}});\r
},\r
\r
queryCommandValue : function(c) {\r
queryValueFontSize : function() {\r
var ed = this.editor, v = 0, p;\r
\r
- if (isOpera || isWebKit) {\r
+ if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN'))\r
+ v = p.style.fontSize;\r
+\r
+ if (!v && (isOpera || isWebKit)) {\r
if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT'))\r
v = p.size;\r
\r
return v;\r
}\r
\r
- return this._queryVal('FontSize');\r
+ return v || this._queryVal('FontSize');\r
},\r
\r
queryValueFontName : function() {\r
if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT'))\r
v = p.face;\r
\r
+ if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN'))\r
+ v = p.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();\r
+\r
if (!v)\r
v = this._queryVal('FontName');\r
\r
\r
if (rm) {\r
if (v == 'center')\r
- dom.setStyle(n.parentNode, 'textAlign', '');\r
+ dom.setStyle(bl || n.parentNode, 'textAlign', '');\r
\r
dom.setStyle(n, 'float', '');\r
this.mceRepaint();\r
\r
if (v == 'center') {\r
// Do not change table elements\r
- if (/^(TD|TH)$/.test(bl.nodeName))\r
+ if (bl && /^(TD|TH)$/.test(bl.nodeName))\r
bl = 0;\r
\r
if (!bl || bl.childNodes.length > 1) {\r
dom.setStyle(n, 'float', '');\r
} else {\r
dom.setStyle(n, 'float', v);\r
- dom.setStyle(n.parentNode, 'textAlign', '');\r
+ dom.setStyle(bl || n.parentNode, 'textAlign', '');\r
}\r
\r
this.mceRepaint();\r
re = new RegExp(re, 'i');\r
\r
// Set style info on selected element\r
- if (e = t.getSelectedElement())\r
+ if ((e = t.getSelectedElement()) && !ed.settings.force_span_wrappers)\r
set(e, 1);\r
else {\r
// Generate wrappers and set styles on them\r
if (!p || !dom.getAttrib(n, 'mce_new'))\r
return;\r
\r
+ if (ed.settings.force_span_wrappers && p.nodeName != 'SPAN')\r
+ return;\r
+\r
// Has parent of the same type and only child\r
if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1)\r
return dom.remove(p, 1);\r
return this._queryState(c);\r
},\r
\r
+ ForeColor : function(ui, v) {\r
+ var ed = this.editor;\r
+\r
+ if (ed.settings.convert_fonts_to_spans) {\r
+ this._applyInlineStyle('span', {style : {color : v}});\r
+ return;\r
+ } else\r
+ ed.getDoc().execCommand('ForeColor', false, v);\r
+ },\r
+\r
HiliteColor : function(ui, val) {\r
var t = this, ed = t.editor, d = ed.getDoc();\r
\r
+ if (ed.settings.convert_fonts_to_spans) {\r
+ this._applyInlineStyle('span', {style : {backgroundColor : val}});\r
+ return;\r
+ }\r
+\r
function set(s) {\r
if (!isGecko)\r
return;\r
\r
if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)\r
return true;\r
- } else\r
- return !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE');\r
+ }\r
\r
- return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList();\r
+ return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE'));\r
},\r
\r
queryStateInsertUnorderedList : function() {\r
};\r
\r
// Get start/end block\r
- sb = dom.getParent(s.getStart(), dom.isBlock);\r
- eb = dom.getParent(s.getEnd(), dom.isBlock);\r
+ sb = dom.getParent(s.getStart(), isBlock);\r
+ eb = dom.getParent(s.getEnd(), isBlock);\r
\r
// Remove blockquote(s)\r
if (bq = getBQ(sb)) {\r
s.collapse(0);\r
\r
// IE misses the empty block some times element so we must move back the caret\r
- if (dom.getParent(s.getStart(), dom.isBlock) != sb) {\r
+ if (dom.getParent(s.getStart(), isBlock) != sb) {\r
r = s.getRng();\r
r.move('character', -1);\r
r.select();\r
} else\r
s.moveToBookmark(bm);\r
},\r
+\r
+ _applyInlineStyle : function(na, at, op) {\r
+ var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh;\r
+\r
+ na = na.toUpperCase();\r
+\r
+ if (op && op.check_classes && at['class'])\r
+ op.check_classes.push(at['class']);\r
+\r
+ function replaceFonts() {\r
+ var bm;\r
+\r
+ each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') {\r
+ if (!bm)\r
+ bm = ed.selection.getBookmark();\r
+\r
+ at._mce_new = '1';\r
+ dom.replace(dom.create(na, at), n, 1);\r
+ }\r
+ });\r
+\r
+ // Remove redundant elements\r
+ each(dom.select(na), function(n) {\r
+ if (n.getAttribute('_mce_new')) {\r
+ function removeStyle(n) {\r
+ if (n.nodeType == 1) {\r
+ each(at.style, function(v, k) {\r
+ dom.setStyle(n, k, '');\r
+ });\r
+\r
+ // Remove spans with the same class or marked classes\r
+ if (at['class'] && n.className && op) {\r
+ each(op.check_classes, function(c) {\r
+ if (dom.hasClass(n, c))\r
+ dom.removeClass(n, c);\r
+ });\r
+ }\r
+ }\r
+ };\r
+\r
+ // Remove specified style information from child elements\r
+ each(dom.select(na, n), removeStyle);\r
+\r
+ // Remove the specified style information on parent if current node is only child (IE)\r
+ if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1)\r
+ removeStyle(n.parentNode);\r
+\r
+ // Remove the child elements style info if a parent already has it\r
+ dom.getParent(n.parentNode, function(pn) {\r
+ if (pn.nodeType == 1) {\r
+ if (at.style) {\r
+ each(at.style, function(v, k) {\r
+ var sv;\r
+\r
+ if (!lo[k] && (sv = dom.getStyle(pn, k))) {\r
+ if (sv === v)\r
+ dom.setStyle(n, k, '');\r
+\r
+ lo[k] = 1;\r
+ }\r
+ });\r
+ }\r
+\r
+ // Remove spans with the same class or marked classes\r
+ if (at['class'] && pn.className && op) {\r
+ each(op.check_classes, function(c) {\r
+ if (dom.hasClass(pn, c))\r
+ dom.removeClass(n, c);\r
+ });\r
+ }\r
+ }\r
+\r
+ return false;\r
+ });\r
+\r
+ n.removeAttribute('_mce_new');\r
+ }\r
+ });\r
+\r
+ // Remove empty span elements\r
+ each(dom.select(na).reverse(), function(n) {\r
+ var c = 0;\r
+\r
+ // Check if there is any attributes\r
+ each(dom.getAttribs(n), function(an) {\r
+ if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') {\r
+ //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName));\r
+ c++;\r
+ }\r
+ });\r
+\r
+ // No attributes then remove the element and keep the children\r
+ if (c == 0)\r
+ dom.remove(n, 1);\r
+ });\r
+\r
+ ed.selection.moveToBookmark(bm);\r
+\r
+ return !!bm;\r
+ };\r
+\r
+ // Create inline elements\r
+ ed.focus();\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ replaceFonts();\r
+\r
+ if (kh = t._applyInlineStyle.keyhandler) {\r
+ ed.onKeyUp.remove(kh);\r
+ ed.onKeyDown.remove(kh);\r
+ }\r
+\r
+ if (ed.selection.isCollapsed()) {\r
+ t._applyInlineStyle.keyhandler = kh = function(e) {\r
+ if (replaceFonts()) {\r
+ ed.onKeyDown.remove(t._applyInlineStyle.keyhandler);\r
+ ed.onKeyPress.remove(t._applyInlineStyle.keyhandler);\r
+ }\r
+\r
+ if (e.type == 'keyup')\r
+ ed.onKeyUp.remove(t._applyInlineStyle.keyhandler);\r
+ };\r
+\r
+ ed.onKeyDown.add(kh);\r
+ ed.onKeyPress.add(kh);\r
+ ed.onKeyUp.add(kh);\r
+ }\r
+ },\r
+\r
/*\r
_mceBlockQuote : function() {\r
var t = this, s = t.editor.selection, b = s.getBookmark(), bq, dom = t.editor.dom;\r
_getSelectedBlocks : function(st, en) {\r
var ed = this.editor, dom = ed.dom, s = ed.selection, sb, eb, n, bl = [];\r
\r
- sb = dom.getParent(st || s.getStart(), dom.isBlock);\r
- eb = dom.getParent(en || s.getEnd(), dom.isBlock);\r
+ sb = dom.getParent(st || s.getStart(), isBlock);\r
+ eb = dom.getParent(en || s.getEnd(), isBlock);\r
\r
if (sb)\r
bl.push(sb);\r
n = sb;\r
\r
while ((n = n.nextSibling) && n != eb) {\r
- if (dom.isBlock(n))\r
+ if (isBlock(n))\r
bl.push(n);\r
}\r
}\r
\r
forceRoots : function(ed, e) {\r
var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;\r
- var nx, bl, bp, sp, le, nl = b.childNodes, i;\r
+ var nx, bl, bp, sp, le, nl = b.childNodes, i, n;\r
\r
// Fix for bug #1863847\r
- if (e && e.keyCode == 13)\r
- return true;\r
+ //if (e && e.keyCode == 13)\r
+ // return true;\r
\r
// Wrap non blocks into blocks\r
for (i = nl.length - 1; i >= 0; i--) {\r
// Store selection\r
if (si == -2 && r) {\r
if (!isIE) {\r
- // If element is inside body, might not be the case in contentEdiable mode\r
- if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {\r
- so = r.startOffset;\r
- eo = r.endOffset;\r
- si = t.find(b, 0, r.startContainer);\r
- ei = t.find(b, 0, r.endContainer);\r
+ // If selection is element then mark it\r
+ if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) {\r
+ n.setAttribute("id", "__mce");\r
+ } else {\r
+ // If element is inside body, might not be the case in contentEdiable mode\r
+ if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {\r
+ so = r.startOffset;\r
+ eo = r.endOffset;\r
+ si = t.find(b, 0, r.startContainer);\r
+ ei = t.find(b, 0, r.endContainer);\r
+ }\r
}\r
} else {\r
tr = d.body.createTextRange();\r
// Ignore\r
}\r
}\r
+ } else if (!isIE && (n = ed.dom.get('__mce'))) {\r
+ // Move caret before selected element\r
+ n.removeAttribute('id');\r
+ r = d.createRange();\r
+ r.setStartBefore(n);\r
+ r.setEndBefore(n);\r
+ se.setRng(r);\r
}\r
},\r
\r
\r
insertPara : function(e) {\r
var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body;\r
- var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch;\r
+ var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car;\r
\r
function isEmpty(n) {\r
n = n.innerHTML;\r
if (isEmpty(bef))\r
bef.innerHTML = '<br />';\r
\r
+ function appendStyles(e, en) {\r
+ var nl = [], nn, n, i;\r
+\r
+ e.innerHTML = '';\r
+\r
+ // Make clones of style elements\r
+ if (se.keep_styles) {\r
+ n = en;\r
+ do {\r
+ // We only want style specific elements\r
+ if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {\r
+ nn = n.cloneNode(false);\r
+ dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique\r
+ nl.push(nn);\r
+ }\r
+ } while (n = n.parentNode);\r
+ }\r
+\r
+ // Append style elements to aft\r
+ if (nl.length > 0) {\r
+ for (i = nl.length - 1, nn = e; i >= 0; i--)\r
+ nn = nn.appendChild(nl[i]);\r
+\r
+ // Padd most inner style element\r
+ nl[0].innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there\r
+ return nl[0]; // Move caret to most inner element\r
+ } else\r
+ e.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there\r
+ };\r
+\r
+ // Fill empty afterblook with current style\r
if (isEmpty(aft))\r
- aft.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there\r
+ car = appendStyles(aft, en);\r
\r
- // Opera needs this one backwards\r
- if (isOpera) {\r
+ // Opera needs this one backwards for older versions\r
+ if (isOpera && parseFloat(opera.version()) < 9.5) {\r
r.insertNode(bef);\r
r.insertNode(aft);\r
} else {\r
\r
// Move cursor and scroll into view\r
r = d.createRange();\r
- r.selectNodeContents(isGecko ? first(aft) : aft);\r
+ r.selectNodeContents(isGecko ? first(car || aft) : car || aft);\r
r.collapse(1);\r
s.removeAllRanges();\r
s.addRange(r);\r
\r
// Is element within viewport\r
if (y < vp.y || y + ch > vp.y + vp.h) {\r
- ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + ch);\r
+ ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks\r
//console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight));\r
}\r
\r
\r
// Gecko generates BR elements here and there, we don't like those so lets remove them\r
function handler(e) {\r
+ var pr;\r
+\r
e = e.target;\r
\r
// A new BR was created in a block element, remove it\r
if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) {\r
+ pr = e.previousSibling;\r
+\r
Event.remove(b, 'DOMNodeInserted', handler);\r
\r
+ // Is there whitespace at the end of the node before then we might need the pesky BR\r
+ // to place the caret at a correct location see bug: #2013943\r
+ if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue))\r
+ return;\r
+\r
// Only remove BR elements that got inserted in the middle of the text\r
if (e.previousSibling || e.nextSibling)\r
ed.dom.remove(e);\r
return t.add(c);\r
},\r
\r
- createMenuButton : function(id, s) {\r
+ createMenuButton : function(id, s, cc) {\r
s = s || {};\r
s.menu_button = 1;\r
\r
- return this.createButton(id, s);\r
+ return this.createButton(id, s, cc);\r
},\r
\r
createSplitButton : function(id, s, cc) {\r
});\r
\r
c.onHideMenu.add(function() {\r
- if (bm)\r
+ if (bm) {\r
ed.selection.moveToBookmark(bm);\r
+ bm = 0;\r
+ }\r
});\r
}\r
\r
return new f(a, b, c, d, e);\r
},\r
\r
- confirm : function(t, cb, s) {\r
- cb.call(s || this, confirm(this._decode(this.editor.getLang(t, t))));\r
+ confirm : function(t, cb, s, w) {\r
+ w = w || window;\r
+\r
+ cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));\r
},\r
\r
- alert : function(tx, cb, s) {\r
+ alert : function(tx, cb, s, w) {\r
var t = this;\r
- \r
- alert(t._decode(t.editor.getLang(tx, tx)));\r
+\r
+ w = w || window;\r
+ w.alert(t._decode(t.editor.getLang(tx, tx)));\r
\r
if (cb)\r
cb.call(s || t);\r
}\r
\r
});\r
-}());\r
+}());
\ No newline at end of file
se.style.display = 'none';\r
ne.focus();\r
ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;\r
+ ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;\r
TinyMCE_EditableSelects.editSelectElm = se;\r
}\r
},\r
se.parentNode.removeChild(se.previousSibling);\r
TinyMCE_EditableSelects.editSelectElm = null;\r
}\r
+ },\r
+\r
+ onKeyDown : function(e) {\r
+ e = e || window.event;\r
+\r
+ if (e.keyCode == 13)\r
+ TinyMCE_EditableSelects.onBlurEditableSelectInput();\r
}\r
};\r
+++ /dev/null
-/**\r
- * $Id$\r
- *\r
- * Moxiecode floating layer script.\r
- *\r
- * @author Moxiecode\r
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
- */\r
-\r
-function MCLayer(id) {\r
- this.id = id;\r
- this.settings = new Array();\r
- this.blockerElement = null;\r
- this.isMSIE = navigator.appName == "Microsoft Internet Explorer";\r
- this.events = false;\r
- this.autoHideCallback = null;\r
-}\r
-\r
-MCLayer.prototype = {\r
- moveRelativeTo : function(re, p, a) {\r
- var rep = this.getAbsPosition(re);\r
- var w = parseInt(re.offsetWidth);\r
- var h = parseInt(re.offsetHeight);\r
- var x, y;\r
-\r
- switch (p) {\r
- case "tl":\r
- break;\r
-\r
- case "tr":\r
- x = rep.absLeft + w;\r
- y = rep.absTop;\r
- break;\r
-\r
- case "bl":\r
- break;\r
-\r
- case "br":\r
- break;\r
- }\r
-\r
- this.moveTo(x, y);\r
- },\r
-\r
- moveBy : function(dx, dy) {\r
- var e = this.getElement();\r
- var x = parseInt(e.style.left);\r
- var y = parseInt(e.style.top);\r
-\r
- e.style.left = (x + dx) + "px";\r
- e.style.top = (y + dy) + "px";\r
-\r
- this.updateBlocker();\r
- },\r
-\r
- moveTo : function(x, y) {\r
- var e = this.getElement();\r
-\r
- e.style.left = x + "px";\r
- e.style.top = y + "px";\r
-\r
- this.updateBlocker();\r
- },\r
-\r
- show : function() {\r
- MCLayer.visibleLayer = this;\r
-\r
- this.getElement().style.display = 'block';\r
- this.updateBlocker();\r
- },\r
-\r
- hide : function() {\r
- this.getElement().style.display = 'none';\r
- this.updateBlocker();\r
- },\r
-\r
- setAutoHide : function(s, cb) {\r
- this.autoHideCallback = cb;\r
- this.registerEventHandlers();\r
- },\r
-\r
- getElement : function() {\r
- return document.getElementById(this.id);\r
- },\r
-\r
- updateBlocker : function() {\r
- if (!this.isMSIE)\r
- return;\r
-\r
- var e = this.getElement();\r
- var b = this.getBlocker();\r
- var x = this.parseInt(e.style.left);\r
- var y = this.parseInt(e.style.top);\r
- var w = this.parseInt(e.offsetWidth);\r
- var h = this.parseInt(e.offsetHeight);\r
-\r
- b.style.left = x + 'px';\r
- b.style.top = y + 'px';\r
- b.style.width = w + 'px';\r
- b.style.height = h + 'px';\r
- b.style.display = e.style.display;\r
- },\r
-\r
- getBlocker : function() {\r
- if (!this.blockerElement) {\r
- var d = document, b = d.createElement("iframe");\r
-\r
- b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';\r
- b.src = 'javascript:false;';\r
- b.frameBorder = '0';\r
- b.scrolling = 'no';\r
-\r
- d.body.appendChild(b);\r
- this.blockerElement = b;\r
- }\r
-\r
- return this.blockerElement;\r
- },\r
-\r
- getAbsPosition : function(n) {\r
- var p = {absLeft : 0, absTop : 0};\r
-\r
- while (n) {\r
- p.absLeft += n.offsetLeft;\r
- p.absTop += n.offsetTop;\r
- n = n.offsetParent;\r
- }\r
-\r
- return p;\r
- },\r
-\r
- registerEventHandlers : function() {\r
- if (!this.events) {\r
- var d = document;\r
-\r
- this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);\r
-\r
- this.events = true;\r
- }\r
- },\r
-\r
- addEvent : function(o, n, h) {\r
- if (o.attachEvent)\r
- o.attachEvent("on" + n, h);\r
- else\r
- o.addEventListener(n, h, false);\r
- },\r
-\r
- onMouseDown : function(e) {\r
- e = typeof(e) == "undefined" ? window.event : e;\r
- var b = document.body;\r
- var l = MCLayer.visibleLayer;\r
-\r
- if (l) {\r
- var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;\r
- var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;\r
- var el = l.getElement();\r
- var x = parseInt(el.style.left);\r
- var y = parseInt(el.style.top);\r
- var w = parseInt(el.offsetWidth);\r
- var h = parseInt(el.offsetHeight);\r
-\r
- if (!(mx > x && mx < x + w && my > y && my < y + h)) {\r
- MCLayer.visibleLayer = null;\r
-\r
- if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))\r
- return true;\r
-\r
- l.hide();\r
- }\r
- }\r
- },\r
-\r
- addCSSClass : function(e, c) {\r
- this.removeCSSClass(e, c);\r
- var a = this.explode(' ', e.className);\r
- a[a.length] = c;\r
- e.className = a.join(' ');\r
- },\r
-\r
- removeCSSClass : function(e, c) {\r
- var a = this.explode(' ', e.className), i;\r
-\r
- for (i=0; i<a.length; i++) {\r
- if (a[i] == c)\r
- a[i] = '';\r
- }\r
-\r
- e.className = a.join(' ');\r
- },\r
-\r
- explode : function(d, s) {\r
- var ar = s.split(d);\r
- var oar = new Array();\r
-\r
- for (var i = 0; i<ar.length; i++) {\r
- if (ar[i] != "")\r
- oar[oar.length] = ar[i];\r
- }\r
-\r
- return oar;\r
- },\r
-\r
- parseInt : function(s) {\r
- if (s == null || s == '')\r
- return 0;\r
-\r
- return parseInt(s);\r
- }\r
-}\r