-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.html
116 lines (103 loc) · 5.19 KB
/
calc.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<head><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-3362264853061823",
enable_page_level_ads: true
});
</script></head>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="273615037515-ebr6473ifcvjvs306tt9hq4ekt1d0q9l.apps.googleusercontent.com">
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://raw.githubusercontent.com/tebahpla/tebahpla.github.io/master/calculator-icon-21.ico">
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-CA"><head><section><a href="calc"><meta content="https://github.com/tebahpla/tebahpla.github.io/blob/master/ooglecalc.png?raw=true" itemprop="image">
<img src="https://github.com/tebahpla/tebahpla.github.io/blob/master/ooglecalc.png?raw=true" class="floatin_oogle" onload='loadXMLDoc()'><br>
</a><np id="greeting" translate="no"></np></section><br><br><br><br>
<script>
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
var user = "Example Name";
function checkCookie() {
user=getCookie("username");
if (user != "") {
document.getElementById("greeting").innerHTML="Let's do some math, " + user+"!";
document.getElementById("setr").innerHTML="Change Name";
} else {
user = "Example Name"
}
}
function setGreet(){
user = prompt("What would you like Oogle to call you?",user);
if (user != "" && user != null) {
setCookie("username", user, 300);
document.getElementById("greeting").innerHTML="Welcome, " + user+".";
document.getElementById("setr").innerHTML="Change Name";
}
}
function translater(){
var txt= prompt("Text to translate:");
document.getElementById('translator').innerHTML=txt;
}
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
user = profile.getName();
if(getCookie("signed") == null || getCookie("signed") == "" || getCookie("signed") == ' '){
user = profile.getName();
document.getElementById("greeting").innerHTML="Welcome, " + user+".";
setCookie("username", user, 3000);
setCookie("signed", "yes", 3000);
}
document.getElementById('sss').innerHTML=' | <a href="#" onclick="signOut();" >Sign out</a> ';
document.getElementById('logg').style.display = 'none';
}
function flipoff(id){
var e = document.getElementById(id);
if (e.style.display == 'block' || e.style.display=='') e.style.display = 'none'; else e.style.display = 'block';
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
console.log('User signed out.');
document.getElementById('logg').style.display = 'block';
document.getElementById('sss').innerHTML='';
});
}
</script>
<np><iframe width="500" height="400" src="https://www.desmos.com/scientific" frameborder="0" scrolling="no" align="middle" ></iframe><br>
<p>Powered by <a href="https://www.desmos.com/" class="deploylink" target="_blank"><u>desmos.com</u></a></p></np>
<br><br><br><p> <br><div id='links'></div> </p><br><br><br><br><br><br><br><br>
<section id="add" translate="no"><iframe src="https://docs.google.com/document/d/1tMcUEiUVSwaTo51Fa3otCdPMgKWPMxufmwhvaDs41Vk/pub?embedded=true" width="1000" height="1000" frameborder="0"></iframe></section>
<title translate="no">Oogle Calculator</title><div id="mySidenav" class="sidenav">
<a class='deployLink' href="#add" id="about" target='blank' translate="no"> Add Oogle to Chrome</a>
<a id="setr" onclick="setGreet()" translate="no">Set Name</a>
</div>
<link href="https://tebahpla.github.io/style.css" rel="stylesheet"><body onload="checkCookie()"><!-- Go to www.addthis.com/dashboard to customize your tools --> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58f14f9d42d58017"></script> </body>
<script>
$.get('https://ooogle.github.io/beta/menulinks.txt', function(a){
document.getElementById('links').innerHTML=a.replace('<a href="calc">Calculator</a>','<a href="https://tebahpla.github.io/newerhome">Search</a>');
});
</script>
</body>
</html>