From 480b6b11d0822015d4fe4515e7a72b495fe78a69 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 10 Jun 2021 11:12:56 +0200 Subject: [PATCH] Use requireJS to load CodeMirror --- .../files/acp/templates/codemirror.tpl | 83 ++++++++----------- wcfsetup/install/files/js/require.config.js | 5 ++ 2 files changed, 41 insertions(+), 47 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/codemirror.tpl b/wcfsetup/install/files/acp/templates/codemirror.tpl index 5a27c7e6f7..38125aaa3b 100644 --- a/wcfsetup/install/files/acp/templates/codemirror.tpl +++ b/wcfsetup/install/files/acp/templates/codemirror.tpl @@ -1,57 +1,47 @@ -{if !$codemirrorLoaded|isset} - - - - - - -{/if} -{if $codemirrorMode|isset} - - {if $codemirrorMode != 'smartymixed'} - - {/if} - - {if $codemirrorMode == 'htmlmixed' || $codemirrorMode == 'smartymixed' || $codemirrorMode == 'php'} - {if $codemirrorMode == 'smartymixed'} - - - {elseif $codemirrorMode == 'php'} - - - {/if} - - - - - {/if} - - -{/if} {event name='javascriptIncludes'} -{assign var='codemirrorLoaded' value=true} diff --git a/wcfsetup/install/files/js/require.config.js b/wcfsetup/install/files/js/require.config.js index 041aadc6e1..9e90d71810 100644 --- a/wcfsetup/install/files/js/require.config.js +++ b/wcfsetup/install/files/js/require.config.js @@ -11,6 +11,11 @@ requirejs.config({ tslib: '3rdParty/tslib', zxcvbn: '3rdParty/zxcvbn', }, + packages: [{ + name: "codemirror", + location: "3rdParty/codemirror", + main: "lib/codemirror" + }], shim: { favico: { exports: 'Favico' }, 'perfect-scrollbar': { exports: 'PerfectScrollbar' }, -- 2.20.1