This file contains hidden or 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
| javascript:(function copyFromCurrentLanguage(){ | |
| if (!document.hasFocus()) { | |
| window.alert("Click the document body first"); | |
| return; | |
| } | |
| const promotionalText = document.querySelector("#promotionalText").innerText; | |
| const whatsNew = document.querySelector("#whatsNew").innerText; | |
| const data = { |
This file contains hidden or 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
| // This is an example of how to fetch external data in response to updated props, | |
| // If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
| class ExampleComponent extends React.Component { | |
| _currentId = null; | |
| state = { | |
| externalData: null | |
| }; |
This file contains hidden or 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
| /** | |
| * Returns noun variant for specified quantity | |
| * | |
| * @param {integer} n e.g. 5 | |
| * @param {array} nounVariants e.g. ["produkt", "produkty", "produktów"] | |
| * @param {string} template Optional template ('$1 $2' as default) | |
| * | |
| * @return {string} e.g. "5 produktów" | |
| */ | |
| function quantityNounVariant(n, variants, template) { |