12
12
13
13
*/
14
14
15
- $ . extend ( $ . infinitescroll . prototype , {
16
-
17
- _setup_twitter : function infscr_setup_twitter ( ) {
18
- var opts = this . options ,
19
- instance = this ;
20
-
21
- // Bind nextSelector link to retrieve
22
- $ ( opts . nextSelector ) . click ( function ( e ) {
23
- if ( e . which == 1 && ! e . metaKey && ! e . shiftKey ) {
24
- e . preventDefault ( ) ;
25
- instance . retrieve ( ) ;
15
+ ( function ( $ , undefined ) {
16
+ $ . extend ( $ . infinitescroll . prototype , {
17
+
18
+ _setup_twitter : function infscr_setup_twitter ( ) {
19
+ var opts = this . options ,
20
+ instance = this ;
21
+
22
+ // Bind nextSelector link to retrieve
23
+ $ ( opts . nextSelector ) . click ( function ( e ) {
24
+ if ( e . which == 1 && ! e . metaKey && ! e . shiftKey ) {
25
+ e . preventDefault ( ) ;
26
+ instance . retrieve ( ) ;
27
+ }
28
+ } ) ;
29
+
30
+ // Define loadingStart to never hide pager
31
+ instance . options . loading . start = function ( opts ) {
32
+ opts . loading . msg
33
+ . appendTo ( opts . loading . selector )
34
+ . show ( opts . loading . speed , function ( ) {
35
+ instance . beginAjax ( opts ) ;
36
+ } ) ;
26
37
}
27
- } ) ;
28
-
29
- // Define loadingStart to never hide pager
30
- instance . options . loading . start = function ( opts ) {
38
+ } ,
39
+ _showdonemsg_twitter : function infscr_showdonemsg_twitter ( ) {
40
+ var opts = this . options ,
41
+ instance = this ;
42
+
43
+ //Do all the usual stuff
31
44
opts . loading . msg
32
- . appendTo ( opts . loading . selector )
33
- . show ( opts . loading . speed , function ( ) {
34
- instance . beginAjax ( opts ) ;
35
- } ) ;
45
+ . find ( 'img' )
46
+ . hide ( )
47
+ . parent ( )
48
+ . find ( 'div' ) . html ( opts . loading . finishedMsg ) . animate ( { opacity : 1 } , 2000 , function ( ) {
49
+ $ ( this ) . parent ( ) . fadeOut ( 'normal' ) ;
50
+ } ) ;
51
+
52
+ //And also hide the navSelector
53
+ $ ( opts . navSelector ) . fadeOut ( 'normal' ) ;
54
+
55
+ // user provided callback when done
56
+ opts . errorCallback . call ( $ ( opts . contentSelector ) [ 0 ] , 'done' ) ;
57
+
36
58
}
37
- } ,
38
- _showdonemsg_twitter : function infscr_showdonemsg_twitter ( ) {
39
- var opts = this . options ,
40
- instance = this ;
41
-
42
- //Do all the usual stuff
43
- opts . loading . msg
44
- . find ( 'img' )
45
- . hide ( )
46
- . parent ( )
47
- . find ( 'div' ) . html ( opts . loading . finishedMsg ) . animate ( { opacity : 1 } , 2000 , function ( ) {
48
- $ ( this ) . parent ( ) . fadeOut ( 'normal' ) ;
49
- } ) ;
50
-
51
- //And also hide the navSelector
52
- $ ( opts . navSelector ) . fadeOut ( 'normal' ) ;
53
-
54
- // user provided callback when done
55
- opts . errorCallback . call ( $ ( opts . contentSelector ) [ 0 ] , 'done' ) ;
56
-
57
- }
58
-
59
- } ) ;
59
+
60
+ } ) ;
61
+ } ) ( jQuery ) ;
0 commit comments