I would advise you not to use the word "this" for several reasons: 1) your command will only make sense to english speaking people, as you hardcode "this" into it. 2) it breaks compatibility, as people are used to having this refer to whatever they have selected 3) does it even work if you have something selected? - otherwise it would be inconsistent. 4) why not just use the current page if no input is given? - and if input is given, use that instead?
Best regards, -- cers / Christian Sonne On Tue, May 19, 2009 at 1:56 AM, Browler <[email protected]> wrote: > > nvm i found it works great :) > > On May 18, 7:35 pm, Browler <[email protected]> wrote: > > I'm making my first project with ubiquity, I have no javascript > > experience, but I do have c++ and actionscript experience so I'm > > finding it pretty easy. This may seem as a newb question to most > > everyone here, but im trying to add a "this" command to my script > > (like in the email this command). inputing the string "this" should > > cause the program to use your current url in the code and the preview. > > > > so heres the basic idea (i wont give the full code as i don't want to > > give away my project lol) > > > > preview: function(pblock, input){ > > if(input.text=="this"){ > > pblock.innerHTML = "this is the url you selected: <b>" + > > location.href + "</b>"; > > } else { > > pblock.innerHTML = "this is the url you selected: <b>" + > > input.text + "</b>"; > > } > > > > } > > > > location.href is where the problem is, it cant find the url the active > > tab is currently on and/or it cant display it in the string. Please > > help :( > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ubiquity-firefox" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ubiquity-firefox?hl=en -~----------~----~----~----~------~----~------~--~---
