PHP Documentation Columnify & Other Improvements

View the PHP document front page in a multi-column layout and some other small improvements.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         PHP Documentation Columnify & Other Improvements
// @version      2.0
// @description  View the PHP document front page in a multi-column layout and some other small improvements.
// @author       Shakil Shahadat
// @match        https://www.php.net/manual/*/
// @match        https://www.php.net/manual/*/index.php
// @namespace    https://greasyfork.org/en/users/6404-shakil
// ==/UserScript==

'use strict';

// Multi-column layout
document.querySelector( '.chunklist' ).style.WebkitColumnCount = 5;
document.querySelector( '.chunklist' ).style.MozColumnCount = 5;
document.querySelector( '.chunklist' ).style.ColumnCount = 5;

document.querySelector( '.chunklist' ).style.WebkitColumnRuleStyle = 'dotted';
document.querySelector( '.chunklist' ).style.MozColumnRuleStyle = 'dotted';
document.querySelector( '.chunklist' ).style.ColumnRuleStyle = 'dotted';

document.querySelector( '.chunklist' ).style.WebkitColumnRuleWidth = '1px';
document.querySelector( '.chunklist' ).style.MozColumnRuleWidth = '1px';
document.querySelector( '.chunklist' ).style.ColumnRuleWidth = '1px';

// Hide unnecessary segments
for ( let e of [ '.headsup', '.page-tools', '.info', '.contribute', '#usernotes', 'footer' ] )
{
	document.querySelector( e ).style.display = 'none';
}

// Keep the header where it should be
document.querySelector( 'nav' ).style.position = 'absolute';

// Widen the layout
document.querySelector( '#layout' ).style.width = '100%';

// Add target="_blank" to all anchor tags, v 2.1
for ( let x of document.links ) x.setAttribute( 'target', '_blank' );