1
0

Add per-repo counts to EGG
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 21s
Build Docker and Deploy / Deploy to Server (push) Successful in 16s

This commit is contained in:
2025-07-12 18:32:22 +02:00
parent 6d54e5b9ba
commit e5c9b1c2a0
10 changed files with 133 additions and 21 deletions

View File

@@ -763,6 +763,7 @@ html, body {
border-radius: 3px;
box-sizing: border-box;
opacity: 0;
pointer-events: none;
}
.extGitGraphContainer {

View File

@@ -145,7 +145,7 @@ html,body{margin:0;padding:0;height:100%}
.git_list text.caption_month{font-size:8px;fill:#BBB}
.git_list text.caption_day{font-size:8px;fill:#BBB}
.svg-tip:after{box-sizing:border-box;position:absolute;left:50%;height:5px;width:5px;bottom:-10px;margin:0 0 0 -5px;content:" ";border:5px solid transparent;border-top-color:rgba(0,0,0,0.8);border-image:none}
.svg-tip{padding:5px;background:none repeat scroll 0 0 rgba(0,0,0,0.8);color:#BBB;font-size:12px;position:absolute;z-index:99999;text-align:center;border-radius:3px;box-sizing:border-box;opacity:0}
.svg-tip{padding:5px;background:none repeat scroll 0 0 rgba(0,0,0,0.8);color:#BBB;font-size:12px;position:absolute;z-index:99999;text-align:center;border-radius:3px;box-sizing:border-box;opacity:0;pointer-events: none;}
.extGitGraphContainer{background-color:#fcfcfc;margin:10px;display:inline-block;border:1px solid #222;border-radius:0;box-shadow:0 0 1px rgba(0,0,0,0.25) inset}
.egg_footer{margin-top:5px;text-align:right;margin-right:5px;margin-bottom:5px;color:#888}
.egg_footer>a{text-decoration:none;color:inherit}

View File

@@ -67,6 +67,8 @@
border-radius: 3px;
box-sizing: border-box;
opacity: 0;
pointer-events: none;
}
.extGitGraphContainer {

View File

@@ -10,6 +10,7 @@ var ExtendedGitGraph2;
masterTip.style.display = 'none';
const masterTipHeader = masterTip.getElementsByTagName('strong')[0];
const masterTipContent = masterTip.getElementsByTagName('span')[0];
const masterTipExtra = masterTip.getElementsByTagName('span')[0];
const rects = Array.from(document.getElementsByClassName("egg_rect"));
for (let rect of rects) {
rect.addEventListener("mouseenter", event => {
@@ -19,6 +20,24 @@ var ExtendedGitGraph2;
masterTip.style.display = 'block';
masterTipHeader.innerHTML = count + ' commits';
masterTipContent.innerHTML = ' on ' + date;
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
masterTipExtra.style.display = 'grid';
const extraAttr = target.getAttributeNames().sort().filter(p => p.startsWith('data-repo-')).map(p => target.getAttribute(p));
let extraHTML = '';
for (const attr of extraAttr) {
try {
let obj = JSON.parse(attr.replace(/'/g, '"'));
extraHTML += `<span class="extra-attr">[${obj.source}] ${obj.repo_name}:</span><strong>${obj.count}</strong>\n`;
}
catch (e) {
console.error('Error parsing extra attribute:', attr, e);
}
}
masterTipExtra.innerHTML = extraHTML;
}
else {
masterTipExtra.style.display = 'none';
}
masterTip.style.left = (window.pageXOffset + target.getBoundingClientRect().left - masterTip.getBoundingClientRect().width / 2 - 3.5 + 9) + 'px';
masterTip.style.top = (window.pageYOffset + target.getBoundingClientRect().top - masterTip.getBoundingClientRect().height - 10) + 'px';
});
@@ -27,4 +46,4 @@ var ExtendedGitGraph2;
}
ExtendedGitGraph2.initHover = initHover;
})(ExtendedGitGraph2 || (ExtendedGitGraph2 = {}));
window.onload = () => { ExtendedGitGraph2.initHover(); };
window.onload = () => { ExtendedGitGraph2.initHover(); };