mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-04 23:44:25 +03:00
навигация по комментариям
This commit is contained in:
parent
680201a7b2
commit
0bca992257
|
@ -91,6 +91,10 @@
|
||||||
<li><a href="javascript:lsCmtTree.toggleCommentForm({$aComment.obj->getId()});" class="reply-link">{$aLang.comment_answer}</a></li>
|
<li><a href="javascript:lsCmtTree.toggleCommentForm({$aComment.obj->getId()});" class="reply-link">{$aLang.comment_answer}</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
<li><a href="#comment{$aComment.obj->getId()}" class="imglink link"></a></li>
|
<li><a href="#comment{$aComment.obj->getId()}" class="imglink link"></a></li>
|
||||||
|
{if $aComment.obj->getPid()}
|
||||||
|
<li class="goto-comment-parent"><a href="#comment{$aComment.obj->getPid()}" onclick="return lsCmtTree.goToParentComment($(this));" title="Ответ на">↑</a></li>
|
||||||
|
{/if}
|
||||||
|
<li class="goto-comment-child hidden"><a href="#" onclick="return lsCmtTree.goToChildComment(this);" title="Обратно к ответу">↓</a></li>
|
||||||
{if !$aComment.obj->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
{if !$aComment.obj->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
||||||
<li><a href="#" class="delete" onclick="lsCmtTree.toggleComment(this,{$aComment.obj->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
<li><a href="#" class="delete" onclick="lsCmtTree.toggleComment(this,{$aComment.obj->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -24,7 +24,11 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li class="date">{date_format date=$oComment->getDate()}</li>
|
<li class="date">{date_format date=$oComment->getDate()}</li>
|
||||||
<li><a href="javascript:lsCmtTree.toggleCommentForm({$oComment->getId()});" class="reply-link">Ответить</a></li>
|
<li><a href="javascript:lsCmtTree.toggleCommentForm({$oComment->getId()});" class="reply-link">Ответить</a></li>
|
||||||
<li><a href="#comment{$oComment->getId()}" class="imglink link"></a></li>
|
<li><a href="#comment{$oComment->getId()}" class="imglink link"></a></li>
|
||||||
|
{if $oComment->getPid()}
|
||||||
|
<li class="goto-comment-parent"><a href="#comment{$oComment->getPid()}" onclick="return lsCmtTree.goToParentComment($(this));" title="Ответ на">↑</a></li>
|
||||||
|
{/if}
|
||||||
|
<li class="goto-comment-child hidden"><a href="#" onclick="return lsCmtTree.goToChildComment(this);" title="Обратно к ответу">↓</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -470,6 +470,8 @@ select { width: 99%; }
|
||||||
.comment .info ul li { float: left; font-size: 10px; margin-right: 10px; }
|
.comment .info ul li { float: left; font-size: 10px; margin-right: 10px; }
|
||||||
.comment .info ul li.date { color: #999; font-size: 10px; padding-right: 20px; }
|
.comment .info ul li.date { color: #999; font-size: 10px; padding-right: 20px; }
|
||||||
.comment .info a.imglink { display: block; width: 9px; height: 11px; text-decoration: none; position: relative; top: 3px; }
|
.comment .info a.imglink { display: block; width: 9px; height: 11px; text-decoration: none; position: relative; top: 3px; }
|
||||||
|
.comment .info ul li.goto-comment-parent a { text-decoration: none; border-bottom: 1px dotted #79B1D4; font-family: tahoma;}
|
||||||
|
.comment .info ul li.goto-comment-child a { text-decoration: none; border-bottom: 1px dotted #79B1D4; font-family: tahoma;}
|
||||||
.comment .info a.link { background: url(../images/icons.gif) no-repeat scroll -10px -230px; }
|
.comment .info a.link { background: url(../images/icons.gif) no-repeat scroll -10px -230px; }
|
||||||
.comment .info a.link:hover { background: url(../images/icons.gif) no-repeat scroll 0px -230px; }
|
.comment .info a.link:hover { background: url(../images/icons.gif) no-repeat scroll 0px -230px; }
|
||||||
.comment .info a.favorite { background: url(../images/icons.gif) no-repeat scroll -40px -40px; }
|
.comment .info a.favorite { background: url(../images/icons.gif) no-repeat scroll -40px -40px; }
|
||||||
|
@ -765,7 +767,7 @@ table.admin_page td { /* IE: */ border-left: expression(previousSibling == nul
|
||||||
table.admin_page img {margin: 0px !important;;}
|
table.admin_page img {margin: 0px !important;;}
|
||||||
|
|
||||||
|
|
||||||
|
.hidden {display: none;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ var lsCmtTreeClass = new Class({
|
||||||
this.aCommentNew=[];
|
this.aCommentNew=[];
|
||||||
this.iCurrentShowFormComment=0;
|
this.iCurrentShowFormComment=0;
|
||||||
this.countNewComment=0;
|
this.countNewComment=0;
|
||||||
|
this.docScroller = new Fx.Scroll(document.getDocument());
|
||||||
|
|
||||||
this.hideCommentForm(this.iCurrentShowFormComment);
|
this.hideCommentForm(this.iCurrentShowFormComment);
|
||||||
},
|
},
|
||||||
|
@ -180,7 +181,7 @@ var lsCmtTreeClass = new Class({
|
||||||
});
|
});
|
||||||
|
|
||||||
if (selfIdComment && $('comment_id_'+selfIdComment)) {
|
if (selfIdComment && $('comment_id_'+selfIdComment)) {
|
||||||
docScroller.toElement($('comment_id_'+selfIdComment));
|
thisObj.docScroller.toElement($('comment_id_'+selfIdComment));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -212,14 +213,14 @@ var lsCmtTreeClass = new Class({
|
||||||
var offsetY=0;
|
var offsetY=0;
|
||||||
//для скролла в центр
|
//для скролла в центр
|
||||||
//offsetY=-window.getSize().y/2;
|
//offsetY=-window.getSize().y/2;
|
||||||
docScroller.setOptions({
|
this.docScroller.setOptions({
|
||||||
duration:500,
|
duration:500,
|
||||||
offset: {
|
offset: {
|
||||||
'x': 0,
|
'x': 0,
|
||||||
'y': offsetY
|
'y': offsetY
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
docScroller.toElement($('comment_id_'+this.aCommentNew[0]));
|
this.docScroller.toElement($('comment_id_'+this.aCommentNew[0]));
|
||||||
}
|
}
|
||||||
this.aCommentNew.erase(this.aCommentNew[0]);
|
this.aCommentNew.erase(this.aCommentNew[0]);
|
||||||
}
|
}
|
||||||
|
@ -327,12 +328,30 @@ var lsCmtTreeClass = new Class({
|
||||||
|
|
||||||
preview: function() {
|
preview: function() {
|
||||||
ajaxTextPreview('form_comment_text',false,'comment_preview_'+this.iCurrentShowFormComment);
|
ajaxTextPreview('form_comment_text',false,'comment_preview_'+this.iCurrentShowFormComment);
|
||||||
}
|
},
|
||||||
|
|
||||||
|
goToParentComment: function(obj) {
|
||||||
|
var idCmt = obj.href.substr(obj.href.indexOf('#')+8);
|
||||||
|
var objCmtParent=$('comment_id_'+idCmt);
|
||||||
|
var objCmt=obj.getParent('div.comment');
|
||||||
|
objCmtParent.getElement('.goto-comment-child').removeClass('hidden');
|
||||||
|
objCmtParent.getElement('.goto-comment-child a').href = '#comment' + objCmt.id.substr(11);
|
||||||
|
this.docScroller.toElement(objCmtParent);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
goToChildComment: function(obj) {
|
||||||
|
var idCmt = obj.href.substr(obj.href.indexOf('#')+8);
|
||||||
|
var objCmtChild=$('comment_id_'+idCmt);
|
||||||
|
var objCmt=obj.getParent('div.comment');
|
||||||
|
objCmt.getElement('.goto-comment-child').addClass('hidden');
|
||||||
|
this.docScroller.toElement(objCmtChild);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var lsCmtTree;
|
var lsCmtTree;
|
||||||
var docScroller;
|
|
||||||
var formCommentSlide;
|
var formCommentSlide;
|
||||||
|
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
|
@ -345,8 +364,7 @@ window.addEvent('domready', function() {
|
||||||
closeImg: 'folding'
|
closeImg: 'folding'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
docScroller = new Fx.Scroll(document.getDocument());
|
|
||||||
// formCommentSlide = new Fx.Slide('form_comment2');
|
// formCommentSlide = new Fx.Slide('form_comment2');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue