tasks/responsive_images.js
function(properties, options) {
    var widthUnit = '',
      heightUnit = '';

    // name takes precedence
    if (properties.name) {
      return properties.name;
    } else {
      // figure out the units for width and height (they can be different)
      widthUnit = ((properties.width || 0).toString().indexOf('%') > 0) ? options.units.percentage : options.units.pixel;
      heightUnit = ((properties.height || 0 ).toString().indexOf('%') > 0) ? options.units.percentage : options.units.pixel;

      if (properties.width && properties.height) {
        return parseFloat(properties.width) + widthUnit + options.units.multiply + parseFloat(properties.height) + heightUnit;
      } else {
        return (properties.width) ? parseFloat(properties.width) + widthUnit : parseFloat(properties.height) + heightUnit;
      }
    }
  }
function(properties, options) {
    var widthUnit = '',
      heightUnit = '';

    // name takes precedence
    if (properties.name) {
      return properties.name;
    } else {
      // figure out the units for width and height (they can be different)
      widthUnit = ((properties.width || 0).toString().indexOf('%') > 0) ? options.units.percentage : options.units.pixel;
      heightUnit = ((properties.height || 0 ).toString().indexOf('%') > 0) ? options.units.percentage : options.units.pixel;

      if (properties.width && properties.height) {
        return parseFloat(properties.width) + widthUnit + options.units.multiply + parseFloat(properties.height) + heightUnit;
      } else {
        return (properties.width) ? parseFloat(properties.width) + widthUnit : parseFloat(properties.height) + heightUnit;
      }
    }
  }
function ( properties , options ) { var widthUnit = '' , heightUnit = '' ; // name takes precedence if ( properties . name ) { return properties . name ; } else { // figure out the units for width and height (they can be different) widthUnit = ( ( properties . width || 0 ) . toString ( ) . indexOf ( '%' ) > 0 ) ? options . units . percentage : options . units . pixel ; heightUnit = ( ( properties . height || 0 ) . toString ( ) . indexOf ( '%' ) > 0 ) ? options . units . percentage : options . units . pixel ; if ( properties . width && properties . height ) { return parseFloat ( properties . width ) + widthUnit + options . units . multiply + parseFloat ( properties . height ) + heightUnit ; } else { return ( properties . width ) ? parseFloat ( properties . width ) + widthUnit : parseFloat ( properties . height ) + heightUnit ; } } }
Create a name to suffix to our file.

@private
@param   {object}          properties Contains properties for name, width, height (where applicable)
@return  {string}          A new name
Create a name to suffix to our file .