### JS
JavaScript should be used sparsely and should not break the usability of the site for browsers without JavaScript
- For style, follow [JavaScript Standard Style](https://standardjs.com/)
+- Document with [jsdoc](http://usejsdoc.org/) at least to describe what every function does
- command: [postcss, -c, postcss.json]
source: static/css
output: out/static/css
+- command: [standard]
+- command: [uglifyjs, -c, -m]
+ source: static/js
+ output: out/static/js
"devDependencies": {
"postcss-cli": "^2.6.0",
"postcss-cssnext": "^2.6.0",
- "postcss-csso": "^1.1.2"
+ "postcss-csso": "^1.1.2",
+ "standard": "^11.0.1",
+ "uglify-js": "^3.3.25"
}
-}
+}
\ No newline at end of file
--- /dev/null
+/**
+ * Removes soft hyphens from copied text
+ * @param {Object} event
+ * @return {Undefined}
+ */
+document.addEventListener('copy', function (event) {
+ let oldText = window.getSelection().toString()
+ let newText = oldText.replace(/\u00AD/g, '')
+
+ event.clipboardData.setData('text/plain', newText)
+ event.clipboardData.setData('text/html', newText.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'))
+ event.preventDefault()
+})
<a id="navigation"></a>
{% include "footer.html" %}
</div>
+ {#- scripts last to avoid blocking rendering #}
+ <script src="{{ url_for("static/js/utils.js") }}?{{ git_hash }}" type="text/javascript"></script>
</body>
</html>