From 92b7dd3335a6572debeacfb5faa82c63a5e67888 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 8 Jun 2018 20:03:25 +0200 Subject: Some minor fixes --- .../assets/userfrosting/js/pages/activities.js | 32 +++---- .../assets/userfrosting/js/pages/dashboard.js | 98 +++++++++++----------- .../admin/assets/userfrosting/js/pages/group.js | 48 +++++------ .../admin/assets/userfrosting/js/pages/groups.js | 48 +++++------ .../assets/userfrosting/js/pages/permission.js | 40 ++++----- .../assets/userfrosting/js/pages/permissions.js | 32 +++---- .../admin/assets/userfrosting/js/pages/role.js | 46 +++++----- .../admin/assets/userfrosting/js/pages/roles.js | 48 +++++------ .../admin/assets/userfrosting/js/pages/user.js | 50 +++++------ .../admin/assets/userfrosting/js/pages/users.js | 48 +++++------ 10 files changed, 245 insertions(+), 245 deletions(-) (limited to 'main/app/sprinkles/admin/assets/userfrosting/js/pages') diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js index 4968ffd..2dc31e1 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js @@ -1,16 +1,16 @@ -/** - * 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: /activities - */ - -$(document).ready(function () { - // Set up table of activities - $("#widget-activities").ufTable({ - dataUrl: site.uri.public + "/api/activities", - useLoadingTransition: site.uf_table.use_loading_transition - }); -}); +/** + * 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: /activities + */ + +$(document).ready(function () { + // Set up table of activities + $("#widget-activities").ufTable({ + dataUrl: site.uri.public + "/api/activities", + useLoadingTransition: site.uf_table.use_loading_transition + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js index d78d611..3ff241d 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js @@ -1,49 +1,49 @@ -/** - * 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 }} - * - * Target page: /dashboard - */ - -$(document).ready(function () { - $('.js-clear-cache').click(function () { - $("body").ufModal({ - sourceUrl: site.uri.public + "/modals/dashboard/clear-cache", - ajaxParams: { - slug: $(this).data('slug') - }, - msgTarget: $("#alerts-page") - }); - - $("body").on('renderSuccess.ufModal', function (data) { - var modal = $(this).ufModal('getModal'); - var form = modal.find('.js-form'); - - form.ufForm() - .on("submitSuccess.ufForm", function () { - // Reload page on success - window.location.reload(); - }); - }); - }); - - // Table of site activities - $("#widget-activities").ufTable({ - dataUrl: site.uri.public + "/api/activities", - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Table of users in current user's group - $("#widget-group-users").ufTable({ - dataUrl: site.uri.public + "/api/groups/g/" + page.group_slug + "/users", - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind user creation button - bindUserCreationButton($("#widget-group-users")); - - // Bind user table buttons - $("#widget-group-users").on("pagerComplete.ufTable", function () { - bindUserButtons($(this)); - }); -}); +/** + * 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 }} + * + * Target page: /dashboard + */ + +$(document).ready(function () { + $('.js-clear-cache').click(function () { + $("body").ufModal({ + sourceUrl: site.uri.public + "/modals/dashboard/clear-cache", + ajaxParams: { + slug: $(this).data('slug') + }, + msgTarget: $("#alerts-page") + }); + + $("body").on('renderSuccess.ufModal', function (data) { + var modal = $(this).ufModal('getModal'); + var form = modal.find('.js-form'); + + form.ufForm() + .on("submitSuccess.ufForm", function () { + // Reload page on success + window.location.reload(); + }); + }); + }); + + // Table of site activities + $("#widget-activities").ufTable({ + dataUrl: site.uri.public + "/api/activities", + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Table of users in current user's group + $("#widget-group-users").ufTable({ + dataUrl: site.uri.public + "/api/groups/g/" + page.group_slug + "/users", + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind user creation button + bindUserCreationButton($("#widget-group-users")); + + // Bind user table buttons + $("#widget-group-users").on("pagerComplete.ufTable", function () { + bindUserButtons($(this)); + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js index e54b897..57cd98d 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js @@ -1,24 +1,24 @@ -/** - * 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: /groups/g/{slug} - */ - -$(document).ready(function () { - // Control buttons - bindGroupButtons($("#view-group")); - - // Table of users in this group - $("#widget-group-users").ufTable({ - dataUrl: site.uri.public + '/api/groups/g/' + page.group_slug + '/users', - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind user table buttons - $("#widget-group-users").on("pagerComplete.ufTable", function () { - bindUserButtons($(this)); - }); -}); +/** + * 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: /groups/g/{slug} + */ + +$(document).ready(function () { + // Control buttons + bindGroupButtons($("#view-group")); + + // Table of users in this group + $("#widget-group-users").ufTable({ + dataUrl: site.uri.public + '/api/groups/g/' + page.group_slug + '/users', + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind user table buttons + $("#widget-group-users").on("pagerComplete.ufTable", function () { + bindUserButtons($(this)); + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js index 42a1f05..f06eda8 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js @@ -1,24 +1,24 @@ -/** - * 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/groups.js, uf-table.js, moment.js, handlebars-helpers.js - * - * Target page: /groups - */ - -$(document).ready(function () { - - $("#widget-groups").ufTable({ - dataUrl: site.uri.public + "/api/groups", - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind creation button - bindGroupCreationButton($("#widget-groups")); - - // Bind table buttons - $("#widget-groups").on("pagerComplete.ufTable", function () { - bindGroupButtons($(this)); - }); -}); +/** + * 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/groups.js, uf-table.js, moment.js, handlebars-helpers.js + * + * Target page: /groups + */ + +$(document).ready(function () { + + $("#widget-groups").ufTable({ + dataUrl: site.uri.public + "/api/groups", + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind creation button + bindGroupCreationButton($("#widget-groups")); + + // Bind table buttons + $("#widget-groups").on("pagerComplete.ufTable", function () { + bindGroupButtons($(this)); + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js index 61eefb6..ccb6bde 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js @@ -1,20 +1,20 @@ -/** - * 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: /permissions/p/{id} - */ - -$(document).ready(function () { - $("#widget-permission-users").ufTable({ - dataUrl: site.uri.public + '/api/permissions/p/' + page.permission_id + '/users', - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind table buttons - $("#widget-permission-users").on("pagerComplete.ufTable", function () { - bindUserButtons($(this)); - }); -}); +/** + * 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: /permissions/p/{id} + */ + +$(document).ready(function () { + $("#widget-permission-users").ufTable({ + dataUrl: site.uri.public + '/api/permissions/p/' + page.permission_id + '/users', + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind table buttons + $("#widget-permission-users").on("pagerComplete.ufTable", function () { + bindUserButtons($(this)); + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js index 4881d25..46dfd3a 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js @@ -1,16 +1,16 @@ -/** - * 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/permissions.js, uf-table.js, moment.js, handlebars-helpers.js - * - * Target page: /permissions - */ - -$(document).ready(function () { - // Set up table of permissions - $("#widget-permissions").ufTable({ - dataUrl: site.uri.public + "/api/permissions", - useLoadingTransition: site.uf_table.use_loading_transition - }); -}); +/** + * 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/permissions.js, uf-table.js, moment.js, handlebars-helpers.js + * + * Target page: /permissions + */ + +$(document).ready(function () { + // Set up table of permissions + $("#widget-permissions").ufTable({ + dataUrl: site.uri.public + "/api/permissions", + useLoadingTransition: site.uf_table.use_loading_transition + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js index 3bfcef7..f8f75b2 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js @@ -1,23 +1,23 @@ -/** - * 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: /roles/r/{slug} - */ - -$(document).ready(function () { - // Control buttons - bindRoleButtons($("#view-role")); - - $("#widget-role-permissions").ufTable({ - dataUrl: site.uri.public + '/api/roles/r/' + page.role_slug + '/permissions', - useLoadingTransition: site.uf_table.use_loading_transition - }); - - $("#widget-role-users").ufTable({ - dataUrl: site.uri.public + '/api/roles/r/' + page.role_slug + '/users', - useLoadingTransition: site.uf_table.use_loading_transition - }); -}); +/** + * 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: /roles/r/{slug} + */ + +$(document).ready(function () { + // Control buttons + bindRoleButtons($("#view-role")); + + $("#widget-role-permissions").ufTable({ + dataUrl: site.uri.public + '/api/roles/r/' + page.role_slug + '/permissions', + useLoadingTransition: site.uf_table.use_loading_transition + }); + + $("#widget-role-users").ufTable({ + dataUrl: site.uri.public + '/api/roles/r/' + page.role_slug + '/users', + useLoadingTransition: site.uf_table.use_loading_transition + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js index 0643305..8818cb5 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js @@ -1,24 +1,24 @@ -/** - * 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/roles.js, uf-table.js, moment.js, handlebars-helpers.js - * - * Target page: /roles - */ - -$(document).ready(function () { - // Set up table of roles - $("#widget-roles").ufTable({ - dataUrl: site.uri.public + "/api/roles", - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind creation button - bindRoleCreationButton($("#widget-roles")); - - // Bind table buttons - $("#widget-roles").on("pagerComplete.ufTable", function () { - bindRoleButtons($(this)); - }); -}); +/** + * 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/roles.js, uf-table.js, moment.js, handlebars-helpers.js + * + * Target page: /roles + */ + +$(document).ready(function () { + // Set up table of roles + $("#widget-roles").ufTable({ + dataUrl: site.uri.public + "/api/roles", + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind creation button + bindRoleCreationButton($("#widget-roles")); + + // Bind table buttons + $("#widget-roles").on("pagerComplete.ufTable", function () { + bindRoleButtons($(this)); + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js index 79d0301..ce75bd5 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js @@ -1,25 +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 - * - * Target page: /users/u/{user_name} - */ - -$(document).ready(function () { - // Control buttons - bindUserButtons($("#view-user")); - - // Table of activities - $("#widget-user-activities").ufTable({ - dataUrl: site.uri.public + '/api/users/u/' + page.user_name + '/activities', - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Table of permissions - $("#widget-permissions").ufTable({ - dataUrl: site.uri.public + '/api/users/u/' + page.user_name + '/permissions', - useLoadingTransition: site.uf_table.use_loading_transition - }); -}); +/** + * 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 + bindUserButtons($("#view-user")); + + // Table of activities + $("#widget-user-activities").ufTable({ + dataUrl: site.uri.public + '/api/users/u/' + page.user_name + '/activities', + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Table of permissions + $("#widget-permissions").ufTable({ + dataUrl: site.uri.public + '/api/users/u/' + page.user_name + '/permissions', + useLoadingTransition: site.uf_table.use_loading_transition + }); +}); diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js index 2e8685c..2051012 100644 --- a/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js +++ b/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js @@ -1,24 +1,24 @@ -/** - * 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 () { - // Set up table of users - $("#widget-users").ufTable({ - dataUrl: site.uri.public + "/api/users", - useLoadingTransition: site.uf_table.use_loading_transition - }); - - // Bind creation button - bindUserCreationButton($("#widget-users")); - - // Bind table buttons - $("#widget-users").on("pagerComplete.ufTable", function () { - bindUserButtons($(this)); - }); -}); +/** + * 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 () { + // Set up table of users + $("#widget-users").ufTable({ + dataUrl: site.uri.public + "/api/users", + useLoadingTransition: site.uf_table.use_loading_transition + }); + + // Bind creation button + bindUserCreationButton($("#widget-users")); + + // Bind table buttons + $("#widget-users").on("pagerComplete.ufTable", function () { + bindUserButtons($(this)); + }); +}); -- cgit v1.2.3