home *** CD-ROM | disk | FTP | other *** search
- //
- // Copyright 1999, 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
- // ----------------------------------------------------
- //
- // Accessibility.js
- //
- // This command adds
- //
- //
- // Version 1.0
- // Added functions...
- // ----------------------------------------------------
-
- var helpDoc = MM.HELP_objCCImageAccessOptions;
- var golbalFormItem;
- var returnTag='';
- var isCanceled=false;
-
- function isDOMRequired() {
- // Return false, indicating that this object is available in code view.
- return false;
- }
-
- function commandButtons(){
- return new Array( "PutButtonsOnBottom",
- "OkButton", MM.BTN_OK, "if (setImageStr()) {isCanceled=false; window.close();}",
- "CancelButton", MM.BTN_Cancel, "isCanceled=true; window.close();",
- "PutButtonOnLeft", MM.BTN_Help, "displayHelp()");
-
-
- }
-
- function setFormItem(formItem) {
- globalFormItem = formItem;
- returnTag = globalFormItem;
- }
-
- function setImageStr()
- {
- var rtnStr='';
-
-
- rtnStr= globalFormItem;
-
-
- ////////////////////////////////////////////////////////////////
- // Attributes: Compose rtnStr with the attributes that have a value
- // Possible attributes are: alt and longdesc
-
-
- // if 'alt attribute' has a value, apply it to the initStr
-
- altValue=document.forms[0].alt.value;
- if ((altValue == null) || (altValue == "") )
- {
- var alertString = dw.loadString ("ccImageOptions/altText");
- alert (alertString);
- return false;
- }
- rtnStr= addAttribute("alt", altValue, rtnStr);
- returnTag= rtnStr;
- return true;
- }
-
- function returnAccessibilityStr ()
- {
- if (isCanceled)
- return "";
- return returnTag;
- }
-
- ///////////////////////////////////////////////////////////////
- // other functions
- //////////////////////////////////////////////////////////////
-
-
- function addAttribute(tagName, tagVal, initStr){
-
- arrayElem= initStr.split(">");
- rtnStr= arrayElem[0] + " " + tagName + "=" + '\"' + tagVal + '\"' + ">" + arrayElem[1];
-
- return rtnStr;
- }
-
-
- function getImageSrc(tagStr){
-
- arrayElements= tagStr.split("src=\"");
- arrayStrings= arrayElements[1].split("\"");
- src= arrayStrings[0];
- return src;
- }
-
-
-