How to use the zepto.toast 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
URL = getObjectURL(thisFile);
                        // var fivarype = thisFile.type.slice(thisFile.type.indexOf('/') + 1);
                        if (['image/jpg', 'image/jpeg', 'image/png', 'image/gif'].indexOf(thisFile.type) >= 0) {
                            $(ele).find('.write-comment .pic-pop-flex')
                                .append('');
                            inputNum++;
                            $(ele).find('.write-comment .pic-input').append('<input name="comment-pic" type="file" class="comment-pic hidden">');
                            $(ele).find('.write-comment .pic-pop').addClass('show');
                            commentPicNumFlag = false;
                        }
                    }
                });
            } else {
                $.toast('只能上传一张图片', 'text');
            }
        });
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
success: function (res) {
                    if (res.response === '1') {
                        $.toast(res.message);
                        $(ele).find('.review-modal-overlay').toggleClass('review-modal-overlay-visible');
                        $(ele).find('.write-comment').toggleClass('show'); // 输入框隐藏
                        $(ele).find('.write-comment').find('#textarea').val(''); // 输入内容置空
                        $(ele).find('.write-comment').find('.weui-textarea-counter').find('span').text(0); // 字数统计重置为0
                        $(ele).find('.write-comment .pic-pop').find('.pic-pop-flex').empty(); // 图片容器置空
                        $(ele).find('.write-comment .pic-pop').removeClass('show'); // 图片容器隐藏
                        commentPicNumFlag = true; // 添加评论图片标志置为 true 允许下次选取
                        if ($(ele).find('input[type="file"]:last-child').siblings('.comment-pic').length !== 0) {
                            $(ele).find('input[type="file"]:last-child').siblings('.comment-pic').remove(); // 删除已经参与上传图片的input框
                        }
                        $(ele).find('.review-cont').find('.review-title').remove(); // 删除评论区域头部
                        $(ele).find('.review-cont').find('.review-item').remove(); // 删除评论区域所有内容
                        getComment();
                    } else {
                        $.toast(res.message, 'forbidden');
                    }
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-upload / mip-linkeddb-upload.js View on Github external
success: function (res) {
                    console.log(res);
                    if (res.response === '1') {
                        $.toast(res.message);
                        fun(res);
                    } else {
                        $.toast(res.message, 'forbidden');
                    }
                },
                complete: function () {
github mipengine / mip-extensions-platform / mip-linkeddb-upload / mip-linkeddb-upload.js View on Github external
success: function (res) {
                    console.log(res);
                    if (res.response === '1') {
                        $.toast(res.message);
                        fun(res);
                    } else {
                        $.toast(res.message, 'forbidden');
                    }
                },
                complete: function () {
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
function writeComment() {
            var content = $(ele).find('.write-comment').find('#textarea').val();
            var pOid = $(ele).find('.write-comment').find('.ok').attr('data-comment-id') || '';
            var callUserOid = $(ele).find('.write-comment').find('.ok').attr('data-other-user-id') || '';
            if (content === '') {
                $.toast('评论内容不能为空', 'forbidden');
                return;
            }
            var formData = new FormData();
            formData.append('obj_type', pageType);
            formData.append('obj_oid', pageOid);
            formData.append('content', content ? content : '');
            formData.append('p_oid', pOid ? pOid : '');
            formData.append('call_user_oid', callUserOid ? callUserOid : '');
            if ($(ele).find('.write-comment .pic-pop').find('.pic-pop-flex').find('mip-img').length >= 1) {
                if ($(ele).find('input[type="file"]').length >= 2) {
                    formData.append('mip-img', $(ele).find('input[type="file"]:last-child')
                    .prev('.comment-pic')[0].files[0]);
                } else {
                    formData.append('mip-img', $(ele).find('input[type="file"]')[0].files[0]
                        ? $(ele).find('input[type="file"]')[0].files[0] : '');
                }

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