Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

BREAKING: Add Footer implementation #208

Merged
merged 21 commits into from
Jul 2, 2019
Merged

BREAKING: Add Footer implementation #208

merged 21 commits into from
Jul 2, 2019

Conversation

joewalsh
Copy link
Contributor

@joewalsh joewalsh commented Jun 19, 2019

https://phabricator.wikimedia.org/T217352

To test locally with a local instance of restbase running, use:

pagelib.c1.PageMods.addFooter(
    document,
    'Knight Lore',  // articleTitle
    [pagelib.c1.Footer.MenuItemType.languages, pagelib.c1.Footer.MenuItemType.lastEdited, pagelib.c1.Footer.MenuItemType.pageIssues, pagelib.c1.Footer.MenuItemType.disambiguation, pagelib.c1.Footer.MenuItemType.talkPage],  // menuItems
    { 
        'readMoreHeading': 'Read more',
        'menuDisambiguationTitle': 'Similar pages',
        'menuLanguagesTitle': 'Available in 9 other languages',
        'menuHeading': 'About this article',
        'menuLastEditedSubtitle': 'Full edit history',
        'menuLastEditedTitle': 'Edited today',
        'licenseString': 'Content is available under $1 unless otherwise noted.',
        'menuTalkPageTitle': 'View talk page',
        'menuPageIssuesTitle': 'Page issues',
        'viewInBrowserString': 'View article in browser',
        'licenseSubstitutionString': 'CC BY-SA 3.0',
        'menuCoordinateTitle': 'View on a map'
     }, // localizedStrings
     3,  // readMoreItemCount
     'http://localhost:7231/en.wikipedia.org/v1' // baseUrl for getting ReadMore items
)

And then to add a bookmark icon and text to a single Read more item:

pagelib.c1.PageMods.updateReadMoreSaveButtonForTitle(document, 'Mire Mare', 'Saved for later', true)

Screen Shot 2019-06-20 at 8 58 04 AM

out

Other notes:
This isn't intended to keep working as it did when bundled with the iOS app. The iOS app can stay on an older version of page library and the newer changes should be solely for mobile-html.

@berndsi
Copy link
Contributor

berndsi commented Jun 25, 2019

Other notes:
This isn't intended to keep working as it did when bundled with the iOS app. The iOS app can stay on an older version of page library and the newer changes should be solely for mobile-html.

@joewalsh What's the main reason to break backwards compatibility for the footer transform?

@joewalsh
Copy link
Contributor Author

joewalsh commented Jun 26, 2019

@joewalsh What's the main reason to break backwards compatibility for the footer transform?

@berndsi it's not worth investing effort in making the footer transform backwards compatible when it'd only be used for a short while before the iOS app upgrades to mobile-html. It's easier to have a clean break and implement it solely in the best way for mobile-html.

@berndsi berndsi changed the title addFooter implementation Add Footer implementation Jun 27, 2019
@berndsi berndsi changed the title Add Footer implementation BREAKING: Add Footer implementation Jun 27, 2019
padding-top: 35px;
font-size: 0.8em;
line-height: 0.8em;
color: #72777D;
}

.pagelib_theme_sepia .pagelib_footer_container_heading {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to keep those rules empty? Why not delete it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure. There had been several empty rules in this CSS file before. @joewalsh Any ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think all these empty rules can be removed. Should remove the classes in the HTML as well. They might need to be re-added depending on design tweaks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I'll do that

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@thesocialdev thesocialdev left a comment

Choose a reason for hiding this comment

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

Minor nit inline that I don't think is a big deal. Overall, LGTM.

docs/pcs/pcs.md Outdated Show resolved Hide resolved
@joewalsh
Copy link
Contributor Author

joewalsh commented Jul 1, 2019

I can't officially approve because it was originally my PR, but looks good to me 👍

@thesocialdev
Copy link
Collaborator

I can't officially approve because it was originally my PR, but looks good to me

LGTM to me too.

@berndsi
Copy link
Contributor

berndsi commented Jul 1, 2019

@joewalsh Thank you for fixing the docs.

@berndsi
Copy link
Contributor

berndsi commented Jul 1, 2019

rebased

joewalsh and others added 12 commits July 1, 2019 15:57
The update script requires 'request' which should be installed locally.
That way this doesn't need to be installed globally anymore.
It's a bit too much code for the high level PageMods to live in,
and seems that it could be a separate and optional feature.
Had changed the name, which should be reflected in the documentation.
Also removed the classes in the HTML. We can add those back if we need
them in the future.
I left the ids in the HTML, though.
@berndsi
Copy link
Contributor

berndsi commented Jul 1, 2019

rebased again. There were some conflicts that needed to be resolved first.

@berndsi berndsi merged commit 83a325b into master Jul 2, 2019
@berndsi berndsi deleted the ft branch July 2, 2019 03:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants