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

how to properly set files changed as expanded by default #56

Closed
sreich opened this issue Feb 1, 2016 · 6 comments
Closed

how to properly set files changed as expanded by default #56

sreich opened this issue Feb 1, 2016 · 6 comments

Comments

@sreich
Copy link

sreich commented Feb 1, 2016

for instances where i'm more interested in the summary of files changed, i would like to have this expanded by default.

i thought i'd be able to do it by setting the url, given that gets changed, but it gets changed to something like 'diff.html#d2h-show-hfr' and 'diff.html#d2h-hide-pvi'

i'm confused as to what the '-hfr' and '-pvi' do, they are not static between generations, they seem random, so it isn't something i could add to my url that i give out

is it possible to easily get functionality like what i want?

@rtfpessoa
Copy link
Owner

The problem here is that we did not wanted to use javascript to do this, so css was used.
The main issue happens when it is done by id, if you have two diffs in the same page it will have problems since you cannot have two ids.

Maybe we should use class, still is not ideal.

@rtfpessoa
Copy link
Owner

@sreich In #58 I added the diff2html-ui and with it the ability to set if the files are expanded or not by default when running the JS on the page. Is that a solution for your problem?

@sreich
Copy link
Author

sreich commented Feb 8, 2016

hey, nice to see progress on this and the other issues i reported!

well, thing is, for it to be useful for me i'd need that to also be exposed via diff2html-cli, as that's all i (can) use. could you be a dear and add a switch for that? :-)

@rtfpessoa
Copy link
Owner

@sreich just released a fix for the cli and also some more customization for the summary.

If you install version 1.4.4 you should have:

diff2html --su open
diff2html --su closed
diff2html --su hidden

Is it ok?

@rtfpessoa
Copy link
Owner

I also added two hash tags to be able to override this with the url:

  • #files-summary-show
  • #files-summary-hide

this will also override any previous decision.
This is available in version 1.4.5.

@sreich can I close this or do you have any other suggestion?

@sreich
Copy link
Author

sreich commented Feb 15, 2016

yes this works perfectly and you covered all bases -- nice work! 👍

@sreich sreich closed this as completed Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants