1$('#commentform').on('submit', function (e) { 2 event.preventDefault(); 3 4 if($('#commentform').hasClass("bl-processing")){ 5 return; 6 } 7 8 $('#commentform').addClass("bl-processing"); 9 10 $.ajax({ 11 url: opBlog.ajax, 12 data: $('#commentform').serialize(), 13 method: 'POST', 14 headers: { "cache-control": "no-cache" }, 15 beforeSend: function(){ 16 $('#new_comment_blog_error').hide(); 17 $('#new_comment_blog_error').html(''); 18 $('#submitComment').addClass('processing'); 19 }, 20 complete: function() { 21 $('#commentform').removeClass('bl-processing'); 22 $('#submitComment').removeClass('processing'); 23 }, 24 success: function(resp) { 25 if (resp['error']) { 26 $.each(resp['error'], function(index, value) { 27 $('#new_comment_blog_error').append('<div>'+value+'</div>'); 28 }); 29 $('#new_comment_blog_error').slideDown(); 30 } 31 if (resp['success']) { 32 $('#new_comment_blog_error').hide(); 33 alert(resp['success']); 34 window.location.reload(); 35 } 36 } 37 }); 38}); 39 40var addComment = { 41 moveForm : function(commId, parentId, respondId, postId) { 42 43 var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID'); 44 if (!comm || !respond || !cancel || !parent){ 45 return; 46 } 47 48 t.respondId = respondId; 49 postId = postId || false; 50 51 if (!t.I('sm-temp-form-div')) { 52 div = document.createElement('div'); 53 div.id = 'sm-temp-form-div'; 54 div.style.display = 'none'; 55 respond.parentNode.insertBefore(div, respond); 56 } 57 58 comm.parentNode.insertBefore(respond, comm.nextSibling); 59 if (post && postId){ 60 post.value = postId; 61 } 62 parent.value = parentId; 63 cancel.style.display = ''; 64 65 cancel.onclick = function() { 66 var t = addComment, temp = t.I('sm-temp-form-div'), respond = t.I(t.respondId); 67 68 if (!temp || !respond){ 69 return; 70 } 71 72 t.I('comment_parent').value = '0'; 73 74 temp.parentNode.insertBefore(respond, temp); 75 temp.parentNode.removeChild(temp); 76 this.style.display = 'none'; 77 this.onclick = null; 78 return false; 79 }; 80 81 try { t.I('comment').focus(); } 82 catch(e) {} 83 84 return false; 85 }, 86 87 I : function(e) { 88 var elem = document.getElementById(e); 89 if(!elem){ 90 return document.querySelector('[name="'+e+'"]'); 91 }else{ 92 return elem; 93 } 94 } 95};
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.