social_stream-base 0.9.19 → 0.9.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/app/assets/javascripts/contacts.js +0 -6
  2. data/app/assets/javascripts/relation_customs.js +28 -81
  3. data/app/assets/javascripts/settings.js +12 -33
  4. data/app/assets/stylesheets/base.css.scss +2 -1
  5. data/app/assets/stylesheets/relation_customs.css.scss +8 -2
  6. data/app/controllers/contacts_controller.rb +7 -3
  7. data/app/controllers/messages_controller.rb +1 -1
  8. data/app/controllers/search_controller.rb +22 -6
  9. data/app/controllers/settings_controller.rb +1 -1
  10. data/app/models/contact.rb +7 -1
  11. data/app/models/relation.rb +14 -1
  12. data/app/views/activities/_new.html.erb +3 -2
  13. data/app/views/contacts/_link.html.erb +1 -1
  14. data/app/views/contacts/index.html.erb +1 -1
  15. data/app/views/conversations/_conversation.html.erb +3 -3
  16. data/app/views/conversations/_conversation_full.html.erb +3 -3
  17. data/app/views/devise/registrations/_delete_account.html.erb +20 -0
  18. data/app/views/devise/registrations/_edit_user.html.erb +87 -0
  19. data/app/views/devise/registrations/edit.html.erb +16 -93
  20. data/app/views/layouts/_header_dropdown_menu.html.erb +0 -3
  21. data/app/views/messages/_form.html.erb +1 -1
  22. data/app/views/permissions/_index.html.erb +2 -2
  23. data/app/views/permissions/index.js.erb +7 -2
  24. data/app/views/relation/customs/_list.html.erb +12 -5
  25. data/app/views/relation/customs/create.js.erb +4 -2
  26. data/app/views/relation/customs/index.html.erb +0 -5
  27. data/app/views/search/_form.html.erb +1 -1
  28. data/app/views/settings/_api_key.html.erb +3 -3
  29. data/app/views/settings/_index.html.erb +6 -1
  30. data/app/views/settings/_notifications.html.erb +3 -3
  31. data/app/views/settings/index.html.erb +4 -1
  32. data/config/locales/en.yml +31 -12
  33. data/config/locales/es.yml +33 -10
  34. data/config/routes.rb +10 -11
  35. data/lib/mailboxer/notification_decoder.rb +13 -4
  36. data/lib/social_stream/base/version.rb +1 -1
  37. metadata +6 -6
  38. data/app/assets/images/title_background.png +0 -0
  39. data/vendor/assets/javascripts/ui.checkbox.js +0 -309
