diff --git a/document_roots/webhost/assets/css/style.css b/document_roots/webhost/assets/css/style.css index 6e27941..f653b57 100644 --- a/document_roots/webhost/assets/css/style.css +++ b/document_roots/webhost/assets/css/style.css @@ -1,3 +1,29 @@ +/* Sticky Footer Start */ +html { + position:relative; + min-height:100%; +} + +body { + margin-bottom:60px; +} + +.sticky-footer { + position:absolute; + bottom:0; + width:100%; + height:60px; + line-height:60px; + background-color:#E0EBF5; +} +/* Sticky Footer End */ + +/* Navbar Start */ .navbar { background-color:#E0EBF5 !important; } + +#logoutForm > button { + cursor:pointer; +} +/* Navbar End */ diff --git a/document_roots/webhost/assets/js/formHandlers/login.js b/document_roots/webhost/assets/js/formHandlers/login.js new file mode 100644 index 0000000..3d12a41 --- /dev/null +++ b/document_roots/webhost/assets/js/formHandlers/login.js @@ -0,0 +1,31 @@ +jQuery('#loginForm').on('submit', function(e){ + e.preventDefault(); + + var formData = {}; + for(var y = 0, yy = this.length; y < yy; y++) { + var input = this[y]; + if(input.name) { + formData[input.name] = input.value; + } + } + + var xhr = new XMLHttpRequest(); + xhr.open(jQuery(this).attr('method'), jQuery(this).attr('action'), true); + xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); + xhr.send(JSON.stringify(formData)); + + xhr.onloadend = function() { + if(xhr.status == 200 || xhr.status == 204) { + jQuery('.index-alert').html('Login Success: Redirecting in 2 seconds...'); + jQuery('.index-alert').removeClass('alert-danger').addClass('alert-success').removeClass('d-none'); + + setTimeout(function(){ + window.location.href = "/gPanel.html"; + }, 2000); + } + else { + jQuery('.index-alert').html("Login Error: " + xhr.response); + jQuery('.index-alert').removeClass('alert-success').addClass('alert-danger').removeClass('d-none'); + } + } +}); diff --git a/document_roots/webhost/assets/js/formHandlers/logout.js b/document_roots/webhost/assets/js/formHandlers/logout.js new file mode 100644 index 0000000..cf2e99a --- /dev/null +++ b/document_roots/webhost/assets/js/formHandlers/logout.js @@ -0,0 +1,20 @@ +jQuery('#logoutForm').on('submit', function(e){ + e.preventDefault(); + + var check = confirm('Are you sure you want to logut?'); + + if(check) { + var xhr = new XMLHttpRequest(); + xhr.open(jQuery(this).attr('method'), jQuery(this).attr('action'), true); + xhr.send(); + + xhr.onloadend = function() { + if(xhr.status == 200 || xhr.status == 204) { + window.location.href = '/'; + } + else { + alert('An error has occurred. Please contact your server\'s administrator.'); + } + } + } +}); diff --git a/document_roots/webhost/assets/js/formHandlers/register.js b/document_roots/webhost/assets/js/formHandlers/register.js new file mode 100644 index 0000000..074a719 --- /dev/null +++ b/document_roots/webhost/assets/js/formHandlers/register.js @@ -0,0 +1,27 @@ +jQuery('#registerForm').on('submit', function(e){ + e.preventDefault(); + + var formData = {}; + for(var y = 0, yy = this.length; y < yy; y++) { + var input = this[y]; + if(input.name) { + formData[input.name] = input.value; + } + } + + var xhr = new XMLHttpRequest(); + xhr.open(jQuery(this).attr('method'), jQuery(this).attr('action'), true); + xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); + xhr.send(JSON.stringify(formData)); + + xhr.onloadend = function() { + if(xhr.status == 200 || xhr.status == 204) { + jQuery('.index-alert').html('Register Success: You may now login.'); + jQuery('.index-alert').removeClass('alert-danger').addClass('alert-success').removeClass('d-none'); + } + else { + jQuery('.index-alert').html("Register Error: " + xhr.response); + jQuery('.index-alert').removeClass('alert-success').addClass('alert-danger').removeClass('d-none'); + } + } +}); diff --git a/document_roots/webhost/assets/js/formHandlers/search.js b/document_roots/webhost/assets/js/formHandlers/search.js new file mode 100644 index 0000000..e659a8a --- /dev/null +++ b/document_roots/webhost/assets/js/formHandlers/search.js @@ -0,0 +1,4 @@ +jQuery('#searchForm').on('submit', function(e){ + e.preventDefault(); + alert('Search functionality coming soon.'); +}); diff --git a/document_roots/webhost/assets/js/main.js b/document_roots/webhost/assets/js/main.js deleted file mode 100644 index 8b13789..0000000 --- a/document_roots/webhost/assets/js/main.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/document_roots/webhost/gPanel.html b/document_roots/webhost/gPanel.html index b1100bd..599f395 100644 --- a/document_roots/webhost/gPanel.html +++ b/document_roots/webhost/gPanel.html @@ -7,19 +7,23 @@ +
@@ -40,11 +44,25 @@ + + - + +