From e26fc7fb41767096fe42341b0b4faad9e180328a Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Sun, 7 Jul 2013 16:02:01 +0100 Subject: [PATCH] Added requirejs shim for bootpag to stop loading errors --- static/js/app/appv2.js | 6 ++++-- static/js/app/dss.bootstrapper.js | 5 +++++ static/js/app/views/user/userItemView.js | 10 +++++----- static/js/app/views/user/userListView.coffee | 2 +- static/js/app/views/user/userListView.js | 17 ++++++++--------- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/static/js/app/appv2.js b/static/js/app/appv2.js index b6bdda8..2577d7f 100755 --- a/static/js/app/appv2.js +++ b/static/js/app/appv2.js @@ -1,14 +1,15 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.6.2 (function() { - define(['backbone', 'marionette', 'vent', 'utils', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/realtimeController', 'app.lib/audioController', 'views/widgets/headerView', 'views/sidebar/sidebarView', 'models/mix/mixCollection'], function(Backbone, Marionette, vent, utils, DssRouter, PanningRegion, RealtimeController, AudioController, HeaderView, SidebarView, MixCollection) { var App, sidebarView; + App = new Marionette.Application(); App.audioController = new AudioController(); App.realtimeController = new RealtimeController(); App.realtimeController.startSocketIO(); App.vent.on("routing:started", function() { var enablePushState, pushState; + console.log("App(vent): routing:started"); enablePushState = true; pushState = !!(enablePushState && window.history && window.history.pushState); @@ -34,6 +35,7 @@ App.addInitializer(function() { $(document).on("click", "a[href]:not([data-bypass])", function(evt) { var href, root; + href = { prop: $(this).prop("href"), attr: $(this).attr("href") diff --git a/static/js/app/dss.bootstrapper.js b/static/js/app/dss.bootstrapper.js index b0314f6..415f246 100755 --- a/static/js/app/dss.bootstrapper.js +++ b/static/js/app/dss.bootstrapper.js @@ -11,6 +11,7 @@ requirejs.config({ ich: 'libs/ICanHaz', bootstrap: 'libs/bootstrap/bootstrap', underscore: 'libs/backbone/underscore', + bootpag: 'libs/bootstrap/bootpag', text: 'libs/text', templates: '/templates', app: 'app/appv2', @@ -38,6 +39,10 @@ requirejs.config({ exports: 'bootstrap', deps: ['jquery'] }, + bootpag: { + exports: 'bootpag', + deps: ['jquery', 'bootstrap'] + }, marionette: { exports: 'Marionette', deps: ['jquery', 'backbone'] diff --git a/static/js/app/views/user/userItemView.js b/static/js/app/views/user/userItemView.js index 6ad764c..f4743d1 100755 --- a/static/js/app/views/user/userItemView.js +++ b/static/js/app/views/user/userItemView.js @@ -1,18 +1,18 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.6.2 (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['app', 'moment', 'marionette', 'vent', 'text!/tpl/UserListItemView'], function(App, moment, Marionette, vent, Template) { - var UserItemView; - UserItemView = (function(_super) { + var UserItemView, _ref; + UserItemView = (function(_super) { __extends(UserItemView, _super); function UserItemView() { - this.initialize = __bind(this.initialize, this); - return UserItemView.__super__.constructor.apply(this, arguments); + this.initialize = __bind(this.initialize, this); _ref = UserItemView.__super__.constructor.apply(this, arguments); + return _ref; } UserItemView.prototype.template = _.template(Template); diff --git a/static/js/app/views/user/userListView.coffee b/static/js/app/views/user/userListView.coffee index 8790474..77c13c6 100755 --- a/static/js/app/views/user/userListView.coffee +++ b/static/js/app/views/user/userListView.coffee @@ -1,5 +1,5 @@ define ['jquery', 'marionette', 'models/user/userCollection', 'views/user/userItemView', 'text!/tpl/UserListView', - 'libs/bootstrap/bootpag'], + 'bootpag'], ($, Marionette, UserCollection, UserItemView, Template) -> class UserListView extends Marionette.CompositeView diff --git a/static/js/app/views/user/userListView.js b/static/js/app/views/user/userListView.js index 909e6c2..b2ff16b 100755 --- a/static/js/app/views/user/userListView.js +++ b/static/js/app/views/user/userListView.js @@ -1,20 +1,22 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - define(['jquery', 'marionette', 'models/user/userCollection', 'views/user/userItemView', 'text!/tpl/UserListView', 'libs/bootstrap/bootpag'], function($, Marionette, UserCollection, UserItemView, Template) { - var UserListView, _ref; - + define(['jquery', 'marionette', 'models/user/userCollection', 'views/user/userItemView', 'text!/tpl/UserListView', 'bootpag'], function($, Marionette, UserCollection, UserItemView, Template) { + var UserListView; UserListView = (function(_super) { + __extends(UserListView, _super); function UserListView() { this.doSearch = __bind(this.doSearch, this); + this._fetchCollection = __bind(this._fetchCollection, this); - this.initialize = __bind(this.initialize, this); _ref = UserListView.__super__.constructor.apply(this, arguments); - return _ref; + + this.initialize = __bind(this.initialize, this); + return UserListView.__super__.constructor.apply(this, arguments); } UserListView.prototype.template = _.template(Template); @@ -39,12 +41,10 @@ UserListView.prototype._fetchCollection = function(options) { var _this = this; - this.collection.fetch({ data: options, success: function() { var pag; - console.log("UserListView: Collection fetched"); console.log(_this.collection); pag = $("#page-selection").bootpag({ @@ -64,7 +64,6 @@ UserListView.prototype.doSearch = function() { var query; - console.log("UserListView: doSearch"); query = this.ui.searchText.val(); if (query) {