{I" class:ETI"ProcessedAsset; FI"logical_path; TI"confirm_with_reveal.js; FI" pathname; TI"c/Users/aaron/dev/push_type_split/admin/vendor/assets/javascripts/confirm_with_reveal.js.coffee; FI"content_type; TI"application/javascript; TI" mtime; Tl+bjˆTI"length; TiI"digest; TI"%c2e8c8e9225e49c55a3ca9da17383dd1; FI"source; TI"(function() { var $; $ = this.jQuery; $.fn.extend({ confirmWithReveal: function(options) { var defaults, do_confirm, handler, settings; if (options == null) { options = {}; } defaults = { modal_class: 'medium', title: 'Are you sure?', title_class: '', body: 'This action cannot be undone.', body_class: '', password: false, prompt: 'Type %s to continue:', footer_class: '', ok: 'Confirm', ok_class: 'button alert', cancel: 'Cancel', cancel_class: 'button secondary' }; settings = $.extend({}, defaults, options); do_confirm = function($el) { var confirm_button, confirm_html, confirm_label, el_options, modal, option, password, _ref; el_options = $el.data('confirm'); if (!el_options) { return true; } if ((typeof el_options === 'string') && (el_options.length > 0)) { return (((_ref = $.rails) != null ? _ref.confirm : void 0) || window.confirm).call(window, el_options); } option = function(name) { return el_options[name] || settings[name]; }; modal = $("
"); confirm_button = $el.is('a') ? $el.clone() : $(''); confirm_button.removeAttr('data-confirm').attr('class', option('ok_class')).html(option('ok')).on('click', function(e) { if ($(this).prop('disabled')) { return false; } $el.trigger('confirm.reveal', e); if ($el.is('form, :input')) { return $el.closest('form').removeAttr('data-confirm').submit(); } }); modal.find('[data-confirm-title]').html(option('title')); modal.find('[data-confirm-body]').html(option('body')); modal.find('[data-confirm-cancel]').html(option('cancel')).on('click', function(e) { modal.foundation('reveal', 'close'); return $el.trigger('cancel.reveal', e); }); modal.find('[data-confirm-footer]').append(confirm_button); if ((password = option('password'))) { confirm_label = (option('prompt')).replace('%s', password); confirm_html = ""; modal.find('[data-confirm-body]').after($(confirm_html)); modal.find('[data-confirm-password]').on('keyup', function(e) { var disabled; disabled = $(this).val() !== password; return confirm_button.toggleClass('disabled', disabled).prop('disabled', disabled); }).trigger('keyup'); } modal.appendTo($('body')).foundation().foundation('reveal', 'open').on('closed.fndtn.reveal', function(e) { return modal.remove(); }); return false; }; if ($.rails) { $.rails.allowAction = function(link) { return do_confirm($(link)); }; return $(this); } else { handler = function(e) { if (!(do_confirm($(this)))) { e.preventDefault(); return e.stopImmediatePropagation(); } }; return this.each(function() { var $el; $el = $(this); $el.on('click', 'a[data-confirm], :input[data-confirm]', handler); $el.on('submit', 'form[data-confirm]', handler); return $el; }); } } }); }).call(this); ; TI"dependency_digest; TI"%9900a0ddf90fffa7494bf4ada4ae13e7; FI"required_paths; T[I"c/Users/aaron/dev/push_type_split/admin/vendor/assets/javascripts/confirm_with_reveal.js.coffee; FI"dependency_paths; T[{I" path; TI"c/Users/aaron/dev/push_type_split/admin/vendor/assets/javascripts/confirm_with_reveal.js.coffee; FI" mtime; TI"2014-12-10T15:44:34+00:00; TI"digest; TI"%f7cc08eec60543ec2b7ac637fda92d0b; FI" _version; TI"%64e62ddc273c2f5847f30d698ca14b67; F