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:135601
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