lalala 4.1.0.dev.299 → 4.1.0.dev.305
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/app/assets/javascripts/lalala/base.js +17 -7
- data/app/assets/javascripts/lalala/initializers/assets.module.js +13 -0
- data/app/assets/javascripts/lalala/initializers/chosen.module.js +1 -1
- data/app/assets/javascripts/lalala/modules/{file-uploader-metadata.module.js → file-metadata.module.js} +16 -16
- data/app/assets/javascripts/lalala/modules/media_selector.module.js +1 -1
- data/app/assets/javascripts/lalala/modules/{file-uploader.module.js → multiple-files-uploader.module.js} +31 -27
- data/app/assets/javascripts/lalala/modules/single-file-uploader.module.js +197 -0
- data/app/assets/stylesheets/lalala/_base.css.scss +3 -2
- data/app/assets/stylesheets/lalala/base/_mixins.css.scss +11 -0
- data/app/assets/stylesheets/lalala/modules/{_file-uploader-metadata.css.scss → _file-metadata.css.scss} +2 -2
- data/app/assets/stylesheets/lalala/modules/{_file-uploader.css.scss → _multiple-file-uploader.css.scss} +3 -3
- data/app/assets/stylesheets/lalala/modules/_single-file-uploader.css.scss +130 -0
- data/lib/formtastic/inputs/{haraway_input.rb → multiple_files_input.rb} +44 -25
- data/lib/formtastic/inputs/single_file_input.rb +78 -0
- data/lib/lalala/version.rb +1 -1
- data/lib/lalala.rb +2 -1
- data/test/dummy/app/admin/articles.rb +3 -2
- data/test/dummy/app/models/article.rb +3 -1
- data/test/dummy/app/pages/media_page.rb +1 -1
- data/test/dummy/config/initializers/haraway.rb +3 -5
- metadata +10 -8
- data/app/assets/javascripts/lalala/initializers/haraway.module.js +0 -8
- data/app/assets/javascripts/lalala/modules/init.module.js +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83d329a4a1b854f2fbc863f36e6836c8024612fa
|
4
|
+
data.tar.gz: fc2864e92a0e8c8120decfd8d5d4aacd0f5e2289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a02aa6edd51dee002d5d2ec2bea3c776346f4d1944429646f3d23ef8a7cd67bf3088c01e3f731a04e064d9d095332c51e855c68cfd618ec5355b0b06d759a3c3
|
7
|
+
data.tar.gz: e959c755eef717dc4f227d0b7c94ee585111e5d977b012aee85d864b503c7e640655179feddaef226dab28f836d25cd030f862dc165d7ea296385952ff224e33
|
@@ -1,16 +1,26 @@
|
|
1
1
|
//= require active_admin/base
|
2
2
|
//= require_tree ./lib
|
3
|
-
|
4
3
|
//= require_tree ../browser
|
5
4
|
//= require_tree ./modules
|
6
5
|
//= require_tree ./initializers
|
7
6
|
//= require_self
|
8
7
|
|
9
|
-
var haraway = require("lalala/initializers/haraway");
|
10
|
-
|
11
8
|
$(function() {
|
12
|
-
|
13
|
-
|
9
|
+
var initializers = [
|
10
|
+
"assets", "chosen"
|
11
|
+
];
|
14
12
|
|
15
|
-
|
16
|
-
|
13
|
+
var modules = [
|
14
|
+
"calendar", "editor", "locale_chooser",
|
15
|
+
"sorted_pages_tree", "login", "dashboard",
|
16
|
+
"collapsible_pages_tree"
|
17
|
+
];
|
18
|
+
|
19
|
+
for (var i=0, j=initializers.length; i<j; ++i) {
|
20
|
+
require("lalala/initializers/" + initializers[i]).init();
|
21
|
+
}
|
22
|
+
|
23
|
+
for (var m=0, n=modules.length; m<n; ++m) {
|
24
|
+
require("lalala/modules/" + modules[m]).init();
|
25
|
+
}
|
26
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
var MultipleFilesUploader = require("lalala/modules/multiple-files-uploader");
|
2
|
+
var SingleFileUploader = require("lalala/modules/single-file-uploader");
|
3
|
+
|
4
|
+
|
5
|
+
exports.init = function() {
|
6
|
+
$("x-files[multiple-files]").each(function() {
|
7
|
+
new MultipleFilesUploader(this);
|
8
|
+
});
|
9
|
+
|
10
|
+
$("x-files[single-file]").each(function() {
|
11
|
+
new SingleFileUploader(this);
|
12
|
+
});
|
13
|
+
};
|
@@ -2,8 +2,8 @@ var Overlay = require("lalala/modules/overlay");
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
function
|
6
|
-
this.$el = $('<div class="mod-file-
|
5
|
+
function FileMetadata($xfile, fileuploader) {
|
6
|
+
this.$el = $('<div class="mod-file-metadata" />');
|
7
7
|
this.$xfile = $xfile;
|
8
8
|
this.fileuploader = fileuploader;
|
9
9
|
|
@@ -13,7 +13,7 @@ function FileUploaderMetadata($xfile, fileuploader) {
|
|
13
13
|
|
14
14
|
|
15
15
|
|
16
|
-
|
16
|
+
FileMetadata.prototype.render = function() {
|
17
17
|
var tmpl, main_tmpl, sidebar_tmpl, img_tmpl, meta_tmpl;
|
18
18
|
var that = this;
|
19
19
|
|
@@ -30,7 +30,7 @@ FileUploaderMetadata.prototype.render = function() {
|
|
30
30
|
|
31
31
|
if (this.$xfile.hasClass("saved-to-db")) {
|
32
32
|
img_tmpl = '<div class="image cover" style="background-image: url(' +
|
33
|
-
this.$xfile.attr("data-src-original").replace("original", "
|
33
|
+
this.$xfile.attr("data-src-original").replace("original", "thumb") + ');"></div>';
|
34
34
|
|
35
35
|
meta_tmpl = this.$xfile.find(".meta").html();
|
36
36
|
|
@@ -92,9 +92,9 @@ FileUploaderMetadata.prototype.render = function() {
|
|
92
92
|
//
|
93
93
|
// Templates
|
94
94
|
//
|
95
|
-
|
95
|
+
FileMetadata.prototype.template = (function() {
|
96
96
|
return [
|
97
|
-
'<div class="mod-file-
|
97
|
+
'<div class="mod-file-metadata">',
|
98
98
|
'<div class="main">{{MAIN}}</div>',
|
99
99
|
'<div class="sidebar">{{SIDEBAR}}</div>',
|
100
100
|
'</div>'
|
@@ -102,7 +102,7 @@ FileUploaderMetadata.prototype.template = (function() {
|
|
102
102
|
})();
|
103
103
|
|
104
104
|
|
105
|
-
|
105
|
+
FileMetadata.prototype.main_template = (function() {
|
106
106
|
return [
|
107
107
|
'<div class="fields">',
|
108
108
|
'{{FIELDS}}',
|
@@ -111,7 +111,7 @@ FileUploaderMetadata.prototype.main_template = (function() {
|
|
111
111
|
})();
|
112
112
|
|
113
113
|
|
114
|
-
|
114
|
+
FileMetadata.prototype.sidebar_template = (function() {
|
115
115
|
return [
|
116
116
|
'{{IMAGE}}',
|
117
117
|
'<div class="meta">{{META}}</div>',
|
@@ -123,7 +123,7 @@ FileUploaderMetadata.prototype.sidebar_template = (function() {
|
|
123
123
|
})();
|
124
124
|
|
125
125
|
|
126
|
-
|
126
|
+
FileMetadata.prototype.get_form_template = function() {
|
127
127
|
var $x = this.fileuploader.$el.find("template.form-template");
|
128
128
|
var x = $x.get(0);
|
129
129
|
var wrapper = document.createElement("div");
|
@@ -142,13 +142,13 @@ FileUploaderMetadata.prototype.get_form_template = function() {
|
|
142
142
|
//
|
143
143
|
// Events (General)
|
144
144
|
//
|
145
|
-
|
145
|
+
FileMetadata.prototype.bind_events = function() {
|
146
146
|
this.$el.on("click", "a.button.commit", $.proxy(this.commit_click_handler, this));
|
147
147
|
this.$el.on("click", "a.button.cancel", $.proxy(this.cancel_click_handler, this));
|
148
148
|
};
|
149
149
|
|
150
150
|
|
151
|
-
|
151
|
+
FileMetadata.prototype.unbind_events = function() {
|
152
152
|
this.$el.off("click");
|
153
153
|
};
|
154
154
|
|
@@ -157,13 +157,13 @@ FileUploaderMetadata.prototype.unbind_events = function() {
|
|
157
157
|
//
|
158
158
|
// Actions
|
159
159
|
//
|
160
|
-
|
160
|
+
FileMetadata.prototype.commit_click_handler = function() {
|
161
161
|
this.copy_attributes_to_xfile();
|
162
162
|
this.hide();
|
163
163
|
};
|
164
164
|
|
165
165
|
|
166
|
-
|
166
|
+
FileMetadata.prototype.cancel_click_handler = function() {
|
167
167
|
this.hide();
|
168
168
|
};
|
169
169
|
|
@@ -172,7 +172,7 @@ FileUploaderMetadata.prototype.cancel_click_handler = function() {
|
|
172
172
|
//
|
173
173
|
// Attributes
|
174
174
|
//
|
175
|
-
|
175
|
+
FileMetadata.prototype.copy_attributes_to_xfile = function() {
|
176
176
|
var $xattr = this.$xfile.find(".attributes");
|
177
177
|
var new_attributes_container;
|
178
178
|
|
@@ -235,7 +235,7 @@ FileUploaderMetadata.prototype.copy_attributes_to_xfile = function() {
|
|
235
235
|
//
|
236
236
|
// Other
|
237
237
|
//
|
238
|
-
|
238
|
+
FileMetadata.prototype.hide = function() {
|
239
239
|
this.unbind_events();
|
240
240
|
Overlay.get_instance().hide();
|
241
241
|
};
|
@@ -245,4 +245,4 @@ FileUploaderMetadata.prototype.hide = function() {
|
|
245
245
|
//
|
246
246
|
// -> EXPORT
|
247
247
|
//
|
248
|
-
module.exports =
|
248
|
+
module.exports = FileMetadata;
|
@@ -57,7 +57,7 @@ MediaSelector.prototype.collect_data_from_self = function() {
|
|
57
57
|
return $(this).attr("data-name");
|
58
58
|
}).toArray();
|
59
59
|
|
60
|
-
$xfiles.find("x-file").each(function() {
|
60
|
+
$xfiles.find("x-file[data-src-original]").each(function() {
|
61
61
|
var $xfile = $(this);
|
62
62
|
|
63
63
|
data.push({
|
@@ -1,9 +1,9 @@
|
|
1
|
-
var
|
1
|
+
var FileMetadata = require("lalala/modules/file-metadata"),
|
2
2
|
Overlay = require("lalala/modules/overlay");
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
-
function
|
6
|
+
function MultipleFilesUploader(xfiles_element) {
|
7
7
|
this.$el = $(xfiles_element);
|
8
8
|
this.$file_container = this.$el.find(".file-container");
|
9
9
|
this.$form = this.$el.closest("form");
|
@@ -26,7 +26,7 @@ function FileUploader(xfiles_element) {
|
|
26
26
|
//
|
27
27
|
// Templates, views, etc.
|
28
28
|
//
|
29
|
-
|
29
|
+
MultipleFilesUploader.prototype.make_xfile_template = function() {
|
30
30
|
var $template = this.$el.find("template.x-file-template");
|
31
31
|
var template = $template.get(0);
|
32
32
|
var $wrapper = $("<x-file />");
|
@@ -51,7 +51,7 @@ FileUploader.prototype.make_xfile_template = function() {
|
|
51
51
|
};
|
52
52
|
|
53
53
|
|
54
|
-
|
54
|
+
MultipleFilesUploader.prototype.render_isempty_message_if_needed = function() {
|
55
55
|
if (this.$file_container.find("x-file").length === 0) {
|
56
56
|
this.$file_container[0].innerHTML = [
|
57
57
|
"<div class=\"is-empty\">",
|
@@ -66,18 +66,18 @@ FileUploader.prototype.render_isempty_message_if_needed = function() {
|
|
66
66
|
};
|
67
67
|
|
68
68
|
|
69
|
-
|
69
|
+
MultipleFilesUploader.prototype.set_data_inspection_html = function(html) {
|
70
70
|
this.$el.find("header .data-inspection").html(html);
|
71
71
|
};
|
72
72
|
|
73
73
|
|
74
|
-
|
74
|
+
MultipleFilesUploader.prototype.clear_file_container = function() {
|
75
75
|
this.$file_container.empty();
|
76
76
|
this.$file_container.append("<div class=\"inner-wrapper\" />");
|
77
77
|
};
|
78
78
|
|
79
79
|
|
80
|
-
|
80
|
+
MultipleFilesUploader.prototype.show_amount_of_files = function() {
|
81
81
|
var amount_of_files = this.$file_container.find("x-file").length;
|
82
82
|
var word = (amount_of_files === 1 ? "file" : "files");
|
83
83
|
|
@@ -87,7 +87,7 @@ FileUploader.prototype.show_amount_of_files = function() {
|
|
87
87
|
};
|
88
88
|
|
89
89
|
|
90
|
-
|
90
|
+
MultipleFilesUploader.prototype.remove_hidden_fields_from_checkboxes = function($element) {
|
91
91
|
$element.find("input[type=\"checkbox\"]").each(function() {
|
92
92
|
var name = $(this).attr("name");
|
93
93
|
$element.find('[name="' + name + '"][type="hidden"]').remove();
|
@@ -99,7 +99,7 @@ FileUploader.prototype.remove_hidden_fields_from_checkboxes = function($element)
|
|
99
99
|
//
|
100
100
|
// Handle file
|
101
101
|
//
|
102
|
-
|
102
|
+
MultipleFilesUploader.prototype.handle_file = function(file) {
|
103
103
|
this.state.files_counter++;
|
104
104
|
this.state.files[this.state.files_counter.toString()] = file;
|
105
105
|
|
@@ -153,13 +153,13 @@ FileUploader.prototype.handle_file = function(file) {
|
|
153
153
|
//
|
154
154
|
// -> this = file
|
155
155
|
//
|
156
|
-
|
156
|
+
MultipleFilesUploader.prototype.file_start_handler = function(e) {
|
157
157
|
this.$el.removeClass("waiting");
|
158
158
|
this.$el.addClass("uploading");
|
159
159
|
};
|
160
160
|
|
161
161
|
|
162
|
-
|
162
|
+
MultipleFilesUploader.prototype.file_progess_handler = function(e) {
|
163
163
|
if (this.$el.hasClass("error")) return;
|
164
164
|
|
165
165
|
// if there are no transform -> upload percentage
|
@@ -174,7 +174,7 @@ FileUploader.prototype.file_progess_handler = function(e) {
|
|
174
174
|
};
|
175
175
|
|
176
176
|
|
177
|
-
|
177
|
+
MultipleFilesUploader.prototype.file_err_handler = function(e) {
|
178
178
|
console.error("Error", this);
|
179
179
|
|
180
180
|
this.$el.addClass("error");
|
@@ -183,19 +183,19 @@ FileUploader.prototype.file_err_handler = function(e) {
|
|
183
183
|
};
|
184
184
|
|
185
185
|
|
186
|
-
|
186
|
+
MultipleFilesUploader.prototype.file_done_uploading_handler = function(e) {
|
187
187
|
this.$el.find(".upload-bar").addClass("done");
|
188
188
|
this.$el.removeClass("uploading");
|
189
189
|
this.$el.addClass("processing");
|
190
190
|
};
|
191
191
|
|
192
192
|
|
193
|
-
|
193
|
+
MultipleFilesUploader.prototype.file_done_processing_handler = function(e) {
|
194
194
|
this.$el.find(".process-bar").addClass("done");
|
195
195
|
};
|
196
196
|
|
197
197
|
|
198
|
-
|
198
|
+
MultipleFilesUploader.prototype.file_done_handler = function(e) {
|
199
199
|
var name = this.$el.closest("x-files").attr("name");
|
200
200
|
var pairs = format_asset_metadata(this.metadata, name + "[]");
|
201
201
|
|
@@ -209,6 +209,10 @@ FileUploader.prototype.file_done_handler = function(e) {
|
|
209
209
|
|
210
210
|
this.$el.removeClass("processing");
|
211
211
|
this.$el.addClass("uploaded");
|
212
|
+
|
213
|
+
// attr
|
214
|
+
var id = this.$el.find("input[name$=\"[id]\"]").val();
|
215
|
+
if (id) this.$el.attr("data-src-original", "//c.assets.sh/" + id + "/thumb");
|
212
216
|
};
|
213
217
|
|
214
218
|
|
@@ -216,7 +220,7 @@ FileUploader.prototype.file_done_handler = function(e) {
|
|
216
220
|
//
|
217
221
|
// Events - General
|
218
222
|
//
|
219
|
-
|
223
|
+
MultipleFilesUploader.prototype.bind_events = function() {
|
220
224
|
var choose_handler = $.proxy(this.choose_click_handler, this);
|
221
225
|
var delete_handler = $.proxy(this.xfile_btn_delete_click_handler, this);
|
222
226
|
var meta_handler = $.proxy(this.xfile_btn_meta_click_handler, this);
|
@@ -237,7 +241,7 @@ FileUploader.prototype.bind_events = function() {
|
|
237
241
|
};
|
238
242
|
|
239
243
|
|
240
|
-
|
244
|
+
MultipleFilesUploader.prototype.choose_click_handler = function(e) {
|
241
245
|
var accept = this.$el.attr("accept").split(",");
|
242
246
|
var profile = this.$el.attr("profile");
|
243
247
|
|
@@ -249,7 +253,7 @@ FileUploader.prototype.choose_click_handler = function(e) {
|
|
249
253
|
};
|
250
254
|
|
251
255
|
|
252
|
-
|
256
|
+
MultipleFilesUploader.prototype.defer_submit = function(e) {
|
253
257
|
var $form = $(e.currentTarget);
|
254
258
|
|
255
259
|
// prevent default behaviour
|
@@ -267,13 +271,13 @@ FileUploader.prototype.defer_submit = function(e) {
|
|
267
271
|
};
|
268
272
|
|
269
273
|
|
270
|
-
|
274
|
+
MultipleFilesUploader.prototype.xfile_btn_delete_click_handler = function(e) {
|
271
275
|
var $xfile = $(e.currentTarget).closest("x-file");
|
272
276
|
if ($xfile.length) this.toggle_destroy($xfile);
|
273
277
|
};
|
274
278
|
|
275
279
|
|
276
|
-
|
280
|
+
MultipleFilesUploader.prototype.xfile_btn_meta_click_handler = function(e) {
|
277
281
|
var $xfile = $(e.currentTarget).closest("x-file"), fum;
|
278
282
|
var main_overlay = Overlay.get_instance();
|
279
283
|
|
@@ -281,10 +285,10 @@ FileUploader.prototype.xfile_btn_meta_click_handler = function(e) {
|
|
281
285
|
if (!$xfile.hasClass("uploaded")) return;
|
282
286
|
|
283
287
|
// new metadata overlay-content block
|
284
|
-
fum = new
|
288
|
+
fum = new FileMetadata($xfile, this);
|
285
289
|
main_overlay.append_content(fum.$el);
|
286
290
|
main_overlay.$el.find("select").chosen({ width: "80%" });
|
287
|
-
main_overlay.show("file-
|
291
|
+
main_overlay.show("file-metadata");
|
288
292
|
};
|
289
293
|
|
290
294
|
|
@@ -292,7 +296,7 @@ FileUploader.prototype.xfile_btn_meta_click_handler = function(e) {
|
|
292
296
|
//
|
293
297
|
// Destroy
|
294
298
|
//
|
295
|
-
|
299
|
+
MultipleFilesUploader.prototype.toggle_destroy = function($xfile) {
|
296
300
|
if ($xfile.hasClass("about-to-destroy")) {
|
297
301
|
this.set_to_not_destroy($xfile);
|
298
302
|
} else {
|
@@ -301,7 +305,7 @@ FileUploader.prototype.toggle_destroy = function($xfile) {
|
|
301
305
|
};
|
302
306
|
|
303
307
|
|
304
|
-
|
308
|
+
MultipleFilesUploader.prototype.set_to_destroy = function($xfile) {
|
305
309
|
var $destroy, $id;
|
306
310
|
|
307
311
|
// add class
|
@@ -323,7 +327,7 @@ FileUploader.prototype.set_to_destroy = function($xfile) {
|
|
323
327
|
};
|
324
328
|
|
325
329
|
|
326
|
-
|
330
|
+
MultipleFilesUploader.prototype.set_to_not_destroy = function($xfile) {
|
327
331
|
$xfile.removeClass("about-to-destroy");
|
328
332
|
$xfile.find("[name$=\"_destroy]\"]").attr("value", "0");
|
329
333
|
};
|
@@ -333,7 +337,7 @@ FileUploader.prototype.set_to_not_destroy = function($xfile) {
|
|
333
337
|
//
|
334
338
|
// Sortable
|
335
339
|
//
|
336
|
-
|
340
|
+
MultipleFilesUploader.prototype.make_items_sortable = function() {
|
337
341
|
this.$el.sortable({
|
338
342
|
containment: "parent",
|
339
343
|
items: "x-file",
|
@@ -373,4 +377,4 @@ function format_asset_metadata(value, prefix) {
|
|
373
377
|
//
|
374
378
|
// -> EXPORT
|
375
379
|
//
|
376
|
-
module.exports =
|
380
|
+
module.exports = MultipleFilesUploader;
|
@@ -0,0 +1,197 @@
|
|
1
|
+
function SingleFileUploader(xfile_element) {
|
2
|
+
this.$el = $(xfile_element);
|
3
|
+
this.$form = this.$el.closest("form");
|
4
|
+
|
5
|
+
this.bind_events();
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
//
|
11
|
+
// Handle file
|
12
|
+
//
|
13
|
+
SingleFileUploader.prototype.handle_file = function(file) {
|
14
|
+
var $image;
|
15
|
+
|
16
|
+
file.$el = this.$el;
|
17
|
+
file.el = file.$el.get(0);
|
18
|
+
|
19
|
+
// make & add thumbnail
|
20
|
+
image = file.$el.find(".content .image").get(0);
|
21
|
+
image.innerHTML = "";
|
22
|
+
|
23
|
+
if (file.type.indexOf("image") == -1) {
|
24
|
+
var fake_thumb = document.createElement("div");
|
25
|
+
fake_thumb.className = "thumb no-image";
|
26
|
+
image.appendChild(fake_thumb);
|
27
|
+
|
28
|
+
} else {
|
29
|
+
file.readThumbnailData(58, 38, function(canvas) {
|
30
|
+
image.appendChild(canvas);
|
31
|
+
});
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
// bind events
|
36
|
+
file.on("start", this.file_start_handler);
|
37
|
+
file.on("progress", this.file_progess_handler);
|
38
|
+
file.on("err", this.file_err_handler);
|
39
|
+
file.on("done:uploading", this.file_done_uploading_handler);
|
40
|
+
file.on("done:processing", this.file_done_processing_handler);
|
41
|
+
file.on("done", this.file_done_handler);
|
42
|
+
};
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
//
|
47
|
+
// Events - File handlers
|
48
|
+
//
|
49
|
+
// -> this = file
|
50
|
+
//
|
51
|
+
SingleFileUploader.prototype.file_start_handler = function(e) {
|
52
|
+
this.$el.removeClass("waiting");
|
53
|
+
this.$el.addClass("uploading");
|
54
|
+
};
|
55
|
+
|
56
|
+
|
57
|
+
SingleFileUploader.prototype.file_progess_handler = function(e) {
|
58
|
+
var $el = this.$el;
|
59
|
+
|
60
|
+
// check
|
61
|
+
if ($el.hasClass("error")) {
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
// if there are no transform -> upload percentage
|
66
|
+
if (this.transforms === 0) {
|
67
|
+
$el.find(".upload-bar").css("width", this.upload_percentage + "%");
|
68
|
+
|
69
|
+
// if there are -> transform percentage
|
70
|
+
} else {
|
71
|
+
$el.find(".process-bar").css("width", this.transforms_percentage + "%");
|
72
|
+
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
|
77
|
+
SingleFileUploader.prototype.file_err_handler = function(e) {
|
78
|
+
console.error("Error", this);
|
79
|
+
|
80
|
+
this.$el.addClass("error");
|
81
|
+
this.$el.find(".upload-bar").css("width", "100%");
|
82
|
+
this.$el.find(".process-bar").css("width", "100%");
|
83
|
+
};
|
84
|
+
|
85
|
+
|
86
|
+
SingleFileUploader.prototype.file_done_uploading_handler = function(e) {
|
87
|
+
this.$el.find(".upload-bar").addClass("done");
|
88
|
+
this.$el.removeClass("uploading");
|
89
|
+
this.$el.addClass("processing");
|
90
|
+
};
|
91
|
+
|
92
|
+
|
93
|
+
SingleFileUploader.prototype.file_done_processing_handler = function(e) {
|
94
|
+
this.$el.find(".process-bar").addClass("done");
|
95
|
+
};
|
96
|
+
|
97
|
+
|
98
|
+
SingleFileUploader.prototype.file_done_handler = function(e) {
|
99
|
+
var name = this.$el.closest("x-files").attr("name");
|
100
|
+
var pairs = format_asset_metadata(this.metadata, name);
|
101
|
+
|
102
|
+
for (var i in pairs) {
|
103
|
+
var input = document.createElement("input");
|
104
|
+
input.type = "hidden";
|
105
|
+
input.name = pairs[i].name;
|
106
|
+
input.value = pairs[i].value;
|
107
|
+
this.el.appendChild(input);
|
108
|
+
}
|
109
|
+
|
110
|
+
this.$el.removeClass("processing");
|
111
|
+
this.$el.addClass("uploaded");
|
112
|
+
};
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
//
|
117
|
+
// Events - General
|
118
|
+
//
|
119
|
+
SingleFileUploader.prototype.bind_events = function() {
|
120
|
+
var choose_handler = $.proxy(this.choose_click_handler, this);
|
121
|
+
|
122
|
+
this.$el.on("click", ".choose", choose_handler);
|
123
|
+
|
124
|
+
// when processing/uploading files -> disable form
|
125
|
+
Haraway.on("busy", $.proxy(function() {
|
126
|
+
this.$form.on("submit", this.defer_submit);
|
127
|
+
}, this));
|
128
|
+
|
129
|
+
// when not processing/uploading files -> resume default behaviour
|
130
|
+
Haraway.on("idle", $.proxy(function() {
|
131
|
+
this.$form.off("submit", this.defer_submit);
|
132
|
+
}, this));
|
133
|
+
};
|
134
|
+
|
135
|
+
|
136
|
+
SingleFileUploader.prototype.choose_click_handler = function(e) {
|
137
|
+
var accept = this.$el.attr("accept").split(",");
|
138
|
+
var profile = this.$el.attr("profile");
|
139
|
+
|
140
|
+
// prevent default
|
141
|
+
e.preventDefault();
|
142
|
+
|
143
|
+
// show choose dialog
|
144
|
+
Haraway.choose(accept, false, profile, $.proxy(this.handle_file, this));
|
145
|
+
};
|
146
|
+
|
147
|
+
|
148
|
+
SingleFileUploader.prototype.defer_submit = function(e) {
|
149
|
+
var $form = $(e.currentTarget);
|
150
|
+
|
151
|
+
// prevent default behaviour
|
152
|
+
e.preventDefault();
|
153
|
+
|
154
|
+
// disable submit button
|
155
|
+
$form.find("input[type=\"submit\"]").attr("disabled", "disabled");
|
156
|
+
|
157
|
+
// once processing/uploading is complete
|
158
|
+
// enable submit button and submit form
|
159
|
+
Haraway.once("idle", function() {
|
160
|
+
$form.find("input[type=submit]").attr("disabled", null);
|
161
|
+
$form.submit();
|
162
|
+
});
|
163
|
+
};
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
//
|
168
|
+
// Extra's
|
169
|
+
//
|
170
|
+
function format_asset_metadata(value, prefix) {
|
171
|
+
var results = [], i;
|
172
|
+
|
173
|
+
if (value instanceof Array) {
|
174
|
+
for (i in value) {
|
175
|
+
results = results.concat(format_asset_metadata(value[i], prefix + "[]"));
|
176
|
+
}
|
177
|
+
return results;
|
178
|
+
}
|
179
|
+
|
180
|
+
if (value === Object(value)) {
|
181
|
+
for (i in value) {
|
182
|
+
if (value.hasOwnProperty(i)) {
|
183
|
+
results = results.concat(format_asset_metadata(value[i], prefix + "[" + i + "]"));
|
184
|
+
}
|
185
|
+
}
|
186
|
+
return results;
|
187
|
+
}
|
188
|
+
|
189
|
+
return [{ name: prefix, value: value }];
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
//
|
195
|
+
// -> EXPORT
|
196
|
+
//
|
197
|
+
module.exports = SingleFileUploader;
|
@@ -39,6 +39,7 @@
|
|
39
39
|
@import "lalala/modules/dashboard";
|
40
40
|
@import "lalala/modules/panel";
|
41
41
|
|
42
|
-
@import "lalala/modules/file-
|
43
|
-
@import "lalala/modules/file-uploader-metadata";
|
42
|
+
@import "lalala/modules/file-metadata";
|
44
43
|
@import "lalala/modules/media-selector";
|
44
|
+
@import "lalala/modules/multiple-file-uploader";
|
45
|
+
@import "lalala/modules/single-file-uploader";
|
@@ -74,3 +74,14 @@
|
|
74
74
|
&::-moz-placeholder { @content }
|
75
75
|
&:-ms-input-placeholder { @content }
|
76
76
|
}
|
77
|
+
|
78
|
+
|
79
|
+
//
|
80
|
+
// Calc
|
81
|
+
//
|
82
|
+
@mixin calc($property, $expression) {
|
83
|
+
#{$property}: -moz-calc(#{$expression});
|
84
|
+
#{$property}: -o-calc(#{$expression});
|
85
|
+
#{$property}: -webkit-calc(#{$expression});
|
86
|
+
#{$property}: calc(#{$expression});
|
87
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/*
|
2
2
|
|
3
|
-
Modules /
|
3
|
+
Modules / Multiple file uploader
|
4
4
|
|
5
5
|
*/
|
6
6
|
|
7
|
-
x-files {
|
7
|
+
x-files[multiple-files] {
|
8
8
|
color: #6F6F71;
|
9
9
|
display: block;
|
10
10
|
font-size: 12px;
|
@@ -122,7 +122,6 @@ x-files {
|
|
122
122
|
// X-file -- General
|
123
123
|
//
|
124
124
|
x-file .thumb {
|
125
|
-
background-color: #F3F3F3;
|
126
125
|
background-position: center;
|
127
126
|
background-repeat: no-repeat;
|
128
127
|
background-size: cover;
|
@@ -131,6 +130,7 @@ x-files {
|
|
131
130
|
}
|
132
131
|
|
133
132
|
x-file .thumb.no-image {
|
133
|
+
background-color: #F3F3F3;
|
134
134
|
background-image: icon-url("page_white");
|
135
135
|
background-size: auto;
|
136
136
|
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Modules / Single file uploader
|
4
|
+
|
5
|
+
*/
|
6
|
+
|
7
|
+
x-files[single-file] {
|
8
|
+
color: #6F6F71;
|
9
|
+
display: block;
|
10
|
+
font-size: 12px;
|
11
|
+
height: 38px;
|
12
|
+
line-height: 38px;
|
13
|
+
margin: 31px 0 45px;
|
14
|
+
position: relative;
|
15
|
+
|
16
|
+
-moz-user-select: none;
|
17
|
+
-webkit-user-select: none;
|
18
|
+
user-select: none;
|
19
|
+
|
20
|
+
.buttons,
|
21
|
+
.content {
|
22
|
+
-webkit-font-smoothing: antialiased;
|
23
|
+
-moz-osx-font-smoothing: grayscale;
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
//
|
28
|
+
// Association
|
29
|
+
//
|
30
|
+
.association {
|
31
|
+
display: inline-block;
|
32
|
+
font-size: 14px;
|
33
|
+
font-weight: bold;
|
34
|
+
line-height: 16px;
|
35
|
+
margin-left: 2px;
|
36
|
+
position: relative;
|
37
|
+
top: -1px;
|
38
|
+
vertical-align: middle;
|
39
|
+
width: 20%;
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
//
|
44
|
+
// Buttons
|
45
|
+
//
|
46
|
+
.buttons {
|
47
|
+
border-right: 1px solid #E2E2E2;
|
48
|
+
bottom: 0;
|
49
|
+
left: 20%;
|
50
|
+
padding-right: 14px;
|
51
|
+
position: absolute;
|
52
|
+
text-align: right;
|
53
|
+
top: 0;
|
54
|
+
|
55
|
+
@media screen and (min-width: $min_width_large) {
|
56
|
+
// right: 511px;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.buttons .choose {
|
61
|
+
@include icon("folder_add");
|
62
|
+
background-position: left center;
|
63
|
+
color: #CDCDCD;
|
64
|
+
cursor: pointer;
|
65
|
+
display: inline-block;
|
66
|
+
font-weight: bold;
|
67
|
+
line-height: 24px;
|
68
|
+
padding-left: 22px;
|
69
|
+
padding-top: 2px;
|
70
|
+
white-space: nowrap;
|
71
|
+
}
|
72
|
+
|
73
|
+
.buttons .choose:hover {
|
74
|
+
color: #6F6F71;
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
//
|
79
|
+
// Content
|
80
|
+
//
|
81
|
+
.content {
|
82
|
+
@include calc(width, "80% - 101px - 26px");
|
83
|
+
position: absolute;
|
84
|
+
right: 0;
|
85
|
+
top: 0;
|
86
|
+
}
|
87
|
+
|
88
|
+
.image {
|
89
|
+
float: left;
|
90
|
+
height: 38px;
|
91
|
+
width: 58px;
|
92
|
+
}
|
93
|
+
|
94
|
+
.image .thumb {
|
95
|
+
background-position: center;
|
96
|
+
background-repeat: no-repeat;
|
97
|
+
background-size: cover;
|
98
|
+
height: 100%;
|
99
|
+
width: 100%;
|
100
|
+
}
|
101
|
+
|
102
|
+
.image .thumb.no-image {
|
103
|
+
background-color: #F3F3F3;
|
104
|
+
background-image: icon-url("page_white");
|
105
|
+
background-size: auto;
|
106
|
+
}
|
107
|
+
|
108
|
+
.image img,
|
109
|
+
.image canvas {
|
110
|
+
display: block;
|
111
|
+
height: auto;
|
112
|
+
opacity: 0.5;
|
113
|
+
width: 100%;
|
114
|
+
|
115
|
+
@include transition(
|
116
|
+
opacity 450ms
|
117
|
+
);
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
//
|
122
|
+
// Statusses
|
123
|
+
//
|
124
|
+
&.uploaded .image canvas,
|
125
|
+
&.uploaded .image img {
|
126
|
+
opacity: 1;
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
}
|
@@ -1,22 +1,27 @@
|
|
1
|
-
class Formtastic::Inputs::
|
1
|
+
class Formtastic::Inputs::MultipleFilesInput
|
2
2
|
include Formtastic::Inputs::Base
|
3
3
|
|
4
4
|
def to_html
|
5
5
|
object = builder.object
|
6
|
-
|
6
|
+
|
7
|
+
klass = Formtastic::Inputs::MultipleFilesInput
|
7
8
|
param_key = "#{object.class.table_name.singularize}[#{method}]"
|
8
9
|
title = method.to_s.pluralize.titleize
|
9
10
|
assets = object.send(method)
|
10
|
-
|
11
|
+
|
12
|
+
profile_name = object.class.haraway_assets[method.to_s]
|
13
|
+
profile = Haraway.configuration.profiles[profile_name]
|
14
|
+
accepts = profile.try(:accepted_file_types)
|
11
15
|
accepts = accepts.join(", ") if accepts
|
16
|
+
versions = compile_versions_array(profile)
|
12
17
|
|
13
18
|
sorted_assets = klass.sorted_assets(assets.clone).map do |asset|
|
14
|
-
klass.xfile_html(self, template, param_key, asset)
|
19
|
+
klass.xfile_html(self, template, param_key, asset, versions)
|
15
20
|
end
|
16
21
|
|
17
|
-
<<-
|
22
|
+
<<-HTML
|
18
23
|
|
19
|
-
<x-files profile="#{
|
24
|
+
<x-files multiple-files profile="#{profile_name}" accept="#{accepts}" name="#{param_key}">
|
20
25
|
<header>
|
21
26
|
<div class="col-a">
|
22
27
|
<span class="name">#{title}</span>
|
@@ -49,11 +54,11 @@ class Formtastic::Inputs::HarawayInput
|
|
49
54
|
</div>
|
50
55
|
|
51
56
|
<div class="meta-versions">
|
52
|
-
#{
|
57
|
+
#{ versions_html(profile) }
|
53
58
|
</div>
|
54
59
|
</x-files>
|
55
60
|
|
56
|
-
|
61
|
+
HTML
|
57
62
|
end
|
58
63
|
|
59
64
|
|
@@ -72,10 +77,7 @@ class Formtastic::Inputs::HarawayInput
|
|
72
77
|
end
|
73
78
|
|
74
79
|
|
75
|
-
def
|
76
|
-
profile = Haraway.configuration.profiles[profile.to_s]
|
77
|
-
|
78
|
-
# collect data
|
80
|
+
def compile_versions_array(profile)
|
79
81
|
if profile
|
80
82
|
versions = profile.versions.keys.map do |key|
|
81
83
|
version = profile.versions[key.to_s]
|
@@ -91,13 +93,18 @@ class Formtastic::Inputs::HarawayInput
|
|
91
93
|
|
92
94
|
end
|
93
95
|
|
94
|
-
#
|
95
|
-
versions
|
96
|
-
|
96
|
+
# return
|
97
|
+
versions
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
def versions_html(profile)
|
102
|
+
compile_versions_array(profile).map do |version|
|
103
|
+
<<-HTML
|
97
104
|
<script class="version" data-name="#{version.name}" type="application/json">
|
98
105
|
#{version.params.to_json}
|
99
106
|
</script>
|
100
|
-
|
107
|
+
HTML
|
101
108
|
end.join("")
|
102
109
|
end
|
103
110
|
|
@@ -110,16 +117,28 @@ class Formtastic::Inputs::HarawayInput
|
|
110
117
|
end
|
111
118
|
|
112
119
|
|
113
|
-
def self.xfile_html(input, template, param_key, asset)
|
114
|
-
asset_url_original =
|
115
|
-
asset_url_thumb = (asset.url(:thumb) rescue "")
|
120
|
+
def self.xfile_html(input, template, param_key, asset, versions)
|
121
|
+
asset_url_original = asset.url(:original)
|
116
122
|
|
117
|
-
|
123
|
+
# thumb
|
124
|
+
if versions.select { |v| v.name == "thumb" }.length >= 1
|
125
|
+
asset_url_thumb = asset.url(:thumb)
|
126
|
+
end
|
127
|
+
|
128
|
+
if asset_url_thumb
|
129
|
+
thumb_html = "<div class=\"thumb\" style=\"background-image: " +
|
130
|
+
"url(#{ asset_url_thumb });\"></div>"
|
131
|
+
else
|
132
|
+
thumb_html = "<div class=\"thumb no-image\"></div>"
|
133
|
+
end
|
134
|
+
|
135
|
+
# return
|
136
|
+
<<-HTML
|
118
137
|
|
119
138
|
<x-file class="uploaded saved-to-db" data-src-original="#{ asset_url_original }">
|
120
|
-
|
139
|
+
#{ thumb_html }
|
121
140
|
|
122
|
-
#{ Formtastic::Inputs::
|
141
|
+
#{ Formtastic::Inputs::MultipleFilesInput.menu_html }
|
123
142
|
#{ template.hidden_field_tag(param_key + "[][id]", asset.id) }
|
124
143
|
#{ template.hidden_field_tag(param_key + "[][_destroy]", "") }
|
125
144
|
|
@@ -132,12 +151,12 @@ class Formtastic::Inputs::HarawayInput
|
|
132
151
|
</div>
|
133
152
|
</x-file>
|
134
153
|
|
135
|
-
|
154
|
+
HTML
|
136
155
|
end
|
137
156
|
|
138
157
|
|
139
158
|
def self.menu_html
|
140
|
-
<<-
|
159
|
+
<<-HTML
|
141
160
|
|
142
161
|
<div class="menu">
|
143
162
|
<a data-action="delete"></a>
|
@@ -145,7 +164,7 @@ class Formtastic::Inputs::HarawayInput
|
|
145
164
|
<a data-action="move"></a>
|
146
165
|
</div>
|
147
166
|
|
148
|
-
|
167
|
+
HTML
|
149
168
|
end
|
150
169
|
|
151
170
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
class Formtastic::Inputs::SingleFileInput
|
2
|
+
include Formtastic::Inputs::Base
|
3
|
+
|
4
|
+
def to_html
|
5
|
+
object = builder.object
|
6
|
+
param_key = "#{object.class.table_name.singularize}[#{method}]"
|
7
|
+
title = method.to_s.titleize
|
8
|
+
asset = object.send(method)
|
9
|
+
|
10
|
+
profile_name = object.class.haraway_assets[method.to_s]
|
11
|
+
profile = Haraway.configuration.profiles[profile_name]
|
12
|
+
accepts = profile.try(:accepted_file_types)
|
13
|
+
accepts = accepts.join(", ") if accepts
|
14
|
+
versions = compile_versions_array(profile)
|
15
|
+
|
16
|
+
<<-HTML
|
17
|
+
|
18
|
+
<x-files single-file profile="#{profile_name}" accept="#{accepts}" name="#{param_key}">
|
19
|
+
<div class="association">#{ title }</div>
|
20
|
+
|
21
|
+
<div class="buttons">
|
22
|
+
<a class="choose">Browse file</a>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="content">
|
26
|
+
<div class="image">#{ asset ? image_html(asset, versions) : "" }</div>
|
27
|
+
<div class="status">
|
28
|
+
<div class="status-title"></div>
|
29
|
+
<div class="status-bar">
|
30
|
+
<div class="upload-bar"></div>
|
31
|
+
<div class="process-bar"></div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<div class="name"></div>
|
35
|
+
</div>
|
36
|
+
</x-files>
|
37
|
+
|
38
|
+
HTML
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def compile_versions_array(profile)
|
43
|
+
if profile
|
44
|
+
versions = profile.versions.keys.map do |key|
|
45
|
+
version = profile.versions[key.to_s]
|
46
|
+
|
47
|
+
OpenStruct.new(
|
48
|
+
name: version.name,
|
49
|
+
params: version.steps.first.try(:[], "params")
|
50
|
+
)
|
51
|
+
end.compact
|
52
|
+
|
53
|
+
else
|
54
|
+
versions = []
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
# return
|
59
|
+
versions
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
def image_html(asset, versions)
|
64
|
+
if versions.select { |v| v.name == "thumb" }.length >= 1
|
65
|
+
asset_url_thumb = asset.url(:thumb)
|
66
|
+
end
|
67
|
+
|
68
|
+
if asset_url_thumb
|
69
|
+
html = "<div class=\"thumb\" style=\"background-image: " +
|
70
|
+
"url(#{ asset_url_thumb });\"></div>"
|
71
|
+
else
|
72
|
+
html = "<div class=\"thumb no-image\"></div>"
|
73
|
+
end
|
74
|
+
|
75
|
+
html
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
data/lib/lalala/version.rb
CHANGED
data/lib/lalala.rb
CHANGED
@@ -37,7 +37,8 @@ module Lalala
|
|
37
37
|
require 'lalala/test'
|
38
38
|
end
|
39
39
|
|
40
|
-
require 'formtastic/inputs/
|
40
|
+
require 'formtastic/inputs/single_file_input'
|
41
|
+
require 'formtastic/inputs/multiple_files_input'
|
41
42
|
require 'formtastic/form_builder_ext'
|
42
43
|
|
43
44
|
autoload :ExtActionDispatch
|
@@ -13,15 +13,16 @@ ActiveAdmin.register Article do
|
|
13
13
|
f.input :body
|
14
14
|
f.input :tags
|
15
15
|
f.input :category, as: :select, collection: %w(A B C)
|
16
|
+
f.input :poster_image, as: :single_file
|
16
17
|
|
17
|
-
f.input :images, as: :
|
18
|
+
f.input :images, as: :multiple_files do |h|
|
18
19
|
h.inputs do
|
19
20
|
h.input :title, as: :string
|
20
21
|
h.input :caption, as: :text
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
f.input :downloads, as: :
|
25
|
+
f.input :downloads, as: :multiple_files do |h|
|
25
26
|
h.inputs do
|
26
27
|
h.input :title, as: :string
|
27
28
|
h.input :category, as: :select, collection: %w(X Y Z)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class Article < ActiveRecord::Base
|
2
|
-
attr_accessible :body, :title, :category, :tag_ids,
|
2
|
+
attr_accessible :body, :title, :category, :tag_ids,
|
3
|
+
:images, :downloads, :poster_image
|
3
4
|
|
4
5
|
# Translations
|
5
6
|
translates :title, :body
|
@@ -8,6 +9,7 @@ class Article < ActiveRecord::Base
|
|
8
9
|
markdown :body
|
9
10
|
|
10
11
|
# Assets
|
12
|
+
has_one_asset :poster_image, :images
|
11
13
|
has_many_assets :images, :images
|
12
14
|
has_many_assets :downloads, :downloads
|
13
15
|
|
@@ -12,10 +12,6 @@ Haraway.configure do |c|
|
|
12
12
|
p.accept "image/*"
|
13
13
|
|
14
14
|
p.version("thumb") do |v|
|
15
|
-
v.resize_to_fill(158, 110)
|
16
|
-
end
|
17
|
-
|
18
|
-
p.version("cover") do |v|
|
19
15
|
v.resize_to_fill(220, 153)
|
20
16
|
end
|
21
17
|
|
@@ -24,6 +20,8 @@ Haraway.configure do |c|
|
|
24
20
|
end
|
25
21
|
end
|
26
22
|
|
27
|
-
c.profile("downloads")
|
23
|
+
c.profile("downloads") do |p|
|
24
|
+
p.accept "*"
|
25
|
+
end
|
28
26
|
|
29
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lalala
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.0.dev.
|
4
|
+
version: 4.1.0.dev.305
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Menke
|
@@ -1295,8 +1295,8 @@ files:
|
|
1295
1295
|
- app/assets/javascripts/browser/screen.module.js
|
1296
1296
|
- app/assets/javascripts/browser/window.module.js
|
1297
1297
|
- app/assets/javascripts/lalala/base.js
|
1298
|
+
- app/assets/javascripts/lalala/initializers/assets.module.js
|
1298
1299
|
- app/assets/javascripts/lalala/initializers/chosen.module.js
|
1299
|
-
- app/assets/javascripts/lalala/initializers/haraway.module.js
|
1300
1300
|
- app/assets/javascripts/lalala/lib/jquery-chosen.js
|
1301
1301
|
- app/assets/javascripts/lalala/lib/jquery-markitup.js
|
1302
1302
|
- app/assets/javascripts/lalala/lib/moment.js
|
@@ -1306,14 +1306,14 @@ files:
|
|
1306
1306
|
- app/assets/javascripts/lalala/modules/collapsible_pages_tree.module.js
|
1307
1307
|
- app/assets/javascripts/lalala/modules/dashboard.module.js
|
1308
1308
|
- app/assets/javascripts/lalala/modules/editor.module.js
|
1309
|
-
- app/assets/javascripts/lalala/modules/file-
|
1310
|
-
- app/assets/javascripts/lalala/modules/file-uploader.module.js
|
1309
|
+
- app/assets/javascripts/lalala/modules/file-metadata.module.js
|
1311
1310
|
- app/assets/javascripts/lalala/modules/helpers.module.js
|
1312
|
-
- app/assets/javascripts/lalala/modules/init.module.js
|
1313
1311
|
- app/assets/javascripts/lalala/modules/locale_chooser.module.js
|
1314
1312
|
- app/assets/javascripts/lalala/modules/login.module.js
|
1315
1313
|
- app/assets/javascripts/lalala/modules/media_selector.module.js
|
1314
|
+
- app/assets/javascripts/lalala/modules/multiple-files-uploader.module.js
|
1316
1315
|
- app/assets/javascripts/lalala/modules/overlay.module.js
|
1316
|
+
- app/assets/javascripts/lalala/modules/single-file-uploader.module.js
|
1317
1317
|
- app/assets/javascripts/lalala/modules/sorted_pages_tree.module.js
|
1318
1318
|
- app/assets/javascripts/lalala/modules/storage.module.js
|
1319
1319
|
- app/assets/stylesheets/lalala/_base.css.scss
|
@@ -1339,8 +1339,7 @@ files:
|
|
1339
1339
|
- app/assets/stylesheets/lalala/modules/_editor-cheatsheet.css.scss
|
1340
1340
|
- app/assets/stylesheets/lalala/modules/_editor-preview.css.scss
|
1341
1341
|
- app/assets/stylesheets/lalala/modules/_editor.css.scss
|
1342
|
-
- app/assets/stylesheets/lalala/modules/_file-
|
1343
|
-
- app/assets/stylesheets/lalala/modules/_file-uploader.css.scss
|
1342
|
+
- app/assets/stylesheets/lalala/modules/_file-metadata.css.scss
|
1344
1343
|
- app/assets/stylesheets/lalala/modules/_filter-form.css.scss
|
1345
1344
|
- app/assets/stylesheets/lalala/modules/_flashes.css.scss
|
1346
1345
|
- app/assets/stylesheets/lalala/modules/_footer.css.scss
|
@@ -1350,9 +1349,11 @@ files:
|
|
1350
1349
|
- app/assets/stylesheets/lalala/modules/_index-footer.css.scss
|
1351
1350
|
- app/assets/stylesheets/lalala/modules/_login.css.scss
|
1352
1351
|
- app/assets/stylesheets/lalala/modules/_media-selector.css.scss
|
1352
|
+
- app/assets/stylesheets/lalala/modules/_multiple-file-uploader.css.scss
|
1353
1353
|
- app/assets/stylesheets/lalala/modules/_panel.css.scss
|
1354
1354
|
- app/assets/stylesheets/lalala/modules/_scopes.css.scss
|
1355
1355
|
- app/assets/stylesheets/lalala/modules/_sidebar-section.css.scss
|
1356
|
+
- app/assets/stylesheets/lalala/modules/_single-file-uploader.css.scss
|
1356
1357
|
- app/assets/stylesheets/lalala/modules/_table-tools.css.scss
|
1357
1358
|
- app/assets/stylesheets/lalala/modules/_title-bar.css.scss
|
1358
1359
|
- app/assets/stylesheets/lalala/modules/_utility-nav.css.scss
|
@@ -1387,7 +1388,8 @@ files:
|
|
1387
1388
|
- lalala-test.gemspec
|
1388
1389
|
- lalala.gemspec
|
1389
1390
|
- lib/formtastic/form_builder_ext.rb
|
1390
|
-
- lib/formtastic/inputs/
|
1391
|
+
- lib/formtastic/inputs/multiple_files_input.rb
|
1392
|
+
- lib/formtastic/inputs/single_file_input.rb
|
1391
1393
|
- lib/generators/lalala/assets/assets_generator.rb
|
1392
1394
|
- lib/generators/lalala/assets/templates/.bowerrc
|
1393
1395
|
- lib/generators/lalala/assets/templates/.jshintrc
|
@@ -1,20 +0,0 @@
|
|
1
|
-
var console = require('browser/console'),
|
2
|
-
calendar = require('lalala/modules/calendar'),
|
3
|
-
editor = require('lalala/modules/editor'),
|
4
|
-
locale_chooser = require("lalala/modules/locale_chooser"),
|
5
|
-
sorted_pages_tree = require("lalala/modules/sorted_pages_tree"),
|
6
|
-
login = require("lalala/modules/login"),
|
7
|
-
dashboard = require("lalala/modules/dashboard"),
|
8
|
-
collapsible_pages_tree = require("lalala/modules/collapsible_pages_tree");
|
9
|
-
|
10
|
-
$(function() {
|
11
|
-
login.init();
|
12
|
-
locale_chooser.init();
|
13
|
-
editor.init();
|
14
|
-
calendar.init();
|
15
|
-
sorted_pages_tree.init();
|
16
|
-
dashboard.init();
|
17
|
-
collapsible_pages_tree.init();
|
18
|
-
|
19
|
-
$('select').not(".bypass-chosen").chosen();
|
20
|
-
});
|