Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
2.1 kB
3
Indexable
Never
(function(){
    var style=document.createElement('style');style.type='text/css';style.appendChild(document.createTextNode('@media screen and (max-width: 767px) {    html body .ES-filters__flexrow .ES-filters__field:not(.ES-filters__field--destination):not(.ES-filters__field--button--search):not(.ES-filters__field--button--clear),    html body #elasticSearch .l-elastic__col:nth-child(2) {        display: none !important;    }    html body #elasticSearch .l-elastic__tabs-container {        height: 55px !important;        justify-content: flex-start !important;    }}'));document.head.appendChild(style);
(function () {
    try {
        /* main variables */
        var debug = 0;
        var variation_name = "";
        /* all Pure helper functions */

        function waitForElement(selector, trigger, delayInterval, delayTimeout) {
            var interval = setInterval(function () {
                if (
                    document &&
                    document.querySelector(selector) &&
                    document.querySelectorAll(selector).length > 0
                ) {
                    clearInterval(interval);
                    trigger();
                }
            }, delayInterval);
            setTimeout(function () {
                clearInterval(interval);
            }, delayTimeout);
        }
        /* Variation Init */
        function init() {
           var interval = setInterval(() => {
                var buttonElement = document.querySelector('html body #elasticSearch .ES-filters__flexrow .ES-filters__field:nth-child(8) .ES-filters__button');
                buttonElement.setAttribute("value", "search all holidays");
            }, 500);
            setTimeout(function(){
            clearInterval(interval);
            }, 5000);
        }

        /* Initialize variation */
        if (window.location.pathname === '/') {
            waitForElement('html body #elasticSearch .ES-filters__flexrow .ES-filters__field:nth-child(8) .ES-filters__button', init, 50, 15000);
        }
    } catch (e) {
        if (debug) console.log(e, "error in Test" + variation_name);
    }
})();



})();
Leave a Comment