Jelajahi Sumber

Ticket #4369 - New PUSH server integration: Remake.

AntonLV 3 tahun lalu
induk
melakukan
3499314ca3

+ 1 - 1
inc/classes/BxDolCmts.php

@@ -1604,7 +1604,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             'countf' => $iCount > 0 ? $this->getCounter(['show_script' => false]) : ''
         ];
 
-        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnable())
+        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnabled())
             $oSockets->sendEvent($this->getSocketName(), $iObjId, 'comment_added', json_encode(array_merge($aResult, [
                 'author_id' => $iPerformerId, 
                 'anchor' => $this->getItemAnchor($iCmtId)

+ 1 - 1
inc/classes/BxDolScore.php

@@ -277,7 +277,7 @@ class BxDolScore extends BxDolObject
             'disabled' => !$bVoted,
         ];
 
-        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnable())
+        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnabled())
             $oSockets->sendEvent($this->getSocketName(), $iObjectId, 'voted', json_encode($this->_returnVoteDataForSocket($aResult)));
 
         return $aResult;

+ 29 - 26
inc/classes/BxDolSockets.php

@@ -12,18 +12,27 @@ class BxDolSockets extends BxDolFactory implements iBxDolSingleton
     protected $_sHost;
     protected $_sPort;
     protected $_sScheme;
-    protected $_sIsEnabled = false;
-    
+    protected $_sIsEnabled;
+
     protected function __construct()
     {
         parent::__construct();
-        if (getParam('sys_sockets_type') != 'sys_sockets_disabled' && trim(getParam('sys_sockets_url')) != ''){
-            $this->_sIsEnabled = true;
-            $a = parse_url(getParam('sys_sockets_url'));
-            $this->_sHost = $a['host'];
-            $this->_sPort = $a['port'];
-            $this->_sScheme = $a['scheme'];
-        }    
+
+        $this->_sIsEnabled = false;
+
+        if(getParam('sys_sockets_type') == 'sys_sockets_disabled')
+            return;
+
+        $sUrl = trim(getParam('sys_sockets_url'));
+        if(!$sUrl)
+            return;
+
+        $a = parse_url($sUrl);
+        $this->_sHost = $a['host'];
+        $this->_sPort = $a['port'];
+        $this->_sScheme = $a['scheme'];
+
+        $this->_sIsEnabled = true;
     }
 
     static public function getInstance()
@@ -36,32 +45,26 @@ class BxDolSockets extends BxDolFactory implements iBxDolSingleton
             
         return $GLOBALS['bxDolClasses']['BxDolSockets'];
     }
-    
-     private function writeLog($sString)
-	{
-        bx_log('sys_sockets', $sString);
-	}
-    
-    public function isEnable()
+
+    public function isEnabled()
     {
         return $this->_sIsEnabled;
     }
-    
-    public function sendEvent($sModule, $iContentId, $sEvent, $sMessage)
+
+    public function sendEvent($sSocket, $iContentId, $sEvent, $sMessage)
     {
         return;
     }
-    
-    public function getInitJsCode()
-    {
-        return 'null';
-    }
-    
-    public function getSubscribeJsCode($sModule, $iContentId, $sEvent, $sCb)
+
+    public function getJsCode()
     {
         return '';
     }
-    
+
+    private function writeLog($sString)
+    {
+        bx_log('sys_sockets', $sString);
+    }    
 }
 
 /** @} */

+ 29 - 20
inc/classes/BxDolSocketsSoketi.php

