This commit is contained in:
Seth Call 2015-07-10 10:49:48 -05:00
parent 3eea6c89d5
commit d63d3ba1b2
33 changed files with 448 additions and 473 deletions

View File

@ -276,12 +276,6 @@ jam_track_duration.sql
sales.sql
show_whats_next_count.sql
recurly_adjustments.sql
alter_type_columns.sql
user_presences_rename.sql
add_genre_type.sql
add_description_to_perf_samples.sql
alter_genre_player_unique_constraint.sql
musician_search.sql
signup_hints.sql
packaging_notices.sql
first_played_jamtrack_at.sql
@ -292,6 +286,12 @@ signing.sql
optimized_redeemption.sql
optimized_redemption_warn_mode.sql
affiliate_partners2.sql
enhance_band_profile.sql
broadcast_notifications.sql
broadcast_notifications_fk.sql
alter_type_columns.sql
user_presences_rename.sql
add_genre_type.sql
add_description_to_perf_samples.sql
alter_genre_player_unique_constraint.sql
musician_search.sql
enhance_band_profile.sql

View File

@ -0,0 +1,2 @@
ALTER TABLE users ALTER paid_sessions_hourly_rate TYPE integer;
ALTER TABLE users ALTER paid_sessions_daily_rate TYPE integer;

View File

@ -193,6 +193,11 @@ module JamRuby
validates_numericality_of :last_jam_audio_latency, greater_than:MINIMUM_AUDIO_LATENCY, less_than:MAXIMUM_AUDIO_LATENCY, :allow_nil => true
validates :last_jam_updated_reason, :inclusion => {:in => [nil, JAM_REASON_REGISTRATION, JAM_REASON_NETWORK_TEST, JAM_REASON_FTUE, JAM_REASON_JOIN, JAM_REASON_IMPORT, JAM_REASON_LOGIN] }
# stored in cents
validates_numericality_of :paid_sessions_hourly_rate, greater_than:0, less_than:200000, :allow_nil => true
# stored in cents
validates_numericality_of :paid_sessions_daily_rate, greater_than:0, less_than:5000000, :allow_nil => true
# custom validators
validate :validate_musician_instruments
validate :validate_current_password

View File

@ -206,6 +206,10 @@ def app_config
1
end
def google_public_server_key
"AIzaSyCPTPq5PEcl4XWcm7NZ2IGClZlbsiE8JNo"
end
private
def audiomixer_workspace_path

View File

