wp-content/plugins/woocommerce-checkout-manager/includes/pickers/iris/src/iris.js
/**
	* Stupid gradients for a stupid browser.
	*/
Stupid gradients for a stupid browser.
Stupid gradients for a stupid browser .
function stupidIEGradient( origin, stops ) {
		var type, self, lastIndex, filter, startPosProp, endPosProp, dimensionProp, template, html;
		origin = ( origin === 'top' ) ? 'top' : 'left';
		stops = $.isArray( stops ) ? stops : Array.prototype.slice.call( arguments, 1 );
		type = ( origin === 'top' ) ? 0 : 1;
		self = $( this );
		lastIndex = stops.length - 1;
		filter = 'filter';
		startPosProp = ( type === 1 ) ? 'left' : 'top';
		endPosProp = ( type === 1 ) ? 'right' : 'bottom';
		dimensionProp = ( type === 1 ) ? 'height' : 'width';
		template = '<div class="iris-ie-gradient-shim" style="position:absolute;' + dimensionProp + ':100%;' + startPosProp + ':%start%;' + endPosProp + ':%end%;' + filter + ':%filter%;" data-color:"%color%"></div>';
		html = '';
		if ( self.css('position') === 'static' ) {
			self.css( {position: 'relative' } );
		}
		stops = fillColorStops( stops );
		$.each(stops, function( i, startColor ) {
			var endColor, endStop, filterVal;
			if ( i === lastIndex ) {
				return false;
			}
			endColor = stops[ i + 1 ];
			if ( startColor.stop === endColor.stop ) {
				return;
			}
			endStop = 100 - parseFloat( endColor.stop ) + '%';
			startColor.octoHex = new Color( startColor.color ).toIEOctoHex();
			endColor.octoHex = new Color( endColor.color ).toIEOctoHex();
			filterVal = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=' + type + ', StartColorStr=\'' + startColor.octoHex + '\', EndColorStr=\'' + endColor.octoHex + '\')';
			html += template.replace( '%start%', startColor.stop ).replace( '%end%', endStop ).replace( '%filter%', filterVal );
		});
		self.find( '.iris-ie-gradient-shim' ).remove();
		$( html ).prependTo( self );
	}
function stupidIEGradient ( origin , stops ) { var type , self , lastIndex , filter , startPosProp , endPosProp , dimensionProp , template , html ; origin = ( origin === 'top' ) ? 'top' : 'left' ; stops = $ . isArray ( stops ) ? stops : Array . prototype . slice . call ( arguments , 1 ) ; type = ( origin === 'top' ) ? 0 : 1 ; self = $ ( this ) ; lastIndex = stops . length - 1 ; filter = 'filter' ; startPosProp = ( type === 1 ) ? 'left' : 'top' ; endPosProp = ( type === 1 ) ? 'right' : 'bottom' ; dimensionProp = ( type === 1 ) ? 'height' : 'width' ; template = '<div class="iris-ie-gradient-shim" style="position:absolute;' + dimensionProp + ':100%;' + startPosProp + ':%start%;' + endPosProp + ':%end%;' + filter + ':%filter%;" data-color:"%color%"></div>' ; html = '' ; if ( self . css ( 'position' ) === 'static' ) { self . css ( { position : 'relative' } ) ; } stops = fillColorStops ( stops ) ; $ . each ( stops , function ( i , startColor ) { var endColor , endStop , filterVal ; if ( i === lastIndex ) { return false ; } endColor = stops [ i + 1 ] ; if ( startColor . stop === endColor . stop ) { return ; } endStop = 100 - parseFloat ( endColor . stop ) + '%' ; startColor . octoHex = new Color ( startColor . color ) . toIEOctoHex ( ) ; endColor . octoHex = new Color ( endColor . color ) . toIEOctoHex ( ) ; filterVal = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=' + type + ', StartColorStr=\'' + startColor . octoHex + '\', EndColorStr=\'' + endColor . octoHex + '\')' ; html += template . replace ( '%start%' , startColor . stop ) . replace ( '%end%' , endStop ) . replace ( '%filter%' , filterVal ) ; } ) ; self . find ( '.iris-ie-gradient-shim' ) . remove ( ) ; $ ( html ) . prependTo ( self ) ; }
Stupid gradients for a stupid browser.
Stupid gradients for a stupid browser .
// 8 hex: AARRGGBB // GradientType: 0 vertical, 1 horizontal // need a positioning context // we want two at a time. if we're on the last pair, bail. //if our pairs are at the same color stop, moving along.