Fixing whitespace conformity on engine.js

This commit is contained in:
Travis Weston
2014-07-16 23:45:48 -04:00
parent d164d1d466
commit 33e9772a1a
+20 -46
View File
@@ -317,12 +317,18 @@
}); });
}, },
export64: function() { generateExport64: function(){
Engine.saveGame();
var string64 = Base64.encode(localStorage.gameState); var string64 = Base64.encode(localStorage.gameState);
string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\s/g, '');
string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, ''); string64 = string64.replace(/\n/g, '');
return string64;
},
export64: function() {
Engine.saveGame();
var string64 = Engine.generateExport64();
Engine.enableSelection(); Engine.enableSelection();
Events.startEvent({ Events.startEvent({
title: _('Export'), title: _('Export'),
@@ -339,51 +345,19 @@
} }
} }
} }
} });
}); Engine.autoSelect('#description textarea')
}, },
generateExport64: function(){ import64: function(string64) {
var string64 = Base64.encode(localStorage.gameState); Engine.disableSelection();
string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\s/g, '');
string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, ''); string64 = string64.replace(/\n/g, '');
var decodedSave = Base64.decode(string64);
return string64; localStorage.gameState = decodedSave;
}, location.reload();
},
export64: function() {
Engine.saveGame();
var string64 = Engine.generateExport64();
Engine.enableSelection();
Events.startEvent({
title: _('Export'),
scenes: {
start: {
text: [_('save this.')],
textarea: string64,
buttons: {
'done': {
text: _('got it'),
nextScene: 'end',
onChoose: Engine.disableSelection
}
}
}
}
});
Engine.autoSelect('#description textarea')
},
import64: function(string64) {
Engine.disableSelection();
string64 = string64.replace(/\s/g, '');
string64 = string64.replace(/\./g, '');
string64 = string64.replace(/\n/g, '');
var decodedSave = Base64.decode(string64);
localStorage.gameState = decodedSave;
location.reload();
},
event: function(cat, act) { event: function(cat, act) {
if(typeof ga === 'function') { if(typeof ga === 'function') {