Skip to content

Commit

Permalink
chore(browsers)!: drop IE11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaseberle committed Jan 22, 2024
1 parent efbcc53 commit 9586422
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Documentation/Developer/JavaScript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ cookieman.onScriptLoaded(String trackingObjectKey, int scriptId, function callba
(starting from 0 with the first).

* `callback` is a function reference. It receives trackingObjectKey and scriptId (see example below).
callback is called immediately if the referred to <script> has already finished loading.
The callback is called immediately if the referred to <script> has already finished loading.

Example:

Expand Down
2 changes: 1 addition & 1 deletion Documentation/Introduction/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Features
Compatibility
-------------

* Supports all modern browsers and Internet Explorer 11
* Supports all modern browsers
* Can be configured to work with a strict `Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>`__
(no inline scripts are needed)

Expand Down
19 changes: 1 addition & 18 deletions Resources/Public/Js/cookieman.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/** global: Cookies */
var cookieman = (function () {
"use strict";
// remember: write IE11-compatible JavaScript
var cookieName = 'CookieConsent',
cookieLifetimeDays = 365,
form = document.querySelector('[data-cookieman-form]'),
Expand Down Expand Up @@ -61,7 +60,7 @@ var cookieman = (function () {
}

/**
* Checks if consent was given for all groups, in which a trackingObject
* Checks if consent was given for all groups in which a trackingObject
* with the given key is defined. Normally each trackingObject should only
* be present in one group.
*
Expand Down Expand Up @@ -318,23 +317,7 @@ var cookieman = (function () {
}
}

// CustomEvents https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
// polyfill for IE9+
function polyfillCustomEvent() {
if (typeof window.CustomEvent !== "function") {
window.CustomEvent = function (typeArg, customEventInit) {
customEventInit = customEventInit || {bubbles: false, cancelable: false, detail: undefined}
var event = document.createEvent('CustomEvent')
event.initCustomEvent(typeArg, customEventInit.bubbles, customEventInit.cancelable, customEventInit.detail)
return event
}
window.CustomEvent.prototype = window.Event.prototype
}
}

function emit(typeArg, customEventInit) {
polyfillCustomEvent()

eventsEl.dispatchEvent(
new window.CustomEvent(typeArg, customEventInit)
)
Expand Down

0 comments on commit 9586422

Please sign in to comment.