Giter Site home page Giter Site logo

dialogs's Introduction

Dialogs

Dialogs for web and mobile

Dependency

jQuery

Usage

Simple and beautiful.

Install

Using bower

bower install geidsonbc/dialogs --save

or npm

npm install dialogsjs

or yarn

yarn add dialogsjs

Setup

Include:

<script src="{your-url}/dialogs.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="{your-url}/dialogs.min.css">

Methods

  1. dialog.waiting('Message');

  2. dialog.confirm('Title', 'Message', function(){ // confirm }, function(){ // cancel });

  3. dialog.prompt('Title', 'Message', 'Label', 'Selector', function(){ // done }, function(){ // cancel });

  4. dialog.modal('Title', 'Message', function(){ ... });

  5. dialog.info('Title', 'Message', function(){ ... });

  6. dialog.help('Title', 'Message', { class: ..., func: ... });

  7. dialog.menu('Title', [{ value: ..., label: ... }, ... ], function(e){ ... } );

  8. dialog.close('Type');

Examples

  1. Info
dialog.info('Titulo', 'Corpo', function() {
	alert('callback');
});
  1. Confirm
dialog.confirm({
	title: 'Titulo',
	message: 'Corpo',
	confirm: {
		label: 'SIM',
		event: function() {
			alert('callback');
		}
	},
	cancel: {
		label: 'NÃO',
		event: function() {
			alert('callback');
		}
	}
});
  1. Menu
dialog.menu('Title', 
	[
		{
			value: '1',
			label: 'Opção 1'
		},

		{
			value: '2',
			label: 'Opção 2'
		}
	], 

	function (e) {
		var value = $(e.currentTarget).data('value');

		alert("Callback ao clicar na opção de valor " + value);
	}
);

Contributing

  1. Fork it!
  2. Create a new branch
  3. Commit your changes
  4. Push to the branch
  5. Submit a pull request :D

License

Licensed under the MIT License.

dialogs's People

Contributors

geidsonc avatar leandrow avatar o-leolleo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dialogs's Issues

Yarn

Por que não submeter o projeto para o npm para que utilizemos via yarn?

Dialogs width

Please, add a feature to select the modal size. Like a parameter in the configuration object.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.