Browse Source

add only page-related scripts loading

main
ghost 3 years ago
parent
commit
2a9e5f25e5
  1. 13
      src/application/controller/follow.php
  2. 13
      src/application/controller/home.php
  3. 12
      src/application/view/common/header/user.phtml

13
src/application/controller/follow.php

@ -7,6 +7,19 @@ if (!isset($_SESSION['userName'])) { @@ -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 = [];

13
src/application/controller/home.php

@ -7,4 +7,17 @@ if (!isset($_SESSION['userName'])) { @@ -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');

12
src/application/view/common/header/user.phtml

@ -9,13 +9,13 @@ @@ -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">

Loading…
Cancel
Save