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

SCDoc: redesign TOC and menubar again #3831

Merged
merged 5 commits into from Jul 9, 2018

Conversation

nhthn
Copy link
Contributor

@nhthn nhthn commented Jun 29, 2018

a lot of changes here:

cc @jamshark70.

@nhthn nhthn added the comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" label Jun 29, 2018
@nhthn nhthn added this to the 3.10 milestone Jun 29, 2018
@mossheim
Copy link
Contributor

This looks pretty good to me!

image

Having some sort of jQuery-like thing available would be nice from what I understand of JavaScript. I don't mind the dependency.

$("#toc").appendTo(toc_container);

toc_items = document.getElementById("toc")
.getElementsByTagName("ul")[0].getElementsByTagName("li");
Copy link
Member

Choose a reason for hiding this comment

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

@snappizz why not use zepto selector here instead of vanilla js? Can't you just do (like jquery):

$('#toc ul').eq(0).find('li')

Same below with $('#toc_search')?

Copy link
Contributor Author

@nhthn nhthn Jul 1, 2018

Choose a reason for hiding this comment

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

it was originally written in vanilla js, and i just haven't bothered to refactor it to use zepto.

Copy link
Member

Choose a reason for hiding this comment

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

@snappizz you use zepto selectors one line above so please, let's either use it or not, but not both

@gusano
Copy link
Member

gusano commented Jun 30, 2018

@snappizz what exactly is the benefit to using zepto vs jquery?
Not a big fan of it TBH..
Also see my comments above..

@nhthn
Copy link
Contributor Author

nhthn commented Jul 1, 2018

zepto is smaller. full jquery functionality is not needed.

$("#toc").appendTo(toc_container);

toc_items = document.getElementById("toc")
.getElementsByTagName("ul")[0].getElementsByTagName("li");
Copy link
Member

Choose a reason for hiding this comment

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

@snappizz you use zepto selectors one line above so please, let's either use it or not, but not both

toc_items = document.getElementById("toc")
.getElementsByTagName("ul")[0].getElementsByTagName("li");

document.getElementById("toc_search").onkeyup = toc_search;
Copy link
Member

Choose a reason for hiding this comment

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

@snappizz same here

toc_link.on("click", function (e) {
e.preventDefault();
document.getElementById("toc_search").focus();
$("#toc").toggle();
Copy link
Member

Choose a reason for hiding this comment

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

@snappizz same here

@jamshark70
Copy link
Contributor

Just tried this branch. It's a massive improvement in usability -- excellent work, Nathan!

The floating menu bar results in one display glitch. I wouldn't have any idea how to fix it. I could live with this more than I could live with the 3.9 workflow, but I guess it's only a matter of time before some user complains.

Jumping to a named anchor positions the anchored text at the top of the window, but the menu bar covers part of the top of the window. So part of the text is hidden.

  1. Open Server help (really, any help file).
  2. In the table of contents, choose a method (e.g. record).
  3. You can't see the method header for record (but the description and arguments are there).

help-browser

@nhthn
Copy link
Contributor Author

nhthn commented Jul 5, 2018

thanks james. i won't have access to my dev environment for the next few days, but i'll use this fix: https://css-tricks.com/hash-tag-links-padding/

Nathan Ho added 3 commits July 8, 2018 15:33
This commit loads jQuery into the SCDoc system.
This commit:

- Restores the floating menu bar in SCDoc.
- Fixes print-friendliness (supercollider#3395)
- Redesigns TOC to fix an issue with internal links (supercollider#3831)
- Unifies appearance of TOC and index submenu
- Refactors a lot of code to use jQuery
@nhthn
Copy link
Contributor Author

nhthn commented Jul 8, 2018

i've fixed the internal links issue, upgraded from zepto to jquery, and refactored some more old code to use jQuery.

there's still some non-jQuery code adjacent to jQuery code. i don't wanna hear about that, there's only so much adjacent refactoring i'm willing to do here.

Copy link
Member

@gusano gusano left a comment

Choose a reason for hiding this comment

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

@snappizz nice one, thank you :)

My complaints were about some non-jquery code in the middle of some jquery code in your additions, not in the older code, so all looks good now!

ps: ah, I still see the anchor link issue James reported

deepinscreenshot_select-area_20180709164617

Signed-off-by: Yvan Volochine <yvan.github@gmail.com>
@gusano
Copy link
Member

gusano commented Jul 9, 2018

@snappizz @jamshark70 I pushed a small fix for the padding glitch on anchor links.. hope you don't mind ;)

deepinscreenshot_select-area_20180709175607

@nhthn
Copy link
Contributor Author

nhthn commented Jul 9, 2018

thanks yvan, looks good!

@telephon telephon merged commit 54208e8 into supercollider:develop Jul 9, 2018
@nhthn nhthn added this to Done in 3.10 Jul 9, 2018
@prko
Copy link
Contributor

prko commented Jul 10, 2018

Hi,
I compiled the version from the source code:
https://github.com/supercollider/supercollider
The issue #3395 is fixed. It is great!

However, I have found the following:

  1. directly above the section title, the links are not clicked (See the attachement):

    • Please try to click the followings above the section title "Description" in the SinOSC help document:
      • the link 'Osc.sc' in the third line,
      • the link 'Osc' in the fourth line and
      • the link 'FSinOsc' in the fourth line.
    • Also, please try to click the followings above the section title "Description" in the same document:
      • the link 'Klang' and
      • the link 'Dynklang'.
  2. The shortcut SHIFT+Enter is broken. It removes text.

  3. The shortcut CMD+Enter evaluate whole codes in a code::.....::

If you already know, I apologise for writing this.

help document mouse click

@patrickdupuis
Copy link
Contributor

@prko Please open an issue rather than commenting here. This PR is closed.

BTW I am seeing this same issue.

@nhthn
Copy link
Contributor Author

nhthn commented Jul 10, 2018

@prko thanks for the report. the link problem is legit and i'll get on that in a moment, but the shortcut issues are a result of other changes (see #3829 and #3777).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help"
Projects
No open projects
3.10
Done
Development

Successfully merging this pull request may close these issues.

3.9 help Table of Contents is unwieldy to use
7 participants