Created
September 14, 2017 02:04
-
-
Save rwilkes/36a7e3974d96958c465a0f1c3c9e2f23 to your computer and use it in GitHub Desktop.
VK Admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name VK Admin | |
| // @grant none | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js | |
| // @include https://new.vk.com/* | |
| // ==/UserScript== | |
| // | |
| jQuery(function($){ | |
| function bindAll(){ | |
| $("#page_body").unbind("DOMSubtreeModified"); | |
| $('.post').each(function(){ | |
| var id = $(this).attr("data-post-id").split('_')[0].split('-')[1]; | |
| var author = $(this).find('.author').attr('data-from-id'); | |
| var del_link = $(this).find('.ui_actions_menu_item[onclick*="deletePost"]'); | |
| var ban_link = $(this).find('.___ban_link'); | |
| if(!ban_link.html() && del_link && author && author > 0){ | |
| del_link.after('<a class="ui_actions_menu_item ___ban_link" onclick="showBox(\'groupsedit.php\', {act: \'bl_edit\', name: \'id'+author+'\', gid: '+id+', auto: 0}, {stat: [\'page.css\', \'ui_controls.js\', \'ui_controls.css\'], dark: 1});">Заблокировать</a>'); | |
| } | |
| }); | |
| $('.reply').each(function(){ | |
| var id = $(this).attr("data-post-id").split('_')[0].split('-')[1]; | |
| var author = $(this).find('.author').attr('data-from-id'); | |
| var del_link = $(this).find('.reply_delete_button'); | |
| var ban_link = $(this).find('.___ban_link'); | |
| if(!ban_link.attr('data-title') && del_link && author && author > 0){ | |
| del_link.after('<div class="reply_action fl_r ___ban_link" style="background: url(/images/icons/edit_newsfeed.png) no-repeat 0px -15px;" data-title="Заблокировать" onmouseover="showTitle(this);" onclick="showBox(\'groupsedit.php\', {act: \'bl_edit\', name: \'id'+author+'\', gid: '+id+', auto: 0}, {stat: [\'page.css\', \'ui_controls.js\', \'ui_controls.css\'], dark: 1});"></div>'); | |
| } | |
| }); | |
| $("#page_body").bind("DOMSubtreeModified",function(){bindAll()}); | |
| } | |
| if($('#page_actions').attr('id')){ | |
| var fst = $('#page_actions').find('.page_actions_cont').find('.page_actions_item:first'); | |
| var group = fst.attr('href').split('?')[0]; | |
| if(group){ | |
| fst.after('<a id="" class="page_actions_item" href="' + group + '?act=blacklist">Чёрный список</a>'); | |
| } | |
| } | |
| bindAll(); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://openuserjs.org/scripts/z-aec/VK_Admin