From a7530e4ef857ebb7bbe92b1aa07157f8475ea55e Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 18 Mar 2015 12:25:30 +0100 Subject: use requirejs --- js/boot.js | 5 +++++ js/main.js | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 js/boot.js (limited to 'js') diff --git a/js/boot.js b/js/boot.js new file mode 100644 index 0000000..54f5b32 --- /dev/null +++ b/js/boot.js @@ -0,0 +1,5 @@ +/* globals requirejs */ +requirejs.config({ + baseUrl: 'js' +}); +requirejs(['main']); diff --git a/js/main.js b/js/main.js index 8f96057..c3191f6 100644 --- a/js/main.js +++ b/js/main.js @@ -1,5 +1,4 @@ -/* jshint browser:true, devel:true */ -(function() { +define(function() { 'use strict'; /* loads a page into view and execute scripts */ @@ -40,4 +39,4 @@ if (!selectPage(location.hash.replace(/^#\//, ''))) { location.hash = '#/home'; } -})(); +}); -- cgit v1.2.1