ModalBox

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

ModalBox

Oleg Richards
Hello Guys!

Lukas, can you look at this thing: http://www.wildbit.com/labs/ 
modalbox/.
You've written me a very good recommendations on how to create effect  
for tooltip library. I would be very happy if you could recommend me  
how to wrap this thing in seaside.

Cheers, Oleg
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ModalBox

Lukas Renggli
> Lukas, can you look at this thing: http://www.wildbit.com/labs/
> modalbox/.
> You've written me a very good recommendations on how to create effect
> for tooltip library. I would be very happy if you could recommend me
> how to wrap this thing in seaside.

Again I would follow the implementation of SUEffect:

1. Create a sibling to SUEffect called SUModalBox.

2. Override #defaultPrototype to return 'Modalbox'.

3. Override #defaultMethod to return 'show'.

4. Create a method #show: that takes an object/block to render the
contents. See the method SUElement>>#render: how to do this.

3. Implement options as you find them in the documentation.

4. Import the JavaScript code into a WAFileLibrary.

5. Commit your changes to SqueakSource so that others can use your
library as well.

Btw, where is the tooltip code available?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ModalBox

Oleg Richards
In reply to this post by Oleg Richards
Hello Guys!

Lukas, i'm trying to incapsulate a modalbox JS library. You've  
recommended me to use SUEffect as base class. What do you think about  
taking something like Lightbox class as parent?

As for SUEffect. I've created a subclass and implemented a few  
functions into it. Now i have a problem with a show method. I would  
like to pass a rendering block to it. To do something like that:

html anchor onClick: ((SUModalBox on:  self) show: [html heading:  
'Hello World']); with: 'Show me hello in modal box'

  But this doesn't works.

What's the problem? I've copied this (String stream.....) from  
SUElement>>#render. But it doesn't works.

So here's my code:

show: aBlock
        self create; arguments: self arguments, (Array with:
                (String streamContents: [ :stream | self render: aBlock on: stream ]))

Cheers, Oleg
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: ModalBox

Oleg Richards
Little more:

I found the way to produce right code like this:
html anchor onClick: ((SUModalBox on:  html) show: [:h | h heading:  
'Hello World']); with: 'Show me hello in modal box'

But this doesn't works again. I see the proper source code, but i don't know why it doesn't works. Firebug shows me a problem in ModalBox.js file. It says, that method _init was not found in JS library.. But why code like html anchor onClick: ((SUModalBox on:  html); with: 'Show me hello in modal box' works. So there is not problem in JS library.. Mystic? or i don't know something :)

Cheers, Oleg
Reply | Threaded
Open this post in threaded view
|

Re: ModalBox

Oleg Richards
Found problem: I need to generate Modalbox.show, and my code generates new ModalBox.show(....). This makes a problem.

Oleg Richards wrote
Little more:

I found the way to produce right code like this:
html anchor onClick: ((SUModalBox on:  html) show: [:h | h heading:  
'Hello World']); with: 'Show me hello in modal box'

But this doesn't works again. I see the proper source code, but i don't know why it doesn't works. Firebug shows me a problem in ModalBox.js file. It says, that method _init was not found in JS library.. But why code like html anchor onClick: ((SUModalBox on:  html); with: 'Show me hello in modal box' works. So there is not problem in JS library.. Mystic? or i don't know something :)

Cheers, Oleg
Reply | Threaded
Open this post in threaded view
|

Re: Re: ModalBox

Lukas Renggli
In reply to this post by Oleg Richards
> Lukas, i'm trying to incapsulate a modalbox JS library. You've
> recommended me to use SUEffect as base class. What do you think about
> taking something like Lightbox class as parent?

Well, I thought for SUEffect as the Smalltalk binding to JavaScript.
The Lightbox-Like-Decoration would be a conveniance method to use the
modalbox.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside