Example #1
0
                    submitHandler: function(form) {
                        //提交事件
                        var btn = $(form).find('[type="submit"]');
                        btn.removeAttr("disabled").removeClass("disabled");
                        $(form).ajaxSubmit({
                            dataType: "json",
                            timeout: 3e3,
                            error: function() {
                                btn.attr("disabled", false).removeClass("disabled");
                                return Comm.alertTips({
                                    msg: "提交出错!"
                                });
                            },
                            success: function(data) {
                                var n = Number(data.status);
                                switch (n) {
                                  case 1:
                                    _SendLetter.remove();
                                    //关闭窗口
                                    return Comm.alertTips({
                                        msg: data.message
                                    });
                                    break;

                                  default:
                                    btn.removeAttr("disabled").removeClass("disabled");
                                    return Comm.alertTips({
                                        msg: data.message
                                    });
                                }
                            }
                        }).submit(function() {
                            return false;
                        });
                    }
Example #2
0
 elt.keyup(function(e) {
     if (/13|38|40|116/.test(e.keyCode) || this.value == "") {
         return false;
     }
     var username = this.value;
     if (username.indexOf("@") == -1) {
         autoComplete.hide();
         return false;
     }
     autoLi.each(function() {
         this.innerHTML = username.replace(/\@+.*/, "") + $(this).attr("hz");
         if (this.innerHTML.indexOf(username) >= 0) {
             $(this).show();
         } else {
             $(this).hide();
         }
     }).filter(".selected").removeClass("selected");
     autoComplete.show().css({
         width: $(this).outerWidth(),
         left: $(this).offset().left,
         top: $(this).offset().top + $(this).outerHeight(),
         position: "absolute",
         zIndex: "9999"
     });
     if (autoLi.filter(":visible").length == 0) {
         autoComplete.hide();
     } else {
         autoLi.filter(":visible").eq(0).addClass("selected");
     }
 }).keydown(function(e) {
Example #3
0
 onUploadSuccess: function(file, data, response) {
     var msg = $.parseJSON(data);
     //裁图
     if (msg.status == 1) {
         $("#crop-pics").val(msg.filelink);
         $("#crop-target").attr("src", msg.filelink);
         $("#crop-preview").attr("src", msg.filelink).css("visibility", "visible");
         $("#codesrc").val(msg.codesrc);
         $("#crop-target").Jcrop({
             setSelect: [ 0, 0, opts.size[0], opts.size[1] ],
             onChange: updatePreview,
             onSelect: updatePreview,
             onSelect: updateCoords,
             boxWidth: 380,
             boxHeight: 316,
             aspectRatio: opts.size[0] / opts.size[1]
         }, function() {
             // Use the API to get the real image size
             var bounds = this.getBounds();
             boundx = bounds[0];
             boundy = bounds[1];
             // Store the API in the jcrop_api variable
             jcrop_api = this;
         });
     } else {
         common.alertTips({
             msg: msg.message
         });
     }
 }
Example #4
0
 autoLi.each(function() {
     this.innerHTML = username.replace(/\@+.*/, "") + $(this).attr("hz");
     if (this.innerHTML.indexOf(username) >= 0) {
         $(this).show();
     } else {
         $(this).hide();
     }
 }).filter(".selected").removeClass("selected");
Example #5
0
 that.find("a").mouseenter(function() {
     var msg = $(this).data("msg");
     var a = $(this).index();
     that.find("a").slice(0, a + 1).addClass("action");
     that.find("a").slice(a + 1).removeClass("action");
     if (hasMsg) {
         __showmsg(msg);
     }
 }).mouseleave(function() {
Example #6
0
 var Show = function(html) {
     var w = that.outerWidth(), h = that.outerHeight(), t = that.offset().top, l = that.offset().left;
     ShowTips = $('<div class="tips-input"><div class="arrow-left"><span></span><em></em></div>' + html + "</div>");
     ShowTips.css({
         position: "absolute",
         top: t + "px",
         left: w + l + 20 + "px",
         "z-index": 99,
         display: "none"
     }).show();
     $("body").append(ShowTips);
 };
Example #7
0
 var __showmsg = function(text) {
     var w = that.outerWidth(), h = that.outerHeight(), t = that.offset().top, l = that.offset().left;
     showmsg = $('<div class="star-msg">' + text + "</div>");
     showmsg.css({
         position: "absolute",
         top: (h - 20) / 2 + t + "px",
         left: w + l + "px",
         "z-index": 99,
         display: "none"
     }).show();
     $("body").append(showmsg);
 };
Example #8
0
 $this.each(function() {
     var opts = $.extend({}, defaults, options);
     var that = $(this), ShowTips = null;
     var Show = function(html) {
         var w = that.outerWidth(), h = that.outerHeight(), t = that.offset().top, l = that.offset().left;
         ShowTips = $('<div class="tips-input"><div class="arrow-left"><span></span><em></em></div>' + html + "</div>");
         ShowTips.css({
             position: "absolute",
             top: t + "px",
             left: w + l + 20 + "px",
             "z-index": 99,
             display: "none"
         }).show();
         $("body").append(ShowTips);
     };
     var data = opts.data, html = "";
     if (data.title) {
         html += "<p>" + data.title + "</p>";
     }
     var text = data.text;
     for (j in text) {
         html += '<a href="javascript:void(0)">' + text[j] + "</a>";
     }
     Show(html);
     $("a", ShowTips).on("click", function() {
         var val = that.val().split(" ");
         var v = $(this).html();
         for (var i = 0; i < val.length; i++) {
             if (val[i] == "" || typeof val[i] == "undefined") {
                 val.splice(i, 1);
                 i = i - 1;
             }
         }
         if ($.inArray(v, val) > -1) {
             return false;
         }
         if (Number(opts.Amount) === 1) {
             return that.val(v).focus();
         } else if (val.length === Number(opts.Amount)) {
             return false;
         }
         val.push(v);
         that.val(val.join(" ")).focus();
     });
     if (opts.AutoClose) {
         that.blur(function() {
             setTimeout(function() {
                 ShowTips.remove();
             }, 120);
         });
     }
 });
Example #9
0
 var SaveForm = function() {
     var cookiename = $('[autosave="true"]').data("cookiename");
     var val = JSON.stringify(Comm.serializeJson('[autosave="true"]'));
     $.cookie(cookiename, val, {
         path: "/"
     });
 };
Example #10
0
 $(document).on("focus", '[data-tips="true"]', function() {
     var that = $(this), amount = that.data("amount"), types = that.data("types");
     new Comm.TipsInput(that, {
         data: eval(types),
         Amount: amount
     });
 });
Example #11
0
 $(document).on("click", "#SendCode", function() {
     var that = $(this);
     if (that.hasClass("btn-orange")) {
         return __SendCode(that);
     }
     return false;
 });
Example #12
0
 serializeJson: function(selector) {
     var that = this.selector = $(selector);
     var serializeObj = {};
     var array = that.serializeArray();
     var str = that.serialize();
     $(array).each(function() {
         if (serializeObj[this.name]) {
             if ($.isArray(serializeObj[this.name])) {
                 serializeObj[this.name].push(this.value);
             } else {
                 serializeObj[this.name] = [ serializeObj[this.name], this.value ];
             }
         } else {
             serializeObj[this.name] = this.value;
         }
     });
     return serializeObj;
 }
Example #13
0
 $(document).on("focus", '[autocomplete="true"]', function() {
     var that = $(this);
     require.async([ "AutoComplete-debug" ], function() {
         that.AutoComplete({
             data: that.data("complete-url"),
             ajaxDataType: "xml",
             maxHeight: 300
         });
     });
 });
Example #14
0
 function updatePreview(c) {
     if (parseInt(c.w) > 0) {
         var rx = opts.size[0] / c.w;
         var ry = opts.size[1] / c.h;
         $("#crop-preview").css({
             width: Math.round(rx * boundx) + "px",
             height: Math.round(ry * boundy) + "px",
             marginLeft: "-" + Math.round(rx * c.x) + "px",
             marginTop: "-" + Math.round(ry * c.y) + "px"
         });
     }
 }
Example #15
0
                    submitHandler: function(form) {
                        //提交事件
                        var btn = $(form).find('[type="submit"]');
                        btn.removeAttr("disabled").removeClass("disabled");
                        $(form).ajaxSubmit({
                            dataType: "json",
                            timeout: 3e3,
                            error: function() {
                                btn.attr("disabled", false).removeClass("disabled");
                                return Comm.alertTips({
                                    msg: "提交出错!"
                                });
                            },
                            success: function(json) {
                                var n = Number(json.status);
                                var url = json.url;
                                switch (n) {
                                  case 1:
                                    Comm.alertTips({
                                        msg: json.message
                                    });
                                    if (url != "") {
                                        window.location.href = url;
                                    } else {
                                        setTimeout("location.reload();", 2e3);
                                    }
                                    break;

                                  default:
                                    btn.removeAttr("disabled").removeClass("disabled");
                                    return Comm.alertTips({
                                        msg: json.message
                                    });
                                }
                            }
                        }).submit(function() {
                            return false;
                        });
                    }
Example #16
0
 require.async([ "tagsedit-debug" ], function() {
     AutoIndustry.tagEditor({
         autocomplete: {
             data: gv.URL.GetIndustry,
             async: true,
             ajaxDataType: "xml"
         },
         delimiter: " "
     });
     $(document).on("click", ".industry-tags a", function() {
         var txt = $(this).text();
         AutoIndustry.tagEditor("addTag", txt);
     });
 });
Example #17
0
 $(document).on("focus", '[data-tips="ajax"]', function() {
     var that = $(this), amount = that.data("amount"), equalto = $(that.data("equalto")).val(), url = that.data("url"), PostData = {
         keyword: ""
     };
     if (equalto != undefined || equalto != "") {
         PostData = {
             keyword: equalto
         };
     }
     $.ajax({
         type: "POST",
         url: url,
         data: PostData,
         dataType: "json",
         success: function(json) {
             if (json.status == 1) {
                 new Comm.TipsInput(that, {
                     data: json,
                     Amount: amount
                 });
             }
         }
     });
 });
Example #18
0
 $(document).on("click", ".edit-avatar", function() {
     var $this = $(this), uid = $this.data("uid");
     Comm.CropPhoto({
         title: "上传头像",
         size: [ 160, 160 ],
         data: {
             userid: uid
         },
         fileSize: "1024KB",
         success: function(url) {
             $this.find("img").attr("src", url);
             $this.find("input").val(url);
         }
     });
 });
Example #19
0
 $("a", ShowTips).on("click", function() {
     var val = that.val().split(" ");
     var v = $(this).html();
     for (var i = 0; i < val.length; i++) {
         if (val[i] == "" || typeof val[i] == "undefined") {
             val.splice(i, 1);
             i = i - 1;
         }
     }
     if ($.inArray(v, val) > -1) {
         return false;
     }
     if (Number(opts.Amount) === 1) {
         return that.val(v).focus();
     } else if (val.length === Number(opts.Amount)) {
         return false;
     }
     val.push(v);
     that.val(val.join(" ")).focus();
 });
Example #20
0
 Raty: function(selector) {
     var $this = this.selector = $(selector);
     $this.each(function() {
         var that = $(this), hasMsg = false, showmsg = null;
         that.find("a").data("msg") == undefined ? hasMsg = false : hasMsg = true;
         var __showmsg = function(text) {
             var w = that.outerWidth(), h = that.outerHeight(), t = that.offset().top, l = that.offset().left;
             showmsg = $('<div class="star-msg">' + text + "</div>");
             showmsg.css({
                 position: "absolute",
                 top: (h - 20) / 2 + t + "px",
                 left: w + l + "px",
                 "z-index": 99,
                 display: "none"
             }).show();
             $("body").append(showmsg);
         };
         that.find("a").mouseenter(function() {
             var msg = $(this).data("msg");
             var a = $(this).index();
             that.find("a").slice(0, a + 1).addClass("action");
             that.find("a").slice(a + 1).removeClass("action");
             if (hasMsg) {
                 __showmsg(msg);
             }
         }).mouseleave(function() {
             that.find("a").removeClass("action");
             var v = that.find("input").val();
             v == "" ? v = 0 : v = v;
             that.find("a").slice(0, v).addClass("action");
             if (hasMsg) {
                 showmsg.remove();
             }
         });
         that.find("a").click(function() {
             var v = $(this).index();
             that.find("input").val(v + 1);
         });
     });
 },
Example #21
0
 var __SendCode = function(that) {
     var phone = $("#Phone").val();
     if (!/^0?(13|15|18|17|14)[0-9]{9}$/.test(phone)) {
         return Comm.alertTips({
             msg: "请输入正确的手机号!"
         });
     }
     $.ajax({
         cache: true,
         type: "POST",
         url: gv.URL.SendCode,
         data: {
             phone: phone
         },
         dataType: "JSON",
         async: false,
         error: function() {
             return Comm.alertTips({
                 msg: "发送失败,请稍后再试!!"
             });
         },
         success: function(data) {
             var status = Number(data.status);
             if (status == 1) {
                 Comm.alertTips({
                     msg: data.message
                 });
                 that.removeClass("btn-orange");
                 __time(that);
             } else {
                 return Comm.alertTips({
                     msg: data.message
                 });
             }
         }
     });
 };
Example #22
0
 function checkCoords() {
     if (parseInt($("#crop-w").val())) return true;
     alert("请选择图片上合适的区域");
     return false;
 }
Example #23
0
 $(document).on("click", ".industry-tags a", function() {
     var txt = $(this).text();
     AutoIndustry.tagEditor("addTag", txt);
 });
Example #24
0
 }).mouseout(function() {
     $(this).removeClass("selected");
 }).mousedown(function() {
Example #25
0
    $(function() {
        //表单验证
        if ($("[data-validate='true']").size() > 0) {
            require.async([ "./validate_methods-debug", "ajaxform-debug" ], function(Validate) {
                new Validate.checked("[data-validate='true']", {
                    debug: false,
                    //进行调试模式(表单不提交)
                    errorElement: "label",
                    //用什么标签标记错误
                    errorClass: "err",
                    //指定错误提示的css类名
                    ignore: null,
                    //对某些元素不进行验证
                    errorPlacement: function(error, element) {
                        //更改错误信息显示的位置
                        element.parent().find(".show-msg").html(error);
                    },
                    success: function(label) {},
                    submitHandler: function(form) {
                        //提交事件
                        var btn = $(form).find('[type="submit"]');
                        btn.removeAttr("disabled").removeClass("disabled");
                        $(form).ajaxSubmit({
                            dataType: "json",
                            timeout: 3e3,
                            error: function() {
                                btn.attr("disabled", false).removeClass("disabled");
                                return Comm.alertTips({
                                    msg: "提交出错!"
                                });
                            },
                            success: function(json) {
                                var n = Number(json.status);
                                var url = json.url;
                                switch (n) {
                                  case 1:
                                    Comm.alertTips({
                                        msg: json.message
                                    });
                                    if (url != "") {
                                        window.location.href = url;
                                    } else {
                                        setTimeout("location.reload();", 2e3);
                                    }
                                    break;

                                  default:
                                    btn.removeAttr("disabled").removeClass("disabled");
                                    return Comm.alertTips({
                                        msg: json.message
                                    });
                                }
                            }
                        }).submit(function() {
                            return false;
                        });
                    }
                });
            });
        }
        /*
         *  自动补全
         */
        //邮箱
        Comm.AutoEmail("[autoemail='true']", {
            data: gv.autoemail
        });
        //行业 带默认选项
        var AutoIndustry = $("#tags-industry");
        if (AutoIndustry.size() > 0) {
            require.async([ "tagsedit-debug" ], function() {
                AutoIndustry.tagEditor({
                    autocomplete: {
                        data: gv.URL.GetIndustry,
                        async: true,
                        ajaxDataType: "xml"
                    },
                    delimiter: " "
                });
                $(document).on("click", ".industry-tags a", function() {
                    var txt = $(this).text();
                    AutoIndustry.tagEditor("addTag", txt);
                });
            });
        }
        //通用自动补全方法
        $(document).on("focus", '[autocomplete="true"]', function() {
            var that = $(this);
            require.async([ "AutoComplete-debug" ], function() {
                that.AutoComplete({
                    data: that.data("complete-url"),
                    ajaxDataType: "xml",
                    maxHeight: 300
                });
            });
        });
        /*
         *   上传头像
         */
        $(document).on("click", ".edit-avatar", function() {
            var $this = $(this), uid = $this.data("uid");
            Comm.CropPhoto({
                title: "上传头像",
                size: [ 160, 160 ],
                data: {
                    userid: uid
                },
                fileSize: "1024KB",
                success: function(url) {
                    $this.find("img").attr("src", url);
                    $this.find("input").val(url);
                }
            });
        });
        /*
        *   重新绑定手机号
        * */
        //注册
        $("#SetPhone").one("click", function() {
            $("#Phone").removeAttr("disabled").removeClass("disabled");
        });
        /*
        *   发送验证码
        * */
        // 倒计时
        var wait = 60;
        var __time = function(o) {
            if (wait == 0) {
                o.addClass("btn-orange");
                o.html("重新发送");
                wait = 60;
            } else {
                o.removeClass("btn-orange");
                o.html("重新发送(" + wait + ")");
                wait--;
                setTimeout(function() {
                    __time(o);
                }, 1e3);
            }
        };
        var __SendCode = function(that) {
            var phone = $("#Phone").val();
            if (!/^0?(13|15|18|17|14)[0-9]{9}$/.test(phone)) {
                return Comm.alertTips({
                    msg: "请输入正确的手机号!"
                });
            }
            $.ajax({
                cache: true,
                type: "POST",
                url: gv.URL.SendCode,
                data: {
                    phone: phone
                },
                dataType: "JSON",
                async: false,
                error: function() {
                    return Comm.alertTips({
                        msg: "发送失败,请稍后再试!!"
                    });
                },
                success: function(data) {
                    var status = Number(data.status);
                    if (status == 1) {
                        Comm.alertTips({
                            msg: data.message
                        });
                        that.removeClass("btn-orange");
                        __time(that);
                    } else {
                        return Comm.alertTips({
                            msg: data.message
                        });
                    }
                }
            });
        };
        $(document).on("click", "#SendCode", function() {
            var that = $(this);
            if (that.hasClass("btn-orange")) {
                return __SendCode(that);
            }
            return false;
        });
        /*
        * 表单输入框默认提示
        * */
        //静态数据
        $(document).on("focus", '[data-tips="true"]', function() {
            var that = $(this), amount = that.data("amount"), types = that.data("types");
            new Comm.TipsInput(that, {
                data: eval(types),
                Amount: amount
            });
        });
        //动态数据
        $(document).on("focus", '[data-tips="ajax"]', function() {
            var that = $(this), amount = that.data("amount"), equalto = $(that.data("equalto")).val(), url = that.data("url"), PostData = {
                keyword: ""
            };
            if (equalto != undefined || equalto != "") {
                PostData = {
                    keyword: equalto
                };
            }
            $.ajax({
                type: "POST",
                url: url,
                data: PostData,
                dataType: "json",
                success: function(json) {
                    if (json.status == 1) {
                        new Comm.TipsInput(that, {
                            data: json,
                            Amount: amount
                        });
                    }
                }
            });
        });
        /*
         *   评分
         */
        new Comm.Raty(".star-scoring");
        /*
        *   下拉选项
        * */
        if ($("select").size() > 0) {
            require.async([ "selectbox-debug" ], function(selectbox) {
                selectbox($("select"));
            });
        }
        /*
        * 表单自动保存
        * */
        if ($('[autosave="true"]').size() > 0) {
            require.async([ "cookie-debug" ], function() {
                var SaveForm = function() {
                    var cookiename = $('[autosave="true"]').data("cookiename");
                    var val = JSON.stringify(Comm.serializeJson('[autosave="true"]'));
                    $.cookie(cookiename, val, {
                        path: "/"
                    });
                };
                setInterval(SaveForm, 1e4);
            });
        }
        /*
        *  发私信
        * */
        $(document).on("click", ".btn-send-letter", function() {
            var that = $(this), data = {
                uid: that.data("uid"),
                name: that.data("name")
            };
            require.async([ "template-debug", "dialog-debug", "./validate_methods-debug", "ajaxform-debug" ], function(template, dialog, Validate, ajaxform) {
                var html = template("SendLetter", data);
                var _SendLetter = dialog({
                    title: "发私信给:" + data.name,
                    content: html,
                    width: "400"
                }).showModal();
                new Validate.checked("#SendLetterForm", {
                    errorElement: "label",
                    //用什么标签标记错误
                    errorClass: "err",
                    //指定错误提示的css类名
                    ignore: null,
                    //对某些元素不进行验证
                    errorPlacement: function(error, element) {
                        //更改错误信息显示的位置
                        element.parent().parent().find(".show-msg").html(error);
                    },
                    success: function(label) {},
                    submitHandler: function(form) {
                        //提交事件
                        var btn = $(form).find('[type="submit"]');
                        btn.removeAttr("disabled").removeClass("disabled");
                        $(form).ajaxSubmit({
                            dataType: "json",
                            timeout: 3e3,
                            error: function() {
                                btn.attr("disabled", false).removeClass("disabled");
                                return Comm.alertTips({
                                    msg: "提交出错!"
                                });
                            },
                            success: function(data) {
                                var n = Number(data.status);
                                switch (n) {
                                  case 1:
                                    _SendLetter.remove();
                                    //关闭窗口
                                    return Comm.alertTips({
                                        msg: data.message
                                    });
                                    break;

                                  default:
                                    btn.removeAttr("disabled").removeClass("disabled");
                                    return Comm.alertTips({
                                        msg: data.message
                                    });
                                }
                            }
                        }).submit(function() {
                            return false;
                        });
                    }
                });
            });
        });
    });
Example #26
0
 }).mousedown(function() {
     autoComplete.data("elt").val($(this).text()).change();
     autoComplete.hide();
 });
Example #27
0
 }).focus(function() {
     autoComplete.data("elt", $(this));
 }).blur(function() {
Example #28
0
 require.async([ "template-debug", "dialog-debug", "uploadify-debug", "jcrop-debug", "ajaxform-debug" ], function(template, dialog, uploadify, Jcrop, ajaxform) {
     data = {
         title: opts.title,
         width: opts.size[0],
         height: opts.size[1],
         fileSize: opts.fileSize,
         fileType: opts.fileType
     };
     var html = template("PicsCrop", data);
     var _UploadPics = dialog({
         title: "上传头像",
         content: html,
         width: "auto"
     }).showModal();
     var jcrop_api, boundx, boundy;
     function updateCoords(c) {
         $("#crop-x").val(c.x);
         $("#crop-y").val(c.y);
         $("#crop-w").val(c.w);
         $("#crop-h").val(c.h);
     }
     function checkCoords() {
         if (parseInt($("#crop-w").val())) return true;
         alert("请选择图片上合适的区域");
         return false;
     }
     function updatePreview(c) {
         if (parseInt(c.w) > 0) {
             var rx = opts.size[0] / c.w;
             var ry = opts.size[1] / c.h;
             $("#crop-preview").css({
                 width: Math.round(rx * boundx) + "px",
                 height: Math.round(ry * boundy) + "px",
                 marginLeft: "-" + Math.round(rx * c.x) + "px",
                 marginTop: "-" + Math.round(ry * c.y) + "px"
             });
         }
     }
     //上传
     $("#Pics-Upload").uploadify({
         auto: true,
         multi: false,
         uploadLimit: 1,
         formData: opts.data,
         buttonImage: gv.URL.Btn_picsupload,
         height: 35,
         width: 140,
         removeCompleted: true,
         fileObjName: "file",
         swf: gv.URL.uploadifySwf,
         uploader: gv.URL.PicsUpload,
         fileTypeExts: opts.fileType,
         fileSizeLimit: opts.fileSize,
         onUploadSuccess: function(file, data, response) {
             var msg = $.parseJSON(data);
             //裁图
             if (msg.status == 1) {
                 $("#crop-pics").val(msg.filelink);
                 $("#crop-target").attr("src", msg.filelink);
                 $("#crop-preview").attr("src", msg.filelink).css("visibility", "visible");
                 $("#codesrc").val(msg.codesrc);
                 $("#crop-target").Jcrop({
                     setSelect: [ 0, 0, opts.size[0], opts.size[1] ],
                     onChange: updatePreview,
                     onSelect: updatePreview,
                     onSelect: updateCoords,
                     boxWidth: 380,
                     boxHeight: 316,
                     aspectRatio: opts.size[0] / opts.size[1]
                 }, function() {
                     // Use the API to get the real image size
                     var bounds = this.getBounds();
                     boundx = bounds[0];
                     boundy = bounds[1];
                     // Store the API in the jcrop_api variable
                     jcrop_api = this;
                 });
             } else {
                 common.alertTips({
                     msg: msg.message
                 });
             }
         }
     });
     //提交
     $("#CropForm").ajaxForm({
         dataType: "json",
         beforeSubmit: function() {
             common.alertTips({
                 msg: "图像保存中,请稍后!"
             });
         },
         error: function() {
             common.alertTips({
                 msg: "操作失败,请稍后再试!"
             });
         },
         success: function(json) {
             if (json.status == 1) {
                 opts.success(json.picsurl);
                 //回传上传的图片地址
                 _UploadPics.remove();
                 //关闭图片上传窗口
                 common.alertTips({
                     msg: json.message
                 });
             } else {
                 common.alertTips({
                     msg: json.message
                 });
             }
         }
     }).submit(function() {
         return false;
     });
 });
Example #29
0
 that.find("a").click(function() {
     var v = $(this).index();
     that.find("input").val(v + 1);
 });
Example #30
0
 function updateCoords(c) {
     $("#crop-x").val(c.x);
     $("#crop-y").val(c.y);
     $("#crop-w").val(c.w);
     $("#crop-h").val(c.h);
 }