mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-08 21:54:26 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
8af0788bb4
17 changed files with 417 additions and 36 deletions
|
@ -84,7 +84,7 @@ var expectTreeAsync = function(command, expectedJSON, startJSON) {
|
|||
console.log(JSON.stringify(getHeadlessSummary(headless)));
|
||||
}
|
||||
return compareAnswer(headless, expectedJSON);
|
||||
}, 'trees should be equal', 100);
|
||||
}, 'trees should be equal', 400);
|
||||
};
|
||||
|
||||
var expectLevelSolved = function(levelBlob) {
|
||||
|
|
|
@ -378,7 +378,9 @@ exports.strings = {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
'git-warning-hard': {
|
||||
'__desc__': 'One of the warning messages for git',
|
||||
'en_US': 'The default behavior is a --hard reset, feel free to omit that option!',
|
||||
'en_US': 'The default behavior for resets on LearnGitBranching is a --hard, so feel free to omit ' +
|
||||
'that option if you get tired of typing it out in our lessons. Just remember that the default ' +
|
||||
'behavior on actual Git is --mixed.',
|
||||
'de_DE': 'Das Standardverhalten in dieser Demo ist --hard, du kannst die Option auch weglassen!',
|
||||
'zh_CN': '默认的行为是 --hard 硬重置,尽管省略掉那个选项吧!',
|
||||
'zh_TW': '預設的行為是 --hard reset,儘量省略掉那個選項吧!',
|
||||
|
|
|
@ -21,7 +21,6 @@ var MultiView = require('../views/multiView').MultiView;
|
|||
var CanvasTerminalHolder = require('../views').CanvasTerminalHolder;
|
||||
var ConfirmCancelTerminal = require('../views').ConfirmCancelTerminal;
|
||||
var NextLevelConfirm = require('../views').NextLevelConfirm;
|
||||
var LevelToolbar = require('../views').LevelToolbar;
|
||||
|
||||
var MarkdownPresenter = require('../views/builderViews').MarkdownPresenter;
|
||||
var MultiViewBuilder = require('../views/builderViews').MultiViewBuilder;
|
||||
|
@ -45,6 +44,7 @@ var LevelBuilder = Level.extend({
|
|||
initialize: function(options) {
|
||||
options = options || {};
|
||||
options.level = {};
|
||||
this.options = options;
|
||||
|
||||
var locale = LocaleStore.getLocale();
|
||||
options.level.startDialog = {};
|
||||
|
@ -75,10 +75,6 @@ var LevelBuilder = Level.extend({
|
|||
},
|
||||
|
||||
initName: function() {
|
||||
this.levelToolbar = new LevelToolbar({
|
||||
name: intl.str('level-builder'),
|
||||
parent: this
|
||||
});
|
||||
},
|
||||
|
||||
initGoalData: function() {
|
||||
|
@ -97,7 +93,6 @@ var LevelBuilder = Level.extend({
|
|||
this.doBothVis('hide');
|
||||
this.goalWindowPos = position;
|
||||
this.goalWindowSize = size;
|
||||
this.levelToolbar.$goalButton.text(intl.str('show-goal-button'));
|
||||
if ($('#goalPlaceholder').is(':visible')) {
|
||||
$('#goalPlaceholder').hide();
|
||||
this.mainVis.myResize();
|
||||
|
|
|
@ -71,7 +71,11 @@ var CommandView = React.createClass({
|
|||
<div id={this.props.id} className="reactCommandView">
|
||||
<p className={commandClass}>
|
||||
<span className="prompt">{'$'}</span>
|
||||
{' ' + this.state.rawStr}
|
||||
{' '}
|
||||
<span dangerouslySetInnerHTML={{
|
||||
__html: this.state.rawStr
|
||||
}}
|
||||
/>
|
||||
<span className="icons transitionAllSlow">
|
||||
<i className="icon-exclamation-sign"></i>
|
||||
<i className="icon-check-empty"></i>
|
||||
|
|
|
@ -75,7 +75,7 @@ var MarkdownGrabber = ContainedBase.extend({
|
|||
var confirmCancel = new Views.ConfirmCancelView({
|
||||
deferred: buttonDefer,
|
||||
destination: this.getDestination()
|
||||
}.bind(this));
|
||||
});
|
||||
}
|
||||
|
||||
this.updatePreview();
|
||||
|
|
|
@ -281,7 +281,6 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
// also go find the series and update the about
|
||||
_.each(this.seriesViews, function(view) {
|
||||
if (view.levelIDs.indexOf(id) === -1) {
|
||||
view.resetAbout();
|
||||
return;
|
||||
}
|
||||
view.updateAboutForLevelID(id);
|
||||
|
@ -354,8 +353,7 @@ var SeriesView = BaseView.extend({
|
|||
template: _.template($('#series-view').html()),
|
||||
events: {
|
||||
'click div.levelIcon': 'click',
|
||||
'mouseenter div.levelIcon': 'enterIcon',
|
||||
'mouseleave div.levelIcon': 'leaveIcon'
|
||||
'mouseenter div.levelIcon': 'enterIcon'
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
|
@ -365,7 +363,11 @@ var SeriesView = BaseView.extend({
|
|||
this.levels = LevelStore.getLevelsInSequence(this.name);
|
||||
|
||||
this.levelIDs = [];
|
||||
var firstLevelInfo = null;
|
||||
_.each(this.levels, function(level) {
|
||||
if (firstLevelInfo === null) {
|
||||
firstLevelInfo = this.formatLevelAbout(level.id);
|
||||
}
|
||||
this.levelIDs.push(level.id);
|
||||
}, this);
|
||||
|
||||
|
@ -375,6 +377,7 @@ var SeriesView = BaseView.extend({
|
|||
this.JSON = {
|
||||
displayName: intl.getIntlKey(this.info, 'displayName'),
|
||||
about: intl.getIntlKey(this.info, 'about') || " ",
|
||||
levelInfo: firstLevelInfo,
|
||||
ids: this.levelIDs
|
||||
};
|
||||
|
||||
|
@ -396,13 +399,8 @@ var SeriesView = BaseView.extend({
|
|||
return $(element).attr('data-id');
|
||||
},
|
||||
|
||||
resetAbout: function() {
|
||||
this.$('p.about').text(intl.getIntlKey(this.info, 'about'))
|
||||
.css('font-style', 'inherit');
|
||||
},
|
||||
|
||||
setAbout: function(content) {
|
||||
this.$('p.about').text(content).css('font-style', 'italic');
|
||||
this.$('p.levelInfo').text(content);
|
||||
},
|
||||
|
||||
enterIcon: function(ev) {
|
||||
|
@ -411,12 +409,19 @@ var SeriesView = BaseView.extend({
|
|||
},
|
||||
|
||||
updateAboutForLevelID: function(id) {
|
||||
var level = LevelStore.getLevel(id);
|
||||
this.setAbout(intl.getName(level));
|
||||
this.setAbout(this.formatLevelAbout(id));
|
||||
},
|
||||
|
||||
leaveIcon: function() {
|
||||
this.resetAbout();
|
||||
formatLevelAbout: function(id) {
|
||||
var level = LevelStore.getLevel(id);
|
||||
return this.getLevelNumberFromID(id) +
|
||||
': ' +
|
||||
intl.getName(level);
|
||||
},
|
||||
|
||||
getLevelNumberFromID: function(id) {
|
||||
// hack -- parse out the level number from the ID
|
||||
return id.replace(/[^0-9]/g, '');
|
||||
},
|
||||
|
||||
click: function(ev) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue