* VRFS-478 done with ctrl + shift + 0 secret hotkey to make browser act like a native client
This commit is contained in:
parent
039a632a74
commit
1190047bf2
|
|
@ -52,7 +52,6 @@
|
|||
$('div.field', $feedback).removeClass('error');
|
||||
|
||||
$submit.val("THANKS!");
|
||||
|
||||
}).
|
||||
fail(function(xhr, textStatus, errorMessage) {
|
||||
$submit.val("SEND");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Band Screen -->
|
||||
<div layout="screen" layout-id="bands" class="screen secondary">
|
||||
<div class="content-head">
|
||||
<!--
|
||||
<div class="content-icon">
|
||||
<%= image_tag "shared/icon_bands.png", {:height => 19, :width => 19} %>
|
||||
</div>
|
||||
-->
|
||||
<h1>bands</h1>
|
||||
<%= render "screen_navigation" %>
|
||||
</div>
|
||||
<p>This feature not yet implemented</p>
|
||||
</div>
|
||||
|
|
@ -1,31 +1,72 @@
|
|||
<div layout="screen" layout-id="home" class="screen">
|
||||
<!-- Grid is the count of the smallest spaces, then
|
||||
individual spells span those spaces -->
|
||||
<div layout-grid="2x4" class="grid">
|
||||
<div layout-grid-position="0,0" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="createSession" class="homecard createsession">
|
||||
<h2>create session</h2>
|
||||
<div class="homebox-info"><!-- 4 friends online, 2 currently in sessions --></div>
|
||||
<!-- Grid is the count of the smallest spaces, then
|
||||
individual spells span those spaces -->
|
||||
<% if @nativeClient %>
|
||||
<div layout-grid="2x4" class="grid">
|
||||
<div layout-grid-position="0,0" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="createSession" class="homecard createsession">
|
||||
<h2>create session</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 4 friends online, 2 currently in sessions --></div>
|
||||
</div>
|
||||
<div layout-grid-position="2,0" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="findSession" class="homecard findsession">
|
||||
<h2>find session</h2>
|
||||
<div class="homebox-info"><!-- 1 session invitation, 19 public sessions active --></div>
|
||||
<div layout-grid-position="2,0" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="findSession" class="homecard findsession">
|
||||
<h2>find session</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 1 session invitation, 19 public sessions active --></div>
|
||||
</div>
|
||||
<div layout-grid-position="0,1" layout-grid-rows="1" layout-grid-columns="1"
|
||||
class="homecard profile">
|
||||
<h2>profile</h2>
|
||||
<div class="homebox-info"><!-- 5 followers, 3 following --></div>
|
||||
<div layout-grid-position="0,1" layout-grid-rows="1" layout-grid-columns="1"
|
||||
class="homecard profile">
|
||||
<h2>profile</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 5 followers, 3 following --></div>
|
||||
</div>
|
||||
<div layout-grid-position="1,1" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="feed" class="homecard feed">
|
||||
<h2>feed</h2>
|
||||
<div class="homebox-info"><!-- 38 new recordings, 19 sessions open to fans --></div>
|
||||
<div layout-grid-position="1,1" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="feed" class="homecard feed">
|
||||
<h2>feed</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 38 new recordings, 19 sessions open to fans --></div>
|
||||
</div>
|
||||
<div layout-grid-position="3,1" layout-grid-rows="1" layout-grid-columns="1"
|
||||
layout-link="account" class="homecard account">
|
||||
<h2>account</h2>
|
||||
<div class="homebox-info"><!-- free service level --></div>
|
||||
<div layout-grid-position="3,1" layout-grid-rows="1" layout-grid-columns="1"
|
||||
layout-link="account" class="homecard account">
|
||||
<h2>account</h2>
|
||||
|
||||
<div class="homebox-info"><!-- free service level --></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div layout-grid="2x4" class="grid">
|
||||
<div layout-grid-position="0,0" layout-grid-rows="1" layout-grid-columns="1"
|
||||
layout-link="feed" class="homecard feed">
|
||||
<h2>feed</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 4 friends online, 2 currently in sessions --></div>
|
||||
</div>
|
||||
<div layout-grid-position="1,0" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="bands" class="homecard bands">
|
||||
<h2>bands</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 1 session invitation, 19 public sessions active --></div>
|
||||
</div>
|
||||
<div layout-grid-position="3,0" layout-grid-rows="1" layout-grid-columns="1"
|
||||
layout-link="musicians" class="homecard musicians">
|
||||
<h2>musicians</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 5 followers, 3 following --></div>
|
||||
</div>
|
||||
<div layout-grid-position="0,1" layout-grid-rows="1" layout-grid-columns="2"
|
||||
class="homecard profile">
|
||||
<h2>profile</h2>
|
||||
|
||||
<div class="homebox-info"><!-- 38 new recordings, 19 sessions open to fans --></div>
|
||||
</div>
|
||||
<div layout-grid-position="2,1" layout-grid-rows="1" layout-grid-columns="2"
|
||||
layout-link="account" class="homecard account">
|
||||
<h2>account</h2>
|
||||
|
||||
<div class="homebox-info"><!-- free service level --></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Musician Screen -->
|
||||
<div layout="screen" layout-id="musicians" class="screen secondary">
|
||||
<div class="content-head">
|
||||
<!--
|
||||
<div class="content-icon">
|
||||
<%= image_tag "shared/icon_musicians.png", {:height => 19, :width => 19} %>
|
||||
</div>
|
||||
-->
|
||||
<h1>musicians</h1>
|
||||
<%= render "screen_navigation" %>
|
||||
</div>
|
||||
<p>This feature not yet implemented</p>
|
||||
</div>
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
<%= render "session" %>
|
||||
<%= render "profile" %>
|
||||
<%= render "feed" %>
|
||||
<%= render "bands" %>
|
||||
<%= render "musicians" %>
|
||||
<%= render "testBridge" %>
|
||||
<%= render "account" %>
|
||||
<%= render "account_identity" %>
|
||||
|
|
|
|||
|
|
@ -143,5 +143,8 @@ if defined?(Bundler)
|
|||
|
||||
# client update killswitch; turn on if client updates are broken and are affecting users
|
||||
config.check_for_client_updates = true
|
||||
|
||||
# allow hot-key to switch between native and normal client
|
||||
config.allow_force_native_client = true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -80,4 +80,6 @@ SampleApp::Application.configure do
|
|||
# filepicker app configured to use S3 bucket jamkazam
|
||||
config.filepicker_rails.api_key = "AhUoVoBZSLirP3esyCl7Zz"
|
||||
config.fp_secret = 'HZBIMSOI5VAQ5LXT4XLG6XA7IE'
|
||||
|
||||
config.allow_force_native_client = false
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue