Web/js/sco.confirm.js

(开头部分) 3KB

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

/* ==========================================================
* sco.confirm.js
* http://github.com/terebentina/sco.js
* ==========================================================
* Copyright 2013 Dan Caragea.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */

/*jshint laxcomma:true, sub:true, browser:true, jquery:true, devel:true */

; (function ($, undefined) {
    "use strict";

    var pluginName = 'scojs_confirm';

    function Confirm(options) {
        this.options = $.extend({}, $.fn[pluginName].defaults, options);

        var $modal = $(this.options.target);
        if (!$modal.length) {
            $modal = $('<div class="modal" id="' + this.options.target.substr(1) + '"><div class="modal-body inner"/><div class="modal-footer"><a class="btn cancel" href="#" data-dismiss="modal">否</a> <a href="#" class="btn btn-danger" data-action="1">是</a></div></div>').appendTo(this.options.appendTo).hide();
            if (typeof this.options.action == 'function') {
                var self = this;
                $modal.find('[data-action]').attr('href', '#').on('click.' + pluginName, function (e) {
                    e.preventDefault();
                    self.options.action.call(self);
                    self.close();
                });
            } else if (typeof this.options.action == 'string') {
                $modal.find('[data-action]').attr('href', this.options.action);
            }
        }
        this.scomodal = $.scojs_modal(this.options);
    }

    $.extend(Confirm.prototype, {
        show: function () {
            this.scomodal.show();
            return this;
        }

		, close: function () {
		    this.scomodal.close();
		    return this;
		}

		, destroy: function () {
		    this.scomodal.destroy();
		    return this;
后面还有 45 行代码,购买后查看完整代码

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

AI 解读

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

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