Skip to content

Commit

Permalink
update readme, adjust license error, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
skrsm committed Mar 1, 2022
1 parent 44e821e commit 8027d56
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<a href="https://www.gnu.org/licenses/gpl-3.0.html">
<img alt="License" src="https://img.shields.io/badge/License-GPL-blue.svg">
</a>
<a href="https://snyk.io/test/npm/cuttr/1.4.0">
<img src="https://snyk.io/test/npm/cuttr/1.4.0/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/npm/cuttr/1.3.1" style="max-width:100%;">
<a href="https://snyk.io/test/npm/cuttr/1.4.1">
<img src="https://snyk.io/test/npm/cuttr/1.4.1/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/npm/cuttr/1.3.1" style="max-width:100%;">
</a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K9X3RW27WJHWE&source=url">
<img alt="License" src="https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg">
Expand Down Expand Up @@ -56,9 +56,9 @@ Link directly to Cuttr files on [unpkg](https://unpkg.com/cuttr).
Link directly to Cuttr files on [cdnjs](https://cdnjs.com/libraries/cuttr).

``` html
<script src="https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.0/cuttr.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.1/cuttr.min.js"></script>
<!-- or -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.0/cuttr.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cuttr/1.4.1/cuttr.js"></script>

```

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cuttr",
"description": "Cuttr is a javascript plugin that truncates multi-line string content with multiple truncation methods and custom ellipsis.",
"main": "dist/cuttr.js",
"version": "1.4.0",
"version": "1.4.1",
"authors": [
"DEVSK"
],
Expand Down
10 changes: 8 additions & 2 deletions dist/cuttr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Cuttr 1.4.0
* Cuttr 1.4.1
* https://github.com/d-e-v-s-k/cuttr-js
*
* @license GPLv3 for open source use only
Expand All @@ -22,6 +22,9 @@
root.Cuttr = factory();
}
})(this, function () {
// private global vars
var CUTTR_LICENSE = true; // init Cuttr

var Cuttr = function Cuttr(el, options) {
'use strict';

Expand Down Expand Up @@ -314,7 +317,10 @@


function displayWarnings(isAuthorized) {
if (!isAuthorized) {
if (!isAuthorized && CUTTR_LICENSE) {
// declare global const to show error only once
CUTTR_LICENSE = false; // show error message

showError('error', 'Cuttr.js has a GPLv3 license and it requires a `licenseKey` option. Read about it here:');
showError('error', 'https://github.com/d-e-v-s-k/cuttr-js#options');
}
Expand Down
4 changes: 2 additions & 2 deletions dist/cuttr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cuttr.min.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ <h2>Truncate without breaking the HTML</h2>
length: 13
});

truncateChar.expandContent();

new Cuttr('.truncate-words', {
//options here
truncate: 'words',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cuttr",
"version": "1.4.0",
"version": "1.4.1",
"description": "Cuttr is a javascript / jQuery plugin that truncates multi-line string content with multiple truncation methods and custom ellipsis.",
"main": "dist/cuttr.js",
"unpkg": "dist/cuttr.min.js",
Expand Down
12 changes: 10 additions & 2 deletions src/cuttr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Cuttr 1.4.0
* Cuttr 1.4.1
* https://github.com/d-e-v-s-k/cuttr-js
*
* @license GPLv3 for open source use only
Expand All @@ -23,6 +23,11 @@
root.Cuttr = factory();
}
}(this, function () {

// private global vars
let CUTTR_LICENSE = true;

// init Cuttr
const Cuttr = function (el, options){
'use strict';

Expand Down Expand Up @@ -370,7 +375,10 @@
*/
function displayWarnings(isAuthorized) {

if (!isAuthorized) {
if (!isAuthorized && CUTTR_LICENSE) {
// declare global const to show error only once
CUTTR_LICENSE = false;
// show error message
showError('error', 'Cuttr.js has a GPLv3 license and it requires a `licenseKey` option. Read about it here:');
showError('error', 'https://github.com/d-e-v-s-k/cuttr-js#options');
}
Expand Down

0 comments on commit 8027d56

Please sign in to comment.