| 23 | | JsHttpRequest.query( |
| 24 | | 'POST '+aRouter['talk']+'ajaxdeletefromblacklist/', |
| 25 | | { idTarget: idTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, |
| 26 | | function(result, errors) { |
| 27 | | if (!result) { |
| 28 | | msgErrorBox.alert('Error','Please try again later'); |
| 29 | | element.getParent().fade(1); |
| | 23 | new Request.JSON({ |
| | 24 | url: aRouter['talk']+'ajaxdeletefromblacklist/', |
| | 25 | noCache: true, |
| | 26 | data: { idTarget: idTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, |
| | 27 | onSuccess: function(result){ |
| | 28 | if (!result) { |
| | 29 | msgErrorBox.alert('Error','Please try again later'); |
| | 30 | element.getParent().fade(1); |
| | 31 | } |
| | 32 | if (result.bStateError) { |
| | 33 | msgErrorBox.alert(result.sMsgTitle,result.sMsg); |
| | 34 | element.getParent().fade(1); |
| | 35 | } else { |
| | 36 | element.getParent('li').destroy(); |
| | 37 | |
| | 38 | if($('blackList').getElements('li').length==0) { |
| | 39 | $('blackList').destroy(); |
| | 40 | $('list_uncheck_all').setProperty('style','display:none'); |
| 31 | | if (result.bStateError) { |
| 32 | | msgErrorBox.alert(result.sMsgTitle,result.sMsg); |
| 33 | | element.getParent().fade(1); |
| 34 | | } else { |
| 35 | | element.getParent('li').destroy(); |
| 36 | | |
| 37 | | if($('blackList').getElements('li').length==0) { |
| 38 | | $('blackList').destroy(); |
| 39 | | $('list_uncheck_all').setProperty('style','display:none'); |
| 40 | | } |
| 41 | | } |
| 42 | | }, |
| 43 | | true |
| 44 | | ); |
| 45 | | |
| | 42 | } |
| | 43 | }, |
| | 44 | onFailure: function(){ |
| | 45 | msgErrorBox.alert('Error','Please try again later'); |
| | 46 | } |
| | 47 | }).send(); |
| 86 | | JsHttpRequest.query( |
| 87 | | 'POST '+aRouter['talk']+'ajaxaddtoblacklist/', |
| 88 | | { users: sUsers, security_ls_key: LIVESTREET_SECURITY_KEY }, |
| 89 | | function(result, errors) { |
| 90 | | if (!result) { |
| 91 | | msgErrorBox.alert('Error','Please try again later'); |
| 92 | | } |
| 93 | | if (result.bStateError) { |
| 94 | | msgErrorBox.alert(result.sMsgTitle,result.sMsg); |
| 95 | | } else { |
| 96 | | var aUsers = result.aUsers; |
| 97 | | aUsers.each(function(item,index) { |
| 98 | | if(item.bStateError){ |
| 99 | | msgErrorBox.alert(item.sMsgTitle, item.sMsg); |
| 100 | | } else { |
| 101 | | addListItem(item.sUserId,item.sUserLogin); |
| 102 | | } |
| 103 | | }); |
| 104 | | } |
| 105 | | }, |
| 106 | | true |
| 107 | | ); |
| | 88 | |
| | 89 | new Request.JSON({ |
| | 90 | url: aRouter['talk']+'ajaxaddtoblacklist/', |
| | 91 | noCache: true, |
| | 92 | data: { users: sUsers, security_ls_key: LIVESTREET_SECURITY_KEY }, |
| | 93 | onSuccess: function(result){ |
| | 94 | if (!result) { |
| | 95 | msgErrorBox.alert('Error','Please try again later'); |
| | 96 | } |
| | 97 | if (result.bStateError) { |
| | 98 | msgErrorBox.alert(result.sMsgTitle,result.sMsg); |
| | 99 | } else { |
| | 100 | var aUsers = result.aUsers; |
| | 101 | aUsers.each(function(item,index) { |
| | 102 | if(item.bStateError){ |
| | 103 | msgErrorBox.alert(item.sMsgTitle, item.sMsg); |
| | 104 | } else { |
| | 105 | addListItem(item.sUserId,item.sUserLogin); |
| | 106 | } |
| | 107 | }); |
| | 108 | } |
| | 109 | }, |
| | 110 | onFailure: function(){ |
| | 111 | msgErrorBox.alert('Error','Please try again later'); |
| | 112 | } |
| | 113 | }).send(); |