forked from strictdoc-project/strictdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request strictdoc-project#1485 from strictdoc-project/stan…
…islaw/git_work UI: Diff Screen to review changes between document trees
- Loading branch information
Showing
31 changed files
with
1,724 additions
and
97 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -19,4 +19,5 @@ features = [ | |
# "REQUIREMENTS_COVERAGE_SCREEN", | ||
# "REQUIREMENT_TO_SOURCE_TRACEABILITY", | ||
"HTML2PDF", | ||
"DIFF", | ||
] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
47 changes: 47 additions & 0 deletions
47
strictdoc/export/html/_static/controllers/diff_controller.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Stimulus.register("diff", class extends Controller { | ||
initialize() { | ||
|
||
const leftColumn = this.element.querySelector('.diff[left]'); | ||
const rightColumn = this.element.querySelector('.diff[right]'); | ||
|
||
const leftOpenBtn = document.getElementById('diff_left_open'); | ||
const leftCloseBtn = document.getElementById('diff_left_close'); | ||
const rightOpenBtn = document.getElementById('diff_right_open'); | ||
const rightCloseBtn = document.getElementById('diff_right_close'); | ||
|
||
const detailsLeftAll = [...leftColumn.querySelectorAll('details')]; | ||
const detailsRightAll = [...rightColumn.querySelectorAll('details')]; | ||
const detailsLeft = [...leftColumn.querySelectorAll('details[modified]')]; | ||
const detailsRight = [...rightColumn.querySelectorAll('details[modified]')]; | ||
|
||
// Add event listener | ||
leftOpenBtn.addEventListener("click", function(event){ | ||
event.preventDefault(); | ||
openAll(detailsLeft); | ||
}); | ||
leftCloseBtn.addEventListener("click", function(event){ | ||
event.preventDefault(); | ||
closeAll(detailsLeftAll); | ||
}); | ||
rightOpenBtn.addEventListener("click", function(event){ | ||
event.preventDefault(); | ||
openAll(detailsRight); | ||
}); | ||
rightCloseBtn.addEventListener("click", function(event){ | ||
event.preventDefault(); | ||
closeAll(detailsRightAll); | ||
}); | ||
|
||
} | ||
}); | ||
|
||
function closeAll(details) { | ||
details.forEach(detail => { | ||
detail.removeAttribute("open") | ||
}); | ||
} | ||
function openAll(details) { | ||
details.forEach(detail => { | ||
detail.setAttribute("open", "") | ||
}); | ||
} |
Oops, something went wrong.