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
+53 -32
View File
@@ -128,7 +128,6 @@
}); });
} }
$('<span>') $('<span>')
.addClass('lightsOff menuBtn') .addClass('lightsOff menuBtn')
.text(_('lights off.')) .text(_('lights off.'))
@@ -204,14 +203,11 @@
}, },
browserValid: function() { browserValid: function() {
return location.search.indexOf('ignorebrowser=true') >= 0 || ( return ( location.search.indexOf( 'ignorebrowser=true' ) >= 0 || ( typeof Storage != 'undefined' && !oldIE ) );
typeof Storage != 'undefined' &&
!oldIE);
}, },
isMobile: function() { isMobile: function() {
return location.search.indexOf('ignorebrowser=true') < 0 && return ( location.search.indexOf( 'ignorebrowser=true' ) < 0 && /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test( navigator.userAgent ) );
/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
}, },
saveGame: function() { saveGame: function() {
@@ -247,8 +243,10 @@
title: _('Export / Import'), title: _('Export / Import'),
scenes: { scenes: {
start: { start: {
text: [_('export or import save data, for backing up'), text: [
_('or migrating computers')], _('export or import save data, for backing up'),
_('or migrating computers')
],
buttons: { buttons: {
'export': { 'export': {
text: _('export'), text: _('export'),
@@ -262,12 +260,13 @@
text: _('cancel'), text: _('cancel'),
nextScene: 'end' nextScene: 'end'
} }
}
}, },
'confirm': { 'confirm': {
text: [_('are you sure?'), text: [
_('are you sure?'),
_('if the code is invalid, all data will be lost.'), _('if the code is invalid, all data will be lost.'),
_('this is irreversible.')], _('this is irreversible.')
],
buttons: { buttons: {
'yes': { 'yes': {
text: _('yes'), text: _('yes'),
@@ -276,10 +275,29 @@
}, },
'no': { 'no': {
text: _('no'), text: _('no'),
nextScene: 'end' 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': { 'inputImport': {
text: [_('put the save code here.')], text: [_('put the save code here.')],
textarea: '', textarea: '',
@@ -404,17 +422,17 @@
}, },
'twitter': { 'twitter': {
text: _('twitter'), text: _('twitter'),
nextScene: 'end',
onChoose: function() { 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'); 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': { 'reddit': {
text: _('reddit'), text: _('reddit'),
nextScene: 'end',
onChoose: function() { 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'); 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': { 'close': {
text: _('close'), text: _('close'),
@@ -423,7 +441,10 @@
} }
} }
} }
}, {width: '400px'}); },
{
width: '400px'
});
}, },
findStylesheet: function(title) { findStylesheet: function(title) {
@@ -438,9 +459,7 @@
isLightsOff: function() { isLightsOff: function() {
var darkCss = Engine.findStylesheet('darkenLights'); var darkCss = Engine.findStylesheet('darkenLights');
if (darkCss != null) { if ( darkCss != null && !darkCss.disabled ) {
if (darkCss.disabled)
return false;
return true; return true;
} }
return false; return false;
@@ -452,12 +471,10 @@
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />'); $('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
Engine.turnLightsOff; Engine.turnLightsOff;
$('.lightsOff').text(_('lights on.')); $('.lightsOff').text(_('lights on.'));
} } else if (darkCss.disabled) {
else if (darkCss.disabled) {
darkCss.disabled = false; darkCss.disabled = false;
$('.lightsOff').text(_('lights on.')); $('.lightsOff').text(_('lights on.'));
} } else {
else {
$("#darkenLights").attr("disabled", "disabled"); $("#darkenLights").attr("disabled", "disabled");
darkCss.disabled = true; darkCss.disabled = true;
$('.lightsOff').text(_('lights off.')); $('.lightsOff').text(_('lights off.'));
@@ -507,15 +524,15 @@
$('div#weapons').animate({opacity: 1}, 300); $('div#weapons').animate({opacity: 1}, 300);
} }
Notifications.printQueue(module); Notifications.printQueue(module);
} }
}, },
// Move the stores panel beneath top_container (or to top: 0px if top_container /* 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 * either hasn't been filled in or is null) using transition_diff to sync with
// the animation in Engine.travelTo(). * the animation in Engine.travelTo().
*/
moveStoresView: function(top_container, transition_diff) { moveStoresView: function(top_container, transition_diff) {
var stores = $('#storesContainer'); var stores = $('#storesContainer');
@@ -531,8 +548,13 @@
stores.animate({top: '0px'}, {queue: false, duration: 300 * transition_diff}); stores.animate({top: '0px'}, {queue: false, duration: 300 * transition_diff});
} }
else { else {
stores.animate({top: top_container.height() + 26 + 'px'}, stores.animate({
{queue: false, duration: 300 * transition_diff}); top: top_container.height() + 26 + 'px'
},
{
queue: false,
duration: 300 * transition_diff
});
} }
}, },
@@ -680,8 +702,7 @@
//create jQuery Callbacks() to handle object events //create jQuery Callbacks() to handle object events
$.Dispatch = function( id ) { $.Dispatch = function( id ) {
var callbacks, var callbacks, topic = id && Engine.topics[ id ];
topic = id && Engine.topics[ id ];
if ( !topic ) { if ( !topic ) {
callbacks = jQuery.Callbacks(); callbacks = jQuery.Callbacks();
topic = { topic = {
+1 -2
View File
@@ -438,8 +438,7 @@ var Events = {
}); });
} }
Events._enemyAttackTimer = Events._enemyAttackTimer = setTimeout(Events.enemyAttack, scene.attackDelay * 1000);
setTimeout(Events.enemyAttack, scene.attackDelay * 1000);
}, },
winFight: function() { winFight: function() {
+1 -5
View File
@@ -66,10 +66,7 @@ Events.Outside = [
{ /* Sickness */ { /* Sickness */
title: _('Sickness'), title: _('Sickness'),
isAvailable: function() { isAvailable: function() {
return Engine.activeModule == Outside && return Engine.activeModule == Outside && $SM.get('game.population', true) > 10 && $SM.get('game.population', true) < 50 && $SM.get('stores.medicine', true) > 0;
$SM.get('game.population', true) > 10 &&
$SM.get('game.population', true) < 50 &&
$SM.get('stores.medicine', true) > 0;
}, },
scenes: { scenes: {
'start': { 'start': {
@@ -241,4 +238,3 @@ Events.Outside = [
} }
} }
]; ];
-2
View File
@@ -2345,7 +2345,6 @@ Events.Setpieces = {
} }
}, },
'end4': { 'end4': {
text: [ text: [
_('the small military outpost is well supplied.'), _('the small military outpost is well supplied.'),
@@ -2456,7 +2455,6 @@ Events.Setpieces = {
} }
}, },
'end7': { 'end7': {
text: [ text: [
_('the remaining settlers flee from the violence, their belongings forgotten.'), _('the remaining settlers flee from the violence, their belongings forgotten.'),
+56 -10
View File
@@ -1,15 +1,61 @@
(function(){ (function(){
//only used for poedit to find translatable strings //only used for poedit to find translatable strings
var keywords = [ _('saved.'), _('wood'),_('builder'),_('teeth'),_('meat'),_('fur'), _('alien alloy'), _('bullets'), var keywords = [
_('charm'),_('leather'),_('iron'), _('steel'), _('coal'), _('enegy cell'), _('saved.'),
_('torch'),_('medicine'),_('hunter'),_('trapper'),_('tanner'), _('grenade'), _('bolas'), _('wood'),
_("charcutier"),_('iron miner'),_('coal miner'), _('sulphur miner'), _('armourer'), _('builder'),
_('steelworker'),_('bait'),_('cured meat'), _('scales'), _('compass'), _('laser rifle'), _('teeth'),
_('gatherer'),_('cloth'), _('scales'), _('cured meat'), _('thieves'), _('meat'),
_('not enough fur'), _('not enough wood'), _('not enough coal'), _('not enough iron'), _('not enough steel'), _('baited trap'), _('fur'),
_('not enough scales'),_('not enough cloth'), _('not enough teeth'), _('not enough leather'), _('alien alloy'),
_('the compass points east.'), _('the compass points west.'), _('the compass points north.'), _('the compass points south.'), _('bullets'),
_('the compass points northeast.'), _('the compass points northwest.'), _('the compass points southeast.'), _('the compass points southwest.')]; _('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; delete keywords;
//translate text in css by overriding attributes //translate text in css by overriding attributes
+1 -2
View File
@@ -604,8 +604,7 @@ var Outside = {
handleStateUpdates: function(e){ handleStateUpdates: function(e){
if(e.category == 'stores'){ if(e.category == 'stores'){
Outside.updateVillage(); Outside.updateVillage();
} else if(e.stateName.indexOf('game.workers') == 0 } else if(e.stateName.indexOf('game.workers') == 0 || e.stateName.indexOf('game.population') == 0){
|| e.stateName.indexOf('game.population') == 0){
Outside.updateVillage(); Outside.updateVillage();
Outside.updateWorkersView(); Outside.updateWorkersView();
Outside.updateVillageIncome(); Outside.updateVillageIncome();
-1
View File
@@ -409,7 +409,6 @@ var Space = {
}, },
complete: function() { complete: function() {
Engine.GAME_OVER = true; Engine.GAME_OVER = true;
Score.save(); Score.save();
Prestige.save(); Prestige.save();