AyaWo.Web/Content/zui/dist/lib/imgcutter/zui.imgcutter.js

(开头部分) 10KB

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

/*!
 * ZUI: 图片裁剪工具 - v1.7.0 - 2017-06-17
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2017 cnezsoft.com; Licensed MIT
 */

/* ========================================================================
 * ZUI: img-cutter.js
 * http://zui.sexy
 * ========================================================================
 * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT
 * ======================================================================== */


(function($, Math, undefined) {
    'use strict';

    if(!$.fn.draggable) console.error('img-cutter requires draggable.js');
    if(!$.zui.imgReady) console.error('img-cutter requires image.ready.js');

    var NAME = 'zui.imgCutter';

    var ImgCutter = function(element, options) {
        this.$ = $(element);
        this.initOptions(options);
        this.init();
    };

    ImgCutter.DEFAULTS = {
        coverColor: '#000',
        coverOpacity: 0.6,
        // fixedRatio: false,
        defaultWidth: 128,
        defaultHeight: 128,
        minWidth: 48,
        minHeight: 48
    }; // default options

    ImgCutter.prototype.callEvent = function(name, params) {
        var result = this.$.callEvent(name + '.' + NAME, params, this);
        return !(result.result !== undefined && (!result.result));
    };

    ImgCutter.prototype.initOptions = function(options) {
        this.options = $.extend({}, ImgCutter.DEFAULTS, this.$.data(), options);
        this.options.coverOpacityIE = this.options.coverOpacity * 100;
        this.clipWidth = this.options.defaultWidth;
        this.clipHeight = this.options.defaultHeight;
    };

    ImgCutter.prototype.init = function() {
        this.initDom();
        this.initSize();
        this.bindEvents();
    };

    ImgCutter.prototype.initDom = function() {
        this.$canvas = this.$.children('.canvas');
        this.$img = this.$canvas.children('img');
后面还有 220 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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