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

Commit6fa66c0

Browse files
committed
replace task checkbox with colors
1 parentd4c8ad0 commit6fa66c0

File tree

113 files changed

+2700
-68
lines changed

Some content is hidden

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

113 files changed

+2700
-68
lines changed

‎lib/actions/_types.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"use strict";
2+
exports.ALERT_REPLAY='ALERT_REPLAY';
3+
exports.ALERT_TOGGLE='ALERT_TOGGLE';
4+
exports.COMPLETE_CHAPTER='COMPLETE_CHAPTER';
5+
exports.COMPLETE_PAGE='COMPLETE_PAGE';
6+
exports.COMPLETE_TUTORIAL='COMPLETE_TUTORIAL';
7+
exports.HINT_POSITION_SET='HINT_POSITION_SET';
8+
exports.HINT_SHOW='HINT_SHOW';
9+
exports.PACKAGE_SET='PACKAGE_SET';
10+
exports.PAGE_SET='PAGE_SET';
11+
exports.POSITION_SET='POSITION_SET';
12+
exports.PROGRESS_LOAD='PROGRESS_LOAD';
13+
exports.ROUTE_SET='ROUTE_SET';
14+
exports.SETUP_VERIFY='SETUP_VERIFY';
15+
exports.TEST_COMPLETE='TEST_COMPLETE';
16+
exports.TEST_RESULT='TEST_RESULT';
17+
exports.TEST_RUN='TEST_RUN';
18+
exports.TESTS_LOAD='TESTS_LOAD';
19+
exports.TUTORIAL_SET='TUTORIAL_SET';
20+
exports.TUTORIAL_UPDATE='TUTORIAL_UPDATE';
21+
exports.TUTORIALS_FIND='TUTORIALS_FIND';

‎lib/actions/alert.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use strict";
2+
varstore_1=require('../store');
3+
var_types_1=require('./_types');
4+
functionalertToggle(alert){
5+
varisOpen=store_1.store.getState().alert.open;
6+
if(!alert){
7+
alert={
8+
action:'',
9+
message:'',
10+
open:false,
11+
};
12+
}
13+
else{
14+
alert=Object.assign({},{open:!isOpen},alert);
15+
}
16+
return{
17+
payload:{alert:alert},
18+
type:_types_1.ALERT_TOGGLE,
19+
};
20+
}
21+
exports.alertToggle=alertToggle;
22+
functionalertReplay(){
23+
return{type:_types_1.ALERT_REPLAY};
24+
}
25+
exports.alertReplay=alertReplay;

‎lib/actions/hint.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
functionhintPositionSet(hintPosition){
4+
return{
5+
payload:{hintPosition:hintPosition},
6+
type:_types_1.HINT_POSITION_SET,
7+
};
8+
}
9+
exports.hintPositionSet=hintPositionSet;
10+
functionhintShow(){
11+
return{type:_types_1.HINT_SHOW};
12+
}
13+
exports.hintShow=hintShow;

‎lib/actions/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"use strict";
2+
varalert_1=require('./alert');
3+
exports.alertToggle=alert_1.alertToggle;
4+
exports.alertReplay=alert_1.alertReplay;
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;
10+
varhint_1=require('./hint');
11+
exports.hintShow=hint_1.hintShow;
12+
exports.hintPositionSet=hint_1.hintPositionSet;
13+
varpage_1=require('./page');
14+
exports.pageSet=page_1.pageSet;
15+
exports.pageNext=page_1.pageNext;
16+
varposition_1=require('./position');
17+
exports.positionSet=position_1.positionSet;
18+
varroute_1=require('./route');
19+
exports.setRoute=route_1.setRoute;
20+
varsetup_1=require('./setup');
21+
exports.setupVerify=setup_1.setupVerify;
22+
vartest_1=require('./test');
23+
exports.testRun=test_1.testRun;
24+
exports.testComplete=test_1.testComplete;
25+
exports.testResult=test_1.testResult;
26+
exports.testsLoad=test_1.testsLoad;
27+
vartutorial_1=require('./tutorial');
28+
exports.tutorialsFind=tutorial_1.tutorialsFind;
29+
exports.tutorialSet=tutorial_1.tutorialSet;

