|
@@ -106,8 +106,26 @@ if ($filtordon) {
|
|
|
<!--
|
|
|
<?php if ($account['Level'] != 'guest') require('js/notifs.js.php'); ?>
|
|
|
|
|
|
+ function reverseSelection() {
|
|
|
+ let checkboxes = Array.from(document.querySelectorAll("div.notif > input.seen-checkbox"));
|
|
|
+ checkboxes.forEach(function (box) {
|
|
|
+ box.checked = !box.checked;
|
|
|
+ })
|
|
|
+ let n_selected = getSelectedNotifs().length;
|
|
|
+ if (n_selected > 0) {
|
|
|
+ setBtnsVisibility("visible");
|
|
|
+ } else if (n_selected === 0) {
|
|
|
+ setBtnsVisibility("hidden");
|
|
|
+ document.getElementById("global-selector").checked = false;
|
|
|
+ }
|
|
|
+ if (n_selected === checkboxes.length) {
|
|
|
+ document.getElementById("global-selector").checked = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function setBtnsVisibility(state) {
|
|
|
- let btns = document.querySelectorAll("#notifs-list-controls .control-btn");
|
|
|
+ let controls = document.querySelector("#notifs-list-controls");
|
|
|
+ let btns = Array(controls.querySelector("#read-btn"), controls.querySelector("#delete-btn"));
|
|
|
btns.forEach(function (btn) {
|
|
|
btn.style.visibility = state;
|
|
|
});
|
|
@@ -158,16 +176,6 @@ if ($filtordon) {
|
|
|
<?php echo($notifs['div']); ?>
|
|
|
|
|
|
<div id="notifs-grid">
|
|
|
- <div id="notifs-list-controls">
|
|
|
- <input id="global-selector" type="checkbox" onclick="toggleState(this)">
|
|
|
- <button class="control-btn" onclick="readSelected()">
|
|
|
- <i class="fa fa-envelope-open-o" aria-hidden="true"></i>
|
|
|
- </button>
|
|
|
- <button class="control-btn" onclick="deleteSelected()">
|
|
|
- <i class="fa fa-trash-o" aria-hidden="true"></i>
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- <h1 class="control-btn">CIAONEE</h1>
|
|
|
<div id="notifs-list">
|
|
|
<?php
|
|
|
if ($account['Level'] != 'guest') {
|
|
@@ -191,6 +199,20 @@ if ($filtordon) {
|
|
|
} ?>
|
|
|
</div>
|
|
|
|
|
|
+ <div id="footer">
|
|
|
+ <div id="notifs-list-controls">
|
|
|
+ <input id="global-selector" type="checkbox" onclick="toggleState(this)">
|
|
|
+ <button id='reverse-btn' type='button' class="control-btn" onclick="reverseSelection()">
|
|
|
+ Inverti selezione
|
|
|
+ </button>
|
|
|
+ <button id='read-btn' type='button' class="control-btn" onclick="readSelected()">
|
|
|
+ <i class="fa fa-envelope-open-o" aria-hidden="true"></i>
|
|
|
+ </button>
|
|
|
+ <button id='delete-btn' type='button' class="control-btn" onclick="deleteSelected()">
|
|
|
+ <i class="fa fa-trash-o" aria-hidden="true"></i>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</body>
|
|
|
</html>
|