insin / dombuilder Goto Github PK
View Code? Open in Web Editor NEWDOM builder with multiple output formats
Home Page: https://dombuilder.readthedocs.org
DOM builder with multiple output formats
Home Page: https://dombuilder.readthedocs.org
An NBSP
variable has plagued DOMBuilder since it was first used to generate tables many moons ago. There are a couple of special cases in the code involving the unicode String representation of a non-breaking space.
As DOMBuilder doesn't do any HTML parsing with innerHTML
, how can we make it easier to work with entities in Strings?
Due to how we set attributes, it's possible to use an "innerHTML" attribute to specify the contents of a newly-created element as an HTML String in DOM mode.
Add special casing for this in HTML mode so it can be used interchangeably.
Provide exports for CommonJS when available.
Grab the global object by using "this" instead of passing "window" into the initialising function.
Goal for 2.1 - can we use the DOMBuilder API as the basis for an object-based templating system with template inheritance?
Scattershot thoughts and questions:
I don't see a license in the README or package.json. Mind adding one?
Since we're always working with objects when generating HTML with DOMBuilder, make some use of them.
How about providing a method on HTMLElement
which finds children which have ids and event handling Function attributes and registers events on the elements with the appropriate ids?
Users could call this method after they've toString()
ed and innerHTML
ed to set up all the event listeners - switching from DOM to HTML mode without changing any element creation code would then be a viable option for people looking for a speedup.
We could generate dummy ids for HTMLElements which have event listening function attributes but no id attribute to make this totally automatic as far as the user is concerned.
Providing a function which takes the element to be innerHTML
ed and does both steps would make it even nicer.
jQuery is a bit heavy to be lugging about solely for the limited subset of its capabilities DOMBuilder needs.
Look at how it's being used and see if we could make those needs pluggable, with a basic default implementation which doesn't depend on a library, but will come with a caveat as to how comprehensively it attempts to deal with cross-browser issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.