‎lib/actions/package.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
functionpackageSet(){
4+
return{type:_types_1.PACKAGE_SET};
5+
}
6+
exports.packageSet=packageSet;

‎lib/actions/page.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
varindex_1=require('./index');
4+
varstore_1=require('../store');
5+
var_position={
6+
chapter:0,
7+
page:0,
8+
};
9+
functionpageNext(){
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}};
34+
}
35+
exports.pageNext=pageNext;
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+
};
43+
}
44+
return{
45+
payload:{position:position},
46+
type:_types_1.PAGE_SET,
47+
};
48+
}
49+
exports.pageSet=pageSet;

‎lib/actions/position.js

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

‎lib/actions/progress.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
varstore_1=require('../store');
4+
functionprogressLoad(){
5+
return{type:_types_1.PROGRESS_LOAD};
6+
}
7+
exports.progressLoad=progressLoad;
8+
functioncompletePage(){
9+
varposition=store_1.store.getState().position;
10+
varpageLength=store_1.store.getState().progress.chapters[position.chapter].pages.length;
11+
if(position.page>=pageLength-1){
12+
returncompleteChapter();
13+
}
14+
return{
15+
payload:{position:position},
16+
type:_types_1.COMPLETE_PAGE,
17+
};
18+
}
19+
exports.completePage=completePage;
20+
functioncompleteChapter(){
21+
varchapter=store_1.store.getState().position.chapter;
22+
varchapterLength=store_1.store.getState().progress.chapters.length;
23+
if(chapter>=chapterLength-1){
24+
returncompleteTutorial();
25+
}
26+
return{
27+
payload:{chapter:chapter},
28+
type:_types_1.COMPLETE_CHAPTER,
29+
};
30+
}
31+
exports.completeChapter=completeChapter;
32+
functioncompleteTutorial(){
33+
return{type:_types_1.COMPLETE_TUTORIAL};
34+
}
35+
exports.completeTutorial=completeTutorial;

‎lib/actions/route.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"use strict";
2+
varstore_1=require('../store');
3+
var_types_1=require('./_types');
4+
vartutorial_1=require('./tutorial');
5+
varprevious=null;
6+
functionsetRoute(route){
7+
if(route&&route!==previous){
8+
switch(route){
9+
case'tutorials':
10+
store_1.store.dispatch(tutorial_1.tutorialsFind());
11+
}
12+
previous=route;
13+
return{
14+
payload:{route:route},
15+
type:_types_1.ROUTE_SET,
16+
};
17+
}
18+
}
19+
exports.setRoute=setRoute;

‎lib/actions/setup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
varpackage_1=require('./package');
4+
varstore_1=require('../store');
5+
functionsetupVerify(){
6+
store_1.store.dispatch(package_1.packageSet());
7+
return{type:_types_1.SETUP_VERIFY};
8+
}
9+
exports.setupVerify=setupVerify;

‎lib/actions/test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
varstore_1=require('../store');
4+
functiontestRun(){
5+
return{type:_types_1.TEST_RUN};
6+
}
7+
exports.testRun=testRun;
8+
functiontestResult(result){
9+
varactions=store_1.store.getState().editorActions;
10+
return{
11+
payload:{result:result,actions:actions},
12+
type:_types_1.TEST_RESULT,
13+
};
14+
}
15+
exports.testResult=testResult;
16+
functiontestComplete(){
17+
return{type:_types_1.TEST_COMPLETE};
18+
}
19+
exports.testComplete=testComplete;
20+
functiontestsLoad(){
21+
return{type:_types_1.TESTS_LOAD};
22+
}
23+
exports.testsLoad=testsLoad;

