diff wikked/assets/js/wikked.js @ 161:f307d4cdc3fb

Setup Wikked Pypi package: - Moved all assets into `wikked/assets` for proper packaging. - Added `setuptools` stuff.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 10 Jan 2014 23:12:10 -0800
parents static/js/wikked.js@d29e2f337b00
children bf2c79779800
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wikked/assets/js/wikked.js	Fri Jan 10 23:12:10 2014 -0800
@@ -0,0 +1,65 @@
+/**
+ * RequireJS configuration.
+ *
+ * We need to alias/shim some of the libraries.
+ */
+require.config({
+    //urlArgs: "bust=" + (new Date()).getTime(),
+    paths: {
+        jquery: 'js/jquery-1.8.3.min',
+        underscore: 'js/underscore-min',
+        backbone: 'js/backbone-min',
+        handlebars: 'js/handlebars-1.0.rc.1',
+        moment: 'js/moment.min',
+        text: 'js/text',
+        bootstrap_modal: 'bootstrap/js/modal',
+        bootstrap_tooltip: 'bootstrap/js/tooltip',
+        bootstrap_collapse: 'bootstrap/js/collapse'
+    },
+    shim: {
+        'jquery': {
+            exports: '$'
+        },
+        'underscore': {
+            exports: '_'
+        },
+        'backbone': {
+            deps: ['underscore', 'jquery'],
+            exports: 'Backbone'
+        },
+        'handlebars': {
+            exports: 'Handlebars'
+        },
+        'bootstrap_modal': {
+            deps: ['jquery']
+        },
+        'bootstrap_tooltip': {
+            deps: ['jquery']
+        },
+        'bootstrap_collapse': {
+            deps: ['jquery']
+        }
+    }
+});
+
+//-------------------------------------------------------------//
+
+/**
+ * Entry point: run Backbone!
+ *
+ * We also import scripts like `handlebars` that are not used directly
+ * by anybody, but need to be evaluated.
+ */
+require([
+        'js/wikked/app',
+        'js/wikked/handlebars',
+        'backbone',
+        'text'
+        ],
+    function(app, hb, Backbone, textExtension) {
+
+    var router = new app.Router();
+    Backbone.history.start();//{ pushState: true });
+
+});
+