How to use the zepto.confirm function in zepto

To help you get started, we’ve selected a few zepto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
function devareComment() {
            var $this = this;
            var replyOid = $($this).parent().parent().parent().data('commentId');
            // $.alert(111,function(){
            //     console.log(1111)
            // });
            $.confirm('确定删除吗?', function () {
                $.post('https://mip.linkeddb.com/del_comment/', {
                    'reply_oid': replyOid
                }, function (res) {
                    if (res.response === '1') {
                        // $.toast(res.message, 'text');
                        $.toptip(res.message, 'success');
                        $(ele).find('.review-cont').find('.review-title').remove(); // 删除评论区域头部
                        $(ele).find('.review-cont').find('.review-item').remove(); // 删除评论区域所有内容
                        getComment();
                    } else {
                        // $.toast(res.message, 'text');
                        $.toptip(res.message, 'error');
                    }
                });
            }, function () {
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
$('.review-cont').on('click', '.agree', function () {
            var $this = this;
            var pOid = $(this).parent().parent().parent().data('commentId');
            // console.log(pOid);
            if (!$($this).find('.icon-agree').hasClass('full')) {
                setAgreeStatus(0, function (res) {
                    $.toast(res.message);
                    // console.log($($this).find('.num'));
                    $($this).find('.num').html(+$($this).find('.num').html() + 1);
                    $($this).find('.icon-agree').toggleClass('full');
                });
            } else {
                $.confirm('确定取消点赞吗?', function () {
                    setAgreeStatus(-1, function () {
                        // $.toast(res.message);
                        // console.log($($this).find('.num'));
                        $($this).find('.num').html(+$($this).find('.num').html() - 1);
                        $($this).find('.icon-agree').toggleClass('full');
                    });
                }, function () {

                });
            }
            function setAgreeStatus(flag, fn) {
                $.post('/reply_goods/', {
                    'reply_oid': pOid,
                    f: flag
                }, function (res) {
                    if (res.response === '-2') {
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
}, function (res) {
                    if (res.response === '-2') {
                        $.confirm('请登录后操作', '登录提示', function () {
                            window.top.location.href = '/sign_in/?callUrl=' + window.top.location.pathname;
                        }, function () {
                            // $.toast('登录取消', 'text');
                        });
                        return false;
                    } else if (res.response === '1') {
                        fn(res);
                    } else {
                        $.toast(res.message, 'forbidden');
                    }
                });
            }
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
$.get('https://mip.linkeddb.com/check_user/', function (res) {
                if (res.response === '-2') {
                    $.confirm('登录后评论', '登录提示', function () {
                        window.top.location.href = 'https://mip.linkeddb.com/sign_in/?callUrl='
                        + window.top.location.pathname;
                    }, function () {

                    });
                    return false;
                } else {
                    $(ele).find('.review-modal-overlay').toggleClass('review-modal-overlay-visible');
                    $(ele).find('.write-comment').toggleClass('show');
                    $(ele).parent().parent().parent().find('.content').toggleClass('z-index-11');
                }
            });
        }
github mipengine / mip-extensions-platform / mip-linkeddb-upload / mip-linkeddb-upload.js View on Github external
$($ele).on('click', function (event) {
                event = event || window.event;
                event.preventDefault();
                $.confirm('登录后操作', '操作提示', function () {
                    window.location.href = sign + window.location.origin + window.location.pathname;
                },
                    function () {
                    });
                return false;
            });
        };

zepto

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis