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

Preparing a sofatime standalone JavaScript library #1

Open
wants to merge 19 commits into
base: localizedFormat
Choose a base branch
from

Conversation

Juanc1to
Copy link
Collaborator

This commit provides infrastructure for distributing the JavaScript that sofatime uses as a stand-alone widget. This includes using yarn to manage library dependencies and using webpack to bundle the JavaScript for easier development and distribution.

You may need to follow the Yarn installation instructions, and then I believe the following should install the dependencies and then bundle and serve up the demo page in a live-reloading server listening on http://localhost:8080:

# yarn install
# yarn devser

As this changes the way that the sofatime JavaScript library is distributed, this will currently break the WordPress plugin; I would like to work with another one of our team to integrate the new JS library into WordPress.

sociocracyforall and others added 9 commits March 22, 2021 13:58
add notes and bug contact
This commit provides infrastructure for distributing the JavaScript that
sofatime uses as a stand-alone widget.  This includes using `yarn` to
manage library dependencies and using `webpack` to bundle the JavaScript
for easier development and distribution.
Store time zone information in a JSON file so that it can be localized.
This also includes a small library (jsontemplate) to build HTML DOM
trees from JavaScript objects, using a JavaScript template object to
specify the mapping.
This change inspects the browser's language preference and translates
the date display accordingly.
@Juanc1to
Copy link
Collaborator Author

This pull request now includes the feature of translating the formatted date into the user's browser-specified language. I couldn't backport the change to the current sociocracyforall:localizedFormat HEAD because it uses dynamic imports (for the language-specific dayjs locale information), and I don't know how to make dynamic imports work without the webpack support. Also, it would imply needing access to the individual dayjs locale files within our local repository, and I don't think we should be managing a third-party library within our repository.

Juanc1to added 10 commits May 31, 2022 16:01
Update the WordPress plugin to incorporate recent refactoring of the
JavaScript widget.
Switch the WordPress webpack configuration to production mode.
Support dates and times displayed inline, set the default mode for the
WordPress plugin to prominent controls, and bump the version to 0.2.0.
Upgrade yarn to fix an incompatibility with a new version of node.js,
and also fix a CSS regression so that the checkbox is displayed as a
toggle slider again.
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.

2 participants