Minified version to match full

This commit is contained in:
Matt Pass
2017-03-10 13:29:11 +00:00
parent c1cd34951c
commit 85e441390c

View File

@@ -4054,7 +4054,7 @@ var ICEcoder = {
// Reset the auto-logout timer
top.ICEcoder.resetAutoLogoutTimer();
// Detect if we type s,n,a,k,e keys, if so start snake game
// Detect if we type s,n,a,k,e keys with content saved, if so start snake game
if (!top.ICEcoder.last5Keys) {top.ICEcoder.last5Keys = [];}
top.ICEcoder.last5Keys.push(key);
if (top.ICEcoder.last5Keys.length == 6) {
@@ -4062,7 +4062,24 @@ var ICEcoder = {
}
if (top.ICEcoder.last5Keys.join() == "83,78,65,75,69") {
setTimeout(function() {
top.ICEcoder.startSnake();
// Undo back to pre 'snake' word
cM = ICEcoder.getcMInstance();
var undoCounts = 0;
var startCG = cM.changeGeneration();
while (cM.changeGeneration() > startCG-5) {
cM.undo();
undoCounts++;
}
// If we have content saved
if (top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1] == cM.changeGeneration()) {
// Start snake game
top.ICEcoder.startSnake();
// If we don't, redo snake word
} else {
for (var i=1; i<=undoCounts; i++) {
cM.redo();
}
}
},0);
}