<attribute name="0"></attribute>
<attribute name="1"></attribute>
</attributes>
- <wysiwygicon>quote.png</wysiwygicon>
+ <wysiwygicon>fa-quote-left</wysiwygicon>
<buttonlabel>wcf.bbcode.button.quote</buttonlabel>
</bbcode>
<bbcode name="code">
</attribute>
</attributes>
<sourcecode>1</sourcecode>
- <wysiwygicon>code.png</wysiwygicon>
+ <wysiwygicon>fa-code</wysiwygicon>
<buttonlabel>wcf.bbcode.button.code</buttonlabel>
</bbcode>
<bbcode name="img">
<attributes>
<attribute name="0"></attribute>
</attributes>
- <wysiwygicon>spoiler.png</wysiwygicon>
+ <wysiwygicon>fa-eye-slash</wysiwygicon>
<buttonlabel>wcf.bbcode.button.spoiler</buttonlabel>
</bbcode>
<bbcode name="tt">
<htmlclose>code</htmlclose>
<allowedchildren>none</allowedchildren>
<sourcecode>1</sourcecode>
- <wysiwygicon>inlineCode.png</wysiwygicon>
+ <wysiwygicon>fa-font</wysiwygicon>
<buttonlabel>wcf.bbcode.button.inlineCode</buttonlabel>
</bbcode>
<link rel="stylesheet" type="text/css" href="{@$__wcf->getPath()}js/3rdParty/redactor/redactor.css" />
<script data-relocate="true">
-var __REDACTOR_BUTTONS = [ {implode from=$__wcf->getBBCodeHandler()->getButtonBBCodes() item=__bbcode}{ icon: '{@$__wcf->getPath()}/icon/{$__bbcode->wysiwygIcon}', label: '{$__bbcode->buttonLabel|language}', name: '{$__bbcode->bbcodeTag}' }{/implode} ];
+var __REDACTOR_ICON_PATH = '{@$__wcf->getPath()}icon/';
+var __REDACTOR_BUTTONS = [ {implode from=$__wcf->getBBCodeHandler()->getButtonBBCodes() item=__bbcode}{ icon: '{$__bbcode->wysiwygIcon}', label: '{$__bbcode->buttonLabel|language}', name: '{$__bbcode->bbcodeTag}' }{/implode} ];
var __REDACTOR_SMILIES = { {implode from=$defaultSmilies item=smiley}'{@$smiley->smileyCode|encodeJS}': '{@$smiley->getURL()|encodeJS}'{/implode} };
var __REDACTOR_SOURCE_BBCODES = [ {implode from=$__wcf->getBBCodeHandler()->getSourceBBCodes() item=__bbcode}'{@$__bbcode->bbcodeTag}'{/implode} ];
</script>
*/
_addBBCodeButton: function(data) {
var $buttonName = '__wcf_' + data.name;
- this.buttonAdd($buttonName, data.label, this._insertBBCode);
+ var $button = this.buttonAdd($buttonName, data.label, this._insertBBCode);
this._bbcodes[$buttonName] = data.name;
- //
- // TODO: These are hardcoded for now, since the API does not provide class names yet, this has to be changes
- //
- var $iconName = '';
- switch (data.name) {
- case 'code':
- $iconName = 'fa-code';
- break;
-
- case 'quote':
- $iconName = 'fa-quote-left';
- break;
-
- case 'spoiler':
- $iconName = 'fa-eye-slash';
- break;
-
- case 'tt':
- $iconName = 'fa-font';
- break;
+ // FontAwesome class name
+ if (data.icon.match(/^fa\-[a-z\-]+$/)) {
+ this.buttonAwesome($buttonName, data.icon);
+ }
+ else {
+ // image reference
+ $button.css('background-image', 'url(' + __REDACTOR_ICON_PATH + data.icon + ')');
}
-
- this.buttonAwesome($buttonName, $iconName);
},
/**