Created
July 10, 2012 13:25
-
-
Save pneff/3083211 to your computer and use it in GitHub Desktop.
Response design with Backbone.js
This file contains hidden or 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( | |
[ | |
"views/page", | |
"Router" | |
], | |
function (pageView, Router) { | |
pageView.render(); | |
$('body').prepend(pageView.el); | |
new Router(); | |
Backbone.history.start(); | |
} | |
); |
This file contains hidden or 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({ | |
paths: { | |
"text": "../libs/require/text", | |
"i18n": "../libs/require/i18n", | |
"order": "../libs/require/order", | |
"libs": "../libs", | |
"controllers/base": "controllers/base", | |
"controllers": "controllers/desktop", | |
// Desktop-specific views | |
"views/page": "views/desktop/page", | |
"views/Settings": "views/desktop/Settings", | |
// Desktop-specific templates | |
"templates/page": "templates/desktop/page", | |
"templates/settings": "templates/desktop/settings" | |
} | |
}); | |
require(['order!libs/core', 'order!app-common'], function () { }); |
This file contains hidden or 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
<script> | |
var edition = 'desktop'; | |
if ($('body').width() <= 480) { | |
edition = 'mobile'; | |
} else if (Modernizr.touch) { | |
edition = 'tablet'; | |
}; | |
document.write('<link rel="stylesheet" type="text/css" href="css/squirro-' + edition + '.css">'); | |
document.write('<script data-main="app-' + edition + '" src="require.js"></' + 'script>'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment