Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix repository page and links #50

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fixers/repository/about-fixer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class AboutFixer extends Fixer {
}

apply() {
const repositoryContent = document.querySelector("main .repository-content");
const repositoryContent = document.querySelector("main .repository-content > div");
const cell = repositoryContent.querySelector(".BorderGrid-cell");
const about = cell.querySelector(".f4");
const website = cell
Expand Down
4 changes: 2 additions & 2 deletions src/fixers/repository/columns-fixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default class ColumnsFixer extends Fixer {
}

waitUntilFixerReady() {
return waitUntilElementsReady("main:nth-child(1) .repository-content");
return waitUntilElementsReady("main:nth-child(1) .repository-content > div");
}

apply() {
const repositoryContent = document.querySelector(".repository-content");
const repositoryContent = document.querySelector(".repository-content > div");
const gutter = repositoryContent.querySelector(".Layout--sidebarPosition-end");
const inner = gutter.firstElementChild;

Expand Down
2 changes: 1 addition & 1 deletion src/fixers/repository/container-fixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export default class ContainerFixer extends Fixer {

apply() {
const container = document.querySelector("main .container-xl");
container.className = "container-lg clearfix new-discussion-timeline px-3";
container.className = "container-lg clearfix px-3";
}
}
2 changes: 1 addition & 1 deletion src/fixers/repository/edit-details-fixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class EditDetailsFixer extends Fixer {
apply() {
const details = document.querySelector("main .repository-content .BorderGrid-row:nth-child(1) details");
if (details) {
document.querySelector("main .repository-content").prepend(details);
document.querySelector("main .repository-content > div").prepend(details);
}
}
}
2 changes: 1 addition & 1 deletion src/fixers/repository/help-fixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default class HelpFixer extends Fixer {
}

waitUntilFixerReady() {
return waitUntilEntriesReady("main:nth-child(1) div.repository-content > :first-child");
return waitUntilEntriesReady("main:nth-child(1) div.repository-content > div > :first-child");
}
}
2 changes: 1 addition & 1 deletion src/fixers/repository/language-bar-fixer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class LanguageBarFixer extends Fixer {
]
.map(this.extractLanguageData);

const container = document.querySelector(".repository-content");
const container = document.querySelector(".repository-content > div");
const shouldBeOpen = await settings.openLanguagesByDefault;

container.prepend(<LanguageBar open={shouldBeOpen} langs={langs}/>);
Expand Down
4 changes: 2 additions & 2 deletions src/fixers/repository/summary-fixer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class SummaryFixer extends Fixer {
async apply(location: string, backupContainer: HTMLElement) {
const langsBar = document.querySelector(".repository-content details summary div.repository-lang-stats-graph");
document
.querySelector(".repository-content")
.querySelector(".repository-content > div")
.prepend(
<SummaryContainer rounded={!langsBar}>
{this.createCommitsSummaryElement(backupContainer)}
Expand Down Expand Up @@ -157,7 +157,7 @@ export default class SummaryFixer extends Fixer {
link = data.querySelector("a").href;
} else {
count = defaultCount;
link = `/${getRepoURL(location)}/${additionalPath}${pluralize(text, count)}`;
link = `/${getRepoURL(location)}/${additionalPath}${pluralize(text, 2)}`;
}

return <SummaryElement icon={icon} href={link} text={text} count={count} />;
Expand Down
2 changes: 1 addition & 1 deletion src/fixers/repository/topics-fixer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class TopicsFixer extends Fixer {
apply() {
const firstTopic = document.querySelector("main .repository-content .BorderGrid-cell .topic-tag");
document
.querySelector("main .repository-content")
.querySelector("main .repository-content > div")
.prepend(
<TopicsContainer>
{firstTopic.parentElement}
Expand Down