cavalion-vcl 1.1.47 → 1.1.48
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.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
align: "client",
|
|
5
5
|
onNodeCreated() {
|
|
6
6
|
var uri = this.vars("uri") || js.sf("%s<%s>", this.getSpecializer(), this.vars("specializer") || this._name);
|
|
7
|
+
var onLoad = this.vars("onLoad");
|
|
7
8
|
require("B").instantiate(uri, { owner: this }).then(_ => {
|
|
8
9
|
_.setParent(this); // TODO why can't this be in property decl?
|
|
10
|
+
if(onLoad) {
|
|
11
|
+
onLoad.apply(this, [_]);
|
|
12
|
+
}
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
15
|
}];
|
|
@@ -17,6 +17,7 @@ var Handlers = {
|
|
|
17
17
|
form_scope = form.getScope();
|
|
18
18
|
if(name === "formload" && !form_scope.left) {
|
|
19
19
|
root_scope.description.revertPropertyValue("content");
|
|
20
|
+
// root_scope.description.setContent(form.vars(["description"]) || (form.qs("#description") || {})._content);
|
|
20
21
|
// console.log(js.sf("%n / description set to: %s", root_scope.description, root_scope.description._content));
|
|
21
22
|
}
|
|
22
23
|
if(form_scope.left && form_scope.left._uri.endsWith("prototypes/ui/forms/View")) {
|
|
@@ -104,6 +105,7 @@ var Handlers = {
|
|
|
104
105
|
form_scope = form.getScope();
|
|
105
106
|
if(name === "formload" && !form_scope.left) {
|
|
106
107
|
root_scope.description.revertPropertyValue("content");
|
|
108
|
+
// /*!!!*/root_scope.description.setContent("--reverted1--");
|
|
107
109
|
}
|
|
108
110
|
if(form_scope.left && form_scope.left._uri.endsWith("prototypes/ui/forms/View")) {
|
|
109
111
|
if(name === "formload") {
|
|
@@ -195,6 +197,7 @@ var Handlers = {
|
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
scope.description.revertPropertyValue("content");
|
|
200
|
+
// /*!!!*/scope.description.setContent("--reverted2--");
|
|
198
201
|
// console.log(js.sf("%n / description set to: %s", scope.description, scope.description._content));
|
|
199
202
|
|
|
200
203
|
// Is there a node selected?
|
package/src/ui/Form.js
CHANGED
|
@@ -27,7 +27,7 @@ define(function(require) {
|
|
|
27
27
|
_onReflectHash: null,
|
|
28
28
|
|
|
29
29
|
onshow: function() {
|
|
30
|
-
/**
|
|
30
|
+
/** @overrides ../Control.prototype.onshow */
|
|
31
31
|
if(this.fire("onShow", arguments) !== false) {
|
|
32
32
|
var me = this;
|
|
33
33
|
(function() {
|
|
@@ -43,12 +43,12 @@ define(function(require) {
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
onhide: function() {
|
|
46
|
-
/**
|
|
46
|
+
/** @overrides ../Control.prototype.onhide */
|
|
47
47
|
if(this.fire("onHide", arguments) !== false) {
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
visibleChanged: function() {
|
|
51
|
-
/**
|
|
51
|
+
/** @overrides ../Control.prototype.visibleChanged */
|
|
52
52
|
var r = this.inherited(arguments);
|
|
53
53
|
|
|
54
54
|
if(this.isVisible()) {
|
package/vcl-comps/Navigator.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"locale, vcl/ui/Node";
|
|
2
|
-
|
|
3
|
-
var Node = require("vcl/ui/Node");
|
|
4
|
-
|
|
5
|
-
var locale = window.locale;
|
|
6
|
-
|
|
7
|
-
var styles = {
|
|
8
|
-
|
|
9
|
-
"#search-panel": "padding: 4px 6px;",
|
|
10
|
-
"#search": "padding: 4px; width: 100%; border-radius: 5px; border: 1px solid #f0f0f0;"
|
|
11
|
-
};
|
|
12
|
-
var handlers = {
|
|
13
|
-
"loaded": function() {
|
|
14
|
-
var scope = this.scope();
|
|
15
|
-
|
|
16
|
-
scope.tree.refresh();
|
|
17
|
-
|
|
18
|
-
// var arr = scope.nodes._array;
|
|
19
|
-
// scope.nodes.setArray(null);
|
|
20
|
-
// scope.nodes.setArray(arr);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var letters = "aaaaaabbccdddeeeeeeeeefgghiiijjkklllmmnnnnnnoooooppqrrssttuuuuuvvwxyzzz";
|
|
25
|
-
function randomWord() {
|
|
26
|
-
var n = Math.random() * 10;
|
|
27
|
-
if(n > 7) {
|
|
28
|
-
n += Math.random() * 5;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
n = parseInt(n) + 1;
|
|
32
|
-
|
|
33
|
-
var r = "", p;
|
|
34
|
-
while(n-- >= 0) {
|
|
35
|
-
p = parseInt(Math.random() * letters.length);
|
|
36
|
-
r += letters.substring(p, p + 1);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return r.substring(0, 1).toUpperCase() + r.substring(1);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function Node_render() {
|
|
43
|
-
/**
|
|
44
|
-
* @overrides Node.prototype.render
|
|
45
|
-
*/
|
|
46
|
-
var record = this._vars.record;
|
|
47
|
-
// this._nodes.text.innerHTML =
|
|
48
|
-
this._nodes.icon.innerHTML = String.format("<i class='fa fa-%s'></i>", record.icon);
|
|
49
|
-
this._nodes.text.textContent = record.text;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var ID = 7;
|
|
53
|
-
|
|
54
|
-
$("vcl/ui/Form", { css: styles, handlers: handlers }, [
|
|
55
|
-
|
|
56
|
-
$("vcl/ui/Panel#search-panel", { align: "top", autoSize: "height" }, [
|
|
57
|
-
$("vcl/ui/Input#search")
|
|
58
|
-
]),
|
|
59
|
-
|
|
60
|
-
$("vcl/data/Array#nodes", {
|
|
61
|
-
array: [
|
|
62
|
-
{ id: 1, parent: 0, text: locale("Root"), icon: "home" },
|
|
63
|
-
{ id: 2, parent: 1, text: locale("Sub1") },
|
|
64
|
-
{ id: 3, parent: 1, text: locale("Sub2") },
|
|
65
|
-
{ id: 4, parent: 1, text: locale("Sub3 ++ ") },
|
|
66
|
-
{ id: 6, parent: 4, text: "Sub3.1" },
|
|
67
|
-
{ id: 5, parent: 1, text: locale("Sub4") }
|
|
68
|
-
]
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
$("vcl/ui/Tree#tree", { align: "left", width: 300,
|
|
72
|
-
onSelectionChange: function() {
|
|
73
|
-
// this.scope().console.print("selectionchange", arguments);
|
|
74
|
-
},
|
|
75
|
-
onNodesNeeded: function(parent) {
|
|
76
|
-
var scope = this.scope(), owner = this._owner;
|
|
77
|
-
|
|
78
|
-
if(parent === null) {
|
|
79
|
-
parent = this;
|
|
80
|
-
scope.nodes.getArray().forEach(function(record) {
|
|
81
|
-
if(record.parent === 0) {
|
|
82
|
-
node = new Node(owner);
|
|
83
|
-
node.render = Node_render;
|
|
84
|
-
node.setVar("record", record);
|
|
85
|
-
node.setExpandable(true);
|
|
86
|
-
node.setParent(parent);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
var parentId = parent.getVar("record.id");
|
|
91
|
-
parent.setExpandable(false);
|
|
92
|
-
// parent.addClass("loading");
|
|
93
|
-
setTimeout(function() {
|
|
94
|
-
parent.setExpandable(true);
|
|
95
|
-
parent.removeClass("loading");
|
|
96
|
-
for(var i = 0; i < 2 + Math.random() * 20; ++i) {
|
|
97
|
-
var record = {text: randomWord(), id: ID++};
|
|
98
|
-
|
|
99
|
-
node = new Node(owner);
|
|
100
|
-
node.render = Node_render;
|
|
101
|
-
node.setVar("record", record);
|
|
102
|
-
node.setExpandable(true);
|
|
103
|
-
node.setParent(parent);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}, Math.round(Math.random() * 500));
|
|
107
|
-
}
|
|
108
|
-
} }),//, source: "#nodes" }),
|
|
109
|
-
|
|
110
|
-
$("vcl/ui/List", { autoColumns: true, align: "client", source: "nodes" }),
|
|
111
|
-
|
|
112
|
-
$("vcl/ui/Console#console", { align: "bottom", height: 200, onEvaluate: function(expr) { var scope = this.scope(); return eval(expr); }})
|
|
113
|
-
|
|
114
|
-
]);
|