Separated 3rdparty files from app files

This commit is contained in:
Pierre 2017-06-23 19:09:45 +02:00
parent 7ec9e23517
commit 7033e22dbe
2 changed files with 59 additions and 35 deletions

View File

@ -8,8 +8,8 @@
//Path to assets
$config['pathAssets'] = $config['siteURL']."assets/";
//CSS files to include
$config['CSSfiles'] = array(
//3rdparty CSS files to include
$config['3rdPartyCSSfiles'] = array(
//CSS files - adminLTE distribution / bootstrap / plugins
"%PATH_ASSETS%3rdparty/adminLTE/bootstrap/css/bootstrap.min.css",
"%PATH_ASSETS%3rdparty/adminLTE/plugins/font-awesome/css/font-awesome.min.css",
@ -19,7 +19,10 @@ $config['CSSfiles'] = array(
"%PATH_ASSETS%3rdparty/adminLTE/plugins/select2/select2.min.css",
"%PATH_ASSETS%3rdparty/adminLTE/dist/css/AdminLTE.min.css",
"%PATH_ASSETS%3rdparty/adminLTE/dist/css/skins/_all-skins.min.css",
);
//App CSS files
$config['CSSfiles'] = array(
//App stylesheets - common stylesheets
"%PATH_ASSETS%css/common/global.css",
"%PATH_ASSETS%css/common/page/waitSplashScreen.css",
@ -47,38 +50,41 @@ $config['CSSfiles'] = array(
"%PATH_ASSETS%css/components/emoji/parser.css",
);
//JS files to include (at the end of the page)
//3rd party JS files to include (at the end of the page)
$config['3rdPartyJSfiles'] = array(
//Jquery
"%PATH_ASSETS%3rdparty/adminLTE/plugins/jQuery/jquery-2.2.3.min.js",
//Bootstrap
"%PATH_ASSETS%3rdparty/adminLTE/bootstrap/js/bootstrap.min.js",
//JQuery UI
"%PATH_ASSETS%3rdparty/adminLTE/plugins/jquery-ui/jquery-ui.min.js",
//iCheck
"%PATH_ASSETS%3rdparty/adminLTE/plugins/iCheck/icheck.min.js",
//Slimscroll
"%PATH_ASSETS%3rdparty/adminLTE/plugins/slimScroll/jquery.slimscroll.min.js",
//Select2
"%PATH_ASSETS%3rdparty/adminLTE/plugins/select2/select2.min.js",
//adminLTE script
"%PATH_ASSETS%3rdparty/adminLTE/dist/js/app.min.js",
//Bootstrap notify
"%PATH_ASSETS%3rdparty/bootstrap-notify-3.1.3.min.js",
//Twitter emojies
"%PATH_ASSETS%3rdparty/twemoji/2/twemoji.min.js",
//Textarea auto-size
"%PATH_ASSETS%3rdparty/jquery.textarea_autosize/jquery.textarea_autosize.min.js",
);
//Application JS files
$config['JSfiles'] = array(
//Framework inclusions
//Jquery
"%PATH_ASSETS%3rdparty/adminLTE/plugins/jQuery/jquery-2.2.3.min.js",
//Bootstrap
"%PATH_ASSETS%3rdparty/adminLTE/bootstrap/js/bootstrap.min.js",
//JQuery UI
"%PATH_ASSETS%3rdparty/adminLTE/plugins/jquery-ui/jquery-ui.min.js",
//iCheck
"%PATH_ASSETS%3rdparty/adminLTE/plugins/iCheck/icheck.min.js",
//Slimscroll
"%PATH_ASSETS%3rdparty/adminLTE/plugins/slimScroll/jquery.slimscroll.min.js",
//Select2
"%PATH_ASSETS%3rdparty/adminLTE/plugins/select2/select2.min.js",
//adminLTE script
"%PATH_ASSETS%3rdparty/adminLTE/dist/js/app.min.js",
//Bootstrap notify
"%PATH_ASSETS%3rdparty/bootstrap-notify-3.1.3.min.js",
//Twitter emojies
"%PATH_ASSETS%3rdparty/twemoji/2/twemoji.min.js",
//Textarea auto-size
"%PATH_ASSETS%3rdparty/jquery.textarea_autosize/jquery.textarea_autosize.min.js",
//Utilities
"%PATH_ASSETS%js/common/utils.js",

View File

@ -35,7 +35,16 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo config['pathAssets']; ?>img/favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="<?php echo config['pathAssets']; ?>img/favicon.png" />
<!--Stylesheet requirements -->
<!--3rdPary Stylesheet requirements -->
<?php
foreach($config['3rdPartyCSSfiles'] as $file){
//Include CSS file
$file = str_replace("%PATH_ASSETS%", $config['pathAssets'], $file);
echo CSSFileInclusionCode($file);
}
?>
<!--App Stylesheet requirements -->
<?php
foreach($config['CSSfiles'] as $file){
//Include CSS file
@ -90,7 +99,16 @@
<p><small>If this screen doesn't disappear after a while, please check javascript is enabled in your browser...</small></p>
</div>
<!-- Javascript files inclusion -->
<!-- 3rdparty Javascript files inclusion -->
<?php
foreach($config['3rdPartyJSfiles'] as $file){
//Include JS file
$file = str_replace("%PATH_ASSETS%", $config['pathAssets'], $file);
echo javascriptFileInclusionCode($file);
}
?>
<!-- Application Javascript files inclusion -->
<?php
foreach($config['JSfiles'] as $file){
//Include JS file