Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Seth Call 2014-02-13 22:11:45 -06:00
commit 0d6c8a94e6
43 changed files with 2488 additions and 2103 deletions

View File

@ -1,229 +1,230 @@
(function(context,$) {
"use strict";
"use strict";
context.JK = context.JK || {};
context.JK.FindBandScreen = function(app) {
context.JK = context.JK || {};
context.JK.FindBandScreen = function(app) {
var logger = context.JK.logger;
var bands = {};
var bandList;
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var did_show_band_page = false;
var page_num=1, page_count=0;
var logger = context.JK.logger;
var bands = {};
var bandList;
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var did_show_band_page = false;
var page_num=1, page_count=0;
function loadBands(queryString) {
// squelch nulls and undefines
queryString = !!queryString ? queryString : "";
function loadBands(queryString) {
// squelch nulls and undefines
queryString = !!queryString ? queryString : "";
$.ajax({
type: "GET",
url: "/api/search.json?" + queryString,
success: afterLoadBands,
error: app.ajaxError
});
$.ajax({
type: "GET",
url: "/api/search.json?" + queryString,
success: afterLoadBands,
error: app.ajaxError
});
}
function search() {
did_show_band_page = true;
var queryString = 'srch_b=1&page='+page_num+'&';
// order by
var orderby = $('#band_order_by').val();
if (typeof orderby != 'undefined' && orderby.length > 0) {
queryString += "orderby=" + orderby + '&';
}
// genre filter
var genre = $('#band_genre').val();
if (typeof genre != 'undefined' && !(genre === '')) {
queryString += "genre=" + genre + '&';
}
// distance filter
var query_param = $('#band_query_distance').val();
if (query_param !== null && query_param.length > 0) {
var matches = query_param.match(/(\d+)/);
if (0 < matches.length) {
var distance = matches[0];
queryString += "distance=" + distance + '&';
}
}
loadBands(queryString);
}
function search() {
did_show_band_page = true;
var queryString = 'srch_b=1&page='+page_num+'&';
function refreshDisplay() {
clearResults();
search();
}
// order by
var orderby = $('#band_order_by').val();
if (typeof orderby != 'undefined' && orderby.length > 0) {
queryString += "orderby=" + orderby + '&';
function afterLoadBands(mList) {
// display the 'no bands' banner if appropriate
var $noBandsFound = $('#bands-none-found');
bandList = mList;
if(bandList.length == 0) {
$noBandsFound.show();
bands = [];
}
else {
$noBandsFound.hide();
bands = bandList['bands'];
if (!(typeof bands === 'undefined')) {
$('#band-filter-city').text(bandList['city']);
if (0 == page_count) {
page_count = bandList['page_count'];
}
renderBands();
}
}
}
function renderBands() {
var ii, len;
var mTemplate = $('#template-find-band-row').html();
var pTemplate = $('#template-band-player-info').html();
var aTemplate = $('#template-band-action-btns').html();
var bVals, bb, renderings='';
var instr_logos, instr;
var players, playerVals, aPlayer;
for (ii=0, len=bands.length; ii < len; ii++) {
bb = bands[ii];
instr_logos = '';
players = '';
playerVals = {};
for (var jj=0, ilen=bb['players'].length; jj<ilen; jj++) {
aPlayer = bb['players'][jj];
var player_instrs = '';
var iter_pinstruments = aPlayer['instruments'].split(',');
for (var kk=0, klen=iter_pinstruments.length; kk<klen; kk++) {
var pinstr = iter_pinstruments[kk];
if (pinstr in instrument_logo_map) {
instr = instrument_logo_map[pinstr];
}
// genre filter
var genre = $('#band_genre').val();
if (typeof genre != 'undefined' && !(genre === '')) {
queryString += "genre=" + genre + '&';
}
// distance filter
var query_param = $('#band_query_distance').val();
if (query_param !== null && query_param.length > 0) {
var matches = query_param.match(/(\d+)/);
if (0 < matches.length) {
var distance = matches[0];
queryString += "distance=" + distance + '&';
}
}
loadBands(queryString);
player_instrs += '<img src="' + instr + '"/>';
}
playerVals = {
user_id: aPlayer.user_id,
player_name: aPlayer.name,
profile_url: '/client#/profile/' + aPlayer.user_id,
avatar_url: context.JK.resolveAvatarUrl(aPlayer.photo_url),
player_instruments: player_instrs
};
players += context.JK.fillTemplate(pTemplate, playerVals);
}
function refreshDisplay() {
clearResults();
search();
var actionVals = {
profile_url: "/client#/bandProfile/" + bb.id,
button_follow: bb['is_following'] ? '' : 'button-orange',
button_message: 'button-orange'
};
var band_actions = context.JK.fillTemplate(aTemplate, actionVals);
var bgenres = '';
for (jj=0, ilen=bb['genres'].length; jj<ilen; jj++) {
bgenres += bb['genres'][jj]['description'] + '<br />';
}
function afterLoadBands(mList) {
// display the 'no bands' banner if appropriate
var $noBandsFound = $('#bands-none-found');
bandList = mList;
bgenres += '<br />';
if(bandList.length == 0) {
$noBandsFound.show();
bands = [];
} else {
$noBandsFound.hide();
bands = bandList['bands'];
if (!(typeof bands === 'undefined')) {
$('#band-filter-city').text(bandList['city']);
if (0 == page_count) {
page_count = bandList['page_count'];
}
renderBands();
}
}
bVals = {
avatar_url: context.JK.resolveBandAvatarUrl(bb.photo_url),
profile_url: "/client#/bandProfile/" + bb.id,
band_name: bb.name,
band_location: bb.city + ', ' + bb.state,
genres: bgenres,
instruments: instr_logos,
biography: bb['biography'],
follow_count: bb['follow_count'],
recording_count: bb['recording_count'],
session_count: bb['session_count'],
band_id: bb['id'],
band_player_template: players,
band_action_template: band_actions
};
var band_row = context.JK.fillTemplate(mTemplate, bVals);
renderings += band_row;
}
$('#band-filter-results').append(renderings);
$('.search-m-follow').on('click', followBand);
context.JK.bindHoverEvents();
}
function beforeShow(data) {
}
function afterShow(data) {
if (!did_show_band_page) {
refreshDisplay();
}
}
function clearResults() {
bands = {};
$('#band-filter-results').empty();
page_num = 1;
page_count = 0;
}
function followBand(evt) {
// if the band is already followed, remove the button-orange class, and prevent
// the link from working
if (0 == $(this).closest('.button-orange').size()) return false;
$(this).click(function(ee) {ee.preventDefault();});
evt.stopPropagation();
var newFollowing = {};
newFollowing.band_id = $(this).parent().data('band-id');
var url = "/api/users/" + context.JK.currentUserId + "/followings";
$.ajax({
type: "POST",
dataType: "json",
contentType: 'application/json',
url: url,
data: JSON.stringify(newFollowing),
processData: false,
success: function(response) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-band-id='+newFollowing.band_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey');
},
error: app.ajaxError
});
}
function events() {
$('#band_query_distance').change(refreshDisplay);
$('#band_genre').change(refreshDisplay);
$('#band_order_by').change(refreshDisplay);
$('#band-filter-results').bind('scroll', function() {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
if (page_num < page_count) {
page_num += 1;
search();
}
}
});
}
/**
* Render a list of bands
*/
function renderBands() {
var ii, len;
var mTemplate = $('#template-find-band-row').html();
var pTemplate = $('#template-band-player-info').html();
var aTemplate = $('#template-band-action-btns').html();
var bVals, bb, renderings='';
var instr_logos, instr;
var players, playerVals, aPlayer;
for (ii=0, len=bands.length; ii < len; ii++) {
bb = bands[ii];
instr_logos = '';
players = '';
playerVals = {};
for (var jj=0, ilen=bb['players'].length; jj<ilen; jj++) {
aPlayer = bb['players'][jj];
var player_instrs = '';
var iter_pinstruments = aPlayer['instruments'].split(',');
for (var kk=0, klen=iter_pinstruments.length; kk<klen; kk++) {
var pinstr = iter_pinstruments[kk];
if (pinstr in instrument_logo_map) {
instr = instrument_logo_map[pinstr];
}
player_instrs += '<img src="' + instr + '"/>';
}
function initialize() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
};
app.bindScreen('bands', screenBindings);
playerVals = {
player_name: aPlayer.name,
profile_url: '/client#/profile/' + aPlayer.user_id,
avatar_url: context.JK.resolveAvatarUrl(aPlayer.photo_url),
player_instruments: player_instrs
};
players += context.JK.fillTemplate(pTemplate, playerVals);
}
var actionVals = {
profile_url: "/client#/bandProfile/" + bb.id,
button_follow: bb['is_following'] ? '' : 'button-orange',
button_message: 'button-orange'
};
var band_actions = context.JK.fillTemplate(aTemplate, actionVals);
var bgenres = '';
for (jj=0, ilen=bb['genres'].length; jj<ilen; jj++) {
bgenres += bb['genres'][jj]['description'] + '<br />';
}
bgenres += '<br />';
events();
}
bVals = {
avatar_url: context.JK.resolveAvatarUrl(bb.photo_url),
profile_url: "/client#/bandProfile/" + bb.id,
band_name: bb.name,
band_location: bb.city + ', ' + bb.state,
genres: bgenres,
instruments: instr_logos,
biography: bb['biography'],
follow_count: bb['follow_count'],
recording_count: bb['recording_count'],
session_count: bb['session_count'],
band_id: bb['id'],
band_player_template: players,
band_action_template: band_actions
};
var band_row = context.JK.fillTemplate(mTemplate, bVals);
renderings += band_row;
}
$('#band-filter-results').append(renderings);
$('.search-m-follow').on('click', followBand);
}
function beforeShow(data) {
}
function afterShow(data) {
if (!did_show_band_page) {
refreshDisplay();
}
}
function clearResults() {
bands = {};
$('#band-filter-results').empty();
page_num = 1;
page_count = 0;
}
function followBand(evt) {
// if the band is already followed, remove the button-orange class, and prevent
// the link from working
if (0 == $(this).closest('.button-orange').size()) return false;
$(this).click(function(ee) {ee.preventDefault();});
evt.stopPropagation();
var newFollowing = {};
newFollowing.band_id = $(this).parent().data('band-id');
var url = "/api/users/" + context.JK.currentUserId + "/followings";
$.ajax({
type: "POST",
dataType: "json",
contentType: 'application/json',
url: url,
data: JSON.stringify(newFollowing),
processData: false,
success: function(response) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-band-id='+newFollowing.band_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey');
},
error: app.ajaxError
});
}
function events() {
$('#band_query_distance').change(refreshDisplay);
$('#band_genre').change(refreshDisplay);
$('#band_order_by').change(refreshDisplay);
$('#band-filter-results').bind('scroll', function() {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
if (page_num < page_count) {
page_num += 1;
search();
}
}
});
}
/**
* Initialize,
*/
function initialize() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
};
app.bindScreen('bands', screenBindings);
events();
}
this.initialize = initialize;
this.renderBands = renderBands;
this.afterShow = afterShow;
this.clearResults = clearResults;
return this;
};
this.initialize = initialize;
this.renderBands = renderBands;
this.afterShow = afterShow;
this.clearResults = clearResults;
return this;
}
})(window,jQuery);

