import {ResultsComponent} from './result/results.component';
import {RecordComponent} from './record/record.component';
import {CopiesComponent} from './record/copies.component';
-import {OpacViewComponent} from './record/opac.component';
import {ResultPaginationComponent} from './result/pagination.component';
import {ResultFacetsComponent} from './result/facets.component';
import {ResultRecordComponent} from './result/record.component';
HoldingsMaintenanceComponent,
SearchTemplatesComponent,
CnBrowseComponent,
- OpacViewComponent,
PreferencesComponent,
CnBrowseResultsComponent,
BrowsePagerComponent
+++ /dev/null
-
-<div *ngIf="!loaded" class="m-3 p-3 d-flex justify-content-center">
- <div><img src="/images/progressbar_green.gif"/></div>
-</div>
-
-<ng-container *ngIf="url">
- <iframe id='opac-iframe' class="w-100" (load)="handleLoad()" [src]="url">
- </iframe>
-</ng-container>
-
+++ /dev/null
-import {Component, Input, Renderer2} from '@angular/core';
-import {DomSanitizer} from '@angular/platform-browser';
-
-const OPAC_BASE_URL = '/eg/opac/record';
-
-@Component({
- selector: 'eg-opac-record-detail',
- templateUrl: 'opac.component.html'
-})
-export class OpacViewComponent {
-
- url; // SafeResourceUrlImpl
- loaded: boolean;
-
- _recordId: number;
- @Input() set recordId(id: number) {
-
- // Verify record ID is numeric only
- if (id && (id + '').match(/^\d+$/)) {
- this._recordId = id;
- this.url = this.sanitizer.bypassSecurityTrustResourceUrl(
- `${OPAC_BASE_URL}/${id}?readonly=1`);
- } else {
- this._recordId = null;
- this.url = null;
- }
- }
-
- get recordId(): number {
- return this._recordId;
- }
-
- constructor(
- private sanitizer: DomSanitizer,
- private renderer: Renderer2) {}
-
- handleLoad() {
- const iframe = this.renderer.selectRootElement('#opac-iframe');
-
- // 50 extra px adds enough space to avoid the scrollbar altogether
- const height = 50 + iframe.contentWindow.document.body.offsetHeight;
-
- iframe.style.height = `${height}px`;
- this.loaded = true;
- }
-}
-