[Rt-commit] rt branch 6.0/htmx updated. rt-5.0.4-28-g4326958f9b
BPS Git Server
git at git.bestpractical.com
Tue Jun 20 15:42:27 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 6.0/htmx has been updated
via 4326958f9ba97869bbeb2d1867b53e4cdacb831f (commit)
via e8e59ad7c6a03a51723b40cd7a7ba2f00c64cf97 (commit)
from e1c99ac25af359699b5010c10eaf35b52e8e857a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4326958f9ba97869bbeb2d1867b53e4cdacb831f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue Jun 20 11:40:45 2023 -0400
Prevent htmx from visiting the modify page
Without the htmx:abort, the inline edit panel displays
briefly, then htmx loads the modify page because of the
link in the pencil icon.
diff --git a/share/static/js/util.js b/share/static/js/util.js
index bf39ce2b87..79954ba8f9 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -1318,6 +1318,7 @@ htmx.onLoad(function () {
jQuery('.inline-edit-toggle').click(function (e) {
e.preventDefault();
+ htmx.trigger(this, 'htmx:abort');
toggle_inline_edit(jQuery(this));
});
@@ -1332,6 +1333,7 @@ htmx.onLoad(function () {
}
e.preventDefault();
+ htmx.trigger(this, 'htmx:abort');
var container = jQuery(this).closest('.titlebox');
if (container.hasClass('editing')) {
return;
commit e8e59ad7c6a03a51723b40cd7a7ba2f00c64cf97
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue Jun 20 10:52:53 2023 -0400
Replace default jQuery call with htmx onload
htmx.onLoad runs for every htmx interaction, so replace the
previous jQuery calls with onLoad to make sure the JS that
used to run on every page load still runs as expected when
the page doesn't reload.
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 19de95fc9a..3cd247df4c 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -118,6 +118,7 @@ sub SquishedJS {
sub JSFiles {
return qw{
+ htmx.min.js
jquery-3.6.0.min.js
jquery_noconflict.js
jquery-ui.min.js
@@ -151,7 +152,6 @@ sub JSFiles {
chartjs-plugin-colorschemes.min.js
jquery.jgrowl.min.js
clipboard.min.js
- htmx.min.js
rt-htmx.js
}, RT->Config->Get('JSFiles');
}
diff --git a/share/static/js/assets.js b/share/static/js/assets.js
index 6eba4c09d5..1e207d5ca6 100644
--- a/share/static/js/assets.js
+++ b/share/static/js/assets.js
@@ -1,4 +1,4 @@
-jQuery(function() {
+htmx.onLoad(function() {
var showModal = function(html) {
var modal = jQuery("<div class='modal'></div>");
modal.append(html).appendTo("body");
diff --git a/share/static/js/autocomplete.js b/share/static/js/autocomplete.js
index c967050ddf..1cf57352f6 100644
--- a/share/static/js/autocomplete.js
+++ b/share/static/js/autocomplete.js
@@ -230,4 +230,4 @@ window.RT.Autocomplete.bind = function(from) {
};
});
};
-jQuery(function(){ RT.Autocomplete.bind(document) });
+htmx.onLoad(function(){ RT.Autocomplete.bind(document) });
diff --git a/share/static/js/event-registration.js b/share/static/js/event-registration.js
index 03ba528926..4c4ac7bc1f 100644
--- a/share/static/js/event-registration.js
+++ b/share/static/js/event-registration.js
@@ -1,5 +1,5 @@
// Disable chosing individual objects when a scrip is applied globally
-jQuery(function() {
+htmx.onLoad(function() {
var global_checkboxes = [
"form[name=AddRemoveScrip] input[type=checkbox][name^=AddScrip-][value=0]",
"form input[type=checkbox][name^=AddCustomField-][value=0]"
@@ -39,10 +39,10 @@ function ReplaceUserReferences() {
}
);
}
-jQuery(ReplaceUserReferences);
+htmx.onLoad(ReplaceUserReferences);
// Cascaded selects
-jQuery(function() {
+htmx.onLoad(function() {
jQuery("select.cascade-by-optgroup").each(function(){
var name = this.name;
if (!name) return;
@@ -118,7 +118,7 @@ jQuery(function() {
});
});
-jQuery( function() {
+htmx.onLoad( function() {
jQuery("input[type=file]").change( function() {
var input = jQuery(this);
var warning = input.next(".invalid");
@@ -138,7 +138,7 @@ jQuery( function() {
});
});
-jQuery(function() {
+htmx.onLoad(function() {
jQuery("#UpdateType").change(function(ev) {
jQuery(".messagebox-container")
.removeClass("action-response action-private")
diff --git a/share/static/js/forms.js b/share/static/js/forms.js
index bf12c95406..223e7eec5e 100644
--- a/share/static/js/forms.js
+++ b/share/static/js/forms.js
@@ -1,4 +1,4 @@
-jQuery(function() {
+htmx.onLoad(function() {
jQuery('.selectionbox-js').each(function () {
var container = jQuery(this);
var source = container.find('.source');
diff --git a/share/static/js/keyboard-shortcuts.js b/share/static/js/keyboard-shortcuts.js
index 8ae117ed92..7d3d5fb3a0 100644
--- a/share/static/js/keyboard-shortcuts.js
+++ b/share/static/js/keyboard-shortcuts.js
@@ -1,4 +1,4 @@
-jQuery(function() {
+htmx.onLoad(function() {
var goBack = function() {
window.history.back();
};
@@ -70,7 +70,7 @@ jQuery(function() {
Mousetrap.bind('?', openHelp);
});
-jQuery(function() {
+htmx.onLoad(function() {
// Only load these shortcuts if there is a ticket list on the page
var hasTicketList = jQuery('table.ticket-list').length;
if (!hasTicketList) return;
@@ -156,7 +156,7 @@ jQuery(function() {
Mousetrap.bind('x', toggleTicketCheckbox);
});
-jQuery(function() {
+htmx.onLoad(function() {
// Only load these shortcuts if reply or comment action is on page
var ticket_reply = jQuery('a#page-actions-reply');
var ticket_comment = jQuery('a#page-actions-comment');
diff --git a/share/static/js/late.js b/share/static/js/late.js
index 6a83ce0592..7d163acd76 100644
--- a/share/static/js/late.js
+++ b/share/static/js/late.js
@@ -1,4 +1,4 @@
-jQuery(function() { sync_grouped_custom_fields() } );
+htmx.onLoad(function() { sync_grouped_custom_fields() } );
function sync_grouped_custom_fields() {
var all_inputs = jQuery("input,textarea,select");
var parse_cf = /^Object-([\w:]+)-(\d*)-CustomField(?::\w+)?-(\d+)-(.*)$/;
diff --git a/share/static/js/lifecycleui-editor.js b/share/static/js/lifecycleui-editor.js
index c61412dfce..9019e1eba2 100644
--- a/share/static/js/lifecycleui-editor.js
+++ b/share/static/js/lifecycleui-editor.js
@@ -1,4 +1,4 @@
-jQuery(function () {
+htmx.onLoad(function () {
RT.NewLifecycleEditor = class LifecycleEditorNew extends LifecycleModel {
constructor(container, config, maps, layout) {
super("LifecycleModel");
diff --git a/share/static/js/quoteselection.js b/share/static/js/quoteselection.js
index 48e01a7557..d99623cd3e 100644
--- a/share/static/js/quoteselection.js
+++ b/share/static/js/quoteselection.js
@@ -1,4 +1,4 @@
-jQuery(function() {
+htmx.onLoad(function() {
if(RT.Config.QuoteSelectedText) {
var reply_from_selection = function(ev) {
var link = jQuery(this);
diff --git a/share/static/js/rights-inspector.js b/share/static/js/rights-inspector.js
index e9b8880439..681c48a9cd 100644
--- a/share/static/js/rights-inspector.js
+++ b/share/static/js/rights-inspector.js
@@ -1,4 +1,4 @@
-jQuery(function() {
+htmx.onLoad(function() {
var form = jQuery('form#rights-inspector');
if ( !form.length ) return;
diff --git a/share/static/js/rt-htmx.js b/share/static/js/rt-htmx.js
index d2b211140b..cb31273138 100644
--- a/share/static/js/rt-htmx.js
+++ b/share/static/js/rt-htmx.js
@@ -1,7 +1,6 @@
-jQuery(function() {
- htmx.onLoad(function(e) {
- // Refresh any dropdowns after they are loaded by turbo
- jQuery('.selectpicker').selectpicker('refresh');
- });
+htmx.onLoad(function(e) {
+ // Refresh any dropdowns after they are loaded by turbo
+ jQuery('.selectpicker').selectpicker('refresh');
});
+
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 1fa236cc4d..bf39ce2b87 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -315,7 +315,7 @@ function initDatePicker(elem) {
});
}
-jQuery(function() {
+htmx.onLoad(function() {
initDatePicker();
jQuery('td.collection-as-table:not(.editable)').each( function() {
if ( jQuery(this).children() ) {
@@ -648,7 +648,7 @@ function refreshCollectionListRow(tbody, table, success, error) {
}
// disable submit on enter in autocomplete boxes
-jQuery(function() {
+htmx.onLoad(function() {
jQuery('input[data-autocomplete], input.ui-autocomplete-input').each(function() {
var input = jQuery(this);
@@ -1142,7 +1142,7 @@ function filterSearchResults () {
};
/* inline edit */
-jQuery(function () {
+htmx.onLoad(function () {
var inlineEditEnabled = true;
var disableInlineEdit = function () {
inlineEditEnabled = false;
@@ -1412,7 +1412,7 @@ function toggle_hide_unset(e) {
}
// enable bootstrap tooltips
-jQuery(function() {
+htmx.onLoad(function() {
jQuery("body").tooltip({
selector: '[data-toggle=tooltip]',
trigger: 'hover focus'
@@ -1475,7 +1475,7 @@ function toggleTransactionDetails () {
}
// Use Growl to show any UserMessages written to the page
-jQuery( function() {
+htmx.onLoad( function() {
var userMessages = RT.UserMessages;
for (var key in userMessages) {
jQuery.jGrowl(userMessages[key], { sticky: true, themeState: 'none' });
-----------------------------------------------------------------------
Summary of changes:
lib/RT/Interface/Web.pm | 2 +-
share/static/js/assets.js | 2 +-
share/static/js/autocomplete.js | 2 +-
share/static/js/event-registration.js | 10 +++++-----
share/static/js/forms.js | 2 +-
share/static/js/keyboard-shortcuts.js | 6 +++---
share/static/js/late.js | 2 +-
share/static/js/lifecycleui-editor.js | 2 +-
share/static/js/quoteselection.js | 2 +-
share/static/js/rights-inspector.js | 2 +-
share/static/js/rt-htmx.js | 9 ++++-----
share/static/js/util.js | 12 +++++++-----
12 files changed, 27 insertions(+), 26 deletions(-)
hooks/post-receive
--
rt
More information about the rt-commit
mailing list