zotero / publications

Easily display Zotero items on a webpage
Other
32 stars 8 forks source link

Cite functionality #2

Closed tnajdek closed 8 years ago

tnajdek commented 8 years ago

See below for updated requirements.

tnajdek commented 8 years ago

Re: implementation this will behave very similarly to export functionality (see #1)

flachware commented 8 years ago

we already show a reference – either directly in the list or on top of the details view. so there is no need to have a cite button, but we could rather have a little 'change style' link, which shows a select element with the list of citation styles on click.

preselection would be a handy feature (how does it technically work in google scholar?).

dstillman commented 8 years ago

I think we do still need a cite button.

The entry in the list will be in the style of the list, which might not be a bibliographic style at all (e.g., if we offer custom My-Pubs-specific styles), and it'd be weird for the list entry itself to change.

Since the details view is opening right below the list entry, it strikes me as a little weird to have a list entry with all its info and then repeat all that info a few pixels down. I think it may make more sense to consider the details view as an expansion of the list entry rather than as a separate view. (This is why I was suggesting that we reduce the indent.) But even if we did treat the details view as a separate view and repeat the bib info at the top, I think it would be in a hard-coded template or a custom style rather than something that made sense to be changed dynamically by the user.

flachware commented 8 years ago

i also consider the 'details view' as an expansion of the list. the indent merely indicates the list item to which the details belong.

which options do we have left, if we neither want to change the references themselves, nor want to duplicate the reference information?

dstillman commented 8 years ago

The generated reference would go either at the bottom of the details view (but only generated on-demand) or in an in-page pop-up, similar to Google Scholar.

flachware commented 8 years ago

i was assuming that the list would be in a bibliographic style (in the not-templated-mode), or at least in a way that allows us to spare the reference in the details. so i guess i was wrong and we have to display the reference in any case, i will change that in the template.

nevertheless, google scholar does not show a default reference (as we use it instead of the metadata table); showing the references on demand makes perfectly sense there, no duplication.

if we generate the reference on demand, let's say at the bottom of the details view, we still have the reference at the top of the details. are we fine with that?

dstillman commented 8 years ago

i was assuming that the list would be in a bibliographic style (in the not-templated-mode), or at least in a way that allows us to spare the reference in the details

The list would be in a bibliographic style some of the time, but you as a viewer still shouldn't be able to change the appearance of the list entry itself. Among other things, that would require the list entry to change as you opened and closed the details view so that it matched the rest of the list when closed. The list entry should be a fixed thing that has its details shown and hidden.

if we generate the reference on demand, let's say at the bottom of the details view, we still have the reference at the top of the details. are we fine with that?

At the top meaning the list entry? (To clarify, I was saying above that there shouldn't be a separate default reference at the top of the details view. Not sure if that's still in the current design.) I think that's OK — the list entry is part of the list, and it may or may not even be in a bibliographic style.

flachware commented 8 years ago

got it. yes, currently there is a default reference implemented in the details view, i will remove it.

tnajdek commented 8 years ago

Thanks for your input guys, just to quickly recap:

flachware commented 8 years ago

i added the basic styling to the cite feature. the reference is rendered into a paragraph now, which unfortunately broke the functionality somehow (selecting a different style does not update the reference inside the paragraph). i hope it is easy to fix.

click on the paragraph should fire selectAll and set the focus on it.

i would prefer to have links instead of buttons, in order to keep the list away from a web app appearance (as discussed with dan on irc), that means preventDefault has to be set on the links when we add the href="…" attribute.

there are some issues with the collapse: generally we should remove the inline-style height after the expand transition because the set height causes troubles when the viewport is resized. the cite expand should work then without being cropped by the zotero-details container (collapsed should be the default). the zotero-cite-container lacks a set height for the transition to work.

tnajdek commented 8 years ago

Thanks for adding new styling, will merge into master.

We can't really remove inline-style height without removing the slide-out animation (because it's not possible to transition to/from height: auto. However we can fix it to adapt the height on viewport resize, see #4.

Cite functionality is currently WIP hence the possibility of cropped/bugged render.

Agreed on all the other points.

tnajdek commented 8 years ago

So what are the opinions re: dedicated copy button? Do we want/need it at all?

I would probably just use https://clipboardjs.com/ as it's small & clean so no reason to re-invent the wheel.

Thoughts?

dstillman commented 8 years ago

Yeah, that looks pretty nice. I don't think we need it, but not much of a reason not to.

flachware commented 8 years ago

looks good to me.

tnajdek commented 8 years ago

Ok, let's skip the copy-to-clipboard button for now.

Last thing:

tnajdek commented 8 years ago

Last changes done in 05c1c839ac59e64d5171aafa52e22edc768b165d as described above. closing.