PageSourceSearch

https://www.017207.com/wp-content/themes/begin/js/comments-ajax.js?ver=2023/12/28

js 017207.com collected 2026-10-09 04:32:30 UTC 4,374 bytes, 139 lines download raw bytes

1function comments_ajax() {
2	var ajax_php_url = ajaxcomment.ajax_php_url;
3	txt1 = '<div id="loading"><div class="loading-spin"></div></div>',
4	txt2 = '<div id="error">#</div>',
5	txt3 = '"> <div id="edita"></div>',
6	num = 1,
7	comm_array = [];
8	comm_array.push("");
9	jQuery(document).ready(function($) {
10		$comments = $("#comments-title");
11		$cancel = $("#cancel-comment-reply-link");
12		cancel_text = $cancel.text();
13		$submit = $("#commentform #submit");
14		$submit.attr("disabled", false);
15		$("#comment").after(txt1 + txt2);
16		$("#loading").hide();
17		$("#error").hide();
18		$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $("html") : $("body")) : $("html,body");
19		$("#commentform").submit(function() {
20			$("#loading").fadeIn();
21			$submit.attr("disabled", true).fadeTo("slow", 0.5);
22			$.ajax({
23				url: ajax_php_url,
24				data: $(this).serialize(),
25				type: $(this).attr("method"),
26				error: function(request) {
27					$("#loading").fadeOut();
28					$("#error").fadeIn().html("" + request.responseText);
29					setTimeout(function() {
30						$submit.attr("disabled", false).fadeTo("slow", 1);
31						$("#error").fadeOut()
32					},
33					3000);
34				},
35				success: function(data) {
36					$("#loading").hide();
37					comm_array.push($("#comment").val());
38					$("textarea").each(function() {
39						this.value = ""
40					});
41					var t = addComment,
42					cancel = t.I("cancel-comment-reply-link"),
43					temp = t.I("wp-temp-form-div"),
44					respond = t.I(t.respondId),
45					post = t.I("comment_post_ID").value,
46					parent = t.I("comment_parent").value;
47					new_htm = '" id="new_comm_' + num + '"></';
48					new_htm = (parent == "0") ? ('\n<ol style="clear:both;" class="comment-list' + new_htm + "ol>") : ('\n<ul class="children' + new_htm + "ul>");
49					$("#respond").before(new_htm);
50					$("#new_comm_" + num).hide().append(data);
51					$("#new_comm_" + num + " li").append();
52					$("#new_comm_" + num).fadeIn(4000);
53					$body.animate({
54						scrollTop: $("#new_comm_" + num).offset().top - 200
55					},
56					900);
57					countdown();
58					num++;
59					cancel.style.display = "none";
60					cancel.onclick = null;
61					t.I("comment_parent").value = "0";
62					if (temp && respond) {
63						temp.parentNode.insertBefore(respond, temp);
64						temp.parentNode.removeChild(temp)
65					}
66				}
67			});
68			return false
69		});
70		addComment = {
71			moveForm: function(commId, parentId, respondId, postId, num) {
72				var t = this,
73				div, comm = t.I(commId),
74				respond = t.I(respondId),
75				cancel = t.I("cancel-comment-reply-link"),
76				parent = t.I("comment_parent"),
77				post = t.I("comment_post_ID");
78				t.respondId = respondId;
79				postId = postId || false;
80				if (!t.I("wp-temp-form-div")) {
81					div = document.createElement("div");
82					div.id = "wp-temp-form-div";
83					div.style.display = "none";
84					respond.parentNode.insertBefore(div, respond)
85				} ! comm ? (temp = t.I("wp-temp-form-div"), t.I("comment_parent").value = "0", temp.parentNode.insertBefore(respond, temp), temp.parentNode.removeChild(temp)) : comm.parentNode.insertBefore(respond, comm.nextSibling);
86				$body.animate({
87					scrollTop: $("#respond").offset().top - 180
88				},
89				400);
90				if (post && postId) {
91					post.value = postId
92				}
93				parent.value = parentId;
94				cancel.style.display = "";
95				cancel.onclick = function() {
96					var t = addComment,
97					temp = t.I("wp-temp-form-div"),
98					respond = t.I(t.respondId);
99					t.I("comment_parent").value = "0";
100					if (temp && respond) {
101						temp.parentNode.insertBefore(respond, temp);
102						temp.parentNode.removeChild(temp)
103					}
104					this.style.display = "none";
105					this.onclick = null;
106					return false
107				};
108				try {
109					t.I("comment").focus()
110				} catch(e) {}
111				return false
112			},
113			I: function(e) {
114				return document.getElementById(e)
115			}
116		};
117		function exit_prev_edit() {
118			$new_comm.show();
119			$new_sucs.show();
120			$("textarea").each(function() {
121				this.value = ""
122			});
123			edit = ""
124		}
125		var wait = 8,
126		submit_val = $submit.val();
127		function countdown() {
128			if (wait > 0) {
129				$submit.val(wait);
130				wait--;
131				setTimeout(countdown, 1000)
132			} else {
133				$submit.val(submit_val).attr("disabled", false).fadeTo("slow", 1);
134				wait = 8
135			}
136		}
137	})
138}
139comments_ajax();

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.