Merge branch 'master' of git.libreccm.org:libreccm
commit
1289b9f210
|
|
@ -1 +1,110 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Processes the journal search widget.
|
||||||
|
|
||||||
|
Author: Jens Pelzetter, jens.pelzetter@googlemail.com
|
||||||
|
-->
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||||
|
xmlns:foundry="http://foundry.libreccm.org"
|
||||||
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||||
|
exclude-result-prefixes="xsl bebop cms foundry nav"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:template match="cms:journal-search-widget">
|
||||||
|
|
||||||
|
<div class="journal-search-widget">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="./cms:selected-journal">
|
||||||
|
<p>
|
||||||
|
<xsl:value-of select="./cms:selected-journal/@name" />
|
||||||
|
</p>
|
||||||
|
<input type="hidden"
|
||||||
|
id="{./@name}"
|
||||||
|
value="{./selected-journal/@journalId}" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<p id="{concat(./@name, '-selected')">
|
||||||
|
<strong>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/no-journal-selected')" />
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<button id="{concat(./@name, 'select-journal-button')}"
|
||||||
|
type="button"
|
||||||
|
class="select-journal-button"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}"
|
||||||
|
data-target="{./@name}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/select-journal-button')" />
|
||||||
|
</button>
|
||||||
|
<dialog id="{concat(./@name, '-dialog')}"
|
||||||
|
class="journal-search-widget-dialog"
|
||||||
|
data-dispatcherPrefix="{$dispatcher-prefix}"
|
||||||
|
data-targetId="{./@name}">
|
||||||
|
<h3 class="titlebar">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/titlebar')" />
|
||||||
|
<button type="button"
|
||||||
|
class="close-button"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<span>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/titlebar/close')" />
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h3>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="hidden" id="{concat(./@name, '-last-focus')}" />
|
||||||
|
<label for="{concat(./@name, 'journal-filter')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/filter-list')" />
|
||||||
|
</label>
|
||||||
|
<input type="text" id="{concat(./@name, '-dialog-journal-filter')}" />
|
||||||
|
<button type="button"
|
||||||
|
class="apply-filter"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/filter-list/apply')" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="selectable-journals">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'journal-search-widget/table/header/name')" />
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>$name</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,129 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2017 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Processes the publication search widget.
|
||||||
|
|
||||||
|
Author: Jens Pelzetter, jens.pelzetter@googlemail.com
|
||||||
|
-->
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||||
|
xmlns:foundry="http://foundry.libreccm.org"
|
||||||
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||||
|
exclude-result-prefixes="xsl bebop cms foundry nav"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:template match="cms:publication-search-widget">
|
||||||
|
|
||||||
|
<div class="publication-search-widget">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="./cms:selected-publication">
|
||||||
|
<p>
|
||||||
|
<xsl:value-of select="./cms:selected-publication/@title" />
|
||||||
|
</p>
|
||||||
|
<input type="hidden"
|
||||||
|
id="{./@name}"
|
||||||
|
value="{./selected-publication/@publicationId}" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<p id="{concat(./@name, '-selected')}">
|
||||||
|
<strong>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/no-publication-selected')" />
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
<input type="hidden"
|
||||||
|
id="{./@name}"
|
||||||
|
name="{./@name}" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<button id="{concat(./@name, 'select-publication-button')}"
|
||||||
|
type="button"
|
||||||
|
class="select-publication-button"
|
||||||
|
|
||||||
|
data-publicationtype="{./@publication-type}"
|
||||||
|
data-contentsection="{./@content-section}"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}"
|
||||||
|
|
||||||
|
data-target="{./@name}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/select-publication-button')" />
|
||||||
|
</button>
|
||||||
|
<dialog id="{concat(./@name, '-dialog')}"
|
||||||
|
class="publication-search-widget-dialog"
|
||||||
|
data-publicationtype="{./@publication-type}"
|
||||||
|
data-contentsection="{./@content-section}"
|
||||||
|
data-dispatcherPrefix="{$dispatcher-prefix}"
|
||||||
|
data-targetId="{./@name}">
|
||||||
|
<h3 class="titlebar">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/titlebar')" />
|
||||||
|
<button type="button"
|
||||||
|
class="close-button"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<span>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/titlebar/close')" />
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h3>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="hidden" id="{concat(./@name, '-last-focus')}" />
|
||||||
|
<label for="{concat(./@name, 'publication-filter')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/filter-list')" />
|
||||||
|
</label>
|
||||||
|
<input type="text" id="{concat(./@name, '-dialog-publication-filter')}" />
|
||||||
|
<button type="button"
|
||||||
|
class="apply-filter"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/filter-list/apply')" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="selectable-publications">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/table/header/title')" />
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/table/header/type')" />
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'publication-search-widget/table/header/place')" />
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
$publicationStr
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
$type
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
</div>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,112 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Processes the series search widget.
|
||||||
|
|
||||||
|
Author: Jens Pelzetter, jens.pelzetter@googlemail.com
|
||||||
|
-->
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||||
|
xmlns:foundry="http://foundry.libreccm.org"
|
||||||
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||||
|
exclude-result-prefixes="xsl bebop cms foundry nav"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:template match="cms:series-search-widget">
|
||||||
|
|
||||||
|
<div class="series-search-widget">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="./cms:selected-series">
|
||||||
|
<p>
|
||||||
|
<xsl:value-of select="./cms:selected-series/@name" />
|
||||||
|
</p>
|
||||||
|
<input type="hidden"
|
||||||
|
id="{./@name}"
|
||||||
|
value="{./selected-series/@seriesId}" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<p id="{concat(./@name, '-selected')">
|
||||||
|
<strong>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/no-series-selected')" />
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<button id="{concat(./@name, 'select-series-button')}"
|
||||||
|
type="button"
|
||||||
|
class="select-series-button"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}"
|
||||||
|
data-target="{./@name}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/select-series-button')" />
|
||||||
|
</button>
|
||||||
|
<dialog id="{concat(./@name, '-dialog')}"
|
||||||
|
class="series-search-widget-dialog"
|
||||||
|
data-dispatcherPrefix="{$dispatcher-prefix}"
|
||||||
|
data-targetId="{./@name}">
|
||||||
|
<h3 class="titlebar">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/titlebar')" />
|
||||||
|
<button type="button"
|
||||||
|
class="close-button"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<span>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/titlebar/close')" />
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</h3>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="hidden" id="{concat(./@name, '-last-focus')}" />
|
||||||
|
<label for="{concat(./@name, 'series-filter')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/filter-list')" />
|
||||||
|
</label>
|
||||||
|
<input type="text" id="{concat(./@name, '-dialog-series-filter')}" />
|
||||||
|
<button type="button"
|
||||||
|
class="apply-filter"
|
||||||
|
data-dialogId="{concat(./@name, '-dialog')}">
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/filter-list/apply')" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="selectable-seriess">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/table/header/name')" />
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<xsl:value-of select="foundry:get-internal-static-text('cms', 'series-search-widget/table/header/place')" />
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>$name</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
|
||||||
|
|
@ -174,10 +174,9 @@ function toggleSelectItemDialog(mode, dialogId) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJournalsForSelectAssetDialog(dialogId) {
|
function getJournalsForSelectJournalDialog(dialogId) {
|
||||||
|
|
||||||
var dialog = document.querySelector("#" + dialogId);
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
var type = dialog.getAttribute("data-assettype");
|
|
||||||
var targetId = dialog.getAttribute('data-targetId');
|
var targetId = dialog.getAttribute('data-targetId');
|
||||||
var filter = document.querySelector('#' + dialogId + '-journals-filter');
|
var filter = document.querySelector('#' + dialogId + '-journals-filter');
|
||||||
var query = filter.value;
|
var query = filter.value;
|
||||||
|
|
@ -188,7 +187,11 @@ function getJournalsForSelectAssetDialog(dialogId) {
|
||||||
0,
|
0,
|
||||||
dispatcherPrefix.length - "/ccm".length
|
dispatcherPrefix.length - "/ccm".length
|
||||||
)
|
)
|
||||||
+ "/sci-publications/journals";
|
+ "/scipublications/journals";
|
||||||
|
|
||||||
|
if (query !== null && query.length > 0) {
|
||||||
|
url = `${url}?query=${query}`;
|
||||||
|
}
|
||||||
|
|
||||||
request.open("GET", url);
|
request.open("GET", url);
|
||||||
request.addEventListener("load", function (event) {
|
request.addEventListener("load", function (event) {
|
||||||
|
|
@ -199,21 +202,262 @@ function getJournalsForSelectAssetDialog(dialogId) {
|
||||||
for (i = 0; i < journals.length; ++i) {
|
for (i = 0; i < journals.length; ++i) {
|
||||||
var journal = journals[i];
|
var journal = journals[i];
|
||||||
tableRows = tableRows
|
tableRows = tableRows
|
||||||
+ "<tr>"
|
+ `<tr>
|
||||||
+ "<td>"
|
<td>
|
||||||
+ "<a href=\"#\" onclick=\"setSelectedJournal(" + journal["journalId"] + ", \'" + journal["title"] + "\', \'" + targetId + "\', \'" + dialogId + "\')\">"
|
<a href="#"
|
||||||
+ journal["title"]
|
onclick="setSelectedJournal('${journal["journalId"]}', '${journal["title"]}', '${targetId}', '${dialogId}')">
|
||||||
+ "</td>"
|
${journal["title"]}
|
||||||
+ "</tr>";
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
document
|
document
|
||||||
.querySelector("#" + dialogId + " tbody")
|
.querySelector("#" + dialogId + " tbody")
|
||||||
.innerHTML = tableRows;
|
.innerHTML = tableRows;
|
||||||
|
} else {
|
||||||
|
alert("Error while retrieving journals. "
|
||||||
|
+ `Response code: ${request.status} `
|
||||||
|
+ `Message: ${request.statusText}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
request.send();
|
request.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setSelectedJournal(journalId, journalTitle, targetId, dialogId) {
|
||||||
|
var target = document.querySelector(`#${targetId}`);
|
||||||
|
var targetText = document.querySelector(`#${targetId}-selected`);
|
||||||
|
|
||||||
|
target.value = journalId;
|
||||||
|
targetText.textContent = journalTitle;
|
||||||
|
|
||||||
|
toggleSelectJournalDialog('hide', dialogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSelectJournalDialog(mode, dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
|
||||||
|
if ('show' === mode) {
|
||||||
|
dialog.setAttribute('open', 'open');
|
||||||
|
getAssetsForSelectAssetDialog(dialogId);
|
||||||
|
} else {
|
||||||
|
dialog.setAttribute('open', 'false');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getItemsForSelectPublicationDialog(dialogId) {
|
||||||
|
var dialog = document.querySelector('#' + dialogId);
|
||||||
|
var type = dialog.getAttribute("data-publicationtype");
|
||||||
|
var targetId = dialog.getAttribute('data-targetId');
|
||||||
|
var filter = document.querySelector(`#${dialogId}-publication-filter`);
|
||||||
|
var query = filter.value;
|
||||||
|
var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix');
|
||||||
|
|
||||||
|
var request = new XMLHttpRequest();
|
||||||
|
var url = `${dispatcherPrefix.substring(0,
|
||||||
|
dispatcherPrefix.length - "/ccm".length)}/scipublications/publications`;
|
||||||
|
if (filter !== null && type.length > 0) {
|
||||||
|
url = `${url}?type=${type}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((type !== null && type.length > 0)
|
||||||
|
&& (query !== null && query.length > 0)) {
|
||||||
|
url = `${url}&query=${query}`;
|
||||||
|
} else if (query !== null && query.length > 0) {
|
||||||
|
url = `${url}?query=${query}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.open("GET", url);
|
||||||
|
request.addEventListener("load", function (event) {
|
||||||
|
if (request.status >= 200 && request.status < 300) {
|
||||||
|
var publications = JSON.parse(request.responseText);
|
||||||
|
var tableRows = "";
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < publications.length; ++i) {
|
||||||
|
var publication = publications[i];
|
||||||
|
var publicationStr = `${publication.authors} (${publication.year}): ${publication.title}`;
|
||||||
|
|
||||||
|
if (publications.publisher) {
|
||||||
|
publicationStr = `${publicationStr}: ${publication.place}: ${publication.publisher}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
tableRows = tableRows
|
||||||
|
+ `<tr>
|
||||||
|
<td>
|
||||||
|
<a href="#"
|
||||||
|
onclick="setSelectedPublication('${publication.publicationId}', '${publicationStr}', '${targetId}', '${dialogId}')">
|
||||||
|
${publicationStr}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
|
}
|
||||||
|
document
|
||||||
|
.querySelector(`#${dialogId} tbody`)
|
||||||
|
.innerHTML = tableRows;
|
||||||
|
} else {
|
||||||
|
alert("Error while retrieving publications. "
|
||||||
|
+ "Response code: " + request.status + " "
|
||||||
|
+ "Message: " + request.statusText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
request.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSelectedPublication(publicationId, publicationStr, targetId,
|
||||||
|
dialogId) {
|
||||||
|
var target = document.querySelector(`#${targetId}`);
|
||||||
|
var targetText = document.querySelector(`#${targetId}-selected`);
|
||||||
|
|
||||||
|
target.value = publicationId;
|
||||||
|
targetText.textContent = publicationStr;
|
||||||
|
|
||||||
|
toggleSelectPublicationDialog('hide', dialogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSelectPublicationDialog(mode, dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
|
||||||
|
if ('show' === mode) {
|
||||||
|
dialog.setAttribute('open', 'open');
|
||||||
|
getAssetsForSelectAssetDialog(dialogId);
|
||||||
|
} else {
|
||||||
|
dialog.setAttribute('open', 'false');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPublishersForSelectPublisherDialog(dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
var targetId = dialog.getAttribute('data-targetId');
|
||||||
|
var filter = document.querySelector('#' + dialogId + '-publisher-filter');
|
||||||
|
var query = filter.value;
|
||||||
|
var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix');
|
||||||
|
|
||||||
|
var request = new XMLHttpRequest();
|
||||||
|
var url = `${dispatcherPrefix.substring(0,
|
||||||
|
dispatcherPrefix.length - "/ccm".length)}/scipublications/publishers}`;
|
||||||
|
if (query !== null && query.length > 0) {
|
||||||
|
url = `${url}?query=${query}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.open("GET", url);
|
||||||
|
request.addEventListener("load", function (event) {
|
||||||
|
if (request.status >= 200 && request.status < 300) {
|
||||||
|
var publishers = JSON.parse(request.responseText);
|
||||||
|
var tableRows = "";
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < publishers.length; ++i) {
|
||||||
|
var publisher = publishers[i];
|
||||||
|
tableRows = tableRows
|
||||||
|
+ `<tr>
|
||||||
|
<td>
|
||||||
|
<a href="#"
|
||||||
|
onclick="setSelectedPublisher('${publisher.publisherId}', '${publisher.name}, ${publisher.place}', '${targetId}', '${dialogId}')">
|
||||||
|
${publisher.name}, ${publisher.place}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
|
}
|
||||||
|
document
|
||||||
|
.querySelector("#" + dialogId + " tbody")
|
||||||
|
.innerHTML = tableRows;
|
||||||
|
} else {
|
||||||
|
alert("Error while retrieving publishers. "
|
||||||
|
+ `Response code: ${request.status} `
|
||||||
|
+ `Message: ${request.statusText}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
request.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSelectedPublisher(publisherId, publisherStr, targetId, dialogId) {
|
||||||
|
var target = document.querySelector(`#${targetId}`);
|
||||||
|
var targetText = document.querySelector(`#${targetId}-selected`);
|
||||||
|
|
||||||
|
target.value = publisherId;
|
||||||
|
targetText.textContent = publisherStr;
|
||||||
|
|
||||||
|
toggleSelectPublisherDialog("hide", dialogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSelectPublisherDialog(mode, dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
|
||||||
|
if ('show' === mode) {
|
||||||
|
dialog.setAttribute('open', 'open');
|
||||||
|
getAssetsForSelectAssetDialog(dialogId);
|
||||||
|
} else {
|
||||||
|
dialog.setAttribute('open', 'false');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSeriesForSelectSeriesDialog(dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
var targetId = dialog.getAttribute('data-targetId');
|
||||||
|
var filter = document.querySelector('#' + dialogId + '-series-filter');
|
||||||
|
var query = filter.value;
|
||||||
|
var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix');
|
||||||
|
|
||||||
|
var request = new XMLHttpRequest();
|
||||||
|
var url = dispatcherPrefix.substring(
|
||||||
|
0,
|
||||||
|
dispatcherPrefix.length - "/ccm".length
|
||||||
|
)
|
||||||
|
+ "/scipublications/series";
|
||||||
|
|
||||||
|
if (query !== null && query.length > 0) {
|
||||||
|
url = `${url}?query=${query}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.open("GET", url);
|
||||||
|
request.addEventListener("load", function (event) {
|
||||||
|
if (request.status >= 200 && request.status < 300) {
|
||||||
|
var seriesList = JSON.parse(request.responseText);
|
||||||
|
var tableRows = "";
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < seriesList.length; ++i) {
|
||||||
|
var series = seriesList[i];
|
||||||
|
tableRows = tableRows
|
||||||
|
+ `<tr>
|
||||||
|
<td>
|
||||||
|
<a href="#"
|
||||||
|
onclick="setSelectedSeries('${series.seriesId}', '${series.name}', '${targetId}', '${dialogId}')">
|
||||||
|
${series.name}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
|
}
|
||||||
|
document
|
||||||
|
.querySelector("#" + dialogId + " tbody")
|
||||||
|
.innerHTML = tableRows;
|
||||||
|
} else {
|
||||||
|
alert("Error while retrieving series. "
|
||||||
|
+ `Response code: ${request.status} `
|
||||||
|
+ `Message: ${request.statusText}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
request.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSelectedSeries(seriesId, seriesName, targetId, dialogId) {
|
||||||
|
var target = document.querySelector(`#${targetId}`);
|
||||||
|
var targetText = document.querySelector(`#${targetId}-selected`);
|
||||||
|
|
||||||
|
target.value = seriesId;
|
||||||
|
targetText.textContent = seriesName;
|
||||||
|
|
||||||
|
toggleSelectSeriesDialog('hide', dialogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSelectSeriesDialog(mode, dialogId) {
|
||||||
|
var dialog = document.querySelector("#" + dialogId);
|
||||||
|
|
||||||
|
if ('show' === mode) {
|
||||||
|
dialog.setAttribute('open', 'open');
|
||||||
|
getAssetsForSelectAssetDialog(dialogId);
|
||||||
|
} else {
|
||||||
|
dialog.setAttribute('open', 'false');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
var i;
|
var i;
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,43 @@
|
||||||
<translation lang="en">Close</translation>
|
<translation lang="en">Close</translation>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
|
<text id="journal-search-widget/filter-list">
|
||||||
|
<translation lang="de">Filtern nach</translation>
|
||||||
|
<translation lang="en">Filter using</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/filter-list/apply">
|
||||||
|
<translation lang="de">Anwenden</translation>
|
||||||
|
<translation lang="en">Apply</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/no-journal-selected">
|
||||||
|
<translation lang="de">Keine Zeitschrift ausgewählt</translation>
|
||||||
|
<translation lang="en">No journal selected</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/selected-journal">
|
||||||
|
<translation lang="de">Ausgewählte Zeitschrift</translation>
|
||||||
|
<translation lang="en">Selected journal</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/selected-journal-name">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/select-journal-button">
|
||||||
|
<translation lang="de">Zeitschrift auswählen</translation>
|
||||||
|
<translation lang="en">Select journal</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/table/header/name">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/titlebar">
|
||||||
|
<translation lang="de">Wählen Sie die zu verwendende Zeitschrift aus</translation>
|
||||||
|
<translation lang="en">Select the journal to use</translation>
|
||||||
|
</text>
|
||||||
|
<text id="journal-search-widget/titlebar/close">
|
||||||
|
<translation lang="de">Ohne Auswahl schließen</translation>
|
||||||
|
<translation lang="en">Close without selecting an journal</translation>
|
||||||
|
</text>
|
||||||
|
|
||||||
<text id="publisher-search-widget/filter-list">
|
<text id="publisher-search-widget/filter-list">
|
||||||
<translation lang="de">Filtern nach</translation>
|
<translation lang="de">Filtern nach</translation>
|
||||||
<translation lang="en">Filter using</translation>
|
<translation lang="en">Filter using</translation>
|
||||||
|
|
@ -167,6 +204,97 @@
|
||||||
<translation lang="en">Close without selecting an publisher</translation>
|
<translation lang="en">Close without selecting an publisher</translation>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
|
<text id="publication-search-widget/filter-list">
|
||||||
|
<translation lang="de">Filtern nach</translation>
|
||||||
|
<translation lang="en">Filter using</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/filter-list/apply">
|
||||||
|
<translation lang="de">Anwenden</translation>
|
||||||
|
<translation lang="en">Apply</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/no-publication-selected">
|
||||||
|
<translation lang="de">Keine Publikation ausgewählt</translation>
|
||||||
|
<translation lang="en">No publication selected</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/selected-publication">
|
||||||
|
<translation lang="de">Ausgewählte Publikation</translation>
|
||||||
|
<translation lang="en">Selected publication</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/selected-publication-name">
|
||||||
|
<translation lang="de">Publikation</translation>
|
||||||
|
<translation lang="en">Publication</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/selected-publication-type">
|
||||||
|
<translation lang="de">Type</translation>
|
||||||
|
<translation lang="en">Typ</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/select-publication-button">
|
||||||
|
<translation lang="de">Publikation auswählen</translation>
|
||||||
|
<translation lang="en">Select publication</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/table/header/name">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/table/header/place">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/titlebar">
|
||||||
|
<translation lang="de">Wählen Sie den zu verwendende Publikation aus</translation>
|
||||||
|
<translation lang="en">Select the publication to use</translation>
|
||||||
|
</text>
|
||||||
|
<text id="publication-search-widget/titlebar/close">
|
||||||
|
<translation lang="de">Ohne Auswahl schließen</translation>
|
||||||
|
<translation lang="en">Close without selecting an </translation>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
|
||||||
|
<text id="series-search-widget/filter-list">
|
||||||
|
<translation lang="de">Filtern nach</translation>
|
||||||
|
<translation lang="en">Filter using</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/filter-list/apply">
|
||||||
|
<translation lang="de">Anwenden</translation>
|
||||||
|
<translation lang="en">Apply</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/no-series-selected">
|
||||||
|
<translation lang="de">Keine Reihe ausgewählt</translation>
|
||||||
|
<translation lang="en">No series selected</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/selected-series">
|
||||||
|
<translation lang="de">Ausgewählte Reihe</translation>
|
||||||
|
<translation lang="en">Selected series</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/selected-series-name">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/selected-series-type">
|
||||||
|
<translation lang="de">Type</translation>
|
||||||
|
<translation lang="en">Typ</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/select-series-button">
|
||||||
|
<translation lang="de">Reihe auswählen</translation>
|
||||||
|
<translation lang="en">Select series</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/table/header/name">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/table/header/place">
|
||||||
|
<translation lang="de">Name</translation>
|
||||||
|
<translation lang="en">Name</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/titlebar">
|
||||||
|
<translation lang="de">Wählen Sie den zu verwendende Reihe aus</translation>
|
||||||
|
<translation lang="en">Select the series to use</translation>
|
||||||
|
</text>
|
||||||
|
<text id="series-search-widget/titlebar/close">
|
||||||
|
<translation lang="de">Ohne Auswahl schließen</translation>
|
||||||
|
<translation lang="en">Close without selecting an </translation>
|
||||||
|
</text>
|
||||||
|
|
||||||
<text id="summary/itemSummary/header">
|
<text id="summary/itemSummary/header">
|
||||||
<translation lang="en">Item Summary</translation>
|
<translation lang="en">Item Summary</translation>
|
||||||
<translation lang="de">Zusammenfassung</translation>
|
<translation lang="de">Zusammenfassung</translation>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue