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

INT-2756: add statusbar attribute #56

Merged
merged 5 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- The `id` attribute was not being used as the id for the editor.

### Added
- Added new `statusbar` attribute that sets the editors `statusbar` config option.

## 2.0.2 - 2023-03-27

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"webpack": "^5.75.0"
},
"dependencies": {},
"version": "2.0.3-rc",
"version": "2.1.0-rc",
"name": "@tinymce/tinymce-webcomponent"
}
1 change: 1 addition & 0 deletions src/main/ts/component/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const parseNumberOrString = (value: string) => /^\d+$/.test(value) ? Number.pars

const configAttributes: Record<string, (v: string) => unknown> = {
setup: parseGlobal, // function
statusbar: parseBooleanOrString, // boolean
Copy link
Member

Choose a reason for hiding this comment

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

Should this be // boolean or string

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought the same, but it is a boolean: https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/#statusbar

I think we both confused with toolbar

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, then parseBooleanOrString should be parseBoolean ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used that because is what is used for other fields like powerpaste_allow_local_images and images_upload_credentials, maybe I'm wrong but the attribute will be always a string so even true and false will be "true" and "false"

Copy link
Member

Choose a reason for hiding this comment

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

Right since they are all strings it needs to check for specific values or fallback to the string value. Makes sense now. I really should have spent time to look thought the webcomponent plugin this sprint but all other stuff came in between.

toolbar: parseFalseOrString, // string or false
menubar: parseFalseOrString, // string or false
plugins: parseString, // string
Expand Down