-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
71 changed files
with
1,043 additions
and
3,514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './src/imageCropperComponent'; | ||
export * from './src/imageCropper'; | ||
export * from './src/cropperSettings'; | ||
export * from './src/cropperDrawSettings'; | ||
export * from './src/model/bounds'; | ||
export * from "./src/imageCropperComponent"; | ||
export * from "./src/imageCropper"; | ||
export * from "./src/cropperSettings"; | ||
export * from "./src/cropperDrawSettings"; | ||
export * from "./src/model/bounds"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { bootstrap } from '@angular/platform-browser-dynamic'; | ||
import {AppComponent} from './app'; | ||
|
||
import {bootstrap} from "@angular/platform-browser-dynamic"; | ||
import {AppComponent} from "./app"; | ||
|
||
// todo: update to angular2 rc.5 with ngModule. | ||
bootstrap(AppComponent, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export class CropperDrawSettings { | ||
constructor(public strokeWidth:number = 1, public strokeColor:string = 'rgba(255,255,255,0.9)') { | ||
} | ||
} | ||
public strokeWidth: number = 1; | ||
public strokeColor: string = "rgba(255,255,255,1)"; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,73 @@ | ||
import {CropperDrawSettings} from "./cropperDrawSettings"; | ||
export class CropperSettings { | ||
canvasWidth:number = 300; | ||
canvasHeight:number = 300; | ||
|
||
width:number = 200; | ||
height:number = 200; | ||
export interface ICropperSettings { | ||
canvasWidth?: number; | ||
canvasHeight?: number; | ||
width?: number; | ||
height?: number; | ||
minWidth?: number; | ||
minHeight?: number; | ||
minWithRelativeToResolution?: boolean; | ||
croppedWidth?: number; | ||
croppedHeight?: number; | ||
touchRadius?: number; | ||
cropperDrawSettings?: any; | ||
noFileInput?: boolean; | ||
allowedFilesRegex?: RegExp; | ||
rounded: boolean; | ||
keepAspect: boolean; | ||
} | ||
|
||
minWidth:number = 50; | ||
minHeight:number = 50; | ||
minWithRelativeToResolution:boolean = true; | ||
export class CropperSettings implements ICropperSettings { | ||
|
||
croppedWidth:number = 100; | ||
croppedHeight:number = 100; | ||
public canvasWidth: number = 300; | ||
public canvasHeight: number = 300; | ||
|
||
public width: number = 200; | ||
public height: number = 200; | ||
|
||
cropperDrawSettings:CropperDrawSettings = new CropperDrawSettings(); | ||
touchRadius:number = 20; | ||
noFileInput:boolean = false; | ||
public minWidth: number = 50; | ||
public minHeight: number = 50; | ||
public minWithRelativeToResolution: boolean = true; | ||
|
||
allowedFilesRegex:RegExp = /\.(jpe?g|png|gif)$/i; | ||
public responsive: boolean = false; | ||
|
||
private _rounded:boolean = false; | ||
private _keepAspect:boolean = true; | ||
public croppedWidth: number = 100; | ||
public croppedHeight: number = 100; | ||
|
||
set rounded(val:boolean) { | ||
public cropperDrawSettings: CropperDrawSettings = new CropperDrawSettings(); | ||
public touchRadius: number = 20; | ||
public noFileInput: boolean = false; | ||
|
||
public allowedFilesRegex: RegExp = /\.(jpe?g|png|gif)$/i; | ||
|
||
private _rounded: boolean = false; | ||
private _keepAspect: boolean = true; | ||
|
||
constructor() { | ||
// init | ||
} | ||
|
||
set rounded(val: boolean) { | ||
this._rounded = val; | ||
if (val) { | ||
this._keepAspect = true; | ||
} | ||
} | ||
|
||
get rounded() { | ||
get rounded(): boolean { | ||
return this._rounded; | ||
} | ||
|
||
set keepAspect(val:boolean) { | ||
set keepAspect(val: boolean) { | ||
if (val === false && this._rounded) { | ||
throw new Error("Cannot set keep aspect to false on rounded cropper. Ellipsis not supported"); | ||
} | ||
|
||
this._keepAspect = val; | ||
} | ||
|
||
get keepAspect() { | ||
get keepAspect(): boolean { | ||
return this._keepAspect; | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.