case 'delete': if (data.length === 0) { showmessage("{lang please_select_at_least_one_row}", 'danger', 3000, 1); return; } var sids = new Array(); $.each(data,function(i) { sids.push(this.sid); }); layer.confirm('{lang share_stop_sharing1}', {title: '{lang affirm_stop_sharing}',skin:'lyear-skin-danger'}, function(index){ var loading = layer.load(0, { shade: [0.1, '#000'] }); jQuery.post('{MOD_URL}&op=ajax&do=delete&ajaxdata=json', {'sids': sids},function(json){ layer.close(loading); layer.close(index); if(json.success){ showmessage('{lang delete_success}', 'success', '3000', 1); } else if(json.msg){ showmessage(json.msg, 'danger', '3000', 1); } else { showmessage('{lang error}', 'danger', '3000', 1); } table.reloadData('table'); },'json').fail(function() { layer.close(loading); layer.close(index); showmessage('{lang do_failed}', 'danger',3000,1); }); }); break; case 'forbidden': if (data.length === 0) { showmessage("{lang please_select_at_least_one_row}", 'danger', 3000, 1); return; } var sids = new Array(); $.each(data,function(i) { sids.push(this.sid); }); layer.confirm('{lang share_stop_sharing2}', {title: '{lang affirm_screen_share}',skin:'lyear-skin-warning'}, function(index){ var loading = layer.load(0, { shade: [0.1, '#000'] }); jQuery.post('{MOD_URL}&op=ajax&do=forbidden&ajaxdata=json', {'sids': sids, "flag": 'forbidden'},function(json){ layer.close(loading); layer.close(index); if(json.success){ showmessage(json.msg, 'success', '3000', 1); } else if(json.error){ showmessage(json.error, 'danger', '3000', 1); } else { showmessage('{lang shielding_failure}', 'danger', '3000', 1); } table.reloadData('table'); },'json').fail(function() { layer.close(loading); layer.close(index); showmessage('{lang do_failed}', 'danger',3000,1); }); }); break; case 'allow': if (data.length === 0) { showmessage("{lang please_select_at_least_one_row}", 'danger', 3000, 1); return; } var sids = new Array(); $.each(data,function(i) { sids.push(this.sid); }); layer.confirm('{lang share_stop_sharing3}', {title: '{lang affirm_cancel_shielding}',skin:'lyear-skin-info'}, function(index){ var loading = layer.load(0, { shade: [0.1, '#000'] }); jQuery.post('{MOD_URL}&op=ajax&do=forbidden&ajaxdata=json', {'sids': sids, "flag": 'allow'},function(json){ layer.close(loading); layer.close(index); if(json.success){ showmessage(json.msg, 'success', '3000', 1); } else if(json.error){ showmessage(json.error, 'danger', '3000', 1); } else { showmessage('{lang cancel_shielding_failure}', 'danger', '3000', 1); } table.reloadData('table'); },'json').fail(function() { layer.close(loading); layer.close(index); showmessage('{lang do_failed}', 'danger',3000,1); }); }); break;