From e1ffea0972dbaa0057668281ae10f0752d749954 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 5 Feb 2020 17:49:42 +0100 Subject: [PATCH] links --- config.jsonc | 14 ++++++++++++++ static/js/documentInfoView.sarai.js | 5 +++++ static/js/infoView.sarai.js | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/config.jsonc b/config.jsonc index 4e4a5c2..cafc582 100644 --- a/config.jsonc +++ b/config.jsonc @@ -320,6 +320,13 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. "find": true, "sort": true }, + { + "id": "links", + "title": "Links", + "type": ["string"], + "columnWidth": 180, + "find": true + }, { "id": "matches", "operator": "-", @@ -636,6 +643,13 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. "find": true, "sort": true }, + { + "id": "links", + "title": "Links", + "type": ["string"], + "columnWidth": 180, + "find": true + }, { "id": "notes", "title": "Notes", diff --git a/static/js/documentInfoView.sarai.js b/static/js/documentInfoView.sarai.js index aa0b32a..98d8e64 100644 --- a/static/js/documentInfoView.sarai.js +++ b/static/js/documentInfoView.sarai.js @@ -241,6 +241,7 @@ pandora.ui.documentInfoView = function(data, isMixed) { renderGroup(['publisher', 'place', 'series', 'edition', 'language']); renderGroup(['tags']); + renderGroup(['links']); // Render any remaing keys defined in config @@ -472,6 +473,10 @@ pandora.ui.documentInfoView = function(data, isMixed) { ret = pandora.formatDate(value); } else if (nameKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), key); + } else if (key == 'links') { + ret = value.split(', ').map(function(link) { + return '' + Ox.parseURL(link).host + ''; + }).join(', '); } else if (listKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), key); } else if (['type', 'publisher'].indexOf(key) > -1) { diff --git a/static/js/infoView.sarai.js b/static/js/infoView.sarai.js index 9746ffd..c9d0e2b 100644 --- a/static/js/infoView.sarai.js +++ b/static/js/infoView.sarai.js @@ -254,6 +254,7 @@ pandora.ui.infoView = function(data, isMixed) { renderGroup(['editor', 'featuring']); renderGroup(['tags']); + renderGroup(['links']); // Render any remaing keys defined in config @@ -515,6 +516,10 @@ pandora.ui.infoView = function(data, isMixed) { true ), key, date) : ''; }).join('; '); + } else if (key == 'links') { + ret = value.split(', ').map(function(link) { + return '' + Ox.parseURL(link).host + ''; + }).join(', '); } else if (listKeys.indexOf(key) > -1) { ret = formatLink(value.split(', '), key); } else if (specialListKeys.indexOf(key) > -1) {