Skip to content

Commit

Permalink
Version 2.3.2 Released.
Browse files Browse the repository at this point in the history
Fixed: "Notiflix.Block.*" module, "Remove()" function fixes and improvements for Internet Explorer(10+) compatibility.

Changed: "notiflix-aio.js" file has been moved from "src" to "src/all-in-one" folder.
  • Loading branch information
furcan committed Jun 18, 2020
1 parent f0989e5 commit b369236
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 61 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[downloads-url]: https://npmjs.org/package/notiflix
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/notiflix/badge?style=rounded
[jsdelivr-url]: https://www.jsdelivr.com/package/npm/notiflix
[size-badge]: https://img.badgesize.io/https://cdn.jsdelivr.net/npm/[email protected].1/dist/notiflix-aio-2.3.1.min.js?compression=gzip
[size-url]: https://cdn.jsdelivr.net/npm/[email protected].1/dist/notiflix-aio-2.3.1.min.js
[size-badge]: https://img.badgesize.io/https://cdn.jsdelivr.net/npm/[email protected].2/dist/notiflix-aio-2.3.2.min.js?compression=gzip
[size-url]: https://cdn.jsdelivr.net/npm/[email protected].2/dist/notiflix-aio-2.3.2.min.js
[lic-badge]: https://img.shields.io/github/license/notiflix/Notiflix.svg
[lic-url]: https://github.com/notiflix/Notiflix/blob/master/LICENSE

Expand All @@ -34,7 +34,7 @@
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more to that makes your web projects much better.

