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

Commit996a73e

Browse files
committed
Merge branch 'packageRefactor'
2 parents4d3bdbc +f4b5f92 commit996a73e

File tree

167 files changed

+1342
-1236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1342
-1236
lines changed

‎lib/actions/_types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ exports.ALERT_TOGGLE = 'ALERT_TOGGLE';
44
exports.COMPLETE_CHAPTER='COMPLETE_CHAPTER';
55
exports.COMPLETE_PAGE='COMPLETE_PAGE';
66
exports.COMPLETE_TUTORIAL='COMPLETE_TUTORIAL';
7-
exports.GLOBALS_SET='GLOBALS_SET';
87
exports.HINT_POSITION_SET='HINT_POSITION_SET';
98
exports.HINT_SHOW='HINT_SHOW';
109
exports.PACKAGE_SET='PACKAGE_SET';
11-
exports.PAGE_NEXT='PAGE_NEXT';
1210
exports.PAGE_SET='PAGE_SET';
1311
exports.POSITION_SET='POSITION_SET';
12+
exports.PROGRESS_LOAD='PROGRESS_LOAD';
1413
exports.ROUTE_SET='ROUTE_SET';
1514
exports.SETUP_VERIFY='SETUP_VERIFY';
1615
exports.TEST_COMPLETE='TEST_COMPLETE';
1716
exports.TEST_RESULT='TEST_RESULT';
1817
exports.TEST_RUN='TEST_RUN';
18+
exports.TESTS_LOAD='TESTS_LOAD';
1919
exports.TUTORIAL_SET='TUTORIAL_SET';
2020
exports.TUTORIAL_UPDATE='TUTORIAL_UPDATE';
2121
exports.TUTORIALS_FIND='TUTORIALS_FIND';

