Apply jshint to scripts/ on check
parent
ba6bc593d6
commit
887d450955
|
@ -40,7 +40,7 @@ lasertank.js: modindex
|
|||
|
||||
test: check
|
||||
check:
|
||||
jshint src/
|
||||
jshint src/ scripts/
|
||||
@PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \
|
||||
mocha --recursive $(TESTARGS)
|
||||
|
||||
|
|
|
@ -17,21 +17,27 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
( function()
|
||||
{
|
||||
/* jshint browser:true */
|
||||
/* global lasertank */
|
||||
|
||||
var load_ltg = lasertank.FileLoader( document.getElementById( 'ltg' ) ),
|
||||
load_lvl = lasertank.FileLoader( document.getElementById( 'lvl' ) ),
|
||||
const load_ltg = lasertank.FileLoader( document.getElementById( 'ltg' ) ),
|
||||
load_lvl = lasertank.FileLoader( document.getElementById( 'lvl' ) ),
|
||||
|
||||
menu_bar = lasertank.ui.MenuBar( document.getElementById( 'menubar' ) ),
|
||||
ele_game = document.getElementById( 'game' ),
|
||||
ctx = document.getElementById( 'render' ).getContext( '2d' );
|
||||
|
||||
ele_game = document.getElementById( 'game' ),
|
||||
ctx = document.getElementById( 'render' ).getContext( '2d' ),
|
||||
|
||||
ltg_data = '',
|
||||
let ltg_data = '',
|
||||
lvl_data = '';
|
||||
|
||||
|
||||
// XXX: relies on side-effects of ctor
|
||||
lasertank.ui.MenuBar( document.getElementById( 'menubar' ) );
|
||||
|
||||
|
||||
load_ltg.onLoad( function( e, data )
|
||||
{
|
||||
if ( e ) throw e;
|
||||
|
@ -40,6 +46,7 @@ load_ltg.onLoad( function( e, data )
|
|||
gamechk();
|
||||
} );
|
||||
|
||||
|
||||
load_lvl.onLoad( function( e, data )
|
||||
{
|
||||
if ( e ) throw e;
|
||||
|
@ -48,6 +55,7 @@ load_lvl.onLoad( function( e, data )
|
|||
gamechk();
|
||||
} );
|
||||
|
||||
|
||||
function gamechk()
|
||||
{
|
||||
if ( !( ltg_data && lvl_data ) ) return;
|
||||
|
@ -62,6 +70,7 @@ function gamechk()
|
|||
} );
|
||||
}
|
||||
|
||||
|
||||
// temporary
|
||||
document.getElementById( 'new' ).onclick = function()
|
||||
{
|
||||
|
|
|
@ -17,5 +17,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* jshint browser:true */
|
||||
|
||||
// alert the user on all uncaught errors
|
||||
window.onerror = alert;
|
||||
window.onerror = window.alert;
|
||||
|
|
Loading…
Reference in New Issue