4.1.27 • Published 20 days ago

@copyleaks/plagiarism-report v4.1.27

Weekly downloads
115
License
SEE LICENSE IN LI...
Repository
github
Last release
20 days ago

Copyleaks plagiarism report

npm:badge

This allows you to view Copyleaks plagiarism report on your website. The report is based on Copyleaks scan results you downloaded via Copyleaks API. By using this component you can view the report anytime without being restricted by the Copyleaks expiration policy and control access policy to the information for your users.

Live demo

npm.io

demo:img

Requirements

  • You should have a Copyleaks account and be able to complete a successful scan and store the results on your end
  • Server side application with access to stored Copyleaks reports
  • A web application with Angular version 8.x

Integration

You must use this module with data generated by Copyleaks API. In general these are the steps you should follow:

  1. Create an account on Copyleaks
  2. Use Copyleaks API to scan for plagiarism
  3. Store the data received from Completed Webhook on your server / cloud
  4. Download and store the source, pdf report (optional) and results on your server / cloud
  5. Create http endpoints to access the stored data (completed, source, pdf-report, results)
  6. Present the data in your website via Copyleaks plagiarism report

Installation

Choose the version corresponding to your Angular version:

Angular@copyleaks/plagiarism-report
134.x+
93.x+
82.x+

Install using npm

npm i @copyleaks/plagiarism-report
ng add @angular/material
npm i @angular/flex-layout
npm i @swimlane/ngx-charts
npm i @ncstate/sat-popover
npm i ngx-skeleton-loader
npm i ngx-virtual-scroller
npm i --save-dev @types/d3-scale
npm i --save-dev @types/d3-selection
npm i scroll-into-view-if-needed

Usage

Note: Copyleaks plagiarism report is built to work with data received from Copyleaks API. The responsibility for storing the data and serving it is in your hands.

Add CopyleaksReportModule, HttpClientModule to your module's imports

//...
import { CopyleaksReportModule } from "@copyleaks/plagiarism-report";
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  declarations: [AppComponent],
  imports: [
    // ...
    CopyleaksReportModule,
    HttpClientModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

Add the component to your template

<cr-copyleaks-report> </cr-copyleaks-report>

Inject CopyleaksService to your Component

export class SomeComponent {
  constructor(private copyleaksService: CopyleaksService, private http: HttpClient) {
    //...
  }
}
ng serve --open

Basic usage

Note: This example assumes you have already downloaded and stored the data generated by copyleaks API

The component must be provided with the data generated by Copyleaks API. As mentioned above, your server must store that data, so your front end could access it via http requests. That means your server should support serving the following data:

  • Endpoint to get the Complete Result of a scan by scan id
  • Endpoint to get the Source of a scan by scan id
  • Endpoint to get a specific Result of a scan by scan id and a result id
  • (optional) Endpoint to download the Pdf of a scan by scan id

Example for the endpoints mentioned above:

  • yourwebsite.com/copyleaks/{scanId}/completed
  • yourwebsite.com/copyleaks/{scanId}/source
  • yourwebsite.com/copyleaks/{scanId}/results/{resultId}
  • yourwebsite.com/copyleaks/{scanId}/pdf

Provide the data with CopyleaksService after downloading it from your server.

@Component({
  // ...
})
export class SomeComponent {
  constructor(private copyleaksService: CopyleaksService, private http: HttpClient) {
    const scanId = "some-scan-id";
    // download the source
    // TODO:
    // USE YOUR SOURCE ENDPOINT
    http
      .get<ScanSource>(`/copyleaks/${scanId}/source`)
      .subscribe(source => copyleaksService.pushDownloadedSource(source));

    // download the complete result
    // TODO:
    // USE YOUR COMPLETE RESULT ENDPOINT
    http.get<CompleteResult>(`/copyleaks/${scanId}/complete`).subscribe(completeResult => {
      copyleaksService.pushCompletedResult(completeResult);
      // download each scan result
      // TODO:
      // USE YOUR RESULT ENDPOINT
      const { internet, database, batch } = completeResult.results;
      for (const result of internet) {
        http
          .get<ScanResult>(`/copyleaks/${scanId}/results/${result.id}`)
          .subscribe(scanResult => copyleaksService.pushScanResult(result.id, scanResult));
      }

      // TODO:
      // USE YOUR RESULT ENDPOINT
      for (const result of database) {
        http
          .get<ScanResult>(`/copyleaks/${scanId}/results/${result.id}`)
          .subscribe(scanResult => copyleaksService.pushScanResult(result.id, scanResult));
      }
      // TODO:
      // USE YOUR RESULT ENDPOINT
      for (const result of batch) {
        http
          .get<ScanResult>(`/copyleaks/${scanId}/results/${result.id}`)
          .subscribe(scanResult => copyleaksService.pushScanResult(result.id, scanResult));
      }
    });
  }
}

Configuration

It is possible to configure the behavior, and the look and state of the report by providing a config via the following methods:

Via component input property:

Note: You can pass the complete config or only a portion of it to the config input property

<!-- some.component.html -->
<cr-copyleaks-report [config]="config"> </cr-copyleaks-report>
// some.component.ts
@Component({
  // ...
})
export class SomeComponent {
  //default config
  public config: CopyleaksReportConfig = {
    contentMode: "html",
    download: false,
    help: false,
    disableSuspectBackButton: false,
    options: {
      showPageSources: false,
      showOnlyTopResults: true,
      showRelated: true,
      showIdentical: true,
      showMinorChanges: true,
      setAsDefault: false
    },
    scanId: null,
    share: false,
    sourcePage: 1,
    suspectId: null,
    suspectPage: 1,
    viewMode: "one-to-many"
  };
}

Via CopyleaksService:

Note: You can pass the complete config or only a portion of it to the setConfig() method

// some.component.ts
@Component({
  // ...
})
export class SomeComponent {
  // plagiarism report will be shown as html
  showHtml() {
    copyleaksService.setConfig({ contentMode: "html" });
  }
  //...
}

Interaction

The component exposes the following events:

name$eventdescription
helpMouseEventemits when the user clicks the help button
shareMouseEventemits when the user clicks the share button
downloadMouseEventemits when the user clicks the download button
configChangeCopyleaksReportConfigemits when the config is changed

You can use it like so:

<cr-copyleaks-report
  (configChange)="onConfigChange($event)"
  (help)="onHelpBtnClick($event)"
  (share)="onShareBtnClick($event)"
  (download)="onDownloadBtnClick($event)"
></cr-copyleaks-report>

FAQ

My website is not using Angular 8, can I use this component?

No, this component is supported by Angular v8.x. As an alternative you can create an Angular web application that uses this library, and include it in your website using routing. This solution should work without any framework or with other web framework/libraries such as React, AngularJs.

Can I modify this component for my own usage?

Modifying the component is allowed according to the License.

Additional Reading Sources

4.1.27

20 days ago

4.1.26

5 months ago

4.1.23

7 months ago

4.1.24

7 months ago

4.1.25

6 months ago

4.1.21

1 year ago

4.1.22

12 months ago

4.1.20

1 year ago

4.1.19

1 year ago

4.1.18

1 year ago

4.1.17

1 year ago

4.1.16

1 year ago

4.1.14

1 year ago

4.1.15

1 year ago

4.1.10

2 years ago

4.1.11

2 years ago

4.1.12

2 years ago

4.1.13

2 years ago

4.1.8

2 years ago

4.1.9

2 years ago

4.1.7

2 years ago

4.1.6

2 years ago

4.1.5

2 years ago

4.1.4

2 years ago

3.1.13

3 years ago

3.1.12

3 years ago

3.1.11

3 years ago

3.1.10

3 years ago

3.1.9

3 years ago

3.1.8

3 years ago

3.1.7

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.23

3 years ago

3.0.24

3 years ago

3.0.27

3 years ago

3.0.28

3 years ago

3.0.25

3 years ago

3.0.26

3 years ago

3.0.30

3 years ago

3.0.31

3 years ago

3.0.29

3 years ago

3.0.21

3 years ago

3.0.22

3 years ago

3.0.17

3 years ago

3.0.20

3 years ago

3.0.18

3 years ago

3.0.19

3 years ago

3.0.16

3 years ago

3.0.14

3 years ago

3.0.13

3 years ago

3.0.12

3 years ago

3.0.11

3 years ago

3.0.10

4 years ago

3.0.9

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

2.0.43

4 years ago

2.0.42

4 years ago

2.0.41

4 years ago

2.0.40

4 years ago

2.0.39

4 years ago

2.0.38

4 years ago

2.0.37

4 years ago

2.0.36

4 years ago

2.0.35

4 years ago

2.0.33

4 years ago

2.0.32

4 years ago

2.0.31

4 years ago

2.0.30

4 years ago

2.0.29

4 years ago

2.0.28

4 years ago

2.0.27

4 years ago

2.0.26

4 years ago

2.0.24

4 years ago

2.0.25

4 years ago

2.0.23

4 years ago

2.0.22

4 years ago

2.0.21

4 years ago

2.0.20

4 years ago

2.0.19

4 years ago

2.0.18

4 years ago

2.0.16

4 years ago

2.0.17

4 years ago

2.0.15

4 years ago

2.0.14

4 years ago

2.0.13

4 years ago

2.0.12

4 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-alpha.46

4 years ago

2.0.0-alpha.45

4 years ago

2.0.0-alpha.44

4 years ago

2.0.0-alpha.43

4 years ago

2.0.0-alpha.42

4 years ago

2.0.0-alpha.41

4 years ago

2.0.0-alpha.40

4 years ago

2.0.0-alpha.39

4 years ago

2.0.0-alpha.38

4 years ago

2.0.0-alpha.37

4 years ago

2.0.0-alpha.36

4 years ago

2.0.0-alpha.35

4 years ago

2.0.0-alpha.34

4 years ago

2.0.0-alpha.33

4 years ago

2.0.0-alpha.32

5 years ago

2.0.0-alpha.31

5 years ago

2.0.0-alpha.30

5 years ago

2.0.0-alpha.29

5 years ago

2.0.0-alpha.28

5 years ago

2.0.0-alpha.27

5 years ago

2.0.0-alpha.26

5 years ago

2.0.0-alpha.25

5 years ago

2.0.0-alpha.24

5 years ago

2.0.0-alpha.23

5 years ago

2.0.0-alpha.22

5 years ago

2.0.0-alpha.21

5 years ago

2.0.0-alpha.20

5 years ago

2.0.0-alpha.19

5 years ago

2.0.0-alpha.18

5 years ago

2.0.0-alpha.17

5 years ago

2.0.0-alpha.16

5 years ago

2.0.0-alpha.15

5 years ago

2.0.0-alpha.14

5 years ago

2.0.0-alpha.13

5 years ago

2.0.0-alpha.12

5 years ago

2.0.0-alpha.10

5 years ago

2.0.0-alpha.11

5 years ago

2.0.0-alpha.9

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-alpha.6

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.0

5 years ago