|
2 | 2 | <div class="loading-shade" *ngIf="running">
|
3 | 3 | <mat-progress-spinner mode="indeterminate" diameter="50"></mat-progress-spinner>
|
4 | 4 | </div>
|
5 |
| -<div class="section"> |
6 |
| - <form> |
7 |
| - <h2>HathiTrust Bibliographic API</h2> |
8 |
| - <p>This API is open and does not require authentication. Enter an identifier and select an identifier type to search the API.</p> |
9 |
| - <section class="settings-section"> |
10 |
| - <mat-form-field> |
11 |
| - <mat-label>Identifier Type</mat-label> |
12 |
| - <mat-select value="isbn" #identifierType> |
13 |
| - <mat-option value="oclc">OCLC Number</mat-option> |
14 |
| - <mat-option value="lccn">LCCN</mat-option> |
15 |
| - <mat-option value="issn">ISSN</mat-option> |
16 |
| - <mat-option value="isbn">ISBN</mat-option> |
17 |
| - <mat-option value="htid">HathiTrust Volume ID</mat-option> |
18 |
| - <mat-option value="recordnumber">HathiTrust record number</mat-option> |
19 |
| - </mat-select> |
20 |
| - </mat-form-field> |
21 |
| - </section> |
| 5 | +<mat-tab-group color="primary" backgroundColor="accent"> |
| 6 | + <mat-tab label="Open"> |
| 7 | + <form> |
| 8 | + <h2>HathiTrust Bibliographic API</h2> |
| 9 | + <p>This API is open and does not require authentication. Enter an identifier and select an identifier type to search the API.</p> |
| 10 | + <section class="settings-section"> |
| 11 | + <mat-form-field> |
| 12 | + <mat-label>Identifier Type</mat-label> |
| 13 | + <mat-select value="isbn" #identifierType> |
| 14 | + <mat-option value="oclc">OCLC Number</mat-option> |
| 15 | + <mat-option value="lccn">LCCN</mat-option> |
| 16 | + <mat-option value="issn">ISSN</mat-option> |
| 17 | + <mat-option value="isbn">ISBN</mat-option> |
| 18 | + <mat-option value="htid">HathiTrust Volume ID</mat-option> |
| 19 | + <mat-option value="recordnumber">HathiTrust record number</mat-option> |
| 20 | + </mat-select> |
| 21 | + </mat-form-field> |
| 22 | + </section> |
| 23 | + <section class="settings-section"> |
| 24 | + <mat-form-field> |
| 25 | + <mat-label>Identifier</mat-label> |
| 26 | + <input matInput #identifier value="0394530934"> |
| 27 | + </mat-form-field> |
| 28 | + </section> |
| 29 | + </form> |
| 30 | + <div class="cloudapp-actions"> |
| 31 | + <button mat-flat-button type="button" color="primary" (click)="search(identifierType.value, identifier.value)">Search</button> |
| 32 | + </div> |
| 33 | + |
| 34 | + <mat-card *ngIf="record"> |
| 35 | + <mat-card-header> |
| 36 | + <mat-card-title>HathiTrust Record</mat-card-title> |
| 37 | + </mat-card-header> |
| 38 | + <mat-card-content> |
| 39 | + <img *ngIf="record.items.length>0" src="https://babel.hathitrust.org/cgi/imgsrv/cover?id={{record.items[0].htid}}" class="pull-right"> |
| 40 | + <ul> |
| 41 | + <li><strong>Record ID: </strong> <a href="{{record.recordURL}}" target="_blank">{{ record.id }}</a></li> |
| 42 | + <li><strong>Title: </strong>{{ record.titles[0] }}</li> |
| 43 | + <li><strong>Held By:</strong> |
| 44 | + <ul> |
| 45 | + <li *ngFor="let item of record.items"><a href="{{item.itemURL}}" target="_blank">{{item.orig}}</a></li> |
| 46 | + </ul> |
| 47 | + </li> |
| 48 | + </ul> |
| 49 | + </mat-card-content> |
| 50 | + </mat-card> |
| 51 | + </mat-tab> |
| 52 | + <mat-tab label="Authenticated" *ngIf="authToken"> |
| 53 | + <h2>HathiTrust Data API</h2> |
| 54 | + <p>This API is restricted and requires authentication.</p> |
22 | 55 | <section class="settings-section">
|
23 | 56 | <mat-form-field>
|
24 | 57 | <mat-label>Identifier</mat-label>
|
25 |
| - <input matInput #identifier value="0394530934"> |
| 58 | + <input matInput #data_api_identifier value="mdp.39015000000128"> |
26 | 59 | </mat-form-field>
|
27 | 60 | </section>
|
28 |
| - </form> |
29 |
| - <div class="cloudapp-actions"> |
30 |
| - <button mat-flat-button type="button" color="primary" (click)="search(identifierType.value, identifier.value)">Search</button> |
31 |
| - </div> |
32 |
| - |
33 |
| - <mat-card *ngIf="record"> |
34 |
| - <mat-card-header> |
35 |
| - <mat-card-title>HathiTrust Record</mat-card-title> |
36 |
| - </mat-card-header> |
37 |
| - <mat-card-content> |
38 |
| - <img *ngIf="record.items.length>0" src="https://babel.hathitrust.org/cgi/imgsrv/cover?id={{record.items[0].htid}}" class="pull-right"> |
39 |
| - <ul> |
40 |
| - <li><strong>Record ID: </strong> <a href="{{record.recordURL}}" target="_blank">{{ record.id }}</a></li> |
41 |
| - <li><strong>Title: </strong>{{ record.titles[0] }}</li> |
42 |
| - <li><strong>Held By:</strong> |
43 |
| - <ul> |
44 |
| - <li *ngFor="let item of record.items"><a href="{{item.itemURL}}" target="_blank">{{item.orig}}</a></li> |
45 |
| - </ul> |
46 |
| - </li> |
47 |
| - </ul> |
48 |
| - </mat-card-content> |
49 |
| - </mat-card> |
50 |
| -</div> |
51 |
| - |
52 |
| -<hr> |
53 |
| - |
54 |
| -<div class="section" *ngIf="authToken"> |
55 |
| - <h2>HathiTrust Data API</h2> |
56 |
| - <p>This API is restricted and requires authentication.</p> |
57 |
| - <section class="settings-section"> |
58 |
| - <mat-form-field> |
59 |
| - <mat-label>Identifier</mat-label> |
60 |
| - <input matInput #data_api_identifier value="mdp.39015000000128"> |
61 |
| - </mat-form-field> |
62 |
| - </section> |
63 |
| - <div class="cloudapp-actions"> |
64 |
| - <button mat-flat-button type="button" color="primary" (click)="dataApi(data_api_identifier.value)">Retrieve Metadata</button> |
65 |
| - </div> |
66 |
| - <mat-card *ngIf="images.length>0"> |
67 |
| - <mat-card-header> |
68 |
| - <mat-card-title>HathiTrust Page Scans</mat-card-title> |
69 |
| - </mat-card-header> |
70 |
| - <mat-card-content> |
71 |
| - <p>Retrieved <strong>{{images.length}}</strong> pages from the API for this title.</p> |
72 |
| - <button mat-flat-button type="button" color="primary" (click)="openModal()">View images</button> |
73 |
| - </mat-card-content> |
74 |
| - </mat-card> |
75 |
| -</div> |
| 61 | + <div class="cloudapp-actions"> |
| 62 | + <button mat-flat-button type="button" color="primary" (click)="dataApi(data_api_identifier.value)">Retrieve Metadata</button> |
| 63 | + </div> |
| 64 | + <mat-card *ngIf="images.length>0"> |
| 65 | + <mat-card-header> |
| 66 | + <mat-card-title>HathiTrust Page Scans</mat-card-title> |
| 67 | + </mat-card-header> |
| 68 | + <mat-card-content> |
| 69 | + <p>Retrieved <strong>{{images.length}}</strong> pages from the API for this title.</p> |
| 70 | + <button mat-flat-button type="button" color="primary" (click)="openModal()">View images</button> |
| 71 | + </mat-card-content> |
| 72 | + </mat-card> |
| 73 | + </mat-tab> |
| 74 | + <mat-tab label="PostMessage"> |
| 75 | + <div class="cloudapp-actions"> |
| 76 | + <button mat-flat-button type="button" color="primary" (click)="openPopup()">Open Pop-up</button> |
| 77 | + </div> |
| 78 | + <p *ngIf="popupResponse"> |
| 79 | + Thanks for responding! You have <span *ngIf="!popupResponse.val">NOT </span> agreed. |
| 80 | + </p> |
| 81 | + </mat-tab> |
| 82 | +</mat-tab-group> |
76 | 83 | <app-lightbox></app-lightbox>
|
0 commit comments