U102328 7 anni fa
parent
commit
30ecaad1e9
3 ha cambiato i file con 25 aggiunte e 6 eliminazioni
  1. 1 0
      userWeb/UI/css/control.css
  2. 7 6
      userWeb/UI/js/control.js
  3. 17 0
      userWeb/config/common.js

+ 1 - 0
userWeb/UI/css/control.css

@@ -240,6 +240,7 @@
     width: 100%;
     height: 100%;
     text-align:right;
+    z-index: 2;
 }
 #control_menu .main{
     width: 27%;

+ 7 - 6
userWeb/UI/js/control.js

@@ -73,14 +73,15 @@ function controlF(){
 		}
 		function Lanclick(inde){
 			en[0].onclick = function(){
-				if (inde==1)return;
+				// if (inde==1)return;
 				var url = window.location.href;
 
-				if (url.indexOf("?")>0) {
-					var url = url+"&languageMark=0"
-				}else{
-					var url = url+"?languageMark=0"
-				}
+				// if (url.indexOf("?")>0) {
+				// 	var url = url+"&languageMark=0"
+				// }else{
+				// 	var url = url+"?languageMark=0"
+				// }
+				changeURLPar(url,languageMark,)
 				window.location.href=url; 
 			}
 			cn[0].onclick = function(){

+ 17 - 0
userWeb/config/common.js

@@ -31,4 +31,21 @@ function dynamicLoadScript(src){ //src相对路径
 	scriptObj.type = "text/javascript";
 	// document.getElementById(id)[0].appendChild(scriptObj);
 	document.getElementsByTagName('body')[0].appendChild(scriptObj);
+}
+function changeURLPar(destiny, par, par_value){
+	var pattern = par+'=([^&]*)'; 
+	var replaceText = par+'='+par_value; 
+	if (destiny.match(pattern)){
+		var tmp = '/\\'+par+'=[^&]*/'; 
+		tmp = destiny.replace(eval(tmp), replaceText); 
+		return (tmp); 
+	}
+	else{
+		if (destiny.match('[\?]')){
+			return destiny+'&'+ replaceText; 
+		}else{
+			return destiny+'?'+replaceText; 
+		}
+	}
+	return destiny+'\n'+par+'\n'+par_value; 
 }