Javascript and Freeway 5 Pro

Hi,

I was hoping someone could give me a short tutorial of description on how to include an external js file at the top of the page that might be used when a user clicks on a button within the web site?

Basically want to know the steps as to how/where to include javascript as well as onclick= function calls within a page.

Thanks.
Tony.


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

a) Adding external files to your site:

Once added to a FW page, it will allow you to specify a javascipt file and add the appropriate < script src="…" > tag. That is really the extend of actually adding the file.

b) Depending on the file being added, there may be a few different methods to accomplish your goal. the simplest is by coding the onclick event directly inside FW. So, where you want the onclick attached (an image, text, etc…), simply follow the same steps you would to add a hyperlink. Then in the hyperlink dialog, under the External tab you would probably want to enter the pound sign: ‘#’. Then press the ‘Extended…’ button and add your onclick code there:

Name = onclick

Value = myFunction(); return false;

Now, there are schools of thought that say this is bad form and to be avoided like the plague. It is not horribly wrong, just not ideal. For your first foray into JS, don’t get hung up on this just yet. As you become more familiar with JS, you will understand how and why alternative methods are preferred.

For instance, with prototype/mootools/jQuery/etc… you can actually define the same command you added manually in the hyperlink dialog, via JavaScript. This leaves the actual html code clean of JS, better following a content/style separation, and also allowing for more complex behaviors.

Please share if you are using such a JS framework.

Notice the 'return false; part? You are likely to want this command present. It tells the browser to stop after it has finished with the actual function defined in the onclick event. Otherwise what happens is the browser executes the JS, then follows with the normal href portion of the hyperlink. (sometimes you want this to happen, most times not). the normal operation of a hyperlink is to, first execute any JS (i.e. onclick), then follow the hyperlink as if it had no JS attached.

Since FW does not really do anything for you, that is to say it does what you tell it and provides a pretty face with which to interact, a basic understanding of JS and the hows and whys comes in handy.

Try this page: http://www.w3schools.com/JS/default.asp

JS is unforgiving in its execution. A wrong character or missing punctuation can easily cause all the scripts on the page to fail, very frustrating when still learning. In contrast, html is very forgiving, even showing pages that are grossly mal-formed.


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

Hi,

As I am a complete newbie to Freeway 5 pro, how do I actually install this External Javascript Action into Freeway 5 pro, so that I can use it ?

And just further on this, is there any doco on how to install Actions - just to make sure that I am installing them properly?

Thanks.
Tony.


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

Hi Tony,

Take a look here:

Joe

On 7 May 2008, at 00:59, Tonsils wrote:

Hi,

As I am a complete newbie to Freeway 5 pro, how do I actually
install this External Javascript Action into Freeway 5 pro, so that
I can use it ?

And just further on this, is there any doco on how to install
Actions - just to make sure that I am installing them properly?

Thanks.
Tony.


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

Thanks Joe.

Just installed it by going into FW 5 Pro then Edit > Actions > Install Actions but unfortunately don’t see it under the Actions menu.

Seems to be in ~username/Library/Application Support/Freeway/Actions folder but not sure where it is ?

Any ideas?

Thanks.


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

Is it not in the Page>Page Actions menu?

Joe

On 7 May 2008, at 16:31, Tonsils wrote:

Thanks Joe.

Just installed it by going into FW 5 Pro then Edit > Actions >
Install Actions but unfortunately don’t see it under the Actions menu.

Seems to be in ~username/Library/Application Support/Freeway/Actions
folder but not sure where it is ?

Any ideas?

Thanks.


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

I am trying to use this javascript that was mention a couple articles ago…here is the link

http://www.cabel.name/draft1/2008/02/fancyzoom-10.html

I can’t seem to get it to work. I am using the freeway action to include the scripts on upload and tried to follow the above instructions the best I can but still nothing. Anyone have an idea?


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

Could you please post a link to your efforts? It would be useful to
look at your site in Firebug and see if it’s generating any errors.

Walter

On May 7, 2008, at 1:51 PM, MichaelBstrauss wrote:

I can’t seem to get it to work. I am using the freeway action to
include the scripts on upload and tried to follow the above
instructions the best I can but still nothing. Anyone have an idea?


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

Michael,

I experimented with it and did get it to work. However, I did have to remove other javascripts that conflicted with it to do so.

Did you try directly uploading the javascript with an ftp program? Make sure you put the code “After Head” with the page HTML Markup option. Then put the “onload” code on your page by inserting a Markup Item and pasting the code in.


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