‎lib/actions/alert.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ var _types_1 = require('./_types');
44
functionalertToggle(alert){
55
varisOpen=store_1.store.getState().alert.open;
66
if(!alert){
7-
alert={message:'',action:'',open:false};
7+
alert={
8+
action:'',
9+
message:'',
10+
open:false,
11+
};
812
}
913
else{
1014
alert=Object.assign({},{open:!isOpen},alert);
1115
}
12-
return{type:_types_1.ALERT_TOGGLE,payload:{alert:alert}};
16+
return{
17+
payload:{alert:alert},
18+
type:_types_1.ALERT_TOGGLE,
19+
};
1320
}
1421
exports.alertToggle=alertToggle;
1522
functionalertReplay(){

‎lib/actions/globals.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎lib/actions/hint.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
"use strict";
22
var_types_1=require('./_types');
33
functionhintPositionSet(hintPosition){
4-
return{type:_types_1.HINT_POSITION_SET,payload:{hintPosition:hintPosition}};
4+
return{
5+
payload:{hintPosition:hintPosition},
6+
type:_types_1.HINT_POSITION_SET,
7+
};
58
}
69
exports.hintPositionSet=hintPositionSet;
710
functionhintShow(){

‎lib/actions/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
varalert_1=require('./alert');
33
exports.alertToggle=alert_1.alertToggle;
44
exports.alertReplay=alert_1.alertReplay;
5-
varcomplete_1=require('./complete');
6-
exports.completePage=complete_1.completePage;
7-
exports.completeChapter=complete_1.completeChapter;
8-
exports.completeTutorial=complete_1.completeTutorial;
9-
varglobals_1=require('./globals');
10-
exports.globalsSet=globals_1.globalsSet;
5+
varprogress_1=require('./progress');
6+
exports.progressLoad=progress_1.progressLoad;
7+
exports.completePage=progress_1.completePage;
8+
exports.completeChapter=progress_1.completeChapter;
9+
exports.completeTutorial=progress_1.completeTutorial;
1110
varhint_1=require('./hint');
1211
exports.hintShow=hint_1.hintShow;
1312
exports.hintPositionSet=hint_1.hintPositionSet;
@@ -24,7 +23,7 @@ var test_1 = require('./test');
2423
exports.testRun=test_1.testRun;
2524
exports.testComplete=test_1.testComplete;
2625
exports.testResult=test_1.testResult;
26+
exports.testsLoad=test_1.testsLoad;
2727
vartutorial_1=require('./tutorial');
2828
exports.tutorialsFind=tutorial_1.tutorialsFind;
29-
exports.tutorialUpdate=tutorial_1.tutorialUpdate;
3029
exports.tutorialSet=tutorial_1.tutorialSet;

‎lib/actions/page.js

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
"use strict";
22
var_types_1=require('./_types');
3+
varindex_1=require('./index');
34
varstore_1=require('../store');
4-
vartutorial_package_1=require('../services/tutorial-package');
5+
var_position={
6+
chapter:0,
7+
page:0,
8+
};
59
functionpageNext(){
6-
varposition=store_1.store.getState().position;
7-
varnextPosition=tutorial_package_1.default.getNextPosition(position);
8-
returnpageSet(nextPosition);
10+
varposition=null;
11+
var_a=store_1.store.getState().position,page=_a.page,chapter=_a.chapter;
12+
varchapters=store_1.store.getState().tutorial.chapters;
13+
if(page<chapters[chapter].pages.length-1){
14+
position={
15+
chapter:chapter,
16+
page:page+1,
17+
};
18+
}
19+
elseif(chapter<chapters.length-1){
20+
store_1.store.dispatch(index_1.completePage());
21+
position={
22+
chapter:chapter+1,
23+
page:0,
24+
};
25+
}
26+
else{
27+
store_1.store.dispatch(index_1.completeTutorial());
28+
position={
29+
chapter:chapter,
30+
page:page
31+
};
32+
}
33+
return{type:_types_1.PAGE_SET,payload:{position:position}};
934
}
1035
exports.pageNext=pageNext;
11-
functionpageSet(selectedPosition){
12-
if(selectedPosition===void0){selectedPosition={chapter:0,page:0};}
13-
if(selectedPosition.completed){
14-
return{type:_types_1.ROUTE_SET,payload:{route:'final'}};
36+
functionpageSet(position){
37+
if(position===void0){position=_position;}
38+
if(position.completed){
39+
return{
40+
payload:{route:'final'},
41+
type:_types_1.ROUTE_SET,
42+
};
1543
}
16-
varpage=tutorial_package_1.default.getPage(selectedPosition);
17-
vartasks=tutorial_package_1.default.getTasks(selectedPosition);
18-
vartaskTests=[].concat.apply([],tasks.map(function(task){returntask.tests||[];}));
19-
varactions=tasks.map(function(task){returntask.actions||[];});
20-
return{type:_types_1.PAGE_SET,payload:{page:page,tasks:tasks,position:selectedPosition,taskTests:taskTests,actions:actions}};
44+
return{
45+
payload:{position:position},
46+
type:_types_1.PAGE_SET,
47+
};
2148
}
2249
exports.pageSet=pageSet;

‎lib/actions/position.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"use strict";
22
var_types_1=require('./_types');
33
functionpositionSet(position){
4-
return{type:_types_1.POSITION_SET,payload:{position:position}};
4+
return{
5+
payload:{position:position},
6+
type:_types_1.POSITION_SET,
7+
};
58
}
69
exports.positionSet=positionSet;

‎lib/actions/complete.jsrenamed to ‎lib/actions/progress.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
"use strict";
22
var_types_1=require('./_types');
33
varstore_1=require('../store');
4+
functionprogressLoad(){
5+
return{type:_types_1.PROGRESS_LOAD};
6+
}
7+
exports.progressLoad=progressLoad;
48
functioncompletePage(){
59
varposition=store_1.store.getState().position;
610
varpageLength=store_1.store.getState().progress.chapters[position.chapter].pages.length;
711
if(position.page>=pageLength-1){
812
returncompleteChapter();
913
}
10-
return{type:_types_1.COMPLETE_PAGE,payload:{position:position}};
14+
return{
15+
payload:{position:position},
16+
type:_types_1.COMPLETE_PAGE,
17+
};
1118
}
1219
exports.completePage=completePage;
1320
functioncompleteChapter(){
@@ -16,7 +23,10 @@ function completeChapter() {
1623
if(chapter>=chapterLength-1){
1724
returncompleteTutorial();
1825
}
19-
return{type:_types_1.COMPLETE_CHAPTER,payload:{chapter:chapter}};
26+
return{
27+
payload:{chapter:chapter},
28+
type:_types_1.COMPLETE_CHAPTER,
29+
};
2030
}
2131
exports.completeChapter=completeChapter;
2232
functioncompleteTutorial(){

‎lib/actions/route.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ function setRoute(route) {
1010
store_1.store.dispatch(tutorial_1.tutorialsFind());
1111
}
1212
previous=route;
13-
return{type:_types_1.ROUTE_SET,payload:{route:route}};
13+
return{
14+
payload:{route:route},
15+
type:_types_1.ROUTE_SET,
16+
};
1417
}
1518
}
1619
exports.setRoute=setRoute;

‎lib/actions/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ function testRun() {
77
exports.testRun=testRun;
88
functiontestResult(result){
99
varactions=store_1.store.getState().editorActions;
10-
return{type:_types_1.TEST_RESULT,payload:{result:result,actions:actions}};
10+
return{
11+
payload:{result:result,actions:actions},
12+
type:_types_1.TEST_RESULT,
13+
};
1114
}
1215
exports.testResult=testResult;
1316
functiontestComplete(){
1417
return{type:_types_1.TEST_COMPLETE};
1518
}
1619
exports.testComplete=testComplete;
20+
functiontestsLoad(){
21+
return{type:_types_1.TESTS_LOAD};
22+
}
23+
exports.testsLoad=testsLoad;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp