'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMedia.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMention.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabModal.js?v={@LAST_UPDATE_TIME}',
- '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabParagraphize.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabQuote.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSize.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}',
'WoltLabInlineCode',
'WoltLabLink',
'WoltLabModal',
- 'WoltLabParagraphize',
'WoltLabQuote',
'WoltLabSize',
'WoltLabSmiley',
'insert-column-left': '{lang}wcf.editor.table.insertColumnLeft{/lang}',
'insert-column-right': '{lang}wcf.editor.table.insertColumnRight{/lang}',
'insert-row-above': '{lang}wcf.editor.table.insertRowAbove{/lang}',
- 'insert-row-below': '{lang}wcf.editor.table.insertRowBelow{/lang}'
+ 'insert-row-below': '{lang}wcf.editor.table.insertRowBelow{/lang}',
+
+ // size
+ 'remove-size': '{lang}wcf.editor.button.size.removeSize{/lang}',
+
+ // color
+ 'remove-color': '{lang}wcf.editor.button.color.removeColor{/lang}',
}
},
linkify: false,
// already and we can safely add all icons
config.plugins.push('WoltLabButton');
+ var content = element.value;
+ element.value = '';
+
+ config.callbacks = config.callbacks || { };
+ config.callbacks.init = function() {
+ // slight delay to allow Redactor to initialize itself
+ window.setTimeout(function() {
+ $(element).redactor('code.set', content);
+ }, 10);
+ };
+
$(element).redactor(config);
});
});
case 'code':
case 'div':
case 'p':
+ case 'woltlab-quote':
+ case 'woltlab-spoiler':
return true;
break;
namespace wcf\system\html\metacode\converter;
/**
- * Converts quote bbcode into `<blockquote>`.
+ * Converts quote bbcode into `<woltlab-quote>`.
*
* @author Alexander Ebert
* @copyright 2001-2016 WoltLab GmbH
* @inheritDoc
*/
public function convert(\DOMDocumentFragment $fragment, array $attributes) {
- $element = $fragment->ownerDocument->createElement('blockquote');
+ $element = $fragment->ownerDocument->createElement('woltlab-quote');
$element->setAttribute('data-quote-title', isset($attributes[0]) ? $attributes[0] : '');
$element->setAttribute('data-quote-url', isset($attributes[1]) ? $attributes[1] : '');
$element->appendChild($fragment);
$usernames = [];
/** @var \DOMElement $element */
- foreach ($htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('blockquote') as $element) {
+ foreach ($htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('woltlab-quote') as $element) {
$username = StringUtil::trim($element->getAttribute('data-author'));
if (!empty($username) && !in_array($username, $usernames)) {
$usernames[] = $username;
$htmlInputProcessor = new HtmlInputProcessor();
$htmlInputProcessor->processIntermediate($fullQuote);
- $elements = $htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('blockquote');
+ $elements = $htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('woltlab-quote');
while ($elements->length) {
DOMUtil::removeNode($elements->item(0));
}
continue;
}
- if (DOMUtil::hasParent($element, 'blockquote')) {
+ if (DOMUtil::hasParent($element, 'woltlab-quote')) {
// ignore mentions within quotes
continue;
}
public static function getQuotedUsers(HtmlInputProcessor $htmlInputProcessor) {
$usernames = [];
- $elements = $htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('blockquote');
+ $elements = $htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('woltlab-quote');
/** @var \DOMElement $element */
foreach ($elements as $element) {
$username = $element->getAttribute('data-author');