-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts list below were resolved by keeping changes from main. Conflicts: concordia/static/js/src/asset-reservation.js concordia/static/js/src/contribute.js concordia/static/js/src/guide.js concordia/static/js/src/ocr.js concordia/static/js/src/quick-tips-setup.js concordia/static/js/src/viewer-split.js concordia/static/js/src/viewer.js concordia/templates/transcriptions/asset_detail.html concordia/templates/transcriptions/asset_detail/editor.html concordia/templates/transcriptions/asset_detail/ocr_transcription_modal.html concordia/templates/transcriptions/asset_detail/viewer_filters.html
- Loading branch information
Showing
29 changed files
with
1,534 additions
and
679 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,5 +19,5 @@ env: | |
browser: true | ||
es2024: true | ||
parserOptions: | ||
sourceType: script | ||
sourceType: module | ||
ecmaVersion: latest |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,85 @@ | ||
/* global $ trackUIInteraction */ | ||
|
||
function openOffcanvas() { | ||
let guide = document.getElementById('guide-sidebar'); | ||
if (guide.classList.contains('offscreen')) { | ||
guide.classList.remove('offscreen'); | ||
guide.style.borderWidth = '0 0 thick thick'; | ||
guide.style.borderStyle = 'solid'; | ||
guide.style.borderColor = '#0076ad'; | ||
document.addEventListener('keydown', function (event) { | ||
if (event.key == 'Escape') { | ||
closeOffcanvas(); | ||
} | ||
}); | ||
document.getElementById('open-guide').style.background = '#002347'; | ||
} else { | ||
closeOffcanvas(); | ||
} | ||
} | ||
|
||
function closeOffcanvas() { | ||
let guide = document.getElementById('guide-sidebar'); | ||
guide.classList.add('offscreen'); | ||
guide.style.border = 'none'; | ||
|
||
document.getElementById('open-guide').style.background = '#0076AD'; | ||
} | ||
|
||
$('#open-guide').on('click', openOffcanvas); | ||
|
||
$('#close-guide').on('click', closeOffcanvas); | ||
|
||
$('#guide-carousel') | ||
.carousel({ | ||
interval: false, | ||
wrap: false, | ||
}) | ||
.on('slide.bs.carousel', function (event) { | ||
if (event.to == 0) { | ||
$('#guide-bars').addClass('d-none'); | ||
} else { | ||
$('#guide-bars').removeClass('d-none'); | ||
} | ||
}); | ||
|
||
$('#previous-card').hide(); | ||
|
||
$('#card-carousel').on('slid.bs.carousel', function () { | ||
if ($('#card-carousel .carousel-item:first').hasClass('active')) { | ||
$('#previous-card').hide(); | ||
$('#next-card').show(); | ||
} else if ($('#card-carousel .carousel-item:last').hasClass('active')) { | ||
$('#previous-card').show(); | ||
$('#next-card').hide(); | ||
} else { | ||
$('#previous-card').show(); | ||
$('#next-card').show(); | ||
} | ||
}); | ||
|
||
function trackHowToInteraction(element, label) { | ||
trackUIInteraction(element, 'How To Guide', 'click', label); | ||
} | ||
|
||
$('#open-guide').on('click', function () { | ||
trackHowToInteraction($(this), 'Open'); | ||
}); | ||
$('#close-guide').on('click', function () { | ||
trackHowToInteraction($(this), 'Close'); | ||
}); | ||
$('#previous-guide').on('click', function () { | ||
trackHowToInteraction($(this), 'Back'); | ||
}); | ||
$('#next-guide').on('click', function () { | ||
trackHowToInteraction($(this), 'Next'); | ||
}); | ||
$('#guide-bars').on('click', function () { | ||
trackHowToInteraction($(this), 'Hamburger Menu'); | ||
}); | ||
$('#guide-sidebar .nav-link').on('click', function () { | ||
let label = $(this).text().trim(); | ||
trackHowToInteraction($(this), label); | ||
}); | ||
|
||
export {openOffcanvas, closeOffcanvas}; |
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,21 @@ | ||
/* global $ */ | ||
|
||
function setTutorialHeight() { | ||
let $carouselItems = $('#card-carousel .carousel-item'); | ||
let heights = $carouselItems.map(function () { | ||
let height = $(this).height(); | ||
if (height <= 0) { | ||
let firstChild = $(this).children[0]; | ||
if (firstChild) { | ||
height = firstChild.offsetHeight + 48; | ||
} else { | ||
return 517.195; | ||
} | ||
} | ||
return height; | ||
}); | ||
let maxHeight = Math.max.apply(this, heights); | ||
$carouselItems.height(maxHeight); | ||
} | ||
|
||
export {setTutorialHeight}; |
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,8 @@ | ||
/* global $ */ | ||
|
||
function selectLanguage() { | ||
$('#ocr-transcription-modal').modal('hide'); | ||
$('#language-selection-modal').modal('show'); | ||
} | ||
|
||
$('#select-language-button').on('click', selectLanguage); |
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,46 @@ | ||
/* global $ trackUIInteraction */ | ||
|
||
import {setTutorialHeight} from './modules/quick-tips.js'; | ||
|
||
let mainContentHeight = $('#contribute-main-content').height(); | ||
|
||
if (mainContentHeight < 710) { | ||
$('.sidebar').height(mainContentHeight - 130); | ||
} | ||
|
||
$('#tutorial-popup').on('shown.bs.modal', function () { | ||
setTutorialHeight(); | ||
}); | ||
|
||
function trackQuickTipsInteraction(element, label) { | ||
trackUIInteraction(element, 'Quick Tips', 'click', label); | ||
} | ||
|
||
$('#quick-tips').on('click', function () { | ||
trackQuickTipsInteraction($(this), 'Open'); | ||
}); | ||
|
||
$('#previous-card').on('click', function () { | ||
trackQuickTipsInteraction($(this), 'Back'); | ||
}); | ||
|
||
$('#next-card').on('click', function () { | ||
trackQuickTipsInteraction($(this), 'Next'); | ||
}); | ||
|
||
$('.carousel-indicators li').on('click', function () { | ||
let index = [...this.parentElement.children].indexOf(this); | ||
trackQuickTipsInteraction($(this), `Carousel ${index}`); | ||
}); | ||
|
||
$('#tutorial-popup').on('hidden.bs.modal', function () { | ||
// We're tracking whenever the popup closes, so we don't separately track the close button being clicked | ||
trackUIInteraction($(this), 'Quick Tips', 'click', 'Close'); | ||
}); | ||
|
||
$('#tutorial-popup').on('shown-on-load', function () { | ||
// We set a timeout to make sure the analytics code is loaded before trying to track | ||
setTimeout(function () { | ||
trackUIInteraction($(this), 'Quick Tips', 'load', 'Open'); | ||
}, 1000); | ||
}); |
Oops, something went wrong.