ipTinyMceConfigPastePreprocess = function(pl, o, allowedClasses) { var tmpContent = o.content; /* replace strong with bold */ tmpContent = tmpContent.replace(/()/ig, ""); tmpContent = tmpContent.replace(/(<\/strong>)/ig, ""); /* replace h1 h2 h3 with bold */ tmpContent = tmpContent.replace(/(<(\ )*h[123][^<>]*>)/ig, ""); tmpContent = tmpContent.replace(/(<(\ )*\/h[123](\ )*>)/ig, ""); /* remove unknown classes */ var pattern = /<[^<>]+class="[^"]+"[^<>]*>/gi; /* find all tags containing classes */ var matches = tmpContent.match(pattern); for ( var i = 0; matches && i < matches.length; i++) { /* loop through found tags */ var pattern2 = /class="[^"]+"/gi; /* find class name */ var matches2 = matches[i].match(pattern2); for ( var i2 = 0; matches2 && i2 < matches2.length; i2++) { /* throw away unknown classes */ var classExist = false; for ( var classKey = 0; classKey < allowedClasses.length; classKey++) { if ('class="' + allowedClasses[classKey] + '"' == matches2[i2]) { classExist = true; } } if (!classExist) { tmpContent = tmpContent.replace(matches2[i2], ""); } } } o.content = tmpContent; }; ipTinyMceConfigMin = { // Location of TinyMCE script script_url : ip.baseUrl + ip.libraryDir + 'js/tiny_mce/tiny_mce.js', theme : "advanced", plugins : "paste,inlinepopups,iplink,autoresize", entity_encoding : "raw", theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator", theme_advanced_buttons2 : "bold,italic,underline,styleselect", theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : 0, theme_advanced_resizing : false, theme_advanced_resize_horizontal : false, valid_elements : "@[class|style],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li", width : '100%', content_css : ip.baseUrl + ip.themeDir + ip.theme + "/ip_content.css", theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button", forced_root_block : "p", gecko_spellcheck : true, document_base_url : ip.baseUrl, remove_script_host : false, relative_urls : false, convert_urls : true, paste_auto_cleanup_on_paste : true, paste_retain_style_properties : "", paste_strip_class_attributes : false, paste_remove_spans : false, paste_remove_styles : true, paste_convert_middot_lists : true, paste_text_use_dialog : true, paste_preprocess : function(pl, o) { ipTinyMceConfigPastePreprocess(pl, o, new Array('caption', 'signature', 'note', 'button')); } };ipTinyMceConfigMed = { // Location of TinyMCE script script_url : ip.baseUrl + ip.libraryDir + 'js/tiny_mce/tiny_mce.js', theme : "advanced", plugins : "paste,inlinepopups,iplink,simplebrowser,advhr,advimage,autoresize", entity_encoding : "raw", theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator", theme_advanced_buttons2 : "bold,italic,underline,styleselect,image,code", theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : 0, theme_advanced_resizing : false, valid_elements : "@[class|style],img[class|src|alt|title|hspace|vspace|width|height|align|name],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li", width : '100%', content_css : ip.baseUrl + ip.themeDir + ip.theme + "/ip_content.css", theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button", forced_root_block : "p", gecko_spellcheck : true, file_browser_callback : "simplebrowser_browse", document_base_url : ip.baseUrl, remove_script_host : false, relative_urls : false, convert_urls : true, paste_auto_cleanup_on_paste : true, paste_retain_style_properties : "", paste_strip_class_attributes : false, paste_remove_spans : false, paste_remove_styles : true, paste_convert_middot_lists : true, paste_text_use_dialog : true, paste_preprocess : function(pl, o) { ipTinyMceConfigPastePreprocess(pl, o, new Array('caption', 'signature', 'note', 'button')); } };ipTinyMceConfigMax = { // Location of TinyMCE script script_url : ip.baseUrl + ip.libraryDir + 'js/tiny_mce/tiny_mce.js', theme : "advanced", entity_encoding : "raw", plugins : "autoresize,iplink,paste,safari,spellchecker,pagebreak,style,layer,table,advhr,advimage,emotions,iespell,inlinepopups,media,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,simplebrowser,advhr", theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,pastetext,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,blockquote,pagebreak,|,insertfile,insertimage,strikethrough,fullscreen", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : false, width : '100%', content_css : ip.baseUrl + ip.themeDir + ip.theme + "/ip_content.css", theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button", forced_root_block : "p", gecko_spellcheck : true, file_browser_callback : "simplebrowser_browse", document_base_url : ip.baseUrl, remove_script_host : false, relative_urls : false, convert_urls : true };ipTinyMceConfigTable = { // Location of TinyMCE script script_url : ip.baseUrl + ip.libraryDir + 'js/tiny_mce/tiny_mce.js', theme : "advanced", plugins : "paste,inlinepopups,iplink,table,autoresize", entity_encoding : "raw", theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator", theme_advanced_buttons2 : "bold,italic,underline,styleselect", theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup", theme_advanced_buttons4 : "tablecontrols", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : 0, theme_advanced_resizing : false, valid_elements : "@[class|style],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li,table,tbody,thead,th,tr,td[colspan|rowspan]", height : 300, width : '100%', content_css : ip.baseUrl + ip.themeDir + ip.theme + "/ip_content.css", theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button", forced_root_block : "p", document_base_url : ip.baseUrl, remove_script_host : false, relative_urls : false, convert_urls : true, paste_auto_cleanup_on_paste : true, paste_retain_style_properties : "", paste_strip_class_attributes : false, paste_remove_spans : false, paste_remove_styles : true, paste_convert_middot_lists : true, paste_text_use_dialog : true, paste_preprocess : function(pl, o) { ipTinyMceConfigPastePreprocess(pl, o, new Array('caption', 'signature', 'note', 'button')); } };