From: Alexander Ebert Date: Wed, 8 Jun 2016 13:42:34 +0000 (+0200) Subject: Added support for inline code / [tt] X-Git-Tag: 3.0.0_Beta_1~1483 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b440b08a246f12c59eab9b3595e83ba6a1202c9;p=GitHub%2FWoltLab%2FWCF.git Added support for inline code / [tt] --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 1d058ab782..919ccdb602 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -24,6 +24,7 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabImage.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabInlineCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabLink.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMedia.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabMention.js?v={@LAST_UPDATE_TIME}', @@ -76,6 +77,7 @@ 'WoltLabDropdown', 'WoltLabEvent', 'WoltLabImage', + 'WoltLabInlineCode', 'WoltLabLink', 'WoltLabModal', 'WoltLabQuote', diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInlineCode.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInlineCode.js new file mode 100644 index 0000000000..a60646f477 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInlineCode.js @@ -0,0 +1,17 @@ +$.Redactor.prototype.WoltLabInlineCode = function() { + "use strict"; + + return { + init: function() { + this.opts.activeButtonsStates.kbd = 'tt'; + + require(['EventHandler'], (function (EventHandler) { + EventHandler.add('com.woltlab.wcf.redactor2', 'bbcode_tt_' + this.$element[0].id, (function(data) { + data.cancel = true; + + this.button.toggle({}, 'kbd', 'func', 'inline.format'); + }).bind(this)); + }).bind(this)); + } + }; +}; diff --git a/wcfsetup/install/files/style/bbcode/inlineCode.scss b/wcfsetup/install/files/style/bbcode/inlineCode.scss new file mode 100644 index 0000000000..4b3d0ff23c --- /dev/null +++ b/wcfsetup/install/files/style/bbcode/inlineCode.scss @@ -0,0 +1,13 @@ +.inlineCode, /* deprecated, legacy class */ +kbd { + background-color: rgba(255, 255, 255, 1) !important; + border: 1px solid rgba(196, 196, 196, 1) !important; + border-radius: 2px; + color: rgba(68, 68, 68, 1) !important; + display: inline-block; + font-family: Consolas, 'Courier New', monospace; + margin: 0 2px; + padding: 0 4px; + word-break: break-all; + word-wrap: break-word; +}