PageSourceSearch

https://sellersprite.ai/assets-v2/js/preset-mode.js?v202609301042

js sellersprite.ai collected 2026-10-01 16:28:19 UTC 1,495 bytes, 44 lines download raw bytes

1/**
2 * 转换为url参数, &拼接
3 * @param param
4 * @param key
5 * @returns {string}
6 */
7function parseUrlParam(param, key) {
8    let paramStr = "";
9    if (param instanceof String || param instanceof Number || param instanceof Boolean) {
10        paramStr += "&" + key + "=" + encodeURIComponent(param);
11    } else {
12        $.each(param, function (i) {
13            let k = key == null ? i : key + (param instanceof Array ? "[" + i + "]" : "." + i);
14            paramStr += '&' + parseUrlParam(this, k);
15        });
16    }
17    return paramStr.substr(1);
18};
19
20/**
21 * 预设模式是否已改变
22 * @param formDomId:string 表格domId
23 * @param excludeKeyReg:reg 排除属性的正则表达式
24 * @param presetMode:obj 验证对象
25 * @returns {boolean}
26 */
27function presetModeIsChange(formDomId, excludeKeyReg, presetMode) {
28    // TODO 该方式无法取得form中input[type=check],并且未选中的值,后续考虑优化
29    let serializeArray = $(`#${formDomId}`).serializeArray();
30    // console.log(serializeArray)
31    if (!serializeArray || !presetMode) {
32        return false;
33    }
34    for (let o of serializeArray) {
35        if (!excludeKeyReg || !excludeKeyReg.test(o.name)) {
36            // console.log('check', o.name)
37            if ((!!presetMode[o.name] && o.value != presetMode[o.name]) || (!presetMode[o.name] && o.value)) {
38                // console.log('check failed', o, presetMode[o.name])
39                return true;
40            }
41        }
42    }
43    return false;
44}

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.