npm install --save-dev gist:8ce270954c48a4092b5dc62a0866792e
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
// När sidan laddat klart | |
document.addEventListener('DOMContentLoaded', function fixaStorlek () { | |
// Hitta artikelnumrets skostorlek | |
var artNrStorlek = parseInt(document.querySelector('.ml-variant-artnr').textContent.split('-').pop(), 10); | |
// Hitta drop-down fältet på sidan | |
var dropDown = document.querySelector('.js_variant_group_field10001'); | |
// Kolla vilket objekt som är valt i drop-down fältet | |
var optionValue = document.querySelector('.js_variant_group_field10001').value; | |
// Hitta objekt | |
var optionEl = document.querySelector('.js_variant_group_field10001 option[value="'+optionValue+'"]'); |
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
export interface Root { | |
selfLink: any | |
id: string | |
title: string | |
rows: Row[] | |
} | |
export interface Row { | |
modules: Module[] | |
} |
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
Trompi'en | |
Han hette Anders Olsson och bebodde torpet Gräsmyren på | |
Skybergsskogen i Älgå, vilket efter honom även benämndes | |
Trumpinntorpet. Man vet inte, när han föddes, men som jag i | |
annat sammanhang har omtalat, skrev han några visor i anledning av en drunkningsolycka på Glavsfjorden år 1817 (se s. II 188) | |
och bör således vara född omkring 1780. Det antages av mina | |
sagesmän, att han avled omkring 1840. | |
Sägnerna om denne trollkarl är många. En del av dem återges |
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
Odla för husbehov o försäljning | |
Vilken är min jordmån? | |
Vem är jag som odlare? | |
Mätt på en plätt | |
346 kg | |
Lex! bladgrönt) mat |
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 imageLoad(imageUrl) { | |
return new Promise((resolve, reject) => { | |
const image = new Image(); | |
image.crossOrigin = 'anonymous'; | |
image.onload = () => resolve(image); | |
image.onerror = err => reject(err); | |
image.src = imageUrl; | |
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
export default class TidalWebComponent extends HTMLElement { | |
static css (strings) { | |
const text = strings.raw.join(); | |
const sheet = new CSSStyleSheet(); | |
sheet.replace(text); | |
return sheet; | |
} | |
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
/** | |
* Converts a snake-case string to camelCase | |
* | |
* @param {string} str kebab-cased string | |
* @returns {string} camelCased string | |
*/ | |
export function kebabToCamelCase(str) { | |
return str.replace(/(-)([a-z])/g, g => g[1].toUpperCase()); | |
} |