Commit 338fdef5 by Jorem Magcawas

commit last changes

parent a4efcb98
......@@ -32,3 +32,10 @@ const INPUT_FOLDER = "./input/"
const OUTPUT_FILES = "../../output/"
//this determines if the images will be retrieved from the gfs
const DOMAIN = "http://35.169.23.0:8080"
const CONTEXTROOT = "gfs-explorer-ws"
const FOLDER_URL = DOMAIN + "/" + CONTEXTROOT + "/svc/gfs-rest/get-folder?parentPath="
const DOWNLOAD_URL = DOMAIN + "/" + CONTEXTROOT + "/svc/gfs-rest/get-download-link"
const IS_RETRIEVE_FROM_GFS = "Y"
var Dirfiles = <?php $arrFiles = array();
$path = './input';
$iterator = new FilesystemIterator($path);
......@@ -7,3 +6,4 @@ foreach($iterator as $entry) {
}
echo json_encode($arrFiles);
?>
......@@ -120,5 +120,5 @@
<script src="./src/endSession/endSession.js"></script>
<script src="./src/tiffViewer/tiffViewer.js"></script>
<script src="./src/highlight/highlight.js"></script>
<script src='config.php'></script>
</html>
\ No newline at end of file
......@@ -238,3 +238,64 @@ function accessFile() {
});
}
}
function getFolder(url){
const promise = fetch(url, {
method: 'GET',
headers: {
'Authorization': kc.token
// 'Content-Type': 'application/x-www-form-urlencoded',
}
//body: JSON.stringify(myObject)
})
.then(function (response) {
if(response.status === 200){
response.json().then(function(data) {
//var parseData = JSON.parse(data);
// func(data);
console.log(data);
//displayData(parseData);
});
}else{
console.log("Error");
}
})
.catch(function (error) {
console.log('Request failed', error);
});
return promise;
}
function postServiceText(url, myObject, funcSuccess, funcFail){
const promise = fetch(url, {
method: 'post',
body: JSON.stringify(myObject),
headers: {
'Content-Type': 'application/json',
'Authorization': kc.token
// 'Content-Type': 'application/x-www-form-urlencoded',
}
})
.then(function (response) {
if(response.status === 200){
response.text().then(function(data) {
//var parseData = JSON.parse(data);
// funcSuccess(data);
console.log(data);
//alert(data);
//displayData(parseData);
});
}else{
console.log("Error");
funcFail();
}
})
.catch(function (error) {
console.log('Request failed', error);
});
return promise;
}
......@@ -211,6 +211,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
tiff.setDirectory(i);
var canvas = tiff.toCanvas().toDataURL();
document.getElementById(`IMG${i + 1}`).src = canvas;
}
//setting the style per page
for (var j = 1; j <= TiffViewer_pages; ++j) {
......@@ -222,6 +223,8 @@ function TIFFViewer(xhr, TiffViewerImageName) {
origwidth = width;
setwidth = width;
setheight = height;
//to only display single page
if (setheight > 800 && setwidth > 1000) {
if (setheight > setwidth) {
img.style = "width: 600; height: 800";
......@@ -258,8 +261,10 @@ function TIFFViewer(xhr, TiffViewerImageName) {
if (j === 1) {
img.style.display = "flex";
}
}
//getting the metadata of each TIFF page
function getMeta(url, callback) {
var img = new Image();
......@@ -556,6 +561,11 @@ function TIFFViewer(xhr, TiffViewerImageName) {
}
editedwidth = image.clientWidth;
editedheight = image.clientHeight;
// document.getElementById(`IMG${TiffViewer_current + 1}`).style.display = 'none';
// document.getElementById("IMG2").style.display = 'none';
}
/* ADDED:
......@@ -604,5 +614,6 @@ function TIFFViewer(xhr, TiffViewerImageName) {
div.scrollTop += 20;
}
});
}
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