diff options
author | mrjive <mrjive@mrjive.it> | 2015-12-04 10:32:14 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-12-04 10:32:14 +0100 |
commit | 051346325609f5f2e78ef0deaf182c65d7823bbc (patch) | |
tree | f3660377b3daf6599623d2e4fb95b4d33c30d8cc /view/js/acl.js | |
parent | 53a796afcc0cff6f9e3f51457df4506a43db1945 (diff) | |
parent | 8a9d743f6f518d3af35014130dcef8f148148113 (diff) | |
download | volse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.tar.gz volse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.tar.bz2 volse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.zip |
Merge pull request #9 from redmatrix/master
updating from original codebase
Diffstat (limited to 'view/js/acl.js')
-rw-r--r-- | view/js/acl.js | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/view/js/acl.js b/view/js/acl.js index 626d1a750..ed8af478a 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -25,20 +25,18 @@ function ACL(backend_url, preset) { /*events*/ $(document).ready(function() { -// setTimeout( function() { that.showall.click(that.on_showall); $(document).on('click','.acl-button-show',that.on_button_show); $(document).on('click','.acl-button-hide',that.on_button_hide); $("#acl-search").keypress(that.on_search); /* startup! */ - that.get(0,100); + that.get(0,15000); that.on_submit(); -// }, 5000 ); }); } -// no longer called on submit - call to update whenever a change occurs to the acl list. +// no longer called only on submit - call to update whenever a change occurs to the acl list. ACL.prototype.on_submit = function() { aclfileds = $("#acl-fields").html(""); @@ -62,11 +60,13 @@ ACL.prototype.on_submit = function() { ACL.prototype.search = function() { var srcstr = $("#acl-search").val(); that.list_content.html(""); - that.get(0, 100, srcstr); + that.get(0, 15000, srcstr); }; ACL.prototype.on_search = function(event) { - if (that.kp_timer) clearTimeout(that.kp_timer); + if (that.kp_timer) { + clearTimeout(that.kp_timer); + } that.kp_timer = setTimeout( that.search, 1000); }; @@ -90,15 +90,37 @@ ACL.prototype.on_showall = function(event) { return false; }; +ACL.prototype.on_selectall = function(event) { + event.preventDefault(); + event.stopPropagation(); + + /* This function has not yet been completed. */ + /* The goal is to select all ACL "show" entries with one action. */ + + $('.acl-button-show').each(function(){}); + + if (that.showall.hasClass("btn-warning")) { + return false; + } + that.showall.removeClass("btn-default").addClass("btn-warning"); + + that.allow_cid = []; + that.allow_gid = []; + that.deny_cid = []; + that.deny_gid = []; + + that.update_view(); + that.on_submit(); + + return false; +}; + + ACL.prototype.on_button_show = function(event) { event.preventDefault(); event.stopImmediatePropagation(); event.stopPropagation(); - /*that.showall.removeClass("selected"); - $(this).siblings(".acl-button-hide").removeClass("selected"); - $(this).toggleClass("selected");*/ - that.set_allow($(this).parent().attr('id')); that.on_submit(); @@ -110,10 +132,6 @@ ACL.prototype.on_button_hide = function(event) { event.stopImmediatePropagation(); event.stopPropagation(); - /*that.showall.removeClass("selected"); - $(this).siblings(".acl-button-show").removeClass("selected"); - $(this).toggleClass("selected");*/ - that.set_deny($(this).parent().attr('id')); that.on_submit(); |