-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMM-Confucius-say.js
396 lines (376 loc) · 27.2 KB
/
MMM-Confucius-say.js
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
Module.register("MMM-Confucius-say",{
// edit these
defaults: {
updateInterval: 30, // how long a quote stays up in seconds
fadeSpeed: 30, // fade out of text in seconds
category: 'random', // pick a category below, or use 'random'
quotes: {
lewd: [
"Confucius say, virginity like bubble. One prick - all gone",
"Confucius say, bird in the hand is not better than two in the bush",
"Confucius say, man who do business in whore house get jerked around",
"Confucius say, gypsies got no babies because gypsies have crystal balls",
"Confucius say, panties not best thing on earth, but next to it",
"Confucius say, war not determine who right. War determine who left",
"Confucius say, woman who put husband in doghouse soon find him in cat house",
"Confucius say, man who fight with wife all day, get no piece at night",
"Confucius say, it take many nail to build crib, one screw to fill it",
"Confucius say, man who keep feet on ground have trouble putting on pants",
"Confucius say, if you want pretty nurse, you got to be patient",
"Confucius say, passionate kiss like spider web, soon lead to undoing of fly",
"Confucius say, man with hand in pocket feel cocky all day long",
"Confucius say, couple on seven day honeymoon make whole week",
"Confucius say, woman who go camping must beware of evil intent",
"Confucius say, squirrel who runs up woman's leg not find nuts",
"Confucius say, man who run before bus get tired",
"Confucius say, man who run behind bus get exhausted",
"Confucius say, man with tool in woman's mouth not necessarily dentist",
"Confucius say, man who make love on side of hill not on level",
"Confucius say, sex is like the army, the closer you are to discharge, the better you feel",
"Confucius say, man with tight trousers is pressing his luck",
"Confucius say, man who stand on toilet high on pot",
"Confucius say, man who eat crackers in bed wake up feeling crummy",
"Confucius say, man with hand in pocket all day not crazy, just feeling nuts",
"Confucius say, man who sleep in bed of nails is holy",
"Confucius say, do not drink and park, accidents cause people",
"Confucius say, man who put pea in soup very unclean",
"Confucius say, man who run through airport turnstile sideways going to Bangkok",
"Confucius say, boy who go to sleep with sex problem on mind wake up with solution in hand",
"Confucius say, man who fishes in another woman's well, often catches crab",
"Confucius say, to meet girl in park is good, but to park meat in girl is better",
"Confucius say, squirrel lay on rock and crack nuts, man lay on crack and rock nuts",
"Confucius say, butcher who back into meat grinder get a little behind in his orders",
"Confucius say, electrician get much angry when find shorts in wife's bedroom¦",
"Confucius say, man who shoot off mouth, must expect to lose face",
"Confucius say, man with big mouth beware of foot",
"Confucius say, man who fart in church, sit in own pew",
"Confucius say, woman who fly upside down have crack up",
"Confucius say, man who leap off cliff jump to conclusion",
"Confucius say, man under wheelbarrow playing with tool, not necessarily mechanic",
"Confucius say, house without bathroom is uncanny",
"Confucius say, foolish man give wife grand piano, wise man give wife upright organ",
"Confucius say, man who sits on stool smells like shit",
"Confucius say, man who throws dirt is losing ground",
"Confucius say, woman who go to man's apartment for snack, get titbit",
"Confucius say, man who lay woman on ground, get piece on earth",
"Confucius say, man who get kicked in testicles, left holding the bag",
"Confucius say, man who kisses girl's behind, get crack in face",
"Confucius say, girl who ride bicycle, peddle ass all over town",
"Confucius say, man with penis in peanut butter jar, fucking nuts",
"Confucius say, man who buy drowned cat, get wet pussy",
"Confucius say, man trapped in pantry, have ass in jam",
"Confucius say, learn to masturbate - come in handy",
"Confucius say, girl who sit on jockey's lap get hot tip",
"Confucius say, girl who sit on judge's lap get honorable discharge",
"Confucius say, waitress who sit on leper's lap, keep tip",
"Confucius say, man who snort coke, get bubbles up nose",
"Confucius say, cow with no legs, ground beef",
"Confucius say, two wrongs not make right, but two rights make U-turn",
"Confucius say, baby born in car with automatic transmission, grow to become shiftless bastard",
"Confucius say, finding old man in dark, not hard",
"Confucius say, man who smoke pot, choke on handle",
"Confucius say, OK for shit to happen - will decompose",
"Confucius say, man with head on railroad track, listening for train to come, get splitting headache",
"Confucius say, man who sneeze without tissue take matter into own hands",
"Confucius say, secretary become permanent fixture, when screwed on desk",
"Confucius say, man who drive like hell, bound to get there",
"Confucius say, man who sit on tack, get point",
"Confucius say, man who put cream in tart, not always baker",
"Confucius say, woman who spend much time on bedspring, may get offspring",
"Confucius say, sex on beach like American beer - fucking near water",
"Confucius say, man who masturbate, only screwing himself",
"Confucius say, woman who dance wearing jock strap, have make believe ballroom",
"Confucius say, support bacteria - is only culture some people have",
"Confucius say, man with athletic finger, make broad jump",
"Confucius say, man who sit on upturned tack, rise above all",
"Confucius say, wash face in morning, neck at night",
"Confucius say, man who have last laugh, not get joke",
"Confucius say, man who sleep with old hen, find it better than pullet",
"Confucius say, man piss in wind, wind piss back",
"Confucius say, man who eat pussy, do lip service",
"Confucius say, girl who marry detective, like to kiss dick",
"Confucius say, men may have more hair on chest than woman, but on the whole, women have more",
"Confucius say, woman wearing G-string, high on crack",
"Confucius say, virgin with thimble on finger, never feel prick",
"Confucius say, man who pull woman's bra strap, may get bust in face",
"Confucius say, woman who pounce on dead rooster, go down on limp cock",
"Confucius say, man who fall in vat of molten glass, make spectacle of self",
"Confucius say, man who jump through screen door, strain self",
"Confucius say, man who push piano down mine shaft, likely to get A flat minor",
"Confucius say, man who put face in punchbowl, get punch in nose",
"Confucius say, woman who sink in man's arms, soon have arms in man's sink",
"Confucius say, man who put cock on stove, have hot rod",
"Confucius say, man who fuck in cemetery may end up fucking dead",
"Confucius say, man who jizz in cash register come into money",
"Confucius say, man who drop watch in toilet have shitty time",
"Confucius say, closed mouth catches no flies, but closed fly catches no mouths",
"Confucius say, man who finger girl having period get caught red handed",
"Confucius say, man who go to bed with itchy butt wake up with smelly fingers",
],
serious: [
"Confucius say, Man who runs in front of car gets tired; man who runs behind car gets exhausted.",
"Confucius say, Man who stands on toilet is high on pot.",
"Confucius say, War does not determine who is right, it determines who is left.",
"Confucius say, Man who cuts himself while shaving loses face.",
"Confucius say, Man who sits on tack gets the point!",
"Confucius say, Man who drives like hell is bound to get there.",
"Confucius say, He who laughs last didn’t get the joke.",
"Confucius say, Man who leaps off cliff jumps to conclusion.",
"Confucius say, Man who sneezes without tissue takes matters into his own hands.",
"Confucius say, House without toilet is uncanny.",
"Confucius say, Man who fights with wife all day gets no peace at night.",
"Confucius say, Man who eats too many prunes sits on problem.",
"Confucius say, Man who pushes piano down mineshaft gets tone of A flat miner.",
"Confucius say, Man who sits on hot stove will rise again.",
"Confucius say, Man who throws dirt is losing ground.",
"Confucius say, Man who puts head in sand will get kicked in the end.",
"Confucius say, Man who walks through airport turnstile sideways is going to Bangkok.",
"Confucius say, Man who sleeps with itchy feet wakes up with stinky fingers.",
"Confucius say, Man who plays with fire may end up with burnt fingers.",
"Confucius say, Man who falls in vat of molten glass makes a spectacle of himself.",
"Confucius say, Man who puts eggs in one basket might make an omelet.",
"Confucius say, Man who tells one too many light bulb jokes is dim-witted.",
"Confucius say, Man who drinks too much makes a good bartender laugh.",
"Confucius say, Man who criticizes others’ garden will find his own overgrown.",
"Confucius say, Man who fishes in another’s well may catch more than he bargained for.",
"Confucius say, Man who stands on mountain top sees the world, but may get altitude sickness.",
"Confucius say, Man who gets too big for his britches will be exposed in the end.",
"Confucius say, Man who procrastinates makes easy jobs hard and hard jobs harder.",
"Confucius say, Man who puts hand on stove doesn’t need to be told it’s hot.",
"Confucius say, Man who walks with head in clouds must beware of trees.",
"Confucius say, Wise man knows when to keep mouth shut; wiser man knows when to open it.",
"Confucius say, Foolish man seeks answers, wise man knows which questions to ask.",
"Confucius say, Man with much knowledge can still make a big mistake.",
"Confucius say, Wise man doesn’t know everything, but he knows where to find it.",
"Confucius say, Man who knows nothing speaks loudly; wise man speaks softly and carries a big brain.",
"Confucius say, Wise man admits his faults; fool denies them and repeats them.",
"Confucius say, Man who chases two rabbits catches neither, but has a lot of fun trying.",
"Confucius say, Wisdom is knowing tomato is a fruit; common sense is not putting it in a fruit salad.",
"Confucius say, Man who thinks he knows it all is most often wrong.",
"Confucius say, Wise man learns from others’ mistakes; fool makes his own and calls it experience.",
"Confucius say, Wisdom is like a good meal: better when shared, but some prefer to keep it all to themselves.",
"Confucius say, Wise man can see through fog; foolish man just gets lost in it.",
"Confucius say, Knowledge is power, but wisdom is knowing how to use it without blowing things up.",
"Confucius say, Wise man knows he is not wise, but keeps quiet so others think he is.",
"Confucius say, Man who knows he doesn’t know much is on the path to wisdom.",
"Confucius say, Wisdom is realizing you’re not the center of the universe, but acting like you are when needed.",
"Confucius say, Man who asks for advice may already know the answer but enjoys hearing it from someone else.",
"Confucius say, Wise man always carries a pen, because wisdom sometimes needs to be written down.",
"Confucius say, Foolish man demands respect; wise man earns it without trying.",
"Confucius say, Wise man knows the difference between being busy and being productive.",
"Confucius say, Man who knows the answer but asks anyway is either wise or testing you.",
"Confucius say, Wisdom is understanding that even a stopped clock is right twice a day.",
"Confucius say, Man who listens to everyone ends up knowing nothing; wise man knows whom to ignore.",
"Confucius say, Wise man knows the right time to be silent and the wrong time to speak up.",
"Confucius say, Man who seeks wisdom should also seek a sense of humor, for wisdom alone can be boring.",
"Confucius say, Wise man knows when to walk away; fool sticks around for the argument.",
"Confucius say, Wisdom is knowing when to keep your shoes on in someone else’s home.",
"Confucius say, Wise man knows the journey is more important than the destination but enjoys both.",
"Confucius say, Man who knows he cannot know everything is closer to wisdom than the one who thinks he can.",
"Confucius say, Wise man can admit when he’s wrong, but he usually isn’t.",
"Confucius say, Life is like a sandwich—no matter which way you flip it, the bread comes first.",
"Confucius say, Success is like a ladder; those at the top should never look down.",
"Confucius say, Life is a journey, but sometimes it’s okay to take the scenic route.",
"Confucius say, The road to success is always under construction.",
"Confucius say, In life, it’s better to be a tortoise with a plan than a hare with an attitude.",
"Confucius say, Man who chases two rabbits catches none; better to chase a cheeseburger.",
"Confucius say, Success is a door marked “push” when it should have been “pull.”",
"Confucius say, Life is short, so eat dessert first—unless it’s pudding.",
"Confucius say, The secret to success is starting before you’re ready.",
"Confucius say, Life is like a mirror; it only smiles back when you do.",
"Confucius say, Success is the ability to go from one failure to another without losing enthusiasm.",
"Confucius say, Life is what happens when you’re busy making other plans—and forgetting them.",
"Confucius say, Success is 10% inspiration, 90% perspiration, and 100% avoiding distractions.",
"Confucius say, Life is like a game of chess; sometimes it’s better to be a pawn with a plan.",
"Confucius say, Success is like wrestling a gorilla; you don’t quit when you’re tired, you quit when the gorilla is tired.",
"Confucius say, Life is what you make of it, so try not to make a mess.",
"Confucius say, Success comes to those who wait, but only after those who hustle.",
"Confucius say, Life is like a bicycle; to keep your balance, you must keep moving—unless you’re on a stationary bike.",
"Confucius say, Success is knowing which ladder to climb and which snakes to avoid.",
"Confucius say, In life, it’s not the years in your life that count, it’s the life in your years—and maybe a good nap.",
"Confucius say, Success is not the key to happiness; happiness is the key to success—and good Wi-Fi.",
"Confucius say, Life is like a cup of tea; it’s all in how you make it, but sometimes it’s too hot to handle.",
"Confucius say, Success is like a snowball; it takes time to build, but once it’s rolling, watch out!",
"Confucius say, Life is what you make it, so if you don’t like it, change the recipe.",
"Confucius say, Success is being able to laugh at yourself without needing a reason.",
"Confucius say, Life is a balance of holding on and letting go—especially of junk mail.",
"Confucius say, Success is waking up each morning, putting on your pants, and being ready to conquer the world—or at least breakfast.",
"Confucius say, Life is like a camera; focus on the good times, develop from the negatives, and if things don’t work out, take another shot.",
"Confucius say, Success is a journey, not a destination, but it helps to have a good map—and maybe some snacks.",
"Confucius say, Life is what you bake of it, so be sure to add plenty of sweetness and avoid burnt edges.",
"Confucius say, Man who works hard all day gets very tired, but at least he sleeps soundly. ",
"Confucius say, Hard work never killed anyone, but why take the chance ",
"Confucius say, Man who digs with a small shovel takes longer, but builds bigger muscles. ",
"Confucius say, Hard work is the yeast that raises the dough, but too much work and you get burnt toast. ",
"Confucius say, Man who sweats more in practice sweats less in stress. ",
"Confucius say, The early bird gets the worm, but the second mouse gets the cheese—so work smarter, not harder. ",
"Confucius say, Hard work is like a staircase; you may not see the top, but each step takes you closer. ",
"Confucius say, Man who works hard by day, sleeps hard by night, and dreams of weekends. ",
"Confucius say, Hard work is the engine that drives success, but don’t forget to stop for gas. ",
"Confucius say, Man who works with both hands is better than man who only works with one—unless he’s juggling. ",
"Confucius say, Hard work beats talent when talent doesn’t work hard, but talent plus hard work is unstoppable. ",
"Confucius say, Man who plants trees works hard, but shade and fruit are worth the effort. ",
"Confucius say, Hard work is like trying to push a boulder uphill; it’s tough, but at least you build strong legs. ",
"Confucius say, Man who breaks sweat every day will find his shirt in the laundry more often. ",
"Confucius say, Hard work pays off in the future, but laziness pays off now. ",
"Confucius say, Man who puts in the hours, gets the reward—or at least a coffee break. ",
"Confucius say, Hard work is the price of admission to the theater of success. ",
"Confucius say, Man who chops his own wood warms himself twice, but also needs a hot bath. ",
"Confucius say, Hard work is a path to success, but make sure you’re on the right road. ",
"Confucius say, Man who works hard and plays hard eventually gets very, very tired. ",
"Confucius say, Hard work is like a hammer; it can shape your future or wear you out. ",
"Confucius say, Man who pushes himself to the limit often finds the limit is just a bit farther. ",
"Confucius say, Hard work and perseverance are the keys to success, but sometimes the lock is rusty. ",
"Confucius say, Man who works hard for a penny learns the value of a dollar. ",
"Confucius say, Hard work is like a treadmill; you may not move forward, but you sure do sweat a lot. ",
"Confucius say, Man who digs well finds water; man who digs too much finds blisters. ",
"Confucius say, Hard work is the mother of success, but even mothers need a break. ",
"Confucius say, Man who puts his nose to the grindstone must also mind his nose. ",
"Confucius say, Hard work is the foundation of achievement, but sometimes a nap is the roof. ",
"Confucius say, Man who gives 110% must also have 10% extra somewhere. ",
"Confucius say, Good morning! Even the rooster knows when to crow; let’s hope your alarm clock is just as smart. ",
"Confucius say, Morning is the first step of the day, so make sure you’re headed in the right direction. ",
"Confucius say, Man who wakes up early gets a head start on the day—or at least on the coffee. ",
"Confucius say, Good morning! The early bird may get the worm, but the second mouse gets to sleep in. ",
"Confucius say, Rise and shine! The sun is up, and so should you be—unless you’re nocturnal. ",
"Confucius say, Morning is like a fresh cup of coffee; it’s best when it’s hot and full of energy. ",
"Confucius say, Man who greets the morning with a smile starts the day off right—or at least confuses the alarm clock. ",
"Confucius say, Good morning! Remember, today is a blank page, so write something worth reading—after your coffee. ",
"Confucius say, The early bird gets the worm, but man who stays in bed dreams of pancakes. ",
"Confucius say, Morning is the best time to make plans—before reality wakes up. ",
"Confucius say, Good morning! Man who wakes with enthusiasm starts the day on the right foot—or at least with both feet out of bed. ",
"Confucius say, Morning is the start of a new adventure—so grab your map, and maybe a GPS. ",
"Confucius say, Man who wakes up grumpy missed his date with the snooze button. ",
"Confucius say, Good morning! The sun is shining, and so should your smile—unless you’re still in bed. ",
"Confucius say, Morning is like a new pair of shoes; it’s best to break it in slowly. ",
"Confucius say, Man who greets the day with a yawn should have gone to bed earlier. ",
"Confucius say, Good morning! Today is full of possibilities—just make sure you don’t hit “snooze” on them. ",
"Confucius say, Morning is a fresh start, so hit the ground running—just watch out for the doorframe. ",
"Confucius say, Man who embraces the morning gets a hug from success—or at least a good stretch. ",
"Confucius say, Good morning! The rooster has crowed, the sun is up, and the day is yours—go get it! ",
"Confucius say, Morning is like a clean slate; just be careful not to spill your coffee on it. ",
"Confucius say, Man who rises early catches the sunrise, but also catches cold if he forgets his jacket. ",
"Confucius say, Good morning! The day is new, and so are your opportunities—time to make the most of them. ",
"Confucius say, Morning is a chance to start over—so let’s make today better than yesterday. ",
"Confucius say, Man who wakes up happy has already won the first battle of the day. ",
"Confucius say, Good morning! The sky’s the limit today—unless you forgot your ladder. ",
"Confucius say, Morning is like a fresh breeze; take a deep breath and enjoy it—before it turns into a whirlwind. ",
"Confucius say, Man who faces morning with a smile will find that the day smiles back. ",
"Confucius say, Good morning! The day is bright, and so should be your attitude—unless you need sunglasses. ",
"Confucius say, Morning is a new beginning, so step out with confidence—just watch out for puddles. ",
],
other: [
"Confucius say, man who walk in front of car gets tired, man who walk behind car get exhausted.",
"Confucius say, man who not crap for many days must deal with backlog.",
"Confucius say, man who cut self while shaving lose face.",
"Confucius say, man who leap off cliff, jump to conclusion.",
"Confucius say, man with five penises have pants that fit like glove.",
"Confucius say, man who walk through airport door sideways going to Bangkok.",
"Confucius say, man who sneeze without tissue takes matter in own hand.",
"Confucius say, squirrel who runs up lady leg will not find nuts.",
"Confucius say, man who laugh last, probably not get joke.",
"Confucius say, man who live in glass house should get changed in basement.",
"Confucius say, constipated man not give a crap.",
"Confucius say, woman who put man in dog house soon find him in cat house.",
"Confucius say, man who pee against wind going to get his own back.",
"Confucius say, man with hole in pocket feel cocky all day.",
"Confucius say, man with hole in both pockets not feel too cocky.",
"Confucius say, man who pee through screen door is straining himself.",
"Confucius say, man who go to bed with itchy bum wake up with smelly finger.",
"Confucius say, man who make mistake in elevator wrong on many levels.",
"Confucius say, early bird gets worm but second mouse gets the cheese.",
"Confucius say, virginity like bubble, one prick all gone.",
"Confucius say, man who fart in church, sit in own pew.",
"Confucius say, many nails needed to make baby crib, only one screw needed to fill it.",
"Confucius say, man who enter diarrhea lottery, winnie the pooh.",
"Confucius say, woman laid in tomb may become mummy.",
"Confucius say, man who eats crackers in bed wake up feeling crumby.",
"Confucius say, romantic kiss, like spider web, leads to undoing of fly.",
"Confucius say, woman who fly upside down, have crack up.",
"Confucius say, man who sleep on bed of nails is holy.",
"Confucius say, man who eat many prunes get good run for money.",
"Confucius say, man who stand on toilet high on pot.",
"Confucius say, war not determine who right, war determine who left.",
"Confucius say, lady who goes camping with man must beware of evil intent.",
"Confucius say, man who go to sleep with sex problem on mind, wake up with solution in hand.",
"Confucius say, inventor of shag carpet make big pile.",
"Confucius say, man who want pretty nurse must be patient.",
"Confucius say, prostitute who like bondage, strapped for cash.",
"Confucius say, wise man does not eat yellow snow.",
"Confucius say, forgiveness is devine but never pay full price for late pizza.",
"Confucius say, man who drop watch in toilet bound to have shitty time.",
"Confucius say, American baseball all wrong, man with 4 balls cannot walk.",
"Confucius say, man who throw dirt losing ground.",
"Confucius say, ant which rest on toilet bowl get pissed off.",
"Confucius say, man who fight with wife all day, get no piece at night.",
"Confucius say, man with two feet planted firmly on ground has difficult time putting on pants.",
"Confucius say, man who fishes in other man’s well, often catch crab.",
"Confucius say, man who shoot off mouth, must expect to lose face.",
"Confucius say, man who walks with head held high will not see dog poop on footpath,",
"Confucius say, man who kisses girl’s behind, get crack in face.",
"Confucius say, man who wears tight pants is like cheap hotel, no ballroom.",
"Confucius say, woman who spend much time on bedspring may get offspring.",
"Confucius say, house without toilet is uncanny.",
"Confucius say, it good to meet girl in park, but better to park meat in girl.",
"Confucius say, girl who sit on lap of judge, get honorable discharge.",
"Confucius say, wise man not keep sledge hammer and slow computer in same room.",
"Confucius say, wise man not play leapfrog with unicorn.",
"Confucius say, woman who sinks in man’s arms soon has arms in man’s sink.",
"Confucius say, man who drives like hell bound to get there.",
]
},
},
// executes on start
start: function() {
Log.info("Starting module: " + this.name);
this.lastquoteIndex = -1;
// update timer
var self = this;
setInterval(function() {
self.updateDom(self.config.fadeSpeed * 1000);
}, this.config.updateInterval * 1000);
},
// generate quote
randomIndex: function(quotes) {
if (quotes.length === 1) {
return 0;
}
var generate = function() {
return Math.floor(Math.random() * quotes.length);
};
var quoteIndex = generate();
while (quoteIndex === this.lastquoteIndex) {
quoteIndex = generate();
}
this.lastquoteIndex = quoteIndex;
return quoteIndex;
},
// create an array of quotes
quoteArray: function() {
if (this.config.category == 'random') {
return this.config.quotes[Object.keys(this.config.quotes)[Math.floor(Math.random() * Object.keys(this.config.quotes).length)]];
} else {
return this.config.quotes[this.config.category];
}
},
// return a quote from array of quotes
randomquote: function() {
var quotes = this.quoteArray();
var index = this.randomIndex(quotes);
return quotes[index];
},
// override getDom to display quote
getDom: function() {
var quoteText = this.randomquote();
var text = quoteText;
var wrapper = document.createElement("div");
var quote = document.createElement("div");
quote.className = "bright medium light";
quote.style.textAlign = 'center';
quote.style.margin = '0 auto';
quote.style.maxWidth = '80%';
quote.innerHTML = text;
wrapper.appendChild(quote);
return wrapper;
}
});