/* * Copyright (c) 2016 * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ /* global OC, Handlebars */ (function() { var TEMPLATE_MENU = ''; /** * Construct a new FederationScopeMenu instance * @constructs FederationScopeMenu * @memberof OC.Settings */ var FederationScopeMenu = OC.Backbone.View.extend({ tagName: 'div', className: 'federationScopeMenu popovermenu bubble hidden menu', field: undefined, _scopes: undefined, initialize: function(options) { this.field = options.field; this._scopes = [ { name: 'private', displayName: (this.field === 'avatar' || this.field === 'displayname') ? t('settings', 'Local') : t('settings', 'Private'), tooltip: (this.field === 'avatar' || this.field === 'displayname') ? t('settings', 'Only visible to local users') : t('settings', 'Only visible to you'), icon: OC.imagePath('core', 'actions/password'), active: false }, { name: 'contacts', displayName: t('settings', 'Contacts'), tooltip: t('settings', 'Visible to local users and to trusted servers'), icon: OC.imagePath('core', 'places/contacts-dark'), active: false }, { name: 'public', displayName: t('settings', 'Public'), tooltip: t('settings', 'Will be synced to a global and public address book'), icon: OC.imagePath('core', 'places/link'), active: false } ]; }, /** * Current context * * @type OCA.Files.FileActionContext */ _context: null, events: { 'click a.action': '_onClickAction' }, template: Handlebars.compile(TEMPLATE_MENU), /** * Event handler whenever an action has been clicked within the menu * * @param {Object} event event object */ _onClickAction: function(event) { var $target = $(event.currentTarget); if (!$target.hasClass('menuitem')) { $target = $target.closest('.menuitem'); } this.trigger('select:scope', $target.data('action')); OC.hideMenus(); }, /** * Renders the menu with the currently set items */ render: function() { this.$el.html(this.template({ items: this._scopes })); }, /** * Displays the menu */ show: function(context) { this._context = context; var currentlyActiveValue = $('#'+context.target.closest('form').id).find('input[type="hidden"]')[0].value; for(var i in this._scopes) { this._scopes[i].active = false; } switch (currentlyActiveValue) { case "private": this._scopes[0].active = true; break; case "contacts": this._scopes[1].active = true; break; case "public": this._scopes[2].active = true; break; } var $el = $(context.target); var offsetIcon = $el.offset(); var offsetHeading = $el.closest('h2').offset(); this.render(); this.$el.removeClass('hidden'); OC.showMenu(null, this.$el); } }); OC.Settings = OC.Settings || {}; OC.Settings.FederationScopeMenu = FederationScopeMenu; })(); 6e545a8871b6a70d2efa'>root/integrations/git_helper_for_declarative_test.go
blob: 294f0bc5fe6ba6054b7daf7cfdfbb8895bd657da (plain)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191