classes/artifacts/student_test_war_exploded/static/lib/webuploader/0.1.5/cropper/cropper.js

(开头部分) 24KB

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

/*!
 * Cropper v0.3.2
 * https://github.com/fengyuanchen/cropper
 *
 * Copyright 2014 Fengyuan Chen
 * Released under the MIT license
 */

(function(factory) {
    if (typeof define === "function" && define.amd) {
        // AMD. Register as anonymous module.
        define(["jquery"], factory);
    } else {
        // Browser globals.
        factory(jQuery);
    }
}(function($) {

    "use strict";

    var $window = $(window),
        Cropper = function(element, options) {
            options = $.isPlainObject(options) ? options : {};
            this.$image = $(element);
            this.defaults = $.extend({}, Cropper.defaults, this.$image.data(), options);
            this.init();
        };

    Cropper.prototype = {
        construstor: Cropper,

        init: function() {
            this.setAspectRatio(this.defaults.aspectRatio);
            this.render();
        },

        render: function(callback) {
            var that = this,
                $image = this.$image,
                $clone,
                src;

            if (this.active) {
                return;
            }

            if (this.$clone) {
                this.$clone.remove(); // Remove the old clone
            }

            src = $image.attr("src"); // Don't use "prop"
            $clone = $('<img src="' + src + '">');

            $clone.on("load", function() {
                var image;

                $clone.off("load");

                if (this.naturalWidth && this.naturalHeight) {
                    image = {
后面还有 718 行代码,购买后查看完整代码

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

AI 解读

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

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