Auto-resize vk.com wall content
当前为
// ==UserScript==
// @name VKResizer
// @version 0.1
// @description Auto-resize vk.com wall content
// @author A-Ivan
// @include https://vk.com/*
// @grant none
// @namespace https://greasyfork.org/users/61380
// ==/UserScript==
(function() {
'use strict';
var ww = parseFloat($("#page_wall_posts").css('width'));
function check_rect(){
var check_elem = document.getElementById("narrow_column");
var coords = 0;
try {
var wallType = $("div.page_block").parent("div.wall_module").attr("id");
if(typeof(wallType) != "undefined")
{
coords = check_elem.getBoundingClientRect().bottom;
if(coords < 0)
{
$("div.post_header").css({'width': ww*1.27204+'px'});
$("div.media_desc.post_video_desc").css({'width': ww*1.35264+'px'});
$("div.page_post_sized_thumbs.clear_fix").css({'zoom': '1'});
$("div.wall_module:last").find("div.wall_post_text").css({'width': ww*1.35264+'px'});
var w = $("div.page_block").parent("div.wall_module").attr("id") == "profile_wall"? -ww/2 : 0;
$("#page_wall_posts").css({'width': ww*1.50377+'px', 'margin-left': w + 'px'});
}
else
{
$("div.post_header").css({'width': ww});
$("div.media_desc.post_video_desc").css({'width': ww*0.84886+'px'});
$("div.page_post_sized_thumbs.clear_fix").css({'zoom': '0.65999'});
$("div.wall_module:last").find("div.wall_post_text").css({'width': ww*0.80604+'px'});
$("#page_wall_posts").css({'width': ww+'px', 'margin-left': '0px'});
}
}
else //Новости
{
$("#feed_rows").find('div.page_post_sized_thumbs.clear_fix').css({'zoom': '0.66'});
}
}
catch(err){}
}
setTimeout(check_rect, 0);
setInterval(check_rect, 200);
})();