diff --git a/static/js/app/models/activity/activityCollection.coffee b/static/js/app/models/activity/activityCollection.coffee index 2b00c86..68e75a1 100755 --- a/static/js/app/models/activity/activityCollection.coffee +++ b/static/js/app/models/activity/activityCollection.coffee @@ -16,7 +16,6 @@ define ['backbone', 'vent', 'models/activity/activityItem', 'app.lib/backbone.ds @add response comparator: (item)-> - console.log("Comparatoring") -item.id ActivityCollection \ No newline at end of file diff --git a/static/js/app/models/activity/activityCollection.js b/static/js/app/models/activity/activityCollection.js index 06192b5..73f911a 100755 --- a/static/js/app/models/activity/activityCollection.js +++ b/static/js/app/models/activity/activityCollection.js @@ -35,7 +35,6 @@ }; ActivityCollection.prototype.comparator = function(item) { - console.log("Comparatoring"); return -item.id; }; diff --git a/static/js/app/models/activity/activityItem.js b/static/js/app/models/activity/activityItem.js index 2cea9fe..a519ff8 100755 --- a/static/js/app/models/activity/activityItem.js +++ b/static/js/app/models/activity/activityItem.js @@ -1,16 +1,17 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.6.2 (function() { var __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(['backbone', 'moment'], function(Backbone, moment) { - var ActivityItem; - ActivityItem = (function(_super) { + var ActivityItem, _ref; + ActivityItem = (function(_super) { __extends(ActivityItem, _super); function ActivityItem() { - return ActivityItem.__super__.constructor.apply(this, arguments); + _ref = ActivityItem.__super__.constructor.apply(this, arguments); + return _ref; } ActivityItem.prototype.urlRoot = com.podnoms.settings.urlRoot + "activity/"; diff --git a/static/js/app/views/activity/activityListView.js b/static/js/app/views/activity/activityListView.js index f3f8f69..13c18d4 100755 --- a/static/js/app/views/activity/activityListView.js +++ b/static/js/app/views/activity/activityListView.js @@ -1,16 +1,17 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.6.2 (function() { var __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(['marionette', 'models/activity/activityCollection', 'views/activity/activityItemView', 'text!/tpl/ActivityListView'], function(Marionette, ActivityCollection, ActivityItemView, Template) { - var ActivityListView; - ActivityListView = (function(_super) { + var ActivityListView, _ref; + ActivityListView = (function(_super) { __extends(ActivityListView, _super); function ActivityListView() { - return ActivityListView.__super__.constructor.apply(this, arguments); + _ref = ActivityListView.__super__.constructor.apply(this, arguments); + return _ref; } ActivityListView.prototype.template = _.template(Template); @@ -25,6 +26,7 @@ ActivityListView.prototype.initialize = function() { var _this = this; + console.log("ActivityListView: initialize"); this.collection = new ActivityCollection; return this.collection.fetch({ @@ -36,6 +38,7 @@ ActivityListView.prototype.appendHtml = function(collectionView, itemView, index) { var children, childrenContainer; + childrenContainer = (collectionView.itemViewContainer ? collectionView.$(collectionView.itemViewContainer) : collectionView.$el); children = childrenContainer.children(); if (children.size() <= index) { diff --git a/static/js/app/views/mix/mixItemView.coffee b/static/js/app/views/mix/mixItemView.coffee index 9de941b..e876e01 100755 --- a/static/js/app/views/mix/mixItemView.coffee +++ b/static/js/app/views/mix/mixItemView.coffee @@ -100,6 +100,14 @@ define ['moment', 'app', 'vent', 'marionette', 'utils', 'models/comment/commentC .toggleClass('play-button-small-pause', false) return + mixStop: (model) -> + if (@model.get('id') == model.get('id')) + this.ui.playButton + .toggleClass('play-button-small-start', true) + .toggleClass('play-button-small-resume', false) + .toggleClass('play-button-small-pause', false) + return + mixFavourite: -> console.log("MixItemView: favouriteMix") app = require('app') diff --git a/static/js/app/views/mix/mixItemView.js b/static/js/app/views/mix/mixItemView.js index 598e6ac..690cb30 100755 --- a/static/js/app/views/mix/mixItemView.js +++ b/static/js/app/views/mix/mixItemView.js @@ -1,22 +1,26 @@ -// 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(['moment', 'app', 'vent', 'marionette', 'utils', 'models/comment/commentCollection', 'views/comment/commentListView', 'text!/tpl/MixListItemView'], function(moment, App, vent, Marionette, utils, CommentsCollection, CommentsListView, Template) { - var MixItemView, _ref; - + var MixItemView; MixItemView = (function(_super) { + __extends(MixItemView, _super); function MixItemView() { this.doStart = __bind(this.doStart, this); + this.renderComments = __bind(this.renderComments, this); + this.renderGenres = __bind(this.renderGenres, this); + this.onRender = __bind(this.onRender, this); - this.initialize = __bind(this.initialize, this); _ref = MixItemView.__super__.constructor.apply(this, arguments); - return _ref; + + this.initialize = __bind(this.initialize, this); + return MixItemView.__super__.constructor.apply(this, arguments); } MixItemView.prototype.template = _.template(Template); @@ -50,7 +54,6 @@ MixItemView.prototype.onRender = function() { var id, totalDuration, totalDurationText; - id = this.model.get('id'); if (this.model.get('duration')) { totalDuration = moment.duration(this.model.get('duration'), "seconds"); @@ -70,7 +73,6 @@ MixItemView.prototype.renderGenres = function() { var el; - el = this.el; $.each(this.model.get("genre-list"), function(data) { $("#genre-list", el).append('' + this.text + ''); @@ -81,7 +83,6 @@ MixItemView.prototype.renderComments = function() { var comments; - comments = new CommentsCollection(); comments.url = this.model.get("resource_uri") + "comments/"; comments.mix_id = this.model.id; @@ -89,7 +90,6 @@ comments.fetch({ success: function(data) { var content; - console.log(data); content = new CommentsListView({ collection: comments @@ -131,9 +131,14 @@ } }; + MixItemView.prototype.mixStop = function(model) { + if (this.model.get('id') === model.get('id')) { + this.ui.playButton.toggleClass('play-button-small-start', true).toggleClass('play-button-small-resume', false).toggleClass('play-button-small-pause', false); + } + }; + MixItemView.prototype.mixFavourite = function() { var app; - console.log("MixItemView: favouriteMix"); app = require('app'); vent.trigger("mix:favourite", this.model); @@ -148,7 +153,6 @@ MixItemView.prototype.mixShare = function(e) { var mode; - console.log("MixItemView: shareMix"); mode = $(e.currentTarget).data("mode"); console.log("MixItemView: " + mode); diff --git a/static/js/app/views/mix/mixListView.coffee b/static/js/app/views/mix/mixListView.coffee index 0b97357..ce0ac52 100755 --- a/static/js/app/views/mix/mixListView.coffee +++ b/static/js/app/views/mix/mixListView.coffee @@ -27,7 +27,7 @@ define ['marionette', 'vent', 'models/mix/mixCollection', 'views/mix/mixItemView if currentMix != -1 v = @children.findByModelCid(currentMix) - v.mixPause(v.model) + v.mixStop(v.model) currentMix = model.cid return diff --git a/static/js/app/views/mix/mixListView.js b/static/js/app/views/mix/mixListView.js index 448c7c2..63b778b 100755 --- a/static/js/app/views/mix/mixListView.js +++ b/static/js/app/views/mix/mixListView.js @@ -1,20 +1,19 @@ -// 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(['marionette', 'vent', 'models/mix/mixCollection', 'views/mix/mixItemView', 'text!/tpl/MixListView'], function(Marionette, vent, MixCollection, MixItemView, Template) { - var MixListView, _ref; - + var MixListView; MixListView = (function(_super) { var currentMix; __extends(MixListView, _super); function MixListView() { - this.initialize = __bind(this.initialize, this); _ref = MixListView.__super__.constructor.apply(this, arguments); - return _ref; + this.initialize = __bind(this.initialize, this); + return MixListView.__super__.constructor.apply(this, arguments); } MixListView.prototype.template = _.template(Template); @@ -29,7 +28,6 @@ MixListView.prototype.initialize = function() { var _this = this; - console.log("MixListView: initialize"); this.collection = new MixCollection(); this.collection.fetch({ @@ -45,11 +43,10 @@ MixListView.prototype.mixPlay = function(model) { var v; - console.log("MixListView: mixPlay"); if (currentMix !== -1) { v = this.children.findByModelCid(currentMix); - v.mixPause(v.model); + v.mixStop(v.model); } currentMix = model.cid; };