@@ -12,38 +12,41 @@ ImageLoader.prototype.findImages = function(nodes) {
1212} ;
1313
1414ImageLoader . prototype . findBackgroundImage = function ( images , container ) {
15- container . parseBackgroundImages ( ) . filter ( this . isImageBackground ) . map ( this . getBackgroundUrl ) . forEach ( this . addImage ( images , this . loadImage ) , this ) ;
15+ container . parseBackgroundImages ( ) . filter ( this . hasImageBackground ) . forEach ( this . addImage ( images , this . loadImage ) , this ) ;
1616 return images ;
1717} ;
1818
1919ImageLoader . prototype . addImage = function ( images , callback ) {
2020 return function ( newImage ) {
2121 if ( ! this . imageExists ( images , newImage ) ) {
2222 images . splice ( 0 , 0 , callback . apply ( this , arguments ) ) ;
23- log ( 'Added image #' + ( images . length ) , newImage . substring ( 0 , 100 ) ) ;
23+ log ( 'Added image #' + ( images . length ) , newImage ) ;
2424 }
2525 } ;
2626} ;
2727
28- ImageLoader . prototype . getBackgroundUrl = function ( imageData ) {
29- return imageData . args [ 0 ] ;
28+ ImageLoader . prototype . hasImageBackground = function ( imageData ) {
29+ return imageData . method !== "none" ;
3030} ;
3131
32- ImageLoader . prototype . isImageBackground = function ( imageData ) {
33- return imageData . method === "url" ;
34- } ;
35-
36- ImageLoader . prototype . loadImage = function ( src ) {
37- if ( src . match ( / d a t a : i m a g e \/ .* ; b a s e 6 4 , / i) ) {
38- return new ImageContainer ( src . replace ( / u r l \( [ ' " ] { 0 , } | [ ' " ] { 0 , } \) $ / ig, '' ) , false ) ;
39- } else if ( this . isSameOrigin ( src ) || this . options . allowTaint === true ) {
40- return new ImageContainer ( src , false ) ;
41- } else if ( this . support . cors && ! this . options . allowTaint && this . options . useCORS ) {
42- return new ImageContainer ( src , true ) ;
43- } else if ( this . options . proxy ) {
44- return new ProxyImageContainer ( src ) ;
45- } else {
46- return new DummyImageContainer ( src ) ;
32+ ImageLoader . prototype . loadImage = function ( imageData ) {
33+ if ( imageData . method === "url" ) {
34+ var src = imageData . args [ 0 ] ;
35+ if ( src . match ( / d a t a : i m a g e \/ .* ; b a s e 6 4 , / i) ) {
36+ return new ImageContainer ( src . replace ( / u r l \( [ ' " ] { 0 , } | [ ' " ] { 0 , } \) $ / ig, '' ) , false ) ;
37+ } else if ( this . isSameOrigin ( src ) || this . options . allowTaint === true ) {
38+ return new ImageContainer ( src , false ) ;
39+ } else if ( this . support . cors && ! this . options . allowTaint && this . options . useCORS ) {
40+ return new ImageContainer ( src , true ) ;
41+ } else if ( this . options . proxy ) {
42+ return new ProxyImageContainer ( src ) ;
43+ } else {
44+ return new DummyImageContainer ( src ) ;
45+ }
46+ } else if ( imageData . method === "linear-gradient" ) {
47+ return new LinearGradientContainer ( imageData ) ;
48+ } else if ( imageData . method === "gradient" ) {
49+ return new WebkitGradientContainer ( imageData ) ;
4750 }
4851} ;
4952
0 commit comments