Просмотр исходного кода

#24 - Timeline.
1. Updated inline comments.
2. View tile in popup and separate page.

AntonLV 13 лет назад
Родитель
Сommit
03cdf2b786

+ 0 - 6
modules/boonex/timeline/classes/BxTimelineCmts.php

@@ -18,12 +18,6 @@ class BxTimelineCmts extends BxTemplCmtsView
         parent::BxTemplCmtsView($sSystem, $iId, $iInit);
     }
 
-    public static function includeCssJs()
-    {
-		self::getExtraJs();
-		self::getExtraCss();
-    }
-
     public function isAttachImageEnabled()
     {
     	return false;

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -193,7 +193,7 @@ class BxTimelineDb extends BxDolModuleDb
         switch($aParams['type']) {
             case 'id':
             	$sMethod = 'getRow';
-                $sWhereClause = $this->prepare("AND `te`.`id`=? ", $aParams['object_id']);
+                $sWhereClause = $this->prepare("AND `te`.`id`=? ", $aParams['value']);
                 $sLimitClause = "LIMIT 1";
                 break;
 

+ 28 - 3
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -51,7 +51,7 @@ class BxTimelineModule extends BxDolModule
     {
         parent::BxDolModule($aModule);
         $this->_oConfig->init($this->_oDb);
-
+        $this->_oTemplate->init();
         $this->_iOwnerId = 0;
     }
 
@@ -173,9 +173,22 @@ class BxTimelineModule extends BxDolModule
     	$sSystem = bx_process_input(bx_get('system'), BX_DATA_TEXT);
     	$iId = bx_process_input(bx_get('id'), BX_DATA_INT);
 
-    	$aComments = $this->_oTemplate->getComments($sSystem, $iId);
+    	$sComments = $this->_oTemplate->getComments($sSystem, $iId);
+
+    	$this->_echoResultJson(array('content' => $sComments));
+    }
+
+    public function actionGetPostPopup()
+    {
+    	$iItemId = bx_process_input(bx_get('id'), BX_DATA_INT);
+    	if(!$iItemId) {
+    		$this->_echoResultJson(array());
+    		return;
+    	}
+
+    	$sContent = $this->_oTemplate->getViewItemPopup($iItemId);
 
-    	$this->_echoResultJson($aComments);
+    	$this->_echoResultJson(array('popup' => $sContent));
     }
 
 	/**
@@ -283,6 +296,15 @@ class BxTimelineModule extends BxDolModule
         return array('content' => $sContent, 'menu' => $oMenu);
     }
 
+    public function serviceGetBlockItem()
+    {
+    	$iItemId = bx_process_input(bx_get('id'), BX_DATA_INT);
+    	if(!$iItemId)
+    		return array();
+
+    	return array('content' => $this->_oTemplate->getViewItemBlock($iItemId));
+    }
+
     /*
      * COMMON METHODS 
      */
@@ -479,6 +501,9 @@ class BxTimelineModule extends BxDolModule
 
     public function getCmtsObject($sSystem, $iId)
     {
+    	if(empty($sSystem) || (int)$iId == 0)
+    		return false;
+
     	bx_import('BxDolCmts');
         $oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
 		if(!$oCmts->isEnabled())

+ 105 - 35
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -24,6 +24,12 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	return BxDolModule::getInstance($sName);
     }
 
+	public function getCssJs()
+    {
+    	$this->addCss(array('plugins/jquery/themes/|jquery-ui.css', 'view.css', 'view-media-tablet.css', 'view-media-desktop.css', 'post.css'));
+        $this->addJs(array('jquery.ui.all.min.js', 'jquery.resize.js', 'plugins/|masonry.pkgd.min.js', 'common_anim.js', 'main.js', 'view.js', 'post.js'));
+    }
+
     public function getJsCode($sType, $aRequestParams = array(), $bWrap = true)
     {
     	$oJson = new Services_JSON();
@@ -40,7 +46,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 			iOwnerId: <?=$oModule->_iOwnerId; ?>,
             sAnimationEffect: '<?=$this->_oConfig->getAnimationEffect(); ?>',
             iAnimationSpeed: '<?=$this->_oConfig->getAnimationSpeed(); ?>',
-            oRequestParams: <?php echo $oJson->encode($aRequestParams); ?>
+            oRequestParams: <?php echo !empty($aRequestParams) ? $oJson->encode($aRequestParams) : '{}'; ?>
         });
 <?php
 		$sContent = ob_get_clean();
