From 2e6f04d0be53c7a0cdaa1ede795e3818fa473648 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Wed, 6 Apr 2016 10:27:31 +0800 Subject: [PATCH] metamaps.debug function, and move VERSION into a rails constant initializer. from this commit on, we would need to modify config/initializers/version.rb to increment the version number. --- app/assets/javascripts/src/Metamaps.Debug.js.erb | 7 +++++++ app/assets/javascripts/src/Metamaps.js.erb | 3 ++- app/views/layouts/_lightboxes.html.erb | 2 +- config/initializers/version.rb | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/src/Metamaps.Debug.js.erb create mode 100644 config/initializers/version.rb diff --git a/app/assets/javascripts/src/Metamaps.Debug.js.erb b/app/assets/javascripts/src/Metamaps.Debug.js.erb new file mode 100644 index 00000000..18fcb620 --- /dev/null +++ b/app/assets/javascripts/src/Metamaps.Debug.js.erb @@ -0,0 +1,7 @@ +Metamaps.Debug = function() { + console.debug(Metamaps) + console.debug(`Metamaps Version: ${Metamaps.VERSION}`) +} +Metamaps.debug = function() { + Metamaps.Debug() +} diff --git a/app/assets/javascripts/src/Metamaps.js.erb b/app/assets/javascripts/src/Metamaps.js.erb index c49e6801..231592da 100644 --- a/app/assets/javascripts/src/Metamaps.js.erb +++ b/app/assets/javascripts/src/Metamaps.js.erb @@ -16,11 +16,12 @@ var labelType, useGradients, nativeTextSupport, animate; animate = !(iStuff || !nativeCanvasSupport); })(); -// TODO eliminate these 4 top-level variables +// TODO eliminate these 5 top-level variables Metamaps.panningInt = null; Metamaps.tempNode = null; Metamaps.tempInit = false; Metamaps.tempNode2 = null; +Metamaps.VERSION = '<%= VERSION %>' Metamaps.Settings = { embed: false, // indicates that the app is on a page that is optimized for embedding in iFrames on other web pages diff --git a/app/views/layouts/_lightboxes.html.erb b/app/views/layouts/_lightboxes.html.erb index 53e402a9..225433ed 100644 --- a/app/views/layouts/_lightboxes.html.erb +++ b/app/views/layouts/_lightboxes.html.erb @@ -18,7 +18,7 @@

PRIVATE BETA

-

2.8

+

<%= VERSION %>

Mar 26, 2016

diff --git a/config/initializers/version.rb b/config/initializers/version.rb new file mode 100644 index 00000000..9fd9407f --- /dev/null +++ b/config/initializers/version.rb @@ -0,0 +1 @@ +VERSION = '2.8.3'