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

Home » FUDforum » FUDforum Suggestions » WYSIWYG editor
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon2.gif  WYSIWYG editor [message #162513] Fri, 28 May 2010 21:47 Go to next message
badisoun is currently offline  badisoun
Messages: 1
Registered: November 2009
Location: Algérie
Karma: 0
Junior Member
Why not an WYSIWYG editor ?
Re: WYSIWYG editor [message #162514 is a reply to message #162513] Sat, 29 May 2010 06:03 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I guess because nobody bothered to integrate or code one for FUDforum. If you can help, please do let us know.
Re: WYSIWYG editor [message #162515 is a reply to message #162513] Sun, 30 May 2010 14:23 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
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.


Re: WYSIWYG editor [message #162516 is a reply to message #162513] Sun, 30 May 2010 14:34 Go to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
I have also edited my forum.css to prevent the above destruction of the forums layout when using code tags by defining a width of the div.pre tag - Mine is set to 600px and the overflow:auto will ensure that a scroller appears.

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Forum banner
Next Topic: API Function to create new forum
Goto Forum:
  

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

Current Time: Wed Nov 27 02:46:40 GMT 2024

Total time taken to generate the page: 0.03726 seconds