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
@media( max-width: 860px ) { | |
.content-item { | |
> .rel { | |
padding: 15px 17px 12px; | |
background: rgba(#5e96ff, 0.1); | |
margin-bottom: 20px; | |
br { | |
display: none; |
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
var node = false; | |
if(editor.selection) { | |
node = editor.selection.getNode(); | |
// myPrism element ? | |
if (!isMyPrismCodeblock(node)){ | |
node = false; | |
} | |
} | |
code = tinymce.html.Entities.encodeAllRaw(code.replace(/^\n+/gm,'')); |
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() { | |
var event = new Event('poop') | |
var clicked = 0 | |
document.body.addEventListener('click', function() { | |
clicked++ | |
if (clicked > 1) { | |
clicked = 0 | |
document.body.dispatchEvent(event) |
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
{ | |
isProductPage: () => { | |
try { | |
const [pageData] = window.dataLayer | |
return pageData.PAGE === "goods" ? true : false | |
} catch (err) { | |
console.error(err) | |
return false | |
} | |
} |
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
{ | |
getProductTitle: () => { | |
try { | |
const [pageData] = window.dataLayer | |
return pageData.goods.title | |
} catch (err) { | |
console.error(err) | |
return "" | |
} | |
}, |
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
... | |
parseSpecsTable: (specsTable) => { | |
let textTable = "" | |
specsTable.forEach((row) => { | |
const [keyNode, valueNode] = row.children | |
const key = keyNode.textContent.trim() | |
const value = valueNode.textContent.trim() | |
textTable += `<strong>${key}</strong>: <p>${value}</p>` | |
}) |
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
{ | |
... | |
getProductImages: function () { | |
try { | |
const imageNodes = document.querySelectorAll( | |
"#js-goodsIntroThumbNail img" | |
) | |
const images = [] | |
imageNodes.forEach((img) => { |
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 adapter = { | |
isProductPage: () => true, //checks if the page you are at is indeed a product page | |
getProductData: () => ({ | |
price: 10, | |
title: 'Product title', | |
images: ['src'], | |
description: 'Full product description', | |
category: 'Product category name' | |
}) | |
} |
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 Form({ isLoading, isSent, hasError, handler }) { | |
return ( | |
<form onSubmit={handler}> | |
<div>isLoading: {isLoading ? "Loading" : "false"}</div> | |
<div>isSent: {isSent ? "Sent" : "false"}</div> | |
<div>Error: {hasError || "null"}</div> | |
</form> | |
) | |
} |
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 audio = document.querySelector("audio"); | |
const initDecoder = (stream) => { | |
const decoder = new Demorse({ | |
stream, | |
render: (str) => { | |
// #message is a node that will be updated on decoding | |
document.querySelector("#message").innerText = str; | |
}, | |
}); |
OlderNewer