From 8e18c1a2ed60ece96e808944d97ea7d3cac92170 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Thu, 12 Dec 2013 22:34:58 +0100 Subject: [PATCH] Download raven-js like other Javascript plugins instead of relying on its CDN Signed-off-by: Nicolas Iooss --- Makefile | 15 ++++++++++++++- classes/xnetpage.php | 4 ++++ classes/xorgpage.php | 4 ++++ htdocs/javascript/.gitignore | 3 +++ templates/platal/raven.tpl | 3 +-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4f1ccd1..b1fd7d7 100644 --- 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 diff --git a/classes/xnetpage.php b/classes/xnetpage.php index c124057..1ef1ecd 100644 --- a/classes/xnetpage.php +++ b/classes/xnetpage.php @@ -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'); } diff --git a/classes/xorgpage.php b/classes/xorgpage.php index 0baad1e..2ffcf4e 100644 --- a/classes/xorgpage.php +++ b/classes/xorgpage.php @@ -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); diff --git a/htdocs/javascript/.gitignore b/htdocs/javascript/.gitignore index 6c46558..5ff7a5c 100644 --- a/htdocs/javascript/.gitignore +++ b/htdocs/javascript/.gitignore @@ -9,3 +9,6 @@ # Google Maps auxiliary scripts /markerclusterer.js + +# Raven-js +/raven*.js diff --git a/templates/platal/raven.tpl b/templates/platal/raven.tpl index e33bc08..6c164e3 100644 --- a/templates/platal/raven.tpl +++ b/templates/platal/raven.tpl @@ -21,8 +21,7 @@ {**************************************************************************} {if $globals->core->sentry_js_dsn} - {* Minified raven *} - + {* Raven.js is included with PlPage::addJsLink('raven.min.js') *}