hg demo starting

This commit is contained in:
Peter Cottle 2013-08-01 10:43:27 -07:00
parent 24b4fcd1cd
commit 8e128020d7
5 changed files with 88 additions and 66 deletions

View file

@ -6056,11 +6056,9 @@ var initDemo = function(sandbox) {
// being the smart programmer I am (not), I dont include a true value on demo, so
// I have to check if the key exists here
var commands;
if (params.hasOwnProperty('demo')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git commit; git checkout -b bugFix C1; git commit; git merge master; git checkout master; git commit; git rebase bugFix;",
"delay 1000; reset;",
"level advanced1 --noFinishDialog --noStartCommand --noIntroDialog;",
@ -6068,18 +6066,28 @@ var initDemo = function(sandbox) {
"git checkout bugFix; git rebase master; git checkout side; git rebase bugFix;",
"git checkout another; git rebase side; git rebase another master;",
"help; levels"
].join(''));
});
];
} else if (params.hasOwnProperty('hgdemo')) {
commands = [
'importTreeNow {"branches":{"master":{"target":"C3","id":"master"},"side":{"target":"C2","id":"side"},"debug":{"target":"C4","id":"debug"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2"],"id":"C4"}},"HEAD":{"target":"side","id":"HEAD"}}',
'delay 5000',
'git rebase master',
'delay 5000',
'undo',
'hg rebase -d master'
];
commands = commands.join(';#').split('#');
} else if (!params.hasOwnProperty('NODEMO')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git help;",
"delay 1000;",
"help;",
"levels"
].join(''));
];
}
if (commands) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', commands.join(''));
});
}
@ -24021,11 +24029,9 @@ var initDemo = function(sandbox) {
// being the smart programmer I am (not), I dont include a true value on demo, so
// I have to check if the key exists here
var commands;
if (params.hasOwnProperty('demo')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git commit; git checkout -b bugFix C1; git commit; git merge master; git checkout master; git commit; git rebase bugFix;",
"delay 1000; reset;",
"level advanced1 --noFinishDialog --noStartCommand --noIntroDialog;",
@ -24033,18 +24039,28 @@ var initDemo = function(sandbox) {
"git checkout bugFix; git rebase master; git checkout side; git rebase bugFix;",
"git checkout another; git rebase side; git rebase another master;",
"help; levels"
].join(''));
});
];
} else if (params.hasOwnProperty('hgdemo')) {
commands = [
'importTreeNow {"branches":{"master":{"target":"C3","id":"master"},"side":{"target":"C2","id":"side"},"debug":{"target":"C4","id":"debug"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2"],"id":"C4"}},"HEAD":{"target":"side","id":"HEAD"}}',
'delay 5000',
'git rebase master',
'delay 5000',
'undo',
'hg rebase -d master'
];
commands = commands.join(';#').split('#');
} else if (!params.hasOwnProperty('NODEMO')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git help;",
"delay 1000;",
"help;",
"levels"
].join(''));
];
}
if (commands) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', commands.join(''));
});
}

File diff suppressed because one or more lines are too long

1
build/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -445,7 +445,7 @@
For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching
-->
<script src="build/bundle.min.4a67e733.js"></script>
<script src="build/bundle.js"></script>
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
The downside? No raw logs to parse for analytics, so I have to include

View file

@ -124,11 +124,9 @@ var initDemo = function(sandbox) {
// being the smart programmer I am (not), I dont include a true value on demo, so
// I have to check if the key exists here
var commands;
if (params.hasOwnProperty('demo')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git commit; git checkout -b bugFix C1; git commit; git merge master; git checkout master; git commit; git rebase bugFix;",
"delay 1000; reset;",
"level advanced1 --noFinishDialog --noStartCommand --noIntroDialog;",
@ -136,18 +134,28 @@ var initDemo = function(sandbox) {
"git checkout bugFix; git rebase master; git checkout side; git rebase bugFix;",
"git checkout another; git rebase side; git rebase another master;",
"help; levels"
].join(''));
});
];
} else if (params.hasOwnProperty('hgdemo')) {
commands = [
'importTreeNow {"branches":{"master":{"target":"C3","id":"master"},"side":{"target":"C2","id":"side"},"debug":{"target":"C4","id":"debug"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2"],"id":"C4"}},"HEAD":{"target":"side","id":"HEAD"}}',
'delay 5000',
'git rebase master',
'delay 5000',
'undo',
'hg rebase -d master'
];
commands = commands.join(';#').split('#');
} else if (!params.hasOwnProperty('NODEMO')) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger(
'commandSubmitted',
[
commands = [
"git help;",
"delay 1000;",
"help;",
"levels"
].join(''));
];
}
if (commands) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', commands.join(''));
});
}