- enable линейная упаковка .
- Установите A 2-line Host .
Код: Выделить всё
// ==UserScript==
// @name Bitbucket change display of Git commit messages.user.js
// @namespace bitbucket
// @include https://bitbucket.org/*
// @version 1
// @grant none
// ==/UserScript==
// Guidance:
// https://somethingididnotknow.wordpress.com/2013/07/01/change-page-styles-with-greasemonkeytampermonkey/
// https://stackoverflow.com/questions/19385698/how-to-change-a-class-css-with-a-greasemonkey-script
// You need to use Firefox -> Browser Tools -> Web Developer Tools -> Inspector
// (or Google Chrome -> View -> Developer -> Developer Tools -> Inspector),
// to see the CSS elements that don't look good.
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
/** This function will run after the time delay, to wait for the dynamic content to load. */
window.setTimeout(changeCssMessageStyleInGitCommitTable_OnceOnly, 3000);
var GIT_COMMIT_TABLE_STYLE_CHANGED = false; // A global flag
/**
* Make the Git commits table show more text: Make the commit message
* display as 2 lines wrapped, without "..." truncation at the end.
*/
function changeCssMessageStyleInGitCommitTable_OnceOnly() {
try {
// The Message column should not show "...", and not have single-line spacing.
// You must get the cssTag names indirectly (without hard-coding), because they change often.
let gitCommitFirstTableRow = document.querySelectorAll("tr")[1];
if (gitCommitFirstTableRow == null || !window.location.href.includes("/commits")) {
console.log("changeCssMessageStyleInGitCommitTable_OnceOnly() Problem: gitCommitFirstTableRow == null, retrying");
window.setTimeout(changeCssMessageStyleInGitCommitTable_OnceOnly, 3000);
return;
}
var gitCommitFirstMessage = gitCommitFirstTableRow.children[2];
gitCommitFirstMessage = gitCommitFirstMessage.children[0].children[0];
if (!gitCommitFirstMessage.hasAttribute("class")) {
console.log(`ERROR 1: gitCommitFirstMessage ${gitCommitFirstMessage} - NO ATTRIBUTE "class". Retrying`);
gitCommitFirstMessage = gitCommitFirstTableRow.children[2].children[0].children[1];
if (!gitCommitFirstMessage.hasAttribute("class")) {
console.log(`ERROR 2: gitCommitFirstMessage ${gitCommitFirstMessage} - NO ATTRIBUTE "class". Exiting`);
return;
}
}
let cssTag1 = gitCommitFirstMessage.getAttribute("class").split(" ")[0];
addGlobalStyle(`.${cssTag1} { white-space: normal; line-height: normal; max-height: 37px }`);
// Author names should not show truncated "..." labels
var gitCommitFirstAuthor = gitCommitFirstTableRow.children[0].children[0].children[1];
let cssTag2 = gitCommitFirstAuthor.getAttribute("class").split(" ")[0];
addGlobalStyle(`.${cssTag2} { margin-left: 7px; text-overflow: unset; }`);
// Reduce the left and right padding of the git commits list
var table = document.querySelector("div[spacing='comfortable']");
if (table != null) {
let cssTag = table.getAttribute("class").split(" ")[1];
addGlobalStyle(`.${cssTag} { padding: 0px 6px; }`);
}
GIT_COMMIT_TABLE_STYLE_CHANGED = true;
} catch (error) {
console.log(`changeCssStylesInGitCommitTable() ERROR: ${error}`);
window.setTimeout(changeCssMessageStyleInGitCommitTable_OnceOnly, 6000); // retry
}
if (GIT_COMMIT_TABLE_STYLE_CHANGED == false) {
window.setTimeout(changeCssMessageStyleInGitCommitTable_OnceOnly, 5000); // retry in 5 seconds
}
}
Код: Выделить всё
addGlobalStyle(`.${cssTag1} { white-space: normal; line-height: normal; max-height: 37px }`);
- https://bitbucket.org/bitbucketpipeline ... s/commits/ />
- https://bitbucket.org/bitbucketpipeline ... t/commits/
- https://bitbucket.org/bitbucketpipepeli ... radle-buid Пользователь: https://bitbucket.org/bitbucketpipelines/
Подробнее здесь: https://stackoverflow.com/questions/699 ... d-with-a-u