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

Conversation

@sharonhoward
Copy link
Contributor

commented Oct 8, 2018

Fixed function

sharonhoward and others added some commits Oct 8, 2018

Update Old Bailey Online.js
Fixed function
tweak
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": ".",

This comment has been minimized.

Copy link
@adam3smith

adam3smith Oct 8, 2018

Collaborator

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?

This comment has been minimized.

Copy link
@zuphilip

zuphilip Nov 10, 2018

Collaborator

What you suggest looks fine for me.

@adam3smith

This comment has been minimized.

Copy link
Collaborator

commented Oct 12, 2018

@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()) {

This comment has been minimized.

Copy link
@zuphilip

zuphilip Nov 10, 2018

Collaborator

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zuphilip

This comment has been minimized.

Copy link
Collaborator

commented Nov 12, 2018

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
Projects
None yet
3 participants
You can’t perform that action at this time.