Backend Modul Worpress Import added
This commit is contained in:
1 parent
b08ea7a55f
commit
4ef3ad0026
10 files changed
+1259
-29
No files matched your search
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
|
||||
stroke="#f47937" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="8.5" r="6"/>
|
||||
<path d="M6.8 5.6 9.4 12.2 11 8.1"/>
|
||||
<path d="M12.2 5.1 14.8 12.2 17.2 5.6"/>
|
||||
<path d="M12 15.5v6"/>
|
||||
<path d="m9 18.5 3 3 3-3"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 379 B |
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Select-all for the WordPress import list.
|
||||
*
|
||||
* Lives in a module rather than in an onclick attribute: the backend enforces a
|
||||
* Content Security Policy that blocks inline event handlers, so the attribute
|
||||
* version simply did nothing.
|
||||
*
|
||||
* Also keeps the header box honest - it shows indeterminate while only some
|
||||
* rows are ticked, which matters on a list of a hundred posts.
|
||||
*/
|
||||
|
||||
function boxes() {
|
||||
return Array.from(document.querySelectorAll('[data-vitec-post]'));
|
||||
}
|
||||
|
||||
function sync(toggle) {
|
||||
const all = boxes();
|
||||
const checked = all.filter((box) => box.checked).length;
|
||||
toggle.checked = all.length > 0 && checked === all.length;
|
||||
toggle.indeterminate = checked > 0 && checked < all.length;
|
||||
}
|
||||
|
||||
function init() {
|
||||
const toggle = document.querySelector('[data-vitec-toggle-all]');
|
||||
if (toggle === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggle.addEventListener('change', () => {
|
||||
const state = toggle.checked;
|
||||
boxes().forEach((box) => {
|
||||
box.checked = state;
|
||||
});
|
||||
toggle.indeterminate = false;
|
||||
});
|
||||
|
||||
boxes().forEach((box) => box.addEventListener('change', () => sync(toggle)));
|
||||
sync(toggle);
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
Reference in new issue
Block a user