Changeset 996
- Timestamp:
- 08/21/10 20:31:41 (18 months ago)
- Location:
- trunk
- Files:
-
- 45 modified
-
classes/actions/ActionBlog.class.php (modified) (3 diffs)
-
classes/actions/ActionProfile.class.php (modified) (3 diffs)
-
classes/actions/ActionTalk.class.php (modified) (6 diffs)
-
include/ajax/blogInfo.php (modified) (1 diff)
-
include/ajax/blogs_join.php (modified) (2 diffs)
-
include/ajax/blogs_self.php (modified) (2 diffs)
-
include/ajax/blogs_top.php (modified) (2 diffs)
-
include/ajax/commentFavourite.php (modified) (2 diffs)
-
include/ajax/commentResponse.php (modified) (2 diffs)
-
include/ajax/commentToggle.php (modified) (2 diffs)
-
include/ajax/joinLeaveBlog.php (modified) (2 diffs)
-
include/ajax/questionVote.php (modified) (2 diffs)
-
include/ajax/stream_comment.php (modified) (2 diffs)
-
include/ajax/stream_topic.php (modified) (2 diffs)
-
include/ajax/talkFavourite.php (modified) (2 diffs)
-
include/ajax/talkNewMessages.php (modified) (2 diffs)
-
include/ajax/textPreview.php (modified) (1 diff)
-
include/ajax/topicFavourite.php (modified) (2 diffs)
-
include/ajax/voteBlog.php (modified) (2 diffs)
-
include/ajax/voteComment.php (modified) (2 diffs)
-
include/ajax/voteTopic.php (modified) (2 diffs)
-
include/ajax/voteUser.php (modified) (2 diffs)
-
templates/skin/developer/actions/ActionTalk/blacklist.tpl (modified) (2 diffs)
-
templates/skin/developer/actions/ActionTalk/speakers.tpl (modified) (3 diffs)
-
templates/skin/developer/js/block_loader.js (modified) (1 diff)
-
templates/skin/developer/js/blog.js (modified) (5 diffs)
-
templates/skin/developer/js/comments.js (modified) (5 diffs)
-
templates/skin/developer/js/favourites.js (modified) (1 diff)
-
templates/skin/developer/js/friend.js (modified) (3 diffs)
-
templates/skin/developer/js/messages.js (modified) (3 diffs)
-
templates/skin/developer/js/other.js (modified) (2 diffs)
-
templates/skin/developer/js/questions.js (modified) (2 diffs)
-
templates/skin/developer/js/vote.js (modified) (1 diff)
-
templates/skin/new/actions/ActionBlog/invited.tpl (modified) (1 diff)
-
templates/skin/new/actions/ActionTalk/blacklist.tpl (modified) (2 diffs)
-
templates/skin/new/actions/ActionTalk/speakers.tpl (modified) (2 diffs)
-
templates/skin/new/js/block_loader.js (modified) (1 diff)
-
templates/skin/new/js/blog.js (modified) (2 diffs)
-
templates/skin/new/js/comments.js (modified) (5 diffs)
-
templates/skin/new/js/favourites.js (modified) (1 diff)
-
templates/skin/new/js/friend.js (modified) (3 diffs)
-
templates/skin/new/js/messages.js (modified) (3 diffs)
-
templates/skin/new/js/other.js (modified) (2 diffs)
-
templates/skin/new/js/questions.js (modified) (2 diffs)
-
templates/skin/new/js/vote.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/classes/actions/ActionBlog.class.php
r892 r996 787 787 */ 788 788 protected function AjaxAddComment() { 789 $this->Viewer_SetResponseAjax( );789 $this->Viewer_SetResponseAjax('json'); 790 790 $this->SubmitComment(); 791 791 } … … 947 947 */ 948 948 protected function AjaxAddBlogInvite() { 949 $this->Viewer_SetResponseAjax( );949 $this->Viewer_SetResponseAjax('json'); 950 950 $sUsers=getRequest('users',null,'post'); 951 951 $sBlogId=getRequest('idBlog',null,'post'); … … 1093 1093 */ 1094 1094 protected function AjaxReBlogInvite() { 1095 $this->Viewer_SetResponseAjax( );1095 $this->Viewer_SetResponseAjax('json'); 1096 1096 $sUserId=getRequest('idUser',null,'post'); 1097 1097 $sBlogId=getRequest('idBlog',null,'post'); -
trunk/classes/actions/ActionProfile.class.php
r995 r996 277 277 278 278 public function EventAjaxFriendAccept() { 279 $this->Viewer_SetResponseAjax( );279 $this->Viewer_SetResponseAjax('json'); 280 280 $sUserId=getRequest('idUser',null,'post'); 281 281 … … 386 386 387 387 public function EventAjaxFriendAdd() { 388 $this->Viewer_SetResponseAjax( );388 $this->Viewer_SetResponseAjax('json'); 389 389 $sUserId=getRequest('idUser'); 390 390 $sUserText=getRequest('userText',''); … … 586 586 */ 587 587 public function EventAjaxFriendDelete() { 588 $this->Viewer_SetResponseAjax( );588 $this->Viewer_SetResponseAjax('json'); 589 589 $sUserId=getRequest('idUser',null,'post'); 590 590 -
trunk/classes/actions/ActionTalk.class.php
r891 r996 420 420 */ 421 421 protected function AjaxResponseComment() { 422 $this->Viewer_SetResponseAjax( );422 $this->Viewer_SetResponseAjax('json'); 423 423 $idCommentLast=getRequest('idCommentLast'); 424 424 /** … … 471 471 */ 472 472 protected function AjaxAddComment() { 473 $this->Viewer_SetResponseAjax( );473 $this->Viewer_SetResponseAjax('json'); 474 474 $this->SubmitComment(); 475 475 } … … 595 595 */ 596 596 public function AjaxAddToBlacklist() { 597 $this->Viewer_SetResponseAjax( );597 $this->Viewer_SetResponseAjax('json'); 598 598 $sUsers=getRequest('users',null,'post'); 599 599 … … 678 678 */ 679 679 public function AjaxDeleteFromBlacklist() { 680 $this->Viewer_SetResponseAjax( );680 $this->Viewer_SetResponseAjax('json'); 681 681 $idTarget=getRequest('idTarget',null,'post'); 682 682 … … 738 738 */ 739 739 public function AjaxDeleteTalkUser() { 740 $this->Viewer_SetResponseAjax( );740 $this->Viewer_SetResponseAjax('json'); 741 741 $idTarget=getRequest('idTarget',null,'post'); 742 742 $idTalk=getRequest('idTalk',null,'post'); … … 814 814 */ 815 815 public function AjaxAddTalkUser() { 816 $this->Viewer_SetResponseAjax( );816 $this->Viewer_SetResponseAjax('json'); 817 817 $sUsers=getRequest('users',null,'post'); 818 818 $idTalk=getRequest('idTalk',null,'post'); -
trunk/include/ajax/blogInfo.php
r548 r996 43 43 44 44 45 $ GLOBALS['_RESULT']= array(45 $aResult = array( 46 46 "bStateError" => $bStateError, 47 47 "sText" => $sText, 48 48 ); 49 49 50 if (!headers_sent()) { 51 header('Content-type: application/json'); 52 } 53 echo json_encode($aResult); 50 54 ?> -
trunk/include/ajax/blogs_join.php
r413 r996 45 45 } 46 46 47 $ GLOBALS['_RESULT']= array(47 $aResult = array( 48 48 "bStateError" => $bStateError, 49 49 "sText" => $sTextResult, … … 52 52 ); 53 53 54 if (!headers_sent()) { 55 header('Content-type: application/json'); 56 } 57 echo json_encode($aResult); 54 58 ?> -
trunk/include/ajax/blogs_self.php
r413 r996 45 45 } 46 46 47 $ GLOBALS['_RESULT']= array(47 $aResult = array( 48 48 "bStateError" => $bStateError, 49 49 "sText" => $sTextResult, … … 52 52 ); 53 53 54 if (!headers_sent()) { 55 header('Content-type: application/json'); 56 } 57 echo json_encode($aResult); 54 58 ?> -
trunk/include/ajax/blogs_top.php
r413 r996 42 42 43 43 44 $ GLOBALS['_RESULT']= array(44 $aResult = array( 45 45 "bStateError" => $bStateError, 46 46 "sText" => $sTextResult, … … 49 49 ); 50 50 51 if (!headers_sent()) { 52 header('Content-type: application/json'); 53 } 54 echo json_encode($aResult); 51 55 ?> -
trunk/include/ajax/commentFavourite.php
r548 r996 87 87 88 88 89 $ GLOBALS['_RESULT']= array(89 $aResult = array( 90 90 "bStateError" => $bStateError, 91 91 "bState" => $bState, … … 94 94 ); 95 95 96 if (!headers_sent()) { 97 header('Content-type: application/json'); 98 } 99 echo json_encode($aResult); 96 100 ?> -
trunk/include/ajax/commentResponse.php
r548 r996 65 65 } 66 66 67 $ GLOBALS['_RESULT']= array(67 $aResult = array( 68 68 "bStateError" => $bStateError, 69 69 "sMsgTitle" => $sMsgTitle, … … 73 73 ); 74 74 75 if (!headers_sent()) { 76 header('Content-type: application/json'); 77 } 78 echo json_encode($aResult); 75 79 ?> -
trunk/include/ajax/commentToggle.php
r548 r996 64 64 65 65 66 $ GLOBALS['_RESULT']= array(66 $aResult = array( 67 67 "bStateError" => $bStateError, 68 68 "bState" => $bState, … … 72 72 ); 73 73 74 if (!headers_sent()) { 75 header('Content-type: application/json'); 76 } 77 echo json_encode($aResult); 74 78 ?> -
trunk/include/ajax/joinLeaveBlog.php
r891 r996 110 110 111 111 112 $ GLOBALS['_RESULT']= array(112 $aResult = array( 113 113 "bStateError" => $bStateError, 114 114 "bState" => $bState, … … 118 118 ); 119 119 120 if (!headers_sent()) { 121 header('Content-type: application/json'); 122 } 123 echo json_encode($aResult); 120 124 ?> -
trunk/include/ajax/questionVote.php
r548 r996 82 82 } 83 83 84 $ GLOBALS['_RESULT']= array(84 $aResult = array( 85 85 "bStateError" => $bStateError, 86 86 "sText" => $sTextResult, … … 89 89 ); 90 90 91 if (!headers_sent()) { 92 header('Content-type: application/json'); 93 } 94 echo json_encode($aResult); 91 95 ?> -
trunk/include/ajax/stream_comment.php
r413 r996 41 41 42 42 43 $ GLOBALS['_RESULT']= array(43 $aResult = array( 44 44 "bStateError" => $bStateError, 45 45 "sText" => $sTextResult, … … 48 48 ); 49 49 50 if (!headers_sent()) { 51 header('Content-type: application/json'); 52 } 53 echo json_encode($aResult); 50 54 ?> -
trunk/include/ajax/stream_topic.php
r413 r996 41 41 42 42 43 $ GLOBALS['_RESULT']= array(43 $aResult = array( 44 44 "bStateError" => $bStateError, 45 45 "sText" => $sTextResult, … … 48 48 ); 49 49 50 if (!headers_sent()) { 51 header('Content-type: application/json'); 52 } 53 echo json_encode($aResult); 50 54 ?> -
trunk/include/ajax/talkFavourite.php
r548 r996 87 87 88 88 89 $ GLOBALS['_RESULT']= array(89 $aResult = array( 90 90 "bStateError" => $bStateError, 91 91 "bState" => $bState, … … 94 94 ); 95 95 96 if (!headers_sent()) { 97 header('Content-type: application/json'); 98 } 99 echo json_encode($aResult); 96 100 ?> -
trunk/include/ajax/talkNewMessages.php
r428 r996 37 37 } 38 38 39 $ GLOBALS['_RESULT']= array(39 $aResult = array( 40 40 "bStateError" => $bStateError, 41 41 "sMsgTitle" => $sMsgTitle, … … 44 44 ); 45 45 46 if (!headers_sent()) { 47 header('Content-type: application/json'); 48 } 49 echo json_encode($aResult); 46 50 ?> -
trunk/include/ajax/textPreview.php
r548 r996 37 37 } 38 38 39 $ GLOBALS['_RESULT']= array(39 $aResult = array( 40 40 "bStateError" => $bStateError, 41 41 "sText" => $sTextResult, 42 42 ); 43 43 44 if (!headers_sent()) { 45 header('Content-type: application/json'); 46 } 47 echo json_encode($aResult); 44 48 ?> -
trunk/include/ajax/topicFavourite.php
r548 r996 87 87 88 88 89 $ GLOBALS['_RESULT']= array(89 $aResult = array( 90 90 "bStateError" => $bStateError, 91 91 "bState" => $bState, … … 94 94 ); 95 95 96 if (!headers_sent()) { 97 header('Content-type: application/json'); 98 } 99 echo json_encode($aResult); 96 100 ?> -
trunk/include/ajax/voteBlog.php
r891 r996 91 91 92 92 93 $ GLOBALS['_RESULT']= array(93 $aResult = array( 94 94 "bStateError" => $bStateError, 95 95 "iRating" => $iRating, … … 99 99 ); 100 100 101 if (!headers_sent()) { 102 header('Content-type: application/json'); 103 } 104 echo json_encode($aResult); 101 105 ?> -
trunk/include/ajax/voteComment.php
r548 r996 86 86 87 87 88 $ GLOBALS['_RESULT']= array(88 $aResult = array( 89 89 "bStateError" => $bStateError, 90 90 "iRating" => $iRating, … … 93 93 ); 94 94 95 if (!headers_sent()) { 96 header('Content-type: application/json'); 97 } 98 echo json_encode($aResult); 95 99 ?> -
trunk/include/ajax/voteTopic.php
r548 r996 88 88 89 89 90 $ GLOBALS['_RESULT']= array(90 $aResult = array( 91 91 "bStateError" => $bStateError, 92 92 "iRating" => $iRating, … … 95 95 ); 96 96 97 if (!headers_sent()) { 98 header('Content-type: application/json'); 99 } 100 echo json_encode($aResult); 97 101 ?> -
trunk/include/ajax/voteUser.php
r548 r996 85 85 86 86 87 $ GLOBALS['_RESULT']= array(87 $aResult = array( 88 88 "bStateError" => $bStateError, 89 89 "iRating" => $iRating, … … 94 94 ); 95 95 96 if (!headers_sent()) { 97 header('Content-type: application/json'); 98 } 99 echo json_encode($aResult); 96 100 ?> -
trunk/templates/skin/developer/actions/ActionTalk/blacklist.tpl
r923 r996 21 21 idTarget = element.get('id').replace('blacklist_item_',''); 22 22 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'); 30 41 } 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(); 46 48 return true; 47 49 } … … 84 86 } 85 87 $('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(); 108 114 return false; 109 115 } -
trunk/templates/skin/developer/actions/ActionTalk/speakers.tpl
r923 r996 22 22 idTarget = element.get('id').replace('speaker_item_',''); 23 23 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) { 29 30 msgErrorBox.alert('Error','Please try again later'); 30 31 element.getParent().fade(1); … … 36 37 element.getParent('li').destroy(); 37 38 } 38 }, 39 true 40 ); 41 39 }, 40 onFailure: function(){ 41 msgErrorBox.alert('Error','Please try again later'); 42 } 43 }).send(); 42 44 return true; 43 45 } … … 73 75 } 74 76 $('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(); 97 102 return false; 98 103 } -
trunk/templates/skin/developer/js/block_loader.js
r923 r996 58 58 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 59 59 } 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); 65 67 }, 66 true 67 ); 68 68 onFailure: function(){ 69 msgErrorBox.alert('Error','Please try again later'); 70 } 71 }).send(); 69 72 }, 70 73 71 onLoad: function(result, errors,blockContent) {74 onLoad: function(result, blockContent) { 72 75 blockContent.set('html',''); 73 76 if (!result) { -
trunk/templates/skin/developer/js/blog.js
r923 r996 1 1 function ajaxJoinLeaveBlog(obj,idBlog) { 2 2 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) { 8 10 msgErrorBox.alert('Error','Please try again later'); 9 11 } … … 23 25 } 24 26 } 25 }, 26 true 27 ); 27 }, 28 onFailure: function(){ 29 msgErrorBox.alert('Error','Please try again later'); 30 } 31 }).send(); 28 32 } 29 33 30 34 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) { 35 function 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) { 37 42 msgErrorBox.alert('Error','Please try again later'); 38 43 } … … 43 48 $('block_blog_info').set('html',result.sText); 44 49 } 45 } 46 }, 47 true 48 ); 50 } 51 }, 52 onFailure: function(){ 53 msgErrorBox.alert('Error','Please try again later'); 54 } 55 }).send(); 49 56 } 50 57 … … 82 89 $('blog_admin_user_add').set('value',''); 83 90 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(); 106 116 return false; 107 117 } … … 109 119 110 120 function 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(); 126 139 return false; 127 140 } -
trunk/templates/skin/developer/js/comments.js
r969 r996 143 143 objImg=$(objImg); 144 144 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'); 187 154 } 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(); 192 195 }).delay(1000); 193 196 }, … … 243 246 addComment: function(formObj,targetId,targetType) { 244 247 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) { 251 258 thisObj.enableFormComment(); 252 259 msgErrorBox.alert('Error','Please try again later'); … … 258 265 } else { 259 266 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 264 274 $('form_comment_text').addClass('loader'); 265 275 $('form_comment_text').setProperty('readonly',true); … … 284 294 285 295 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) { 291 303 msgErrorBox.alert('Error','Please try again later'); 292 304 } … … 304 316 } 305 317 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(); 310 324 }, 311 325 -
trunk/templates/skin/developer/js/favourites.js
r923 r996 54 54 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 55 55 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(); 64 67 }, 65 68 66 onToggle: function(result, errors,thisObj) {69 onToggle: function(result, thisObj) { 67 70 if (!result) { 68 71 msgErrorBox.alert('Error','Please try again later'); -
trunk/templates/skin/developer/js/friend.js
r923 r996 28 28 } 29 29 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) { 35 36 msgErrorBox.alert('Error','Please try again later'); 36 37 obj.getElement('form').getChildren().each(function(item){item.removeProperty('disabled')}); … … 46 47 obj.dispose(); 47 48 } 48 } 49 }, 50 true 51 ); 49 } 50 }, 51 onFailure: function(){ 52 msgErrorBox.alert('Error','Please try again later'); 53 } 54 }).send(); 52 55 } 53 56 54 57 function ajaxDeleteUserFriend(obj,idUser,sAction) { 55 58 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) { 61 66 msgErrorBox.alert('Error','Please try again later'); 62 67 } … … 70 75 obj.dispose(); 71 76 } 72 } 73 }, 74 true 75 ); 77 } 78 }, 79 onFailure: function(){ 80 msgErrorBox.alert('Error','Please try again later'); 81 } 82 }).send(); 76 83 } -
trunk/templates/skin/developer/js/messages.js
r923 r996 17 17 errors:0, 18 18 19 requestObj: new JsHttpRequest(),20 21 19 initialize: function(options){ 22 20 var thisObj = this; … … 29 27 30 28 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){ 35 34 if (!result) { 36 35 thisObj.errors+=1; … … 54 53 } 55 54 }, 56 true 57 ); 55 onFailure: function(){ 56 msgErrorBox.alert('Error','Please try again later'); 57 } 58 }).send(); 58 59 } 59 60 } -
trunk/templates/skin/developer/js/other.js
r923 r996 6 6 text = $(textId).value; 7 7 } 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) { 13 15 msgErrorBox.alert('Error','Please try again later'); 14 16 } … … 22 24 $(divPreview).set('html',result.sText).setStyle('display','block'); 23 25 } 24 } 25 }, 26 true 27 ); 26 } 27 }, 28 onFailure: function(){ 29 msgErrorBox.alert('Error','Please try again later'); 30 } 31 }).send(); 28 32 } 29 33 -
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) { 1 function 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) { 7 8 msgErrorBox.alert('Error','Please try again later'); 8 9 } … … 14 15 $('topic_question_area_'+idTopic).set('html',result.sText); 15 16 } 16 } 17 }, 18 true 19 ); 17 } 18 }, 19 onFailure: function(){ 20 msgErrorBox.alert('Error','Please try again later'); 21 } 22 }).send(); 20 23 } -
trunk/templates/skin/developer/js/vote.js
r923 r996 62 62 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 63 63 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(); 72 75 }, 73 76 74 onVote: function(result, errors,thisObj) {77 onVote: function(result, thisObj) { 75 78 if (!result) { 76 79 msgErrorBox.alert('Error','Please try again later'); -
trunk/templates/skin/new/actions/ActionBlog/invited.tpl
r831 r996 35 35 $('blog_admin_user_add').set('value',''); 36 36 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 59 63 return false; 60 64 } 65 61 66 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(); 77 86 return false; 78 87 } -
trunk/templates/skin/new/actions/ActionTalk/blacklist.tpl
r780 r996 23 23 idTarget = element.get('id').replace('blacklist_item_',''); 24 24 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(); 48 50 return true; 49 51 } … … 84 86 } 85 87 $('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(); 108 114 return false; 109 115 } -
trunk/templates/skin/new/actions/ActionTalk/speakers.tpl
r553 r996 24 24 idTarget = element.get('id').replace('speaker_item_',''); 25 25 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(); 44 46 return true; 45 47 } … … 75 77 } 76 78 $('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(); 99 105 return false; 100 106 } -
trunk/templates/skin/new/js/block_loader.js
r624 r996 58 58 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 59 59 } 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(); 69 72 }, 70 73 71 onLoad: function(result, errors,blockContent) {74 onLoad: function(result, blockContent) { 72 75 blockContent.set('html',''); 73 76 if (!result) { -
trunk/templates/skin/new/js/blog.js
r550 r996 1 1 function ajaxJoinLeaveBlog(obj,idBlog) { 2 2 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) { 8 10 msgErrorBox.alert('Error','Please try again later'); 9 11 } … … 23 25 } 24 26 } 25 }, 26 true 27 ); 27 }, 28 onFailure: function(){ 29 msgErrorBox.alert('Error','Please try again later'); 30 } 31 }).send(); 32 28 33 } 29 34 30 35 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 ); 36 function 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(); 49 57 } -
trunk/templates/skin/new/js/comments.js
r742 r996 142 142 objImg=$(objImg); 143 143 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'); 186 154 } 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 191 196 }).delay(1000); 192 197 }, … … 242 247 addComment: function(formObj,targetId,targetType) { 243 248 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) { 250 259 thisObj.enableFormComment(); 251 260 msgErrorBox.alert('Error','Please try again later'); … … 257 266 } else { 258 267 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 263 275 $('form_comment_text').addClass('loader'); 264 276 $('form_comment_text').setProperty('readonly',true); … … 282 294 283 295 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) { 289 303 msgErrorBox.alert('Error','Please try again later'); 290 304 } … … 302 316 } 303 317 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 308 326 }, 309 327 -
trunk/templates/skin/new/js/favourites.js
r550 r996 55 55 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 56 56 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(); 65 68 }, 66 69 67 onToggle: function(result, errors,thisObj) {70 onToggle: function(result, thisObj) { 68 71 if (!result) { 69 72 msgErrorBox.alert('Error','Please try again later'); -
trunk/templates/skin/new/js/friend.js
r550 r996 28 28 } 29 29 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) { 35 36 msgErrorBox.alert('Error','Please try again later'); 36 37 obj.getElement('form').getChildren().each(function(item){item.removeProperty('disabled')}); … … 46 47 obj.dispose(); 47 48 } 48 } 49 }, 50 true 51 ); 49 } 50 }, 51 onFailure: function(){ 52 msgErrorBox.alert('Error','Please try again later'); 53 } 54 }).send(); 52 55 } 53 56 54 57 function ajaxDeleteUserFriend(obj,idUser,sAction) { 55 58 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) { 61 66 msgErrorBox.alert('Error','Please try again later'); 62 67 } … … 70 75 obj.dispose(); 71 76 } 72 } 73 }, 74 true 75 ); 77 } 78 }, 79 onFailure: function(){ 80 msgErrorBox.alert('Error','Please try again later'); 81 } 82 }).send(); 76 83 } -
trunk/templates/skin/new/js/messages.js
r550 r996 17 17 errors:0, 18 18 19 requestObj: new JsHttpRequest(),20 21 19 initialize: function(options){ 22 20 var thisObj = this; … … 29 27 30 28 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){ 35 34 if (!result) { 36 35 thisObj.errors+=1; … … 54 53 } 55 54 }, 56 true 57 ); 55 onFailure: function(){ 56 msgErrorBox.alert('Error','Please try again later'); 57 } 58 }).send(); 58 59 } 59 60 } -
trunk/templates/skin/new/js/other.js
r701 r996 6 6 text = $(textId).value; 7 7 } 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) { 13 15 msgErrorBox.alert('Error','Please try again later'); 14 16 } … … 22 24 $(divPreview).set('html',result.sText).setStyle('display','block'); 23 25 } 24 } 25 }, 26 true 27 ); 26 } 27 }, 28 onFailure: function(){ 29 msgErrorBox.alert('Error','Please try again later'); 30 } 31 }).send(); 28 32 } 29 33 -
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) { 1 function 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) { 7 8 msgErrorBox.alert('Error','Please try again later'); 8 9 } … … 14 15 $('topic_question_area_'+idTopic).set('html',result.sText); 15 16 } 16 } 17 }, 18 true 19 ); 17 } 18 }, 19 onFailure: function(){ 20 msgErrorBox.alert('Error','Please try again later'); 21 } 22 }).send(); 20 23 } -
trunk/templates/skin/new/js/vote.js
r550 r996 62 62 params['security_ls_key']=LIVESTREET_SECURITY_KEY; 63 63 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(); 72 75 }, 73 76 74 onVote: function(result, errors,thisObj) {77 onVote: function(result, thisObj) { 75 78 if (!result) { 76 79 msgErrorBox.alert('Error','Please try again later');
