@@ -89,33 +89,44 @@ var ImageDiff = React.createClass({
8989 } ) ;
9090 var diffBoxEnabled = isSameSizeImagePair ( pair ) ;
9191 var boxClasses = diffBoxEnabled ? '' : 'diff-box-disabled' ;
92+ var boxStyles = { display : HAS_IMAGE_MAGICK ? '' : 'none' } ;
93+ var imageMagickCallout = ! HAS_IMAGE_MAGICK ? (
94+ < span className = "magick" > Install{ ' ' }
95+ < a href = "http://www.imagemagick.org/script/binary-releases.php" > ImageMagick</ a > { ' ' }
96+ to see perceptual diffs</ span >
97+ ) : null ;
9298
9399 return < div >
94100 < div className = "image-diff-controls" >
95101 < ImageDiffModeSelector { ...this . props } />
96102 < input type = "checkbox" id = "shrink-to-fit" checked = { this . state . shrinkToFit } onChange = { this . toggleShrinkToFit } />
97103 < label htmlFor = "shrink-to-fit" > Shrink to fit</ label >
98104
99- < span className = { boxClasses } >
100- Perceptual Diff:
101- < input type = "radio" name = "pdiff-mode"
102- id = "pdiff-off"
103- checked = { this . props . pdiffMode == PDIFF_MODE . OFF }
104- disabled = { ! diffBoxEnabled }
105- onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . OFF ) } />
106- < label htmlFor = "pdiff-off" > None</ label >
107- < input type = "radio" name = "pdiff-mode"
108- id = "pdiff-bbox"
109- checked = { this . props . pdiffMode == PDIFF_MODE . BBOX }
110- disabled = { ! diffBoxEnabled }
111- onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . BBOX ) } />
112- < label htmlFor = "pdiff-bbox" > Box</ label >
113- < input type = "radio" name = "pdiff-mode"
114- id = "pdiff-pixels"
115- checked = { this . props . pdiffMode == PDIFF_MODE . PIXELS }
116- disabled = { ! diffBoxEnabled }
117- onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . PIXELS ) } />
118- < label htmlFor = "pdiff-pixels" > Differing Pixels</ label >
105+ < span className = "pdiff-options" >
106+ < span className = { boxClasses } style = { boxStyles } >
107+ Perceptual Diff:
108+ < input type = "radio" name = "pdiff-mode"
109+ id = "pdiff-off"
110+ checked = { this . props . pdiffMode == PDIFF_MODE . OFF }
111+ disabled = { ! diffBoxEnabled }
112+ onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . OFF ) } />
113+ < label htmlFor = "pdiff-off" > None</ label >
114+
115+ < input type = "radio" name = "pdiff-mode"
116+ id = "pdiff-bbox"
117+ checked = { this . props . pdiffMode == PDIFF_MODE . BBOX }
118+ disabled = { ! diffBoxEnabled }
119+ onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . BBOX ) } />
120+ < label htmlFor = "pdiff-bbox" > Box</ label >
121+
122+ < input type = "radio" name = "pdiff-mode"
123+ id = "pdiff-pixels"
124+ checked = { this . props . pdiffMode == PDIFF_MODE . PIXELS }
125+ disabled = { ! diffBoxEnabled }
126+ onChange = { ( ) => this . setPdiffMode ( PDIFF_MODE . PIXELS ) } />
127+ < label htmlFor = "pdiff-pixels" > Differing Pixels</ label >
128+ </ span >
129+ { imageMagickCallout }
119130 </ span >
120131 </ div >
121132 < div className = { 'image-diff ' + mode } >
0 commit comments