mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Fixing whitespace conformity in Engine.js
This commit is contained in:
+36
-30
@@ -190,14 +190,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() {
|
||||
@@ -242,7 +239,9 @@
|
||||
},
|
||||
'import': {
|
||||
text: _('import'),
|
||||
nextScene: {1: 'confirm'},
|
||||
nextScene: {
|
||||
1: 'confirm'
|
||||
},
|
||||
},
|
||||
'cancel': {
|
||||
text: _('cancel'),
|
||||
@@ -251,9 +250,11 @@
|
||||
}
|
||||
},
|
||||
'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'),
|
||||
@@ -267,7 +268,9 @@
|
||||
}
|
||||
},
|
||||
'inputImport': {
|
||||
text: [_('put the save code here.')],
|
||||
text: [
|
||||
_('put the save code here.')
|
||||
],
|
||||
textarea: '',
|
||||
buttons: {
|
||||
'okay': {
|
||||
@@ -383,17 +386,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'),
|
||||
@@ -402,7 +405,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {width: '400px'});
|
||||
},
|
||||
{
|
||||
width: '400px'
|
||||
});
|
||||
},
|
||||
|
||||
findStylesheet: function(title) {
|
||||
@@ -417,9 +423,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;
|
||||
@@ -431,12 +435,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.'));
|
||||
@@ -486,15 +488,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');
|
||||
|
||||
@@ -510,8 +512,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
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -655,8 +662,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 = {
|
||||
|
||||
Reference in New Issue
Block a user