您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add Google calendar iframe to MeisterTask dashboard
// ==UserScript== // @name Google calendar to MeisterTask // @namespace XcomeX // @description Add Google calendar iframe to MeisterTask dashboard // @version 1.0 // @author Copyleft (Ɔ) 2018, by XcomeX // @license GPLv3 - http://www.gnu.org/licenses/gpl-3.0.txt // @include https://www.meistertask.com/app/* // ==/UserScript== var calendarHolderId = "GoogleCalendarHolder"; AddCalendar(); function AddCalendar () { // calendar parameters var p_width = 1200; var p_height = 335; var p_bgColor = "000000"; var p_ctz = "ctz=UTC"; var p_src = "src=YOUR_EMAIL%40GMAIL.COM&color=%232952A3"; // insert calendar on page var calendarColumnElement = '<div id="'+calendarHolderId+'" style="position:absolute;right:15px;bottom:8px;z-index:999;opacity:0.85;overflow:hidden;height:'+(p_height-24)+'px;"><iframe width="'+p_width+'" height="'+p_height+'" src="https://calendar.google.com/calendar/embed?showTitle=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&height='+p_height+'&wkst=2&bgcolor=%23'+p_bgColor+'&'+p_src+'&'+p_ctz+'" style="border-width:0" frameborder="0" scrolling="no"></iframe></div>'; if ( document.getElementById(calendarHolderId) == null ) { var bodyElement = document.getElementsByTagName("BODY")[0]; bodyElement.innerHTML += calendarColumnElement; } } function RemoveCalendar () { var calendarHolder = document.getElementById(calendarHolderId); if ( calendarHolder ) { calendarHolder.remove(); } } // remove calendar on NO-dashboard pages document.body.addEventListener('DOMSubtreeModified', function () { if (window.location.href.indexOf("dashboard") !== -1) { AddCalendar(); } else { RemoveCalendar(); } }, false); // support functions Element.prototype.remove = function() { this.parentElement.removeChild(this); } NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = this.length - 1; i >= 0; i--) { if(this[i] && this[i].parentElement) { this[i].parentElement.removeChild(this[i]); } } }