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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54bd57935b1b79ceea32a8d6714e0322b783cd2f
4
- data.tar.gz: fa3a81e9ed9bb5a26410fe588d6417f0c4109ef2
3
+ metadata.gz: 3346bb9c1064294211e0e3ab82836f5ae15ae3a6
4
+ data.tar.gz: 7a6b48f30c7a6eb9dd106a7c9064a9e895f6134f
5
5
  SHA512:
6
- metadata.gz: 5eb162b0f913af28fe6c54bdcc2afeaecb7dff8c251e0b3ad2469f412b333a3e95cef0119ea68656b5612ee6910c79754baaab861d2e56828d28bd1d217248f9
7
- data.tar.gz: 512540e87de6f6a3b617e1bf13bcfe61fe95ad9ed22f0232d884bce4f6b91b847d24d4c618b8b7e4daefee2e290c3ac2e71cd57c04e8b3379cd7ed4499eabf47
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 pageSetup = function(){
10
- window.addEvent('domready', function(){
11
- ajaxNote.setup();
12
- var lang = document.html.get('lang');
13
- if (lang === 'en') {
14
- lang = 'en-US';
15
- }
16
- else {
17
- lang = lang+'-'+lang.toUpperCase();
18
- }
19
- Locale.use(lang);
20
- var wysiwyg = [];
21
- var setupJsForm = function(scope){
22
- scope.getElements('.wysiwyg').each(function(elem){
23
- wysiwyg.push(elem.mooEditable());
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
- scope.getElements('.multiple_field').each(function(elem){
27
- new MultipleFields(elem);
28
- });
29
- scope.getElements('.array_holder').each(function(elem){
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
- scope.getElements('.picker').each(function(input){
34
- var options = {
35
- timePicker: true,
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
- var hiddenInput = input.clone();
52
- input.value = new Date().parse(input.value).format(options.format);
53
- input.erase('name');
54
- hiddenInput.set('type', 'hidden').inject(input, 'after');
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
- scope.getElements('.wmd_editor').each(function(mdTa){
64
- var headline, toggleHtmlPreview, toggleLivePreview, livePreview, htmlPreview;
65
-
66
- var togglePreview = function(e){
67
- var htmlMode = e.target.hasClass('toggle_html_preview');
68
- livePreview.toggleClass('hide', htmlMode);
69
- htmlPreview.toggleClass('hide', !htmlMode);
70
- toggleLivePreview.toggleClass('active', !htmlMode);
71
- toggleHtmlPreview.toggleClass('active', htmlMode);
72
- };
73
-
74
- headline = new Element('h6.preview_switch', {text: 'Preview'});
75
-
76
- toggleHtmlPreview = new Element('span.toggle_html_preview', {text: 'HTML'})
77
- .addEvent('click', togglePreview)
78
- .inject(headline);
79
- toggleLivePreview = new Element('span.toggle_live_preview', {text: 'Live'})
80
- .addEvent('click', togglePreview)
81
- .inject(headline);
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
- headline.inject(mdTa, 'after');
84
-
85
- livePreview = new Element('div.wmd-preview.hide').inject(headline, 'after');
86
- htmlPreview = new Element('div.wmd-output.hide').inject(livePreview, 'after');
87
-
88
- new WMDEditor({
89
- input: mdTa,
90
- button_bar: new Element('div').inject(mdTa, 'before'),
91
- preview: livePreview,
92
- output: htmlPreview,
93
- buttons: 'bold italic link image ol ul heading hr undo redo help',
94
- modifierKeys: false,
95
- autoFormatting: false
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
- scope.getElements('.map_data_lat').each(function(lat){
100
- new Setlatlng(lat);
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
- quickEdit.setup({
105
- holderParent: $('content'),
106
- onStartRequest: function(form){
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
- onFormInjected: function(form){
110
- setupJsForm(form);
111
- scrollContent();
112
- ajaxNote.success();
188
+ 'click:relay(.quick_edit)': function(e){
189
+ e.preventDefault();
190
+ quickEdit.startEdit(this, this.getParent('tr'));
113
191
  },
114
- onSave: function(form){
115
- ajaxNote.success();
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
- onBeforeSubmit: function(){
118
- ajaxNote.loading();
119
- wysiwyg.each(function(elem){
120
- elem.saveContent();
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
- var platforms = document.body.getElements('.platform');
126
- var mainForm = document.id('main_form');
127
-
128
- if (platforms.length) {
129
- var setupSortables = function(scope){
130
- scope.getElements('.sortable').each(function(sortableElems){
131
- new Sortables(sortableElems, {
132
- handle: '.handle',
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
- var updatePlatform = function(href, platform, callback){
147
- ajaxNote.loading();
148
- new Request.HTML({
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
- 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});
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
- 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] || '';
218
- });
219
- },
220
- successAndNext: function(json){
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
- 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
- });
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
- setupSortables(document.body);
249
- }
250
- else if (mainForm) {
251
- setupJsForm(mainForm);
246
+ }
247
+ });
248
+ setupSortables(document.body);
249
+ }
250
+ else if (mainForm) {
251
+ setupJsForm(mainForm);
252
252
 
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');
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
- var holder = li.getNext('li');
273
+ });
274
+ }
275
+ });
301
276
 
302
- if ( ! holder) {
303
- holder = li.getParent('ul');
304
- }
305
- quickEdit.startEdit(holder.getElement('a'));
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
- 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;
319
- }
320
- if (scroll + innerForm.getSize().y > windowHight) { return; }
321
- quickEdit.holder.setStyle('padding-top', scroll);
322
- };
323
- window.onscroll = scrollContent;
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
- var fm = $('flash_massages');
326
- if (fm) {
327
- fm.removeClass.delay(4000, fm, 'show');
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
- new BrowserUpdate({vs:{i:8,f:7,o:10.01,s:4,n:9}});
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
- pageSetup();
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
- pageSetup();
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
- location.href = (this.wrapElement.getElement('a') || this.wrapElement).get('href');
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.2
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-10 00:00:00.000000000 Z
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.DatePicker.js
191
- - vendor/assets/javascripts/bhf/classes/Locale.en-US.DatePicker.js
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