Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Scott Comer 2014-02-22 22:00:44 -06:00
commit 57d2dff00b
13 changed files with 132 additions and 40 deletions

View File

@ -3,18 +3,17 @@
"use strict";
context.JK = context.JK || {};
context.JK.AddNewGearDialog = function(app, ftueCallback) {
context.JK.AddNewGearDialog = function(app) {
var logger = context.JK.logger;
function events() {
$('#btn-leave-session-test').click(function() {
ftueCallback();
// TODO: THIS IS A HACK - THIS DIALOG IS LAYERED
// ON TOP OF OTHER DIALOGS. ANY OTHER DIALOGS THAT
// USE THIS NEED TO BE ADDED TO THE FOLLOWING LIST.
// NEED TO FIGURE OUT A CLEANER WAY TO HANDLE THIS.
app.layout.closeDialog('configure-audio');
context.location = "/client#/home";
app.layout.startNewFtue();
});
$('#btn-cancel-new-audio').click(function() {

View File

@ -451,7 +451,36 @@
return true;
}
function onSessionLeaveWarningAccepted(args) {
changeScreen(args.screen, args.data);
}
function onSessionLeaveWarningDeclined() {
context.location = "/client#/session/" + context.JK.CurrentSessionModel.id();
closeDialog('leave-session-warning');
}
function changeToScreen(screen, data) {
if (screen === currentScreen) {
return;
}
// special case to prompt user if they really want to leave session
if (currentScreen === "session") {
var args = {};
args.screen = screen;
args.data = data;
var leaveSessionWarningDialog = new context.JK.LeaveSessionWarningDialog(context.JK.app, onSessionLeaveWarningAccepted, onSessionLeaveWarningDeclined, args);
leaveSessionWarningDialog.initialize();
showDialog('leave-session-warning');
return;
}
else {
changeScreen(screen, data);
}
}
function changeScreen(screen, data) {
previousScreen = currentScreen;
currentScreen = screen;

View File

@ -0,0 +1,33 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.LeaveSessionWarningDialog = function(app, acceptCallback, declinedCallback, args) {
var logger = context.JK.logger;
var dialogId = 'leave-session-warning';
var $scopeSelector = "[layout-id='leave-session-warning']";
function events() {
$('#btn-accept', $scopeSelector).click(function(evt) {
if (acceptCallback) {
acceptCallback(args);
}
app.layout.closeDialog(dialogId);
});
$('#btn-cancel', $scopeSelector).click(function(evt) {
if (declinedCallback) {
declinedCallback();
}
});
}
function initialize() {
events();
}
this.initialize = initialize;
};
})(window,jQuery);

View File

@ -98,7 +98,7 @@
16: {"title": "", "message": ""}, // DECODE_VIOLATIONS,
17: {"title": "", "message": ""}, // LAST_THRESHOLD
18: {"title": "", "message": ""}, // WIFI_NETWORK_ALERT, //user or peer is using wifi
19: {"title": "No Audio Configuration", "message": "You cannot join the session because you do not have a valid audio configuration."}, // NO_VALID_AUDIO_CONFIG, // alert the user to popup a config
19: {"title": "No Audio Configuration", "message": "You cannot join the session because you do not have a valid audio configuration."}, // NO_VALID_AUDIO_CONFIG,
20: {"title": "", "message": ""}, // AUDIO_DEVICE_NOT_PRESENT, // the audio device is not connected
21: {"title": "", "message": ""}, // RECORD_PLAYBACK_STATE, // record/playback events have occurred
22: {"title": "", "message": ""}, // RUN_UPDATE_CHECK_BACKGROUND, //this is auto check - do
@ -424,11 +424,10 @@
});
}
function beforeHide(data) {
// track that the screen is inactive, to disable body-level handlers
screenActive = false;
sessionModel.leaveCurrentSession()
.fail(app.ajaxError);
function beforeHide(data) {
screenActive = false;
sessionModel.leaveCurrentSession()
.fail(app.ajaxError);
}
function handleTransitionsInRecordingPlayback() {
@ -840,12 +839,7 @@
});
configureTrackDialog = new context.JK.ConfigureTrackDialog(app, myTracks, sessionId, sessionModel);
addNewGearDialog = new context.JK.AddNewGearDialog(app, ftueCallback);
}
function ftueCallback() {
context.location = "/client#/home";
app.layout.showDialog('ftue');
addNewGearDialog = new context.JK.AddNewGearDialog(app);
}
function connectTrackToMixer(trackSelector, clientId, mixerId, gainPercent) {

View File

@ -566,7 +566,7 @@
// if this has already been initialized, re-init it so it picks up any new <options>
$item.easyDropDown('destroy')
}
$item.easyDropDown({nativeTouch: !gon.isNativeClient && gon.global.env != "test", cutOff:7});
$item.easyDropDown({nativeTouch: !(context.jamClient && context.jamClient.IsNativeClient()) && gon.global.env != "test", cutOff:7});
})
}

View File