@@ -9,45 +9,54 @@
 
 class BxDolSocketsSoketi extends BxDolSockets
 {
+    protected $_sKey;
+
+    protected $_sJsClass;
+    protected $_sJsObject;
 
     protected function __construct()
     {
         parent::__construct();
+        
+        $this->_sKey = getParam('sys_sockets_key');
+        
+        $this->_sJsClass = 'BxDolSockets';
+        $this->_sJsObject = 'oBxDolSockets';
     }
     
-    public function sendEvent($sModule, $iContentId, $sEvent, $sMessage)
+    public function sendEvent($sSocket, $iContentId, $sEvent, $sMessage)
     {
-        try{
-            $oPusher = new Pusher\Pusher(getParam('sys_sockets_key'), getParam('sys_sockets_secret'), getParam('sys_sockets_app_id'), [
+        try {
+            $oPusher = new Pusher\Pusher($this->_sKey, getParam('sys_sockets_secret'), getParam('sys_sockets_app_id'), [
                 'host' => $this->_sHost,
                 'port' => $this->_sPort,
                 'scheme' => $this->_sScheme,
                 'encrypted' => true,
                 'useTLS' => false,
             ]);
-            $b = $oPusher->trigger($sModule . '_' . $iContentId, $sEvent, $sMessage);
+            $b = $oPusher->trigger($sSocket . '_' . $iContentId, $sEvent, $sMessage);
         }
-         catch (Exception $oException) {
+        catch (Exception $oException) {
             $this->writeLog($oException->getFile() . ':' . $oException->getLine() . ' ' . $oException->getMessage());
             return false;
         }
-        
-    }
-    
-    public function getInitJsCode()
-    {
-        return " new Pusher('". getParam('sys_sockets_key') ."', {
-            wsHost: '" . $this->_sHost . "',
-            wsPort: " . $this->_sPort . ",
-            forceTLS: false, 
-            enabledTransports: ['ws', 'wss'],
-            cluster:''
-        });";
     }
-    
-    public function getSubscribeJsCode($sModule, $iContentId, $sEvent, $sCb)
+
+    public function getJsCode()
     {
-        return " $(document).ready(function() {oBxDolPage.socketsSubscribe('" . $sModule . "', '" . $iContentId . "', '" . $sEvent . "', function(data) {" . $sCb . "})})";
+        $sMask = "{var} {object} = new {class}({params});";
+        $aParams = [
+            'sKey' => $this->_sKey,
+            'sHost' => $this->_sHost,
+            'sPort' => $this->_sPort,
+        ];
+
+        return bx_replace_markers($sMask, [
+            'var' => 'var',
+            'object' => $this->_sJsObject, 
+            'class' => $this->_sJsClass,
+            'params' => json_encode($aParams)
+        ]);
     }
 }
 

+ 3 - 0
inc/classes/BxDolTemplate.php

@@ -1896,6 +1896,9 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 				$sKey = str_replace('css_media_', '', $sKey);
                 $sRet = $aData[$sKey];
                 break;
+            case 'socket_engine':
+                $sRet = BxDolSockets::getInstance()->getJsCode();
+                break;
             default:
                 $sRet = ($sTemplAdd = BxTemplFunctions::getInstance()->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right'];
         }

+ 1 - 1
inc/classes/BxDolVote.php

@@ -259,7 +259,7 @@ class BxDolVote extends BxDolObject
 
         $aResult = $this->_returnVoteData($iObjectId, $iAuthorId, $iAuthorIp, $aVoteData, !$bVoted, $aRequestParamsData);
 
-        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnable())
+        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnabled())
             $oSockets->sendEvent($this->getSocketName(), $iObjectId, 'voted', json_encode($this->_returnVoteDataForSocket($aResult)));
 
         return $aResult;

+ 8 - 0
inc/js/classes/BxDolCmts.js