View File

@ -1,247 +1,250 @@
(function(context,$) {
"use strict";
"use strict";
context.JK = context.JK || {};
context.JK.FindMusicianScreen = function(app) {
context.JK = context.JK || {};
context.JK.FindMusicianScreen = function(app) {
var logger = context.JK.logger;
var musicians = {};
var musicianList;
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var did_show_musician_page = false;
var page_num=1, page_count=0;
var logger = context.JK.logger;
var musicians = {};
var musicianList;
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var did_show_musician_page = false;
var page_num=1, page_count=0;
function loadMusicians(queryString) {
// squelch nulls and undefines
queryString = !!queryString ? queryString : "";
function loadMusicians(queryString) {
// squelch nulls and undefines
queryString = !!queryString ? queryString : "";
$.ajax({
type: "GET",
url: "/api/search.json?" + queryString,
success: afterLoadMusicians,
error: app.ajaxError
});
$.ajax({
type: "GET",
url: "/api/search.json?" + queryString,
success: afterLoadMusicians,
error: app.ajaxError
});
}
function search() {
did_show_musician_page = true;
var queryString = 'srch_m=1&page='+page_num+'&';
// order by
var orderby = $('#musician_order_by').val();
if (typeof orderby != 'undefined' && orderby.length > 0) {
queryString += "orderby=" + orderby + '&';
}
function search() {
did_show_musician_page = true;
var queryString = 'srch_m=1&page='+page_num+'&';
// order by
var orderby = $('#musician_order_by').val();
if (typeof orderby != 'undefined' && orderby.length > 0) {
queryString += "orderby=" + orderby + '&';
}
// instrument filter
var instrument = $('#musician_instrument').val();
if (typeof instrument != 'undefined' && !(instrument === '')) {
queryString += "instrument=" + instrument + '&';
}
// distance filter
var query_param = $('#musician_query_distance').val();
if (query_param !== null && query_param.length > 0) {
var matches = query_param.match(/(\d+)/);
if (0 < matches.length) {
var distance = matches[0];
queryString += "distance=" + distance + '&';
}
}
loadMusicians(queryString);
// instrument filter
var instrument = $('#musician_instrument').val();
if (typeof instrument != 'undefined' && !(instrument === '')) {
queryString += "instrument=" + instrument + '&';
}
function refreshDisplay() {
clearResults();
search();
}
function afterLoadMusicians(mList) {
// display the 'no musicians' banner if appropriate
var $noMusiciansFound = $('#musicians-none-found');
musicianList = mList;
if(musicianList.length == 0) {
$noMusiciansFound.show();
musicians = [];
}
else {
$noMusiciansFound.hide();
musicians = musicianList['musicians'];
if (!(typeof musicians === 'undefined')) {
$('#musician-filter-city').text(musicianList['city']);
if (0 == page_count) {
page_count = musicianList['page_count'];
}
renderMusicians();
}
// distance filter
var query_param = $('#musician_query_distance').val();
if (query_param !== null && query_param.length > 0) {
var matches = query_param.match(/(\d+)/);
if (0 < matches.length) {
var distance = matches[0];
queryString += "distance=" + distance + '&';
}
}
loadMusicians(queryString);
}
function renderMusicians() {
var ii, len;
var mTemplate = $('#template-find-musician-row').html();
var fTemplate = $('#template-musician-follow-info').html();
var aTemplate = $('#template-musician-action-btns').html();
var mVals, mm, renderings='';
var instr_logos, instr;
var follows, followVals, aFollow;
function refreshDisplay() {
clearResults();
search();
}
for (ii=0, len=musicians.length; ii < len; ii++) {
mm = musicians[ii];
if (context.JK.currentUserId === mm.id) {
// VRFS-294.3 (David) => skip if current user is musician
continue;
function afterLoadMusicians(mList) {
// display the 'no musicians' banner if appropriate
var $noMusiciansFound = $('#musicians-none-found');
musicianList = mList;
if(musicianList.length == 0) {
$noMusiciansFound.show();
musicians = [];
}
else {
$noMusiciansFound.hide();
musicians = musicianList['musicians'];
if (!(typeof musicians === 'undefined')) {
$('#musician-filter-city').text(musicianList['city']);
if (0 == page_count) {
page_count = musicianList['page_count'];
}
instr_logos = '';
for (var jj=0, ilen=mm['instruments'].length; jj<ilen; jj++) {
if (mm['instruments'][jj].instrument_id in instrument_logo_map) {
instr = instrument_logo_map[mm['instruments'][jj].instrument_id];
}
instr_logos += '<img src="' + instr + '"/>';
renderMusicians();
}
}
}
function renderMusicians() {
var ii, len;
var mTemplate = $('#template-find-musician-row').html();
var fTemplate = $('#template-musician-follow-info').html();
var aTemplate = $('#template-musician-action-btns').html();
var mVals, mm, renderings='';
var instr_logos, instr;
var follows, followVals, aFollow;
for (ii=0, len=musicians.length; ii < len; ii++) {
mm = musicians[ii];
if (context.JK.currentUserId === mm.id) {
// VRFS-294.3 (David) => skip if current user is musician
continue;
}
instr_logos = '';
for (var jj=0, ilen=mm['instruments'].length; jj<ilen; jj++) {
if (mm['instruments'][jj].instrument_id in instrument_logo_map) {
instr = instrument_logo_map[mm['instruments'][jj].instrument_id];
}
follows = '';
followVals = {};
for (var jj=0, ilen=mm['followings'].length; jj<ilen; jj++) {
aFollow = mm['followings'][jj];
followVals = {
musician_name: aFollow.name,
profile_url: '/client#/profile/' + aFollow.user_id,
avatar_url: context.JK.resolveAvatarUrl(aFollow.photo_url),
};
follows += context.JK.fillTemplate(fTemplate, followVals);
if (2 == jj) break;
}
var actionVals = {
profile_url: "/client#/profile/" + mm.id,
friend_class: 'button-' + (mm['is_friend'] ? 'grey' : 'orange'),
friend_caption: (mm.is_friend ? 'DIS':'')+'CONNECT',
follow_class: 'button-' + (mm['is_following'] ? 'grey' : 'orange'),
follow_caption: (mm.is_following ? 'UN':'')+'FOLLOW',
button_message: 'button-orange'
instr_logos += '<img src="' + instr + '"/>';
}
follows = '';
followVals = {};
for (var jj=0, ilen=mm['followings'].length; jj<ilen; jj++) {
aFollow = mm['followings'][jj];
followVals = {
user_id: aFollow.user_id,
musician_name: aFollow.name,
profile_url: '/client#/profile/' + aFollow.user_id,
avatar_url: context.JK.resolveAvatarUrl(aFollow.photo_url),
};
var musician_actions = context.JK.fillTemplate(aTemplate, actionVals);
mVals = {
avatar_url: context.JK.resolveAvatarUrl(mm.photo_url),
profile_url: "/client#/profile/" + mm.id,
musician_name: mm.name,
musician_location: mm.city + ', ' + mm.state,
instruments: instr_logos,
biography: mm['biography'],
follow_count: mm['follow_count'],
friend_count: mm['friend_count'],
recording_count: mm['recording_count'],
session_count: mm['session_count'],
musician_id: mm['id'],
musician_follow_template: follows,
musician_action_template: musician_actions
};
var musician_row = context.JK.fillTemplate(mTemplate, mVals);
renderings += musician_row;
follows += context.JK.fillTemplate(fTemplate, followVals);
if (2 == jj) break;
}
$('#musician-filter-results').append(renderings);
$('.search-m-friend').on('click', friendMusician);
$('.search-m-follow').on('click', followMusician);
}
function beforeShow(data) {
}
function afterShow(data) {
if (!did_show_musician_page) {
refreshDisplay();
}
}
function clearResults() {
musicians = {};
$('#musician-filter-results').empty();
page_num = 1;
page_count = 0;
}
function friendMusician(evt) {
// if the musician is already a friend, remove the button-orange class, and prevent
// the link from working
if (0 === $(this).closest('.button-orange').size()) {
return false;
}
$(this).click(function(ee) {ee.preventDefault();});
evt.stopPropagation();
var uid = $(this).parent().data('musician-id');
context.JK.sendFriendRequest(app, uid, friendRequestCallback);
}
function friendRequestCallback(user_id) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-musician-id='+user_id+'] .search-m-friend').removeClass('button-orange').addClass('button-grey');
}
function followMusician(evt) {
// if the musician is already followed, remove the button-orange class, and prevent
// the link from working
if (0 === $(this).closest('.button-orange').size()) {
return false;
}
$(this).click(function(ee) {ee.preventDefault();});
evt.stopPropagation();
var newFollowing = {};
newFollowing.user_id = $(this).parent().data('musician-id');
var url = "/api/users/" + context.JK.currentUserId + "/followings";
$.ajax({
type: "POST",
dataType: "json",
contentType: 'application/json',
url: url,
data: JSON.stringify(newFollowing),
processData: false,
success: function(response) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-musician-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey');
},
error: app.ajaxError
});
}
function events() {
$('#musician_query_distance').change(refreshDisplay);
$('#musician_instrument').change(refreshDisplay);
$('#musician_order_by').change(refreshDisplay);
$('#musician-filter-results').bind('scroll', function() {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
if (page_num < page_count) {
page_num += 1;
search();
}
}
});
}
function initialize() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
var actionVals = {
profile_url: "/client#/profile/" + mm.id,
friend_class: 'button-' + (mm['is_friend'] ? 'grey' : 'orange'),
friend_caption: (mm.is_friend ? 'DIS':'')+'CONNECT',
follow_class: 'button-' + (mm['is_following'] ? 'grey' : 'orange'),
follow_caption: (mm.is_following ? 'UN':'')+'FOLLOW',
button_message: 'button-orange'
};
app.bindScreen('musicians', screenBindings);
var musician_actions = context.JK.fillTemplate(aTemplate, actionVals);
events();
mVals = {
avatar_url: context.JK.resolveAvatarUrl(mm.photo_url),
profile_url: "/client#/profile/" + mm.id,
musician_name: mm.name,
musician_location: mm.city + ', ' + mm.state,
instruments: instr_logos,
biography: mm['biography'],
follow_count: mm['follow_count'],
friend_count: mm['friend_count'],
recording_count: mm['recording_count'],
session_count: mm['session_count'],
musician_id: mm['id'],
musician_follow_template: follows,
musician_action_template: musician_actions
};
var musician_row = context.JK.fillTemplate(mTemplate, mVals);
renderings += musician_row;
}
$('#musician-filter-results').append(renderings);
$('.search-m-friend').on('click', friendMusician);
$('.search-m-follow').on('click', followMusician);
context.JK.bindHoverEvents();
}
function beforeShow(data) {
}
function afterShow(data) {
if (!did_show_musician_page) {
refreshDisplay();
}
}
function clearResults() {
musicians = {};
$('#musician-filter-results').empty();
page_num = 1;
page_count = 0;
}
function friendMusician(evt) {
// if the musician is already a friend, remove the button-orange class, and prevent
// the link from working
if (0 === $(this).closest('.button-orange').size()) {
return false;
}
this.initialize = initialize;
this.renderMusicians = renderMusicians;
this.afterShow = afterShow;
$(this).click(function(ee) {ee.preventDefault();});
this.clearResults = clearResults;
evt.stopPropagation();
var uid = $(this).parent().data('musician-id');
context.JK.sendFriendRequest(app, uid, friendRequestCallback);
}
return this;
};
function friendRequestCallback(user_id) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-musician-id='+user_id+'] .search-m-friend').removeClass('button-orange').addClass('button-grey');
}
function followMusician(evt) {
// if the musician is already followed, remove the button-orange class, and prevent
// the link from working
if (0 === $(this).closest('.button-orange').size()) {
return false;
}
$(this).click(function(ee) {ee.preventDefault();});
evt.stopPropagation();
var newFollowing = {};
newFollowing.user_id = $(this).parent().data('musician-id');
var url = "/api/users/" + context.JK.currentUserId + "/followings";
$.ajax({
type: "POST",
dataType: "json",
contentType: 'application/json',
url: url,
data: JSON.stringify(newFollowing),
processData: false,
success: function(response) {
// remove the orange look to indicate it's not selectable
// @FIXME -- this will need to be tweaked when we allow unfollowing
$('div[data-musician-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey');
},
error: app.ajaxError
});
}
function events() {
$('#musician_query_distance').change(refreshDisplay);
$('#musician_instrument').change(refreshDisplay);
$('#musician_order_by').change(refreshDisplay);
$('#musician-filter-results').bind('scroll', function() {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
if (page_num < page_count) {
page_num += 1;
search();
}
}
});
}
function initialize() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
};
app.bindScreen('musicians', screenBindings);
events();
}
this.initialize = initialize;
this.renderMusicians = renderMusicians;
this.afterShow = afterShow;
this.clearResults = clearResults;
return this;
}
})(window,jQuery);

