VulpesOS/gaia/shared/js/smart-screen/cards/app_bookmark.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

46 lines
1.1 KiB
JavaScript
Executable file

/* global Card */
(function(exports) {
'use strict';
function AppBookmark(options) {
this.url = options.url;
this.name = options.name;
this.group = options.group;
this.thumbnail = options.thumbnail;
Card.prototype.constructor.call(this);
}
AppBookmark.deserialize = function ab_deserialize(cardEntry) {
var cardInstance;
if (cardEntry && cardEntry.type === 'AppBookmark') {
cardInstance = new AppBookmark({
name: cardEntry.name,
url: cardEntry.url,
group: cardEntry.group,
thumbnail: cardEntry.thumbnail
});
}
return cardInstance;
};
AppBookmark.prototype = Object.create(Card.prototype);
AppBookmark.prototype.constructor = AppBookmark;
AppBookmark.prototype.launch = function ab_launch(args) {
window.open(this.url, '_blank', 'remote=true,applike=true');
};
AppBookmark.prototype.serialize = function ab_serialize() {
return {
type: 'AppBookmark',
name: this.name,
url: this.url,
group: this.group,
thumbnail: this.thumbnail
};
};
exports.AppBookmark = AppBookmark;
}(window));