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.