개발자

JS.SFC :: Core

쿠카곰돌이 2021. 7. 4. 09:46
반응형

ApiUtils.getApiURL = function(a, c) {
    var d = window.location.href,
        b = d.indexOf("/", 10);
    return d.substring(0, b) + UserContext.getUrl("/services/Soap/") + (a ? "u" : "c") + "/" + c
};
ApiUtils.getSessionId = function() {
    return getCookie("sid")
};
ApiUtils.to18CharId = function(a) {
    if (null == a || 18 == a.length) return a;
    a = a.replace(/\"/g, "");
    if (15 != a.length) return null;
    for (var c = "", d = 0; 3 > d; d++) {
        for (var b = 0, e = 0; 5 > e; e++) {
            var f = a.charAt(5 * d + e);
            "A" <= f && "Z" >= f && (b += 1 << e)
        }
        c = 25 >= b ? c + "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(b) : c + "012345".charAt(b - 26)
    }
    return a + c
};
ApiUtils.to15CharId = function(a) {
    return !a ? null : a.substring(0, 15)
};
ApiUtils.getId = function(a) {
    if (!a) return null;
    a = a.get("Id");
    a.splice && (a.length && 0 < a.length) && (a = a[0]);
    a && (a = ApiUtils.to15CharId(a));
    return a
};
ApiUtils.soqlEncode = function(a) {
    a = a.replace("\\", "\\\\");
    return a = a.replace("'", "\\'")
};
function PreferenceBits(a, d) {
    this.bitsByName = {};
    this.preferenceType = a;
    for (var c = 0; c < d.length; c++) {
        var b = d[c];
        this.bitsByName[b.name] = {
            index: b.index,
            val: b.value
        }
    }
}
PreferenceBits.prototype.csrfToken = null;
PreferenceBits.prototype.getBoolean = function(a) {
    return this.bitsByName[a].val
};
PreferenceBits.prototype.getIndexByName = function(a) {
    return this.bitsByName[a].index
};
PreferenceBits.prototype.setBoolean = function(a, d, c) {
    if ("boolean" == typeof d) {
        var b = this.bitsByName[a];
        b && b.val != d && (this.bitsByName[a].val = d, this.save(a, c))
    }
};
PreferenceBits.prototype.setBooleanNoCheck = function(a, d, c) {
    "boolean" == typeof d && this.bitsByName[a] && (this.bitsByName[a].val = d, this.save(a, c))
};
PreferenceBits.prototype.setBooleanNoCheckWithError = function(a, d, c, b) {
    "boolean" == typeof d && this.bitsByName[a] && (this.bitsByName[a].val = d, this.save(a, c, b))
};
PreferenceBits.prototype.save = function(a, d, c) {
    var b = this.bitsByName[a];
    if (b) {
        a = {};
        a.csrf = PreferenceBits.prototype.csrfToken;
        var e = {};
        e.val = b.val;
        e.bit = b.index;
        b = {};
        b.headers = a;
        b.data = e;
        b.failure = c;
        c = "";
        !this.preferenceType || "userPreferences" == this.preferenceType ? c = "/_ui/common/request/servlet/UserPreferencesServlet" : "orgPreferences" == preferenceType && (c = "/_ui/common/request/servlet/OrgPreferencesServlet");
        Sfdc.Ajax.post(UserContext.getUrl(c), d || function() {}, b)
    }
};
function DateUtil() {}
"undefined" != typeof Sfdc && Sfdc.provide && Sfdc.provide("Sfdc.Date", DateUtil);
DateUtil.MONTH_NAMES = "January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
DateUtil.DAY_NAMES = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat".split(" ");
DateUtil.LZ = function(a) {
    return (0 > a || 9 < a ? "" : "0") + a
};
DateUtil.isDate = function(a, c) {
    return 0 === DateUtil.getDateFromFormat(a, c) ? !1 : !0
};

 

 

Core.js
0.29MB

반응형

'개발자' 카테고리의 다른 글

[ORACLE]오라클_유저 생성 및 권한 부여  (0) 2021.07.17
JS.SFC :: xdomain  (0) 2021.07.04
JS.SFC :: FinalLorg.ajax4  (0) 2021.07.04
JS.SFC :: resources  (0) 2021.07.04
JS.SFC :: CanvasRendering  (0) 2021.07.04