@@ -19,47 +19,49 @@ function getCookie(c_name)
19
19
return c_value ;
20
20
}
21
21
22
- // JSON highlighting.
23
- prettyPrint ( ) ;
22
+ $ ( document ) . ready ( function ( ) {
23
+ // JSON highlighting.
24
+ prettyPrint ( ) ;
24
25
25
- // Bootstrap tooltips.
26
- $ ( '.js-tooltip' ) . tooltip ( {
27
- delay : 1000 ,
28
- container : 'body'
29
- } ) ;
26
+ // Bootstrap tooltips.
27
+ $ ( '.js-tooltip' ) . tooltip ( {
28
+ delay : 1000 ,
29
+ container : 'body'
30
+ } ) ;
30
31
31
- // Deal with rounded tab styling after tab clicks.
32
- $ ( 'a[data-toggle="tab"]:first' ) . on ( 'shown' , function ( e ) {
33
- $ ( e . target ) . parents ( '.tabbable' ) . addClass ( 'first-tab-active' ) ;
34
- } ) ;
35
- $ ( 'a[data-toggle="tab"]:not(:first)' ) . on ( 'shown' , function ( e ) {
36
- $ ( e . target ) . parents ( '.tabbable' ) . removeClass ( 'first-tab-active' ) ;
37
- } ) ;
32
+ // Deal with rounded tab styling after tab clicks.
33
+ $ ( 'a[data-toggle="tab"]:first' ) . on ( 'shown' , function ( e ) {
34
+ $ ( e . target ) . parents ( '.tabbable' ) . addClass ( 'first-tab-active' ) ;
35
+ } ) ;
36
+ $ ( 'a[data-toggle="tab"]:not(:first)' ) . on ( 'shown' , function ( e ) {
37
+ $ ( e . target ) . parents ( '.tabbable' ) . removeClass ( 'first-tab-active' ) ;
38
+ } ) ;
38
39
39
- $ ( 'a[data-toggle="tab"]' ) . click ( function ( ) {
40
- document . cookie = "tabstyle=" + this . name + "; path=/" ;
41
- } ) ;
40
+ $ ( 'a[data-toggle="tab"]' ) . click ( function ( ) {
41
+ document . cookie = "tabstyle=" + this . name + "; path=/" ;
42
+ } ) ;
42
43
43
- // Store tab preference in cookies & display appropriate tab on load.
44
- var selectedTab = null ;
45
- var selectedTabName = getCookie ( 'tabstyle' ) ;
44
+ // Store tab preference in cookies & display appropriate tab on load.
45
+ var selectedTab = null ;
46
+ var selectedTabName = getCookie ( 'tabstyle' ) ;
46
47
47
- if ( selectedTabName ) {
48
- selectedTabName = selectedTabName . replace ( / [ ^ a - z - ] / g, '' ) ;
49
- }
48
+ if ( selectedTabName ) {
49
+ selectedTabName = selectedTabName . replace ( / [ ^ a - z - ] / g, '' ) ;
50
+ }
50
51
51
- if ( selectedTabName ) {
52
- selectedTab = $ ( '.form-switcher a[name=' + selectedTabName + ']' ) ;
53
- }
52
+ if ( selectedTabName ) {
53
+ selectedTab = $ ( '.form-switcher a[name=' + selectedTabName + ']' ) ;
54
+ }
54
55
55
- if ( selectedTab && selectedTab . length > 0 ) {
56
- // Display whichever tab is selected.
57
- selectedTab . tab ( 'show' ) ;
58
- } else {
59
- // If no tab selected, display rightmost tab.
60
- $ ( '.form-switcher a:first' ) . tab ( 'show' ) ;
61
- }
56
+ if ( selectedTab && selectedTab . length > 0 ) {
57
+ // Display whichever tab is selected.
58
+ selectedTab . tab ( 'show' ) ;
59
+ } else {
60
+ // If no tab selected, display rightmost tab.
61
+ $ ( '.form-switcher a:first' ) . tab ( 'show' ) ;
62
+ }
62
63
63
- $ ( window ) . load ( function ( ) {
64
- $ ( '#errorModal' ) . modal ( 'show' ) ;
64
+ $ ( window ) . load ( function ( ) {
65
+ $ ( '#errorModal' ) . modal ( 'show' ) ;
66
+ } ) ;
65
67
} ) ;
0 commit comments