java.js
// opens a page from the navigation. if the same page is opened twice it should return back to the home screen
opens a page from the navigation. if the same page is opened twice it should return back to the home screen
opens a page from the navigation . if the same page is opened twice it should return back to the home screen
function openPage(pageName) {
	if (isloading === 0) {
		if (pageName === 'settings') {
			if (isHome === 2) {
				isHome = 0;
				var i, tabcontent;
				tabcontent = document.getElementsByClassName("tabcontent");
				for (i = 0; i < tabcontent.length; i++) {tabcontent[i].style.display = "none";}
				document.getElementById('upspage').style.display = "block";
			} else {
				isHome = 2;
				var i, tabcontent;
				tabcontent = document.getElementsByClassName("tabcontent");
				for (i = 0; i < tabcontent.length; i++) {tabcontent[i].style.display = "none";}
				document.getElementById(pageName).style.display = "block";
			}
		}
		if (pageName === 'statistics') {
			if (isHome === 1) {
				isHome = 0;
				var i, tabcontent;
				tabcontent = document.getElementsByClassName("tabcontent");
				for (i = 0; i < tabcontent.length; i++) {tabcontent[i].style.display = "none";}
				document.getElementById('upspage').style.display = "block";
			} else {
				isHome = 1;
				var i, tabcontent;
				tabcontent = document.getElementsByClassName("tabcontent");
				for (i = 0; i < tabcontent.length; i++) {tabcontent[i].style.display = "none";}
				document.getElementById(pageName).style.display = "block";
			}
		} else {
			if (pageName === 'upspage') {isHome = 0;} else {isHome = 1;}
			var i, tabcontent;
			tabcontent = document.getElementsByClassName("tabcontent");
			for (i = 0; i < tabcontent.length; i++) {tabcontent[i].style.display = "none";}
			document.getElementById(pageName).style.display = "block";
		}
	}
}
function openPage ( pageName ) { if ( isloading === 0 ) { if ( pageName === 'settings' ) { if ( isHome === 2 ) { isHome = 0 ; var i , tabcontent ; tabcontent = document . getElementsByClassName ( "tabcontent" ) ; for ( i = 0 ; i < tabcontent . length ; i ++ ) { tabcontent [ i ] . style . display = "none" ; } document . getElementById ( 'upspage' ) . style . display = "block" ; } else { isHome = 2 ; var i , tabcontent ; tabcontent = document . getElementsByClassName ( "tabcontent" ) ; for ( i = 0 ; i < tabcontent . length ; i ++ ) { tabcontent [ i ] . style . display = "none" ; } document . getElementById ( pageName ) . style . display = "block" ; } } if ( pageName === 'statistics' ) { if ( isHome === 1 ) { isHome = 0 ; var i , tabcontent ; tabcontent = document . getElementsByClassName ( "tabcontent" ) ; for ( i = 0 ; i < tabcontent . length ; i ++ ) { tabcontent [ i ] . style . display = "none" ; } document . getElementById ( 'upspage' ) . style . display = "block" ; } else { isHome = 1 ; var i , tabcontent ; tabcontent = document . getElementsByClassName ( "tabcontent" ) ; for ( i = 0 ; i < tabcontent . length ; i ++ ) { tabcontent [ i ] . style . display = "none" ; } document . getElementById ( pageName ) . style . display = "block" ; } } else { if ( pageName === 'upspage' ) { isHome = 0 ; } else { isHome = 1 ; } var i , tabcontent ; tabcontent = document . getElementsByClassName ( "tabcontent" ) ; for ( i = 0 ; i < tabcontent . length ; i ++ ) { tabcontent [ i ] . style . display = "none" ; } document . getElementById ( pageName ) . style . display = "block" ; } } }
opens a page from the navigation.
opens a page from the navigation .