rem: isPercentWidth = (dialog.widthUnitsSelect.selectedIndex == 1); isPercentHeight = (dialog.heightUnitsSelect.selectedIndex == 1); 
add: isPercentWidth = (dialog.widthUnitsMenulist.selectedIndex == 1); isPercentHeight = (dialog.heightUnitsMenulist.selectedIndex == 1); 
context: function ValidateData(){  if ( !IsValidImage(dialog.srcInput.value )) {    ShowInputErrorMessage(GetString("MissingImageError"));    return false;  }  //TODO: WE NEED TO DO SOME URL VALIDATION HERE, E.G.:  // We must convert to "file:///" or "http://" format else image doesn't load!  var src = dialog.srcInput.value.trimString();  globalElement.setAttribute("src", src);    // TODO: Should we confirm with user if no alt tag? Or just set to empty string?  var alt = dialog.altTextInput.value.trimString();  globalElement.setAttribute("alt", alt);    //TODO: WE SHOULD ALWAYS SET WIDTH AND HEIGHT FOR FASTER IMAGE LAYOUT  //  IF USER DOESN'T SET IT, WE NEED TO GET VALUE FROM ORIGINAL IMAGE     var width = "";  var height = "";  var isPercentWidth, isPercentHeight;  var maxLimitWidth, maxLimitHeight;  if ( SeeMore )  {    dialog.isCustomSize = dialog.customsizeRadio.checked;		isPercentWidth = (dialog.widthUnitsSelect.selectedIndex == 1);		isPercentHeight = (dialog.heightUnitsSelect.selectedIndex == 1);		width = dialog.widthInput.value;		height = dialog.heightInput.value;  }  else /* can't SeeMore */  {    var tailindex;        width = globalElement.getAttribute( "width" );        tailindex = width.lastIndexOf("%");     isPercentWidth = ( tailindex > 0 );    if ( isPercentWidth )      width = width.substring(0, tailindex);        height = globalElement.getAttribute( "height" );    tailindex = height.lastIndexOf("%");     isPercentHeight = ( tailindex > 0 );    if ( isPercentHeight )      height = height.substring(0, tailindex);  }  if ( dialog.isCustomSize )  {	  maxLimitWidth = isPercentWidth ? 100 : maxPixels;  // Defined in EdDialogCommon.js    width = ValidateNumberString(width, 1, maxLimitWidth);    if (width == "") {      if ( !SeeMore )        onMoreFewerImage();      dialog.widthInput.focus();      return false;    }    if (isPercentWidth)      width = width + "%";	  maxLimitHeight = isPercentHeight ? 100 : maxPixels;  // Defined in EdDialogCommon.js    height = ValidateNumberString(height, 1, maxLimitHeight);    if (height == "") {      if ( !SeeMore )        onMoreFewerImage();      dialog.heightInput.focus();      return false;    }    if (isPercentHeight)      height = height + "%";  }  if ( !dialog.isCustomSize )  {  // for now (until we can get the actual image dimensions), clear the height/width attributes if not set    globalElement.removeAttribute( "width" );    globalElement.removeAttribute( "height" );  }  else  {	  if (width.length > 0)	    globalElement.setAttribute("width", width);	  if (height.length > 0)	    globalElement.setAttribute("height", height);  }  // spacing attributes  // All of these should use ValidateNumberString() to   //  ensure value is within acceptable range  var amount;  if ( SeeMore )  {	  if ( dialog.imagelrInput.value.length > 0 )	  {	    amount = ValidateNumberString(dialog.imagelrInput.value, 0, maxPixels);	    if (amount == "")	      return false;      globalElement.setAttribute( "hspace", amount );    }    else      globalElement.removeAttribute( "hspace" );	  if ( dialog.imagetbInput.value.length > 0 )	  {	    var vspace = ValidateNumberString(dialog.imagetbInput.value, 0, maxPixels);	    if (vspace == "")	      return false;	    globalElement.setAttribute( "vspace", vspace );	  }	  else	    globalElement.removeAttribute( "vspace" );  // note this is deprecated and should be converted to stylesheets	  if ( dialog.border.value.length > 0 )	  {	    var border = ValidateNumberString(dialog.border.value, 0, maxPixels);	    if (border == "")	      return false;	    globalElement.setAttribute( "border", border );	  }	  else	    globalElement.removeAttribute( "border" );  	  // Default or setting "bottom" means don't set the attribute    // Note that the attributes "left" and "right" are opposite    //  of what we use in the UI, which describes where the TEXT wraps,    //  not the image location (which is what the HTML describes)	  var align = "";	  switch ( dialog.alignTypeSelect.selectedIndex )	  {	    case 0:	      align = "top";	      break;	    case 1:	      align = "center";	      break;	    case 3:	      align = "right";	      break;	    case 4:	      align = "left";	      break;	  }	  if (align == "")	    globalElement.removeAttribute( "align" );	  else	    globalElement.setAttribute( "align", align );  }  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d5c3bc9965443e2d1721a87cd00b4c6cb12ec93d/EdImageProps.js/clean/editor/ui/dialogs/content/EdImageProps.js