Bladeren bron

Ticket #3182 - Point №1

AntonLV 5 jaren geleden
bovenliggende
commit
400bc8f683

+ 0 - 1
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -23,7 +23,6 @@
     <string name="_bx_timeline_option_auto_preloads"><![CDATA[Бесконечная прокрутка: Количество авто-подгрузок]]></string>
     <string name="_bx_timeline_option_rss_length"><![CDATA[Количество элементов в RSS-ленте]]></string>
     <string name="_bx_timeline_option_events_hide"><![CDATA[Показывать события]]></string>
-    <string name="_bx_timeline_option_enable_dynamic_cards"><![CDATA[Включить динамическую загрузку карточек]]></string>
     <string name="_bx_timeline_option_enable_brief_cards"><![CDATA[Включить лаконичные карточки]]></string>
     <string name="_bx_timeline_option_videos_autoplay"><![CDATA[Автоматически проигрывать видео ролики (доступно только для Ленты)]]></string>
     <string name="_bx_timeline_option_videos_autoplay_off"><![CDATA[Отключено]]></string>

+ 0 - 7
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -34,7 +34,6 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
     protected $_iCharsDisplayMinTitle;
     protected $_iCharsDisplayMaxTitle;
 
-    protected $_bDynamicCards;
     protected $_bBriefCards;
     protected $_aBriefCardsTags;
     protected $_sVideosAutoplay;
@@ -348,7 +347,6 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         $this->_iCharsDisplayMinTitle = 32;
         $this->_iCharsDisplayMaxTitle = 64;
 
-        $this->_bDynamicCards = getParam($sOptionPrefix . 'enable_dynamic_cards') == 'on';
         $this->_bBriefCards = getParam($sOptionPrefix . 'enable_brief_cards') == 'on';
 
         $this->_sVideosAutoplay = getParam($sOptionPrefix . 'videos_autoplay');
@@ -445,11 +443,6 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
         return $this->_bCountAllViews;
     }
 
-    public function isDynamicCards()
-    {
-        return $this->_bDynamicCards;
-    }
-
     public function isBriefCards()
     {
         return $this->_bBriefCards;

+ 1 - 57
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -118,7 +118,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             'bInit' => true,
             'bInfScroll' => $this->_oConfig->isInfiniteScroll(),
             'iInfScrollAutoPreloads' => $this->_oConfig->getAutoPreloads(),
-            'bDynamicCards' => $this->_oConfig->isDynamicCards(),
         ), $aParams);
 
         return parent::getJsCode('view', $aParams, $bWrap, $bDynamic);
@@ -410,57 +409,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return $this->getPost($aEvent, $aBrowseParams);
     }
 
-    public function getPostSample($aEvent, $aBrowseParams = array())
-    {
-        $CNF = &$this->_oConfig->CNF;
-
-        $oModule = $this->getModule();
-        $sStylePrefix = $this->_oConfig->getPrefix('style');
-        $sJsObject = $this->_oConfig->getJsObjectView($aBrowseParams);
-
-        $bViewOutline = isset($aBrowseParams['view']) && $aBrowseParams['view'] == BX_TIMELINE_VIEW_OUTLINE;
-
-        $bPinned = (int)$aEvent['pinned'] > 0;
-        $bSticked = (int)$aEvent['sticked'] > 0;
-        $bPromoted = (int)$aEvent['promoted'] > 0;
-
-        $sClass = $aEvent['type'] . ' ' . (!empty($aEvent['action']) ? $aEvent['action'] . ' ' : '') . $sStylePrefix . '-view-sizer';
-        if($bViewOutline) {
-            $sClass = $sStylePrefix . '-grid-item-sizer';
-            if($bPinned || $bSticked || $bPromoted) {
-                $sClass .= ' ' . $sStylePrefix . '-gis';
-                if($bPinned)
-                    $sClass .= '-pnd';
-                if($bSticked)
-                    $sClass .= '-psd';
-                if($bPromoted)
-                    $sClass .= '-pmd';
-            }
-        }
-        if($bPinned)
-            $sClass .= ' ' . $sStylePrefix . '-pinned';
-        if($bSticked)
-            $sClass .= ' ' . $sStylePrefix . '-sticked';
-        if($bPromoted)
-            $sClass .= ' ' . $sStylePrefix . '-promoted';
-
-        $sVariable = '_sTmplContentItem' . bx_gen_method_name($aBrowseParams['view']) . 'Sample';
-        if(empty(self::$$sVariable))
-            self::$$sVariable = $this->getHtml('item_' . $aBrowseParams['view'] . '_sample.html');
-
-        $sTmplCode = self::$$sVariable;
-        $aTmplVars = array(
-            'style_prefix' => $sStylePrefix,
-            'js_object' => $sJsObject,
-            'html_id' => $this->_oConfig->getHtmlIdView('item', $aBrowseParams, array('whole' => false)) . $aEvent['id'],
-            'class' => $sClass,
-            'icon' => !empty($aEvent['icon']) ? $aEvent['icon'] : $CNF['ICON'],
-            'id' => $aEvent['id'],
-        );
-
-        return $this->parseHtmlByContent($sTmplCode, $aTmplVars);
-    }
-
     public function getPost(&$aEvent, $aBrowseParams = array())
     {
         $CNF = &$this->_oConfig->CNF;
@@ -616,16 +564,12 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             }
         }
 
-        $sMethodGetPost = 'getPost';
-        if($this->_oConfig->isDynamicCards() && in_array($aParams['view'], array(BX_TIMELINE_VIEW_TIMELINE, BX_TIMELINE_VIEW_OUTLINE)) && !$aParams['dynamic_mode'])
-            $sMethodGetPost .=  'Sample';
-
         $bFirst = true;
         $mixedEvents = $bReturnArray ? array() : '';
         foreach($aEvents as $aEvent) {
             $iEvent = (int)$aEvent['id'];
 
-            $sEvent = $this->$sMethodGetPost($aEvent, $aParams);
+            $sEvent = $this->getPost($aEvent, $aParams);
             if(empty($sEvent))
                 continue;
 

+ 0 - 1
modules/boonex/timeline/install/langs/en.xml

@@ -23,7 +23,6 @@
     <string name="_bx_timeline_option_auto_preloads"><![CDATA[Infinite Scroll: Number of auto preloads]]></string>
     <string name="_bx_timeline_option_rss_length"><![CDATA[The length of RSS feed]]></string>
     <string name="_bx_timeline_option_events_hide"><![CDATA[Show events]]></string>
-    <string name="_bx_timeline_option_enable_dynamic_cards"><![CDATA[Enable dynamic cards loading]]></string>
     <string name="_bx_timeline_option_enable_brief_cards"><![CDATA[Enable brief cards]]></string>
     <string name="_bx_timeline_option_videos_autoplay"><![CDATA[Videos autoplay (for Timeline view only)]]></string>
     <string name="_bx_timeline_option_videos_autoplay_off"><![CDATA[Disabled]]></string>

+ 0 - 1
modules/boonex/timeline/install/sql/enable.sql

@@ -281,7 +281,6 @@ VALUES (@iTypeId, 'bx_timeline_card', '_bx_timeline_options_category_card', 3);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_params`, `check_error`, `extra`, `order`) VALUES
-('bx_timeline_enable_dynamic_cards', '', @iCategId, '_bx_timeline_option_enable_dynamic_cards', 'checkbox', '', '', '', '', 1),
 ('bx_timeline_enable_brief_cards', '', @iCategId, '_bx_timeline_option_enable_brief_cards', 'checkbox', '', '', '', '', 2),
 ('bx_timeline_videos_autoplay', 'off', @iCategId, '_bx_timeline_option_videos_autoplay', 'select', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_options_videos_autoplay";}', 10),
 ('bx_timeline_preload_comments', '0', @iCategId, '_bx_timeline_option_preload_comments', 'digit', '', '', '', '', 20),

+ 0 - 61
modules/boonex/timeline/js/view.js

@@ -32,8 +32,6 @@ function BxTimelineView(oOptions) {
     this._bInfScrollBusy = false;
     this._iInfScrollPreloads = 1; //--- First portion is loaded with page loading or 'Load More' button click.
 
-    this._bDynamicCards = oOptions.bDynamicCards == undefined ? false : oOptions.bDynamicCards;
-
     this._fOutsideOffset = 0.8;
     this._oSaved = {};
 
@@ -46,8 +44,6 @@ function BxTimelineView(oOptions) {
         window.glBxTimelineVapPlayers = [];
 
     this.initView();
-    if(this._bDynamicCards) 
-        this.loadCards();
 
     if(this._bInit) {
         var $this = this;
@@ -271,63 +267,6 @@ BxTimelineView.prototype.initVideosAutoplay = function(oParent)
     });
 };
 
-BxTimelineView.prototype.loadCards = function()
-{
-    var $this = this;
-    var oData = this._getDefaultData();
-
-    this.oView.find('.' + this.sClassItem + '.' + this.sClassSample).each(function(iIndex, oItem) {
-        var oItem = $(oItem);
-        var sItemId = oItem.attr('id');
-
-        oData['id'] = parseInt(oItem.attr('bx-id'));
-
-        jQuery.get (
-            $this._sActionsUrl + 'get_post',
-            oData,
-            function(oData) {
-                if(!oData.item) {
-                    oItem.remove();
-                    return;
-                }
-
-                oItem.replaceWith($(oData.item).bxProcessHtml());
-
-                oItem = $this.oView.find('#' + sItemId);
-
-                if($this.bViewTimeline) {
-                    //-- Check content to show 'See More'
-                    $this.initSeeMore(oItem, false);
-
-                    //--- Hide timeline Events which are outside the viewport
-                    $this.hideEvent(oItem, $this._fOutsideOffset, iIndex, true);
-        
-                    //--- Init Flickity
-                    $this.initFlickityByItem(oItem);
-
-                    //--- Init Video Autoplay
-                    if(this._sVideosAutoplay != 'off')
-                        $this.initVideosAutoplay(oItem);
-                }
-
-                if($this.bViewOutline)
-                    $this.appendMasonry(oItem, function(oItem) {
-                        //-- Check content to show 'See More'
-                        $this.initSeeMore(oItem, false);
-
-                        //--- Init Flickity
-                        $this.initFlickityByItem(oItem);
-
-                        //--- Init Video Layout
-                        if($this._sVideosAutoplay != 'off') 
-                            $this.initVideos(oItem);
-                    });
-            },
-            'json'
-        );
-    });
-};
-
 BxTimelineView.prototype.hideEvents = function(oEvents, fOffset)
 {
     var $this = this;

+ 0 - 30
modules/boonex/timeline/template/item_outline_sample.html

@@ -1,30 +0,0 @@
-<div id="__html_id__" class="__style_prefix__-item __style_prefix__-sample __class__" bx-id="__id__">
-    <a name="timeline-event-__id__"></a>
-    <div class="__style_prefix__-item-ind bx-def-padding-sec">
-        <div class="__style_prefix__-item-cnt bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box">
-            <div class="__style_prefix__-is vcenter">
-                <div class="__style_prefix__-is-avatar bx-def-thumb-size">
-                    <span class="__style_prefix__-is-icon bx-def-thumb bx-def-thumb-size"></span>
-                </div>
-                <div class="__style_prefix__-is-content bx-def-margin-left">
-                    <h3 class="__style_prefix__-is-title" style="width: 58%;"></h3>
-                    <ul class="__style_prefix__-is-aux">
-                        <li style="width: 27%;"></li>
-                    </ul>
-                </div>
-            </div>
-            <div class="__style_prefix__-is">
-                <div class="__style_prefix__-is-content">
-                    <ul class="__style_prefix__-is-paragraph">
-                        <li></li><li></li><li style="width: 61%;"></li>
-                        <li></li><li style="width: 83%;"></li><li></li>
-                        <li></li><li></li><li style="width: 55%;"></li>
-                    </ul>
-                    <ul class="__style_prefix__-is-paragraph">
-                        <li style="width: 27%;"></li>
-                    </ul>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>

+ 0 - 19
modules/boonex/timeline/template/item_timeline_sample.html

@@ -1,19 +0,0 @@
-<div id="__html_id__" class="__style_prefix__-item __style_prefix__-sample __class__ bx-def-thumb-size-min-height bx-def-padding-bottom bx-clearfix" bx-id="__id__">
-    <a name="timeline-event-__id__"></a>
-    <div class="__style_prefix__-item-type bx-def-media-phone-hide">
-        <div class="__style_prefix__-item-circle">
-            <i class="sys-icon __icon__"></i>
-        </div>
-    </div>
-    <div class="__style_prefix__-item-cnt bx-def-box bx-def-box-sizing bx-def-padding bx-def-round-corners bx-def-color-bg-box">
-        <div class="__style_prefix__-is">
-            <div class="__style_prefix__-is-avatar bx-def-thumb-size">
-                <span class="__style_prefix__-is-icon bx-def-thumb bx-def-thumb-size"></span>
-            </div>
-            <div class="__style_prefix__-is-content bx-def-margin-left">
-                <h3 class="__style_prefix__-is-title" style="width: 38%;"></h3>
-                <ul class="__style_prefix__-is-paragraph"><li></li><li></li><li style="width: 61%;"></li></ul>
-            </div>
-        </div>
-    </div>
-</div>