diff --git a/Gemfile b/Gemfile index f720116a..fae722ef 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'json' gem 'rails3-jquery-autocomplete' gem 'best_in_place' gem 'kaminari' # pagination - +gem 'uservoice-ruby' gem 'paperclip' gem 'aws-sdk' diff --git a/Gemfile.lock b/Gemfile.lock index ee449288..1fc7e6af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,6 +58,7 @@ GEM warden (~> 1.2.3) erubis (2.7.0) execjs (2.0.2) + ezcrypto (0.7.2) formtastic (2.2.1) actionpack (>= 3.0) formula (1.0.1) @@ -84,6 +85,7 @@ GEM mini_portile (= 0.6.0) nokogiri (1.6.2.1-x86-mingw32) mini_portile (= 0.6.0) + oauth (0.4.7) orm_adapter (0.5.0) paperclip (4.1.1) activemodel (>= 3.0.0) @@ -141,6 +143,10 @@ GEM uglifier (2.5.0) execjs (>= 0.3.0) json (>= 1.8.0) + uservoice-ruby (0.0.11) + ezcrypto (>= 0.7.2) + json (>= 1.7.5) + oauth (>= 0.4.7) warden (1.2.3) rack (>= 1.0) @@ -167,3 +173,4 @@ DEPENDENCIES redis (= 2.2.2) sass-rails uglifier (>= 1.0.3) + uservoice-ruby diff --git a/app/assets/javascripts/lib/barometer.js b/app/assets/barometer.js similarity index 96% rename from app/assets/javascripts/lib/barometer.js rename to app/assets/barometer.js index be6b45fb..30b1451e 100644 --- a/app/assets/javascripts/lib/barometer.js +++ b/app/assets/barometer.js @@ -3,7 +3,7 @@ if(BAROMETER == undefined) { BAROMETER = {}; } -BAROMETER.load = function(barometer_id) { +//BAROMETER.load = function(barometer_id) { this.barometer_id = barometer_id; this.empty_url = "http://getbarometer.s3.amazonaws.com/assets/barometer/images/transparent.gif"; this.feedback_url = 'http://getbarometer.com/system/feedback_form/' + this.barometer_id; diff --git a/app/assets/javascripts/lib/uservoice.js b/app/assets/javascripts/lib/uservoice.js new file mode 100644 index 00000000..ae2e0f3f --- /dev/null +++ b/app/assets/javascripts/lib/uservoice.js @@ -0,0 +1,49 @@ +var USERVOICE; +if(USERVOICE == undefined) { + USERVOICE = {}; +} + +USERVOICE.load = function (barometer_id) { +// Include the UserVoice JavaScript SDK (only needed once on a page) +UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/wybK0nSMNuhlWkIKzTyWg.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})(); + +// +// UserVoice Javascript SDK developer documentation: +// https://www.uservoice.com/o/javascript-sdk +// + +// Set colors +UserVoice.push(['set', { + accent_color: '#448dd6', + trigger_color: 'white', + trigger_background_color: 'rgba(46, 49, 51, 0.6)' +}]); + +// Identify the user and pass traits +// To enable, replace sample data with actual user traits and uncomment the line +//TODO NEED HELP HERE MAKING SURE CORRECT USER DATA GETS PUSHED +UserVoice.push(['identify', { + //email: 'getElementsByTagName(userid)', // User’s email address + name: "userid", // User’s real name + //created_at: 1364406966, // Unix timestamp for the date the user signed up + id: "Metamaps.Active.Mapper.id", // Optional: Unique id of the user (if set, this should not change) + //type: 'Owner', // Optional: segment your users by type + //account: { + // id: 123, // Optional: associate multiple users with a single account + // name: 'Acme, Co.', // Account name + // created_at: 1364406966, // Unix timestamp for the date the account was created + // monthly_rate: 9.99, // Decimal; monthly rate of the account + // ltv: 1495.00, // Decimal; lifetime value of the account + // plan: 'Enhanced' // Plan name for the account + //} +}]); + +// Add default trigger to the bottom-right corner of the window: +UserVoice.push(['addTrigger', { mode: 'contact', trigger_position: 'bottom-left' }]); + +// Or, use your own custom trigger: +//UserVoice.push(['addTrigger', '#barometer_tab', { mode: 'contact' }]); + +// Autoprompt for Satisfaction and SmartVote (only displayed under certain conditions) +UserVoice.push(['autoprompt', {}]); +}; \ No newline at end of file diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 3cd98fb5..3c58b95d 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -40,6 +40,7 @@ Metamaps.Settings = { } }; + Metamaps.Touch = { touchPos: null, // this stores the x and y values of a current touch event touchDragNode: null // this stores a reference to a JIT node that is being dragged @@ -3685,3 +3686,4 @@ Metamaps.Admin = { } } }; + diff --git a/app/assets/stylesheets/barometer.css b/app/assets/stylesheets/uservoice.css similarity index 93% rename from app/assets/stylesheets/barometer.css rename to app/assets/stylesheets/uservoice.css index fbc21d3f..fd3c68f5 100644 --- a/app/assets/stylesheets/barometer.css +++ b/app/assets/stylesheets/uservoice.css @@ -1,23 +1,21 @@ -/* =Barometer feedback tab +/* =USERVOICE ICON DEFINE --------------------------------------------------------*/ -a#barometer_tab { - background-image:url(../images/feedback_tab.png); +div.uv-icon.uv-bottom-left { + background-image:url(feedback_sprite.png); background-color:#222222; color:#FFFFFF; cursor:pointer; - height:102px; + height:108px; left:0; - margin-left:-7px; - overflow:hidden; - position:fixed; + margin-left:0px; text-indent:-100000px; top:25%; - width:42px; + width:25px; z-index:100000; } -/* =Barometer Overlay +/* =NOTHING AFTER THIS POINT IS BEING USED --------------------------------------------------------*/ #barometer_overlay { diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 22745231..a05a85c3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -66,8 +66,8 @@ <%= render :partial => 'layouts/templates' %> <%= render :partial => 'shared/metacodeBgColors' %>