24 function delayedFadeOut(time, element) {
25 $(element).delay(time).fadeOut();
29 $(
".pat-revoke").on(
'click',
function(e) {
31 var tokenId = button.id.split(
'-')[1];
32 var parentTr = $(button).parent().parent();
39 url :
"?mod=manage-token",
40 success :
function(data) {
41 if (data.status ==
true) {
42 button.disabled =
true;
44 .html(
"<td colspan='6'>The token is revoked</td>");
45 delayedFadeOut(5000, parentTr);
47 var infoMessage = $(
"<td>Unable to revoke token</td>");
48 parentTr.append(infoMessage);
49 delayedFadeOut(5000, infoMessage);
52 error :
function(data) {
53 var infoMessage = $(
"<td>Some error occured</td>");
54 parentTr.append(infoMessage);
55 delayedFadeOut(5000, infoMessage);
60 $(
".pat-reveal").on(
'click',
function(e) {
62 var tokenId = button.id.split(
'-')[1];
63 var parentTr = $(button).parent().parent();
70 url :
"?mod=manage-token",
71 success :
function(data) {
72 if (data.status ==
true) {
73 button.disabled =
true;
74 var tokenDisplay = $(
"<tr><td colspan='6'>" 75 +
"<textarea readonly style='width:100%'>" + data.token
76 +
"</textarea></td></tr>");
77 parentTr.after(tokenDisplay);
79 var infoMessage = $(
"<tr><td colspan='6'>" 80 +
"<textarea readonly style='width:100%'>" 81 +
"Unable to reveal token</textarea></td></tr>");
82 parentTr.after(infoMessage);
83 delayedFadeOut(5000, infoMessage);
86 error :
function(data) {
87 var infoMessage = $(
"<tr><td colspan='6'>" 88 +
"<textarea readonly style='width:100%'>" 89 +
"Some error occured</textarea></td></tr>");
90 parentTr.after(infoMessage);
91 delayedFadeOut(5000, infoMessage);