/*! Bootstrap modal dialog (for jQuery Dirty Forms) | v2.0.0-beta00004 | github.com/snikch/jquery.dirtyforms (c) 2015 Shad Storhaug License MIT */ // Support for UMD: https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js // This allows for tools such as Browserify to compose the components together into a single HTTP request. (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS module.exports = factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var exclamationGlyphicon = ' '; $.DirtyForms.dialog = { // Custom properties and methods to allow overriding (may differ per dialog) title: exclamationGlyphicon + 'Are you sure you want to do that?', proceedButtonClass: 'dirty-proceed', proceedButtonText: 'Leave This Page', stayButtonClass: 'dirty-stay', stayButtonText: 'Stay Here', dialogID: 'dirty-dialog', titleID: 'dirty-title', messsageClass: 'dirty-message', preMessageText: '', postMessageText: '', replaceText: true, // Typical Dirty Forms Properties and Methods open: function (choice, message) { // Look for a pre-existing element with the dialogID. var $dialog = $('#' + this.dialogID); // If the user already added a dialog with this ID, skip doing it here if ($dialog.length === 0) { // NOTE: Buttons don't have the ignore class because Bootstrap 3 isn't compatible // with old versions of jQuery that don't properly cancel the click events. $dialog = $('