PageSourceSearch

https://larachecity.com/public/naples/js/jquery.news_detail.js

js larachecity.com collected 2026-10-03 02:36:14 UTC 3,608 bytes, 100 lines download raw bytes

1$(function () {
2    // 点击评论提交评论
3    $(".g-click-comment").click(function () {
4        // 验证是否不用登陆就可以评论
5        var commentLimit = $("input[name='comment-limit']").val();
6        if (commentLimit == 2) {
7            // 需要验证是否登录
8            if (false === isUserLogin()) {
9                layer.alert(languagePack('noLoginMessage'), function (index) {
10                    window.location.href = memberLoginUrl;
11                    layer.close(index);
12                });
13                return '';
14            }
15        }
16        // 获取验证码
17        var code = $("input[name='code']").val();
18        if (code === "") {
19            layer.alert(languagePack('verificationCodeCannotBeEmpty'), function (index) {
20                layer.close(index);
21            });
22            return '';
23        }
24        // 获取文章的id
25        var articleId = $("input[name='article-id']").val();
26        if (parseInt(articleId) < 1) {
27            return '';
28        }
29        // 是否匿名
30        if ($("input[name='anonymous']").length < 1 || $("input[name='anonymous']").is(":checked")) {
31            var anonymous = 1;
32        } else {
33            var anonymous = 0;
34        }
35        // 获取评论内容
36        var message = $("textarea[name='comment-message']").val();
37        if (message == "") {
38            layer.alert(languagePack('pleaseEnterComments'), function (index) {
39                layer.close(index);
40            });
41            return '';
42        }
43        if (strlen(message) > 1000) {
44            layer.alert(languagePack('commentaryContentCanNotMoreThan500Words'), function (index) {
45                layer.close(index);
46            });
47            return '';
48        }
49        $.ajax({
50            type: "POST",
51            url: ajaxUrlArticleComment,
52            data: {
53                commentLimit: commentLimit,
54                articleId: articleId,
55                anonymous: anonymous,
56                message: message,
57                code: code
58            },
59            dataType: 'json',
60            success: function (_ret) {
61                // 非法操作
62                if (_ret._return !== "success" && _ret.code == "110") {
63                    return  ajaxError();
64                }
65                // 登录超时
66                if (_ret._return !== "success" && _ret.code == "1") {
67                    gotoMemberLoginPage();
68                }
69                // 错误信息提示
70                if (_ret._return !== "success" && _ret.message !== "") {
71                    if (_ret.code == "1") {
72                        layer.alert(_ret.message, function (index) {
73                            window.location.href = memberLoginUrl;
74                            layer.close(index);
75                        });
76                    } else {
77                        layer.alert(_ret.message, function (index) {
78                            layer.close(index);
79                        });
80                    }
81                    return false;
82                }
83                // 返回成功
84                if (_ret._return === "success") {
85                    setTimeout(function () {
86                        window.location.reload();
87                    }, 3000);
88                    layer.alert(languagePack('commentOnSuccess'), function (index) {
89                        window.location.reload();
90                        layer.close(index);
91                    });
92                }
93            },
94            error: function () {
95                return  ajaxError();
96            }
97        });
98    });
99});
100

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.