1.2.12 • Published 4 years ago

d1dialog v1.2.12

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

DEPRECATED - d1dialog

This is no longer maintained.
Please consider using d1-web instead.


Add-on for d1.
Replacement of standard Javascript dialogs: alert, confirm, prompt.
Demo & Docs

Install

npm install d1dialog

Usage

On page load call:

d1dialog.init(options);

In your markup:

  • Add alert class to a link for simple alert with one button.
  • Add dialog class to a link or form button for dialog with two buttons.
  • Add data-caption or title attribute to set text of dialog.
  • Add data-prompt attribute to specify URL argument for editing.
  • Add data-ok and data-cancel attributes to set custom button captions.
  • Add data-reverse attribute to reverse buttons order.
  • Add data-src attribute to specify selector of the input from which to take value for data-prompt.
    If that value is not empty then prompt is not shown.

Examples

Simple alert link

<a href="#ok" class="alert" title="Hi!">Show alert</a>

Simple link with confirmation

<a href="?action" class="dialog" title="Continue?">Confirm action</a>

Simple button with confirmation

<input type="submit" value="Submit" class="dialog" title="Confirm?">

Simple link with value prompt

<a href="?action=default" class="dialog" data-prompt="action" data-caption="Action:">Action prompt</a>

Options

argConfirm

Argument appended to URL when user confirms action.
Default: "confirm"

ccDialog

CSS class (classes) of dialog window element.
Default: "dlg pad c"

hashCancel

Hash of "close" and "cancel" links.
Default: "#cancel"

hashOk

Hash of "ok" link.
Default: "#ok"

idPrefix

Prefix of the id of dialog window element.
Default: "dlg"

Browser Support

  • IE 10+
  • Latest Stable: Chrome, Firefox, Opera, Safari

License

MIT

1.2.12

4 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.0

5 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago