# j-Notify

> j-Notify: błędy są przetwarzane automatycznie

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: pl
Content-SHA256: fd51d31e1f3a5c1a86ebfdff2dba1ef4589e6e24afb7a833eaf486056a06ee14
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__Konfiguracja__:

- `timeout {Number}` musi zawierać czas wygaśnięcia (milisekundy) do upływu powiadomienia (default: `3000`)
- `position {String}` może być `top`, `top left`, `top right` (default), `bottom`, `bottom left` i `bottom right`

__Metody__:

```js
SETTER('notify/warning', 'Some warning');
SETTER('notify/success', 'Some success message');
SETTER('notify/info', 'Some info message');
```

__Praca z asystentem__:

- Błędy są automatycznie popełnione

```js
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully', function(response) {
	console.log(response);
}));

// Or with a callback and without notify
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', function(response) {
	console.log(response);
}));

// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Your message', '?.response'));
```

Użyj go z `<ui-component name="notify">`Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu `DEF.fallback` (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

```html example.html
<style>
	body { font-family: Arial; background-color: #F5F5F5; }
</style>

<ui-component name="notify"></ui-component>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia harum accusamus debitis aut sunt, deserunt magni alias neque unde reprehenderit ipsa ea laboriosam eveniet! Distinctio pariatur sed, a aut nobis.

<script>
	setTimeout(function() {
		SETTER('notify/success', 'This is "success" message.');
	}, 1000);

	setTimeout(function() {
		SETTER('notify/warning', 'This is "warning" message.', 2);
	}, 2000);

	setTimeout(function() {
		SETTER('notify/info', 'This is "info" message.', 3);
	}, 3000);
</script>
```
