Released on 2017-09-10
- Removed polyfill for
addEventListener
on IE8. dialog()
now returns aPromise
(no more callbacks) resolving to the result object (previously known asreturnObj
).- Renamed
vars
→data
, both in the options fordialog
and in thePromise
resolved object.
NB: These changes break compatibility with v2.x. Please read the new documentation for further details.
NB: This version drops support for older browsers and IE. Consider using polyfills for addEventListener
and Promise
for browsers not supporting them.
Released on 2017-07-14
returnObj.value
is correctly set toundefined
if a dialog is not of "prompt" type.- Renamed button classes (
dialog-continue-button
→dialog-continue-btn
,dialog-cancel-button
→dialog-cancel-btn
). - Removed unneeded
data-action
attributes on dialog buttons. - Simplified code (increased readability).
Released on 2017-02-18
- Minor bugfixes.
Released on 2015-10-18
- Reconception of the majority of the code.
- Uploaded the project on GitHub.
- Removed
data-*
attributes for styling, now using classes (refer to style.css file to see new classes used). - Renamed callBack → callback, which is now a reference to a function (with
returnObj
passed as first argument), not an executable string (noteval
anymore!). - Renamed returnObj.boolean → returnObj.action (same behavior).
- Title and content can't contain HTML anymore. However LF characters and whitespaces are preserved.
- Adding to the DOM only the visible elements (removed
display: none
hack). - Fixed a bug with the
keyup
event listener.
NB: These changes break compatibility with v1.x. Please read the new documentation for further details.
Released on 2012-13-09
- Fixed a problem with the XHTML syntax. Now the function works good both in HTML and XHTML, automatically.
Released on 2012-08-07
- This is the first version of the code, which includes the 3 objects
dialogSettings
,dialog()
andreturnObj
. - The code integrates the default stylesheet. The semitransparent background of the dialog doesn't work with IE < 9.
- When pressing enter the script will emulate the ok or continue button click, and the esc key will emulate the cancel button click when the cancel button is shown.