Compare commits
No commits in common. "305cd0cb6c36a733a07754003f3a05f6bcc5efc0" and "b95f6046c5842173649b599133ca9db5dc79d068" have entirely different histories.
305cd0cb6c
...
b95f6046c5
@ -73,9 +73,6 @@ export class PageService {
|
|||||||
page['parent_title']=item['parentTitle']['title'];
|
page['parent_title']=item['parentTitle']['title'];
|
||||||
page['parent_link']=item['parentTitle']['link'];
|
page['parent_link']=item['parentTitle']['link'];
|
||||||
|
|
||||||
if (item['acf']['pdf']) { page['pdf']=item['acf']['pdf']; }
|
|
||||||
else { page['pdf']=null; }
|
|
||||||
|
|
||||||
/* chilsd */
|
/* chilsd */
|
||||||
page["hasChild"]=item["hasChild"];
|
page["hasChild"]=item["hasChild"];
|
||||||
// if (item["hasChild"]) {
|
// if (item["hasChild"]) {
|
||||||
@ -89,6 +86,8 @@ export class PageService {
|
|||||||
|
|
||||||
/* featured images */
|
/* featured images */
|
||||||
if ( !childs && item["_embedded"]["wp:featuredmedia"]) {
|
if ( !childs && item["_embedded"]["wp:featuredmedia"]) {
|
||||||
|
console.log('featured image: '+item.id);
|
||||||
|
console.log(item["_embedded"]["wp:featuredmedia"])
|
||||||
page["featuredmedia"] = item["_embedded"]["wp:featuredmedia"];
|
page["featuredmedia"] = item["_embedded"]["wp:featuredmedia"];
|
||||||
|
|
||||||
if (item["_embedded"]["wp:featuredmedia"][0]["media_details"]["sizes"]["large"]) {
|
if (item["_embedded"]["wp:featuredmedia"][0]["media_details"]["sizes"]["large"]) {
|
||||||
|
@ -36,11 +36,11 @@
|
|||||||
<ks-modal-gallery [id]="0" [slideConfig]="{infinite: true, sidePreviews: {show: false}}" [buttonsConfig]="buttonsConfigIndustria" [previewConfig]="{visible: false}" [dotsConfig]="{visible: false}" [currentImageConfig]="{downloadable: true, description: {imageText:''}}" [modalImages]="page.gallery" [plainGalleryConfig]="customPlainGalleryRowDescConfig"></ks-modal-gallery>
|
<ks-modal-gallery [id]="0" [slideConfig]="{infinite: true, sidePreviews: {show: false}}" [buttonsConfig]="buttonsConfigIndustria" [previewConfig]="{visible: false}" [dotsConfig]="{visible: false}" [currentImageConfig]="{downloadable: true, description: {imageText:''}}" [modalImages]="page.gallery" [plainGalleryConfig]="customPlainGalleryRowDescConfig"></ks-modal-gallery>
|
||||||
</section>
|
</section>
|
||||||
<section class="section-publitas">
|
<section class="section-publitas">
|
||||||
<div class="row" *ngIf="page.pdf">
|
<div class="row" *ngIf="page.publitas_link">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<simple-pdf-viewer #pdfViewer [src]="page.pdf.url" [removePageBorders]="true" (onProgress)="onProgressPDF($event,page.pdf.filesize)"></simple-pdf-viewer>
|
<simple-pdf-viewer #pdfViewer [src]="'../assets/'+page.publitas_link" [removePageBorders]="true"></simple-pdf-viewer>
|
||||||
<div class="pdf-buttons" *ngIf="!pdfViewer.isDocumentLoaded()">
|
<div class="pdf-buttons" *ngIf="!pdfViewer.isDocumentLoaded()">
|
||||||
<button>Cargando documento {{loaderPDF}}%</button>
|
<button>Cargando documento</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="pdf-buttons" style="" *ngIf="pdfViewer.isDocumentLoaded()">
|
<div class="pdf-buttons" style="" *ngIf="pdfViewer.isDocumentLoaded()">
|
||||||
<button (click)="pdfViewer.firstPage()">First Page</button>
|
<button (click)="pdfViewer.firstPage()">First Page</button>
|
||||||
|
@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||||||
import { PageService } from '../page.service';
|
import { PageService } from '../page.service';
|
||||||
import { PageItem } from '../page';
|
import { PageItem } from '../page';
|
||||||
import { ActivatedRoute,Router, NavigationEnd } from "@angular/router";
|
import { ActivatedRoute,Router, NavigationEnd } from "@angular/router";
|
||||||
import { SafeResourceUrl, DomSanitizer,SafeUrl } from '@angular/platform-browser';
|
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
||||||
import {
|
import {
|
||||||
AccessibilityConfig,
|
AccessibilityConfig,
|
||||||
Action,
|
Action,
|
||||||
@ -34,13 +34,12 @@ import * as $ from 'jquery';
|
|||||||
})
|
})
|
||||||
export class PageComponent implements OnInit {
|
export class PageComponent implements OnInit {
|
||||||
|
|
||||||
pages : PageItem[] = [];
|
pages : PageItem[];
|
||||||
slug : string;
|
slug : string;
|
||||||
parent : string;
|
parent : string;
|
||||||
imageIndex = 1;
|
imageIndex = 1;
|
||||||
galleryId = 1;
|
galleryId = 1;
|
||||||
gallery: Image[];
|
gallery: Image[];
|
||||||
loaderPDF: number;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -57,6 +56,7 @@ export class PageComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log('init')
|
||||||
// $('html body').animate(
|
// $('html body').animate(
|
||||||
// {scrollTop:0}, 1000);
|
// {scrollTop:0}, 1000);
|
||||||
document.documentElement.scrollTop = 0
|
document.documentElement.scrollTop = 0
|
||||||
@ -69,17 +69,11 @@ export class PageComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPage() {
|
getPage() {
|
||||||
// console.log(this.slug);
|
console.log(this.slug);
|
||||||
this.pageService.getPage(this.slug)
|
this.pageService.getPage(this.slug)
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.pages = data;
|
this.pages = data;
|
||||||
this.pages.forEach( (p) => {
|
//console.log(data);
|
||||||
|
|
||||||
var safeUrl:SafeUrl;
|
|
||||||
safeUrl = this.sanitizer.bypassSecurityTrustUrl('https://backend.industriapaisaia.eus/wp-content/uploads/2018/10/test.pdf');
|
|
||||||
p['publitas_link_sanitize'] = safeUrl;
|
|
||||||
if (p['pdf']) { p['pdfUrl'] = p['pdf']['url']; };
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,12 +127,12 @@ buttonsConfigIndustria: ButtonsConfig = {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
onVisibleIndex(event: ImageModalEvent) {
|
onVisibleIndex(event: ImageModalEvent) {
|
||||||
// console.log('onVisibleIndex action: ' + Action[event.action]);
|
console.log('onVisibleIndex action: ' + Action[event.action]);
|
||||||
// console.log('onVisibleIndex result:' + event.result);
|
console.log('onVisibleIndex result:' + event.result);
|
||||||
}
|
}
|
||||||
|
|
||||||
openImageModalRowDescription(image: Image) {
|
openImageModalRowDescription(image: Image) {
|
||||||
// console.log('Opening modal gallery from custom plain gallery row and description, with image: ', image);
|
console.log('Opening modal gallery from custom plain gallery row and description, with image: ', image);
|
||||||
const index: number = this.getCurrentIndexCustomLayout(image, this.pages[0].gallery);
|
const index: number = this.getCurrentIndexCustomLayout(image, this.pages[0].gallery);
|
||||||
this.customPlainGalleryRowDescConfig = Object.assign({}, this.customPlainGalleryRowDescConfig, { layout: new AdvancedLayout(index, true) });
|
this.customPlainGalleryRowDescConfig = Object.assign({}, this.customPlainGalleryRowDescConfig, { layout: new AdvancedLayout(index, true) });
|
||||||
}
|
}
|
||||||
@ -147,10 +141,4 @@ private getCurrentIndexCustomLayout(image: Image, images: Image[]): number {
|
|||||||
return image ? images.indexOf(image) : -1;
|
return image ? images.indexOf(image) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
onProgressPDF(event,total) {
|
|
||||||
let loadInt = parseInt(event.loaded, 10);
|
|
||||||
let totalInt = parseInt(total,10);
|
|
||||||
this.loaderPDF = Math.floor(loadInt/totalInt*100);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
BIN
src/assets/test.pdf
Normal file
BIN
src/assets/test.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user