diff --git a/templates/skin/developer-jquery/block.streamConfig.tpl b/templates/skin/developer-jquery/block.streamConfig.tpl
index 56e32c8a..6c58d121 100644
--- a/templates/skin/developer-jquery/block.streamConfig.tpl
+++ b/templates/skin/developer-jquery/block.streamConfig.tpl
@@ -31,7 +31,7 @@
{$aLang.stream_block_users_title}
{$aLang.stream_block_config_append}
-
+
{if count($aStreamSubscribedUsers)}
{foreach from=$aStreamSubscribedUsers item=oUser}
{assign var=iUserId value=$oUser->getId()}
diff --git a/templates/skin/developer-jquery/js/stream.js b/templates/skin/developer-jquery/js/stream.js
index 114ab5c7..e1de64a4 100644
--- a/templates/skin/developer-jquery/js/stream.js
+++ b/templates/skin/developer-jquery/js/stream.js
@@ -1,32 +1,34 @@
+var ls = ls || {};
+
ls.stream =( function ($) {
this.isBusy = false;
this.subscribe = function (iTargetUserId) {
- jQuery.post(aRouter['stream']+'subscribe', {'id':iTargetUserId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ jls.ajax(aRouter['stream']+'subscribe', {'id':iTargetUserId}, function(data) {
if (!data.bStateError) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
});
}
this.unsubscribe = function (iId) {
- jQuery.post(aRouter['stream']+'unsubscribe', {'id':iId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['stream']+'unsubscribe', {'id':iId}, function(data) {
if (!data.bStateError) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
});
}
this.switchEventType = function (iType) {
- jQuery.post(aRouter['stream']+'switchEventType', { 'type':iType, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['stream']+'switchEventType', { 'type':iType}, function(data) {
if (!data.bStateError) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
});
}
this.appendUser = function() {
- var sLogin = jQuery('#stream_users_complete').val();
+ var sLogin = $('#stream_users_complete').val();
if (!sLogin) return;
- jQuery.post(aRouter['stream']+'subscribeByLogin', {'login':sLogin, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['stream']+'subscribeByLogin', {'login':sLogin}, function(data) {
if (!data.bStateError) {
- var checkbox = jQuery('#strm_u_'+data.uid);
+ var checkbox = $('#strm_u_'+data.uid);
if (checkbox.length) {
if (checkbox.attr('checked')) {
ls.msg.error(data.lang_error_title,data.lang_error_msg);
@@ -35,8 +37,8 @@ ls.stream =( function ($) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
} else {
- var liElement='- '+data.user_login+'
';
- jQuery('#stream_block_users_list').append(liElement);
+ var liElement='- '+data.user_login+'
';
+ $('#stream_block_users_list').append(liElement);
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
}
@@ -46,21 +48,21 @@ ls.stream =( function ($) {
if (this.isBusy) {
return;
}
- var lastId = jQuery('#stream_last_id').val();
+ var lastId = $('#stream_last_id').val();
if (!lastId) return;
- jQuery('#stream_get_more').addClass('stream_loading');
+ $('#stream_get_more').addClass('stream_loading');
this.isBusy = true;
- jQuery.post(aRouter['stream']+'get_more', {'last_id':lastId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['stream']+'get_more', {'last_id':lastId}, function(data) {
if (!data.bStateError && data.topics_count) {
- jQuery('#stream_loaded_topics').append(data.result);
- jQuery('#stream_last_id').attr('value', data.iStreamLastId);
+ $('#stream_loaded_topics').append(data.result);
+ $('#stream_last_id').attr('value', data.iStreamLastId);
}
if (!data.topics_count) {
- jQuery('#stream_get_more').css({'display':'none'});
+ $('#stream_get_more').css({'display':'none'});
}
- jQuery('#stream_get_more').removeClass('stream_loading');
- ls.stream.isBusy = false;
- });
+ $('#stream_get_more').removeClass('stream_loading');
+ this.isBusy = false;
+ }.bind(this));
}
return this;
-}).call(ls.stream || {},jQuery);
\ No newline at end of file
+}).call(ls.stream || {},$);
\ No newline at end of file
diff --git a/templates/skin/developer-jquery/js/userfeed.js b/templates/skin/developer-jquery/js/userfeed.js
index cc9fa2dd..f20aa7ba 100644
--- a/templates/skin/developer-jquery/js/userfeed.js
+++ b/templates/skin/developer-jquery/js/userfeed.js
@@ -1,25 +1,27 @@
+var ls = ls || {};
+
ls.userfeed =( function ($) {
this.isBusy = false;
this.subscribe = function (sType, iId) {
- jQuery.post(aRouter['feed']+'subscribe', {'type':sType, 'id':iId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['feed']+'subscribe', {'type':sType, 'id':iId}, function(data) {
if (!data.bStateError) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
});
}
this.unsubscribe = function (sType, iId) {
- jQuery.post(aRouter['feed']+'unsubscribe', {'type':sType, 'id':iId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['feed']+'unsubscribe', {'type':sType, 'id':iId}, function(data) {
if (!data.bStateError) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
});
}
this.appendUser = function() {
- var sLogin = jQuery('#userfeed_users_complete').val();
+ var sLogin = $('#userfeed_users_complete').val();
if (!sLogin) return;
- jQuery.post(aRouter['feed']+'subscribeByLogin', {'login':sLogin, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['feed']+'subscribeByLogin', {'login':sLogin}, function(data) {
if (!data.bStateError) {
- var checkbox = jQuery('#usf_u_'+data.uid);
+ var checkbox = $('#usf_u_'+data.uid);
if (checkbox.length) {
if (checkbox.attr('checked')) {
ls.msg.error(data.lang_error_title,data.lang_error_msg);
@@ -28,8 +30,8 @@ ls.userfeed =( function ($) {
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
} else {
- var liElement='- '+data.user_login+'
';
- jQuery('#userfeed_block_users_list').append(liElement);
+ var liElement='- '+data.user_login+'
';
+ $('#userfeed_block_users_list').append(liElement);
ls.msg.notice(data.sMsgTitle,data.sMsg);
}
}
@@ -39,21 +41,21 @@ ls.userfeed =( function ($) {
if (this.isBusy) {
return;
}
- var lastId = jQuery('#userfeed_last_id').val();
+ var lastId = $('#userfeed_last_id').val();
if (!lastId) return;
- jQuery('#userfeed_get_more').addClass('userfeed_loading');
+ $('#userfeed_get_more').addClass('userfeed_loading');
this.isBusy = true;
- jQuery.post(aRouter['feed']+'get_more', {'last_id':lastId, 'security_ls_key':LIVESTREET_SECURITY_KEY}, function(data) {
+ ls.ajax(aRouter['feed']+'get_more', {'last_id':lastId}, function(data) {
if (!data.bStateError && data.topics_count) {
- jQuery('#userfeed_loaded_topics').append(data.result);
- jQuery('#userfeed_last_id').attr('value', data.iUserfeedLastId);
+ $('#userfeed_loaded_topics').append(data.result);
+ $('#userfeed_last_id').attr('value', data.iUserfeedLastId);
}
if (!data.topics_count) {
- jQuery('#userfeed_get_more').css({'display':'none'});
+ $('#userfeed_get_more').css({'display':'none'});
}
- jQuery('#userfeed_get_more').removeClass('userfeed_loading');
- ls.userfeed.isBusy = false;
- });
+ $('#userfeed_get_more').removeClass('userfeed_loading');
+ this.isBusy = false;
+ }.bind(this));
}
return this;
-}).call(ls.userfeed || {},jQuery);
\ No newline at end of file
+}).call(ls.userfeed || {},$);
\ No newline at end of file