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

Commit3f197cf

Browse files
committed
move alert into "alert" module
1 parentb5cf63b commit3f197cf

File tree

35 files changed

+188
-78
lines changed

35 files changed

+188
-78
lines changed

‎lib/actions/_types.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"use strict";
2-
exports.ALERT_REPLAY='ALERT_REPLAY';
3-
exports.ALERT_OPEN='ALERT_OPEN';
4-
exports.ALERT_CLOSE='ALERT_CLOSE';
52
exports.COMPLETE_PAGE='COMPLETE_PAGE';
63
exports.COMPLETE_TUTORIAL='COMPLETE_TUTORIAL';
74
exports.DEVTOOLS_TOGGLE='DEVTOOLS_TOGGLE';

‎lib/actions/index.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
2-
varalert_1=require('./alert');
3-
exports.alertOpen=alert_1.alertOpen;
4-
exports.alertClose=alert_1.alertClose;
5-
exports.alertReplay=alert_1.alertReplay;
2+
varactions_1=require('../modules/alert/actions');
3+
exports.alertOpen=actions_1.alertOpen;
4+
exports.alertClose=actions_1.alertClose;
5+
exports.alertReplay=actions_1.alertReplay;
66
varprogress_1=require('./progress');
77
exports.progressLoad=progress_1.progressLoad;
88
exports.completePage=progress_1.completePage;

