atome 0.5.6.6.9 → 0.5.6.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/atome +22 -7
- data/lib/atome/atome.rb +1 -1
- data/lib/atome/extensions/atome.rb +45 -2
- data/lib/atome/genesis/genesis.rb +1 -1
- data/lib/atome/genesis/sparkle.rb +17 -19
- data/lib/atome/kernel/universe.rb +7 -6
- data/lib/atome/utilities/utilities.rb +47 -37
- data/lib/atome/version.rb +1 -1
- data/lib/atome.rb +1 -0
- data/lib/atome_relative.rb +1 -0
- data/lib/molecules/intuition/sliders.rb +31 -45
- data/lib/renderers/html/html.rb +3 -0
- data/vendor/assets/application/examples/affect.rb +1 -1
- data/vendor/assets/application/examples/allow_copy.rb +13 -0
- data/vendor/assets/application/examples/allow_system_right_click.rb +16 -0
- data/vendor/assets/application/examples/alternate.rb +18 -0
- data/vendor/assets/application/examples/js&ruby.rb +8 -21
- data/vendor/assets/application/examples/localstorage.rb +19 -0
- data/vendor/assets/application/examples/matrix.rb +8 -8
- data/vendor/assets/application/examples/sliders.rb +6 -0
- data/vendor/assets/application/examples/test.rb +0 -19
- data/vendor/assets/application/examples/tools.rb +302 -300
- data/vendor/assets/src/index_opal.html +1 -5
- data/vendor/assets/src/index_server.html +13 -18
- data/vendor/assets/src/index_server_wasm.html +1 -6
- data/vendor/assets/src/index_wasm.html +6 -6
- data/vendor/assets/src/js/atome/atome.js +8 -4
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +0 -94
- data/vendor/assets/src/js/atome/specific/opal.js +93 -0
- data/vendor/assets/src/js/atome/specific/wasm.js +99 -7
- metadata +7 -2
@@ -20,12 +20,12 @@
|
|
20
20
|
<script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
|
21
21
|
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
22
22
|
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
<script>
|
24
|
+
// to prevent right click
|
25
|
+
document.addEventListener("contextmenu", function (e) {
|
26
|
+
e.preventDefault();
|
27
|
+
});
|
28
|
+
</script>
|
29
29
|
<title>atome</title>
|
30
30
|
</head>
|
31
31
|
<body id='user_view' class='atome'>
|
@@ -294,8 +294,12 @@ function loadFeature() {
|
|
294
294
|
}
|
295
295
|
}
|
296
296
|
|
297
|
-
|
298
|
-
|
299
|
-
Opal.eval("my_ruby_meth('"+val+"')");
|
300
|
-
Opal.Object.$my_ruby_meth(val);
|
297
|
+
///test methode
|
298
|
+
function my_opal_js_fct(val){
|
299
|
+
Opal.eval("my_ruby_meth('opal call ruby with eval: "+val+"')");
|
300
|
+
Opal.Object.$my_ruby_meth('opal call ruby with method name: '+val);
|
301
|
+
}
|
302
|
+
|
303
|
+
function my_ruby_wasm_js_fct(val){
|
304
|
+
rubyVM.eval("my_ruby_meth('ruby wasm eval: "+val+"')");
|
301
305
|
}
|
@@ -1,98 +1,4 @@
|
|
1
|
-
const communication = {
|
2
|
-
websocket: null,// websocket init for server
|
3
|
-
initialize: function () {
|
4
|
-
this.websocket = new WebSocket('ws://localhost:9292')
|
5
|
-
// this.websocket = new WebSocket(address);
|
6
1
|
|
7
|
-
this.websocket.onopen = function (event) {
|
8
|
-
rubyVMCallback("puts 'Connected to WebSocket'")
|
9
|
-
};
|
10
|
-
|
11
|
-
this.websocket.onmessage = function (event) {
|
12
|
-
rubyVMCallback('message', "('" + event.data + "')")
|
13
|
-
};
|
14
|
-
|
15
|
-
this.websocket.onclose = function (event) {
|
16
|
-
rubyVMCallback("puts 'WebSocket closed'")
|
17
|
-
|
18
|
-
};
|
19
|
-
|
20
|
-
this.websocket.onerror = function (event) {
|
21
|
-
// to prevent error disturbing the console
|
22
|
-
event.preventDefault();
|
23
|
-
console.log('connection lost!')
|
24
|
-
};
|
25
|
-
},// Controller for native core
|
26
|
-
controller_sender: function (msg) {
|
27
|
-
let json_msg = JSON.parse(msg);
|
28
|
-
|
29
|
-
if (window.webkit) {
|
30
|
-
try {
|
31
|
-
window.webkit.messageHandlers.wkHandler.postMessage(json_msg);
|
32
|
-
} catch (error) {
|
33
|
-
console.log('no server, unable to post message')
|
34
|
-
}
|
35
|
-
|
36
|
-
} else {
|
37
|
-
try {
|
38
|
-
window.chrome.webview.postMessage(json_msg);
|
39
|
-
} catch (error) {
|
40
|
-
console.log('no server, unable to post message')
|
41
|
-
}
|
42
|
-
}
|
43
|
-
},
|
44
|
-
controller_listener: function () {
|
45
|
-
if (window.webkit) {
|
46
|
-
try {
|
47
|
-
///
|
48
|
-
} catch (error) {
|
49
|
-
console.log('no server, unable to receive message')
|
50
|
-
}
|
51
|
-
} else {
|
52
|
-
|
53
|
-
try {
|
54
|
-
window.chrome.webview.addEventListener('message', arg => {
|
55
|
-
Opal.Object.$response_listener(arg.data)
|
56
|
-
});
|
57
|
-
} catch (error) {
|
58
|
-
console.log('no server, unable to receive message')
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
},
|
64
|
-
connect: function (type, server, user, pass, atomes, particles) {
|
65
|
-
// websocket for server
|
66
|
-
this.websocket = new WebSocket(type + '://' + server);
|
67
|
-
this.websocket.onopen = function (event) {
|
68
|
-
|
69
|
-
// now new can exec user code : loadApplicationJs in index.html
|
70
|
-
loadApplicationJs();
|
71
|
-
// rubyVMCallback("A.user_login");
|
72
|
-
};
|
73
|
-
this.websocket.onmessage = function (event) {
|
74
|
-
// console.log(event.data)
|
75
|
-
rubyVMCallback("A.server_receiver(" + event.data + ")");
|
76
|
-
};
|
77
|
-
|
78
|
-
this.websocket.onclose = function (event) {
|
79
|
-
rubyVMCallback("puts 'WebSocket closed'")
|
80
|
-
|
81
|
-
};
|
82
|
-
|
83
|
-
this.websocket.onerror = function (event) {
|
84
|
-
// to prevent error disturbing the console
|
85
|
-
event.preventDefault();
|
86
|
-
console.log('connection lost!')
|
87
|
-
};
|
88
|
-
|
89
|
-
},
|
90
|
-
ws_sender: function (message) {
|
91
|
-
// now we send the data to the server
|
92
|
-
// puts "--> message : #{message}"
|
93
|
-
this.websocket.send(message)
|
94
|
-
},
|
95
|
-
}
|
96
2
|
|
97
3
|
/////////////////////////// connection ws
|
98
4
|
|
@@ -1,3 +1,96 @@
|
|
1
1
|
function rubyVMCallback(rubycode) {
|
2
2
|
Opal.eval(rubycode);
|
3
3
|
}
|
4
|
+
|
5
|
+
|
6
|
+
function controller_message(msg) {
|
7
|
+
Opal.Object.$receptor(msg);
|
8
|
+
}
|
9
|
+
|
10
|
+
|
11
|
+
function loadApplicationJs() {
|
12
|
+
var script = document.createElement('script');
|
13
|
+
script.src = 'js/application.js';
|
14
|
+
script.onload = function() {
|
15
|
+
Opal.Object.$init_database();
|
16
|
+
};
|
17
|
+
document.body.appendChild(script);
|
18
|
+
}
|
19
|
+
|
20
|
+
window.addEventListener('load', function () {
|
21
|
+
Opal.Object.$atome_genesis();
|
22
|
+
|
23
|
+
})
|
24
|
+
|
25
|
+
|
26
|
+
const communication = {
|
27
|
+
controller_sender: function (msg) {
|
28
|
+
let json_msg = JSON.parse(msg);
|
29
|
+
|
30
|
+
if (window.webkit) {
|
31
|
+
try {
|
32
|
+
window.webkit.messageHandlers.wkHandler.postMessage(json_msg);
|
33
|
+
} catch (error) {
|
34
|
+
console.log('no server, unable to post message')
|
35
|
+
}
|
36
|
+
|
37
|
+
} else {
|
38
|
+
try {
|
39
|
+
window.chrome.webview.postMessage(json_msg);
|
40
|
+
} catch (error) {
|
41
|
+
console.log('no server, unable to post message')
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
controller_listener: function () {
|
46
|
+
if (window.webkit) {
|
47
|
+
try {
|
48
|
+
///
|
49
|
+
} catch (error) {
|
50
|
+
console.log('no server, unable to receive message')
|
51
|
+
}
|
52
|
+
} else {
|
53
|
+
|
54
|
+
try {
|
55
|
+
window.chrome.webview.addEventListener('message', arg => {
|
56
|
+
Opal.Object.$response_listener(arg.data)
|
57
|
+
});
|
58
|
+
} catch (error) {
|
59
|
+
console.log('no server, unable to receive message')
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
}
|
64
|
+
},
|
65
|
+
connect: function (type, server, user, pass, atomes, particles) {
|
66
|
+
// websocket for server
|
67
|
+
this.websocket = new WebSocket(type + '://' + server);
|
68
|
+
this.websocket.onopen = function (event) {
|
69
|
+
|
70
|
+
// now new can exec user code : loadApplicationJs in index.html
|
71
|
+
loadApplicationJs();
|
72
|
+
// rubyVMCallback("A.user_login");
|
73
|
+
};
|
74
|
+
this.websocket.onmessage = function (event) {
|
75
|
+
Opal.eval("Atome.server_receiver(" + event.data + ")");
|
76
|
+
// Opal.Atome.$server_receiver(event.data);
|
77
|
+
};
|
78
|
+
|
79
|
+
this.websocket.onclose = function (event) {
|
80
|
+
console.log("puts 'WebSocket closed'")
|
81
|
+
|
82
|
+
};
|
83
|
+
|
84
|
+
this.websocket.onerror = function (event) {
|
85
|
+
// to prevent error disturbing the console
|
86
|
+
event.preventDefault();
|
87
|
+
console.log('connection lost!')
|
88
|
+
};
|
89
|
+
|
90
|
+
},
|
91
|
+
ws_sender: function (message) {
|
92
|
+
// now we send the data to the server
|
93
|
+
// puts "--> message : #{message}"
|
94
|
+
this.websocket.send(message)
|
95
|
+
},
|
96
|
+
}
|
@@ -2,11 +2,103 @@ function rubyVMCallback(rubycode) {
|
|
2
2
|
rubyVM.eval(rubycode);
|
3
3
|
}
|
4
4
|
|
5
|
+
function controller_message(msg) {
|
6
|
+
rubyVM.eval(rubycode);
|
7
|
+
}
|
8
|
+
|
9
|
+
|
10
|
+
const communication = {
|
11
|
+
// websocket: null,// websocket init for server
|
12
|
+
// initialize: function () {
|
13
|
+
// this.websocket = new WebSocket('ws://localhost:9292')
|
14
|
+
// // this.websocket = new WebSocket(address);
|
15
|
+
//
|
16
|
+
// this.websocket.onopen = function (event) {
|
17
|
+
// rubyVM.eval("puts 'Connected to WebSocket'")
|
18
|
+
// };
|
19
|
+
//
|
20
|
+
// this.websocket.onmessage = function (event) {
|
21
|
+
// rubyVM.eval('message', "('" + event.data + "')")
|
22
|
+
// };
|
23
|
+
//
|
24
|
+
// this.websocket.onclose = function (event) {
|
25
|
+
// rubyVM.eval("puts 'WebSocket closed'")
|
26
|
+
//
|
27
|
+
// };
|
28
|
+
//
|
29
|
+
// this.websocket.onerror = function (event) {
|
30
|
+
// // to prevent error disturbing the console
|
31
|
+
// event.preventDefault();
|
32
|
+
// console.log('connection lost!')
|
33
|
+
// };
|
34
|
+
// },// Controller for native core
|
35
|
+
controller_sender: function (msg) {
|
36
|
+
let json_msg = JSON.parse(msg);
|
37
|
+
|
38
|
+
if (window.webkit) {
|
39
|
+
try {
|
40
|
+
window.webkit.messageHandlers.wkHandler.postMessage(json_msg);
|
41
|
+
} catch (error) {
|
42
|
+
console.log('no server, unable to post message')
|
43
|
+
}
|
44
|
+
|
45
|
+
} else {
|
46
|
+
try {
|
47
|
+
window.chrome.webview.postMessage(json_msg);
|
48
|
+
} catch (error) {
|
49
|
+
console.log('no server, unable to post message')
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
controller_listener: function () {
|
54
|
+
if (window.webkit) {
|
55
|
+
try {
|
56
|
+
///
|
57
|
+
} catch (error) {
|
58
|
+
console.log('no server, unable to receive message')
|
59
|
+
}
|
60
|
+
} else {
|
61
|
+
|
62
|
+
try {
|
63
|
+
window.chrome.webview.addEventListener('message', arg => {
|
64
|
+
Opal.Object.$response_listener(arg.data)
|
65
|
+
});
|
66
|
+
} catch (error) {
|
67
|
+
console.log('no server, unable to receive message')
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
}
|
72
|
+
},
|
73
|
+
connect: function (type, server, user, pass, atomes, particles) {
|
74
|
+
// websocket for server
|
75
|
+
this.websocket = new WebSocket(type + '://' + server);
|
76
|
+
this.websocket.onopen = function (event) {
|
77
|
+
|
78
|
+
// now new can exec user code : loadApplicationJs in index.html
|
79
|
+
loadApplicationJs();
|
80
|
+
// rubyVM.eval("A.user_login");
|
81
|
+
};
|
82
|
+
this.websocket.onmessage = function (event) {
|
83
|
+
// console.log(event.data)
|
84
|
+
rubyVM.eval("A.server_receiver(" + event.data + ")");
|
85
|
+
};
|
86
|
+
|
87
|
+
this.websocket.onclose = function (event) {
|
88
|
+
rubyVM.eval("puts 'WebSocket closed'")
|
89
|
+
|
90
|
+
};
|
91
|
+
|
92
|
+
this.websocket.onerror = function (event) {
|
93
|
+
// to prevent error disturbing the console
|
94
|
+
event.preventDefault();
|
95
|
+
console.log('connection lost!')
|
96
|
+
};
|
5
97
|
|
6
|
-
|
7
|
-
|
8
|
-
//
|
9
|
-
//
|
10
|
-
|
11
|
-
|
12
|
-
|
98
|
+
},
|
99
|
+
ws_sender: function (message) {
|
100
|
+
// now we send the data to the server
|
101
|
+
// puts "--> message : #{message}"
|
102
|
+
this.websocket.send(message)
|
103
|
+
},
|
104
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.6.
|
4
|
+
version: 0.5.6.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Eric Godard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: artoo
|
@@ -528,6 +528,9 @@ files:
|
|
528
528
|
- vendor/assets/Rakefile
|
529
529
|
- vendor/assets/application/examples/affect.rb
|
530
530
|
- vendor/assets/application/examples/aid.rb
|
531
|
+
- vendor/assets/application/examples/allow_copy.rb
|
532
|
+
- vendor/assets/application/examples/allow_system_right_click.rb
|
533
|
+
- vendor/assets/application/examples/alternate.rb
|
531
534
|
- vendor/assets/application/examples/animation.rb
|
532
535
|
- vendor/assets/application/examples/apply.rb
|
533
536
|
- vendor/assets/application/examples/atome.rb
|
@@ -587,6 +590,7 @@ files:
|
|
587
590
|
- vendor/assets/application/examples/js&ruby.rb
|
588
591
|
- vendor/assets/application/examples/keyboard.rb
|
589
592
|
- vendor/assets/application/examples/layout.rb
|
593
|
+
- vendor/assets/application/examples/localstorage.rb
|
590
594
|
- vendor/assets/application/examples/login.rb
|
591
595
|
- vendor/assets/application/examples/markup.rb
|
592
596
|
- vendor/assets/application/examples/match.rb
|
@@ -618,6 +622,7 @@ files:
|
|
618
622
|
- vendor/assets/application/examples/shapes.rb
|
619
623
|
- vendor/assets/application/examples/shortcut.rb
|
620
624
|
- vendor/assets/application/examples/size.rb
|
625
|
+
- vendor/assets/application/examples/sliders.rb
|
621
626
|
- vendor/assets/application/examples/smooth.rb
|
622
627
|
- vendor/assets/application/examples/style.rb
|
623
628
|
- vendor/assets/application/examples/sub_atome_manipulation.rb
|