blacklight-spotlight 2.6.1 → 2.6.1.1
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/spotlight/block_mixins/formable.js +15 -13
- data/lib/spotlight/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d99e741c6d655545a5e60834cd1303cff3bdb8a91f664b616e50203f877775bf
|
|
4
|
+
data.tar.gz: c5c5e37f19b4c210ad669417472efb886c4108d09dad793083daa0383fd31808
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97065dbe90e1d70dc6b5e25fa54e0e0059b1a1cf18020edb39725042e69ad1888d46fb941fb388dafde971d52bcd04928e74f708772f6c2ccdb16c35e37c4cbf
|
|
7
|
+
data.tar.gz: c7caa256cfb6bba53f6dd4bc3bdd989bdbdc0e9f1ba722405a2d5d5fbadfeeaba4a283915aebca3a113ce1c08101b15fb35331909743a386f005afc9e50b50d2
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
preload: true,
|
|
5
5
|
|
|
6
6
|
initializeFormable: function() {
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
if (_.isUndefined(this['afterLoadData'])) {
|
|
9
9
|
this['afterLoadData'] = function(data) { };
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
formId: function(id) {
|
|
14
14
|
return this.blockID + "_" + id;
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
_serializeData: function() {
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
var data = $(":input,textarea,select", this.inner).not(':input:radio').serializeJSON();
|
|
20
20
|
|
|
21
21
|
$(':input:radio:checked', this.inner).each(function(index, input) {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
if (this.hasTextBlock()) {
|
|
31
31
|
data.text = this.getTextBlockHTML();
|
|
32
32
|
data.format = 'html';
|
|
33
|
-
if (data.text.length > 0 && this.options.convertToMarkdown) {
|
|
33
|
+
if (data.text && data.text.length > 0 && this.options.convertToMarkdown) {
|
|
34
34
|
data.text = stToMarkdown(data.text, this.type);
|
|
35
35
|
data.format = 'markdown';
|
|
36
36
|
}
|
|
@@ -38,27 +38,29 @@
|
|
|
38
38
|
|
|
39
39
|
return data;
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
loadData: function(data){
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
if (this.hasTextBlock()) {
|
|
44
|
+
if (data.text && data.text.length > 0 && this.options.convertFromMarkdown && data.format !== "html") {
|
|
45
|
+
this.setTextBlockHTML(SirTrevor.toHTML(data.text, this.type));
|
|
46
|
+
} else {
|
|
47
|
+
this.setTextBlockHTML(data.text);
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
this.loadFormDataByKey(data);
|
|
49
51
|
this.afterLoadData(data);
|
|
50
52
|
},
|
|
51
|
-
|
|
53
|
+
|
|
52
54
|
loadFormDataByKey: function(data) {
|
|
53
55
|
$(':input', this.inner).not('button,:input[type=hidden]').each(function(index, input) {
|
|
54
56
|
var key = $(input).data('key') || input.getAttribute('name');
|
|
55
57
|
|
|
56
58
|
if (key) {
|
|
57
|
-
|
|
59
|
+
|
|
58
60
|
if (key.match("\\[\\]$")) {
|
|
59
61
|
key = key.replace("[]", "");
|
|
60
62
|
}
|
|
61
|
-
|
|
63
|
+
|
|
62
64
|
// by wrapping it in an array, this'll "just work" for radio and checkbox fields too
|
|
63
65
|
var input_data = data[key];
|
|
64
66
|
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
});
|
|
71
73
|
},
|
|
72
74
|
},
|
|
73
|
-
|
|
75
|
+
|
|
74
76
|
|
|
75
77
|
SirTrevor.Block.prototype.availableMixins.push("formable");
|
|
76
78
|
})(jQuery);
|
data/lib/spotlight/version.rb
CHANGED