next level and id refactor

This commit is contained in:
Peter Cottle 2013-01-09 13:38:13 -08:00
parent d406317788
commit f0a9c66056
8 changed files with 416 additions and 210 deletions

View file

@ -367,7 +367,7 @@ var ConfirmCancelTerminal = Backbone.View.extend({
var NextLevelConfirm = ConfirmCancelTerminal.extend({
initialize: function(options) {
options = options || {};
this.nextLevelName = options.nextLevelName || 'The mysterious next level';
var nextLevelName = (options.nextLevel) ? options.nextLevel.name : '';
var markdowns = [
'## Great Job!!',
@ -386,11 +386,18 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({
);
}
markdowns = markdowns.concat([
'',
'Would you like to move onto "',
this.nextLevelName + '", the next level?'
]);
if (options.nextLevel) {
markdowns = markdowns.concat([
'',
'Would you like to move onto "',
nextLevelName + '", the next level?'
]);
} else {
markdowns = markdowns.concat([
'',
'Wow!!! You finished the last level, congratulations!'
]);
}
options.modalAlert = {
markdowns: markdowns