Skip to content

Instantly share code, notes, and snippets.

@drifterz28
Created April 25, 2019 16:29
Show Gist options
  • Save drifterz28/27191e58cd73e96064af273ac16b7c37 to your computer and use it in GitHub Desktop.
Save drifterz28/27191e58cd73e96064af273ac16b7c37 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Team-Oregon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://app3.msi5.com/*
// @grant none
// ==/UserScript==
const AddGoogleCalLink = () => {
return `<a href="http://www.google.com/calendar/event?
action=TEMPLATE
&text=[event-title]
&dates=[start-custom format='Ymd\\THi00\\Z']/[end-custom format='Ymd\\THi00\\Z']
&details=[description]
&ctz=America/Los_Angeles
&location=[location]
&trp=false
&sprop=
&sprop=name:"
target="_blank" rel="nofollow">Add to my calendar</a>`;
};
const getTableRowInfo = row => {
console.log(row)
}
const buildGoogleCalLinks = () => {
const table = document.querySelector('.rgMasterTable');
const tRows = table.querySelectorAll('.rgRow, .rgAltRow');
[...tRows].forEach(getTableRowInfo);
};
(function() {
'use strict';
const RadTextBox1 = document.querySelector('#RadTextBox1');
if(RadTextBox1 && RadTextBox1.value === 'My Schedule') {
buildGoogleCalLinks();
}
})();
/*
<a href="http://www.google.com/calendar/event?
action=TEMPLATE
&text=[event-title]
&dates=[start-custom format='Ymd\\THi00\\Z']/[end-custom format='Ymd\\THi00\\Z']
&details=[description]
&ctz=America/Los_Angeles
&location=[location]
&trp=false
&sprop=
&sprop=name:"
target="_blank" rel="nofollow">Add to my calendar</a>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment