Skip to content

Issues-498: fixed threaded/flat mode for anonymous, Issues-488: formatting nested comments, Issues-491:set the scroll animations settings as in quotes plugin #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ReplyTo/class.replyto.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ public function commentModel_deleteComment_handler(&$Sender) {
}

public function discussionController_BeforeCalculatingOffsetLimit_handler($sender, $args) {
if (!Gdn::session()->isValid()) {
return;
}
$viewMode = self::getViewMode();
// $offsetProvided = $args['OffsetProvided'];
$discussion = $args['Discussion'];
Expand Down
99 changes: 97 additions & 2 deletions ReplyTo/design/replyto.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,103 @@ li.Item.ReplyToDepth-9 {
margin-left: 14em;
}

/* Stop indenting any further after 10 levels */
li.Item.ReplyToDepth-10plus {
li.Item.ReplyToDepth-10 {
margin-left: 15em;
}

li.Item.ReplyToDepth-11 {
margin-left: 16em;
}

li.Item.ReplyToDepth-12 {
margin-left: 17em;
}

li.Item.ReplyToDepth-13 {
margin-left: 18em;
}

li.Item.ReplyToDepth-14 {
margin-left: 19em;
}

li.Item.ReplyToDepth-15 {
margin-left: 20em;
}


/* Stop indenting any further after 15 levels */
li.Item.ReplyToDepth-16plus {
margin-left: 20em;
}

@media screen and (max-width: 960px) {
li.Item.ReplyToDepth-1 {
margin-left: 1em;
}

li.Item.ReplyToDepth-2 {
margin-left: 1.25em;
}

li.Item.ReplyToDepth-3 {
margin-left: 1.5em;
}

li.Item.ReplyToDepth-4 {
margin-left: 1.75em;
}

li.Item.ReplyToDepth-5 {
margin-left: 2em;
}

/* Reduce the indenting to single ems after 5 levels */

li.Item.ReplyToDepth-6 {
margin-left: 2.25em;
}

li.Item.ReplyToDepth-7 {
margin-left: 2.5em;
}

li.Item.ReplyToDepth-8 {
margin-left: 2.75em;
}

li.Item.ReplyToDepth-9 {
margin-left: 3em;
}

li.Item.ReplyToDepth-10 {
margin-left: 3.25em;
}

li.Item.ReplyToDepth-11 {
margin-left: 3.5em;
}

li.Item.ReplyToDepth-12 {
margin-left: 3.75em;
}

li.Item.ReplyToDepth-13 {
margin-left: 4em;
}

li.Item.ReplyToDepth-14 {
margin-left: 4.25em;
}

li.Item.ReplyToDepth-15 {
margin-left: 4.5em;
}


/* Stop indenting any further after 15 levels */
li.Item.ReplyToDepth-16plus {
margin-left: 5em;
}

}
6 changes: 4 additions & 2 deletions ReplyTo/js/replyto.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jQuery(document).ready(function($) {
//If view is not flat, reload a page to rebuild a tree
function reloadPage() {
var currentView = param(window.location.href, 'view');
return (currentView == 'tree' || currentView == 'threaded');
return currentView == 'threaded';
}

$(document).on('click','a.ReplyComment', function(ev) {
Expand Down Expand Up @@ -48,7 +48,9 @@ jQuery(document).ready(function($) {
} else {
$(cancelReplyButton).show();
}
$(form)[0].scrollIntoView();

var ScrollY = $(form).offset().top - 100;
$('html,body').animate({scrollTop: ScrollY}, 800);
return false;
});

Expand Down
2 changes: 1 addition & 1 deletion ReplyTo/models/class.replytomodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function depthClasses($depth) {

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