Skip to content

Commit

Permalink
1.rename to Flow 2.remove buster test 3.add nest flow control
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoazhen committed Nov 26, 2013
1 parent 6ad676f commit 926bb72
Show file tree
Hide file tree
Showing 15 changed files with 913 additions and 368 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text = auto
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
.idea
.tmp
.DS_Store
*.log


bower_components/
35 changes: 35 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';

module.exports = function (grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

grunt.initConfig({
jshint: {

},
clean: {
dist: {

}
},
watch: {

},
concat:{

}
});


grunt.registerTask('server', function () {

});

grunt.registerTask('build', function () {

});

grunt.registerTask('test', function () {

});
};
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jumper
Flow
======

function flow control library
Flow control library
8 changes: 8 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Flow",
"version": "0.5.0",
"dependencies": {
"jquery": "~1.9.1",
"underscore": "*"
}
}
11 changes: 0 additions & 11 deletions buster.js

This file was deleted.

74 changes: 39 additions & 35 deletions example/example.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Example</title>
<script type="text/javascript" src="../underscore.js"></script>
<script type="text/javascript" src="../jumper.js"></script>
<meta charset="UTF-8"/>
<title>Example</title>
<script type="text/javascript" src="../src/Flow.js"></script>
</head>
<body>
<h1>Results in the console</h1>
<script type="text/javascript">
var processExemple = new Jumper(
function(a,b,c){
// If you want to using the once function, you have to give a name for the function
// like once and onceInAll
<h1>Results in the console</h1>
<script type="text/javascript">
var processExemple = new Flow(
function (a, b, c) {
// If you want to using the once function, you have to give a name for the function
// like once and onceInAll

this.onceInAll('t11', function(){
console.log('ALL 1-1'); // Just run once even you back to this step
});
console.log(1);
this.once('t12', function(){
console.log('Step 1-2 param:' +a +b+c); // Run once every time go to this step
});
}
,function(e,f,g){
console.log(2);
this.once('t22',function(){
console.log('Step 2-1 param:'+e+f+g);
});
}
,function(){
console.log(3);
}
,function(){
console.log(4);
}
,function(){
console.log(5);
}).go(1,2,3).go(4,5,6).go().go().go().back().back().back(4,5,6).action().back(1,2,3).action();
// Here you can pass the args with go(),back(),action() for functions
</script>
this.onceInAll('t11', function () {
console.log('ALL 1-1'); // Just run once even you back to this step
});
console.log(1);
this.once('t12', function () {
console.log('Step 1-2 param:' + a + b + c); // Run once every time go to this step
});
}
, function (e, f, g) {
console.log(2);
this.once('t22', function () {
console.log('Step 2-1 param:' + e + f + g);
});
}
, new Flow(function () {
console.log("Sub flow 3.1");
}, function () {
console.log("Sub flow 3.2");
}, new Flow()
)
, function () {
console.log(4);
}
, function () {
console.log(5);
}).go(1, 2, 3).go(4, 5, 6).go().go().go().go().go()
.go().go().go().go().go().go().go()
.back().back().back().back(4, 5, 6).action().back(1, 2, 3).action();
// Here you can pass the args with go(),back(),action() for functions
</script>
</body>
</html>
48 changes: 48 additions & 0 deletions example/example_underscore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Example with underscore</title>
<script type="text/javascript" src="../bower_components/underscore/underscore.js"></script>
<script type="text/javascript" src="../src/Flow_underscore.js"></script>
</head>
<body>
<h1>Results in the console</h1>
<script type="text/javascript">
var processExemple = new Flow(
function (a, b, c) {
// If you want to using the once function, you have to give a name for the function
// like once and onceInAll

this.onceInAll('t11', function () {
console.log('ALL 1-1'); // Just run once even you back to this step
});
console.log(1);
this.once('t12', function () {
console.log('Step 1-2 param:' + a + b + c); // Run once every time go to this step
});
}
, function (e, f, g) {
console.log(2);
this.once('t22', function () {
console.log('Step 2-1 param:' + e + f + g);
});
}
, new Flow(function () {
console.log("Sub flow 3.1");
}, function () {
console.log("Sub flow 3.2");
}, new Flow()
)
, function () {
console.log(4);
}
, function () {
console.log(5);
}).go(1, 2, 3).go(4, 5, 6).go().go().go().go().go()
.go().go().go().go().go().go().go()
.back().back().back().back(4, 5, 6).action().back(1, 2, 3).action();
// Here you can pass the args with go(),back(),action() for functions
</script>
</body>
</html>
Loading

0 comments on commit 926bb72

Please sign in to comment.