Skip to content
Merged
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
6 changes: 5 additions & 1 deletion components/annotorious-annotator/line-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ class AnnotoriousAnnotator extends HTMLElement {
cursor: pointer;
width: 100%;
margin-top: 1em;
display: block;
text-align: center;
text-decoration: none;
border: none;
}
#saveBtn[disabled], #createColumnsBtn[disabled], #deleteAllBtn[disabled] {
background-color: gray;
Expand Down Expand Up @@ -269,7 +273,7 @@ class AnnotoriousAnnotator extends HTMLElement {
<input type="checkbox" id="seeTool" checked>
</label>
<input id="deleteAllBtn" type="button" value="Delete All Annotations"/>
<input id="createColumnsBtn" type="button" value="Manage Columns"/>
<a id="createColumnsBtn" href="#">Manage Columns</a>
<input id="saveBtn" type="button" value="Save Annotations"/>
</div>
<button id="autoParseBtn">Auto Parse</button>
Expand Down
1 change: 1 addition & 0 deletions components/classroom/groups/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions components/copy-existing-project/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ class CopyExistingProject extends HTMLElement {
const projectTitle = document.createElement('span')
projectTitle.textContent = data.label

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`

projectInfo.appendChild(projectTitle)
projectInfo.appendChild(manageButton)
Expand Down
6 changes: 2 additions & 4 deletions components/copy-project-with-customization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,10 @@ class CopyExistingProjectWithCustomizations extends HTMLElement {
const projectTitle = document.createElement('span')
projectTitle.textContent = data.label

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`

projectInfo.appendChild(projectTitle)
projectInfo.appendChild(manageButton)
Expand Down
6 changes: 2 additions & 4 deletions components/copy-project-with-group-member/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,10 @@ class CopyProjectWithGroupMember extends HTMLElement {
const projectTitle = document.createElement('span')
projectTitle.textContent = data.label

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`

projectInfo.appendChild(projectTitle)
projectInfo.appendChild(manageButton)
Expand Down
6 changes: 2 additions & 4 deletions components/copy-project-without-annotations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ class CopyExistingProjectWithoutAnnotations extends HTMLElement {
const projectTitle = document.createElement('span')
projectTitle.textContent = data.label

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${data._id}`

projectInfo.appendChild(projectTitle)
projectInfo.appendChild(manageButton)
Expand Down
6 changes: 2 additions & 4 deletions components/import-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ class ImageImporter extends HTMLElement {
const pageTitle = document.createElement('span')
pageTitle.textContent = project.label || 'Untitled Page'

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${project._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${project._id}`

pageInfo.appendChild(pageTitle)
pageInfo.appendChild(manageButton)
Expand Down
6 changes: 2 additions & 4 deletions components/import-project/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ class ProjectImporter extends HTMLElement {
const projectTitle = document.createElement('span')
projectTitle.textContent = project.label

const manageButton = document.createElement('button')
const manageButton = document.createElement('a')
manageButton.className = 'manage-btn'
manageButton.textContent = 'Manage'
manageButton.onclick = () => {
window.location.href = `${TPEN.BASEURL}/project/manage?projectID=${project._id}`
}
manageButton.href = `${TPEN.BASEURL}/project/manage?projectID=${project._id}`

projectInfo.appendChild(projectTitle)
projectInfo.appendChild(manageButton)
Expand Down
4 changes: 3 additions & 1 deletion components/user-profile/userStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ class UserStats extends HTMLElement {
<div class="collaborators">
${collaborators.map(c => `
<div class="collaborator">
<img src="${c.img}" alt="${c.name}" onclick="window.location.href='${TPEN.BASEURL}/public-profile?userId=${c._id}'">
<a href="${TPEN.BASEURL}/public-profile?userId=${c._id}">
<img src="${c.img}" alt="${c.name}">
</a>
<div class="collaborator-name">${c.name}</div>
</div>
`).join('')}
Expand Down
8 changes: 4 additions & 4 deletions interfaces/import-tpen28/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 class="header">Select a Project :</h1>
<div id="message" class="message">Loading projects...</div>

<div class="form-group">
<select id="projectSelect" class="dropdown">
<select id="projectSelect" title="projectSelect" class="dropdown">
<option value="">-- Choose a Project --</option>
</select>
<button id="importProjectBtn" class="btn primary-btn">Import</button>
Expand All @@ -38,10 +38,10 @@ <h2>Invite the Collaborators :</h2>
<div class="collaborator-list" id="collaboratorList"></div>
</section>

<button id="openProject" class="btn secondary-btn hidden">
<a id="openProject" class="btn secondary-btn hidden" href="#" role="button">
Open the Project
</button>
</a>
</div>
</tpen-page>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion interfaces/import-tpen28/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ async function openProject() {
await importCollaborators(projectTPEN28Data, projectID)
}

fetchProjects()
fetchProjects()
16 changes: 8 additions & 8 deletions interfaces/manage-project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ <h2 slot="header">This Project</h2>
<tpen-project-details></tpen-project-details>
<div class="action-links">
<tpen-can tpen-view="*_SELECTOR_LINE">
<a id="goParse" title="Go Parse Lines" class="left"><img src="../../assets/icons/parse-lines.svg"/>
<a id="goParse" title="Go Parse Lines" class="left"><img src="../../assets/icons/parse-lines.svg" alt="icon"/>
<span>Parse Lines</span>
</a>
</tpen-can>
<tpen-can tpen-view="READ_TEXT_LINE">
<a id="goTranscribe" title="Go Transcribe" class="right">
<span>Transcribe Text</span>
<img src="../../assets/icons/transcribe.png"/>
<img src="../../assets/icons/transcribe.png" alt="icon"/>
</a>
</tpen-can>
</div>
</div>
<button id="leave-project-btn" slot="footer" type="button">LEAVE PROJECT</button>
<a id="leave-project-btn" slot="footer" class="default-btn" href="#" role="button">LEAVE PROJECT</a>
</tpen-card>
<tpen-card tpen-scope="metadata">
<h2 slot="header">Metadata</h2>
<tpen-project-metadata slot="body"></tpen-project-metadata>
<button id="update-metadata-btn" slot="footer" type="button">EDIT METADATA</button>
<a id="update-metadata-btn" slot="footer" class="default-btn" href="#" role="button">EDIT METADATA</a>
</tpen-card>
<tpen-card tpen-entity="member">
<h2 slot="header">Collaborators</h2>
<project-collaborators slot="body"></project-collaborators>
<button id="manage-collaboration-btn" slot="footer" type="button">MANAGE COLLABORATORS</button>
<a id="manage-collaboration-btn" slot="footer" class="default-btn" href="#" role="button">MANAGE COLLABORATORS</a>
</tpen-card>
<tpen-card tpen-entity="layer">
<h2 slot="header">Layers & Pages</h2>
<tpen-project-layers slot="body"></tpen-project-layers>
<button id="manage-layers-btn" slot="footer" type="button">SEE DETAILS / MODIFY</button>
<a id="manage-layers-btn" slot="footer" class="default-btn" href="#" role="button">SEE DETAILS / MODIFY</a>
</tpen-card>
<tpen-card tpen-entity="role">
<h2 slot="header">Project Roles</h2>
<tpen-project-permissions slot="body"></tpen-project-permissions>
<button id="manage-custom-role-btn" slot="footer" type="button">MANAGE ROLE</button>
<a id="manage-custom-role-btn" slot="footer" class="default-btn" href="#" role="button">MANAGE ROLE</a>
</tpen-card>
<tpen-card tpen-scope="options">
<h2 slot="header">Project Options</h2>
Expand All @@ -64,7 +64,7 @@ <h2 slot="header">Project Options</h2>
Default Transcription Interface: /transcribe
</div>
</tpen-project-options>
<button id="manage-project-options-btn" slot="footer" type="button">SEE DETAILS</button>
<a id="manage-project-options-btn" slot="footer" class="default-btn" href="#" role="button">SEE DETAILS</a>
</tpen-card>
<tpen-card tpen-entity="tools">
<h2 slot="header">Tools</h2>
Expand Down
55 changes: 33 additions & 22 deletions interfaces/manage-project/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,34 @@ TPEN.eventDispatcher.on('tpen-project-loaded', () => render())
const container = document.body
TPEN.attachAuthentication(container)

document.getElementById('manage-collaboration-btn').addEventListener('click', () => {
const url = `/project/manage/collaborators?projectID=${TPEN.screen.projectInQuery}`
window.location.href = url
})

document.getElementById("update-metadata-btn").addEventListener('click', () => {
window.location.href = `/project/metadata?projectID=${TPEN.screen.projectInQuery}`
})

document.getElementById('manage-layers-btn').addEventListener('click', () => {
window.location.href = `/components/manage-layers/index.html?projectID=${TPEN.screen.projectInQuery}`
// Set href for navigation links once project ID is available
TPEN.eventDispatcher.on('tpen-project-loaded', () => {
const projectID = TPEN.screen.projectInQuery

const manageCollabBtn = document.getElementById('manage-collaboration-btn')
if (manageCollabBtn) {
manageCollabBtn.href = `/project/manage/collaborators?projectID=${projectID}`
}

const updateMetadataBtn = document.getElementById("update-metadata-btn")
if (updateMetadataBtn) {
updateMetadataBtn.href = `/components/update-metadata/index.html?projectID=${projectID}`
}

const manageLayersBtn = document.getElementById('manage-layers-btn')
if (manageLayersBtn) {
manageLayersBtn.href = `/components/manage-layers/index.html?projectID=${projectID}`
}

const manageProjectOptionsBtn = document.getElementById('manage-project-options-btn')
if (manageProjectOptionsBtn) {
manageProjectOptionsBtn.href = `/project/options?projectID=${projectID}`
}

const leaveProjectBtn = document.getElementById('leave-project-btn')
if (leaveProjectBtn) {
leaveProjectBtn.href = `/project/leave?projectID=${projectID}`
}
})

document.getElementById('export-project-btn').addEventListener('click', async () => {
Expand All @@ -43,22 +60,16 @@ document.getElementById('export-project-btn').addEventListener('click', async ()
})
})

document.getElementById('manage-project-options-btn').addEventListener('click', () => {
window.location.href = `/project/options?projectID=${TPEN.screen.projectInQuery}`
})

document.getElementById('leave-project-btn').addEventListener('click', (e) => {
window.location.href = `/project/leave?projectID=${TPEN.screen.projectInQuery}`
})

async function render() {
const isManageProjectPermission = await CheckPermissions.checkEditAccess('PROJECT')
if(!isManageProjectPermission) {
alert("You do not have permissions to use this page.")
document.location.href = `/project?projectID=${TPEN.screen.projectInQuery}`
}
document.querySelector('tpen-project-details').setAttribute('tpen-project-id', TPEN.screen.projectInQuery)
document.getElementById("manage-custom-role-btn").addEventListener('click', async () => {
window.location.href = `/components/manage-role/index.html?projectID=${TPEN.screen.projectInQuery}`
})

const manageCustomRoleBtn = document.getElementById("manage-custom-role-btn")
if (manageCustomRoleBtn) {
manageCustomRoleBtn.href = `/components/manage-role/index.html?projectID=${TPEN.screen.projectInQuery}`
}
}
8 changes: 4 additions & 4 deletions interfaces/project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2 slot="header">Project Details</h2>
</tpen-can>
</div>
</div>
<button id="leaveProject" slot="footer" type="button">LEAVE PROJECT</button>
<a id="leaveProject" slot="footer" href="#">LEAVE PROJECT</a>
</tpen-card>
</div>
</tpen-page>
Expand All @@ -83,9 +83,9 @@ <h2 slot="header">Project Details</h2>
const goParse = document.getElementById("goParse")
const goTranscribe = document.getElementById("goTranscribe")
const leaveProject = document.getElementById("leaveProject")
leaveProject.addEventListener('click', (e) => {
window.location.href = `/project/leave?projectID=${ev.detail._id}`
})
if (leaveProject) {
leaveProject.href = `/project/leave?projectID=${ev.detail._id}`
}
if(goParse) goParse.setAttribute("href", `/annotator?projectID=${ev.detail._id}`)
if(goTranscribe) goTranscribe.setAttribute("href", `/transcribe?projectID=${ev.detail._id}`)
})
Expand Down
2 changes: 1 addition & 1 deletion interfaces/project/quick-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2>Save and Start Transcribing :</h2>
</div>
</div>
<div class="bottom-panel">
<button class="get-started-button" onclick="window.location.href='/components/quick-guide/'">Get Started</button>
<a class="get-started-button" href="/components/quick-guide/">Get Started</a>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

Anchor tags used as buttons should include role="button" for proper accessibility. Screen readers and assistive technologies rely on proper ARIA roles to communicate the element's purpose to users. This ensures that users understand this is an actionable element that performs a navigation action.

Suggested change
<a class="get-started-button" href="/components/quick-guide/">Get Started</a>
<a class="get-started-button" href="/components/quick-guide/" role="button">Get Started</a>

Copilot uses AI. Check for mistakes.
</div>
</section>
</tpen-page>
Expand Down
4 changes: 2 additions & 2 deletions manage/collaboration.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<span class="text">Share Publicly</span>
<span class="btn-icon share"></span>
</button>
<button class="default-btn" id="modify-team-btn" >
<a class="default-btn" id="modify-team-btn" href="#">
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

Anchor tags used as buttons should include role="button" for proper accessibility. Screen readers and assistive technologies rely on proper ARIA roles to communicate the element's purpose to users. This ensures that users understand this is an actionable element that performs a navigation action.

Suggested change
<a class="default-btn" id="modify-team-btn" href="#">
<a class="default-btn" id="modify-team-btn" href="#" role="button">

Copilot uses AI. Check for mistakes.
<span class="text">Modify Project Team</span>
<span class="btn-icon team"></span>
</button>
</a>

<div class="project-owner" id="project-owner">
<p>
Expand Down
9 changes: 3 additions & 6 deletions manage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ function loadManageInterface(){
const modifyTeamBtn = document.getElementById("modify-team-btn")

if (modifyTeamBtn) {
modifyTeamBtn.addEventListener("click", () => {
const URLParams = new URLSearchParams(window.location.search)
const projectID = URLParams.get("projectID")
const url = `/project/manage/collaborators?projectID=${projectID}`
window.location.href = url
})
const URLParams = new URLSearchParams(window.location.search)
const projectID = URLParams.get("projectID")
modifyTeamBtn.href = `/project/manage/collaborators?projectID=${projectID}`
}
const { projectData } = await getActiveProject()
console.log(projectData)
Expand Down