Git.Storage.Web/Theme/plugins/jquery-file-upload/test/test.js

(开头部分) 40KB

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

/*
 * jQuery File Upload Plugin Test 7.3
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*jslint nomen: true, unparam: true */
/*global $, QUnit, window, document, expect, module, test, asyncTest, start, ok, strictEqual, notStrictEqual */

$(function () {
    'use strict';

    QUnit.done = function () {
        // Delete all uploaded files:
        var url = $('#fileupload').prop('action');
        $.getJSON(url, function (result) {
            $.each(result.files, function (index, file) {
                $.ajax({
                    url: url + '?file=' + encodeURIComponent(file.name),
                    type: 'DELETE'
                });
            });
        });
    };

    var lifecycle = {
            setup: function () {
                // Set the .fileupload method to the basic widget method:
                $.widget('blueimp.fileupload', window.testBasicWidget, {});
            },
            teardown: function () {
                // Remove all remaining event listeners:
                $(document).unbind();
            }
        },
        lifecycleUI = {
            setup: function () {
                // Set the .fileupload method to the UI widget method:
                $.widget('blueimp.fileupload', window.testUIWidget, {});
            },
            teardown: function () {
                // Remove all remaining event listeners:
                $(document).unbind();
            }
        };

    module('Initialization', lifecycle);

    test('Widget initialization', function () {
        var fu = $('#fileupload').fileupload();
        ok(fu.data('blueimp-fileupload') || fu.data('fileupload'));
    });

    test('Data attribute options', function () {
        $('#fileupload').attr('data-url', 'http://example.org');
后面还有 1200 行代码,购买后查看完整代码

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

AI 解读

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

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