VRFS-1110 fixed integration of InviteMusiciansUtil to band setup
This commit is contained in:
parent
a91092a048
commit
b428bbb913
|
|
@ -15,6 +15,7 @@
|
|||
var invitationDialog = null;
|
||||
var nilOptionText = 'n/a';
|
||||
var bandId = '';
|
||||
var friendInput=null;
|
||||
|
||||
function is_new_record() {
|
||||
return bandId.length == 0;
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
$("#band-setup-step-1").show();
|
||||
$("#band-setup-step-2").hide();
|
||||
|
||||
$('#friend-input')
|
||||
$(friendInput)
|
||||
.unbind('blur')
|
||||
.attr("placeholder", "Looking up friends...")
|
||||
.prop('disabled', true)
|
||||
|
|
@ -442,12 +443,12 @@
|
|||
invitationDialog.showFacebookDialog();
|
||||
});
|
||||
|
||||
$('#friend-input').focus(function() { $(this).val(''); })
|
||||
$(friendInput).focus(function() { $(this).val(''); })
|
||||
}
|
||||
|
||||
function initialize(invitationDialogInstance, inviteMusiciansUtilInstance) {
|
||||
inviteMusiciansUtil = inviteMusiciansUtilInstance;
|
||||
inviteMusiciansUtil.inviteBandCreate('#band-setup-invite-musicians');
|
||||
friendInput = inviteMusiciansUtil.inviteBandCreate('#band-setup-invite-musicians');
|
||||
invitationDialog = invitationDialogInstance;
|
||||
events();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
var inviteMusiciansUtil = null;
|
||||
var MAX_GENRES = 1;
|
||||
var sessionSettings = {};
|
||||
var friendInput = null;
|
||||
|
||||
function beforeShow(data) {
|
||||
inviteMusiciansUtil.clearSelections();
|
||||
|
|
@ -60,7 +61,7 @@
|
|||
context.JK.dropdown($('#musician-access', $form));
|
||||
context.JK.dropdown($('#fan-access', $form));
|
||||
|
||||
$('#friend-input')
|
||||
$(friendInput)
|
||||
.unbind('blur')
|
||||
.attr("placeholder", "Looking up friends...")
|
||||
.prop('disabled', true)
|
||||
|
|
@ -233,7 +234,7 @@
|
|||
invitationDialog.showFacebookDialog(e);
|
||||
});
|
||||
|
||||
$('#friend-input').focus(function() { $(this).val(''); })
|
||||
$(friendInput).focus(function() { $(this).val(''); })
|
||||
}
|
||||
|
||||
function toggleMusicianAccess() {
|
||||
|
|
@ -306,7 +307,7 @@
|
|||
function initialize(invitationDialogInstance, inviteMusiciansUtilInstance) {
|
||||
invitationDialog = invitationDialogInstance;
|
||||
inviteMusiciansUtil = inviteMusiciansUtilInstance;
|
||||
inviteMusiciansUtil.inviteSessionCreate('#create-session-invite-musicians');
|
||||
friendInput = inviteMusiciansUtil.inviteSessionCreate('#create-session-invite-musicians');
|
||||
events();
|
||||
loadBands();
|
||||
loadSessionSettings();
|
||||
|
|
|
|||
|
|
@ -14,16 +14,22 @@
|
|||
var autoComplete = null;
|
||||
var rest = context.JK.Rest();
|
||||
var inviteAction = 'create'; // create/update
|
||||
var friendInput = null;
|
||||
var updateSessionID = null;
|
||||
|
||||
this.inviteSessionCreate = function(elemSelector) {
|
||||
inviteAction = 'create';
|
||||
function _initInvite(elemSelector, iAction) {
|
||||
inviteAction = iAction;
|
||||
friendInput = '#friend-input-'+inviteAction;
|
||||
_appendFriendSelector($(elemSelector));
|
||||
return friendInput;
|
||||
}
|
||||
|
||||
this.inviteSessionCreate = function(elemSelector) {
|
||||
return _initInvite(elemSelector, 'create')
|
||||
};
|
||||
|
||||
this.inviteBandCreate = function(elemSelector) {
|
||||
inviteAction = 'band';
|
||||
_appendFriendSelector($(elemSelector));
|
||||
return _initInvite(elemSelector, 'band')
|
||||
};
|
||||
|
||||
this.inviteSessionUpdate = function(elemSelector, sessionId) {
|
||||
|
|
@ -78,10 +84,10 @@
|
|||
autoSelectFirst: true
|
||||
};
|
||||
|
||||
$('#friend-input').attr("placeholder", "Type a friend\'s name").prop('disabled', false);
|
||||
autoComplete = $('#friend-input').autocomplete(autoCompleteOptions);
|
||||
$(friendInput).attr("placeholder", "Type a friend\'s name").prop('disabled', false);
|
||||
autoComplete = $(friendInput).autocomplete(autoCompleteOptions);
|
||||
/*if (!autoComplete) {
|
||||
autoComplete = $('#friend-input').autocomplete(autoCompleteOptions);
|
||||
autoComplete = $(friendInput).autocomplete(autoCompleteOptions);
|
||||
} else {
|
||||
autoComplete.setOptions(autoCompleteOptions);
|
||||
}*/
|
||||
|
|
@ -89,7 +95,7 @@
|
|||
$(".autocomplete").width("150px");
|
||||
})
|
||||
.fail(function() {
|
||||
$('#friend-input').attr("placeholder", "Unable to lookup friends");
|
||||
$(friendInput).attr("placeholder", "Unable to lookup friends");
|
||||
app.ajaxError(arguments);
|
||||
});
|
||||
}
|
||||
|
|
@ -119,11 +125,11 @@
|
|||
userName: value,
|
||||
imageStyle: imgStyle});
|
||||
$('.selected-friends').append(invitationHtml);
|
||||
$('#friend-input').select();
|
||||
$(friendInput).select();
|
||||
invitedFriends.push(data);
|
||||
|
||||
} else {
|
||||
$('#friend-input').select();
|
||||
$(friendInput).select();
|
||||
context.alert('Invitation already exists for this musician.');
|
||||
}
|
||||
}
|
||||
|
|
@ -195,7 +201,8 @@
|
|||
function _friendSelectorHTML() {
|
||||
return context.JK.fillTemplate($('#template-session-invite-musicians').html(),
|
||||
{choose_friends_id: 'btn-choose-friends-'+inviteAction,
|
||||
selected_friends_id: 'selected-friends-'+inviteAction});
|
||||
selected_friends_id: 'selected-friends-'+inviteAction,
|
||||
friend_input: friendInput.substring(1,friendInput.length)});
|
||||
}
|
||||
|
||||
function _appendFriendSelector(elemSelector) {
|
||||
|
|
|
|||
|
|
@ -95,18 +95,6 @@
|
|||
<h2>Step 2: Add Band Members</h2><br/>
|
||||
<div class="left w70">If your bandmates are already on JamKazam, start typing their names in the box<br/> below, or click the Choose Friends button to select them.</div>
|
||||
<div id="band-setup-invite-musicians"></div>
|
||||
|
||||
<!--<div class="right" layout-link="select-friends">
|
||||
<a href="#" id="btn-band-choose-friends" class="button-grey right">CHOOSE FRIENDS</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
<br />
|
||||
|
||||
<div class="friendbox">
|
||||
<div id="selected-band-invitees"></div>
|
||||
<input id="band-invitee-input" type="text" placeholder="Looking up friends..." width="150px" />
|
||||
</div>
|
||||
<br/><br/>-->
|
||||
If your bandmates are not on JamKazam yet, use any of the options below to invite them to join the service.<br/><br/>
|
||||
|
||||
<div class="left mr20">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<!-- friend invitation box -->
|
||||
<div class="friendbox">
|
||||
<div class="selected-friends" id="{selected_friends_id}"></div>
|
||||
<input id="friend-input" type="text" placeholder="Looking up friends..." />
|
||||
<input id="{friend_input}" type="text" placeholder="Looking up friends..." />
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -132,9 +132,6 @@
|
|||
var friendSelectorDialog = new JK.FriendSelectorDialog(JK.app);
|
||||
friendSelectorDialog.initialize();
|
||||
|
||||
var inviteMusiciansUtil = new JK.InviteMusiciansUtil(JK.app);
|
||||
inviteMusiciansUtil.initialize(friendSelectorDialog);
|
||||
|
||||
var userDropdown = new JK.UserDropdown(JK.app);
|
||||
JK.UserDropdown = userDropdown;
|
||||
userDropdown.initialize(invitationDialog);
|
||||
|
|
@ -177,11 +174,15 @@
|
|||
JK.GenreSelectorHelper.initialize();
|
||||
JK.Banner.initialize();
|
||||
|
||||
var inviteMusiciansUtil1 = new JK.InviteMusiciansUtil(JK.app);
|
||||
inviteMusiciansUtil1.initialize(friendSelectorDialog);
|
||||
var createSessionScreen = new JK.CreateSessionScreen(JK.app);
|
||||
createSessionScreen.initialize(invitationDialog, inviteMusiciansUtil);
|
||||
createSessionScreen.initialize(invitationDialog, inviteMusiciansUtil1);
|
||||
|
||||
var inviteMusiciansUtil2 = new JK.InviteMusiciansUtil(JK.app);
|
||||
inviteMusiciansUtil2.initialize(friendSelectorDialog);
|
||||
var bandSetupScreen = new JK.BandSetupScreen(JK.app);
|
||||
bandSetupScreen.initialize(invitationDialog, inviteMusiciansUtil);
|
||||
bandSetupScreen.initialize(invitationDialog, inviteMusiciansUtil2);
|
||||
|
||||
var bandSetupPhotoScreen = new JK.BandSetupPhotoScreen(JK.app);
|
||||
bandSetupPhotoScreen.initialize();
|
||||
|
|
@ -202,8 +203,10 @@
|
|||
var findBandScreen = new JK.FindBandScreen(JK.app);
|
||||
findBandScreen.initialize();
|
||||
|
||||
var inviteMusiciansUtil3 = new JK.InviteMusiciansUtil(JK.app);
|
||||
inviteMusiciansUtil3.initialize(friendSelectorDialog);
|
||||
var sessionScreen = new JK.SessionScreen(JK.app);
|
||||
sessionScreen.initialize(localRecordingsDialog, recordingFinishedDialog, inviteMusiciansUtil);
|
||||
sessionScreen.initialize(localRecordingsDialog, recordingFinishedDialog, inviteMusiciansUtil3);
|
||||
|
||||
var sessionSettingsDialog = new JK.SessionSettingsDialog(JK.app, sessionScreen);
|
||||
sessionSettingsDialog.initialize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue