-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContribute.html
60 lines (55 loc) · 2.5 KB
/
Contribute.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?
let locale = 'en';
try{ locale = getUserLocale(); }
catch(e){ alertMe("Error: " + e.message + "\r\nFile: " + e.fileName + "\r\nLine: " + e.lineNumber); }
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css">
<style>
#messageToUser {
border: 1px solid Gray;
background-color: pink;
color: Gray;
padding: 12px;
}
</style>
</head>
<body>
<div id="messageToUser"></div>
<input id="idAccountOfEffectiveUsr" type="hidden" style="display:none" value="<?!= Session.getEffectiveUser().getEmail(); ?>"/>
<script>
let failedAcctTest = function(rtrn) {
$('.spinner').hide();
let usrWhoLoaded = document.getElementById('idAccountOfEffectiveUsr').textContent;
if (usrWhoLoaded !== rtrn) {
document.getElementById('messageToUser').textContent = "<?=__('The Add-on loaded under the account:',locale)?>" + " <" + usrWhoLoaded + ">" +
"\n\n" + "<?=__('However you are also logged into another account in this browser:',locale)?>" + " <" + rtrn + ">" +
"\n\n" + "<?=__('Being logged into multiple accounts in the same browser session causes authorization errors.',locale)?>" +
"\n\n" + "<?=__('In order to proceed, you must either log out of all accounts, and log back into the account that installed the add-on, or open an incognito window, log in with the account that installed the add-on and use the add-on from that window.',locale)?>" +
"\n\n" + "<?=__('The best practice to avoid these problems is to login to your accounts using the browser\'s own account manager. That way you have a different browser session for each account that you would like to use.',locale)?>";
}
},
successAcctTest = function(rtrn) {
$('#messageToUser').hide();
};
</script>
<div style="text-align:justify;">
<?!=__("The BibleGet I/O Project with it's server",locale)?>
</div>
<div style="text-align:center;border:2px outset Orange;border-radius:15px;background:Yellow;color:Red;height:60px;padding:5px;margin:30px;cursor:pointer;" >
<a id="submitme" href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HDS7XQKGFHJ58" target="_blank">
<?!= include("Paypal_"+locale); ?>
</a>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
google.script.run.withFailureHandler(failedAcctTest).withSuccessHandler(successAcctTest).getEffectiveUserEM();
$('#submitme').click(function(){
google.script.host.close();
});
});
</script>
</body>