From 0afb2c0046b55c123eafb4ab9ee77efa68d12463 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 06 Jun 2026 17:15:31 +0000
Subject: [PATCH] =Starting the Favourites.js setup, converting previous Northeh stuff to new Registrar, fixing up Square.php integration to match
---
inc/forms/TaxonomySelector.php | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/inc/forms/TaxonomySelector.php b/inc/forms/TaxonomySelector.php
index 5af59da..8e4d0c1 100644
--- a/inc/forms/TaxonomySelector.php
+++ b/inc/forms/TaxonomySelector.php
@@ -57,6 +57,7 @@
'update' => true, // Whether to update on close
]);
+
$this->plural = $registrar->getPlural();
$this->singular = $registrar->getSingular();
}
@@ -101,7 +102,7 @@
?>
<dialog id="jvb-selector" aria-labelledby="modal-title" aria-modal="true">
<div class="wrap col">
- <header class="modal-header">
+ <header class="row">
<h3 id="modal-title">Select Taxonomy</h3>
</header>
@@ -111,8 +112,8 @@
<div class="items-wrap">
<!-- Common/Favorite terms section -->
<details class="favourite-terms" hidden>
- <summary class="title row btw">Your Go Tos:</summary>
- <ul class="favourite-list row btw"></ul>
+ <summary class="title row x-btw">Your Go Tos:</summary>
+ <ul class="favourite-list row x-btw"></ul>
</details>
<!-- Pagination info -->
@@ -130,7 +131,7 @@
{ <span>loading items</span> }
</p>
<!-- Terms list -->
- <ul class="items-container col start" role="listbox" aria-label="Available terms">
+ <ul class="items-container col top" role="listbox" aria-label="Available terms">
<!-- Terms will be populated here -->
</ul>
@@ -143,13 +144,13 @@
<!-- Search section -->
<div class="search-wrapper">
<div class="search-bar">
- <?= jvbSearch('Search terms', 'search-terms') ?>
+ <?= str_replace('class="search-container', 'class="open search-container', jvbSearch('Search terms', 'search-terms')) ?>
</div>
</div>
<!-- Create new term section -->
<details class="create-term" hidden>
- <summary class="row btw">Add New Term</summary>
+ <summary class="row x-btw">Add New Term</summary>
<div class="create-new-term-section">
<form class="create-term" data-nocache data-form-id="create-term" data-save="terms">
<div class="form-group">
@@ -195,7 +196,7 @@
<template class="selectedTerm">
<div class="selected-item row">
<span class="item-name"></span>
- <button type="button" class="remove-term row"><?=jvbIcon('x')?></button>
+ <button type="button" class="remove-term"><?=jvbIcon('x')?></button>
</div>
</template>
<template class="termBreadcrumb">
@@ -229,7 +230,7 @@
?>
<div class="jvb-selector <?= esc_attr($this->name) ?>"
id="<?= esc_attr($this->id) ?>"<?= $hidden ?>>
- <div class="field-group-header row btw">
+ <div class="field-group-header row x-btw">
<label for="<?= $this->base ?><?= esc_attr($this->config['name']) ?>-autocomplete">
<?= ($this->config['icon']) ? jvbIcon($this->config['icon']) : '' ?>
<span><?= $this->config['label'] ?></span>
@@ -268,7 +269,7 @@
$selectedItems = ob_get_clean();
endif;
?>
- <div class="selected-items row" role="region" aria-label="Selected <?= esc_attr($this->plural) ?>"><?=$selectedItems?></div>
+ <div class="selected-items row left" role="region" aria-label="Selected <?= esc_attr($this->plural) ?>"><?=$selectedItems?></div>
<?= $extra ?>
</div>
<?php
@@ -277,12 +278,14 @@
protected function renderTaxonomyToggle(array $selected = [], string $extra = ''): string
{
+
return sprintf(
- '<button type="button" data-icon="%s" data-filter="taxonomy" data-taxonomy="%s" data-type="selector" data-single="%s" data-plural="%s" title="Filter by %s">%s<span class="label">%s</span></button>',
+ '<button type="button" data-icon="%s" data-filter="taxonomy" data-taxonomy="%s" data-type="selector" data-single="%s" data-plural="%s" %stitle="Filter by %s">%s<span class="label">%s</span></button>',
$this->registrar->getIcon(),
$this->name,
$this->singular,
$this->plural,
+ $this->buildDataAttributes([]),
$this->singular,
jvbIcon($this->registrar->getIcon()),
$this->singular
--
Gitblit v1.10.0