Commit 1b93425e0e7b8ec720a24b705c1780c3729a5928

Authored by Victor Costa
1 parent 04dc10ea

Rename piwik config file

1 /* global define */ 1 /* global define */
2 -define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers', 'piwik'], function($, Handlebars, FastClick, ProposalApp){ 2 +define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers', 'piwik_config'], function($, Handlebars, FastClick, ProposalApp){
3 // 'use strict'; 3 // 'use strict';
4 4
5 // The template code 5 // The template code
js/piwik-config.js 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 +define(['piwik_config'], function(){
  2 +
  3 + var _paq = _paq || [];
  4 + _paq.push(["trackPageView"]);
  5 + _paq.push(["enableLinkTracking"]);
  6 +
  7 + var isProduction = /^http:\/\/dialoga\.gov\.br\//.test(window.location.href);
  8 + var siteId = isProduction ? "65" : "1";
  9 +
  10 + (function() {
  11 + var u="http://estatisticas.dialoga.gov.br/";
  12 + _paq.push(["setTrackerUrl", u+"piwik.php"]);
  13 + _paq.push(["setSiteId", siteId]);
  14 + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
  15 + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  16 + })();
  17 +
  18 + window._paq = _paq;
  19 + return _paq;
  20 +
  21 +});
js/piwik.js
@@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
1 -define(['piwik'], function(){  
2 -  
3 - var _paq = _paq || [];  
4 - _paq.push(["trackPageView"]);  
5 - _paq.push(["enableLinkTracking"]);  
6 -  
7 - var isProduction = /^http:\/\/dialoga\.gov\.br\//.test(window.location.href);  
8 - var siteId = isProduction ? "65" : "1";  
9 -  
10 - (function() {  
11 - var u="http://estatisticas.dialoga.gov.br/";  
12 - _paq.push(["setTrackerUrl", u+"piwik.php"]);  
13 - _paq.push(["setSiteId", siteId]);  
14 - var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";  
15 - g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);  
16 - })();  
17 -  
18 - window._paq = _paq;  
19 - return _paq;  
20 -  
21 -});  
js/requirejs-config.js
@@ -8,7 +8,7 @@ requirejs.config({ @@ -8,7 +8,7 @@ requirejs.config({
8 baseUrl: base, 8 baseUrl: base,
9 waitSeconds: 0, 9 waitSeconds: 0,
10 paths: { 10 paths: {
11 - piwik: 'piwik', 11 + piwik_config: 'piwik-config',
12 jquery: 'jquery-2.1.3.min', 12 jquery: 'jquery-2.1.3.min',
13 jquery_xdomainrequest: 'jquery.xdomainrequest.min', 13 jquery_xdomainrequest: 'jquery.xdomainrequest.min',
14 jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min', 14 jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min',
@@ -78,6 +78,6 @@ requirejs.config({ @@ -78,6 +78,6 @@ requirejs.config({
78 } 78 }
79 }); 79 });
80 80
81 -requirejs(['piwik']); 81 +requirejs(['piwik_config']);
82 requirejs(['jquery', 'proposal_app', 'jquery_ui', 'jquery_xdomainrequest', 'jquery_timeago_pt', 'jquery_simplePagination', 'jquery_equalHeights', 'footable', 'handlebars_helpers']); 82 requirejs(['jquery', 'proposal_app', 'jquery_ui', 'jquery_xdomainrequest', 'jquery_timeago_pt', 'jquery_simplePagination', 'jquery_equalHeights', 'footable', 'handlebars_helpers']);
83 requirejs(['slick', 'fastclick', 'jquery_maxlength', 'layout','main']); 83 requirejs(['slick', 'fastclick', 'jquery_maxlength', 'layout','main']);