diff --git a/public/assets/js/bootstrap-confirm.js b/public/assets/js/bootstrap-confirm.js deleted file mode 100644 index 812042d..0000000 --- a/public/assets/js/bootstrap-confirm.js +++ /dev/null @@ -1,90 +0,0 @@ -(function($) { - $.fn.confirmModal = function(opts) - { - var body = $('body'); - var defaultOptions = { - confirmTitle : 'Please confirm', - confirmMessage : 'Are you sure you want to perform this action ?', - confirmOk : 'Yes', - confirmCancel : 'Cancel', - confirmDirection : 'rtl', - confirmStyle : 'primary', - confirmCallback : defaultCallback - }; - var options = $.extend(defaultOptions, opts); - var time = Date.now(); - - var headModalTemplate = - '' - ; - - return this.each(function(index) - { - var confirmLink = $(this); - var targetData = confirmLink.data(); - - var currentOptions = $.extend(options, targetData); - - var modalId = "confirmModal" + parseInt(time + index); - var modalTemplate = headModalTemplate; - var buttonTemplate = - '' + - '' - ; - - if(options.confirmDirection == 'ltr') - { - buttonTemplate = - '' + - '' - ; - } - - modalTemplate = modalTemplate. - replace('#buttonTemplate#', buttonTemplate). - replace('#modalId#', modalId). - replace('#AriaLabel#', options.confirmTitle). - replace('#Heading#', options.confirmTitle). - replace('#Body#', options.confirmMessage). - replace('#Ok#', options.confirmOk). - replace('#Cancel#', options.confirmCancel). - replace('#Style#', options.confirmStyle) - ; - - body.append(modalTemplate); - - var confirmModal = $('#' + modalId); - - confirmLink.on('click', function(modalEvent) - { - modalEvent.preventDefault(); - confirmModal.modal('show'); - - $('button[data-dismiss="ok"]', confirmModal).on('click', function(event) { - confirmModal.modal('hide'); - options.confirmCallback(confirmLink); - }); - }); - }); - - function defaultCallback(target) - { - window.location = $(target).attr('href'); - } - }; -})(jQuery); \ No newline at end of file