FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » WYSIWYG editor
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: WYSIWYG editor [message #162515 is a reply to message #162513] Sun, 30 May 2010 14:23 Go to previous messageGo to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma:
Senior Member
I just wrote a long post and it vanished in forum_eatery_dev/null.

Anyhow: I have tinyMCE WYSIWYG editor enabled on my HTML enabled parts of my forum. Using it for BB code is very slow and annoying - The extra second you have to wait for it is not worth it and one of the main reasons to use FUD is because of its speed.

Anyhow, to add it to HTML enabled forums, just edit your POST.tmpl -> POST_PAGE and add something like this:
{IF: !($frm->forum_opt & 16)}
							<script type="text/javascript" src="js/tiny_mce/tiny_mce_gzip.js"></script>
							<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
							{TEMPLATE: HTML_TINYMCE}
							{ENDIF}


The subtemplate HTML_TINYMCE contains the following:
<script type="text/javascript">
// This is where the compressor will load all components, include all components used on the page here
tinyMCE_GZ.init({
	plugins : \'style,table,preview,media,contextmenu,paste,fullscreen,visualchars\',
	themes : \'advanced\',
	languages : \'en\',
	disk_cache : true,
	debug : false
});
</script>
<script type="text/javascript">
// Normal initialization of TinyMCE
tinyMCE.init({
	// General options
	mode : "textareas",
	editor_selector : "msg_body",
	theme : "advanced",
	plugins : "style,table,preview,media,contextmenu,paste,fullscreen,visualchars",

	// Theme options
	theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
	theme_advanced_buttons2 : "pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,image,cleanup,code,|,preview,|,forecolor,backcolor",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,fullscreen,visualchars",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "{THEME_ROOT}/tinymce.css",
body_class : "newsbackground",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js",
extended_valid_elements : "iframe[src|frameborder|border|style|width|height|name|align]",
	// Replace values for the template plugin
	template_replace_values : {
		username : "Some User",
		staffid : "991234"
	}
});
</script>


TINYMCE has its own CSS file if you so wish, you can either add the CSS code to the existing forum.css.tmpl or you can add it as a secondary CSS file, something I have done and I only load that CSS file while on the post page, to avoid unecessary loading times.

To add an additional CSS file to the FUD templating system, you just copy the existing forum.css.tmpl and name it differently, then open the WWW_ROOT/adm/TMPLLIST.PHP file and look for this (or something similair, just search for CSS):
if ($file != ('forum.css')

change it to this
if ($file != ('forum.css') && $file != ('tinymce.css')) {



Something like that.


[Message index]
 
Read Message icon2.gif
Read Message
Read Message
Read Message
Previous Topic: Forum banner
Next Topic: API Function to create new forum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 01:45:47 GMT 2024

Total time taken to generate the page: 0.04062 seconds