diff --git a/web/app/assets/javascripts/hoverRecording.js b/web/app/assets/javascripts/hoverRecording.js
index 68718743c..46f7d05bd 100644
--- a/web/app/assets/javascripts/hoverRecording.js
+++ b/web/app/assets/javascripts/hoverRecording.js
@@ -1,14 +1,72 @@
(function(context,$) {
- "use strict";
- context.JK = context.JK || {};
- context.JK.RecordingHoverBubble = function(app) {
+ "use strict";
+ context.JK = context.JK || {};
+ context.JK.RecordingHoverBubble = function(recordingId, position) {
- function initialize() {
+ var logger = context.JK.logger;
+ var rest = context.JK.Rest();
+ var instrumentLogoMap = context.JK.getInstrumentIconMap24();
+ var hoverSelector = "#recording-hover";
- }
-
- this.initialize = initialize;
- this.showBubble = showBubble;
- }
+ this.showBubble = function() {
+ $(hoverSelector).css({left: position.left-100, top: position.top});
+ $(hoverSelector).fadeIn(500);
+
+ rest.getClaimedRecording(recordingId)
+ .done(function(response) {
+ $(hoverSelector).html('');
+
+ // musicians
+ var musicianHtml = '';
+ $.each(response.musicians, function(index, val) {
+ var instrumentHtml = '';
+
+ musicianHtml += '
 + ') | ';
+ musicianHtml += '' + val.name + ' | ';
+
+ instrumentHtml = '';
+ $.each(val.instruments, function(index, instrument) {
+ instrumentHtml += '  ';
+ });
+
+ instrumentHtml += ' | ';
+
+ musicianHtml += instrumentHtml;
+ musicianHtml += '
';
+ });
+
+ var template = $('#template-hover-recording').html();
+
+ var recordingHtml = context.JK.fillTemplate(template, {
+ avatar_url: context.JK.resolveAvatarUrl(response.photo_url),
+ name: response.name,
+ location: response.location,
+ friend_count: response.friend_count,
+ follower_count: response.follower_count
+ });
+
+ $(hoverSelector).append('Recording Detail
' + recordingHtml);
+ })
+ .fail(function(xhr) {
+ if(xhr.status >= 500) {
+ context.JK.fetchUserNetworkOrServerFailure();
+ }
+ else if(xhr.status == 404) {
+ context.JK.entityNotFound("Recording");
+ }
+ else {
+ context.JK.app.ajaxError(arguments);
+ }
+ });
+ };
+
+ this.hideBubble = function() {
+ $(hoverSelector).hide();
+ };
+
+ this.id = function() {
+ return hoverSelector;
+ };
+ }
})(window,jQuery);
\ No newline at end of file
diff --git a/web/app/assets/javascripts/hoverSession.js b/web/app/assets/javascripts/hoverSession.js
index 7bfe105cf..e09845841 100644
--- a/web/app/assets/javascripts/hoverSession.js
+++ b/web/app/assets/javascripts/hoverSession.js
@@ -1,14 +1,67 @@
(function(context,$) {
- "use strict";
- context.JK = context.JK || {};
- context.JK.SessionHoverBubble = function(app) {
+ "use strict";
+ context.JK = context.JK || {};
+ context.JK.SessionHoverBubble = function(sessionId, position) {
- function initialize() {
+ var logger = context.JK.logger;
+ var rest = context.JK.Rest();
+ var instrumentLogoMap = context.JK.getInstrumentIconMap24();
+ var hoverSelector = "#session-hover";
- }
-
- this.initialize = initialize;
- this.showBubble = showBubble;
- }
+ this.showBubble = function() {
+ $(hoverSelector).css({left: position.left-100, top: position.top});
+ $(hoverSelector).fadeIn(500);
+
+ rest.getSessionHistory(sessionId)
+ .done(function(response) {
+ $(hoverSelector).html('');
+
+ // musicians
+ var musicianHtml = '';
+ $.each(response.users, function(index, val) {
+ var instrumentHtml = '';
+
+ musicianHtml += ' + ') | ';
+ musicianHtml += '' + val.name + ' | ';
+
+ instrumentHtml = '';
+ $.each(val.instruments, function(index, instrument) {
+ instrumentHtml += '  ';
+ });
+
+ instrumentHtml += ' | ';
+
+ musicianHtml += instrumentHtml;
+ musicianHtml += '
';
+ });
+
+ var template = $('#template-hover-session').html();
+
+ var sessionHtml = context.JK.fillTemplate(template, {
+ });
+
+ $(hoverSelector).append('Session Detail
' + sessionHtml);
+ })
+ .fail(function(xhr) {
+ if(xhr.status >= 500) {
+ context.JK.fetchUserNetworkOrServerFailure();
+ }
+ else if(xhr.status == 404) {
+ context.JK.entityNotFound("Session");
+ }
+ else {
+ context.JK.app.ajaxError(arguments);
+ }
+ });
+ };
+
+ this.hideBubble = function() {
+ $(hoverSelector).hide();
+ };
+
+ this.id = function() {
+ return hoverSelector;
+ };
+ }
})(window,jQuery);
\ No newline at end of file
diff --git a/web/app/views/api_music_sessions/history_show.rabl b/web/app/views/api_music_sessions/history_show.rabl
index 7296aca8f..9d3ea1c81 100644
--- a/web/app/views/api_music_sessions/history_show.rabl
+++ b/web/app/views/api_music_sessions/history_show.rabl
@@ -1,6 +1,6 @@
object @history
-attributes :music_session_id, :description, :genres
+attributes :music_session_id, :description, :genres, :created_at
node :share_url do |history|
unless history.share_token.nil?
diff --git a/web/app/views/clients/_hoverRecording.html.erb b/web/app/views/clients/_hoverRecording.html.erb
index 12627f1b1..a6c2415ec 100644
--- a/web/app/views/clients/_hoverRecording.html.erb
+++ b/web/app/views/clients/_hoverRecording.html.erb
@@ -1,55 +1,36 @@
-
-
-
Recording Detail
-
-
Twelve Weeks
-
JAZZ
-
01/25/14 - 11:23 pm
-
-
Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. Aliquam erat volutpat. Nullam ultrices, diam tempus vulputate egestas, eros pede varius leo, sed imperdiet lectus est ornare odio.
-
12

4

17

-
-

-
Fox Force Five
-Richmond, VA
-
-MUSICIANS:
-
-
-
-
-
-
+
-
-
-
-
-
-
\ No newline at end of file
diff --git a/web/app/views/clients/_hoverSession.html.erb b/web/app/views/clients/_hoverSession.html.erb
index b5e190b04..cce8897f5 100644
--- a/web/app/views/clients/_hoverSession.html.erb
+++ b/web/app/views/clients/_hoverSession.html.erb
@@ -1,49 +1,28 @@
-
-
-
Session Detail
-
-
JAZZ
-
01/25/14 - 11:23 pm
-
-
Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. Aliquam erat volutpat. Nullam ultrices, diam tempus vulputate egestas, eros pede varius leo, sed imperdiet lectus est ornare odio.
-
-
-MUSICIANS:
-
-
-
-
-
-
+
-
-
-
-
-
\ No newline at end of file