show-a-license 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +12 -121
  3. package/lib/index.js +33 -32
  4. package/package.json +3 -2
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-22 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
3
+ Copyright (c) 2015-26 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,45 +1,17 @@
1
1
  <!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
2
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
3
  # show-a-license
21
4
 
22
- [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/show-a-license.svg)](https://www.npmjs.com/package/show-a-license) [![Downloads](https://img.shields.io/npm/dt/show-a-license.svg)](https://www.npmjs.com/package/show-a-license) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
5
+ [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/show-a-license.svg)](https://www.npmjs.com/package/show-a-license) [![Downloads](https://img.shields.io/npm/dt/show-a-license.svg)](https://www.npmjs.com/package/show-a-license) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/@johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
23
6
 
24
7
  <a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
25
8
 
26
-
27
-
28
-
29
-
30
-
31
-
32
9
  > A site to provide an easy way to show licenses and their human-readable explanations.
33
10
 
34
-
35
-
36
-
37
-
38
-
39
11
  ## Your help is needed! :heart:
40
12
 
41
13
 
42
- Contribute by explaining licenses. Check out [this issue](https://github.com/IonicaBizau/show-the-license/issues/1). :memo: :book:
14
+ Contribute by explaining licenses. Check out [this issue](https://github.com/IonicaBizau/show-a-license/issues/1). :memo: :book:
43
15
 
44
16
  ## Usage
45
17
 
@@ -59,33 +31,7 @@ Whether you just want to show a license or see its human-readable explanation, y
59
31
  - In the end, run in parallel `npm run watch` and `npm start`
60
32
  - Open in your browser [http://localhost:9000/index.html](http://localhost:9000/index.html).
61
33
 
62
-
63
-
64
-
65
-
66
-
67
-
68
34
  [![show-a-license](http://i.imgur.com/AB42LJo.png)](#)
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
35
 
90
36
  ## Examples
91
37
 
@@ -95,62 +41,34 @@ Whether you just want to show a license or see its human-readable explanation, y
95
41
  - To set the starting copyright year use the `year` parameter: https://ionicabizau.github.io/show-a-license?year=2013&fullname=Alice#license-mit
96
42
  - To hide the explanations column, you have to use `hide_explanations=true`: https://ionicabizau.github.io/show-a-license?hide_explanations=true&year=2013&fullname=Alice#license-mit
97
43
 
98
-
99
-
100
-
101
-
102
-
103
-
104
44
  ## :question: Get Help
105
45
 
106
- There are few ways to get help:
107
-
46
+ There are a few ways to get help:
108
47
 
109
-
110
- 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
48
+ 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long as you add a link to your Stack Overflow question.
111
49
  2. For bug reports and feature requests, open issues. :bug:
112
50
  3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
113
51
 
52
+ ## :yum: How to Contribute
114
53
 
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- ## :yum: How to contribute
130
54
  Have an idea? Found a bug? See [how to contribute][contributing].
131
55
 
56
+ ## :sparkling_heart: Support My Projects
132
57
 
133
- ## :sparkling_heart: Support my projects
134
- I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
135
- this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
136
-
137
- However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
58
+ I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute it (even resell it).
138
59
 
60
+ However, if you get some profit from this or just want to encourage me to continue creating stuff, there are a few ways you can do it:
139
61
 
140
62
  - Starring and sharing the projects you like :rocket:
141
- - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
63
+ - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you for years if you buy me one. :grin: :book:
142
64
  - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
143
65
  - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
144
- - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
145
-
146
- ![](https://i.imgur.com/z6OQI95.png)
66
+ - **Bitcoin**—You can send me bitcoins at this address (or by scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
147
67
 
68
+ ![Bitcoin QR code](https://i.imgur.com/z6OQI95.png)
148
69
 
149
70
  Thanks! :heart:
150
71
 
151
-
152
-
153
-
154
72
  ### Explaining a license
155
73
 
156
74
 
@@ -177,42 +95,15 @@ If the license you're searching for is missing, make sure you add it.
177
95
  4. Add yourself as contributor in [`package.json`](/package.json).
178
96
  5. Raise a pull request! :tada:
179
97
 
180
-
181
-
182
-
183
-
184
-
185
-
186
98
  ## :cake: Thanks
187
99
 
188
100
  - [github/choosealicense.com](https://github.com/github/choosealicense.com)–a good inspiration source (some ideas and CSS were taken from here) :sparkle:
189
101
  - [**@Cerberus-tm**](https://github.com/Cerberus-tm)–who had the idea for the site name :cake:
190
102
 
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
103
  ## :scroll: License
208
104
 
209
105
  [MIT][license] © [Ionică Bizău][website]
210
106
 
211
-
212
-
213
-
214
-
215
-
216
107
  [license]: /LICENSE
217
108
  [website]: https://ionicabizau.net
218
109
  [contributing]: /CONTRIBUTING.md
@@ -222,5 +113,5 @@ If the license you're searching for is missing, make sure you add it.
222
113
  [badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
223
114
  [badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
224
115
  [patreon]: https://www.patreon.com/ionicabizau
225
- [amazon]: http://amzn.eu/hRo9sIZ
116
+ [amazon]: https://amzn.eu/hRo9sIZ
226
117
  [paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
package/lib/index.js CHANGED
@@ -1,25 +1,25 @@
1
- "use strict";
2
-
3
1
  // Dependencies
4
- var $ = require("elm-select"),
5
- _fetch = require("whatwg-fetch"),
6
- sameTime = require("same-time"),
7
- barbe = require("barbe"),
8
- Err = require("err"),
9
- yearRange = require("year-range");
2
+ var $ = require("elm-select")
3
+ , _fetch = require("whatwg-fetch")
4
+ , sameTime = require("same-time")
5
+ , barbe = require("barbe")
6
+ , Err = require("err")
7
+ , yearRange = require("year-range")
8
+ ;
10
9
 
11
10
  // Constants
12
11
  var HASH_PREFIX = "#license-";
13
12
 
14
13
  // Get the elements
15
- var licenseTable = $(".license-view table")[0],
16
- tableTbody = $("tbody", licenseTable)[0],
17
- viewExplanationsEl = $("tfoot", licenseTable)[0],
18
- searchLicenseEl = $("input.search-license-name.awesomplete")[0],
19
- linkLicenseEl = $("input.link-license-name.awesomplete")[0];
20
- form = $('form')[0];
14
+ var licenseTable = $(".license-view table")[0]
15
+ , tableTbody = $("tbody", licenseTable)[0]
16
+ , viewExplanationsEl = $("tfoot", licenseTable)[0]
17
+ , searchLicenseEl = $("input.search-license-name.awesomplete")[0]
18
+ , linkLicenseEl = $("input.link-license-name.awesomplete")[0]
19
+ form = $('form')[0]
20
+ ;
21
21
 
22
- var licenses = _licenses.join(",");
22
+ let licenses = _licenses.join(",");
23
23
 
24
24
  searchLicenseEl.setAttribute("data-list", licenses);
25
25
  linkLicenseEl.setAttribute("data-list", licenses);
@@ -54,7 +54,7 @@ function checkExplanationState() {
54
54
  viewExplanationsEl.addEventListener("click", function (e) {
55
55
  e.preventDefault();
56
56
  Url.updateSearchParam("hide_explanations", showExplanations ? "true" : undefined);
57
- location.reload();
57
+ location.reload()
58
58
  });
59
59
 
60
60
  function showNormalView() {
@@ -65,11 +65,13 @@ function showNormalView() {
65
65
  elm.classList.remove("hide");
66
66
  });
67
67
  searchLicenseEl.focus();
68
+
68
69
  }
69
70
 
70
71
  function renderInfo(c) {
71
- var data = {},
72
- startYear = parseInt(Url.queryString("year"));
72
+ var data = {}
73
+ , startYear = parseInt(Url.queryString("year"))
74
+ ;
73
75
 
74
76
  data.year = startYear;
75
77
  data.fullname = Url.queryString("fullname");
@@ -104,16 +106,17 @@ function doRequest(url) {
104
106
  }
105
107
 
106
108
  function getLicense(license, fn) {
107
- sameTime([doRequest("https://ionicabizau.github.io/show-a-license/licenses/" + license + ".txt"), doRequest("https://ionicabizau.github.io/show-a-license/explanations/" + license + ".txt")], function (err, data) {
108
- if (err) {
109
- return fn(err);
110
- }
109
+ sameTime([
110
+ doRequest("https://ionicabizau.github.io/show-a-license/licenses/" + license + ".txt")
111
+ , doRequest("https://ionicabizau.github.io/show-a-license/explanations/" + license + ".txt")
112
+ ], function (err, data) {
113
+ if (err) { return fn(err); }
111
114
  data = data.map(function (c) {
112
115
  return c.split("\n\n");
113
116
  });
114
117
  fn(null, {
115
- license: data[0],
116
- explanation: data[1]
118
+ license: data[0]
119
+ , explanation: data[1]
117
120
  });
118
121
  });
119
122
  }
@@ -121,10 +124,10 @@ function getLicense(license, fn) {
121
124
  function showError(err) {
122
125
  err = err[0] || err;
123
126
  var sweetErr = {
124
- title: "Oops...",
125
- text: err.toString(),
126
- type: "error",
127
- html: true
127
+ title: "Oops..."
128
+ , text: err.toString()
129
+ , type: "error"
130
+ , html: true
128
131
  };
129
132
 
130
133
  // License not found
@@ -182,13 +185,11 @@ function showLicenseView(license) {
182
185
 
183
186
  function checkHash() {
184
187
  var hash = location.hash;
185
- if (hash.indexOf(HASH_PREFIX) !== 0) {
186
- return showNormalView();
187
- }
188
+ if (hash.indexOf(HASH_PREFIX) !== 0) { return showNormalView(); }
188
189
  var license = hash.substring(HASH_PREFIX.length).toLowerCase();
189
190
  showLicenseView(license);
190
191
  checkExplanationState();
191
192
  }
192
193
 
193
194
  window.addEventListener("hashchange", checkHash);
194
- window.addEventListener("load", checkHash);
195
+ window.addEventListener("load", checkHash);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "show-a-license",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "A site to provide an easy way to show licenses and their human-readable explanations.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@
20
20
  "h2": "Your help is needed! :heart:"
21
21
  },
22
22
  {
23
- "p": "Contribute by explaining licenses. Check out [this issue](https://github.com/IonicaBizau/show-the-license/issues/1). :memo: :book:"
23
+ "p": "Contribute by explaining licenses. Check out [this issue](https://github.com/IonicaBizau/show-a-license/issues/1). :memo: :book:"
24
24
  },
25
25
  {
26
26
  "h2": "Usage"
@@ -141,6 +141,7 @@
141
141
  "menu/",
142
142
  "cli.js",
143
143
  "index.js",
144
+ "index.d.ts",
144
145
  "bloggify.js",
145
146
  "bloggify.json",
146
147
  "bloggify/"