Export button for skema.ku.dk

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

当前为 2014-08-27 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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>');
});