Skip to content

Instantly share code, notes, and snippets.

@IngoWinter
IngoWinter / .htaccess
Created January 15, 2018 22:54
auth media für ycom
RewriteRule ^/?media/(.*)$ /index.php?ycom_file=$1 [L]
# RewriteRule ^/?media/(.*\.(pdf|doc|zip))$ /index.php?ycom_file=$1 [L]
@IngoWinter
IngoWinter / _readme.md
Last active September 2, 2020 05:37
cookie gedöns modul

input.php/output.php: modul ein- und ausgabe, um html/scripte bei consent nachzuladen

module.js: lädt html/scripte des moduls bei consent ohne reload nach

@IngoWinter
IngoWinter / snippet.js
Created March 24, 2023 13:13
Focus Trapping BITV
function trapFocus(element) {
'use strict';
var focusableEls = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
var firstFocusableEl = focusableEls[0];
var lastFocusableEl = focusableEls[focusableEls.length - 1];
var KEYCODE_TAB = 9;
element.addEventListener('keydown', function (e) {
var isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB);