Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
destroy: function(){
this.target.destroy();
}
}
});
//
// Main view
//
module.exports = new Node({
template: resource('./template/list.tmpl'),
binding: {
hidden: count(Todo.all).as(basis.bool.invert),
noActive: count(Todo.active).as(basis.bool.invert)
},
action: {
toggleCompletedForAll: function(event){
var dataset = event.sender.checked ? Todo.active : Todo.completed;
// invert completed flag for dataset members
dataset.forEach(function(item){
item.update({
completed: !item.data.completed
});
});
}
},
sorting: 'data.id', // shortcut for function(child){ return child.data.id }
sortingDesc: true,
title: 'Completed'
}
]
});
//
// panel
//
module.exports = new Node({
template: resource('./template/footer.tmpl'),
binding: {
filters: filters,
hidden: count(Todo.all).as(basis.bool.invert),
completed: count(Todo.completed),
active: count(Todo.active)
},
action: {
clearCompleted: function(){
Todo.completed.forEach(function(item){
item.destroy();
});
}
}
});
var count = require('basis.data.index').count;
var Warning = require('type').Warning;
module.exports = {
caption: 'Warnings',
view: resource('./view/index.js'),
template: resource('./tab.tmpl'),
binding: {
count: count(Warning.all)
}
};
count: function(node){
return count(node.dataset || node.delegate);
}
},
hasWarnings: count(Warning.all)
},
dataSource: warningsByType,
childClass: StatItem,
sorting: 'data.title',
selection: true,
satellite: {
total: {
delegate: basis.fn.$self,
instance: new StatItem({
dataset: Warning.all,
caption: 'Total'
})
},
fatal: {
existsIf: count(fatalWarnings),
delegate: basis.fn.$self,
instance: new StatItem({
dataset: fatalWarnings,
caption: 'Fatal',
fatal: true
})
}
}
});
StatItem.prototype.contextSelection = stat.selection;
Value.query(stat, 'selection.pick()').link(stat.selection, function(selected){
if (!selected)
this.set([stat.satellite.total]);
});
function processMessage(node){
}
});
var templates = require('basis.template').define('devpanel.ui', {
view: resource('./template/view.tmpl')
});
require('basis.template').theme('standalone').define('devpanel.ui', {
view: resource('./template/standalone.tmpl')
});
module.exports = Node.subclass({
disabled: api.connected.as(basis.bool.invert),
template: templates.view,
binding: {
connected: api.connected,
instanceCount: count(instances),
withLoc: count(instances, 'data.loc')
},
dataSource: splitByParent.getSubset(null, true),
childClass: ViewNode,
childFactory: function(config){
return map.resolve(config.delegate);
},
sorting: 'data.id',
init: function(){
Node.prototype.init.call(this);
uiApi.channel.link(this, processData);
api.connected.link(this, function(connected){
if (connected)
nestedViewCount: function(node){
return count(node.subset);
}
},
delegate: instanceMap[this.data.grouping]
});
},
destroy: function(){
this.subset = null;
Node.prototype.destroy.call(this);
}
});
new Node({
container: document.body,
template: resource('./template/view.tmpl'),
binding: {
instanceCount: count(uiInfo.instances),
withLoc: count(uiInfo.instances, 'data.loc')
},
childClass: ViewNode,
dataSource: splitByParent.getSubset(null, true),
sorting: 'data.id'
});
},
count: {
events: 'delegateChanged',
getter: function(node){
return count(node.dataset || node.delegate);
}
}
}
});
var stat = new Node({
template: resource('./template/stat.tmpl'),
binding: {
total: 'satellite:',
fatal: 'satellite:',
hasWarnings: count(Warning.all)
},
dataSource: warningsByType,
childClass: StatItem,
sorting: 'data.title',
selection: true,
satellite: {
total: {
delegate: basis.fn.$self,
instance: new StatItem({
dataset: Warning.all,
caption: 'Total'
})
},
fatal: {
existsIf: count(fatalWarnings),
delegate: basis.fn.$self,
var Value = require('basis.data').Value;
var count = require('basis.data.index').count;
var TabControl = require('basis.ui.tabs').TabControl;
module.exports = TabControl.subclass({
autoDelegate: true,
dataSource: Value.query('data.files'),
template: resource('./template/list.tmpl'),
binding: {
hasChanges: count(Value.query('data.files'), 'rollbackUpdate', 'modified')
},
action: {
resetSlides: function(){
this.data.files.forEach(function(file){
file.rollback();
});
}
},
childClass: {
active: true,
template: resource('./template/item.tmpl'),
binding: {
name: Value.query('data.filename').as(basis.path.basename),
modified: Value.query('target.modified').as(Boolean)
}