diff --git a/app/assets/javascripts/corp/contact.js b/app/assets/javascripts/corp/contact.js index a4852590c..0b963ab68 100644 --- a/app/assets/javascripts/corp/contact.js +++ b/app/assets/javascripts/corp/contact.js @@ -52,7 +52,6 @@ $('div.field', $feedback).removeClass('error'); $submit.val("THANKS!"); - }). fail(function(xhr, textStatus, errorMessage) { $submit.val("SEND"); diff --git a/app/assets/javascripts/homeScreen.js b/app/assets/javascripts/homeScreen.js index 349369a14..eeedd9245 100644 --- a/app/assets/javascripts/homeScreen.js +++ b/app/assets/javascripts/homeScreen.js @@ -22,15 +22,32 @@ } function mouseenterTile() { - console.log("mouseenterTile!") $(this).addClass('hover'); } function mouseleaveTile() { - console.log("mouse leave tile") $(this).removeClass('hover'); } + function switchClientMode(e) { + // ctrl + shift + 0 + if(e.ctrlKey && e.shiftKey && e.keyCode == 48) { + console.log("switch client mode!"); + var act_as_native_client = $.cookie('act_as_native_client'); + + console.log("currently: " + act_as_native_client); + if(act_as_native_client == null || act_as_native_client != "true") { + console.log("forcing act as native client!"); + $.cookie('act_as_native_client', 'true', { expires: 120, path: '/' }); + } + else { + console.log("remove act as native client!"); + $.removeCookie('act_as_native_client'); + } + window.location.reload(); + } + } + function userHasDevices() { // undo any earlier disabling $('.homecard.createsession, .homecard.findsession').removeClass('disabled'); @@ -60,6 +77,9 @@ $('.homecard.profile, .homecard.feed, .homecard.account').on('mouseenter', mouseenterTile); $('.homecard.profile, .homecard.feed, .homecard.account').on('mouseleave', mouseleaveTile); $('div[layout-id=ftue]').on("ftue_success", refreshDeviceState); + if(gon.allow_force_native_client) { + $('body').on('keyup', switchClientMode); + } } function updateTiles() { @@ -83,6 +103,7 @@ app.bindScreen('home', screenBindings); events(); + }; this.beforeShow = beforeShow; diff --git a/app/assets/stylesheets/client/home.css.scss b/app/assets/stylesheets/client/home.css.scss index 1e3ef1148..8347b83ca 100644 --- a/app/assets/stylesheets/client/home.css.scss +++ b/app/assets/stylesheets/client/home.css.scss @@ -24,6 +24,12 @@ .homecard.account { background-image: url(/assets/content/bkg_home_account.jpg); } +.homecard.bands { + background-image: url(/assets/content/bkg_home_bands.jpg); +} +.homecard.musicians { + background-image: url(/assets/content/bkg_home_musicians.jpg); +} .homecard.disabled { cursor:default; @@ -65,4 +71,12 @@ .homecard.account.hover { background-image: url(/assets/content/bkg_home_account_x.jpg); } +.homecard.bands.hover { + background-image: url(/assets/content/bkg_home_bands_x.jpg); +} +.homecard.musicians.hover { + background-image: url(/assets/content/bkg_home_musicians_x.jpg); +} + + diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index a5924bdaa..043c1efd7 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -8,6 +8,18 @@ class ClientsController < ApplicationController gon.check_for_client_updates = Rails.application.config.check_for_client_updates gon.fp_apikey = Rails.application.config.filepicker_rails.api_key gon.fp_upload_dir = Rails.application.config.filepicker_upload_dir + gon.allow_force_native_client = Rails.application.config.allow_force_native_client + + # is this the native client or browser? + user_agent = request.env["HTTP_USER_AGENT"] + @nativeClient = !user_agent.blank? && user_agent.downcase.include?("jamkazam") + + # allow override of the client type if configured to so, and if we find the override cookie in place + if Rails.application.config.allow_force_native_client + unless cookies[:act_as_native_client].nil? + @nativeClient = (cookies[:act_as_native_client] == "true") ? true : false + end + end if current_user render :layout => 'client' diff --git a/app/views/clients/_bands.html.erb b/app/views/clients/_bands.html.erb new file mode 100644 index 000000000..88aa5fd7a --- /dev/null +++ b/app/views/clients/_bands.html.erb @@ -0,0 +1,13 @@ + +
This feature not yet implemented
+This feature not yet implemented
+