Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
Clukey #1
Calling function if the site changes
I am making an extension that gets information from the current site, so if you
change the selected site the extension must refresh it's content, is there any
way to call a function when the current site changes? Thanks.
Clukey Guest
-
Calling a function within a function registered to an event
Hey, Just registered and tried to search through the forum for a solution to my problem, but I haven't found anything that could help me. I've... -
Function calling from url
Good morning! I would like to call a function from a <FORM>'s ACTION attribute. This is what I'm trying to do: <FORM... -
[PHP] Function calling from url
> I would like to call a function from a <FORM>'s ACTION attribute. This Well, you're not going to call a function that way, but you will submit... -
Function/Global var to return name of calling function?
I'm sure I saw this somewhere but can't remember where and can't find it now... Is there a PHP function or global variable that will return name... -
calling c function from php app
Did you get vertex tax integrated? I am trying to implement that for a client right now. Any help would be great. Thanks, Chris ... -
T.Pastrana - 4Level #2
Re: Calling function if the site changes
The user can not change sites in the sites panel if the extension UI is open
so whenever the extension UI is opened it should get the current sites info.
If you are changing the site from within your extension code you can
re-initialize your functions that get the info after the site has been
changed.
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"Clukey" <webforumsuser@macromedia.com> wrote in message
news:drc0ib$a56$1@forums.macromedia.com...>I am making an extension that gets information from the current site, so if
>you
> change the selected site the extension must refresh it's content, is there
> any
> way to call a function when the current site changes? Thanks.
>
T.Pastrana - 4Level Guest
-
Clukey #3
Re: Calling function if the site changes
I do not want to change the site information, I just want my extension to realize, then call a function, when the sites panel changes sites. Thanks
Clukey Guest
-
T.Pastrana - 4Level #4
Re: Calling function if the site changes
What kind of extension are you building? Does it have a launchable interface
from which to make selections?
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"Clukey" <webforumsuser@macromedia.com> wrote in message
news:dret54$63u$1@forums.macromedia.com...>I do not want to change the site information, I just want my extension to
>realize, then call a function, when the sites panel changes sites. Thanks
T.Pastrana - 4Level Guest
-
Clukey #5
Re: Calling function if the site changes
I'm making a floater that has a list of specific files from the current site, so when the site changes I need to refresh the list of files.
Clukey Guest
-
T.Pastrana - 4Level #6
Re: Calling function if the site changes
Clukey,
You can't capture when a user actually changes the site selection but you
can look to see if the site "has been changed". Since your using a Floater
you can use the selectionChanged() function that will take an action
whenever focus switches to a new document or the cursor moves to a new
location of the open document.
Knowing this you can set a global variable when the floater is initialized.
This global var will be the current site that is open. The
selectionChanged() function will check to see if the site that was defined
matches the actual site selected and do 1 of 2 things...
[1] Take action if the site "has been changed"
or
[2] Do nothing if it is the same ( return )
Here is the code that will do this for you... Note however that you must
initialize the global var when the floater is launched so you need to use
the setCurrentSite(); on an onload event of the body of the Floater HTML
document.
<body onLoad="setCurrentSite()">
var gCurrentSite;
function setCurrentSite(){
var siteList = site.getSites();
if(siteList.length > 0){
gCurrentSite = site.getCurrentSite();
}
}
function selectionChanged(){
if(site.getCurrentSite() == gCurrentSite){
return
}else{
setCurrentSite();
// reinitialize your floater here //
}
}
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"Clukey" <webforumsuser@macromedia.com> wrote in message
news:drg4d4$kk0$1@forums.macromedia.com...> I'm making a floater that has a list of specific files from the current
> site, so when the site changes I need to refresh the list of files.
T.Pastrana - 4Level Guest
-
T.Pastrana - 4Level #7
Re: Calling function if the site changes
I should have stated that the onLoad event is optional. It really isn't
needed since you are using the selectionChanged() function which initiates
automatically.
<body onLoad="setCurrentSite()">
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
T.Pastrana - 4Level Guest
-



Reply With Quote

