Download raven-js like other Javascript plugins instead of relying on its CDN
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Thu, 12 Dec 2013 21:34:58 +0000 (22:34 +0100)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 14 Dec 2013 16:49:05 +0000 (17:49 +0100)
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
Makefile
classes/xnetpage.php
classes/xorgpage.php
htdocs/javascript/.gitignore
templates/platal/raven.tpl

index 4f1ccd1..b1fd7d7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ endef
 
 all: build
 
-build: core conf static banana wiki openid medals jquery maps
+build: core conf static banana wiki openid medals jquery maps raven
 
 check:
        @!(find . -name '*.php' -exec php -l {} ";" | grep -v 'No syntax errors detected')
@@ -256,6 +256,19 @@ htdocs/javascript/markerclusterer.js:
        wget "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js?r=308" -O htdocs/javascript/markerclusterer.js
 
 ##
+## Raven-js
+##
+RAVEN_VERSION=1.1.2
+raven: htdocs/javascript/raven.min.js
+
+# Documentation: http://raven-js.readthedocs.org/en/latest/install/index.html
+htdocs/javascript/raven.min.js: DOWNLOAD_SRC = http://cdn.ravenjs.com/1.1.2/raven.min.js
+htdocs/javascript/raven.min.js:
+       @-rm htdocs/javascript/raven*.js:
+       $(download)
+
+
+##
 ## lists rpc
 ##
 start-listrpc: spool/run
index c124057..1ef1ecd 100644 (file)
@@ -27,6 +27,7 @@ class XnetPage extends PlPage
 
     public function __construct()
     {
+        global $globals;
         parent::__construct();
 
         $this->register_function('list_all_my_groups', 'list_all_my_groups');
@@ -48,6 +49,9 @@ class XnetPage extends PlPage
         $this->addJsLink('overlib.js');
         $this->addJsLink('core.js');
         $this->addJsLink('xorg.js');
+        if ($globals->core->sentry_js_dsn) {
+            $this->addJsLink('raven.min.js');
+        }
         $this->setTitle('Les associations polytechniciennes');
     }
 
index 0baad1e..2ffcf4e 100644 (file)
@@ -26,6 +26,7 @@ class XorgPage extends PlPage
 
     public function __construct()
     {
+        global $globals;
         parent::__construct();
 
         // Set the default page
@@ -37,6 +38,9 @@ class XorgPage extends PlPage
         $this->addJsLink('overlib.js');
         $this->addJsLink('core.js');
         $this->addJsLink('xorg.js');
+        if ($globals->core->sentry_js_dsn) {
+            $this->addJsLink('raven.min.js');
+        }
         $this->setTitle('le site des élèves et anciens élèves de l\'École polytechnique');
         if (S::logged() && S::user()->checkPerms('admin')) {
             $types = array(S::user()->type);
index 6c46558..5ff7a5c 100644 (file)
@@ -9,3 +9,6 @@
 
 # Google Maps auxiliary scripts
 /markerclusterer.js
+
+# Raven-js
+/raven*.js
index e33bc08..6c164e3 100644 (file)
@@ -21,8 +21,7 @@
 {**************************************************************************}
 
 {if $globals->core->sentry_js_dsn}
-    {* Minified raven *}
-    <script type="text/javascript" src="//d3nslu0hdya83q.cloudfront.net/dist/1.0/raven.min.js"></script>
+    {* Raven.js is included with PlPage::addJsLink('raven.min.js') *}
     <script type="text/javascript">
     {literal}
         var options = {};