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 Old Bailey Online.js #1760

Merged
merged 4 commits into from Nov 12, 2018
Merged

Update Old Bailey Online.js #1760

merged 4 commits into from Nov 12, 2018

Conversation

sharonhoward
Copy link
Contributor

Fixed function

sharonhoward and others added 2 commits October 8, 2018 16:29
The reason for that last bit in the conditional is to not impose title case where the title is already properly cased, i.e. not in all caps
"items": [
{
"itemType": "case",
"caseName": ".",
Copy link
Collaborator

Choose a reason for hiding this comment

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

That doesn't seem right/helpful as data import. I think what I would do is strip all trailing periods and commas, and then set newItem.title = [no title] when there's nothing left -- does that sound right?

Copy link
Contributor

@zuphilip zuphilip Nov 10, 2018

Choose a reason for hiding this comment

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

What you suggest looks fine for me.

@adam3smith
Copy link
Collaborator

@sharonhoward -- could you take a look what you think about my changes? Looks good to me, but I don't use the database.


if (newItem.itemType == "case" && newItem.title && newItem.title == newItem.title.toUpperCase()) {
if (newItem.itemType == "case" && trialTitle && trialTitle == trialTitle.toUpperCase()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to split this further up, because maybe also trialTitle for a case might exitsts which is not all uppercase:

if (newItem.itemType == "case" && trialTitle) {
   if (trialTitle == trialTitle.toUpperCase()) {
      newItem.title = ZU.capitalizeTitle(trialTitle, true);
   } else {
      newItem.title = trialTitle;
   }
}

@zuphilip zuphilip merged commit cf1f2a4 into zotero:master Nov 12, 2018
@zuphilip
Copy link
Contributor

Thank you both for the work here!

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

Successfully merging this pull request may close these issues.

None yet

3 participants