How dtrung98/gpabookmarklet works
Main Components and Their Roles
• User Browser: Represents the client where the bookmarklet is installed and executed.
• Bookmarklet (bookmarklet.js): Acts as the entry point when a user clicks the bookmarklet. This script likely injects or triggers the GPA calculation routines within the browser.
• Application Logic (app.js): Contains the core functionality for processing the GPA calculation based on data extracted from the HCMUS Portal.
• User Interface: Consists of HTML files (index.html, guideline_mobile.html, README.html) that show information, guidelines, or results, along with default.css to ensure consistent styling.
• Supporting Documentation/Assets: Files like Changelog.md, LICENSE, READMEs, and potentially the “Figure” directory (which might contain images or additional assets for UI decoration or further explanations).
Relationships and Interactions
• A user accesses the HCMUS GPA Calculator Bookmarklet via their browser.
• When activated, the bookmarklet.js script executes, interacting with the currently loaded HCMUS Portal page, and triggers the app.js component to parse and calculate the GPA from available data.
• The outcome or user guidance is displayed using one or more HTML pages (index.html for the main UI and guideline_mobile.html for mobile users).
• The default.css file applies consistent styling across these components.
• Any updates or changes are tracked in the Changelog.md, and licensing details are available in the LICENSE file.
Architectural Design Patterns and Principles
• Client-Side Execution: The entire application logic runs within the browser, ensuring fast interaction without the need for server-side components.
• Modularity: Separation of concerns is evident—bookmarklet for entry point actions, app.js for core logic, HTML for presentation, and CSS for styling.
Relevant Technologies and Libraries
• JavaScript: For both the main application logic (app.js) and the bookmarklet's behavior (bookmarklet.js).
• HTML/CSS: For UI presentation (index.html, guideline_mobile.html) and styling (default.css).
• No explicit backend or database is involved since it’s a client-side tool that operates as an enhancement to an external website.
Additional Detail
• “Figure” directory as a resource for assets if applicable.