Resize Forum-Auto

Restyle forum-auto.caradisiac.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==// @name Resize Forum-Auto
// @version 1.3
// @author Sly_North
// @description Restyle forum-auto.caradisiac.com
// @grant none
// @include https://forum-auto.caradisiac.com*
// @namespace https://forum-auto.caradisiac.com
// @license MIT
// @icon https://content-eu.invisioncic.com/m304542/monthly_2020_11/android-chrome-36x36.png
// ==/UserScript==

console.log('ResizeForumAuto - Begin');

SetStyleByClass = function(name, style) {
  var elts = document.getElementsByClassName(name);
  if (elts.length > 0) {
    for (var i = 0; i < elts.length; ++i)
    elts[i].setAttribute('style', style);
  }
  else console.log('ResizeForumAuto - Element class not found: ' + name);
}

SetStyleById = function(name, style) {
  var elt = document.getElementById(name);
  if (elt) elt.setAttribute('style', style);
  else console.log('ResizeForumAuto - Element id not found: ' + name);
}

ResizeByClass = function(name) {
  SetStyleByClass(name, 'width: 100vw; max-width: 90vw; margin: 0px; margin-left: 2vw;');
}

ResizeAll = function() {
	ResizeByClass('main');
	ResizeByClass('ipsLayout_container');

  var hasSideBar = document.getElementsByClassName('ipsWidget').length > 1;
  if (hasSideBar) {
  	// Side bar
  	SetStyleByClass('ipsLayout_sidebar', 'padding-left: 10px;min-width: 250px;');
  } else {
  	SetStyleByClass('ipsLayout_sidebarright', 'display: none;');
  }

  // Messages
  SetStyleByClass('ipsComment', 'margin-bottom: 5px;');

  SetStyleById('ipsLayout_contentArea','background: rgb(220, 220, 220);');
  SetStyleByClass('ipsComment_author', 'padding: 0 !important;');
  SetStyleByClass('ipsComment_meta', 'padding: 0;');
  SetStyleByClass('ipsItemControls', 'padding: 0; min-height: 35px; height: 35px;'); // message controls
  SetStyleByClass('ipsPadding_vertical', 'padding: 0; max-height: 70px; overflow: hidden;'); // message signature
  
  // Quotes
  SetStyleByClass('ipsQuote_contents', 'font-size: 75%;');
  SetStyleByClass('ipsQuote_citation', 'max-height: 20px; padding: 0;');
}

setTimeout(100, ResizeAll());
setTimeout(500, ResizeAll());
setTimeout(5000, ResizeAll());
console.log('ResizeForumAuto - End');