Changeset 996

Show
Ignore:
Timestamp:
08/21/10 20:31:41 (18 months ago)
Author:
ort
Message:

Избавляемся от использования JsHttpRequest? и отдаем ответы в формате JSON

Location:
trunk
Files:
45 modified

Legend:

Unmodified
Added
Removed
  • trunk/classes/actions/ActionBlog.class.php

    r892 r996  
    787787         */ 
    788788        protected function AjaxAddComment() { 
    789                 $this->Viewer_SetResponseAjax(); 
     789                $this->Viewer_SetResponseAjax('json'); 
    790790                $this->SubmitComment(); 
    791791        }        
     
    947947         */ 
    948948        protected function AjaxAddBlogInvite() { 
    949                 $this->Viewer_SetResponseAjax(); 
     949                $this->Viewer_SetResponseAjax('json'); 
    950950                $sUsers=getRequest('users',null,'post'); 
    951951                $sBlogId=getRequest('idBlog',null,'post'); 
     
    10931093         */ 
    10941094        protected function AjaxReBlogInvite() { 
    1095                 $this->Viewer_SetResponseAjax(); 
     1095                $this->Viewer_SetResponseAjax('json'); 
    10961096                $sUserId=getRequest('idUser',null,'post'); 
    10971097                $sBlogId=getRequest('idBlog',null,'post'); 
  • trunk/classes/actions/ActionProfile.class.php

    r995 r996  
    277277         
    278278        public function EventAjaxFriendAccept() { 
    279                 $this->Viewer_SetResponseAjax(); 
     279                $this->Viewer_SetResponseAjax('json'); 
    280280                $sUserId=getRequest('idUser',null,'post'); 
    281281 
     
    386386         
    387387        public function EventAjaxFriendAdd() { 
    388                 $this->Viewer_SetResponseAjax(); 
     388                $this->Viewer_SetResponseAjax('json'); 
    389389                $sUserId=getRequest('idUser'); 
    390390                $sUserText=getRequest('userText',''); 
     
    586586         */ 
    587587        public function EventAjaxFriendDelete() { 
    588                 $this->Viewer_SetResponseAjax(); 
     588                $this->Viewer_SetResponseAjax('json'); 
    589589                $sUserId=getRequest('idUser',null,'post'); 
    590590                 
  • trunk/classes/actions/ActionTalk.class.php

    r891 r996  
    420420         */ 
    421421        protected function AjaxResponseComment() { 
    422                 $this->Viewer_SetResponseAjax(); 
     422                $this->Viewer_SetResponseAjax('json'); 
    423423                $idCommentLast=getRequest('idCommentLast');              
    424424                /** 
     
    471471         */ 
    472472        protected function AjaxAddComment() { 
    473                 $this->Viewer_SetResponseAjax(); 
     473                $this->Viewer_SetResponseAjax('json'); 
    474474                $this->SubmitComment(); 
    475475        }        
     
    595595         */      
    596596        public function AjaxAddToBlacklist() { 
    597                 $this->Viewer_SetResponseAjax(); 
     597                $this->Viewer_SetResponseAjax('json'); 
    598598                $sUsers=getRequest('users',null,'post'); 
    599599                 
     
    678678         */      
    679679        public function AjaxDeleteFromBlacklist() { 
    680                 $this->Viewer_SetResponseAjax(); 
     680                $this->Viewer_SetResponseAjax('json'); 
    681681                $idTarget=getRequest('idTarget',null,'post'); 
    682682                 
     
    738738         */      
    739739        public function AjaxDeleteTalkUser() { 
    740                 $this->Viewer_SetResponseAjax(); 
     740                $this->Viewer_SetResponseAjax('json'); 
    741741                $idTarget=getRequest('idTarget',null,'post'); 
    742742                $idTalk=getRequest('idTalk',null,'post'); 
     
    814814         */ 
    815815        public function AjaxAddTalkUser() { 
    816                 $this->Viewer_SetResponseAjax(); 
     816                $this->Viewer_SetResponseAjax('json'); 
    817817                $sUsers=getRequest('users',null,'post'); 
    818818                $idTalk=getRequest('idTalk',null,'post'); 
  • trunk/include/ajax/blogInfo.php

    r548 r996  
    4343 
    4444 
    45 $GLOBALS['_RESULT'] = array( 
     45$aResult = array( 
    4646"bStateError"     => $bStateError, 
    4747"sText"   => $sText, 
    4848); 
    4949 
     50if (!headers_sent()) { 
     51        header('Content-type: application/json'); 
     52} 
     53echo json_encode($aResult); 
    5054?> 
  • trunk/include/ajax/blogs_join.php

    r413 r996  
    4545} 
    4646 
    47 $GLOBALS['_RESULT'] = array( 
     47$aResult = array( 
    4848"bStateError"     => $bStateError, 
    4949"sText"   => $sTextResult, 
     
    5252); 
    5353 
     54if (!headers_sent()) { 
     55        header('Content-type: application/json'); 
     56} 
     57echo json_encode($aResult); 
    5458?> 
  • trunk/include/ajax/blogs_self.php

    r413 r996  
    4545} 
    4646 
    47 $GLOBALS['_RESULT'] = array( 
     47$aResult = array( 
    4848"bStateError"     => $bStateError, 
    4949"sText"   => $sTextResult, 
     
    5252); 
    5353 
     54if (!headers_sent()) { 
     55        header('Content-type: application/json'); 
     56} 
     57echo json_encode($aResult); 
    5458?> 
  • trunk/include/ajax/blogs_top.php

    r413 r996  
    4242 
    4343 
    44 $GLOBALS['_RESULT'] = array( 
     44$aResult = array( 
    4545"bStateError"     => $bStateError, 
    4646"sText"   => $sTextResult, 
     
    4949); 
    5050 
     51if (!headers_sent()) { 
     52        header('Content-type: application/json'); 
     53} 
     54echo json_encode($aResult); 
    5155?> 
  • trunk/include/ajax/commentFavourite.php

    r548 r996  
    8787 
    8888 
    89 $GLOBALS['_RESULT'] = array( 
     89$aResult = array( 
    9090        "bStateError" => $bStateError, 
    9191        "bState"      => $bState, 
     
    9494); 
    9595 
     96if (!headers_sent()) { 
     97        header('Content-type: application/json'); 
     98} 
     99echo json_encode($aResult); 
    96100?> 
  • trunk/include/ajax/commentResponse.php

    r548 r996  
    6565} 
    6666 
    67 $GLOBALS['_RESULT'] = array( 
     67$aResult = array( 
    6868"bStateError"     => $bStateError, 
    6969"sMsgTitle"   => $sMsgTitle, 
     
    7373); 
    7474 
     75if (!headers_sent()) { 
     76        header('Content-type: application/json'); 
     77} 
     78echo json_encode($aResult); 
    7579?> 
  • trunk/include/ajax/commentToggle.php

    r548 r996  
    6464 
    6565 
    66 $GLOBALS['_RESULT'] = array( 
     66$aResult = array( 
    6767"bStateError"     => $bStateError, 
    6868"bState"     => $bState, 
     
    7272); 
    7373 
     74if (!headers_sent()) { 
     75        header('Content-type: application/json'); 
     76} 
     77echo json_encode($aResult); 
    7478?> 
  • trunk/include/ajax/joinLeaveBlog.php

    r891 r996  
    110110 
    111111 
    112 $GLOBALS['_RESULT'] = array( 
     112$aResult = array( 
    113113"bStateError"     => $bStateError, 
    114114"bState"   => $bState, 
     
    118118); 
    119119 
     120if (!headers_sent()) { 
     121        header('Content-type: application/json'); 
     122} 
     123echo json_encode($aResult); 
    120124?> 
  • trunk/include/ajax/questionVote.php

    r548 r996  
    8282} 
    8383 
    84 $GLOBALS['_RESULT'] = array( 
     84$aResult = array( 
    8585"bStateError"     => $bStateError, 
    8686"sText"   => $sTextResult, 
     
    8989); 
    9090 
     91if (!headers_sent()) { 
     92        header('Content-type: application/json'); 
     93} 
     94echo json_encode($aResult); 
    9195?> 
  • trunk/include/ajax/stream_comment.php

    r413 r996  
    4141 
    4242 
    43 $GLOBALS['_RESULT'] = array( 
     43$aResult = array( 
    4444"bStateError"     => $bStateError, 
    4545"sText"   => $sTextResult, 
     
    4848); 
    4949 
     50if (!headers_sent()) { 
     51        header('Content-type: application/json'); 
     52} 
     53echo json_encode($aResult); 
    5054?> 
  • trunk/include/ajax/stream_topic.php

    r413 r996  
    4141 
    4242 
    43 $GLOBALS['_RESULT'] = array( 
     43$aResult = array( 
    4444"bStateError"     => $bStateError, 
    4545"sText"   => $sTextResult, 
     
    4848); 
    4949 
     50if (!headers_sent()) { 
     51        header('Content-type: application/json'); 
     52} 
     53echo json_encode($aResult); 
    5054?> 
  • trunk/include/ajax/talkFavourite.php

    r548 r996  
    8787 
    8888 
    89 $GLOBALS['_RESULT'] = array( 
     89$aResult = array( 
    9090        "bStateError" => $bStateError, 
    9191        "bState"      => $bState, 
     
    9494); 
    9595 
     96if (!headers_sent()) { 
     97        header('Content-type: application/json'); 
     98} 
     99echo json_encode($aResult); 
    96100?> 
  • trunk/include/ajax/talkNewMessages.php

    r428 r996  
    3737} 
    3838 
    39 $GLOBALS['_RESULT'] = array( 
     39$aResult = array( 
    4040        "bStateError"   => $bStateError, 
    4141        "sMsgTitle"     => $sMsgTitle, 
     
    4444); 
    4545 
     46if (!headers_sent()) { 
     47        header('Content-type: application/json'); 
     48} 
     49echo json_encode($aResult); 
    4650?> 
  • trunk/include/ajax/textPreview.php

    r548 r996  
    3737} 
    3838 
    39 $GLOBALS['_RESULT'] = array( 
     39$aResult = array( 
    4040"bStateError"     => $bStateError, 
    4141"sText"   => $sTextResult, 
    4242); 
    4343 
     44if (!headers_sent()) { 
     45        header('Content-type: application/json'); 
     46} 
     47echo json_encode($aResult); 
    4448?> 
  • trunk/include/ajax/topicFavourite.php

    r548 r996  
    8787 
    8888 
    89 $GLOBALS['_RESULT'] = array( 
     89$aResult = array( 
    9090"bStateError"     => $bStateError, 
    9191"bState"   => $bState, 
     
    9494); 
    9595 
     96if (!headers_sent()) { 
     97        header('Content-type: application/json'); 
     98} 
     99echo json_encode($aResult); 
    96100?> 
  • trunk/include/ajax/voteBlog.php

    r891 r996  
    9191 
    9292 
    93 $GLOBALS['_RESULT'] = array( 
     93$aResult = array( 
    9494"bStateError"     => $bStateError, 
    9595"iRating"   => $iRating, 
     
    9999); 
    100100 
     101if (!headers_sent()) { 
     102        header('Content-type: application/json'); 
     103} 
     104echo json_encode($aResult); 
    101105?> 
  • trunk/include/ajax/voteComment.php

    r548 r996  
    8686 
    8787 
    88 $GLOBALS['_RESULT'] = array( 
     88$aResult = array( 
    8989"bStateError"     => $bStateError, 
    9090"iRating"   => $iRating, 
     
    9393); 
    9494 
     95if (!headers_sent()) { 
     96        header('Content-type: application/json'); 
     97} 
     98echo json_encode($aResult); 
    9599?> 
  • trunk/include/ajax/voteTopic.php

    r548 r996  
    8888 
    8989 
    90 $GLOBALS['_RESULT'] = array( 
     90$aResult = array( 
    9191"bStateError"     => $bStateError, 
    9292"iRating"   => $iRating, 
     
    9595); 
    9696 
     97if (!headers_sent()) { 
     98        header('Content-type: application/json'); 
     99} 
     100echo json_encode($aResult); 
    97101?> 
  • trunk/include/ajax/voteUser.php

    r548 r996  
    8585 
    8686 
    87 $GLOBALS['_RESULT'] = array( 
     87$aResult = array( 
    8888"bStateError"     => $bStateError, 
    8989"iRating"   => $iRating, 
     
    9494); 
    9595 
     96if (!headers_sent()) { 
     97        header('Content-type: application/json'); 
     98} 
     99echo json_encode($aResult); 
    96100?> 
  • trunk/templates/skin/developer/actions/ActionTalk/blacklist.tpl

    r923 r996  
    2121                                idTarget = element.get('id').replace('blacklist_item_',''); 
    2222 
    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'); 
    3041                                                        } 
    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(); 
    4648                                return true; 
    4749                        } 
     
    8486                                } 
    8587                                $('talk_blacklist_add').set('value',''); 
    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(); 
    108114                                return false; 
    109115                        } 
  • trunk/templates/skin/developer/actions/ActionTalk/speakers.tpl

    r923 r996  
    2222                                idTarget = element.get('id').replace('speaker_item_',''); 
    2323 
    24                                 JsHttpRequest.query( 
    25                                                 'POST '+aRouter['talk']+'ajaxdeletetalkuser/', 
    26                                                 { idTarget:idTarget,idTalk:idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    27                                                 function(result, errors) { 
    28                                                         if (!result) { 
     24                                new Request.JSON({ 
     25                                        url: aRouter['talk']+'ajaxdeletetalkuser/', 
     26                                        noCache: true, 
     27                                        data: { idTarget:idTarget,idTalk:idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     28                                        onSuccess: function(result){ 
     29                                                if (!result) { 
    2930                                                                msgErrorBox.alert('Error','Please try again later'); 
    3031                                                                element.getParent().fade(1); 
     
    3637                                                                element.getParent('li').destroy(); 
    3738                                                        } 
    38                                                 }, 
    39                                                 true 
    40                                 ); 
    41  
     39                                        }, 
     40                                        onFailure: function(){ 
     41                                                msgErrorBox.alert('Error','Please try again later'); 
     42                                        } 
     43                                }).send(); 
    4244                                return true; 
    4345                        } 
     
    7375                                } 
    7476                                $('talk_speaker_add').set('value',''); 
    75                                 JsHttpRequest.query( 
    76                                                 'POST '+aRouter['talk']+'ajaxaddtalkuser/', 
    77                                                 { users: sUsers, idTalk: idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    78                                                 function(result, errors) { 
    79                                                         if (!result) { 
    80                                                                 msgErrorBox.alert('Error','Please try again later'); 
    81                                                         } 
    82                                                         if (result.bStateError) { 
    83                                                                 msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    84                                                         } else { 
    85                                                                 var aUsers = result.aUsers; 
    86                                                                 aUsers.each(function(item,index) { 
    87                                                                         if(item.bStateError){ 
    88                                                                                 msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
    89                                                                         } else { 
    90                                                                                 addListItem(item.sUserId,item.sUserLogin,item.sUserLink,idTalk); 
    91                                                                         } 
    92                                                                 }); 
    93                                                         } 
    94                                                 }, 
    95                                                 true 
    96                                 ); 
     77                                new Request.JSON({ 
     78                                        url: aRouter['talk']+'ajaxaddtalkuser/', 
     79                                        noCache: true, 
     80                                        data: { users: sUsers, idTalk: idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     81                                        onSuccess: function(result){ 
     82                                                if (!result) { 
     83                                                        msgErrorBox.alert('Error','Please try again later'); 
     84                                                } 
     85                                                if (result.bStateError) { 
     86                                                        msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     87                                                } else { 
     88                                                        var aUsers = result.aUsers; 
     89                                                        aUsers.each(function(item,index) { 
     90                                                                if(item.bStateError){ 
     91                                                                        msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
     92                                                                } else { 
     93                                                                        addListItem(item.sUserId,item.sUserLogin,item.sUserLink,idTalk); 
     94                                                                } 
     95                                                        }); 
     96                                                } 
     97                                        }, 
     98                                        onFailure: function(){ 
     99                                                msgErrorBox.alert('Error','Please try again later'); 
     100                                        } 
     101                                }).send(); 
    97102                                return false; 
    98103                        } 
  • trunk/templates/skin/developer/js/block_loader.js

    r923 r996  
    5858                        params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    5959                } 
    60                 JsHttpRequest.query( 
    61                         'POST '+this.type[type].url, 
    62                         params, 
    63                         function(result, errors) { 
    64                                 thisObj.onLoad(result, errors, blockContent); 
     60                 
     61                new Request.JSON({ 
     62                        url: this.type[type].url, 
     63                        noCache: true, 
     64                        data: params, 
     65                        onSuccess: function(result){ 
     66                                thisObj.onLoad(result, blockContent); 
    6567                        }, 
    66                         true 
    67                 ); 
    68  
     68                        onFailure: function(){ 
     69                                msgErrorBox.alert('Error','Please try again later'); 
     70                        } 
     71                }).send(); 
    6972        }, 
    7073 
    71         onLoad: function(result, errors, blockContent) { 
     74        onLoad: function(result, blockContent) { 
    7275                blockContent.set('html',''); 
    7376                if (!result) { 
  • trunk/templates/skin/developer/js/blog.js

    r923 r996  
    11function ajaxJoinLeaveBlog(obj,idBlog) { 
    22        obj=$(obj); 
    3         JsHttpRequest.query( 
    4         'POST '+DIR_WEB_ROOT+'/include/ajax/joinLeaveBlog.php', 
    5         { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    6         function(result, errors) { 
    7                 if (!result) { 
     3         
     4        new Request.JSON({ 
     5                url: DIR_WEB_ROOT+'/include/ajax/joinLeaveBlog.php', 
     6                noCache: true, 
     7                data: { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     8                onSuccess: function(result){ 
     9                        if (!result) { 
    810                msgErrorBox.alert('Error','Please try again later'); 
    911                } 
     
    2325                } 
    2426            } 
    25         }, 
    26         true 
    27     ); 
     27                }, 
     28                onFailure: function(){ 
     29                        msgErrorBox.alert('Error','Please try again later'); 
     30                } 
     31        }).send(); 
    2832} 
    2933 
    3034 
    31 function ajaxBlogInfo(idBlog) {          
    32         JsHttpRequest.query( 
    33         'POST '+DIR_WEB_ROOT+'/include/ajax/blogInfo.php',                        
    34         { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY  }, 
    35         function(result, errors) {   
    36                 if (!result) { 
     35function ajaxBlogInfo(idBlog) { 
     36        new Request.JSON({ 
     37                url: DIR_WEB_ROOT+'/include/ajax/blogInfo.php', 
     38                noCache: true, 
     39                data: { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     40                onSuccess: function(result){ 
     41                        if (!result) { 
    3742                msgErrorBox.alert('Error','Please try again later');            
    3843                } 
     
    4348                        $('block_blog_info').set('html',result.sText);                           
    4449                } 
    45             }                                
    46         }, 
    47         true 
    48     ); 
     50            } 
     51                }, 
     52                onFailure: function(){ 
     53                        msgErrorBox.alert('Error','Please try again later'); 
     54                } 
     55        }).send(); 
    4956} 
    5057 
     
    8289        $('blog_admin_user_add').set('value',''); 
    8390 
    84         JsHttpRequest.query( 
    85                    'POST '+aRouter['blog']+'ajaxaddbloginvite/', 
    86                         { users: sUsers, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    87                         function(result, errors) { 
    88                                 if (!result) { 
    89                                         msgErrorBox.alert('Error','Please try again later'); 
    90                                 } 
    91                                 if (result.bStateError) { 
    92                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    93                                 } else { 
    94                                         var aUsers = result.aUsers; 
    95                                         aUsers.each(function(item,index) { 
    96                                                 if(item.bStateError){ 
    97                                                         msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
    98                                                 } else { 
    99                                                         addUserItem(item.sUserLogin,item.sUserWebPath); 
    100                                                 } 
    101                                         }); 
    102                                 } 
    103                         }, 
    104                         true 
    105         ); 
     91        new Request.JSON({ 
     92                url: aRouter['blog']+'ajaxaddbloginvite/', 
     93                noCache: true, 
     94                data: { users: sUsers, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     95                onSuccess: function(result){ 
     96                        if (!result) { 
     97                                msgErrorBox.alert('Error','Please try again later'); 
     98                        } 
     99                        if (result.bStateError) { 
     100                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     101                        } else { 
     102                                var aUsers = result.aUsers; 
     103                                aUsers.each(function(item,index) { 
     104                                        if(item.bStateError){ 
     105                                                msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
     106                                        } else { 
     107                                                addUserItem(item.sUserLogin,item.sUserWebPath); 
     108                                        } 
     109                                }); 
     110                        } 
     111                }, 
     112                onFailure: function(){ 
     113                        msgErrorBox.alert('Error','Please try again later'); 
     114                } 
     115        }).send(); 
    106116        return false; 
    107117} 
     
    109119 
    110120function reBlogInvite(idUser,idBlog) { 
    111         JsHttpRequest.query( 
    112                    'POST '+aRouter['blog']+'ajaxrebloginvite/', 
    113                         { idUser: idUser, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    114                         function(result, errors) { 
    115                                 if (!result) { 
    116                                         msgErrorBox.alert('Error','Please try again later'); 
    117                                 } 
    118                                 if (result.bStateError) { 
    119                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    120                                 } else { 
    121                                         msgNoticeBox.alert(result.sMsgTitle, result.sMsg); 
    122                                 } 
    123                         }, 
    124                         true 
    125         ); 
     121        new Request.JSON({ 
     122                url: aRouter['blog']+'ajaxrebloginvite/', 
     123                noCache: true, 
     124                data: { idUser: idUser, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     125                onSuccess: function(result){ 
     126                        if (!result) { 
     127                                msgErrorBox.alert('Error','Please try again later'); 
     128                        } 
     129                        if (result.bStateError) { 
     130                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     131                        } else { 
     132                                msgNoticeBox.alert(result.sMsgTitle, result.sMsg); 
     133                        } 
     134                }, 
     135                onFailure: function(){ 
     136                        msgErrorBox.alert('Error','Please try again later'); 
     137                } 
     138        }).send(); 
    126139        return false; 
    127140} 
  • trunk/templates/skin/developer/js/comments.js

    r969 r996  
    143143                objImg=$(objImg); 
    144144                objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update_act.gif');      
    145                 (function(){             
    146                 JsHttpRequest.query(             
    147                 'POST '+thisObj.typeComment[typeTarget].url_response, 
    148                 { idCommentLast: idCommentLast, idTarget: idTarget, typeTarget: typeTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    149                 function(result, errors) {                       
    150                         objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update.gif');  
    151                 if (!result) { 
    152                         msgErrorBox.alert('Error','Please try again later');            
    153                         }       
    154                         if (result.bStateError) { 
    155                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    156                         } else {    
    157                                 var aCmt=result.aComments;                               
    158                                 if (aCmt.length>0 && result.iMaxIdComment) { 
    159                                         thisObj.setIdCommentLast(result.iMaxIdComment); 
    160                                         var countComments=$('count-comments'); 
    161                                         countComments.set('text',parseInt(countComments.get('text'))+aCmt.length); 
    162                                         if ($('block_stream_comment') && lsBlockStream) { 
    163                                                 lsBlockStream.toggle($('block_stream_comment'),'comment_stream'); 
    164                                         } 
    165                                 }                
    166                                 var iCountOld=0; 
    167                                 if (bNotFlushNew) {                                                                      
    168                                         iCountOld=thisObj.countNewComment;                                       
    169                                 } else { 
    170                                         thisObj.aCommentNew=[]; 
    171                                 } 
    172                                 if (selfIdComment) { 
    173                                         thisObj.setCountNewComment(aCmt.length-1+iCountOld); 
    174                                         thisObj.hideCommentForm(thisObj.iCurrentShowFormComment);  
    175                                 } else { 
    176                                         thisObj.setCountNewComment(aCmt.length+iCountOld); 
    177                                 }                                
    178                                 aCmt.each(function(item,index) {    
    179                                         if (!(selfIdComment && selfIdComment==item.id)) { 
    180                                                 thisObj.aCommentNew.extend([item.id]); 
    181                                         }                                                                        
    182                                         thisObj.injectComment(item.idParent,item.id,item.html); 
    183                                 });  
    184                                  
    185                                 if (selfIdComment && $('comment_id_'+selfIdComment)) { 
    186                                                 thisObj.scrollToComment(selfIdComment); 
     145                (function(){ 
     146                        new Request.JSON({ 
     147                                url: thisObj.typeComment[typeTarget].url_response, 
     148                                noCache: true, 
     149                                data: { idCommentLast: idCommentLast, idTarget: idTarget, typeTarget: typeTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     150                                onSuccess: function(result){ 
     151                                        objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update.gif'); 
     152                                        if (!result) { 
     153                                                msgErrorBox.alert('Error','Please try again later'); 
    187154                                        } 
    188                         }                            
    189                 }, 
    190                 true 
    191        ); 
     155                                        if (result.bStateError) { 
     156                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     157                                        } else { 
     158                                                var aCmt=result.aComments; 
     159                                                if (aCmt.length>0 && result.iMaxIdComment) { 
     160                                                        thisObj.setIdCommentLast(result.iMaxIdComment); 
     161                                                        var countComments=$('count-comments'); 
     162                                                        countComments.set('text',parseInt(countComments.get('text'))+aCmt.length); 
     163                                                        if ($('block_stream_comment') && lsBlockStream) { 
     164                                                                lsBlockStream.toggle($('block_stream_comment'),'comment_stream'); 
     165                                                        } 
     166                                                } 
     167                                                var iCountOld=0; 
     168                                                if (bNotFlushNew) { 
     169                                                        iCountOld=thisObj.countNewComment; 
     170                                                } else { 
     171                                                        thisObj.aCommentNew=[]; 
     172                                                } 
     173                                                if (selfIdComment) { 
     174                                                        thisObj.setCountNewComment(aCmt.length-1+iCountOld); 
     175                                                        thisObj.hideCommentForm(thisObj.iCurrentShowFormComment); 
     176                                                } else { 
     177                                                        thisObj.setCountNewComment(aCmt.length+iCountOld); 
     178                                                } 
     179                                                aCmt.each(function(item,index) { 
     180                                                        if (!(selfIdComment && selfIdComment==item.id)) { 
     181                                                                thisObj.aCommentNew.extend([item.id]); 
     182                                                        } 
     183                                                        thisObj.injectComment(item.idParent,item.id,item.html); 
     184                                                }); 
     185 
     186                                                if (selfIdComment && $('comment_id_'+selfIdComment)) { 
     187                                                        thisObj.scrollToComment(selfIdComment); 
     188                                                } 
     189                                        } 
     190                                }, 
     191                                onFailure: function(){ 
     192                                        msgErrorBox.alert('Error','Please try again later'); 
     193                                } 
     194                        }).send(); 
    192195       }).delay(1000); 
    193196        }, 
     
    243246        addComment: function(formObj,targetId,targetType) { 
    244247                var thisObj=this; 
    245                 formObj=$(formObj);                      
    246                 JsHttpRequest.query( 
    247                 'POST '+thisObj.typeComment[targetType].url_add, 
    248                 { params: formObj, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    249                 function(result, errors) { 
    250                 if (!result) { 
     248                formObj=$(formObj);              
     249                var params=formObj.toQueryString(); 
     250                params=params+'&security_ls_key='+LIVESTREET_SECURITY_KEY; 
     251                 
     252                new Request.JSON({ 
     253                        url: thisObj.typeComment[targetType].url_add, 
     254                        noCache: true, 
     255                        data: params, 
     256                        onSuccess: function(result){ 
     257                                if (!result) { 
    251258                        thisObj.enableFormComment(); 
    252259                        msgErrorBox.alert('Error','Please try again later');   
     
    258265                        } else { 
    259266                                thisObj.responseNewComment(targetId,targetType,$('update-comments'),result.sCommentId,true);                                                                                             
    260                         }                            
    261                 }, 
    262                 true 
    263         ); 
     267                        } 
     268                        }, 
     269                        onFailure: function(){ 
     270                                msgErrorBox.alert('Error','Please try again later'); 
     271                        } 
     272                }).send(); 
     273 
    264274        $('form_comment_text').addClass('loader');               
    265275        $('form_comment_text').setProperty('readonly',true);             
     
    284294                 
    285295                var thisObj=this; 
    286                 JsHttpRequest.query( 
    287                 'POST '+DIR_WEB_ROOT+'/include/ajax/commentToggle.php', 
    288                 { idComment: commentId, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    289                 function(result, errors) {                        
    290                 if (!result) { 
     296                 
     297                new Request.JSON({ 
     298                        url: DIR_WEB_ROOT+'/include/ajax/commentToggle.php', 
     299                        noCache: true, 
     300                        data: { idComment: commentId, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     301                        onSuccess: function(result){ 
     302                                if (!result) { 
    291303                        msgErrorBox.alert('Error','Please try again later');            
    292304                        }       
     
    304316                                } 
    305317                                        obj.set('text',result.sTextToggle);                                                                                                      
    306                         }                            
    307                 }, 
    308                 true 
    309        ); 
     318                        } 
     319                        }, 
     320                        onFailure: function(){ 
     321                                msgErrorBox.alert('Error','Please try again later'); 
     322                        } 
     323                }).send(); 
    310324        }, 
    311325         
  • trunk/templates/skin/developer/js/favourites.js

    r923 r996  
    5454                params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    5555                 
    56                 JsHttpRequest.query( 
    57                         'POST '+this.typeFavourite[type].url,                        
    58                         params, 
    59                         function(result, errors) {      
    60                                 thisObj.onToggle(result, errors, thisObj);                                
    61                         }, 
    62                         true 
    63                 );              
     56                new Request.JSON({ 
     57                        url: this.typeFavourite[type].url, 
     58                        noCache: true, 
     59                        data: params, 
     60                        onSuccess: function(result){ 
     61                                thisObj.onToggle(result, thisObj); 
     62                        }, 
     63                        onFailure: function(){ 
     64                                msgErrorBox.alert('Error','Please try again later'); 
     65                        } 
     66                }).send(); 
    6467        }, 
    6568        
    66         onToggle: function(result, errors, thisObj) {             
     69        onToggle: function(result, thisObj) {             
    6770                if (!result) { 
    6871                msgErrorBox.alert('Error','Please try again later');            
  • trunk/templates/skin/developer/js/friend.js

    r923 r996  
    2828        } 
    2929         
    30         JsHttpRequest.query( 
    31         'POST '+sPath,                        
    32         { idUser: idUser,userText: sText, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    33         function(result, errors) {   
    34                 if (!result) { 
     30        new Request.JSON({ 
     31                url: sPath, 
     32                noCache: true, 
     33                data: { idUser: idUser,userText: sText, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     34                onSuccess: function(result){ 
     35                        if (!result) { 
    3536                msgErrorBox.alert('Error','Please try again later');          
    3637                                obj.getElement('form').getChildren().each(function(item){item.removeProperty('disabled')}); 
     
    4647                                obj.dispose(); 
    4748                } 
    48             }                                
    49         }, 
    50         true 
    51     ); 
     49            } 
     50                }, 
     51                onFailure: function(){ 
     52                        msgErrorBox.alert('Error','Please try again later'); 
     53                } 
     54        }).send(); 
    5255} 
    5356 
    5457function ajaxDeleteUserFriend(obj,idUser,sAction) {    
    5558        obj=$(obj).getParent('li'); 
    56         JsHttpRequest.query( 
    57         'POST '+aRouter.profile+'ajaxfrienddelete/',                          
    58         { idUser: idUser,sAction: sAction, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    59         function(result, errors) {   
    60                 if (!result) { 
     59                 
     60        new Request.JSON({ 
     61                url: aRouter.profile+'ajaxfrienddelete/', 
     62                noCache: true, 
     63                data: { idUser: idUser,sAction: sAction, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     64                onSuccess: function(result){ 
     65                        if (!result) { 
    6166                msgErrorBox.alert('Error','Please try again later');            
    6267                } 
     
    7075                                        obj.dispose(); 
    7176                } 
    72             }                                
    73         }, 
    74         true 
    75     ); 
     77            } 
     78                }, 
     79                onFailure: function(){ 
     80                        msgErrorBox.alert('Error','Please try again later'); 
     81                } 
     82        }).send(); 
    7683} 
  • trunk/templates/skin/developer/js/messages.js

    r923 r996  
    1717        errors:0,        
    1818                         
    19         requestObj: new JsHttpRequest(), 
    20                          
    2119        initialize: function(options){   
    2220                        var thisObj = this;  
     
    2927                                 
    3028                                if(this.errors<this.options.reload.errors&&this.options.reload.request>1) { 
    31                                         JsHttpRequest.query( 
    32                                                 'POST '+thisObj.options.reload.url, 
    33                                                 { security_ls_key: LIVESTREET_SECURITY_KEY  }, 
    34                                                 function(result, errors) { 
     29                                        new Request.JSON({ 
     30                                                url: thisObj.options.reload.url, 
     31                                                noCache: true, 
     32                                                data: { security_ls_key: LIVESTREET_SECURITY_KEY }, 
     33                                                onSuccess: function(result){ 
    3534                                                        if (!result) {                                                           
    3635                                                                thisObj.errors+=1; 
     
    5453                                                        } 
    5554                                                }, 
    56                                                 true 
    57                                         ); 
     55                                                onFailure: function(){ 
     56                                                        msgErrorBox.alert('Error','Please try again later'); 
     57                                                } 
     58                                        }).send(); 
    5859                                } 
    5960                        } 
  • trunk/templates/skin/developer/js/other.js

    r923 r996  
    66                text = $(textId).value;  
    77        }        
    8         JsHttpRequest.query( 
    9         'POST '+DIR_WEB_ROOT+'/include/ajax/textPreview.php',                        
    10         { text: text, save: save, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    11         function(result, errors) {   
    12                 if (!result) { 
     8         
     9        new Request.JSON({ 
     10                url: DIR_WEB_ROOT+'/include/ajax/textPreview.php', 
     11                noCache: true, 
     12                data: { text: text, save: save, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     13                onSuccess: function(result){ 
     14                        if (!result) { 
    1315                msgErrorBox.alert('Error','Please try again later');            
    1416                } 
     
    2224                        $(divPreview).set('html',result.sText).setStyle('display','block'); 
    2325                } 
    24             }                                
    25         }, 
    26         true 
    27     ); 
     26            } 
     27                }, 
     28                onFailure: function(){ 
     29                        msgErrorBox.alert('Error','Please try again later'); 
     30                } 
     31        }).send(); 
    2832} 
    2933 
  • trunk/templates/skin/developer/js/questions.js

    r923 r996  
    1 function ajaxQuestionVote(idTopic,idAnswer) {    
    2         JsHttpRequest.query( 
    3         'POST '+DIR_WEB_ROOT+'/include/ajax/questionVote.php',                        
    4         { idTopic: idTopic, idAnswer: idAnswer, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    5         function(result, errors) {   
    6                 if (!result) { 
     1function ajaxQuestionVote(idTopic,idAnswer) { 
     2        new Request.JSON({ 
     3                url: DIR_WEB_ROOT+'/include/ajax/questionVote.php', 
     4                noCache: true, 
     5                data: { idTopic: idTopic, idAnswer: idAnswer, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     6                onSuccess: function(result){ 
     7                        if (!result) { 
    78                msgErrorBox.alert('Error','Please try again later');            
    89                } 
     
    1415                        $('topic_question_area_'+idTopic).set('html',result.sText); 
    1516                }   
    16             }                                
    17         }, 
    18         true 
    19     );   
     17            } 
     18                }, 
     19                onFailure: function(){ 
     20                        msgErrorBox.alert('Error','Please try again later'); 
     21                } 
     22        }).send(); 
    2023} 
  • trunk/templates/skin/developer/js/vote.js

    r923 r996  
    6262                params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    6363                 
    64                 JsHttpRequest.query( 
    65                         'POST '+this.typeVote[type].url,                        
    66                         params, 
    67                         function(result, errors) {      
    68                                 thisObj.onVote(result, errors, thisObj);                                
    69                         }, 
    70                         true 
    71                 );              
     64                new Request.JSON({ 
     65                        url: this.typeVote[type].url, 
     66                        noCache: true, 
     67                        data: params, 
     68                        onSuccess: function(result){ 
     69                                thisObj.onVote(result, thisObj); 
     70                        }, 
     71                        onFailure: function(){ 
     72                                msgErrorBox.alert('Error','Please try again later'); 
     73                        } 
     74                }).send(); 
    7275        }, 
    7376        
    74         onVote: function(result, errors, thisObj) {             
     77        onVote: function(result, thisObj) {             
    7578                if (!result) { 
    7679                msgErrorBox.alert('Error','Please try again later');            
  • trunk/templates/skin/new/actions/ActionBlog/invited.tpl

    r831 r996  
    3535                                                        $('blog_admin_user_add').set('value',''); 
    3636                                                         
    37                                         JsHttpRequest.query( 
    38                                                'POST '+aRouter['blog']+'ajaxaddbloginvite/',                       
    39                                                 { users: sUsers, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    40                                                 function(result, errors) {      
    41                                                     if (!result) { 
    42                                                                         msgErrorBox.alert('Error','Please try again later');          
    43                                                                         }     
    44                                                                         if (result.bStateError) { 
    45                                                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    46                                                                         } else { 
    47                                                                                 var aUsers = result.aUsers; 
    48                                                                                 aUsers.each(function(item,index) {  
    49                                                                                         if(item.bStateError){ 
    50                                                                                                 msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
    51                                                                                         } else { 
    52                                                                                         addUserItem(item.sUserLogin,item.sUserWebPath); 
    53                                                                                         } 
    54                                                                                 }); 
    55                                                                         }                                  
    56                                                 }, 
    57                                                 true 
    58                                         );                                                       
     37                                                        new Request.JSON({ 
     38                                                                url: aRouter['blog']+'ajaxaddbloginvite/', 
     39                                                                noCache: true, 
     40                                                                data: { users: sUsers, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     41                                                                onSuccess: function(result){ 
     42                                                                        if (!result) { 
     43                                                                                msgErrorBox.alert('Error','Please try again later'); 
     44                                                                        } 
     45                                                                        if (result.bStateError) { 
     46                                                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     47                                                                        } else { 
     48                                                                                var aUsers = result.aUsers; 
     49                                                                                aUsers.each(function(item,index) { 
     50                                                                                        if(item.bStateError){ 
     51                                                                                                msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
     52                                                                                        } else { 
     53                                                                                                addUserItem(item.sUserLogin,item.sUserWebPath); 
     54                                                                                        } 
     55                                                                                }); 
     56                                                                        } 
     57                                                                }, 
     58                                                                onFailure: function(){ 
     59                                                                        msgErrorBox.alert('Error','Please try again later'); 
     60                                                                } 
     61                                                        }).send(); 
     62                                                                                         
    5963                                                        return false; 
    6064                                                } 
     65                                                 
    6166                                                function reBlogInvite(idUser,idBlog) { 
    62                                         JsHttpRequest.query( 
    63                                                'POST '+aRouter['blog']+'ajaxrebloginvite/',                       
    64                                                 { idUser: idUser, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    65                                                 function(result, errors) {      
    66                                                     if (!result) { 
    67                                                                         msgErrorBox.alert('Error','Please try again later');          
    68                                                                         }     
    69                                                                         if (result.bStateError) { 
    70                                                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    71                                                                         } else { 
    72                                                                                 msgNoticeBox.alert(result.sMsgTitle, result.sMsg); 
    73                                                                         }                                  
    74                                                 }, 
    75                                                 true 
    76                                         );                                                       
     67                                                         
     68                                                        new Request.JSON({ 
     69                                                                url: aRouter['blog']+'ajaxrebloginvite/', 
     70                                                                noCache: true, 
     71                                                                data: { idUser: idUser, idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     72                                                                onSuccess: function(result){ 
     73                                                                        if (!result) { 
     74                                                                                msgErrorBox.alert('Error','Please try again later'); 
     75                                                                        } 
     76                                                                        if (result.bStateError) { 
     77                                                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     78                                                                        } else { 
     79                                                                                msgNoticeBox.alert(result.sMsgTitle, result.sMsg); 
     80                                                                        } 
     81                                                                }, 
     82                                                                onFailure: function(){ 
     83                                                                        msgErrorBox.alert('Error','Please try again later'); 
     84                                                                } 
     85                                                        }).send(); 
    7786                                                        return false; 
    7887                                                }                                                
  • trunk/templates/skin/new/actions/ActionTalk/blacklist.tpl

    r780 r996  
    2323                                                        idTarget = element.get('id').replace('blacklist_item_',''); 
    2424                 
    25                                         JsHttpRequest.query( 
    26                                                 'POST '+aRouter['talk']+'ajaxdeletefromblacklist/',                                              
    27                                                 { idTarget: idTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    28                                                 function(result, errors) {      
    29                                                     if (!result) { 
    30                                                                         msgErrorBox.alert('Error','Please try again later'); 
    31                                                                         element.getParent().fade(1);            
    32                                                                         }     
    33                                                                         if (result.bStateError) { 
    34                                                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    35                                                                         element.getParent().fade(1); 
    36                                                                         } else { 
    37                                                                         element.getParent('li').destroy(); 
    38                                                                          
    39                                                                         if($('blackList').getElements('li').length==0) { 
    40                                                                                 $('blackList').destroy(); 
    41                                                                                 $('list_uncheck_all').setProperty('style','display:none'); 
    42                                                                         } 
    43                                                                         }                                  
    44                                                 }, 
    45                                                 true 
    46                                         );  
    47                                                                                                  
     25                                                        new Request.JSON({ 
     26                                                                url: aRouter['talk']+'ajaxdeletefromblacklist/', 
     27                                                                noCache: true, 
     28                                                                data: { idTarget: idTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     29                                                                onSuccess: function(result){ 
     30                                                                        if (!result) { 
     31                                                                                msgErrorBox.alert('Error','Please try again later'); 
     32                                                                                element.getParent().fade(1); 
     33                                                                        } 
     34                                                                        if (result.bStateError) { 
     35                                                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     36                                                                                element.getParent().fade(1); 
     37                                                                        } else { 
     38                                                                                element.getParent('li').destroy(); 
     39 
     40                                                                                if($('blackList').getElements('li').length==0) { 
     41                                                                                        $('blackList').destroy(); 
     42                                                                                        $('list_uncheck_all').setProperty('style','display:none'); 
     43                                                                                } 
     44                                                                        } 
     45                                                                }, 
     46                                                                onFailure: function(){ 
     47                                                                        msgErrorBox.alert('Error','Please try again later'); 
     48                                                                } 
     49                                                        }).send();                 
    4850                                                        return true; 
    4951                                                } 
     
    8486                                                        } 
    8587                                                        $('talk_blacklist_add').set('value',''); 
    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();                       
    108114                                                        return false; 
    109115                                                } 
  • trunk/templates/skin/new/actions/ActionTalk/speakers.tpl

    r553 r996  
    2424                                                        idTarget = element.get('id').replace('speaker_item_',''); 
    2525                 
    26                                         JsHttpRequest.query( 
    27                                                 'POST '+aRouter['talk']+'ajaxdeletetalkuser/',                       
    28                                                 { idTarget:idTarget,idTalk:idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    29                                                 function(result, errors) {      
    30                                                     if (!result) { 
    31                                                                         msgErrorBox.alert('Error','Please try again later'); 
    32                                                                         element.getParent().fade(1);            
    33                                                                         }     
    34                                                                         if (result.bStateError) { 
    35                                                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    36                                                                         element.getParent().fade(1); 
    37                                                                         } else { 
    38                                                                         element.getParent('li').destroy(); 
    39                                                                         }                                  
    40                                                 }, 
    41                                                 true 
    42                                         );  
    43                                                                                                  
     26                                                        new Request.JSON({ 
     27                                                                url: aRouter['talk']+'ajaxdeletetalkuser/', 
     28                                                                noCache: true, 
     29                                                                data: { idTarget:idTarget,idTalk:idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     30                                                                onSuccess: function(result){ 
     31                                                                        if (!result) { 
     32                                                                                msgErrorBox.alert('Error','Please try again later'); 
     33                                                                                element.getParent().fade(1); 
     34                                                                        } 
     35                                                                        if (result.bStateError) { 
     36                                                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     37                                                                                element.getParent().fade(1); 
     38                                                                        } else { 
     39                                                                                element.getParent('li').destroy(); 
     40                                                                        } 
     41                                                                }, 
     42                                                                onFailure: function(){ 
     43                                                                        msgErrorBox.alert('Error','Please try again later'); 
     44                                                                } 
     45                                                        }).send();                                                                       
    4446                                                        return true; 
    4547                                                } 
     
    7577                                                        } 
    7678                                                        $('talk_speaker_add').set('value',''); 
    77                                         JsHttpRequest.query( 
    78                                                 'POST '+aRouter['talk']+'ajaxaddtalkuser/',                       
    79                                                 { users: sUsers, idTalk: idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    80                                                 function(result, errors) {      
    81                                                     if (!result) { 
    82                                                                         msgErrorBox.alert('Error','Please try again later');          
    83                                                                         }     
    84                                                                         if (result.bStateError) { 
    85                                                                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    86                                                                         } else { 
    87                                                                                 var aUsers = result.aUsers; 
    88                                                                                 aUsers.each(function(item,index) {  
    89                                                                                         if(item.bStateError){ 
    90                                                                                                 msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
    91                                                                                         } else { 
    92                                                                                         addListItem(item.sUserId,item.sUserLogin,item.sUserLink,idTalk); 
    93                                                                                         } 
    94                                                                                 }); 
    95                                                                         }                                  
    96                                                 }, 
    97                                                 true 
    98                                         );                                                       
     79                                                         
     80                                                        new Request.JSON({ 
     81                                                                url: aRouter['talk']+'ajaxaddtalkuser/', 
     82                                                                noCache: true, 
     83                                                                data: { users: sUsers, idTalk: idTalk, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     84                                                                onSuccess: function(result){ 
     85                                                                        if (!result) { 
     86                                                                                msgErrorBox.alert('Error','Please try again later'); 
     87                                                                        } 
     88                                                                        if (result.bStateError) { 
     89                                                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     90                                                                        } else { 
     91                                                                                var aUsers = result.aUsers; 
     92                                                                                aUsers.each(function(item,index) { 
     93                                                                                        if(item.bStateError){ 
     94                                                                                                msgErrorBox.alert(item.sMsgTitle, item.sMsg); 
     95                                                                                        } else { 
     96                                                                                                addListItem(item.sUserId,item.sUserLogin,item.sUserLink,idTalk); 
     97                                                                                        } 
     98                                                                                }); 
     99                                                                        } 
     100                                                                }, 
     101                                                                onFailure: function(){ 
     102                                                                        msgErrorBox.alert('Error','Please try again later'); 
     103                                                                } 
     104                                                        }).send();                               
    99105                                                        return false; 
    100106                                                } 
  • trunk/templates/skin/new/js/block_loader.js

    r624 r996  
    5858                        params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    5959                } 
    60             JsHttpRequest.query( 
    61                 'POST '+this.type[type].url,                        
    62                 params, 
    63                 function(result, errors) {      
    64                         thisObj.onLoad(result, errors, blockContent);                                
    65                 }, 
    66                 true 
    67             ); 
    68              
     60                 
     61                new Request.JSON({ 
     62                        url: this.type[type].url, 
     63                        noCache: true, 
     64                        data: params, 
     65                        onSuccess: function(result){ 
     66                                thisObj.onLoad(result, blockContent); 
     67                        }, 
     68                        onFailure: function(){ 
     69                                msgErrorBox.alert('Error','Please try again later'); 
     70                        } 
     71                }).send();             
    6972                }, 
    7073                 
    71                 onLoad: function(result, errors, blockContent) { 
     74                onLoad: function(result, blockContent) { 
    7275                        blockContent.set('html',''); 
    7376                        if (!result) { 
  • trunk/templates/skin/new/js/blog.js

    r550 r996  
    11function ajaxJoinLeaveBlog(obj,idBlog) {    
    22        obj=$(obj); 
    3         JsHttpRequest.query( 
    4         'POST '+DIR_WEB_ROOT+'/include/ajax/joinLeaveBlog.php', 
    5         { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    6         function(result, errors) { 
    7                 if (!result) { 
     3         
     4        new Request.JSON({ 
     5                url: DIR_WEB_ROOT+'/include/ajax/joinLeaveBlog.php', 
     6                noCache: true, 
     7                data: { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     8                onSuccess: function(result){ 
     9                        if (!result) { 
    810                msgErrorBox.alert('Error','Please try again later'); 
    911                } 
     
    2325                } 
    2426            } 
    25         }, 
    26         true 
    27     ); 
     27                }, 
     28                onFailure: function(){ 
     29                        msgErrorBox.alert('Error','Please try again later'); 
     30                } 
     31        }).send(); 
     32         
    2833} 
    2934 
    3035 
    31 function ajaxBlogInfo(idBlog) {          
    32         JsHttpRequest.query( 
    33         'POST '+DIR_WEB_ROOT+'/include/ajax/blogInfo.php',                        
    34         { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY  }, 
    35         function(result, errors) {   
    36                 if (!result) { 
    37                 msgErrorBox.alert('Error','Please try again later');            
    38                 } 
    39             if (result.bStateError) { 
    40                  
    41             } else {                     
    42                 if ($('block_blog_info')) { 
    43                         $('block_blog_info').set('html',result.sText);                           
    44                 } 
    45             }                                
    46         }, 
    47         true 
    48     ); 
     36function ajaxBlogInfo(idBlog) { 
     37        new Request.JSON({ 
     38                url: DIR_WEB_ROOT+'/include/ajax/blogInfo.php', 
     39                noCache: true, 
     40                data: { idBlog: idBlog, security_ls_key: LIVESTREET_SECURITY_KEY  }, 
     41                onSuccess: function(result){ 
     42                        if (!result) { 
     43                                msgErrorBox.alert('Error','Please try again later'); 
     44                        } 
     45                        if (result.bStateError) { 
     46 
     47                        } else { 
     48                                if ($('block_blog_info')) { 
     49                                        $('block_blog_info').set('html',result.sText); 
     50                                } 
     51                        } 
     52                }, 
     53                onFailure: function(){ 
     54                        msgErrorBox.alert('Error','Please try again later'); 
     55                } 
     56        }).send(); 
    4957} 
  • trunk/templates/skin/new/js/comments.js

    r742 r996  
    142142                objImg=$(objImg); 
    143143                objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update_act.gif');      
    144                 (function(){             
    145                 JsHttpRequest.query(             
    146                 'POST '+thisObj.typeComment[typeTarget].url_response, 
    147                 { idCommentLast: idCommentLast, idTarget: idTarget, typeTarget: typeTarget, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    148                 function(result, errors) {                       
    149                         objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update.gif');  
    150                 if (!result) { 
    151                         msgErrorBox.alert('Error','Please try again later');            
    152                         }       
    153                         if (result.bStateError) { 
    154                         msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
    155                         } else {    
    156                                 var aCmt=result.aComments;                               
    157                                 if (aCmt.length>0 && result.iMaxIdComment) { 
    158                                         thisObj.setIdCommentLast(result.iMaxIdComment); 
    159                                         var countComments=$('count-comments'); 
    160                                         countComments.set('text',parseInt(countComments.get('text'))+aCmt.length); 
    161                                         if ($('block_stream_comment') && lsBlockStream) { 
    162                                                 lsBlockStream.toggle($('block_stream_comment'),'comment_stream'); 
    163                                         } 
    164                                 }                
    165                                 var iCountOld=0; 
    166                                 if (bNotFlushNew) {                                                                      
    167                                         iCountOld=thisObj.countNewComment;                                       
    168                                 } else { 
    169                                         thisObj.aCommentNew=[]; 
    170                                 } 
    171                                 if (selfIdComment) { 
    172                                         thisObj.setCountNewComment(aCmt.length-1+iCountOld); 
    173                                         thisObj.hideCommentForm(thisObj.iCurrentShowFormComment);  
    174                                 } else { 
    175                                         thisObj.setCountNewComment(aCmt.length+iCountOld); 
    176                                 }                                
    177                                 aCmt.each(function(item,index) {    
    178                                         if (!(selfIdComment && selfIdComment==item.id)) { 
    179                                                 thisObj.aCommentNew.extend([item.id]); 
    180                                         }                                                                        
    181                                         thisObj.injectComment(item.idParent,item.id,item.html); 
    182                                 });  
    183                                  
    184                                 if (selfIdComment && $('comment_id_'+selfIdComment)) { 
    185                                                 thisObj.scrollToComment(selfIdComment); 
     144                (function(){     
     145                         
     146                        new Request.JSON({ 
     147                                url: thisObj.typeComment[typeTarget].url_response, 
     148                                noCache: true, 
     149                                data: { idCommentLast: idCommentLast, idTarget: idTarget, typeTarget: typeTarget, security_ls_key: LIVESTREET_SECURITY_KEY  }, 
     150                                onSuccess: function(result){ 
     151                                        objImg.setProperty('src',DIR_STATIC_SKIN+'/images/update.gif'); 
     152                                        if (!result) { 
     153                                                msgErrorBox.alert('Error','Please try again later'); 
    186154                                        } 
    187                         }                            
    188                 }, 
    189                 true 
    190        ); 
     155                                        if (result.bStateError) { 
     156                                                msgErrorBox.alert(result.sMsgTitle,result.sMsg); 
     157                                        } else { 
     158                                                var aCmt=result.aComments; 
     159                                                if (aCmt.length>0 && result.iMaxIdComment) { 
     160                                                        thisObj.setIdCommentLast(result.iMaxIdComment); 
     161                                                        var countComments=$('count-comments'); 
     162                                                        countComments.set('text',parseInt(countComments.get('text'))+aCmt.length); 
     163                                                        if ($('block_stream_comment') && lsBlockStream) { 
     164                                                                lsBlockStream.toggle($('block_stream_comment'),'comment_stream'); 
     165                                                        } 
     166                                                } 
     167                                                var iCountOld=0; 
     168                                                if (bNotFlushNew) { 
     169                                                        iCountOld=thisObj.countNewComment; 
     170                                                } else { 
     171                                                        thisObj.aCommentNew=[]; 
     172                                                } 
     173                                                if (selfIdComment) { 
     174                                                        thisObj.setCountNewComment(aCmt.length-1+iCountOld); 
     175                                                        thisObj.hideCommentForm(thisObj.iCurrentShowFormComment); 
     176                                                } else { 
     177                                                        thisObj.setCountNewComment(aCmt.length+iCountOld); 
     178                                                } 
     179                                                aCmt.each(function(item,index) { 
     180                                                        if (!(selfIdComment && selfIdComment==item.id)) { 
     181                                                                thisObj.aCommentNew.extend([item.id]); 
     182                                                        } 
     183                                                        thisObj.injectComment(item.idParent,item.id,item.html); 
     184                                                }); 
     185 
     186                                                if (selfIdComment && $('comment_id_'+selfIdComment)) { 
     187                                                        thisObj.scrollToComment(selfIdComment); 
     188                                                } 
     189                                        } 
     190                                }, 
     191                                onFailure: function(){ 
     192                                        msgErrorBox.alert('Error','Please try again later'); 
     193                                } 
     194                        }).send(); 
     195                         
    191196       }).delay(1000); 
    192197        }, 
     
    242247        addComment: function(formObj,targetId,targetType) { 
    243248                var thisObj=this; 
    244                 formObj=$(formObj);                      
    245                 JsHttpRequest.query( 
    246                 'POST '+thisObj.typeComment[targetType].url_add, 
    247                 { params: formObj, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    248                 function(result, errors) { 
    249                 if (!result) { 
     249                formObj=$(formObj);              
     250                var params=formObj.toQueryString(); 
     251                params=params+'&security_ls_key='+LIVESTREET_SECURITY_KEY; 
     252                 
     253                new Request.JSON({ 
     254                        url: thisObj.typeComment[targetType].url_add, 
     255                        noCache: true, 
     256                        data: params, 
     257                        onSuccess: function(result){ 
     258                                if (!result) { 
    250259                        thisObj.enableFormComment(); 
    251260                        msgErrorBox.alert('Error','Please try again later');   
     
    257266                        } else { 
    258267                                thisObj.responseNewComment(targetId,targetType,$('update-comments'),result.sCommentId,true);                                                                                             
    259                         }                            
    260                 }, 
    261                 true 
    262         ); 
     268                        } 
     269                        }, 
     270                        onFailure: function(){ 
     271                                msgErrorBox.alert('Error','Please try again later'); 
     272                        } 
     273                }).send(); 
     274 
    263275        $('form_comment_text').addClass('loader');               
    264276        $('form_comment_text').setProperty('readonly',true);             
     
    282294                 
    283295                var thisObj=this; 
    284                 JsHttpRequest.query( 
    285                 'POST '+DIR_WEB_ROOT+'/include/ajax/commentToggle.php', 
    286                 { idComment: commentId, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    287                 function(result, errors) {                        
    288                 if (!result) { 
     296                 
     297                new Request.JSON({ 
     298                        url: DIR_WEB_ROOT+'/include/ajax/commentToggle.php', 
     299                        noCache: true, 
     300                        data: { idComment: commentId, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     301                        onSuccess: function(result){ 
     302                                if (!result) { 
    289303                        msgErrorBox.alert('Error','Please try again later');            
    290304                        }       
     
    302316                                } 
    303317                                        obj.set('text',result.sTextToggle);                                                                                                      
    304                         }                            
    305                 }, 
    306                 true 
    307        ); 
     318                        } 
     319                                 
     320                        }, 
     321                        onFailure: function(){ 
     322                                msgErrorBox.alert('Error','Please try again later'); 
     323                        } 
     324                }).send(); 
     325 
    308326        }, 
    309327         
  • trunk/templates/skin/new/js/favourites.js

    r550 r996  
    5555                params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    5656                 
    57                 JsHttpRequest.query( 
    58                         'POST '+this.typeFavourite[type].url,                        
    59                         params, 
    60                         function(result, errors) {      
    61                                 thisObj.onToggle(result, errors, thisObj);                                
    62                         }, 
    63                         true 
    64                 );              
     57                new Request.JSON({ 
     58                        url: this.typeFavourite[type].url, 
     59                        noCache: true, 
     60                        data: params, 
     61                        onSuccess: function(result){ 
     62                                thisObj.onToggle(result, thisObj); 
     63                        }, 
     64                        onFailure: function(){ 
     65                                msgErrorBox.alert('Error','Please try again later'); 
     66                        } 
     67                }).send(); 
    6568        }, 
    6669        
    67         onToggle: function(result, errors, thisObj) {             
     70        onToggle: function(result, thisObj) {             
    6871                if (!result) { 
    6972                msgErrorBox.alert('Error','Please try again later');            
  • trunk/templates/skin/new/js/friend.js

    r550 r996  
    2828        } 
    2929         
    30         JsHttpRequest.query( 
    31         'POST '+sPath,                        
    32         { idUser: idUser,userText: sText, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    33         function(result, errors) {   
    34                 if (!result) { 
     30        new Request.JSON({ 
     31                url: sPath, 
     32                noCache: true, 
     33                data: { idUser: idUser,userText: sText, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     34                onSuccess: function(result){ 
     35                        if (!result) { 
    3536                msgErrorBox.alert('Error','Please try again later');          
    3637                                obj.getElement('form').getChildren().each(function(item){item.removeProperty('disabled')}); 
     
    4647                                obj.dispose(); 
    4748                } 
    48             }                                
    49         }, 
    50         true 
    51     ); 
     49            } 
     50                }, 
     51                onFailure: function(){ 
     52                        msgErrorBox.alert('Error','Please try again later'); 
     53                } 
     54        }).send(); 
    5255} 
    5356 
    5457function ajaxDeleteUserFriend(obj,idUser,sAction) {    
    5558        obj=$(obj).getParent('li'); 
    56         JsHttpRequest.query( 
    57         'POST '+aRouter.profile+'ajaxfrienddelete/',                          
    58         { idUser: idUser,sAction: sAction, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    59         function(result, errors) {   
    60                 if (!result) { 
     59                 
     60        new Request.JSON({ 
     61                url: aRouter.profile+'ajaxfrienddelete/', 
     62                noCache: true, 
     63                data: { idUser: idUser,sAction: sAction, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     64                onSuccess: function(result){ 
     65                        if (!result) { 
    6166                msgErrorBox.alert('Error','Please try again later');            
    6267                } 
     
    7075                                        obj.dispose(); 
    7176                } 
    72             }                                
    73         }, 
    74         true 
    75     ); 
     77            } 
     78                }, 
     79                onFailure: function(){ 
     80                        msgErrorBox.alert('Error','Please try again later'); 
     81                } 
     82        }).send(); 
    7683} 
  • trunk/templates/skin/new/js/messages.js

    r550 r996  
    1717        errors:0,        
    1818                         
    19         requestObj: new JsHttpRequest(), 
    20                          
    2119        initialize: function(options){   
    2220                        var thisObj = this;  
     
    2927                                 
    3028                                if(this.errors<this.options.reload.errors&&this.options.reload.request>1) { 
    31                                         JsHttpRequest.query( 
    32                                                 'POST '+thisObj.options.reload.url, 
    33                                                 { security_ls_key: LIVESTREET_SECURITY_KEY  }, 
    34                                                 function(result, errors) { 
     29                                        new Request.JSON({ 
     30                                                url: thisObj.options.reload.url, 
     31                                                noCache: true, 
     32                                                data: { security_ls_key: LIVESTREET_SECURITY_KEY }, 
     33                                                onSuccess: function(result){ 
    3534                                                        if (!result) {                                                           
    3635                                                                thisObj.errors+=1; 
     
    5453                                                        } 
    5554                                                }, 
    56                                                 true 
    57                                         ); 
     55                                                onFailure: function(){ 
     56                                                        msgErrorBox.alert('Error','Please try again later'); 
     57                                                } 
     58                                        }).send(); 
    5859                                } 
    5960                        } 
  • trunk/templates/skin/new/js/other.js

    r701 r996  
    66                text = $(textId).value;  
    77        }        
    8         JsHttpRequest.query( 
    9         'POST '+DIR_WEB_ROOT+'/include/ajax/textPreview.php',                        
    10         { text: text, save: save, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    11         function(result, errors) {   
    12                 if (!result) { 
     8         
     9        new Request.JSON({ 
     10                url: DIR_WEB_ROOT+'/include/ajax/textPreview.php', 
     11                noCache: true, 
     12                data: { text: text, save: save, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     13                onSuccess: function(result){ 
     14                        if (!result) { 
    1315                msgErrorBox.alert('Error','Please try again later');            
    1416                } 
     
    2224                        $(divPreview).set('html',result.sText).setStyle('display','block'); 
    2325                } 
    24             }                                
    25         }, 
    26         true 
    27     ); 
     26            } 
     27                }, 
     28                onFailure: function(){ 
     29                        msgErrorBox.alert('Error','Please try again later'); 
     30                } 
     31        }).send(); 
    2832} 
    2933 
  • trunk/templates/skin/new/js/questions.js

    r550 r996  
    1 function ajaxQuestionVote(idTopic,idAnswer) {    
    2         JsHttpRequest.query( 
    3         'POST '+DIR_WEB_ROOT+'/include/ajax/questionVote.php',                        
    4         { idTopic: idTopic, idAnswer: idAnswer, security_ls_key: LIVESTREET_SECURITY_KEY }, 
    5         function(result, errors) {   
    6                 if (!result) { 
     1function ajaxQuestionVote(idTopic,idAnswer) { 
     2        new Request.JSON({ 
     3                url: DIR_WEB_ROOT+'/include/ajax/questionVote.php', 
     4                noCache: true, 
     5                data: { idTopic: idTopic, idAnswer: idAnswer, security_ls_key: LIVESTREET_SECURITY_KEY }, 
     6                onSuccess: function(result){ 
     7                        if (!result) { 
    78                msgErrorBox.alert('Error','Please try again later');            
    89                } 
     
    1415                        $('topic_question_area_'+idTopic).set('html',result.sText); 
    1516                }   
    16             }                                
    17         }, 
    18         true 
    19     );   
     17            } 
     18                }, 
     19                onFailure: function(){ 
     20                        msgErrorBox.alert('Error','Please try again later'); 
     21                } 
     22        }).send(); 
    2023} 
  • trunk/templates/skin/new/js/vote.js

    r550 r996  
    6262                params['security_ls_key']=LIVESTREET_SECURITY_KEY; 
    6363                 
    64                 JsHttpRequest.query( 
    65                         'POST '+this.typeVote[type].url,                        
    66                         params, 
    67                         function(result, errors) {      
    68                                 thisObj.onVote(result, errors, thisObj);                                
    69                         }, 
    70                         true 
    71                 );              
     64                new Request.JSON({ 
     65                        url: this.typeVote[type].url, 
     66                        noCache: true, 
     67                        data: params, 
     68                        onSuccess: function(result){ 
     69                                thisObj.onVote(result, thisObj); 
     70                        }, 
     71                        onFailure: function(){ 
     72                                msgErrorBox.alert('Error','Please try again later'); 
     73                        } 
     74                }).send(); 
    7275        }, 
    7376        
    74         onVote: function(result, errors, thisObj) {             
     77        onVote: function(result, thisObj) {             
    7578                if (!result) { 
    7679                msgErrorBox.alert('Error','Please try again later');