angular2-cookie-law
Advanced tools
Comparing version 0.1.7 to 0.2.0
{ | ||
"name": "angular2-cookie-law", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "Angular2 component that provides a banner to inform users about cookie law", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "karma start", | ||
"test:headless": "karma start --browsers PhantomJS", | ||
"prebuild": "rm -rf lib", | ||
"build": "rollup -c -f umd -o lib/angular2-cookie-law.umd.js", | ||
"commit": "git-cz", | ||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls", | ||
"lint": "tslint -c tslint.json src/**/*.ts", | ||
"precommit": "npm run lint && npm run test:headless", | ||
"commit": "git-cz", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post", | ||
"test:headless": "karma start --browsers PhantomJS", | ||
"test": "karma start" | ||
}, | ||
@@ -64,2 +66,5 @@ "repository": { | ||
"raw-loader": "0.5.1", | ||
"rollup": "^0.41.4", | ||
"rollup-plugin-sourcemaps": "^0.4.1", | ||
"rollup-plugin-typescript": "^0.8.1", | ||
"rxjs": "5.0.2", | ||
@@ -69,6 +74,6 @@ "semantic-release": "6.3.2", | ||
"ts-helpers": "1.1.2", | ||
"tslint": "4.0.0", | ||
"tslint": "3.15.1", | ||
"typescript": "2.1.1", | ||
"webpack": "2.2.0", | ||
"zone.js": "0.7.4" | ||
"zone.js": "0.6.26" | ||
}, | ||
@@ -75,0 +80,0 @@ "config": { |
@@ -21,2 +21,3 @@ [![Build Status](https://travis-ci.org/andreasonny83/angular2-cookie-law.svg?branch=master)](https://travis-ci.org/andreasonny83/angular2-cookie-law) | ||
* [Options](#options) | ||
* [Custom template](#custom-template) | ||
* [Contributing](#contributing) | ||
@@ -137,6 +138,6 @@ * [Changelog](#changelog) | ||
Have a look at the [example](https://github.com/andreasonny83/angular2-cookie-law/tree/master/example) | ||
Have a look at the [demo](https://github.com/andreasonny83/angular2-cookie-law/tree/master/demo) | ||
available in this repository for a real Angular2 application using the `Angular2-Cookie-Law` library. | ||
From your termianl, navigate inside the `demo` folder, then install all the Node dependencies using npm: | ||
From your terminal, navigate inside the `demo` folder, then install all the Node dependencies using npm: | ||
@@ -193,2 +194,15 @@ ```bash | ||
## Custom template | ||
It is possible to overwrite our default cookie policy law text with a | ||
custom template. | ||
Just put your favorite html content between the component like in the | ||
following example: | ||
```html | ||
<cookie-law> | ||
This website contains cookie. | ||
<a =href="#/cookie-policy">Read more</a> | ||
</cookie-law> | ||
``` | ||
## Contributing | ||
@@ -195,0 +209,0 @@ |
@@ -34,20 +34,2 @@ /** | ||
], | ||
template: ` | ||
<div class="cookie-law-wrapper" | ||
*ngIf="!cookieLawSeen" | ||
[@state]="cookieLawSeen"> | ||
<div class="copy"> | ||
<strong>By continuing to browse the site, you're agreeing to our use of cookies.</strong> | ||
<span *ngIf="learnMore"> | ||
Learn more in our <a [href]="learnMore" [target]="target">privacy policy</a>. | ||
</span> | ||
</div> | ||
<a href="#" role="button" | ||
class="dismiss" | ||
[innerHTML]="closeSvg" | ||
(click)="dismiss($event)"></a> | ||
</div> | ||
`, | ||
styles: [` | ||
@@ -103,3 +85,3 @@ a { | ||
} | ||
.copy strong { | ||
.copy span { | ||
color: #fff; | ||
@@ -131,3 +113,24 @@ font-weight: 400; | ||
} | ||
`] | ||
`], | ||
template: ` | ||
<div class="cookie-law-wrapper" | ||
*ngIf="!cookieLawSeen" | ||
[@state]="cookieLawSeen"> | ||
<div class="copy"> | ||
<span #ref><ng-content></ng-content></span> | ||
<span *ngIf="ref.childNodes.length == 0"> | ||
By continuing to browse the site, you're agreeing to our use of cookies. | ||
<span *ngIf="learnMore"> | ||
Learn more in our <a [href]="learnMore" [target]="target">privacy policy</a>. | ||
</span> | ||
</span> | ||
<a href="#" role="button" | ||
class="dismiss" | ||
[innerHTML]="closeSvg" | ||
(click)="dismiss($event)"></a> | ||
</div> | ||
`, | ||
}) | ||
@@ -134,0 +137,0 @@ export class CookieLawComponent implements OnInit { |
@@ -20,3 +20,2 @@ /** | ||
it('#seen should return a value', () => { | ||
expect(service.seen()).toBe(false); | ||
@@ -23,0 +22,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183943
571
224
41
17
1