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

Add Field.prototype.toXml() & .fromXml() #1627

Closed
2 tasks
AnmAtAnm opened this issue Feb 15, 2018 · 1 comment
Closed
2 tasks

Add Field.prototype.toXml() & .fromXml() #1627

AnmAtAnm opened this issue Feb 15, 2018 · 1 comment
Labels
component: fields component: i/o help wanted External contributions actively solicited

Comments

@AnmAtAnm
Copy link
Contributor

AnmAtAnm commented Feb 15, 2018

Problem statement

Some fields need more than the value= attribute of the <field> XML when serializing and deserializing data. For example, FieldVariable uses id= and variabletype=.

Proposed Solution

  • Add .fromXml(/* @type {!Element} */ fieldElement) and .toXml(!Element} */ fieldElement) to the Field base class.
  • Modify Blockly.Xml.fieldToDom_(..) and .domToField_() to call new methods.
@RoboErikG
Copy link
Contributor

RoboErikG commented Apr 25, 2019

After internal discussion we'd like to keep writing the value as the text in the element instead of adding a value property to the tag. Edited the checklist to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: fields component: i/o help wanted External contributions actively solicited
Projects
None yet
Development

No branches or pull requests

3 participants