Created
October 30, 2013 17:15
-
-
Save joelongstreet/7236438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.config({ | |
baseUrl : '/js/', | |
paths : { | |
'jquery' : '/vendor/jquery', | |
'underscore' : '/vendor/underscore', | |
'handlebars' : '/vendor/handlebars', | |
'hbs' : '/vendor/hbs', | |
'ejs' : '/vendor/ejs', | |
'backbone' : '/vendor/backbone', | |
'chaplin' : '/vendor/chaplin', | |
'text' : '/vendor/requirejs-text', | |
'sailsio' : '/vendor/sails.io', | |
'socketio' : '/vendor/socket.io', | |
'jcolor' : '/vendor/jquery.color', | |
'jcrop' : '/vendor/jquery.Jcrop', | |
'bootstrap' : '/vendor/bootstrap', | |
'uploader' : '/vendor/jquery.fineuploader-3.8.2', | |
'sortable' : '/vendor/jquery.sortable', | |
'wysiwyg' : '/vendor/bootstrap-wysiwyg', | |
'hotkeys' : '/vendor/jquery.hotkeys' | |
}, | |
shim : { | |
ejs : { | |
exports : 'ejs' | |
}, | |
hotkeys : { | |
exports : 'hotkeys', | |
deps : ['jquery'] | |
}, | |
wysiwyg : { | |
exports : 'wysiwyg', | |
deps : ['bootstrap', 'hotkeys'] | |
}, | |
sortable : { | |
exports : 'sortable', | |
deps : ['jquery'] | |
}, | |
uploader : { | |
exports : 'qq', | |
deps : ['jquery'] | |
}, | |
bootstrap : { | |
exports : 'bootstrap' | |
}, | |
jcrop : { | |
exports : 'jcrop' | |
}, | |
jcolor : { | |
exports : 'jcolor' | |
}, | |
sailsio : { | |
exports : 'sailsio' | |
}, | |
socketio : { | |
exports : 'io' | |
}, | |
underscore : { | |
exports : '_' | |
}, | |
backbone : { | |
deps : ['underscore', 'jquery'], | |
exports : 'Backbone' | |
}, | |
handlebars : { | |
exports : 'Handlebars' | |
}, | |
ejs : { | |
exports : 'ejs', | |
deps : ['text'] | |
} | |
}, | |
urlArgs : 'bust=' + (new Date()).getTime() | |
}); | |
require(['application', 'routes', 'socketio'], function(Application, routes, io){ | |
window.io = io; | |
require(['sailsio'], function(sailsio){ | |
window.socket = io.connect() | |
socket.on('connect', function(){ | |
new Application({ routes : routes, controllerSuffix : '-controller', root : '/ui' }); | |
}); | |
// After going to sleep, some clients lose the socket connection. | |
// Just refresh the page when this happens | |
socket.on('disconnect', function(){ | |
location.reload(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment