I created it because of a simple thing that i made, and i didn't like the
first solution i came with.I had a div with some inputs inside of it and i
had to extract the information of the inputs and generate a string, like
'valueiput1 -- valueinput2 --valueinput3' to insert it as the label of an
option, the value of the options was inside the div too.
So i had to go selecting what i wanted get the values and generate the
string.
With the plugin, as i know the structure of the div, i can create if on a
hidden div using the {key} value where i wantto capture the values and
compare this template with the div i have the values to generate an object
with all the values i need to create my string and my option value.
Did you guys understand?
Thanks for the interest.
--
Fábio Miranda Costa
Solucione Sistemas
Front-End Engineer
http://meiocodigo.com
On Fri, Aug 7, 2009 at 12:09 AM, Ryan Florence <[email protected]> wrote:
> 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
>>
>>
>>
>
>