[NC] Remove jQuery dependency for theme's navbar.js

It wasn't really necessary and could lead to the whole megamenu not
being loaded under certain circumstances.
GON-3874-DD-moodle
Evilham 2022-11-10 16:28:33 +01:00
parent f355b160a1
commit 75e314ff7e
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
3 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,6 @@
/* /*
* Copyright © 2021,2022 IsardVDI S.L. * Copyright © 2021,2022 IsardVDI S.L.
* Copyright © 2022 Evilham <contact@evilham.com>
* *
* This file is part of DD * This file is part of DD
* *
@ -18,7 +19,7 @@
* *
* SPDX-License-Identifier: AGPL-3.0-or-later * SPDX-License-Identifier: AGPL-3.0-or-later
*/ */
jQuery(document).ready(() => { document.addEventListener("DOMContentLoaded", () => {
base_url = `${window.location.protocol}//${window.location.host.replace(/^nextcloud\./, 'api.')}` base_url = `${window.location.protocol}//${window.location.host.replace(/^nextcloud\./, 'api.')}`
$.getJSON(`${base_url}/json`, (result) => { $.getJSON(`${base_url}/json`, (result) => {
if (result.logo) { if (result.logo) {
@ -32,7 +33,6 @@ jQuery(document).ready(() => {
} }
}) })
$.get(`${base_url}/header/html/nextcloud`, (result) => { $.get(`${base_url}/header/html/nextcloud`, (result) => {
console.log(result)
$("#settings").before(result) $("#settings").before(result)
$('#dropdownMenuAppsButton').click(() => { $('#dropdownMenuAppsButton').click(() => {
$('#dropdownMenuApps').toggle() $('#dropdownMenuApps').toggle()

View File

@ -53,7 +53,6 @@
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>"> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>"> <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
<link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>"> <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>">
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="/themes/dd/core/js/jquery_slim_3.2.1.js"></script>
<link rel="stylesheet" href="<?php p($api_url) ?>/css/font-awesome-4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="<?php p($api_url) ?>/css/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php p($api_url) ?>/css/dd.css"> <link rel="stylesheet" href="<?php p($api_url) ?>/css/dd.css">
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="/themes/dd/core/js/navbar.js"></script> <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="/themes/dd/core/js/navbar.js"></script>

1
dd-ctl
View File

@ -741,7 +741,6 @@ upgrade_plugins_moodle(){
} }
upgrade_plugins_nextcloud(){ upgrade_plugins_nextcloud(){
wget https://code.jquery.com/jquery-3.2.1.slim.min.js -O "$SRC_FOLDER/nextcloud/themes/dd/core/js/jquery_slim_3.2.1.js"
cp -R dd-apps/docker/nextcloud/src/* "$SRC_FOLDER/nextcloud/" cp -R dd-apps/docker/nextcloud/src/* "$SRC_FOLDER/nextcloud/"
nextcloud_upgrade nextcloud_upgrade
} }