Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. $(document).ready(function(){
  2.  
  3.  
  4.  
  5. window.twttr = (function(d, s, id) {
  6. var js, fjs = d.getElementsByTagName(s)[0],
  7. t = window.twttr || {};
  8. if (d.getElementById(id)) {return t;}
  9. js = d.createElement(s);
  10. js.id = id;
  11. js.src = "https://platform.twitter.com/widgets.js";
  12. fjs.parentNode.insertBefore(js, fjs);
  13.  
  14. t._e = [];
  15. t.ready = function(f) {
  16. t._e.push(f);
  17. };
  18. return t;
  19. }
  20. (document, "script", "twitter-wjs"));
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. var quotes = [
  29. {
  30. quote: "The universe is big. It’s vast and complicated and ridiculous. And sometimes, very rarely, impossible things just happen and we call them miracles.",
  31. author: "The Doctor, Season 5, Episode 12"
  32. },
  33. {
  34. quote: "You want weapons? We’re in a library! Books! The best weapons in the world!",
  35. author: "The Doctor, Season 2, Episode 2"
  36. },
  37. {
  38. quote:"Amy Pond, there’s something you’d better understand about me ‘cause it’s important, and one day your life may depend on it: I am definitely a mad man with a box!",
  39. author:"The Doctor, Season 5, Episode 1"
  40. },
  41. {
  42. quote:"When you’re a kid, they tell you it’s all… Grow up, get a job, get married, get a house, have a kid, and that’s it. But the truth is, the world is so much stranger than that. It’s so much darker. And so much madder. And so much better.",
  43. author:"Elton Pope, Season 2, Episode 10"
  44. },
  45. {
  46. quote:"The way I see it, every life is a pile of good things and bad things. The good things don’t always soften the bad things, but vice versa, the bad things don’t always spoil the good things and make them unimportant.",
  47. author:"The Doctor, Season 5, Episode 10"
  48. },
  49. {
  50. quote:"The way I see it, every life is a pile of good things and bad things. The good things don’t always soften the bad things, but vice versa, the bad things don’t always spoil the good things and make them unimportant.",
  51. author:"The Doctor, Season 5, Episode 10"
  52. },
  53. {
  54. quote:"Some people live more in 20 years than others do in 80. It’s not the time that matters, it’s the person.",
  55. author:"The Doctor, Season 3, Episode 6"
  56. },
  57. {
  58. quote:"Do what I do. Hold tight and pretend it’s a plan!",
  59. author:"The Doctor, Season 7, Christmas Special"
  60. },
  61. {
  62. quote:"In 900 years of time and space, I’ve never met anyone who wasn’t important",
  63. author:"The Doctor, Season 6, Christmas Special"
  64. },
  65. {
  66. quote:"900 years of time and space, and I’ve never been slapped by someone’s mother.",
  67. author:"The Doctor, Season 1, Episode 4"
  68. },
  69. {
  70. quote:"Never ignore coincidence. Unless, of course, you’re busy. In which case, always ignore coincidence.",
  71. author:"The Doctor, Season 5, Episode 12"
  72. },
  73. {
  74. quote:"There’s a lot of things you need to get across this universe. Warp drive… wormhole refractors… You know the thing you need most of all? You need a hand to hold.",
  75. author:"The Doctor, Season 6, Episode 6"
  76. },
  77. {
  78. quote:"This is who I am, right here, right now, all right? All that counts is here and now, and this is me!",
  79. author:"The Doctor, Season 1, Episode 2"
  80. },
  81. {
  82. quote:"I am and always will be the optimist. The hoper of far-flung hopes and the dreamer of improbable dreams.",
  83. author:"The Doctor, Season 6, Episode 6"
  84. },
  85. {
  86. quote:"Everybody knows that everybody dies. But not every day. Not today. Some days are special. Some days are so, so blessed. Some days, nobody dies at all. Now and then, every once in a very long while, every day in a million days, when the wind stands fair and the Doctor comes to call, everybody lives.",
  87. author:"River Song, Season 6, Episode 13"
  88. },
  89. {
  90. quote:"We’re all stories, in the end. Just make it a good one, eh?",
  91. author:"The Doctor, Season 5, Episode 13"
  92. },
  93. {
  94. quote:"Letting it get to you. You know what that’s called? Being alive. Best thing there is. Being alive right now is all that counts.",
  95. author:"The Doctor, Season 6, Episode 4"
  96. },
  97. {
  98. quote:"Always take a banana to a party, Rose: bananas are good!",
  99. author:"The Doctor, Season 2, Episode 4"
  100. },
  101. {
  102. quote:"You don’t just give up. You don’t just let things happen. You make a stand! You say no! You have the guts to do what’s right, even when everyone else just runs away.",
  103. author:"Rose Tyler, Season 1, Episode 13"
  104. },
  105. {
  106. quote:"This is one corner… of one country, in one continent, on one planet that’s a corner of a galaxy that’s a corner of a universe that is forever growing and shrinking and creating and destroying and never remaining the same for a single millisecond. And there is so much, so much to see.",
  107. author:"The Doctor, Season 7, Episode 4"
  108. },
  109. {
  110. quote:"Rose, before I go, I just want to tell you: you were fantastic. Absolutely fantastic. And you know what? So was I.",
  111. author:"The Doctor, Season 1, Episode 13"
  112. }
  113. ];
  114. var randomQuote = function(){
  115. var randomNumber = Math.floor(Math.random()*quotes.length);
  116. $(".quote-box").html("<p class='quote-text'>" + quotes[randomNumber].quote + "</p> <p class='author-text'>- " + quotes[randomNumber].author + "</p>" + '<a href="https://twitter.com/share" class="twitter-share-button" data-text="'+quotes[randomNumber].quote+'">Tweet</a>');
  117. twttr.widgets.load();
  118. };
  119. randomQuote();
  120. $('#quoteButton').on("click", function(){
  121. //You don't need to redefine randomNumber
  122. //var randomNumber = Math.floor(Math.random()*quotes.length);
  123. $(".tardis").fadeTo(1200, 0);
  124. $(".quote-box").fadeTo(1200, 0, randomQuote);
  125. //load your widget inside of randomQuote instead
  126. //twttr.widgets.load();
  127. $(".tardis").fadeTo(1200, 1.0);
  128. $(".quote-box").fadeTo(1200, 1.0);
  129. });
  130. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement