var ENCODE={a:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',encode:function($){$=this.cc($);var str=new Array();var ch1,ch2,ch3;var pos=0;while(pos+3<=$.length){ch1=$.charCodeAt(pos++);ch2=$.charCodeAt(pos++);ch3=$.charCodeAt(pos++);str.push(this.a.charAt(ch1>>2),this.a.charAt(((ch1<<4)+(ch2>>4))&0x3f));str.push(this.a.charAt(((ch2<<2)+(ch3>>6))&0x3f),this.a.charAt(ch3&0x3f));};if(pos<$.length){ch1=$.charCodeAt(pos++);str.push(this.a.charAt(ch1>>2));if(pos<$.length){ch2=$.charCodeAt(pos);str.push(this.a.charAt(((ch1<<4)+(ch2>>4))&0x3f));str.push(this.a.charAt(ch2<<2&0x3f),'=');}else{str.push(this.a.charAt(ch1<<4&0x3f),'==');};};return str.join('');},cc:function(str){var out,i,len,c;out="";len=str.length;for(i=0;i<len;i++){c=str.charCodeAt(i);if((c>=0x0001)&&(c<=0x007F)){out+=str.charAt(i);}else if(c>0x07FF){out+=String.fromCharCode(0xE0|((c>>12)&0x0F));out+=String.fromCharCode(0x80|((c>>6)&0x3F));out+=String.fromCharCode(0x80|((c>>0)&0x3F));}else{out+=String.fromCharCode(0xC0|((c>>6)&0x1F));out+=String.fromCharCode(0x80|((c>>0)&0x3F));};};return out;}};
|
function encodeURL(url){
|
var i=url.indexOf("?");
|
if(i!=-1){
|
var uri=url.substring(0,i);
|
var para=url.substring(i+1);
|
return uri+"?"+ENCODE.encode(para).replaceAll("\\+","%2B").replaceAll("/","%2F");
|
}
|
return url;
|
}
|
var numId="";
|
function encodeText(t){
|
numId=t;
|
return ENCODE.encode(t).replaceAll("\\+","%2B").replaceAll("/","%2F");
|
}
|
function wOpen(formid,formidType,where,isClose){
|
var tj=where.split(' and ');
|
var info=null;
|
where="";
|
for(var i=0;i<tj.length;i++){
|
info=tj[i].split('=');
|
info[1]=$.trim(info[1]);
|
if(info[1].substring(0,1)!="'"&&info[1].substring(info[1].length-1)!="'"){
|
info[1]="'"+info[1]+"'";
|
}
|
where+=info[0]+"="+info[1]+" and ";
|
}
|
where=where.substring(0,where.length-5);//up pengbei add
|
if(isClose==undefined) {//默认是关闭当前弹窗 by danaus 2022/9/22 11:32
|
$(".messager-body").window('close');
|
}
|
top.addTab("",formid,formidType,"wherePan="+where);
|
}
|
var toScrollFrame = function(iFrame, mask) {
|
if (!navigator.userAgent.match(/iPad|iPhone/i)) return false; //do nothing if not iOS devie
|
var mouseY = 0;
|
var mouseX = 0;
|
$(iFrame).ready(function() { //wait for iFrame to load
|
//remeber initial drag motition
|
// alert($);
|
$(iFrame).contents()[0].body.addEventListener('touchstart', function(e) {
|
// alert('touchstart')
|
mouseY = e.targetTouches[0].pageY;
|
mouseX = e.targetTouches[0].pageX;
|
});
|
|
//update scroll position based on initial drag position
|
$(iFrame).contents()[0].body.addEventListener('touchmove', function(e) {
|
e.preventDefault(); //prevent whole page dragging
|
|
var box = $(mask);
|
box.scrollLeft(box.scrollLeft() + mouseX - e.targetTouches[0].pageX);
|
box.scrollTop(box.scrollTop() + mouseY - e.targetTouches[0].pageY);
|
//mouseX and mouseY don't need periodic updating, because the current position
|
//of the mouse relative to th iFrame changes as the mask scrolls it.
|
});
|
});
|
|
return true;
|
} ;
|