diff --git a/web/Gemfile b/web/Gemfile index 8c719b4b9..27471d0a7 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -22,7 +22,7 @@ end gem 'oj' gem 'builder' gem 'rails', '~>3.2.11' -gem 'jquery-rails', '2.0.2' +gem 'jquery-rails' gem 'jquery-ui-rails' gem 'bootstrap-sass', '2.0.4' gem 'bcrypt-ruby', '3.0.1' @@ -68,6 +68,9 @@ gem 'resque-failed-job-mailer' gem 'resque-dynamic-queues' gem 'resque-lonely_job', '~> 1.0.0' gem 'resque_mailer' +#gem 'typescript-src', path: '../../typescript-src-ruby' +#gem 'typescript-node', path: '../../typescript-node-ruby' +#gem 'typescript-rails', path: '../../typescript-rails' gem 'quiet_assets', :group => :development gem 'bugsnag' diff --git a/web/app/assets/javascripts/application.js b/web/app/assets/javascripts/application.js index ec1dee5c6..922c5b7c4 100644 --- a/web/app/assets/javascripts/application.js +++ b/web/app/assets/javascripts/application.js @@ -31,6 +31,7 @@ //= require jquery.pulse //= require jquery.browser //= require jquery.custom-protocol +// //= require jquery.d //= require AAA_Log //= require globals //= require AAB_message_factory diff --git a/web/app/assets/javascripts/gear_wizard.js b/web/app/assets/javascripts/gear_wizard.js index bb148d5b0..d77dfe0c0 100644 --- a/web/app/assets/javascripts/gear_wizard.js +++ b/web/app/assets/javascripts/gear_wizard.js @@ -1,14 +1,35 @@ - (function (context, $) { "use strict"; + context.JK = context.JK || {}; context.JK.GearWizard = function (app) { var $dialog = null; + var $wizardSteps = null; + var $currentWizardStep = null; + var step = 0; - function beforeShow() { + function moveToStep() { + var $nextWizardStep = $wizardSteps.filter($('[layout-wizard-step=' + step + ']')); + + $wizardSteps.hide(); + + $currentWizardStep = $nextWizardStep; + $currentWizardStep.show(); + } + + function reset() { + $currentWizardStep = null; + } + + function beforeShow(args) { + step = args.d1; + if(!step) step = 0; + + + moveToStep(); } function afterShow() { @@ -19,9 +40,28 @@ } - function events() { + function back() { + var currentStep = parseInt($(this).closest('.wizard-step').attr('layout-wizard-step')); + step = currentStep - 1; + moveToStep(); + return false; } + function next() { + var currentStep = parseInt($(this).closest('.wizard-step').attr('layout-wizard-step')); + step = currentStep + 1; + moveToStep(); + return false; + } + + function events() { + $('.btn-next').on('click', next); + $('.btn-back').on('click', back); + } + + function route() { + + } function initialize() { var dialogBindings = { beforeShow: beforeShow, afterShow: afterShow, afterHide: afterHide }; @@ -29,6 +69,7 @@ app.bindDialog('gear-wizard', dialogBindings); $dialog = $('#gear-wizard-dialog'); + $wizardSteps = $dialog.find('.wizard-step'); events(); } diff --git a/web/app/assets/stylesheets/client/gearWizard.css.scss b/web/app/assets/stylesheets/client/gearWizard.css.scss index 100a37424..f6c469d7f 100644 --- a/web/app/assets/stylesheets/client/gearWizard.css.scss +++ b/web/app/assets/stylesheets/client/gearWizard.css.scss @@ -17,6 +17,10 @@ font-size:15px; color:#aaa; + .wizard-step { + display:none; + } + a { text-decoration: underline; } diff --git a/web/app/views/clients/_account_identity.html.erb b/web/app/views/clients/_account_identity.html.erb index c0514284e..9b8866b96 100644 --- a/web/app/views/clients/_account_identity.html.erb +++ b/web/app/views/clients/_account_identity.html.erb @@ -74,7 +74,7 @@ - +
diff --git a/web/app/views/clients/_gear_wizard.html.haml b/web/app/views/clients/_gear_wizard.html.haml deleted file mode 100644 index 2ce2b422e..000000000 --- a/web/app/views/clients/_gear_wizard.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -.dialog.gear-wizard{ layout: 'dialog', 'layout-id' => 'gear-wizard', id: 'gear-wizard-dialog'} - .content-head - %h1 audio gear setup - - .ftue-inner{ 'layout-wizard' => 'gear-wizard' } - .wizard-step{ 'layout-wizard-step' => "0", 'dialog-title' => "audio gear settings", 'dialog-purpose' => "Intro", 'style'=>"display:block;" } - %iframe{width:320, height:195, src: '//www.youtube.com/embed/ylYcvTY9CVo?html5=1&wmode=transparent&rel=0', frameborder: 0, allowfullscreen: true, wmode: "Opaque", playsinline:'inline'} \ No newline at end of file diff --git a/web/app/views/clients/gear/_buttons.html.haml b/web/app/views/clients/gear/_buttons.html.haml new file mode 100644 index 000000000..3e547d4b0 --- /dev/null +++ b/web/app/views/clients/gear/_buttons.html.haml @@ -0,0 +1,16 @@ + +- show_back ||= local_assigns[:show_back] = local_assigns.fetch(:show_back, true) +- show_next ||= local_assigns[:show_next] = local_assigns.fetch(:show_next, true) + +- total_steps = 7 + +.buttons + - if step > 0 && step != total_steps + %a.button-orange.btn-back{href:'#'} BACK + - if step != total_steps + %a.button-orange.btn-next{href:'#'} NEXT + - if step == total_steps + %a.button-orange.btn-close{href:'#', 'layout-action' => 'close'} CLOSE + + + diff --git a/web/app/views/clients/gear/_gear_wizard.html.haml b/web/app/views/clients/gear/_gear_wizard.html.haml new file mode 100644 index 000000000..07998175a --- /dev/null +++ b/web/app/views/clients/gear/_gear_wizard.html.haml @@ -0,0 +1,43 @@ +.dialog.gear-wizard{ layout: 'dialog', 'layout-id' => 'gear-wizard', id: 'gear-wizard-dialog'} + .content-head + %h1 audio gear setup + + .ftue-inner{ 'layout-wizard' => 'gear-wizard' } + .wizard-step{ 'layout-wizard-step' => "0", 'dialog-title' => "Understand Your Gear", 'dialog-purpose' => "Intro"} + read this + + = render :partial => "clients/gear/buttons", locals: { step: 0 } + + .wizard-step{ 'layout-wizard-step' => "1", 'dialog-title' => "Select & Test Audio Gear", 'dialog-purpose' => "SelectAudioGear" } + select audio gear + + = render :partial => "clients/gear/buttons", locals: { step: 1 } + + .wizard-step{ 'layout-wizard-step' => "2", 'dialog-title' => "Configure Tracks", 'dialog-purpose' => "ConfigureTracks" } + configure tracks + + = render :partial => "clients/gear/buttons", locals: { step: 2 } + + .wizard-step{ 'layout-wizard-step' => "3", 'dialog-title' => "Configure Voice Chat", 'dialog-purpose' => "ConfigureVoiceChat" } + configure voice chat + + = render :partial => "clients/gear/buttons", locals: { step: 3 } + + .wizard-step{ 'layout-wizard-step' => "4", 'dialog-title' => "Turn Off Direct Monitoring", 'dialog-purpose' => "DirectMonitoring" } + turn off direct monitoring + + = render :partial => "clients/gear/buttons", locals: { step: 4 } + + .wizard-step{ 'layout-wizard-step' => "5", 'dialog-title' => "Test Router & Network", 'dialog-purpose' => "TestRouterNetwork" } + test router network + + = render :partial => "clients/gear/buttons", locals: { step: 5 } + + .wizard-step{ 'layout-wizard-step' => "6", 'dialog-title' => "Success!", 'dialog-purpose' => "Success" } + success! + + = render :partial => "clients/gear/buttons", locals: { step: 6 } + + + + diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index f3742ae20..e3e56221c 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -14,7 +14,7 @@ <%= render "faders" %> <%= render "vu_meters" %> <%= render "ftue" %> -<%= render "gear_wizard" %> +<%= render "clients/gear/gear_wizard" %> <%= render "terms" %> <%= render "leaveSessionWarning" %> <%= render "alert" %>