Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Mizunashi Mana 2015-06-13 23:05:25 +09:00
commit 8af0788bb4
17 changed files with 417 additions and 36 deletions

View file

@ -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) {

View file

@ -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儘量省略掉那個選項吧',

View file

@ -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();

View file

@ -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>

View file

@ -75,7 +75,7 @@ var MarkdownGrabber = ContainedBase.extend({
var confirmCancel = new Views.ConfirmCancelView({
deferred: buttonDefer,
destination: this.getDestination()
}.bind(this));
});
}
this.updatePreview();

View file

@ -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') || "&nbsp;",
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) {