This repository was archived by the owner on Apr 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
64 lines (44 loc) · 2.16 KB
/
script.js
File metadata and controls
64 lines (44 loc) · 2.16 KB
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
$(document).ready(function() {
$("#getMessage").on("click", function(){
num = Math.floor(Math.random() * 10);
string = caseInSwitch(num);
$(".rquoteText").html(string);
});
});
function cardTweet(){
var re = /<br>/gi;
var cleanString = string.replace(re, '');
if (cleanString.length>280){
cleanString=cleanString.slice(0,120);
cleanString=cleanString.concat("... -- Satprem");
}
var twtLink = 'https://twitter.com/intent/tweet?text=' +encodeURIComponent(cleanString);
window.open(twtLink,'_blank');
};
function caseInSwitch(val) {
var caseString = "";
switch (val) {
case 0:
caseString = "I become what I see in myself. All that thought suggests to me, I can do; all that thought reveals in me, I can become. This should be man's unshakeable faith in himself, because God dwells in him.<br><br> Sri Aurobindo,<br> Thoughts and Glimpses";
break;
case 1:
caseString = "The soul attracted leaned to the Abyss: <br> It longed for the adventure of Ignorance...<br><br> Sri Aurobindo,<br> Savitri"
break;
case 2:
caseString = "The heavens beyond are great and wonderful, but greater and more wonderful are the heavens within you. It is these Edens that await the divine worker.<br><br> Sri Aurobindo,<br> Hour of God";
break;
case 3:
caseString = "Our actual enemy is not any force exterior to ourselves, but our own crying weaknesses, our cowardice, our selfishness, our hypocrisy, our purblind sentimentalism.<br><br> Sri Aurobindo,<br> New Lamps for Old";
break;
case 4:
caseString = "For what the Spirit sees becomes a truth. <br> And what the soul imagines is made a world.<br><br> Sri Aurobindo,<br> Savitri";
break;
case 5:
caseString = "For Truth and knowldge are an idle gleam, <br> If Knowldge brings not power to change the world.<br><br> Sri Aurobindo,<br> Savitri";
break;
default:
caseString = "I never admitted a truth in the mind without simultaneously keeping it open to the contrary of it <br> And the first result was the prestige of the intellect was gone.<br><br> Sri Aurobindo,<br> Evening Talks";
break;
}
return caseString;
}