@ -1,3 +1,10 @@
@mixin box_sizing {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
html {
min-height:100%;
}
@ -90,7 +97,7 @@ body.web {
padding:25px;
padding-top:0px;
line-height:130%;
h2 {
font-size:18px !important;
line-height:normal;
@ -209,7 +216,7 @@ body.web {
width:345px;
font-size:12px;
}
white-space: nowrap;
p, ul {
@ -269,24 +276,32 @@ body.web {
input[type=text], input[type=password] {
margin-top:1px;
width:100%;
@include box_sizing;
}
select {
width:100%;
}
#instrument_selector .easydropdown-wrapper .easydropdown {
box-shadow: none !important;
}
.easydropdown-wrapper {
width:100%;
.easydropdown {
padding: 0 3px;
padding: 0px;
width:100%;
box-shadow: none !important;
}
}
.right-side {
margin-left:25px;
}

View File

@ -0,0 +1,21 @@
<!-- Terms Dialog -->
<div class="dialog" layout="dialog" layout-id="leave-session-warning" style="max-width:550px;">
<div class="content-head">
<%= image_tag "content/icon_alert.png", {:width => 19, :height => 19, :class => 'content-icon' } %>
<h1>Warning</h1>
</div>
<div class="dialog-inner">
<span>
WARNING: This action will result in you leaving this session. You will no longer be
able to transmit or hear audio. Click OK below to proceed.
</span>
<br clear="left" /><br />
<div class="left">
<a id="btn-cancel" layout-action="close" class="button-orange">CANCEL</a>
</div>
<div class="right">
<a id="btn-accept" layout-action="close" class="button-orange">OK</a>
</div>
<br clear="all" />
</div>
</div>

View File

@ -39,7 +39,6 @@
<!-- Friends -->
<div layout="panel" layout-id="panelFriends">
<div layout-panel="collapsed">
F
</div>
<div layout-panel="expanded" class="panel expanded">
<div layout-panel="header" class="panel-header">
@ -89,7 +88,6 @@
<!--
<div layout="panel" layout-id="panelChat">
<div layout-panel="collapsed">
C
</div>
<div layout-panel="expanded" class="panel expanded">
<div layout-panel="header" class="panel-header">
@ -117,7 +115,6 @@
<!-- Notifications -->
<div layout="panel" layout-id="panelNotifications">
<div layout-panel="collapsed">
N
</div>
<div layout-panel="expanded" class="panel expanded">
<div layout-panel="header" class="panel-header">

View File

@ -15,6 +15,7 @@
<%= render "vu_meters" %>
<%= render "ftue" %>
<%= render "terms" %>
<%= render "leaveSessionWarning" %>
<%= render "alert" %>
<%= render "sidebar" %>
<%= render "createSession" %>

View File

@ -37,7 +37,7 @@
<div class="field country right-side">
<%= f.label :country, "Country:" %>
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off" class="easydropdown">
<option value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
<option class="label" value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
<% @countries.each do |country| %>
<% unless country.blank? %>
<option value="<%= country %>" <%= @location[:country] == country ? "selected" : "" %>><%= country %></option>

View File

@ -3,10 +3,10 @@ require 'spec_helper'
describe "Music Session", :js => true, :type => :feature, :capybara_feature => true, :slow => true do
def leave_music_session_cleanly(usr)
usr.music_session_histories.count.should be == 1
usr.music_session_user_histories.count.should be == 1
usr.music_session_histories[0].session_removed_at.should_not be_nil
usr.music_session_user_histories[0].session_removed_at.should_not be_nil
expect(usr.music_session_histories.count).to eq 1
expect(usr.music_session_user_histories.count).to eq 1
expect(usr.music_session_histories[0].session_removed_at).not_to be_nil
expect(usr.music_session_user_histories[0].session_removed_at).not_to be_nil
end
subject { page }
@ -20,19 +20,19 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
context "last person" do
before(:each) do
UserMailer.deliveries.clear
#pending
@user1, session_description = create_session
end
describe "cleanly leaves music session" do
it "should update music session user session history" do
pending
pending "session leave is not removing user's connection"
should have_link('session-leave')
click_link('session-leave')
leave_music_session_sleep_delay
@user1.reload
@user1.connections.count.should be == 0
expect(@user1.connections.count).to eq 0
leave_music_session_cleanly(@user1)
end
end
@ -45,14 +45,13 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
leave_music_session_sleep_delay
@user1.reload
@user1.connections.count.should be == 0
expect(@user1.connections.count).to eq 0
leave_music_session_cleanly(@user1)
end
end
end
context "second-to-last person " do
context "second-to-last person" do
before(:each) do
UserMailer.deliveries.clear
in_client(:user1_music_session) do
@ -62,6 +61,7 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
describe "cleanly leaves" do
it "should update music session and user session history" do
pending "session leave is not removing user's connection"
in_client(:user2_music_session) do
@user2, session_description = create_session
sleep 5
@ -70,7 +70,7 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
leave_music_session_sleep_delay
@user2.reload
@user2.connections.count.should be == 1
expect(@user2.connections.count).to eq 1
leave_music_session_cleanly(@user2)
end
end
@ -78,6 +78,7 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
describe "abruptly leaves" do
it "should update music session and user session history" do
pending "failing on build server"
in_client(:user2_music_session) do
@user2, session_description = create_session
sleep 5
@ -86,7 +87,7 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
leave_music_session_sleep_delay
@user2.reload
@user2.connections.count.should be == 0
expect(@user2.connections.count).to eq 0
leave_music_session_cleanly(@user2)
end
end

View File

@ -39,6 +39,7 @@ describe "Session Recordings", :js => true, :type => :feature, :capybara_feature
in_client(creator) do
find('#session-leave').trigger(:click)
find('#btn-accept').trigger(:click)
expect(page).to have_selector('h2', text: 'feed')
end
@ -75,6 +76,7 @@ describe "Session Recordings", :js => true, :type => :feature, :capybara_feature
in_client(creator) do
find('#session-leave').trigger(:click)
find('#btn-accept').trigger(:click)
expect(page).to have_selector('h2', text: 'feed')
end

View File

@ -144,7 +144,7 @@ describe Router do
describe "login" do
it "should not allow login of bogus user", :mq => true do
pending "broken currenly"
pending "broken currently due to some"
#em do
TestClient = Class.new do