I think the JavaScript is just to insert some default values into the
behaviour for the current date, file etc.

The manual has a section on extending DW at
http://www.macromedia.com/livedocs/dreamweaver/mx2004/extending/wwhelp/wwhim
pl/js/html/wwhelp.htm but good luck with it; it could take days to work
through that.

There is supposed to be some guides on building extensions available on the
Dreamweaver Exchange but I have never found them, but then again I find the
exchange to be about as usable as 10 foot chopsticks, so they could be there
somewhere :)

-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED] 
Sent: 12 November 2004 01:12
To: CF-Community
Subject: RE: ServerBehaviours in Dreamweaver (Two monitors are so NICE!)

Mm..that was a simple example, but it seems that basically you create server
behaviours using Javascript.
That's what they're written in. 
:-\
I don't think I know enough javascript to be able to do the kinds of stuff I
want to do..
This is the javascript that you are mysteriously supposed to 'know' to add
to the server behaviour file which Dreamweaver generates:
function defaultFields(){
                var tmpDate = new Date();
                var defaultDate = (tmpDate.getMonth() + 1) + '/' +
tmpDate.getDate() + '/'
+tmpDate.toString().substr(tmpDate.toString().length - 4, 4);
                var tmpSiteLen = dreamweaver.getSiteRoot().length;
                var tmpFilePath = dreamweaver.getDocumentPath("document");
                var tmpPath = tmpFilePath.substr(tmpSiteLen,
tmpFilePath.length - tmpSiteLen);
                var aPath = tmpPath.split("/");
                var defaultFile = "";
                var defaultSection = "";
                
                if (aPath.length == 1){
                        defaultSection = "root";
                } else{
                        for (i = 0; i < aPath.length - 1; i++){
                                defaultSection += aPath[i] + "/";       
                        }
                        defaultSection = defaultSection.substr(0,
defaultSection.length - 1);     
                }
                defaultFile = aPath[aPath.length - 1];
                document.forms[0].createdate.value = defaultDate;
                document.forms[0].filename.value = defaultFile;
                document.forms[0].appsection.value = defaultSection;
        }
-Gel 



-----Original Message-----
From: Wayne Putterill 

Buried away in the MM site is this:
http://www.macromedia.com/devnet/mx/dreamweaver/articles/server_behaviors.ht
ml

Looks reasonably simple to create server behaviours, although I have a
feeling it may be more complex when you try to do it
yourself.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:5:135615
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to