<img>
, <input type="text">
, <input type="email">
, <input type="password">
, <input type="datetime">
, etc. <div class="inputbox">
<input type="text">
</div>
.inputbox::after {
/* ...стили для псевдоэлемента */
}
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
$user_id = 2; // ID пользователя
$forum_id = 2; // ID форума
$subject = 'Welcome to Wonderland'; // Заголовок темы
$text = 'Lorem ipsum dolor sit amet.'; // Контент темы
$user->session_create($user_id);
$auth->acl($user->data);
$user->setup();
$poll = $uid = $bitfield = $flags = '';
generate_text_for_storage($text, $uid, $bitfield, $flags, true, true, true);
$data = array(
'forum_id' => $forum_id,
'topic_id' => 0,
'icon_id' => false,
'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => true,
'enable_sig' => true,
'message' => $text,
'message_md5' => md5($text),
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'post_edit_locked' => 0,
'topic_title' => $subject,
'notify_set' => false,
'notify' => false,
'post_time' => 0,
'forum_name' => "",
'enable_indexing' => true,
'force_approved_state' => true,
'force_visibility' => true,
);
$result = submit_post('post', $subject, '', POST_NORMAL, $poll, $data);
if ($result === FALSE) {
echo "Error sending post";
} else {
echo "Post sent successfully, URL is: $result";
}
$user->session_kill(false);
var parent = this.closest('div').className;
const parent = this.closest('.parent-selector');
const child = parent.querySelector(".b24-form-control-label");
<!-- IF S_REGISTERED_USER -->
<!-- IF S_USERNAME eq "RISARO" -->
Welcome home, good hunter...
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF S_REGISTERED_USER --><!-- ENDIF -->
<!-- IF S_USERNAME eq "RISARO" --><!-- ENDIF -->
/includes/functions.php
$template->assign_vars(array(
'S_USER_ID' => $user->data['user_id'];
const debounce = (fn, ms = 300) => {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
}, ms);
};
}
const inputbox = document.querySelector(".input");
const checkForEmpty = ({ value: v }) => v === "" && console.log("Empty");
const processChanges = debounce(() => checkForEmpty(inputbox), 500);
inputbox.addEventListener("input", processChanges);
const container = document.querySelector('.box');
container.addEventListener("click", ({ target: t }) => {
if(t.classList.contains("btn")) {
const card = t.closest(".item");
card && card.classList.add("active");
}
})
document.querySelectorAll('.item').forEach(v => {
v.querySelector(".btn").addEventListener('click', () => {
v.classList.add('active');
});
});
.container{
display: flex;
justify-content: space-around;
}
.card {
width: fit-content;
}
grid-template-columns: repeat(auto-fill, minmax(310px, 310px));
justify-content: space-between;
.title:hover ~ .title::after {
transform: rotate(180deg);
}
<element>:hover::after { /* ... style */ }
.title:hover::after {
transform: rotate(180deg);
}
new Swiper('.swiper', {
navigation: {
nextEl: '.my-awesome-slider-button-next',
prevEl: '.my-awesome-slider-button-prev',
},
});
.my-awesome-slider-button-prev { /* ...styles */ };
.my-awesome-slider-button-next { /* ...styles */ };
Не пойму в чем дело, разъясните пожалуйста.
console.log
в определенном месте своего кода:document.querySelector('.list').addEventListener('click', (event) => {
const target = event.target
if (target.classList.contains('delete')) {
const task = document.querySelector(`[data-id="${target.dataset.delete}"]`)
// Посмотрим что будет выводиться в консоль?
console.log(target.dataset.id)
deleteTask(task)
}
})
const modal = document.querySelector(".modal");
const listbox = document.querySelector(".list");
const modalCancelButton = modal.querySelector(".cancel");
const modalConfirmButton = modal.querySelector(".confirm");
let currentTaskID = null;
listbox.addEventListener("click", ({ target: t }) => {
if (t.classList.contains("delete")) {
currentTaskID = t.dataset.delete;
modal.classList.remove("hidden");
}
});
modalCancelButton.addEventListener("click", () => {
modal.classList.add("hidden");
currentTaskID = null;
});
modalConfirmButton.addEventListener("click", () => {
modal.classList.add("hidden");
deleteTask(currentTaskID);
});
const deleteTask = id => id && listbox.querySelector(`[data-id="${id}"]`).remove();
Но вылазит то один баг, то другой. Уже нервишки здают...
Есть ли хорошие конвертеры из jquery в js?