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

Util.js to es5 #58

Merged
merged 9 commits into from
Sep 26, 2023
Merged

Util.js to es5 #58

merged 9 commits into from
Sep 26, 2023

Conversation

dunxd
Copy link

@dunxd dunxd commented Sep 25, 2023

Default values for function parameters were introduced in ES6. Old Kindle's Experimental Browser only supports ES5 features. I've changed the way that a default is handled, based on a method found on StackOverflow, and it works ok.

The initiateTwigged function that we moved earlier doesn't appear to use this, but I expect the issue is related to an unsupported language feature too.

@dunxd
Copy link
Author

dunxd commented Sep 25, 2023

I realised I could run util.js through chatGPT and ask it what wasn't valid ES5. It identified the use of let in the intiateTwig() function which I changed to var and the customise page does indeed work on my Kindle after that. I haven't included that in this PR since that function is defined elsewhere now, but at least we now know :-)

@dunxd
Copy link
Author

dunxd commented Sep 25, 2023

I didn't need to roll back all the changes :-) Still learning.

@mikespub
Copy link
Member

Thanks @dunxd - if we ever expand what's in util.js I would indeed consider splitting off an ES5 variant for very old e-readers

@mikespub mikespub merged commit d34a129 into mikespub-org:main Sep 26, 2023
@mikespub mikespub added the templates About COPS templates, stylesheets, javascript label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
templates About COPS templates, stylesheets, javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants