async_futurize 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async_futurize/version.rb +1 -1
- data/vendor/assets/javascripts/futurize.js +46 -46
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c63b2ef9df6d0dcc4efafe3bc8bccc3fd051860c8148a536236c4e71afcf98c5
|
4
|
+
data.tar.gz: c9993ee0111d0ecbee32135237f81bc97ae099ab34663917832d2f07d436f99d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 968ff7005a711e286d545036ac6a321a87b16b026ed7291f1725f673af81ce6f210f4f8ca7edf371a1c5490d048b012439799c51549afddc7d7f8b84abbc8114
|
7
|
+
data.tar.gz: 8fef187c24d73c1b74da4e1ea1907cef8db424b0ab40a36ec69360019ad39822e24cd68b1201258cf49f4bff010b43b41e63a6df94d7def1836d2c3a6dcb37ca
|
@@ -1,50 +1,50 @@
|
|
1
1
|
global.FuturizeComponent = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}
|
2
|
+
init: function (css_selector) {
|
3
|
+
var obj = document.querySelectorAll(css_selector);
|
4
|
+
for (var i in obj) {
|
5
|
+
if (obj.hasOwnProperty(i)) {
|
6
|
+
//console.log(obj[i].getAttribute('data-futurize-component'));
|
7
|
+
this.load_component(obj[i])
|
9
8
|
}
|
10
|
-
},
|
11
|
-
|
12
|
-
reload: function(css_selector) {
|
13
|
-
document.querySelectorAll(css_selector).forEach(function(o) {
|
14
|
-
o.innerHTML = ""
|
15
|
-
})
|
16
|
-
},
|
17
|
-
|
18
|
-
load_component: function (obj) {
|
19
|
-
var component_name = obj.getAttribute('data-futurize-component'),
|
20
|
-
component_params = obj.getAttribute('data-futurize-params');
|
21
|
-
|
22
|
-
if (obj.innerHTML.trim().length <= 0) {
|
23
|
-
obj.innerHTML = 'Loading....';
|
24
|
-
}
|
25
|
-
|
26
|
-
var AUTH_TOKEN = document.querySelector('meta[name=csrf-token]').getAttribute('content');
|
27
|
-
fetch('/home/loadComponent', {
|
28
|
-
mode: 'same-origin',
|
29
|
-
method: 'POST',
|
30
|
-
dataType: 'json',
|
31
|
-
body : JSON.stringify({ component_to_load: component_name, component_params: component_params }),
|
32
|
-
headers: {
|
33
|
-
'Content-Type': 'application/json',
|
34
|
-
'X-CSRF-Token' : AUTH_TOKEN,
|
35
|
-
},
|
36
|
-
})
|
37
|
-
.then(response => response.json())
|
38
|
-
.then(data => {
|
39
|
-
obj.innerHTML = data.html
|
40
|
-
obj.querySelectorAll("script").forEach(function(o) {
|
41
|
-
eval(o.innerHTML)
|
42
|
-
})
|
43
|
-
}).catch((error) => {
|
44
|
-
console.error('Error:', error);
|
45
|
-
});
|
46
9
|
}
|
10
|
+
},
|
11
|
+
|
12
|
+
reload: function(css_selector) {
|
13
|
+
document.querySelectorAll(css_selector).forEach(function(o) {
|
14
|
+
o.innerHTML = ""
|
15
|
+
})
|
16
|
+
},
|
17
|
+
|
18
|
+
load_component: function (obj) {
|
19
|
+
var component_name = obj.getAttribute('data-futurize-component'),
|
20
|
+
component_params = obj.getAttribute('data-futurize-params');
|
21
|
+
|
22
|
+
if (obj.innerHTML.trim().length <= 0) {
|
23
|
+
obj.innerHTML = 'Loading....';
|
24
|
+
}
|
25
|
+
|
26
|
+
var AUTH_TOKEN = document.querySelector('meta[name=csrf-token]').getAttribute('content');
|
27
|
+
fetch('/home/loadComponent', {
|
28
|
+
mode: 'same-origin',
|
29
|
+
method: 'POST',
|
30
|
+
dataType: 'json',
|
31
|
+
body : JSON.stringify({ component_to_load: component_name, component_params: component_params }),
|
32
|
+
headers: {
|
33
|
+
'Content-Type': 'application/json',
|
34
|
+
'X-CSRF-Token' : AUTH_TOKEN,
|
35
|
+
},
|
36
|
+
})
|
37
|
+
.then(response => response.json())
|
38
|
+
.then(data => {
|
39
|
+
obj.innerHTML = data.html
|
40
|
+
obj.querySelectorAll("script").forEach(function(o) {
|
41
|
+
eval(o.innerHTML)
|
42
|
+
})
|
43
|
+
}).catch((error) => {
|
44
|
+
console.error('Error:', error);
|
45
|
+
});
|
47
46
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
}
|
48
|
+
document.addEventListener('DOMContentLoaded', function () {
|
49
|
+
FuturizeComponent.init('[data-futurize-component]');
|
50
|
+
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async_futurize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashesh Tuladhar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Asynchronously load view components.
|
14
14
|
email:
|