PageSourceSearch

https://www.rlcomputing.com/DesktopModules/DNNGo_SuperForm/JS/sf_common.js

js rlcomputing.com collected 2026-10-07 16:36:24 UTC 5,426 bytes, 180 lines download raw bytes

1function SF_DateDiff(sDate, eDate) { //sDateºÍeDateÊÇyyyy-MM-dd¸ñʽ
2    var date1 = new Date(sDate);
3    var date2 = new Date(eDate);
4    var date3 = date2.getTime() - date1.getTime();
5    var days = Math.floor(date3 / (24 * 3600 * 1000));
6    if (isNaN(days)) {
7        days = 0;
8    }
9    return days;
10}
11
12
13$('.Step1Content86647').datepicker({
14    onSelect: function (dateText, inst) {
15        $('.Step1Content86647').val(Number(SF_DateDiff($('.Step1Content66647').val(), $('.Step1Content76647').val()))); Calculate6647();
16    }
17});
18
19var isalerttoken = false; //ͬһ¸öÌáʾµ¯³öÁ˾Ͳ»ÒªÔÙµ¯³ö
20//ÑéÖ¤·µ»Ø½á¹û ¶ÔÏó²ÅÄÜÒýÓô«µÝ£¬ÖµÀàÐͲ»ÐÐ
21function ValidResult(resultObj) {
22    resultObj.text = SDDe(resultObj.text);
23    if (resultObj.text == "invalidtoken") {
24        if (isalerttoken == false) {
25            alert("Because you have not operated for a long time, your session state has expired. Please refresh the page and try again.");
26            isalerttoken = true;
27        }
28        return false;
29    }
30    return true;
31};
32
33function SDEn(text) {
34    var arr = NumberUtil.stringToByte(text.toString());
35    for (var i = 0; i < arr.length; i++) {
36        if (arr[i] == 255) {
37            arr[i] = 0;
38        } else {
39            arr[i]++;
40        }
41    }
42    return NumberUtil.byteToString(arr);
43}
44
45function SDDe(text) {
46    var arr = NumberUtil.stringToByte(text.toString());
47    for (var i = 0; i < arr.length; i++) {
48        if (arr[i] == 0) {
49            arr[i] = 255;
50        } else {
51            arr[i]--;
52        }
53    }
54    return NumberUtil.byteToString(arr);
55}
56
57
58var NumberUtil = {
59    //byteÊý×éת»»ÎªintÕûÊý
60    bytesToInt2: function (bytes, off) {
61        var b3 = bytes[off] & 0xFF;
62        var b2 = bytes[off + 1] & 0xFF;
63        var b1 = bytes[off + 2] & 0xFF;
64        var b0 = bytes[off + 3] & 0xFF;
65        return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
66    },
67    //byteÊý×éת»»ÎªÎÞ·ûºÅshortÕûÊý
68    byte2ToUnsignedShort: function (bytes, off) {
69        var high = bytes[off + 1];
70        var low = bytes[off];
71        return (high << 8 & 0xFF00) | (low & 0xFF);
72    },
73    //byteÊý×éת×Ö·û´®
74    byteToString: function (arr) {
75        if (typeof arr === 'string') {
76            return arr;
77        }
78        var str = '',
79            _arr = arr;
80        for (var i = 0; i < _arr.length; i++) {
81            var one = _arr[i].toString(2),
82                v = one.match(/^1+?(?=0)/);
83            if (v && one.length == 8) {
84                var bytesLength = v[0].length;
85                var store = _arr[i].toString(2).slice(7 - bytesLength);
86                for (var st = 1; st < bytesLength; st++) {
87                    store += _arr[st + i].toString(2).slice(2);
88                }
89                str += String.fromCharCode(parseInt(store, 2));
90                i += bytesLength - 1;
91            } else {
92                str += String.fromCharCode(_arr[i]);
93            }
94        }
95        return str;
96    },
97    //intÕûÊýת»»Îª4×Ö½ÚµÄbyteÊý×é
98    intToByte4: function (i) {
99        var targets = [];
100        targets[0] = (i & 0xFF);
101        targets[1] = (i >> 8 & 0xFF);
102        targets[2] = (i >> 16 & 0xFF);
103        targets[3] = (i >> 24 & 0xFF);
104        return targets;
105    },
106    //ÎÞ·ûºÅshortת»»Îª2×Ö½ÚµÄbyteÊý×é
107    unsignedShortToByte2: function (s) {
108        var targets = [];
109        targets[1] = (s >> 8 & 0xFF);
110        targets[0] = (s & 0xFF);
111        return targets;
112    },
113    //×Ö·û´®×ªbyteÊý×é
114    stringToByte: function (str) {
115        var bytes = new Array();
116        var len, c;
117        len = str.length;
118        for (var i = 0; i < len; i++) {
119            c = str.charCodeAt(i);
120            if (c >= 0x010000 && c <= 0x10FFFF) {
121                bytes.push(((c >> 18) & 0x07) | 0xF0);
122                bytes.push(((c >> 12) & 0x3F) | 0x80);
123                bytes.push(((c >> 6) & 0x3F) | 0x80);
124                bytes.push((c & 0x3F) | 0x80);
125            } else if (c >= 0x000800 && c <= 0x00FFFF) {
126                bytes.push(((c >> 12) & 0x0F) | 0xE0);
127                bytes.push(((c >> 6) & 0x3F) | 0x80);
128                bytes.push((c & 0x3F) | 0x80);
129            } else if (c >= 0x000080 && c <= 0x0007FF) {
130                bytes.push(((c >> 6) & 0x1F) | 0xC0);
131                bytes.push((c & 0x3F) | 0x80);
132            } else {
133                bytes.push(c & 0xFF);
134            }
135        }
136        return bytes;
137    },
138    //ÓзûintתÎÞ·ûint
139    int2uint: function (i) {
140        if (i >= 0)
141            return i;
142        else
143            4294967296 + i;
144    },
145    //ÎÞ·ûintתÓзûint
146    uint2int: function (i) {
147        if (i <= 2147483647)
148            return i;
149        else
150            return i - 4294967296
151    },
152    //ÓзûcharתÎÞ·ûchar
153    char2uchar: function (i) {
154        if (i >= 0)
155            return i;
156        else
157            65535 + i;
158    },
159    //ÎÞ·ûcharתÓзûchar
160    uchar2char: function (i) {
161        if (i <= 32767)
162            return i;
163        else
164            return i - 65535
165    },
166    //ÓзûbyteתÎÞ·ûbyte
167    bytes2ubytes: function (i) {
168        if (i >= 0)
169            return i;
170        else
171            255 + i;
172    },
173    //ÎÞ·ûbyteתÓзûbyte
174    ubytes2bytes: function (i) {
175        if (i <= 127)
176            return i;
177        else
178            return i - 255
179    }
180}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.