This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.search-results .optimize-mixed div.search-result').forEach(item => {if (item.className.indexOf('premium') > -1) {item.remove()}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const version = '1.1.2'; | |
/** | |
* Returns the HTML for the modal, which is used for both AR and 3D. | |
* @param {String} id The ID of the type of modal, can only be "ar" or "3d". Is used for class names and data attributes. | |
* @returns {String} The HTML for the modal | |
*/ | |
function getModal(id) { | |
return `<div class="modal fade modal-scanblue modal-scanblue-${id}" data-scanblue-type="${id}" tabindex="-1" role="dialog"> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content modal-bg-white"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Based on Chris Ferdinandis emit() function as shown in his great newsletter. | |
* See also https://gomakethings.com/a-vanilla-js-custom-event-helper-function/ | |
* Emit a custom event | |
* @param {String} type The event type | |
* @param {any} detail Any details to pass along with the event | |
* @param {Node} elem The element to emit the event on | |
*/ | |
function emit (type, detail, elem = document) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function defer(method) { | |
if (window.jQuery) { | |
method() | |
} else { | |
setTimeout(function() { defer(method) }, 50) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.debug { | |
position:fixed; | |
bottom:0; | |
left:0; | |
z-index:99999999; | |
width:100%; | |
min-height:25px; | |
line-height:25px; | |
background:#ef4f2f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setup Mutation Observers for Recommendations Slots | |
* When recommendations markup is loaded, fire off Mutation Observer callback | |
* - Init Product Tile Carousel on Recommendation Product Tiles | |
*/ | |
function initRecommendations() { | |
var observer = new MutationObserver(function(mutations, observer) { | |
var $this = $(mutations[0].target); | |
// This is the logic to ensure that initProductTileCarousel() |