Skip to content

Commit 263924a

Browse files
committed
many optimizations in the project
1 parent 400f397 commit 263924a

File tree

10 files changed

+95
-37
lines changed

10 files changed

+95
-37
lines changed

README.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,33 @@ Here's a simple example of how to use AvalynxLoader in your project:
1818

1919
## Installation
2020

21-
To use AvalynxLoader in your project, you can directly include it in your HTML file.
21+
To use AvalynxLoader in your project, you can directly include it in your HTML file. Ensure you have Bootstrap 5.3 or higher included in your project for AvalynxLoader to work correctly.
2222

23-
Include AvalynxLoader:
23+
First, include Bootstrap:
24+
25+
```html
26+
<!-- Bootstrap -->
27+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/css/bootstrap.min.css" rel="stylesheet">
28+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/js/bootstrap.bundle.min.js"></script>
29+
```
30+
31+
Then, include AvalynxLoader:
2432

2533
```html
2634
<script src="path/to/avalynx-loader.js"></script>
2735
```
2836

2937
Replace `path/to/avalynx-loader.js` with the actual path to the file in your project.
3038

31-
## Installation via jsDelivr
39+
## Installation via jsDelivr ([Link](https://cdn.jsdelivr.net/npm/avalynx-loader/))
3240

3341
AvalynxLoader is also available via [jsDelivr](https://www.jsdelivr.com/). You can include it in your project like this:
3442

3543
```html
36-
<script src="https://cdn.jsdelivr.net/npm/avalynx-loader/dist/avalynx-loader.js"></script>
44+
<script src="https://cdn.jsdelivr.net/npm/avalynx-loader@0.0.1/dist/js/avalynx-loader.min.js"></script>
3745
```
3846

39-
## Installation via NPM
47+
## Installation via NPM ([Link](https://www.npmjs.com/package/avalynx-loader))
4048

4149
AvalynxLoader is also available as a npm package. You can add it to your project with the following command:
4250

@@ -62,6 +70,24 @@ After installing, you can import AvalynxLoader into your JavaScript file like th
6270
import { AvalynxLoader } from 'avalynx-loader';
6371
```
6472

73+
Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxLoader displays correctly.
74+
75+
## Installation via Composer ([Link](https://packagist.org/packages/avalynx/avalynx-loader))
76+
77+
AvalynxLoader is also available as a Composer package. You can add it to your project with the following command:
78+
79+
```bash
80+
composer require avalynx/avalynx-loader
81+
```
82+
83+
After installing, you can import AvalynxLoader into your HTML file like this:
84+
85+
```html
86+
<script src="vendor/avalynx/avalynx-loader/dist/js/avalynx-loader.js"></script>
87+
```
88+
89+
Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxLoader displays correctly.
90+
6591
## Usage
6692

6793
To use AvalynxLoader in your project, include the AvalynxLoader JavaScript file in your project and initialize the class with the appropriate selector.
@@ -77,11 +103,11 @@ myLoader.load=false;
77103

78104
AvalynxLoader allows the following options for customization:
79105

80-
- `selector`: A custom selector for targeting tables within the DOM (default: `.avalynx-loader`).
106+
- `selector`: A custom selector for targeting tables within the DOM (default: `'.avalynx-loader'`).
81107
- `options`: An object containing the following keys:
82-
- `className`: (string) A custom class name for the loader element (default: `spinner-border text-primary`).
108+
- `className`: (string) A custom class name for the loader element (default: `'spinner-border text-primary'`).
83109
- `language` An object containing the following keys:
84-
- `loaderText`: (string) A custom text for the loader element (default: `Loading...`). If set to empty string, no text will be displayed.
110+
- `loaderText`: (string) A custom text for the loader element. If set to empty string, no text will be displayed. (default: `'Loading...'`).
85111

86112
## Contributing
87113

composer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "avalynx/avalynx-loader",
3+
"description": "AvalynxLoader is a lightweight JavaScript library designed to provide a loading overlay for DOM elements. Based on Bootstrap >=5.3 without any framework dependencies.",
4+
"keywords": [
5+
"avalynx",
6+
"loader",
7+
"bootstrap",
8+
"bootstrap5",
9+
"component",
10+
"ajax",
11+
"spinner"
12+
],
13+
"homepage": "https://github.com/avalynx/avalynx-loader",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Juergen Schwind an the AvalynxLoader authors",
18+
"homepage": "https://github.com/avalynx/avalynx-loader/graphs/contributors"
19+
}
20+
],
21+
"require": {
22+
"twbs/bootstrap": "^5.3"
23+
},
24+
"repositories": [
25+
{
26+
"type": "vcs",
27+
"url": "https://github.com/avalynx/avalynx-loader.git"
28+
}
29+
]
30+
}

dist/js/avalynx-loader.esm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* @repository https://github.com/avalynx/avalynx-loader.git
1111
* @bugs https://github.com/avalynx/avalynx-loader/issues
1212
*
13-
* @param {string} selector - The selector for the element(s) to update.
14-
* @param {object} options - Options for the loader.
15-
* @param {string} options.className - The class name for the loader spinner.
16-
* @param {object} language - Language settings for the loader.
17-
* @param {string} language.loaderText - The text to display with the loader spinner.
13+
* @param {string} selector - A custom selector for targeting tables within the DOM (default: '.avalynx-loader').
14+
* @param {object} options - An object containing the following keys:
15+
* @param {string} options.className - A custom class name for the loader element (default: 'spinner-border text-primary').
16+
* @param {object} language - An object containing the following keys:
17+
* @param {string} language.loaderText - A custom text for the loader element. If set to empty string, no text will be displayed. (default: 'Loading...').
1818
*
1919
*/
2020

dist/js/avalynx-loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* @repository https://github.com/avalynx/avalynx-loader.git
1111
* @bugs https://github.com/avalynx/avalynx-loader/issues
1212
*
13-
* @param {string} selector - The selector for the element(s) to update.
14-
* @param {object} options - Options for the loader.
15-
* @param {string} options.className - The class name for the loader spinner.
16-
* @param {object} language - Language settings for the loader.
17-
* @param {string} language.loaderText - The text to display with the loader spinner.
13+
* @param {string} selector - A custom selector for targeting tables within the DOM (default: '.avalynx-loader').
14+
* @param {object} options - An object containing the following keys:
15+
* @param {string} options.className - A custom class name for the loader element (default: 'spinner-border text-primary').
16+
* @param {object} language - An object containing the following keys:
17+
* @param {string} language.loaderText - A custom text for the loader element. If set to empty string, no text will be displayed. (default: 'Loading...').
1818
*
1919
*/
2020

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.9"
21
services:
32
web:
43
build: ./docker/web
@@ -18,4 +17,4 @@ services:
1817
- PHP_MEMORY_LIMIT=512M
1918
- PHP_MAX_EXECUTION_TIME=300
2019
- PHP_POST_MAX_SIZE=100M
21-
- PHP_UPLOAD_MAX_FILESIZE=100M
20+
- PHP_UPLOAD_MAX_FILESIZE=100M

examples/loader-for-2-elements.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<script>hljs.highlightAll();</script>
1818

1919
<!-- AvalynxLoader 0.0.1 -->
20-
<script src="../dist/js/avalynx-loader.js"></script>
20+
<script src="https://cdn.jsdelivr.net/npm/avalynx-loader@0.0.1/dist/js/avalynx-loader.min.js"></script>
2121

2222
<!-- Example helper -->
2323
<link href="./css/helper.css" rel="stylesheet">

examples/loader-for-3-elements-with-load-button.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9/build/styles/stackoverflow-light.min.css" id="hljsTheme">
1717
<script>hljs.highlightAll();</script>
1818

19-
<!-- AvalynxLoader 0.0.1 -->
20-
<script src="../dist/js/avalynx-loader.js"></script>
19+
<!-- AvalynxLoader 0.0.1 -->
20+
<script src="https://cdn.jsdelivr.net/npm/avalynx-loader@0.0.1/dist/js/avalynx-loader.min.js"></script>
2121

2222
<!-- Example helper -->
2323
<link href="./css/helper.css" rel="stylesheet">

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
],
1313
"keywords": [
1414
"avalynx",
15-
"ref",
16-
"vue",
17-
"react"
15+
"loader",
16+
"bootstrap",
17+
"bootstrap5",
18+
"component",
19+
"ajax",
20+
"spinner"
1821
],
1922
"ignore": [
2023
"package.json"
2124
],
2225
"author": {
23-
"name": "Juergen Schwind an the avalynx-loader Authors",
26+
"name": "Juergen Schwind an the AvalynxLoader Authors",
2427
"url": "https://github.com/avalynx/avalynx-loader/graphs/contributors"
2528
},
2629
"homepage": "https://github.com/avalynx/",

src/js/avalynx-loader.esm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* @repository https://github.com/avalynx/avalynx-loader.git
1111
* @bugs https://github.com/avalynx/avalynx-loader/issues
1212
*
13-
* @param {string} selector - The selector for the element(s) to update.
14-
* @param {object} options - Options for the loader.
15-
* @param {string} options.className - The class name for the loader spinner.
16-
* @param {object} language - Language settings for the loader.
17-
* @param {string} language.loaderText - The text to display with the loader spinner.
13+
* @param {string} selector - A custom selector for targeting tables within the DOM (default: '.avalynx-loader').
14+
* @param {object} options - An object containing the following keys:
15+
* @param {string} options.className - A custom class name for the loader element (default: 'spinner-border text-primary').
16+
* @param {object} language - An object containing the following keys:
17+
* @param {string} language.loaderText - A custom text for the loader element. If set to empty string, no text will be displayed. (default: 'Loading...').
1818
*
1919
*/
2020

src/js/avalynx-loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* @repository https://github.com/avalynx/avalynx-loader.git
1111
* @bugs https://github.com/avalynx/avalynx-loader/issues
1212
*
13-
* @param {string} selector - The selector for the element(s) to update.
14-
* @param {object} options - Options for the loader.
15-
* @param {string} options.className - The class name for the loader spinner.
16-
* @param {object} language - Language settings for the loader.
17-
* @param {string} language.loaderText - The text to display with the loader spinner.
13+
* @param {string} selector - A custom selector for targeting tables within the DOM (default: '.avalynx-loader').
14+
* @param {object} options - An object containing the following keys:
15+
* @param {string} options.className - A custom class name for the loader element (default: 'spinner-border text-primary').
16+
* @param {object} language - An object containing the following keys:
17+
* @param {string} language.loaderText - A custom text for the loader element. If set to empty string, no text will be displayed. (default: 'Loading...').
1818
*
1919
*/
2020

0 commit comments

Comments
 (0)