Skip to content

Instantly share code, notes, and snippets.

View cahva's full-sized avatar

Markku Virtanen cahva

View GitHub Profile
@cahva
cahva / change_maxlength_of_inputs.html
Created October 29, 2019 13:40
Change maxLenght of register form inputs
<script>
function tryEl(e) {
var privEl = document.querySelector('.register-form');
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
changeForm(privEl);
}
}
@cahva
cahva / open_commentform.html
Created January 20, 2020 12:22
Open commentform and set the height
<script>
/* wait for element to be ready */
function tryEl(e) {
var privEl = document.querySelector('.comment-feed-header')[0];
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
changeAndClick(privEl);
}
@cahva
cahva / privacypolicy_change.html
Last active April 7, 2020 12:03
Change privacypolicy text in videosync registration
<script>
var url = window.location.href;
/* wait for element to be ready and then change text */
function tryEl(e) {
var privEl = document.querySelector('.register-form .privacyread span');
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
changeText(privEl);
@cahva
cahva / add_link_to_slide.html
Last active March 4, 2020 21:12
Add link to slide using observer
@cahva
cahva / set_autocomplete_off.html
Last active October 16, 2020 11:29
Sets the autocomplete off on registration page
<script src="https://getvideosync.com/js/vs-helpers.js"></script>
<script>
var url = window.location.href;
if (url.indexOf('/register') > -1) {
waitForElement('.register-form', function(el) {
el.setAttribute('autocomplete', 'off')
});
}
@cahva
cahva / add-googleform-to-hidden-element.html
Last active June 5, 2020 16:50
Add google form to hidden element
<script>
// ENABLE THE NEXT LINE ONLY FOR TESTING PURPOSES
// var oskariAttendeeName = 'Markku Vee';
</script>
<script>
if (_eventData.state === 3) {
const hiddenContentEl = document.querySelector("#vs-hidden .container");
const iframeEl = document.createElement('iframe');
@cahva
cahva / safaricfix.js
Created July 16, 2020 15:27
Safari cookie fix to get around cookie setting problem in an iframe
(function() {
function sc(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = 'expires='+d.toUTCString();
document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
}
function gc(cname) {
var name = cname + '=';
@cahva
cahva / hide_cookie_query_window_when_embed.html
Created September 4, 2020 15:25
Hide cookie query window when url has embed_view in it
@cahva
cahva / add_querystring_to_links.html
Last active October 23, 2020 09:17
Add current querystring to links
@cahva
cahva / redirect_to_event_after_agree_to_disclaimer.html
Created January 7, 2021 16:56
Redirects to the event page after agreeing to disclaimer
<script src="https://getvideosync.com/js/vs-helpers.js"></script>
<script>
var isRegister = window.location.href.indexOf('register') > -1;
if (isRegister) {
waitForElement('.modal', handleModalClose);
}
function handleModalClose(modalNode) {
var config = {