Skip to content

Commit

Permalink
mobile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Dec 26, 2018
1 parent 6fcc111 commit 73ccb3a
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlig
server.port:8080

# Activate authentication
server.auth.active=false
server.auth.active=true
server.auth.user=aesel
server.auth.pw=password
# Secret for generating JWT's
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/WEB-INF/jsp/assetBrowser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@
var currentPage = gridOptions.api.paginationGetCurrentPage();
gridOptions.api.paginationGoToPage(currentPage-1);
} else if (event.target.id == "delete") {
delete_selected();
var r = confirm("Delete the selected asset?");
if (r) {
delete_selected();
}
}
updateGridData({});
}
Expand All @@ -303,10 +306,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Execute an HTTP call to get the available asset metadata
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/assetEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
</li>
</ul>
</nav>
<div class="alert alert-success" id="success-alert" style="display:none">Asset Saved!</div>
<div class="row">
<div class="col-md-12">
<h1 style="text-align: center;">Asset</h1>
Expand Down Expand Up @@ -190,6 +191,8 @@
processData: false,
success: function(data) {
console.log(data);
$("#success-alert").show();
setTimeout(function() { $("#success-alert").hide(); }, 5000);
}
});
}
Expand Down Expand Up @@ -226,10 +229,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Setup the cancel button callback
Expand Down
7 changes: 3 additions & 4 deletions src/main/webapp/WEB-INF/jsp/home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@
// If the user is an admin, then the server will inject 'true' here,
// otherwise, it will inject 'false'.
var isUserAdmin = "${isAdmin}";
console.log(isUserAdmin);
var adminLoggedIn = (isUserAdmin == 'true');
console.log(adminLoggedIn);
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
// document.getElementById("userBrowserLink").click(function() {
// return false;
// });
document.getElementById("userBrowserLink").href = "#";
}
// The favorite projects list is injected here by the server
// before it returns the page.
Expand Down
38 changes: 19 additions & 19 deletions src/main/webapp/WEB-INF/jsp/objEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</li>
</ul>
</nav>
<div class="alert alert-success" id="success-alert" style="display:none">Object Saved!</div>
<div class="row">
<div class="col-md-12">
<h1 style="text-align: center;">Object</h1>
Expand All @@ -60,103 +61,103 @@
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Key:</p>
</div>
<div class="col-md-10" class="tooltip" title="The unique identifier of the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The unique identifier of the Object.">
<input id="keyinp" type="text" class="form-control-plaintext" name="Key" placeholder="Key"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Name:</p>
</div>
<div class="col-md-10" class="tooltip" title="The human-readable name of the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The human-readable name of the Object.">
<input id="nameinp" type="text" class="form-control-plaintext" name="Name" placeholder="Name"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Parent:</p>
</div>
<div class="col-md-10" class="tooltip" title="The parent Object from which this inherits attributes.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The parent Object from which this inherits attributes.">
<input id="parentinp" type="text" class="form-control-plaintext" name="Parent" placeholder="Parent"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Type:</p>
</div>
<div class="col-md-10" class="tooltip" title="The human-readable name of the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The human-readable name of the Object.">
<input id="typeinp" type="text" class="form-control-plaintext" name="Type" placeholder="Type"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Subtype:</p>
</div>
<div class="col-md-10" class="tooltip" title="The latitude of the Object for distance queries.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The latitude of the Object for distance queries.">
<input id="subtypeinp" type="text" class="form-control-plaintext" name="Subtype" placeholder="Subtype"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Owner:</p>
</div>
<div class="col-md-10" class="tooltip" title="The longitude of the Object for distance queries.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The longitude of the Object for distance queries.">
<input id="ownerinp" type="text" class="form-control-plaintext" name="Owner" placeholder="Owner"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Frame:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="frameinp" type="text" class="form-control-plaintext" name="Frame" placeholder="Frame"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Timestamp:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="timeinp" type="text" class="form-control-plaintext" name="Timestamp" placeholder="Timestamp"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Translation:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="translationinp" type="text" class="form-control-plaintext" name="Translation" placeholder="Translation"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Euler Rotation:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="erotinp" type="text" class="form-control-plaintext" name="ERotation" placeholder="Euler Rotation"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Quaternion Rotation:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="qrotinp" type="text" class="form-control-plaintext" name="QRotation" placeholder="Quaternion Rotation"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Scale:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="scaleinp" type="text" class="form-control-plaintext" name="Scale" placeholder="Scale"></input>
</div>
</div>
<div class="row">
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Transform:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Object.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Object.">
<input id="transforminp" type="text" class="form-control-plaintext" name="Transform" placeholder="Transform"></input>
</div>
</div>
Expand Down Expand Up @@ -216,18 +217,20 @@
if (newQRotation) objData["quaternion_rotation"] = stringToFloatArray(newQRotation);
if (newScale) objData["scale"] = stringToFloatArray(newScale);
if (newTransform) objData["transform"] = stringToFloatArray(newTransform);
var objUrl = "v1/object/";
var objUrl = "v1/scene/" + sceneKey + "/object/";
if (newKey) {
objData["key"] = newKey;
objUrl = objUrl + newKey;
}
objListData = {"objects": [objData]}
$.ajax({url: "v1/scene/" + sceneKey + "/object/" + newKey,
$.ajax({url: objUrl,
type: 'POST',
data: JSON.stringify(objListData),
contentType: "application/json; charset=utf-8",
success: function(data) {
console.log(data);
$("#success-alert").show();
setTimeout(function() { $("#success-alert").hide(); }, 5000);
}});
} else if (event.target.id == "cancel") {
window.location.replace("sceneBrowser");
Expand Down Expand Up @@ -265,10 +268,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Setup the button callbacks into the Javascript
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/WEB-INF/jsp/projectBrowser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@
var selectedRow = gridOptions.api.getSelectedNodes()[0].data;
window.location.replace("editProject?key=" + selectedRow.id);
} else if (event.target.id == "delete") {
delete_selected();
var r = confirm("Delete the selected project?");
if (r) {
delete_selected();
}
}
updateGridData({});
}
Expand All @@ -231,10 +234,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Execute an HTTP call to get the available asset metadata
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/projectEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</li>
</ul>
</nav>
<div class="alert alert-success" id="success-alert" style="display:none">Project Saved!</div>
<div class="row">
<div class="col-md-12">
<h1 style="text-align: center;">Project</h1>
Expand Down Expand Up @@ -249,6 +250,8 @@
contentType: "application/json; charset=utf-8",
success: function(data) {
console.log("Project Saved");
$("#success-alert").show();
setTimeout(function() { $("#success-alert").hide(); }, 5000);
}
});
}
Expand Down Expand Up @@ -415,10 +418,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Setup the button callbacks into the Javascript
Expand Down
26 changes: 20 additions & 6 deletions src/main/webapp/WEB-INF/jsp/sceneBrowser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<button id="editScene" type="button" class="btn btn-primary"><span style="font-size:larger;">Edit Scene</span></button>
<button id="createScene" type="button" class="btn btn-primary"><span style="font-size:larger;">Create Scene</span></button>
<button id="deleteScene" type="button" class="btn btn-primary"><span style="font-size:larger;">Delete Scene</span></button>
<button id="viewScnProperties" type="button" class="btn btn-primary"><span style="font-size:larger;">View Scene Properties</span></button>
</div>
</div>
</div>
Expand Down Expand Up @@ -119,6 +120,7 @@
<button id="editObject" type="button" class="btn btn-primary"><span style="font-size:larger;">Edit Object</span></button>
<button id="createObject" type="button" class="btn btn-primary"><span style="font-size:larger;">Create Object</span></button>
<button id="deleteObject" type="button" class="btn btn-primary"><span style="font-size:larger;">Delete Object</span></button>
<button id="viewObjProperties" type="button" class="btn btn-primary"><span style="font-size:larger;">View Object Properties</span></button>
</div>
</div>
</div>
Expand Down Expand Up @@ -372,7 +374,14 @@
window.location.replace("editScene?key=" + selectedRow.key);
} else if (event.target.id == "deleteScene") {
deleteSelectedScene();
var r = confirm("Delete the selected Scene?");
if (r) {
deleteSelectedScene();
}
} else if (event.target.id == "viewScnProperties") {
var selectedRow = scnGridOptions.api.getSelectedNodes()[0].data;
window.location.replace("propertyBrowser?scene=" + selectedRow.key);
} else if (event.target.id == "createObject") {
var selectedRow = scnGridOptions.api.getSelectedNodes()[0].data;
Expand All @@ -383,8 +392,16 @@
var selectedObj = objGridOptions.api.getSelectedNodes()[0].data;
window.location.replace("editObj?sceneKey=" + selectedRow.key + "&objKey=" + selectedObj.key);
} else if (event.target.id == "viewObjProperties") {
var selectedRow = scnGridOptions.api.getSelectedNodes()[0].data;
var selectedObj = objGridOptions.api.getSelectedNodes()[0].data;
window.location.replace("propertyBrowser?scene=" + selectedRow.key + "&object=" + selectedObj.key);
} else if (event.target.id == "deleteObject") {
deleteSelectedObj();
var r = confirm("Delete the selected Object?");
if (r) {
deleteSelectedObj();
}
}
}
Expand Down Expand Up @@ -433,10 +450,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
updateSceneGridData({});
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/sceneEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</li>
</ul>
</nav>
<div class="alert alert-success" id="success-alert" style="display:none">Scene Saved!</div>
<div class="row">
<div class="col-md-12">
<h1 style="text-align: center;">Scene</h1>
Expand Down Expand Up @@ -123,6 +124,8 @@
function sceneReturn(data) {
console.log(data);
$("#success-alert").show();
setTimeout(function() { $("#success-alert").hide(); }, 5000);
}
// Button click logic
Expand Down Expand Up @@ -182,10 +185,7 @@
if (!adminLoggedIn) {
// Disable the user browser link in the navbar if the logged in
// user does not have admin access
document.getElementById("userBrowser").setAttribute('class', 'nav-item disabled');
document.getElementById("userBrowserLink").click(function() {
return false;
});
document.getElementById("userBrowserLink").href = "#";
}
// Setup the button callbacks into the Javascript
Expand Down
5 changes: 4 additions & 1 deletion src/main/webapp/WEB-INF/jsp/userBrowser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@
// Logic to update the scene list based on the input query
if (event.target.id == "deleteUser") {
delete_selected();
var r = confirm("Delete the selected User?");
if (r) {
delete_selected();
}
} else {
if (event.target.id == "firstPage") {
gridOptions.api.paginationGoToPage(0);
Expand Down

0 comments on commit 73ccb3a

Please sign in to comment.