From b0cbd9d9d6e109cf70e01361c1c2b051af06be63 Mon Sep 17 00:00:00 2001 From: ajile Date: Mon, 8 Aug 2016 19:17:25 +0300 Subject: [PATCH] Improvements --- README.md | 6 ++---- tests/dummy/app/templates/getting-started/partials/en.hbs | 2 ++ tests/dummy/app/templates/getting-started/partials/ru.hbs | 2 ++ .../examples/cookbook/creating-notices/example-1.javascript | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c3e37f6..7942899 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ember-dialog [![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/wheely/ember-dialog/blob/master/LICENSE.md) [![Build Status](https://travis-ci.org/wheely/ember-dialog.svg?branch=master)](https://travis-ci.org/wheely/ember-dialog) [![Code Climate](https://codeclimate.com/github/wheely/ember-dialog/badges/gpa.svg)](https://codeclimate.com/github/wheely/ember-dialog) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f364ecdab2f4486dbd15b198d5debf87)](https://www.codacy.com/app/ajile/ember-dialog?utm_source=github.com&utm_medium=referral&utm_content=wheely/ember-dialog&utm_campaign=Badge_Grade) -Old version (ember-cli-dialog and ember-dialog below v2) outdated and will not be supported. +A lightweight and powerful Ember Addon that allows you to easily create routable dialog windows and control their closing. It consists of a service that is available from any object and a component which is a dialog-window itself. -See Tutorials (with examples), Cookbook and Documentation. +With ember-dialog you can create any popups like dialogs, modals, notices, bubbles etc. We have decided do not include realization of all this features to the library for minification reasons. Instead of it we have written absolute documentation how you can make it your own (see cookbook and tutorial with examples). You can look the library's code on github and get surprised how much code on aboard to realize all features, presented on this site. ## Installation @@ -16,8 +16,6 @@ ember install ember-dialog -A lightweight and powerful Ember Addon that allows you to easily create *routable* dialog windows and control their closing. It consists of a service that is available from any object and a component which is a dialog-window itself. - The principle of work is simple. Service is instructed to display a modal window (`show`, `alert`, `confirm` or `blank` methods), creates a component instance with required layout and template, then renders it, and attaches it to the body. At this point, it also creates a Promise, "handles" of which puts into the component and returns it. The component has 2 actions on aboard: one for `resolved` closing, another one for `rejected` closing. Actions available within the template and can be called, for instance by clicking on the button (in the layout or in the template). When you call an action, one of the Promise's method is executed and triggered independent "accepted" or "declined" event. The dialog service when gets the event destroys component object and detaches it from the DOM. Let's say you want to ask user confirm an action. You should call `show` method of the dialog service with a layout path (you needed dialog window with two buttons - `confirm` layout what you need) and a path to template that you want to show the user in the modal window. Method creates and shows dialog window and returns a Promise, that will become resolved or rejected when window closed (it's depend on which button user has clicked). diff --git a/tests/dummy/app/templates/getting-started/partials/en.hbs b/tests/dummy/app/templates/getting-started/partials/en.hbs index d246ea9..f66302f 100644 --- a/tests/dummy/app/templates/getting-started/partials/en.hbs +++ b/tests/dummy/app/templates/getting-started/partials/en.hbs @@ -4,6 +4,8 @@

So how do they look like? See yourself: alert, confirm and blank.

+

With ember-dialog you can create any popups like dialogs, modals, notices, bubbles etc. We have decided do not include realization of all this features to the library for minification reasons. Instead of it we have written absolute documentation how you can make it your own (see {{#link-to 'cookbook'}}{{t "navigation.cookbook"}}{{/link-to}} and {{#link-to 'tutorial'}}{{t "navigation.tutorial"}}{{/link-to}}). You can look the library's code on github and get surprised how much code on aboard to realize all features, presented on this site.

+

Installation

Installing the library is as easy as:

diff --git a/tests/dummy/app/templates/getting-started/partials/ru.hbs b/tests/dummy/app/templates/getting-started/partials/ru.hbs index 6bedfc5..c898815 100644 --- a/tests/dummy/app/templates/getting-started/partials/ru.hbs +++ b/tests/dummy/app/templates/getting-started/partials/ru.hbs @@ -4,6 +4,8 @@

Сразу к делу, как они выглядят? Можете сами взглянуть: alert, confirm и blank.

+

С помощью ember-dialog вы можете создавать любые всплавающие интерфейсы: диалоговые окна, модалки, предупреждения, баблы и т.п. Для минимизации кода библиотеки мы не стали включать их реализацию в проект, но постарались максимально подробно описать как это сделать в вашем проекте (см. разделы {{#link-to 'cookbook'}}{{t "navigation.cookbook"}}{{/link-to}} и {{#link-to 'tutorial'}}{{t "navigation.tutorial"}}{{/link-to}}). Также вы можете заглянуть в код библиотеки, вы будете приятно удивлены тем, каким количеством кода обеспечены описанные на этом сайте возможности.

+

Установка

Установка аддона такая же простая как:

diff --git a/tests/dummy/public/examples/cookbook/creating-notices/example-1.javascript b/tests/dummy/public/examples/cookbook/creating-notices/example-1.javascript index d070b9f..35bf924 100644 --- a/tests/dummy/public/examples/cookbook/creating-notices/example-1.javascript +++ b/tests/dummy/public/examples/cookbook/creating-notices/example-1.javascript @@ -5,7 +5,7 @@ export default DialogManager.extend({ notice(template, context, options) { const layout = "cookbook/creating-notices/partials/notice"; - options = Ember.merge({ root: ".notices", delay: 2000 }, options); + options = Ember.merge({ root: ".notices", delay: 500 }, options); this.one("created", presenter => { Ember.run.later(presenter, "accept", options.delay)