Skip to content

65 添加快速跳转至exambase#66

Merged
Karis004 merged 4 commits into
devfrom
65-添加快速跳转至exambase
May 24, 2025

Hidden character warning

The head ref may contain hidden characters: "65-\u6dfb\u52a0\u5feb\u901f\u8df3\u8f6c\u81f3exambase"
Merged

65 添加快速跳转至exambase#66
Karis004 merged 4 commits into
devfrom
65-添加快速跳转至exambase

Conversation

@Karis004
Copy link
Copy Markdown
Member

This pull request introduces a new feature for integrating an "Exam Base" navigation element into the application, along with enhancements to the user interface and functionality. The changes include adding a floating "Exam Base" button with animations, a fixed navigation tab for quick access, and a corresponding toggle in the settings menu.

New Feature: Exam Base Navigation

  • Floating "Exam Base" Button with Animations: Added a floating button (jump-to-exam-base) on course pages that animates and provides quick access to the "Exam Base" page. The button includes hover effects, random floating animations, and a smooth transition to a fixed navigation tab when clicked.

  • Fixed Navigation Tab for "Exam Base": Introduced a fixed navigation tab (jump-to-exam-base-fixed) under the navigation bar on course pages. Clicking the tab opens the "Exam Base" page in a new tab.

  • Integration with Course Page Routing: Updated the routing logic to invoke the jumpToExamBase function on course pages, ensuring the "Exam Base" button and tab are initialized.

User Interface Enhancements

  • Settings Toggle for "Exam Base" Feature: Added a new toggle in the settings menu to enable or disable the floating "Exam Base" button. The toggle uses a checkbox (ez-exam-base-checkbox) and stores the user's preference in Chrome's sync storage. [1] [2]

  • Reusable Label Component: Added a new Label component to the window.elements namespace for consistent label creation across the application.

@Karis004 Karis004 requested a review from Copilot May 24, 2025 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new "Exam Base" navigation feature along with a settings toggle to enable or disable the floating Exam Base button, and a fixed navigation tab on course pages.

  • Adds a settings toggle component for enabling/disabling the floating Exam Base button
  • Implements a jumpToExamBase function with animated floating and fixed navigation elements
  • Provides a reusable Label component for consistent UI elements

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/setting/jsx/Setting.js Added Exam Base settings toggle with a new ExamBaseButton function
scripts/moodle/js/content.js Implemented jumpToExamBase with animated floating button and fixed navigation tab
scripts/lib/elements.js Added a new reusable Label component
Comments suppressed due to low confidence (1)

scripts/setting/jsx/Setting.js:195

  • [nitpick] Consider using a label text that matches the feature name (e.g., 'Exam Base') to maintain consistency with other UI elements.
innerText: "Skyrocketing Exam Base",

Comment thread scripts/moodle/js/content.js Outdated
vh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
});

setInterval(() => {
Copy link

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

Consider using requestAnimationFrame for smoother and more efficient animations instead of setInterval with a fixed 50ms interval.

Suggested change
setInterval(() => {
function animate() {

Copilot uses AI. Check for mistakes.
@Karis004 Karis004 merged commit 2f61c4d into dev May 24, 2025
@Karis004 Karis004 deleted the 65-添加快速跳转至exambase branch May 24, 2025 14:59
@Karis004 Karis004 linked an issue May 24, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

添加快速跳转至exambase

2 participants