Skip to content

Commit

Permalink
#93: Zentralisierung der FileService-URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Grüning committed Dec 14, 2020
1 parent 2dd03ae commit b500bd8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/js/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@ function openFormNewElement()
{
window.open(window.location.href.replace(window.location.search, ""), "_self");
}

function getMuninsArchivBaseUrl() {
return "https://localhost/Munins Archiv";
}

function getMuninsArchivFileServiceBaseUrl() {
return "https://localhost/munins-archiv-file-service";
}
2 changes: 1 addition & 1 deletion src/js/views/Ablage/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function UpdateGridData(funde) {
let kontextPath = fund.Kontext.Path;
let previewFileName = fund.FileName.substr(0, fund.FileName.lastIndexOf(".")) + ".preview" + fund.FileName.substr(fund.FileName.lastIndexOf("."));
let relativePreviewFilePath = kontextPath + "/" + previewFileName;
copy.PreviewImage = "https://localhost/munins-archiv-file-service/file.php?relativePath=/" + relativePreviewFilePath;
copy.PreviewImage = getMuninsArchivFileServiceBaseUrl() + "/file.php?relativePath=/" + relativePreviewFilePath;
}

copy.Anzahl = fund.Anzahl.replace("-", ">");
Expand Down
2 changes: 1 addition & 1 deletion src/js/views/Begehung/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function UpdateGridData(funde) {
let kontextPath = fund.Kontext.Path;
let previewFileName = fund.FileName.substr(0, fund.FileName.lastIndexOf(".")) + ".preview" + fund.FileName.substr(fund.FileName.lastIndexOf("."));
let relativePreviewFilePath = kontextPath + "/" + previewFileName;
copy.PreviewImage = "https://localhost/munins-archiv-file-service/file.php?relativePath=/" + relativePreviewFilePath;
copy.PreviewImage = getMuninsArchivFileServiceBaseUrl() + "/file.php?relativePath=/" + relativePreviewFilePath;
}

copy.Anzahl = fund.Anzahl.replace("-", ">");
Expand Down
2 changes: 1 addition & 1 deletion src/js/views/Fund/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function setFileName(fileName) {
let kontextPath = _viewModelFormFund.getKontext().Path;
let previewFileName = fileName.substr(0, fileName.lastIndexOf(".")) + ".preview" + fileName.substr(fileName.lastIndexOf("."));
let relativePreviewFilePath = kontextPath + "/" + previewFileName;
$("img.preview").attr("src", "https://localhost/munins-archiv-file-service/file.php?relativePath=/" +
$("img.preview").attr("src", getMuninsArchivFileServiceBaseUrl() + "/file.php?relativePath=/" +
relativePreviewFilePath);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/js/views/Fund/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function UpdateGridData(funde) {
let kontextPath = fund.Kontext.Path;
let previewFileName = fund.FileName.substr(0, fund.FileName.lastIndexOf(".")) + ".preview" + fund.FileName.substr(fund.FileName.lastIndexOf("."));
let relativePreviewFilePath = kontextPath + "/" + previewFileName;
copy.PreviewImage = "https://localhost/munins-archiv-file-service/file.php?relativePath=/" + relativePreviewFilePath;
copy.PreviewImage = getMuninsArchivFileServiceBaseUrl() + "/file.php?relativePath=/" + relativePreviewFilePath;
}

copy.Anzahl = fund.Anzahl.replace("-", ">");
Expand Down Expand Up @@ -408,4 +408,4 @@ function disableButtonGoToLastPage() {
$("#buttonGoToLastPage").off("click");
$("#buttonGoToLastPage").addClass("disabled");
$("#buttonGoToLastPage").prop("disabled", true);
}
}

0 comments on commit b500bd8

Please sign in to comment.