aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/mod_settings.js
blob: 7f9a9e960d4a209dfce7d2b2057ef2d6bb322b40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
var ispublic = aStr['everybody'] ;

$(document).ready(function() {

			  $("a#settings-default-perms-menu").colorbox({ 
				  'inline' : true, 
				  'transition' : 'elastic' 
			});

	$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
		var selstr;
		$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
			selstr = $(this).text();
			$('#jot-perms-icon').removeClass('unlock').addClass('lock');
			$('#jot-public').hide();
		});
		if(selstr == null) { 
			$('#jot-perms-icon').removeClass('lock').addClass('unlock');
			$('#jot-public').show();
		}

	}).trigger('change');

});

function channel_privacy_macro(n) {
    if(n == 0) {
        $('#id_view_stream option').eq(0).attr('selected','selected');
        $('#id_view_profile option').eq(0).attr('selected','selected');
        $('#id_view_photos option').eq(0).attr('selected','selected');
        $('#id_view_contacts option').eq(0).attr('selected','selected');
        $('#id_view_storage option').eq(0).attr('selected','selected');
        $('#id_view_pages option').eq(0).attr('selected','selected');
        $('#id_send_stream option').eq(0).attr('selected','selected');
        $('#id_post_wall option').eq(0).attr('selected','selected');
        $('#id_post_comments option').eq(0).attr('selected','selected');
        $('#id_post_mail option').eq(0).attr('selected','selected');
        $('#id_post_photos option').eq(0).attr('selected','selected');
        $('#id_tag_deliver option').eq(0).attr('selected','selected');
        $('#id_chat option').eq(0).attr('selected','selected');
        $('#id_write_storage option').eq(0).attr('selected','selected');
        $('#id_write_pages option').eq(0).attr('selected','selected');
        $('#id_delegate option').eq(0).attr('selected','selected');
		$('#id_republish option').eq(0).attr('selected','selected');
		$('#id_profile_in_directory_onoff .off').removeClass('hidden');
		$('#id_profile_in_directory_onoff .on').addClass('hidden');
		$('#id_profile_in_directory').val(0);
	}
    if(n == 1) {
        $('#id_view_stream option').eq(1).attr('selected','selected');
        $('#id_view_profile option').eq(1).attr('selected','selected');
        $('#id_view_photos option').eq(1).attr('selected','selected');
        $('#id_view_contacts option').eq(1).attr('selected','selected');
        $('#id_view_storage option').eq(1).attr('selected','selected');
        $('#id_view_pages option').eq(1).attr('selected','selected');
        $('#id_send_stream option').eq(1).attr('selected','selected');
        $('#id_post_wall option').eq(1).attr('selected','selected');
        $('#id_post_comments option').eq(1).attr('selected','selected');
        $('#id_post_mail option').eq(1).attr('selected','selected');
        $('#id_post_photos option').eq(1).attr('selected','selected');
        $('#id_tag_deliver option').eq(1).attr('selected','selected');
        $('#id_chat option').eq(1).attr('selected','selected');
        $('#id_write_storage option').eq(1).attr('selected','selected');
        $('#id_write_pages option').eq(1).attr('selected','selected');
        $('#id_delegate option').eq(0).attr('selected','selected');
		$('#id_republish option').eq(0).attr('selected','selected');
		$('#id_profile_in_directory_onoff .off').removeClass('hidden');
		$('#id_profile_in_directory_onoff .on').addClass('hidden');
		$('#id_profile_in_directory').val(0);
	}
    if(n == 2) {
        $('#id_view_stream option').eq(5).attr('selected','selected');
        $('#id_view_profile option').eq(5).attr('selected','selected');
        $('#id_view_photos option').eq(5).attr('selected','selected');
        $('#id_view_contacts option').eq(5).attr('selected','selected');
        $('#id_view_storage option').eq(5).attr('selected','selected');
        $('#id_view_pages option').eq(5).attr('selected','selected');
        $('#id_send_stream option').eq(1).attr('selected','selected');
        $('#id_post_wall option').eq(1).attr('selected','selected');
        $('#id_post_comments option').eq(1).attr('selected','selected');
        $('#id_post_mail option').eq(1).attr('selected','selected');
        $('#id_post_photos option').eq(0).attr('selected','selected');
        $('#id_tag_deliver option').eq(1).attr('selected','selected');
        $('#id_chat option').eq(1).attr('selected','selected');
        $('#id_write_storage option').eq(0).attr('selected','selected');
        $('#id_write_pages option').eq(0).attr('selected','selected');
        $('#id_delegate option').eq(0).attr('selected','selected');
		$('#id_republish option').eq(1).attr('selected','selected');
		$('#id_profile_in_directory_onoff .on').removeClass('hidden');
		$('#id_profile_in_directory_onoff .off').addClass('hidden');
		$('#id_profile_in_directory').val(1);
	}
    if(n == 3) {
        $('#id_view_stream option').eq(5).attr('selected','selected');
        $('#id_view_profile option').eq(5).attr('selected','selected');
        $('#id_view_photos option').eq(5).attr('selected','selected');
        $('#id_view_contacts option').eq(5).attr('selected','selected');
        $('#id_view_storage option').eq(5).attr('selected','selected');
        $('#id_view_pages option').eq(5).attr('selected','selected');
        $('#id_send_stream option').eq(4).attr('selected','selected');
        $('#id_post_wall option').eq(4).attr('selected','selected');
        $('#id_post_comments option').eq(4).attr('selected','selected');
        $('#id_post_mail option').eq(4).attr('selected','selected');
        $('#id_post_photos option').eq(2).attr('selected','selected');
        $('#id_tag_deliver option').eq(1).attr('selected','selected');
        $('#id_chat option').eq(4).attr('selected','selected');
        $('#id_write_storage option').eq(2).attr('selected','selected');
        $('#id_write_pages option').eq(2).attr('selected','selected');
        $('#id_delegate option').eq(0).attr('selected','selected');
		$('#id_republish option').eq(4).attr('selected','selected');
		$('#id_profile_in_directory_onoff .on').removeClass('hidden');
		$('#id_profile_in_directory_onoff .off').addClass('hidden');
		$('#id_profile_in_directory').val(1);

	}



}