dieketzer
Well-known member
xf 1.1.0
due to chrome pasting issues (pasting colour-formatted text), i have elected to completely disable all colour functionality from tinyMCE.
(line 51)
find:
comment it out:
(line 645)
find:
comment it out:
in the file /library/XenForo/BbCode/Formatter/Base.php
(line 296)
find:
replace with:
in the js file: /js/tinymce/themes/xenforo/editor_template.js
(line 985)
find:
remove 'forecolor':
due to chrome pasting issues (pasting colour-formatted text), i have elected to completely disable all colour functionality from tinyMCE.
- pasted colour-formatting will be stripped when posted
- colour-format button will not be visible
- manually entered [color] tags will silently fail
- php code colour-formatting is unaffected (syntax highlighting)
- the effect is not retroactive
(line 51)
find:
PHP:
'color' => array('$this', 'handleCssColor'),
Code:
/* 'color' => array('$this', 'handleCssColor'),*/
(line 645)
find:
PHP:
public function handleCssColor($text, $color)
{
return "[COLOR=$color]{$text}[/COLOR]";
}
Code:
/*public function handleCssColor($text, $color)
{
return "[COLOR=$color]{$text}[/COLOR]";
}*/
in the file /library/XenForo/BbCode/Formatter/Base.php
(line 296)
find:
PHP:
'color' => array(
'hasOption' => true,
'optionRegex' => '/^(rgb\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*\)|#[a-f0-9]{6}|#[a-f0-9]{3}|[a-z]+)$/i',
'replace' => array('<span style="color: %s">', '</span>')
),
Code:
'color' => array(
'hasOption' => true,
'optionRegex' => '/^(rgb\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*\)|#[a-f0-9]{6}|#[a-f0-9]{3}|[a-z]+)$/i',
'replace' => array('<span>', '</span>')
),
in the js file: /js/tinymce/themes/xenforo/editor_template.js
(line 985)
find:
PHP:
theme_xenforo_buttons1 : 'removeformat,|,fontselect,fontsizeselect,forecolor,xenforo_smilies,|,' + undoRedoButtons,
remove 'forecolor':
Code:
theme_xenforo_buttons1 : 'removeformat,|,fontselect,fontsizeselect,xenforo_smilies,|,' + undoRedoButtons,