/*!
PNotify dialog module (for jQuery Dirty Forms) | v2.0.0 | github.com/snikch/jquery.dirtyforms
(c) 2015 Shad Storhaug
License MIT
*/
(function($, window, document, undefined) {
// Can't use ECMAScript 5's strict mode because several apps
// including ASP.NET trace the stack via arguments.caller.callee
// and Firefox dies if you try to trace through "use strict" call chains.
// See jQuery issue (#13335)
// Support: Firefox 18+
//"use strict";
var modal_overlay,
notice,
isPN1 = typeof PNotify !== 'function';
$.DirtyForms.dialog = {
// Custom properties and methods to allow overriding (may differ per dialog)
title: 'Are you sure you want to do that?',
class: 'dirty-dialog',
proceedButtonText: 'Leave This Page',
stayButtonText: 'Stay Here',
styling: 'bootstrap3',
width: '330',
// Typical Dirty Forms Properties and Methods
open: function (choice, message, ignoreClass) {
var content = $.extend(true, {}, {
title: this.title,
hide: false,
styling: this.styling,
width: this.width,
// 3.x and 2.x confirm buttons
confirm: {
confirm: true,
align: 'center',
buttons: [
{
text: this.proceedButtonText,
addClass: 'dirty-proceed ' + ignoreClass
},
{
text: this.stayButtonText,
addClass: 'dirty-stay ' + ignoreClass
}
]
},
// 3.x don't use history
history: {
history: false
},
// 3.x modal dialog
addclass: 'stack-modal ' + this.class,
stack: { 'dir1': 'down', 'dir2': 'right', 'modal': true },
// 3.x and 2.x hide closer and sticker
buttons: {
closer: false,
sticker: false
},
// 1.x hide closer and sticker
closer: false,
sticker: false,
// NOTE: Animate does not seem to work in 3.x in conjunction with confirm,
// but this is being added so the settings can be supplied externally should
// this issue be fixed. https://github.com/sciactive/pnotify/issues/224
animate: this.animate === undefined ? undefined : this.animate,
text: !isPN1 ? message :
'' +
' ' + message + '