mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-25 19:17:35 +00:00
Fixed socket.io throwing error on non standard port
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -24,3 +24,5 @@ dss_ah
|
|||||||
fixtures.json
|
fixtures.json
|
||||||
dss_test.db
|
dss_test.db
|
||||||
dsskeys
|
dsskeys
|
||||||
|
.ropeproject/*
|
||||||
|
*.map
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ STATICFILES_DIRS = (
|
|||||||
here('static'),
|
here('static'),
|
||||||
)
|
)
|
||||||
|
|
||||||
SECRET_KEY = '8*&j)j4lnq*ft*=jhajvc7&upaifb2f2s5(v6i($$+3p(4^bvd'
|
SECRET_KEY = localsettings.SECRET_KEY
|
||||||
|
|
||||||
TEMPLATE_LOADERS = (
|
TEMPLATE_LOADERS = (
|
||||||
'django.template.loaders.filesystem.Loader',
|
'django.template.loaders.filesystem.Loader',
|
||||||
|
|||||||
@@ -8,14 +8,13 @@ from django.db import models
|
|||||||
from core.utils import url
|
from core.utils import url
|
||||||
from core.utils.audio.mp3 import mp3_length, tag_mp3
|
from core.utils.audio.mp3 import mp3_length, tag_mp3
|
||||||
from core.utils.url import unique_slugify
|
from core.utils.url import unique_slugify
|
||||||
from spa.models.activity import ActivityFavourite, ActivityLike, ActivityDownload, ActivityPlay
|
from spa.models.activity import ActivityDownload, ActivityPlay
|
||||||
from spa.models.genre import Genre
|
from spa.models.genre import Genre
|
||||||
from dss import settings, localsettings
|
from dss import settings, localsettings
|
||||||
from spa.models.userprofile import UserProfile
|
from spa.models.userprofile import UserProfile
|
||||||
from spa.models._basemodel import _BaseModel
|
from spa.models._basemodel import _BaseModel
|
||||||
from core.utils.file import generate_save_file_name
|
from core.utils.file import generate_save_file_name
|
||||||
|
|
||||||
|
|
||||||
def mix_file_name(instance, filename):
|
def mix_file_name(instance, filename):
|
||||||
return generate_save_file_name(instance.uid, 'mixes', filename)
|
return generate_save_file_name(instance.uid, 'mixes', filename)
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ from spa.models import _BaseModel, UserProfile
|
|||||||
|
|
||||||
class NotificationThread(threading.Thread):
|
class NotificationThread(threading.Thread):
|
||||||
def __init__(self, instance, **kwargs):
|
def __init__(self, instance, **kwargs):
|
||||||
self.instance = instance
|
self._instance = instance
|
||||||
super(NotificationThread, self).__init__(**kwargs)
|
super(NotificationThread, self).__init__(**kwargs)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
post_notification(self.instance.get_notification_url())
|
post_notification(self._instance.get_notification_url())
|
||||||
|
|
||||||
|
|
||||||
class Notification(_BaseModel):
|
class Notification(_BaseModel):
|
||||||
|
|||||||
@@ -55,4 +55,3 @@ def post_save_handler(**kwargs):
|
|||||||
|
|
||||||
|
|
||||||
post_save.connect(post_save_handler)
|
post_save.connect(post_save_handler)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
define ['backbone', 'marionette', 'vent', 'utils',
|
define ['backbone', 'marionette', 'vent', 'utils',
|
||||||
'app.lib/social', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/realtimeController',
|
'app.lib/social', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/realtimeController', 'app.lib/audioController',
|
||||||
'app.lib/audioController',
|
|
||||||
'models/user/userItem', 'models/mix/mixCollection',
|
'models/user/userItem', 'models/mix/mixCollection',
|
||||||
'views/widgets/headerView', 'views/sidebar/sidebarView'],
|
'views/widgets/headerView', 'views/sidebar/sidebarView'],
|
||||||
(Backbone, Marionette, vent, utils, social, DssRouter, PanningRegion, RealtimeController, AudioController, UserItem, MixCollection, HeaderView, SidebarView) ->
|
(Backbone, Marionette, vent, utils,
|
||||||
|
social, DssRouter, PanningRegion, RealtimeController, AudioController,
|
||||||
|
UserItem, MixCollection,
|
||||||
|
HeaderView, SidebarView) ->
|
||||||
App = new Marionette.Application();
|
App = new Marionette.Application();
|
||||||
App.audioController = new AudioController();
|
App.audioController = new AudioController();
|
||||||
App.realtimeController = new RealtimeController();
|
App.realtimeController = new RealtimeController();
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
define(['backbone', 'marionette', 'vent', 'utils', 'app.lib/social', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/realtimeController', 'app.lib/audioController', 'models/user/userItem', 'models/mix/mixCollection', 'views/widgets/headerView', 'views/sidebar/sidebarView'], function(Backbone, Marionette, vent, utils, social, DssRouter, PanningRegion, RealtimeController, AudioController, UserItem, MixCollection, HeaderView, SidebarView) {
|
define(['backbone', 'marionette', 'vent', 'utils', 'app.lib/social', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/realtimeController', 'app.lib/audioController', 'models/user/userItem', 'models/mix/mixCollection', 'views/widgets/headerView', 'views/sidebar/sidebarView'], function(Backbone, Marionette, vent, utils, social, DssRouter, PanningRegion, RealtimeController, AudioController, UserItem, MixCollection, HeaderView, SidebarView) {
|
||||||
var App, sidebarView;
|
var App, sidebarView;
|
||||||
|
|
||||||
App = new Marionette.Application();
|
App = new Marionette.Application();
|
||||||
App.audioController = new AudioController();
|
App.audioController = new AudioController();
|
||||||
App.realtimeController = new RealtimeController();
|
App.realtimeController = new RealtimeController();
|
||||||
App.realtimeController.startSocketIO();
|
App.realtimeController.startSocketIO();
|
||||||
App.vent.on("routing:started", function() {
|
App.vent.on("routing:started", function() {
|
||||||
var enablePushState, pushState;
|
var enablePushState, pushState;
|
||||||
|
|
||||||
console.log("App(vent): routing:started");
|
console.log("App(vent): routing:started");
|
||||||
enablePushState = true;
|
enablePushState = true;
|
||||||
pushState = !!(enablePushState && window.history && window.history.pushState);
|
pushState = !!(enablePushState && window.history && window.history.pushState);
|
||||||
@@ -35,7 +34,6 @@
|
|||||||
App.addInitializer(function() {
|
App.addInitializer(function() {
|
||||||
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
|
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
|
||||||
var href, root;
|
var href, root;
|
||||||
|
|
||||||
href = {
|
href = {
|
||||||
prop: $(this).prop("href"),
|
prop: $(this).prop("href"),
|
||||||
attr: $(this).attr("href")
|
attr: $(this).attr("href")
|
||||||
@@ -71,7 +69,6 @@
|
|||||||
this.listenTo(vent, "user:follow", function(model) {
|
this.listenTo(vent, "user:follow", function(model) {
|
||||||
var target, user,
|
var target, user,
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
||||||
console.log("App(vent): user:follow");
|
console.log("App(vent): user:follow");
|
||||||
user = new UserItem({
|
user = new UserItem({
|
||||||
id: com.podnoms.settings.currentUser
|
id: com.podnoms.settings.currentUser
|
||||||
@@ -80,7 +77,6 @@
|
|||||||
user.fetch({
|
user.fetch({
|
||||||
success: function() {
|
success: function() {
|
||||||
var f, newFollowers;
|
var f, newFollowers;
|
||||||
|
|
||||||
if (!model.get("is_following")) {
|
if (!model.get("is_following")) {
|
||||||
newFollowers = user.get("following").concat([target]);
|
newFollowers = user.get("following").concat([target]);
|
||||||
user.save({
|
user.save({
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
define ['app', 'marionette', 'vent',
|
define ['app', 'marionette', 'vent',
|
||||||
'views/chat/chatView',
|
|
||||||
'models/mix/mixItem', 'views/mix/mixListLayout', 'views/mix/mixListView', 'views/mix/mixDetailView'
|
'models/mix/mixItem', 'views/mix/mixListLayout', 'views/mix/mixListView', 'views/mix/mixDetailView'
|
||||||
'views/mix/mixEditView', 'views/user/userProfileView',
|
'views/mix/mixEditView', 'views/user/userProfileView',
|
||||||
'models/user/userItem', 'views/user/userListView', 'views/user/userEditView'],
|
'models/user/userItem', 'views/user/userListView', 'views/user/userEditView'],
|
||||||
(App, Marionette, vent, ChatView, MixItem, MixListLayout, MixListView, MixDetailView, MixEditView, UserProfileView, UserItem, UserListView, UserEditView)->
|
(App, Marionette, vent,
|
||||||
|
MixItem, MixListLayout, MixListView, MixDetailView,
|
||||||
|
MixEditView, UserProfileView,
|
||||||
|
UserItem, UserListView, UserEditView)->
|
||||||
class DssController extends Marionette.Controller
|
class DssController extends Marionette.Controller
|
||||||
|
|
||||||
home: ->
|
home: ->
|
||||||
@@ -11,14 +13,13 @@ define ['app', 'marionette', 'vent',
|
|||||||
@showMixList()
|
@showMixList()
|
||||||
true
|
true
|
||||||
|
|
||||||
_showMixList: () ->
|
showMixList: (options) ->
|
||||||
app = require('app')
|
app = require('app')
|
||||||
app.contentRegion.show(new MixListLayout())
|
app.contentRegion.show(new MixListLayout(options or {order_by: 'latest'}))
|
||||||
true
|
true
|
||||||
|
|
||||||
showMixList: (type) ->
|
showMixListType: (type) ->
|
||||||
@_showMixList()
|
@showMixList({order_by: type})
|
||||||
vent.trigger("mix:showlist", {order_by: type || 'latest'})
|
|
||||||
true
|
true
|
||||||
|
|
||||||
showMix: (slug)->
|
showMix: (slug)->
|
||||||
@@ -78,18 +79,15 @@ define ['app', 'marionette', 'vent',
|
|||||||
|
|
||||||
showUserFavourites: (slug) ->
|
showUserFavourites: (slug) ->
|
||||||
console.log("Controller: showUserFavourites")
|
console.log("Controller: showUserFavourites")
|
||||||
@_showMixList()
|
@showMixList({order_by: 'latest', favourites__slug: slug})
|
||||||
vent.trigger("mix:showlist", {order_by: 'latest', favourites__slug: slug})
|
|
||||||
|
|
||||||
showUserLikes: (slug) ->
|
showUserLikes: (slug) ->
|
||||||
console.log("Controller: showUserLikes")
|
console.log("Controller: showUserLikes")
|
||||||
@_showMixList()
|
@showMixList({order_by: 'latest', likes__slug: slug})
|
||||||
vent.trigger("mix:showlist", {order_by: 'latest', likes__slug: slug})
|
|
||||||
|
|
||||||
showUserMixes: (slug) ->
|
showUserMixes: (slug) ->
|
||||||
console.log("Controller: showUserMixes")
|
console.log("Controller: showUserMixes")
|
||||||
@_showMixList()
|
@showMixList({order_by: 'latest', user: slug})
|
||||||
vent.trigger("mix:showlist", {order_by: 'latest', user: slug})
|
|
||||||
|
|
||||||
showUserFollowing: (slug) ->
|
showUserFollowing: (slug) ->
|
||||||
console.log("Controller: showUserFollowing")
|
console.log("Controller: showUserFollowing")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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', 'marionette', 'vent', 'views/chat/chatView', 'models/mix/mixItem', 'views/mix/mixListLayout', 'views/mix/mixListView', 'views/mix/mixDetailView', 'views/mix/mixEditView', 'views/user/userProfileView', 'models/user/userItem', 'views/user/userListView', 'views/user/userEditView'], function(App, Marionette, vent, ChatView, MixItem, MixListLayout, MixListView, MixDetailView, MixEditView, UserProfileView, UserItem, UserListView, UserEditView) {
|
define(['app', 'marionette', 'vent', 'models/mix/mixItem', 'views/mix/mixListLayout', 'views/mix/mixListView', 'views/mix/mixDetailView', 'views/mix/mixEditView', 'views/user/userProfileView', 'models/user/userItem', 'views/user/userListView', 'views/user/userEditView'], function(App, Marionette, vent, MixItem, MixListLayout, MixListView, MixDetailView, MixEditView, UserProfileView, UserItem, UserListView, UserEditView) {
|
||||||
var DssController, _ref;
|
var DssController, _ref;
|
||||||
|
|
||||||
DssController = (function(_super) {
|
DssController = (function(_super) {
|
||||||
@@ -20,18 +20,19 @@
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
DssController.prototype._showMixList = function() {
|
DssController.prototype.showMixList = function(options) {
|
||||||
var app;
|
var app;
|
||||||
|
|
||||||
app = require('app');
|
app = require('app');
|
||||||
app.contentRegion.show(new MixListLayout());
|
app.contentRegion.show(new MixListLayout(options || {
|
||||||
|
order_by: 'latest'
|
||||||
|
}));
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
DssController.prototype.showMixList = function(type) {
|
DssController.prototype.showMixListType = function(type) {
|
||||||
this._showMixList();
|
this.showMixList({
|
||||||
vent.trigger("mix:showlist", {
|
order_by: type
|
||||||
order_by: type || 'latest'
|
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@@ -128,8 +129,7 @@
|
|||||||
|
|
||||||
DssController.prototype.showUserFavourites = function(slug) {
|
DssController.prototype.showUserFavourites = function(slug) {
|
||||||
console.log("Controller: showUserFavourites");
|
console.log("Controller: showUserFavourites");
|
||||||
this._showMixList();
|
return this.showMixList({
|
||||||
return vent.trigger("mix:showlist", {
|
|
||||||
order_by: 'latest',
|
order_by: 'latest',
|
||||||
favourites__slug: slug
|
favourites__slug: slug
|
||||||
});
|
});
|
||||||
@@ -137,8 +137,7 @@
|
|||||||
|
|
||||||
DssController.prototype.showUserLikes = function(slug) {
|
DssController.prototype.showUserLikes = function(slug) {
|
||||||
console.log("Controller: showUserLikes");
|
console.log("Controller: showUserLikes");
|
||||||
this._showMixList();
|
return this.showMixList({
|
||||||
return vent.trigger("mix:showlist", {
|
|
||||||
order_by: 'latest',
|
order_by: 'latest',
|
||||||
likes__slug: slug
|
likes__slug: slug
|
||||||
});
|
});
|
||||||
@@ -146,8 +145,7 @@
|
|||||||
|
|
||||||
DssController.prototype.showUserMixes = function(slug) {
|
DssController.prototype.showUserMixes = function(slug) {
|
||||||
console.log("Controller: showUserMixes");
|
console.log("Controller: showUserMixes");
|
||||||
this._showMixList();
|
return this.showMixList({
|
||||||
return vent.trigger("mix:showlist", {
|
|
||||||
order_by: 'latest',
|
order_by: 'latest',
|
||||||
user: slug
|
user: slug
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ define ['vent', 'socket.io'],
|
|||||||
(vent, SocketIO) ->
|
(vent, SocketIO) ->
|
||||||
class RealtimeController
|
class RealtimeController
|
||||||
startSocketIO: ->
|
startSocketIO: ->
|
||||||
console.log("RealtimeController: Socket IO starting")
|
console.log("RealtimeController: SocketIO starting on " + com.podnoms.settings.REALTIME_HOST)
|
||||||
@socket = SocketIO.connect(com.podnoms.settings.REALTIME_HOST)
|
@socket = SocketIO.connect(com.podnoms.settings.REALTIME_HOST)
|
||||||
@socket.on "hello", (data) =>
|
@socket.on "hello", (data) =>
|
||||||
console.log("RealtimeController: Connected " + data['message'])
|
console.log("RealtimeController: Connected " + data['message'])
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
define(['vent', 'socket.io'], function(vent, SocketIO) {
|
define(['vent', 'socket.io'], function(vent, SocketIO) {
|
||||||
var RealtimeController;
|
var RealtimeController;
|
||||||
|
|
||||||
RealtimeController = (function() {
|
RealtimeController = (function() {
|
||||||
|
|
||||||
function RealtimeController() {}
|
function RealtimeController() {}
|
||||||
|
|
||||||
RealtimeController.prototype.startSocketIO = function() {
|
RealtimeController.prototype.startSocketIO = function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
console.log("RealtimeController: SocketIO starting on " + com.podnoms.settings.REALTIME_HOST);
|
||||||
console.log("RealtimeController: Socket IO starting");
|
|
||||||
this.socket = SocketIO.connect(com.podnoms.settings.REALTIME_HOST);
|
this.socket = SocketIO.connect(com.podnoms.settings.REALTIME_HOST);
|
||||||
this.socket.on("hello", function(data) {
|
this.socket.on("hello", function(data) {
|
||||||
return console.log("RealtimeController: Connected " + data['message']);
|
return console.log("RealtimeController: Connected " + data['message']);
|
||||||
});
|
});
|
||||||
"@socket.on \"activity\", (data) =>\n console.log(\"RealtimeController: activity \" + data['message'])\n vent.trigger(\"model:activity:new\", data['message'])";
|
"@socket.on \"activity\", (data) =>\n console.log(\"RealtimeController: activity \" + data['message'])\n vent.trigger(\"model:activity:new\", data['message'])";
|
||||||
|
|
||||||
return this.socket.on("notification", function(data) {
|
return this.socket.on("notification", function(data) {
|
||||||
console.log("RealtimeController: notification " + data['message']);
|
console.log("RealtimeController: notification " + data['message']);
|
||||||
return vent.trigger("model:notification:new", data['message']);
|
return vent.trigger("model:notification:new", data['message']);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ define ['marionette', 'vent', 'app.lib/controller'],
|
|||||||
|
|
||||||
"mix/upload": "uploadMix",
|
"mix/upload": "uploadMix",
|
||||||
"mixes": "showMixList",
|
"mixes": "showMixList",
|
||||||
"mixes/:type": "showMixList"
|
"mixes/:type": "showMixListType"
|
||||||
"mix/:slug": "showMix"
|
"mix/:slug": "showMix"
|
||||||
"mix/edit/:slug": "editMix",
|
"mix/edit/:slug": "editMix",
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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', 'app.lib/controller'], function(Marionette, vent, Controller) {
|
define(['marionette', 'vent', 'app.lib/controller'], function(Marionette, vent, Controller) {
|
||||||
var DssRouter, _ref;
|
var DssRouter;
|
||||||
|
|
||||||
return DssRouter = (function(_super) {
|
return DssRouter = (function(_super) {
|
||||||
|
|
||||||
__extends(DssRouter, _super);
|
__extends(DssRouter, _super);
|
||||||
|
|
||||||
function DssRouter() {
|
function DssRouter() {
|
||||||
_ref = DssRouter.__super__.constructor.apply(this, arguments);
|
return DssRouter.__super__.constructor.apply(this, arguments);
|
||||||
return _ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DssRouter.prototype.controller = new Controller;
|
DssRouter.prototype.controller = new Controller;
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
"/": "home",
|
"/": "home",
|
||||||
"mix/upload": "uploadMix",
|
"mix/upload": "uploadMix",
|
||||||
"mixes": "showMixList",
|
"mixes": "showMixList",
|
||||||
"mixes/:type": "showMixList",
|
"mixes/:type": "showMixListType",
|
||||||
"mix/:slug": "showMix",
|
"mix/:slug": "showMix",
|
||||||
"mix/edit/:slug": "editMix",
|
"mix/edit/:slug": "editMix",
|
||||||
"chat": "showChat",
|
"chat": "showChat",
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
// Generated by CoffeeScript 1.3.3
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
define(['jquery', 'utils', 'facebook'], function($, utils) {
|
|
||||||
return {
|
|
||||||
postFacebookLike: function(mixId) {
|
|
||||||
return $.getJSON("social/like/" + mixId + "/", function(data) {
|
|
||||||
return com.podnoms.utils.showAlert("Posted your like to facebook, you can stop this in your settings page.", "Cheers feen");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
generateEmbedCode: function(model) {
|
|
||||||
console.log("Generating embed code");
|
|
||||||
return utils.modal("/dlg/embed/" + model.get('slug'));
|
|
||||||
},
|
|
||||||
sharePageToTwitter: function(model) {
|
|
||||||
var loc, title;
|
|
||||||
loc = $(this).attr("href");
|
|
||||||
title = $(this).attr("title");
|
|
||||||
return window.open("http://twitter.com/share?url=" + "http://" + window.location.host + "/" + model.get("item_url") + "&text=" + model.get("title"), "twitterwindow", "height=450, width=550, top=" + ($(window).height() / 2 - 225) + ", left=" + $(window).width() / 2 + ", toolbar=0, location=0, menubar=0, directories=0, scrollbars=0");
|
|
||||||
},
|
|
||||||
sharePageToFacebook: function(model) {
|
|
||||||
FB.init({
|
|
||||||
appId: '154504534677009',
|
|
||||||
xfbml: true
|
|
||||||
});
|
|
||||||
return FB.getLoginStatus(function(oResponse) {
|
|
||||||
if (oResponse.status === "connected") {
|
|
||||||
return FB.ui({
|
|
||||||
method: "feed",
|
|
||||||
name: "Check out this mix on Deep South Sounds",
|
|
||||||
display: "popup",
|
|
||||||
link: "http://" + window.location.host + "/" + model.get("item_url"),
|
|
||||||
picture: com.podnoms.settings.staticUrl + model.get("mix_image"),
|
|
||||||
caption: model.get("title"),
|
|
||||||
description: model.get("description")
|
|
||||||
}, function(response) {
|
|
||||||
if (response && response.post_id) {
|
|
||||||
return utils.showAlert("Success", "Post shared to facebook");
|
|
||||||
} else {
|
|
||||||
return utils.showError("Error", "Failure sharing post");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return utils.showError("Error", "Failure sharing post");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
|
|||||||
@@ -4,7 +4,4 @@ define ['backbone', 'models/mix/mixItem', 'app.lib/backbone.dss.model.collection
|
|||||||
model: MixItem
|
model: MixItem
|
||||||
url:com.podnoms.settings.urlRoot + "mix/"
|
url:com.podnoms.settings.urlRoot + "mix/"
|
||||||
|
|
||||||
_parse: (data) ->
|
|
||||||
console.log("MixCollection: parse")
|
|
||||||
|
|
||||||
MixCollection
|
MixCollection
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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', 'models/mix/mixItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, MixItem, DssCollection) {
|
define(['backbone', 'models/mix/mixItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, MixItem, DssCollection) {
|
||||||
var MixCollection, _ref;
|
var MixCollection;
|
||||||
|
|
||||||
MixCollection = (function(_super) {
|
MixCollection = (function(_super) {
|
||||||
|
|
||||||
__extends(MixCollection, _super);
|
__extends(MixCollection, _super);
|
||||||
|
|
||||||
function MixCollection() {
|
function MixCollection() {
|
||||||
_ref = MixCollection.__super__.constructor.apply(this, arguments);
|
return MixCollection.__super__.constructor.apply(this, arguments);
|
||||||
return _ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MixCollection.prototype.model = MixItem;
|
MixCollection.prototype.model = MixItem;
|
||||||
|
|
||||||
MixCollection.prototype.url = com.podnoms.settings.urlRoot + "mix/";
|
MixCollection.prototype.url = com.podnoms.settings.urlRoot + "mix/";
|
||||||
|
|
||||||
MixCollection.prototype._parse = function(data) {
|
|
||||||
return console.log("MixCollection: parse");
|
|
||||||
};
|
|
||||||
|
|
||||||
return MixCollection;
|
return MixCollection;
|
||||||
|
|
||||||
})(DssCollection);
|
})(DssCollection);
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
define ['backbone', 'vent', 'models/notifications/notificationItem', 'app.lib/backbone.dss.model.collection'], \
|
define ['backbone', 'vent',
|
||||||
(Backbone, vent, NotificationItem, DssCollection) ->
|
'models/notifications/notificationItem', 'app.lib/backbone.dss.model.collection'],
|
||||||
class NotificationCollection extends DssCollection
|
(Backbone, vent,
|
||||||
page: 0
|
NotificationItem, DssCollection) ->
|
||||||
model: NotificationItem
|
class NotificationCollection extends DssCollection
|
||||||
limit: 5
|
page: 0
|
||||||
url: ->
|
model: NotificationItem
|
||||||
com.podnoms.settings.urlRoot + "notification/?limit=" + @limit + "&offset=" + Math.max(@page-1, 0) * @limit
|
limit: 5
|
||||||
|
url: ->
|
||||||
|
com.podnoms.settings.urlRoot + "notification/?limit=" + @limit + "&offset=" + Math.max(@page - 1,
|
||||||
|
0) * @limit
|
||||||
|
|
||||||
initialize: ->
|
initialize: ->
|
||||||
@listenTo vent, "model:notification:new", (url) =>
|
@listenTo vent, "model:notification:new", (url) =>
|
||||||
console.log("NotificationCollection: notification:new")
|
console.log("NotificationCollection: notification:new")
|
||||||
item = new NotificationItem()
|
item = new NotificationItem()
|
||||||
item.fetch
|
item.fetch
|
||||||
url: url
|
url: url
|
||||||
success: (response) =>
|
success: (response) =>
|
||||||
console.log("NotificationCollection: item fetched")
|
console.log("NotificationCollection: item fetched")
|
||||||
console.log(response)
|
console.log(response)
|
||||||
@add response
|
@add response
|
||||||
|
|
||||||
comparator: (item)->
|
comparator: (item)->
|
||||||
-item.id
|
-item.id
|
||||||
|
|
||||||
NotificationCollection
|
NotificationCollection
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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', 'vent', 'models/notifications/notificationItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, vent, NotificationItem, DssCollection) {
|
define(['backbone', 'vent', 'models/notifications/notificationItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, vent, NotificationItem, DssCollection) {
|
||||||
var NotificationCollection, _ref;
|
var NotificationCollection;
|
||||||
|
|
||||||
NotificationCollection = (function(_super) {
|
NotificationCollection = (function(_super) {
|
||||||
|
|
||||||
__extends(NotificationCollection, _super);
|
__extends(NotificationCollection, _super);
|
||||||
|
|
||||||
function NotificationCollection() {
|
function NotificationCollection() {
|
||||||
_ref = NotificationCollection.__super__.constructor.apply(this, arguments);
|
return NotificationCollection.__super__.constructor.apply(this, arguments);
|
||||||
return _ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationCollection.prototype.page = 0;
|
NotificationCollection.prototype.page = 0;
|
||||||
@@ -26,10 +25,8 @@
|
|||||||
|
|
||||||
NotificationCollection.prototype.initialize = function() {
|
NotificationCollection.prototype.initialize = function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
return this.listenTo(vent, "model:notification:new", function(url) {
|
return this.listenTo(vent, "model:notification:new", function(url) {
|
||||||
var item;
|
var item;
|
||||||
|
|
||||||
console.log("NotificationCollection: notification:new");
|
console.log("NotificationCollection: notification:new");
|
||||||
item = new NotificationItem();
|
item = new NotificationItem();
|
||||||
return item.fetch({
|
return item.fetch({
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
define ['moment', 'app', 'vent', 'marionette', 'utils', 'models/comment/commentCollection', 'views/comment/commentListView', 'text!/tpl/MixListItemView'],
|
define ['moment', 'app', 'vent', 'marionette', 'utils',
|
||||||
(moment, App, vent, Marionette, utils, CommentsCollection, CommentsListView, Template) ->
|
'models/comment/commentCollection',
|
||||||
|
'views/comment/commentListView',
|
||||||
|
'text!/tpl/MixListItemView'],
|
||||||
|
(moment, App, vent, Marionette, utils,
|
||||||
|
CommentsCollection,
|
||||||
|
CommentsListView,
|
||||||
|
Template) ->
|
||||||
class MixItemView extends Marionette.ItemView
|
class MixItemView extends Marionette.ItemView
|
||||||
template: _.template(Template)
|
template: _.template(Template)
|
||||||
tagName: @tagName or "li"
|
tagName: @tagName or "li"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.3.3
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||||
__hasProp = {}.hasOwnProperty,
|
__hasProp = {}.hasOwnProperty,
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
define [
|
define [
|
||||||
'marionette', 'vent',
|
'marionette', 'vent',
|
||||||
'models/user/userItem',
|
'models/user/userItem', 'models/mix/mixCollection'
|
||||||
'views/widgets/mixTabHeaderView', 'views/user/userItemView', 'views/mix/mixListView',
|
'views/widgets/mixTabHeaderView', 'views/user/userItemView', 'views/mix/mixListView',
|
||||||
'text!/tpl/MixListLayoutView'],
|
'text!/tpl/MixListLayoutView'],
|
||||||
(Marionette, vent,
|
(Marionette, vent,
|
||||||
UserItem,
|
UserItem, MixCollection,
|
||||||
MixTabHeaderView, UserItemView, MixListView,
|
MixTabHeaderView, UserItemView, MixListView,
|
||||||
Template) ->
|
Template) ->
|
||||||
|
class MixListLayout extends Marionette.Layout
|
||||||
class MixListRegionView extends Marionette.Layout
|
|
||||||
template: _.template(Template)
|
template: _.template(Template)
|
||||||
regions:{
|
regions: {
|
||||||
headerRegion: "#mix-list-heading"
|
headerRegion: "#mix-list-heading"
|
||||||
bodyRegion: "#mix-list-body"
|
bodyRegion: "#mix-list-body"
|
||||||
}
|
}
|
||||||
@@ -18,12 +17,17 @@ define [
|
|||||||
initialize: ->
|
initialize: ->
|
||||||
@listenTo(vent, "mix:showlist", @showMixList)
|
@listenTo(vent, "mix:showlist", @showMixList)
|
||||||
@listenTo(vent, "user:showdetail", @showUserView)
|
@listenTo(vent, "user:showdetail", @showUserView)
|
||||||
|
@showMixList(@options)
|
||||||
|
|
||||||
onShow: ->
|
onShow: ->
|
||||||
@headerRegion.show(new MixTabHeaderView())
|
@headerRegion.show(new MixTabHeaderView())
|
||||||
|
|
||||||
showMixList: (options)->
|
showMixList: (options)->
|
||||||
@bodyRegion.show(new MixListView(options))
|
@collection = new MixCollection()
|
||||||
|
@collection.fetch
|
||||||
|
data: @options
|
||||||
|
success: (collection)=>
|
||||||
|
@bodyRegion.show(new MixListView({collection: collection}))
|
||||||
|
|
||||||
showUserView: (options) ->
|
showUserView: (options) ->
|
||||||
@bodyRegion.show(new MixListView(options))
|
@bodyRegion.show(new MixListView(options))
|
||||||
@@ -32,4 +36,5 @@ define [
|
|||||||
success: =>
|
success: =>
|
||||||
@headerRegion.show(new UserItemView({model: user}))
|
@headerRegion.show(new UserItemView({model: user}))
|
||||||
)
|
)
|
||||||
MixListRegionView
|
|
||||||
|
MixListLayout
|
||||||
@@ -1,43 +1,51 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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/user/userItem', 'views/widgets/mixTabHeaderView', 'views/user/userItemView', 'views/mix/mixListView', 'text!/tpl/MixListLayoutView'], function(Marionette, vent, UserItem, MixTabHeaderView, UserItemView, MixListView, Template) {
|
define(['marionette', 'vent', 'models/user/userItem', 'models/mix/mixCollection', 'views/widgets/mixTabHeaderView', 'views/user/userItemView', 'views/mix/mixListView', 'text!/tpl/MixListLayoutView'], function(Marionette, vent, UserItem, MixCollection, MixTabHeaderView, UserItemView, MixListView, Template) {
|
||||||
var MixListRegionView, _ref;
|
var MixListLayout;
|
||||||
|
MixListLayout = (function(_super) {
|
||||||
|
|
||||||
MixListRegionView = (function(_super) {
|
__extends(MixListLayout, _super);
|
||||||
__extends(MixListRegionView, _super);
|
|
||||||
|
|
||||||
function MixListRegionView() {
|
function MixListLayout() {
|
||||||
_ref = MixListRegionView.__super__.constructor.apply(this, arguments);
|
return MixListLayout.__super__.constructor.apply(this, arguments);
|
||||||
return _ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MixListRegionView.prototype.template = _.template(Template);
|
MixListLayout.prototype.template = _.template(Template);
|
||||||
|
|
||||||
MixListRegionView.prototype.regions = {
|
MixListLayout.prototype.regions = {
|
||||||
headerRegion: "#mix-list-heading",
|
headerRegion: "#mix-list-heading",
|
||||||
bodyRegion: "#mix-list-body"
|
bodyRegion: "#mix-list-body"
|
||||||
};
|
};
|
||||||
|
|
||||||
MixListRegionView.prototype.initialize = function() {
|
MixListLayout.prototype.initialize = function() {
|
||||||
this.listenTo(vent, "mix:showlist", this.showMixList);
|
this.listenTo(vent, "mix:showlist", this.showMixList);
|
||||||
return this.listenTo(vent, "user:showdetail", this.showUserView);
|
this.listenTo(vent, "user:showdetail", this.showUserView);
|
||||||
|
return this.showMixList(this.options);
|
||||||
};
|
};
|
||||||
|
|
||||||
MixListRegionView.prototype.onShow = function() {
|
MixListLayout.prototype.onShow = function() {
|
||||||
return this.headerRegion.show(new MixTabHeaderView());
|
return this.headerRegion.show(new MixTabHeaderView());
|
||||||
};
|
};
|
||||||
|
|
||||||
MixListRegionView.prototype.showMixList = function(options) {
|
MixListLayout.prototype.showMixList = function(options) {
|
||||||
return this.bodyRegion.show(new MixListView(options));
|
var _this = this;
|
||||||
|
this.collection = new MixCollection();
|
||||||
|
return this.collection.fetch({
|
||||||
|
data: this.options,
|
||||||
|
success: function(collection) {
|
||||||
|
return _this.bodyRegion.show(new MixListView({
|
||||||
|
collection: collection
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
MixListRegionView.prototype.showUserView = function(options) {
|
MixListLayout.prototype.showUserView = function(options) {
|
||||||
var user,
|
var user,
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
||||||
this.bodyRegion.show(new MixListView(options));
|
this.bodyRegion.show(new MixListView(options));
|
||||||
user = new UserItem({
|
user = new UserItem({
|
||||||
id: options.user
|
id: options.user
|
||||||
@@ -51,10 +59,10 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return MixListRegionView;
|
return MixListLayout;
|
||||||
|
|
||||||
})(Marionette.Layout);
|
})(Marionette.Layout);
|
||||||
return MixListRegionView;
|
return MixListLayout;
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|||||||
@@ -9,13 +9,6 @@ define ['marionette', 'vent', 'models/mix/mixCollection', 'views/mix/mixItemView
|
|||||||
|
|
||||||
currentMix = -1
|
currentMix = -1
|
||||||
|
|
||||||
initialize: ->
|
|
||||||
@collection = new MixCollection()
|
|
||||||
@collection.fetch
|
|
||||||
data: @options
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
mixPlay: (model) ->
|
mixPlay: (model) ->
|
||||||
if currentMix != -1
|
if currentMix != -1
|
||||||
v = @children.findByModelCid(currentMix)
|
v = @children.findByModelCid(currentMix)
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
// Generated by CoffeeScript 1.6.2
|
// Generated by CoffeeScript 1.4.0
|
||||||
(function() {
|
(function() {
|
||||||
var __hasProp = {}.hasOwnProperty,
|
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; };
|
__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) {
|
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) {
|
MixListView = (function(_super) {
|
||||||
var currentMix;
|
var currentMix;
|
||||||
|
|
||||||
__extends(MixListView, _super);
|
__extends(MixListView, _super);
|
||||||
|
|
||||||
function MixListView() {
|
function MixListView() {
|
||||||
_ref = MixListView.__super__.constructor.apply(this, arguments);
|
return MixListView.__super__.constructor.apply(this, arguments);
|
||||||
return _ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MixListView.prototype.template = _.template(Template);
|
MixListView.prototype.template = _.template(Template);
|
||||||
@@ -26,16 +24,8 @@
|
|||||||
|
|
||||||
currentMix = -1;
|
currentMix = -1;
|
||||||
|
|
||||||
MixListView.prototype.initialize = function() {
|
|
||||||
this.collection = new MixCollection();
|
|
||||||
this.collection.fetch({
|
|
||||||
data: this.options
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
MixListView.prototype.mixPlay = function(model) {
|
MixListView.prototype.mixPlay = function(model) {
|
||||||
var v;
|
var v;
|
||||||
|
|
||||||
if (currentMix !== -1) {
|
if (currentMix !== -1) {
|
||||||
v = this.children.findByModelCid(currentMix);
|
v = this.children.findByModelCid(currentMix);
|
||||||
v.mixStop(v.model);
|
v.mixStop(v.model);
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
// Generated by CoffeeScript 1.3.3
|
|
||||||
(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(['app', 'toastr', 'app.lib/editableView', 'moment', 'utils', 'backbone.syphon', 'text!/tpl/UserEditView'], function(App, toastr, EditableView, moment, utils, Syphon, Template) {
|
|
||||||
var UserEditView;
|
|
||||||
UserEditView = (function(_super) {
|
|
||||||
|
|
||||||
__extends(UserEditView, _super);
|
|
||||||
|
|
||||||
function UserEditView() {
|
|
||||||
return UserEditView.__super__.constructor.apply(this, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
UserEditView.prototype.template = _.template(Template);
|
|
||||||
|
|
||||||
UserEditView.prototype.events = {
|
|
||||||
"click #save-changes": "saveChanges",
|
|
||||||
"change input[type=radio]": "selectAvatar"
|
|
||||||
};
|
|
||||||
|
|
||||||
UserEditView.prototype.onRender = function() {
|
|
||||||
var avatarType;
|
|
||||||
console.log("MixEditView: onRender");
|
|
||||||
avatarType = this.model.get('avatar_type');
|
|
||||||
$('#avatar_' + avatarType, this.el).attr('checked', true);
|
|
||||||
if (avatarType === "custom") {
|
|
||||||
$("#div_avatar_image_upload", this.el).show();
|
|
||||||
} else {
|
|
||||||
$("#div_avatar_image_upload", this.el).hide();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
UserEditView.prototype.selectAvatar = function(evt) {
|
|
||||||
var type;
|
|
||||||
type = $(evt.currentTarget).val();
|
|
||||||
this.model.set("avatar_type", type);
|
|
||||||
if (type === "custom") {
|
|
||||||
return $("#custom_avatar_helptext", this.el).show();
|
|
||||||
} else {
|
|
||||||
return $("#custom_avatar_helptext", this.el).hide();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
UserEditView.prototype.saveChanges = function() {
|
|
||||||
var data, ref;
|
|
||||||
data = Backbone.Syphon.serialize(this);
|
|
||||||
this.model.set(data);
|
|
||||||
ref = this;
|
|
||||||
this._saveChanges({
|
|
||||||
success: function() {
|
|
||||||
var _this = this;
|
|
||||||
if (ref.model.get('avatar_type') === "custom") {
|
|
||||||
$.ajaxFileUpload({
|
|
||||||
url: "ajax/upload_avatar_image/",
|
|
||||||
secureuri: false,
|
|
||||||
fileElementId: "mix_image",
|
|
||||||
success: function(data, status) {
|
|
||||||
if (typeof data.error !== "undefined") {
|
|
||||||
if (data.error !== "") {
|
|
||||||
return alert(data.error);
|
|
||||||
} else {
|
|
||||||
return alert(data.msg);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$("#mix-details", _this.el).hide();
|
|
||||||
return Backbone.history.navigate("/", {
|
|
||||||
trigger: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(data, status, e) {
|
|
||||||
return utils.showError(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.uploadImage({
|
|
||||||
el: $('#avatar_image'),
|
|
||||||
success: function() {
|
|
||||||
utils.showMessage("Successfully updated yourself");
|
|
||||||
return Backbone.history.navigate("/", {
|
|
||||||
trigger: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
toastr.info("Successfully updated yourself");
|
|
||||||
Backbone.history.navigate("/", {
|
|
||||||
trigger: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
error: function() {
|
|
||||||
toastr.error("There was an error updating your info. Please try again later.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
false;
|
|
||||||
|
|
||||||
return UserEditView;
|
|
||||||
|
|
||||||
})(EditableView);
|
|
||||||
return UserEditView;
|
|
||||||
});
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
var socket = new io.Socket({host: 'ext-test.deepsouthsounds.com', resource: 'socket.io', port: '8000', rememberTransport: false});
|
var socket = new io.Socket({host: 'ext-test.deepsouthsounds.com', resource: 'socket.io', port: '8000', rememberTransport: false});
|
||||||
socket.connect();
|
socket.connect();
|
||||||
|
|
||||||
@@ -36,3 +37,4 @@ function message (from, msg) {
|
|||||||
console.log(msg);
|
console.log(msg);
|
||||||
$('#lines').append($('<p>').append($('<b>').text(from), msg));
|
$('#lines').append($('<p>').append($('<b>').text(from), msg));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@@ -22,7 +22,7 @@ requirejs.config({
|
|||||||
ace: 'lib/ace',
|
ace: 'lib/ace',
|
||||||
wysiwyg: 'lib/bootstrap-wysiwyg',
|
wysiwyg: 'lib/bootstrap-wysiwyg',
|
||||||
'ace-editable': 'lib/ace-editable',
|
'ace-editable': 'lib/ace-editable',
|
||||||
'facebook': '//connect.facebook.net/en_US/all',
|
//'facebook': '//connect.facebook.net/en_US/all',
|
||||||
|
|
||||||
/*File upload */
|
/*File upload */
|
||||||
/*TOOD: Move this to a shim */
|
/*TOOD: Move this to a shim */
|
||||||
@@ -61,10 +61,10 @@ requirejs.config({
|
|||||||
bootstrap: {
|
bootstrap: {
|
||||||
exports: 'bootstrap',
|
exports: 'bootstrap',
|
||||||
deps: ['jquery']
|
deps: ['jquery']
|
||||||
},
|
}/*,
|
||||||
'facebook': {
|
'facebook': {
|
||||||
export: 'FB'
|
export: 'FB'
|
||||||
},
|
}*/,
|
||||||
'ace': {
|
'ace': {
|
||||||
exports: 'ace',
|
exports: 'ace',
|
||||||
deps: ['jquery', 'lib/ace-elements', 'lib/ace-extra']
|
deps: ['jquery', 'lib/ace-elements', 'lib/ace-extra']
|
||||||
|
|||||||
Reference in New Issue
Block a user