PURPOSE Clean organization and models linked to Event Online feature introduced in semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae Also clean website event menu not being available in website event but only in website event track, which implies some extra-code to manage it. In short: merge website_event_online in website_event, website_event_track _(online/session) in website_event_track. RATIONALE _online modules have been added to extend content of website_event and website_event_track without having any impact on those module. First step of cleaning is to move this content directly in base module. track_session module is mainly a rewrite of track module. Second step of cleaning is to move its content directly in website_event_track. SPECIFICATIONS Move remaining content of website event track online to website event track. Agenda notably is completely replaced by the new one developed within track_online module. Update dependencies accordingly. LINKS Task ID-2319779 COM odoo/odoo#56067 ENT odoo/enterprise#12520 UPG odoo/upgrade#1654
82 lines
2.8 KiB
JavaScript
82 lines
2.8 KiB
JavaScript
// idb-keyval.js 3.2.0
|
|
// https://github.com/jakearchibald/idb-keyval
|
|
// Copyright 2016, Jake Archibald
|
|
// Licensed under the Apache License, Version 2.0
|
|
|
|
var idbKeyval = (function (exports) {
|
|
'use strict';
|
|
|
|
class Store {
|
|
constructor(dbName = 'keyval-store', storeName = 'keyval') {
|
|
this.storeName = storeName;
|
|
this._dbp = new Promise((resolve, reject) => {
|
|
const openreq = indexedDB.open(dbName, 1);
|
|
openreq.onerror = () => reject(openreq.error);
|
|
openreq.onsuccess = () => resolve(openreq.result);
|
|
// First time setup: create an empty object store
|
|
openreq.onupgradeneeded = () => {
|
|
openreq.result.createObjectStore(storeName);
|
|
};
|
|
});
|
|
}
|
|
_withIDBStore(type, callback) {
|
|
return this._dbp.then(db => new Promise((resolve, reject) => {
|
|
const transaction = db.transaction(this.storeName, type);
|
|
transaction.oncomplete = () => resolve();
|
|
transaction.onabort = transaction.onerror = () => reject(transaction.error);
|
|
callback(transaction.objectStore(this.storeName));
|
|
}));
|
|
}
|
|
}
|
|
let store;
|
|
function getDefaultStore() {
|
|
if (!store)
|
|
store = new Store();
|
|
return store;
|
|
}
|
|
function get(key, store = getDefaultStore()) {
|
|
let req;
|
|
return store._withIDBStore('readonly', store => {
|
|
req = store.get(key);
|
|
}).then(() => req.result);
|
|
}
|
|
function set(key, value, store = getDefaultStore()) {
|
|
return store._withIDBStore('readwrite', store => {
|
|
store.put(value, key);
|
|
});
|
|
}
|
|
function del(key, store = getDefaultStore()) {
|
|
return store._withIDBStore('readwrite', store => {
|
|
store.delete(key);
|
|
});
|
|
}
|
|
function clear(store = getDefaultStore()) {
|
|
return store._withIDBStore('readwrite', store => {
|
|
store.clear();
|
|
});
|
|
}
|
|
function keys(store = getDefaultStore()) {
|
|
const keys = [];
|
|
return store._withIDBStore('readonly', store => {
|
|
// This would be store.getAllKeys(), but it isn't supported by Edge or Safari.
|
|
// And openKeyCursor isn't supported by Safari.
|
|
(store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {
|
|
if (!this.result)
|
|
return;
|
|
keys.push(this.result.key);
|
|
this.result.continue();
|
|
};
|
|
}).then(() => keys);
|
|
}
|
|
|
|
exports.Store = Store;
|
|
exports.get = get;
|
|
exports.set = set;
|
|
exports.del = del;
|
|
exports.clear = clear;
|
|
exports.keys = keys;
|
|
|
|
return exports;
|
|
|
|
}({}));
|