132 } |
132 } |
133 |
133 |
134 | "«@id»": new «$widget/@type»Widget ("«@id»",«$freq»,[«$args»],[«$variables»],«$enable_expr»,{ |
134 | "«@id»": new «$widget/@type»Widget ("«@id»",«$freq»,[«$args»],[«$variables»],«$enable_expr»,{ |
135 if "$widget/@enable_expr" { |
135 if "$widget/@enable_expr" { |
136 |
136 |
137 | assignments: [], |
137 | enable_assignments: [], |
138 | compute_enable: function(value, oldval, varnum) { |
138 | compute_enable: function(value, oldval, varnum) { |
139 | let result = false; |
139 | let result = false; |
140 | do { |
140 | do { |
141 foreach "$widget/path" { |
141 foreach "$widget/path" { |
142 const "varid","generate-id()"; |
142 const "varid","generate-id()"; |
143 const "varnum","position()-1"; |
143 const "varnum","position()-1"; |
144 if "@assign" foreach "$widget/path[@assign]" if "$varid = generate-id()" { |
144 if "@assign" foreach "$widget/path[@assign]" if "$varid = generate-id()" { |
145 | if(varnum == «$varnum») this.assignments[«position()-1»] = value; |
145 | if(varnum == «$varnum») this.enable_assignments[«position()-1»] = value; |
146 | let «@assign» = this.assignments[«position()-1»]; |
146 | let «@assign» = this.enable_assignments[«position()-1»]; |
147 | if(«@assign» == undefined) break; |
147 | if(«@assign» == undefined) break; |
148 } |
148 } |
149 } |
149 } |
150 | result = «$widget/@enable_expr»; |
150 | result = «$widget/@enable_expr»; |
151 | } while(0); |
151 | } while(0); |