From 71a3528510f0ef6e640fae79b9e30f0e639b716e Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Tue, 30 Nov 2021 15:46:09 +0100 Subject: Allow scripts prioritization based on other apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- lib/private/TemplateLayout.php | 4 ++-- lib/private/legacy/OC_Util.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/private') diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 639e7dc007b..317862ff386 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -96,7 +96,7 @@ class TemplateLayout extends \OC_Template { $this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry()); $this->initialState->provideInitialState('unified-search', 'limit-default', SearchQuery::LIMIT_DEFAULT); - Util::addScript('dist/unified-search', null, true); + Util::addScript('core', 'dist/unified-search', 'core'); // Add navigation entry $this->assign('application', ''); @@ -209,7 +209,7 @@ class TemplateLayout extends \OC_Template { } // Add the js files - $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); + $jsFiles = self::findJavascriptFiles(array_merge(\OC_Util::$scripts, Util::getScripts())); $this->assign('jsfiles', []); if ($this->config->getSystemValue('installed', false) && $renderAs != TemplateResponse::RENDER_AS_ERROR) { // this is on purpose outside of the if statement below so that the initial state is prefilled (done in the getConfig() call) diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 6239583160b..80114a60b89 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -580,6 +580,8 @@ class OC_Util { /** * add a javascript file * + * @deprecated 24.0.0 + * * @param string $application application id * @param string|null $file filename * @param bool $prepend prepend the Script to the beginning of the list @@ -611,6 +613,8 @@ class OC_Util { /** * add a translation JS file * + * @deprecated 24.0.0 + * * @param string $application application id * @param string|null $languageCode language code, defaults to the current language * @param bool|null $prepend prepend the Script to the beginning of the list -- cgit v1.2.3