‎lib/actions/tutorial.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
var_types_1=require('./_types');
3+
functiontutorialSet(name){
4+
return{
5+
payload:{name:name},
6+
type:_types_1.TUTORIAL_SET,
7+
};
8+
}
9+
exports.tutorialSet=tutorialSet;
10+
functiontutorialsFind(){
11+
return{type:_types_1.TUTORIALS_FIND};
12+
}
13+
exports.tutorialsFind=tutorialsFind;

‎lib/atom/actions.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"use strict";
2+
functioncloseAllPanels(){
3+
vareditors=atom.workspace.getTextEditors();
4+
editors.forEach(function(editor){
5+
editor.destroy();
6+
});
7+
}
8+
exports.closeAllPanels=closeAllPanels;
9+
functionquit(){
10+
}
11+
exports.quit=quit;
12+
functionopenFolder(){
13+
atom.open();
14+
}
15+
exports.openFolder=openFolder;
16+
varconsoleHasOpened=false;
17+
functiontoggleDevTools(){
18+
if(!consoleHasOpened){
19+
consoleHasOpened=true;
20+
console.log('Atom-CodeRoad: runs on save');
21+
}
22+
atom.toggleDevTools();
23+
}
24+
exports.toggleDevTools=toggleDevTools;
25+
functionopenDevTools(){
26+
atom.openDevTools();
27+
consoleHasOpened=true;
28+
}
29+
exports.openDevTools=openDevTools;
30+
functionopenTerminal(){
31+
if(atom.packages.isPackageActive('terminal-plus')){
32+
if(!document.getElementsByClassName('xterm')[0]){
33+
atom.commands.dispatch(document.getElementsByTagName('atom-workspace')[0],'terminal-plus:toggle');
34+
}
35+
returntrue;
36+
}
37+
returnfalse;
38+
}
39+
exports.openTerminal=openTerminal;

‎lib/atom/editor.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
"use strict";
2+
varfs_1=require('fs');
3+
varexists_1=require('../services/exists');
4+
vargetEditorCount=0;
5+
functionsave(){
6+
vareditor=findEditor();
7+
editor.save();
8+
}
9+
exports.save=save;
10+
functionfindEditor(){
11+
vareditor=atom.workspace.getActiveTextEditor();
12+
varmax=1000;
13+
if(!editor){
14+
getEditorCount+=1;
15+
setTimeout(function(){
16+
returnfindEditor();
17+
},10);
18+
}
19+
elseif(getEditorCount>max){
20+
console.log('Failed to find active editor');
21+
returnnull;
22+
}
23+
else{
24+
getEditorCount=0;
25+
returneditor;
26+
}
27+
}
28+
exports.findEditor=findEditor;
29+
functiongetEditor(){
30+
returnnewPromise(function(resolve,reject){
31+
resolve(findEditor());
32+
});
33+
}
34+
exports.getEditor=getEditor;
35+
functionopen(filePath,options){
36+
if(options===void0){options={};}
37+
if(exists_1.fileExists(filePath)){
38+
fs_1.unlink(filePath);
39+
}
40+
atom.workspace.open(filePath,options);
41+
}
42+
exports.open=open;
43+
functionset(text){
44+
returngetEditor().then(function(editor){
45+
editor.setText(text);
46+
editor.insertNewline();
47+
editor.moveToBottom();
48+
editor.save();
49+
setCursorPosition(editor);
50+
});
51+
}
52+
exports.set=set;
53+
functioninsert(text,options){
54+
if(options===void0){options={};}
55+
options=Object.assign(options,{
56+
autoIndent:true,
57+
});
58+
return(getEditor().then(functioninsertWithEditor(editor){
59+
editor.moveToBottom();
60+
editor.insertText(text,options);
61+
editor.insertNewline();
62+
editor.moveToBottom();
63+
editor.save();
64+
setCursorPosition(editor);
65+
}));
66+
}
67+
exports.insert=insert;
68+
varcursor=/::\s?>/g;
69+
functionsetCursorPosition(editor){
70+
editor.scan(cursor,function(scanned){
71+
editor.setCursorScreenPosition(scanned.range.start);
72+
scanned.replace('');
73+
scanned.stop();
74+
});
75+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp