Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Chatconnect log IP & user listing
- * @description Display IP and usernames of [[Special:Log/chatconnect]]
- * @author Ozuzanna
- */
- if ("Special:Log/chatconnect".indexOf(mw.config.get('wgPageName')) !== -1) {
- $('#WikiaArticle').prepend('<textarea id="output-box" rows="10" cols="100"></textarea>');
- $('#WikiaArticle').prepend('<span style="color:white" id="button-filter" class="button">Filter</span>');
- $('li.mw-logline-chatconnect').each(function() {
- var text = $(this).text().match(/((?:\d{1,3}\.){3}\d{1,3})/)[0] + ' ';
- text += decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1])+'\n';
- $('#output-box').append(text);
- });
- $('#button-filter').click(function () {
- var uniqueDetails = [];
- var nameList = $('#output-box').val();
- $.each(nameList.split(/\n/), function(i, details) {
- details += '\n';
- if ($.inArray(details, uniqueDetails) === -1)
- uniqueDetails.push(details);
- });
- $('#output-box').val(uniqueDetails.join('\n').trim());
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement