Export button for skema.ku.dk

Adds a calendar export button to skema.ku.dk and sis.ku.dk

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Export button for skema.ku.dk
// @namespace    http://mathemaniac.org
// @version      1.1.0
// @description  Adds a calendar export button to skema.ku.dk and sis.ku.dk
// @match        http://skema.ku.dk/*
// @match        https://skema.ku.dk/*
// @match        http://sis.ku.dk/kurser/viskursus.aspx*
// @copyright    2012, Sebastian Paaske Tørholm
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
// ==/UserScript==

// skema.ku.dk
$('.header-5-0-5').append('<a href="http://rasmuswriedtlarsen.com/ku-kalender/?url=' + encodeURIComponent(window.location) + '" class="rwl-export">Export to calendar</a>');
$('.rwl-export').css({
    "padding": "2px 0.5em",
    "border": "1px solid silver",
    "text-decoration": "none",
    "text-color": "black",
    "margin-left": "2em"
});

// sis.ku.dk
$('#ctl00_cph_main_kursusindhold_lbl_SkemaoplysningerSWS > a[href*="spreadsheet"]').each(function () {
    var url = $(this).attr('href');
    $(this).after('&nbsp;- <a href="http://rasmuswriedtlarsen.com/ku-kalender/?url=' + encodeURIComponent(url) + '">Export to calendar</a>');
});