3 Commits

5 changed files with 45 additions and 33 deletions

View File

@@ -1,13 +1,17 @@
/* /*
* ShrinkVertically -- mark the two vertical-collapse menu items so it is obvious the * ShrinkVertically page scripts (loaded on every page via template:layout:js). Each runs only where
* behaviour comes from this plugin and not from Kanboard core. * its elements exist, so both are no-ops elsewhere:
* *
* Core renders these labels in app/Template/project_header/dropdown.php: * 1. addPlus() -- mark the two vertical-collapse gear-menu items with a trailing "+" so it is
* obvious the behaviour comes from this plugin and not core. Core renders these labels in
* app/Template/project_header/dropdown.php:
* .filter-vert-collapse .filter-vert-toggle-collapse -> "Collapse vertically" * .filter-vert-collapse .filter-vert-toggle-collapse -> "Collapse vertically"
* .filter-vert-expand .filter-vert-toggle-collapse -> "Expand vertically" * .filter-vert-expand .filter-vert-toggle-collapse -> "Expand vertically"
* Editing the rendered text (not the translation table) is locale-independent.
* *
* We append a "+" to each so they read "Collapse vertically+" / "Expand vertically+". * 2. syncAutoAdjust() -- on Settings -> Shrink Vertically, dim + disable the pixel-offset input
* This is locale-independent (it edits the rendered text, not the translation table). * while "Auto adjust" is checked. This lives here (not an inline <script> on the config page)
* because Kanboard's CSP (default-src 'self') blocks inline scripts and event handlers.
*/ */
(function () { (function () {
"use strict"; "use strict";
@@ -26,9 +30,31 @@
} }
} }
if (document.readyState === "loading") { function syncAutoAdjust() {
document.addEventListener("DOMContentLoaded", addPlus); var auto = document.getElementById("form-shrink_vertically_auto");
} else { var offset = document.getElementById("form-shrink_vertically_offset");
if (! auto || ! offset) {
return;
}
function sync() {
offset.disabled = auto.checked;
offset.style.opacity = auto.checked ? "0.4" : "";
}
auto.addEventListener("change", sync);
sync();
}
function init() {
addPlus(); addPlus();
syncAutoAdjust();
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
} }
})(); })();

View File

@@ -59,7 +59,7 @@ class Plugin extends Base
public function getPluginVersion() public function getPluginVersion()
{ {
return '1.6.1'; return '1.6.4';
} }
public function getPluginHomepage() public function getPluginHomepage()

View File

@@ -100,7 +100,7 @@ These settings are global (per Kanboard instance) and admin-only. Go to
AGPL-3.0. See LICENSE. AGPL-3.0. See LICENSE.
## More Kanboard plugins by Ruben (drbeco) ## More Kanboard plugins by Dr. Beco
All free and AGPL-3.0, at [code.beco.cc](https://code.beco.cc/beco): All free and AGPL-3.0, at [code.beco.cc](https://code.beco.cc/beco):
@@ -108,6 +108,10 @@ All free and AGPL-3.0, at [code.beco.cc](https://code.beco.cc/beco):
monthly, weekly, daily), driven by the card due date. monthly, weekly, daily), driven by the card due date.
- **[FinanceBuddy](https://code.beco.cc/beco/FinanceBuddy)** -- attach a money value (debit/credit - **[FinanceBuddy](https://code.beco.cc/beco/FinanceBuddy)** -- attach a money value (debit/credit
and installments) to cards, shown on the card and totalled per column. and installments) to cards, shown on the card and totalled per column.
- **[QualKard](https://code.beco.cc/beco/QualKard)** -- flashcard spaced repetition: grade a card by
dragging it to a column, and it comes back when due (needs RecoReco).
- **[WorkspaceOrg](https://code.beco.cc/beco/WorkspaceOrg)** -- group your projects into personal
per-user workspaces, shown on a "My workspaces" dashboard page with a badge on each project.
- **[OrganonTweaks](https://code.beco.cc/beco/OrganonTweaks)** -- an umbrella of small - **[OrganonTweaks](https://code.beco.cc/beco/OrganonTweaks)** -- an umbrella of small
quality-of-life board tweaks: remove an empty column, always show the comment icon, emphasize due quality-of-life board tweaks: remove an empty column, always show the comment icon, emphasize due
dates, extra search keywords and shared board filters, and more. dates, extra search keywords and shared board filters, and more.

View File

@@ -37,23 +37,5 @@
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div> </div>
</form> </form>
<?php /* The "Auto adjust" checkbox dims/disables the offset input via Asset/js/shrink-vertically.js
<script> (loaded globally). An inline <script> here would be blocked by Kanboard's CSP. */ ?>
// Dim + disable the pixel-offset input while "Auto adjust" is checked (auto mode measures the height
// live on the board, so the manual offset is inactive). Disabled inputs are not submitted; the
// controller preserves the stored offset when it is absent, so the manual value is never lost.
(function () {
"use strict";
var auto = document.getElementById("form-shrink_vertically_auto");
var offset = document.getElementById("form-shrink_vertically_offset");
if (! auto || ! offset) {
return;
}
function sync() {
offset.disabled = auto.checked;
offset.style.opacity = auto.checked ? "0.4" : "";
}
auto.addEventListener("change", sync);
sync();
})();
</script>

View File

@@ -1 +1 @@
ShrinkVertically v1.6.1 ShrinkVertically v1.6.4