@@ -1,309 +0,0 @@
1
- /**
2
- * @author alexander.farkas
3
- * @version 1.4.1
4
- */
5
- $(document).ready(function() {
6
-
7
- var baseClasses = /ui-checkbox|ui-radio/;
8
- $.widget('ui.checkBox', {
9
- options: {
10
- hideInput: true,
11
- addVisualElement: true,
12
- addLabel: true,
13
- _delegated: false
14
- },
15
- _create: function(){
16
- var that = this,
17
- opts = this.options
18
- ;
19
-
20
- if(!this.element.is(':radio,:checkbox')){
21
- if($.nodeName(this.element[0], 'input')){return false;}
22
- this._addDelegate();
23
- this.updateContainer();
24
- return false;
25
- }
26
- this.labels = $([]);
27
-
28
- this.checkedStatus = false;
29
- this.disabledStatus = false;
30
- this.hoverStatus = false;
31
-
32
- this.radio = (this.element.is(':radio'));
33
-
34
- this.visualElement = $([]);
35
- if (opts.hideInput) {
36
- this.element
37
- .addClass('ui-helper-hidden-accessible')
38
- ;
39
- if(opts.addVisualElement){
40
- this.visualElement = $('<span />')
41
- .addClass(this.radio ? 'ui-radio' : 'ui-checkbox')
42
- ;
43
- this.element.after(this.visualElement[0]);
44
- }
45
- }
46
-
47
- if(opts.addLabel){
48
- this.labels = $('label[for=' + this.element.attr('id') + ']')
49
- .addClass(this.radio ? 'ui-radio' : 'ui-checkbox')
50
- ;
51
- }
52
- if(!opts._delegated){
53
- this._addEvents();
54
- }
55
- this.initialized = true;
56
- this.reflectUI({type: 'initialReflect'});
57
- return undefined;
58
- },
59
- updateContainer: function(){
60
- if(!this.element.is(':radio,:checkbox') && !$.nodeName(this.element[0], 'input')){
61
- $('input', this.element[0])
62
- .filter(function(){
63
- return !($.data(this, 'checkBox'));
64
- })
65
- .checkBox($.extend({}, this.options, {_delegated: true}))
66
- ;
67
- }
68
- },
69
- _addDelegate: function(){
70
- var opts = this.options,
71
-
72
- toggleHover = function(e, that){
73
- if(!that){return;}
74
- that.hover = !!(e.type == 'focus' || e.type == 'mouseenter' || e.type == 'focusin' || e.type == 'mouseover');
75
- that._changeStateClassChain.call(that);
76
- return undefined;
77
- }
78
- ;
79
-
80
-
81
- this.element
82
- .bind('click', function(e){
83
- if(!$.nodeName(e.target, 'input')){return;}
84
- var inst = ($.data(e.target) || {}).checkBox;
85
- if(!inst){return;}
86
- inst.reflectUI.call(inst, e.target, e);
87
- })
88
- .bind('focusin.checkBox focusout.checkBox', function(e){
89
- if(!$.nodeName(e.target, 'input')){return;}
90
- var inst = ($.data(e.target) || {}).checkBox;
91
- toggleHover(e, inst);
92
- })
93
- ;
94
-
95
- if (opts.hideInput){
96
- this.element
97
- .bind('usermode', function(e){
98
- if(!e.enabled){return;}
99
- $('input', this).each(function(){
100
- var inst = ($.data(this) || {}).checkBox;
101
- (inst && inst.destroy.call(inst, true));
102
- });
103
- })
104
- ;
105
- }
106
-
107
- if(opts.addVisualElement){
108
- this.element
109
- .bind('mouseover.checkBox mouseout.checkBox', function(e){
110
- if(!$.nodeName(e.target, 'span')){return;}
111
- var inst = ( $.data($(e.target).prev()[0]) || {} ).checkBox;
112
- toggleHover(e, inst);
113
- })
114
- .bind('click.checkBox', function(e){
115
- if(!$.nodeName(e.target, 'span') || !baseClasses.test( e.target.className || '' )){return;}
116
- $(e.target).prev()[0].click();
117
- return false;
118
- })
119
- ;
120
- }
121
- if(opts.addLabel){
122
- this.element
123
- .delegate('label.ui-radio, label.ui-checkbox', 'mouseenter.checkBox mouseleave.checkBox', function(e){
124
- var inst = ( $.data(document.getElementById( $(this).attr('for') )) || {} ).checkBox;
125
- toggleHover( e, inst );
126
- });
127
- }
128
-
129
- },
130
- _addEvents: function(){
131
- var that = this,
132
-
133
- opts = this.options,
134
-
135
- toggleHover = function(e){
136
- if(that.disabledStatus){
137
- return false;
138
- }
139
- that.hover = (e.type == 'focus' || e.type == 'mouseenter');
140
- that._changeStateClassChain();
141
- return undefined;
142
- }
143
- ;
144
-
145
- this.element
146
- .bind('click.checkBox', $.proxy(this, 'reflectUI'))
147
- .bind('focus.checkBox blur.checkBox', toggleHover)
148
- ;
149
- if (opts.hideInput){
150
- this.element
151
- .bind('usermode', function(e){
152
- (e.enabled &&
153
- that.destroy.call(that, true));
154
- })
155
- ;
156
- }
157
- if(opts.addVisualElement){
158
- this.visualElement
159
- .bind('mouseenter.checkBox mouseleave.checkBox', toggleHover)
160
- .bind('click.checkBox', function(e){
161
- that.element[0].click();
162
- return false;
163
- })
164
- ;
165
- }
166
- if(opts.addLabel){
167
- this.labels.bind('mouseenter.checkBox mouseleave.checkBox', toggleHover);
168
- }
169
- },
170
- _changeStateClassChain: function(){
171
- var allElements = this.labels.add(this.visualElement),
172
- stateClass = '',
173
- baseClass = 'ui-'+((this.radio) ? 'radio' : 'checkbox')
174
- ;
175
-
176
- if(this.checkedStatus){
177
- stateClass += '-checked';
178
- allElements.addClass(baseClass+'-checked');
179
- } else {
180
- allElements.removeClass(baseClass+'-checked');
181
- }
182
-
183
- if(this.disabledStatus){
184
- stateClass += '-disabled';
185
- allElements.addClass(baseClass+'-disabled');
186
- } else {
187
- allElements.removeClass(baseClass+'-disabled');
188
- }
189
- if(this.hover){
190
- stateClass += '-hover';
191
- allElements.addClass(baseClass+'-hover');
192
- } else {
193
- allElements.removeClass(baseClass+'-hover');
194
- }
195
-
196
- baseClass += '-state';
197
- if(stateClass){
198
- stateClass = baseClass + stateClass;
199
- }
200
-
201
- function switchStateClass(){
202
- var classes = this.className.split(' '),
203
- found = false;
204
- $.each(classes, function(i, classN){
205
- if(classN.indexOf(baseClass) === 0){
206
- found = true;
207
- classes[i] = stateClass;
208
- return false;
209
- }
210
- return undefined;
211
- });
212
- if(!found){
213
- classes.push(stateClass);
214
- }
215
- this.className = classes.join(' ');
216
- }
217
-
218
- this.labels.each(switchStateClass);
219
- this.visualElement.each(switchStateClass);
220
- },
221
- destroy: function(onlyCss){
222
- this.element.removeClass('ui-helper-hidden-accessible');
223
- if(this.visualElement){
224
- this.visualElement.addClass('ui-helper-hidden');
225
- }
226
- if (!onlyCss) {
227
- var o = this.options;
228
- this.element.unbind('.checkBox');
229
- if(this.visualElement){
230
- this.visualElement.remove();
231
- }
232
- if(this.labels){
233
- this.labels.unbind('.checkBox').removeClass('ui-state-hover ui-state-checked ui-state-disabled');
234
- }
235
- }
236
- },
237
-
238
- disable: function(){
239
- this.element[0].disabled = true;
240
- this.reflectUI({type: 'manuallyDisabled'});
241
- },
242
-
243
- enable: function(){
244
- this.element[0].disabled = false;
245
- this.reflectUI({type: 'manuallyenabled'});
246
- },
247
-
248
- toggle: function(e){
249
- this.changeCheckStatus((this.element.is(':checked')) ? false : true, e);
250
- },
251
-
252
- changeCheckStatus: function(status, e){
253
- if(e && e.type == 'click' && this.element[0].disabled){
254
- return false;
255
- }
256
- this.element.attr({'checked': status});
257
- this.reflectUI(e || {
258
- type: 'changeCheckStatus'
259
- });
260
- return undefined;
261
- },
262
-
263
- propagate: function(n, e, _noGroupReflect){
264
- if(!e || e.type != 'initialReflect'){
265
- if (this.radio && !_noGroupReflect) {
266
- //dynamic
267
- $(document.getElementsByName(this.element.attr('name')))
268
- .checkBox('reflectUI', e, true);
269
- }
270
- return this._trigger(n, e, {
271
- options: this.options,
272
- checked: this.checkedStatus,
273
- labels: this.labels,
274
- disabled: this.disabledStatus
275
- });
276
- }
277
- return undefined;
278
- },
279
-
280
- reflectUI: function(e){
281
-
282
- var oldChecked = this.checkedStatus,
283
- oldDisabledStatus = this.disabledStatus;
284
-
285
- this.disabledStatus = this.element.is(':disabled');
286
- this.checkedStatus = this.element.is(':checked');
287
-
288
- if (this.disabledStatus != oldDisabledStatus || this.checkedStatus !== oldChecked) {
289
-
290
- //Change status callback
291
-
292
- if (this.checkedStatus==true){
293
- var id = this.element[0].id;
294
- checkBoxEnable(id);
295
- } else if (this.checkedStatus==false){
296
- var id = this.element[0].id;
297
- checkBoxDisable(id);
298
- }
299
-
300
- this._changeStateClassChain();
301
-
302
- (this.disabledStatus != oldDisabledStatus && this.propagate('disabledChange', e));
303
-
304
- (this.checkedStatus !== oldChecked && this.propagate('change', e));
305
- }
306
-
307
- }
308
- });
309
- });