@@ -57,8 +63,6 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	$aFormLink = $oModule->getFormLink();
     	$aFormPhoto = $oModule->getFormPhoto();
 
-    	$this->addCss('post.css');
-        $this->addJs(array('jquery.form.js', 'main.js', 'post.js'));
         return $this->parseHtmlByName('post.html', array (
             'js_object' => $sJsObject,
         	'js_content' => $this->getJsCode('post', array(
@@ -95,13 +99,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 			'modules' => $aModules
 		));
 
-    	$this->addCss(array('plugins/jquery/themes/|jquery-ui.css', 'view.css', 'view-media-tablet.css', 'view-media-desktop.css'));
-        $this->addJs(array('jquery.ui.all.min.js', 'jquery.resize.js', 'plugins/|masonry.pkgd.min.js', 'common_anim.js', 'main.js', 'view.js'));
-
-        $oModule = $this->getModule();
-        bx_import('Cmts', $oModule->_aModule);
-		BxTimelineCmts::includeCssJs();
-
+    	$this->getCssJs();
     	return $this->parseHtmlByName('view.html', array(
     		'style_prefix' => $this->_oConfig->getPrefix('style'),
             'timeline' => $this->getTimeline($iOwnerId, $iStart, $iPerPage, $sFilter, $iTimeline, $aModules),
@@ -118,6 +116,36 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         ));
     }
 
+    public function getViewItemBlock($iId)
+    {
+    	$aEvent = $this->_oDb->getEvents(array('type' => 'id', 'value' => $iId));
+    	if(empty($aEvent))
+    		return '';
+
+    	$sContent = $this->getJsCode('view');
+    	$sContent .= $this->getPost($aEvent, array('type' => 'view_item'));
+
+		$this->getCssJs();
+    	return $sContent;
+    }
+
+    public function getViewItemPopup($iId)
+    {
+    	$sContent = $this->getViewItemBlock($iId);
+
+    	bx_import('BxTemplFunctions');
+    	return $this->parsePageByName('view_item.html', array(
+    		'style_prefix' => $this->_oConfig->getPrefix('style'),
+    		'id' => $iId,
+    		'content' => BxTemplFunctions::getInstance()->transBox($sContent)
+    	));
+    }
+
+    public function getPost(&$aEvent, $aParams = array())
+    {
+    	return !empty($aEvent['action']) ? $this->getSystem($aEvent, $aParams) : $this->getCommon($aEvent, $aParams);
+    }
+
 	public function getPosts($aParams)
     {
     	$iStart = $aParams['start'];
@@ -152,11 +180,11 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         $sContent = $this->getEmpty($iEvents <= 0);
 
         foreach($aEvents as $aEvent) {
-            $aEvent['content'] = !empty($aEvent['action']) ? $this->getSystem($aEvent, $aParams) : $this->getCommon($aEvent, $aParams);
-            if(empty($aEvent['content']))
+            $sEvent = $this->getPost($aEvent, $aParams);
+            if(empty($sEvent))
                 continue;
 
-            $sContent .= $aEvent['content'];
+            $sContent .= $sEvent;
         }
 
         $sLoadMore = $this->getLoadMore($iStart, $iPerPage, $bNext, $iEvents > 0);
@@ -216,18 +244,17 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 
     	$oCmts = $oModule->getCmtsObject($sSystem, $iId);
     	if($oCmts === false)
-			return array();
+			return '';
 
-		$sContent = $this->parseHtmlByName('comments.html', array(
+		$aComments = $oCmts->getCommentsBlock(0, 0, false);
+		return $this->parseHtmlByName('comments.html', array(
         	'style_prefix' => $sStylePrefix,
 			'id' => $iId,
-        	'content' => $oCmts->getCommentsBlock(0, 0, false)
+        	'content' => $aComments['content']
         ));
-
-        return array('content' => $sContent);
     }
 
-	function getSystem($aEvent, $aBrowseParams)
+	function getSystem(&$aEvent, $aBrowseParams = array())
     {
         $aResult = $this->_getSystemData($aEvent);
 		if(empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content']))
@@ -250,7 +277,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         return $this->_getPost($sType, $aEvent, $aBrowseParams);
     }
 
-    public function getCommon($aEvent, $aBrowseParams)
+    public function getCommon(&$aEvent, $aBrowseParams = array())
     {
     	$sPrefix = $this->_oConfig->getPrefix('common_post');
         if(strpos($aEvent['type'], $sPrefix) !== 0)
@@ -307,7 +334,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 		return $this->_getPost($sType, $aEvent, $aBrowseParams);
     }
 
-	protected function _getPost($sType, $aEvent, $aBrowseParams)
+	protected function _getPost($sType, $aEvent, $aBrowseParams = array())
     {
 		$oModule = $this->getModule();
 		$sStylePrefix = $this->_oConfig->getPrefix('style');
@@ -319,12 +346,16 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         $aTmplVarsMenu = $this->_getTmplVarsItemMenu($aEvent);
 
         $aTmplVarsTimelineOwner = array();
-        if($aBrowseParams['type'] == 'friends')
+        if(isset($aBrowseParams['type']) && $aBrowseParams['type'] == 'friends')
         	$aTmplVarsTimelineOwner = $this->_getTmplVarsTimelineOwner($aEvent);
 
+		bx_import('BxDolPermalinks');
+		$sViewUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=timeline-item&id=' . $aEvent['id']);
+
         $aTmplVars = array (
         	'style_prefix' => $sStylePrefix,
-        	'post_id' => $aEvent['id'],
+        	'js_object' => $sJsObject,
+        	'id' => $aEvent['id'],
         	'bx_if:show_menu' => array(
         		'condition' => !empty($aTmplVarsMenu),
         		'content' => $aTmplVarsMenu
@@ -345,19 +376,32 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         		'condition' => !empty($aTmplVarsTimelineOwner),
         		'content' => $aTmplVarsTimelineOwner
         	),
+        	'item_view_url' => $sViewUrl,
         	'item_date' => bx_time_js($aEvent['date']),
         	'bx_if:show_comments' => array(
 				'condition' => false,
 				'content' => array()
-			)
+			),
+			'bx_if:show_votes' => array(
+				'condition' => false,
+				'content' => array()
+			),
+			'comments' => ''
         );
 
+        //--- Add Comments
         if(!empty($aEvent['comments']) && is_array($aEvent['comments'])) {
-        	$aTmplVarsComments = $this->_getTmplVarsComments($aEvent['comments']);
+        	$aTmplVarsComments = $this->_getTmplVarsComments($aEvent['comments'], $aBrowseParams);
         	if(is_array($aTmplVarsComments))
         		$aTmplVars = array_merge($aTmplVars, $aTmplVarsComments);
         }
 
+        //--- Add Votes
+        $aEvent['votes'] = '';
+        $aTmplVarsVotes = $this->_getTmplVarsVotes($aEvent['votes']);
+		if(is_array($aTmplVarsVotes))
+        	$aTmplVars = array_merge($aTmplVars, $aTmplVarsVotes);
+
         $sMethod = '_getTmplVarsContent' . ucfirst($sType);
         if(method_exists($this, $sMethod)) {
         	$aTmplVarsContent = $this->$sMethod($aEvent['content']);
@@ -408,7 +452,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         return $aTmplVarsTimelineOwner;
     }
 
-	protected function _getTmplVarsComments($aComments)
+	protected function _getTmplVarsComments($aComments, $aBrowseParams)
     {
     	$sStylePrefix = $this->_oConfig->getPrefix('style');
 
@@ -418,19 +462,45 @@ class BxTimelineTemplate extends BxDolModuleTemplate
     	if($sSystem == '' || $iObjectId == 0 || ($iCount == 0 && !isLogged()))
     		return array();
 
+    	$oCmts = $this->getModule()->getCmtsObject($sSystem, $iObjectId);
+    	$oCmts->addCssJs();
+
+    	$sComments = '';
+    	if(isset($aBrowseParams['type']) && $aBrowseParams['type'] == 'view_item')
+			$sComments = $this->getComments($sSystem, $iObjectId);
+
 		return array(
     		'bx_if:show_comments' => array(
     			'condition' => true,
     			'content' => array(
 					'style_prefix' => $sStylePrefix,
-					'link' => $this->parseHtmlByName('bx_a.html', array(
-						'href' => 'javascript:void(0)',
-						'title' => _t($iCount > 0 ? '_bx_timeline_txt_view_comments' : '_bx_timeline_txt_add_comment'),
-						'bx_repeat:attrs' => array(
-							array('key' => 'onclick', 'value' => "javascript:" . $this->_oConfig->getJsObject('view') . ".showComments(this, '" . $sSystem . "', " . $iObjectId . ")")
-						),
-						'content' => $iCount > 0 ? _t('_bx_timeline_txt_n_comments', $iCount) : _t('_bx_timeline_txt_add_comment')
-					))
+					'url' => 'javascript:void(0)',
+					'onclick' => "javascript:" . $this->_oConfig->getJsObject('view') . ".commentItem(this, '" . $sSystem . "', " . $iObjectId . ")",
+					'content' => $iCount > 0 ? _t('_bx_timeline_txt_n_comments', $iCount) : _t('_bx_timeline_txt_comment')
+				)
+			),
+			'comments' => $sComments
+		);
+    }
+
+	protected function _getTmplVarsVotes($aVotes)
+    {
+    	$sStylePrefix = $this->_oConfig->getPrefix('style');
+/*
+    	$sSystem = isset($aComments['system']) ? $aComments['system'] : '';
+    	$iObjectId = isset($aComments['object_id']) ? (int)$aComments['object_id'] : 0;
+    	$iCount = isset($aComments['count']) ? (int)$aComments['count'] : 0;
+    	if($sSystem == '' || $iObjectId == 0 || ($iCount == 0 && !isLogged()))
+    		return array();
+*/
+		return array(
+    		'bx_if:show_votes' => array(
+    			'condition' => true,
+    			'content' => array(
+					'style_prefix' => $sStylePrefix,
+					'url' => 'javascript:void(0)',
+					'onclick' => "javascript:" . $this->_oConfig->getJsObject('view') . ".voteItem(this)",
+					'content' => _t('_bx_timeline_txt_plus')
 				)
 			)
 		);
@@ -583,7 +653,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
         }
 
         return $mixedResult;
-    } 
+    }
 	protected function _prepareTextForOutput($s)
     {
 		$s = bx_process_output($s, BX_DATA_TEXT);

+ 7 - 2
modules/boonex/timeline/install/langs/en.xml

@@ -54,10 +54,13 @@
 
 	<string name="_bx_timeline_page_title_sys_view"><![CDATA[View Timeline]]></string>
 	<string name="_bx_timeline_page_title_view"><![CDATA[View Timeline]]></string>
+	<string name="_bx_timeline_page_title_sys_item"><![CDATA[Timeline Item]]></string>
+	<string name="_bx_timeline_page_title_item"><![CDATA[Timeline Item]]></string>
 	<string name="_bx_timeline_page_block_title_post"><![CDATA[Post to Timeline]]></string>
 	<string name="_bx_timeline_page_block_title_view"><![CDATA[View Timeline]]></string>
 	<string name="_bx_timeline_page_block_title_post_profile"><![CDATA[Post to Timeline]]></string>
 	<string name="_bx_timeline_page_block_title_view_profile"><![CDATA[Timeline]]></string>
+	<string name="_bx_timeline_page_block_title_item"><![CDATA[Item]]></string>
 
 	<!--
     <string name="_bx_timeline_menu_set_title_XXX"><![CDATA[Notes Submenu]]></string>
@@ -93,8 +96,10 @@
 	<string name="_bx_timeline_txt_added_photo"><![CDATA[added a photo]]></string>
 	<string name="_bx_timeline_txt_date_from"><![CDATA[today]]></string>
 	<string name="_bx_timeline_txt_date_to"><![CDATA[olden days]]></string>
-	<string name="_bx_timeline_txt_view_comments"><![CDATA[View comments]]></string>
-	<string name="_bx_timeline_txt_add_comment"><![CDATA[Add comment]]></string>
+	
+	<string name="_bx_timeline_txt_comment"><![CDATA[Comment]]></string>
 	<string name="_bx_timeline_txt_n_comments"><![CDATA[{0} comments]]></string>
 
+	<string name="_bx_timeline_txt_plus"><![CDATA[Plus]]></string>
+	
 </resources>

+ 5 - 2
modules/boonex/timeline/install/sql/enable.sql

@@ -1,10 +1,13 @@
 -- PAGES & BLOCKS
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_timeline_view', '_bx_timeline_page_title_sys_view', '_bx_timeline_page_title_view', 'bx_timeline', 5, 2147483647, 1, 'view', 'page.php?i=view', '', '', '', 0, 1, 0, '', '');
+('bx_timeline_view', '_bx_timeline_page_title_sys_view', '_bx_timeline_page_title_view', 'bx_timeline', 5, 2147483647, 1, 'timeline-view', 'page.php?i=timeline-view', '', '', '', 0, 1, 0, '', ''),
+('bx_timeline_item', '_bx_timeline_page_title_sys_item', '_bx_timeline_page_title_item', 'bx_timeline', 5, 2147483647, 1, 'timeline-item', 'page.php?i=timeline-item', '', '', '', 0, 1, 0, '', '');
 
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
 ('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_post', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_post";}', 0, 0, 1),
-('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_view";}', 0, 1, 1);
+('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_view";}', 0, 1, 1),
+
+('bx_timeline_item', 1, 'bx_timeline', '_bx_timeline_page_block_title_item', 0, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_item";}', 0, 1, 1);
 
 SET @iPBCellProfile = 1;
 SET @iPBOrderProfile = (SELECT MAX(`order`) FROM `sys_pages_blocks` WHERE `object`='bx_persons_view_profile' AND `cell_id` = @iPBCellProfile LIMIT 1);

+ 8 - 2
modules/boonex/timeline/js/main.js

@@ -1,11 +1,12 @@
 function BxTimelineMain() {
 	this.sIdPost = '#bx-timeline-post';
-	
+
 	this.sIdView = '#bx-timeline';
 	this.sIdItem = '#bx-timeline-item-';
-	this.sIdComments = '#bx-timeline-comments-';
 
 	this.sClassMasonry = 'bx-tl-masonry';
+	this.sClassActions = 'bx-tl-actions';
+	this.sClassComments = 'bx-tl-comments';
 }
 
 BxTimelineMain.prototype.isMasonry = function() {
@@ -60,6 +61,11 @@ BxTimelineMain.prototype.loadingInButton = function(e, bShow) {
 		bx_loading($('body'), bShow);	
 };
 
+BxTimelineMain.prototype.loadingInItem = function(e, bShow) {
+	var oParent = $(e).length ? $(e).parents('.bx-tl-item:first') : $('body'); 
+	bx_loading(oParent, bShow);
+};
+
 BxTimelineMain.prototype.loadingInBlock = function(e, bShow) {
 	var oParent = $(e).length ? $(e).parents('.bx-db-container:first') : $('body'); 
 	bx_loading(oParent, bShow);

+ 51 - 11
modules/boonex/timeline/js/view.js

@@ -101,44 +101,84 @@ BxTimelineView.prototype.showMoreContent = function(oLink) {
 	this.reloadMasonry();
 };
 
-BxTimelineView.prototype.showPostMenu = function(oLink) {
+BxTimelineView.prototype.showItemMenu = function(oLink) {
 	var sId = $(oLink).parents('.bx-tl-item-menu:first').children('.bx-db-menu-popup:hidden').attr('id');
 	bx_menu_popup_inline('#' + sId, oLink);
 };
 
-BxTimelineView.prototype.showComments = function(oLink, sSystem, iId) {
+BxTimelineView.prototype.showItem = function(oLink, iId) {
+	var $this = this;
+
+    var oData = this._getDefaultData();    
+    oData['id'] = iId;
+
+	if(oLink)
+    	this.loadingInItem(oLink, true);
+
+	jQuery.post (
+		this._sActionsUrl + 'get_post_popup',
+	    oData,
+	    function(oData) {
+			if(oLink)
+				$this.loadingInItem(oLink, false);
+
+			if(!oData.popup)
+				return;
+
+			var oPopup = $(oData.popup).hide(); 
+
+	        $('#' + oPopup.attr('id')).remove();
+	        oPopup.prependTo('body').bxTime().dolPopup({
+	        	fog: {
+	        		color: '#fff',
+	    			opacity: 0.7
+	        	}
+	        });
+		},
+	    'json'
+	);
+
+	return false;
+};
+
+BxTimelineView.prototype.commentItem = function(oLink, sSystem, iId) {
 	var $this = this;
 
     var oData = this._getDefaultData();
+    oData['system'] = sSystem;    
     oData['id'] = iId;
-    oData['system'] = sSystem;
 
-    if(oLink)
-    	this.loadingInBlock(oLink, true);
+    var oActions = $(oLink).parents('.' + this.sClassActions + ':first');
+    var oComments = oActions.next('.' + this.sClassComments);
 
-    if($(this.sIdComments + iId + ':hidden').length > 0) {
-    	$(oLink).next(this.sIdComments + iId + ':hidden').bx_anim('show', this._sAnimationEffect, this._iAnimationSpeed);
+    if(oComments.length > 0) {
+    	oComments.bx_anim('toggle', this._sAnimationEffect, this._iAnimationSpeed);
     	return;
     }
 
+    if(oLink)
+    	this.loadingInItem(oLink, true);
+
     jQuery.post (
         this._sActionsUrl + 'get_comments',
         oData,
         function(oData) {
         	if(oLink)
-        		$this.loadingInBlock(oLink, false);
+        		$this.loadingInItem(oLink, false);
 
         	if(!oData.content)
         		return;
 
-        	$(oLink).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
-        		$(this).parents('.bx-tl-comments-link:first').after($(oData.content).hide()).next($this.sIdComments + iId + ':hidden').bxTime().bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed);
-    		});
+        	oActions.after($(oData.content).hide()).next('.' + $this.sClassComments + ':hidden').bxTime().bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed);
         },
         'json'
     );
 };
 
+BxTimelineView.prototype.voteItem = function(oLink) {
+	alert('Votes will be here.');
+};
+
 BxTimelineView.prototype._getPosts = function(oElement, sAction) {
     var $this = this;
     var oView = $(this.sIdView);

+ 3 - 1
modules/boonex/timeline/template/comments.html

@@ -1 +1,3 @@
-<div id="bx-timeline-comments-__id__" class="__style_prefix__-comments">__content__</div>
+<div id="bx-timeline-comments-__id__" class="__style_prefix__-comments bx-def-margin-top">
+	<div class="__style_prefix__-comments-cnt">__content__</div>
+</div>

+ 7 - 0
modules/boonex/timeline/template/css/view.css

@@ -79,6 +79,13 @@ span.bx-tl-content-see-more a {
 	font-weight: bold;
 }
 
+
+/*--- View Item Popup Style ---*/
+div.bx-tl-item-popup div.bx-tl-item {
+	width: 100%;
+} 
+
+
 /*--- Empty Style ---*/
 div.bx-tl-empty div.bx-msg-box-container {
 	margin-top: 0px;

+ 16 - 14
modules/boonex/timeline/template/text.html

@@ -1,4 +1,4 @@
-<div id="bx-timeline-item-__post_id__" class="__style_prefix__-item bx-tl-grid-sizer">
+<div id="bx-timeline-item-__id__" class="__style_prefix__-item bx-tl-grid-sizer">
 	<div class="__style_prefix__-item-ind bx-def-padding-sec">
 	    <div class="__style_prefix__-item-cnt bx-def-padding bx-def-round-corners bx-def-shadow">
 	    	<bx_if:show_images>
@@ -6,7 +6,7 @@
 		    		<div class="__style_prefix__-item-image bx-def-thumb bx-def-margin-bottom">__image__</div>
 		    	</bx_repeat:images>
 	    	</bx_if:show_images>
-	    	<div class="__style_prefix__-owner bx-def-icon-size-min-height"> 
+	    	<div class="__style_prefix__-owner bx-def-margin-bottom bx-def-icon-size-min-height"> 
 		       	<div class="__style_prefix__-owner-icon bx-def-icon bx-def-icon-size">
 					<bx_if:show_icon>
 						<img src="__author_icon__" />
@@ -22,12 +22,14 @@
 			        	<a href="__owner_url__" class="__style_prefix__-timeline-owner-name">__owner_username__</a>
 			        </bx_if:show_timeline_owner>
 				</div>
-				<div class="__style_prefix__-date bx-def-font-small bx-def-font-grayed">__item_date__</div>
+				<div class="__style_prefix__-date bx-def-font-small bx-def-font-grayed">
+					<a href="__item_view_url__" onclick="javascript:return __js_object__.showItem(this, __id__)">__item_date__</a>
+				</div>
 				<bx_if:show_menu>
 					<div class="__style_prefix__-item-menu">
 						__menu__
 						<div class="__style_prefix__-item-menu-button">
-				   			<a href="javascript:void(0)" onclick="javascript:__js_object__.showPostMenu(this);">
+				   			<a href="javascript:void(0)" onclick="javascript:__js_object__.showItemMenu(this);">
 								<i class="sys-icon chevron-down"></i>
 							</a>
 						</div>
@@ -35,23 +37,23 @@
 			   	</bx_if:show_menu>
 			</div>
 			<bx_if:show_title>
-				<div class="__style_prefix__-title bx-def-margin-sec-top bx-def-font-large">__title__</div>
+				<div class="__style_prefix__-title bx-def-margin-sec-bottom bx-def-font-large">__title__</div>
 			</bx_if:show_title>
 			<bx_if:show_content>
-				<div class="__style_prefix__-content bx-def-margin-sec-top bx-def-font-grayed">
+				<div class="__style_prefix__-content bx-def-margin-sec-bottom">
 				__item_content__<bx_if:show_more><span class="__style_prefix__-content-see-more">... <a class="bx-def-font-small" href="javascript:void(0)" onclick="__js_object__.showMoreContent(this);"><bx_text:_see_more /></a></span><span style="display:none;"> __item_content_more__</span></bx_if:show_more>
 				</div>
 			</bx_if:show_content>
 
-			<bx_if:show_comments>
-				<div class="__style_prefix__-comments-link bx-def-margin-sec-top">__link__</div>
-			</bx_if:show_comments>
-			<!--
-			<div class="__style_prefix__-comments bx-def-margin-sec-top bx-def-border bx-def-round-corners">
-				<i class="sys-icon comment-o"></i>
-				<a href="__item_comments_link__">__item_comments__</a>
+			<div class="__style_prefix__-actions">
+				<bx_if:show_comments>
+					<a class="bx-def-margin-left-auto" href="__url__" onclick="__onclick__"><i class="sys-icon comment"></i>&nbsp;__content__</a>
+				</bx_if:show_comments>
+				<bx_if:show_votes>
+					<a class="bx-def-margin-left-auto" href="__url__" onclick="__onclick__"><i class="sys-icon plus"></i>&nbsp;__content__</a>
+				</bx_if:show_votes>
 			</div>
-			-->
+			__comments__
 		</div>
 	</div>
 </div>

+ 1 - 0
modules/boonex/timeline/template/view_item.html

@@ -0,0 +1 @@
+<div id="bx-timeline-item-popup-__id__" class="__style_prefix__-item-popup bx-popup-width">__content__</div>