PATH:
home
/
lab2454c
/
tripvare.com
/
public
/
js
(function ($) { $(document).ready(function () { var bootstrapCore = { bootstrapLoader: '<i class="fa fa-circle-o-notch fa-spin"></i>', showLoader: true, currentNode: '', requestType: 'POST', requestFormat: 'json', requestWithEncType: false, requestFormData: '', formResetOnSuccess: true, pageReaload: false, toastPosition: 'bottom-right', toastTextAlign: 'left', toastHideAfter: 10000, updateInfoStatus: false, redirectUrlAfterRequestComplete: '', currentListingPage: '', init: () => { //--- Login $('.frm-auth').on('submit', e => { e.preventDefault() bootstrapCore.currentNode = $(e.currentTarget) bootstrapCore.currentNode.find('button').attr('disabled', true).prepend(bootstrapCore.bootstrapLoader) bootstrapCore.ajaxReqSetup() bootstrapCore.makeAjaxReq() }) if($(".travel_ready").length){ if(($("input:radio[class='travel_ready']").is(":checked")) && $('input[class="travel_ready"]:checked').val() == 1) { $(".travel_frm_data").find('input').attr('required',true) $(".travel_frm_data").find('textarea').attr('required',true) $(".middle_name_travel").attr('required',false) } } $(".corporate__industry_type").change(function(){ if($(this).val() == 'other'){ $(".industry_type_other").attr('required',true) $(".industry_type_other_wrap").show() }else{ $(".industry_type_other").attr('required',false).val('') $(".industry_type_other_wrap").hide() } }) $(".travel_ready").on('click', function(){ if(($("input:radio[class='travel_ready']").is(":checked")) && $('input[class="travel_ready"]:checked').val() == 1) { $(".travel_frm_data").show(); $(".travel_frm_data").find('input').attr('required',true) $(".travel_frm_data").find('textarea').attr('required',true) $(".middle_name_travel").attr('required',false) }else{ $(".travel_frm_data").hide(); $(".travel_frm_data").find('input').attr('required',false).val('') $(".travel_frm_data").find('textarea').attr('required',false).val('') } }) if($('.navbar').length){ $(window).scroll(function () { if ($(document).scrollTop() > 50) { $('.navbar').addClass('shrink') $('.add').hide() } else { $('.navbar').removeClass('shrink') $('.add').show() } }) } $("form").submit(function(event) { if($(this).hasClass('trvl__frm') && ($("input:radio[class='travel_ready']").is(":checked")) && $('input[class="travel_ready"]:checked').val() == 1 ){ let _msg = confirm("Once you submit the travel form, you will not be able to make any changes to that. Hence, please be very much sure before submitting the form."); if (_msg != true) { event.preventDefault() } } }) $(document).on('click','.travel__form a',function(){ $(".av-tabs").find(".active").removeClass('active') $(".tab-content").find(".active").removeClass('active') $(".tab-content").find("#travel-form").addClass('active') $(this).addClass('active') }) $(document).on('click','.rewards__tab',function(){ $(".av-tabs").find(".active").removeClass('active') $(".tab-content").find(".active").removeClass('active') $(".tab-content").find("#rewards").addClass('active') $(this).addClass('active') }) $(document).on('click','.av-tabs li a',function(){ $(document).find('.travel__form a').removeClass('active') $(document).find('.rewards__tab').removeClass('active') }) }, ajaxReqSetup: () => { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, }) }, makeAjaxReq: () => { $.ajax({ url: (bootstrapCore.requestType == 'GET' || bootstrapCore.requestType == 'DELETE') ? bootstrapCore.currentNode.attr('href') : bootstrapCore.currentNode.attr('action'), type: bootstrapCore.requestType, dataType: (bootstrapCore.requestWithEncType) ? '' : bootstrapCore.requestFormat, data: (bootstrapCore.requestFormData != '') ? bootstrapCore.requestFormData : (bootstrapCore.requestType == 'POST' ? bootstrapCore.currentNode.serialize() : ''), processData: false, contentType: (bootstrapCore.requestFormData != '') ? false : 'application/x-www-form-urlencoded; charset=UTF-8', cache: false, success: function (data) { if (bootstrapCore.showLoader) { bootstrapCore.currentNode.find('button').attr('disabled', false).find('i').remove() } if (data.status == 'success') { if (typeof data.redirect_url !== 'undefined') { bootstrapCore.redirectUrlAfterRequestComplete = data.redirect_url; } else { bootstrapCore.redirectUrlAfterRequestComplete = '' } if (bootstrapCore.pageReaload) { location.reload() } else if (data.url) { location.href = data.url } else { if (bootstrapCore.formResetOnSuccess) { bootstrapCore.currentNode[0].reset() } if (typeof data.profile_src !== 'undefined') { $(bootstrapCore.profilePictureClass).attr('src', data.profile_src) } $.toast({ heading: (typeof data.heading !== 'undefined') ? data.heading : '', text: data.message, hideAfter: bootstrapCore.toastHideAfter, textAlign: bootstrapCore.toastTextAlign, position: bootstrapCore.toastPosition, icon: data.status }) bootstrapCore.updateInfoStatus = true } } else { $.toast({ heading: (typeof data.heading !== 'undefined') ? data.heading : '', text: data.message, textAlign: bootstrapCore.toastTextAlign, hideAfter: bootstrapCore.toastHideAfter, position: bootstrapCore.toastPosition, icon: data.status }) } }, error: function (data) { let err = '' if (bootstrapCore.showLoader) { bootstrapCore.currentNode.find('button').attr('disabled', false).find('i').remove() } $.each(data.responseJSON.errors, function (key, e) { err += `${e} <br/>` }) $.toast({ heading: data.responseJSON.message, text: err, textAlign: bootstrapCore.toastTextAlign, position: bootstrapCore.toastPosition, icon: 'error' }) }, complete: function () { if (bootstrapCore.redirectUrlAfterRequestComplete != '') { if ($(".manage-listing").length) { $(".manage-listing").find(".modal-body").html(bootstrapCore.bootstrapLoader).load(bootstrapCore.redirectUrlAfterRequestComplete, function () { if ($(document).find('#_location').length) { bootstrapCore.initPlaceSearch() } }) } else { //window.location.href = bootstrapCore.redirectUrlAfterRequestComplete let formArea = $(document).find('.stg-form-area') formArea.find('form').attr('action', bootstrapCore.redirectUrlAfterRequestComplete) let frmBtn = formArea.find('button') frmBtn.text(frmBtn.data('update')) } //bootstrapCore.updateInfoStatus = true } }, }) }, } bootstrapCore.init() }) })(jQuery)
[-] core.js
[edit]
[+]
..
[-] toast-notificatons.js
[edit]
[-] dashboard.min.js
[edit]