//   IMB=new Array(); IMB["Load"]=true; IMB["ISSP"]=false; IMB["ww"]=window.innerWidth; if(IMB["ww"] <= 768){IMB["ISSP"]=true;} IMB["AjaxRequestAfterFunc"]=null; IMB["OnLoad"]=new Array(); IMB["OnLoadRun"]=function(){ for(let i=0;i < IMB["OnLoad"].length;i++){ IMB["OnLoad"][i](); } } // /*window.onload=IMB["OnLoadRun"]; //*/ IMB["SessionAliveSkip"]=true; IMB["sendf"]=true; IMB["IMBInit"]=function(){//ブラウザのバックボタンで戻って来た時用。特に IMB["sendf"]=true; が必要 //IMB["SessionAliveSkip"]=false; IMB["sendf"]=true; IMB["ISSP"]=false; if(window.innerWidth < 768){IMB["ISSP"]=true;} } IMB["OnLoad"].push(IMB["IMBInit"]); IMB["presend"]=function(d,x){ EntityMethod=function(){ if(IMB["sendf"]){ if(IMV["AllValid"]()){ if(IMB["ISSessionAlive"]()){ IMB["sendf"]=false; if(d){return x(IMB["AjaxRequest"]("POST","./",{"Content-Type":"application/x-www-form-urlencoded"},IMB["EncodeHTMLForm"](d)));} else{document.getElementById("forma").submit();} IMB["sendf"]=true; } else{IMB["ReSession"](this);} } } } EntityMethod(); } IMB["SetSessionAliveSkip"]=function(){ IMB["SessionAliveSkip"]=true; } IMB["ISSessionAlive"]=function(){ if(IMB["SessionAliveSkip"]){return true;} let iss=IMB["AjaxRequest"]("GET","./?res=IsSessionAlive",{},null); if(iss == "alive"){return true;} else{return false;} } IMB["AfterReSessionJS"]=null; IMB["ReSession"]=function(x){ IMB["AfterReSessionJS"]=x; document.getElementById("IMPopupPlate").innerHTML=IMB["AjaxRequest"]("GET","./?res=ReSession",{},null); document.getElementById("IMPopupPlate").style.display="block"; document.getElementById("IMPopupPlateBackModal").style.display="block"; document.getElementById("IMReSessionBtnPlate").innerHTML=IMB["MakeLinkParts"]('IMB["ReSessionLogin"]()','ログインする')+"    "+IMB["MakeLinkParts"]('/?rev=logout','ログアウト'); } IMB["ReSessionKeyCatch"]=function(){ if(event.keyCode == "13"){IMB["ReSessionLogin"]();} } IMB["ReSessionLogin"]=function(d){ let ucc=d; if(!ucc){ucc="";} let SendData={ "res":'direct' ,"rev":'login' ,"mode":'iss' ,"cu":IMB["UserIDR"] ,"ucc":ucc ,"iid":document.getElementById("Formrs-iid").value ,"ips":document.getElementById("Formrs-ips").value } let iss=IMB["AjaxRequest"]('POST','./',{"Content-Type":"application/x-www-form-urlencoded"},IMB["EncodeHTMLForm"](SendData)); if(iss.substring(0,7) == "error: "){alert(iss.substring(7));} else if(iss == UserIDR){ if(IMB["AfterReSessionJS"]){ IMB["AfterReSessionJS"].EntityMethod(); IMB["AfterReSessionJS"]=null; } IMB["PopupHide"](); } else if(iss == "retry"){alert("IDまたはパスワードが違います");} else{ if(ucc){location.href="./?res=mgr/top";} if(confirm("異なるユーザーとしてログインしようとしていますが、ユーザーを切り替えてトップページに戻っていいですか?")){ IMB["ReSessionLogin"]("ucc"); } } } IMB["EncodeHTMLForm"]=function(data){ let params=[]; for(let name in data){ let value=data[name]; let param=encodeURIComponent(name)+'='+encodeURIComponent(value); params.push(param); } return params.join('&').replace(/%20/g,'+'); } IMB["AjaxRequest"]=function(m,u,ct,d){ let ARajax; if(window.XMLHttpRequest){ARajax=new XMLHttpRequest();} else if(window.ActiveXObject){ try{ARajax=new ActiveXObject("Msxml2.XMLHTTP");} catch(e){ARajax=new ActiveXObject("Microsoft.XMLHTTP");} } if(IMB["AjaxRequestAfterFunc"]){ ARajax.onreadystatechange=function(){ if((ARajax.readyState == 4) && (ARajax.status == 200)){IMB["AjaxRequestAfterFunc"](ARajax.responseText);} } ARajax.open(m,u,true); } else{ARajax.open(m,u,false);} for(let i in ct){ARajax.setRequestHeader(i,ct[i]);} ARajax.send(d); if(!IMB["AjaxRequestAfterFunc"]){return ARajax.responseText;} } IMB["Popup"]=function(u,m,d){ EntityMethod=function(){ let result=""; if(d){result=d;} else{ result=IMB["AjaxRequest"]("GET",u,{},null); if(result.substring(0,7) == "error: "){ if(result.substring(0,21) == "error: NeedRessesion "){IMB["ReSession"](this);} else{alert(result);} return false; } } document.getElementById("IMPopupPlate").innerHTML='
X
'+result; document.getElementById("IMPopupPlate").style.display="block"; document.getElementById("IMPopupPlateBack"+m).style.display="block"; } EntityMethod(); } IMB["PopupHide"]=function(){ document.getElementById("IMPopupPlate").innerHTML=""; document.getElementById("IMPopupPlate").style.display="none"; document.getElementById("IMPopupPlateBack").style.display="none"; document.getElementById("IMPopupPlateBackModal").style.display="none"; } IMB["MakeLinkParts"]=function(url,str,cl){ let cls="MGRBTN"; if(cl){cls=cl;} let u=url; if(IMB["ISSP"]){ if((url.substring(0,1) == "/") || (url.substring(0,2) == "./") || (url.substring(0,7) == "http://") || (url.substring(0,8) == "https://")){u="location.href='"+u+"'";} return ''; } else{ if((url.substring(0,1) == "/") || (url.substring(0,2) == "./") || (url.substring(0,7) == "http://") || (url.substring(0,8) == "https://")){} else{u="javascript:"+u;} return '
'+str+'
'; } } IMB["NowUploadObj"]=null; IMB["NowUploadStat"]=false; IMB["NowUploadResult"]=""; IMB['UpFileSelect']=function(d){ IMP["FileUpOption"]=new Array(); if(document.getElementById("IMFileForm-"+d)){document.getElementById("IMFileForm-"+d).click();} else{alert("要素 IMFileForm-"+d+" が存在しません");} } IMB['FileUpload']=function(obj,sm,ct){ if(obj.id.substring(0,11) != "IMFileForm-"){alert("要素のidの形式が正しくありません "+obj.id);return false;} if(obj.id.length < 12){alert("要素のidの形式が正しくありません "+obj.id);return false;} if(IMB["NowUploadObj"]){alert("現在、他のアップロード処理が進行中です。しばらくお待ちください。");return false;} if(sm){ if(obj.files.length > 1){alert("アップロードするファイルは1度に1つです");return false;} } let c=0; for(let i=0;i < obj.files.length;i++){ if(ct == "image"){ if(obj.files[i].type.match(/image.*/)){c++;} else{alert("想定されているファイル形式ではないファイルが含まれています");return false;} } else{c++;} } if(c == 0){alert("アップロードするファイルはありませんでした");return false;} if(document.getElementById("IMFileFormStat-"+obj.id.substring(11))){document.getElementById("IMFileFormStat-"+obj.id.substring(11)).innerHTML="アップロード中";} IMB["NowUploadObj"]=obj; setTimeout("IMB['FileUploadSend']()",10); } IMB["FileUploadSend"]=function(){ let fd=new FormData(); fd.append('rev','mgr/lib/FileUp'); fd.append("file",IMB["NowUploadObj"].files[0]); if(IMP["FileUpOption"]){ for(let i in IMP["FileUpOption"]){fd.append(i,IMP["FileUpOption"][i]);} } IMB["NowUploadStat"]=false; let result=IMB["AjaxRequest"]('POST','./',{},fd); if(result.substring(0,7) == "error: "){let err=result.split("\n");alert((err.pop).substring(7));IMB["NowUploadResult"]=err.join("\n");} else if(result.substring(0,9) == "success: "){IMB["NowUploadStat"]=true;IMB["NowUploadResult"]=result.substring(9);} else{alert("unknown error ".result);IMB["NowUploadResult"]="irregal";} IMB["FileUpFinalize"](); } IMB["FileUpFinalize"]=function(){ //プレビューに画像表示含め、要素の再構築(input type=file には値が入ってしまっているので、タグを空にする意味でも要素再構築が必要) if(IMP["FileUpFinalize"]){IMP["FileUpFinalize"]();} IMB["NowUploadResult"]=""; IMB["NowUploadStat"]=false; IMB["NowUploadObj"]=null; } document.write("
"); document.getElementById("RankerElem").innerHTML=IMB["AjaxRequest"]("GET","/ranker/?ex-annaisyo",{},"");