#### Current Version
2.3.1 [*](https://github.com/notiflix/Notiflix/blob/master/ReleaseNotes.md "Release Notes")
2.3.2 [*](https://github.com/notiflix/Notiflix/blob/master/ReleaseNotes.md "Release Notes")

#### Website
https://www.notiflix.com
Expand Down Expand Up @@ -84,14 +84,14 @@ import { Notify, Report, Confirm, Loading, Block } from "notiflix";

##### CSS and JS
```html
<link rel="stylesheet" href="dist/notiflix-2.3.1.min.css" />
<link rel="stylesheet" href="dist/notiflix-2.3.2.min.css" />

<script src="dist/notiflix-2.3.1.min.js"></script>
<script src="dist/notiflix-2.3.2.min.js"></script>
```

##### or only JS (All in One - Internal CSS)
```html
<script src="dist/notiflix-aio-2.3.1.min.js"></script>
<script src="dist/notiflix-aio-2.3.2.min.js"></script>
```

---------
Expand Down
7 changes: 7 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
@2.3.2
* **Fixed:** `Notiflix.Block.*` module, `Remove()` function fixes and improvements for Internet Explorer(10+) compatibility.

* **Changed:** `"notiflix-aio.js"` file has been moved from `"src"` to `"src/all-in-one"` folder.

-----

@2.3.1
* **Changed:** `Notiflix.Notify.*` module, `callback` and `options` parameters have been changed.

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/notiflix-2.3.1.min.js → dist/notiflix-2.3.2.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@

</style>

<!-- <link href="../dist/notiflix-2.3.1.min.css" rel="stylesheet" />
<script src="../dist/notiflix-2.3.1.min.js"></script> -->
<!-- <script src="../dist/notiflix-aio-2.3.1.min.js"></script> -->
<!-- <link href="../dist/notiflix-2.3.2.min.css" rel="stylesheet" />
<script src="../dist/notiflix-2.3.2.min.js"></script> -->
<script src="../dist/notiflix-aio-2.3.2.min.js"></script>

<!-- <link href="../src/notiflix.css" rel="stylesheet" />
<script src="../src/notiflix.js"></script> -->
<script src="../src/all-in-one/notiflix-aio.js"></script>
<!-- <script src="../src/all-in-one/notiflix-aio.js"></script> -->

<script>
// Notiflix.Notify.Init({
Expand Down
22 changes: 13 additions & 9 deletions helpers/notiflix-dev-allinone.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Notiflix - All In One
*
* Description: Create "notiflix-aio.js" file from "notiflix.js" and "notiflix.css" files for the development.
* Description: Creates "notiflix-aio.js" file automatically from "notiflix.js" and "notiflix.css" files.
* Version: 1.0.0
* Author: Furkan MT ('https://github.com/furcan')
* Copyright 2020 Notiflix - All In One, MIT Licence ('https://opensource.org/licenses/MIT')
Expand Down Expand Up @@ -57,25 +57,29 @@ const createNotiflixAIOfileFromJsAndCss = () => {
if (nxStyleAsMinified && nxScript) {
// if output directory is exist
if (existsSync(Constants.dirOutputDev)) {
var internalCSS = `var css = '';`;
// replace internal css codes if exist
if (nxScript.indexOf(internalCSS) > -1) {
// replace
const nxScriptAIO = nxScript.replace(internalCSS, `var css = '${nxStyleAsMinified}';`);
const commentVersion = `* Version:`;
const commentDescAndVersion = `* Description: Notiflix All In One contains the Notiflix CSS codes as internal to use the Notiflix as one file. This file has been created automatically from using the "notiflix.js", and "notiflix.css" files.\n${commentVersion}`;
const internalCSS = `var css = '';`;
// add a description comment before the version && replace internal css codes => if they exist
if (nxScript.indexOf(commentVersion) > -1 && nxScript.indexOf(internalCSS) > -1) {
// add the description above the version as comment
let nxScriptAIO = nxScript.replace(commentVersion, commentDescAndVersion);
// replace internal css
nxScriptAIO = nxScriptAIO.replace(internalCSS, `var css = '${nxStyleAsMinified}';`);
// create "notiflix-aio.js" file
writeFileSync(join(Constants.dirOutputDev, Constants.fileScriptAIO), nxScriptAIO);
} else {
Constants.terminalError(`"${internalCSS}" does not exist in the "${Constants.fileScript}" file.`, `${thisFilePath} => Line: 68`);
Constants.terminalError(`"${nxScript.indexOf(commentVersion) === -1 ? commentVersion : internalCSS}" does not exist in the "${Constants.fileScript}" file.`, `${thisFilePath} => Line: 68`);
return false;
}
}
// else throw error
else {
Constants.terminalError(`"${Constants.dirOutputDev}" directory does not exist in the root directory.`, `${thisFilePath} => Line: 74`);
Constants.terminalError(`"${Constants.dirOutputDev}" directory does not exist in the root directory.`, `${thisFilePath} => Line: 78`);
return false;
}
} else {
Constants.terminalError(`Something went wrong on ${!nxStyleAsMinified ? '"getNxStyleAsMinifiedFromInputDir();"' : '"getNxScriptFromInputDir();"'}.`, `${thisFilePath} => Line: 78`);
Constants.terminalError(`Something went wrong on ${!nxStyleAsMinified ? '"getNxStyleAsMinifiedFromInputDir();"' : '"getNxScriptFromInputDir();"'}.`, `${thisFilePath} => Line: 82`);
return false;
}
};
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "notiflix",
"main": "dist/notiflix-aio-2.3.1.min.js",
"version": "2.3.1",
"main": "dist/notiflix-aio-2.3.2.min.js",
"version": "2.3.2",
"description": "Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more...",
"homepage": "https://github.com/notiflix/Notiflix",
"files": [
Expand Down Expand Up @@ -45,7 +45,7 @@
"babel-minify": "^0.5.1",
"clean-css": "^4.2.3",
"eslint": "^7.2.0",
"stylelint": "^13.6.0",
"stylelint": "^13.6.1",
"stylelint-config-standard": "^20.0.0"
},
"scripts": {
Expand Down
19 changes: 11 additions & 8 deletions src/all-in-one/notiflix-aio.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*!
* Notiflix ('https://www.notiflix.com')
* Version: 2.3.1
* Author: Furkan MT ('https://github.com/furcan')
* Copyright 2020 Notiflix, MIT Licence ('https://opensource.org/licenses/MIT')
* Notiflix ("https://www.notiflix.com")
* Description: Notiflix All In One contains the Notiflix CSS codes as internal to use the Notiflix as one file. This file has been created automatically from using the "notiflix.js", and "notiflix.css" files.
* Version: 2.3.2
* Author: Furkan MT ("https://github.com/furcan")
* Copyright 2020 Notiflix, MIT Licence ("https://opensource.org/licenses/MIT")
*/

/* global define */
Expand Down Expand Up @@ -1411,7 +1412,7 @@
// check the message off

} else {
notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) on the document.');
notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) in the document.');
return false;
}
// check the selector off
Expand Down Expand Up @@ -1554,13 +1555,15 @@
var removeBlockElements = function (eachOne) {
var timeout = setTimeout(function () {
// remove element
eachOne.remove();
if (eachOne.parentNode !== null) {
eachOne.parentNode.removeChild(eachOne);
}

// remove this selector internal style
var eachOneId = eachOne.getAttribute('id');
var eachOneStyle = window.document.getElementById('Style-' + eachOneId);
if (eachOneStyle) {
eachOneStyle.remove();
if (eachOneStyle && eachOneStyle.parentNode !== null) {
eachOneStyle.parentNode.removeChild(eachOneStyle);
}

// clear timeout
Expand Down
8 changes: 4 additions & 4 deletions src/notiflix.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* Notiflix ('https://www.notiflix.com')
* Version: 2.3.1
* Author: Furkan MT ('https://github.com/furcan')
* Copyright 2020 Notiflix, MIT Licence ('https://opensource.org/licenses/MIT')
* Notiflix ("https://www.notiflix.com")
* Version: 2.3.2
* Author: Furkan MT ("https://github.com/furcan")
* Copyright 2020 Notiflix, MIT Licence ("https://opensource.org/licenses/MIT")
*/

/* Notiflix: Notify wrap on */
Expand Down
18 changes: 10 additions & 8 deletions src/notiflix.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* Notiflix ('https://www.notiflix.com')
* Version: 2.3.1
* Author: Furkan MT ('https://github.com/furcan')
* Copyright 2020 Notiflix, MIT Licence ('https://opensource.org/licenses/MIT')
* Notiflix ("https://www.notiflix.com")
* Version: 2.3.2
* Author: Furkan MT ("https://github.com/furcan")
* Copyright 2020 Notiflix, MIT Licence ("https://opensource.org/licenses/MIT")
*/

/* global define */
Expand Down Expand Up @@ -1411,7 +1411,7 @@
// check the message off

} else {
notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) on the document.');
notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) in the document.');
return false;
}
// check the selector off
Expand Down Expand Up @@ -1554,13 +1554,15 @@
var removeBlockElements = function (eachOne) {
var timeout = setTimeout(function () {
// remove element
eachOne.remove();
if (eachOne.parentNode !== null) {
eachOne.parentNode.removeChild(eachOne);
}

// remove this selector internal style
var eachOneId = eachOne.getAttribute('id');
var eachOneStyle = window.document.getElementById('Style-' + eachOneId);
if (eachOneStyle) {
eachOneStyle.remove();
if (eachOneStyle && eachOneStyle.parentNode !== null) {
eachOneStyle.parentNode.removeChild(eachOneStyle);
}

// clear timeout
Expand Down

0 comments on commit b369236

Please sign in to comment.