Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Mar 7, 2016
0 parents commit 5601119
Show file tree
Hide file tree
Showing 15 changed files with 1,255 additions and 0 deletions.
144 changes: 144 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Basic Usage
> toast is a UI that can be used as an alternative means of window.alert, window.confirm and window.prompt
## setConfig()
`setConfig([options])`
You define the default settings for the toast. Create a ax5.ui.toast instance, using the setConfig method in that instance, you can define a default value.

```js
var myToast = new ax5.ui.toast();
myToast.set_config({
msg: "String",
theme: "String",
width: "Number",
icon: "String",
closeIcon: "String",
onStateChanged: "Function",
displayTime: "Number",
animateTime: "Number",
containerPosition: "String",
lang: "Object"
});
```
**Easy Way - without setConfig**
```js
var myToast = new ax5.ui.toast({
msg: "String",
theme: "String",
width: "Number",
icon: "String",
closeIcon: "String",
onStateChanged: "Function",
displayTime: "Number",
animateTime: "Number",
containerPosition: "String",
lang: "Object"
});
```

### msg

Type: `String`

Title of toast.


### theme

Type: `String` [default: default]

Theme of toast, ax5toast themes using six colors defined by the bootstrap is provided.


### width

Type: `Number` [default: 300]

Toast width


### icon

Type: `String`


### closeIcon

Type: `String`


### onStateChanged

Type: `Function`

onStateChanged function is executed when the toast of the state is changed,
this.state state value is passed to this time onStateChanged function.


### displayTime

Type: `Number` [default : 3000]



### animateTime

Type: `Number` [default : 300]



### containerPosition

Type: `String` [top-left|top-right|bottom-left|bottom-right]



### lang

Type: `Object`

```js
myToast.setConfig({
lang: {
"ok": "확인"
}
});
```


- - -

## push()
`push(String|Options[, callBack])`

If this is String in the first argument and recognizes the first argument to `msg`.
it is possible to redefine all of the options that can be used in setConfig.

```js
toast.push('Toast message', function () {
console.log(this);
});

toast.push({
theme: 'danger',
msg:'Toast message'
}, function () {
console.log(this);
});
```

- - -

## confirm()
`confirm(String|Options[, callBack])`

```js
confirmToast.confirm({
msg: 'Confirm message'
}, function(){

});
```

## close()
`close()`
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) AXISJ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[![axisj-contributed](https://img.shields.io/badge/AXISJ.com-Contributed-green.svg)](https://github.com/axisj) ![](https://img.shields.io/badge/Seowoo-Mondo&Thomas-red.svg)

# ax5ui-toast

> *Dependencies*
> * _[jQuery 1.X+](http://jquery.com/)_
> * _[ax5core](http://ax5.io/ax5core)_
> * _[bootstrap](http://getbootstrap.com/)_

### Install by bower
```sh
bower install ax5ui-toast
```
[bower](http://bower.io/#install-bower) is web front-end package manager.
using the `bower`, when you install the plug-in is installed to resolve the plug-in dependencies under the `bower_components` folder.
(You can change the folder location. [.bowerrc](http://bower.io/docs/config/#bowerrc-specification) )

It is recommended that you install by using the `bower`.
If you've never used a bower is, you will be able to be used for [http://bower.io/#install-bower](http://bower.io/#install-bower).

### Download code
- [ax5core Github releases](https://github.com/ax5ui/ax5core/releases)
- [ax5ui-toast Github releases](https://github.com/ax5ui/ax5ui-toast/releases)


### Insert the "ax5toast" in the HTML HEAD.

Location of the folder can be determined freely in your project. But be careful not to accidentally caused
exactly the path.
```html
<html>
<head>
<link rel="stylesheet" type="text/css" href="bower_components/ax5ui-toast/dist/ax5toast.css" />
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/ax5core/dist/ax5core.min.js"></script>
<script type="text/javascript" src="bower_components/ax5ui-toast/dist/ax5toast.min.js"></script>
</head>
<body>
....
</body>
</html>
```

### Basic Usages
```js
var myToast = new ax5.ui.toast({
icon: '<i class="fa fa-bug"></i>',
containerPosition: "bottom-right",
closeIcon: '<i class="fa fa-times"></i>'
});

myToast.push('Toast message');
```

- - -

### Install by npm
If you do not use the bower, it can be downloaded by using the npm as second best.
In npm, so pile on the package manager for the front end, you need to solve the problem of plug-in dependencies.

```sh
npm install jquery
npm install ax5core
npm install ax5ui-toast
```

After you download the file in npm install, you will need to copy to the location where you want to use as a resource for the project.
If the inconvenience in the process that you want to copy the file and can be easily copied by using a `gulp` or `grunt`.

- - -


### Preview
- [See Demostration](http://ax5.io/ax5ui-toast/demo/index.html)

If you have any questions, please refer to the following [gitHub](https://github.com/ax5ui/ax5ui-kernel)
26 changes: 26 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ax5ui-toast",
"version": "0.2.0",
"authors": [
"ThomasJ <[email protected]>"
],
"description": "",
"main": "dist/ax5toast.js",
"keywords": [
"bootstrap",
"jquery",
"ax5ui",
"plugin",
"bootstrap jQuery plugins",
"toast",
"ax5ui-toast",
"javascript ui"
],
"dependencies": {
"jquery": "^1.11.0",
"ax5core": ">=0.4.0",
"bootstrap": "^3.3.6"
},
"license": "MIT",
"homepage": "ax5.io"
}
1 change: 1 addition & 0 deletions dist/ax5toast.css

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

Loading

0 comments on commit 5601119

Please sign in to comment.