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

Visiting a specific Disqus Comment link does not reach its destination #6

Closed
tshepang opened this issue Sep 30, 2013 · 28 comments
Closed
Labels
bug Well, it shouldn’t be doing that. Let’s fix it!
Milestone

Comments

@tshepang
Copy link

This link should reach the oldest Comment in that thread, but it doesn't. This is likely related to the fact that Comments are hidden by default.

@talha131
Copy link
Member

talha131 commented Oct 6, 2013

Excellent! That's a good catch.

@talha131
Copy link
Member

talha131 commented Oct 7, 2013

@tshepang I have fixed this issue. But I need your input. Can you please pull my branch bugfix-uncollapse-comments-section and try it?

Please let me know when you update your blog with the fix so that I can check few others things too myself.

@tshepang
Copy link
Author

tshepang commented Oct 7, 2013

ekselent! it weks \0/

you can go ahead and do your tests

@talha131
Copy link
Member

talha131 commented Oct 8, 2013

Thanks @tshepang for your cooperation. Please keep on reporting issues that you notice.

@talha131
Copy link
Member

talha131 commented Oct 8, 2013

@tshepang need a favor from you. Can you please change the link of Elegant on your page from https://github.com/talha131/pelican-elegant to http://oncrashreboot.com/pelican-elegant. Thanks.

@tshepang
Copy link
Author

tshepang commented Oct 8, 2013

Why is that? There is already a pointer to the page I use. Also, that would break the consistency... all the other theme links point to the respective Github pages.

@talha131
Copy link
Member

talha131 commented Oct 8, 2013

My Github repository is not the best place to access Elegant. I am constantly updating and pushing changes to master. Sometimes, though rarely, I had to rebase too.

Users should use the zip files that they can download via "Get Elegant" button on the project documentation page.

Repository is useful for those people who can keep abreast with development.

I understand your point about other themes. But most other themes do not get as frequently updated as Elegant that's why pointing to repo is dangerous.

My intention is to keep is brain dead simple for users.

Let me know what you think about it.

@tshepang
Copy link
Author

tshepang commented Oct 8, 2013

The other themes don't normally have dedicated info, other than the README file. That you took the effort to create a detailed post about yours makes me wanna give you what you want :)

@talha131
Copy link
Member

talha131 commented Oct 8, 2013

Thanks a lot. I appreciate it. 😄

This is the permalink http://oncrashreboot.com/pelican-elegant.

@tshepang
Copy link
Author

tshepang commented Oct 8, 2013

you are too late :)

@tshepang
Copy link
Author

tshepang commented Oct 8, 2013

BTW, why are you doing a redirect? I see the actual url is http://oncrashreboot.com/elegant-a-clean-the me-for-pelican-with-search-feature.html. Why not shorten it to http://oncrashreboot.com/pelican-elegant?

@talha131
Copy link
Member

talha131 commented Oct 8, 2013

http://oncrashreboot.com/pelican-elegant is the actual URL of Github page for the project. Now if I want to host the documentation there using Pelican I will have to generate a new site from scratch and configure it's categories, tags etc. It's just too much work and result is not as good.

http://oncrashreboot.com/elegant-a-clean-theme-for-pelican-with-search-feature.html is the page on my blog. It's URL is going to change soon. I find it easy to redirect Github page to my blog page for easy maintenance.

Link on my blog can change that's why I use http://oncrashreboot.com/pelican-elegant as permalink.

@tshepang
Copy link
Author

This bug has resurfaced. Click the link under Elegant heading on this page to check.

@talha131
Copy link
Member

@tshepang can you please try again. I cannot reproduce this issue at all

@tshepang
Copy link
Author

I tried with Firefox and Chrome. I can go to the link if I use it directly (i.e. paste it onto the address bar), but not when I click on the link on that page. My browser just scrolls to the Comments section without actually exposing Disqus.

@talha131
Copy link
Member

This is the link.

I opened it up on Chrome, Safari and Firefox and they all worked as expected. When you see this problem, can you make sure that your page's HTML source code has following lines at the bottom.

<script language="javascript" type="text/javascript">
function uncollapse() {
    var hash_str = window.location.hash;
    if (window.location.hash.match(/^#comment-\d+$/))
    {
        var hash_str = '#disqus_thread';
    }
    $(hash_str).collapse({
        toggle: true
    })
}
</script>
<script type="text/javascript" language="JavaScript">
    uncollapse(); 
</script>

Let me know what you find.

@tshepang
Copy link
Author

I do have that text at the bottom.

Note that visiting the link 'directly' works, but not when visited from the page... do not open the link in a new tab to reproduce the issue.

@talha131
Copy link
Member

Now we are talking! I can reproduce the issue. I will come up with a fix soon. Thank you for reporting it.

@talha131 talha131 reopened this Nov 20, 2013
@tshepang
Copy link
Author

What sort of set-up do you have where you open links in new tabs?

@talha131
Copy link
Member

What sort of set-up do you have where you open links in new tabs?

No setup. It is just a out of habit that I always open links in new tabs.

@talha131
Copy link
Member

Disqus comments are in an iFrame. No matter how much I try, I cannot make it scroll to the exact comment.

The best I have manged to do is to open the comments section when user clicks on such links.

The final solution will require a bit more Javascript. Even then user will not be able to scroll to the exact disqus comment.

I wonder is it worth it? Such Javascript code is brittle, adding it might break more things. What purpose will it server when it cannot scroll you to the exact comment?

Easier solution that will not invite more bugs is to make sure such links open in a new tab. See a how to here.

We are facing this problem b/c disqus comments are loaded in an iFrame.

@talha131
Copy link
Member

There is another way to do it. If user clicks on such links, we reload the page. Then page scrolls to the correct comment. I think this one is a better solution.

@calfzhou please manage sometime to share your feedback too. Thank you.

@tshepang
Copy link
Author

For some reason, I think this was fixed. Do you think maybe Disqus changed it's behavior?

@talha131
Copy link
Member

For some reason, I think this was fixed. Do you think maybe Disqus changed it's behavior?

I don't think so. You must have tested it by opening it in a new tab. Anyway, can't comment on Disqus.

@tshepang
Copy link
Author

maybe; it's easy to miss like that :)

@calfzhou
Copy link
Contributor

No idea about this issue. One adhoc solution is to open the link in an new tab.

talha131 added a commit that referenced this issue Nov 25, 2013
Just call show instead of using toggel

Update #6
@talha131
Copy link
Member

@calfzhou Thank you.

@tshepang please confirm the fix.

Let me know if anyone finds a problem or bug with this solution.

@tshepang
Copy link
Author

Ugly workaround, but it works. Thanks.

tshepang added a commit to tshepang/blog that referenced this issue Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Well, it shouldn’t be doing that. Let’s fix it!
Development

No branches or pull requests

3 participants