Use Rust for the front-end too (#374)

Rust can compile to WASM, so let's use it for front-end code as well.

To compile the front-end:

```
cargo install cargo-web
cargo web deploy -p plume-front
```
This commit is contained in:
Baptiste Gelez
2018-12-25 11:51:40 +01:00
committed by GitHub
parent 22bc8c1d40
commit 3fce5d6a14
23 changed files with 1215 additions and 628 deletions
-7
View File
@@ -1,7 +0,0 @@
const articleContent = document.querySelector('#plume-editor')
const offset = articleContent.offsetHeight - articleContent.clientHeight
articleContent.addEventListener('keydown', () => {
articleContent.style.height = 'auto'
articleContent.style.height = `${articleContent.scrollHeight - offset}px`
})
-13
View File
@@ -1,13 +0,0 @@
// It should normally be working fine even without this code
// But :focus-within is not yet supported by Webkit/Blink
const button = document.getElementById('menu')
const menu = document.getElementById('content')
button.addEventListener('click', () => {
menu.classList.add('show')
})
menu.addEventListener('click', () => {
menu.classList.remove('show')
})
-13
View File
@@ -1,13 +0,0 @@
window.onload = function(evt) {
var form = document.getElementById('form');
form.addEventListener('submit', function () {
for (var input of form.getElementsByTagName('input')) {
if (input.name === '') {
input.name = input.id
}
if (input.name && !input.value) {
input.name = '';
}
}
});
}