User:Chiến Thần Vương/global.js

$(function {   if(!$('#WikiaArticleComments').length) {        return;    }    window.CommentReply = function {        $('.buttons .tools').before('Quote ');        $('.article-comm-quote').click(function { var text = '', nick = $(this).parents('.SpeechBubble').attr('data-user'), $comment = $(this).parents('.speech-bubble-message'); $(this).parents('.speech-bubble-message').find('.article-comm-text p').each(function {               text += $(this).text.replace(/\n/g,' ');            }); if ($(this).parents('.sub-comments').length) { $(this).parents('.sub-comments').prev.find('.article-comm-reply').click; } else { $(this).parents('.SpeechBubble').find('.article-comm-reply').click; }           $comment.bind("DOMSubtreeModified", function {                if ($('.loading-indicator').css('display') != 'none') {                    return;                }                $comment.unbind("DOMSubtreeModified");                $('[name="wpArticleReply"]').val(''+nick+': '+text+' ');            }); });   };    if ($('#article-comments').length) {        CommentReply;    } else {        $("#WikiaArticleComments").bind("DOMSubtreeModified", function { if (!$('#article-comments').length) { return; }           $("#WikiaArticleComments").unbind("DOMSubtreeModified"); CommentReply; });   } });