Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edenreich/admin-message-bag-loader-javascript-plugin
For the admin panel, a messagebag, no jQuery needed.
https://github.com/edenreich/admin-message-bag-loader-javascript-plugin
Last synced: about 4 hours ago
JSON representation
For the admin panel, a messagebag, no jQuery needed.
- Host: GitHub
- URL: https://github.com/edenreich/admin-message-bag-loader-javascript-plugin
- Owner: edenreich
- Created: 2016-10-23T00:50:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-23T01:07:35.000Z (about 8 years ago)
- Last Synced: 2023-03-04T09:40:45.934Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Admin-Message-Bag-Loader-Javascript-Plugin
For the admin panel, a messagebag, no jQuery needed.##How To Use
just embed this js file in your project, and then when you want to run it type:
```javascript
AdminPanelLoader.start();
```normally you would start the loader before the ajax request is sent.
now, during the processing you may make your logic and collect either errors or success messages like so:
```javascript
AdminPanelLoader.addSuccessMessage('This is my custom success message');
AdminPanelLoader.addErrorMessage('This is my custom error message');
```then once the ajax request is done you want to list all the messages you collected to the user like so:
```javascript
AdminPanelLoader.listMessages();
```and of course dont forget to stop the loader before you display the messages like that:
```javascript
AdminPanelLoader.stop();
```you may also empty the collected messages like so:
```javascript
AdminPanelLoader.emptyMessages();
```