WXAppUI/Scripts/knockout-2.1.0.debug.js

(开头部分) 191KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// Knockout JavaScript library v2.1.0
// (c) Steven Sanderson - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)

(function (window, document, navigator, undefined) {
    var DEBUG = true;
    !function (factory) {
        // Support three module loading scenarios
        if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
            // [1] CommonJS/Node.js
            var target = module['exports'] || exports; // module.exports is for Node.js
            factory(target);
        } else if (typeof define === 'function' && define['amd']) {
            // [2] AMD anonymous module
            define(['exports'], factory);
        } else {
            // [3] No module loader (plain <script> tag) - put directly in global namespace
            factory(window['ko'] = {});
        }
    }(function (koExports) {
        // Internally, all KO objects are attached to koExports (even the non-exported ones whose names will be minified by the closure compiler).
        // In the future, the following "ko" variable may be made distinct from "koExports" so that private objects are not externally reachable.
        var ko = typeof koExports !== 'undefined' ? koExports : {};
        // Google Closure Compiler helpers (used only to make the minified file smaller)
        ko.exportSymbol = function (koPath, object) {
            var tokens = koPath.split(".");

            // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable)
            // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko)
            var target = ko;

            for (var i = 0; i < tokens.length - 1; i++)
                target = target[tokens[i]];
            target[tokens[tokens.length - 1]] = object;
        };
        ko.exportProperty = function (owner, publicName, object) {
            owner[publicName] = object;
        };
        ko.version = "2.1.0";

        ko.exportSymbol('version', ko.version);
        ko.utils = new (function () {
            var stringTrimRegex = /^(\s|\u00A0)+|(\s|\u00A0)+$/g;

            // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)
            var knownEvents = {}, knownEventTypesByEventName = {};
            var keyEventTypeName = /Firefox\/2/i.test(navigator.userAgent) ? 'KeyboardEvent' : 'UIEvents';
            knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress'];
            knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'];
            for (var eventType in knownEvents) {
                var knownEventsForType = knownEvents[eventType];
                if (knownEventsForType.length) {
                    for (var i = 0, j = knownEventsForType.length; i < j; i++)
                        knownEventTypesByEventName[knownEventsForType[i]] = eventType;
                }
            }
            var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406

            // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness)
            var ieVersion = (function () {
后面还有 3378 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。