X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Ffrio%2Fjs%2Fmod_admin.js;h=188b4809863c7d1b697f2bda43d4d58722365159;hb=cf9a65cded8e8f270aedbb3ba46d5fe2fe351b4c;hp=8d573816cf2f4cb1118fa00863c639df99946455;hpb=20a2918bdaaa9108765228a9cabdab1c52de329e;p=friendica.git diff --git a/view/theme/frio/js/mod_admin.js b/view/theme/frio/js/mod_admin.js index 8d573816cf..188b480986 100644 --- a/view/theme/frio/js/mod_admin.js +++ b/view/theme/frio/js/mod_admin.js @@ -9,7 +9,9 @@ $(function() { selectnone($(this).data('selectNone')); }); - $('body').on('change', 'input[type=checkbox].select', function() { + // Toggle checkbox status to all or none for all checkboxes of a specific + // css class. + $('body').on('change', 'input[type=checkbox].selecttoggle', function() { $this = $(this); if ($this.prop('checked')) { selectall($this.data('selectClass')); @@ -20,27 +22,46 @@ $(function() { } }); -}); + // Use AJAX calls to reorder the table (so we don't need to reload the page). + $('body').on('click', '.table-order', function(e) { + e.preventDefault(); -function selectall(cls) { - $('.' + cls).prop('checked', true); - return false; -} -function selectnone(cls) { - $('.' + cls).prop('checked', false); - return false; -} + // Get the parent table element. + var table = $(this).parents('table'); + var orderUrl = this.getAttribute("data-order-url"); + table.fadeTo("fast", 0.33); + + $("body").css("cursor", "wait"); + + $.get(orderUrl, function(data) { + // Find the table element in the html we got. + var result = $(data).find('#' + table[0].id); + // And add the new table html to the parent. + $(table).parent().html(result); + $("body").css("cursor", "auto"); + }); + }); + + function selectall(cls) { + $('.' + cls).prop('checked', true); + return false; + } + function selectnone(cls) { + $('.' + cls).prop('checked', false); + return false; + } + + +}); // Users -function confirm_delete(uname){ - return confirm( "{{$confirm_delete}}".format(uname)); -} -function confirm_delete_multi(){ - return confirm("{{$confirm_delete_multi}}"); +function confirm_delete(msg, uname){ + return confirm(msg.format(uname)); } + function details(uid) { - $("#user-"+uid+"-detail").toggleClass("hidden"); - $("#user-"+uid).toggleClass("opened"); + $("#user-" + uid + "-detail").toggleClass("hidden"); + $("#user-" + uid).toggleClass("opened"); return false; }