From 306b4cd70b2d1159e75c9dcca8004e0556b25f85 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 6 Jul 2005 13:38:23 +0000 Subject: [PATCH] got rid of the login page in favor of the login popup box git-svn-id: svn://svn.open-ils.org/ILS/trunk@1070 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/javascript/opac/OPACStartPage.js | 20 +++++++++++--------- Open-ILS/src/javascript/opac/Page.js | 21 +++++++++++++++++---- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Open-ILS/src/javascript/opac/OPACStartPage.js b/Open-ILS/src/javascript/opac/OPACStartPage.js index e9100749b0..6efd9b28f4 100644 --- a/Open-ILS/src/javascript/opac/OPACStartPage.js +++ b/Open-ILS/src/javascript/opac/OPACStartPage.js @@ -23,14 +23,13 @@ var globalOPACStartPage = null; function OPACStartPage() { debug("In OPACStartPage()"); - //this.searchBar = new SearchBarChunk(); this.searchBrFormChunk = new SearchBarFormChunk(); if( globalOPACStartPage ) { return globalOPACStartPage; } - + this.init(); globalOPACStartPage = this; } @@ -42,15 +41,18 @@ OPACStartPage.prototype.instance = function() { } OPACStartPage.prototype.init = function() { - //this.searchBar.reset(); + globalSearchBarFormChunk.resetPage(); - /* - var menu = globalMenuManager.buildMenu("record_result_row","record_result_row_1"); - globalAppFrame.document.body.appendChild(menu.getNode()); - getById('help').setAttribute("oncontextmenu", - "logicNode.globalMenuManager.getMenu('record_result_row_1').toggle(); return false;"); - */ + var login = getById("login_link"); + + if(!UserSession.instance().verifySession()) { + login.setAttribute("href","javascript:void(0);"); + var func = function(){url_redirect(["target","my_opac"])}; + var diag = new LoginDialog(getDocument().body, func); + login.onclick = function(){diag.display(login);} + } } + OPACStartPage.prototype.doSearch = function() { } diff --git a/Open-ILS/src/javascript/opac/Page.js b/Open-ILS/src/javascript/opac/Page.js index 125749e5c8..54e0995e2c 100644 --- a/Open-ILS/src/javascript/opac/Page.js +++ b/Open-ILS/src/javascript/opac/Page.js @@ -209,13 +209,26 @@ Page.prototype.buildNavBox = function(full) { var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath; arr.push(elem("a", {href: prefix + '?target=advanced_search'}, null, "Advanced Search")); - arr.push(elem("a", {href: prefix + '?target=my_opac'}, null, "My OPAC")); - //arr.push(elem("a", {href: prefix + '?target=about'}, null, "About PINES")); + + + var mylink = elem("a", {href: "?target=my_opac"}, null, "My OPAC"); + arr.push(mylink); + + /* if user is not logged in, popup the login dialog when they + select the myopac link */ + if(!UserSession.instance().verifySession()) { + mylink.setAttribute("href","javascript:void(0);"); + var func = function(){url_redirect(["target","my_opac"])}; + var diag = new LoginDialog(getDocument().body, func); + mylink.onclick = function(){diag.display(mylink);} + } + + if(loc) arr.push(this.buildDeepLink()); if(UserSession.instance().verifySession()) { - //arr.push(elem("a", {href: prefix + "?target=logout"}, null, "Logout")); - var a = elem("a", {href:globalRootPath}, null, "Logout"); + var a = elem("a", {href:"http://" + globalRootURL + ":" + + globalPort + "/" + globalRootPath}, null, "Logout"); a.onclick = doLogout; arr.push(a); } -- 2.11.0