@ -145,8 +145,9 @@
$traditionalTouringOption.val(userDetail.traditional_band_touring ? '1' : '0')
context.JK.dropdown($traditionalTouringOption)
$hourlyRate.val(userDetail.paid_sessions_hourly_rate)
$dailyRate.val(userDetail.paid_sessions_daily_rate)
// convert the value to cents
$hourlyRate.val(userDetail.paid_sessions_hourly_rate || userDetail.paid_sessions_hourly_rate == 0 ? (new Number(userDetail.paid_sessions_hourly_rate) / 100).toFixed(2) : '')
$dailyRate.val(userDetail.paid_sessions_daily_rate || userDetail.paid_sessions_daily_rate == 0 ? (new Number(userDetail.paid_sessions_daily_rate) / 100).toFixed(2) : '')
$cowritingPurpose.val(userDetail.cowriting_purpose)
context.JK.dropdown($cowritingPurpose)
@ -226,6 +227,25 @@
disableSubmits()
resetForm()
// convert from dollars to cents
var hourlyRate = new Number($hourlyRate.val())
var dailyRate = new Number($dailyRate.val())
if(!context._.isNaN(hourlyRate)) {
hourlyRate = Math.round(hourlyRate * 100)
}
else {
// restore original value to allow server to reject with validation error
hourlyRate = $hourlyRate.val()
}
if(!context._.isNaN(dailyRate)) {
dailyRate = Math.round(dailyRate * 100)
}
else {
// restore original value to allow server to reject with validation error
dailyRate = $dailyRate.val()
}
api.updateUser({
virtual_band: $screen.find('input[name=virtual_band]:checked').val(),
virtual_band_genres: $virtualBandGenreList.html() === NONE_SPECIFIED ? [] : $virtualBandGenreList.html().split(GENRE_LIST_DELIMITER),
@ -238,11 +258,11 @@
paid_sessions: $screen.find('input[name=paid_sessions]:checked').val(),
paid_session_genres: $paidSessionsGenreList.html() === NONE_SPECIFIED ? [] : $paidSessionsGenreList.html().split(GENRE_LIST_DELIMITER),
paid_sessions_hourly_rate: $hourlyRate.val(),
paid_sessions_daily_rate: $dailyRate.val(),
paid_sessions_hourly_rate: hourlyRate,
paid_sessions_daily_rate: dailyRate,
free_sessions: $screen.find('input[name=free_sessions]:checked').val(),
free_session_genre: $freeSessionsGenreList.html() === NONE_SPECIFIED ? [] : $freeSessionsGenreList.html().split(GENRE_LIST_DELIMITER),
free_session_genres: $freeSessionsGenreList.html() === NONE_SPECIFIED ? [] : $freeSessionsGenreList.html().split(GENRE_LIST_DELIMITER),
cowriting: $screen.find('input[name=cowriting]:checked').val(),
cowriting_genres: $cowritingGenreList.html() === NONE_SPECIFIED ? [] : $cowritingGenreList.html().split(GENRE_LIST_DELIMITER),
@ -263,7 +283,12 @@
var errors = JSON.parse(xhr.responseText)
if(xhr.status == 422) {
context.JK.append_errors($hourlyRate, 'paid_sessions_hourly_rate', errors)
context.JK.append_errors($dailyRate, 'paid_sessions_daily_rate', errors)
if(errors.errors.length > 0) {
app.notifyServerError(xhr)
}
}
else {
app.ajaxError(xhr, textStatus, errorMessage)

View File

@ -6,7 +6,7 @@
// TODO: Add a target type, which can be band or user -- call the
// appropriate API methods.
context.JK.AccountProfileSamples = function(app, parent, loadFn, updateFn) {
context.JK.AccountProfileSamples = function(app) {
var $document = $(document)
// used to initialize RecordingSourceValidator in site_validator.js.coffee
@ -20,6 +20,8 @@
var ui = new context.JK.UIHelper(JK.app);
var target = {};
var profileUtils = context.JK.ProfileUtils;
var parent = $(".account-profile-samples")
var $screen = $('.profile-online-sample-controls', parent);
// online presences
var $website = $screen.find('.website');
@ -58,11 +60,8 @@
}
function afterShow(data) {
$.when(loadFn())
.done(function(targetPlayer) {
if (targetPlayer && targetPlayer.keys && targetPlayer.keys.length > 0) {
renderPlayer(targetPlayer)
}
api.getUserProfile().done(function(targetPlayer) {
renderPlayer(targetPlayer)
})
}
@ -147,24 +146,29 @@
if (samples && samples.length > 0) {
$.each(samples, function(index, val) {
recordingSources.push({
var source = {
'url': val.url,
'recording_id': val.service_id,
'recording_title': val.description
});
// TODO: this code is repeated in HTML file
var recordingIdAttr = ' data-recording-id="' + val.service_id + '" ';
var recordingUrlAttr = ' data-recording-url="' + val.url + '" ';
var recordingTitleAttr = ' data-recording-title="' + val.description + '"';
var title = formatTitle(val.description);
$sampleList.append('<div class="clearall recording-row left entry"' + recordingIdAttr + recordingUrlAttr + recordingTitleAttr + '>' + title + '</div>');
$sampleList.append('<div class="right close-button" data-recording-type="' + type + '"' + recordingIdAttr + '>X</div>');
}
recordingSources.push(source);
buildNonJamKazamEntry($sampleList, type, source);
});
}
}
}
function buildNonJamKazamEntry($sampleList, type, source) {
// TODO: this code is repeated in HTML file
var recordingIdAttr = ' data-recording-id="' + source.recording_id + '" ';
var recordingUrlAttr = ' data-recording-url="' + source.url + '" ';
var recordingTitleAttr = ' data-recording-title="' + source.recording_title + '"';
var title = formatTitle(source.recording_title);
$sampleList.find(".empty").addClass("hidden")
$sampleList.append('<div class="clearall recording-row left entry"' + recordingIdAttr + recordingUrlAttr + recordingTitleAttr + '>' + title + '</div>');
$sampleList.append('<div class="right close-button" data-recording-type="' + type + '"' + recordingIdAttr + '>X</div>');
}
function buildJamkazamEntry(recordingId, recordingName) {
var title = formatTitle(recordingName);
@ -179,25 +183,22 @@
$btnAddJkRecording.click(function(evt) {
evt.preventDefault();
// retrieve recordings and pass to modal dialog
api.getClaimedRecordings()
.done(function(response) {
ui.launchRecordingSelectorDialog(response, jamkazamRecordingSources, function(selectedRecordings) {
$jamkazamSampleList.empty();
ui.launchRecordingSelectorDialog(jamkazamRecordingSources, function(selectedRecordings) {
$jamkazamSampleList.empty();
jamkazamRecordingSources = [];
jamkazamRecordingSources = [];
// update the list with the selected recordings
$.each(selectedRecordings, function(index, val) {
jamkazamRecordingSources.push({
'claimed_recording_id': val.id,
'description': val.name
});
buildJamkazamEntry(val.id, val.name);
});
// update the list with the selected recordings
$.each(selectedRecordings, function(index, val) {
jamkazamRecordingSources.push({
'claimed_recording_id': val.id,
'description': val.name
});
buildJamkazamEntry(val.id, val.name);
});
});
return false;
});
@ -287,7 +288,7 @@
disableSubmits()
var player = buildPlayer()
updateFn({
api.updateUser({
website: player.website,
online_presences: player.online_presences,
performance_samples: player.performance_samples
@ -316,8 +317,13 @@
addPerformanceSamples(ps, $soundCloudSampleList, performanceSampleTypes.SOUNDCLOUD.description);
addPerformanceSamples(ps, $youTubeSampleList, performanceSampleTypes.YOUTUBE.description);
var website = $website.val()
if (website == '') {
website = null;
}
return {
website: $website.val(),
website: website,
online_presences: op,
performance_samples: ps
}
@ -428,8 +434,8 @@
siteSuccessCallback($inputDiv, youTubeRecordingValidator, $youTubeSampleList, 'youtube');
}
function siteSuccessCallback($inputDiv, recordingSiteValidator, sampleList, type) {
sampleList.find(".empty").addClass("hidden")
function siteSuccessCallback($inputDiv, recordingSiteValidator, $sampleList, type) {
$sampleList.find(".empty").addClass("hidden")
$inputDiv.removeClass('error');
$inputDiv.find('.error-text').remove();
@ -437,13 +443,7 @@
if (recordingSources && recordingSources.length > 0) {
var addedRecording = recordingSources[recordingSources.length-1];
// TODO: this code is repeated in elsewhere in this JS file:
var recordingIdAttr = ' data-recording-id="' + addedRecording.recording_id + '" ';
var recordingUrlAttr = ' data-recording-url="' + addedRecording.url + '" ';
var recordingTitleAttr = ' data-recording-title="' + addedRecording.recording_title + '"';
var title = formatTitle(addedRecording.recording_title);
sampleList.append('<div class="clearall recording-row left entry"' + recordingIdAttr + recordingUrlAttr + recordingTitleAttr + '>' + title + '</div>');
sampleList.append('<div class="right close-button" data-recording-type="' + type + '"' + recordingIdAttr + '>X</div>');
buildNonJamKazamEntry($sampleList, type, addedRecording);
}
$inputDiv.find('input').val('');

View File

@ -2,7 +2,7 @@
"use strict";
context.JK = context.JK || {};
context.JK.RecordingSelectorDialog = function(app, recordings, selectedRecordings, selectCallback) {
context.JK.RecordingSelectorDialog = function(app, selectedRecordings, selectCallback) {
var logger = context.JK.logger;
var rest = context.JK.Rest();
var recordingUtils = context.JK.RecordingUtils;
@ -10,173 +10,26 @@
var dialogId = 'recording-selector-dialog';
var $screen = $('#' + dialogId);
var $btnSelect = $screen.find(".btn-select-recordings");
var $instructions = $screen.find('#instructions');
var $recordings = $screen.find('.recordings');
var $paginatorHolder = null;
var feedHelper = new context.JK.Feed(app);
var $scroller = $recordings;
var $content = $recordings;
var $noMoreFeeds = $screen.find('.end-of-list');
var $empty = $();
feedHelper.initialize($screen, $scroller, $content, $noMoreFeeds, $empty, $empty, $empty, $empty, {sort: 'date', time_range: 'all', type: 'recording', show_checkbox: true, hide_avatar: true});
function beforeShow(data) {
}
function afterShow(data) {
$recordings.empty();
$.each(recordings, function(index, val) {
bindRecordingItem(val);
});
feedHelper.setUser(context.JK.currentUserId)
feedHelper.refresh()
// hide the avatars
$screen.find('.avatar-small.ib').hide();
}
/********* THE FOLLOWING BLOCK IS REPEATED IN feedHelper.js **********/
function startRecordingPlay($feedItem) {
var img = $('.play-icon', $feedItem);
var $controls = $feedItem.find('.recording-controls');
img.attr('src', '/assets/content/icon_pausebutton.png');
$controls.trigger('play.listenRecording');
$feedItem.data('playing', true);
}
function stopRecordingPlay($feedItem) {
var img = $('.play-icon', $feedItem);
var $controls = $feedItem.find('.recording-controls');
img.attr('src', '/assets/content/icon_playbutton.png');
$controls.trigger('pause.listenRecording');
$feedItem.data('playing', false);
}
function toggleRecordingPlay() {
var $playLink = $(this);
var $feedItem = $playLink.closest('.feed-entry');
var playing = $feedItem.data('playing');
if(playing) {
stopRecordingPlay($feedItem);
}
else {
startRecordingPlay($feedItem);
}
return false;
}
function toggleRecordingDetails() {
var $detailsLink = $(this);
var $feedItem = $detailsLink.closest('.feed-entry');
var $musicians = $feedItem.find('.musician-detail');
var $description = $feedItem.find('.description');
var $name = $feedItem.find('.name');
var toggledOpen = $detailsLink.data('toggledOpen');
if(toggledOpen) {
toggleClose($feedItem, $name, $description, $musicians)
}
else {
toggleOpen($feedItem, $name, $description, $musicians)
}
toggledOpen = !toggledOpen;
$detailsLink.data('toggledOpen', toggledOpen);
return false;
}
function stateChangeRecording(e, data) {
var $controls = data.element;
var $feedItem = $controls.closest('.feed-entry');
var $sliderBar = $('.recording-position', $feedItem);
var $statusBar = $('.recording-status', $feedItem);
var $currentTime = $('.recording-current', $feedItem);
var $status = $('.status-text', $feedItem);
var $playButton = $('.play-button', $feedItem);
if(data.isEnd) stopRecordingPlay($feedItem);
if(data.isError) {
$sliderBar.hide();
$playButton.hide();
$currentTime.hide();
$statusBar.show();
$status.text(data.displayText);
}
}
function toggleOpen($feedItem, $name, $description, $musicians) {
$description.trigger('destroy.dot');
$description.data('original-height', $description.css('height')).css('height', 'auto');
$name.trigger('destroy.dot');
$name.data('original-height', $name.css('height')).css('height', 'auto');
$musicians.show();
$feedItem.animate({'max-height': '1000px'});
}
function toggleClose($feedItem, $name, $description, $musicians, immediate) {
$feedItem.css('height', $feedItem.height() + 'px')
$feedItem.animate({'height': $feedItem.data('original-max-height')}, immediate ? 0 : 400).promise().done(function() {
$feedItem.css('height', 'auto').css('max-height', $feedItem.data('original-max-height'));
$musicians.hide();
$description.css('height', $description.data('original-height'));
$description.dotdotdot();
$name.css('height', $name.data('original-height'));
$name.dotdotdot();
});
}
/**********************************************************/
function bindRecordingItem(claimedRecording) {
claimedRecording.recording.mix_info = recordingUtils.createMixInfo({state: claimedRecording.recording.mix_state});
var options = {
feed_item: claimedRecording.recording,
candidate_claimed_recording: claimedRecording,
mix_class: claimedRecording['has_mix?'] ? 'has-mix' : 'no-mix',
};
var $feedItem = $(context._.template($('#template-feed-recording').html(), options, {variable: 'data'}));
var $controls = $feedItem.find('.recording-controls');
var $titleText = $feedItem.find('.title .title-text');
// if this item will be discarded, tack on a * to the RECORDING NAME
var discardTime = claimedRecording.recording['when_will_be_discarded?'];
if(discardTime) {
context.JK.helpBubble($titleText, 'recording-discarded-soon', {discardTime: discardTime}, {});
$titleText.text($titleText.text() + '*');
}
$controls.data('mix-state', claimedRecording.recording.mix_info); // for recordingUtils helper methods
$controls.data('server-info', claimedRecording.recording.mix); // for recordingUtils helper methods
$controls.data('view-context', 'feed');
$('.timeago', $feedItem).timeago();
context.JK.prettyPrintElements($('.duration', $feedItem));
context.JK.setInstrumentAssetPath($('.instrument-icon', $feedItem));
$('.details', $feedItem).click(toggleRecordingDetails);
$('.details-arrow', $feedItem).click(toggleRecordingDetails);
$('.play-button', $feedItem).click(toggleRecordingPlay);
var checked = '';
var match = $.grep(selectedRecordings, function(obj, index) {
return obj.claimed_recording_id === claimedRecording.id;
});
if (match && match.length > 0) {
checked = 'checked';
}
// put the item on the page
$recordings.append("<div class='left'><input type='checkbox' " + checked + " data-recording-id='" + claimedRecording.id + "' data-recording-title='" + claimedRecording.name + "' />");
$recordings.append($feedItem);
// these routines need the item to have height to work (must be after renderFeed)
$controls.listenRecording({recordingId: claimedRecording.recording.id, claimedRecordingId: options.candidate_claimed_recording.id, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
$controls.bind('statechange.listenRecording', stateChangeRecording);
$('.dotdotdot', $feedItem).dotdotdot();
$feedItem.data('original-max-height', $feedItem.css('height'));
context.JK.bindHoverEvents($feedItem);
context.JK.bindProfileClickEvents($feedItem);
//$screen.find('.avatar-small.ib').hide();
}
function afterHide() {
@ -187,10 +40,10 @@
}
function events() {
$btnSelect.click(function(evt) {
$btnSelect.off('click').on('click', function(evt) {
evt.preventDefault();
var preSelectedRecordings = [];
$recordings.find('input[type=checkbox]:checked').each(function(index) {
$recordings.find('.select-box input[type=checkbox]:checked').each(function(index) {
preSelectedRecordings.push({
"id": $(this).attr('data-recording-id'),
"name": $(this).attr('data-recording-title')
@ -198,6 +51,7 @@
});
if (selectCallback) {
console.log("calling selectCallback", preSelectedRecordings)
selectCallback(preSelectedRecordings);
}
@ -217,8 +71,6 @@
app.bindDialog(dialogId, dialogBindings);
$instructions.html('Select one or more recordings and click ADD to add JamKazam recordings to your performance samples.');
events();
}

View File

@ -15,7 +15,8 @@ context.JK.SoundCloudPlayerDialog = class SoundCloudPlayerDialog
initialize:(@url, @caption) =>
dialogBindings = {
'beforeShow' : @beforeShow,
'afterShow' : @afterShow
'afterShow' : @afterShow,
'afterHide' : @afterHide
}
@dialog = $('[layout-id="' + @dialogId + '"]')
@ -27,9 +28,15 @@ context.JK.SoundCloudPlayerDialog = class SoundCloudPlayerDialog
beforeShow:() =>
@player.addClass("hidden")
@player.attr("src", "")
u = encodeURIComponent(@url)
src = "https://w.soundcloud.com/player/?url=#{u}&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true&loop=true"
@player.attr("src", src)
# the Windows client does not play back correctly
if context.jamClient.IsNativeClient()
context.JK.popExternalLink(@url)
return false
else
u = encodeURIComponent(@url)
src = "https://w.soundcloud.com/player/?url=#{u}&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true&loop=true"
@player.attr("src", src)
afterShow:() =>
@player.removeClass("hidden")
@ -37,4 +44,7 @@ context.JK.SoundCloudPlayerDialog = class SoundCloudPlayerDialog
showDialog:() =>
@app.layout.showDialog(@dialogId)
afterHide: () =>
@player.attr('src', '')

View File

@ -25,6 +25,7 @@
var $includeType = null;
var didLoadAllFeeds = false, isLoading = false;
var $templateRecordingDiscardedSoon = null;
var defaults;
function defaultQuery() {
var query = { limit: feedBatchSize };
@ -47,9 +48,9 @@
var currentQuery = defaultQuery();
// specify search criteria based on form
currentQuery.sort = $sortFeedBy.val();
currentQuery.time_range = $includeDate.val();
currentQuery.type = $includeType.val();
currentQuery.sort = $sortFeedBy.length == 0 ? defaults.sort : $sortFeedBy.val();
currentQuery.time_range = $includeDate.length == 0 ? defaults.time_range : $includeDate.val();
currentQuery.type = $includeType.length == 0 ? defaults.type : $includeType.val();
return currentQuery;
}
@ -423,6 +424,11 @@
ui.addSessionLike(feed.id, JK.currentUserId, $('.likes', $feedItem), $('.btn-like', $feedItem))
});
// should we show the select checkbox?
if(!defaults.show_checkbox) {
$feedItem.find('.select-box').hide();
}
// put the feed item on the page
renderFeed($feedItem);
@ -448,6 +454,7 @@
mix_class: feed['has_mix?'] ? 'has-mix' : 'no-mix',
}
console.log("OPTIONS", options)
var $feedItem = $(context._.template($('#template-feed-recording').html(), options, {variable: 'data'}));
var $controls = $feedItem.find('.recording-controls');
@ -534,6 +541,14 @@
context.JK.helpBubble($feedItem.find('.help-launcher'), recordingUtils.onMixHover, {}, {width:'450px', closeWhenOthersOpen: true, positions:['top', 'left', 'bottom', 'right'], offsetParent: $screen.parent()})
// should we show the select checkbox?
if(!defaults.show_checkbox) {
$feedItem.find('.select-box').hide();
}
if(defaults.hide_avatar) {
$feedItem.find('.avatar-small.ib').hide();
}
// put the feed item on the page
renderFeed($feedItem);
@ -582,7 +597,7 @@
}
function initialize(_$parent, _$scroller, _$content, _$noMorefeeds, _$refresh, _$sortFeedBy, _$includeDate, _$includeType, defaults) {
function initialize(_$parent, _$scroller, _$content, _$noMorefeeds, _$refresh, _$sortFeedBy, _$includeDate, _$includeType, _defaults) {
$screen = _$parent;
$scroller = _$scroller;
$content = _$content;
@ -596,12 +611,10 @@
if($scroller.length == 0) throw "$scroller must be specified";
if($content.length == 0) throw "$content must be specified";
if($noMoreFeeds.length == 0) throw "$noMoreFeeds must be specified";
if($refresh.length == 0) throw "$refresh must be specified";
if($sortFeedBy.length == 0) throw "$sortFeedBy must be specified";
if($includeDate.length == 0) throw "$includeDate must be specified";
if($includeType.length ==0) throw "$includeType must be specified";
defaults = $.extend({}, {sort: 'date', time_range: 'month', type: 'all'}, defaults)
// show_checkbox will show a checkbox in the upper left
defaults = $.extend({}, {sort: 'date', time_range: 'month', type: 'all', show_checkbox: false, hide_avatar: true}, _defaults)
// set default search criteria
$sortFeedBy.val(defaults.date)
$includeDate.val(defaults.time_range)

View File

@ -523,16 +523,12 @@
function getUserProfile(options) {
var id = getId(options);
var profile = null;
if (id != null && typeof(id) != 'undefined') {
profile = $.ajax({
return $.ajax({
type: "GET",
dataType: "json",
url: "/api/users/" + id + "/profile",
processData: false
});
}
return profile;
}
function createAffiliatePartner(options) {

View File

@ -226,7 +226,7 @@
var errors = JSON.parse(jqXHR.responseText);
var $errors = context.JK.format_all_errors(errors);
logger.debug("Unprocessable entity sent from server:", JSON.stringify(errors))
this.notify({title: title, text: $errors, icon_url: "/assets/content/icon_alert_big.png"})
this.notify({title: title || "Validation Error", text: $errors, icon_url: "/assets/content/icon_alert_big.png"})
}
else if(jqXHR.status == 403) {
logger.debug("permission error sent from server:", jqXHR.responseText)

View File

@ -23,7 +23,7 @@
var $biography = $screen.find('#biography');
// musical experience
var $instruments = $screen.find('#instruments');
var $instruments = $screen.find('.instruments-holder');
var $musicianStatus = $screen.find('#musician-status');
var $genres = $screen.find('#genres');
var $concertCount = $screen.find('#concert-count');
@ -36,7 +36,7 @@
var $youTubeSamples = $screen.find('.youtube-samples');
// online presence
var $noOnlinePresence = $screen.find('.no-online-presence');
var $userWebsite = $screen.find('.user-website');
var $soundCloudPresence = $screen.find('.soundcloud-presence');
var $reverbNationPresence = $screen.find('.reverbnation-presence');
@ -95,7 +95,7 @@
var $age = $screen.find('#age');
// buttons
var $btnEdit = $screen.find('#btn-edit');
var $btnEdit = $screen.find('.edit-profile-btn');
var $btnAddFriend = $screen.find('#btn-add-friend');
var $btnFollowUser = $screen.find('#btn-follow-user');
var $btnMessageUser = $screen.find('#btn-message-user');
@ -128,7 +128,7 @@
}
function resetForm() {
$instruments.empty();
//$instruments.empty();
$aboutContent.show();
$historyContent.hide();
@ -411,7 +411,7 @@
/****************** ABOUT TAB *****************/
function renderAbout() {
$instruments.empty();
//$instruments.empty();
$aboutContent.show();
$historyContent.hide();
@ -477,7 +477,7 @@
function renderBio() {
$biography.html(user.biography ? user.biography : NOT_SPECIFIED_TEXT);
if (isCurrentUser() && !user.biography) {
if (isCurrentUser()) {
$btnEditBio.show();
} else {
$btnEditBio.hide();
@ -485,19 +485,26 @@
}
function renderMusicalExperience() {
profileUtils.renderMusicalExperience(user, $screen)
profileUtils.renderMusicalExperience(user, $screen, isCurrentUser())
}
function renderPerformanceSamples() {
profileUtils.renderPerformanceSamples(user, $screen)
profileUtils.renderPerformanceSamples(user, $screen, isCurrentUser())
}
function renderOnlinePresence() {
profileUtils.renderOnlinePresence(user, $screen)
profileUtils.renderOnlinePresence(user, $screen, isCurrentUser())
}
function renderInterests() {
// current interests
if (isCurrentUser()) {
$btnAddInterests.show();
}
else {
$btnAddInterests.hide();
}
var noInterests = !user.paid_sessions && !user.free_sessions && !user.cowriting && !user.virtual_band && !user.traditional_band;
if (noInterests) {
$noInterests.show();
@ -506,12 +513,7 @@
$cowritingSection.hide();
$traditionalBandSection.hide();
$virtualBandSection.hide();
if (isCurrentUser()) {
$btnAddInterests.show();
}
} else {
$btnAddInterests.hide();
$noInterests.hide();
// paid sessions

View File

@ -307,18 +307,25 @@
}
function formatTitle(title) {
return title && title.length > 30 ? title.substring(0, 30) + "..." : title;
return title;
}
profileUtils.renderMusicalExperience = function(player, $root) {
var $instruments = $root.find('#instruments');
profileUtils.renderMusicalExperience = function(player, $root, isOwner) {
var $instruments = $root.find('.instruments-holder');
var $musicianStatus = $root.find('#musician-status');
var $genres = $root.find('#genres');
var $concertCount = $root.find('#concert-count');
var $studioCount = $root.find('#studio-count');
var $btnAddExperiences = $root.find('.add-experiences')
$instruments.empty();
$instruments.find('.profile-instrument').remove()
if(isOwner) {
$btnAddExperiences.show()
}
else {
$btnAddExperiences.hide()
}
if (player.instruments) {
for (var i = 0; i < player.instruments.length; i++) {
var instrument = player.instruments[i];
@ -335,7 +342,7 @@
proficiency_level_css: proficiencyCssMap[proficiency]
});
$instruments.append(instrumentHtml);
$instruments.prepend(instrumentHtml);
}
}
@ -367,16 +374,22 @@
var $youTubeSamples = $root.find('.youtube-samples');
var $btnAddRecordings = $root.find('.add-recordings');
$jamkazamSamples.find('.playable').remove()
$soundCloudSamples.find('.playable').remove()
$youTubeSamples.find('.playable').remove()
if (isOwner) {
$btnAddRecordings.show();
}
else {
$btnAddRecordings.hide();
}
if (!performanceSamples || performanceSamples.length === 0) {
$noSamples.show()
$jamkazamSamples.hide()
$soundCloudSamples.hide()
$youTubeSamples.hide()
if (isOwner) {
$btnAddRecordings.show();
}
} else {
$btnAddRecordings.hide();
$noSamples.hide();
// show samples section
@ -402,15 +415,15 @@
}
$.each(jamkazamSamples, function(index, sample) {
$jamkazamSamples.append("<a class='jamkazam-playable' href='/recordings/" + sample.claimed_recording.id + "' rel='external'>" + formatTitle(sample.claimed_recording.name) + "</a><br/>");
$jamkazamSamples.append("<a class='jamkazam-playable playable' href='/recordings/" + sample.claimed_recording.id + "' rel='external'>" + formatTitle(sample.claimed_recording.name) + "</a>");
});
$.each(soundCloudSamples, function(index, sample) {
$soundCloudSamples.append("<a class='sound-cloud-playable' href='' soundcloud_url='" + sample.url + "'>" + formatTitle(sample.description) + "</a><br/>");
$soundCloudSamples.append("<a class='sound-cloud-playable playable' href='' soundcloud_url='" + sample.url + "'>" + formatTitle(sample.description) + "</a>");
});
$.each(youTubeSamples, function(index, sample) {
$youTubeSamples.append("<a class='youtube-playable' href='" + sample.url + "' rel='external'>" + formatTitle(sample.description) + "</a><br/>");
$youTubeSamples.append("<a class='youtube-playable playable' href='" + sample.url + "' rel='external'>" + formatTitle(sample.description) + "</a>");
});
}
}// function renderPerformanceSamples
@ -425,13 +438,17 @@
var $youTubePresence = $root.find('.youtube-presence');
var $facebookPresence = $root.find('.facebook-presence');
var $twitterPresence = $root.find('.twitter-presence');
var $btnAddSites = $root.find('.add-sites');
var $btnAddSites = $root.find('.add-presences');
if (isOwner) {
$btnAddSites.show();
} else {
$btnAddSites.hide();
}
// online presences
var onlinePresences = player.online_presences;
if ((!onlinePresences || onlinePresences.length === 0) && !player.website) {
if (onlinePresences.length == 0 && !player.website) {
$noOnlinePresence.show()
$userWebsite.show()
$soundCloudPresence.show()
@ -441,18 +458,19 @@
$youTubePresence.show()
$facebookPresence.show()
$twitterPresence.show()
if (isOwner) {
$btnAddSites.show();
} else {
$btnAddSites.hide();
}
} else {
$btnAddSites.hide();
$noOnlinePresence.hide();
if (player.website) {
$userWebsite.find('a').attr('href', player.website);
// make sure website is rooted
var website = player.website;
if(website.indexOf('http') == -1) {
website = 'http://' + website;
}
$userWebsite.removeClass('hidden').find('a').attr('href', website)
}
else {
$userWebsite.addClass('hidden').find('a').attr('href', '')
}
var soundCloudPresences = profileUtils.soundCloudPresences(onlinePresences);

View File

@ -74,8 +74,8 @@
return genreSelectorDialog.showDialog();
}
function launchRecordingSelectorDialog(recordings, selectedRecordings, callback) {
var recordingSelectorDialog = new JK.RecordingSelectorDialog(JK.app, recordings, selectedRecordings, callback);
function launchRecordingSelectorDialog(selectedRecordings, callback) {
var recordingSelectorDialog = new JK.RecordingSelectorDialog(JK.app, selectedRecordings, callback);
recordingSelectorDialog.initialize();
return recordingSelectorDialog.showDialog();
}

View File

@ -892,6 +892,19 @@
return ul;
}
context.JK.reset_errors = function($container) {
$container.find('.error-text').remove()
$container.find('.error').removeClass("error")
}
context.JK.append_errors = function($field, fieldName, errors_data) {
var $ul = context.JK.format_errors(fieldName, errors_data);
if($ul != null) {
delete errors_data['errors'][fieldName];
$field.closest('div.field').addClass('error').end().after($ul);
}
}
context.JK.format_all_errors = function (errors_data) {
var errors = errors_data["errors"];
if (errors == null) return $('<ul class="error-text"><li>unknown error</li></ul>');

View File

@ -339,7 +339,6 @@
var $fader = $voiceChatFader.find('[data-control="fader"]');
var db = context.jamClient.FTUEGetChatInputVolume();
var faderPct = db + 80;
console.log("SET HANDLE POSITION", $fader, db)
context.JK.FaderHelpers.setHandlePosition($fader, faderPct);
}

View File

@ -14,6 +14,7 @@
div.genres {
width: 20%;
margin-bottom: 15px;
float:left;
}
a.select-genre {
@ -28,14 +29,42 @@
}
.interest-options {
width: 30%;
margin-bottom: 15px;
width: 33%;
margin-right: 20px;
margin-bottom: 20px;
label {
margin-bottom: 10px;
}
}
.play-commitment, .purpose {
width:150px;
.easydropdown-wrapper {
width:150px;
}
margin-right:20px;
}
.hourly-rate-holder {
margin-right:20px;
}
.yes-no-options {
.option {
float:left;
.iradio_minimal {
float:left;
}
label {
float:left;
margin:3px 0 0 3px;
}
&:nth-child(2) {
margin-left:20px;
}
}
}
input[type=text].rate {
width: 100px;
}

View File

@ -1,6 +1,10 @@
@import "client/common.css.scss";
#user-profile, #band-profile {
.user-header {
h2 {display:inline;}
a {margin:2px 0 0 20px}
}
.profile-about-right {
textarea {
@ -9,29 +13,42 @@
padding:0;
}
}
div.logo, div.item {
text-align: bottom;
.section {
margin-bottom:40px;
}
.add-recordings, .add-interests, .add-presences, .add-bio, .add-experiences {
display:inline;
font-size:11px;
}
.online-presence-option, .performance-sample-option {
margin-right: 1em;
display:block;
vertical-align:middle;
margin-bottom:20px;
&.no-online-presence {
display:block;
}
}
.instruments-holder {
margin-bottom:20px;
}
.statuses {
clear:both;
}
img.logo {
margin-right: 20px;
}
ul {
margin:0px 0px 10px 0px;
padding:0px;
}
li {
margin-left: 15px;
margin-bottom: 0px !important;
list-style: disc;
}
.playable {
display:block;
}
}
.profile-head {
@ -56,14 +73,12 @@
.section-header {
font-weight:600;
font-size:18px;
float:left;
margin: 0px 0px 10px 0px;
}
.section-content {
font-weight:normal;
font-size:1.2em;
float:left;
margin: 0px 0px 10px 0px;
}
}

View File

@ -2,13 +2,37 @@
#recording-selector-dialog {
min-height:initial;
height:600px;
.dialog-inner {
color:white;
height:100%;
}
.recordings {
max-height:450px;
margin-bottom:20px;
overflow-y:auto;
}
.action-buttons {
margin-bottom:10px;
}
.instructions {
margin-bottom:20px;
}
.select-recording {
position:relative;
input {
z-index:1;
position:absolute;
top:7px;
}
.feed-entry {
margin-top: 0;
padding-top: 10px;
}
}
}

View File

@ -145,6 +145,10 @@
overflow:hidden;
margin-top:20px;
.select-box {
position:absolute;
}
&:nth-child(1) {
margin-top:0;
}

View File

@ -18,22 +18,17 @@
<div>
<div class="left interest-options">
<label>I would like to join a virtual band <a class="help" help-topic="profile-interests-virtual-band">[?]</a></label>
<div class="left w30">
<div class="left w25">
<div class="yes-no-options">
<div class="option">
<input type="radio" name="virtual_band" id="virtual-band-yes" value="true" />
</div>
<div>
<label for="virtual-band-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<div class="option">
<input type="radio" name="virtual_band" id="virtual-band-no" value="false" />
</div>
<div>
<label for="virtual-band-no">No</label>
</div>
</div>
</div>
<div id="virtual-band-genres" class="left genres">
@ -41,7 +36,7 @@
<span class="genre-list"></span>
</div>
<div class="field left w35">
<div class="field left play-commitment">
<label>Play Commitment</label>
<select id="virtual-band-commitment" name="virtual_band_commitment">
<option value="1">infrequent</option>
@ -57,19 +52,13 @@
<div>
<div class="left interest-options">
<label>I would like to join a traditional band <a class="help" help-topic="profile-interests-traditional-band">[?]</a></label>
<div class="left w30">
<div class="left w25">
<div class="yes-no-options">
<div class="option">
<input type="radio" name="traditional_band" id="traditional-band-yes" value="true" />
</div>
<div>
<label for="traditional-band-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<div class="option">
<input type="radio" name="traditional_band" id="traditional-band-no" value="false" />
</div>
<div>
<label for="traditional-band-no">No</label>
</div>
</div>
@ -80,7 +69,7 @@
<span class="genre-list"></span>
</div>
<div class="field left w15">
<div class="field left play-commitment">
<label>Play Commitment</label>
<select id="traditional-band-commitment" name="traditional_band_commitment">
<option value="1">infrequent</option>
@ -90,7 +79,7 @@
</select>
</div>
<div class="field left w10">
<div class="field left">
<label>Touring Option</label>
<select id="traditional-band-touring" name="touring">
<option value='1'>Yes</option>
@ -104,35 +93,29 @@
<div>
<div class="left interest-options">
<label>I am available to play in paid sessions <a class="help" help-topic="profile-interests-paid-sessions">[?]</a></label>
<div class="left w30">
<div class="left w25">
<div class="yes-no-options">
<div class="option">
<input type="radio" name="paid_sessions" id="paid-sessions-yes" value="true" />
</div>
<div>
<label for="paid-sessions-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<div class="option">
<input type="radio" name="paid_sessions" id="paid-sessions-no" value="false" />
</div>
<div>
<label for="paid-sessions-no">No</label>
</div>
</div>
</div>
<div id="paid-sessions-genres" class="left genres">
<div id="paid-sessions-genres" class="genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
<div class="field left w15">
<div class="field left hourly-rate-holder">
<label>Hourly Rate:</label>
<input type="text" class="rate" id="hourly-rate" name="paid_sessions_hourly_rate" />
</div>
<div class="field left w15">
<div class="field left">
<label>Daily Rate:</label>
<input type="text" class="rate" id="daily-rate" name="paid_sessions_daily_rate" />
</div>
@ -143,19 +126,13 @@
<div>
<div class="left interest-options">
<label>I am available to play in free sessions <a class="help" help-topic="profile-interests-free-sessions">[?]</a></label>
<div class="left w30">
<div class="left w25">
<div class="yes-no-options">
<div class="option">
<input type="radio" name="free_sessions" id="free-sessions-yes" value="true" />
</div>
<div>
<label for="free-sessions-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<div class="option">
<input type="radio" name="free_sessions" id="free-sessions-no" value="false" />
</div>
<div>
<label for="free-sessions-no">No</label>
</div>
</div>
@ -172,19 +149,13 @@
<div>
<div class="left interest-options">
<label>I would like to co-write with partner(s) <a class="help" help-topic="profile-interests-cowrite-partners">[?]</a></label>
<div class="left w30">
<div class="left w25">
<div class="yes-no-options">
<div class="option">
<input type="radio" name="cowriting" id="cowriting-yes" value="true" />
</div>
<div>
<label for="cowriting-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<div class="option">
<input type="radio" name="cowriting" id="cowriting-no" value="false" />
</div>
<div>
<label for="cowriting-no">No</label>
</div>
</div>
@ -195,7 +166,7 @@
<span class="genre-list"></span>
</div>
<div class="field left w35">
<div class="field left purpose">
<label>Purpose</label>
<select id="cowriting-purpose" name="cowriting_purpose">
<option value='1'>just for fun</option>

View File

@ -13,9 +13,9 @@
<form id="profile-form" class="inner-content">
<div class="profile-header profile-head">
<div class="left">
<div class="user-header">
<h2 id="username"></h2>
<%= link_to("EDIT PROFILE", '/client#/account/profile', :id => "btn-edit", :class => "button-orange") %>
<%= link_to("EDIT PROFILE", '/client#/account/profile', :class => "button-orange edit-profile-btn") %>
</div>
<!-- action buttons -->
@ -61,118 +61,98 @@
<span id="favorite-stats"></span><br />
</div>
<div class="profile-about-right">
<div class="section-header">Bio</div>
<br clear="all" />
<div id="biography" class="item"></div>
<div class="item"><a href="/client#/account/profile" class="add-bio">Edit Bio</a></div>
<br clear="all" />
<div class="section-header">Musical Experience</div>
<br clear="all" />
<div class="section bio">
<div class="section-header">Bio <a href="/client#/account/profile" class="add-bio">(edit)</a></div>
<div id="biography" class="item"></div>
<div id="instruments" class="item"></div>
<br clear="all" />
<br clear="all" />
<div class="item">
<div class="left profile-details">Status:</div>
<div id="musician-status"></div>
</div>
<div class="item">
<div class="left profile-details">Genres:</div>
<div id="genres"></div>
</div>
<div class="item">
<div class="left profile-details">Concert Gigs:</div>
<div id="concert-count"></div>
</div>
<div class="item">
<div class="left profile-details">Studio Gigs:</div>
<div id="studio-count"></div>
</div>
<br clear="all" />
<br clear="all" />
<div class="section">
<div class="section-header">Musical Experience <a href="/client#/account/profile/experience" class="add-experiences">(edit)</a></div>
<div class="section-header">Performance Samples</div>
<br clear="all" />
<div class="instruments-holder" class="item">
<br clear="all" />
</div>
<%=render "profile_summary_performance_samples" %>
<br clear="all" />
<div class="left item"><a href="/client#/account/profile/samples" class="add-recordings">Add Recordings</a></div>
<br clear="all" />
<br clear="all" />
<div class="section-header">Online Presence</div>
<br clear="all" />
<%=render "profile_summary_online_presence" %>
<br clear="all" />
<div class="left item"><a href="/client#/account/profile/samples">Add Sites</a></div>
<br clear="all" />
<br clear="all" />
<div class="section-header">Current Interests</div>
<br clear="all" />
<div id="no-interests" class="left item">None specified</div>
<div id="paid-gigs" class="item">
<div class="left">I'm interested in playing paid gigs</div>
<br clear="all" />
<div id="paid-gig-details">
<ul>
</ul>
<div class="statuses">
<div class="item">
<div class="profile-details">Status:</div>
<div id="musician-status"></div>
</div>
<div class="item">
<div class="profile-details">Genres:</div>
<div id="genres"></div>
</div>
<div class="item">
<div class="profile-details">Concert Gigs:</div>
<div id="concert-count"></div>
</div>
<div class="item">
<div class="profile-details">Studio Gigs:</div>
<div id="studio-count"></div>
</div>
</div>
</div>
<div id="free-gigs" class="item">
<div class="left">I'm interested in playing free gigs</div>
<br clear="all" />
<div id="free-gig-details">
<ul>
</ul>
</div>
<div class="section performance-samples">
<div class="section-header">Performance Samples <a href="/client#/account/profile/samples" class="add-recordings">(edit)</a></div>
<%=render "profile_summary_performance_samples" %>
</div>
<div id="cowriting" class="item">
<div class="left">I'm interested in co-writing</div>
<br clear="all" />
<div id="cowriting-details">
<ul>
</ul>
<div class="section">
<div class="section-header">Online Presence <a href="/client#/account/profile/samples" class="add-presences">(edit)</a></div>
<%=render "profile_summary_online_presence" %>
</div>
<div class="section">
<div class="section-header">Current Interests <a href="/client#/account/profile/interests" class="add-interests">(edit)</a></div>
<div id="no-interests" class="item">None specified</div>
<div id="paid-gigs" class="item">
<div>I'm interested in playing paid gigs</div>
<div id="paid-gig-details">
<ul>
</ul>
</div>
</div>
<div id="free-gigs" class="item">
<div>I'm interested in playing free gigs</div>
<div id="free-gig-details">
<ul>
</ul>
</div>
</div>
<div id="cowriting" class="item">
<div>I'm interested in co-writing</div>
<div id="cowriting-details">
<ul>
</ul>
</div>
</div>
<div id="traditional-band" class="item">
<div>I'm interested in forming traditional band(s)</div>
<div id="traditional-band-details">
<ul>
</ul>
</div>
</div>
<div id="virtual-band" class="item">
<div>I'm interested in forming virtual band(s)</div>
<div id="virtual-band-details">
<ul>
</ul>
</div>
</div>
</div>
<div id="traditional-band" class="item">
<div class="left">I'm interested in forming traditional band(s)</div>
<br clear="all" />
<div id="traditional-band-details">
<ul>
</ul>
</div>
</div>
<div id="virtual-band" class="item">
<div class="left">I'm interested in forming virtual band(s)</div>
<br clear="all" />
<div id="virtual-band-details">
<ul>
</ul>
</div>
</div>
<br clear="all" />
<div class="item"><a href="/client#/account/profile/interests" class="add-interests">Add Interests</a></div>
</div>
</div>

View File

@ -32,9 +32,15 @@
span.spinner-small
tr
td colspan="25%": label Fandalism (URL):
td colspan="25%": label YouTube (username):
td colspan="25%": label Facebook (username):
td colspan="25%": label Fandalism (username):
td colspan="25%": label
| YouTube&nbsp;
a href="https://support.google.com/youtube/answer/2657968?ref_topic=3024172&hl=en" rel="external" (channel name)
| :
td colspan="25%": label
| Facebook&nbsp;
a href="https://www.facebook.com/help/174987089221178" rel="external" (page name)
| :
td colspan="25%": label Twitter (username):
tr
td colspan="25%"

View File

@ -1,26 +1,26 @@
.no-online-presence.left.online-presence-option.hidden
.no-online-presence.online-presence-option.hidden
| None specified
.user-website.left.logo.online-presence-option.hidden
.user-website.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/website-logo.png"
.soundcloud-presence.left.logo.online-presence-option.hidden
.soundcloud-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/soundcloud-logo.png"
.reverbnation-presence.left.logo.online-presence-option.hidden
.reverbnation-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/reverbnation-logo.png"
.bandcamp-presence.left.logo.online-presence-option.hidden
.bandcamp-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/bandcamp-logo.png"
.fandalism-presence.left.logo.online-presence-option.hidden
.fandalism-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/fandalism-logo.png"
.youtube-presence.left.logo.online-presence-option.hidden
.youtube-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/youtube-logo.png"
.facebook-presence.left.logo.online-presence-option.hidden
.facebook-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/facebook-logo.png"
.twitter-presence.left.logo.online-presence-option.hidden
.twitter-presence.logo.online-presence-option.hidden
a rel="external"
img.logo src="/assets/content/twitter-logo.png"

View File

@ -1,11 +1,8 @@
.no-samples.left.performance-sample-option.hidden None specified
.jamkazam-samples.left.logo.performance-sample-option.hidden
.no-samples.performance-sample-option.hidden None specified
.jamkazam-samples.logo.performance-sample-option.hidden
img.logo src="/assets/header/logo.png"
br/
.soundcloud-samples.left.logo.performance-sample-option.hidden
.soundcloud-samples.logo.performance-sample-option.hidden
img.logo src="/assets/content/soundcloud-logo.png"
br/
.youtube-samples.left.logo.performance-sample-option.hidden
.youtube-samples.logo.performance-sample-option.hidden
img.logo src="/assets/content/youtube-logo.png"
br/

View File

@ -240,7 +240,7 @@
var accountProfileInterests = new JK.AccountProfileInterests(JK.app);
accountProfileInterests.initialize();
var accountProfileSamples = new JK.AccountProfileSamples(JK.app, $(".account-profile-samples"), api.getUserProfile, api.updateUser)
var accountProfileSamples = new JK.AccountProfileSamples(JK.app)
accountProfileSamples.initialize();
var accountAudioProfile = new JK.AccountAudioProfile(JK.app);

View File

@ -4,11 +4,10 @@
%h1
= 'select recordings'
.dialog-inner
%span{id: 'instructions'}
%br{:clear => "all"}/
%br{:clear => "all"}/
.instructions
= 'Select one or more recordings and click ADD to add JamKazam recordings to your performance samples.'
.recordings
.right.action-buttons
%a.button-grey.btn-cancel-dialog{'layout-action' => 'cancel'} CANCEL
%a.button-orange.btn-select-recordings SAVE
.end-of-list No more feed entries
.right.action-buttons
%a.button-grey.btn-cancel-dialog{'layout-action' => 'cancel'} CANCEL
%a.button-orange.btn-select-recordings SAVE

View File

@ -1,5 +1,8 @@
%script{type: 'text/template', id: 'template-feed-recording'}
.feed-entry.recording-entry{:'data-claimed-recording-id' => '{{data.candidate_claimed_recording.id}}', :'data-recording-id' => '{{data.feed_item.id}}' }
/ optional checkbox for cehcking
.select-box
%input{type: 'checkbox', 'data-recording-id' => '{{data.candidate_claimed_recording.id}}', 'data-recording-title' => '{{data.feed_item.helpers.name}}' }
/ avatar
.avatar-small.ib
%a{:hoveraction => "{{data.feed_item.helpers.artist_hoveraction}}", :profileaction => "{{data.feed_item.helpers.artist_hoveraction}}", :"{{data.feed_item.helpers.artist_datakey}}" => "{{data.feed_item.helpers.artist_id}}"}

View File

@ -156,6 +156,7 @@ if defined?(Bundler)
config.google_client_id = '785931784279-gd0g8on6sc0tuesj7cu763pitaiv2la8.apps.googleusercontent.com'
config.google_secret = 'UwzIcvtErv9c2-GIsNfIo7bA'
config.google_email = '785931784279-gd0g8on6sc0tuesj7cu763pitaiv2la8@developer.gserviceaccount.com'
config.google_public_server_key = "AIzaSyCPTPq5PEcl4XWcm7NZ2IGClZlbsiE8JNo"
# Use Private API Keys to communicate with Recurly's API v2. See https://docs.recurly.com/api/basics/authentication to learn more.
config.recurly_private_api_key = '7d623daabfc2434fa2a893bb008eb3e6'

View File

@ -20,4 +20,5 @@ Gon.global.web_performance_timing_enabled = Rails.application.config.web_perform
Gon.global.jamtrack_landing_bubbles_enabled = Rails.application.config.jamtrack_landing_bubbles_enabled
Gon.global.jamtrack_browser_bubbles_enabled = Rails.application.config.jamtrack_browser_bubbles_enabled
Gon.global.bugsnag_key = Rails.application.config.bugsnag_key
Gon.global.bugsnag_notify_release_stages = Rails.application.config.bugsnag_notify_release_stages
Gon.global.env = Rails.env

View File

@ -19,9 +19,9 @@ class Utils
when 'rec_youtube'
# regex derived from: https://gist.github.com/afeld/1254889
watch = (recording_url =~ /(youtu.be\/|youtube.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&\"\'>]+)/)
rec_data["id"] = $5 if watch
rec_data["id"] = $5 if watch
uri = URI.parse("https://gdata.youtube.com/feeds/api/videos/#{$5}?v=2&alt=json")
uri = URI.parse("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=#{$5}&key=#{APP_CONFIG.google_public_server_key}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https'
@ -31,8 +31,8 @@ class Utils
json = response.body.force_encoding("UTF-8")# .encode('UTF-8', :invalid => :replace, :replace => '')
json_hash = JSON.parse(json)
if watch && json_hash["entry"] && json_hash["entry"]["title"]
rec_data["title"] = json_hash["entry"]["title"]["$t"]
if watch && json_hash["items"] && json_hash["items"].length == 1
rec_data["title"] = json_hash["items"][0]["snippet"]["title"]
end
end

View File

@ -102,6 +102,10 @@ def web_config
def found_conflict_count
1
end
def google_public_server_key
"AIzaSyCPTPq5PEcl4XWcm7NZ2IGClZlbsiE8JNo"
end
end
klass.new
end

File diff suppressed because one or more lines are too long