‎lib/actions/page.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function pageSet(pagePosition) {
1919
if(pagePosition===void0){pagePosition=0;}
2020
returnfunction(dispatch,getState){
2121
var_a=getState(),dir=_a.dir,progress=_a.progress,tutorial=_a.tutorial,route=_a.route;
22-
console.log(pagePosition,dir,progress,tutorial,route);
2322
if(pagePosition>=progress.pages.length){
2423
dispatch({type:_types_1.ROUTE_SET,payload:{route:'final'}});
2524
}

‎lib/actions/progress.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var_types_1=require('./_types');
3-
varalert_1=require('./alert');
3+
varactions_1=require('../modules/alert/actions');
44
vartest_1=require('./test');
55
functionprogressPagePositionLoad(){
66
returnfunction(dispatch,getState){
@@ -28,7 +28,7 @@ function completePage(completed) {
2828
dispatch(completeTutorial());
2929
}
3030
else{
31-
dispatch(alert_1.alertOpen({
31+
dispatch(actions_1.alertOpen({
3232
message:"Page "+(pagePosition+1)+" Complete",
3333
action:'PASS',
3434
}));
@@ -45,7 +45,7 @@ function completeTutorial(completed) {
4545
returnfunction(dispatch,getState){
4646
vartutorial=getState().tutorial;
4747
dispatch({type:_types_1.COMPLETE_TUTORIAL,payload:{tutorial:tutorial,completed:completed}});
48-
dispatch(alert_1.alertOpen({
48+
dispatch(actions_1.alertOpen({
4949
message:'Tutorial Complete',
5050
action:'PASS',
5151
}));

‎lib/actions/test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var_types_1=require('./_types');
33
varhint_1=require('./hint');
44
varprogress_1=require('./progress');
5-
varalert_1=require('./alert');
5+
varactions_1=require('../modules/alert/actions');
66
functiontestRun(){
77
returnfunction(dispatch,getState){
88
var_a=getState(),taskTests=_a.taskTests,dir=_a.dir,tutorial=_a.tutorial,taskPosition=_a.taskPosition;
@@ -35,7 +35,7 @@ function testResult(result) {
3535
});
3636
}
3737
dispatch({type:_types_1.TEST_RESULT,payload:{result:result,taskActions:taskActions}});
38-
dispatch(alert_1.alertOpen(alert));
38+
dispatch(actions_1.alertOpen(alert));
3939
};
4040
}
4141
exports.testResult=testResult;

‎lib/actions/tutorial.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var_types_1=require('./_types');
33
varprogress_1=require('./progress');
44
varroute_1=require('./route');
5-
varalert_1=require('./alert');
5+
varactions_1=require('../modules/alert/actions');
66
functiontutorialSet(name){
77
returnfunction(dispatch,getState){
88
vardir=getState().dir;
@@ -20,7 +20,7 @@ function tutorialUpdate(name) {
2020
duration:3000,
2121
};
2222
dispatch({type:_types_1.TUTORIAL_UPDATE,payload:{name:name}});
23-
dispatch(alert_1.alertOpen(alert));
23+
dispatch(actions_1.alertOpen(alert));
2424
};
2525
}
2626
exports.tutorialUpdate=tutorialUpdate;

‎lib/components/Page/ProgressBar/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var LinearProgress_1 = require('material-ui/LinearProgress');
44
varstyle={
55
height:'10px',
66
position:'relative',
7-
margin:'0',
7+
margin:'0px',
88
};
99
varProgressBar=function(_a){
1010
vartaskPosition=_a.taskPosition,taskLength=_a.taskLength,completed=_a.completed;

‎lib/components/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
2-
varAlert_1=require('./Alert');
3-
exports.Alert=Alert_1.default;
2+
varalert_1=require('../modules/alert');
3+
exports.Alert=alert_1.Alert;
44
varAppMenu_1=require('./AppMenu');
55
exports.AppMenu=AppMenu_1.default;
66
varFinalPage_1=require('./FinalPage');

‎lib/modules/alert/Alert.js‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"use strict";
2+
var__extends=(this&&this.__extends)||function(d,b){
3+
for(varpinb)if(b.hasOwnProperty(p))d[p]=b[p];
4+
function__(){this.constructor=d;}
5+
d.prototype=b===null ?Object.create(b) :(__.prototype=b.prototype,new__());
6+
};
7+
var__decorate=(this&&this.__decorate)||function(decorators,target,key,desc){
8+
varc=arguments.length,r=c<3 ?target :desc===null ?desc=Object.getOwnPropertyDescriptor(target,key) :desc,d;
9+
if(typeofReflect==="object"&&typeofReflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);
10+
elsefor(vari=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3 ?d(r) :c>3 ?d(target,key,r) :d(target,key))||r;
11+
returnc>3&&r&&Object.defineProperty(target,key,r),r;
12+
};
13+
var__metadata=(this&&this.__metadata)||function(k,v){
14+
if(typeofReflect==="object"&&typeofReflect.metadata==="function")returnReflect.metadata(k,v);
15+
};
16+
varReact=require('react');
17+
varreact_redux_1=require('react-redux');
18+
varSnackbar_1=require('material-ui/Snackbar');
19+
varactions_1=require('./actions');
20+
vardefaultAlert={
21+
message:'',
22+
open:false,
23+
};
24+
varstyles={
25+
display:'inline-block',
26+
margin:'0px 10px',
27+
};
28+
varAlert=(function(_super){
29+
__extends(Alert,_super);
30+
functionAlert(){
31+
_super.apply(this,arguments);
32+
}
33+
Alert.prototype.render=function(){
34+
var_a=this.props,alert=_a.alert,close=_a.close;
35+
varaction=alert.action,message=alert.message,open=alert.open,duration=alert.duration,color=alert.color;
36+
return(React.createElement(Snackbar_1.default,{style:styles,bodyStyle:{color:color},open:open,message:message||'',action:action||'',autoHideDuration:duration||2000,onRequestClose:close}));
37+
};
38+
Alert=__decorate([
39+
react_redux_1.connect(null,function(dispatch){
40+
return{
41+
close:function(){returndispatch(actions_1.alertClose());}
42+
};
43+
}),
44+
__metadata('design:paramtypes',[])
45+
],Alert);
46+
returnAlert;
47+
}(React.Component));
48+
Object.defineProperty(exports,"__esModule",{value:true});
49+
exports.default=Alert;

‎lib/modules/alert/actions.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
vartypes_1=require('./types');
3+
functionalertOpen(alert){
4+
returnfunction(dispatch,getState){
5+
dispatch({type:types_1.ALERT_OPEN,payload:{alert:alert}});
6+
};
7+
}
8+
exports.alertOpen=alertOpen;
9+
functionalertReplay(){
10+
return{type:types_1.ALERT_REPLAY};
11+
}
12+
exports.alertReplay=alertReplay;
13+
functionalertClose(){
14+
return{type:types_1.ALERT_CLOSE};
15+
}
16+
exports.alertClose=alertClose;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp