function showBoxUI(boxAccessToken) { console.log("tok:" + boxAccessToken) $(".view").hide(); var folderId = '0'; var contentExplorer = new Box.ContentExplorer(); contentExplorer.show(folderId, boxAccessToken, { container: '#app-container', logoUrl: 'box', contentPreviewProps: { contentSidebarProps: { detailsSidebarProps: { hasNotices: true, hasProperties: true, hasAccessStats: true, hasVersions: true }, hasActivityFeed: true, hasSkills: true, hasMetadata: true } } }) $("#app-container").height(800); console.log("show colla"); $(".collapsible").show(); var coll = document.getElementsByClassName("collapsible"); var i; for (i = 0; i < coll.length; i++) { coll[i].addEventListener("click", function () { this.classList.toggle("active"); var content = this.nextElementSibling; if (content.style.display === "block") { content.style.display = "none"; $("#userinfo").text("Show user info"); } else { content.style.display = "block"; $("#userinfo").text("Hide user info"); } }); } $("#app-container").show(); $("#myModal").toggle(); $(".load").hide(); } // Operations when the web page is loaded. $(document).ready(function() { $("#imagemodal").toggle(); $("#popreg").on("click", function () { $('#license').hide(); $('#imagepreview').show(); $('#imagepreview').attr('src', '/img/register.png'); $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function }); $("#poplog").on("click", function () { $('#license').hide(); $('#imagepreview').show(); $('#imagepreview').attr('src', '/img/login.png'); $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function }); $("#lic").on("click", function () { $('#license').show(); $('#imagepreview').hide(); $('#license').html(''+ 'Copyright 2022 Peter Christensen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:' + '
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
' + 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.'); $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function }); $(".tab-pane").hide();; $("#statusNotAuth").hide(); $("#statusAuth").hide(); $("#signInButton").click( function () { window.location.href='/login'; }); }); // Operations when signed in. function showSignedIn() { console.log("calling signed out") $("#statusNotAuth").hide(); $("#statusAuth").show(); $("#signInButton").text("Sign Out"); } // Operations when signed out. function showSignedOut() { $("#statusNotAuth").show(); $("#statusAuth").hide(); closeTab("userdetails"); } function getBoxToken(userId) { console.log(userId); $.post("/boxUI", { userId: userId }, function (json) { console.log(json); console.log("msg: " + JSON.stringify(json.accessToken)); accessToken = json.accessToken; showBoxUI(accessToken); $("#user").append("Auth0 User:" + json.userName).append("
"); $("#user").append("Auth0 ID:" + json.auth0Id).append("
"); $("#user").append("Box User ID:" + json.boxId).append("
"); $("#user").append("Box external app user ID:" + json.extId).append("
"); $("#user").append("Box User Name:" + json.userName).append("
"); $("#user").append("Box User Login:" + json.login).append("
"); }) };