PATH:
home
/
lab2454c
/
keebchat.com
/
themes
/
default
/
apps
/
cpanel
/
assets
/
main
/
scripts
<script> /* @*************************************************************************@ // @ @author Mansur Altamirov (Mansur_TL) @ // @ @author_url 1: https://www.instagram.com/mansur_tl @ // @ @author_url 2: http://codecanyon.net/user/mansur_tl @ // @ @author_email: highexpresstore@gmail.com @ // @*************************************************************************@ // @ ColibriSM - The Ultimate Modern Social Media Sharing Platform @ // @ Copyright (c) 21.03.2020 ColibriSM. All rights reserved. @ // @*************************************************************************@ */ "use strict"; (function(window) { function _SMC_CPanel() { var _evh = {}; var data = { url: "{%config url%}" }; var _smc = { curr_pn: "<?php echo fetch_or_get($cl["pn"],"none"); ?>", vue: {} }; _smc.init = function() { _smc.update_msb_indicators(); } _smc.confirm_action = function(data = {}) { var modal = '<div class="modal fadeIn confirm-actions-modal" tabindex="-1" data-onclose="remove" role="dialog" aria-hidden="true" data-keyboard="false" data-backdrop="static"><div class="modal-dialog modal-md" role="document"><div class="modal-content"><div class="modal-body"><h4>{0}</h4><p>{1}</p></div><div class="modal-footer"><button id="confirm-actions-cancel" type="button" class="btn btn-primary-outline ttup btn-lg">{2}</button><button id="confirm-actions-confirm" type="button" class="btn btn-primary ttup btn-lg">{3}</button></div></div></div></div>'; var title = data['title']; var message = data['message']; var btn_1 = data['btn_1']; var btn_2 = data['btn_2']; var modal = modal.format(title,message,btn_1,btn_2); var deferred = new $.Deferred(); $(document).on('click', '#confirm-actions-confirm', function(event) { deferred.resolve(); }); $(document).on('click', '#confirm-actions-cancel', function(event) { deferred.reject(); }); $('div[data-app="black-hole"]').append($(modal)).find('div.confirm-actions-modal').modal('show'); return deferred.promise(); } _smc.delete_user = function(id = false) { if ($.isNumeric(id) && id) { var promise = SMC_CPanel.confirm_action({ btn_1: "Cancel", btn_2: "Delete", title: "Please confirm your actions!", message: "Please note that if you delete this user, then all posts, replies, and all other data associated with this user will also be deleted!", }); promise.done(function() { $.ajax({ url: '<?php echo cl_link("native_api/cpanel/delete_user"); ?>', type: 'POST', dataType: 'json', data: {id: id}, }).done(function(data) { if (data.status != 200) { cl_bs_notify("An error occurred while processing your request. Please try again later.",3000); } else { $('[data-user-id="{0}"]'.format(id)).slideUp(300, function() { $(this).remove(); if ($('[data-user-id]').length < 1) { $(window).reloadPage(500); } }); } }).always(function() { $("div.confirm-actions-modal").modal("hide"); }); }); promise.fail(function() { $("div.confirm-actions-modal").modal("hide"); }); } } _smc.delete_post = function(id = false) { if ($.isNumeric(id) && id) { var promise = SMC_CPanel.confirm_action({ btn_1: "Cancel", btn_2: "Delete", title: "Please confirm your actions!", message: "Please note that if you delete this post, then with the removal of this post all posts related to this thread will also be permanently deleted!" }); promise.done(function() { $.ajax({ url: '<?php echo cl_link("native_api/cpanel/delete_post"); ?>', type: 'POST', dataType: 'json', data: {id: id}, }).done(function(data) { if (data.status != 200) { cl_bs_notify("An error occurred while processing your request. Please try again later.",3000); } else { $('[data-list-item="{0}"]'.format(id)).slideUp(300, function() { $(this).remove(); if ($('[data-list-item]').length < 1) { $(window).reloadPage(500); } }); } }).always(function() { $("div.confirm-actions-modal").modal("hide"); }); }); promise.fail(function() { $("div.confirm-actions-modal").modal("hide"); }); } } _smc.extend_vue = function(app_name = "", vue_instance = {}) { _smc.vue[app_name] = vue_instance; } _smc.update_msb_indicators = function() { var main_header = $('[data-app="header"]') var timer_id = setInterval(function() { $.ajax({ url: '<?php echo cl_link("native_api/main/update_msb_indicators"); ?>', type: 'GET', dataType: 'json', }).done(function(data) { if (data.status == 200) { if (data.notifications > 0) { main_header.find('[data-an="new-notifs"]').text($.trim(data.notifications)); } else { main_header.find('[data-an="new-notifs"]').empty(); } if (data.messages) { main_header.find('[data-an="new-messages"]').text($.trim(data.messages)); } else { main_header.find('[data-an="new-messages"]').empty(); } } else { clearInterval(timer_id); } }); }, (30 * 1000)); } _smc.waitme = function(o = false, a = false) { if (a == 'hide') { o.waitMe('hide'); } else { o.waitMe({ effect : 'rotation', text : '', bg : 'rgba(255,255,255,0.5)', color : '#1ca1f3', maxSize : '40', waitTime : -1, textPos : 'vertical', fontSize : '', source : '' }); } } return _smc; } if (window.SMC_CPanel === undefined) { window.SMC_CPanel = _SMC_CPanel(); } })(window); jQuery(document).ready(function($) { SMC_CPanel.init(); }); </script>
[+]
..
[-] app_master_script.phtml
[edit]