Commit 12948cf6 by Daniel Bawag

WG-227 - Modified PDF viewer to accept blob

parent a4a5ea70
...@@ -121,12 +121,26 @@ function createRejectWindow(){ ...@@ -121,12 +121,26 @@ function createRejectWindow(){
setRadioHandler('MssgBox'); setRadioHandler('MssgBox');
okButton.onclick = function () { okButton.onclick = function () {
saveExceptionToXml();//save xml if (document.querySelector('input[name="rejectRadio"]:checked').value != null) {
rejectElement();//reject on bpo if (document.querySelector('input[name="rejectRadio"]:checked').value.trim().length != 0) {
screenMain.style.display = 'none'; saveExceptionToXml();//save xml
rejectButton.disabled = false; rejectElement();//reject on bpo
popUpDisplay.remove(); screenMain.style.display = 'none';
rejectButton.disabled = false;
popUpDisplay.remove();
var fileName = sessionStorage.getItem("file_Name");
if(fileName !== null && fileName !== undefined){
document.getElementById("controlsContainer").outerHTML="";
}else{
document.getElementById("TiffViewer_ButtonContainer").outerHTML="";
}
return;
}
}
document.getElementById('MssgBox').value = "";
document.getElementById('rejectSubmit').click();
} }
cancelButton.onclick = function () { cancelButton.onclick = function () {
...@@ -298,19 +312,28 @@ function saveExceptionToXml(){ ...@@ -298,19 +312,28 @@ function saveExceptionToXml(){
} }
function createMessageBox(id){ function createMessageBox(id){
let form = document.createElement('form');
var mssgBox = document.createElement('textarea'); var mssgBox = document.createElement('textarea');
mssgBox.id = id; mssgBox.id = id;
mssgBox.name = "rejectRadio"; mssgBox.name = "rejectRadio";
mssgBox.maxLength = "1000"; mssgBox.maxLength = "1000";
mssgBox.cols = "20"; mssgBox.cols = "20";
mssgBox.rows = "5"; mssgBox.rows = "5";
mssgBox.required = true;
mssgBox.disabled = true; mssgBox.disabled = true;
mssgBox.onkeyup = function () { mssgBox.onkeyup = function () {
let radioFive = document.getElementById('check5'); let radioFive = document.getElementById('check5');
radioFive.value = mssgBox.value; radioFive.value = mssgBox.value;
} }
return mssgBox; let submit = document.createElement('input');
submit.id = 'rejectSubmit';
submit.type = 'submit';
submit.style.visibility = 'hidden';
form.appendChild(mssgBox);
form.appendChild(submit);
return form;
} }
......
...@@ -67,14 +67,28 @@ async function returnElementLogout(elementId) { ...@@ -67,14 +67,28 @@ async function returnElementLogout(elementId) {
} }
var returnButton = document.getElementById('return'); var returnButton = document.getElementById('return');
returnButton.addEventListener("click", function () { returnButton.addEventListener("click", function () {
returnElementBPO(sessionStorage.getItem("element_id")); returnElementBPO(sessionStorage.getItem("element_id"));
var fileName = sessionStorage.getItem("file_Name");
if(fileName !== null && fileName !== undefined){
document.getElementById("controlsContainer").outerHTML="";
}else{
document.getElementById("TiffViewer_ButtonContainer").outerHTML="";
}
}); });
window.addEventListener('keydown', function(e) { window.addEventListener('keydown', function(e) {
if (e.altKey == true && e.keyCode == 85){ if (e.altKey == true && e.keyCode == 85){
returnElementBPO(sessionStorage.getItem("element_id")); returnElementBPO(sessionStorage.getItem("element_id"));
var fileName = sessionStorage.getItem("file_Name");
if(fileName !== null && fileName !== undefined){
document.getElementById("controlsContainer").outerHTML="";
}else{
document.getElementById("TiffViewer_ButtonContainer").outerHTML="";
}
} }
}); });
......
...@@ -188,24 +188,24 @@ var displayPdf = function(doc) { ...@@ -188,24 +188,24 @@ var displayPdf = function(doc) {
fitContentButton.addEventListener('click', function() { fitContentButton.addEventListener('click', function() {
if (currentScale != fitScale) { /*if (currentScale != fitScale) {
currentScale = fitScale; currentScale = fitScale;
renderPage(currentPage); renderPage(currentPage);
} else { } else {*/
currentScale = 1.3; currentScale = 1.3;
renderPage(currentPage); renderPage(currentPage);
} //}
}); });
document.addEventListener("keydown", function(e) { document.addEventListener("keydown", function(e) {
if (e.shiftKey && e.key == 'F') { if (e.shiftKey && e.key == 'F') {
if (currentScale != fitScale) { // if (currentScale != fitScale) {
currentScale = fitScale; // currentScale = fitScale;
renderPage(currentPage); // renderPage(currentPage);
} else { // } else {
currentScale = 1.3; currentScale = 1.3;
renderPage(currentPage); renderPage(currentPage);
} // }
} }
}); });
......
.tiffViewerContainer { .tiffViewerContainer {
margin: auto; margin: auto;
height: calc(100% - 60px); /* height: calc(100% - 60px); */
width: 70%; width: 70%;
position: relative; position: relative;
display: block; display: block;
......
...@@ -468,7 +468,6 @@ div#nextDivContainer { ...@@ -468,7 +468,6 @@ div#nextDivContainer {
} }
#nextDiv { #nextDiv {
z-index: 1;
background-color: #000000a1; background-color: #000000a1;
width: 35px; width: 35px;
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment