User:Andrey Andrey/global.js

/*Batch Delete Settings*/ batchDeleteDelay = 1;

/*Fast Delete Settings*/ window.AjaxCommentDeleteConfig = { fastDelete: "Housekeeping" } var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'Spam'}; fdButtons[fdButtons.length] = { 'summary': 'Vandalism', 'label': 'Vandalism'}; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'Clean-up'}; fdButtons[fdButtons.length] = { 'summary': 'Unused', 'label': 'Unused'}; $(window).load(function {   switch( wgCanonicalNamespace ) {        case 'User':        case 'User_talk':        $('.UserProfileActionButton .wikia-menu-button').css('margin-left','24px').appendTo('.UserProfileActionButton');        break;    }    $('.UserProfileActionButton .wikia-button').show; });

/*Mass Cetegorization Settings*/ massCategorizationDelay = 1;

/*Null Edit Settings*/ nullEditDelay = 1; //sin

/*FileUsageAuto-update Settings*/ LIRoptions = { bottomMessage: '', editSummary: 'Updating file links (automatic)', singleButtonText: 'Rename and update', queueButtonText: 'Add to queue', delay: 1000 } /*Nuke Settings*/ nukeDeleteReason = "Cleanup";

/*RedirectManagement Settings*/ linkSweepConfirmation = true; LinkSweeperDelay = 1000;

/*CacheCheck Settings*/ window.cacheSkip = []; window.cacheSkipLimit = 1000; window.topLevelCat = '';

/*Taken from User:Dorumin/global.js*/ $(".message-removed.hide").removeClass("hide").each(function {   var $this = $(this),    id = $this.attr('data-id'),    relativeid = $this.attr('id'),    isBoardThread = !!$('.voting-controls').length,    Api = new mw.Api;    Api.get({ action: 'query', prop: 'revisions', rvprop: 'timestamp|user', pageids: id, rvlimit: 500 }).done(function(ts) { var rev = ts.query.pages[id].revisions[0], name = rev.user, time = rev.timestamp, d = new Date(time), // this may be a readable string, but the code certainly isn't :P readableTime = d.getHours + d.getTimezoneOffset / 60 + ':' + d.getMinutes + ', ' + wgMonthNames[d.getMonth + 1] + ' ' + d.getDate + ', ' + d.getFullYear; $.get('/api/v1/User/Details', {           ids: name,            size: 50        }).done(function(avi) {            avi = avi.items[0].avatar;            Api.get({ action: 'parse', pageid: id           }).done(function(d) { var html = d.parse.text['*'], $avatar = $(' ', {                   class: 'speech-bubble-avatar'                }).append($('', { href: wgArticlePath.replace('$1', 'Message_Wall:' + name), append: $(' ', {                       src: avi,                        width: '30',                        height: '30',                        class: 'avatar',                        alt: name                    }) })),               $msg = $(' ', {                    class: 'speech-bubble-message'                }).append($(' ', { class: 'MiniEditorWrapper', 'data-min-height': '100', 'data-max-height': '400', append: [ $(' ', {                           class: 'edited-by',                            append: [                                $('', { text: name, href: wgArticlePath.replace('$1', 'Message_Wall:' + name) }),                               $('', { class: 'subtle', href: wgArticlePath.replace('$1', 'Message_Wall:' + name) })                           ]                        }),                        $(' ', {                            class: 'editarea',                            'data-space-type': 'editarea',                            append: [                                $(' ', { class: 'msg-body', id: 'WallMessage_' + id, html: html }),                               $(' ', {                                    class: 'loading-indicator', 'data-space-type': 'loading-status', append: [ $(' ', {                                           class: 'loading-background'                                        }), $(' ', {                                           class: 'loading-message',                                            append: [                                                $(' ', { class: 'loading-throbber', html: ' ' }),                                               $(' ', {                                                    class: 'loading-text', html: 'Loading editor' })                                           ]                                        })                                    ]                                })                            ]                        }),                        $(' ', {                            class: 'toolbar',                            'data-space-type': 'toolbar'                        }), $(' ', {                           class: 'msg-toolbar',                            append: [                                $(' ', { class: 'timestamp', append: $('', {                                       class: 'permalink',                                        tabindex: '-1',                                        href: '#' + relativeid,                                        append: [                                            $(' ', { class: 'timeago abstimeago', title: time, alt: readableTime, each: function { $(this).timeago; }                                           }),                                            $(' ', {                                                class: 'timeago-fmt', text: readableTime })                                       ]                                    })                                })/*, not adding buttons  coz it's way too hard (also idk why you'd want to quote a removed message)                                $(' ', { class: 'buttonswrapper', append: the_buttons :P })*/                           ]                        })                    ]                }));                $this.append($avatar, $msg); console.log(d); });       });    }); });

/****************** Import scripts ******************/ importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:NullEditButton/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:CacheCheck/code.js',        'u:dev:AjaxBatchDelete/code.js',        'u:dev:AjaxRename/code.js',        'u:dev:DupImageList/code.js',        'u:dev:FastDelete/code.js',        'u:dev:ListFiles/code.js',        'u:kocka:MediaWiki:AjaxCommentDelete/code.js',        'u:dev:MultiUpload/code.js',        'u:dev:MassCategorization/code.js',        'u:dev:MediaWiki:FileUsageAuto-update/code.js',        'u:dev:QuickDiff/code.js',        'u:dev:MediaWiki:Nuke/code.js',        'u:dev:MediaWiki:MassBlock/code.js',        'u:dev:MediaWiki:RedirectManagement/code.js',        'u:dev:Linksweeper/code.js',        'u:dev:DisplayTimer/code.js'    ] });