-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
haha! Rewrote basically the entire app.
- Loading branch information
Julian Connor
committed
Mar 28, 2012
1 parent
8f22b72
commit 273330f
Showing
13 changed files
with
194 additions
and
129 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(function($) { | ||
$.fn.extend({ | ||
htmlFadeIn: function(dom_obj) { | ||
$(this).hide().html(dom_obj); | ||
$(this).fadeIn(); | ||
} | ||
}); | ||
})(jQuery); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
myvolume.collections.Songs = Backbone.Collection.extend({ | ||
model: myvolume.models.Song, | ||
url: "/songs" | ||
initialize: function() { | ||
_.bindAll(this, 'url'); | ||
}, | ||
url: function() { | ||
return "/songs?chart_id=" + this.id; | ||
}, | ||
parse: function(response) { | ||
return response; | ||
} | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
myvolume.views.Songs = Backbone.View.extend({ | ||
id: 'songs', | ||
tagName: 'table', | ||
el: '#songs', | ||
|
||
initialize: function(chartId) { | ||
console.log("ChartSongsView::Init"); | ||
_.bindAll(this, "render", "addOne", "addAll"); | ||
_.bindAll(this, | ||
'render', | ||
'fadeIn'); | ||
this.view = new myvolume.views.SongsTable(); | ||
this.view.on('ready', this.fadeIn); | ||
}, | ||
|
||
render: function() { | ||
console.log("ChartSongsView::render"); | ||
$('#content').append($(this.el)); | ||
this.addAll(); | ||
render: function(id) { | ||
myvolume.routers.workspace.navigate('charts/' + id); | ||
$(this.el).empty(); | ||
$(this.el).html('<div class="loader"><img src="/images/ajax-loader.gif" /></div>'); | ||
this.view.render(id); | ||
return this; | ||
}, | ||
|
||
addOne: function(result) { | ||
console.log("ChartSongsView::addOne"); | ||
var song = new SongItemView({model: result}); | ||
$(this.el).append(song.render().el); | ||
}, | ||
|
||
addAll: function() { | ||
console.log("ChartSongsView::addAll"); | ||
$('table#songs').empty(); | ||
|
||
fadeIn: function() { | ||
$(this.el).htmlFadeIn(this.view.el); | ||
} | ||
|
||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
myvolume.views.SongsTable = Backbone.View.extend({ | ||
id: 'songs', | ||
tagName: 'table', | ||
|
||
initialize: function(chartId) { | ||
console.log("ChartSongsView::Init"); | ||
_.bindAll(this, "render", "addOne", "addAll"); | ||
this.songs = new myvolume.collections.Songs(); | ||
this.songs.on('reset', this.addAll); | ||
}, | ||
|
||
render: function(id) { | ||
console.log("ChartSongsView::render"); | ||
this.songs.id = id; | ||
//$(this.el).empty(); | ||
this.songs.fetch(); | ||
return this; | ||
}, | ||
|
||
addAll: function() { | ||
console.log("ChartSongsView::addAll"); | ||
$(this.el).empty(); | ||
this.songs.each(this.addOne); | ||
|
||
this.trigger('ready'); | ||
}, | ||
|
||
addOne: function(result) { | ||
console.log("ChartSongsView::addOne"); | ||
var song = new myvolume.views.SongRow({model: result}); | ||
$(this.el).append(song.render().el); | ||
} | ||
|
||
|
||
}); |
Oops, something went wrong.