1) в admin toolbar: Content / Add Content / Article
3) в admin toolbar: Structure / Views / Add Views
Как пишутся drupal8 сайты на Ubuntu?
The directory sites/default/files does not exist. An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.
Settings file
The Settings file does not exist.
The Drupal installer requires that you create a ./sites/default/settings.php as part of the installation process. Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php.
More details about installing Drupal are available in INSTALL.txt.
state = {
likes: localStorage.getItem('likes') | 0,
}
plus = () => {
this.setState(({ likes }) => ({
likes: likes + 1,
}), () => localStorage.setItem('likes', this.state.likes));
}
JSON.stringify
не нужен для простых типов.localStorage.setItem("likes", likes); // записать
Number(localStorage.getItem("likes")); // прочитать и привести строку к числу
setItem()
, или вытащить getItem()
, если есть — всё тот же текст.const KEY = 'my-likes';
let likes = 0; // по умолчанию
if (localStorage.hasOwnProperty(KEY)) likes = +localStorage.getItem(KEY);
const showLikes = n => document.querySelector("#root").innerText = n;
showLikes(likes);
let plusOne = () => {
likes++;
localStorage.setItem(KEY, likes);
showLikes(likes);
}
var changeBoxVisibility = show => {
box.style.display = show ? 'block' : 'none'
}
var showBox = () => changeBoxVisibility(true)
var hideBox = () => changeBoxVisibility(false)
var open = document.querySelector("#open");
var close = document.querySelector(".close");
open.onclick = showBox
close.onclick = hideBox
Array.from([open, box]).forEach(el => {
el.addEventListener('click', e => e.stopPropagation())
})
document.addEventListener('click', hideBox)