mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-17 03:45:25 +02:00
Implement Patreon token syncer
This commit is contained in:
20
webapp/titanembeds/static/js/patreon.js
Normal file
20
webapp/titanembeds/static/js/patreon.js
Normal file
@ -0,0 +1,20 @@
|
||||
/* global $, Materialize */
|
||||
(function () {
|
||||
function post() {
|
||||
var funct = $.ajax({
|
||||
dataType: "json",
|
||||
method: "POST",
|
||||
});
|
||||
return funct.promise();
|
||||
}
|
||||
|
||||
$("#syncbtn").click(function () {
|
||||
var formPost = post();
|
||||
formPost.done(function (data) {
|
||||
window.location.href = "thanks";
|
||||
});
|
||||
formPost.fail(function (data) {
|
||||
Materialize.toast('Failed to sync Patreon....', 10000);
|
||||
});
|
||||
});
|
||||
})();
|
Reference in New Issue
Block a user