[mod] getBaseUrl moved to its own file

This commit is contained in:
Jose Pabl Domingo Aramburo Sanchez 2018-08-12 09:07:48 -06:00
parent cb5d30b4e0
commit 697d0fe769
4 changed files with 13 additions and 6 deletions

View File

@ -238,4 +238,5 @@ if(!isset($_SESSION['userName'])){
</div>
</body>
<script src="../js/getBaseUrl.js"></script>
<link href="../css/panel.css" rel="stylesheet">

View File

@ -50,4 +50,5 @@ if(isset($_SESSION['userName'])){
</div>
<script src="../js/login.js"></script>
<script src="../js/getBaseUrl.js"></script>
<link href="../css/login.css" rel="stylesheet">

View File

@ -0,0 +1,10 @@
/**
* Returns the entry point url for the system, this url will be used
* to access both the api and the static resources
*
* @returns {string}
*/
function getbaseUrl(){
var url = window.location.href;
return url.substring(0, url.indexOf('/html/'));
}

View File

@ -1,10 +1,5 @@
function getbaseUrl(uriPath){
var url = window.location.href;
return url.substring(0, url.indexOf(uriPath));
}
function processLogin() {
var baseUrl = getbaseUrl('/html/');
var baseUrl = getbaseUrl();
var parametros = {
"userName":$('#userName').val(),