View File

@ -0,0 +1,86 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.BandHoverBubble = function(bandId, position) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var instrumentLogoMap = context.JK.getInstrumentIconMap24();
var hoverSelector = "#band-hover";
this.showBubble = function() {
$(hoverSelector).css({left: position.left-100, top: position.top});
$(hoverSelector).fadeIn(500);
rest.getBand(bandId)
.done(function(response) {
$(hoverSelector).html('');
// musicians
var musicianHtml = '';
$.each(response.musicians, function(index, val) {
var instrumentHtml = '';
musicianHtml += '<tr><td width="50"><a href="#" class="avatar-tiny"><img src="' + context.JK.resolveAvatarUrl(val.photo_url) + '" /></a></td>';
musicianHtml += '<td width="75"><a href="#">' + val.name + '</a></td>';
instrumentHtml = '<td><div class="nowrap">';
$.each(val.instruments, function(index, instrument) {
instrumentHtml += '<img src="' + instrumentLogoMap[instrument.instrument_id] + '" width="24" height="24" />&nbsp;';
});
instrumentHtml += '</div></td>';
musicianHtml += instrumentHtml;
musicianHtml += '</tr>';
});
var template = $('#template-hover-band').html();
if (response.biography == null) {
response.biography = 'No Biography Available';
}
var genres = [];
genres = $.map(response.genres, function(n, i) {
return n.description;
});
var bandHtml = context.JK.fillTemplate(template, {
avatar_url: context.JK.resolveBandAvatarUrl(response.photo_url),
name: response.name,
location: response.location,
genres: genres.join(', '),
musicians: musicianHtml,
like_count: response.liker_count,
follower_count: response.follower_count,
recording_count: response.recording_count,
session_count: response.session_count,
biography: response.biography,
profile_url: "/client#/bandProfile/" + response.id
});
$(hoverSelector).append('<h2>Band Detail</h2>' + bandHtml);
})
.fail(function(xhr) {
if(xhr.status >= 500) {
context.JK.fetchUserNetworkOrServerFailure();
}
else if(xhr.status == 404) {
context.JK.entityNotFound("Band");
}
else {
context.JK.app.ajaxError(arguments);
}
});
};
this.hideBubble = function() {
$(hoverSelector).hide();
};
this.id = function() {
return hoverSelector;
};
}
})(window,jQuery);

View File

@ -0,0 +1,76 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.FanHoverBubble = function(userId, position) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var instrumentLogoMap = context.JK.getInstrumentIconMap24();
var hoverSelector = "#fan-hover";
this.showBubble = function() {
$(hoverSelector).css({left: position.left-100, top: position.top});
$(hoverSelector).fadeIn(500);
rest.getUserDetail({id: userId})
.done(function(response) {
$(hoverSelector).html('');
// followings
var followingHtml = '';
$.each(response.followings, function(index, val) {
if (index < 4) { // display max of 4 followings (NOTE: this only displays USER followings, not BAND followings)
if (index % 2 === 0) {
followingHtml += '<tr>';
}
followingHtml += '<td width="24"><a href="#" class="avatar-tiny"><img src="' + context.JK.resolveAvatarUrl(val.photo_url) + '" /></a></td>';
followingHtml += '<td><a href="/client#/profile/' + val.id + '"><strong>' + val.name + '</strong></a></td>';
if (index % 2 > 0) {
followingHtml += '</tr>';
}
}
});
var template = $('#template-hover-fan').html();
if (response.biography == null) {
response.biography = 'No Biography Available';
}
var fanHtml = 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,
biography: response.biography,
followings: response.followings && response.followings.length > 0 ? followingHtml : "<tr><td>N/A</td></tr>",
profile_url: "/client#/profile/" + response.id
});
$(hoverSelector).append('<h2>Fan Detail</h2>' + fanHtml);
})
.fail(function(xhr) {
if(xhr.status >= 500) {
context.JK.fetchUserNetworkOrServerFailure();
}
else if(xhr.status == 404) {
context.JK.entityNotFound("User");
}
else {
context.JK.app.ajaxError(arguments);
}
});
};
this.hideBubble = function() {
$(hoverSelector).hide();
};
this.id = function() {
return hoverSelector;
};
}
})(window,jQuery);

View File

@ -0,0 +1,94 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.MusicianHoverBubble = function(userId, position) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var instrumentLogoMap = context.JK.getInstrumentIconMap24();
var hoverSelector = "#musician-hover";
this.showBubble = function() {
$(hoverSelector).css({left: position.left-100, top: position.top});
$(hoverSelector).fadeIn(500);
rest.getUserDetail({id: userId})
.done(function(response) {
$(hoverSelector).html('');
// instruments
var instrumentHtml = '';
$.each(response.instruments, function(index, val) {
instrumentHtml += '<div class="left mr10 mb"><img src="' + instrumentLogoMap[val.instrument_id] + '" width="24" height="24" /></div>';
});
// followings
var followingHtml = '';
$.each(response.followings, function(index, val) {
if (index < 4) { // display max of 4 followings (NOTE: this only displays USER followings, not BAND followings)
if (index % 2 === 0) {
followingHtml += '<tr>';
}
followingHtml += '<td width="24"><a href="#" class="avatar-tiny"><img src="' + context.JK.resolveAvatarUrl(val.photo_url) + '" /></a></td>';
followingHtml += '<td><a href="/client#/profile/' + val.id + '"><strong>' + val.name + '</strong></a></td>';
if (index % 2 > 0) {
followingHtml += '</tr>';
}
}
});
var template = $('#template-hover-musician').html();
if (response.biography == null) {
response.biography = 'No Biography Available';
}
var sessionDisplayStyle = 'none';
var sessionId = '';
if (response.sessions !== undefined && response.sessions.length > 0) {
sessionDisplayStyle = 'block';
sessionId = response.sessions[0].id;
}
var musicianHtml = context.JK.fillTemplate(template, {
avatar_url: context.JK.resolveAvatarUrl(response.photo_url),
name: response.name,
location: response.location,
instruments: instrumentHtml,
friend_count: response.friend_count,
follower_count: response.follower_count,
recording_count: response.recording_count,
session_count: response.session_count,
session_display: sessionDisplayStyle,
session_id: sessionId,
biography: response.biography,
followings: response.followings && response.followings.length > 0 ? followingHtml : "<tr><td>N/A</td></tr>",
profile_url: "/client#/profile/" + response.id
});
$(hoverSelector).append('<h2>Musician Detail</h2>' + musicianHtml);
})
.fail(function(xhr) {
if(xhr.status >= 500) {
context.JK.fetchUserNetworkOrServerFailure();
}
else if(xhr.status == 404) {
context.JK.entityNotFound("User");
}
else {
context.JK.app.ajaxError(arguments);
}
});
};
this.hideBubble = function() {
$(hoverSelector).hide();
};
this.id = function() {
return hoverSelector;
};
}
})(window,jQuery);

View File

