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

fix: increase recommended logo size, improve javascript, replace Twitter logo #474

Merged
merged 17 commits into from
Dec 19, 2024

Conversation

SteelWagstaff
Copy link
Member

@SteelWagstaff SteelWagstaff commented Dec 13, 2024

This PR increases the recommended custom logo size (from 40x265 pixels to 140x560 pixels) in order to support the display of logos up to 70x280 pixels on Retina 2x monitors. Fixes #201. Note: will need to wait to be merged until new release of Aetna is updated in this repo. See pressbooks/aetna#87

It addresses #198 by adding a new 'Header Background' option to the color customizer. Depends on pressbooks/pressbooks#3867 and the open PR in Aetna.

It resolves #235 by making small improvements to the common.js javascript file.

It also replaces the Twitter logo (and label) with X's logo and label, replaces the link to the no longer maintained Pressbooks Twitter account in the footer with a link to our LinkedIn page, and adds three new social media options to the Customizer (for LinkedIn, YouTube, and Bluesky).

$anchorElement.scrollTo({ duration: 1500 });
$anchorElement.trigger('focus');
} else {
console.warn(`Anchor element "${anchorUponArrival}" not found in the document.`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can delete this console.warn

Copy link
Member Author

Choose a reason for hiding this comment

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

It could fail, silently, sure. I was adding it in case someone wanted to understand why the page didn't jump to the expected anchor point. Previously we were just throwing an error if the anchor wasn't present: #235. Happy to defer to your judgment about what's best

Copy link
Contributor

Choose a reason for hiding this comment

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

got it. I think it would be good to debug, maybe locally or on dev, but I am not sure if we want to print errors in the console in production for debugging purposes. In case we want to debug it in prod, maybe we could think of some strategy, such as sending it somewhere in the backend and putting it in the error logs?

Copy link
Member Author

@SteelWagstaff SteelWagstaff Dec 17, 2024

Choose a reason for hiding this comment

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

I wasn't intending it to be used for debugging by a developer, but to inform the browser user. If, for example, as a reader I pasted a link that looks like this: https://pressbooks.pub/mybook/#fake but the fake anchor doesn't exist in the page, I might be surprised that the page doesn't load at the expected anchor. Opening the browser console would display a warning message telling me that the anchor fake doesn't exist on the page so I could correct or update the URL path. It was purely intended for informational purposes. If you don't think it's helpful, let me know, and I can remove it -- it would be a simple commit to take it out.

Comment on lines +39 to +40
input.classList.add('error');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a linting issue here it seems

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not seeing any locally. What's the issue?
Screenshot 2024-12-16 155820

@SteelWagstaff
Copy link
Member Author

FYI: new Aetna release has been made and bump was added to this PR.

@arzola arzola self-requested a review December 19, 2024 02:00
Copy link
Contributor

@arzola arzola left a comment

Choose a reason for hiding this comment

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

LGTM I tested all of this changes and works as expected

@arzola arzola merged commit 85cffed into dev Dec 19, 2024
@arzola arzola deleted the fix/assorted-aldine-issues branch December 19, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if scrollTo target is a valid DOM element Increase size allocated for institutional logo
4 participants