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,72 @@
/* globals DataGridProvider, GaiaGrid, Search,
Promise, SyncDataStore, InMemoryStore */
(function(exports) {
'use strict';
var STORE_NAME = 'bookmarks_store';
function formatBookmark(bookmark) {
return {
data: new GaiaGrid.Bookmark({
id: bookmark.url,
name: bookmark.name || bookmark.url,
url: bookmark.url,
icon: bookmark.icon
})
};
}
function Bookmarks() {}
Bookmarks.prototype = {
__proto__: DataGridProvider.prototype,
name: 'Bookmarks',
init: function() {
DataGridProvider.prototype.init.apply(this, arguments);
this.persistStore = new InMemoryStore();
this.syncStore = new SyncDataStore(STORE_NAME, this.persistStore, 'url');
return this.syncStore.sync();
},
get: function(url) {
var results = this.persistStore.results;
for (var idx in results) {
var item = results[idx];
if (item.url === url) {
return formatBookmark(item);
}
}
return null;
},
search: function(filter) {
var self = this;
return new Promise(function(resolve, reject) {
var renderResults = [];
filter = filter.toLowerCase();
for(var elem in self.persistStore.results) {
var bookmark = self.persistStore.results[elem];
var name = ('name' in bookmark) && bookmark.name.toLowerCase();
if ((!bookmark.url || bookmark.url.indexOf(filter) == -1) &&
(!name || name.indexOf(filter) == -1)) {
continue;
}
renderResults.push(formatBookmark(bookmark));
}
resolve(renderResults);
});
}
};
exports.Bookmarks = new Bookmarks();
Search.provider(exports.Bookmarks);
}(window));