Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,30 @@
{
"name": "model",
"main": "index.js",
"version": "0.1.0",
"homepage": "https://github.com/gaia-components/model",
"authors": [
"Wilson Page <wilsonpage@me.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"README.md"
],
"dependencies": {
"evt": "wilsonpage/evt#~0.4.0"
},
"_release": "0.1.0",
"_resolution": {
"type": "version",
"tag": "v0.1.0",
"commit": "7464471d4da0743ba4042918083a3429f0fc0fd2"
},
"_source": "git://github.com/fxos-components/model.git",
"_target": "~0.1.0",
"_originalSource": "fxos-components/model"
}

View file

@ -0,0 +1,21 @@
{
"name": "model",
"main": "index.js",
"version": "0.1.0",
"homepage": "https://github.com/gaia-components/model",
"authors": [
"Wilson Page <wilsonpage@me.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"README.md"
],
"dependencies": {
"evt": "wilsonpage/evt#~0.4.0"
}
}

View file

@ -0,0 +1,104 @@
(function(define){define(function(require,exports,module){
'use strict';
/**
* Dependencies
*/
var events = require('evt');
/**
* Exports
*/
module.exports = Model;
function Model(obj) {
if (!(this instanceof Model)) { return mix(obj, Model.prototype); }
this.reset(obj, { silent: true });
this.id = obj.id || obj.key;
}
Model.prototype = events({
/**
* Returns the value of the given
* key, or if not key is given a
* shallow clone of the model is
* returned.
*
* We check `aguments.length` so that
* when calling `get()` with an unknown
* key, `undefined` is returned and not
* the entire model.
*
* Example:
*
* model.get(); //=> { ... }
* model.get('undefinedKey'); //=> undefined
*
* @param {String} key
* @return {*}
* @public
*/
get: function(key) {
var data = this._getData();
return arguments.length ? data[key] : mix({}, data);
},
set: function(key, value, options) {
options = typeof key === 'object' ? value : options;
var silent = options && options.silent;
var data = this._getData();
var keys;
switch (typeof key) {
case 'string':
data[key] = value;
if (!silent) {
this.onKeyChange(key);
this.emit('change', [key]);
}
return;
case 'object':
mix(data, key);
if (!silent) {
keys = Object.keys(key);
keys.forEach(this.onKeyChange, this);
this.emit('change', keys);
}
return;
}
},
setter: function(key, value1) {
return (function(value2) { this.set(key, value1 || value2); }).bind(this);
},
reset: function(data, options) {
if (!data) { return; }
var silent = options && options.silent;
var isArray = data instanceof Array;
this._data = !isArray ? mix({}, data) : data;
if (!silent) { this.emit('reset'); }
},
onKeyChange: function(key) {
var data = this._getData();
this.emit('change:' + key, data[key]);
},
_getData: function() {
this._data = this._data || {};
return this._data;
}
});
function mix(a, b) {
for (var key in b) { a[key] = b[key]; }
return a;
}
});})((function(n,w){return typeof define=='function'&&define.amd?
define:typeof module=='object'?function(c){c(require,exports,module);}:function(c){
var m={exports:{}},r=function(n){return w[n];};w[n]=c(r,m.exports,m)||m.exports;};})('model',this));