mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-15 17:14:25 +02:00
git demonstration co ming along
This commit is contained in:
parent
388f449ab6
commit
c1813c346c
8 changed files with 231 additions and 11 deletions
src/js/views
|
@ -5,8 +5,49 @@ var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.
|
|||
|
||||
var ModalTerminal = require('../views').ModalTerminal;
|
||||
var ContainedBase = require('../views').ContainedBase;
|
||||
var ConfirmCancelView = require('../views').ConfirmCancelView;
|
||||
var LeftRightView = require('../views').LeftRightView;
|
||||
var ModalAlert = require('../views').ModalAlert;
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
|
||||
var GitDemonstrationView = ContainedBase.extend({
|
||||
tagName: 'div',
|
||||
className: 'gitDemonstrationView box horizontal',
|
||||
template: _.template($('#git-demonstration-view').html()),
|
||||
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
this.JSON = _.extend(
|
||||
options,
|
||||
{
|
||||
beforeMarkdowns: [
|
||||
'## Git Commits',
|
||||
'',
|
||||
'Awesome!'
|
||||
],
|
||||
command: 'git commit',
|
||||
afterMarkdowns: [
|
||||
'Now you have seen it in action',
|
||||
'',
|
||||
'Go ahead and try the level!'
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
var convert = function(markdowns) {
|
||||
return require('markdown').markdown.toHTML(markdowns.join('\n'));
|
||||
};
|
||||
|
||||
this.JSON.beforeHTML = convert(this.JSON.beforeMarkdowns);
|
||||
this.JSON.afterHTML = convert(this.JSON.afterMarkdowns);
|
||||
|
||||
this.container = new ModalTerminal({
|
||||
title: options.title || 'Git Demonstration'
|
||||
});
|
||||
this.render();
|
||||
|
||||
if (!options.wait) {
|
||||
this.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
exports.GitDemonstrationView = GitDemonstrationView;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue