diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index 00932df8..a7d251dd 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -26,7 +26,9 @@ $(document).ready(function () { var classes = ['answer correct', 'answer half-correct', 'answer incorrect']; $(element).each(function () { - this.className = classes[($.inArray(this.className, classes) + 1) % classes.length]; + mark = classes[($.inArray(this.className, classes) + 1) % classes.length]; + this.className = mark + this.dataset.newmark = mark }); prepAnswerData(); diff --git a/static/admin/js/actions.js b/static/admin/js/actions.js index da1c3108..2830e911 100644 --- a/static/admin/js/actions.js +++ b/static/admin/js/actions.js @@ -36,7 +36,10 @@ function clearAcross(options) { reset(options); - document.querySelector(options.acrossInput).value = 0; + const acrossInputs = document.querySelectorAll(options.acrossInput); + acrossInputs.forEach(function(acrossInput) { + acrossInput.value = 0; + }); document.querySelector(options.actionContainer).classList.remove(options.selectedClass); } @@ -107,8 +110,10 @@ document.querySelectorAll(options.acrossQuestions + " a").forEach(function(el) { el.addEventListener('click', function(event) { event.preventDefault(); - const acrossInput = document.querySelector(options.acrossInput); - acrossInput.value = 1; + const acrossInputs = document.querySelectorAll(options.acrossInput); + acrossInputs.forEach(function(acrossInput) { + acrossInput.value = 1; + }); showClear(options); }); }); diff --git a/static/js/anatomy.js b/static/js/anatomy.js index 00932df8..a7d251dd 100644 --- a/static/js/anatomy.js +++ b/static/js/anatomy.js @@ -26,7 +26,9 @@ $(document).ready(function () { var classes = ['answer correct', 'answer half-correct', 'answer incorrect']; $(element).each(function () { - this.className = classes[($.inArray(this.className, classes) + 1) % classes.length]; + mark = classes[($.inArray(this.className, classes) + 1) % classes.length]; + this.className = mark + this.dataset.newmark = mark }); prepAnswerData(); diff --git a/static/mptt/arrow-move-black.png b/static/mptt/arrow-move-black.png new file mode 100644 index 00000000..d528679e Binary files /dev/null and b/static/mptt/arrow-move-black.png differ diff --git a/static/mptt/arrow-move-white.png b/static/mptt/arrow-move-white.png new file mode 100644 index 00000000..40e4f1f8 Binary files /dev/null and b/static/mptt/arrow-move-white.png differ diff --git a/static/mptt/disclosure-down-black.png b/static/mptt/disclosure-down-black.png new file mode 100644 index 00000000..5f217577 Binary files /dev/null and b/static/mptt/disclosure-down-black.png differ diff --git a/static/mptt/disclosure-down-white.png b/static/mptt/disclosure-down-white.png new file mode 100644 index 00000000..c55f6f62 Binary files /dev/null and b/static/mptt/disclosure-down-white.png differ diff --git a/static/mptt/disclosure-right-black.png b/static/mptt/disclosure-right-black.png new file mode 100644 index 00000000..50741efc Binary files /dev/null and b/static/mptt/disclosure-right-black.png differ diff --git a/static/mptt/disclosure-right-white.png b/static/mptt/disclosure-right-white.png new file mode 100644 index 00000000..850380dc Binary files /dev/null and b/static/mptt/disclosure-right-white.png differ diff --git a/static/mptt/draggable-admin.css b/static/mptt/draggable-admin.css index 936daad2..16cb8538 100644 --- a/static/mptt/draggable-admin.css +++ b/static/mptt/draggable-admin.css @@ -13,14 +13,23 @@ } .tree-node { cursor: pointer; } -.tree-node.children { background-image: url(disclosure-down.png); } -.tree-node.closed { background-image: url(disclosure-right.png); } +.tree-node.children { background-image: url(disclosure-down-black.png); } +.tree-node.closed { background-image: url(disclosure-right-black.png); } -.drag-handle { background-image: url(arrow-move.png); cursor: move; } +.drag-handle { background-image: url(arrow-move-black.png); cursor: move; } /* focus */ #result_list tbody tr:focus { - background-color: #ffffcc !important; outline: 0px; } + background-color: var(--selected-row, #ffc) !important; outline: 0px; } + +@media (prefers-color-scheme: dark) { + .tree-node.children { background-image: url(disclosure-down-white.png); } + .tree-node.closed { background-image: url(disclosure-right-white.png); } + .drag-handle { background-image: url(arrow-move-white.png); } + + #result_list tbody tr:focus { + background-color: var(--selected-row, #00363A) !important; outline: 0px; } +} #drag-line { position: absolute; diff --git a/static/sortedm2m/widget.js b/static/sortedm2m/widget.js index 10fc3a56..aacbdf52 100644 --- a/static/sortedm2m/widget.js +++ b/static/sortedm2m/widget.js @@ -19,18 +19,31 @@ if (typeof jQuery === 'undefined') { var label, labelFor; var currentElement = ul; - while (!label || !label.length) { + // Look for a