Hi guys, I''m trying to make a drag''n''drop portal using sortable element. I would like to apply the "hoverclass" option only on the droppable zone instead of the column border. Any idea a about the solution? Thanks for any help, Sabri --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
do you mean like iGoogle? I was looking at how to implement that myself on a web project less than 2 days ago... Gareth On 6/9/07, sabinfos <sabinfos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi guys, > I''m trying to make a drag''n''drop portal using sortable element. I > would like to apply the "hoverclass" option only on the droppable zone > instead of the column border. > Any idea a about the solution? > Thanks for any help, > Sabri > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yes concerning the look and feed. Did you found something interresting ? On 9 juin, 11:29, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> do you mean like iGoogle? > I was looking at how to implement that myself on a web project less than 2 > days ago... > > Gareth > > On 6/9/07, sabinfos <sabin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi guys, > > I''m trying to make a drag''n''drop portal using sortable element. I > > would like to apply the "hoverclass" option only on the droppable zone > > instead of the column border. > > Any idea a about the solution? > > Thanks for any help, > > Sabri--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Just about got something going, you can almost reorder vertically but I can''t get it to drag between columns... another half hour and it should be going... I need it for my project so seems like a good feature to sink a bit of time into... I''ve created 3 divs, and these are sortable containers, the items within them are the items that can be sorted... I''m missing something here about how to be able to move the items to other containers though.. I wish scripty had better docs Gareth On 6/9/07, sabinfos <sabinfos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Yes concerning the look and feed. > Did you found something interresting ? > > On 9 juin, 11:29, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > do you mean like iGoogle? > > I was looking at how to implement that myself on a web project less than > 2 > > days ago... > > > > Gareth > > > > On 6/9/07, sabinfos <sabin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi guys, > > > I''m trying to make a drag''n''drop portal using sortable element. I > > > would like to apply the "hoverclass" option only on the droppable zone > > > instead of the column border. > > > Any idea a about the solution? > > > Thanks for any help, > > > Sabri > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, Gareth Evans a écrit :> I wish scripty had better docsJust wait for the second Beta (B1) of my book :-) It''ll feature the whole Scripty part! -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Is your book available in NZ, or internet purchase only? i''ve been meaning to get a copy as soon as my credit card gets paid off a bit! Gareth On 6/9/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > > Hey, > > Gareth Evans a écrit : > > I wish scripty had better docs > > Just wait for the second Beta (B1) of my book :-) It''ll feature the > whole Scripty part! > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey! Gareth Evans a écrit :> Is your book available in NZ, or internet purchase only? i''ve been > meaning to get a copy as soon as my credit card gets paid off a bit!It''s currently in the Beta phase at Pragmatic Programmers [1], so it''s electronic only so far. When it does release in final form (sometime between July and October, depending on when we at Prototype Core feature- and API-freeze 1.6), it''ll of course also be available in paper form, shipped anywhere in the world. You can buy the Combo pack if shipment doesn''t kill the usefulness of it, or just buy the PDF for now (updated everytime I release a new Beta, then final, then perhaps errata), and grab a paper copy in the bookstores later in the year. My editor is currently going through a lot of catch-up work, but as soon as he gets a chance of editing the Scripty part, we''ll release B1. In the meantime, I keep the book up-to-date on the latest trunk additions, and keep contributing to both Proto and Scripty ;-) [1] http://books.pragprog.com/titles/cppsu/ -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Wicked, i''ll go steal the business credit card from my business partner :) Since you''re here and all... trying to get this sortable thing working (discussed in this thread) I''ve currently got 3 floating divs with widths set. All 3 divs have been initialized as sortables, dropOnEmpty:true. Only the first div contains items. There has been no constraint set. $(''Zones'').getElementsBySelector(''div.ZoneColumn'').each(function (column) { if ($F(''UserId'') != 0) Sortable.create(column,{tag:''div'',onChange:function(a,b,c) { },onUpdate: function(a,b,c) { },dropOnEmpty:''true''}); }); I can sort the items within the first ''div.ZoneColumn'' but am unable to drag the items into the next column over horizontally... I''m guessing this is a limitation of sorts, should I go for a new Draggable and Droppables.add solution? How do I get a draggable/droppable solution to only allow items to be dropped in the container droppables? Gareth On 6/9/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > > Hey! > > Gareth Evans a écrit : > > Is your book available in NZ, or internet purchase only? i''ve been > > meaning to get a copy as soon as my credit card gets paid off a bit! > > It''s currently in the Beta phase at Pragmatic Programmers [1], so it''s > electronic only so far. > > When it does release in final form (sometime between July and October, > depending on when we at Prototype Core feature- and API-freeze 1.6), > it''ll of course also be available in paper form, shipped anywhere in the > world. > > You can buy the Combo pack if shipment doesn''t kill the usefulness of > it, or just buy the PDF for now (updated everytime I release a new Beta, > then final, then perhaps errata), and grab a paper copy in the > bookstores later in the year. > > My editor is currently going through a lot of catch-up work, but as soon > as he gets a chance of editing the Scripty part, we''ll release B1. In > the meantime, I keep the book up-to-date on the latest trunk additions, > and keep contributing to both Proto and Scripty ;-) > > [1] http://books.pragprog.com/titles/cppsu/ > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
About to lunch, replying in a moment ;-) Gareth Evans a écrit :> Wicked, i''ll go steal the business credit card from my business partner :) > > Since you''re here and all... trying to get this sortable thing working > (discussed in this thread) > I''ve currently got 3 floating divs with widths set. > > All 3 divs have been initialized as sortables, dropOnEmpty:true. > Only the first div contains items. > There has been no constraint set. > > $( > > ''Zones'').getElementsBySelector(''div.ZoneColumn'').each( function (column) { > if ($F(''UserId'') != 0) > Sortable.create(column,{tag: ''div'',onChange:function(a,b,c) { > },onUpdate:function (a,b,c) { },dropOnEmpty:''true''}); > }); > > I can sort the items within the first ''div.ZoneColumn'' but am unable to > drag the items into the next column over horizontally... > I''m guessing this is a limitation of sorts, should I go for a new > Draggable and Droppables.add solution? > > How do I get a draggable/droppable solution to only allow items to be > dropped in the container droppables? > > Gareth > > > > > > On 6/9/07, *Christophe Porteneuve* <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > <mailto:tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>> wrote: > > > Hey! > > Gareth Evans a écrit : > > Is your book available in NZ, or internet purchase only? i''ve been > > meaning to get a copy as soon as my credit card gets paid off a bit! > > It''s currently in the Beta phase at Pragmatic Programmers [1], so it''s > electronic only so far. > > When it does release in final form (sometime between July and October, > depending on when we at Prototype Core feature- and API-freeze 1.6), > it''ll of course also be available in paper form, shipped anywhere in the > world. > > You can buy the Combo pack if shipment doesn''t kill the usefulness of > it, or just buy the PDF for now (updated everytime I release a new Beta, > then final, then perhaps errata), and grab a paper copy in the > bookstores later in the year. > > My editor is currently going through a lot of catch-up work, but as > soon > as he gets a chance of editing the Scripty part, we''ll release B1. In > the meantime, I keep the book up-to-date on the latest trunk additions, > and keep contributing to both Proto and Scripty ;-) > > [1] http://books.pragprog.com/titles/cppsu/ > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org <mailto:tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> > > > >-- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Still playing with it while you''re lunching... Found this: http://tankut.googlepages.com/home http://tanrikut.blogspot.com/search/label/scriptaculous This code allows you to use .emptyPlaceMarker { border-right: red thin dashed; border-top: red thin dashed; border-left: red thin dashed; border-bottom: red thin dashed; background-color: Transparent; } To signify where an Item is going to be dropped. Combined with ghosting, and constraint, i''m almost there. The emptyPlaceMarker is appearing as the element it is going to replace (ie the element that will move down) rather than a placeholder element that is where the new element would be dropped though. The guy hasn''t put much detail on what he''s patched in scripty to make this happen either. I have this (stripped down, wont work just like this but thought I better give some context to my example) *CSS* .ZoneColumn { width:310px; padding-left:0px; padding-right:0px; height:100%; background-color:#efefef; margin-right:10px; float:left; position:relative; } #Zones { position:relative; clear:both; height:100%; } .zone { width:300px; margin:15px; display:block; } *HTML* <div id="Zones"> <div id="ZoneAddLink"><a href=''AddItemsToHome.aspx''>add new</a></div> <div class=''ZoneColumn'' id=''ZoneColumn_1''> <div class=''zone'' id=''Zone_c6cdfd9a-fab7-464d-ae93-bd8bfebcfeb9'' style=''position:relative;'' zonedataid=''4''>Loading Content....</div> <div class=''zone'' id=''Zone_cf1016a0-1a04-48f4-905f-e7dd23037b72'' style=''position:relative;'' zonedataid=''7''>Loading Content....</div> <div class=''zone'' id=''Zone_9c352d38-43e7-4ad2-ba00-3d0b03517587'' style=''position:relative;'' zonedataid=''10''>Loading Content....</div> <div class=''zone'' id=''Zone_086d7527-2846-4568-9217-c6f8a4657530'' style=''position:relative;'' zonedataid=''19''>Loading Content....</div> <div class=''zone'' id=''Zone_3552f386-52e3-4d9b-895a-72f89881e4d3'' style=''position:relative;'' zonedataid=''24''>Loading Content....</div> <div class=''zone'' id=''Zone_af032da3-cbd6-484d-890b-600f11a96eff'' style=''position:relative;'' zonedataid=''25''>Loading Content....</div> <div class=''zone'' id=''Zone_599dc938-b6db-4d3e-b1ac-1ce2dd35077e'' style=''position:relative;'' zonedataid=''26''>Loading Content....</div> </div> <div class=''ZoneColumn'' id=''ZoneColumn_2''></div> <div class=''ZoneColumn'' id=''ZoneColumn_3''></div> </div> *Javascript* var ZoneColumns = $(''Zones'').getElementsBySelector(''div.ZoneColumn'').pluck( ''id''); $(''Zones'').getElementsBySelector(''div.ZoneColumn'').each(function (column) { if ($F(''UserId'') != 0) Sortable.create(column,{tag:''div'',onChange:function(a,b,c) { },onUpdate: function(a,b,c) { },dropOnEmpty:''true'', containment:ZoneColumns, constraint: false, ghosting: true}); column.getElementsBySelector(''div.zone'').each(function(node){ if (node.id != null){ if (node.getAttribute(''ZoneDataId'') != null) { var url = ''RenderZone.aspx''; var pars = ''ZoneDataId='' + node.getAttribute(''ZoneDataId''); var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: pars, onComplete:processCollapse }); } } }); }); This allows me to drop the items between the columns, and everything appears to be working. The ghosting option seems to not be what I want, but the containment:[...] and constraint:false fixed the dropping between columns. sabinfo- see, progress! PS, how the hell does google keep the syntax highlighting in the text area when I paste from my dev env? Gareth On 6/9/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > About to lunch, replying in a moment ;-) > > Gareth Evans a écrit : > > Wicked, i''ll go steal the business credit card from my business partner > :) > > > > Since you''re here and all... trying to get this sortable thing working > > (discussed in this thread) > > I''ve currently got 3 floating divs with widths set. > > > > All 3 divs have been initialized as sortables, dropOnEmpty:true. > > Only the first div contains items. > > There has been no constraint set. > > > > $( > > > > ''Zones'').getElementsBySelector(''div.ZoneColumn'').each( function (column) > { > > if ($F(''UserId'') != 0) > > Sortable.create(column,{tag: ''div'',onChange:function(a,b,c) { > > },onUpdate:function (a,b,c) { },dropOnEmpty:''true''}); > > }); > > > > I can sort the items within the first ''div.ZoneColumn'' but am unable to > > drag the items into the next column over horizontally... > > I''m guessing this is a limitation of sorts, should I go for a new > > Draggable and Droppables.add solution? > > > > How do I get a draggable/droppable solution to only allow items to be > > dropped in the container droppables? > > > > Gareth > > > > > > > > > > > > On 6/9/07, *Christophe Porteneuve* <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > <mailto:tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>> wrote: > > > > > > Hey! > > > > Gareth Evans a écrit : > > > Is your book available in NZ, or internet purchase only? i''ve > been > > > meaning to get a copy as soon as my credit card gets paid off a > bit! > > > > It''s currently in the Beta phase at Pragmatic Programmers [1], so > it''s > > electronic only so far. > > > > When it does release in final form (sometime between July and > October, > > depending on when we at Prototype Core feature- and API-freeze 1.6), > > it''ll of course also be available in paper form, shipped anywhere in > the > > world. > > > > You can buy the Combo pack if shipment doesn''t kill the usefulness > of > > it, or just buy the PDF for now (updated everytime I release a new > Beta, > > then final, then perhaps errata), and grab a paper copy in the > > bookstores later in the year. > > > > My editor is currently going through a lot of catch-up work, but as > > soon > > as he gets a chance of editing the Scripty part, we''ll release > B1. In > > the meantime, I keep the book up-to-date on the latest trunk > additions, > > and keep contributing to both Proto and Scripty ;-) > > > > [1] http://books.pragprog.com/titles/cppsu/ > > > > -- > > Christophe Porteneuve aka TDD > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org <mailto:tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> > > > > > > > > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
ghosting:false; and now it is working how I expected... Just an annoying container-height css issue now... and postback, which will be relatively simple to implement. I''d like a method that didn''t require modifications to scriptaculous for the drop indicator, it''s a pain when new versions come out. Gareth On 6/9/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Still playing with it while you''re lunching... > Found this: > http://tankut.googlepages.com/home > http://tanrikut.blogspot.com/search/label/scriptaculous > > This code allows you to use > > .emptyPlaceMarker { > border-right: red thin dashed; > border-top: red thin dashed; > border-left : red thin dashed; > border-bottom: red thin dashed ; > background-color: Transparent; > } > To signify where an Item is going to be dropped. Combined with ghosting, > and constraint, i''m almost there. > The emptyPlaceMarker is appearing as the element it is going to replace > (ie the element that will move down) rather than a placeholder element that > is where the new element would be dropped though. > The guy hasn''t put much detail on what he''s patched in scripty to make > this happen either. > > I have this (stripped down, wont work just like this but thought I better > give some context to my example) > > *CSS* > > .ZoneColumn > { width:310px; padding-left :0px; padding-right:0px ; height:100%; > background-color: #efefef; margin-right:10px; float :left; position: > relative; } > #Zones > { > position:relative; > clear :both; > height:100% ; > } > .zone { > width:300px; > margin:15px; > display:block ; > } > > *HTML* > > <div id="Zones"> > <div id="ZoneAddLink"><a href=''AddItemsToHome.aspx''>add new</a></div> > <div class=''ZoneColumn'' id=''ZoneColumn_1''> > <div class=''zone'' id=''Zone_c6cdfd9a-fab7-464d-ae93-bd8bfebcfeb9'' > style=''position:relative;'' zonedataid=''4''>Loading Content....</div> > <div class=''zone'' id=''Zone_cf1016a0-1a04-48f4-905f-e7dd23037b72'' > style=''position:relative;'' zonedataid=''7''>Loading Content....</div> > <div class=''zone'' id=''Zone_9c352d38-43e7-4ad2-ba00-3d0b03517587'' > style=''position:relative;'' zonedataid=''10''>Loading Content....</div> > <div class=''zone'' id=''Zone_086d7527-2846-4568-9217-c6f8a4657530'' > style=''position:relative;'' zonedataid=''19''>Loading Content....</div> > <div class=''zone'' id=''Zone_3552f386-52e3-4d9b-895a-72f89881e4d3'' > style=''position:relative;'' zonedataid=''24''>Loading Content....</div> > <div class=''zone'' id=''Zone_af032da3-cbd6-484d-890b-600f11a96eff'' > style=''position:relative;'' zonedataid=''25''>Loading Content....</div> > <div class=''zone'' id=''Zone_599dc938-b6db-4d3e-b1ac-1ce2dd35077e'' > style=''position:relative;'' zonedataid=''26''>Loading Content....</div> > </div> > <div class=''ZoneColumn'' id=''ZoneColumn_2''></div> > <div class=''ZoneColumn'' id=''ZoneColumn_3''></div> > </div> > > *Javascript* > > var ZoneColumns = $(''Zones'').getElementsBySelector( ''div.ZoneColumn'' > ).pluck(''id''); > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function (column) > { > if ($F(''UserId'') != 0) > Sortable.create(column,{tag:''div'',onChange: function(a,b,c) { },onUpdate: > function(a,b,c) { },dropOnEmpty:''true'' , containment:ZoneColumns, > constraint:false, ghosting: true}); > column.getElementsBySelector (''div.zone'').each(function(node){ > if (node.id != null){ > if (node.getAttribute( ''ZoneDataId'') != null) > { > var url = ''RenderZone.aspx''; > var pars = ''ZoneDataId='' + node.getAttribute (''ZoneDataId''); > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: > pars, onComplete:processCollapse }); > } > } > }); > }); > > > > This allows me to drop the items between the columns, and everything > appears to be working. > The ghosting option seems to not be what I want, but the containment:[...] > and constraint:false fixed the dropping between columns. > > sabinfo- see, progress! > > PS, how the hell does google keep the syntax highlighting in the text area > when I paste from my dev env? > > Gareth > > > On 6/9/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > > About to lunch, replying in a moment ;-) > > > > Gareth Evans a écrit : > > > Wicked, i''ll go steal the business credit card from my business > > partner :) > > > > > > Since you''re here and all... trying to get this sortable thing working > > > (discussed in this thread) > > > I''ve currently got 3 floating divs with widths set. > > > > > > All 3 divs have been initialized as sortables, dropOnEmpty:true. > > > Only the first div contains items. > > > There has been no constraint set. > > > > > > $( > > > > > > ''Zones'').getElementsBySelector(''div.ZoneColumn'').each( function > > (column) { > > > if ($F(''UserId'') != 0) > > > Sortable.create(column,{tag: ''div'',onChange:function(a,b,c) { > > > },onUpdate:function (a,b,c) { },dropOnEmpty:''true''}); > > > }); > > > > > > I can sort the items within the first ''div.ZoneColumn '' but am unable > > to > > > drag the items into the next column over horizontally... > > > I''m guessing this is a limitation of sorts, should I go for a new > > > Draggable and Droppables.add solution? > > > > > > How do I get a draggable/droppable solution to only allow items to be > > > dropped in the container droppables? > > > > > > Gareth > > > > > > > > > > > > > > > > > > On 6/9/07, *Christophe Porteneuve* < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > <mailto:tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>> wrote: > > > > > > > > > Hey! > > > > > > Gareth Evans a écrit : > > > > Is your book available in NZ, or internet purchase only? i''ve > > been > > > > meaning to get a copy as soon as my credit card gets paid off a > > bit! > > > > > > It''s currently in the Beta phase at Pragmatic Programmers [1], so > > it''s > > > electronic only so far. > > > > > > When it does release in final form (sometime between July and > > October, > > > depending on when we at Prototype Core feature- and API-freeze 1.6 > > ), > > > it''ll of course also be available in paper form, shipped anywhere > > in the > > > world. > > > > > > You can buy the Combo pack if shipment doesn''t kill the usefulness > > of > > > it, or just buy the PDF for now (updated everytime I release a new > > Beta, > > > then final, then perhaps errata), and grab a paper copy in the > > > bookstores later in the year. > > > > > > My editor is currently going through a lot of catch-up work, but > > as > > > soon > > > as he gets a chance of editing the Scripty part, we''ll release > > B1. In > > > the meantime, I keep the book up-to-date on the latest trunk > > additions, > > > and keep contributing to both Proto and Scripty ;-) > > > > > > [1] http://books.pragprog.com/titles/cppsu/ > > > > > > -- > > > Christophe Porteneuve aka TDD > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org <mailto: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> > > > > > > > > > > > > > > -- > > Christophe Porteneuve aka TDD > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey! Gareth Evans a écrit :> ghosting:false; and now it is working how I expected...Yeah, ghosting has issues currently on draggables, which may or may not relate to how it affects Droppable behavior (Sortable uses Droppable internally). I fixed a Draggable+ghosting issue recently, which also relied on improper absolute detection in absolutize, and it''s in the trunks now. I kinda remember having run into the same quandary when trying to implement the sort of stuff you''re dealing with here. Yet I can see a use for proper hoverclass positioning *and* ghosting, so we''ll have to dive into this at some point (we = Scripty author + contribs).> Just an annoying container-height css issue now... and postback, which > will be relatively simple to implement.Hell yeah, postback is just an Ajax.Request in onUpdate.> I''d like a method that didn''t require modifications to scriptaculous for > the drop indicator, it''s a pain when new versions come out.Totally. You''re trying to get the class applied on some stuff *between* the elements you''re dropping over, right? Just to provide a placeholder for the to-be-dropped element? I kinda remember having achieved that with <span> placeholders b/w elements that were actually sortable. I''ll have to dig further code out. At any rate, this kind of feature has been discussed countless times, in various forms and disguises, on this list. Maybe a smart sifting of the archives could yield useful clues. Still, w/o ghosting you''re in the clear just now, aren''t you? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah, I just have to figure out why my columns aren''t setting their height when I use percentages, they work fine when I use pixels.. this is definitely css related- i know that in order to use %, the parent container must have a fixed or percentage height, recursively back to body. Updating to the server is almost working, it''s a little more complex than just an Ajax.Request since you need to determine which was the destination div, and the onUpdate fires once for each container. I did this by caching the order in an attribute and comparing it to the new order. I''ll post this code up shortly. My biggest issue at present is that in order to get the placeholder to work, I had to use a modified version of scripty, and I can''t find any documentation on the guys page about what he actually changed to enable it to work. He seems to put up new versions in sync with scripty, but it''s a pain.>Totally. You''re trying to get the class applied on some stuff *between* >the elements you''re dropping over, right? Just to provide a placeholder >for the to-be-dropped element? I kinda remember having achieved that >with <span> placeholders b/w elements that were actually sortable. I''ll >have to dig further code out.That would be great, and yes that''s what i''m trying to do. Check out iGoogle personalised homepage to see what i''m basically replicating in my own project. It''s all basically working now, albiet with a modified scripty and a few small bugs.. Gareth --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Bip, Gareth Evans a écrit :> Yeah, I just have to figure out why my columns aren''t setting their > height when I use percentages, they work fine when I use pixels.. this > is definitely css related- i know that in order to use %, the parent > container must have a fixed or percentage height, recursively back to body.Tread carefully: most code in Scripty relies on DOM Level 2 CSS to access the style properties, and these are by definition /computed values/, i.e. in pixels on a screen rendering. You may be in trouble if you''re using non-pixel values, but that all depends on where you''re using them and what system interprets them. I haven''t resolved the details of this yet...> My biggest issue at present is that in order to get the placeholder to > work, I had to use a modified version of scripty, and I can''t find any > documentation on the guys page about what he actually changed to enable > it to work.Can''t you diff his files against the official ones? I won''t have time in the foreseeable future to dig up old code, I''m over my head with pressing duties for now. I''ll try to keep this in mind if you get stuck too long... -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I plan to diff them as soon as I get onto that issue... dealing with lack of documentation for onupdate- trying to find the element that is actually being inserted into the div... I think i''m going to have to get the old order and the new order and find the new value in the new order... I think the computed values remain as pixels if you use percentages in css? No problem about the time issue, I know what thats like Gareth On 6/10/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > > Bip, > > Gareth Evans a écrit : > > Yeah, I just have to figure out why my columns aren''t setting their > > height when I use percentages, they work fine when I use pixels.. this > > is definitely css related- i know that in order to use %, the parent > > container must have a fixed or percentage height, recursively back to > body. > > Tread carefully: most code in Scripty relies on DOM Level 2 CSS to > access the style properties, and these are by definition /computed > values/, i.e. in pixels on a screen rendering. You may be in trouble if > you''re using non-pixel values, but that all depends on where you''re > using them and what system interprets them. I haven''t resolved the > details of this yet... > > > My biggest issue at present is that in order to get the placeholder to > > work, I had to use a modified version of scripty, and I can''t find any > > documentation on the guys page about what he actually changed to enable > > it to work. > > Can''t you diff his files against the official ones? > > I won''t have time in the foreseeable future to dig up old code, I''m over > my head with pressing duties for now. I''ll try to keep this in mind if > you get stuck too long... > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, Gareth Evans a écrit :> I think the computed values remain as pixels if you use percentages in css?You can check that by using getStyle on the properties you specified as percents, and see what you get. I do believe all length-related props get computed to pixels, which seems to fit the CSS spec. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Okay, continuing on from my previous post which details my solution... here is the new onload var ZoneColumns = $(''Zones'').getElementsBySelector(''div.ZoneColumn'').pluck( ''id''); $(''Zones'').getElementsBySelector(''div.ZoneColumn'').each(function (column) { if ($F(''UserId'') != 0) { Sortable.create(column,{ tag:''div'', onChange:function(a,b,c) { }, onUpdate:function(a,b,c) { //new Insertion.Top(''debug'',''new childNodeLength: '' + String( a.childNodes.length) + ''<br/>''); //new Insertion.Top(''debug'',a.id + '' event<br/>''); //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( Sortable.sequence(a).length) + ''<br/>''); //new Insertion.Top(''debug'',''stored length of droppable: '' + String( a.readAttribute(''currentOrder'')).split('','').without('''').length + ''<br/>''); if (Sortable.sequence(a).length > String(a.readAttribute(''currentOrder'' )).split('','').without('''').length) { //new Insertion.Top(''debug'',String(a.id) + '' is the destination div<br/>''); //i think this is probably my most awesome line of prototype code ever... var element = $(''Zone_''+Sortable.sequence(a).without(String(a.readAttribute( ''currentOrder'')).split('','').without('''' )).flatten().toString()).readAttribute(''zonedataid''); //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); new Ajax.Request(''Ajax.aspx'', {method:''post'', parameters:''ZoneDataId='' +element+''&action=UpdateUserZoneItemColumn&Column=''+String(a.id).replace( ''ZoneColumn_'',''''), onFailure:errFunc }); a.setAttribute(''currentOrder'',Sortable.sequence(a)); } }, dropOnEmpty:''true'', containment:ZoneColumns, constraint:false, ghosting: false }); //alert(String(Sortable.sequence(column)).split('','').flatten().length); column.setAttribute(''currentOrder'',Sortable.sequence(column)); } column.getElementsBySelector(''div.zone'').each(function(node){ if (node.id != null){ if (node.getAttribute(''ZoneDataId'') != null) { var url = ''RenderZone.aspx''; var pars = ''ZoneDataId='' + node.getAttribute(''ZoneDataId''); var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: pars, onComplete:processCollapse }); } } }); }); *Christophe, *I will check that pixel/percent thing in a sec and get back to you. I will also check this diff between scripty and the version I had to use. Gareth On 6/10/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > > Hey, > > Gareth Evans a écrit : > > I think the computed values remain as pixels if you use percentages in > css? > > You can check that by using getStyle on the properties you specified as > percents, and see what you get. I do believe all length-related props > get computed to pixels, which seems to fit the CSS spec. > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
*Christophe: re; Pixel, percent heights.* Element.style.height returns in percentages. If you use the prototype element method to getHeight, it returns in pixels, without the px. Test case is below. <html> <head> <script src="javascript/prototype.js" type="text/javascript"></script> <script type="text/javascript"> function Begin() { var h = $(''percenttest'').style.height new Insertion.Top(''debug'',''div Percentage height: '' + h + ''<br/>''); var ch = $(''percenttest'').getHeight(); new Insertion.Top(''debug'',''div Calculated height: '' + ch + ''<br/>''); } </script> </head> <body style="height:1000px;" onload="Begin();"> <div id=''percenttest'' style="height:70%;background-color:#efefef;"> </div> <div id=''debug''> </div> </body> </html> On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Okay, continuing on from my previous post which details my solution... > > here is the new onload > > > var ZoneColumns = $(''Zones'').getElementsBySelector( ''div.ZoneColumn'' > ).pluck(''id''); > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function (column) > { > if ($F(''UserId'') != 0) > { > Sortable.create(column,{ > tag:''div'', > onChange:function(a,b,c) { }, > onUpdate:function(a,b,c) { > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > a.childNodes.length) + ''<br/>''); > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( > Sortable.sequence(a).length) + ''<br/>''); > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > a.readAttribute(''currentOrder'')).split('','').without('''').length + ''<br/>''); > > if (Sortable.sequence(a).length > String(a.readAttribute(''currentOrder'' > )).split( '','').without('''').length) > { > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > div<br/>''); > //i think this is probably my most awesome line of prototype code ever... > var element = $(''Zone_''+Sortable.sequence(a).without(String( > a.readAttribute(''currentOrder'' )).split('','').without('''')).flatten().toString()).readAttribute( > ''zonedataid''); > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters:''ZoneDataId='' > +element+''&action=UpdateUserZoneItemColumn&Column='' +String(a.id).replace( > ''ZoneColumn_'',''''), onFailure:errFunc }); > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > } > }, > dropOnEmpty:''true'' , > containment:ZoneColumns, > constraint:false, > ghosting: false > }); > //alert(String(Sortable.sequence(column)).split('','').flatten().length); > column.setAttribute(''currentOrder'',Sortable.sequence (column)); > } > column.getElementsBySelector(''div.zone'').each(function(node){ > if (node.id != null){ > if (node.getAttribute( ''ZoneDataId'') != null) > { > var url = ''RenderZone.aspx''; > var pars = ''ZoneDataId='' + node.getAttribute(''ZoneDataId''); > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: > pars, onComplete:processCollapse }); > } > } > }); > }); > > > > *Christophe, *I will check that pixel/percent thing in a sec and get back > to you. > > I will also check this diff between scripty and the version I had to use. > > > Gareth > > > On 6/10/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > > > Hey, > > > > Gareth Evans a écrit : > > > I think the computed values remain as pixels if you use percentages in > > css? > > > > You can check that by using getStyle on the properties you specified as > > percents, and see what you get. I do believe all length-related props > > get computed to pixels, which seems to fit the CSS spec. > > > > -- > > Christophe Porteneuve aka TDD > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
As for the changes made, I can see the changes in visual compare but it doesn''t have the option to generate a patch file. I installed tortisesvn (i use win xp) and grabbed the latest trunk, copied the changed file in and then used "create patch" but the resulting patch has - for every line of dragdrop.js and then a + for every line of the new dragdrop.js so I don''t know what''s going on... How should I go about creating a patch under XP? It doesn''t seem like this patch exists in the trac, though it looks fairly comprehensive. Gareth On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > *Christophe: re; Pixel, percent heights.* > > Element.style.height returns in percentages. > If you use the prototype element method to getHeight, it returns in > pixels, without the px. > > Test case is below. > > <html> > <head> > <script src="javascript/prototype.js" type="text/javascript"></script> > <script type="text/javascript"> > function Begin() > { > var h = $(''percenttest'').style.height > new Insertion.Top(''debug'',''div Percentage height: '' + h + ''<br/>''); > var ch = $(''percenttest'').getHeight(); > new Insertion.Top (''debug'',''div Calculated height: '' + ch + ''<br/>''); > > } > </script> > </head> > <body style="height:1000px;" onload="Begin();"> > <div id=''percenttest'' style="height:70%;background-color:#efefef;"> > </div> > <div id=''debug''> > </div> > </body> > </html> > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Okay, continuing on from my previous post which details my solution... > > > > here is the new onload > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( ''div.ZoneColumn'' > > ).pluck(''id''); > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > if ($F(''UserId'') != 0) > > { > > Sortable.create(column,{ > > tag:''div'', > > onChange:function(a,b,c) { }, > > onUpdate:function(a,b,c) { > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > a.childNodes.length) + ''<br/>''); > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( > > Sortable.sequence(a).length) + ''<br/>''); > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > ''<br/>''); > > if (Sortable.sequence(a).length > String(a.readAttribute(''currentOrder'' > > )).split( '','').without('''').length) > > { > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > div<br/>''); > > //i think this is probably my most awesome line of prototype code > > ever... > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > ''zonedataid''); > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters:''ZoneDataId='' > > +element+''&action=UpdateUserZoneItemColumn&Column='' +String(a.id > > ).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > } > > }, > > dropOnEmpty:''true'' , > > containment:ZoneColumns, > > constraint:false, > > ghosting: false > > }); > > //alert(String(Sortable.sequence(column)).split('','').flatten().length); > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > } > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > if ( node.id != null){ > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > { > > var url = ''RenderZone.aspx ''; > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > parameters: pars, onComplete:processCollapse }); > > } > > } > > }); > > }); > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and get > > back to you. > > > > I will also check this diff between scripty and the version I had to > > use. > > > > > > Gareth > > > > > > On 6/10/07, Christophe Porteneuve < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > > > > > > Hey, > > > > > > Gareth Evans a écrit : > > > > I think the computed values remain as pixels if you use percentages > > > in css? > > > > > > You can check that by using getStyle on the properties you specified > > > as > > > percents, and see what you get. I do believe all length-related props > > > get computed to pixels, which seems to fit the CSS spec. > > > > > > -- > > > Christophe Porteneuve aka TDD > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Updated javascript for onload, this one is set up to identify the new sort order and save it to the database, as well as a second ajax call to send the actual move operation. Forget the serverside and database code, that''s for your own implementation guys :) The line commented previously, //i think this is probably my most awesome line of prototype code ever... Broke when I actually started testing different scenarios so I had to break it into multiple lines ;( It was meant to take 2 arrays, and return the only item not in the smaller of the two, look that up in the dom, pluck an attribute off it... var ZoneColumns = $(''Zones'').getElementsBySelector(''div.ZoneColumn'').pluck( ''id''); $(''Zones'').getElementsBySelector(''div.ZoneColumn'').each(function (column) { if ($F(''UserId'') != 0) { Sortable.create(column,{ tag:''div'', onChange:function(a,b,c) { }, onUpdate:function(a,b,c) { //new Insertion.Top(''debug'',''new childNodeLength: '' + String( a.childNodes.length) + ''<br/>''); //new Insertion.Top(''debug'',a.id + '' event<br/>''); //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( Sortable.sequence(a).length) + ''<br/>''); //new Insertion.Top(''debug'',''stored length of droppable: '' + String( a.readAttribute(''currentOrder'')).split('','').without('''').length + ''<br/>''); var currentSequence = Sortable.sequence(a).invoke(''toString''); var c = $A(String(a.readAttribute(''currentOrder'')).split('','').without('''' ).invoke(''toString'')); if (currentSequence.length > c.size()) { //new Insertion.Top(''debug'',String(a.id) + '' is the destination div<br/>''); var n = $A(currentSequence).invoke(''toString''); var e = n.clone(); c.each(function (value,index) { e = e.without(value); }); var element = $(''Zone_''+e.reduce()).readAttribute(''zonedataid''); //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); //alert($A(currentSequence)); new Ajax.Request(''Ajax.aspx'', {method:''post'', parameters:''ZoneDataId='' +element+''&action=UpdateUserZoneItemColumn&Column=''+String(a.id).replace( ''ZoneColumn_'',''''), onFailure:errFunc }); a.setAttribute(''currentOrder'',Sortable.sequence(a)); } var newOrder = $($A(currentSequence).inject([],function(array,value) { array.push($(''Zone_''+value).readAttribute(''zonedataid'')); return array; })); new Ajax.Request("Ajax.aspx", {method:''post'', postBody: ''Action=OrderZoneItems&newArray='' + newOrder, onFailure: function(transport) { alert(''There was an error setting the new order.''); } }); //new Insertion.Top(''debug'',String(a.id) + ''s new order is: '' + newOrder + ''<br/>''); }, dropOnEmpty:''true'', containment:ZoneColumns, constraint:false, ghosting: false }); column.setAttribute(''currentOrder'',Sortable.sequence(column)); } column.getElementsBySelector(''div.zone'').each(function(node){ if (node.id != null){ if (node.getAttribute(''ZoneDataId'') != null) { var url = ''RenderZone.aspx''; var pars = ''ZoneDataId='' + node.getAttribute(''ZoneDataId''); var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: pars, onComplete:processCollapse }); } } }); }); Enjoy, hopefully this is of some use to someone else as well, coming up to 6 hours of dev :P Gareth On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > As for the changes made, > I can see the changes in visual compare but it doesn''t have the option to > generate a patch file. > I installed tortisesvn (i use win xp) and grabbed the latest trunk, copied > the changed file in and then used "create patch" but the resulting patch has > - for every line of dragdrop.js and then a + for every line of the new > dragdrop.js so I don''t know what''s going on... > How should I go about creating a patch under XP? > It doesn''t seem like this patch exists in the trac, though it looks fairly > comprehensive. > > Gareth > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > *Christophe: re; Pixel, percent heights.* > > > > Element.style.height returns in percentages. > > If you use the prototype element method to getHeight, it returns in > > pixels, without the px. > > > > Test case is below. > > > > <html> > > <head> > > <script src="javascript/prototype.js" type="text/javascript"></script> > > <script type="text/javascript"> > > function Begin() > > { > > var h = $(''percenttest'').style.height > > new Insertion.Top(''debug'',''div Percentage height: '' + h + ''<br/>''); > > var ch = $(''percenttest'').getHeight(); > > new Insertion.Top (''debug'',''div Calculated height: '' + ch + ''<br/>''); > > > > } > > </script> > > </head> > > <body style="height:1000px;" onload="Begin();"> > > <div id=''percenttest'' style="height:70%;background-color:#efefef;"> > > </div> > > <div id=''debug''> > > </div> > > </body> > > </html> > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Okay, continuing on from my previous post which details my solution... > > > > > > here is the new onload > > > > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( ''div.ZoneColumn'' > > > ).pluck(''id''); > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > > if ($F(''UserId'') != 0) > > > { > > > Sortable.create(column,{ > > > tag:''div'', > > > onChange:function(a,b,c) { }, > > > onUpdate:function(a,b,c) { > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > a.childNodes.length) + ''<br/>''); > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > > ''<br/>''); > > > if (Sortable.sequence(a).length > String(a.readAttribute( > > > ''currentOrder'')).split( '','').without('''').length) > > > { > > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > > div<br/>''); > > > //i think this is probably my most awesome line of prototype code > > > ever... > > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > > ''zonedataid''); > > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters: > > > ''ZoneDataId=''+element+''&action=UpdateUserZoneItemColumn&Column='' > > > +String(a.id).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > > } > > > }, > > > dropOnEmpty:''true'' , > > > containment:ZoneColumns, > > > constraint:false, > > > ghosting: false > > > }); > > > //alert(String(Sortable.sequence > > > (column)).split('','').flatten().length); > > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > > } > > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > > if ( node.id != null){ > > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > > { > > > var url = ''RenderZone.aspx ''; > > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > > parameters: pars, onComplete:processCollapse }); > > > } > > > } > > > }); > > > }); > > > > > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and get > > > back to you. > > > > > > I will also check this diff between scripty and the version I had to > > > use. > > > > > > > > > Gareth > > > > > > > > > On 6/10/07, Christophe Porteneuve < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > wrote: > > > > > > > > > > > > Hey, > > > > > > > > Gareth Evans a écrit : > > > > > I think the computed values remain as pixels if you use > > > > percentages in css? > > > > > > > > You can check that by using getStyle on the properties you specified > > > > as > > > > percents, and see what you get. I do believe all length-related > > > > props > > > > get computed to pixels, which seems to fit the CSS spec. > > > > > > > > -- > > > > Christophe Porteneuve aka TDD > > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Gareth, ...many thanks for the informative thread. If you nail down the difference between the versions of Script.aculo.us and modified Script.aculo.us you were using, would be interested to know what they were. -Mark On 6/9/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Updated javascript for onload, this one is set up to identify the new sort > order and save it to the database, as well as a second ajax call to send the > actual move operation. > Forget the serverside and database code, that''s for your own > implementation guys :) > > The line commented previously, > //i think this is probably my most awesome line of prototype code ever... > Broke when I actually started testing different scenarios so I had to > break it into multiple lines ;( > It was meant to take 2 arrays, and return the only item not in the smaller > of the two, look that up in the dom, pluck an attribute off it... > > var ZoneColumns = $(''Zones'').getElementsBySelector('' div.ZoneColumn'' > ).pluck(''id''); > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function (column) > { > if ($F(''UserId'') != 0) > { > Sortable.create(column,{ > tag:''div'', > onChange:function(a,b,c) { }, > onUpdate:function(a,b,c) { > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > a.childNodes.length) + ''<br/>''); > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( > Sortable.sequence(a).length) + ''<br/>''); > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > a.readAttribute(''currentOrder'')).split('','').without('''').length + ''<br/>''); > > var currentSequence = Sortable.sequence(a).invoke(''toString''); > var c = $A(String(a.readAttribute(''currentOrder'')).split('','').without( '''' > ).invoke(''toString'')); > if (currentSequence.length > c.size()) > { > //new Insertion.Top(''debug'',String(a.id) + '' is the destination > div<br/>''); > var n = $A(currentSequence).invoke(''toString''); > var e = n.clone(); > c.each(function (value,index) { e = e.without(value); }); > var element = $( ''Zone_''+e.reduce()).readAttribute(''zonedataid''); > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > //alert($A(currentSequence)); > new Ajax.Request(''Ajax.aspx'', {method:''post'', parameters: ''ZoneDataId='' > +element+''&action=UpdateUserZoneItemColumn&Column=''+String( a.id).replace( > ''ZoneColumn_'',''''), onFailure:errFunc }); > a.setAttribute( ''currentOrder'',Sortable.sequence(a)); > } > var newOrder = $($A(currentSequence).inject([], function(array,value) { > array.push($(''Zone_''+value).readAttribute(''zonedataid'' )); return array; > })); > new Ajax.Request(" Ajax.aspx", {method:''post'', postBody: > ''Action=OrderZoneItems&newArray='' + newOrder, onFailure: function(transport) { alert(''There > was an error setting the new order.'' ); } }); > //new Insertion.Top(''debug'',String(a.id) + ''s new order is: '' + newOrder + > ''<br/>''); > }, > dropOnEmpty:''true'', > containment:ZoneColumns, > constraint:false, > ghosting: false > }); > column.setAttribute(''currentOrder'',Sortable.sequence(column)); > } > column.getElementsBySelector (''div.zone'').each(function(node){ > if (node.id != null){ > if (node.getAttribute( ''ZoneDataId'') != null) > { > var url = ''RenderZone.aspx''; > var pars = ''ZoneDataId='' + node.getAttribute (''ZoneDataId''); > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: > pars, onComplete:processCollapse }); > } > } > }); > }); > > > Enjoy, hopefully this is of some use to someone else as well, coming up to > 6 hours of dev :P > > Gareth > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > As for the changes made, > > I can see the changes in visual compare but it doesn''t have the option > > to generate a patch file. > > I installed tortisesvn (i use win xp) and grabbed the latest trunk, > > copied the changed file in and then used "create patch" but the resulting > > patch has - for every line of dragdrop.js and then a + for every line of > > the new dragdrop.js so I don''t know what''s going on... > > How should I go about creating a patch under XP? > > It doesn''t seem like this patch exists in the trac, though it looks > > fairly comprehensive. > > > > Gareth > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > *Christophe: re; Pixel, percent heights.* > > > > > > Element.style.height returns in percentages. > > > If you use the prototype element method to getHeight, it returns in > > > pixels, without the px. > > > > > > Test case is below. > > > > > > <html> > > > <head> > > > <script src="javascript/prototype.js" > > > type="text/javascript"></script> > > > <script type="text/javascript"> > > > function Begin() > > > { > > > var h = $(''percenttest'').style.height > > > new Insertion.Top(''debug'',''div Percentage height: '' + h + ''<br/>''); > > > var ch = $(''percenttest'').getHeight(); > > > new Insertion.Top (''debug'',''div Calculated height: '' + ch + > > > ''<br/>''); > > > > > > } > > > </script> > > > </head> > > > <body style="height:1000px;" onload="Begin();"> > > > <div id=''percenttest'' style="height:70%;background-color:#efefef;"> > > > </div> > > > <div id=''debug''> > > > </div> > > > </body> > > > </html> > > > > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > Okay, continuing on from my previous post which details my > > > > solution... > > > > > > > > here is the new onload > > > > > > > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( ''div.ZoneColumn'' > > > > ).pluck(''id''); > > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > > > if ($F(''UserId'') != 0) > > > > { > > > > Sortable.create(column,{ > > > > tag:''div'', > > > > onChange:function(a,b,c) { }, > > > > onUpdate:function(a,b,c) { > > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > > a.childNodes.length) + ''<br/>''); > > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > > > ''<br/>''); > > > > if (Sortable.sequence(a).length > String(a.readAttribute( > > > > ''currentOrder'')).split( '','').without('''').length) > > > > { > > > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > > > div<br/>''); > > > > //i think this is probably my most awesome line of prototype code > > > > ever... > > > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > > > ''zonedataid''); > > > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > > > > > > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters: > > > > ''ZoneDataId=''+element+''&action=UpdateUserZoneItemColumn&Column='' > > > > +String(a.id).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > > > } > > > > }, > > > > dropOnEmpty:''true'' , > > > > containment:ZoneColumns, > > > > constraint:false, > > > > ghosting: false > > > > }); > > > > //alert(String(Sortable.sequence > > > > (column)).split('','').flatten().length); > > > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > > > } > > > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > > > if ( node.id != null){ > > > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > > > { > > > > var url = ''RenderZone.aspx ''; > > > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > > > parameters: pars, onComplete:processCollapse }); > > > > } > > > > } > > > > }); > > > > }); > > > > > > > > > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and get > > > > back to you. > > > > > > > > I will also check this diff between scripty and the version I had to > > > > use. > > > > > > > > > > > > Gareth > > > > > > > > > > > > On 6/10/07, Christophe Porteneuve < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > wrote: > > > > > > > > > > > > > > > Hey, > > > > > > > > > > Gareth Evans a écrit : > > > > > > I think the computed values remain as pixels if you use > > > > > percentages in css? > > > > > > > > > > You can check that by using getStyle on the properties you > > > > > specified as > > > > > percents, and see what you get. I do believe all length-related > > > > > props > > > > > get computed to pixels, which seems to fit the CSS spec. > > > > > > > > > > -- > > > > > Christophe Porteneuve aka TDD > > > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
HI Mark No Problem, thought I better contribute something that actually works on here since I''m always asking questions and my project is a little ''closed off'' right now, (i dont want to open it to the world while it''s got this many bugs/missing features), and I can''t direct people to the site to see the fruits. The changes in scripty were easy to identify as they are all commented, they are only in dragdrop.js but I can''t generate a patch- I think I need someone''s help to figure out how to generate a patch/diff file under windows... If someone sorts this out, I will submit it to trac as I think it is something that is possibly quite useful. Gareth On 6/10/07, Mark Holton <holtonma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Gareth, > ...many thanks for the informative thread. If you nail down the > difference between the versions of Script.aculo.us<http://script.aculo.us/>and modified Script.aculo.us > <http://script.aculo.us/>you were using, would be interested to know what > they were. > -Mark > > > On 6/9/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > Updated javascript for onload, this one is set up to identify the new > > sort order and save it to the database, as well as a second ajax call to > > send the actual move operation. > > Forget the serverside and database code, that''s for your own > > implementation guys :) > > > > The line commented previously, > > //i think this is probably my most awesome line of prototype code > > ever... > > Broke when I actually started testing different scenarios so I had to > > break it into multiple lines ;( > > It was meant to take 2 arrays, and return the only item not in the > > smaller of the two, look that up in the dom, pluck an attribute off it... > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' div.ZoneColumn'' > > ).pluck(''id''); > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > if ($F(''UserId'') != 0) > > { > > Sortable.create(column,{ > > tag:''div'', > > onChange:function(a,b,c) { }, > > onUpdate:function(a,b,c) { > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > a.childNodes.length) + ''<br/>''); > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + String( > > Sortable.sequence(a).length) + ''<br/>''); > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > ''<br/>''); > > var currentSequence = Sortable.sequence(a).invoke(''toString''); > > var c = $A(String(a.readAttribute(''currentOrder'')).split('','').without( > > '''').invoke(''toString'')); > > if (currentSequence.length > c.size()) > > { > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > div<br/>''); > > var n = $A(currentSequence).invoke(''toString''); > > var e = n.clone(); > > c.each(function (value,index) { e = e.without(value); }); > > var element = $( ''Zone_''+e.reduce()).readAttribute(''zonedataid''); > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > //alert($A(currentSequence)); > > new Ajax.Request(''Ajax.aspx'', {method:''post'', parameters: ''ZoneDataId='' > > +element+''&action=UpdateUserZoneItemColumn&Column=''+String( a.id > > ).replace(''ZoneColumn_'',''''), onFailure:errFunc }); > > a.setAttribute( ''currentOrder'',Sortable.sequence(a)); > > } > > var newOrder = $($A(currentSequence).inject([], function(array,value) { > > array.push($(''Zone_''+value).readAttribute(''zonedataid'' )); return array; > > })); > > new Ajax.Request(" Ajax.aspx", {method:''post'', postBody: > > ''Action=OrderZoneItems&newArray='' + newOrder, onFailure: function(transport) { alert(''There > > was an error setting the new order.'' ); } }); > > //new Insertion.Top(''debug'',String(a.id) + ''s new order is: '' + newOrder > > + ''<br/>''); > > }, > > dropOnEmpty:''true'', > > containment:ZoneColumns, > > constraint:false, > > ghosting: false > > }); > > column.setAttribute(''currentOrder'',Sortable.sequence(column)); > > } > > column.getElementsBySelector (''div.zone'').each(function(node){ > > if (node.id != null){ > > if (node.getAttribute( ''ZoneDataId'') != null) > > { > > var url = ''RenderZone.aspx''; > > var pars = ''ZoneDataId='' + node.getAttribute (''ZoneDataId''); > > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', parameters: > > pars, onComplete:processCollapse }); > > } > > } > > }); > > }); > > > > > > Enjoy, hopefully this is of some use to someone else as well, coming up > > to 6 hours of dev :P > > > > Gareth > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > As for the changes made, > > > I can see the changes in visual compare but it doesn''t have the option > > > to generate a patch file. > > > I installed tortisesvn (i use win xp) and grabbed the latest trunk, > > > copied the changed file in and then used "create patch" but the resulting > > > patch has - for every line of dragdrop.js and then a + for every line > > > of the new dragdrop.js so I don''t know what''s going on... > > > How should I go about creating a patch under XP? > > > It doesn''t seem like this patch exists in the trac, though it looks > > > fairly comprehensive. > > > > > > Gareth > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > *Christophe: re; Pixel, percent heights.* > > > > > > > > Element.style.height returns in percentages. > > > > If you use the prototype element method to getHeight, it returns in > > > > pixels, without the px. > > > > > > > > Test case is below. > > > > > > > > <html> > > > > <head> > > > > <script src="javascript/prototype.js" > > > > type="text/javascript"></script> > > > > <script type="text/javascript"> > > > > function Begin() > > > > { > > > > var h = $(''percenttest'').style.height > > > > new Insertion.Top(''debug'',''div Percentage height: '' + h + > > > > ''<br/>''); > > > > var ch = $(''percenttest'').getHeight(); > > > > new Insertion.Top (''debug'',''div Calculated height: '' + ch + > > > > ''<br/>''); > > > > > > > > } > > > > </script> > > > > </head> > > > > <body style="height:1000px;" onload="Begin();"> > > > > <div id=''percenttest'' style="height:70%;background-color:#efefef;"> > > > > </div> > > > > <div id=''debug''> > > > > </div> > > > > </body> > > > > </html> > > > > > > > > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > Okay, continuing on from my previous post which details my > > > > > solution... > > > > > > > > > > here is the new onload > > > > > > > > > > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' > > > > > div.ZoneColumn'').pluck(''id''); > > > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > > > > if ($F(''UserId'') != 0) > > > > > { > > > > > Sortable.create(column,{ > > > > > tag:''div'', > > > > > onChange:function(a,b,c) { }, > > > > > onUpdate:function(a,b,c) { > > > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > > > a.childNodes.length) + ''<br/>''); > > > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + > > > > > String(a.readAttribute(''currentOrder'')).split('','').without('''').length > > > > > + ''<br/>''); > > > > > if (Sortable.sequence(a).length > String(a.readAttribute( > > > > > ''currentOrder'')).split( '','').without('''').length) > > > > > { > > > > > //new Insertion.Top (''debug'',String( a.id) + '' is the destination > > > > > div<br/>''); > > > > > //i think this is probably my most awesome line of prototype code > > > > > ever... > > > > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > > > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > > > > ''zonedataid''); > > > > > //new Insertion.Top(''debug'',element + '' is the draggable > > > > > div<br/>''); > > > > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters: > > > > > ''ZoneDataId=''+element+''&action=UpdateUserZoneItemColumn&Column='' > > > > > +String(a.id).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > > > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > > > > } > > > > > }, > > > > > dropOnEmpty:''true'' , > > > > > containment:ZoneColumns, > > > > > constraint:false, > > > > > ghosting: false > > > > > }); > > > > > //alert(String(Sortable.sequence > > > > > (column)).split('','').flatten().length); > > > > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > > > > } > > > > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > > > > if ( node.id != null){ > > > > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > > > > { > > > > > var url = ''RenderZone.aspx ''; > > > > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > > > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > > > > parameters: pars, onComplete:processCollapse }); > > > > > } > > > > > } > > > > > }); > > > > > }); > > > > > > > > > > > > > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and > > > > > get back to you. > > > > > > > > > > I will also check this diff between scripty and the version I had > > > > > to use. > > > > > > > > > > > > > > > Gareth > > > > > > > > > > > > > > > On 6/10/07, Christophe Porteneuve < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > wrote: > > > > > > > > > > > > > > > > > > Hey, > > > > > > > > > > > > Gareth Evans a écrit : > > > > > > > I think the computed values remain as pixels if you use > > > > > > percentages in css? > > > > > > > > > > > > You can check that by using getStyle on the properties you > > > > > > specified as > > > > > > percents, and see what you get. I do believe all length-related > > > > > > props > > > > > > get computed to pixels, which seems to fit the CSS spec. > > > > > > > > > > > > -- > > > > > > Christophe Porteneuve aka TDD > > > > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Gareth, Very cool. Good luck with your project. ... the banter is useful in triggering thought, for sure! cheers, Mark On 6/9/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > HI Mark > No Problem, thought I better contribute something that actually works on > here since I''m always asking questions and my project is a little ''closed > off'' right now, (i dont want to open it to the world while it''s got this > many bugs/missing features), and I can''t direct people to the site to see > the fruits. > > The changes in scripty were easy to identify as they are all commented, > they are only in dragdrop.js but I can''t generate a patch- I think I need > someone''s help to figure out how to generate a patch/diff file under > windows... > > If someone sorts this out, I will submit it to trac as I think it is > something that is possibly quite useful. > > Gareth > > > > On 6/10/07, Mark Holton <holtonma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Gareth, > > ...many thanks for the informative thread. If you nail down the > > difference between the versions of Script.aculo.us<http://script.aculo.us/>and modified Script.aculo.us > > <http://script.aculo.us/>you were using, would be interested to know > > what they were. > > -Mark > > > > > > On 6/9/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > > > Updated javascript for onload, this one is set up to identify the new > > > sort order and save it to the database, as well as a second ajax call to > > > send the actual move operation. > > > Forget the serverside and database code, that''s for your own > > > implementation guys :) > > > > > > The line commented previously, > > > //i think this is probably my most awesome line of prototype code > > > ever... > > > Broke when I actually started testing different scenarios so I had to > > > break it into multiple lines ;( > > > It was meant to take 2 arrays, and return the only item not in the > > > smaller of the two, look that up in the dom, pluck an attribute off it... > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' div.ZoneColumn'' > > > ).pluck(''id''); > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > > if ($F(''UserId'') != 0) > > > { > > > Sortable.create(column,{ > > > tag:''div'', > > > onChange:function(a,b,c) { }, > > > onUpdate:function(a,b,c) { > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > a.childNodes.length) + ''<br/>''); > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > > ''<br/>''); > > > var currentSequence = Sortable.sequence(a).invoke(''toString''); > > > var c = $A(String(a.readAttribute(''currentOrder'')).split('','').without( > > > '''').invoke(''toString'')); > > > if (currentSequence.length > c.size()) > > > { > > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > > div<br/>''); > > > var n = $A(currentSequence).invoke(''toString'' ); > > > var e = n.clone(); > > > c.each(function (value,index) { e = e.without(value); }); > > > var element = $( ''Zone_''+e.reduce()).readAttribute( ''zonedataid''); > > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > > //alert($A(currentSequence)); > > > new Ajax.Request(''Ajax.aspx'' , {method:''post'', parameters: > > > ''ZoneDataId=''+element+ ''&action=UpdateUserZoneItemColumn&Column='' > > > +String( a.id).replace( ''ZoneColumn_'',''''), onFailure:errFunc }); > > > a.setAttribute( ''currentOrder'' ,Sortable.sequence(a)); > > > } > > > var newOrder = $($A(currentSequence).inject([], function (array,value) > > > { array.push($(''Zone_''+value).readAttribute(''zonedataid'' )); returnarray; })); > > > new Ajax.Request(" Ajax.aspx", {method: ''post'', postBody: > > > ''Action=OrderZoneItems&newArray='' + newOrder, onFailure: function (transport) > > > { alert(''There was an error setting the new order.'' ); } }); > > > //new Insertion.Top (''debug'',String(a.id) + ''s new order is: '' + > > > newOrder + ''<br/>''); > > > }, > > > dropOnEmpty:''true'', > > > containment:ZoneColumns, > > > constraint:false, > > > ghosting: false > > > }); > > > column.setAttribute(''currentOrder'',Sortable.sequence(column)); > > > } > > > column.getElementsBySelector (''div.zone'').each(function(node){ > > > if (node.id != null){ > > > if (node.getAttribute( ''ZoneDataId'') != null) > > > { > > > var url = ''RenderZone.aspx''; > > > var pars = ''ZoneDataId='' + node.getAttribute (''ZoneDataId''); > > > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', > > > parameters: pars, onComplete:processCollapse }); > > > } > > > } > > > }); > > > }); > > > > > > > > > Enjoy, hopefully this is of some use to someone else as well, coming > > > up to 6 hours of dev :P > > > > > > Gareth > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > As for the changes made, > > > > I can see the changes in visual compare but it doesn''t have the > > > > option to generate a patch file. > > > > I installed tortisesvn (i use win xp) and grabbed the latest trunk, > > > > copied the changed file in and then used "create patch" but the resulting > > > > patch has - for every line of dragdrop.js and then a + for every > > > > line of the new dragdrop.js so I don''t know what''s going on... > > > > How should I go about creating a patch under XP? > > > > It doesn''t seem like this patch exists in the trac, though it looks > > > > fairly comprehensive. > > > > > > > > Gareth > > > > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > *Christophe: re; Pixel, percent heights.* > > > > > > > > > > Element.style.height returns in percentages. > > > > > If you use the prototype element method to getHeight, it returns > > > > > in pixels, without the px. > > > > > > > > > > Test case is below. > > > > > > > > > > <html> > > > > > <head> > > > > > <script src="javascript/prototype.js" > > > > > type="text/javascript"></script> > > > > > <script type="text/javascript"> > > > > > function Begin() > > > > > { > > > > > var h = $(''percenttest'').style.height > > > > > new Insertion.Top(''debug'',''div Percentage height: '' + h + > > > > > ''<br/>''); > > > > > var ch = $(''percenttest'').getHeight(); > > > > > new Insertion.Top (''debug'',''div Calculated height: '' + ch + > > > > > ''<br/>''); > > > > > > > > > > } > > > > > </script> > > > > > </head> > > > > > <body style="height:1000px;" onload="Begin();"> > > > > > <div id=''percenttest'' > > > > > style="height:70%;background-color:#efefef;"> > > > > > </div> > > > > > <div id=''debug''> > > > > > </div> > > > > > </body> > > > > > </html> > > > > > > > > > > > > > > > > > > > > On 6/10/07, Gareth Evans <agrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > Okay, continuing on from my previous post which details my > > > > > > solution... > > > > > > > > > > > > here is the new onload > > > > > > > > > > > > > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' > > > > > > div.ZoneColumn'').pluck(''id''); > > > > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each( > > > > > > function (column) { > > > > > > if ($F(''UserId'') != 0) > > > > > > { > > > > > > Sortable.create(column,{ > > > > > > tag:''div'', > > > > > > onChange:function(a,b,c) { }, > > > > > > onUpdate:function(a,b,c) { > > > > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > > > > a.childNodes.length) + ''<br/>''); > > > > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + > > > > > > String(a.readAttribute(''currentOrder'')).split('','').without('''').length > > > > > > + ''<br/>''); > > > > > > if (Sortable.sequence(a).length > String(a.readAttribute( > > > > > > ''currentOrder'')).split( '','').without('''').length) > > > > > > { > > > > > > //new Insertion.Top (''debug'',String( a.id) + '' is the > > > > > > destination div<br/>''); > > > > > > //i think this is probably my most awesome line of prototype > > > > > > code ever... > > > > > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > > > > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > > > > > ''zonedataid''); > > > > > > //new Insertion.Top(''debug'',element + '' is the draggable > > > > > > div<br/>''); > > > > > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters: > > > > > > ''ZoneDataId=''+element+''&action=UpdateUserZoneItemColumn&Column='' > > > > > > +String(a.id).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > > > > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > > > > > } > > > > > > }, > > > > > > dropOnEmpty:''true'' , > > > > > > containment:ZoneColumns, > > > > > > constraint:false, > > > > > > ghosting: false > > > > > > }); > > > > > > //alert(String(Sortable.sequence > > > > > > (column)).split('','').flatten().length); > > > > > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > > > > > } > > > > > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > > > > > if ( node.id != null){ > > > > > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > > > > > { > > > > > > var url = ''RenderZone.aspx ''; > > > > > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > > > > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > > > > > parameters: pars, onComplete:processCollapse }); > > > > > > } > > > > > > } > > > > > > }); > > > > > > }); > > > > > > > > > > > > > > > > > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and > > > > > > get back to you. > > > > > > > > > > > > I will also check this diff between scripty and the version I > > > > > > had to use. > > > > > > > > > > > > > > > > > > Gareth > > > > > > > > > > > > > > > > > > On 6/10/07, Christophe Porteneuve < tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > wrote: > > > > > > > > > > > > > > > > > > > > > Hey, > > > > > > > > > > > > > > Gareth Evans a écrit : > > > > > > > > I think the computed values remain as pixels if you use > > > > > > > percentages in css? > > > > > > > > > > > > > > You can check that by using getStyle on the properties you > > > > > > > specified as > > > > > > > percents, and see what you get. I do believe all > > > > > > > length-related props > > > > > > > get computed to pixels, which seems to fit the CSS spec. > > > > > > > > > > > > > > -- > > > > > > > Christophe Porteneuve aka TDD > > > > > > > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Gareth, the modified version of scripty found at http://tankut.googlepages.com/home solved my issue. Thanks for your help Sabri On 10 juin, 02:40, "Mark Holton" <holto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Gareth, > Very cool. Good luck with your project. ... the banter is useful in > triggering thought, for sure! > cheers, > Mark > > On 6/9/07, Gareth Evans <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > HI Mark > > No Problem, thought I better contribute something that actually works on > > here since I''m always asking questions and my project is a little ''closed > > off'' right now, (i dont want to open it to the world while it''s got this > > many bugs/missing features), and I can''t direct people to the site to see > > the fruits. > > > The changes in scripty were easy to identify as they are all commented, > > they are only in dragdrop.js but I can''t generate a patch- I think I need > > someone''s help to figure out how to generate a patch/diff file under > > windows... > > > If someone sorts this out, I will submit it to trac as I think it is > > something that is possibly quite useful. > > > Gareth > > > On 6/10/07, Mark Holton <holto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Gareth, > > > ...many thanks for the informative thread. If you nail down the > > > difference between the versions of Script.aculo.us<http://script.aculo.us/>and modified Script.aculo.us > > > <http://script.aculo.us/>you were using, would be interested to know > > > what they were. > > > -Mark > > > > On 6/9/07, Gareth Evans <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > > Updated javascript for onload, this one is set up to identify the new > > > > sort order and save it to the database, as well as a second ajax call to > > > > send the actual move operation. > > > > Forget the serverside and database code, that''s for your own > > > > implementation guys :) > > > > > The line commented previously, > > > > //i think this is probably my most awesome line of prototype code > > > > ever... > > > > Broke when I actually started testing different scenarios so I had to > > > > break it into multiple lines ;( > > > > It was meant to take 2 arrays, and return the only item not in the > > > > smaller of the two, look that up in the dom, pluck an attribute off it... > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' div.ZoneColumn'' > > > > ).pluck(''id''); > > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each(function(column) { > > > > if ($F(''UserId'') != 0) > > > > { > > > > Sortable.create(column,{ > > > > tag:''div'', > > > > onChange:function(a,b,c) { }, > > > > onUpdate:function(a,b,c) { > > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > > a.childNodes.length) + ''<br/>''); > > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + String( > > > > a.readAttribute(''currentOrder'')).split('','').without('''').length + > > > > ''<br/>''); > > > > var currentSequence = Sortable.sequence(a).invoke(''toString''); > > > > var c = $A(String(a.readAttribute(''currentOrder'')).split('','').without( > > > > '''').invoke(''toString'')); > > > > if (currentSequence.length > c.size()) > > > > { > > > > //new Insertion.Top(''debug'',String( a.id) + '' is the destination > > > > div<br/>''); > > > > var n = $A(currentSequence).invoke(''toString'' ); > > > > var e = n.clone(); > > > > c.each(function (value,index) { e = e.without(value); }); > > > > var element = $( ''Zone_''+e.reduce()).readAttribute( ''zonedataid''); > > > > //new Insertion.Top(''debug'',element + '' is the draggable div<br/>''); > > > > //alert($A(currentSequence)); > > > > new Ajax.Request(''Ajax.aspx'' , {method:''post'', parameters: > > > > ''ZoneDataId=''+element+ ''&action=UpdateUserZoneItemColumn&Column='' > > > > +String( a.id).replace( ''ZoneColumn_'',''''), onFailure:errFunc }); > > > > a.setAttribute( ''currentOrder'' ,Sortable.sequence(a)); > > > > } > > > > var newOrder = $($A(currentSequence).inject([], function (array,value) > > > > { array.push($(''Zone_''+value).readAttribute(''zonedataid'' )); returnarray; })); > > > > new Ajax.Request(" Ajax.aspx", {method: ''post'', postBody: > > > > ''Action=OrderZoneItems&newArray='' + newOrder, onFailure: function (transport) > > > > { alert(''There was an error setting the new order.'' ); } }); > > > > //new Insertion.Top (''debug'',String(a.id) + ''s new order is: '' + > > > > newOrder + ''<br/>''); > > > > }, > > > > dropOnEmpty:''true'', > > > > containment:ZoneColumns, > > > > constraint:false, > > > > ghosting: false > > > > }); > > > > column.setAttribute(''currentOrder'',Sortable.sequence(column)); > > > > } > > > > column.getElementsBySelector (''div.zone'').each(function(node){ > > > > if (node.id != null){ > > > > if (node.getAttribute( ''ZoneDataId'') != null) > > > > { > > > > var url = ''RenderZone.aspx''; > > > > var pars = ''ZoneDataId='' + node.getAttribute (''ZoneDataId''); > > > > var myAjax = new Ajax.Updater(node.id, url, {method: ''post'', > > > > parameters: pars, onComplete:processCollapse }); > > > > } > > > > } > > > > }); > > > > }); > > > > > Enjoy, hopefully this is of some use to someone else as well, coming > > > > up to 6 hours of dev :P > > > > > Gareth > > > > > On 6/10/07, Gareth Evans <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > As for the changes made, > > > > > I can see the changes in visual compare but it doesn''t have the > > > > > option to generate a patch file. > > > > > I installed tortisesvn (i use win xp) and grabbed the latest trunk, > > > > > copied the changed file in and then used "create patch" but the resulting > > > > > patch has - for every line of dragdrop.js and then a + for every > > > > > line of the new dragdrop.js so I don''t know what''s going on... > > > > > How should I go about creating a patch under XP? > > > > > It doesn''t seem like this patch exists in the trac, though it looks > > > > > fairly comprehensive. > > > > > > Gareth > > > > > > On 6/10/07, Gareth Evans <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > *Christophe: re; Pixel, percent heights.* > > > > > > > Element.style.height returns in percentages. > > > > > > If you use the prototype element method to getHeight, it returns > > > > > > in pixels, without the px. > > > > > > > Test case is below. > > > > > > > <html> > > > > > > <head> > > > > > > <script src="javascript/prototype.js" > > > > > > type="text/javascript"></script> > > > > > > <script type="text/javascript"> > > > > > > function Begin() > > > > > > { > > > > > > var h = $(''percenttest'').style.height > > > > > > new Insertion.Top(''debug'',''div Percentage height: '' + h + > > > > > > ''<br/>''); > > > > > > var ch = $(''percenttest'').getHeight(); > > > > > > new Insertion.Top (''debug'',''div Calculated height: '' + ch + > > > > > > ''<br/>''); > > > > > > > } > > > > > > </script> > > > > > > </head> > > > > > > <body style="height:1000px;" onload="Begin();"> > > > > > > <div id=''percenttest'' > > > > > > style="height:70%;background-color:#efefef;"> > > > > > > </div> > > > > > > <div id=''debug''> > > > > > > </div> > > > > > > </body> > > > > > > </html> > > > > > > > On 6/10/07, Gareth Evans <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > Okay, continuing on from my previous post which details my > > > > > > > solution... > > > > > > > > here is the new onload > > > > > > > > var ZoneColumns = $(''Zones'').getElementsBySelector( '' > > > > > > > div.ZoneColumn'').pluck(''id''); > > > > > > > $(''Zones'').getElementsBySelector( ''div.ZoneColumn'').each( > > > > > > > function (column) { > > > > > > > if ($F(''UserId'') != 0) > > > > > > > { > > > > > > > Sortable.create(column,{ > > > > > > > tag:''div'', > > > > > > > onChange:function(a,b,c) { }, > > > > > > > onUpdate:function(a,b,c) { > > > > > > > //new Insertion.Top(''debug'',''new childNodeLength: '' + String( > > > > > > > a.childNodes.length) + ''<br/>''); > > > > > > > //new Insertion.Top(''debug'', a.id + '' event<br/>''); > > > > > > > //new Insertion.Top(''debug'',''sequenced length of droppable: '' + > > > > > > > String(Sortable.sequence(a).length) + ''<br/>''); > > > > > > > //new Insertion.Top(''debug'',''stored length of droppable: '' + > > > > > > > String(a.readAttribute(''currentOrder'')).split('','').without('''').length > > > > > > > + ''<br/>''); > > > > > > > if (Sortable.sequence(a).length > String(a.readAttribute( > > > > > > > ''currentOrder'')).split( '','').without('''').length) > > > > > > > { > > > > > > > //new Insertion.Top (''debug'',String( a.id) + '' is the > > > > > > > destination div<br/>''); > > > > > > > //i think this is probably my most awesome line of prototype > > > > > > > code ever... > > > > > > > var element = $(''Zone_''+Sortable.sequence(a).without(String( > > > > > > > a.readAttribute(''currentOrder'' )).split('','').without( '''')).flatten().toString()).readAttribute( > > > > > > > ''zonedataid''); > > > > > > > //new Insertion.Top(''debug'',element + '' is the draggable > > > > > > > div<br/>''); > > > > > > > new Ajax.Request(''Ajax.aspx'', {method:''post'' , parameters: > > > > > > > ''ZoneDataId=''+element+''&action=UpdateUserZoneItemColumn&Column='' > > > > > > > +String(a.id).replace(''ZoneColumn_'' ,''''), onFailure:errFunc }); > > > > > > > a.setAttribute(''currentOrder'',Sortable.sequence(a)); > > > > > > > } > > > > > > > }, > > > > > > > dropOnEmpty:''true'' , > > > > > > > containment:ZoneColumns, > > > > > > > constraint:false, > > > > > > > ghosting: false > > > > > > > }); > > > > > > > //alert(String(Sortable.sequence > > > > > > > (column)).split('','').flatten().length); > > > > > > > column.setAttribute (''currentOrder'',Sortable.sequence (column)); > > > > > > > } > > > > > > > column.getElementsBySelector(''div.zone'' ).each(function(node){ > > > > > > > if ( node.id != null){ > > > > > > > if (node.getAttribute( ''ZoneDataId'' ) != null) > > > > > > > { > > > > > > > var url = ''RenderZone.aspx ''; > > > > > > > var pars = ''ZoneDataId='' + node.getAttribute( ''ZoneDataId''); > > > > > > > var myAjax = new Ajax.Updater( node.id, url, {method: ''post'', > > > > > > > parameters: pars, onComplete:processCollapse }); > > > > > > > } > > > > > > > } > > > > > > > }); > > > > > > > }); > > > > > > > > *Christophe, *I will check that pixel/percent thing in a sec and > > > > > > > get back to you. > > > > > > > > I will also check this diff between scripty and the version I > > > > > > > had > > ... > > plus de détails >>--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---