diff --git a/ruby/lib/jam_ruby/models/feed.rb b/ruby/lib/jam_ruby/models/feed.rb index 0802e3085..6ac48f792 100644 --- a/ruby/lib/jam_ruby/models/feed.rb +++ b/ruby/lib/jam_ruby/models/feed.rb @@ -29,7 +29,7 @@ module JamRuby start = start.to_i time_range = params[:time_range] - time_range ||= 'month' + time_range ||= 'all' raise "not valid time_range #{time_range}" unless TIME_RANGES.has_key?(time_range) type_filter = params[:type] diff --git a/ruby/spec/jam_ruby/models/feed_spec.rb b/ruby/spec/jam_ruby/models/feed_spec.rb index d7ba3391d..54ec1955e 100644 --- a/ruby/spec/jam_ruby/models/feed_spec.rb +++ b/ruby/spec/jam_ruby/models/feed_spec.rb @@ -150,7 +150,7 @@ describe Feed do claimed_recording1.recording.feed.created_at = 32.days.ago claimed_recording1.recording.feed.save! - feeds, start = Feed.index(user1, :type => 'recording') + feeds, start = Feed.index(user1, :type => 'recording', time_range: 'month') feeds.length.should == 0 end diff --git a/web/app/assets/javascripts/banner.js b/web/app/assets/javascripts/banner.js index 99e0ddfbd..b2e8a89a8 100644 --- a/web/app/assets/javascripts/banner.js +++ b/web/app/assets/javascripts/banner.js @@ -114,11 +114,13 @@ if(options.buttons) { var $buttons = $banner.find('.buttons') - context._.each(options.buttons, function(button) { + context._.each(options.buttons, function(button, i) { if(!button.name) throw "button.name must be specified"; if(!button.click) throw "button.click must be specified"; - var $btn = $('' + button.name + ''); + var buttonStyle = options.buttons.length == i + 1 ? 'button-orange' : 'button-grey'; + + var $btn = $('' + button.name + ''); $btn.click(function() { button.click(); hide(); diff --git a/web/app/assets/javascripts/fakeJamClient.js b/web/app/assets/javascripts/fakeJamClient.js index 4074b3de0..af144dfd6 100644 --- a/web/app/assets/javascripts/fakeJamClient.js +++ b/web/app/assets/javascripts/fakeJamClient.js @@ -774,6 +774,10 @@ logger.debug("SessionLiveBroadcastStop requested"); } + function RegisterQuitCallback() { + + } + // Javascript Bridge seems to camel-case // Set the instance functions: this.AbortRecording = AbortRecording; @@ -804,6 +808,7 @@ this.IsMyNetworkWireless = IsMyNetworkWireless; this.SetNetworkTestScore = SetNetworkTestScore; this.GetNetworkTestScore = GetNetworkTestScore; + this.RegisterQuitCallback = RegisterQuitCallback; this.connected = true; // FTUE (round 3) diff --git a/web/app/assets/javascripts/globals.js b/web/app/assets/javascripts/globals.js index 86cf69dcf..4cacf3c4f 100644 --- a/web/app/assets/javascripts/globals.js +++ b/web/app/assets/javascripts/globals.js @@ -28,7 +28,9 @@ }; context.JK.EVENTS = { - DIALOG_CLOSED : 'dialog_closed' + DIALOG_CLOSED : 'dialog_closed', + SHOW_SIGNUP : 'show_signup', + SHOW_SIGNIN : 'show_signin' } context.JK.ALERT_NAMES = { diff --git a/web/app/assets/javascripts/landing/landing.js b/web/app/assets/javascripts/landing/landing.js index fbdb167c0..3da8e39a0 100644 --- a/web/app/assets/javascripts/landing/landing.js +++ b/web/app/assets/javascripts/landing/landing.js @@ -1,13 +1,35 @@ //= require jquery +//= require jquery.monkeypatch +//= require jquery_ujs +//= require jquery.ui.draggable //= require jquery.queryparams +//= require jquery.hoverIntent +//= require jquery.cookie +//= require jquery.clipboard +//= require jquery.easydropdown +//= require jquery.carousel-1.1 +//= require jquery.mousewheel-3.1.9 +//= require jquery.timeago +//= require jquery.dotdotdot +//= require jquery.listenbroadcast +//= require jquery.listenRecording +//= require jquery.browser +//= require jquery.custom-protocol +//= require jquery.ba-bbq //= require AAA_Log //= require AAC_underscore //= require globals +//= require AAB_message_factory +//= require facebook_helper +//= require layout //= require jamkazam //= require utils //= require ui_helper //= require ga //= require jam_rest +//= require web/signup_helper +//= require web/signin_helper +//= require web/signin //= require landing/init //= require landing/signup //= require shareDialog \ No newline at end of file diff --git a/web/app/assets/javascripts/scheduled_session.js b/web/app/assets/javascripts/scheduled_session.js index 6766b51cf..de8fde8e5 100644 --- a/web/app/assets/javascripts/scheduled_session.js +++ b/web/app/assets/javascripts/scheduled_session.js @@ -746,10 +746,10 @@ } if (step == STEP_SELECT_TYPE && createSessionSettings.createType == 'start-scheduled' && createSessionSettings.selectedSessionId == null) { - $btnNext.removeClass('button-orange').addClass('button-grey'); + $btnNext.addClass('disabled'); } else { - $btnNext.removeClass('button-grey').addClass('button-orange'); + $btnNext.removeClass('disabled'); } if (step == STEP_SELECT_CONFIRM) { @@ -770,7 +770,7 @@ event.preventDefault(); } - if ($(this).is('.button-grey')) return false; + if ($(this).is('.disabled')) return false; if ($.inArray(createSessionSettings.createType, ['start-scheduled', 'quick-start']) > -1) step = STEP_SELECT_TYPE; else @@ -806,7 +806,7 @@ if (event) { event.preventDefault(); } - if ($(this).is('.button-grey')) return false; + if ($(this).is('.disabled')) return false; if ($.inArray(createSessionSettings.createType, ['start-scheduled', 'quick-start']) > -1) step = STEP_SELECT_CONFIRM; @@ -1072,10 +1072,10 @@ var $btnNext = $('#create-session-buttons .btn-next'); if (step == STEP_SELECT_TYPE && createSessionSettings.createType == 'start-scheduled' && createSessionSettings.selectedSessionId == null) { - $btnNext.removeClass('button-orange').addClass('button-grey'); + $btnNext.addClass('disabled') } else { - $btnNext.removeClass('button-grey').addClass('button-orange'); + $btnNext.removeClass('disabled'); } toggleStepStatus(); diff --git a/web/app/assets/javascripts/shutdownDialog.js b/web/app/assets/javascripts/shutdownDialog.js new file mode 100644 index 000000000..94aea13f4 --- /dev/null +++ b/web/app/assets/javascripts/shutdownDialog.js @@ -0,0 +1,36 @@ +(function (context, $) { + + "use strict"; + + context.JK = context.JK || {}; + + context.JK.ShutdownDialog = function (app) { + var logger = context.JK.logger; + + function show() { + context.JK.Banner.showAlert( + { title: "Close JamKazam Application", + buttons: [ + {name: 'Completely Shut Down the App', click: function() {context.jamClient.ShutdownApplication()}}, + {name: 'Let App Run in Background', click: function() {context.jamClient.ShutdownApplication()}} + ], + html: $('#template-shutdown-prompt').html()}); + } + + function initialize() { + //context.jamClient.RegisterQuitCallback("window.JK.ShutdownDialogCallback"); + } + + function quitCallback(options) { + logger.debug("oh hai"); + show(); + } + + this.initialize = initialize; + + context.JK.ShutdownDialogCallback = quitCallback; + + return this; + + } +})(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/user_dropdown.js b/web/app/assets/javascripts/user_dropdown.js index d8868a058..656ce71ab 100644 --- a/web/app/assets/javascripts/user_dropdown.js +++ b/web/app/assets/javascripts/user_dropdown.js @@ -85,7 +85,11 @@ function handleWhatsNext(userProfile) { if (notYetShownWhatsNext && gon.isNativeClient && userProfile.show_whats_next) { notYetShownWhatsNext = false; - app.layout.showDialog('whatsNext'); + console.log("window.location.pathname", window.location.pathname, gon.client_path, window.location.pathname.indexOf(gon.client_url)); + if(window.location.pathname.indexOf(gon.client_path) == 0) { + app.layout.showDialog('whatsNext'); + } + } } diff --git a/web/app/assets/javascripts/web/signin.js b/web/app/assets/javascripts/web/signin.js new file mode 100644 index 000000000..d01d2c200 --- /dev/null +++ b/web/app/assets/javascripts/web/signin.js @@ -0,0 +1,39 @@ +(function (context, $) { + + "use strict"; + + context.JK = context.JK || {}; + + var $signin; + var $signinRoot; + var $signupRoot; + + var rest = context.JK.Rest(); + var logger = context.JK.logger; + var EVENTS = context.JK.EVENTS; + + function initialize() { + + $signinRoot = $('.signin-common'); + $signupRoot = $('.signup-common'); + + var signinHelper = new context.JK.SigninHelper(context.JK.app); + $(signinHelper).on(EVENTS.SHOW_SIGNUP, function() { + $signinRoot.hide(); + $signupRoot.show(); + }); + signinHelper.initialize($signinRoot, false); + + var signupHelper = new context.JK.SignupHelper(context.JK.app); + $(signupHelper).on(EVENTS.SHOW_SIGNIN, function() { + $signupRoot.hide(); + $signinRoot.show(); + }); + signupHelper.initialize($signupRoot); + + $signinRoot.find('input[name="session[email]"]').focus(); + } + + context.JK.SigninPage = initialize; + +})(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/signinDialog.js b/web/app/assets/javascripts/web/signinDialog.js index e93d4492f..a76d649d5 100644 --- a/web/app/assets/javascripts/web/signinDialog.js +++ b/web/app/assets/javascripts/web/signinDialog.js @@ -5,78 +5,21 @@ context.JK = context.JK || {}; context.JK.SigninDialog = function(app) { + var EVENTS = context.JK.EVENTS; var logger = context.JK.logger; var rest = context.JK.Rest(); var dialogId = '#signin-dialog'; + var $dialog = null; + var signinHelper = null; - function reset() { - $(dialogId + ' #signin-form').removeClass('login-error') - - $(dialogId + ' input[name=email]').val(''); - $(dialogId + ' input[name=password]').val(''); - $(dialogId + ' input[name=remember_me]').attr('checked', 'checked') - } - - function login() { - var email = $(dialogId + ' input[name=email]').val(); - var password = $(dialogId + ' input[name=password]').val(); - var rememberMe = $(dialogId + ' input[name=remember_me]').is(':checked') - - rest.login({email: email, password: password, remember_me: rememberMe}) - .done(function() { - app.layout.closeDialog('signin-dialog') - - var redirectTo = $.QueryString['redirect-to']; - if(redirectTo) { - logger.debug("redirectTo:" + redirectTo); - window.location.href = redirectTo; - } - else { - logger.debug("default post-login path"); - window.location.href = '/client' - } - }) - .fail(function(jqXHR) { - if(jqXHR.status == 422) { - $(dialogId + ' #signin-form').addClass('login-error') - } - else { - app.notifyServerError(jqXHR, "Unable to log in") - } - }) - } - - function events() { - $(dialogId + ' .signin-cancel').click(function(e) { - app.layout.closeDialog('signin-dialog'); - e.stopPropagation(); - return false; - }); - - $(dialogId + ' #signin-form').submit(function(e) { - login(); - return false; - }); - - $(dialogId + ' .signin-submit').click(function(e) { - login(); - return false; - }); - - $(dialogId + ' .show-signup-dialog').click(function(e) { - app.layout.closeDialog('signin-dialog') - app.layout.showDialog('signup-dialog') - return false; - }) - } function beforeShow() { logger.debug("showing login form") - reset(); + signinHelper.reset(); } function afterShow() { - $(dialogId + ' input[name=email]').focus(); + $dialog.find('input[name="session[email]"]').focus(); } function afterHide() { @@ -93,10 +36,16 @@ app.bindDialog('signin-dialog', dialogBindings); - events(); + $dialog = $(dialogId); + + signinHelper = new context.JK.SigninHelper(app); + $(signinHelper).on(EVENTS.SHOW_SIGNUP, function() { + app.layout.closeDialog('signin-dialog') + app.layout.showDialog('signup-dialog') + }) + signinHelper.initialize($dialog, true); } this.initialize = initialize; - } })(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/signin_helper.js b/web/app/assets/javascripts/web/signin_helper.js new file mode 100644 index 000000000..76a5dfaab --- /dev/null +++ b/web/app/assets/javascripts/web/signin_helper.js @@ -0,0 +1,115 @@ +(function(context,$) { + + "use strict"; + + context.JK = context.JK || {}; + + context.JK.SigninHelper = function(app) { + + if(!app) throw "no app defined"; + + var logger = context.JK.logger; + var rest = context.JK.Rest(); + var $self = $(this); + var $parent = null; + var $signinBtn = null; + var $signinForm = null; + var $signinCancelBtn = null; + var $email = null; + var $password = null; + var $rememberMe = null; + var useAjax = false; + var EVENTS = context.JK.EVENTS; + + function reset() { + $signinForm.removeClass('login-error') + + $email.val(''); + $password.val(''); + $rememberMe.attr('checked', 'checked') + } + + function login() { + var email = $email.val(); + var password = $password.val(); + var rememberMe = $rememberMe.is(':checked') + + reset(); + + $signinBtn.text('TRYING...'); + + rest.login({email: email, password: password, remember_me: rememberMe}) + .done(function() { + //app.layout.closeDialog('signin-dialog') + + var redirectTo = $.QueryString['redirect-to']; + if(redirectTo) { + logger.debug("redirectTo:" + redirectTo); + window.location.href = redirectTo; + } + else { + logger.debug("default post-login path"); + window.location.href = '/client' + } + }) + .fail(function(jqXHR) { + if(jqXHR.status == 422) { + $signinForm.addClass('login-error') + } + else { + app.notifyServerError(jqXHR, "Unable to log in") + } + }) + .always(function() { + $signinBtn.text('SIGN IN') + }) + } + + + function events() { + $signinCancelBtn.click(function(e) { + app.layout.closeDialog('signin-dialog'); + e.stopPropagation(); + return false; + }); + + if(useAjax) { + $signinForm.submit(function(e) { + login(); + return false; + }); + + $signinBtn.click(function(e) { + login(); + return false; + }); + } + + + $parent.find('.show-signup-dialog').click(function(e) { + $self.triggerHandler(EVENTS.SHOW_SIGNUP); + return false; + }) + } + + function initialize(_$parent, _useAjax){ + $parent = _$parent; + useAjax = _useAjax; + + $signinBtn = $parent.find('.signin-submit') + $signinForm = $parent.find('.signin-form') + $signinCancelBtn = $parent.find('.signin-cancel') + $email = $parent.find('input[name="session[email]"]'); + $password = $parent.find('input[name="session[password]"]'); + $rememberMe = $parent.find('input[name="user[remember_me]"]'); + + if($signinForm.length == 0) throw "no signin form found"; + events(); + } + + this.initialize = initialize; + this.reset = reset; + + return this; + } +})(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/signupDialog.js b/web/app/assets/javascripts/web/signupDialog.js index fc126cb57..cc69ccae0 100644 --- a/web/app/assets/javascripts/web/signupDialog.js +++ b/web/app/assets/javascripts/web/signupDialog.js @@ -1,49 +1,43 @@ -(function(context,$) { +(function (context, $) { - "use strict"; + "use strict"; - context.JK = context.JK || {}; + context.JK = context.JK || {}; - context.JK.SignupDialog = function(app) { - var logger = context.JK.logger; - var rest = context.JK.Rest(); - var dialogId = '#signup-dialog'; - - function events() { - $(dialogId + ' .signup-cancel').click(function(e) { - app.layout.closeDialog('signup-dialog'); - e.stopPropagation(); - return false; - }); - - $(dialogId + ' .show-signin-dialog').click(function(e) { - app.layout.closeDialog('signup-dialog') - app.layout.showDialog('signin-dialog') - return false; - }) - } - - function beforeShow() { - - } - - function afterHide() { - - } - - function initialize(){ - - var dialogBindings = { - 'beforeShow' : beforeShow, - 'afterHide': afterHide - }; - - app.bindDialog('signup-dialog', dialogBindings); - - events(); - } - - this.initialize = initialize; + context.JK.SignupDialog = function (app) { + var logger = context.JK.logger; + var rest = context.JK.Rest(); + var dialogId = '#signup-dialog'; + var $dialog = null; + var signupHelper = null; + var EVENTS = context.JK.EVENTS; + function beforeShow() { } + + function afterHide() { + } + + function initialize() { + + var dialogBindings = { + 'beforeShow': beforeShow, + 'afterHide': afterHide + }; + + app.bindDialog('signup-dialog', dialogBindings); + + $dialog = $(dialogId); + + signupHelper = new context.JK.SignupHelper(app); + $(signupHelper).on(EVENTS.SHOW_SIGNIN, function () { + app.layout.closeDialog('signup-dialog') + app.layout.showDialog('signin-dialog') + }) + signupHelper.initialize($dialog); + } + + this.initialize = initialize; + + } })(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/signup_helper.js b/web/app/assets/javascripts/web/signup_helper.js new file mode 100644 index 000000000..2bf34b662 --- /dev/null +++ b/web/app/assets/javascripts/web/signup_helper.js @@ -0,0 +1,47 @@ +(function(context,$) { + + "use strict"; + + context.JK = context.JK || {}; + + context.JK.SignupHelper = function(app) { + + if(!app) throw "no app defined"; + + var logger = context.JK.logger; + var rest = context.JK.Rest(); + var $self = $(this); + var $parent = null; + var $signupCancel = null; + var $showSigninDialog = null; + var EVENTS = context.JK.EVENTS; + + function events() { + $parent.find('.signup-cancel').click(function(e) { + app.layout.closeDialog('signup-dialog'); + e.stopPropagation(); + return false; + }); + + $parent.find('.show-signin-dialog').click(function(e) { + $self.triggerHandler(EVENTS.SHOW_SIGNIN); + return false; + }) + } + + function initialize(_$parent){ + $parent = _$parent; + + $showSigninDialog = $parent.find('.show-signin-dialog') + $signupCancel = $parent.find('.signup-cancel') + + if($showSigninDialog.length == 0) throw "no $showSigninDialog found"; + if($signupCancel.length == 0) throw "no $signupCancel form found"; + events(); + } + + this.initialize = initialize; + + return this; + } +})(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/web.js b/web/app/assets/javascripts/web/web.js index 4112c4d99..a97905224 100644 --- a/web/app/assets/javascripts/web/web.js +++ b/web/app/assets/javascripts/web/web.js @@ -21,7 +21,9 @@ //= require globals //= require AAB_message_factory //= require facebook_helper +//= require web/signup_helper //= require web/signupDialog +//= require web/signin_helper //= require web/signinDialog //= require web/videoDialog //= require invitationDialog diff --git a/web/app/assets/javascripts/web/welcome.js b/web/app/assets/javascripts/web/welcome.js index 2403fa2dc..dd570b763 100644 --- a/web/app/assets/javascripts/web/welcome.js +++ b/web/app/assets/javascripts/web/welcome.js @@ -18,7 +18,7 @@ return false; }); - $('#signin').click(function (e) { + $('#signin.signin').click(function (e) { if (context.JK.currentUserId) { rest.getUserDetail({id:context.JK.currentUserId}) .done(function () { @@ -73,6 +73,12 @@ } }); } + + $('.like-link').click(function() { + var like_site = $(this).data('site'); + JK.GA.trackJKSocial(JK.GA.Categories.jkLike, like_site, JK.clientType()); + window.open("/endorse/0/"+like_site, '_blank'); + }); } context.JK.WelcomePage = initialize; diff --git a/web/app/assets/stylesheets/client/createSession.css.scss b/web/app/assets/stylesheets/client/createSession.css.scss index 29f0e6a2f..9bc340939 100644 --- a/web/app/assets/stylesheets/client/createSession.css.scss +++ b/web/app/assets/stylesheets/client/createSession.css.scss @@ -67,7 +67,7 @@ } .session-wrapper { - padding: 10px 35px 5px 35px; + padding: 10px 35px 0 35px; white-space: initial; h3 { @@ -140,7 +140,7 @@ .btn-select-files { margin-top: 10px; - margin-left:0; + margin-left:2px; width:110px; @include border_box_sizing; } @@ -287,11 +287,6 @@ #session-step-5 { } - .session-buttons { - padding-right: 30px; - padding-bottom: 20px; - } - #session-name-disp { font-style:italic; } @@ -319,10 +314,42 @@ margin-bottom:20px; } - #create-session-buttons { - margin-top:10px; + + .session-buttons { + position:absolute; + width:100%; + bottom:15px; + + .left-buttons { + position:absolute; + left:29px; + bottom:0; + } + + .right-buttons { + position:absolute; + right:29px; + bottom:0; + } + + #create-session-buttons { + position: absolute; + bottom: 0; + width:100%; + @include border_box_sizing; + padding-right:45px; + padding-bottom:15px; + + .btn-help { + float:left; + } + } + } + + + .error-text { margin:2px 0 0 2em; @@ -346,6 +373,8 @@ } #create-session-form { + position:relative; + padding-bottom:50px; .musician_access .dropdown-wrapper { width:75px; diff --git a/web/app/assets/stylesheets/client/ftue.css.scss b/web/app/assets/stylesheets/client/ftue.css.scss index 933d01a6b..494e12532 100644 --- a/web/app/assets/stylesheets/client/ftue.css.scss +++ b/web/app/assets/stylesheets/client/ftue.css.scss @@ -443,7 +443,7 @@ div[layout-id="ftue3"] { */ /* Start Jeff's ftue.css */ -.signin-overlay { +.landing-overlay { z-index:100; width:800px; height:auto; diff --git a/web/app/assets/stylesheets/client/wizard/wizard.css.scss b/web/app/assets/stylesheets/client/wizard/wizard.css.scss index 4e974eb15..41b7c1a64 100644 --- a/web/app/assets/stylesheets/client/wizard/wizard.css.scss +++ b/web/app/assets/stylesheets/client/wizard/wizard.css.scss @@ -9,7 +9,6 @@ @include border_box_sizing; padding-right:45px; padding-bottom:15px; - } .wizard-buttons-holder { diff --git a/web/app/assets/stylesheets/landing/landing.css b/web/app/assets/stylesheets/landing/landing.css index ef1d495a8..23908ed65 100644 --- a/web/app/assets/stylesheets/landing/landing.css +++ b/web/app/assets/stylesheets/landing/landing.css @@ -6,4 +6,6 @@ *= require client/ftue *= require landing/simple_landing *= require landing/footer +*= require users/signinCommon +*= require users/signin */ \ No newline at end of file diff --git a/web/app/assets/stylesheets/landing/simple_landing.css.scss b/web/app/assets/stylesheets/landing/simple_landing.css.scss index 07020e0a0..54881b998 100644 --- a/web/app/assets/stylesheets/landing/simple_landing.css.scss +++ b/web/app/assets/stylesheets/landing/simple_landing.css.scss @@ -27,6 +27,11 @@ body { top:0; } +.landing-overlay { + position:relative; + top:0; +} + strong { font-weight: 600; @@ -92,86 +97,22 @@ strong { // all custom CSS for the sign-in page goes here .signin-page { - .ftue-inner { - line-height:18px; + z-index:100; + width:300px; + height:auto; + position:absolute; + top:110px; + background-color:#333; + border: 1px solid #ed3618; + margin-left:-150px; + + .overlay-inner { + height:auto; + margin-left:0; } - .ftue-left, .ftue-right { - - } - - fieldset[name=text-input]{ - float:right; - margin-right:18px; - } - - fieldset[name=signin-options] { - float:left; - margin:10px 0 0 10px; - - small { - float:left; - } - } - - fieldset[name=actions] { - float:right; - margin: 10px 19px 0 0; - } - - .field { - right:0; - } - - .email { - float:left; - margin-right:10px; - - } - - .password { - float:left; - } - - label { - margin:27px 0 10px; - } - - - - .already-member { - - } - - .keep-logged-in { - - } - - .forgot-password { - font-size:11px; - float:right; - margin:15px 19px 0 0; - - a { - text-decoration: underline; - } - } - - .login-error { - background-color: #330000; - border: 1px solid #990000; - padding:4px; - } - - .login-error-msg { + .signin-cancel { display:none; - margin-top:10px; - text-align:center; - color:#F00; - font-size:11px; } - fieldset.login-error .login-error-msg { - display:block; - } } diff --git a/web/app/assets/stylesheets/users/request_reset_password.css.scss b/web/app/assets/stylesheets/users/request_reset_password.css.scss new file mode 100644 index 000000000..e69de29bb diff --git a/web/app/assets/stylesheets/users/signin.css.scss b/web/app/assets/stylesheets/users/signin.css.scss new file mode 100644 index 000000000..0cfbeaa5c --- /dev/null +++ b/web/app/assets/stylesheets/users/signin.css.scss @@ -0,0 +1,10 @@ +body.signin { + + .signup-common { + display:none; + + .signup-cancel { + display:none; + } + } +} \ No newline at end of file diff --git a/web/app/assets/stylesheets/users/signinCommon.css.scss b/web/app/assets/stylesheets/users/signinCommon.css.scss new file mode 100644 index 000000000..3a5d7ca0a --- /dev/null +++ b/web/app/assets/stylesheets/users/signinCommon.css.scss @@ -0,0 +1,55 @@ +.signin-common { + + div.field { + width:100%; + } + + div.overlay-inner { + height:auto; + } + + label { + margin-bottom:2px; + } + + div.email { + margin-top:5px; + } + + div.password { + margin-top:20px; + } + + div.actions { + margin-top:20px; + } + + .login-error { + background-color: #330000; + border: 1px solid #990000; + padding:4px; + + div.actions { + margin-top:10px; + } + } + + .login-error-msg { + display:none; + margin-top:10px; + text-align:center; + color:#F00; + font-size:11px; + } + + .login-error .login-error-msg { + display:block; + } + + input[type=text], input[type=password]{ + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + } +} \ No newline at end of file diff --git a/web/app/assets/stylesheets/users/signinDialog.css.scss b/web/app/assets/stylesheets/users/signinDialog.css.scss index 2412813d3..1bef3b20a 100644 --- a/web/app/assets/stylesheets/users/signinDialog.css.scss +++ b/web/app/assets/stylesheets/users/signinDialog.css.scss @@ -1,59 +1,3 @@ #signin-dialog { height:auto; -} - -#signin-dialog { - - div.field { - width:100%; - } - - div.overlay-inner { - height:auto; - } - - label { - margin-bottom:2px; - } - - div.email { - margin-top:5px; - } - - div.password { - margin-top:20px; - } - - div.actions { - margin-top:20px; - } - - .login-error { - background-color: #330000; - border: 1px solid #990000; - padding:4px; - - div.actions { - margin-top:10px; - } - } - - .login-error-msg { - display:none; - margin-top:10px; - text-align:center; - color:#F00; - font-size:11px; - } - - .login-error .login-error-msg { - display:block; - } - - input[type=text], input[type=password]{ - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - } } \ No newline at end of file diff --git a/web/app/assets/stylesheets/web/main.css.scss b/web/app/assets/stylesheets/web/main.css.scss index c0ec227e9..d61989e40 100644 --- a/web/app/assets/stylesheets/web/main.css.scss +++ b/web/app/assets/stylesheets/web/main.css.scss @@ -453,6 +453,10 @@ body.web { top:0; } +.landing-overlay { + position:relative; + top:0; +} strong { font-weight: 600; @@ -593,4 +597,7 @@ strong { body.jam.web.welcome .no-websocket-connection { display:none; +} +body.jam.web.register .no-websocket-connection { + display:none; } \ No newline at end of file diff --git a/web/app/assets/stylesheets/web/web.css b/web/app/assets/stylesheets/web/web.css index c06b72a33..e99f565ba 100644 --- a/web/app/assets/stylesheets/web/web.css +++ b/web/app/assets/stylesheets/web/web.css @@ -22,5 +22,6 @@ *= require web/welcome #= require web/sessions *= require web/events +*= require users/signinCommon *= require users/signinDialog */ \ No newline at end of file diff --git a/web/app/controllers/sessions_controller.rb b/web/app/controllers/sessions_controller.rb index fbeb8ec9f..f2f705141 100644 --- a/web/app/controllers/sessions_controller.rb +++ b/web/app/controllers/sessions_controller.rb @@ -3,7 +3,7 @@ class SessionsController < ApplicationController layout "web" - def new + def signin @login_error = false @sso = params[:sso] @send_back_to = request.headers['REFERER'] @@ -25,7 +25,7 @@ class SessionsController < ApplicationController @login_error = true @sso = params[:sso] @send_back_to = params[:send_back_to] - render 'new', :layout => "landing" + render 'signin', :layout => "landing" else if jkclient_agent? diff --git a/web/app/helpers/client_helper.rb b/web/app/helpers/client_helper.rb index f8f52caf6..6f4d0a489 100644 --- a/web/app/helpers/client_helper.rb +++ b/web/app/helpers/client_helper.rb @@ -19,6 +19,7 @@ module ClientHelper def gon_setup gon.root_url = root_url + gon.client_path = client_path # use gon to pass variables into javascript if Rails.env == "development" # if in development mode, we assume you are running websocket-gateway diff --git a/web/app/views/clients/_banner.html.haml b/web/app/views/clients/_banner.html.haml index 9e53fb0e1..42d44452d 100644 --- a/web/app/views/clients/_banner.html.haml +++ b/web/app/views/clients/_banner.html.haml @@ -30,4 +30,18 @@ %li In the resulting screen, drag the JamKazam icon to the Applications folder. It will show a progress bar as it copies. %li Double-click the Applications folder to go into it. %li If you are still running the JamKazam application, you will need to stop it before executing the last step. - %li Find the JamKazam application in the Applications folder, and double-click the icon to launch it! \ No newline at end of file + %li Find the JamKazam application in the Applications folder, and double-click the icon to launch it! + +%script{type: 'text/template', id: 'template-shutdown-prompt'} + .shutdown-prompt + We strongly recommend that you leave the JamKazam application running in the background. + This is a very lightweight app that will not disrupt your use of your computer and other applications, and leaving this app running will deliver the following benefits to you: + %ul + %li + %span.definition Scoring Service + = '- If you leave the app running, there is a service that can check your Internet latency to other JamKazam users. This is critical data that will guide you on which musicians and which sessions will offer a good online play experience.' + %li + %span.definition Recordings + = '- If you leave the app running, any recordings that you and others have made during sessions can be mastered - i.e. uploaded, mixed on our servers, and downloaded back to your computer - so that you have high quality versions of your recordings available.' + + Please consider leaving this lightweight app running in the background for your own benefit, thanks! diff --git a/web/app/views/clients/_scheduledSession.html.erb b/web/app/views/clients/_scheduledSession.html.erb index 9a972ab3a..d7531c61f 100644 --- a/web/app/views/clients/_scheduledSession.html.erb +++ b/web/app/views/clients/_scheduledSession.html.erb @@ -94,7 +94,7 @@ This is good option to choose if you just want to jump into a quick test session alone to make sure you audio gear is working properly, and to familiarize yourself with the session interface. Choosing this option will set your session to private so that you won't be disturbed, and will - set other options to defaults. To use this option, just click the NEXT buttono to proceed. + set other options to defaults. To use this option, just click the NEXT button to proceed. @@ -407,14 +407,17 @@ -
-
-
-
+ +
+
+
+
+ -
+ + @@ -438,9 +441,13 @@ diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index 2ab03c5c5..6d8a0dd44 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -121,7 +121,15 @@ // you need to be logged in to use this part of the interface. // save original URL, and redirect to the home page logger.debug("redirecting back to / because not logged in") - window.location.href = '/?redirect-to=' + encodeURIComponent(JK.locationPath()); + + var redirectPath= '?redirect-to=' + encodeURIComponent(JK.locationPath()); + if(gon.isNativeClient) { + window.location.href = '/signin' + redirectPath; + } + else { + window.location.href = '/' + redirectPath; + } + <% end %> @@ -130,6 +138,9 @@ if (this.didInitAfterConnect) return; this.didInitAfterConnect = true + var shutdownDialog = new JK.ShutdownDialog(JK.app); + shutdownDialog.initialize(); + // This is a helper class with a singleton. No need to instantiate. JK.GenreSelectorHelper.initialize(JK.app); diff --git a/web/app/views/layouts/landing.erb b/web/app/views/layouts/landing.html.erb similarity index 87% rename from web/app/views/layouts/landing.erb rename to web/app/views/layouts/landing.html.erb index d88d06461..960b20852 100644 --- a/web/app/views/layouts/landing.erb +++ b/web/app/views/layouts/landing.html.erb @@ -31,7 +31,7 @@ <%= render "layouts/social_meta" %> <% end %> - +
<%= javascript_include_tag "landing/landing" %> @@ -63,14 +63,22 @@ JK.currentUserId = '<%= current_user.id %>'; JK.currentUserAvatarUrl = JK.resolveAvatarUrl('<%= current_user.photo_url %>'); JK.currentUserName = '<%= current_user.name %>'; + JK.currentUserMusician = '<%= current_user.musician %>'; <% else %> JK.currentUserId = null; JK.currentUserAvatarUrl = null; JK.currentUserName = null; + JK.currentUserMusician = null; <% end %> + + JK.app = JK.JamKazam(); + + JK.app.initialize({inClient: false, layoutOpts: {layoutFooter: false, sizeOverlayToContent: true}}); }) + <%= yield(:extra_js) %> + <%= render "shared/ga" %> diff --git a/web/app/views/sessions/new.html.erb b/web/app/views/sessions/new.html.erb deleted file mode 100644 index a59fb1cf6..000000000 --- a/web/app/views/sessions/new.html.erb +++ /dev/null @@ -1,100 +0,0 @@ -<% provide(:title, 'Sign in') %> -
- - -
-

sign in or register

-
- - -
- - -

- - Already a member? - Enter your email address and password: - -
- <%= form_for(:session, url: signin_path + (request.query_string.blank? ? '' : '?' + request.query_string)) do |f| %> - - -
- - - -
- <%= f.label :password, "Password:" %> - <%= f.password_field :password %> -
- -
- -
- -
- -
- -
- -
- <%= f.submit "SIGN IN", class: "button-orange m0" %> -
- -
- - - <% end %> -
-
- - - -
- -
-
-
-
-
Not a member? Join JamKazam for free:
-
- REGISTER NOW -
- - - -
-
- -
- - -
- - - - - diff --git a/web/app/views/sessions/signin.html.haml b/web/app/views/sessions/signin.html.haml new file mode 100644 index 000000000..e20fa396e --- /dev/null +++ b/web/app/views/sessions/signin.html.haml @@ -0,0 +1,18 @@ +- provide(:title, 'Sign in') +- provide(:page_name, 'signin') + +.signin-overlay.signin-page + .content-head + %h1 sign in or register + + = render "users/signin" + + = render "users/signup" + + %br{clear: 'all'} + +- content_for :extra_js do + :javascript + $(function () { + window.JK.SigninPage(); + }) \ No newline at end of file diff --git a/web/app/views/users/_create_account_form.html.erb b/web/app/views/users/_create_account_form.html.erb index 77cbbafed..c89173d42 100644 --- a/web/app/views/users/_create_account_form.html.erb +++ b/web/app/views/users/_create_account_form.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/web/app/views/users/_signin.html.haml b/web/app/views/users/_signin.html.haml new file mode 100644 index 000000000..0cc535096 --- /dev/null +++ b/web/app/views/users/_signin.html.haml @@ -0,0 +1,48 @@ +.overlay-inner.signin-common + = link_to image_tag("content/button_facebook_signin.png", {:width => 249, :height => 46}), '/auth/facebook', class: "signin-facebook" + + %br + %br + %br + %strong.white Or sign in with JamKazam Account + %br + %br + + = form_for(:session, url: signin_path + (request.query_string.blank? ? '' : '?' + request.query_string), html: {class:"signin-form #{'login-error' if @login_error}"}) do |f| + %input{type:'hidden', name: 'sso', value: @sso} + %input{type:'hidden', name: 'send_back_to', value: @send_back_to} + + .field.email + = f.label :email, "Email Address:" + = f.text_field :email, autofocus: true + + .field.password + = f.label :password, "Password:" + = f.password_field :password, autofocus: true + + :javascript + if(window.jamClient === undefined) { + document.write(''); + document.write(' Keep me logged in'); + } else { + document.write(''); + } + + .login-error-msg Invalid login + + %br{clear:'all'} + + .actions{align: 'center'} + %a.button-grey.signin-cancel{href:'#' } CANCEL + = f.submit "SIGN IN",class: 'button-orange signin-submit' + %br + %br + %small + %a.forgot-password{href:'/request_reset_password'} Forgot Password? + + %br + + .center + %small + Don't have an account? + %a.show-signup-dialog{href: '#'} Sign Up \ No newline at end of file diff --git a/web/app/views/users/_signinDialog.html.erb b/web/app/views/users/_signinDialog.html.erb index 1357b2e48..a485999d4 100644 --- a/web/app/views/users/_signinDialog.html.erb +++ b/web/app/views/users/_signinDialog.html.erb @@ -1,66 +1,11 @@
-

sign in

- -
+ <%= render "users/signin" %> - <%= link_to image_tag("content/button_facebook_signin.png", {:width => 249, :height => 46}), '/auth/facebook', class: "signin-facebook" %> - -
-
-
- Or sign in with JamKazam Account -
-
- -
- - - -
- - -
- - - - - - -
- -
- -    -
-
- Forgot Password? -
- -
-
- -
- Don't have an account? -
- -
- -
diff --git a/web/app/views/users/_signup.html.haml b/web/app/views/users/_signup.html.haml new file mode 100644 index 000000000..f73d12d73 --- /dev/null +++ b/web/app/views/users/_signup.html.haml @@ -0,0 +1,20 @@ +.overlay-inner.signup-common + = link_to image_tag("content/button_facebook_signup.png", {:width => 249, :height => 46 }), '/auth/facebook', class: "signup-facebook" + %br + %br + %br + .center + %strong.white Or + %br + %br + .center + = link_to "SIGN UP WITH YOUR EMAIL", signup_path, class: "button-orange block signup-email" + %br + .center + %small + Already have an account? + %a.show-signin-dialog{href: '#'} Sign In + %br + %br + %a.signup-cancel{href: '#'} Cancel + %br{clear: 'all'} \ No newline at end of file diff --git a/web/app/views/users/_signupDialog.html.erb b/web/app/views/users/_signupDialog.html.erb index 66d6fea7f..84b542afe 100644 --- a/web/app/views/users/_signupDialog.html.erb +++ b/web/app/views/users/_signupDialog.html.erb @@ -5,29 +5,6 @@

sign up for jamkazam

- -
- - <%= link_to image_tag("content/button_facebook_signup.png", {:width => 249, :height => 46 }), '/auth/facebook', class: "signup-facebook" %> -
-

- -
Or
-
-
- -
<%= link_to "SIGN UP WITH YOUR EMAIL", signup_path, class: "button-orange block signup-email" %> - -
- -
- Already have an account?
-
-
-
-
- -
-
+ <%= render "users/signup" %>
\ No newline at end of file diff --git a/web/app/views/users/already_signed_up.html.erb b/web/app/views/users/already_signed_up.html.erb index 6bd614ec1..e0cf7635a 100644 --- a/web/app/views/users/already_signed_up.html.erb +++ b/web/app/views/users/already_signed_up.html.erb @@ -1,6 +1,6 @@ <% provide(:title, 'Already Signed Up') %> -