MediaWiki:Comment.js

if (mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 500) { (function{   var o = jQuery.fn.removeClass;    jQuery.fn.removeClass = function {        var result = o.apply(this, arguments);        jQuery(this).trigger('commentsLoaded');        return result;    } }); $(function{   $('#WikiaArticleComments').one('commentsLoaded', function(event){ var timer = window.setInterval(function {           if ($('.article-comments-pagination').length > 1) {                doStuff;                window.clearInterval(timer);            }        }, 100); });   function doStuff {        $('#article-comments-ul .edited-by').each(function { var link = $(this).children('a:first').attr('href'); link = link.substring(0, link.indexOf('?')); $(this).find('.edit-link').append(             '(full)'            ); });   } }); }

$(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+' đã viết: '+text+' ');            }); });   };    if ($('#article-comments').length) {        CommentReply;    } else {        $("#WikiaArticleComments").bind("DOMSubtreeModified", function { if (!$('#article-comments').length) { return; }           $("#WikiaArticleComments").unbind("DOMSubtreeModified"); CommentReply; });   } });

WikiaEditorButtons = { 'Spoiler code': [ " ",       "Văn bản cần ẩn đi", " "   ],    'Emo code': [ "="   ],    'Font color':     [ ""   ] }; (function(mw, $) {    var WE = window.WikiaEditor;    if (typeof (WE) === 'undefined' || typeof (WikiaEditorButtons) === 'undefined') return;    var default_config = {            modes: {                source: true            },            headerClass: 'formatsourcemini',            items: [                'SourceBold',                'SourceItalic',                'SourceLink'            ]        },        new_items = [];    $.each(WikiaEditorButtons, function(k, v) { wgEditorExtraButtons[k] = { type: 'button', labelId: 'Chèn ' + k.toLowerCase, className: 'we_' + k.toLowerCase, clicksource: function { insertTags(v[0], v[2], v[1], WE.getInstance.getEditbox[0]); }       };        default_config.items.push(k); });   WE.modules.FormatMiniEditorSource = $.createClass(WE.modules.ButtonsList, default_config); })(this.mediaWiki, this.jQuery);