{"version":3,"sources":["jquery.dirtyforms.dialogs.bootstrap.js"],"names":["$","window","document","undefined","DirtyForms","dialog","title","proceedButtonClass","proceedButtonText","stayButtonClass","stayButtonText","dialogID","titleID","messageClass","preMessageText","postMessageText","replaceText","open","choice","message","$dialog","this","length","$bootstrapVersion4Dialog","append","data","find","html","bindEscKey","onContinueClick","proceed","choiceContinue","onHidden","e","isDF1","choiceCommit","commit","remove","off","on","modal","show","fire","bind","stash","refire","selector","jQuery"],"mappings":";;;;;CAMA,SAAWA,EAAGC,EAAQC,EAAUC,GAW5BH,EAAEI,WAAWC,OAAS,CAElBC,MAJc,oCAKdC,mBAAoB,gBACpBC,kBAAmB,kBACnBC,gBAAiB,aACjBC,eAAgB,YAChBC,SAAU,eACVC,QAAS,cACTC,aAAc,gBACdC,eAAgB,GAChBC,gBAAiB,GACjBC,aAAa,EAGbC,KAAM,SAAUC,EAAQC,GAEpB,IAAIC,EAAUpB,EAAE,IAAMqB,KAAKV,UAG3B,GAAuB,IAAnBS,EAAQE,OAAc,CAItB,IAAIC,EACAvB,EAAE,YAAcqB,KAAKV,SAAW,qEAAuEU,KAAKT,QAAU,iKAItES,KAAKT,QAAU,6KAGrBS,KAAKR,aAAe,8EAExBQ,KAAKd,mBAAqB,+EAC1Bc,KAAKZ,gBAAkB,iFAMjEW,EAAUG,EAIVvB,EAAE,QAAQwB,OAAOJ,GACZK,KAAK,sBAAsB,GAGhCJ,KAAKL,cAELI,EAAQM,KAAK,IAAML,KAAKT,SAASe,KAAKN,KAAKf,OAC3Cc,EAAQM,KAAK,IAAML,KAAKR,cAAcc,KAAKN,KAAKP,eAAiBK,EAAUE,KAAKN,iBAChFK,EAAQM,KAAK,IAAML,KAAKd,oBAAoBoB,KAAKN,KAAKb,mBACtDY,EAAQM,KAAK,IAAML,KAAKZ,iBAAiBkB,KAAKN,KAAKX,iBAIvDQ,EAAOU,YAAa,EAEpB,IAAIC,EAAkB,WAClBX,EAAOY,QAAU9B,EAAEI,WAAW2B,gBAAiB,GAE/CC,EAAW,SAAUC,IACRf,EAAOgB,MAAQlC,EAAEI,WAAW+B,aAAejB,EAAOkB,QACxDH,IACsC,IAAzCjC,EAAE,QAAQyB,KAAK,uBACfL,EAAQiB,UAIhBjB,EAAQM,KAAK,IAAML,KAAKd,oBAAoB+B,IAAI,QAAST,GAAiBU,GAAG,QAASV,GACtFT,EAAQkB,IAAI,kBAAmBN,GAAUO,GAAG,kBAAmBP,GAG/DZ,EAAQoB,MAAM,CAAEC,MAAM,KAI1BC,KAAM,SAAUvB,EAASb,GACrBe,KAAKf,MAAQA,EACbe,KAAKJ,KAAK,CAAEiB,OAAO,GAAQf,IAI/BwB,KAAM,aAENC,MAAO,WACH,OAAO,GAEXC,OAAQ,WACJ,OAAO,GAEXC,SAAU,SAxGlB,CA2GGC,OAAQ9C,OAAQC","file":"jquery.dirtyforms.dialogs.bootstrap.js","sourcesContent":["/*!\r\nBootstrap modal dialog (for jQuery Dirty Forms) | v2.0.0 | github.com/snikch/jquery.dirtyforms\r\n(c) 2015 Shad Storhaug\r\nLicense MIT\r\n*/\r\n\r\n(function ($, window, document, undefined) {\r\n // Can't use ECMAScript 5's strict mode because several apps \r\n // including ASP.NET trace the stack via arguments.caller.callee \r\n // and Firefox dies if you try to trace through \"use strict\" call chains. \r\n // See jQuery issue (#13335)\r\n // Support: Firefox 18+\r\n //\"use strict\";\r\n\r\n // Glyphicons don't exist in bootstrap v4, so decide if title needs it\r\n var dialogTitle = 'Are you sure you want to do that?';\r\n\r\n $.DirtyForms.dialog = {\r\n // Custom properties and methods to allow overriding (may differ per dialog)\r\n title: dialogTitle,\r\n proceedButtonClass: 'dirty-proceed',\r\n proceedButtonText: 'Leave This Page',\r\n stayButtonClass: 'dirty-stay',\r\n stayButtonText: 'Stay Here',\r\n dialogID: 'dirty-dialog',\r\n titleID: 'dirty-title',\r\n messageClass: 'dirty-message',\r\n preMessageText: '',\r\n postMessageText: '',\r\n replaceText: true,\r\n\r\n // Typical Dirty Forms Properties and Methods\r\n open: function (choice, message) {\r\n // Look for a pre-existing element with the dialogID.\r\n var $dialog = $('#' + this.dialogID);\r\n\r\n // If the user already added a dialog with this ID, skip doing it here\r\n if ($dialog.length === 0) {\r\n // NOTE: Buttons don't have the ignore class because Bootstrap 3 isn't compatible\r\n // with old versions of jQuery that don't properly cancel the click events.\r\n\r\n var $bootstrapVersion4Dialog =\r\n $('
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '' +\r\n '
' +\r\n '
' +\r\n '' +\r\n '
' +\r\n '
' +\r\n '
');\r\n\r\n $dialog = $bootstrapVersion4Dialog;\r\n\r\n // Append to the body so we can capture DOM events.\r\n // Flag the dialog for later removal.\r\n $('body').append($dialog)\r\n .data('df-dialog-appended', true);\r\n }\r\n\r\n if (this.replaceText) {\r\n // Replace the text in the dialog (whether it is external or not).\r\n $dialog.find('#' + this.titleID).html(this.title);\r\n $dialog.find('.' + this.messageClass).html(this.preMessageText + message + this.postMessageText);\r\n $dialog.find('.' + this.proceedButtonClass).html(this.proceedButtonText);\r\n $dialog.find('.' + this.stayButtonClass).html(this.stayButtonText);\r\n }\r\n\r\n // Bind the events\r\n choice.bindEscKey = false;\r\n\r\n var onContinueClick = function () {\r\n choice.proceed = $.DirtyForms.choiceContinue = true;\r\n };\r\n var onHidden = function (e) {\r\n var commit = choice.isDF1 ? $.DirtyForms.choiceCommit : choice.commit;\r\n commit(e);\r\n if ($('body').data('df-dialog-appended') === true) {\r\n $dialog.remove();\r\n }\r\n };\r\n // NOTE: Bootstrap 3 requires jQuery 1.9, so we can use on and off here.\r\n $dialog.find('.' + this.proceedButtonClass).off('click', onContinueClick).on('click', onContinueClick);\r\n $dialog.off('hidden.bs.modal', onHidden).on('hidden.bs.modal', onHidden);\r\n\r\n // Show the dialog\r\n $dialog.modal({ show: true });\r\n },\r\n\r\n // Support for Dirty Forms < 2.0\r\n fire: function (message, title) {\r\n this.title = title;//exclamationGlyphicon + title;\r\n this.open({ isDF1: true }, message);\r\n },\r\n\r\n // Support for Dirty Forms < 1.2\r\n bind: function () {\r\n },\r\n stash: function () {\r\n return false;\r\n },\r\n refire: function () {\r\n return false;\r\n },\r\n selector: 'no-op'\r\n };\r\n\r\n})(jQuery, window, document);"]}