I think that the original Link object is not nice.
For example, you want to add id attribute to Link.
Maybe you write a code such as above.
<pre>
function addIdToLink (link, id) {
return link.toString().replace(/<a /i, '<a id="' + id + '"');
}
</pre>
After few minutes, you want to add class attribute to Link.
Then, do you write a code too?
I don't want to write the code.
So, I implemented Link.setAttribute method.
You can add attributes to Link using method chains.
Sample code:
<pre>
new Link().toSymbol('foo.bar').setAttribute('id', 'foobar');
// also
new Link().toSymbol('foo.bar').setAttributes({'id', 'foobar', 'class':
'foo-bar'});
</pre>
What do you have in mind?
Original issue reported on code.google.com by yaman...@gmail.com on 20 May 2012 at 7:00
Original issue reported on code.google.com by
yaman...@gmail.com
on 20 May 2012 at 7:00Attachments: