aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-06 20:13:14 -0800
committerzotlabs <mike@macgirvin.com>2017-11-06 20:13:14 -0800
commit3f1a4b655900d64ad2c13f1906eb77eaf15d11b5 (patch)
tree4bd5ea0d025e1d7deca8080fb2eb84d97f250f4c /view/js
parent11a7a08b9d98073a3dcb012bea4ec32e8baf649d (diff)
downloadvolse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.tar.gz
volse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.tar.bz2
volse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.zip
second half of issue #893 - move channel default permissions to its own module so we can apply different page/widget layouts than for connedit; the relevant functionality is abandoned on mod_connedit but still intact. Trying a slightly different look/behaviour for inherited settings and the associated checkboxes. This may need a bit more tweaking but overall looks a lot cleaner.
Diffstat (limited to 'view/js')
-rw-r--r--view/js/mod_defperms.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/view/js/mod_defperms.js b/view/js/mod_defperms.js
new file mode 100644
index 000000000..c89142579
--- /dev/null
+++ b/view/js/mod_defperms.js
@@ -0,0 +1,32 @@
+$(document).ready(function() {
+
+ $('#id_permcat').change(function() {
+ $('.loading-role-rotator').show();
+ var permName = $('#id_permcat').val();
+ loadConnectionRole(permName);
+ });
+
+
+});
+
+
+function loadConnectionRole(name) {
+
+ if(! name)
+ name = 'default';
+
+ $('.defperms-edit input').each(function() {
+ if(! $(this).is(':disabled'))
+ $(this).removeAttr('checked');
+ });
+
+ $.get('permcat/' + name, function(data) {
+ $(data.perms).each(function() {
+ if(this.value)
+ $('#id_perms_' + this.name).attr('checked','checked');
+ });
+ $('.loading-role-rotator').hide();
+ });
+}
+
+