Merge pull request #102 from anubisthejackle/whitespace-fixes

Covert whitespace to tabs as per coding standard
This commit is contained in:
Blake Grotewold
2014-07-17 19:25:45 -04:00
15 changed files with 2261 additions and 2203 deletions
+14 -14
View File
@@ -6,11 +6,11 @@
**/
var Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
@@ -41,10 +41,10 @@ encode : function (input) {
}
return output;
},
},
// public method for decoding
decode : function (input) {
// public method for decoding
decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
@@ -78,10 +78,10 @@ decode : function (input) {
return output;
},
},
// private method for UTF-8 encoding
_utf8_encode : function (string) {
// private method for UTF-8 encoding
_utf8_encode : function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
@@ -105,10 +105,10 @@ _utf8_encode : function (string) {
}
return utftext;
},
},
// private method for UTF-8 decoding
_utf8_decode : function (utftext) {
// private method for UTF-8 decoding
_utf8_decode : function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
@@ -136,6 +136,6 @@ _utf8_decode : function (utftext) {
}
return string;
}
}
}
+53 -32
View File
@@ -128,7 +128,6 @@
});
}
$('<span>')
.addClass('lightsOff menuBtn')
.text(_('lights off.'))
@@ -204,14 +203,11 @@
},
browserValid: function() {
return location.search.indexOf('ignorebrowser=true') >= 0 || (
typeof Storage != 'undefined' &&
!oldIE);
return ( location.search.indexOf( 'ignorebrowser=true' ) >= 0 || ( typeof Storage != 'undefined' && !oldIE ) );
},
isMobile: function() {
return location.search.indexOf('ignorebrowser=true') < 0 &&
/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
return ( location.search.indexOf( 'ignorebrowser=true' ) < 0 && /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test( navigator.userAgent ) );
},
saveGame: function() {
@@ -247,8 +243,10 @@
title: _('Export / Import'),
scenes: {
start: {
text: [_('export or import save data, for backing up'),
_('or migrating computers')],
text: [
_('export or import save data, for backing up'),
_('or migrating computers')
],
buttons: {
'export': {
text: _('export'),
@@ -262,12 +260,13 @@
text: _('cancel'),
nextScene: 'end'
}
}
},
'confirm': {
text: [_('are you sure?'),
text: [
_('are you sure?'),
_('if the code is invalid, all data will be lost.'),
_('this is irreversible.')],
_('this is irreversible.')
],
buttons: {
'yes': {
text: _('yes'),
@@ -276,10 +275,29 @@
},
'no': {
text: _('no'),
nextScene: 'end'
}
}
},
'inputImport': {
text: [
_('put the save code here.')
],
textarea: '',
buttons: {
'okay': {
text: _('import'),
nextScene: 'end',
onChoose: Engine.import64
},
'cancel': {
text: _('cancel'),
nextScene: 'end'
}
}
}
},
'inputImport': {
text: [_('put the save code here.')],
textarea: '',
@@ -404,17 +422,17 @@
},
'twitter': {
text: _('twitter'),
nextScene: 'end',
onChoose: function() {
window.open('https://twitter.com/intent/tweet?text=A%20Dark%20Room&url=' + Engine.SITE_URL, 'sharer', 'width=660,height=260,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
},
nextScene: 'end'
}
},
'reddit': {
text: _('reddit'),
nextScene: 'end',
onChoose: function() {
window.open('http://www.reddit.com/submit?url=' + Engine.SITE_URL, 'sharer', 'width=960,height=700,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no');
},
nextScene: 'end'
}
},
'close': {
text: _('close'),
@@ -423,7 +441,10 @@
}
}
}
}, {width: '400px'});
},
{
width: '400px'
});
},
findStylesheet: function(title) {
@@ -438,9 +459,7 @@
isLightsOff: function() {
var darkCss = Engine.findStylesheet('darkenLights');
if (darkCss != null) {
if (darkCss.disabled)
return false;
if ( darkCss != null && !darkCss.disabled ) {
return true;
}
return false;
@@ -452,12 +471,10 @@
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
Engine.turnLightsOff;
$('.lightsOff').text(_('lights on.'));
}
else if (darkCss.disabled) {
} else if (darkCss.disabled) {
darkCss.disabled = false;
$('.lightsOff').text(_('lights on.'));
}
else {
} else {
$("#darkenLights").attr("disabled", "disabled");
darkCss.disabled = true;
$('.lightsOff').text(_('lights off.'));
@@ -507,15 +524,15 @@
$('div#weapons').animate({opacity: 1}, 300);
}
Notifications.printQueue(module);
}
},
// Move the stores panel beneath top_container (or to top: 0px if top_container
// either hasn't been filled in or is null) using transition_diff to sync with
// the animation in Engine.travelTo().
/* Move the stores panel beneath top_container (or to top: 0px if top_container
* either hasn't been filled in or is null) using transition_diff to sync with
* the animation in Engine.travelTo().
*/
moveStoresView: function(top_container, transition_diff) {
var stores = $('#storesContainer');
@@ -531,8 +548,13 @@
stores.animate({top: '0px'}, {queue: false, duration: 300 * transition_diff});
}
else {
stores.animate({top: top_container.height() + 26 + 'px'},
{queue: false, duration: 300 * transition_diff});
stores.animate({
top: top_container.height() + 26 + 'px'
},
{
queue: false,
duration: 300 * transition_diff
});
}
},
@@ -680,8 +702,7 @@
//create jQuery Callbacks() to handle object events
$.Dispatch = function( id ) {
var callbacks,
topic = id && Engine.topics[ id ];
var callbacks, topic = id && Engine.topics[ id ];
if ( !topic ) {
callbacks = jQuery.Callbacks();
topic = {
+1 -2
View File
@@ -438,8 +438,7 @@ var Events = {
});
}
Events._enemyAttackTimer =
setTimeout(Events.enemyAttack, scene.attackDelay * 1000);
Events._enemyAttackTimer = setTimeout(Events.enemyAttack, scene.attackDelay * 1000);
},
winFight: function() {
+1 -5
View File
@@ -66,10 +66,7 @@ Events.Outside = [
{ /* Sickness */
title: _('Sickness'),
isAvailable: function() {
return Engine.activeModule == Outside &&
$SM.get('game.population', true) > 10 &&
$SM.get('game.population', true) < 50 &&
$SM.get('stores.medicine', true) > 0;
return Engine.activeModule == Outside && $SM.get('game.population', true) > 10 && $SM.get('game.population', true) < 50 && $SM.get('stores.medicine', true) > 0;
},
scenes: {
'start': {
@@ -241,4 +238,3 @@ Events.Outside = [
}
}
];
-2
View File
@@ -2345,7 +2345,6 @@ Events.Setpieces = {
}
},
'end4': {
text: [
_('the small military outpost is well supplied.'),
@@ -2456,7 +2455,6 @@ Events.Setpieces = {
}
},
'end7': {
text: [
_('the remaining settlers flee from the violence, their belongings forgotten.'),
+56 -10
View File
@@ -1,15 +1,61 @@
(function(){
//only used for poedit to find translatable strings
var keywords = [ _('saved.'), _('wood'),_('builder'),_('teeth'),_('meat'),_('fur'), _('alien alloy'), _('bullets'),
_('charm'),_('leather'),_('iron'), _('steel'), _('coal'), _('enegy cell'),
_('torch'),_('medicine'),_('hunter'),_('trapper'),_('tanner'), _('grenade'), _('bolas'),
_("charcutier"),_('iron miner'),_('coal miner'), _('sulphur miner'), _('armourer'),
_('steelworker'),_('bait'),_('cured meat'), _('scales'), _('compass'), _('laser rifle'),
_('gatherer'),_('cloth'), _('scales'), _('cured meat'), _('thieves'),
_('not enough fur'), _('not enough wood'), _('not enough coal'), _('not enough iron'), _('not enough steel'), _('baited trap'),
_('not enough scales'),_('not enough cloth'), _('not enough teeth'), _('not enough leather'),
_('the compass points east.'), _('the compass points west.'), _('the compass points north.'), _('the compass points south.'),
_('the compass points northeast.'), _('the compass points northwest.'), _('the compass points southeast.'), _('the compass points southwest.')];
var keywords = [
_('saved.'),
_('wood'),
_('builder'),
_('teeth'),
_('meat'),
_('fur'),
_('alien alloy'),
_('bullets'),
_('charm'),
_('leather'),
_('iron'),
_('steel'),
_('coal'),
_('enegy cell'),
_('torch'),
_('medicine'),
_('hunter'),
_('trapper'),
_('tanner'),
_('grenade'),
_('bolas'),
_("charcutier"),
_('iron miner'),
_('coal miner'),
_('sulphur miner'), _('armourer'),
_('steelworker'),
_('bait'),
_('cured meat'),
_('scales'),
_('compass'),
_('laser rifle'),
_('gatherer'),
_('cloth'),
_('scales'),
_('cured meat'),
_('thieves'),
_('not enough fur'),
_('not enough wood'),
_('not enough coal'),
_('not enough iron'),
_('not enough steel'),
_('baited trap'),
_('not enough scales'),
_('not enough cloth'), _('not enough teeth'),
_('not enough leather'),
_('the compass points east.'),
_('the compass points west.'),
_('the compass points north.'),
_('the compass points south.'),
_('the compass points northeast.'),
_('the compass points northwest.'),
_('the compass points southeast.'),
_('the compass points southwest.')
];
delete keywords;
//translate text in css by overriding attributes
+1 -2
View File
@@ -604,8 +604,7 @@ var Outside = {
handleStateUpdates: function(e){
if(e.category == 'stores'){
Outside.updateVillage();
} else if(e.stateName.indexOf('game.workers') == 0
|| e.stateName.indexOf('game.population') == 0){
} else if(e.stateName.indexOf('game.workers') == 0 || e.stateName.indexOf('game.population') == 0){
Outside.updateVillage();
Outside.updateWorkersView();
Outside.updateVillageIncome();
-1
View File
@@ -409,7 +409,6 @@ var Space = {
},
complete: function() {
Engine.GAME_OVER = true;
Score.save();
Prestige.save();