Thanks for the quick responses, here is the test page…

http://straussdesigns.com/untitled.html

Its a blank page so, there is no other javascripts there and i did put the scripts “after head” with the page html markup. I then added a hyperlink to the image. went to the external tab, chose javascript:, then clicked extended and added

name: onclick
value: onload=“setupZomm()”

This is where I think i am doing something wrong, thanks for any and all advice.


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

You are, but you are very close. In your link, you have mashed
together two separate javascript events, one calling the other in
effect. It won’t work at all like this.

Start with the page onload event. With nothing on your page selected,
choose Page > Extended from the main menu. Click on New, then enter:

onload
setupZoom()

in the Name and Value fields. Okay the dialog, and then move to your
linked image. Click on the image, then choose Edit > Hyperlink from
the main menu (or press Apple-K).

Click on the Extended button and delete whatever you have there. You
don’t need anything in Extended for this link.

In the URL part of the link, enter a path to your full-size image.
This should be Resources/fullsize.jpeg or whatever your full-size
image is. This does not need to be javascript: as you have it now.

That’s it. Publish and test.

Walter

On May 7, 2008, at 2:20 PM, MichaelBstrauss wrote:

Thanks for the quick responses, here is the test page…

http://straussdesigns.com/untitled.html

Its a blank page so, there is no other javascripts there and i did
put the scripts “after head” with the page html markup. I then
added a hyperlink to the image. went to the external tab, chose
javascript:, then clicked extended and added

name: onclick
value: onload=“setupZomm()”

This is where I think i am doing something wrong, thanks for any
and all advice.


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

Walter,

Thanks! That did it! works great. Another great thing about this script is that it actually works well on the iphone since the iphone doesn’t support flash. I have been looking for a gallery alternatives.

One more thing…how do add a title to each once its clicked, they show examples of it on the script page.


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

The text is whatever you put in as the title tag of the link wrapped
around the thumbnail image. You add that in the Hyperlink dialog,
right below the URL.

Walter

On May 7, 2008, at 2:50 PM, MichaelBstrauss wrote:

Walter,

Thanks! That did it! works great. Another great thing about this
script is that it actually works well on the iphone since the
iphone doesn’t support flash. I have been looking for a gallery
alternatives.

One more thing…how do add a title to each once its clicked, they
show examples of it on the script page.


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

Thanks, that was real easy!


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

That’s the whole point of unobtrusive JavaScript. When you have to go
through your page, clicking n everything, and adding onclick events
to everything, you are not only junking up your code and making it
harder for screen readers to make sense of, you are also wasting a
lot of time. Better all around to do something once, in the head of
the page!

Walter

On May 7, 2008, at 2:58 PM, MichaelBstrauss wrote:

Thanks, that was real easy!


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

I have a menu with 6 header out of which only the 2nd and 3rd headers have submenus to display. My problem is that for some reason the first header triggers the action of the 2nd header. The second and third headers work as they are meant to as are the remaining 3 header that display nothing (and also don’t trigger actions like the first one).
Any thoughts/fix to this?
I can provide the source code if that helps anyone…
Thanks in advance!


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

A link would help, are you using the CSS Menus Action to build this menu?

Walter

On May 3, 2012, at 7:46 AM, adellas wrote:

I have a menu with 6 header out of which only the 2nd and 3rd headers have submenus to display. My problem is that for some reason the first header triggers the action of the 2nd header. The second and third headers work as they are meant to as are the remaining 3 header that display nothing (and also don’t trigger actions like the first one).
Any thoughts/fix to this?
I can provide the source code if that helps anyone…
Thanks in advance!


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

I’m sorry but It seems like I posted in the wrong thread… I was reading an older post of yours describing Protaculous to someone… not sure how this happened.
You had provided them with a link and a zip file which I also used.
Below is the link to the website I’m trying to build.

http://www.advocati.gr/test.html

thank you and sorry about the mix up!


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

Try using the ScriptyAccordion Action instead of all the custom code. That fixes this issue with the wrong target being assigned, because it uses a different technique.

Walter

On May 3, 2012, at 11:59 AM, adellas wrote:

I’m sorry but It seems like I posted in the wrong thread… I was reading an older post of yours describing Protaculous to someone… not sure how this happened.
You had provided them with a link and a zip file which I also used.
Below is the link to the website I’m trying to build.

http://www.advocati.gr/test.html

thank you and sorry about the mix up!


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

Does the ScriptyAccordion Action do the same thing? Can I set it to hover/show submenu or is it only click/show?


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