Skip to content
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

Update Shorten Posts extension #1972

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

beccasafan
Copy link

@beccasafan beccasafan commented Aug 22, 2020

Update for react, remove options that aren't relevant anymore with NPF, add a threshold preference as discussed in Discord.

wrapperCss: null,
avatarCss: null,
processing: false,

run: function() {

this.running = true;

This comment was marked as off-topic.

@AprilSylph AprilSylph self-requested a review August 25, 2020 19:50
run: function() {

this.running = true;
XKit.extensions.shorten_posts.cpanel_check_height();

if ($(".posts .post").length > 0) {
if ($("[data-id], .posts .post").length > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check should be removed entirely in case the user hard-loads onto a page without posts and then soft-loads onto a page with posts


$obj.addClass("xkit-shorten-posts-shortened");

$article.append("<div class=\"xkit-shorten-posts-embiggen xkit-shorten-posts-embiggen-for-post-" + post_id + "\" data-post-id=\"" + post_id + "\" data-old-height=\"" + height + "\">This post has been shortened. Click here to show the full post</div>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these escapes and string concatenation is a little rough, could this be a template string instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants