De-conflict asset bundles

This commit is contained in:
2022-03-05 17:22:25 +00:00
parent 5cf22b1715
commit 299a6709cd
10 changed files with 37 additions and 35 deletions

View File

@@ -0,0 +1,25 @@
/**
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
*
* This script depends on uf-table.js, moment.js, handlebars-helpers.js, widgets/users.js
*
* Target page: /organisations/o/{slug}
*/
$(document).ready(function() {
// Control buttons
bindOrganisationButtons($("#view-organisation"), { delete_redirect: page.delete_redirect, leave_redirect: page.leave_redirect });
// Table of users in this organisation
$("#widget-organisation-members").ufTable({
dataUrl: site.uri.public + '/api/organisations/o/' + page.organisation_slug + '/members',
useLoadingTransition: site.uf_table.use_loading_transition
});
// Bind user table buttons
$("#widget-organisation-members").on("pagerComplete.ufTable", function () {
bindMemberButtons($(this));
bindUserButtons($(this));
});
});

View File

@@ -0,0 +1,38 @@
/**
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
*
* This script depends on widgets/organisations.js, uf-table.js, moment.js, handlebars-helpers.js
*
* Target page: /organisations
*/
$(document).ready(function() {
if ($("#widget-organisations").length) {
$("#widget-organisations").ufTable({
dataUrl: site.uri.public + "/api/organisations",
useLoadingTransition: site.uf_table.use_loading_transition
});
// Bind creation button
bindOrganisationCreationButton($("#widget-organisations"));
// Bind registration button
bindOrganisationRegistrationButton($("#widget-organisations"));
// Bind table buttons
$("#widget-organisations").on("pagerComplete.ufTable", function () {
bindOrganisationButtons($(this));
});
} else {
$("#widget-deleted-organisations").ufTable({
dataUrl: site.uri.public + "/api/organisations/deleted",
useLoadingTransition: site.uf_table.use_loading_transition
});
// Bind table buttons
$("#widget-deleted-organisations").on("pagerComplete.ufTable", function () {
bindOrganisationButtons($(this));
});
}
});

View File

@@ -0,0 +1,13 @@
/**
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
*
* This script depends on uf-table.js, moment.js, handlebars-helpers.js
*
* Target page: /users/u/{user_name}
*/
$(document).ready(function() {
// Control buttons
bindUserButtonsExtra($("#view-user"), { delete_redirect: page.delete_redirect });
});

View File

@@ -0,0 +1,15 @@
/**
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
*
* This script depends on widgets/users.js, uf-table.js, moment.js, handlebars-helpers.js
*
* Target page: /users
*/
$(document).ready(function() {
// Bind table buttons
$("#widget-users").on("pagerComplete.ufTable", function () {
bindUserButtonsExtra($(this));
});
});