From: Tim Düsterhus Date: Fri, 3 Jun 2022 07:52:15 +0000 (+0200) Subject: Re-add search addon to CodeMirror X-Git-Tag: 5.5.0_RC_1~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b7098c2e1825755862e27d89fb5e97dd122ecc9d;p=GitHub%2FWoltLab%2FWCF.git Re-add search addon to CodeMirror The browser search does not work well with CodeMirror, re-add the search addon to make Ctrl+F work more or less as expected. This got lost when CodeMirror was adjusted to make use of require.js in 480b6b11d0822015d4fe4515e7a72b495fe78a69. --- diff --git a/wcfsetup/install/files/acp/templates/codemirror.tpl b/wcfsetup/install/files/acp/templates/codemirror.tpl index a383947801..1abaf8ffa5 100644 --- a/wcfsetup/install/files/acp/templates/codemirror.tpl +++ b/wcfsetup/install/files/acp/templates/codemirror.tpl @@ -15,24 +15,31 @@ 'codemirror/mode/{@$codemirrorMode}/{@$codemirrorMode}', {/if} {/if} + 'codemirror/addon/search/search', 'EventHandler', 'Dom/Traverse', 'Dom/Util' ], ( CodeMirror, {if $codemirrorMode|isset} - CoreMirrorMode, + CodeMirrorMode, {/if} + CodeMirrorSearchAddon, EventHandler, DomTraverse, DomUtil, ) => { const codemirrorCss = document.head.querySelector('link[href$="codemirror.css"]'); if (codemirrorCss === null) { - const link = document.createElement('link'); + let link = document.createElement('link'); link.rel = 'stylesheet'; link.href = '{@$__wcf->getPath()}js/3rdParty/codemirror/codemirror.css'; document.head.appendChild(link); + + link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = '{@$__wcf->getPath()}js/3rdParty/codemirror/addon/dialog/dialog.css'; + document.head.appendChild(link); } var elements = document.querySelectorAll('{@$codemirrorSelector|encodeJS}');