Skip to content

Commit acf08a8

Browse files
committed
working on hlisp
1 parent b0247d1 commit acf08a8

11 files changed

+4275
-779
lines changed

_includes/declarify.attrlib.js

+8
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@
99
elem[(val ? "add" : "remove") + "Class"](classname);
1010
});
1111

12+
$UI.m.dep("log", function attrlib_text(elem, val, tag) {
13+
console.log(tag+":", val);
14+
});
15+
16+
$UI.attr("data-hide", function(elem, ini, fin, op) {
17+
$(elem)[fin ? "hide" : "show"]();
18+
});
19+
1220
})();

_includes/declarify.dep.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@
2222
return;
2323

2424
map(function(x) {
25+
var action = dep.tfdAttrMap()[x],
26+
same = {},
27+
opts = { "$val" : ref.attr(attr) };
28+
29+
if (action["if"] && ! dep.tfdEval(action["if"], ref, same, opts))
30+
return;
31+
32+
delete action["if"];
33+
2534
map(function(y) {
26-
var same = {},
27-
opts = { "$val" : ref.attr(attr) },
28-
expr = dep.tfdEval(y[1], ref, same, opts),
35+
var expr = dep.tfdEval(y[1], ref, same, opts),
2936
tmp;
3037
if (expr !== same) {
3138
if (y[0] in mods)
@@ -37,7 +44,7 @@
3744
} else
3845
dep.attr("data-"+y[0], expr);
3946
}
40-
}, outof(dep.tfdAttrMap()[x]));
47+
}, outof(action));
4148
}, depset.split(" "));
4249
}
4350

@@ -52,7 +59,7 @@
5259

5360
$.fn.tfdEval = function(expr, ref, same, opts) {
5461
var env = {
55-
"$this": this,
62+
"$this": this.tfdAsMap(),
5663
"$same": same,
5764
"$$": $(ref).tfdAsMapFn()
5865
};

0 commit comments

Comments
 (0)