Merge pull request #67 from nextcloud/debug-js

Include source js files when debug is enabled
This commit is contained in:
Julius Härtl
2017-03-05 14:14:13 +01:00
committed by GitHub
2 changed files with 19 additions and 2 deletions

View File

@@ -52,7 +52,8 @@ Nothing to prepare, just dig into the code.
### JavaScript
Make sure you have installed the dependencies with ```make install-deps```. After that you can run ```make``` to build the javascript code once or run ```make watch``` to run in on every file change.
When `'debug'=>true` is set in your config.php files will get loaded automatically. Otherwise you need to ensure that `public/app.js` is generated by running `make` or `make watch` to regenerate it on every change.
Make sure you have installed the dependencies with ```make install-deps```.
### Running tests
You can use the provided Makefile to run all tests by using:

View File

@@ -36,8 +36,24 @@ Util::addScript('deck', 'vendor/angular-ui-select/dist/select.min');
Util::addScript('deck', 'vendor/markdown-it/dist/markdown-it.min');
Util::addScript('deck', 'vendor/angular-markdown-it/dist/ng-markdownit.min');
Util::addScript('deck', 'vendor/markdown-it-link-target/dist/markdown-it-link-target.min');
Util::addScript('deck', 'public/app');
if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
Util::addScript('deck', 'public/app');
} else {
// Load seperate JS files when debug mode is enabled
$js = [
'app' => ['App', 'Config', 'Run'],
'controller' => ['AppController', 'BoardController', 'CardController', 'ListController'],
'directive' => ['appnavigationentryutils', 'appPopoverMenuUtils', 'autofocusoninsert', 'avatar', 'elastic', 'search'],
'filters' => ['cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'relativeDateFilter', 'textColorFilter'],
'service' => ['ApiService', 'BoardService', 'CardService', 'LabelService', 'StackService', 'StatusService'],
];
foreach($js as $folder=>$files) {
foreach ($files as $file) {
Util::addScript('deck', $folder.'/'.$file);
}
}
}
?>
<div id="app" class="app-deck" data-ng-app="Deck" ng-controller="AppController" ng-cloak>