Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name vk.com/docs gallery
- // @namespace vk.com
- // @version 0.0.1
- // @description gallery mode for VK docs
- // @author AHOHNMYC
- // @match https://vk.com/doc*
- // @grant GM_addStyle
- // ==/UserScript==
- if ( location.href.match('vk.com/docs') ) {
- document.getElementById('docs_search_more').style.display = 'block';
- GM_addStyle(`
- .docs_item_actions, .docs_item_cont {display:none!important}
- .docs_item_thumb_img, .docs_item_thumb {max-height: none !important; width: auto !important; height: auto !important}
- .docs_item {padding: 0 0 0 6px !important; float: left}
- .docs_item_thumb_wrap {margin-left: 0 !important; width:130px !important}
- .docs_wrap {padding: 0 !important}
- `);
- } else {
- addButton('Профиль', ()=>location.href=location.href.match(/[^_]+/)[0].replace('doc', 'id'));
- addButton('Альбомы', ()=>location.href=location.href.match(/[^_]+/)[0].replace('doc', 'albums'));
- addButton('Фотки', ()=>location.href=location.href.match(/[^_]+/)[0].replace('doc', 'photos'));
- }
- function addButton(text, callback) {
- let but = document.createElement('button');
- but.className = 'flat_button fl_r';
- but.textContent = text;
- but.addEventListener('click', callback);
- document.querySelector('.clear_fix').appendChild(but);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement