Drag and drop?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Drag and drop?

Bernat Romagosa
I'd need to drag some visual elements and perform some actions depending on where they are dropped, is there a way to get JQuery's drag and drop in an Iliad app?

Thanks,

Bernat Romagosa
Reply | Threaded
Open this post in threaded view
|

Re: Drag and drop?

Nicolas Petton
Le lundi 28 mars 2011 à 18:31 +0200, AxiNat a écrit :
> I'd need to drag some visual elements and perform some actions
> depending on where they are dropped, is there a way to get JQuery's
> drag and drop in an Iliad app?
>
What actions do you need to perform? Do you want to trigger JavaScript
code or Smalltalk code?

Cheers,
Nico


Reply | Threaded
Open this post in threaded view
|

Re: Drag and drop?

Bernat Romagosa
I'd need to trigger Smalltalk code.

The idea is as follows:

There's a box full of icons, and a "canvas" where you can drop these icons. Each icon has a Smalltalk object assigned, and upon an icon being dropped, you have to trigger a lightbox asking the user to input some properties for said object.

Thanks!

Bernat.

2011/3/30 Nicolas Petton <[hidden email]>
Le lundi 28 mars 2011 à 18:31 +0200, AxiNat a écrit :
> I'd need to drag some visual elements and perform some actions
> depending on where they are dropped, is there a way to get JQuery's
> drag and drop in an Iliad app?
>
What actions do you need to perform? Do you want to trigger JavaScript
code or Smalltalk code?

Cheers,
Nico



Reply | Threaded
Open this post in threaded view
|

Re: Drag and drop?

Bernat Romagosa
Hi, digging up an old topic here...

Would it be very difficult to implement event listeners for onDrag: onDragDo: onDrop: onDropDo:? Something like the following:

h div onDropDo: [:point | self inform: 'You have dropped me at ' , point printString ]

IMHO, this would follow Iliad's idiosyncrasy much more than having to manually take care of communicating back and forth with the terrifying kingdom of the browser. Sorry for requesting without actually making an effort to build a prototype, my javascript knowledge is ridiculously small and I feel any attempt to implement this by myself would result in an awful clutch...

Cheers!

Bernat Romagosa.

2011/3/30 Nicolas Petton <[hidden email]>
Le mercredi 30 mars 2011 à 15:24 +0200, AxiNat a écrit :
> Thanks Canol, I'll see if I can manage :)
>
>
> Out of curiosity, if someone were to build a wrapper for JQuery, would
> that be the way to do it?

I think I would start with the existing Seaside package.

Nico


Reply | Threaded
Open this post in threaded view
|

Re: Drag and drop?

Nicolas Petton
Le mercredi 18 mai 2011 à 11:35 +0200, Bernat Romagosa a écrit :
> Hi, digging up an old topic here...
>
>
> Would it be very difficult to implement event listeners for onDrag:
> onDragDo: onDrop: onDropDo:? Something like the following:
>
>
> h div onDropDo: [:point | self inform: 'You have dropped me at ' ,
> point printString ]

Not really, but if we start supporting this events, we have to add
support for the entire jQuery library, and this is another story.

What features would you need? I can try to help :-)

Another possibility would be to adapt the Seaside-JQuery package to
Iliad.

Cheers,
Nico

>
>
> IMHO, this would follow Iliad's idiosyncrasy much more than having to
> manually take care of communicating back and forth with the terrifying
> kingdom of the browser. Sorry for requesting without actually making
> an effort to build a prototype, my javascript knowledge is
> ridiculously small and I feel any attempt to implement this by myself
> would result in an awful clutch...
>
>
> Cheers!
>
>
> Bernat Romagosa.
>
> 2011/3/30 Nicolas Petton <[hidden email]>
>         Le mercredi 30 mars 2011 à 15:24 +0200, AxiNat a écrit :
>         > Thanks Canol, I'll see if I can manage :)
>         >
>         >
>         > Out of curiosity, if someone were to build a wrapper for
>         JQuery, would
>         > that be the way to do it?
>        
>        
>         I think I would start with the existing Seaside package.
>        
>         Nico
>        
>
>

--
Nicolas Petton
http://www.nicolas-petton.fr

Reply | Threaded
Open this post in threaded view
|

Re: Drag and drop?

Bernat Romagosa
Indeed... if we got to deal with JQuery the Iliad way we'd be miles ahead of any other framework around, but I guess this is a massive task.

I did manage to solve my needs and I can now drag stuff, drop it, and execute both JS and ST code at will, but I got there by typing quite a lot of plain javascript (I didn't want to use JQuery for only one of its functionalities) and using hidden fields to communicate the position of the drops to Iliad, which feels a bit dirty ;)

Cheers,
Bernat.

2011/5/19 Nicolas Petton <[hidden email]>
Le mercredi 18 mai 2011 à 11:35 +0200, Bernat Romagosa a écrit :
> Hi, digging up an old topic here...
>
>
> Would it be very difficult to implement event listeners for onDrag:
> onDragDo: onDrop: onDropDo:? Something like the following:
>
>
> h div onDropDo: [:point | self inform: 'You have dropped me at ' ,
> point printString ]

Not really, but if we start supporting this events, we have to add
support for the entire jQuery library, and this is another story.

What features would you need? I can try to help :-)

Another possibility would be to adapt the Seaside-JQuery package to
Iliad.

Cheers,
Nico

>
>
> IMHO, this would follow Iliad's idiosyncrasy much more than having to
> manually take care of communicating back and forth with the terrifying
> kingdom of the browser. Sorry for requesting without actually making
> an effort to build a prototype, my javascript knowledge is
> ridiculously small and I feel any attempt to implement this by myself
> would result in an awful clutch...
>
>
> Cheers!
>
>
> Bernat Romagosa.
>
> 2011/3/30 Nicolas Petton <[hidden email]>
>         Le mercredi 30 mars 2011 à 15:24 +0200, AxiNat a écrit :
>         > Thanks Canol, I'll see if I can manage :)
>         >
>         >
>         > Out of curiosity, if someone were to build a wrapper for
>         JQuery, would
>         > that be the way to do it?
>
>
>         I think I would start with the existing Seaside package.
>
>         Nico
>
>
>

--
Nicolas Petton
http://www.nicolas-petton.fr