wip javascript

This commit is contained in:
John Woodlock
2012-07-05 19:53:58 +10:00
parent 425ff4b539
commit f1f3fc5873
2 changed files with 17 additions and 14 deletions
+1 -9
View File
@@ -1401,16 +1401,11 @@
<style type="text/css">
#container {
display: none;
}
#toptable {
display: none;
}
</style>
<div id="logonDiv"></div>
<div id="container"></div>
@@ -1436,14 +1431,11 @@ $(document).ready(function() {
jsViewsRegisterHelpers();
showMainContainer("container");
//baseApiUrl = "https://localhost:8443/mifosng-provider/api/v1/";
baseApiUrl = "https://ec2-46-137-62-163.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/";
if (QueryParameters["baseApiUrl"]) baseApiUrl = QueryParameters["baseApiUrl"];
showILLogon("logonDiv");
showILLogon("container");
});
</script>
+16 -5
View File
@@ -62,7 +62,7 @@ function doI18N(xlateStr, params) {
// load html functions
function showMainContainer(containerDivName) {
function showMainContainer(containerDivName, username) {
var htmlVar = '<div id="logowrapper">';
htmlVar += ' <span style="float: left">';
@@ -93,12 +93,12 @@ function showMainContainer(containerDivName) {
htmlVar += ' <li><a href="?lang=zh">zh</a></li>';
htmlVar += ' </ul>';
htmlVar += ' </li>';
htmlVar += ' <li><a href="org/admin/settings" class="dmenu">xxxxxxxxmifos</a>';
htmlVar += ' <li><a href="org/admin/settings" class="dmenu">' + username + '</a>';
htmlVar += ' <ul>';
htmlVar += ' <li><a href="org/admin/settings">' + doI18N("link.topnav.account.settings") + '</a></li>';
htmlVar += ' </ul>';
htmlVar += ' </li>';
htmlVar += ' <li><a href="signout">' + doI18N("link.signout") + '</a></li>';
htmlVar += ' <li><a href="unknown.html" onclick="signOut(' + "'" + containerDivName + "'" + ');return false;">' + doI18N("link.signout") + '</a></li>';
htmlVar += '</ul>';
htmlVar += '<br class="clear">';
htmlVar += '</div><div style="float:none; clear:both;">';
@@ -134,12 +134,12 @@ function setBasicAuthKey(logonDivName, username, password)
cache : false,
success : function(data, textStatus, jqXHR) {
base64 = data.base64EncodedAuthenticationKey;
$("#" + logonDivName).hide();
$("#container").show();
showMainContainer(logonDivName, username);
showILClientListing();
return false;
},
error : function(jqXHR, textStatus, errorThrown) {
//actually should have more checking here, its not just invalid user/pwd that may get here
alert("Invalid Username/Password");
return true;
}
@@ -1592,3 +1592,14 @@ function selectNewThousandsSep(selectedVal) {
}
}
}
//sign-out
function signOut(containerDivName) {
base64 = "";
$("#" + containerDivName).html("");
alert("Close the Browser for a Complete Sign Out");
}