Skip to content

Conversation

@b0ink
Copy link
Member

@b0ink b0ink commented Jun 26, 2025

Description

Allows the JPlag app to be embedded in an iframe or opened as popup from within another web application, and automatically load report files, search for comparisons, and open a comparison if a single result is found

Examples of using postMessage from external web application

Loading .jplag report files:

this.jplagIframe.nativeElement.contentWindow?.postMessage(
  {
    type: 'upload-jplag-file',
    file: response.body, // Blob file of the .jplag file
    name: 'report.jplag',
  },
  '*',
);

Setting the search filter and auto viewing the first comparison:

this.jplagIframe.nativeElement.contentWindow?.postMessage(
  {
    type: 'set-search-filter-value',
    filter: studentUsername, // Search filter
    autoViewComparison: true
  },
  '*',
);

@b0ink b0ink changed the base branch from development to main June 26, 2025 05:26
@b0ink b0ink changed the base branch from main to development June 26, 2025 05:26
@b0ink b0ink force-pushed the feat/auto-file-handler branch from 18186bf to 95f3d99 Compare June 30, 2025 06:57
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.

1 participant