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
/** | |
* Заполняет массив значениями value, любой размерности | |
* @example [].field(null, 2,2) в результате получим [[null,null], [null,null]] | |
* @param value значение которым нужно заполнить массив | |
* @returns {Array} | |
*/ | |
Array.prototype.field = function field(value) { | |
var array = [], | |
nextDimensions = [].slice.call(arguments,2); |
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 observable(obj) { | |
obj._events = []; | |
obj.on = function (eventName, fn) { | |
this._events[eventName] = (this._events[eventName]) ? this._events[eventName] : []; | |
this._events[eventName].push({ | |
fn: fn, | |
once: false |