PageSourceSearch

https://www.sellerapp.com/help/wp-content/uploads/siteground-optimizer-assets/docy-comments.min.js?ver=4.8.3

js sellerapp.com collected 2026-09-24 08:34:35 UTC 6,616 bytes, 20 lines download raw bytes

1(function($){'use strict';var params=window.docy_comments_params||{};var i18n=params.i18n||{};var DocyComments={init:function(){this.$form=$('#commentform');this.$response=$('.docy-comment-response');this.$list=$('#comments .comment_box').first();this.$count=$('#comments .c_head').first();this.$empty=$('#comments .comment_empty').first();this.$wrappers=$('#comments, .blog_comment_box');this.dismissTimer=null;this.bindSubmit();this.bindEditing()},notify:function(message,isError){var self=this;if(!this.$response.length||!message){return}
2if(this.dismissTimer){window.clearTimeout(this.dismissTimer);this.dismissTimer=null}
3this.$response.removeClass('is-error is-success').addClass(isError?'is-error':'is-success').attr('role',isError?'alert':'status').attr('aria-live',isError?'assertive':'polite').text(message).prop('hidden',!1);if(!isError){this.dismissTimer=window.setTimeout(function(){self.$response.prop('hidden',!0).text('');self.dismissTimer=null},5000)}},updateCount:function(data){if(typeof data.count==='undefined'){return}
4if(data.count>0){if(this.$count.length&&data.count_text){this.$count.text(' '+data.count_text+' ').prop('hidden',!1)}
5this.$wrappers.removeClass('no_comments').addClass('have_comments')}},clearEmptyState:function(){if(this.$empty.length){this.$empty.remove();this.$empty=$()}},bindSubmit:function(){var self=this;if(!this.$form.length){return}
6this.$form.on('submit',function(event){event.preventDefault();var $form=$(this);var $submit=$form.find('#submit, [type="submit"]').first();var $comment=$form.find('#comment');if($.trim($comment.val())===''){self.notify(i18n.empty_comment,!0);$comment.trigger('focus');return}
7if($submit.prop('disabled')){return}
8var originalLabel=$submit.is('input')?$submit.val():$submit.text();$submit.prop('disabled',!0).addClass('is-loading');if($submit.is('input')){$submit.val(i18n.posting||originalLabel)}else{$submit.text(i18n.posting||originalLabel)}
9var formData=$form.serializeArray();formData.push({name:'action',value:'docy_post_comment'});$.ajax({url:params.ajax_url,type:'POST',data:$.param(formData),dataType:'json'}).done(function(response){if(response&&response.success&&response.data){self.handlePosted(response.data,$form)}else{var msg=response&&response.data&&response.data.message?response.data.message:i18n.generic_error;self.notify(msg,!0)}}).fail(function(xhr){var msg=i18n.generic_error;if(xhr&&xhr.responseJSON&&xhr.responseJSON.data&&xhr.responseJSON.data.message){msg=xhr.responseJSON.data.message}
10self.notify(msg,!0)}).always(function(){$submit.prop('disabled',!1).removeClass('is-loading');if($submit.is('input')){$submit.val(originalLabel)}else{$submit.text(originalLabel)}})})},handlePosted:function(data,$form){var $node=$(data.comment_html);if(data.parent&&data.parent>0){var $parent=$('#comment-'+data.parent);if($parent.length){var $children=$parent.children('ul.children').first();if(!$children.length){$children=$('<ul class="children list-unstyled"></ul>');$parent.append($children)}
11$children.append($node)}else if(this.$list.length){this.$list.append($node)}}else if(this.$list.length){this.$list.append($node)}
12$form[0].reset();var $cancel=$('#cancel-comment-reply-link');if($cancel.length&&$cancel.is(':visible')){$cancel.trigger('click')}
13this.clearEmptyState();this.updateCount(data);this.notify(data.message,!1);if($node.length&&$node.offset()){var offset=24;var $adminBar=$('#wpadminbar');if($adminBar.length){offset+=$adminBar.outerHeight()}
14$('html, body').animate({scrollTop:$node.offset().top-offset},400)}},bindEditing:function(){var self=this;if(!params.editing_enabled||!params.is_logged_in){return}
15var $scope=$('#comments');if(!$scope.length){return}
16$scope.on('click','.docy-comment-edit-link',function(event){event.preventDefault();self.openEditor($(this).closest('.post_comment'))});$scope.on('click','.docy-comment-edit-cancel',function(event){event.preventDefault();self.closeEditor($(this).closest('.post_comment'))});$scope.on('click','.docy-comment-edit-save',function(event){event.preventDefault();self.saveEditor($(this).closest('.post_comment'))})},openEditor:function($comment){if(!$comment.length||$comment.hasClass('is-editing')){return}
17var $txt=$comment.find('.comment-txt').first();var source=$comment.find('.docy-comment-edit-source').first().val()||'';$comment.data('docy-original',$txt.html());var $editor=$('<div class="docy-comment-editor">'+'<textarea class="docy-comment-edit-field form-control"></textarea>'+'<div class="docy-comment-edit-actions">'+'<button type="button" class="docy-comment-edit-save fill-brand">'+this.escape(i18n.save||'Save')+'</button>'+'<button type="button" class="docy-comment-edit-cancel">'+this.escape(i18n.cancel||'Cancel')+'</button>'+'</div></div>');$editor.find('.docy-comment-edit-field').val(source);$txt.hide().after($editor);$comment.find('.comment_actions').first().hide();$comment.addClass('is-editing');$editor.find('.docy-comment-edit-field').trigger('focus')},closeEditor:function($comment){$comment.find('.docy-comment-editor').remove();$comment.find('.comment-txt').first().show();$comment.find('.comment_actions').first().show();$comment.removeClass('is-editing');$comment.find('.docy-comment-edit-link').first().trigger('focus')},saveEditor:function($comment){var self=this;var commentId=$comment.data('comment-id');var $editor=$comment.find('.docy-comment-editor');var $field=$editor.find('.docy-comment-edit-field');var $save=$editor.find('.docy-comment-edit-save');var content=$.trim($field.val());if(content===''){self.notify(i18n.empty_comment,!0);$field.trigger('focus');return}
18if($save.prop('disabled')){return}
19$save.prop('disabled',!0).text(i18n.saving||'Saving…');$.ajax({url:params.ajax_url,type:'POST',dataType:'json',data:{action:'docy_edit_comment',nonce:params.edit_nonce,comment_id:commentId,comment_content:content}}).done(function(response){if(response&&response.success&&response.data){var $txt=$comment.find('.comment-txt').first();$txt.html(response.data.content_html);$comment.find('.docy-comment-edit-source').first().val(response.data.source);self.closeEditor($comment);self.notify(response.data.message,!1)}else{var msg=response&&response.data&&response.data.message?response.data.message:i18n.generic_error;self.notify(msg,!0)}}).fail(function(xhr){var msg=i18n.generic_error;if(xhr&&xhr.responseJSON&&xhr.responseJSON.data&&xhr.responseJSON.data.message){msg=xhr.responseJSON.data.message}
20self.notify(msg,!0)}).always(function(){$save.prop('disabled',!1).text(i18n.save||'Save')})},escape:function(str){return $('<div>').text(str||'').html()}};$(function(){DocyComments.init()})})(jQuery)

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.