bhf 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/vendor/assets/javascripts/bhf/application.js +292 -292
- data/vendor/assets/javascripts/bhf/classes/AjaxEdit.js +2 -10
- data/vendor/assets/javascripts/bhf/classes/{Locale.de-DE.DatePicker.js → Locale.de-DE.js} +4 -11
- data/vendor/assets/javascripts/bhf/classes/{Locale.en-US.DatePicker.js → Locale.en-US.js} +5 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3346bb9c1064294211e0e3ab82836f5ae15ae3a6
|
4
|
+
data.tar.gz: 7a6b48f30c7a6eb9dd106a7c9064a9e895f6134f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f78d178b8439625c9b012a0e4fbae1717481e00da63ab969425d09ccbca3dffaf7954bd314528089c29afefdc9d85cae023eeb183f843368e27bc68d8de65ca2
|
7
|
+
data.tar.gz: 8697bf020a5cec3d846054af1df78355557417d972baa3efa4502457a566326a358c4ba58c29bf11c67aff5ca470c110791a492fa279c2a63920aac5df058050
|
@@ -6,332 +6,332 @@
|
|
6
6
|
|
7
7
|
var ajaxNote = new Ajaxify();
|
8
8
|
var quickEdit = new AjaxEdit();
|
9
|
-
var
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
9
|
+
var bhfInit = function(){
|
10
|
+
ajaxNote.setup();
|
11
|
+
var lang = document.html.get('lang');
|
12
|
+
if (lang === 'en') {
|
13
|
+
lang = 'en-US';
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
lang = lang+'-'+lang.toUpperCase();
|
17
|
+
}
|
18
|
+
Locale.use(lang);
|
19
|
+
var wysiwyg = [];
|
20
|
+
var setupJsForm = function(scope){
|
21
|
+
scope.getElements('.wysiwyg').each(function(elem){
|
22
|
+
wysiwyg.push(elem.mooEditable());
|
23
|
+
});
|
24
|
+
|
25
|
+
scope.getElements('.multiple_field').each(function(elem){
|
26
|
+
new MultipleFields(elem);
|
27
|
+
});
|
28
|
+
scope.getElements('.array_holder').each(function(elem){
|
29
|
+
new ArrayFields(elem);
|
30
|
+
});
|
31
|
+
|
32
|
+
scope.getElements('.picker').each(function(input){
|
33
|
+
var options = {
|
34
|
+
timePicker: true,
|
35
|
+
format: '%B %d, %Y %H:%M'
|
36
|
+
};
|
37
|
+
if (input.hasClass('date')) {
|
38
|
+
options = {
|
39
|
+
timePicker: false,
|
40
|
+
format: '%B %d, %Y'
|
41
|
+
};
|
42
|
+
}
|
43
|
+
else if (input.hasClass('time')) {
|
44
|
+
options = {
|
45
|
+
pickOnly: 'time',
|
46
|
+
format: '%H:%M'
|
47
|
+
};
|
48
|
+
}
|
25
49
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
new ArrayFields(elem);
|
31
|
-
});
|
50
|
+
var hiddenInput = input.clone();
|
51
|
+
input.value = new Date().parse(input.value).format(options.format);
|
52
|
+
input.erase('name');
|
53
|
+
hiddenInput.set('type', 'hidden').inject(input, 'after');
|
32
54
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
format: '%B %d, %Y %H:%M'
|
37
|
-
};
|
38
|
-
if (input.hasClass('date')) {
|
39
|
-
options = {
|
40
|
-
timePicker: false,
|
41
|
-
format: '%B %d, %Y'
|
42
|
-
};
|
43
|
-
}
|
44
|
-
else if (input.hasClass('time')) {
|
45
|
-
options = {
|
46
|
-
pickOnly: 'time',
|
47
|
-
format: '%H:%M'
|
48
|
-
};
|
55
|
+
new Picker.Date(input, Object.merge({
|
56
|
+
onSelect: function(date){
|
57
|
+
hiddenInput.value = date.format('db');
|
49
58
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
new Picker.Date(input, Object.merge({
|
57
|
-
onSelect: function(date){
|
58
|
-
hiddenInput.value = date.format('db');
|
59
|
-
}
|
60
|
-
}, options));
|
61
|
-
});
|
59
|
+
}, options));
|
60
|
+
});
|
61
|
+
|
62
|
+
scope.getElements('.wmd_editor').each(function(mdTa){
|
63
|
+
var headline, toggleHtmlPreview, toggleLivePreview, livePreview, htmlPreview;
|
62
64
|
|
63
|
-
|
64
|
-
var
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
65
|
+
var togglePreview = function(e){
|
66
|
+
var htmlMode = e.target.hasClass('toggle_html_preview');
|
67
|
+
livePreview.toggleClass('hide', htmlMode);
|
68
|
+
htmlPreview.toggleClass('hide', !htmlMode);
|
69
|
+
toggleLivePreview.toggleClass('active', !htmlMode);
|
70
|
+
toggleHtmlPreview.toggleClass('active', htmlMode);
|
71
|
+
};
|
72
|
+
|
73
|
+
headline = new Element('h6.preview_switch', {text: 'Preview'});
|
74
|
+
|
75
|
+
toggleHtmlPreview = new Element('span.toggle_html_preview', {text: 'HTML'})
|
76
|
+
.addEvent('click', togglePreview)
|
77
|
+
.inject(headline);
|
78
|
+
toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
|
79
|
+
.addEvent('click', togglePreview)
|
80
|
+
.inject(headline);
|
81
|
+
|
82
|
+
headline.inject(mdTa, 'after');
|
83
|
+
|
84
|
+
livePreview = new Element('div.wmd-preview.hide').inject(headline, 'after');
|
85
|
+
htmlPreview = new Element('div.wmd-output.hide').inject(livePreview, 'after');
|
86
|
+
|
87
|
+
new WMDEditor({
|
88
|
+
input: mdTa,
|
89
|
+
button_bar: new Element('div').inject(mdTa, 'before'),
|
90
|
+
preview: livePreview,
|
91
|
+
output: htmlPreview,
|
92
|
+
buttons: 'bold italic link image ol ul heading hr undo redo help',
|
93
|
+
modifierKeys: false,
|
94
|
+
autoFormatting: false
|
95
|
+
});
|
96
|
+
});
|
82
97
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
98
|
+
scope.getElements('.map_data_lat').each(function(lat){
|
99
|
+
new Setlatlng(lat);
|
100
|
+
});
|
101
|
+
};
|
102
|
+
|
103
|
+
quickEdit.setup({
|
104
|
+
holderParent: $('content'),
|
105
|
+
onStartRequest: function(form){
|
106
|
+
ajaxNote.loading();
|
107
|
+
},
|
108
|
+
onFormInjected: function(form){
|
109
|
+
setupJsForm(form);
|
110
|
+
scrollContent();
|
111
|
+
ajaxNote.success();
|
112
|
+
},
|
113
|
+
onSave: function(form){
|
114
|
+
ajaxNote.success();
|
115
|
+
},
|
116
|
+
onBeforeSubmit: function(){
|
117
|
+
ajaxNote.loading();
|
118
|
+
wysiwyg.each(function(elem){
|
119
|
+
elem.saveContent();
|
120
|
+
});
|
121
|
+
}
|
122
|
+
});
|
123
|
+
|
124
|
+
var platforms = document.body.getElements('.platform');
|
125
|
+
var mainForm = document.id('main_form');
|
126
|
+
|
127
|
+
if (platforms.length) {
|
128
|
+
var setupSortables = function(scope){
|
129
|
+
scope.getElements('.sortable').each(function(sortableElems){
|
130
|
+
new Sortables(sortableElems, {
|
131
|
+
handle: '.handle',
|
132
|
+
onStart: function(element, clone){
|
133
|
+
element.addClass('dragged');
|
134
|
+
},
|
135
|
+
onComplete: function(element){
|
136
|
+
element.removeClass('dragged');
|
137
|
+
new Request({
|
138
|
+
method: 'put',
|
139
|
+
url: this.element.getParent('tbody').get('data-sort-url')
|
140
|
+
}).send({data: {order: this.serialize()}});
|
141
|
+
}
|
96
142
|
});
|
97
143
|
});
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
144
|
+
};
|
145
|
+
var updatePlatform = function(href, platform, callback){
|
146
|
+
ajaxNote.loading();
|
147
|
+
new Request.HTML({
|
148
|
+
method: 'get',
|
149
|
+
url: href,
|
150
|
+
onSuccess: function(a, b, html, js){
|
151
|
+
platform.innerHTML = html;
|
152
|
+
if (callback) {
|
153
|
+
callback.call();
|
154
|
+
}
|
155
|
+
setupSortables(platform);
|
156
|
+
Browser.exec(js);
|
157
|
+
ajaxNote.success();
|
158
|
+
windowHight = document.body.clientHeight;
|
159
|
+
document.body.fireEvent('platformUpdate');
|
160
|
+
}
|
161
|
+
}).send();
|
102
162
|
};
|
103
163
|
|
104
|
-
|
105
|
-
|
106
|
-
|
164
|
+
platforms.addEvents({
|
165
|
+
'click:relay(.pagination a, thead a)': function(e){
|
166
|
+
e.preventDefault();
|
167
|
+
updatePlatform(this.get('href'), this.getParent('.platform'));
|
168
|
+
},
|
169
|
+
'submit:relay(.search)': function(e){
|
107
170
|
ajaxNote.loading();
|
171
|
+
e.preventDefault();
|
172
|
+
var parent = this.getParent('.platform');
|
173
|
+
var hidden_search = e.target.getElement('.hidden_search');
|
174
|
+
if (hidden_search) {
|
175
|
+
hidden_search.destroy();
|
176
|
+
}
|
177
|
+
|
178
|
+
new Request.HTML({
|
179
|
+
method: 'get',
|
180
|
+
url: this.get('action'),
|
181
|
+
onSuccess: function(a, b, html){
|
182
|
+
parent.innerHTML = html;
|
183
|
+
setupSortables(parent);
|
184
|
+
ajaxNote.success();
|
185
|
+
}
|
186
|
+
}).send({data: this});
|
108
187
|
},
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
ajaxNote.success();
|
188
|
+
'click:relay(.quick_edit)': function(e){
|
189
|
+
e.preventDefault();
|
190
|
+
quickEdit.startEdit(this, this.getParent('tr'));
|
113
191
|
},
|
114
|
-
|
115
|
-
|
192
|
+
'click:relay(.action a)': function(e){
|
193
|
+
this.addClass('clicked');
|
194
|
+
setTimeout(function(){
|
195
|
+
this.removeClass('clicked');
|
196
|
+
}.bind(this), 1500);
|
116
197
|
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
198
|
+
'click:relay(.delete)': function(e){
|
199
|
+
e.target.addEvents({
|
200
|
+
'ajax:success': function(html){
|
201
|
+
this.getParent('tr').dispose();
|
202
|
+
},
|
203
|
+
'ajax:failure': function(html){
|
204
|
+
alert(Locale.get('Messages.warning'));
|
205
|
+
}
|
121
206
|
});
|
122
207
|
}
|
123
208
|
});
|
124
209
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
onStart: function(element, clone){
|
134
|
-
element.addClass('dragged');
|
135
|
-
},
|
136
|
-
onComplete: function(element){
|
137
|
-
element.removeClass('dragged');
|
138
|
-
new Request({
|
139
|
-
method: 'put',
|
140
|
-
url: this.element.getParent('tbody').get('data-sort-url')
|
141
|
-
}).send({data: {order: this.serialize()}});
|
142
|
-
}
|
143
|
-
});
|
210
|
+
quickEdit.addEvents({
|
211
|
+
successAndChange: function(json){
|
212
|
+
var tr = this.wrapElement;
|
213
|
+
tr.getElements('td').each(function(td){
|
214
|
+
var name = td.get('data-column-name');
|
215
|
+
if ( ! name) { return; }
|
216
|
+
var a = td.getElement('a.quick_edit');
|
217
|
+
(a ? a : td).innerHTML = json[name] || '';
|
144
218
|
});
|
145
|
-
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
method: 'get',
|
150
|
-
url: href,
|
151
|
-
onSuccess: function(a, b, html, js){
|
152
|
-
platform.innerHTML = html;
|
153
|
-
if (callback) {
|
154
|
-
callback.call();
|
155
|
-
}
|
156
|
-
setupSortables(platform);
|
157
|
-
Browser.exec(js);
|
158
|
-
ajaxNote.success();
|
159
|
-
windowHight = document.body.clientHeight;
|
160
|
-
}
|
161
|
-
}).send();
|
162
|
-
};
|
163
|
-
|
164
|
-
platforms.addEvents({
|
165
|
-
'click:relay(.pagination a, thead a)': function(e){
|
166
|
-
e.preventDefault();
|
167
|
-
updatePlatform(this.get('href'), this.getParent('.platform'));
|
168
|
-
},
|
169
|
-
'submit:relay(.search)': function(e){
|
170
|
-
ajaxNote.loading();
|
171
|
-
e.preventDefault();
|
172
|
-
var parent = this.getParent('.platform');
|
173
|
-
var hidden_search = e.target.getElement('.hidden_search');
|
174
|
-
if (hidden_search) {
|
175
|
-
hidden_search.destroy();
|
176
|
-
}
|
219
|
+
},
|
220
|
+
successAndNext: function(json){
|
221
|
+
var tr = this.wrapElement;
|
222
|
+
var nextTr = tr.getNext('tr');
|
177
223
|
|
178
|
-
|
179
|
-
|
180
|
-
url: this.get('action'),
|
181
|
-
onSuccess: function(a, b, html){
|
182
|
-
parent.innerHTML = html;
|
183
|
-
setupSortables(parent);
|
184
|
-
ajaxNote.success();
|
185
|
-
}
|
186
|
-
}).send({data: this});
|
187
|
-
},
|
188
|
-
'click:relay(.quick_edit)': function(e){
|
189
|
-
e.preventDefault();
|
190
|
-
quickEdit.startEdit(this, this.getParent('tr'));
|
191
|
-
},
|
192
|
-
'click:relay(.action a)': function(e){
|
193
|
-
this.addClass('clicked');
|
194
|
-
setTimeout(function(){
|
195
|
-
this.removeClass('clicked');
|
196
|
-
}.bind(this), 1500);
|
197
|
-
},
|
198
|
-
'click:relay(.delete)': function(e){
|
199
|
-
e.target.addEvents({
|
200
|
-
'ajax:success': function(html){
|
201
|
-
this.getParent('tr').dispose();
|
202
|
-
},
|
203
|
-
'ajax:failure': function(html){
|
204
|
-
alert('Something went wrong!');
|
205
|
-
}
|
206
|
-
});
|
224
|
+
if (nextTr) {
|
225
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
207
226
|
}
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
var tr = this.wrapElement;
|
222
|
-
var nextTr = tr.getNext('tr');
|
223
|
-
|
224
|
-
if (nextTr) {
|
225
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
227
|
+
else {
|
228
|
+
var platform = tr.getParent('.platform');
|
229
|
+
var loadMore = platform.getElement('.load_more');
|
230
|
+
if (loadMore) {
|
231
|
+
trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
|
232
|
+
updatePlatform(loadMore.get('href'), platform, function(){
|
233
|
+
platform.getElements('tbody tr').each(function(newTr, index){
|
234
|
+
if (trIndex === index) {
|
235
|
+
nextTr = newTr.getNext('tr');
|
236
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
});
|
226
240
|
}
|
227
241
|
else {
|
228
|
-
|
229
|
-
|
230
|
-
if (loadMore) {
|
231
|
-
trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
|
232
|
-
updatePlatform(loadMore.get('href'), platform, function(){
|
233
|
-
platform.getElements('tbody tr').each(function(newTr, index){
|
234
|
-
if (trIndex === index) {
|
235
|
-
nextTr = newTr.getNext('tr');
|
236
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
237
|
-
}
|
238
|
-
});
|
239
|
-
});
|
240
|
-
}
|
241
|
-
else {
|
242
|
-
nextTr = platform.getElements('tbody tr')[0];
|
243
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
244
|
-
}
|
242
|
+
nextTr = platform.getElements('tbody tr')[0];
|
243
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
245
244
|
}
|
246
245
|
}
|
247
|
-
}
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
246
|
+
}
|
247
|
+
});
|
248
|
+
setupSortables(document.body);
|
249
|
+
}
|
250
|
+
else if (mainForm) {
|
251
|
+
setupJsForm(mainForm);
|
252
252
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
}
|
253
|
+
mainForm.addEvents({
|
254
|
+
'click:relay(.quick_edit)': function(e){
|
255
|
+
e.preventDefault();
|
256
|
+
quickEdit.startEdit(this);
|
257
|
+
},
|
258
|
+
'click:relay(.delete)': function(e){
|
259
|
+
e.target.addEvents({
|
260
|
+
'ajax:success': function(html){
|
261
|
+
var relation = e.target.getParent('.relation');
|
262
|
+
if (relation.getElements('li').length < 2) {
|
263
|
+
relation.getPrevious('.empty').removeClass('hide');
|
264
|
+
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
265
|
+
relation.getNext('.add_field').removeClass('hide');
|
267
266
|
}
|
268
|
-
e.target.getParent('li').dispose();
|
269
|
-
},
|
270
|
-
'ajax:failure': function(html){
|
271
|
-
alert('Something went wrong!');
|
272
267
|
}
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
quickEdit.addEvents({
|
278
|
-
successAndAdd: function(json){
|
279
|
-
var relation = this.wrapElement.getPrevious('.relation');
|
280
|
-
relation.getPrevious('.empty').addClass('hide');
|
281
|
-
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
282
|
-
relation.getNext('.add_field').addClass('hide');
|
283
|
-
}
|
284
|
-
relation.adopt(
|
285
|
-
new Element('li').adopt(
|
286
|
-
new Element('a.quick_edit', {text: json.to_bhf_s || '', href: json.edit_path})
|
287
|
-
)
|
288
|
-
);
|
289
|
-
},
|
290
|
-
successAndChange: function(json){
|
291
|
-
this.wrapElement.set('text', json.to_bhf_s || '');
|
292
|
-
},
|
293
|
-
successAndNext: function(json){
|
294
|
-
var a = this.wrapElement;
|
295
|
-
var li = a.getParent('li');
|
296
|
-
if ( ! li) {
|
297
|
-
this.close();
|
298
|
-
return;
|
268
|
+
e.target.getParent('li').dispose();
|
269
|
+
},
|
270
|
+
'ajax:failure': function(html){
|
271
|
+
alert(Locale.get('Messages.warning'));
|
299
272
|
}
|
300
|
-
|
273
|
+
});
|
274
|
+
}
|
275
|
+
});
|
301
276
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
277
|
+
quickEdit.addEvents({
|
278
|
+
successAndAdd: function(json){
|
279
|
+
var relation = this.wrapElement.getPrevious('.relation');
|
280
|
+
relation.getPrevious('.empty').addClass('hide');
|
281
|
+
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
282
|
+
relation.getNext('.add_field').addClass('hide');
|
306
283
|
}
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
284
|
+
relation.adopt(
|
285
|
+
new Element('li').adopt(
|
286
|
+
new Element('a.quick_edit', {text: json.to_bhf_s || '', href: json.edit_path})
|
287
|
+
)
|
288
|
+
);
|
289
|
+
},
|
290
|
+
successAndChange: function(json){
|
291
|
+
this.wrapElement.set('text', json.to_bhf_s || '');
|
292
|
+
},
|
293
|
+
successAndNext: function(json){
|
294
|
+
var a = this.wrapElement;
|
295
|
+
var li = a.getParent('li');
|
296
|
+
if ( ! li) {
|
297
|
+
this.close();
|
298
|
+
return;
|
299
|
+
}
|
300
|
+
var holder = li.getNext('li');
|
324
301
|
|
325
|
-
|
326
|
-
|
327
|
-
|
302
|
+
if ( ! holder) {
|
303
|
+
holder = li.getParent('ul');
|
304
|
+
}
|
305
|
+
quickEdit.startEdit(holder.getElement('a'));
|
306
|
+
}
|
307
|
+
});
|
308
|
+
}
|
309
|
+
var windowHight = document.body.clientHeight;
|
310
|
+
window.onresize = function(e){
|
311
|
+
windowHight = document.body.clientHeight;
|
312
|
+
};
|
313
|
+
var scrollContent = function(){
|
314
|
+
var innerForm = quickEdit.holder.getElement('form');
|
315
|
+
if ( ! innerForm) { return; }
|
316
|
+
var scroll = document.body.scrollTop-70;
|
317
|
+
if (scroll < 10) {
|
318
|
+
scroll = 10;
|
328
319
|
}
|
320
|
+
if (scroll + innerForm.getSize().y > windowHight) { return; }
|
321
|
+
quickEdit.holder.setStyle('padding-top', scroll);
|
322
|
+
};
|
323
|
+
window.onscroll = scrollContent;
|
329
324
|
|
330
|
-
|
331
|
-
|
325
|
+
var fm = $('flash_massages');
|
326
|
+
if (fm) {
|
327
|
+
fm.removeClass.delay(4000, fm, 'show');
|
328
|
+
}
|
329
|
+
|
330
|
+
new BrowserUpdate({vs:{i:8,f:7,o:10.01,s:4,n:9}});
|
332
331
|
};
|
333
332
|
|
334
|
-
|
333
|
+
|
334
|
+
window.addEvent('domready', bhfInit);
|
335
335
|
|
336
336
|
if (document.addEventListener) {
|
337
337
|
document.addEventListener('page:fetch', function(){
|
@@ -340,7 +340,7 @@ if (document.addEventListener) {
|
|
340
340
|
|
341
341
|
document.addEventListener('page:load', function(){
|
342
342
|
quickEdit.removeEvents();
|
343
|
-
|
343
|
+
bhfInit();
|
344
344
|
rails.applyEvents();
|
345
345
|
ajaxNote.success();
|
346
346
|
});
|
@@ -7,20 +7,12 @@ var AjaxEdit = new Class({
|
|
7
7
|
|
8
8
|
Implements: [Options, Events],
|
9
9
|
|
10
|
-
holder: new Element('div.quick_edit_holder'),
|
11
|
-
|
12
10
|
setup: function(_options) {
|
13
11
|
this.setOptions(_options);
|
14
|
-
this.holder
|
15
|
-
.removeEvents('click:relay(.open)')
|
16
|
-
.removeEvents('click:relay(.cancel)')
|
17
|
-
.removeEvents('click:relay(.save_and_next)')
|
18
|
-
.removeEvents('click:relay(.save)')
|
19
|
-
.removeEvents('submit:relay(form)')
|
20
|
-
.addEvents({
|
12
|
+
this.holder = new Element('div.quick_edit_holder').addEvents({
|
21
13
|
'click:relay(.open)': function(e){
|
22
14
|
e.preventDefault();
|
23
|
-
|
15
|
+
Turbolinks.visit((this.wrapElement.getElement('a') || this.wrapElement).get('href'));
|
24
16
|
}.bind(this),
|
25
17
|
'click:relay(.cancel)': function(e){
|
26
18
|
e.preventDefault();
|
@@ -1,14 +1,3 @@
|
|
1
|
-
/*
|
2
|
-
---
|
3
|
-
name: Locale.de-DE.DatePicker
|
4
|
-
description: German Language File for DatePicker
|
5
|
-
authors: Bastian Bringenberg
|
6
|
-
requires: [More/Locale]
|
7
|
-
provides: Locale.de-DE.DatePicker
|
8
|
-
...
|
9
|
-
*/
|
10
|
-
|
11
|
-
|
12
1
|
Locale.define('de-DE', 'DatePicker', {
|
13
2
|
select_a_time: 'Wähle eine Zeit',
|
14
3
|
use_mouse_wheel: 'Mit dem Mausrad kannst du schneller die Werte ändern',
|
@@ -17,3 +6,7 @@ Locale.define('de-DE', 'DatePicker', {
|
|
17
6
|
cancel: 'Abbrechen',
|
18
7
|
week: 'W'
|
19
8
|
});
|
9
|
+
|
10
|
+
Locale.define('de-DE', 'Messages', {
|
11
|
+
warning: 'Etwas ist schief gelaufen!'
|
12
|
+
});
|
@@ -1,14 +1,3 @@
|
|
1
|
-
/*
|
2
|
-
---
|
3
|
-
name: Locale.en-US.DatePicker
|
4
|
-
description: English Language File for DatePicker
|
5
|
-
authors: Arian Stolwijk
|
6
|
-
requires: [More/Locale]
|
7
|
-
provides: Locale.en-US.DatePicker
|
8
|
-
...
|
9
|
-
*/
|
10
|
-
|
11
|
-
|
12
1
|
Locale.define('en-US', 'DatePicker', {
|
13
2
|
select_a_time: 'Select a time',
|
14
3
|
use_mouse_wheel: 'Use the mouse wheel to quickly change value',
|
@@ -17,3 +6,8 @@ Locale.define('en-US', 'DatePicker', {
|
|
17
6
|
cancel: 'Cancel',
|
18
7
|
week: 'Wk'
|
19
8
|
});
|
9
|
+
|
10
|
+
|
11
|
+
Locale.define('de-DE', 'Messages', {
|
12
|
+
warning: 'Something went wrong!'
|
13
|
+
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bhf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Pawlik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -187,8 +187,8 @@ files:
|
|
187
187
|
- vendor/assets/javascripts/bhf/classes/Ajaxify.js
|
188
188
|
- vendor/assets/javascripts/bhf/classes/ArrayFields.js
|
189
189
|
- vendor/assets/javascripts/bhf/classes/BrowserUpdate.js
|
190
|
-
- vendor/assets/javascripts/bhf/classes/Locale.de-DE.
|
191
|
-
- vendor/assets/javascripts/bhf/classes/Locale.en-US.
|
190
|
+
- vendor/assets/javascripts/bhf/classes/Locale.de-DE.js
|
191
|
+
- vendor/assets/javascripts/bhf/classes/Locale.en-US.js
|
192
192
|
- vendor/assets/javascripts/bhf/classes/MooEditable.js
|
193
193
|
- vendor/assets/javascripts/bhf/classes/MultipleFields.js
|
194
194
|
- vendor/assets/javascripts/bhf/classes/Picker.js
|