Skip to content

Commit 70e5789

Browse files
committed
- add systemLoaded event to web addon
- fix bug with use of collection in API - update generated documentation
1 parent 5dbd2a8 commit 70e5789

File tree

15 files changed

+387
-296
lines changed

15 files changed

+387
-296
lines changed

addons/web.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
"version": "0.1.0",
44
"description": "Add behaviors for web",
55
"_id": "133421d0c313d2d",
6-
"schemas": {},
6+
"schemas": {
7+
"MonocoSchema": {
8+
"systemLoaded": "event"
9+
},
10+
"Monoco": {
11+
"systemLoaded": {}
12+
}
13+
},
714
"types": {},
815
"behaviors": {
916
"1aaee1e6311ff39": {
@@ -18,7 +25,7 @@
1825
"_id": "1f6001773a18791",
1926
"component": "monoco",
2027
"state": "ready",
21-
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; this.load(system.href, false); } } }",
28+
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; this.load(system.href, false); this.systemLoaded();} } }",
2229
"core": true
2330
}
2431
},

build/monoco-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.js

Lines changed: 96 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.json

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@
44
"description": "A Model and a NoSQL Database for Components",
55
"_id": "e89c617b6b15d24",
66
"schemas": {
7+
"MonocoSchema": {
8+
"systemLoaded": "event",
9+
"_id": "MonocoSchema",
10+
"_name": "MonocoSchema",
11+
"_inherit": [
12+
"MonocoComponentSchema"
13+
],
14+
"_core": true,
15+
"version": "property",
16+
"find": "method",
17+
"load": "method",
18+
"system": "method",
19+
"warning": "event",
20+
"ready": "event"
21+
},
722
"Monoco": {
23+
"systemLoaded": {},
824
"_id": "Monoco",
925
"_name": "Monoco",
1026
"_schema": "MonocoSchema",
@@ -464,20 +480,6 @@
464480
"type": "method",
465481
"create": "method"
466482
},
467-
"MonocoSchema": {
468-
"_id": "MonocoSchema",
469-
"_name": "MonocoSchema",
470-
"_inherit": [
471-
"MonocoComponentSchema"
472-
],
473-
"_core": true,
474-
"version": "property",
475-
"find": "method",
476-
"load": "method",
477-
"system": "method",
478-
"warning": "event",
479-
"ready": "event"
480-
},
481483
"MonocoState": {
482484
"_id": "MonocoState",
483485
"_name": "MonocoState",
@@ -734,170 +736,170 @@
734736
"_id": "1f6001773a18791",
735737
"component": "monoco",
736738
"state": "ready",
737-
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; this.load(system.href, false); } } }",
739+
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; this.load(system.href, false); this.systemLoaded();} } }",
738740
"core": true
739741
},
740-
"1e9821b2a3125de": {
741-
"_id": "1e9821b2a3125de",
742+
"1db2d1b4e619242": {
743+
"_id": "1db2d1b4e619242",
742744
"component": "Monoco",
743745
"state": "error",
744746
"action": "function error(data) { console.error('monoco: ' + data.message, data.error); }",
745747
"core": true
746748
},
747-
"11ced1bb5c189ec": {
748-
"_id": "11ced1bb5c189ec",
749+
"1eb721fcf912afe": {
750+
"_id": "1eb721fcf912afe",
749751
"component": "Monoco",
750752
"state": "find",
751753
"action": "function find(Class, query) { return $component.find(Class, query);}",
752754
"core": true,
753755
"useCoreAPI": true
754756
},
755-
"1eaa91ef7d1aaca": {
756-
"_id": "1eaa91ef7d1aaca",
757+
"102c714a641ecaa": {
758+
"_id": "102c714a641ecaa",
757759
"component": "Monoco",
758760
"state": "system",
759761
"action": "function system(name) { var System = null, system = {}, result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = this.require('MonocoSystem'); system = new System(conf); } else { result = this.find('MonocoSystem', {'master': true}); if (result.length) { system = result[0]; } } return system; }",
760762
"core": true
761763
},
762-
"1ff5011cee13f5e": {
763-
"_id": "1ff5011cee13f5e",
764+
"1e7271a8c314756": {
765+
"_id": "1e7271a8c314756",
764766
"component": "Monoco",
765767
"state": "warning",
766768
"action": "function warning(message) { console.warn('monoco: ' + message); }",
767769
"core": true
768770
},
769-
"11caf178fa134b9": {
770-
"_id": "11caf178fa134b9",
771+
"110a41de0815dab": {
772+
"_id": "110a41de0815dab",
771773
"component": "MonocoChannel",
772774
"state": "listen",
773775
"action": "function listen(event, action) { $channel.listen(event, action); }",
774776
"core": true,
775777
"useCoreAPI": true
776778
},
777-
"16ad41550714670": {
778-
"_id": "16ad41550714670",
779+
"128b312af1127aa": {
780+
"_id": "128b312af1127aa",
779781
"component": "MonocoChannel",
780782
"state": "send",
781783
"action": "function send(message) { return $channel.send(message); }",
782784
"core": true,
783785
"useCoreAPI": true
784786
},
785-
"1d82513ca81cfec": {
786-
"_id": "1d82513ca81cfec",
787+
"1396313e9214352": {
788+
"_id": "1396313e9214352",
787789
"component": "MonocoClassInfo",
788790
"state": "event",
789791
"action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }",
790792
"core": true
791793
},
792-
"14d5511a2e1c2fe": {
793-
"_id": "14d5511a2e1c2fe",
794+
"15184191c9112e3": {
795+
"_id": "15184191c9112e3",
794796
"component": "MonocoClassInfo",
795797
"state": "events",
796798
"action": "function events() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'event') { result.push(item); } } return result; }",
797799
"core": true
798800
},
799-
"15b8a12ba813c2e": {
800-
"_id": "15b8a12ba813c2e",
801+
"145a91494d13499": {
802+
"_id": "145a91494d13499",
801803
"component": "MonocoClassInfo",
802804
"state": "method",
803805
"action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }",
804806
"core": true
805807
},
806-
"19b9a1bc2119ae3": {
807-
"_id": "19b9a1bc2119ae3",
808+
"171691267319632": {
809+
"_id": "171691267319632",
808810
"component": "MonocoClassInfo",
809811
"state": "methods",
810812
"action": "function methods() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'method') { result.push(item); } } return result; }",
811813
"core": true
812814
},
813-
"1d9771924611328": {
814-
"_id": "1d9771924611328",
815+
"1d1aa1c14a1fd7f": {
816+
"_id": "1d1aa1c14a1fd7f",
815817
"component": "MonocoClassInfo",
816818
"state": "properties",
817819
"action": "function properties() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'property') { result.push(item); } } return result; }",
818820
"core": true
819821
},
820-
"182f1179a81d52a": {
821-
"_id": "182f1179a81d52a",
822+
"17c03118d1180c5": {
823+
"_id": "17c03118d1180c5",
822824
"component": "MonocoClassInfo",
823825
"state": "property",
824826
"action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }",
825827
"core": true
826828
},
827-
"18cd51ab241fbe8": {
828-
"_id": "18cd51ab241fbe8",
829+
"1749013e771cc97": {
830+
"_id": "1749013e771cc97",
829831
"component": "MonocoComponent",
830832
"state": "destroy",
831833
"action": "function destroy() { $component.destroy(this.id()); }",
832834
"core": true,
833835
"useCoreAPI": true
834836
},
835-
"1fa9f1557b1c67c": {
836-
"_id": "1fa9f1557b1c67c",
837+
"177a11340c12de7": {
838+
"_id": "177a11340c12de7",
837839
"component": "MonocoComponent",
838840
"state": "off",
839841
"action": "function off(state, behaviorId) { var args = [], i = 0, length = 0; length = arguments.length; for (i = 0; i < length - 7; i++) { args.push(arguments[i]); } if ($workflow.checkParams({\"component\": this, \"methodName\": \"off\", \"args\": args})) { if ($metamodel.isValidState(state, this.constructor.name)) {$behavior.remove({\"behaviorId\": behaviorId, \"componentId\": this.id(), \"state\": state}); } else { $helper.getMonoco().warning({ \"message\":\"invoke 'off' method of component '\" + this.id() + \"' with an invalid state '\" + state + \"'\"}); } } }",
840842
"core": true,
841843
"useCoreAPI": true
842844
},
843-
"1b0d112d88129d5": {
844-
"_id": "1b0d112d88129d5",
845+
"1840a1da96191a6": {
846+
"_id": "1840a1da96191a6",
845847
"component": "MonocoComponent",
846848
"state": "require",
847849
"action": "function require(id) { return $component.get(id); }",
848850
"core": true,
849851
"useCoreAPI": true
850852
},
851-
"1f96711cb01f43a": {
852-
"_id": "1f96711cb01f43a",
853+
"176d81187419117": {
854+
"_id": "176d81187419117",
853855
"component": "MonocoDatabase",
854856
"state": "subsystem",
855857
"action": "function subsystem(params) { return $db.subsystem(params); }",
856858
"core": true,
857859
"useCoreAPI": true
858860
},
859-
"1a7f91f8711a8a6": {
860-
"_id": "1a7f91f8711a8a6",
861+
"161881d4fc1b2ad": {
862+
"_id": "161881d4fc1b2ad",
861863
"component": "MonocoDatabase",
862864
"state": "system",
863865
"action": "function system(system) { return $db.system(system); }",
864866
"core": true,
865867
"useCoreAPI": true
866868
},
867-
"1362b1a251106cb": {
868-
"_id": "1362b1a251106cb",
869+
"1e9ef11e601639a": {
870+
"_id": "1e9ef11e601639a",
869871
"component": "MonocoMetamodel",
870872
"state": "create",
871873
"action": "function create() { $metamodel.create(); }",
872874
"core": true,
873875
"useCoreAPI": true
874876
},
875-
"10d2d17af21b75e": {
876-
"_id": "10d2d17af21b75e",
877+
"17bd2144571287d": {
878+
"_id": "17bd2144571287d",
877879
"component": "MonocoMetamodel",
878880
"state": "schema",
879881
"action": "function schema(schema) { $metamodel.schema(schema); }",
880882
"core": true,
881883
"useCoreAPI": true
882884
},
883-
"1aee51fae51c488": {
884-
"_id": "1aee51fae51c488",
885+
"1156b1d5d511ead": {
886+
"_id": "1156b1d5d511ead",
885887
"component": "MonocoMetamodel",
886888
"state": "type",
887889
"action": "function type(type) { $metamodel.type(type); }",
888890
"core": true,
889891
"useCoreAPI": true
890892
},
891-
"1757c11ec81428a": {
892-
"_id": "1757c11ec81428a",
893+
"1d62c163391a350": {
894+
"_id": "1d62c163391a350",
893895
"component": "MonocoSystem",
894896
"state": "sync",
895897
"action": "function sync() { var dump = $db.dump(); this.schemas(dump.schemas); this.types(dump.types); this.behaviors(dump.behaviors); this.components(dump.components); }",
896898
"core": true,
897899
"useCoreAPI": true
898900
},
899-
"184df1440c14198": {
900-
"_id": "184df1440c14198",
901+
"12cfa18e43188ed": {
902+
"_id": "12cfa18e43188ed",
901903
"component": "e89c617b6b15d24",
902904
"state": "main",
903905
"action": "function main() { var monoco = $component.get('monoco'); monoco.ready(); }",

0 commit comments

Comments
 (0)