Skip to content

Commit

Permalink
Forever users are required to update their profile name and photo bef…
Browse files Browse the repository at this point in the history
…ore sending invitations, fixes #28
  • Loading branch information
edorcutt committed May 7, 2013
1 parent fa2ea89 commit 584a648
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ <h3>Forever is linked to your personal cloud</h3>
<input type="text" name="inviteName" id="inviteName" placeholder="Name" required autofocus>
<input type="email" name="inviteEmail" id="inviteEmail" placeholder="Email" required>
<button type="submit" class="btn">Send Invitation</button>
<span class="help-block" style="display:none;">Update your profile name &amp; photo to send invitations.</span>
</form>

<h3>Open Invitations</h3>
Expand Down
22 changes: 22 additions & 0 deletions app/js/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ $(document).ready(function() {
// View: friend finder
function view_finder() {
$('#modalSpinner').show();
initInvitationForm();
getForeverInvitations();
show_view('finder');
// set_screen_title('Finder');
Expand Down Expand Up @@ -318,6 +319,27 @@ $(document).ready(function() {
// ========================================================================
// Friend Finder

// --------------------------------------------
// https://s3.amazonaws.com/k-mycloud/a169x672/unknown.png

function initInvitationForm() {
var myName = $('#myProfileName').val();
var myPhoto = $('#myProfilePhoto').val();

console.debug("myName: ", myName);
console.debug("myPhoto: ", myPhoto);

if (myName === '' || myPhoto === 'https://s3.amazonaws.com/k-mycloud/a169x672/unknown.png') {
$("form.form-finder span.help-block").show();
$("form.form-finder input").prop('disabled', true);
$("form.form-finder button").prop('disabled', true);
} else {
$("form.form-finder span.help-block").hide();
$("form.form-finder input").prop('disabled', false);
$("form.form-finder button").prop('disabled', false);
}
}

// --------------------------------------------
// GET list of Forever Invitations

Expand Down

0 comments on commit 584a648

Please sign in to comment.