From 0bca992257d82fbe0f0fcc55edb7197da91174c8 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sun, 29 Mar 2009 12:02:35 +0000 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D0=B2=D0=B8=D0=B3=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skin/new/actions/ActionBlog/comment.tpl | 4 +++ templates/skin/new/comment.tpl | 6 +++- templates/skin/new/css/style.css | 4 ++- templates/skin/new/js/comments.js | 32 +++++++++++++++---- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/templates/skin/new/actions/ActionBlog/comment.tpl b/templates/skin/new/actions/ActionBlog/comment.tpl index c86b871f..bea7d94a 100644 --- a/templates/skin/new/actions/ActionBlog/comment.tpl +++ b/templates/skin/new/actions/ActionBlog/comment.tpl @@ -91,6 +91,10 @@
  • {$aLang.comment_answer}
  • {/if}
  • + {if $aComment.obj->getPid()} +
  • + {/if} + {if !$aComment.obj->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
  • {$aLang.comment_delete}
  • {/if} diff --git a/templates/skin/new/comment.tpl b/templates/skin/new/comment.tpl index 8e5a206e..fbe54296 100644 --- a/templates/skin/new/comment.tpl +++ b/templates/skin/new/comment.tpl @@ -24,7 +24,11 @@ diff --git a/templates/skin/new/css/style.css b/templates/skin/new/css/style.css index 9ed73cd7..7d9b29e1 100644 --- a/templates/skin/new/css/style.css +++ b/templates/skin/new/css/style.css @@ -470,6 +470,8 @@ select { width: 99%; } .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 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: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; } @@ -765,7 +767,7 @@ table.admin_page td { /* IE: */ border-left: expression(previousSibling == nul table.admin_page img {margin: 0px !important;;} - +.hidden {display: none;} diff --git a/templates/skin/new/js/comments.js b/templates/skin/new/js/comments.js index ad58dd33..3032f86d 100644 --- a/templates/skin/new/js/comments.js +++ b/templates/skin/new/js/comments.js @@ -22,6 +22,7 @@ var lsCmtTreeClass = new Class({ this.aCommentNew=[]; this.iCurrentShowFormComment=0; this.countNewComment=0; + this.docScroller = new Fx.Scroll(document.getDocument()); this.hideCommentForm(this.iCurrentShowFormComment); }, @@ -180,7 +181,7 @@ var lsCmtTreeClass = new Class({ }); 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; //для скролла в центр //offsetY=-window.getSize().y/2; - docScroller.setOptions({ + this.docScroller.setOptions({ duration:500, offset: { 'x': 0, 'y': offsetY } }); - docScroller.toElement($('comment_id_'+this.aCommentNew[0])); + this.docScroller.toElement($('comment_id_'+this.aCommentNew[0])); } this.aCommentNew.erase(this.aCommentNew[0]); } @@ -327,12 +328,30 @@ var lsCmtTreeClass = new Class({ preview: function() { 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 docScroller; var formCommentSlide; window.addEvent('domready', function() { @@ -345,8 +364,7 @@ window.addEvent('domready', function() { closeImg: 'folding' } }); - - docScroller = new Fx.Scroll(document.getDocument()); + // formCommentSlide = new Fx.Slide('form_comment2'); });