Hey all, I just wanted to let you guys know that I updated my notify script. I still need to package it for easy download (next on my task list) but it does what I need it to do. Any thoughts, comments? http://thinkof.net/notify/index.html Also thanks to those of you who helped previously. -Greg
Hey!!! Much better! Good job. So what was making it so slow before? The evals? -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Greg Militello Sent: Monday, February 06, 2006 9:14 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Notify JS updates, oh my Hey all, I just wanted to let you guys know that I updated my notify script. I still need to package it for easy download (next on my task list) but it does what I need it to do. Any thoughts, comments? http://thinkof.net/notify/index.html Also thanks to those of you who helped previously. -Greg _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Ryan, I think it was a combination of the evals, and the way I was using Effects. I took the effects out by default, and I just turn the layer on and off. I think it adds to the usability as the popup come immediately, instead of waiting for a while to become visible. I never did like the eval () statement in my code. But quite frankly I had never heard of binding a variable to a function the way Greg showed me either (thanks BTW). Next steps on the list: Making the confirm play nice with form submits and anchor href tags so that the code degrades nicely. Making IE work the same way as Firefox/Safari/Camino Are there any other things you guys would want in this? I am just trying to plan out my roadmap. Thanks again all, -Greg On Feb 7, 2006, at 9:22 AM, Ryan Gahl wrote:> Hey!!! Much better! Good job. So what was making it so slow before? > The > evals? > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Greg > Militello > Sent: Monday, February 06, 2006 9:14 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails-spinoffs] Notify JS updates, oh my > > Hey all, > I just wanted to let you guys know that I updated my notify > script. > I still need to package it for easy download (next on my task list) > but it does what I need it to do. Any thoughts, comments? > > http://thinkof.net/notify/index.html > > > Also thanks to those of you who helped previously. > > > -Greg > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > The information transmitted in this electronic mail is intended > only for the > person or entity to which it is addressed and may contain > confidential, > proprietary, and/or privileged material. Any review, retransmission, > dissemination or other use of, or taking of any action in reliance > upon, > this information by persons or entities other than the intended > recipient > is prohibited. If you received this in error, please contact the > sender and > delete the material from all computers. > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> I never did like the eval () statement in my code. But quite > frankly I had never heard of binding a variable to a function the way > Greg showed me either (thanks BTW).Just a quick note on that; the bind() function is part of prototype.js. It isn''t a native javascript function. Just wanted to make sure that was understood in case you tried to use it in another project that didn''t have prototype and then cursed my name :) Greg
using Ajax.Updater to update a section of a page with a <ul> also want to write some javascript into it (because im trying to make each of the <li> draggable. but the <script..... > are not being written. is this not possible?
Pass evalScripts: true in the options hash passed to Ajax.Updater. tom ------------------------- http://www.smallroomsoftware.com On 7 Feb 2006, at 15:28, Louis Walch wrote:> using Ajax.Updater to update a section of a page with a <ul> also > want to > write some javascript into it (because im trying to make each of > the <li> > draggable. but the <script..... > are not being written. is this not > possible? > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
HA! At this point I don''t see myself not using prototype... It''s just so nice. So no worries. -Greg On Feb 7, 2006, at 10:26 AM, Gregory Hill wrote:>> I never did like the eval () statement in my code. But quite >> frankly I had never heard of binding a variable to a function the way >> Greg showed me either (thanks BTW). > > Just a quick note on that; the bind() function is part of > prototype.js. > It isn''t a native javascript function. Just wanted to make sure that > was understood in case you tried to use it in another project that > didn''t have prototype and then cursed my name :) > > Greg > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Also, be careful about the problem described here: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005-December/ 001615.html (which crashes all but the latest firefox, I think). Also, if you surround your script elements with <!--//<![CDATA[ ... //]]>--> you might have to remove them or you''ll get javascript syntax errors on IE. I''m not sure if this is a well known limitation with prototype or not - I only ran into it yesterday. Prototype should probably strip these kind of comment lines before calling eval(). tom ------------------------- http://www.smallroomsoftware.com On 7 Feb 2006, at 15:35, Tom Riley wrote:> Pass evalScripts: true in the options hash passed to Ajax.Updater. > > tom > > ------------------------- > http://www.smallroomsoftware.com > > On 7 Feb 2006, at 15:28, Louis Walch wrote: > >> using Ajax.Updater to update a section of a page with a <ul> also >> want to >> write some javascript into it (because im trying to make each of >> the <li> >> draggable. but the <script..... > are not being written. is this not >> possible? >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
thanks that worked... another related question.... im also writing Droppables.add with the Ajax.Updater. and the drop area was written when the page was originally loaded (not the ajax.updater area of the page). will it still be droppable? when i run updater, it writes the dragable items, and they are draggable but they do not do anything when dropped on the areas. also, the drop areas are TD''s maybe that is it.> Also, be careful about the problem described here: > > http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005-December/ > 001615.html > > (which crashes all but the latest firefox, I think). Also, if you > surround your script elements with <!--//<![CDATA[ ... //]]>--> you > might have to remove them or you''ll get javascript syntax errors on > IE. I''m not sure if this is a well known limitation with prototype or > not - I only ran into it yesterday. Prototype should probably strip > these kind of comment lines before calling eval(). > > tom > > ------------------------- > http://www.smallroomsoftware.com > > > On 7 Feb 2006, at 15:35, Tom Riley wrote: > >> Pass evalScripts: true in the options hash passed to Ajax.Updater. >> >> tom >> >> ------------------------- >> http://www.smallroomsoftware.com >> >> On 7 Feb 2006, at 15:28, Louis Walch wrote: >> >>> using Ajax.Updater to update a section of a page with a <ul> also >>> want to >>> write some javascript into it (because im trying to make each of >>> the <li> >>> draggable. but the <script..... > are not being written. is this not >>> possible? >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 7 Feb 2006, at 16:38, Louis Walch wrote:> thanks that worked... > > another related question.... > im also writing Droppables.add with the Ajax.Updater. and the drop > area > was written when the page was originally loaded (not the > ajax.updater area > of the page). will it still be droppable? >Sounds like it should work - javascript functions defined in the containing page should certainly be accessible from script elements in the updated fragment.> when i run updater, it writes the dragable items, and they are > draggable > but they do not do anything when dropped on the areas. > > also, the drop areas are TD''s maybe that is it. >Hmm, does your drop area work for draggables delared in the surrounding page (not in the fragment)? Any javascript errors/warnings?> > > >> Also, be careful about the problem described here: >> >> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005-December/ >> 001615.html >> >> (which crashes all but the latest firefox, I think). Also, if you >> surround your script elements with <!--//<![CDATA[ ... //]]>--> you >> might have to remove them or you''ll get javascript syntax errors on >> IE. I''m not sure if this is a well known limitation with prototype or >> not - I only ran into it yesterday. Prototype should probably strip >> these kind of comment lines before calling eval(). >> >> tom >> >> ------------------------- >> http://www.smallroomsoftware.com >> >> >> On 7 Feb 2006, at 15:35, Tom Riley wrote: >> >>> Pass evalScripts: true in the options hash passed to Ajax.Updater. >>> >>> tom >>> >>> ------------------------- >>> http://www.smallroomsoftware.com >>> >>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>> >>>> using Ajax.Updater to update a section of a page with a <ul> also >>>> want to >>>> write some javascript into it (because im trying to make each of >>>> the <li> >>>> draggable. but the <script..... > are not being written. is this >>>> not >>>> possible? >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Okay, I just hit version 0.8.3 and added a bunch, included a BSD based license (finally). http://thinkof.net/notify/index.html I have a question though, and this relates to the API of the library. In order for the script to degrade nicely (and play well with <a/> and <form/> tags) I needed a way to pass the target into the script. For example I use this on links: <a href="http://google.com" onclick="new Notify.Confirm (''Go to <em>google</em>?<br/>Please stay!'', this); return false;">Go to google.com</a> If you click the confirmation button, your browser will be redirected to the anchor''s href attribute. That behavior is only possible because Notify.Confirm()''s second parameter is this, passing the anchor tag into my object. This seems a little messy to me, but I do not know of a way to clean up this function call (eg: not passing in this, and still being able to direct browsers to the href value). Is there a way to access the tag of the element that the script is executed from? (I know I may not always have a parent element, in a <script/> tag for instance. Thanks again, -Greg On Feb 7, 2006, at 10:43 AM, Greg Militello wrote:> HA! > > At this point I don''t see myself not using prototype... It''s just > so nice. So no worries. > > -Greg > > > On Feb 7, 2006, at 10:26 AM, Gregory Hill wrote: > >>> I never did like the eval () statement in my code. But quite >>> frankly I had never heard of binding a variable to a function the >>> way >>> Greg showed me either (thanks BTW). >> >> Just a quick note on that; the bind() function is part of >> prototype.js. >> It isn''t a native javascript function. Just wanted to make sure that >> was understood in case you tried to use it in another project that >> didn''t have prototype and then cursed my name :) >> >> Greg >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
thanks for the help but you were right it should work - i just had a typo :) next issue............ tying to get it to hit a function onDrop, but its not working correctly. i was given this way of doing it last week on this board. when i load the page w/ FF i get "dropAction is not defined" dropAction: function(draggable, droppable) { alert("DROPED:" + draggable.id +" ON " + droppable.id); } . . . Droppables.add("drop_List''",{hoverclass:"highlightField",accept:["draggable"],onDrop:dropAction});> > On 7 Feb 2006, at 16:38, Louis Walch wrote: > >> thanks that worked... >> >> another related question.... >> im also writing Droppables.add with the Ajax.Updater. and the drop >> area >> was written when the page was originally loaded (not the >> ajax.updater area >> of the page). will it still be droppable? >> > > Sounds like it should work - javascript functions defined in the > containing page should certainly be accessible from script elements > in the updated fragment. > > >> when i run updater, it writes the dragable items, and they are >> draggable >> but they do not do anything when dropped on the areas. >> >> also, the drop areas are TD''s maybe that is it. >> > > Hmm, does your drop area work for draggables delared in the > surrounding page (not in the fragment)? Any javascript errors/warnings? > >> >> >> >>> Also, be careful about the problem described here: >>> >>> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005-December/ >>> 001615.html >>> >>> (which crashes all but the latest firefox, I think). Also, if you >>> surround your script elements with <!--//<![CDATA[ ... //]]>--> you >>> might have to remove them or you''ll get javascript syntax errors on >>> IE. I''m not sure if this is a well known limitation with prototype or >>> not - I only ran into it yesterday. Prototype should probably strip >>> these kind of comment lines before calling eval(). >>> >>> tom >>> >>> ------------------------- >>> http://www.smallroomsoftware.com >>> >>> >>> On 7 Feb 2006, at 15:35, Tom Riley wrote: >>> >>>> Pass evalScripts: true in the options hash passed to Ajax.Updater. >>>> >>>> tom >>>> >>>> ------------------------- >>>> http://www.smallroomsoftware.com >>>> >>>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>>> >>>>> using Ajax.Updater to update a section of a page with a <ul> also >>>>> want to >>>>> write some javascript into it (because im trying to make each of >>>>> the <li> >>>>> draggable. but the <script..... > are not being written. is this >>>>> not >>>>> possible? >>>>> _______________________________________________ >>>>> Rails-spinoffs mailing list >>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 7 Feb 2006, at 17:35, Louis Walch wrote:> thanks for the help but you were right it should work - i just had > a typo :) > > next issue............ > tying to get it to hit a function onDrop, but its not working > correctly. i > was given this way of doing it last week on this board. when i load > the > page w/ FF i get "dropAction is not defined" > > dropAction: function(draggable, droppable) { > alert("DROPED:" + draggable.id +" ON " + droppable.id); > }Try removing "dropAction:" from that first line. ------------------------- http://www.smallroomsoftware.com> > . . . > > Droppables.add("drop_List''",{hoverclass:"highlightField",accept: > ["draggable"],onDrop:dropAction}); > > > > > > > >> >> On 7 Feb 2006, at 16:38, Louis Walch wrote: >> >>> thanks that worked... >>> >>> another related question.... >>> im also writing Droppables.add with the Ajax.Updater. and the drop >>> area >>> was written when the page was originally loaded (not the >>> ajax.updater area >>> of the page). will it still be droppable? >>> >> >> Sounds like it should work - javascript functions defined in the >> containing page should certainly be accessible from script elements >> in the updated fragment. >> >> >>> when i run updater, it writes the dragable items, and they are >>> draggable >>> but they do not do anything when dropped on the areas. >>> >>> also, the drop areas are TD''s maybe that is it. >>> >> >> Hmm, does your drop area work for draggables delared in the >> surrounding page (not in the fragment)? Any javascript errors/ >> warnings? >> >>> >>> >>> >>>> Also, be careful about the problem described here: >>>> >>>> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005- >>>> December/ >>>> 001615.html >>>> >>>> (which crashes all but the latest firefox, I think). Also, if you >>>> surround your script elements with <!--//<![CDATA[ ... //]]>--> >>>> you >>>> might have to remove them or you''ll get javascript syntax errors on >>>> IE. I''m not sure if this is a well known limitation with >>>> prototype or >>>> not - I only ran into it yesterday. Prototype should probably strip >>>> these kind of comment lines before calling eval(). >>>> >>>> tom >>>> >>>> ------------------------- >>>> http://www.smallroomsoftware.com >>>> >>>> >>>> On 7 Feb 2006, at 15:35, Tom Riley wrote: >>>> >>>>> Pass evalScripts: true in the options hash passed to Ajax.Updater. >>>>> >>>>> tom >>>>> >>>>> ------------------------- >>>>> http://www.smallroomsoftware.com >>>>> >>>>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>>>> >>>>>> using Ajax.Updater to update a section of a page with a <ul> also >>>>>> want to >>>>>> write some javascript into it (because im trying to make each of >>>>>> the <li> >>>>>> draggable. but the <script..... > are not being written. is this >>>>>> not >>>>>> possible? >>>>>> _______________________________________________ >>>>>> Rails-spinoffs mailing list >>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>> >>>>> _______________________________________________ >>>>> Rails-spinoffs mailing list >>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
umm... if i remove the function name how does it know which function to use?> > On 7 Feb 2006, at 17:35, Louis Walch wrote: > >> thanks for the help but you were right it should work - i just had >> a typo :) >> >> next issue............ >> tying to get it to hit a function onDrop, but its not working >> correctly. i >> was given this way of doing it last week on this board. when i load >> the >> page w/ FF i get "dropAction is not defined" >> >> dropAction: function(draggable, droppable) { >> alert("DROPED:" + draggable.id +" ON " + droppable.id); >> } > > Try removing "dropAction:" from that first line. > > > ------------------------- > http://www.smallroomsoftware.com > > >> >> . . . >> >> Droppables.add("drop_List''",{hoverclass:"highlightField",accept: >> ["draggable"],onDrop:dropAction}); >> >> >> >> >> >> >> >>> >>> On 7 Feb 2006, at 16:38, Louis Walch wrote: >>> >>>> thanks that worked... >>>> >>>> another related question.... >>>> im also writing Droppables.add with the Ajax.Updater. and the drop >>>> area >>>> was written when the page was originally loaded (not the >>>> ajax.updater area >>>> of the page). will it still be droppable? >>>> >>> >>> Sounds like it should work - javascript functions defined in the >>> containing page should certainly be accessible from script elements >>> in the updated fragment. >>> >>> >>>> when i run updater, it writes the dragable items, and they are >>>> draggable >>>> but they do not do anything when dropped on the areas. >>>> >>>> also, the drop areas are TD''s maybe that is it. >>>> >>> >>> Hmm, does your drop area work for draggables delared in the >>> surrounding page (not in the fragment)? Any javascript errors/ >>> warnings? >>> >>>> >>>> >>>> >>>>> Also, be careful about the problem described here: >>>>> >>>>> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005- >>>>> December/ >>>>> 001615.html >>>>> >>>>> (which crashes all but the latest firefox, I think). Also, if you >>>>> surround your script elements with <!--//<![CDATA[ ... //]]>--> >>>>> you >>>>> might have to remove them or you''ll get javascript syntax errors on >>>>> IE. I''m not sure if this is a well known limitation with >>>>> prototype or >>>>> not - I only ran into it yesterday. Prototype should probably strip >>>>> these kind of comment lines before calling eval(). >>>>> >>>>> tom >>>>> >>>>> ------------------------- >>>>> http://www.smallroomsoftware.com >>>>> >>>>> >>>>> On 7 Feb 2006, at 15:35, Tom Riley wrote: >>>>> >>>>>> Pass evalScripts: true in the options hash passed to Ajax.Updater. >>>>>> >>>>>> tom >>>>>> >>>>>> ------------------------- >>>>>> http://www.smallroomsoftware.com >>>>>> >>>>>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>>>>> >>>>>>> using Ajax.Updater to update a section of a page with a <ul> also >>>>>>> want to >>>>>>> write some javascript into it (because im trying to make each of >>>>>>> the <li> >>>>>>> draggable. but the <script..... > are not being written. is this >>>>>>> not >>>>>>> possible? >>>>>>> _______________________________________________ >>>>>>> Rails-spinoffs mailing list >>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>> >>>>>> _______________________________________________ >>>>>> Rails-spinoffs mailing list >>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>> >>>>> _______________________________________________ >>>>> Rails-spinoffs mailing list >>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>> >>>> >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 7 Feb 2006, at 17:47, Louis Walch wrote:> umm... if i remove the function name how does it know which > function to use? > >sorry, i meant remove ": function", or rather change it to: function dropAction(... Where are you defining the function? From what you''ve typed, it looks like you''re defining an anonymous function in a hash - if you just want a global function definition for ''dropAction'', use the syntax above. tom ------------------------- http://www.smallroomsoftware.com>> >> On 7 Feb 2006, at 17:35, Louis Walch wrote: >> >>> thanks for the help but you were right it should work - i just had >>> a typo :) >>> >>> next issue............ >>> tying to get it to hit a function onDrop, but its not working >>> correctly. i >>> was given this way of doing it last week on this board. when i load >>> the >>> page w/ FF i get "dropAction is not defined" >>> >>> dropAction: function(draggable, droppable) { >>> alert("DROPED:" + draggable.id +" ON " + droppable.id); >>> } >> >> Try removing "dropAction:" from that first line. >> >> >> ------------------------- >> http://www.smallroomsoftware.com >> >> >>> >>> . . . >>> >>> Droppables.add("drop_List''",{hoverclass:"highlightField",accept: >>> ["draggable"],onDrop:dropAction}); >>> >>> >>> >>> >>> >>> >>> >>>> >>>> On 7 Feb 2006, at 16:38, Louis Walch wrote: >>>> >>>>> thanks that worked... >>>>> >>>>> another related question.... >>>>> im also writing Droppables.add with the Ajax.Updater. and the drop >>>>> area >>>>> was written when the page was originally loaded (not the >>>>> ajax.updater area >>>>> of the page). will it still be droppable? >>>>> >>>> >>>> Sounds like it should work - javascript functions defined in the >>>> containing page should certainly be accessible from script elements >>>> in the updated fragment. >>>> >>>> >>>>> when i run updater, it writes the dragable items, and they are >>>>> draggable >>>>> but they do not do anything when dropped on the areas. >>>>> >>>>> also, the drop areas are TD''s maybe that is it. >>>>> >>>> >>>> Hmm, does your drop area work for draggables delared in the >>>> surrounding page (not in the fragment)? Any javascript errors/ >>>> warnings? >>>> >>>>> >>>>> >>>>> >>>>>> Also, be careful about the problem described here: >>>>>> >>>>>> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005- >>>>>> December/ >>>>>> 001615.html >>>>>> >>>>>> (which crashes all but the latest firefox, I think). Also, if you >>>>>> surround your script elements with <!--//<![CDATA[ ... //]]>--> >>>>>> you >>>>>> might have to remove them or you''ll get javascript syntax >>>>>> errors on >>>>>> IE. I''m not sure if this is a well known limitation with >>>>>> prototype or >>>>>> not - I only ran into it yesterday. Prototype should probably >>>>>> strip >>>>>> these kind of comment lines before calling eval(). >>>>>> >>>>>> tom >>>>>> >>>>>> ------------------------- >>>>>> http://www.smallroomsoftware.com >>>>>> >>>>>> >>>>>> On 7 Feb 2006, at 15:35, Tom Riley wrote: >>>>>> >>>>>>> Pass evalScripts: true in the options hash passed to >>>>>>> Ajax.Updater. >>>>>>> >>>>>>> tom >>>>>>> >>>>>>> ------------------------- >>>>>>> http://www.smallroomsoftware.com >>>>>>> >>>>>>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>>>>>> >>>>>>>> using Ajax.Updater to update a section of a page with a <ul> >>>>>>>> also >>>>>>>> want to >>>>>>>> write some javascript into it (because im trying to make >>>>>>>> each of >>>>>>>> the <li> >>>>>>>> draggable. but the <script..... > are not being written. is >>>>>>>> this >>>>>>>> not >>>>>>>> possible? >>>>>>>> _______________________________________________ >>>>>>>> Rails-spinoffs mailing list >>>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rails-spinoffs mailing list >>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>> >>>>>> _______________________________________________ >>>>>> Rails-spinoffs mailing list >>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rails-spinoffs mailing list >>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Louis Walch wrote:> umm... if i remove the function name how does it know which function to use?That''s not a function name, it''s an attribute name. Unless your putting this function definition in a classes prototype, then you''re not really defining it. it should be something like: function dropAction(...) { ... } and then Droppables.add("drop_List''",{hoverclass:"highlightField",accept: ["draggable"],onDrop: dropAction}); -- Michael Peters Developer Plus Three, LP
thanks, i misunderstood. droppable.id in the function is coming through as "undefined" it does have an id> > On 7 Feb 2006, at 17:47, Louis Walch wrote: > >> umm... if i remove the function name how does it know which >> function to use? >> >> > > sorry, i meant remove ": function", or rather change it to: > > function dropAction(... > > Where are you defining the function? From what you''ve typed, it looks > like you''re defining an anonymous function in a hash - if you just > want a global function definition for ''dropAction'', use the syntax > above. > > tom > > ------------------------- > http://www.smallroomsoftware.com > > > >>> >>> On 7 Feb 2006, at 17:35, Louis Walch wrote: >>> >>>> thanks for the help but you were right it should work - i just had >>>> a typo :) >>>> >>>> next issue............ >>>> tying to get it to hit a function onDrop, but its not working >>>> correctly. i >>>> was given this way of doing it last week on this board. when i load >>>> the >>>> page w/ FF i get "dropAction is not defined" >>>> >>>> dropAction: function(draggable, droppable) { >>>> alert("DROPED:" + draggable.id +" ON " + droppable.id); >>>> } >>> >>> Try removing "dropAction:" from that first line. >>> >>> >>> ------------------------- >>> http://www.smallroomsoftware.com >>> >>> >>>> >>>> . . . >>>> >>>> Droppables.add("drop_List''",{hoverclass:"highlightField",accept: >>>> ["draggable"],onDrop:dropAction}); >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> >>>>> On 7 Feb 2006, at 16:38, Louis Walch wrote: >>>>> >>>>>> thanks that worked... >>>>>> >>>>>> another related question.... >>>>>> im also writing Droppables.add with the Ajax.Updater. and the drop >>>>>> area >>>>>> was written when the page was originally loaded (not the >>>>>> ajax.updater area >>>>>> of the page). will it still be droppable? >>>>>> >>>>> >>>>> Sounds like it should work - javascript functions defined in the >>>>> containing page should certainly be accessible from script elements >>>>> in the updated fragment. >>>>> >>>>> >>>>>> when i run updater, it writes the dragable items, and they are >>>>>> draggable >>>>>> but they do not do anything when dropped on the areas. >>>>>> >>>>>> also, the drop areas are TD''s maybe that is it. >>>>>> >>>>> >>>>> Hmm, does your drop area work for draggables delared in the >>>>> surrounding page (not in the fragment)? Any javascript errors/ >>>>> warnings? >>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Also, be careful about the problem described here: >>>>>>> >>>>>>> http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2005- >>>>>>> December/ >>>>>>> 001615.html >>>>>>> >>>>>>> (which crashes all but the latest firefox, I think). Also, if you >>>>>>> surround your script elements with <!--//<![CDATA[ ... //]]>--> >>>>>>> you >>>>>>> might have to remove them or you''ll get javascript syntax >>>>>>> errors on >>>>>>> IE. I''m not sure if this is a well known limitation with >>>>>>> prototype or >>>>>>> not - I only ran into it yesterday. Prototype should probably >>>>>>> strip >>>>>>> these kind of comment lines before calling eval(). >>>>>>> >>>>>>> tom >>>>>>> >>>>>>> ------------------------- >>>>>>> http://www.smallroomsoftware.com >>>>>>> >>>>>>> >>>>>>> On 7 Feb 2006, at 15:35, Tom Riley wrote: >>>>>>> >>>>>>>> Pass evalScripts: true in the options hash passed to >>>>>>>> Ajax.Updater. >>>>>>>> >>>>>>>> tom >>>>>>>> >>>>>>>> ------------------------- >>>>>>>> http://www.smallroomsoftware.com >>>>>>>> >>>>>>>> On 7 Feb 2006, at 15:28, Louis Walch wrote: >>>>>>>> >>>>>>>>> using Ajax.Updater to update a section of a page with a <ul> >>>>>>>>> also >>>>>>>>> want to >>>>>>>>> write some javascript into it (because im trying to make >>>>>>>>> each of >>>>>>>>> the <li> >>>>>>>>> draggable. but the <script..... > are not being written. is >>>>>>>>> this >>>>>>>>> not >>>>>>>>> possible? >>>>>>>>> _______________________________________________ >>>>>>>>> Rails-spinoffs mailing list >>>>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rails-spinoffs mailing list >>>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rails-spinoffs mailing list >>>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rails-spinoffs mailing list >>>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>> >>>>> _______________________________________________ >>>>> Rails-spinoffs mailing list >>>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>>> >>>> >>>> _______________________________________________ >>>> Rails-spinoffs mailing list >>>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >