-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb0c0e6
commit 06e8961
Showing
18 changed files
with
521 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<h1>sweet-alert <small>1.1.2</small></h1> | ||
![logo](https://sweetalert2.github.io/images/swal2-logo.png) | ||
<h1>sweet-alert <small>2.0.0</small></h1> | ||
|
||
<h4>By <strong>Rashid Ali</strong></h4> | ||
|
||
> A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, | ||
ZERO DEPENDENCIES | ||
<p> | ||
A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL | ||
</p> | ||
|
||
|
||
[GitHub](https://github.com/realrashid/sweet-alert) | ||
[Get Started](/README) | ||
[Get Started](/readme) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
* Getting started | ||
|
||
* [Installation](sweet-alert/install.md) | ||
* [Configuration](sweet-alert/config.md) | ||
* [Usage](sweet-alert/usage?id=usage) | ||
* [Helpers](sweet-alert/helpers?id=helpers) | ||
* [Middleware](sweet-alert/middleware?id=middleware) | ||
* [Demo](sweet-alert/demo) | ||
* [Installation](install.md) | ||
* [Configuration](config.md) | ||
* [Environment Variables](environment.md) | ||
* [Usage](usage?id=usage) | ||
* [Middleware](middleware?id=middleware) | ||
* [Helpers](helpers?id=helpers) | ||
* [Demo](demo) | ||
* [Changelog](changelog) | ||
|
||
* [Credits](sweet-alert/credits.md) | ||
* Video Tutorial | ||
* [Tutorial](tutorial.md) | ||
* Credits | ||
* [Credits](credits.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
;(function(window) { | ||
window.Carbon = { | ||
scriptEl: null, | ||
create: function() { | ||
return function(hook, vm) { | ||
hook.ready(function() { | ||
window.Carbon.injectCarbonStyle(); | ||
}) | ||
|
||
hook.doneEach(function () { | ||
window.Carbon.injectCarbonContainer(); | ||
}) | ||
} | ||
}, | ||
|
||
injectCarbonContainer() { | ||
let nav = document.getElementsByClassName('sidebar-nav') | ||
let carbonContainer = document.createElement('script') | ||
carbonContainer.src = '//cdn.carbonads.com/carbon.js?serve=CK7ICKQI&placement=realrashidgithubio' | ||
carbonContainer.id = '_carbonads_js' | ||
nav[0].insertBefore(carbonContainer, nav[0].firstChild) | ||
|
||
if (document.getElementsByClassName('carbonads').length === 0) { | ||
window._carbon && window._carbon.serve(); | ||
} | ||
}, | ||
|
||
injectCarbonStyle() { | ||
var carbonCss = document.createElement('style'); | ||
window.Carbon.injectCarbonContainer(); | ||
var css = '#carbonads{font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,sans-serif}#carbonads{display: flex;max-width: 330px;background-color: hsl(0, 0%, 98%);box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1)}#carbonads a{color: inherit;text-decoration: none}#carbonads a:hover{color: inherit}#carbonads span{position: relative;display: block;overflow: hidden}#carbonads .carbon-wrap{display: flex}.carbon-img{display: block;margin: 0;line-height: 1}.carbon-img img{display: block}.carbon-text{font-size: 13px;padding: 10px;line-height: 1.5;text-align: left}.carbon-poweredby{display: block;padding: 8px 10px;background: repeating-linear-gradient(-45deg,transparent,transparent 5px,hsla(0, 0%, 0%, 0.025) 5px,hsla(0, 0%, 0%, 0.025) 10px)hsla(203, 11%, 95%, 0.4);text-align: center;text-transform: uppercase;letter-spacing: 0.5px;font-weight: 600;font-size: 9px;line-height: 1}'; | ||
|
||
carbonCss.type = 'text/css'; | ||
if (carbonCss.styleSheet){ | ||
carbonCss.styleSheet.cssText = css; | ||
} else { | ||
carbonCss.appendChild(document.createTextNode(css)); | ||
} | ||
document.head.appendChild(carbonCss); | ||
} | ||
} | ||
})(window) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Changelog | ||
|
||
All notable changes to `sweet-alert` will be documented in this file. | ||
|
||
## v2.0 - 2019-06-14 | ||
- Upgraded SweetAlert2 to latest version | ||
- Added width() helper method | ||
- Added padding() helper method | ||
- Added background() helper method | ||
- Added animation() helper method | ||
- Added focusConfirm() helper method | ||
- Added focusCancel() helper method | ||
- Added CDN Support | ||
- Docs Updated | ||
- Fix some bugs | ||
|
||
Changes | ||
```php | ||
// From | ||
public function toast($title = '', $type = '', $position = 'bottom-right'){...} | ||
// To | ||
public function toast($title = '', $type = ''){...} | ||
|
||
// set the default position in package config file or use the helper method position() | ||
``` | ||
|
||
## v1.1.2 - 2019-03-29 | ||
- Upgraded SweetAlert2 to latest version | ||
- Added hideCloseButton() helper method | ||
- Added reverseButtons() helper method | ||
- Added image() method | ||
- Added addImage() helper method | ||
- Added position() helper method | ||
- Docs Updated | ||
- Fix some bugs | ||
|
||
## v1.1.1 - 2018-03-25 | ||
Added some new methods | ||
- `alert() method` | ||
- `alert()->success() method` | ||
- `alert()->info() method` | ||
- `alert()->wanring() method` | ||
- `alert()->question() method` | ||
- `alert()->error() method` | ||
- `alert()->html() method` | ||
- `toast() method` | ||
- `showConfirmButton() helper method` | ||
- `showCloseButton() helper method` | ||
- `showCancelButton() helper method` | ||
- `persistent() helper method` | ||
- `autoClose() helper method` | ||
- `toToast() helper method` | ||
- `footer() helper method` | ||
|
||
## v1.0 - 2018-03-25 | ||
- Deprecated | ||
|
||
## v1.0 - 2017-09-02 | ||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,35 @@ | ||
# Configuration | ||
|
||
> Optional in Laravel 5.5 or above | ||
### Include SweetAlert 2 View | ||
|
||
After installing the sweet-alert package, register the | ||
in your master layout | ||
|
||
```php | ||
RealRashid\SweetAlert\SweetAlertServiceProvider::class | ||
@include('sweetalert::alert') | ||
``` | ||
in your `config/app.php` configuration file: | ||
|
||
```php | ||
'providers' => [ | ||
// Other service providers... | ||
and run the below command to publish the package assets. | ||
|
||
RealRashid\SweetAlert\SweetAlertServiceProvider::class, | ||
], | ||
```bash | ||
php artisan vendor:publish --provider="RealRashid\SweetAlert\SweetAlertServiceProvider" | ||
``` | ||
|
||
Also, add the `Alert` facade to the `aliases` array in your `app` configuration file: | ||
> note: The javascript library of sweetalert2 is already loaded and included in the view with the help of above command! | ||
```php | ||
'Alert' => RealRashid\SweetAlert\Facades\Alert::class, | ||
``` | ||
|
||
# Include SweetAlert 2 View | ||
|
||
in your master layout | ||
!> If you don't want to use pre-loaded **sweetalert.all.js** so you can use cdn. | ||
Just chnage the below .env key. | ||
|
||
```php | ||
@include('sweetalert::alert') | ||
// By Default its true | ||
// Turn it to false | ||
SWEET_ALERT_LOCAL=false | ||
// Add sweetalert2 cdn link | ||
SWEET_ALERT_CDN='' | ||
``` | ||
!> You can not use local **sweetalert.all.js** or cdn together! | ||
|
||
and run the below command to publish the sweetalert.all.js in your public assets. | ||
|
||
```bash | ||
php artisan vendor:publish --provider="RealRashid\SweetAlert\SweetAlertServiceProvider" | ||
ex: | ||
```php | ||
SWEET_ALERT_LOCAL=true | ||
SWEET_ALERT_CDN='link' | ||
``` | ||
|
||
> note: the javascript library of sweetalert.all.js is already loaded in above included view | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Credits | ||
# Credits | ||
|
||
* [SweetAlert2](https://github.com/sweetalert2/sweetalert2) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.