I got dumped on a site to "spice up" the interface but I can't touch
the html output--and I've got 20 hours allotted for the project.
There are a number of TABLE elements that I want to pull out and
switch to DIV elements. The method starting to formalize in my mind
is basically what Fabio has done, yank out the data according to a
pattern and store it in an object, then I'm free to do whatever.
If I had control of the whole site I'm not sure how relevant the
script would be. And, as usual, there's often a better way of doing
things, but when time is not on my side I go with the first obvious
solution :).
How do you plan to use it, Fabio?
Ryan Florence
On Aug 6, 2009, at 9:00 PM, Aaron Newton wrote:
Interesting. I've been doing a ton of work with templating lately
(using Thomas's SubtleTemplates) but I haven't really found a need
for this kind of thing. Curious what your use case is...
On Thu, Aug 6, 2009 at 7:02 PM, Ryan Florence <[email protected]>
wrote:
Clever, I could actually use this right away on a project.
Ryan Florence
On Aug 6, 2009, at 8:02 PM, Fábio M. Costa wrote:
Hi cool ppl from the users group,
i've made a reverse templating engine and i would like to share it
with you.
i havent seen it other at other places so the name reverse
templating is kind of created from scratch.
Well as you dont get it by the name ill give an example of what it
does (for the ones that are still reading):
var template = '<span>{data}</span><div>{another_data}</div>';
var html = '<span>data-value</span><div>anothervalue</div>';
template.matchWith(html); // returns {'data': 'data-value',
'another_data': 'anothervalue'}
for the source-code:
http://github.com/fabiomcosta/mootools-meio-template/tree/master
You could contribute with a better name for it too :D
Feel free to contribute or talk shit about it.
--
Fábio Miranda Costa
Solucione Sistemas
Front-End Engineer
http://meiocodigo.com