by Ange Tuteur September 2nd 2014, 6:31 am
Hello Ramdaman,
This is absolutely possible with a bit of JavaScript.
Go to Administration Panel > Modules > JavaScript codes management > create a new script
Title : Your choice
Placement : In the topics
Paste the code below :
- Code:
$(function(){$(function(){
 var editor = $('#text_editor_textarea').sceditor('instance');
 if ( forum(1) || forum(2) || forum(3) ) {
  if (editor.inSourceMode()) {
   editor.sourceMode(false);
   $('.sceditor-button-source').removeClass('hover');
   $.cookie('WYSIWYG_STATE', '1', { expires: 365 });
  }
 }
 else {
  editor.sourceMode(true);
  $('.sceditor-button-source').addClass('hover');
  $.cookie('WYSIWYG_STATE', '0', { expires: 365 });
 }
 function forum(n) {return RegExp('\/f'+n+'-').test($('.topic-actions .pathname-box p a.nav:last').attr('href'))}
})});
In the script is a condition :
- Code:
if ( forum(1) || forum(2) || forum(3) )
These are the forums whose topics you'll enabled WYSIWYG mode for. Simply write :
forum(n) with
n being a number value, that is the forum ID. You must separate multiple forums by
||.
So for example, if you wanted to enable WYSIWYG mode in
announcement, you would write :
- Code:
if ( forum(6) )
You can see the forum ID from the address bar while viewing the forum. e.g.
http://www.agg-community.com/f6-announcements = f6 - f = 6
Note :* The forums which don't allow WYSIWYG mode by default will start in source mode
* The mode can still be switched if the source button is visible