{"version":3,"sources":["jquery.dirtyforms.dialogs.jquery-ui.min.js"],"names":["$","window","document","undefined","$dialog","append","DirtyForms","dialog","title","proceedButtonText","stayButtonText","preMessageText","postMessageText","width","open","choice","message","commit","isDF1","choiceCommit","this","parents","find","focus","close","modal","buttons","text","click","proceed","choiceContinue","html","onEscKey","e","which","preventDefault","unbind","keydown","fire","bind","stash","refire","selector","jQuery"],"mappings":";;;;;CAMA,SAAUA,EAAGC,EAAQC,EAAUC,GAS3B,GAAIC,GAAUJ,EAAE,gCAChBA,GAAE,QAAQK,OAAOD,GAEjBJ,EAAEM,WAAWC,QAETC,MAAO,oCACPC,kBAAmB,kBACnBC,eAAgB,YAChBC,eAAgB,yFAChBC,gBAAiB,GACjBC,MAAO,IAGPC,KAAM,SAAUC,EAAQC,GACpB,GAAIC,GAASF,EAAOG,MAAQlB,EAAEM,WAAWa,aAAeJ,EAAOE,MA8B/D,IA5BAb,EAAQG,QACJO,KAAM,WAEFd,EAAEoB,MAAMC,QAAQ,cAAcC,KAAK,sCAAsCC,SAE7EC,MAAOP,EACPT,MAAOY,KAAKZ,MACZK,MAAOO,KAAKP,MACZY,OAAO,EACPC,UAEQC,KAAMP,KAAKX,kBACXmB,MAAO,WACHb,EAAOc,QAAU7B,EAAEM,WAAWwB,gBAAiB,EAC/C9B,EAAEoB,MAAMb,OAAO,YAInBoB,KAAMP,KAAKV,eACXkB,MAAO,WACH5B,EAAEoB,MAAMb,OAAO,cAK/BH,EAAQ2B,KAAKX,KAAKT,eAAiBK,EAAUI,KAAKR,iBAG9CG,EAAOG,MAAO,CACd,GAAIc,GAAW,SAAUC,GACrB,MAAe,KAAXA,EAAEC,OACFD,EAAEE,iBACF/B,EAAQG,OAAO,UACR,GAHX,OASJP,GAAEE,GAAUkC,OAAO,UAAWJ,GAAUK,QAAQL,KAGxDR,MAAO,WACHpB,EAAQG,OAAO,UAInB+B,KAAM,SAAUtB,EAASR,GACrBY,KAAKZ,MAAQA,EACbY,KAAKN,MAAOI,OAAO,GAAQF,IAI/BuB,KAAM,aAENC,MAAO,WACH,OAAO,GAEXC,OAAQ,WACJ,OAAO,GAEXC,SAAU,UAGfC,OAAQ1C,OAAQC","file":"jquery.dirtyforms.dialogs.jquery-ui.min.js","sourceRoot":"/","sourcesContent":["/*!\njQuery UI dialog module (for jQuery Dirty Forms) | v2.0.0 | github.com/snikch/jquery.dirtyforms\n(c) 2015 Shad Storhaug\nLicense MIT\n*/\n\n(function($, window, document, undefined) {\n // Can't use ECMAScript 5's strict mode because several apps \n // including ASP.NET trace the stack via arguments.caller.callee \n // and Firefox dies if you try to trace through \"use strict\" call chains. \n // See jQuery issue (#13335)\n // Support: Firefox 18+\n //\"use strict\";\n\n // Create a local reference for simplicity\n var $dialog = $('
');\n $('body').append($dialog);\n\n $.DirtyForms.dialog = {\n // Custom properties and methods to allow overriding (may differ per dialog)\n title: 'Are you sure you want to do that?',\n proceedButtonText: 'Leave This Page',\n stayButtonText: 'Stay Here',\n preMessageText: '',\n postMessageText: '',\n width: 430,\n\n // Typical Dirty Forms Properties and Methods\n open: function (choice, message) {\n var commit = choice.isDF1 ? $.DirtyForms.choiceCommit : choice.commit;\n\n $dialog.dialog({\n open: function () {\n // Set the focus on close button\n $(this).parents('.ui-dialog').find('.ui-dialog-buttonpane button:eq(1)').focus();\n },\n close: commit,\n title: this.title,\n width: this.width,\n modal: true,\n buttons: [\n {\n text: this.proceedButtonText,\n click: function () {\n choice.proceed = $.DirtyForms.choiceContinue = true;\n $(this).dialog('close');\n }\n },\n {\n text: this.stayButtonText,\n click: function () {\n $(this).dialog('close');\n }\n }\n ]\n });\n $dialog.html(this.preMessageText + message + this.postMessageText);\n\n // Support for Dirty Forms < 2.0\n if (choice.isDF1) {\n var onEscKey = function (e) {\n if (e.which == 27) {\n e.preventDefault();\n $dialog.dialog('close');\n return false;\n }\n };\n\n // Trap the escape key and force a close. Cancel it so jQuery UI doesn't intercept it.\n // This will fire the dialogclose event to commit the choice (which defaults to false).\n $(document).unbind('keydown', onEscKey).keydown(onEscKey);\n }\n },\n close: function () {\n $dialog.dialog('close');\n },\n\n // Support for Dirty Forms < 2.0\n fire: function (message, title) {\n this.title = title;\n this.open({ isDF1: true }, message);\n },\n\n // Support for Dirty Forms < 1.2\n bind: function () {\n },\n stash: function () {\n return false;\n },\n refire: function () {\n return false;\n },\n selector: 'no-op'\n };\n\n})(jQuery, window, document);\n"]}