JSFiddle - React, Tailwind, and code Playground
JavaScript
// #############################################################################
// vB_Text_Editor
/**
* vBulletin Editor Class
*
* Activates any HTML controls for an editor
*
* @param string Unique key for this editor
* @param boolean Initialise to WYSIWYG mode?
* @param string Forumid / Calendar etc.
* @param boolean Parse smilies?
* @param string (Optional) Initial text for the editor
* @param string (Optional) Extra arguments to pass when switching editor modes
*/
function vB_Text_Editor(editorid, mode, parsetype, parsesmilies, initial_text, ajax_extra)
{
/**
* Miscellaneous variables
*
* @var string Unique Editor ID
* @var boolean WYSIWYG mode
* @var boolean Have we initialized the editor?
* @var mixed Passed parsetype (corresponds to bbcodeparse forumid)
* @var boolean Passed parsesmilies option
* @var boolean Can we use vBmenu popups?
* @var object The element containing controls
* @var object The textarea object containing the initial text
* @var array Array containing all button objects
* @var array Array containing all popup objects
* @var object Current prompt() emulation popup
* @var string State of the font context control
* @var string State of the size context control
* @var string State of the color context control
* @var string String to contain the fake 'clipboard'
* @var boolean Is the editor 'disabled'? (quick reply use)
* @var vB_History History manager for undo/redo systems
* @var integer Is the editor mode trying to be changed?
* @var boolean Are we allowed to use basic (B/I/U) BB code? - Set up with allowbasicbbcode in editor_clientscript template
*/
this.editorid = editorid;
this.wysiwyg_mode = parseInt(mode, 10) ? 1 : 0;
this.initialized = false;
this.parsetype = (typeof parsetype == 'undefined' ? 'nonforum' : parsetype);
this.ajax_extra = (typeof parsetype == 'undefined' ? '' : ajax_extra);
this.parsesmilies = (typeof parsesmilies == 'undefined' ? 1 : parsesmilies);
this.popupmode = (typeof vBmenu ==...