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

Commitd34e3d0

Browse files
committed
remove RAT, break ALERT_TOGGLE into OPEN & CLOSE
1 parentea9cc35 commitd34e3d0

File tree

22 files changed

+50
-55
lines changed

22 files changed

+50
-55
lines changed

‎lib/actions/_types.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use strict";
22
exports.ALERT_REPLAY='ALERT_REPLAY';
3-
exports.ALERT_TOGGLE='ALERT_TOGGLE';
3+
exports.ALERT_OPEN='ALERT_OPEN';
4+
exports.ALERT_CLOSE='ALERT_CLOSE';
45
exports.COMPLETE_PAGE='COMPLETE_PAGE';
56
exports.COMPLETE_TUTORIAL='COMPLETE_TUTORIAL';
67
exports.DEVTOOLS_TOGGLE='DEVTOOLS_TOGGLE';
78
exports.HINT_POSITION_SET='HINT_POSITION_SET';
89
exports.PAGE_SET='PAGE_SET';
9-
exports.PAGE_POSITION_SET='POSITION_SET';
1010
exports.PROGRESS_LOAD='PROGRESS_LOAD';
1111
exports.PROGRESS_PAGE_POSITION_LOAD='PROGRESS_PAGE_POSITION_LOAD';
1212
exports.QUIT='QUIT';

‎lib/actions/alert.js‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
"use strict";
22
var_types_1=require('./_types');
3-
functionalertToggle(alert){
3+
functionalertOpen(alert){
44
returnfunction(dispatch,getState){
5-
dispatch({type:_types_1.ALERT_TOGGLE,payload:{alert:alert}});
5+
dispatch({type:_types_1.ALERT_OPEN,payload:{alert:alert}});
66
};
77
}
8-
exports.alertToggle=alertToggle;
8+
exports.alertOpen=alertOpen;
99
functionalertReplay(){
1010
return{type:_types_1.ALERT_REPLAY};
1111
}
1212
exports.alertReplay=alertReplay;
13+
functionalertClose(){
14+
return{type:_types_1.ALERT_CLOSE};
15+
}
16+
exports.alertClose=alertClose;

‎lib/actions/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22
varalert_1=require('./alert');
3-
exports.alertToggle=alert_1.alertToggle;
3+
exports.alertOpen=alert_1.alertOpen;
4+
exports.alertClose=alert_1.alertClose;
45
exports.alertReplay=alert_1.alertReplay;
56
varprogress_1=require('./progress');
67
exports.progressLoad=progress_1.progressLoad;
@@ -12,7 +13,6 @@ exports.hintPositionSet = hint_1.hintPositionSet;
1213
varpage_1=require('./page');
1314
exports.pageSet=page_1.pageSet;
1415
exports.pageNext=page_1.pageNext;
15-
exports.pagePositionSet=page_1.pagePositionSet;
1616
varroute_1=require('./route');
1717
exports.routeSet=route_1.routeSet;
1818
varsetup_1=require('./setup');

‎lib/actions/page.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,3 @@ function pageSet(pagePosition) {
3030
};
3131
}
3232
exports.pageSet=pageSet;
33-
functionpagePositionSet(pagePosition){
34-
return{type:_types_1.PAGE_POSITION_SET,payload:{pagePosition:pagePosition}};
35-
}
36-
exports.pagePositionSet=pagePositionSet;

‎lib/actions/progress.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function completePage(completed) {
2828
dispatch(completeTutorial());
2929
}
3030
else{
31-
dispatch(alert_1.alertToggle({
31+
dispatch(alert_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('ALER'({
48+
dispatch(alert_1.alertOpen({
4949
message:'Tutorial Complete',
5050
action:'PASS',
5151
}));

‎lib/actions/test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.alertToggle(alert));
38+
dispatch(alert_1.alertOpen(alert));
3939
};
4040
}
4141
exports.testResult=testResult;

‎lib/actions/tutorial.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.alertToggle(alert));
23+
dispatch(alert_1.alertOpen(alert));
2424
};
2525
}
2626
exports.tutorialUpdate=tutorialUpdate;

‎lib/components/Alert/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ var Alert = (function (_super) {
2727
_super.apply(this,arguments);
2828
}
2929
Alert.prototype.render=function(){
30-
var_a=this.props,alert=_a.alert,alertToggle=_a.alertToggle;
30+
var_a=this.props,alert=_a.alert,close=_a.close;
3131
varaction=alert.action,message=alert.message,open=alert.open,duration=alert.duration;
32-
return(React.createElement(Snackbar_1.default,{className:"cr-alert "+action,open:open,message:message||'',action:action||'NOTE',autoHideDuration:duration||2000,onRequestClose:alertToggle}));
32+
return(React.createElement(Snackbar_1.default,{className:"cr-alert "+action,open:open,message:message||'',action:action||'NOTE',autoHideDuration:duration||2000,onRequestClose:close}));
3333
};
3434
Alert=__decorate([
3535
react_redux_1.connect(null,function(dispatch){
3636
return{
37-
alertToggle:function(){returndispatch(actions_1.alertToggle({open:false}));}
37+
close:function(){returndispatch(actions_1.alertClose());}
3838
};
3939
}),
4040
__metadata('design:paramtypes',[])

‎lib/reducers/alert/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ function alertReducer(alert, action) {
2828
switch(action.type){
2929
case_types_1.ALERT_REPLAY:
3030
returnsetAlert(current);
31-
case_types_1.ALERT_TOGGLE:
31+
case_types_1.ALERT_OPEN:
3232
returnsetAlert(action.payload.alert);
33+
case_types_1.ALERT_CLOSE:
34+
returnObject.assign({},alert,{open:false});
3335
default:
3436
returnalert;
3537
}

‎lib/reducers/page-position/index.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function pagePositionReducer(pagePosition, action) {
77
varpages=action.payload.progress.pages;
88
varfirstFail=pages.indexOf(false);
99
returnfirstFail<0 ?pages.length-1 :firstFail;
10-
case_types_1.PAGE_SET:
1110
case_types_1.PAGE_POSITION_SET:
1211
returnaction.payload.pagePosition;
1312
default:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp