Google Calendar Show All

Removes scrollbars and displays entire schedule.

  1. // ==UserScript==
  2. // @name Google Calendar Show All
  3. // @namespace http://www.arthaey.com/
  4. // @description Removes scrollbars and displays entire schedule.
  5. // @include http*://www.google.com/calendar/*
  6. // @author Arthaey Angosii <arthaey@gmail.com>
  7. // @version 1.3
  8. //
  9. // Backed up from http://userscripts.org/scripts/review/6545
  10. // Last updated on 2010-05-27
  11. // ==/UserScript==
  12.  
  13. // Google-defined element IDs and CSS class names, subject to change without notice
  14. var PRINT_ICON_ID = "mtpPrintLk";
  15. var CALENDAR_ID = "scrolltimedeventswk";
  16. var TOOLBAR_CLASS = "goog-inline-block";
  17.  
  18. window.addEventListener("load", function() {
  19.  
  20. GM_addStyle(
  21. "#showAll {" +
  22. " cursor: pointer;" +
  23. " padding-right: 4px;" +
  24. " position: relative;" +
  25. " top: 2px;" +
  26. "}"
  27. );
  28. addShowAllButton();
  29.  
  30. var SHOW_ALL_ADDED = false;
  31.  
  32. function addShowAllButton() {
  33. if (SHOW_ALL_ADDED) return;
  34.  
  35. var printLink = document.getElementById(PRINT_ICON_ID);
  36. var calendarDiv = document.getElementById(CALENDAR_ID);
  37.  
  38. // try again later; window onload doesn't seem good enough?
  39. if (!printLink || !calendarDiv) {
  40. window.setTimeout(addShowAllButton, 1000);
  41. }
  42.  
  43. var showLink = createShowLink(
  44. "Show All", "showAll", showAll,
  45. "Show everything, from midnight to midnight"
  46. );
  47.  
  48. var showDiv = document.createElement('div');
  49. showDiv.className = TOOLBAR_CLASS;
  50. showDiv.appendChild(showLink);
  51. printLink.parentNode.insertBefore(showDiv, printLink);
  52.  
  53. SHOW_ALL_ADDED = true;
  54. }
  55.  
  56. }, true);
  57.  
  58. function showAll() {
  59. var calendarDiv = document.getElementById(CALENDAR_ID);
  60. calendarDiv.style.height = "";
  61. }
  62.  
  63. function createShowLink(text, id, fnct, title) {
  64. var link = document.createElement('img');
  65. link.alt = text;
  66. link.src = "data:image/gif,GIF89a%0D%00%0D%00%F1%03%00%00%00%CCaa%DF%C8%C8%F4%FF%FF%FF!%F9%04%01%0A%00%03%00%2C%00%00%00%00%0D%00%0D%00%00%02'%9C-%20%C7%08%BF%9AyT%DA%96N%1Cj%24%60%04%400)%D5%D7Q_8%96K%86%1C%DDES%CF%85nR%A2%0F%05%00%3B";
  67.  
  68. link.addEventListener("click", fnct, true);
  69. link.id = id;
  70. if (title)
  71. link.title = title;
  72.  
  73. return link;
  74. }