@@ -14,6 +14,7 @@ function BxDolCmts (options) {
     this._iAuthorId = options.iAuthorId; // this comment's author ID.
     this._iObjId = options.iObjId; // this object id comments
     this._sBaseUrl = options.sBaseUrl; // base url to view comment's listing.
+    this._sSocket = options.sSocket === undefined ? this._sSystem : options.sSocket;
 
     this._iMinPostForm = undefined == options.iMinPostForm ? 0 : options.iMinPostForm;
     this._sPostFormPosition = undefined == options.sPostFormPosition ? 'top' : options.sPostFormPosition;
@@ -40,6 +41,13 @@ BxDolCmts.prototype.cmtInit = function()
     var $this = this;
 
     $(document).ready(function() {
+        // init socket
+        if(oBxDolSockets && $this._sSocket)
+            oBxDolSockets.subscribe($this._sSocket, $this._iObjId, 'comment_added', function(oData) {
+                $this.cmtUpdateCounterAs(oData);
+                $this.showLiveUpdateForSocket(oData);
+            });
+
         // init post comment form    
         var sFormId = $this._sRootId + ' .cmt-post-reply form';
         if ($(sFormId).length) {

+ 0 - 12
inc/js/classes/BxDolPage.js

@@ -15,7 +15,6 @@ function BxDolPage(oOptions) {
 
     this._isStickyColumns = oOptions.isStickyColumns == undefined ? false : oOptions.isStickyColumns;
     this._iLastSc = 0;
-    this._oPusher = eval(oOptions.oSocket);
 
     var $this = this;
     $(document).ready(function() {
@@ -40,17 +39,6 @@ BxDolPage.prototype.init = function() {
     
 };
 
-
-BxDolPage.prototype.socketsSubscribe = function(module, content_id, event, cb)
-{
-    if (this._oPusher != null){
-        var channel = this._oPusher.subscribe(module + '_' + content_id);
-        channel.bind(event, function(data) {
-            cb(data)
-        });
-    }
-}
-
 BxDolPage.prototype.embededCallback = function(item)
 {
     return function(oData) {

+ 19 - 0
inc/js/classes/BxDolScore.js

@@ -15,6 +15,7 @@ function BxDolScore(oOptions)
 
     this._sActionsUri = 'score.php';
     this._sActionsUrl = oOptions.sRootUrl + this._sActionsUri; // actions url address
+    this._sSocket = oOptions.sSocket === undefined ? this._sSystem : oOptions.sSocket;
 
     this._sAnimationEffect = 'fade';
     this._iAnimationSpeed = 'slow';
@@ -23,8 +24,26 @@ function BxDolScore(oOptions)
     this._aRequestParams = oOptions.aRequestParams;
 
     this._iSaveWidth = -1;
+
+    var $this = this;
+    $(document).ready(function() {
+    	$this.init();
+    });
 }
 
+BxDolScore.prototype.init = function()
+{
+    var $this = this; 
+    $(document).ready(function() {
+        if(oBxDolSockets && $this._sSocket)
+            oBxDolSockets.subscribe($this._sSocket, $this._iObjId, 'voted', function(oData) {
+                $this.onVoteAs(oData);
+            });
+    });
+
+    return;
+};
+
 BxDolScore.prototype.toggleByPopup = function(oLink) {
     var $this = this;
     var oData = this._getDefaultParams();

+ 36 - 0
inc/js/classes/BxDolSockets.js

@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaCore UNA Core
+ * @{
+ */
+
+function BxDolSockets(oOptions)
+{
+    this._sKey = oOptions.sKey;
+    this._sHost = oOptions.sHost;
+    this._sPort = oOptions.sPort;
+    this._sObject = oOptions.sObject === undefined ? 'oBxDolSockets' : oOptions.sObject;
+
+    this._oPusher = new Pusher(this._sKey, {
+        wsHost: oOptions.sHost,
+        wsPort: oOptions.sPort,
+        forceTLS: false, 
+        enabledTransports: ['ws', 'wss'],
+        cluster:''
+    });
+}
+
+BxDolSockets.prototype.subscribe = function(module, content_id, event, cb)
+{
+    if(!this._oPusher)
+        return;
+
+    var channel = this._oPusher.subscribe(module + '_' + content_id);
+    channel.bind(event, function(data) {
+        cb(data)
+    });
+}
+
+/** @} */

+ 14 - 0
inc/js/classes/BxDolVote.js

@@ -18,16 +18,30 @@ function BxDolVote(oOptions)
 
     this._sActionsUri = 'vote.php';
     this._sActionsUrl = oOptions.sRootUrl + this._sActionsUri; // actions url address
+    this._sSocket = oOptions.sSocket === undefined ? this._sSystem : oOptions.sSocket;
 
     this._sAnimationEffect = 'fade';
     this._iAnimationSpeed = 'slow';
     this._sSP = oOptions.sStylePrefix === undefined ? 'bx-vote' : oOptions.sStylePrefix;
     this._aHtmlIds = oOptions.aHtmlIds;
     this._aRequestParams = oOptions.aRequestParams;
+
+    var $this = this;
+    $(document).ready(function() {
+    	$this.init();
+    });
 }
 
 BxDolVote.prototype.init = function()
 {
+    var $this = this; 
+    $(document).ready(function() {
+        if(oBxDolSockets && $this._sSocket)
+            oBxDolSockets.subscribe($this._sSocket, $this._iObjId, 'voted', function(oData) {
+                $this.onVoteAs(oData);
+            });
+    });
+
     return;
 };
 

+ 3 - 6
inc/js/classes/BxDolVoteReactions.js

@@ -22,18 +22,15 @@ function BxDolVoteReactions(oOptions)
 
     this._sClassDo = 'bx-vote-do-vote';
     this._sClassDoVoted = 'bx-vote-voted';
-
-    var $this = this;
-    $(document).ready(function() {
-        $this.initVote();
-    });
 }
 
 BxDolVoteReactions.prototype = Object.create(BxDolVote.prototype);
 BxDolVoteReactions.prototype.constructor = BxDolVoteReactions;
 
-BxDolVoteReactions.prototype.initVote = function()
+BxDolVoteReactions.prototype.init = function()
 {
+    BxDolVote.prototype.init.call(this);
+
     var $this = this;
     var bMobile = bx_check_mq() == 'mobile';
 

+ 2 - 5
inc/js/classes/BxDolVoteStars.js

@@ -11,11 +11,6 @@ function BxDolVoteStars(oOptions)
     BxDolVote.call(this, oOptions);
 
     this._iSaveWidth = -1;
-
-    var $this = this;
-    $(document).ready(function() {
-    	$this.init();
-    });
 }
 
 BxDolVoteStars.prototype = Object.create(BxDolVote.prototype);
@@ -23,6 +18,8 @@ BxDolVoteStars.prototype.constructor = BxDolVoteStars;
 
 BxDolVoteStars.prototype.init = function ()
 {
+    BxDolVote.prototype.init.call(this);
+
     var $this = this;
 
     $('.' + this._sSP + '.' + this._sSP + '-stars').each(function() {

+ 1 - 0
install/sql/system.sql

@@ -6203,6 +6203,7 @@ INSERT INTO `sys_preloader`(`module`, `type`, `content`, `active`, `order`) VALU
 ('system', 'js_system', 'BxDolForm.js', 1, 42),
 ('system', 'js_system', 'BxDolNestedForm.js', 1, 43),
 ('system', 'js_system', 'BxDolConnection.js', 1, 44),
+('system', 'js_system', 'BxDolSockets.js', 1, 45),
 
 ('system', 'js_translation', '_Are_you_sure', 1, 1),
 ('system', 'js_translation', '_error occured', 1, 2),

+ 2 - 0
template/_header_js.html

@@ -60,4 +60,6 @@
 
     var aIncludedCss = __included_css__;
     var aIncludedJs = __included_js__;
+
+    __socket_engine__
 </script>

+ 3 - 30
template/scripts/BxBaseCmts.php

@@ -124,6 +124,7 @@ class BxBaseCmts extends BxDolCmts
             'iAuthorId' => $this->_getAuthorId(),
             'iObjId' => $this->getId(),
             'sBaseUrl' => $this->getBaseUrl(),
+            'sSocket' => $this->getSocketName(),
             'sPostFormPosition' => $this->_aSystem['post_form_position'],
             'sBrowseType' => $this->_sBrowseType,
             'sDisplayType' => $this->_sDisplayType,
@@ -136,28 +137,6 @@ class BxBaseCmts extends BxDolCmts
         $this->addCssJs();
         return $this->_oTemplate->_wrapInTagJsCode("if(window['" . $this->_sJsObjName . "'] == undefined) var " . $this->_sJsObjName . " = new " . $this->_sJsObjClass . "(" . json_encode($aParams) . "); " . $this->_sJsObjName . ".cmtInit();");
     }
-    
-    public function getJsScriptSocket($sType, $aBp = [], $aDp = [])
-    {
-        $oSockets = BxDolSockets::getInstance();
-        if(!$oSockets->isEnable())
-            return '';
-
-        $sJsMethod = '';
-        switch($sType) {
-            case 'counter':
-                $sJsMethod = 'cmtUpdateCounterAs';
-                break;
-
-            case 'live_update':
-                $sJsMethod = 'showLiveUpdateForSocket';
-                break;
-        }
-
-        $sCode = $oSockets->getSubscribeJsCode($this->getSocketName(), $this->_iId, 'comment_added', $this->getJsObjectName() . '.' . $sJsMethod . '(data)');
-
-        return $this->_oTemplate->_wrapInTagJsCode($sCode);
-    }
 
     function getCommentsBlockAPI($aParams, $aBp = [], $aDp = ['in_designbox' => false, 'show_empty' => false])
     {
@@ -217,7 +196,7 @@ class BxBaseCmts extends BxDolCmts
         $this->_getParams($aBp, $aDp);
 
         $oSockets = BxDolSockets::getInstance();
-        $bSockets = $oSockets->isEnable();
+        $bSockets = $oSockets->isEnabled();
 
         if(!$bSockets) {
             //add live update
@@ -239,8 +218,6 @@ class BxBaseCmts extends BxDolCmts
         $sPostFormTop = $this->getFormBoxPost($aBp, array_merge($aDp, ['type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP]));
         $sPostFormBottom = $this->getFormBoxPost($aBp, array_merge($aDp, ['type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM]));
         $sJsContent = $this->getJsScript($aBp, $aDp);
-        if($bSockets)
-            $sJsContent .= $this->getJsScriptSocket('live_update', $aBp, $aDp);
 
         $sBlockTitle = _t($this->_aT['block_comments_title'], $this->getCommentsCountAll(0, true));
         $sBlockMenu = $this->_getControlsBox();
@@ -888,10 +865,6 @@ class BxBaseCmts extends BxDolCmts
         if(!empty($aParams['overwrite_counter_link_onclick']))
             $sOnclick = $aParams['overwrite_counter_link_onclick'];
 
-        $sJsContent = $this->getJsScript();
-        if(($oSockets = BxDolSockets::getInstance()) && $oSockets->isEnable())
-            $sJsContent .= $this->getJsScriptSocket('counter');
-
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplCounter(), [
             'style_prefix' => $this->_sStylePrefix,
             'id' => $this->_aHtmlIds['counter'],
@@ -912,7 +885,7 @@ class BxBaseCmts extends BxDolCmts
                     'icon' => !empty($aParams['custom_icon']) ? $aParams['custom_icon'] : $this->_oTemplate->getImageAuto('comment|' . $this->_sStylePrefix . '-counter-icon')
                 ]
             ],
-            'script' => $sJsContent
+            'script' => $this->getJsScript()
         ]);
     }
 

+ 1 - 2
template/scripts/BxBasePage.php

@@ -267,8 +267,7 @@ class BxBasePage extends BxDolPage
             'sObject' => $this->_sObject,
             'sRootUrl' => BX_DOL_URL_ROOT,
             'aHtmlIds' => $this->_aHtmlIds,
-            'isStickyColumns' => $this->_bStickyColumns,
-            'oSocket' => BxDolSockets::getInstance()->getInitJsCode()
+            'isStickyColumns' => $this->_bStickyColumns
         )) . ");";
 
         return $this->_wrapInTagJsCode($sCode);

+ 3 - 13
template/scripts/BxBaseScore.php

@@ -83,6 +83,7 @@ class BxBaseScore extends BxDolScore
             'iAuthorId' => $this->_getAuthorId(),
             'iObjId' => $this->getId(),
             'sRootUrl' => BX_DOL_URL_ROOT,
+            'sSocket' => $this->getSocketName(),
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds,
             'aRequestParams' => $this->_prepareRequestParamsData($aParams)
@@ -92,17 +93,6 @@ class BxBaseScore extends BxDolScore
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
 
-    public function getJsScriptSocket($aParams = [])
-    {
-        $oSockets = BxDolSockets::getInstance();
-        if(!$oSockets->isEnable())
-            return '';
-
-        $sCode = $oSockets->getSubscribeJsCode($this->getSocketName(), $this->getId(), 'voted', $this->getJsObjectName() . '.onVoteAs(data)');
-
-        return $this->_oTemplate->_wrapInTagJsCode($sCode);
-    }
-
     public function getJsClick($sType)
     {
         return $this->getJsObjectName() . '.vote' . ucfirst($sType) . '(this)';
@@ -164,7 +154,7 @@ class BxBaseScore extends BxDolScore
                 'condition' => !$bLink,
                 'content' => $aTmplVarsText
             ),
-            'script' => $bShowScript ? $this->getJsScript($aParams) . $this->getJsScriptSocket($aParams) : ''
+            'script' => $bShowScript ? $this->getJsScript($aParams) : ''
         ));
     }
 
@@ -296,7 +286,7 @@ class BxBaseScore extends BxDolScore
             	'condition' => $bTmplVarsLegend,
             	'content' => $aTmplVarsLegend
             ),
-            'script' => $this->getJsScript($aParams) . ($bTmplVarsCounter ? $this->getJsScriptSocket($aParams) : '')
+            'script' => $this->getJsScript($aParams)
         ));
     }
 

+ 3 - 13
template/scripts/BxBaseVote.php

@@ -69,23 +69,13 @@ class BxBaseVote extends BxDolVote
         $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
 
         $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new " . $sJsObjClass . "(" . json_encode($this->_prepareParamsData([
+            'sSocket' => $this->getSocketName(),
             'aRequestParams' => $this->_prepareRequestParamsData($aParams)
         ])) . ");";
 
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
 
-    public function getJsScriptSocket($aParams = [])
-    {
-        $oSockets = BxDolSockets::getInstance();
-        if(!$oSockets->isEnable())
-            return '';
-
-        $sCode = $oSockets->getSubscribeJsCode($this->getSocketName(), $this->getId(), 'voted', $this->getJsObjectName() . '.onVoteAs(data)');
-
-        return $this->_oTemplate->_wrapInTagJsCode($sCode);
-    }
-
     public function getJsClick($iValue = 0)
     {
         return $this->getJsObjectName() . '.vote(this, ' . $iValue . ')';
@@ -148,7 +138,7 @@ class BxBaseVote extends BxDolVote
             'class' => $sClass,
             'bx_repeat:attrs' => $aTmplVarsAttrs,
             'content' => $sContent,
-            'script' => $bShowScript ? $this->getJsScript($aParams) . $this->getJsScriptSocket($aParams) : ''
+            'script' => $bShowScript ? $this->getJsScript($aParams) : ''
         ]);
     }
 
@@ -319,7 +309,7 @@ class BxBaseVote extends BxDolVote
             	'condition' => $bTmplVarsLegend,
             	'content' => $aTmplVarsLegend
             ),
-            'script' => $this->getJsScript($aParams) . ($bTmplVarsCounter ? $this->getJsScriptSocket($aParams) : '')
+            'script' => $this->getJsScript($aParams)
         );
     }
 

+ 3 - 3
template/scripts/BxBaseVoteReactions.php

@@ -181,7 +181,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                 'condition' => false,
                 'content' => array()
             ),
-            'script' => $bShowScript ? $this->getJsScript($aParams) . $this->getJsScriptSocket($aParams) : ''
+            'script' => $bShowScript ? $this->getJsScript($aParams) : ''
         ));
     }
 
@@ -235,7 +235,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                     'counter' => $sResult,
                 )
             ),
-            'script' => $bShowScript ? $this->getJsScript($aParams) . $this->getJsScriptSocket($aParams) : ''
+            'script' => $bShowScript ? $this->getJsScript($aParams) : ''
         ));
     }
 
@@ -321,7 +321,7 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                 'condition' => false,
                 'content' => array()
             ),
-            'script' => $bShowScript ? $this->getJsScript($aParams) . $this->getJsScriptSocket($aParams) : ''
+            'script' => $bShowScript ? $this->getJsScript($aParams) : ''
         ));
     }