FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

:bug: Fix after GitHub site update by darkred · Pull Request #128 · jerone/UserScripts · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .md  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 4 additions & 3 deletions GitHub_Commit_Compare/GitHub_Commit_Compare.user.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// @namespace https://github.com/jerone/UserScripts
// @description Add controls to compare commits.
// @author jerone
// @contributor darkred

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

// @copyright 2017+, jerone (http://jeroenvanwarmerdam.nl)
// @license GPL-3.0
// @homepage https://github.com/jerone/UserScripts/tree/master/GitHub_Commit_Compare
Expand All @@ -16,7 +17,7 @@
// @include https://github.com/*/*/commits/*
// @exclude https://github.com/*/*.diff
// @exclude https://github.com/*/*.patch
// @version 0.0.1
// @version 0.0.2
// @grant none
// ==/UserScript==

Expand Down Expand Up @@ -143,9 +144,9 @@
const repo = document.querySelector('meta[property="og:url"]').content;

const compareA = document.querySelector('.GitHubCommitCompareButtonAB [name="GitHubCommitCompareButtonA"]:checked');
const hashA = compareA.parentNode.parentNode.parentNode.querySelector('[data-clipboard-text]').dataset.clipboardText;
const hashA = compareA.parentNode.parentNode.parentNode.querySelector('clipboard-copy').value;
const compareB = document.querySelector('.GitHubCommitCompareButtonAB [name="GitHubCommitCompareButtonB"]:checked');
const hashB = compareB.parentNode.parentNode.parentNode.querySelector('[data-clipboard-text]').dataset.clipboardText;
const hashB = compareB.parentNode.parentNode.parentNode.querySelector('clipboard-copy').value;

const a = document.getElementById('GitHubCommitCompareButton');
a.setAttribute('href', `${repo}/compare/${hashA}...${hashB}`);
Expand Down
13 changes: 13 additions & 0 deletions GitHub_Commit_Compare/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ Add controls to compare commits.

## Version History

* **0.0.2**

* 🐛 Fix after GitHub site update (fixed by [@darkred](https://github.com/darkred) in [#128](https://github.com/jerone/UserScripts/issues/128)).

* **0.0.1**

* Initial version.

## Contributors

* [darkred](https://github.com/darkred)

## External links

* [Greasy Fork](https://greasyfork.org/en/scripts/33563-github-commit-compare)
* [OpenUserJS](https://openuserjs.org/scripts/jerone/GitHub_Commit_Compare)

Back | FazBrowse Home | New Git URL