Trigger for move action revisited...

Hello Walter,
I am intrigued and interested to follow this through if I can.
Is there any guidance you can point me toward that may allow me to achieve the end effect I’m after.
I guess I need a better understanding of the protaculous action among other things to get on with.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Protaculous is just a gateway drug to hand-coding JavaScript in Freeway. It allows you to attach the Prototype and Scriptaculous libraries to the page in a manner that will cooperate with the built-in FX Actions, and then gives you some text boxes to type your script in long-hand.

If you can find a script somewhere that works with those libraries (and the links to the Scriptaculous documentation wiki are a good starting point for that) then post a link to what you want to do and I can help you translate it.

Walter

On Nov 25, 2012, at 1:12 PM, tonzodehoo wrote:

Hello Walter,
I am intrigued and interested to follow this through if I can.
Is there any guidance you can point me toward that may allow me to achieve the end effect I’m after.
I guess I need a better understanding of the protaculous action among other things to get on with.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s a horizontal scaling effect using Protaculous and Freeway 5.5:

http://scripty.walterdavisstudio.com/toggle-sideways.html

Click the yellow box to make the red box shrink and grow. This is a tiny blob of JavaScript, and it’s specific to this page (you’d need to change the IDs to match your page elements) but it’s really very simple.

var red = $('item1').store('width', $('item1').getWidth());
$('item2').observe('click', function(evt){
  if(red.getWidth() < red.retrieve('width')){
    red.morph('width: ' + red.retrieve('width') + 'px', {duration: 0.4});
  }else{
    red.morph('width: 0', {duration: 0.4});
  }
}).setStyle('cursor:pointer');

First line gets a reference to the red box (which has the ID item1) and then causes it to remember its original width so you can restore it later. Second line through the end is the observer function that watches for a click on the yellow box. Third line checks to see if the box has already been scaled left. If it has, it restores the original width (line 4). If not (line 5), it scales the box down to nothing (line 6). The last line adds a pointer cursor to the yellow box, just so you know it’s clickable.

Walter

On Nov 25, 2012, at 2:12 PM, Walter Lee Davis wrote:

Protaculous is just a gateway drug to hand-coding JavaScript in Freeway. It allows you to attach the Prototype and Scriptaculous libraries to the page in a manner that will cooperate with the built-in FX Actions, and then gives you some text boxes to type your script in long-hand.

If you can find a script somewhere that works with those libraries (and the links to the Scriptaculous documentation wiki are a good starting point for that) then post a link to what you want to do and I can help you translate it.

Walter

On Nov 25, 2012, at 1:12 PM, tonzodehoo wrote:

Hello Walter,
I am intrigued and interested to follow this through if I can.
Is there any guidance you can point me toward that may allow me to achieve the end effect I’m after.
I guess I need a better understanding of the protaculous action among other things to get on with.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thats excellent.
I’d been digging through the scriptaculous library looking for something to work with and try out.
I think I shall be trying out some of the other scripts which offer some quite exciting possibilities.
I’ll work at customising and styling the script you’ve put together and try to learn a bit from it.
Many thanks. I think the word I’d use is inspiring!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This got a little messed up by the formatter here. So here’s a Gist of the code:

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks again for this.
I’m waiting on content from the organisation who’s website I am working on.
Once I have this then I shall be making some use of this.

Its been a bit of a crash course in understanding the use of java scripts but I am excited at the possibilites.

I’ve been trying out a few scripts which are opening up a range of possibilities which sometimes raise more questions for me.

The one that comes to mind for this script is to find a way to relate it to other scripts on the page so that by closing or opening oneslider that another would be triggered open and then be able to build a sequence of such opening and closing sliders.

Any thoughts at all


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The scripts inserted by the various FX Actions are very insular – it’s hard to imagine how I would reach inside them and get them to do anything besides what they do already. I don’t believe there’s a way to take these scripts the way they are written and tell them to do anything from outside themselves. You could piggy-back on them somehow – add a classname to the elements in your group, for example, and then listen separately at the page level for a click on any element with that classname and do something else. But if those Actions do anything internally to track their state (a flag saying “I am open” or “I am hidden”), that flag would not be toggled by the external script, so the effect could get out of synch. It becomes a bit of a detective game to figure out a way to have two things happen at once when one has no idea what the other is doing.

I have looked at the way these scripts are generated within the FX Actions, and they have been written in a very modular manner. On the one hand, this makes perfect sense for the author – more maintainable, less code means less occasions for errors – but on the other, it means that the individual effects have only the most common of controls possible. There are settings in the Scriptaculous API (Application Programming Interface) that are not exposed by the Action controls; some of these could be useful, especially in combination.

That’s why if things get even a little bit complicated, my first instinct is to go right to the “metal” with the Protaculous Action. It does require that you type (or paste) some very cryptic code into its dialog, but in so doing, it exposes the geek-level interface of the full API, so you get to use all the crayons in the box.

Walter

On Dec 4, 2012, at 9:37 AM, tonzodehoo wrote:

Thanks again for this.
I’m waiting on content from the organisation who’s website I am working on.
Once I have this then I shall be making some use of this.

Its been a bit of a crash course in understanding the use of java scripts but I am excited at the possibilites.

I’ve been trying out a few scripts which are opening up a range of possibilities which sometimes raise more questions for me.

The one that comes to mind for this script is to find a way to relate it to other scripts on the page so that by closing or opening oneslider that another would be triggered open and then be able to build a sequence of such opening and closing sliders.

Any thoughts at all


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options