From 7c47ebe8f4a51b64ee225194a2a7184f96242f22 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 30 Sep 2015 00:17:09 -0400 Subject: [PATCH] Add site-vars.js containing site-wide javascript variables, and add the current page from the URL to it --- gulpfile.js | 1 + resources/assets/js/site-vars.js | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 resources/assets/js/site-vars.js diff --git a/gulpfile.js b/gulpfile.js index 2467d04..a9e4df6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,6 +12,7 @@ elixir.config.autoprefix = { remove: false, cascade: false, browsers: ['last 2 v // javascript files in resources/assets/js/ var jsLocal = [ + 'site-vars.js', 'app.js' ]; diff --git a/resources/assets/js/site-vars.js b/resources/assets/js/site-vars.js new file mode 100644 index 0000000..b2f8a6c --- /dev/null +++ b/resources/assets/js/site-vars.js @@ -0,0 +1,4 @@ +var SiteVars = { + page: location.href.replace(/https*:\/\/[^\/]*\//, '').replace(/(#|\?).*/, '') +}; +