VulpesOS/gaia/shared/js/smart-screen/cards/card.js
OverSu b38dea0597 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.
2026-09-30 23:13:03 +02:00

40 lines
1 KiB
JavaScript
Executable file

/* global evt */
(function(exports) {
'use strict';
var _counter = 0;
// Card is the base class for Application, Deck, and Folder
var Card = function Card() {
this.generateCardId();
};
Card.deserialize = function c_deserialize(cardEntry) {
// just to prevent undefined error
};
Card.prototype = evt({
get cardId() {
return this._id;
},
generateCardId: function c_generateCardId() {
// XXX: use constructor.name + name + incremental counter
// as cardId for now. Notice that cardId is only meaningful for
// Smart-Home app. Because only Smart-Home app has 'write' privilege.
var name = (this.nativeApp && this.nativeApp.manifest) ?
this.nativeApp.manifest.name : 'card';
this._id = this.constructor.name + '-' + name + '-' + (_counter);
_counter += 1;
return this._id;
},
serialize: function c_serialize() {
// just to prevent undefined error
},
constructor: Card
});
exports.Card = Card;
}(window));