add only page-related scripts loading

This commit is contained in:
ghost 2021-12-30 22:17:06 +02:00
parent 56042ea5a8
commit 2a9e5f25e5
3 changed files with 32 additions and 6 deletions

View File

@ -7,6 +7,19 @@ if (!isset($_SESSION['userName'])) {
$metaTitle = _('Following | Twisterarmy Cloud');
// Load dependencies
$metaStyles = [
'css/template/default/module/menu.css',
'css/template/default/module/post.css',
'css/template/default/module/feed.css',
];
$metaScripts = [
'js/module/menu.js',
'js/module/post.js',
'js/module/feed.js',
];
$followingUsersTotal = 0;
$followingUsers = [];

View File

@ -7,4 +7,17 @@ if (!isset($_SESSION['userName'])) {
$metaTitle = _('Home | Twisterarmy Cloud');
// Load dependencies
$metaStyles = [
'css/template/default/module/menu.css',
'css/template/default/module/post.css',
'css/template/default/module/feed.css',
];
$metaScripts = [
'js/module/menu.js',
'js/module/post.js',
'js/module/feed.js',
];
require(PROJECT_DIR . '/application/view/home.phtml');

View File

@ -9,13 +9,13 @@
<link rel="stylesheet" type="text/css" href="css/template/default/common.css" />
<link rel="stylesheet" type="text/css" href="css/template/default/mobile.css" />
<link rel="stylesheet" type="text/css" href="css/template/default/app.css" />
<link rel="stylesheet" type="text/css" href="css/template/default/module/menu.css" />
<link rel="stylesheet" type="text/css" href="css/template/default/module/post.css" />
<link rel="stylesheet" type="text/css" href="css/template/default/module/feed.css" />
<?php foreach ($metaStyles as $metaStyle) { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $metaStyle ?>" />
<?php } ?>
<script src="js/jquery.js"></script>
<script src="js/module/menu.js"></script>
<script src="js/module/post.js"></script>
<script src="js/module/feed.js"></script>
<?php foreach ($metaScripts as $metaScript) { ?>
<script src="<?php echo $metaScript ?>"></script>
<?php } ?>
<script src="js/home.js"></script>
</head>
<body class="bg-c-1 bg-img-1 c-0">