Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function () {
- var inputsSelector = 'input[type=text]';
- var inputsEvents = ['keyup', 'click', 'submit', 'paste', 'dblclick'];
- var inputConsentHandler = function () {
- var inputsArr = Array.prototype.slice.call(document.querySelectorAll(inputsSelector));
- inputsArr.map(function (inp) {
- inputsEvents.forEach(function (ev) {
- inp.addEventListener(ev, window['__lxG__consent__']['acceptConsent'], false);
- });
- });
- };
- var inputHandlersSet = false;
- window['__lxG__consent__'] = window['__lxG__consent__'] || {};
- var originalConsentCallback = window['__lxG__consent__']['consentCallback'];
- var consentCallback = function (consent) {
- if (consent === -1
- && !inputHandlersSet
- ) {
- inputHandlersSet = true;
- inputConsentHandler();
- }
- if (originalConsentCallback) {
- originalConsentCallback(consent);
- }
- };
- window['__lxG__consent__']['consentCallback'] = consentCallback;
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement