This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3718 from gratipay/paint-the-walls
paint the walls
- Loading branch information
Showing
85 changed files
with
1,526 additions
and
1,613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
Gratipay.emails = {}; | ||
|
||
Gratipay.emails.post = function(e) { | ||
e.preventDefault(); | ||
var $this = $(this); | ||
var action = this.className; | ||
var $inputs = $('.emails button, .emails input'); | ||
console.log($this); | ||
var address = $this.parent().data('email') || $('input.add-email').val(); | ||
|
||
$inputs.prop('disabled', true); | ||
|
||
$.ajax({ | ||
url: 'modify.json', | ||
type: 'POST', | ||
data: {action: action, address: address}, | ||
dataType: 'json', | ||
success: function (msg) { | ||
if (msg) { | ||
Gratipay.notification(msg, 'success'); | ||
} | ||
if (action == 'add-email') { | ||
$('input.add-email').val(''); | ||
setTimeout(function(){ window.location.reload(); }, 3000); | ||
return; | ||
} else if (action == 'set-primary') { | ||
$('.emails li').removeClass('primary'); | ||
$this.parent().addClass('primary'); | ||
} else if (action == 'remove') { | ||
$this.parent().fadeOut(); | ||
} | ||
$inputs.prop('disabled', false); | ||
}, | ||
error: [ | ||
function () { $inputs.prop('disabled', false); }, | ||
Gratipay.error | ||
], | ||
}); | ||
}; | ||
|
||
|
||
Gratipay.emails.init = function () { | ||
|
||
// Wire up email addresses list. | ||
// ============================= | ||
|
||
$('.emails button, .emails input').prop('disabled', false); | ||
$('.emails button[class]').on('click', Gratipay.emails.post); | ||
$('form.add-email').on('submit', Gratipay.emails.post); | ||
|
||
|
||
// Wire up notification preferences | ||
// ================================ | ||
|
||
$('.email-notifications input').click(function(e) { | ||
var field = $(e.target).data('field'); | ||
var bits = $(e.target).data('bits') || 1; | ||
jQuery.ajax( | ||
{ url: '../emails/notifications.json' | ||
, type: 'POST' | ||
, data: {toggle: field, bits: bits} | ||
, dataType: 'json' | ||
, success: function(data) { | ||
Gratipay.notification(data.msg, 'success'); | ||
$(e.target).attr('checked', data.new_value & bits) | ||
} | ||
, error: [ | ||
Gratipay.error, | ||
function(){ $(e.target).attr('checked', !$(e.target).attr('checked')) }, | ||
] | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
$(document).ready(function() { | ||
$('#jump').submit(function (e) { | ||
$('.jump-box').submit(function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
|
||
var platform = Gratipay.trim($('#jump select').val()), | ||
val = Gratipay.trim($('#jump input').val()); | ||
var platform = Gratipay.trim($('.jump-box select').val()), | ||
val = Gratipay.trim($('.jump-box input').val()); | ||
if (val) window.location = '/on/' + platform + '/' + val + '/'; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.