xinyb
2024-04-23 2ef61846432762b570d5f2004a4551225da01324
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
} ;