-
Notifications
You must be signed in to change notification settings - Fork 0
/
google_calendar_textwrap.user.js
55 lines (52 loc) · 2.02 KB
/
google_calendar_textwrap.user.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
// ==UserScript==
// @name Google Calendar Textwrap Events v1.4
// @description Fix Google Calendar so that long event names will text wrap on the calendar.
// @include http*://www.google.com/calendar/render*
// @include http*://www.google.com/calendar/embed*
// ==/UserScript==
//////////////////////////////////////////////////////////////////////////////
//NOTES:
//
// This is a bug fix for http://userscripts-mirror.org/scripts/show/5850
// ...but has become out of date itself.
//
// For a better solution, see http://stackoverflow.com/questions/8225132/how-do-i-make-the-new-google-calendar-event-text-wrap-around-using-css
//
// Known issues:
//
// -Does not work with new version of Google calendar (go back to 'classic view' to make it work)
//
//////////////////////////////////////////////////////////////////////////////
// Version 1.4
// -Updated for new version of Google Calendar (unfortunately now out-of date again)
// -Copied from http://userscripts-mirror.org/scripts/show/97755.html to github
//
// Version 1.3
// -Work for embedded calendars as well (thanks Micah Sittig http://userscripts.org/users/msittig )
// -Massively simplified by removing unnecessary parts (I hope they're really unnecessary!)
//
// Version 1.21
// -Made all day events wrap properly
//
// Version 1.2
// -Enhanced funtionality between all day events and specific time events
// to keep them from overlapping each other.
//
// Version 1.1
// -Enabled all day events to wrap text the same as specific time events.
//
// Version 1.0
// -Initial version - Allow specific time events to wrap if they are too long.
//////////////////////////////////////////////////////////////////////////////
function buildStyle()
{
var st = "div.rb-n, span, nobr { white-space: normal; }";
var dochead = document.getElementsByTagName("head")[0];
var stEl = document.createElement("style");
stEl.setAttribute("type", "text/css");
stEl.innerHTML = st;
dochead.appendChild(stEl);
}
window.addEventListener("load", function(e) {
buildStyle();
}, false);