Add proper showing of FTUE on Create/Join session if id hasn't been done.

This commit is contained in:
Jonathon Wilson 2013-11-05 15:44:40 -07:00
parent 443593a9ee
commit 1aeb358d29
5 changed files with 39 additions and 11 deletions

View File

@ -178,6 +178,13 @@
function submitForm(evt) {
evt.preventDefault();
// If user hasn't completed FTUE - do so now.
if (!(context.jamClient.FTUEGetStatus())) {
app.afterFtue = function() { submitForm(evt); };
app.layout.showDialog('ftue');
return;
}
var isValid = validateForm();
if (!isValid) {
// app.notify({
@ -435,4 +442,4 @@
return this;
};
})(window,jQuery);
})(window,jQuery);

View File

@ -422,7 +422,16 @@
return false;
}
jamClient.FTUESave(true);
jamClient.FTUESetStatus(true); // No FTUE wizard next time
rest.userCertifiedGear({success:true});
app.layout.closeDialog('ftue');
if (app.afterFtue) {
// If there's a function to invoke, invoke it.
logger.dbg("afterFTUE function:");
logger.dbg(app.afterFtue);
app.afterFtue();
app.afterFtue = null;
}
return false;
}

View File

@ -255,12 +255,6 @@
}
logger.debug("Changing screen to " + url);
context.location = url;
if (!(context.jamClient.FTUEGetStatus())) {
app.layout.showDialog('ftue');
}
// TODO FIXME REMOVE ME - Testing Only
app.layout.showDialog('ftue');
}
this.unloadFunction = function() {
@ -296,6 +290,9 @@
}
};
// Holder for a function to invoke upon successfully completing the FTUE.
// See createSession.submitForm as an example.
this.afterFtue = null;
// enable temporary suspension of heartbeat for fine-grained control
this.heartbeatActive = true;

View File

@ -383,12 +383,20 @@
function linkClicked(evt) {
evt.preventDefault();
var $currentTarget = $(evt.currentTarget);
// allow links to be disabled
if($(evt.currentTarget).hasClass("disabled") ) {
if($currentTarget.hasClass("disabled") ) {
return;
}
// If link requires FTUE, show that first.
if ($currentTarget.hasClass("requires-ftue")) {
if (!(context.jamClient.FTUEGetStatus())) {
app.layout.showDialog('ftue');
}
}
var destination = $(evt.currentTarget).attr('layout-link');
var destinationType = $('[layout-id="' + destination + '"]').attr("layout");
if (destinationType === "screen") {

View File

@ -138,7 +138,14 @@
var $parentRow = $('tr[id=' + session.id + ']', tbGroup);
$('#join-link', $parentRow).click(function(evt) {
joinClick(session.id);
// If no FTUE, show that first.
if (!(context.jamClient.FTUEGetStatus())) {
app.afterFtue = function() { joinClick(session.id); };
app.layout.showDialog('ftue');
return;
} else {
joinClick(session.id);
}
});
}
}
@ -201,7 +208,7 @@
}
function openAlert(sessionId) {
var alertDialog = new context.JK.AlertDialog(app, "YES",
var alertDialog = new context.JK.AlertDialog(app, "YES",
"You must be approved to join this session. Would you like to send a request to join?",
sessionId, onCreateJoinRequest);
@ -210,7 +217,7 @@
}
function sessionNotJoinableAlert() {
var alertDialog = new context.JK.AlertDialog(app, "OK",
var alertDialog = new context.JK.AlertDialog(app, "OK",
"This session is over or is no longer public and cannot be joined. Please click Refresh to update the session list.",
null,
function(evt) {