@ -0,0 +1,79 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.RecordingHoverBubble = function(recordingId, position) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var instrumentLogoMap = context.JK.getInstrumentIconMap24();
var hoverSelector = "#recording-hover";
this.showBubble = function() {
$(hoverSelector).css({left: position.left-100, top: position.top+20});
$(hoverSelector).fadeIn(500);
rest.getClaimedRecording(recordingId)
.done(function(response) {
var claimedRecording = response;
var recording = response.recording;
$(hoverSelector).html('');
// musicians
var musicianHtml = '';
$.each(recording.recorded_tracks, function(index, val) {
var instrumentHtml = '';
var musician = val.user;
musicianHtml += '<tr><td width="50"><a href="#" class="avatar-tiny"><img src="' + context.JK.resolveAvatarUrl(musician.photo_url) + '" /></a></td>';
musicianHtml += '<td width="75"><a href="#">' + musician.name + '</a></td>';
instrumentHtml = '<td><div class="nowrap">';
instrumentHtml += '<img src="' + instrumentLogoMap[val.instrument_id] + '" width="24" height="24" />&nbsp;';
instrumentHtml += '</div></td>';
musicianHtml += instrumentHtml;
musicianHtml += '</tr>';
});
var template = $('#template-hover-recording').html();
var creator = recording.band == null ? recording.owner : recording.band;
var recordingHtml = context.JK.fillTemplate(template, {
name: claimedRecording.name,
genre: claimedRecording.genre_id.toUpperCase(),
created_at: context.JK.formatDateTime(recording.created_at),
description: response.description,
play_count: recording.play_count,
comment_count: recording.comment_count,
like_count: recording.like_count,
creator_avatar_url: recording.band === null ? context.JK.resolveAvatarUrl(creator.photo_url) : context.JK.resolveBandAvatarUrl(creator.photo_url),
creator_name: creator.name,
location: creator.location,
musicians: musicianHtml
});
$(hoverSelector).append('<h2>Recording Detail</h2>' + 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);

View File

@ -0,0 +1,74 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
context.JK.SessionHoverBubble = function(sessionId, position) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var instrumentLogoMap = context.JK.getInstrumentIconMap24();
var hoverSelector = "#session-hover";
this.showBubble = function() {
$(hoverSelector).css({left: position.left-100, top: position.top+20});
$(hoverSelector).fadeIn(500);
rest.getSessionHistory(sessionId)
.done(function(response) {
$(hoverSelector).html('');
// musicians
var musicianHtml = '';
$.each(response.users, function(index, val) {
var instrumentHtml = '';
musicianHtml += '<tr><td width="50"><a href="#" class="avatar-tiny"><img src="' + context.JK.resolveAvatarUrl(val.user.photo_url) + '" /></a></td>';
musicianHtml += '<td width="75"><a href="#">' + val.user.name + '</a></td>';
instrumentHtml = '<td><div class="nowrap">';
var instruments = val.instruments.split("|");
$.each(instruments, function(index, instrument) {
instrumentHtml += '<img src="' + instrumentLogoMap[instrument] + '" width="24" height="24" />&nbsp;';
});
instrumentHtml += '</div></td>';
musicianHtml += instrumentHtml;
musicianHtml += '</tr>';
});
var template = $('#template-hover-session').html();
var sessionHtml = context.JK.fillTemplate(template, {
description: response.description,
genre: response.genres.toUpperCase(),
comment_count: response.comment_count,
like_count: response.like_count,
created_at: context.JK.formatDateTime(response.created_at),
musicians: musicianHtml
});
$(hoverSelector).append('<h2>Session Detail</h2>' + 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);

View File

@ -60,10 +60,10 @@
})
.fail(function(jqXHR) {
if(jqXHR.status >= 500) {
fetchUserNetworkOrServerFailure();
context.JK.fetchUserNetworkOrServerFailure();
}
else if(jqXHR.status == 404) {
fetchUserGone();
context.JK.entityNotFound("User");
}
else {
app.ajaxError(arguments);
@ -644,22 +644,6 @@
}
function fetchUserGone() {
app.notify({
title: "User Deleted",
text: "The user you are looking for is gone",
icon_url: "/assets/content/icon_alert_big.png"
})
}
function fetchUserNetworkOrServerFailure() {
app.notify({
title: "Unable to communicate with server",
text: "Please try again later",
icon_url: "/assets/content/icon_alert_big.png"
})
}
function bindFavorites() {
}

View File

@ -1,236 +1,254 @@
(function(context,$) {
"use strict";
"use strict";
context.JK = context.JK || {};
context.JK.SearchResultScreen = function(app) {
var logger = context.JK.logger;
context.JK = context.JK || {};
context.JK.SearchResultScreen = function(app) {
var logger = context.JK.logger;
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var instrument_logo_map = context.JK.getInstrumentIconMap24();
function initializeSearchNavLinks() {
$('.search-nav').click(function() {
$('.search-nav.active').removeClass('active');
$(this).addClass('active');
setTimeout(search, 100);
context.JK.Sidebar.searchTypeSelection($(this).data('search_text_type'));
});
}
function initializeSearchNavLinks() {
$('.search-nav').click(function() {
$('.search-nav.active').removeClass('active');
$(this).addClass('active');
setTimeout(search, 100);
context.JK.Sidebar.searchTypeSelection($(this).data('search_text_type'));
});
}
context.JK.SearchResultScreen.searchTypeSelection = function(typeSelection) {
$('.search-nav.active').removeClass('active');
$('.search-result-header a[data-search_text_type='+typeSelection+']').addClass('active');
}
context.JK.SearchResultScreen.searchTypeSelection = function(typeSelection) {
$('.search-nav.active').removeClass('active');
$('.search-result-header a[data-search_text_type='+typeSelection+']').addClass('active');
}
function beforeShow(data) {
var query = data.query;
}
function beforeShow(data) {
var query = data.query;
}
function afterShow(data) {
}
function afterShow(data) {
}
function selectedSearchType() {
var srchtype = $('.search-nav.active').data('search_text_type');
if (srchtype === undefined) {
srchtype = $('#search_text_type').val();
}
return srchtype;
}
function selectedSearchType() {
var srchtype = $('.search-nav.active').data('search_text_type');
if (srchtype === undefined) {
srchtype = $('#search_text_type').val();
}
return srchtype;
}
function search(evt) {
if (evt) {
evt.stopPropagation();
}
$('#search-results').empty();
var query = $('#search-input').val();
if (query) {
context.location = '/client#/searchResults/:' + query;
}
else {
query = $('#query').html();
}
function search(evt) {
if (evt) {
evt.stopPropagation();
}
$('#search-results').empty();
var query = $('#search-input').val();
if (query) {
context.location = '/client#/searchResults/:' + query;
} else {
query = $('#query').html();
}
if (query !== '') {
$('#query').html(query);
query += '&search_text_type='+selectedSearchType();
context.JK.search(query, app, context.JK.SearchResultScreen.onSearchSuccess);
}
else {
$('#result-count').html('');
$('#query').html('');
}
if (query !== '') {
$('#query').html(query);
query += '&search_text_type='+selectedSearchType();
context.JK.search(query, app, context.JK.SearchResultScreen.onSearchSuccess);
} else {
$('#result-count').html('');
$('#query').html('');
return false;
}
function resultDivVisibility(val, isSidebar) {
if (isSidebar) {
$('div[layout=sidebar user-id=' + val.id + '].sidebar-search-connected').hide();
$('div[layout=sidebar user-id=' + val.id + '].sidebar-search-result').show();
}
else {
$('div[user-id=' + val.id + '].search-connected').hide();
$('div[user-id=' + val.id + '].search-result').show();
}
}
context.JK.SearchResultScreen.onSearchSuccess = function(response) {
searchResults(response, true);
searchResults(response, false);
context.JK.bindHoverEvents();
}
function searchResults(response, isSidebar) {
var resultCount=0;
var selector, template_name;
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).html('');
if (response.search_type === 'musicians') {
resultCount = response.musicians.length;
// TODO: generalize this for each search result type (band, musician, et. al.)
template_name = isSidebar ? "#template-musicians-sidebar-search-result" : "#template-musicians-search-result";
$.each(response.musicians, function(index, val) {
// fill in template for Connect pre-click
var args = {
userId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
profile_url: "/client#/profile/" + val.id,
userName: val.name,
location: val.location,
instruments: getInstrumentHtml(val.instruments)
};
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(context.JK.fillTemplate($(template_name).html(), args));
// fill in template for Connect post-click
selector = isSidebar ? '#template-sidebar-invitation-sent' : '#template-invitation-sent';
var invitationSentHtml = context.JK.fillTemplate($(selector).html(), {
userId: val.id,
first_name: val.first_name,
profile_url: "/client#/profile/" + val.id
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(invitationSentHtml);
// wire up button click handler if search result is not a friend or the current use
if (isSidebar) {
var $sidebar = $('div[layout=sidebar] div[user-id=' + val.id + ']');
if (!val.is_friend && val.id !== context.JK.currentUserId) {
$sidebar.find('.btn-connect-friend').click(sendFriendRequest);
}
return false;
}
function resultDivVisibility(val, isSidebar) {
if (isSidebar) {
$('div[layout=sidebar user-id=' + val.id + '].sidebar-search-connected').hide();
$('div[layout=sidebar user-id=' + val.id + '].sidebar-search-result').show();
} else {
$('div[user-id=' + val.id + '].search-connected').hide();
$('div[user-id=' + val.id + '].search-result').show();
}
}
context.JK.SearchResultScreen.onSearchSuccess = function(response) {
searchResults(response, true);
searchResults(response, false);
}
function searchResults(response, isSidebar) {
var resultCount=0;
var selector, template_name;
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).html('');
if (response.search_type === 'musicians') {
resultCount = response.musicians.length;
// TODO: generalize this for each search result type (band, musician, et. al.)
template_name = isSidebar ? "#template-musicians-sidebar-search-result" : "#template-musicians-search-result";
$.each(response.musicians, function(index, val) {
// fill in template for Connect pre-click
var args = {
userId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
profile_url: "/client#/profile/" + val.id,
userName: val.name,
location: val.location,
instruments: getInstrumentHtml(val.instruments)
};
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(context.JK.fillTemplate($(template_name).html(), args));
// fill in template for Connect post-click
selector = isSidebar ? '#template-sidebar-invitation-sent' : '#template-invitation-sent';
var invitationSentHtml = context.JK.fillTemplate($(selector).html(), {
userId: val.id,
first_name: val.first_name,
profile_url: "/client#/profile/" + val.id
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(invitationSentHtml);
// wire up button click handler if search result is not a friend or the current use
if (isSidebar) {
var $sidebar = $('div[layout=sidebar] div[user-id=' + val.id + ']');
if (!val.is_friend && val.id !== context.JK.currentUserId) {
$sidebar.find('.btn-connect-friend').click(sendFriendRequest);
} else {
// hide the button if the search result is already a friend
$sidebar.find('.btn-connect-friend').hide();
}
} else {
if (!val.is_friend && val.id !== context.JK.currentUserId) {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').click(sendFriendRequest);
} else {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').hide();
}
}
resultDivVisibility(val, isSidebar);
});
} else if (response.search_type === 'bands') {
resultCount = response.bands.length;
template_name = isSidebar ? "#template-bands-sidebar-search-result" : "#template-bands-search-result";
$.each(response.bands, function(index, val) {
// fill in template for Connect pre-click
var searchResultHtml = context.JK.fillTemplate($(template_name).html(), {
bandId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
band_url: val.website,
bandName: val.name,
location: val.location
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(searchResultHtml);
resultDivVisibility(val, isSidebar);
});
} else if (response.search_type === 'fans') {
resultCount = response.fans.length;
template_name = isSidebar ? "#template-fans-sidebar-search-result" : "#template-fans-search-result";
$.each(response.fans, function(index, val) {
// fill in template for Connect pre-click
var searchResultHtml = context.JK.fillTemplate($(template_name).html(), {
userId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
profile_url: "/client#/profile/" + val.id,
userName: val.name,
location: val.location
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(searchResultHtml);
resultDivVisibility(val, isSidebar);
});
else {
// hide the button if the search result is already a friend
$sidebar.find('.btn-connect-friend').hide();
}
if (isSidebar) {
// show header
$('#sidebar-search-header').show();
// hide panels
$('[layout-panel="contents"]').hide();
$('[layout-panel="contents"]').css({"height": "1px"});
// resize search results area
$('#sidebar-search-results').height(context.JK.Sidebar.getHeight() + 'px');
} else {
$('#result-count').html(resultCount);
if (resultCount === 1) {
$('#result-count').append(" Result for: ");
} else {
$('#result-count').append(" Results for: ");
}
}
};
function friendRequestCallbackSidebar(userId) {
// toggle the pre-click and post-click divs
$('div[layout=sidebar] div[user-id=' + userId + '].sidebar-search-connected').show();
$('div[layout=sidebar] div[user-id=' + userId + '].sidebar-search-result').hide();
}
function friendRequestCallbackSearchResults(userId) {
// toggle the pre-click and post-click divs
$('div[user-id=' + userId + '].search-connected').show();
$('div[user-id=' + userId + '].search-result').hide();
}
function sendFriendRequest(evt) {
evt.stopPropagation();
var userId = $(this).parent().attr('user-id');
if ($(this).closest('#sidebar-search-results')) {
context.JK.sendFriendRequest(app, userId, friendRequestCallbackSidebar);
} else {
context.JK.sendFriendRequest(app, userId, friendRequestCallbackSearchResults);
}
}
function getInstrumentHtml(instruments) {
var instrumentLogoHtml = '';
if (instruments !== undefined) {
for (var i=0; i < instruments.length; i++) {
var inst = '../assets/content/icon_instrument_default24.png';
if (instruments[i].instrument_id in instrument_logo_map) {
inst = instrument_logo_map[instruments[i].instrument_id];
instrumentLogoHtml += '<img src="' + inst + '" width="24" height="24" />&nbsp;';
}
}
}
else {
if (!val.is_friend && val.id !== context.JK.currentUserId) {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').click(sendFriendRequest);
}
return instrumentLogoHtml;
else {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').hide();
}
}
resultDivVisibility(val, isSidebar);
});
}
else if (response.search_type === 'bands') {
resultCount = response.bands.length;
template_name = isSidebar ? "#template-bands-sidebar-search-result" : "#template-bands-search-result";
$.each(response.bands, function(index, val) {
// fill in template for Connect pre-click
var searchResultHtml = context.JK.fillTemplate($(template_name).html(), {
bandId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
band_url: val.website,
bandName: val.name,
location: val.location
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(searchResultHtml);
resultDivVisibility(val, isSidebar);
});
}
else if (response.search_type === 'fans') {
resultCount = response.fans.length;
template_name = isSidebar ? "#template-fans-sidebar-search-result" : "#template-fans-search-result";
$.each(response.fans, function(index, val) {
// fill in template for Connect pre-click
var searchResultHtml = context.JK.fillTemplate($(template_name).html(), {
userId: val.id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
profile_url: "/client#/profile/" + val.id,
userName: val.name,
location: val.location
});
selector = isSidebar ? '#sidebar-search-results' : '#search-results';
$(selector).append(searchResultHtml);
resultDivVisibility(val, isSidebar);
});
}
if (isSidebar) {
// show header
$('#sidebar-search-header').show();
// hide panels
$('[layout-panel="contents"]').hide();
$('[layout-panel="contents"]').css({"height": "1px"});
// resize search results area
$('#sidebar-search-results').height(context.JK.Sidebar.getHeight() + 'px');
}
else {
$('#result-count').html(resultCount);
if (resultCount === 1) {
$('#result-count').append(" Result for: ");
}
function events() {
$('#searchForm').submit(search);
else {
$('#result-count').append(" Results for: ");
}
}
}
this.initialize = function() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
};
app.bindScreen('searchResults', screenBindings);
events();
initializeSearchNavLinks();
};
function friendRequestCallbackSidebar(userId) {
// toggle the pre-click and post-click divs
$('div[layout=sidebar] div[user-id=' + userId + '].sidebar-search-connected').show();
$('div[layout=sidebar] div[user-id=' + userId + '].sidebar-search-result').hide();
}
function friendRequestCallbackSearchResults(userId) {
// toggle the pre-click and post-click divs
$('div[user-id=' + userId + '].search-connected').show();
$('div[user-id=' + userId + '].search-result').hide();
}
function sendFriendRequest(evt) {
evt.stopPropagation();
var userId = $(this).parent().attr('user-id');
if ($(this).closest('#sidebar-search-results')) {
context.JK.sendFriendRequest(app, userId, friendRequestCallbackSidebar);
}
else {
context.JK.sendFriendRequest(app, userId, friendRequestCallbackSearchResults);
}
}
function getInstrumentHtml(instruments) {
var instrumentLogoHtml = '';
if (instruments !== undefined) {
for (var i=0; i < instruments.length; i++) {
var inst = '../assets/content/icon_instrument_default24.png';
if (instruments[i].instrument_id in instrument_logo_map) {
inst = instrument_logo_map[instruments[i].instrument_id];
instrumentLogoHtml += '<img src="' + inst + '" width="24" height="24" />&nbsp;';
}
}
}
return instrumentLogoHtml;
}
function events() {
$('#searchForm').submit(search);
}
this.initialize = function() {
var screenBindings = {
'beforeShow': beforeShow,
'afterShow': afterShow
};
app.bindScreen('searchResults', screenBindings);
events();
initializeSearchNavLinks();
};
}
})(window,jQuery);

View File

@ -408,10 +408,6 @@
}
}
function clearTextFields() {
}
function beforeShow() {
disableTwitter();
// no disableFacebook on purpose
@ -484,7 +480,7 @@
registerEvents(false);
}
function initialize(_facebookHelper){
function initialize(_facebookHelper) {
facebookHelper = _facebookHelper;
var dialogBindings = {
@ -498,11 +494,11 @@
initDialog();
facebookHelper.deferredLoginStatus().done(function(response) { handleFbStateChange(response); });
};
}
this.initialize = initialize;
this.showDialog = showDialog;
}
return this;
})(window,jQuery)
})(window,jQuery);

File diff suppressed because it is too large Load Diff

View File

@ -141,6 +141,100 @@
$element.bt(text, options);
}
context.JK.bindHoverEvents = function() {
function showBubble(bubble, $hoverElement) {
$hoverElement.attr("bubble-id", bubble.id);
bubble.showBubble();
}
function hideBubble($hoverElement) {
var bubbleSelector = $hoverElement.attr("bubble-id");
$(bubbleSelector).hover(
function() {
// do nothing when entering the bubble (this should never happen)
},
function() {
$(this).fadeOut(500);
}
);
}
// MUSICIAN
$("[hoveraction='musician']").hoverIntent({
over: function() {
var bubble = new JK.MusicianHoverBubble($(this).attr('user-id'), $(this).offset());
showBubble(bubble, $(this));
},
out: function() { // this registers for leaving the hoverable element
hideBubble($(this));
},
sensitivity: 1
});
// FAN
$("[hoveraction='fan']").hover(
function() {
var bubble = new JK.FanHoverBubble($(this).attr('user-id'), $(this).offset());
showBubble(bubble, $(this));
},
function() { // this registers for leaving the hoverable element
hideBubble($(this));
}
);
// BAND
$("[hoveraction='band']").hoverIntent({
over: function() {
var bubble = new JK.BandHoverBubble($(this).attr('band-id'), $(this).offset());
showBubble(bubble, $(this));
},
out: function() { // this registers for leaving the hoverable element
hideBubble($(this));
},
sensitivity: 1
});
// SESSION
$("[hoveraction='session']").hover(
function() {
var bubble = new JK.SessionHoverBubble($(this).attr('session-id'), $(this).offset());
showBubble(bubble, $(this));
},
function() { // this registers for leaving the hoverable element
hideBubble($(this));
}
);
// RECORDING
$("[hoveraction='recording']").hover(
function() {
var bubble = new JK.RecordingHoverBubble($(this).attr('recording-id'), $(this).offset());
showBubble(bubble, $(this));
},
function() { // this registers for leaving the hoverable element
hideBubble($(this));
}
);
}
context.JK.fetchUserNetworkOrServerFailure = function() {
app.notify({
title: "Unable to communicate with server",
text: "Please try again later",
icon_url: "/assets/content/icon_alert_big.png"
});
}
context.JK.entityNotFound = function(type) {
app.notify({
title: type + " Deleted",
text: "The " + type + " no longer exists.",
icon_url: "/assets/content/icon_alert_big.png"
});
}
// Uber-simple templating
// var template = "Hey {name}";
// var vals = { name: "Jon" };
@ -248,7 +342,7 @@
context.JK.formatDateTime = function(dateString) {
var date = new Date(dateString);
return date.getFullYear() + "-" + context.JK.padString(date.getMonth()+1, 2) + "-" + context.JK.padString(date.getDate(), 2) + " @ " + date.toLocaleTimeString();
return context.JK.padString(date.getMonth()+1, 2) + "/" + context.JK.padString(date.getDate(), 2) + "/" + date.getFullYear() + " - " + date.toLocaleTimeString();
}
// returns Fri May 20, 2013
@ -679,7 +773,7 @@
if(context.JK.CurrentSessionModel.recordingModel.isRecording()) {
app.notify({
title: "Currently Recording",
text: "Tracks can not be modified while recording.",
text: "Tracks cannot be modified while recording.",
icon_url: "/assets/content/icon_alert_big.png"});
return false;
}

View File

@ -15,6 +15,11 @@
//= require web/signupDialog
//= require web/signinDialog
//= require invitationDialog
//= require hoverMusician
//= require hoverFan
//= require hoverBand
//= require hoverSession
//= require hoverRecording
//= require shareDialog
//= require layout
//= require user_dropdown

View File

@ -124,8 +124,10 @@
box-shadow: none !important;
color: #666666;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
-moz-box-sizing:border-box;
}
}

View File

@ -66,6 +66,9 @@
.content-body {
height:100%;
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding-top: 29px;
@ -96,21 +99,33 @@
.filter-body {
height:100%;
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding-top: 49px;
}
.profile-head {
position: absolute;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
width:100%;
}
.profile-body {
height:100%;
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding-top: 157px;
> * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
}
}
@ -130,6 +145,9 @@
width:100%;
padding:0 25px;
line-height:25px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
+.profile-wrapper {
@ -139,6 +157,9 @@
.profile-social-body {
height:100%;
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
padding-top:25px;
.profile-social-body-wrapper {
@ -192,7 +213,7 @@
.content-wrapper, .dialog, .dialog-inner, .ftue-inner {
select, textarea, input[type=text], input[type=password], div.friendbox {
select, textarea, input[type=text], input[type=password], div.friendbox {
font-family:"Raleway", arial, sans-serif;
background-color:#c5c5c5;
border:none;

View File

@ -0,0 +1,72 @@
.bubble {
width:350px;
min-height:200px;
background-color:#242323;
border:solid 1px #ed3618;
position:absolute;
z-index:999;
}
.bubble h2 {
padding:6px 0px;
text-align:center;
font-size:15px;
font-weight:200;
width:100%;
background-color:#ed3618;
}
.bubble h3 {
font-weight:400;
font-size:16px;
color:#fff;
}
.bubble-inner {
padding:10px;
color:#ccc;
}
.bubble-inner div.mb {
margin-bottom:5px;
}
strong {
font-weight:600 !important;
}
.musicians {
margin-top:-3px;
font-size:11px;
}
.musicians td {
border-right:none;
border-top:none;
padding:3px;
vertical-align:middle;
}
.musicians a {
color:#fff;
text-decoration:none;
}
.avatar-tiny {
float:left;
padding:1px;
width:24px;
height:24px;
background-color:#ed3618;
-webkit-border-radius:12px;
-moz-border-radius:12px;
border-radius:12px;
}
.avatar-tiny img {
width: 24px;
height: 24px;
-webkit-border-radius:12px;
-moz-border-radius:12px;
border-radius:12px;
}

View File

@ -202,6 +202,9 @@
position:relative;
margin:10px 0px 10px 0px;
padding-bottom:5px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
.result-name {

View File

@ -10,6 +10,9 @@
z-index:-1;
.recording-manager-command {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
width:33%;
margin:5px 10px;

View File

@ -51,6 +51,9 @@
}
input[type=text], input[type=password]{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
}

View File

@ -195,7 +195,7 @@ class ApiMusicSessionsController < ApiController
# example of using curl to access this API:
# curl -L -T some_file -X PUT http://localhost:3000/api/sessions/[SESSION_ID]/perf.json?client_id=[CLIENT_ID]
music_session_history = MusicSessionHistory.find_by_music_session_id(params[:id])
music_session_history = MusicSessionHistory.find(params[:id])
msuh = MusicSessionUserHistory.find_by_client_id(params[:client_id])
@perfdata = MusicSessionPerfData.new
@ -293,7 +293,7 @@ class ApiMusicSessionsController < ApiController
end
def history_show
@history = MusicSessionHistory.find_by_music_session_id(params[:id])
@history = MusicSessionHistory.find(params[:id])
end
def claimed_recording_start

View File

@ -553,7 +553,7 @@ class ApiUsersController < ApiController
def share_session
provider = params[:provider]
music_session_id = params[:music_session]
history = MusicSessionHistory.find_by_music_session_id!(music_session_id)
history = MusicSessionHistory.find!(music_session_id)
if provider == 'facebook'

View File

@ -3,7 +3,7 @@ class MusicSessionsController < ApplicationController
respond_to :html
def show
@music_session = MusicSessionHistory.find_by_music_session_id(params[:id])
@music_session = MusicSessionHistory.find(params[:id])
render :layout => "web"
end

View File

@ -3,9 +3,9 @@ object @band
attributes :id, :name, :city, :state, :country, :location, :website, :biography, :photo_url, :logo_url, :liker_count, :follower_count, :recording_count, :session_count,
:original_fpfile_photo, :cropped_fpfile_photo, :crop_selection_photo
unless @band.users.nil? || @band.users.size == 0
unless @band.users.blank?
child :users => :musicians do
attributes :id, :first_name, :last_name, :photo_url
attributes :id, :first_name, :last_name, :name, :photo_url
# TODO: figure out how to omit empty arrays
node :instruments do |user|
@ -18,7 +18,7 @@ unless @band.users.nil? || @band.users.size == 0
end
end
unless @band.genres.nil? || @band.genres.size == 0
unless @band.genres.blank?
child :genres => :genres do
attributes :id, :description
#partial('api_genres/index', :object => @band.genres)

View File

@ -16,11 +16,11 @@ child(:recording => :recording) {
attributes :id, :created_at, :duration, :comment_count, :like_count, :play_count
child(:band => :band) {
attributes :id, :name, :photo_url
attributes :id, :name, :location, :photo_url
}
child(:owner => :owner) {
attributes :id, :name, :photo_url
attributes :id, :name, :location, :photo_url
}
child(:mixes => :mixes) {
@ -43,7 +43,7 @@ child(:recording => :recording) {
end
child(:user => :user) {
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :photo_url
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :photo_url
}
}

View File

@ -1,6 +1,6 @@
object @history
attributes :music_session_id, :description, :genres
attributes :id, :music_session_id, :description, :genres, :like_count, :comment_count, :created_at
node :share_url do |history|
unless history.share_token.nil?

View File

@ -1,3 +1,3 @@
object @user.friends
attributes :id, :first_name, :last_name, :name, :location, :city, :state, :country, :email, :online, :photo_url
attributes :id, :first_name, :last_name, :name, :location, :city, :state, :country, :musician, :email, :online, :photo_url

View File

@ -21,25 +21,27 @@ elsif current_user
end
end
unless @user.friends.nil? || @user.friends.size == 0
child :friends => :friends do
attributes :id, :first_name, :last_name, :online
child :friends => :friends do
attributes :id, :first_name, :last_name, :name, :online, :photo_url
end
child :followings => :followings do
attributes :id, :first_name, :last_name, :name, :online, :photo_url
end
child :band_musicians => :bands do
attributes :id, :name, :admin, :photo_url, :logo_url
child :genres => :genres do
attributes :id, :description
#partial('api_genres/index', :object => @user.bands.genres)
end
end
unless @user.bands.nil? || @user.bands.size == 0
child :band_musicians => :bands do
attributes :id, :name, :admin, :photo_url, :logo_url
child :genres => :genres do
attributes :id, :description
#partial('api_genres/index', :object => @user.bands.genres)
end
end
child :musician_instruments => :instruments do
attributes :description, :proficiency_level, :priority, :instrument_id
end
unless @user.instruments.nil? || @user.instruments.size == 0
child :musician_instruments => :instruments do
attributes :description, :proficiency_level, :priority, :instrument_id
end
child :music_sessions => :sessions do
attributes :id, :description, :musician_access, :approval_required, :fan_access
end

View File

@ -1,4 +1,4 @@
<!-- Profile -->
<!-- Band Profile -->
<div layout="screen" layout-id="bandProfile" layout-arg="id" class="screen secondary">
<div class="content-head">
<div class="content-icon">

View File

@ -30,7 +30,7 @@
<div class="right mband-players" style="width:250px;margin-top:-10px;">
<table class="musicians" cellpadding="0" cellspacing="5">{band_player_template}</table>
</div>
<div class="" style="margin-left: 63px; margin-right: 260px;margin-top: 12px;"">
<div class="" style="margin-left: 63px; margin-right: 260px;margin-top: 12px;">
<div class="first-row" data-hint="top-row">
<div class="lcol left">
<!-- name & location -->
@ -67,8 +67,12 @@
<script type="text/template" id="template-band-player-info">
<tr>
<td ><a href="{profile_url}" class="avatar-tiny"><img src="{avatar_url}" /></a></td>
<td style="padding: 0 4px;width:88px;"><a href="{profile_url}"><strong>{player_name}</strong></a></td>
<td>
<a href="{profile_url}" user-id="{user_id}" hoveraction="musician" class="avatar-tiny"><img src="{avatar_url}" /></a>
</td>
<td style="padding: 0 4px;width:88px;">
<a user-id="{user_id}" hoveraction="musician" href="{profile_url}"><strong>{player_name}</strong></a>
</td>
<td class="instruments">{player_instruments}</td>
</tr>
</script>

View File

@ -1,52 +1,31 @@
<!-- band hover -->
<div id="band-detail-1" class="hidden bubble">
<h2>Band Detail</h2>
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="images/content/avatar_band3.jpg" /></a>
<div class="left"><h3>Fox Force Five</h3>
<small>Richmond, VA<br />
<strong>Jazz</strong></small><br />
12 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;64 <img src="images/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
</div>
<br clear="all" /><br />
<div class="f11">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.</div>
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">PROFILE</a></div>
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
<div id="band-hover" class="hidden bubble">
</div>
</div>
<script type="text/template" id="template-hover-bubble">
<div class="hover-bubble">
<script type="text/template" id="template-hover-band">
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="{avatar_url}" /></a>
<div class="left">
<h3>{name}</h3>
<small>{location}<br /><strong>{genres}</strong></small><br />
<br clear="all" />
{like_count} <img src="/assets/content/icon_like.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{follower_count} <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
</div>
<br clear="all" /><br />
<br />
<div class="f11">{biography}</div><br />
<table class="musicians" cellpadding="0" cellspacing="5">
{musicians}
</table>
<br />
<div align="center">
<div class="left"><a href="{profile_url}" class="button-orange">PROFILE</a></div>
<div class="left"><a class="button-orange">LIKE</a></div>
<div class="left"><a class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</script>

View File

@ -1,232 +1,3 @@
<!-- band hover -->
<div id="band-detail-1" class="hidden bubble">
<h2>Band Detail</h2>
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="images/content/avatar_band3.jpg" /></a>
<div class="left"><h3>Fox Force Five</h3>
<small>Richmond, VA<br />
<strong>Jazz</strong></small><br />
12 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;64 <img src="images/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
</div>
<br clear="all" /><br />
<div class="f11">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.</div>
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">PROFILE</a></div>
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</div>
<!-- musician hover -->
<div id="musician-detail-1" class="hidden bubble">
<h2>Musician Detail</h2>
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="images/shared/avatar_david.jpg" /></a>
<div class="left ib"><h3>John Doe</h3>
<small>Austin, TX</small><br /><br />
<div class="left mr10 mb"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></div>
<div class="left mr10"><img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div>
<div class="left mr10"><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></div>
<br clear="all" />
122 <img src="images/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;64 <img src="images/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" /></div><br clear="all" /><br />
<div class="f12"><strong>IN SESSION &mdash; <a href="#">Click to Join</a></strong></div>
<br />
<div class="f11">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.</div><br />
<small><strong>FOLLOWING:</strong></small>
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band3.jpg" /></a></td>
<td><a href="#"><strong>Fox Force Five</strong></a></td>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band1.jpg" /></a></td>
<td><a href="#"><strong>Tammany Hall</strong></a></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band2.jpg" /></a></td>
<td><a href="#"><strong>Bethany Grey</strong></a></td>
<td></td>
<td></td>
</tr>
</table><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">PROFILE</a></div>
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">FRIEND</a></div>
<div class="left"><a href="#" class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</div>
<!-- fan hover -->
<div id="fan-detail-1" class="hidden bubble">
<h2>Fan Detail</h2>
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="images/shared/avatar_creepyeye.jpg" /></a>
<div class="left ib"><h3>Tomas Jones</h3>
<small>Austin, TX</small><br /><br />
122 <img src="images/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_followers.png" width="22" height="12" align="absmiddle" /></div><br clear="all" /><br />
<br />
<div class="f11">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.</div><br />
<small><strong>FOLLOWING:</strong></small>
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band3.jpg" /></a></td>
<td><a href="#"><strong>Fox Force Five</strong></a></td>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#"><strong>Bob Scrothers</strong></a></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band2.jpg" /></a></td>
<td><a href="#"><strong>Bethany Grey</strong></a></td>
<td></td>
<td></td>
</tr>
</table><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">PROFILE</a></div>
<div class="left"><a href="#" class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</div>
<!-- session hover -->
<div id="session-detail-1" class="hidden bubble">
<h2>Session Detail</h2>
<div class="bubble-inner">
<div class="small left">JAZZ</div>
<div class="small right">01/25/14 - 11:23 pm</div>
<br clear="all" />
<div class="f11 mt5 mb5">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.</div>
<div class="small">12 <img src="images/content/icon_arrow.png" width="7" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_comment.png" width="13" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" /></div><br />
MUSICIANS:
<!-- sub-table of musicians -->
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
</div>
</div>
<!-- recording hover -->
<div id="recording-detail-1" class="hidden bubble">
<h2>Recording Detail</h2>
<div class="bubble-inner">
<h3>Twelve Weeks</h3>
<div class="small left">JAZZ</div>
<div class="small right">01/25/14 - 11:23 pm</div>
<br clear="all" />
<div class="f11 mt5 mb5">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.</div>
<div class="small">12 <img src="images/content/icon_arrow.png" width="7" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_comment.png" width="13" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" /><br />
<br />
<a href="#" class="avatar_large left mr20"><img src="images/content/avatar_band3.jpg" /></a>
<div class="left"><h3>Fox Force Five</h3>
<small>Richmond, VA</small></div>
<br clear="all" /><br />
MUSICIANS:
<!-- sub-table of musicians -->
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
</div>
</div>
</div>
<script type="text/template" id="template-hover-bubble">
<div class="hover-bubble">

View File

@ -1,46 +1,27 @@
<!-- fan hover -->
<div id="fan-detail-1" class="hidden bubble">
<h2>Fan Detail</h2>
<div id="fan-hover" class="hidden bubble">
</div>
<script type="text/template" id="template-hover-fan">
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="images/shared/avatar_creepyeye.jpg" /></a>
<div class="left ib"><h3>Tomas Jones</h3>
<small>Austin, TX</small><br /><br />
122 <img src="images/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_followers.png" width="22" height="12" align="absmiddle" /></div><br clear="all" /><br />
<br />
<div class="f11">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.</div><br />
<small><strong>FOLLOWING:</strong></small>
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band3.jpg" /></a></td>
<td><a href="#"><strong>Fox Force Five</strong></a></td>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#"><strong>Bob Scrothers</strong></a></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/content/avatar_band2.jpg" /></a></td>
<td><a href="#"><strong>Bethany Grey</strong></a></td>
<td></td>
<td></td>
</tr>
</table><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">PROFILE</a></div>
<div class="left"><a href="#" class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</div>
<script type="text/template" id="template-hover-bubble">
<div class="hover-bubble">
<a href="#" class="avatar_large left mr20"><img src="{avatar_url}" /></a>
<div class="left ib">
<h3>{name}</h3>
<small>{location}</small><br /><br />
{friend_count} <img src="/assets/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{follower_count} <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />
</div>
<br clear="all" /><br />
<div class="f11">{biography}</div><br />
<small><strong>FOLLOWING:</strong></small><br /><br />
<table class="musicians" cellpadding="0" cellspacing="5">
{followings}
</table>
<br />
<div align="center">
<div class="left"><a href="{profile_url}" class="button-orange">PROFILE</a></div>
<div class="left"><a class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</script>

View File

@ -0,0 +1,35 @@
<div id="musician-hover" class="hidden bubble">
</div>
<script type="text/template" id="template-hover-musician">
<div class="bubble-inner">
<a href="#" class="avatar_large left mr20"><img src="{avatar_url}" /></a>
<div class="left ib">
<h3>{name}</h3>
<small>{location}</small><br /><br />
{instruments}
<br clear="all" />
{friend_count} <img src="/assets/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{follower_count} <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
</div>
<br clear="all" /><br />
<div style="display:{session_display}" class="f12"><strong>IN SESSION &mdash; <a href="/client#/session/{session_id}">Click to Join</a></strong></div>
<br />
<div class="f11">{biography}</div><br />
<small><strong>FOLLOWING:</strong></small><br /><br />
<table class="musicians" cellpadding="0" cellspacing="5">
{followings}
</table>
<br />
<div align="center">
<div class="left"><a href="{profile_url}" class="button-orange">PROFILE</a></div>
<div class="left"><a class="button-orange">LIKE</a></div>
<div class="left"><a class="button-orange">FRIEND</a></div>
<div class="left"><a class="button-orange">FOLLOW</a></div>
</div>
<br /><br />
</div>
</script>

View File

@ -1,55 +1,36 @@
<!-- recording hover -->
<div id="recording-detail-1" class="hidden bubble">
<h2>Recording Detail</h2>
<div class="bubble-inner">
<h3>Twelve Weeks</h3>
<div class="small left">JAZZ</div>
<div class="small right">01/25/14 - 11:23 pm</div>
<br clear="all" />
<div class="f11 mt5 mb5">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.</div>
<div class="small">12 <img src="images/content/icon_arrow.png" width="7" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_comment.png" width="13" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" /><br />
<br />
<a href="#" class="avatar_large left mr20"><img src="images/content/avatar_band3.jpg" /></a>
<div class="left"><h3>Fox Force Five</h3>
<small>Richmond, VA</small></div>
<br clear="all" /><br />
MUSICIANS:
<!-- sub-table of musicians -->
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
<div id="recording-hover" class="hidden bubble">
</div>
</div>
</div>
<script type="text/template" id="template-hover-bubble">
<div class="hover-bubble">
<script type="text/template" id="template-hover-recording">
<div class="bubble-inner">
<h3>{name}</h3>
<div class="small left">{genre}</div>
<div class="small right">{created_at}</div>
<br clear="all" />
<div class="f11 mt5 mb5">{description}</div>
<div class="small">
{play_count} <img src="/assets/content/icon_arrow.png" width="7" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;
{comment_count} <img src="/assets/content/icon_comment.png" width="13" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;
{like_count} <img src="/assets/content/icon_like.png" width="12" height="12" align="absmiddle" />
</div>
<br /><br />
<a href="#" class="avatar_large left mr20"><img src="{creator_avatar_url}" /></a>
<div class="left">
<h3>{creator_name}</h3>
<small>{location}</small>
</div>
<br clear="all" /><br />
MUSICIANS:<br /><br />
<table class="musicians" cellpadding="0" cellspacing="5">
{musicians}
</table>
<br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
</div>
</script>

View File

@ -1,49 +1,28 @@
<!-- session hover -->
<div id="session-detail-1" class="hidden bubble">
<h2>Session Detail</h2>
<div class="bubble-inner">
<div class="small left">JAZZ</div>
<div class="small right">01/25/14 - 11:23 pm</div>
<br clear="all" />
<div class="f11 mt5 mb5">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.</div>
<div class="small">12 <img src="images/content/icon_arrow.png" width="7" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;4 <img src="images/content/icon_comment.png" width="13" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;17 <img src="images/content/icon_like.png" width="12" height="12" align="absmiddle" /></div><br />
MUSICIANS:
<!-- sub-table of musicians -->
<table class="musicians" cellpadding="0" cellspacing="5">
<tr>
<td width="24"><a href="#" class="avatar-tiny" id="musician1"><img src="images/shared/avatar_david.jpg" /></a></td>
<td><a href="#">John Doe</a></td>
<td><div class="nowrap"><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" />&nbsp;<img src="images/content/icon_instrument_vocal24.png" width="24" height="24" /></div></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_creepyeye.jpg" /></a></td>
<td><a href="#">Cassandra Defrenza</a></td>
<td><img src="images/content/icon_instrument_keyboard24.png" width="24" height="24" /></td>
</tr>
<tr>
<td width="24"><a href="#" class="avatar-tiny"><img src="images/shared/avatar_silverfox.jpg" /></a></td>
<td><a href="#">Jimmy Stratham</a></td>
<td><img src="images/content/icon_instrument_guitar24.png" width="24" height="24" /></td>
</tr>
</table><br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
<div id="session-hover" class="hidden bubble">
</div>
</div>
<script type="text/template" id="template-hover-bubble">
<div class="hover-bubble">
<script type="text/template" id="template-hover-session">
<div class="bubble-inner">
<div class="small left">{genre}</div>
<div class="small right">{created_at}</div>
<br clear="all" />
<div class="f11 mt5 mb5">{description}</div>
<div class="small">
{comment_count} <img src="/assets/content/icon_comment.png" width="13" height="12" align="absmiddle" style="vertical-align:middle;" />&nbsp;&nbsp;&nbsp;
{like_count} <img src="/assets/content/icon_like.png" width="12" height="12" align="absmiddle" style="vertical-align:middle;" />
</div>
<br />
MUSICIANS:<br /><br />
<table class="musicians" cellpadding="0" cellspacing="5">
{musicians}
</table>
<br /><br />
<div align="center">
<div class="left"><a href="#" class="button-orange">LIKE</a></div>
<div class="left"><a href="#" class="button-orange">COMMENT</a></div>
<div class="left"><a href="#" class="button-orange">SHARE</a></div>
</div>
<br /><br />
</div>
</script>

View File

@ -20,7 +20,7 @@
<% end -%>
<!-- Session Row Template -->
<script type="text/template" id="template-find-musician-row"><!-- -->
<script type="text/template" id="template-find-musician-row">
<div class="profile-band-list-result musician-list-result">
<div class="f11" data-hint="container">
<div class="left" style="width:63px;margin-top:-12px;">
@ -31,7 +31,7 @@
<div class="bold">FOLLOWING:</div>
<table class="musicians" cellpadding="0" cellspacing="5">{musician_follow_template}</table>
</div>
<div class="" style="margin-left: 63px; margin-right: 130px;margin-top: 12px;"">
<div class="" style="margin-left: 63px; margin-right: 130px;margin-top: 12px;">
<div class="first-row" data-hint="top-row">
<div class="lcol left">
<!-- name & location -->
@ -74,10 +74,10 @@
<script type="text/template" id="template-musician-follow-info">
<tr>
<td width="32">
<a href="{profile_url}" class="avatar-tiny"><img src="{avatar_url}" /></a>
<a user-id="{user_id}" hoveraction="musician" href="{profile_url}" class="avatar-tiny"><img src="{avatar_url}" /></a>
</td>
<td>
<a href="{profile_url}"><strong>{musician_name}</strong></a>
<a user-id="{user_id}" hoveraction="musician" href="{profile_url}"><strong>{musician_name}</strong></a>
</td>
</tr>
</script>

View File

@ -25,8 +25,11 @@
<script type="text/template" id="template-musicians-search-result">
<div user-id="{userId}" class="search-result">
<a href="#" class="avatar-small"><img src="{avatar_url}" /></a>
<div class="search-result-name"><a href="{profile_url}">{userName}</a><br />
<a href="#" user-id="{userId}" hoveraction="musician" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="search-result-name">
<a user-id="{userId}" hoveraction="musician" href="{profile_url}">{userName}</a><br />
<span class="search-result-location">{location}</span>
</div>
<br clear="left" />
@ -37,6 +40,32 @@
</div>
</script>
<script type="text/template" id="template-fans-search-result">
<div user-id="{userId}" class="search-result">
<a user-id="{userId}" hoveraction="fan" href="#" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="search-result-name">
<a user-id="{userId}" hoveraction="fan" href="{profile_url}">{userName}</a><br />
<span class="search-result-location">{location}</span>
</div>
<br clear="left" />
</div>
</script>
<script type="text/template" id="template-bands-search-result">
<div user-id="{bandId}" class="search-result">
<a band-id="{bandId}" hoveraction="band" href="#" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="search-result-name">
<a band-id="{bandId}" hoveraction="band" href="{band_url}">{bandName}</a><br />
<span class="search-result-location">{location}</span>
</div>
<br clear="left" />
</div>
</script>
<script type="text/template" id="template-invitation-sent">
<div user-id="{userId}" class="search-connected">
<div style="margin-top:10px;">
@ -49,23 +78,3 @@
</div>
</script>
<script type="text/template" id="template-bands-search-result">
<div user-id="{bandId}" class="search-result">
<a href="#" class="avatar-small"><img src="{avatar_url}" /></a>
<div class="search-result-name"><a href="{band_url}">{bandName}</a><br />
<span class="search-result-location">{location}</span>
</div>
<br clear="left" />
</div>
</script>
<script type="text/template" id="template-fans-search-result">
<div user-id="{userId}" class="search-result">
<a href="#" class="avatar-small"><img src="{avatar_url}" /></a>
<div class="search-result-name"><a href="{profile_url}">{userName}</a><br />
<span class="search-result-location">{location}</span>
</div>
<br clear="left" />
</div>
</script>

View File

@ -134,26 +134,37 @@
<!-- Search result template -->
<script type="text/template" id="template-musicians-sidebar-search-result">
<div user-id="{userId}" class="sidebar-search-result">
<a class="avatar-small"><img src="{avatar_url}" /></a>
<div class="result-name"><a href="{profile_url}">{userName}</a><br />
<a user-id="{userId}" hoveraction="musician" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="result-name">
<a user-id="{userId}" hoveraction="musician" href="{profile_url}">{userName}</a><br />
<span class="result-location">{location}</span>
</div><br />
<a class="btn-connect-friend button-orange smallbutton right">CONNECT</a>
<br clear="all" />
</div>
</script>
<script type="text/template" id="template-bands-sidebar-search-result">
<div band-id="{bandId}" class="sidebar-search-result">
<a class="avatar-small"><img src="{avatar_url}" /></a>
<div class="result-name"><a href="{band_url}">{bandName}</a><br />
<a band-id="{bandId}" hoveraction="band" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="result-name">
<a band-id="{bandId}" hoveraction="band" href="{band_url}">{bandName}</a><br />
<span class="result-location">{location}</span>
</div><br />
</div>
</script>
<script type="text/template" id="template-fans-sidebar-search-result">
<div user-id="{userId}" class="sidebar-search-result">
<a class="avatar-small"><img src="{avatar_url}" /></a>
<div class="result-name"><a href="{profile_url}">{userName}</a><br />
<a user-id="{userId}" hoveraction="fan" class="avatar-small">
<img src="{avatar_url}" />
</a>
<div class="result-name">
<a user-id="{userId}" hoveraction="fan" href="{profile_url}">{userName}</a><br />
<span class="result-location">{location}</span>
</div><br />
<br clear="all" />
@ -162,7 +173,7 @@
<!-- Friend panel template -->
<script type="text/template" id="template-friend-panel">
<li class="{cssClass}">
<li class="{cssClass}" user-id="{userId}" hoveraction="{hoverAction}" >
<div class="avatar-small"><img src="{avatar_url}" /></div>
<div class="friend-name">
{userName}<br/>

View File

@ -36,6 +36,11 @@
<%= render "account_audio_profile" %>
<%= render "invitationDialog" %>
<%= render "inviteMusicians" %>
<%= render "hoverBand" %>
<%= render "hoverFan" %>
<%= render "hoverMusician" %>
<%= render "hoverRecording" %>
<%= render "hoverSession" %>
<%= render "whatsNextDialog" %>
<%= render "recordingFinishedDialog" %>
<%= render "localRecordingsDialog" %>
@ -243,6 +248,8 @@
}
testConnected();
}
JK.bindHoverEvents();
})
</script>

View File

@ -57,6 +57,12 @@
<%= render "users/signupDialog" %>
<%= render "users/signinDialog" %>
<%= render "clients/notify" %>
<%= render "clients/hoverMusician" %>
<%= render "clients/hoverFan" %>
<%= render "clients/hoverBand" %>
<%= render "clients/hoverSession" %>
<%= render "clients/hoverRecording" %>
<%= yield(:extra_dialogs) %>
<script type="text/javascript">
@ -94,6 +100,8 @@
var signinDialog = new JK.SigninDialog(JK.app);
signinDialog.initialize();
JK.bindHoverEvents();
})
</script>

View File

@ -10,7 +10,8 @@
<div class="landing-comment-scroller">
<% comments.each do |c| %>
<div class="avatar-small mr10">
<% hoverAction = c.user.musician ? "musician" : "fan" %>
<div user-id="<%= c.user.id %>" hoveraction="<%= hoverAction %>" class="avatar-small mr10">
<% unless c.user.photo_url.blank? %>
<%= image_tag "#{c.user.photo_url}", {:alt => ""} %>
<% else %>
@ -18,7 +19,7 @@
<% end %>
</div>
<div class="w80 left p10 lightgrey mt10">
<a href="#"><%= c.user.name %></a>&nbsp;<%= c.comment %>
<a user-id="<%= c.user.id %>" hoveraction="<%= hoverAction %>" href="#"><%= c.user.name %></a>&nbsp;<%= c.comment %>
<br />
<div class="f12 grey mt5"><%= c.created_at.strftime("%b %e %Y, %l:%M %p") %></div>
</div>

View File

@ -10,7 +10,7 @@
</div>
<div class="f16">
<span class="orange"><strong>RECORDING:</strong></span>
<a href="/recordings/<%= history_record.recording_id %>" class="white">Test</a>
<a recording-id="<%= history_record.recording_id %>" hoveraction="recording" href="/recordings/<%= history_record.recording_id %>" class="white">Test</a>
</div>
<% elsif history_record.instance_of? MusicSessionHistory %>
@ -26,7 +26,7 @@
<div class="f16">
<span class="teal"><strong>SESSION:</strong></span>&nbsp;
<% if history_record.session_removed_at.blank? %>
<a href="/sessions/<%= history_record.music_session_id %>" class="white">Live Session in Progress</a>
<a session-id="<%= history_record.music_session_id %>" hoveraction="session" href="/sessions/<%= history_record.music_session_id %>" class="white">Live Session in Progress</a>
<% else %>
<span class="grey">Session Ended. Unavailable.</span>
<% end %>

View File

@ -8,7 +8,7 @@
<table>
<tr>
<td>
<div class="avatar-small m0">
<div user-id="<%= track.musician.id %>" hoveraction="musician" class="avatar-small m0">
<% unless track.musician.photo_url.blank? %>
<%= image_tag "#{track.musician.photo_url}", {:alt => ""} %>
<% else %>
@ -16,7 +16,7 @@
<% end %>
</div>
</td>
<td style="width:150px;"><div class="lightgrey f15 ml10"><%= track.musician.name %></div></td>
<td style="width:150px;"><div user-id="<%= track.musician.id %>" hoveraction="musician" class="lightgrey f15 ml10"><%= track.musician.name %></div></td>
<td class="p10">
<div class="ml10">
<%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => "", :title => "#{track.instrument_id}"} %>