Skip to content

Commit

Permalink
Merged Repo Cleanum #47 (thanks @rayzru)
Browse files Browse the repository at this point in the history
  • Loading branch information
cstefanache committed Sep 2, 2016
2 parents 5303d20 + fa465bc commit ccb6213
Show file tree
Hide file tree
Showing 71 changed files with 1,043 additions and 3,514 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/typings
/dist
src/**/*.js.map
src/**/*.d.ts
src/**/*.js
runtime/*.js
index.js.map
index.d.ts
index.js
#################
## Misc
#################
Expand Down
5 changes: 0 additions & 5 deletions index.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0; maximum-scale=1.0;">
<link rel="stylesheet" href="runtime/runtime.css" >
Expand All @@ -10,14 +9,10 @@
<script src="system.config.js"></script>
<script src="dist/img-cropper-test-app.js"></script>
</head>

<body>
<test-app>Loading...</test-app>
<script>
System.import('runtime/main').then(null, function(err) {console.log(err)});
</script>


</body>

</html>
10 changes: 0 additions & 10 deletions index.js

This file was deleted.

1 change: 0 additions & 1 deletion index.js.map

This file was deleted.

10 changes: 5 additions & 5 deletions index.ts
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";
19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"name": "ng2-img-cropper",
"version": "0.6.1",
"version": "0.6.4",
"description": "Angular2 Image Cropper Component",
"repository": {
"type": "git",
"url": "git+https://github.com/cstefanache/angular2-img-cropper.git"
},
"scripts": {
"prepublish": "tsc",
"tsc": "tsc",
"postinstall": "typings install",
"build": "tsc -p ./",
"preversion": "npm test && npm run build",
"version": "git commit -am \"Prerelease updates\" && git checkout -b release && git add -f ./",
"postversion": "git push --tags && git checkout master && git branch -D release && git push && npm publish",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish",
"compile": "npm run compile:ts",
"compile:ts": "tsc",
"typings": "typings",
"all": "concurrently \"tsc -w \" \"tsc -p runtime -w \" \"npm run lite\" ",
"start": "concurrently \"tsc -w \" \"tsc -p runtime -w \" \"npm run lite\" ",
"watch": "tsc -w ",
"lite": "lite-server"
},
Expand All @@ -28,11 +40,10 @@
"bootstrap": "^3.3.6",
"concurrently": "^2.0.0",
"es6-shim": "^0.35.0",
"jquery": "^2.2.3",
"lite-server": "^2.2.0",
"ng2-styler": "^0.1.2",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"rxjs": "^5.0.0-beta.6",
"systemjs": "0.19.27",
"typescript": "^1.8.10",
"typings": "^1.3.0",
Expand Down
6 changes: 3 additions & 3 deletions runtime/main.ts
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, []);
2 changes: 1 addition & 1 deletion runtime/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"out": "dist/img-cropper-test-app.js",
"noImplicitAny": false,
"noImplicitAny": true,
"module": "system",
"target": "es5",
"emitDecoratorMetadata": true,
Expand Down
5 changes: 0 additions & 5 deletions src/cropperDrawSettings.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/cropperDrawSettings.js

This file was deleted.

1 change: 0 additions & 1 deletion src/cropperDrawSettings.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions src/cropperDrawSettings.ts
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)";
}
20 changes: 0 additions & 20 deletions src/cropperSettings.d.ts

This file was deleted.

50 changes: 0 additions & 50 deletions src/cropperSettings.js

This file was deleted.

1 change: 0 additions & 1 deletion src/cropperSettings.js.map

This file was deleted.

68 changes: 46 additions & 22 deletions src/cropperSettings.ts
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;
}

}
}
25 changes: 0 additions & 25 deletions src/exif.d.ts

This file was deleted.

Loading

0 comments on commit ccb6213

Please sign in to comment.