Page MenuHomePhabricator
Paste P9475

GreaseMonkey script to add a link to https://wikifarm.wmflabs.org/cpt/index.php/Phab:Txxxx on Phab tasks
ActivePublic

Authored by Anomie on Oct 24 2019, 3:27 PM.
Referenced Files
F30878361: raw.txt
Oct 24 2019, 3:27 PM
Subscribers
None
// ==UserScript==
// @name Add Phab task summary link
// @include https://phabricator.wikimedia.org/T*
// @version 1
// ==/UserScript==
var sidebar = document.querySelector( '#phabricator-standard-page-body .phui-side-column .phabricator-action-list-view' );
if ( sidebar ) {
var a = document.createElement( 'a' );
a.className = 'phabricator-action-view-item';
a.href = 'https://wikifarm.wmflabs.org/cpt/index.php/Phab:' + document.location.pathname.match( /T\d+/ )[0];
a.setAttribute( 'data-sigil', 'workflow' );
var span = document.createElement( 'span' );
span.className = 'visual-only phui-icon-view phui-font-fa fa-cubes phabricator-action-view-icon';
span.setAttribute( 'aria-hidden', 'true' );
a.appendChild( span );
a.appendChild( document.createTextNode( 'Patch summary' ) );
var li = document.createElement( 'li' );
li.className = 'phabricator-action-view phabricator-action-view-href action-has-icon';
li.appendChild( a );
sidebar.appendChild( li );
}