angular2-image-gallery
Advanced tools
Comparing version
@@ -10,2 +10,3 @@ import { ElementRef, ChangeDetectorRef, QueryList, OnInit, SimpleChanges, OnChanges, EventEmitter, OnDestroy } from "@angular/core"; | ||
providedImageSize: number; | ||
providedGalleryName: string; | ||
viewerChange: EventEmitter<boolean>; | ||
@@ -17,2 +18,3 @@ galleryContainer: ElementRef; | ||
private imageDataFilePath; | ||
private dataFileName; | ||
private images; | ||
@@ -19,0 +21,0 @@ private gallery; |
@@ -20,4 +20,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.providedImageSize = 7; | ||
this.providedGalleryName = ''; | ||
this.viewerChange = new EventEmitter(); | ||
this.imageDataFilePath = 'assets/img/gallery/data.json'; | ||
this.imageDataFilePath = 'assets/img/gallery/'; | ||
this.dataFileName = 'data.json'; | ||
this.images = []; | ||
@@ -54,2 +56,5 @@ this.gallery = []; | ||
var _this = this; | ||
this.imageDataFilePath = this.providedGalleryName != '' ? | ||
this.imageDataFilePath + this.providedGalleryName + '/' + this.dataFileName : | ||
this.imageDataFilePath + this.dataFileName; | ||
this.http.get(this.imageDataFilePath) | ||
@@ -182,2 +187,6 @@ .map(function (res) { return res.json(); }) | ||
__decorate([ | ||
Input('galleryName'), | ||
__metadata('design:type', String) | ||
], GalleryComponent.prototype, "providedGalleryName", void 0); | ||
__decorate([ | ||
Output(), | ||
@@ -184,0 +193,0 @@ __metadata('design:type', Object) |
@@ -27,2 +27,8 @@ var fs = require('fs'); | ||
function init() { | ||
if(argv["gName"]){ | ||
var galleryName = argv['gName']; | ||
console.log(`Gallery name provided - '${galleryName}'. Images to be created in the '${galleryName}' subfolder`); | ||
assetsAbsoluteBasePath = assetsAbsoluteBasePath + argv['gName'] + "/"; | ||
previewRelativePath = previewRelativePath + argv['gName'] + "/"; | ||
} | ||
if (argv['_'].length == 0) { | ||
@@ -133,2 +139,4 @@ toConvertAbsoluteBasePath = projectRoot + "/images_to_convert"; | ||
function createPreviewImage(files, fidx, filePath, file, index) { | ||
// create various preview images | ||
gm(filePath) | ||
@@ -135,0 +143,0 @@ .resize(null, resolutions[index].height) |
{ | ||
"name": "angular2-image-gallery", | ||
"version": "0.5.9", | ||
"version": "0.6.0", | ||
"description": "Responsive Angular 2 image gallery", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -66,2 +66,6 @@ # Angular 2 Image Gallery | ||
Additional optional parameter to support multiple galleries. Add it if you want to put your images into a separate gallery. | ||
`--gName=yourGalleryName` | ||
#### 6. Embed gallery in your template | ||
@@ -72,3 +76,4 @@ | ||
[flexBorderSize]="3" | ||
[flexImageSize]="7" | ||
[flexImageSize]="7" | ||
[galleryName]="yourGalleryName" | ||
(viewerChange)="yourNotificationFunction($event)"> | ||
@@ -75,0 +80,0 @@ </gallery> |
Sorry, the diff of this file is not supported yet
72104
1.93%976
1.88%99
5.32%