File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 3
3
*/
4
4
( function ( $ ) {
5
5
$ . fn . html2canvas = function ( options ) {
6
+ if ( options && options . profile && window . console && window . console . profile ) {
7
+ console . profile ( ) ;
8
+ }
6
9
var date = new Date ( ) ,
7
10
$message = null ,
8
11
timeoutTimer = false ,
14
17
$canvas = $ ( html2canvas . Renderer ( queue , options ) ) ,
15
18
finishTime = new Date ( ) ;
16
19
20
+ if ( options && options . profile && window . console && window . console . profileEnd ) {
21
+ console . profileEnd ( ) ;
22
+ }
17
23
$canvas . css ( { position : 'absolute' , left : 0 , top : 0 } ) . appendTo ( document . body ) ;
18
24
$canvas . siblings ( ) . toggle ( ) ;
19
25
20
26
$ ( window ) . click ( function ( ) {
21
- if ( ! $canvas . is ( ':visible' ) ) {
22
27
$canvas . toggle ( ) . siblings ( ) . toggle ( ) ;
23
- throwMessage ( "Canvas Render visible" ) ;
24
- } else {
25
- $canvas . siblings ( ) . toggle ( ) ;
26
- $canvas . toggle ( ) ;
27
- throwMessage ( "Canvas Render hidden" ) ;
28
- }
28
+ throwMessage ( "Canvas Render " + ( $canvas . is ( ':visible' ) ? "visible" : "hidden" ) ) ;
29
29
} ) ;
30
- throwMessage ( 'Screenshot created in ' + ( ( finishTime . getTime ( ) - timer ) / 1000 ) + " seconds <br />" , 4000 ) ;
30
+ throwMessage ( 'Screenshot created in ' + ( ( finishTime . getTime ( ) - timer ) ) + " ms <br />" , 4000 ) ;
31
31
}
32
32
} , options ) ) ;
33
33
36
36
timeoutTimer = window . setTimeout ( function ( ) {
37
37
$message . fadeOut ( function ( ) {
38
38
$message . remove ( ) ;
39
+ $message = null ;
39
40
} ) ;
40
41
} , duration || 2000 ) ;
41
42
if ( $message )
55
56
width :'auto' ,
56
57
height :'auto' ,
57
58
textAlign :'center' ,
58
- textDecoration :'none'
59
- } ) . hide ( ) . fadeIn ( ) . appendTo ( 'body' ) ;
59
+ textDecoration :'none' ,
60
+ display :'none'
61
+ } ) . appendTo ( document . body ) . fadeIn ( ) ;
62
+ html2canvas . log ( msg ) ;
60
63
}
61
64
} ;
62
65
} ) ( jQuery ) ;
Original file line number Diff line number Diff line change 18
18
}
19
19
setTimeout ( function ( ) {
20
20
$ ( document . body ) . html2canvas ( {
21
- logging : true
21
+ logging : true ,
22
+ profile : true
22
23
} ) ;
23
24
} , 100 ) ;
24
25
} ;
25
- } ( document , window ) ) ;
26
+ } ( document , window ) ) ;
You can’t perform that action at this time.
0 commit comments