function ready() {
var blockIds = [];
var blocks = document.querySelectorAll('[data-box-id] a');
blocks.forEach(block => block.addEventListener('click', e => {
blockIds.push(e.target.parentNode.getAttribute('data-box-id'));
e.target.parentNode.style.display = 'none';
localStorage.setItem('blocks', JSON.stringify(blockIds));
console.log(localStorage.getItem('blocks'));
}))
}
document.addEventListener("DOMContentLoaded", ready());
class Upload {
public function upload($uploadDir, $file) {
$pathToUpload = $uploadDir . "bla-bla-bla." . pathinfo($file, PATHINFO_EXTENSION);
if( move_uploaded_file($file['tmp_name'], $pathToUpload) ) {
return $pathToUpload;
}
return false;
}
}
success: function(data) {
var data = jQuery.parseJSON(data);
if (data.result==1) {
h=$('.addons').html();
$('.addons').html(h+data.txt);
}
}