Changeset View
Changeset View
Standalone View
Standalone View
swh/web/assets/src/bundles/webapp/webapp-utils.js
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// This will contain a mapping between an archived object type | // This will contain a mapping between an archived object type | ||||
// and its related SWHID metadata for each object reachable from | // and its related SWHID metadata for each object reachable from | ||||
// the current browse view. | // the current browse view. | ||||
// SWHID metadata contain the following keys: | // SWHID metadata contain the following keys: | ||||
// * object_type: type of archived object | // * object_type: type of archived object | ||||
// * object_id: sha1 object identifier | // * object_id: sha1 object identifier | ||||
// * swhid: SWH persistent identifier without contextual info | // * swhid: SWHID without contextual info | ||||
// * swhid_url: URL to resolve SWH persistent identifier without contextual info | // * swhid_url: URL to resolve SWHID without contextual info | ||||
// * context: object describing SWHID context | // * context: object describing SWHID context | ||||
// * swhid_with_context: SWH persistent identifier with contextual info | // * swhid_with_context: SWHID with contextual info | ||||
// * swhid_with_context_url: URL to resolve SWH persistent identifier with contextual info | // * swhid_with_context_url: URL to resolve SWHID with contextual info | ||||
let swhidsContext_ = {}; | let swhidsContext_ = {}; | ||||
export function setSwhIdsContext(swhidsContext) { | export function setSwhIdsContext(swhidsContext) { | ||||
swhidsContext_ = {}; | swhidsContext_ = {}; | ||||
for (let swhidContext of swhidsContext) { | for (let swhidContext of swhidsContext) { | ||||
swhidsContext_[swhidContext.object_type] = swhidContext; | swhidsContext_[swhidContext.object_type] = swhidContext; | ||||
} | } | ||||
} | } | ||||
Show All 27 Lines |