﻿
tinyMCE.init(
{
	// General options
	mode: "textareas",
	theme: "advanced",
	remove_script_host: false,
	relative_urls: false,
	editor_selector: "mceEditor",
	editor_deselector: "mceNoEditor",
	height: '150px',
	width: '100%',
	content_css: String.format("{0}/assets/css/tinymce.css?{1}", Communifire.virtualDirectory, new Date().getTime()),
	plugins: "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,codehighlight",
	theme_advanced_resizing: true,
	theme_advanced_buttons1: "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,undo,redo,separator,link,unlink,separator,code,separator,image,media,emotions,codehighlight,separator,pastetext,pasteword,selectall,separator,fullscreen",
	theme_advanced_buttons2: '',
	theme_advanced_buttons3: '',
	theme_advanced_toolbar_location: "top",
	theme_advanced_toolbar_align: "left",
	theme_advanced_statusbar_location: "bottom"
});

function convertWord(type, content) {
	switch (type) {
		// Gets executed before the built in logic performes it's cleanups     
		case "before":
			// do nothing
			break;

		// Gets executed after the built in logic performes it's cleanups     
		case "after":
			content = content.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
			break;
	}
	return content;
}
 
