This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b:style src="./item.css"/> | |
<b:define name="nestedViewCount" type="bool"/> | |
<b:define name="satelliteName" type="bool"/> | |
<b:define name="namespace" type="bool"/> | |
<div class="basisjs-devpanel-ui-view-item"> | |
<div class="basisjs-devpanel-ui-view-item__title" event-click="toggle" event-mouseenter="enter" event-mouseleave="leave"> | |
<div class="basisjs-devpanel-ui-view-item__expander basisjs-devpanel-ui-view-item__expander_{nestedViewCount}"/> | |
<span class="basisjs-devpanel-ui-view-item__satelliteName basisjs-devpanel-ui-view-item__satelliteName_{satelliteName}"> | |
{satelliteName} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Closure | |
// | |
var a = []; // хранилище истансов, чтобы они не разрушались (не собирались GC) | |
var getClosure = function(a){ return function(b){ return fn(a, b); } }; | |
var t = performance.now(); | |
for (var i = 0; i < 10000; i++) | |
a.push(getClosure(i)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create element with color green | |
var elem = document.createElement('div'); | |
elem.style.color = 'green'; | |
document.body.appendChild(elem); // add to document, to make getComputedStyle/animate works | |
console.log(getComputedStyle(elem).color); // rgb(0, 128, 0) - it's OK! | |
// add animation | |
var player = elem.animate([ | |
{ color: 'red' }, | |
{ color: 'blue' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we could create several effects for node/models and don't affect node/models | |
var source = new basis.data.Dataset({ items: [/* .. */]}); | |
var modified = new basis.data.dataset.Filter({ | |
source: source, | |
ruleEvents: 'rollbackUpdate', | |
rule: 'data.modified' | |
}); | |
var customSet = new basis.data.Dataset(); | |
var view = new basis.ui.Node({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRange(str, start, end){ | |
var lines = str | |
.split('\n') | |
.slice(start.line - 1, end.line); | |
return lines | |
.concat(lines.pop().substr(0, end.column)) | |
.join('\n') | |
.substr(start.column - 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Enum class is proposed future citizen of basis.js | |
// | |
var Value = require('basis.data').Value; | |
var Enum = Value.subclass({ | |
className: 'Enum', | |
init: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chalk = require('chalk'); | |
var readline = require('readline'); | |
var BAR_LENGTH = 40; | |
var lines = 0; | |
function repeatStr(str, len){ | |
return new Array(parseInt(len) + 1).join(str); | |
} | |
function drawBarLine(fill, str){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<body> | |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" style="position: fixed; width: 100%; height: 100%"> | |
<text x="0" y="81" fill="black" stroke="black" font-size="100">A!</text> | |
</svg> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"json": ".bowerrc", | |
"directory": "lib", | |
"name": "my-project", | |
"version": "1.0.0", | |
"dependencies": { | |
"basisjs": "0.9.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basis.require('basis.event'); | |
basis.require('basis.data'); | |
basis.require('basis.net'); | |
basis.net.AbstractRequest.extend({ | |
stateOnAbort: basis.data.STATE.ERROR, | |
emit_abort: function(){ | |
this.emit_failure(); | |
basis.event.events.abort.call(this); | |
} |
OlderNewer