Skip to content

Instantly share code, notes, and snippets.

@dulldesk
Created October 5, 2024 16:24
Show Gist options
  • Select an option

  • Save dulldesk/32207d61ed5a3c2f331c78544af1588c to your computer and use it in GitHub Desktop.

Select an option

Save dulldesk/32207d61ed5a3c2f331c78544af1588c to your computer and use it in GitHub Desktop.
adds a button to autofill (part of) the UWaterloo Conversation Partner Program weekly log (as a volunteer)
// ==UserScript==
// @name autofill uwaterloo renison cpp log
// @namespace http://tampermonkey.net/
// @version 2024-10-05
// @description adds a button to autofill part of the uwaterloo renison conversation partner program weekly log
// @author sleet
// @match https://uwaterloo.ca/renison-student-experience/conversation-partner-program/online-cpp-log-sheet-submission
// @icon https://www.google.com/s2/favicons?sz=64&domain=uwaterloo.ca
// @grant none
// ==/UserScript==
// UWaterloo Renison Conversation Partner Program:
// https://uwaterloo.ca/renison-student-experience/conversation-partner-program
function autofill() {
const data = {
'#edit-first-name': 'FILL-IN',
'#edit-last-name': 'FILL-IN',
'#edit-e-mail-address': 'FILL-IN@uwaterloo.ca',
'#edit-uw-id-number': '########',
'#edit-partners-first-name-legal-name': 'FILL-IN',
'#edit-partners-last-name-legal-name': 'FILL-IN',
};
const radio = [
'#edit-are-you-a-cpp-volunteer-or-language-learner-1',
'#edit-is-your-partner-a-volunteer-or-language-learner-2',
// 1 hour
'#edit-how-many-hours-did-you-meet-with-your-partner-during-this-meeting-2',
// certify form accuracy
//'#edit-acknowledgement-of-information-accuracy-i-certify-that-the-information-provided-in-this-webform-is-true-and-accurate-based-on-my-experience-in-the-conversation-partner-program-this-week',
];
Object.keys(data).forEach(id => {
document.querySelector(id).value = data[id];
});
radio.forEach(id => {
document.querySelector(id).checked = true
});
}
(function() {
'use strict';
const btn = document.createElement('button');
btn.textContent = 'autofill'
btn.onclick = autofill;
document.querySelector('aside.uw-node__sidebar').appendChild(btn);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment