Initial commit from SVN.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Main Authenticated Page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
|
||||
<script language="javascript" src="main.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="../common.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Use one style sheet for IE and another for other browsers. -->
|
||||
<script language="javascript">
|
||||
<!--
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
//Detect what browser this is and load the specific CSS for the browser.//
|
||||
var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
|
||||
|
||||
if(isIE) {
|
||||
document.write('<'+'link rel="stylesheet" href="../main.css" type="text/css"/>');
|
||||
document.write('<'+'link rel="stylesheet" href="../main-ie.css" type="text/css"/>');
|
||||
}
|
||||
else {
|
||||
document.write('<'+'link rel="stylesheet" href="../main.css" type="text/css"/>');
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</head>
|
||||
<body id="bodyId" onLoad="init();">
|
||||
<div align="center" style="padding-top:4px;">
|
||||
<div id="page">
|
||||
<!-- The welcome and links above the border. -->
|
||||
<div id="pageTop">
|
||||
<span id="linksLeft">
|
||||
<a href="javascript:" class="topMenuLink" style="color: #400">SAMPLE LINK</a>
|
||||
</span>
|
||||
<span id="linksRight">
|
||||
<a id="logLink" href="javascript:logout();" class="topMenuLink">Logout</a>
|
||||
 |
|
||||
<a href="javascript:" class="topMenuLink" style="color: #400">SAMPLE LINK</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- Everything inside the border. -->
|
||||
<div id="pageCenter">
|
||||
<!-- TODO: Place content here. -->
|
||||
</div>
|
||||
<!-- Contains link text and navigation - outside the border. -->
|
||||
<div id="pageBottom">
|
||||
<!-- TODO: Place content here. -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyrightDiv">
|
||||
<p style="font: 8pt serif bold; color: white; padding: 0px; margin: 18px 0px 0px 0px; color: #999;">
|
||||
© DATE_HERE NAME_HERE. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
129
Foundation Web Test Webapp/web/secure/authenticated/main.js
Normal file
129
Foundation Web Test Webapp/web/secure/authenticated/main.js
Normal file
@@ -0,0 +1,129 @@
|
||||
var userContentFadeOut = 800;
|
||||
var userContentFadeIn = 1400;
|
||||
var mainFadeImageDelay = 0;
|
||||
var mainFadeImagePeriod = 2000;
|
||||
var mainFadeTitleDelay = 500;
|
||||
var mainFadeTitlePeriod = 1500;
|
||||
var mainFadeContentDelay = 1500;
|
||||
var mainFadeContentPeriod = 1000;
|
||||
|
||||
var selectedTextImgId;
|
||||
var selectedImageImgId;
|
||||
var selectedBlackTextImage;
|
||||
|
||||
var isAnonymous;
|
||||
var userName = 0;
|
||||
|
||||
//
|
||||
// Initializes the main view.
|
||||
//
|
||||
function init() {
|
||||
checkLogin(240000);
|
||||
}
|
||||
|
||||
//Sends a ping to the server on a regular basis to prevent loss of the session and to check the logged in status of the user.
|
||||
//Updates the logLink to display Log In or Log Out depending on the login state.
|
||||
// interval: The time increment between pings to the server, in milliseconds.
|
||||
function checkLogin(interval) {
|
||||
var url = "/PingController.java";
|
||||
var httpRequest = null;
|
||||
|
||||
if(window.XMLHttpRequest) {
|
||||
httpRequest = new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject) {
|
||||
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
if(httpRequest != null) {
|
||||
httpRequest.onreadystatechange = function() {
|
||||
if(httpRequest.readyState == 4) {
|
||||
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
|
||||
if(httpRequest.responseText == "") {
|
||||
location.pathname = "/secure/index.html";
|
||||
}
|
||||
else {
|
||||
if(httpRequest.responseText != userName) {
|
||||
userName = httpRequest.responseText;
|
||||
|
||||
if(userName == "Anonymous") {
|
||||
isAnonymous = true;
|
||||
}
|
||||
|
||||
//TODO: May provide a personalized welcome to the user, also might want to enable a link to change the user's settings.
|
||||
|
||||
}
|
||||
|
||||
setTimeout("checkLogin('" + interval + "')", interval);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
httpRequest.open("POST",url,true);
|
||||
httpRequest.send(null);
|
||||
}
|
||||
}
|
||||
|
||||
//Called by the login/logout link at the top of the main page.
|
||||
//Either displays the login portion of the view, or logs the user off and updates the link text.
|
||||
function logout() {
|
||||
var url = "/secure/LogoutController.java";
|
||||
var httpRequest = null;
|
||||
|
||||
if(window.XMLHttpRequest) {
|
||||
httpRequest = new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject) {
|
||||
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
if(httpRequest != null) {
|
||||
httpRequest.open("POST",url,false);
|
||||
httpRequest.send(null);
|
||||
|
||||
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
|
||||
document.getElementById("logLink").innerHTML = "Log In";
|
||||
location.pathname = "/secure/index.html"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Switches between visible components.
|
||||
// fromComponentId: The component ID that will become invisible.
|
||||
// toComponentId: The component ID that will become visible.
|
||||
// focusComponentId: The component ID that will gain focus.
|
||||
function switchComponents(fromComponentId, toComponentId, focusComponentId) {
|
||||
errorText.innerHTML = "";
|
||||
errorText.style.visibility = "hidden";
|
||||
replaceFade(fromComponentId, userContentFadeOut, 5, toComponentId, userContentFadeIn, 5, focusComponentId);
|
||||
}
|
||||
|
||||
//
|
||||
// Called by the mouse over and out functions of the images and text associated with the main menu items.
|
||||
//
|
||||
function mainMenuRollover(textImageId, imageUrl) {
|
||||
if(selectedTextImgId != textImageId) {
|
||||
document.getElementById(textImageId).src = imageUrl;
|
||||
}//if//
|
||||
}//mainMenuRollover()//
|
||||
|
||||
//
|
||||
// Opens the edit user settings popup.
|
||||
//
|
||||
function openSettings() {
|
||||
var w = window.open('/secure/authenticated/identified/SettingsViewController.java', 'SettingsEditor', 'width=800,height=700,status,scrollbars,resizable');
|
||||
w.focus();
|
||||
}
|
||||
|
||||
//
|
||||
// Opens a window to send a message to the company.
|
||||
//
|
||||
function contactUsClicked() {
|
||||
window.open('/secure/ContactUsViewController.java', 'ContactUsEditor', 'width=800,height=800,status,scrollbars,resizable');
|
||||
}
|
||||
Reference in New Issue
Block a user