Commit cdfaa0a1 by Jorem Magcawas

add shortcut keys

parent 31af58ed
...@@ -153,18 +153,6 @@ ...@@ -153,18 +153,6 @@
</div> </div>
<div id="TiffModalBody"> <div id="TiffModalBody">
<!-- <button id = "prev-button">prev</button>
<button id = "next-button">next</button>
<button id="fit-content">Fit-Content</button>
<button id="rotate-right">Rotate Right</button>
<button id="rotate-left">Rotate Left</button>
<button id="zoom-in">Zoom In</button>
<button id="zoom-out">Zoom Out</button>
<button id="flip-vertical">Flip Vertical</button>
<button id="flip-horizontal">Flip Horizontal</button>
<div id="page-info"></div>
<div id="zoom-info"></div>
<div id="pdf-container"></div> -->
</div> </div>
<div > <div >
...@@ -281,14 +269,14 @@ const rejectIcon = document.createElement("img"); ...@@ -281,14 +269,14 @@ const rejectIcon = document.createElement("img");
); );
document.addEventListener("keydown", (e) => { document.addEventListener("keydown", (e) => {
if (e.key === "F12") { if (e.ctrlKey && e.keyCode === 123) {
const fieldForm = document.getElementById("fields"); const fieldForm = document.getElementById("fields");
fieldForm.querySelector('input[type="submit"]').click(); fieldForm.querySelector('input[type="submit"]').click();
} }
}) })
document.addEventListener("keydown", (e) => { document.addEventListener("keydown", (e) => {
if (e.key === "F11") { if (e.ctrlKey && e.keyCode === 122) {
const fieldForm = document.getElementById("fields"); const fieldForm = document.getElementById("fields");
fieldForm.querySelector('input[type="submit"]').click() fieldForm.querySelector('input[type="submit"]').click()
} }
......
...@@ -322,7 +322,7 @@ async function accessFile() { ...@@ -322,7 +322,7 @@ async function accessFile() {
if(IS_RETRIEVE_FROM_GFS == "Y"){ if(IS_RETRIEVE_FROM_GFS == "Y"){
const modal = document.getElementById("TiffViewerModal"); const modal = document.getElementById("TiffViewerModal");
modal.style.display = 'none';//hide local modal\ modal.style.display = 'none';//hide local modal\
getFolder(FOLDER_URL+sessionStorage.getItem('user_id')+'/element8'); getFolder(FOLDER_URL+sessionStorage.getItem('user_id')+'/element6');
}else{ }else{
if((localStorage.length)==0){ if((localStorage.length)==0){
if(updated_input_files.length==0){ if(updated_input_files.length==0){
......
...@@ -73,10 +73,16 @@ const startMetricCapture = () => { ...@@ -73,10 +73,16 @@ const startMetricCapture = () => {
let pause = document.getElementById("pause"); let pause = document.getElementById("pause");
pause.onclick = (event) => { pause.onclick = (event) => {
console.log("pause");
pauseMetricCapture(); pauseMetricCapture();
/*disableTiffButtons();*/ /*disableTiffButtons();*/
} }
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape' || event.key === 'Esc') {
pauseMetricCapture();
}
});
/*window.onclick = (event) => { /*window.onclick = (event) => {
if (event.path[0].id == 'pause') { if (event.path[0].id == 'pause') {
......
...@@ -70,6 +70,7 @@ const displayFields = async (parentID) => { ...@@ -70,6 +70,7 @@ const displayFields = async (parentID) => {
createSection('Section', div, doctypes, underscoredKey); createSection('Section', div, doctypes, underscoredKey);
div = deconstruct(doctypes[sec], div, underscoredSec) div = deconstruct(doctypes[sec], div, underscoredSec)
const submit = document.createElement('input') const submit = document.createElement('input')
submit.setAttribute('id', 'submitButton');
submit.classList.add("submitButtons"); submit.classList.add("submitButtons");
submit.classList.add(underscoredSec); submit.classList.add(underscoredSec);
submit.type = 'submit' submit.type = 'submit'
......
var displayPdf = function(document) {
//Create all Elements //Create all Elements
var container = document.createElement('div'); var container = document.createElement('div');
container.setAttribute('id', 'pdf-container'); container.setAttribute('id', 'pdf-container');
...@@ -69,8 +70,6 @@ controllsContainer.appendChild(zoomInfo); ...@@ -69,8 +70,6 @@ controllsContainer.appendChild(zoomInfo);
//canva's //canva's
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var displayPdf = function(document) {
// Get the container element
// Load the PDF document // Load the PDF document
pdfjsLib.getDocument(document).promise.then(function(pdf) { pdfjsLib.getDocument(document).promise.then(function(pdf) {
......
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