Friday 29 December 2006 3:22:51 am
What if I want to add several bookmarklets to an article?
a) I need to add different custom tags for each bookmarklet.
b) I add a switch in the custom tag view template. Depending on a custom tag attribute it inserts the right bookmarklet.
In response to item, a - Question: What exactly will differentiate one final rendered bookmarklet code snippet from another from within the same content attribute / document.
In response to item, b - Question: Why must custom tag attributes be used to insert the right bookmarklet? (Dependant on answer to above) - Comment: This would go against processing or using user input in the creation of the custom tag / bookmarklet (to prevent security vulnerabilities related to code injection) unless you have a set standard switch cases say of 1,2,3,4 which insert the correct bookmarklet. It just seems to snow ball quickly downhill once you start accepting user input (let alone informing users of accepted input). - Comment: Because it sounds like a bookmarklet needs a title and a url. the client knows the url and the url's document name. I don't see why your bookmarklet could not be entirely client side js code and avoid this problem entirely. If you have to say pass it a url via js that's simple enough to grab from within the custom tag via the wrap_operator or other method. If you have to say pass it a url document name, say you grab the current document's name + site title from within the custom tag. - Comment: I still don't see why user input is needed to include a snippet of code which passes your bookmarklet code snippet the needed argument per instance; a name and url detected via php, tpl or js. A good bookmarklet will pop open a browser based dialog with the ability to alter the default name on the client side. //kracker It's what I was thinking, I still should not have posted it ..
Member since: 2001.07.13 || http://ezpedia.se7enx.com/
|