Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e7c3d7

Browse files
committed
improved typings
1 parent65ff242 commit1e7c3d7

File tree

28 files changed

+1194
-106
lines changed

28 files changed

+1194
-106
lines changed

‎lib/atom/main.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ var subscriptions_1 = require('./subscriptions');
55
vareditor_1=require('./editor');
66
varMain=(function(){
77
functionMain(){
8-
window.coderoad={};
8+
window.coderoad={
9+
dir:null
10+
};
911
polyfills_1.default();
1012
editor_1.setAtomGlobals();
1113
this.root=render_1.initRoot();
@@ -22,7 +24,7 @@ var Main = (function () {
2224
};
2325
Main.prototype.deactivate=function(){
2426
if(this.statusBarTile){
25-
this.statusBarTile.dispose();
27+
this.statusBarTile.destroy();
2628
this.statusBarTile=null;
2729
}
2830
subscriptions_1.onDeactivateSubscriptionsAndUnmount();

‎lib/components/page/chapter.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict';
2+
varReact=require('react');
23
var_components_1=require('../_components');
34
Object.defineProperty(exports,"__esModule",{value:true});
45
exports.default=function(_a){

‎lib/components/page/page.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ var default_1 = (function (_super) {
7575
default_1.prototype.displayHint=function(task){
7676
if(task&&task.hints&&task.hints.length){
7777
if(this.state.hintPos<task.hints.length-1){
78-
this.setState({hintPos:this.state.hintPos+=1});
78+
this.setState({hintPos:this.state.hintPos+=1,taskPos:this.state.taskPos});
7979
}
8080
}
8181
else{
82-
this.setState({hintPos:-1});
82+
this.setState({hintPos:-1,taskPos:this.state.taskPos});
8383
}
8484
};
8585
default_1.prototype.hintsShown=function(task){

‎lib/components/progress/progress.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var React = require('react');
1717
varreact_redux_1=require('react-redux');
1818
varAction=require('../../actions/actions');
1919
varmaterial_ui_1=require('material-ui');
20-
varclassNames=require('classnames');
2120
varCompleted=require('material-ui/lib/svg-icons/toggle/check-box');
2221
varCurrent=require('material-ui/lib/svg-icons/av/play-circle-filled');
2322
varAllCompleted=require('material-ui/lib/svg-icons/action/done-all');

‎lib/components/render.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function unmount(target) {
1717
ReactDOM.unmountComponentAtNode(target);
1818
}
1919
exports.unmount=unmount;
20-
functioninitRoot(canStart){
20+
functioninitRoot(){
2121
varroot=document.createElement('div');
2222
root.setAttribute('id',rootName);
2323
root.hidden=true;

‎lib/reducers/editor-actions/actions.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ function getParams(actionString) {
2121
varparams=actionString.substring(command.length+1,actionString.length-1);
2222
if(!params.length){
2323
console.error('Error loading editor action params ',actionString);
24-
return'';
24+
returnnull;
2525
}
26-
params=parser_1.parseParams.getParams(params);
27-
returnparams;
26+
varparamsList=parser_1.parseParams.getParams(params);
27+
returnparamsList;
2828
}
2929
exports.getParams=getParams;
3030
functioncreateObjectFromKeyValString(string){

‎lib/reducers/editor-actions/editor-actions.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ var _ = require('lodash');
44
varactions_1=require('./actions');
55
functionhandleEditorActions(actionArray){
66
if(actionArray&&actionArray.length){
7-
returnPromise.all(actionArray.map(function(actionString){returnactions_1.editorActions(actionString);}));
7+
actionArray.map(function(actionString){returnactions_1.editorActions(actionString);});
88
}
99
}
1010
varcurrentTaskPosition=0;
11+
varactions;
1112
functioneditorActionsReducer(editorActions,action){
1213
if(editorActions===void0){editorActions=[];}
1314
switch(action.type){
1415
caseType.SET_PAGE:
15-
varactions=action.payload.actions;
16+
actions=action.payload.actions;
1617
currentTaskPosition=0;
1718
handleEditorActions(actions.shift());
1819
returnactions;
1920
caseType.TEST_RESULT:
20-
varactions=action.payload.actions;
21+
actions=action.payload.actions;
2122
varnextTaskPosition=action.payload.result.taskPosition;
2223
if(nextTaskPosition>currentTaskPosition){
2324
_.times(handleEditorActions(actions.shift()),nextTaskPosition-currentTaskPosition);

‎lib/reducers/reducer.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var run_tests_1 = require('./run-tests/run-tests');
1313
vareditor_actions_1=require('./editor-actions/editor-actions');
1414
vartutorials_1=require('./tutorials/tutorials');
1515
varlog_1=require('./log/log');
16-
varhint_1=require('./hint/hint');
1716
Object.defineProperty(exports,"__esModule",{value:true});
1817
exports.default=redux_1.combineReducers({
1918
project:project_1.default,
@@ -28,6 +27,5 @@ exports.default = redux_1.combineReducers({
2827
runTests:run_tests_1.default,
2928
editorActions:editor_actions_1.default,
3029
tutorials:tutorials_1.default,
31-
log:log_1.default,
32-
hint:hint_1.default
30+
log:log_1.default
3331
});

‎lib/services/package.js‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,16 @@ var PackageService = (function () {
4343
var_this=this;
4444
varconfig=this.config.config;
4545
return!tasks ?[] :tasks.map(function(task){
46-
task.tests=!task.tests ?[] :task.tests.map(function(tests){
47-
if(_.isString(tests)){
48-
return[].concat(configTestString(config,_this.packageName,tests));
49-
}
50-
else{
51-
console.error('Invalid task test',tests);
52-
}
53-
});
46+
if(task.tests){
47+
task.tests=task.tests.map(function(tests){
48+
if(_.isString(tests)){
49+
return[].concat(configTestString(config,_this.packageName,tests));
50+
}
51+
else{
52+
console.error('Invalid task test',tests);
53+
}
54+
});
55+
}
5456
returntask;
5557
});
5658
};

‎src/atom/main.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class Main {
99
root:HTMLElement;
1010
statusBarTile:StatusBar.IStatusBarView;
1111
constructor(){
12-
window.coderoad={};
12+
window.coderoad={
13+
dir:null
14+
};
1315
loadPolyfills();
1416
setAtomGlobals();
1517
this.root=initRoot();
@@ -28,7 +30,7 @@ class Main {
2830
}
2931
deactivate():void{
3032
if(this.statusBarTile){
31-
this.statusBarTile.dispose();
33+
this.statusBarTile.destroy();
3234
this.statusBarTile=null;
3335
}
3436
onDeactivateSubscriptionsAndUnmount();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp