⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsonrpc_ah.js

📁 能够实现宾馆管理的基本功能。 例如删除
💻 JS
字号:
/* ATTENTION 1 : NE PAS FAIRE DE PROTOTYPE POUR L INSTANT DANS CE JS PAR MESURE DE COMPATIBILITE AVEC LES PAGE COMPORTANT TJS DU PSEUDOJS   ATTENTION 2 : <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> est obligatoire sur la pages incluant ce js */document.write('<script type="text/javascript" src="/scripts-v54/dwr/engine.js"></script>');document.write('<script type="text/javascript" src="/scripts-v54/dwr/interface/RemoteView.js"></script>');var jsonrpc;var preventCall=false;var beans;var beanToLoad;var dummyElement;var codeLang;var viewBeans;/*Initialisation des beans par leurs noms declares*/function initBeanList(beanNames){	if (beanNames){		beanToLoad="beans="+beanNames;		var tabBean = beanNames.split(";");		beans = new Array;		for(var num=0;num<tabBean.length;num++)			beans.unshift(new Bean(tabBean[num]));	} else		 alert("Attention: Pas de beans declares!");}/*Decalaration de l objet bean*/function Bean(nomBean){	this.nom = nomBean;	this.bean= null;}/*Initialisation de la vue*/function initView(viewBeans) {	for( var num=0;num<beans.length; num++)		beans[num].bean = viewBeans[beans[num].nom];}function updateView(actionName, viewName, parameters){	try {		if (preventCall==false) {			preventCall=true;			if (!codeLang)				codeLang = getDirLangFromHtmlAttrib();						      RemoteView.getViewBeans(actionName, viewName, parameters, codeLang, { callback:function(data) {          viewBeans = data;                     initView(viewBeans);         }, async:false        , errorHandler:function(errorString, exception) {                             if (errorString && errorString.startsWith("Erreur de session")){              document.location='/'+ codeLang + '/session/expired.html';            }                            throw exception;                      }        }, document.referrer            );						rewriteView();		}	} catch(e) {		if (e.name == "JSONRpcClientException" ) {			/* Redirection vers page err tech			if (!codeLang || codeLang=="")				var errPage = "/gb/error/error.shtml";			else				var errPage = "/" + codeLang + "/error/error.shtml";			if (parent.location.href == self.location.href)				 document.location.href = errPage;			else				 parent.location.href = errPage;			alert("UpdateView failed: " + e);			*/		} else			throw e;	} finally {		preventCall=false;	}}/* Permet de recuperer la langue de la page. Meta OBLIGATOIRE sur les pages incluant ce js !<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> */function getDirLangFromHtmlAttrib() {	var htmlTag = document.getElementsByTagName("html")[0];	var langue = "";	if(htmlTag.attributes["xml:lang"] && htmlTag.attributes["xml:lang"].value)		langue = htmlTag.attributes["xml:lang"].value;	else if(htmlTag.attributes["lang"] && htmlTag.attributes["lang"].value)		langue = htmlTag.attributes["lang"].value;	return convertEn2Gb(langue);}function convertEn2Gb(langue) {	if (langue && langue.toUpperCase()=="EN")		langue = "gb";  return langue;}function fillSelect(selectId, values, selectedValue, blankValue){	// si l element n est pas present, on sort	if (!document.getElementById(selectId)) return;	var selectElement = document.getElementById(selectId);	//On force le nettoyage du select	selectElement.options.length=0;	selectElement.innerHTML="";	var index = 0;	var selectIndex = -1;	if(blankValue!=null)		selectElement[index++]=new Option(blankValue, "");	for(var mapKey in values){		//On regarde si c est une option ou un groupe d ptions		//Cas groupe d options		if(values[mapKey]!=null && typeof(values[mapKey]) == 'object'){			var oGroup = document.createElement('optgroup');			oGroup.label = mapKey;			selectElement.appendChild(oGroup);			var options = values[mapKey];			for(var optionKey in options){				var oOption = document.createElement('option');				oOption.value = optionKey;				oOption.innerHTML = options[optionKey];				oGroup.appendChild(oOption);			}		}		//Cas option seule		else {			//BUG IE : bug sur innerHTML dans un select et pb constrinction select en DOM + selection valeur pas defaut			selectElement.options[index] = new Option(values[mapKey],mapKey);		}		if(selectedValue!= null && mapKey==selectedValue){			selectIndex=index;		}		index++;	}	if(selectIndex!=-1){	 //alert(selectIndex);		selectElement.selectedIndex=selectIndex;	}else		selectElement.selectedIndex=0;}function fillSelectWithKeys(selectId, values, selectedValue, blankValue){	// si l element n est pas present, on sort	if (!document.getElementById(selectId)) return;	var selectElement = document.getElementById(selectId);	selectElement.options.length=0;	var index = 0;	var selectIndex = -1;	if(blankValue && blankValue!=null)		selectElement[index++]=new Option(blankValue, "");	for(var mapKey in values){		selectElement[index]=new Option(mapKey, mapKey);		if(selectedValue!= null && mapKey==selectedValue){			selectIndex=index;		}		index++;		if(selectIndex!=-1)			selectElement.selectedIndex=selectIndex;		else			selectElement.selectedIndex=0;	}}function updateCheckBoxStatus(checkBoxId){	// si l element n est pas present, on sort	if (!document.getElementById(checkBoxId)) return;	var checkBoxElement = document.getElementById(checkBoxId);	if(checkBoxElement.checked)		checkBoxElement.value="ON";	else		checkBoxElement.value="";}function selectOption(selectid, selectedValue){	// si l element n est pas present, on sort	if (!document.getElementById(selectid)) return;	var selectElement = document.getElementById(selectid);	if(selectElement && selectElement.options){		for(var i=0; i<selectElement.options.length; i++){			if(selectElement.options[i].value==selectedValue)				selectElement.selectedIndex=i;		}	}}function checkRadio(radioElement, selectedValue){	// si l element n est pas present, on sort	if (!radioElement) return;	for(var i=0; i<radioElement.length; i++){		if(radioElement[i].value==selectedValue)			radioElement[i].checked=true;	}}// fonction qui retourne un element s il existe, sinon retourne un element dummy qui n est jamais ecrit dans la page// mais qui permet de faire fonctionner le js meme si l element cherche n existe pasfunction getElementByIdIfExists(id){	if (document.getElementById(id)){		return document.getElementById(id);	} else {		// creation d un element dummy s il n existe pas		if (!dummyElement)			dummyElement = document.createElement('dummy_json_rpc');		return dummyElement;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -