bhf 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/bhf/_footer.haml +3 -11
- data/app/views/layouts/bhf/application.haml +2 -0
- data/config/locales/de.yml +6 -0
- data/config/locales/en.yml +5 -0
- data/vendor/assets/javascripts/bhf/application.js +288 -304
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 935bc1f41ce1c4d48236e2957871bab97678b03a
|
4
|
+
data.tar.gz: e2a223ef1b771a990f5817411fb721ecef0d68fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375a0df88ac376813fac7a275c99dabffdeb6084b0aa789661dfe80191655330c2acb40722229caff73c2a1a7d7d6c239a203590ec7affa4cd2a7c9adc8846a4
|
7
|
+
data.tar.gz: 11fef397840dd2173ef7bd51b24ac50b9f1c1c502db38faee9a87bb2fed531425bcddf27535f6789c3e4a6f06031a1e03c77ec49884e48140f5a9ca12bce4e23
|
data/app/views/bhf/_footer.haml
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
- if @start_time
|
2
|
-
%p.
|
2
|
+
%p.state= I18n.t('bhf.footer.state', time: (Time.now-@start_time).round(2)).html_safe
|
3
3
|
|
4
|
-
%p.copy
|
5
|
-
Made by
|
6
|
-
= link_to '@antpaw', 'http://twitter.com/antpaw'
|
7
|
-
with
|
8
|
-
= link_to 'Rails 3', 'http://twitter.com/antpaw'
|
9
|
-
and
|
10
|
-
= link_to 'MooTools', 'http://mootools.net/'
|
4
|
+
%p.copy= I18n.t('bhf.footer.copy').html_safe
|
11
5
|
|
12
|
-
%p.info
|
13
|
-
More information on
|
14
|
-
= link_to 'GitHub', 'http://github.com/antpaw/bahnhof/'
|
6
|
+
%p.info= I18n.t('bhf.footer.info').html_safe
|
data/config/locales/de.yml
CHANGED
@@ -53,6 +53,12 @@ de:
|
|
53
53
|
other: "Es werden <strong>alle %{count}</strong> %{name_plural} angezeigt"
|
54
54
|
one: "Es wird <strong>1</strong> %{name_singular} angezeigt"
|
55
55
|
zero: "Es wurde nichts gefunden"
|
56
|
+
|
57
|
+
footer:
|
58
|
+
state: 'Seite wurde in ~%{time} Sekunden erstellt'
|
59
|
+
copy: 'Gemacht von <a href="http://twitter.com/antpaw">@antpaw</a> mit <a href="http://rubyonrails.org">Rails</a> und <a href="http://mootools.net">MooTools</a>'
|
60
|
+
info: 'Mehr Information auf <a href="http://github.com/antpaw/bhf">GitHub</a>'
|
61
|
+
|
56
62
|
activerecord:
|
57
63
|
notices:
|
58
64
|
messages:
|
data/config/locales/en.yml
CHANGED
@@ -63,6 +63,11 @@ en:
|
|
63
63
|
one: "Displaying <strong>1</strong> %{name_singular}"
|
64
64
|
zero: "No %{name_zero} found"
|
65
65
|
|
66
|
+
footer:
|
67
|
+
state: 'Page rendered in ~%{time} seconds'
|
68
|
+
copy: 'Made by <a href="http://twitter.com/antpaw">@antpaw</a> with <a href="http://rubyonrails.org">Rails</a> and <a href="http://mootools.net">MooTools</a>'
|
69
|
+
info: 'More information on <a href="http://github.com/antpaw/bhf">GitHub</a>'
|
70
|
+
|
66
71
|
attributes:
|
67
72
|
_id: 'id'
|
68
73
|
|
@@ -1,342 +1,326 @@
|
|
1
1
|
//= require ./mootools-core-1.4.5-full-compat.js
|
2
2
|
//= require ./mootools-more-1.4.0.1.js
|
3
3
|
//= require ./mootools_ujs_ap
|
4
|
-
//= require turbolinks
|
5
4
|
//= require_tree ./classes/
|
6
5
|
var ajaxNote = new Ajaxify();
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
6
|
+
var quickEdit;
|
7
|
+
window.addEvent('domready', function(){
|
8
|
+
ajaxNote.setup();
|
9
|
+
var lang = document.html.get('lang');
|
10
|
+
if (lang === 'en') {
|
11
|
+
lang = 'en-US';
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
lang = lang+'-'+lang.toUpperCase();
|
15
|
+
}
|
16
|
+
Locale.use(lang);
|
17
|
+
var wysiwyg = [];
|
18
|
+
var setupJsForm = function(scope){
|
19
|
+
scope.getElements('.wysiwyg').each(function(elem){
|
20
|
+
wysiwyg.push(elem.mooEditable());
|
21
|
+
});
|
22
|
+
|
23
|
+
scope.getElements('.multiple_field').each(function(elem){
|
24
|
+
new MultipleFields(elem);
|
25
|
+
});
|
26
|
+
scope.getElements('.array_holder').each(function(elem){
|
27
|
+
new ArrayFields(elem);
|
28
|
+
});
|
29
|
+
|
30
|
+
scope.getElements('.picker').each(function(input){
|
31
|
+
var options = {
|
32
|
+
timePicker: true,
|
33
|
+
format: '%B %d, %Y %H:%M'
|
34
|
+
};
|
35
|
+
if (input.hasClass('date')) {
|
36
|
+
options = {
|
37
|
+
timePicker: false,
|
38
|
+
format: '%B %d, %Y'
|
39
|
+
};
|
40
|
+
}
|
41
|
+
else if (input.hasClass('time')) {
|
42
|
+
options = {
|
43
|
+
pickOnly: 'time',
|
44
|
+
format: '%H:%M'
|
45
|
+
};
|
46
|
+
}
|
24
47
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
new ArrayFields(elem);
|
30
|
-
});
|
48
|
+
var hiddenInput = input.clone();
|
49
|
+
input.value = new Date().parse(input.value).format(options.format);
|
50
|
+
input.erase('name');
|
51
|
+
hiddenInput.set('type', 'hidden').inject(input, 'after');
|
31
52
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
format: '%B %d, %Y %H:%M'
|
36
|
-
};
|
37
|
-
if (input.hasClass('date')) {
|
38
|
-
options = {
|
39
|
-
timePicker: false,
|
40
|
-
format: '%B %d, %Y'
|
41
|
-
};
|
53
|
+
new Picker.Date(input, Object.merge({
|
54
|
+
onSelect: function(date){
|
55
|
+
hiddenInput.value = date.format('db');
|
42
56
|
}
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
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');
|
54
|
-
|
55
|
-
new Picker.Date(input, Object.merge({
|
56
|
-
onSelect: function(date){
|
57
|
-
hiddenInput.value = date.format('db');
|
58
|
-
}
|
59
|
-
}, options));
|
60
|
-
});
|
57
|
+
}, options));
|
58
|
+
});
|
59
|
+
|
60
|
+
scope.getElements('.wmd_editor').each(function(mdTa){
|
61
|
+
var headline, toggleHtmlPreview, toggleLivePreview, livePreview, htmlPreview;
|
61
62
|
|
62
|
-
|
63
|
-
var
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
|
79
|
-
.addEvent('click', togglePreview)
|
80
|
-
.inject(headline);
|
63
|
+
var togglePreview = function(e){
|
64
|
+
var htmlMode = e.target.hasClass('toggle_html_preview');
|
65
|
+
livePreview.toggleClass('hide', htmlMode);
|
66
|
+
htmlPreview.toggleClass('hide', !htmlMode);
|
67
|
+
toggleLivePreview.toggleClass('active', !htmlMode);
|
68
|
+
toggleHtmlPreview.toggleClass('active', htmlMode);
|
69
|
+
};
|
70
|
+
|
71
|
+
headline = new Element('h6.preview_switch', {text: 'Preview'});
|
72
|
+
|
73
|
+
toggleHtmlPreview = new Element('span.toggle_html_preview', {text: 'HTML'})
|
74
|
+
.addEvent('click', togglePreview)
|
75
|
+
.inject(headline);
|
76
|
+
toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
|
77
|
+
.addEvent('click', togglePreview)
|
78
|
+
.inject(headline);
|
81
79
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
80
|
+
headline.inject(mdTa, 'after');
|
81
|
+
|
82
|
+
livePreview = new Element('div.wmd-preview.hide').inject(headline, 'after');
|
83
|
+
htmlPreview = new Element('div.wmd-output.hide').inject(livePreview, 'after');
|
84
|
+
|
85
|
+
new WMDEditor({
|
86
|
+
input: mdTa,
|
87
|
+
button_bar: new Element('div').inject(mdTa, 'before'),
|
88
|
+
preview: livePreview,
|
89
|
+
output: htmlPreview,
|
90
|
+
buttons: 'bold italic link image ol ul heading hr undo redo help',
|
91
|
+
modifierKeys: false,
|
92
|
+
autoFormatting: false
|
93
|
+
});
|
94
|
+
});
|
95
|
+
|
96
|
+
scope.getElements('.map_data_lat').each(function(lat){
|
97
|
+
new Setlatlng(lat);
|
98
|
+
});
|
99
|
+
};
|
100
|
+
|
101
|
+
// TODO: disable more ajax calls while ajax is loading
|
102
|
+
quickEdit = new AjaxEdit({
|
103
|
+
holderParent: $('content'),
|
104
|
+
onStartRequest: function(form){
|
105
|
+
ajaxNote.loading();
|
106
|
+
},
|
107
|
+
onFormInjected: function(form){
|
108
|
+
setupJsForm(form);
|
109
|
+
scrollContent();
|
110
|
+
ajaxNote.success();
|
111
|
+
},
|
112
|
+
onSave: function(form){
|
113
|
+
ajaxNote.success();
|
114
|
+
},
|
115
|
+
onBeforeSubmit: function(){
|
116
|
+
ajaxNote.loading();
|
117
|
+
wysiwyg.each(function(elem){
|
118
|
+
elem.saveContent();
|
119
|
+
});
|
120
|
+
}
|
121
|
+
});
|
122
|
+
|
123
|
+
var platforms = document.body.getElements('.platform');
|
124
|
+
var mainForm = document.id('main_form');
|
125
|
+
|
126
|
+
if (platforms.length) {
|
127
|
+
var setupSortables = function(scope){
|
128
|
+
scope.getElements('.sortable').each(function(sortableElems){
|
129
|
+
new Sortables(sortableElems, {
|
130
|
+
handle: '.handle',
|
131
|
+
onStart: function(element, clone){
|
132
|
+
element.addClass('dragged');
|
133
|
+
},
|
134
|
+
onComplete: function(element){
|
135
|
+
element.removeClass('dragged');
|
136
|
+
new Request({
|
137
|
+
method: 'put',
|
138
|
+
url: this.element.getParent('tbody').get('data-sort-url')
|
139
|
+
}).send({data: {order: this.serialize()}});
|
140
|
+
}
|
95
141
|
});
|
96
142
|
});
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
143
|
+
};
|
144
|
+
var updatePlatform = function(href, platform, callback){
|
145
|
+
ajaxNote.loading();
|
146
|
+
new Request.HTML({
|
147
|
+
method: 'get',
|
148
|
+
url: href,
|
149
|
+
onSuccess: function(a, b, html, js){
|
150
|
+
platform.innerHTML = html;
|
151
|
+
if (callback) {
|
152
|
+
callback.call();
|
153
|
+
}
|
154
|
+
setupSortables(platform);
|
155
|
+
Browser.exec(js);
|
156
|
+
ajaxNote.success();
|
157
|
+
windowHight = document.body.clientHeight;
|
158
|
+
}
|
159
|
+
}).send();
|
101
160
|
};
|
102
161
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
162
|
+
platforms.addEvents({
|
163
|
+
'click:relay(.pagination a, thead a)': function(e){
|
164
|
+
e.preventDefault();
|
165
|
+
updatePlatform(this.get('href'), this.getParent('.platform'));
|
166
|
+
},
|
167
|
+
'submit:relay(.search)': function(e){
|
107
168
|
ajaxNote.loading();
|
169
|
+
e.preventDefault();
|
170
|
+
var parent = this.getParent('.platform');
|
171
|
+
var hidden_search = e.target.getElement('.hidden_search');
|
172
|
+
if (hidden_search) {
|
173
|
+
hidden_search.destroy();
|
174
|
+
}
|
175
|
+
|
176
|
+
new Request.HTML({
|
177
|
+
method: 'get',
|
178
|
+
url: this.get('action'),
|
179
|
+
onSuccess: function(a, b, html){
|
180
|
+
parent.innerHTML = html;
|
181
|
+
setupSortables(parent);
|
182
|
+
ajaxNote.success();
|
183
|
+
}
|
184
|
+
}).send({data: this});
|
108
185
|
},
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
ajaxNote.success();
|
186
|
+
'click:relay(.quick_edit)': function(e){
|
187
|
+
e.preventDefault();
|
188
|
+
quickEdit.startEdit(this, this.getParent('tr'));
|
113
189
|
},
|
114
|
-
|
115
|
-
|
190
|
+
'click:relay(.action a)': function(e){
|
191
|
+
this.addClass('clicked');
|
116
192
|
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
193
|
+
'click:relay(.delete)': function(e){
|
194
|
+
e.target.addEvents({
|
195
|
+
'ajax:success': function(html){
|
196
|
+
this.getParent('tr').dispose();
|
197
|
+
},
|
198
|
+
'ajax:failure': function(html){
|
199
|
+
alert('Something went wrong!');
|
200
|
+
}
|
121
201
|
});
|
122
202
|
}
|
123
203
|
});
|
124
204
|
|
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
|
-
});
|
205
|
+
quickEdit.addEvents({
|
206
|
+
successAndChange: function(json){
|
207
|
+
var tr = this.wrapElement;
|
208
|
+
tr.getElements('td').each(function(td){
|
209
|
+
var name = td.get('data-column-name');
|
210
|
+
if ( ! name) { return; }
|
211
|
+
var a = td.getElement('a.quick_edit');
|
212
|
+
(a ? a : td).innerHTML = json[name] || '';
|
144
213
|
});
|
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
|
-
}
|
214
|
+
},
|
215
|
+
successAndNext: function(json){
|
216
|
+
var tr = this.wrapElement;
|
217
|
+
var nextTr = tr.getNext('tr');
|
177
218
|
|
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
|
-
},
|
195
|
-
'click:relay(.delete)': function(e){
|
196
|
-
e.target.addEvents({
|
197
|
-
'ajax:success': function(html){
|
198
|
-
this.getParent('tr').dispose();
|
199
|
-
},
|
200
|
-
'ajax:failure': function(html){
|
201
|
-
alert('Something went wrong!');
|
202
|
-
}
|
203
|
-
});
|
219
|
+
if (nextTr) {
|
220
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
204
221
|
}
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
var tr = this.wrapElement;
|
219
|
-
var nextTr = tr.getNext('tr');
|
220
|
-
|
221
|
-
if (nextTr) {
|
222
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
222
|
+
else {
|
223
|
+
var platform = tr.getParent('.platform');
|
224
|
+
var loadMore = platform.getElement('.load_more');
|
225
|
+
if (loadMore) {
|
226
|
+
trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
|
227
|
+
updatePlatform(loadMore.get('href'), platform, function(){
|
228
|
+
platform.getElements('tbody tr').each(function(newTr, index){
|
229
|
+
if (trIndex === index) {
|
230
|
+
nextTr = newTr.getNext('tr');
|
231
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
232
|
+
}
|
233
|
+
});
|
234
|
+
});
|
223
235
|
}
|
224
236
|
else {
|
225
|
-
|
226
|
-
|
227
|
-
if (loadMore) {
|
228
|
-
trIndex = tr.getParent('tbody').getElements('tr').indexOf(tr);
|
229
|
-
updatePlatform(loadMore.get('href'), platform, function(){
|
230
|
-
platform.getElements('tbody tr').each(function(newTr, index){
|
231
|
-
if (trIndex === index) {
|
232
|
-
nextTr = newTr.getNext('tr');
|
233
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
234
|
-
}
|
235
|
-
});
|
236
|
-
});
|
237
|
-
}
|
238
|
-
else {
|
239
|
-
nextTr = platform.getElements('tbody tr')[0];
|
240
|
-
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
241
|
-
}
|
237
|
+
nextTr = platform.getElements('tbody tr')[0];
|
238
|
+
quickEdit.startEdit(nextTr.getElement('a'), nextTr);
|
242
239
|
}
|
243
240
|
}
|
244
|
-
}
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
241
|
+
}
|
242
|
+
});
|
243
|
+
setupSortables(document.body);
|
244
|
+
}
|
245
|
+
else if (mainForm) {
|
246
|
+
setupJsForm(mainForm);
|
249
247
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
}
|
248
|
+
mainForm.addEvents({
|
249
|
+
'click:relay(.quick_edit)': function(e){
|
250
|
+
e.preventDefault();
|
251
|
+
quickEdit.startEdit(this);
|
252
|
+
},
|
253
|
+
'click:relay(.delete)': function(e){
|
254
|
+
e.target.addEvents({
|
255
|
+
'ajax:success': function(html){
|
256
|
+
var relation = e.target.getParent('.relation');
|
257
|
+
if (relation.getElements('li').length < 2) {
|
258
|
+
relation.getPrevious('.empty').removeClass('hide');
|
259
|
+
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
260
|
+
relation.getNext('.add_field').removeClass('hide');
|
264
261
|
}
|
265
|
-
e.target.getParent('li').dispose();
|
266
|
-
},
|
267
|
-
'ajax:failure': function(html){
|
268
|
-
alert('Something went wrong!');
|
269
262
|
}
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
quickEdit.addEvents({
|
275
|
-
successAndAdd: function(json){
|
276
|
-
var relation = this.wrapElement.getPrevious('.relation');
|
277
|
-
relation.getPrevious('.empty').addClass('hide');
|
278
|
-
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
279
|
-
relation.getNext('.add_field').addClass('hide');
|
263
|
+
e.target.getParent('li').dispose();
|
264
|
+
},
|
265
|
+
'ajax:failure': function(html){
|
266
|
+
alert('Something went wrong!');
|
280
267
|
}
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
)
|
285
|
-
);
|
286
|
-
},
|
287
|
-
successAndChange: function(json){
|
288
|
-
this.wrapElement.set('text', json.to_bhf_s || '');
|
289
|
-
},
|
290
|
-
successAndNext: function(json){
|
291
|
-
var a = this.wrapElement;
|
292
|
-
var li = a.getParent('li');
|
293
|
-
if ( ! li) {
|
294
|
-
this.close();
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
var holder = li.getNext('li');
|
268
|
+
});
|
269
|
+
}
|
270
|
+
});
|
298
271
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
272
|
+
quickEdit.addEvents({
|
273
|
+
successAndAdd: function(json){
|
274
|
+
var relation = this.wrapElement.getPrevious('.relation');
|
275
|
+
relation.getPrevious('.empty').addClass('hide');
|
276
|
+
if (relation.hasClass('has_one') || relation.hasClass('embeds_one')) {
|
277
|
+
relation.getNext('.add_field').addClass('hide');
|
303
278
|
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
279
|
+
relation.adopt(
|
280
|
+
new Element('li').adopt(
|
281
|
+
new Element('a.quick_edit', {text: json.to_bhf_s || '', href: json.edit_path})
|
282
|
+
)
|
283
|
+
);
|
284
|
+
},
|
285
|
+
successAndChange: function(json){
|
286
|
+
this.wrapElement.set('text', json.to_bhf_s || '');
|
287
|
+
},
|
288
|
+
successAndNext: function(json){
|
289
|
+
var a = this.wrapElement;
|
290
|
+
var li = a.getParent('li');
|
291
|
+
if ( ! li) {
|
292
|
+
this.close();
|
293
|
+
return;
|
294
|
+
}
|
295
|
+
var holder = li.getNext('li');
|
296
|
+
|
297
|
+
if ( ! holder) {
|
298
|
+
holder = li.getParent('ul');
|
299
|
+
}
|
300
|
+
quickEdit.startEdit(holder.getElement('a'));
|
316
301
|
}
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
302
|
+
});
|
303
|
+
}
|
304
|
+
var windowHight = document.body.clientHeight;
|
305
|
+
window.onresize = function(e){
|
306
|
+
windowHight = document.body.clientHeight;
|
307
|
+
};
|
308
|
+
var scrollContent = function(){
|
309
|
+
var innerForm = quickEdit.holder.getElement('form');
|
310
|
+
if ( ! innerForm) { return; }
|
311
|
+
var scroll = document.body.scrollTop-70;
|
312
|
+
if (scroll < 10) {
|
313
|
+
scroll = 10;
|
325
314
|
}
|
326
|
-
|
327
|
-
|
328
|
-
}
|
329
|
-
|
315
|
+
if (scroll + innerForm.getSize().y > windowHight) { return; }
|
316
|
+
quickEdit.holder.setStyle('padding-top', scroll);
|
317
|
+
};
|
318
|
+
window.onscroll = scrollContent;
|
330
319
|
|
331
|
-
|
332
|
-
if (
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
pageSetup();
|
339
|
-
rails.applyEvents();
|
340
|
-
ajaxNote.success();
|
341
|
-
});
|
342
|
-
}
|
320
|
+
var fm = $('flash_massages');
|
321
|
+
if (fm) {
|
322
|
+
fm.removeClass.delay(4000, fm, 'show');
|
323
|
+
}
|
324
|
+
|
325
|
+
new BrowserUpdate({vs:{i:8,f:7,o:10.01,s:4,n:9}});
|
326
|
+
});
|
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.5.
|
4
|
+
version: 0.5.13
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|