Skip to content

Commit 379dc1f

Browse files
authored
Merge pull request #76 from topcoder-platform/issues-498
Issues-498: fixed threaded/flat mode for anonymous, Issues-488: formatting nested comments, Issues-491:set the scroll animations settings as in quotes plugin
2 parents 9238058 + 92c8df2 commit 379dc1f

File tree

4 files changed

+102
-8
lines changed

4 files changed

+102
-8
lines changed

ReplyTo/class.replyto.plugin.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ public function commentModel_deleteComment_handler(&$Sender) {
144144
}
145145

146146
public function discussionController_BeforeCalculatingOffsetLimit_handler($sender, $args) {
147-
if (!Gdn::session()->isValid()) {
148-
return;
149-
}
150147
$viewMode = self::getViewMode();
151148
// $offsetProvided = $args['OffsetProvided'];
152149
$discussion = $args['Discussion'];

ReplyTo/design/replyto.css

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,103 @@ li.Item.ReplyToDepth-9 {
5656
margin-left: 14em;
5757
}
5858

59-
/* Stop indenting any further after 10 levels */
60-
li.Item.ReplyToDepth-10plus {
59+
li.Item.ReplyToDepth-10 {
6160
margin-left: 15em;
6261
}
6362

63+
li.Item.ReplyToDepth-11 {
64+
margin-left: 16em;
65+
}
66+
67+
li.Item.ReplyToDepth-12 {
68+
margin-left: 17em;
69+
}
70+
71+
li.Item.ReplyToDepth-13 {
72+
margin-left: 18em;
73+
}
74+
75+
li.Item.ReplyToDepth-14 {
76+
margin-left: 19em;
77+
}
78+
79+
li.Item.ReplyToDepth-15 {
80+
margin-left: 20em;
81+
}
82+
83+
84+
/* Stop indenting any further after 15 levels */
85+
li.Item.ReplyToDepth-16plus {
86+
margin-left: 20em;
87+
}
88+
89+
@media screen and (max-width: 960px) {
90+
li.Item.ReplyToDepth-1 {
91+
margin-left: 1em;
92+
}
93+
94+
li.Item.ReplyToDepth-2 {
95+
margin-left: 1.25em;
96+
}
97+
98+
li.Item.ReplyToDepth-3 {
99+
margin-left: 1.5em;
100+
}
101+
102+
li.Item.ReplyToDepth-4 {
103+
margin-left: 1.75em;
104+
}
105+
106+
li.Item.ReplyToDepth-5 {
107+
margin-left: 2em;
108+
}
109+
110+
/* Reduce the indenting to single ems after 5 levels */
111+
112+
li.Item.ReplyToDepth-6 {
113+
margin-left: 2.25em;
114+
}
115+
116+
li.Item.ReplyToDepth-7 {
117+
margin-left: 2.5em;
118+
}
119+
120+
li.Item.ReplyToDepth-8 {
121+
margin-left: 2.75em;
122+
}
123+
124+
li.Item.ReplyToDepth-9 {
125+
margin-left: 3em;
126+
}
127+
128+
li.Item.ReplyToDepth-10 {
129+
margin-left: 3.25em;
130+
}
131+
132+
li.Item.ReplyToDepth-11 {
133+
margin-left: 3.5em;
134+
}
135+
136+
li.Item.ReplyToDepth-12 {
137+
margin-left: 3.75em;
138+
}
139+
140+
li.Item.ReplyToDepth-13 {
141+
margin-left: 4em;
142+
}
143+
144+
li.Item.ReplyToDepth-14 {
145+
margin-left: 4.25em;
146+
}
147+
148+
li.Item.ReplyToDepth-15 {
149+
margin-left: 4.5em;
150+
}
151+
152+
153+
/* Stop indenting any further after 15 levels */
154+
li.Item.ReplyToDepth-16plus {
155+
margin-left: 5em;
156+
}
157+
158+
}

ReplyTo/js/replyto.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jQuery(document).ready(function($) {
77
//If view is not flat, reload a page to rebuild a tree
88
function reloadPage() {
99
var currentView = param(window.location.href, 'view');
10-
return (currentView == 'tree' || currentView == 'threaded');
10+
return currentView == 'threaded';
1111
}
1212

1313
$(document).on('click','a.ReplyComment', function(ev) {
@@ -48,7 +48,9 @@ jQuery(document).ready(function($) {
4848
} else {
4949
$(cancelReplyButton).show();
5050
}
51-
$(form)[0].scrollIntoView();
51+
52+
var ScrollY = $(form).offset().top - 100;
53+
$('html,body').animate({scrollTop: ScrollY}, 800);
5254
return false;
5355
});
5456

ReplyTo/models/class.replytomodel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function depthClasses($depth) {
293293

294294
// Add some further classes for blocks of each 5 depth levels, so limits can
295295
// be set on the way depth is formatted.
296-
for ($i = 1; $i <= 100; $i += 5) {
296+
for ($i = 1; $i <= 20; $i += 5) {
297297
if ($depth >= $i) {
298298
$Class .= ' ' . $Prefix . '-' . $i . 'plus';
299299
} else {

0 commit comments

Comments
 (0)