bhf 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/bhf/application.js +26 -26
- data/app/assets/javascripts/bhf/classes/Ajaxify.js +4 -4
- data/app/assets/javascripts/bhf/classes/ArrayFields.js +3 -3
- data/app/assets/javascripts/bhf/classes/FormHelper.js +4 -4
- data/app/assets/javascripts/bhf/classes/MultipleFields.js +2 -2
- data/app/assets/javascripts/bhf/classes/PlatformHelper.js +2 -2
- data/app/assets/javascripts/bhf/classes/QuickEdit.js +18 -18
- data/app/assets/javascripts/bhf/classes/QuickEditStack.js +3 -3
- data/app/assets/javascripts/bhf/classes/Request_bhf.js +2 -3
- data/app/assets/javascripts/bhf/classes/Setlatlng.js +8 -9
- data/app/assets/javascripts/bhf/locales/Locale.de-DE.js +0 -1
- data/app/assets/javascripts/bhf/mootools_ujs.js +81 -26
- data/app/assets/stylesheets/bhf/application.css.sass +1 -1
- data/app/controllers/bhf/embed_entries_controller.rb +3 -3
- data/app/controllers/bhf/entries_controller.rb +17 -15
- data/app/controllers/bhf/pages_controller.rb +3 -3
- data/app/helpers/bhf/application_helper.rb +2 -2
- data/app/helpers/bhf/entries_helper.rb +6 -6
- data/app/helpers/bhf/frontend_helper.rb +3 -3
- data/app/helpers/bhf/pages_helper.rb +5 -5
- data/app/views/bhf/entries/_form.html.haml +4 -4
- data/app/views/bhf/entries/_validation_errors.html.haml +1 -1
- data/app/views/bhf/entries/edit.html.haml +1 -1
- data/app/views/bhf/entries/new.html.haml +1 -1
- data/app/views/bhf/form/belongs_to/_radio.html.haml +5 -5
- data/app/views/bhf/form/belongs_to/_select.html.haml +3 -3
- data/app/views/bhf/form/column/_boolean.html.haml +1 -1
- data/app/views/bhf/form/column/_date.html.haml +1 -1
- data/app/views/bhf/form/column/_hash.html.haml +1 -1
- data/app/views/bhf/form/column/_hidden.html.haml +1 -1
- data/app/views/bhf/form/column/_markdown.html.haml +1 -1
- data/app/views/bhf/form/column/_multiple_fields.html.haml +1 -1
- data/app/views/bhf/form/column/_number.html.haml +1 -1
- data/app/views/bhf/form/column/_paperclip.html.haml +3 -3
- data/app/views/bhf/form/column/_password.html.haml +1 -1
- data/app/views/bhf/form/column/_static.html.haml +1 -1
- data/app/views/bhf/form/column/_string.html.haml +1 -1
- data/app/views/bhf/form/column/_text.html.haml +1 -1
- data/app/views/bhf/form/column/_wysiwyg.html.haml +1 -1
- data/app/views/bhf/form/embeds_many/_static.html.haml +3 -3
- data/app/views/bhf/form/has_and_belongs_to_many/_check_box.html.haml +3 -3
- data/app/views/bhf/form/has_and_belongs_to_many/_static.html.haml +1 -1
- data/app/views/bhf/form/has_many/_static.html.haml +1 -1
- data/app/views/bhf/helper/_field_errors.html.haml +1 -1
- data/app/views/bhf/helper/_flash.html.haml +1 -1
- data/app/views/bhf/helper/_frontend_edit.html.haml +1 -1
- data/app/views/bhf/helper/_info.html.haml +1 -1
- data/app/views/bhf/helper/_node.html.haml +1 -1
- data/app/views/bhf/pages/_platform.html.haml +2 -2
- data/app/views/bhf/pages/_search.html.haml +2 -4
- data/app/views/bhf/pages/show.html.haml +1 -1
- data/app/views/bhf/table/column/_array.html.haml +1 -1
- data/app/views/bhf/table/column/_boolean.html.haml +1 -1
- data/app/views/bhf/table/column/_date.html.haml +1 -1
- data/app/views/bhf/table/column/_empty.html.haml +1 -1
- data/app/views/bhf/table/column/_extern_link.html.haml +1 -1
- data/app/views/bhf/table/column/_file.html.haml +1 -1
- data/app/views/bhf/table/column/_hash.html.haml +1 -1
- data/app/views/bhf/table/column/_image.html.haml +1 -1
- data/app/views/bhf/table/column/_number.html.haml +1 -1
- data/app/views/bhf/table/column/_paperclip.html.haml +1 -1
- data/app/views/bhf/table/column/_primary_key.html.haml +1 -1
- data/app/views/bhf/table/column/_string.html.haml +1 -1
- data/app/views/bhf/table/column/_text.html.haml +1 -1
- data/app/views/bhf/table/column/{_thumbmail.haml → _thumbnail.html.haml} +0 -0
- data/app/views/bhf/table/column/_type.html.haml +1 -1
- data/app/views/bhf/table/embeds_many/_default.html.haml +1 -1
- data/app/views/bhf/table/embeds_one/_default.html.haml +1 -1
- data/app/views/bhf/table/has_and_belongs_to_many/_default.html.haml +1 -1
- data/app/views/bhf/table/has_many/_default.html.haml +1 -1
- data/app/views/bhf/table/has_one/_default.html.haml +1 -1
- data/app/views/layouts/bhf/application.haml +4 -5
- data/app/views/layouts/bhf/quick_edit.haml +1 -1
- data/bhf.gemspec +5 -6
- data/config/locales/de.yml +2 -2
- data/config/locales/en.yml +2 -2
- data/config/locales/pt.yml +2 -2
- data/config/routes.rb +5 -5
- data/lib/bhf/action_view/form_builder.rb +3 -3
- data/lib/bhf/action_view/form_options.rb +5 -5
- data/lib/bhf/active_record/base.rb +5 -5
- data/lib/bhf/mongoid/document.rb +8 -8
- data/lib/bhf/platform/attribute/abstract.rb +12 -12
- data/lib/bhf/platform/attribute/column.rb +4 -4
- data/lib/bhf/platform/attribute/reflection.rb +11 -11
- data/lib/bhf/platform/base.rb +14 -14
- data/lib/bhf/platform/pagination.rb +3 -3
- data/lib/bhf/settings/base.rb +4 -4
- data/lib/bhf/settings/platform.rb +4 -4
- data/lib/bhf/settings/yaml_parser.rb +1 -1
- data/lib/bhf.rb +5 -5
- data/lib/rails/generators/bhf/templates/initializer.rb +3 -3
- data/test/database.yml +2 -2
- data/test/test_helper.rb +4 -4
- metadata +4 -5
- data/Getting_Started.md +0 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a140fe70021fd5465f86cbd6df27bb58bc47fd1
|
|
4
|
+
data.tar.gz: 3099b6a20bd3fa24a6bbbaa388d97d5d1476d09c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9d6903797d6fb4017631d798c9132e7841e5e23d1891e136576bd4f3266d796241cb6a7584dd68f675774f20d5b0d5da6d350428228a2864821dc8d99348477
|
|
7
|
+
data.tar.gz: b3e00412522c5f9354b69ba9857e8af065a87e5d8cbd1bdd8803fd6cb2ca3a29ffdd6128e9bbb9934918f360afef34da9737f0b8602176161bc2c4080797b967
|
data/README.md
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.10.
|
|
1
|
+
0.10.13
|
|
@@ -44,7 +44,7 @@ Turbolinks.pagesCached(0);
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
var triggerPlatformPagination = function(href, platform, callback){
|
|
49
49
|
window.history.pushState({ turbolinks: true, url: href }, '', href);
|
|
50
50
|
ajaxNote.loading();
|
|
@@ -76,7 +76,7 @@ Turbolinks.pagesCached(0);
|
|
|
76
76
|
if ( ! entry) {
|
|
77
77
|
entry = parent.getElement('.quick_edit_active');
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
if (entryTemplate) {
|
|
81
81
|
entryTemplate = entryTemplate.clone();
|
|
82
82
|
entryTemplate.getElements('.js_remove_disabled').each(function(elem){
|
|
@@ -86,7 +86,7 @@ Turbolinks.pagesCached(0);
|
|
|
86
86
|
parsedTemplate = entryTemplate.innerHTML.replace(new RegExp('%7Bobject_id%7D', 'g'), '{object_id}').substitute(json);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
if (eventNames.contains('successAndAdd')) {
|
|
91
91
|
if (newEntryInjectArea && entryTemplate) {
|
|
92
92
|
newEntryInjectArea.appendHTML(parsedTemplate);
|
|
@@ -94,7 +94,7 @@ Turbolinks.pagesCached(0);
|
|
|
94
94
|
newEntryInjectArea.fireEvent('quickEditEntryAdded');
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
|
|
98
98
|
if (relation) {
|
|
99
99
|
if (relation.getPrevious('.empty')) {
|
|
100
100
|
relation.getPrevious('.empty').addClass('hide');
|
|
@@ -118,7 +118,7 @@ Turbolinks.pagesCached(0);
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
var scrollContent = function(){
|
|
123
123
|
editStack.bricksArray.each(function(quickEdit){
|
|
124
124
|
var innerForm = quickEdit.holder.getElement('form');
|
|
@@ -128,26 +128,26 @@ Turbolinks.pagesCached(0);
|
|
|
128
128
|
quickEdit.holder.setStyle('padding-top', scroll);
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
|
|
132
|
+
|
|
133
133
|
window.addEvent('bhfDomChunkReady', function(mainScope){
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
var areaSelect = mainScope.getElement('#area_select');
|
|
136
136
|
if (areaSelect) {
|
|
137
137
|
areaSelect.addEvent('change', function(){
|
|
138
138
|
location.href = this.value;
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
var quickEditOptions;
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
ajaxNote.setup();
|
|
145
145
|
|
|
146
146
|
var jsForm = new FormHelper();
|
|
147
147
|
mainScope.getElements('.js_bhf_form').each(function(form){
|
|
148
148
|
jsForm.setup(form);
|
|
149
149
|
});
|
|
150
|
-
|
|
150
|
+
|
|
151
151
|
var sharedQuickEditOptions = {
|
|
152
152
|
onFailure: function(){
|
|
153
153
|
ajaxNote.failure();
|
|
@@ -173,7 +173,7 @@ Turbolinks.pagesCached(0);
|
|
|
173
173
|
|
|
174
174
|
var platforms = mainScope.getElements('.platform');
|
|
175
175
|
var mainForm = mainScope.getElementById('main_form');
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
mainScope.getElements('.quick_edit_select').addEvent('change', function(){
|
|
178
178
|
var parent = this.getParent('.quick_edit_block');
|
|
179
179
|
var optionElem = this.options[this.selectedIndex];
|
|
@@ -194,7 +194,7 @@ Turbolinks.pagesCached(0);
|
|
|
194
194
|
this.selectedIndex = 0;
|
|
195
195
|
this.fireEvent('change');
|
|
196
196
|
}).fireEvent('change');
|
|
197
|
-
|
|
197
|
+
|
|
198
198
|
mainScope.addEvent('click:relay(.js_delete)', function(e){
|
|
199
199
|
e.target.addEvents({
|
|
200
200
|
'ajax:success': function(){
|
|
@@ -205,7 +205,7 @@ Turbolinks.pagesCached(0);
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
|
|
210
210
|
if (platforms.length) {
|
|
211
211
|
quickEditOptions = Object.merge({
|
|
@@ -227,7 +227,7 @@ Turbolinks.pagesCached(0);
|
|
|
227
227
|
platform.getElements('tbody tr').each(function(newTr, index){
|
|
228
228
|
if (trIndex === index) {
|
|
229
229
|
nextTr = newTr.getNext('tr');
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
editStack.removeAllStacks();
|
|
232
232
|
editStack.addEditBrick(quickEditOptions, nextTr.getElement('a'), nextTr);
|
|
233
233
|
}
|
|
@@ -236,14 +236,14 @@ Turbolinks.pagesCached(0);
|
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
238
238
|
nextTr = platform.getElements('tbody tr')[0];
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
editStack.removeAllStacks();
|
|
241
241
|
editStack.addEditBrick(quickEditOptions, nextTr.getElement('a'), nextTr);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}, sharedQuickEditOptions);
|
|
246
|
-
|
|
246
|
+
|
|
247
247
|
|
|
248
248
|
platforms.each(function(p){
|
|
249
249
|
new PlatformHelper(p, {
|
|
@@ -272,7 +272,7 @@ Turbolinks.pagesCached(0);
|
|
|
272
272
|
onSuccessAndNext: function(){
|
|
273
273
|
var a = this.linkElem;
|
|
274
274
|
var li = a.getParent('li');
|
|
275
|
-
if ( ! li) {
|
|
275
|
+
if ( ! li) {
|
|
276
276
|
this.close();
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
@@ -280,12 +280,12 @@ Turbolinks.pagesCached(0);
|
|
|
280
280
|
if ( ! holder) {
|
|
281
281
|
holder = li.getParent('ul');
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
|
|
284
284
|
editStack.removeAllStacks();
|
|
285
285
|
editStack.addEditBrick(quickEditOptions, holder.getElement('a'));
|
|
286
286
|
}
|
|
287
287
|
}, sharedQuickEditOptions);
|
|
288
|
-
|
|
288
|
+
|
|
289
289
|
mainForm.addEvent('click:relay(.quick_edit)', function(e){
|
|
290
290
|
e.preventDefault();
|
|
291
291
|
editStack.removeAllStacks();
|
|
@@ -299,14 +299,14 @@ Turbolinks.pagesCached(0);
|
|
|
299
299
|
},
|
|
300
300
|
hideNext: true
|
|
301
301
|
}, sharedQuickEditOptions);
|
|
302
|
-
|
|
302
|
+
|
|
303
303
|
mainScope.addEvent('click:relay(.quick_edit)', function(e){
|
|
304
304
|
e.preventDefault();
|
|
305
305
|
editStack.addStack();
|
|
306
306
|
editStack.addEditBrick(quickEditOptions, this);
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
|
|
310
310
|
mainScope.getElements('.js_sortable').each(function(sortableElems){
|
|
311
311
|
new Sortables(sortableElems, {
|
|
312
312
|
handle: '.handle',
|
|
@@ -322,12 +322,12 @@ Turbolinks.pagesCached(0);
|
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
324
|
});
|
|
325
|
-
|
|
325
|
+
|
|
326
326
|
var fm = document.id('flash_massages');
|
|
327
327
|
if (fm) {
|
|
328
328
|
fm.removeClass.delay(10000, fm, 'show');
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
|
|
331
331
|
mainScope.getElements('.initial_referral').each(function(elem){
|
|
332
332
|
setTimeout(function(){
|
|
333
333
|
elem.removeClass('live_edit');
|
|
@@ -336,7 +336,7 @@ Turbolinks.pagesCached(0);
|
|
|
336
336
|
}, 600);
|
|
337
337
|
}, 500);
|
|
338
338
|
});
|
|
339
|
-
|
|
339
|
+
|
|
340
340
|
mainScope.getElements('.ninja_file_field').addEvent('change', function(){
|
|
341
341
|
var text = (this.value || '').split('\\');
|
|
342
342
|
var parent = this.getParent();
|
|
@@ -346,7 +346,7 @@ Turbolinks.pagesCached(0);
|
|
|
346
346
|
}
|
|
347
347
|
parent.getElement('.h_text').set('text', newText);
|
|
348
348
|
});
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
mainScope.getElements('.js_submit_form_on_change').addEvent('change', function(e){
|
|
351
351
|
e.target.getParent('form').submit();
|
|
352
352
|
});
|
|
@@ -25,17 +25,17 @@ var Ajaxify = new Class({
|
|
|
25
25
|
};
|
|
26
26
|
this.setOptions(_options);
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
setup: function(){
|
|
30
30
|
this.holder = this.options.holder.inject(document.body);
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
applyEvents: function(el){
|
|
34
34
|
el = document.id(el || document.body);
|
|
35
35
|
var apply = function(action, callback) {
|
|
36
36
|
el.getElements('[data-remote="true"]').addEvent(action, callback);
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
apply(this.options.events.loading.name, this.loading.bind(this));
|
|
40
40
|
apply(this.options.events.success.name, this.success.bind(this));
|
|
41
41
|
apply(this.options.events.failure.name, this.failure.bind(this));
|
|
@@ -63,4 +63,4 @@ var Ajaxify = new Class({
|
|
|
63
63
|
}.bind(this), this.options.fadeOutDuration);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
});
|
|
66
|
+
});
|
|
@@ -9,7 +9,7 @@ var ArrayFields = new Class({
|
|
|
9
9
|
var elem = _object;
|
|
10
10
|
var template = elem.getElement('.array_fields').clone();
|
|
11
11
|
var currentNr = 0;
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
new Element('span.plus_button.qe_button.default_form_align', {text: '+'})
|
|
14
14
|
.inject(elem)
|
|
15
15
|
.addEvent('click', function(e){
|
|
@@ -26,7 +26,7 @@ var ArrayFields = new Class({
|
|
|
26
26
|
holder.inject(e.target, 'before');
|
|
27
27
|
window.fireEvent('bhfDomChunkReady', [holder]);
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
elem.getParent('form').addEvent('submit', function(){
|
|
31
31
|
elem.getElements('.array_fields').each(function(fieldElem){
|
|
32
32
|
var input = (fieldElem.getElement('input') || fieldElem);
|
|
@@ -36,4 +36,4 @@ var ArrayFields = new Class({
|
|
|
36
36
|
return true;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
});
|
|
39
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var FormHelper = new Class({
|
|
2
2
|
version: 0.1,
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
wysiwyg: [],
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
options: {
|
|
7
7
|
},
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ var FormHelper = new Class({
|
|
|
12
12
|
if ( ! _object) { return; }
|
|
13
13
|
// this.setOptions(_options);
|
|
14
14
|
var scope = _object;
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
scope.getElements('.wysiwyg').each(function(elem){
|
|
17
17
|
this.wysiwyg.push(elem.mooEditable());
|
|
18
18
|
}.bind(this));
|
|
@@ -96,4 +96,4 @@ var FormHelper = new Class({
|
|
|
96
96
|
new Setlatlng(lat);
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
});
|
|
99
|
+
});
|
|
@@ -31,7 +31,7 @@ var MultipleFields = new Class({
|
|
|
31
31
|
this.addField(elem, template, data);
|
|
32
32
|
}.bind(this));
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
addField: function(elem, template, data){
|
|
36
36
|
template
|
|
37
37
|
.clone()
|
|
@@ -47,4 +47,4 @@ var MultipleFields = new Class({
|
|
|
47
47
|
}.bind(this))
|
|
48
48
|
.inject(elem.getParent('.input').getElement('.plus_button'), 'before');
|
|
49
49
|
}
|
|
50
|
-
});
|
|
50
|
+
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var QuickEdit = new Class({
|
|
2
2
|
version: 0.2,
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
options: {
|
|
5
5
|
holderParent: 'content',
|
|
6
6
|
hideNext: false
|
|
7
7
|
},
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
Implements: [Options, Events],
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
initialize: function(_options){
|
|
12
12
|
this.setOptions(_options);
|
|
13
13
|
this.holder = new Element('div.quick_edit_holder');
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
startEdit: function(element){
|
|
17
17
|
this.linkElem = element;
|
|
18
18
|
this.newEntry = this.linkElem.hasClass('js_add_field');
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
this.fireEvent('startRequest');
|
|
21
21
|
this.currentRequest = new Request.HTML({
|
|
22
22
|
method: 'get',
|
|
@@ -27,21 +27,21 @@ var QuickEdit = new Class({
|
|
|
27
27
|
}.bind(this),
|
|
28
28
|
onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){
|
|
29
29
|
this.injectForm(responseHTML);
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
var nextElem = this.holder.getElement('.save_and_next');
|
|
32
32
|
if (this.options.hideNext && nextElem) {
|
|
33
33
|
nextElem.addClass('hide');
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
window.fireEvent('quickEditFormInject', [this.holder]);
|
|
37
37
|
}.bind(this)
|
|
38
38
|
}).send();
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
submit: function(eventNames){
|
|
42
42
|
var form = this.holder.getElement('form');
|
|
43
43
|
this.fireEvent('beforeSubmit');
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
new Request.JSON({
|
|
46
46
|
method: form.get('method'),
|
|
47
47
|
url: form.get('action'),
|
|
@@ -64,11 +64,11 @@ var QuickEdit = new Class({
|
|
|
64
64
|
}.bind(this)
|
|
65
65
|
}).send({data: form});
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
disableButtons: function(){
|
|
69
69
|
this.holder.getElements('.open, .cancel, .save_and_next, .save').set('disabled', 'disabled');
|
|
70
70
|
},
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
close: function(){
|
|
73
73
|
if (this.currentRequest) {
|
|
74
74
|
this.currentRequest.cancel();
|
|
@@ -76,10 +76,10 @@ var QuickEdit = new Class({
|
|
|
76
76
|
this.holder.dispose();
|
|
77
77
|
this.fireEvent('closed');
|
|
78
78
|
},
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
injectForm: function(form){
|
|
81
81
|
this.holder.innerHTML = form;
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
this.holder.getElements('.open').addEvent('click', function(e){
|
|
84
84
|
e.preventDefault();
|
|
85
85
|
Turbolinks.visit((this.linkElem.getElement('a') || this.linkElem).get('href'));
|
|
@@ -100,17 +100,17 @@ var QuickEdit = new Class({
|
|
|
100
100
|
e.preventDefault();
|
|
101
101
|
this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange']);
|
|
102
102
|
}.bind(this));
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
this.holder.inject(document.id(this.options.holderParent));
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
this.fireEvent('formInjected', [this.holder]);
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
hide: function(){
|
|
110
110
|
this.holder.addClass('collapsed');
|
|
111
111
|
},
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
show: function(){
|
|
114
114
|
this.holder.removeClass('collapsed');
|
|
115
115
|
}
|
|
116
|
-
});
|
|
116
|
+
});
|
|
@@ -18,7 +18,7 @@ var QuickEditStack = new Class({
|
|
|
18
18
|
qe = new QuickEdit(editOptions);
|
|
19
19
|
this.bricksArray.push(qe);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
this.bricksArray.each(function(b, i){
|
|
23
23
|
if (i === qi) {
|
|
24
24
|
b.show();
|
|
@@ -27,7 +27,7 @@ var QuickEditStack = new Class({
|
|
|
27
27
|
b.close();
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
qe.addEvents(this.options.permanentQuickEditEvents);
|
|
32
32
|
qe.startEdit(link);
|
|
33
33
|
},
|
|
@@ -50,4 +50,4 @@ var QuickEditStack = new Class({
|
|
|
50
50
|
this.bricksArray = [];
|
|
51
51
|
this.bricksIndex = 0;
|
|
52
52
|
}
|
|
53
|
-
});
|
|
53
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Request.bhf = new Class({
|
|
2
2
|
Extends: Request.HTML,
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
send: function(options){
|
|
5
5
|
var progressSupport = ('onprogress' in new Browser.Request);
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
if (!this.check(options)) return this;
|
|
8
8
|
|
|
9
9
|
this.options.isSuccess = this.options.isSuccess || this.isSuccess;
|
|
@@ -77,4 +77,3 @@ Request.bhf = new Class({
|
|
|
77
77
|
return this;
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
-
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var Setlatlng = new Class({
|
|
2
2
|
Implements: [Options, Events],
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
options: {
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
initialize: function(elem){
|
|
9
9
|
if (window.google) {
|
|
10
10
|
this.setup(elem);
|
|
@@ -16,7 +16,7 @@ var Setlatlng = new Class({
|
|
|
16
16
|
Asset.javascript('http://maps.googleapis.com/maps/api/js?sensor=false&callback=Setlatlng.GMapsCallback');
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
setup: function(elem){
|
|
21
21
|
var latElem = elem;
|
|
22
22
|
var lngElem = elem.getNext('.map_data_lng');
|
|
@@ -28,7 +28,7 @@ var Setlatlng = new Class({
|
|
|
28
28
|
latElem.value ? latElem.value : latElem.get('data-default-lat'),
|
|
29
29
|
lngElem.value ? lngElem.value : latElem.get('data-default-lng')
|
|
30
30
|
);
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
var map = new google.maps.Map(new Element('div.map_canvas').inject(latElem, 'before'), {
|
|
33
33
|
zoom: 14,
|
|
34
34
|
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
|
@@ -43,12 +43,12 @@ var Setlatlng = new Class({
|
|
|
43
43
|
scaleControl: false,
|
|
44
44
|
overviewMapControl: false
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
var marker = new google.maps.Marker({
|
|
48
48
|
title: 'Location',
|
|
49
49
|
draggable: true
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
if (latElem.value && lngElem.value) {
|
|
53
53
|
marker.setPosition(new google.maps.LatLng(latElem.value, lngElem.value));
|
|
54
54
|
marker.setMap(map);
|
|
@@ -66,7 +66,7 @@ var Setlatlng = new Class({
|
|
|
66
66
|
google.maps.event.clearListeners(map, 'click');
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
google.maps.event.addListener(marker, 'dragend', function(){
|
|
71
71
|
var mPos = marker.getPosition();
|
|
72
72
|
map.panTo(mPos);
|
|
@@ -74,4 +74,3 @@ var Setlatlng = new Class({
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
|