Commits

Daniel Beck committed 24b782f

Added: initial user script

  • Participants

Comments (0)

Files changed (1)

File google-calendar-clickable.user.js

+// ==UserScript==
+// @name           Google Calendar Clickable URLs
+// @namespace      ddbeck-gcal-clickable-urls
+// @description    Make URLs in the location field clickable hyperlinks
+// @include        https://www.google.com/calendar/*
+// @include        http://www.google.com/calendar/*
+// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
+// ==/UserScript==
+
+$(function () {
+    $('.lv-location:not(.urlized)').live('mouseover', function () {
+        var elem = $(this);
+        var location = elem.text();
+        var url = $.trim(location.substring(3));
+
+        if (url.substring(0,4) === 'http') {
+            elem.html(
+                location.substring(0,3) +
+                '<a href="' +
+                url +
+                '">' +
+                url +
+                '</a>'
+            );
+        }
+
+        elem.addClass('urlized');
+    });
+});