芝麻web文件管理V1.00
编辑当前文件:/home/unicorntechnolog/public_html/mt5-ctrader/public/js/main-admin.js
(function ($) { "use strict"; // Spinner var spinner = function () { setTimeout(function () { if ($('#spinner').length > 0) { $('#spinner').removeClass('show'); } }, 1); }; spinner(); // Back to top button $(window).scroll(function () { if ($(this).scrollTop() > 300) { $('.back-to-top').fadeIn('slow'); } else { $('.back-to-top').fadeOut('slow'); } }); $('.back-to-top').click(function () { $('html, body').animate({scrollTop: 0}, 1500, 'easeInOutExpo'); return false; }); // Sidebar Toggler $('.sidebar-toggler').click(function () { $('.sidebar, .content').toggleClass("open"); return false; }); // Progress Bar $('.pg-bar').waypoint(function () { $('.progress .progress-bar').each(function () { $(this).css("width", $(this).attr("aria-valuenow") + '%'); }); }, {offset: '80%'}); // Calender $('#calender').datetimepicker({ inline: true, format: 'L' }); // Testimonials carousel $(".testimonial-carousel").owlCarousel({ autoplay: true, smartSpeed: 1000, items: 1, dots: true, loop: true, nav : false }); if($(".select2").length > 0){ $(".select2").select2({ placeholder: "Please Choose...", allowClear: true }); } if($(".useridajax").length > 0){ $('#useridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/usersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".useremailajax").length > 0){ $('#useremailajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/usersemaildatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.email } }) }; } }, }); } if($(".pendinguseridajax").length > 0){ $('#pendinguseridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/pendingusersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".ibuseridajax").length > 0){ $('#ibuseridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/ibusersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".searchajax").length > 0){ $('#searchajax').select2({ placeholder: "Search...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/searchajaxlist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".usermt5idajax").length > 0){ $('#usermt5idajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/usersmt5datalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.mt5id+' ('+item.email+')', id: item.mt5id } }) }; } }, }); } if($(".usermt5idgroupajax").length > 0){ $('#usermt5idgroupajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/usersmt5grouplist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+' ('+item.mt5id+') ('+item.groupname+')', id: item.mt5id } }) }; } }, }); } if($(".fromaccountajax").length > 0){ $('#fromaccountajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/fromaccountajax', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.mt5id+' ('+item.email+')', id: item.mt5id } }) }; } }, }); } if($(".toaccountajax").length > 0){ $('#toaccountajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/admin/toaccountajax', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.mt5id+' ('+item.email+')', id: item.mt5id } }) }; } }, }); } /***** marketing ***/ if($(".marketinguseridajax").length > 0){ $('#marketinguseridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/marketing/usersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".marketingpendinguseridajax").length > 0){ $('#marketingpendinguseridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/marketing/pendingusersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".marketingusermt5idajax").length > 0){ $('#marketingusermt5idajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/marketing/usersmt5datalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.mt5id+' ('+item.email+')', id: item.mt5id } }) }; } }, }); } if($(".marketingibuseridajax").length > 0){ $('#marketingibuseridajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/marketing/ibusersdatalist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+'('+item.email+')', id: item.id } }) }; } }, }); } if($(".marketingusermt5idgroupajax").length > 0){ $('#marketingusermt5idgroupajax').select2({ placeholder: "Please Choose...", allowClear: true, minimumInputLength: 3, ajax: { url: '/marketing/usersmt5grouplist', dataType: 'json', type: "GET", data: function(term){ return{ term: term.term }; }, processResults: function(data) { return { results: $.map(data.results, function (item) { return { text: item.name+' ('+item.mt5id+') ('+item.groupname+')', id: item.mt5id } }) }; } }, }); } /**** end marketing ***/ if($("#grouplisting").length > 0){ $('#grouplisting').DataTable({ "paging": true, "ordering": true, "info": true, }); } if($("#documentlisting").length > 0){ $('#documentlisting').DataTable({ "paging": true, "ordering": true, "info": true, }); } if($("#bankdetailslisting").length > 0){ $('#bankdetailslisting').DataTable({ "paging": true, "ordering": true, "info": true, }); } if($("#accountlisting").length > 0){ $('#accountlisting').DataTable({ "paging": true, "ordering": true, "info": true, }); } if($("#level1listing").length > 0){ $('#level1listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level2listing").length > 0){ $('#level2listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level3listing").length > 0){ $('#level3listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level4listing").length > 0){ $('#level4listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level5listing").length > 0){ $('#level5listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level6listing").length > 0){ $('#level6listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } if($("#level7listing").length > 0){ $('#level7listing').DataTable({ "paging": true, "ordering": true, "info": true, dom: 'lBfrtip', buttons: [ { extend: 'excel'}, ], }); } })(jQuery);