Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2015-09-08 01:00:29 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2015-09-08 11:38:01 +0300
commit35e60a1b8fcdc6b9c5a1441cf6ef7d103a6a6e1c (patch)
tree2b47e000dac1af33fe5b57fae7187a4fd092eb0f /templates
parent2331291a7a00bf4e851f9d02b75fc5a2c109c156 (diff)
load optimized js files only in debug mode
Diffstat (limited to 'templates')
-rw-r--r--templates/index.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/templates/index.php b/templates/index.php
index 39fb8385c..531a02558 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -1,12 +1,23 @@
<?php
+
+// TODO: remove DEBUG constant check once minimum oc
+// core version >= 8.2, see https://github.com/owncloud/core/pull/18510
+$debug = (defined('DEBUG') && DEBUG)
+ || \OC::$server->getSystemConfig()->getValue('debug', false);
+
style('mail','mail');
style('mail','mobile');
script('mail','vendor/autosize/jquery.autosize');
script('mail', 'vendor/jQuery-Storage-API/jquery.storageapi');
script('mail', 'vendor/jquery-visibility/jquery-visibility');
script('mail', 'vendor/requirejs/require');
-//script('mail', 'require_config');
-script('mail', 'mail.min');
+if ($debug) {
+ // Load JS dependencies asynchronously as specified in require_config.js
+ script('mail', 'require_config');
+} else {
+ // Load optimzed requirejs dependencies in one single file
+ script('mail', 'mail.min');
+}
?>
<div id="app">
@@ -140,7 +151,4 @@ script('mail', 'mail.min');
</form>
<div id="mail-message" class="icon-loading hidden-mobile"></div>
</div>
-</div>
-<script type="text/javascript">
- alert(1);
-</script> \ No newline at end of file
+</div> \ No newline at end of file