5
5
return ( s =
6
6
"function" == typeof Symbol && "symbol" == typeof Symbol . iterator
7
7
? function ( o ) {
8
- return typeof o ;
8
+ return typeof o
9
9
}
10
10
: function ( o ) {
11
- return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ;
12
- } ) ( o ) ;
11
+ return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o
12
+ } ) ( o )
13
13
}
14
14
! ( function ( o , e ) {
15
- void 0 === e && ( e = { } ) ;
16
- var t = e . insertAt ;
15
+ void 0 === e && ( e = { } )
16
+ var t = e . insertAt
17
17
if ( o && "undefined" != typeof document ) {
18
18
var n = document . head || document . getElementsByTagName ( "head" ) [ 0 ] ,
19
19
c = document . createElement ( "style" ) ;
20
- ( c . type = "text/css" ) , "top" === t && n . firstChild ? n . insertBefore ( c , n . firstChild ) : n . append ( c ) , c . styleSheet ? ( c . styleSheet . cssText = o ) : c . append ( document . createTextNode ( o ) ) ;
20
+ ( c . type = "text/css" ) , "top" === t && n . firstChild ? n . insertBefore ( c , n . firstChild ) : n . append ( c ) , c . styleSheet ? ( c . styleSheet . cssText = o ) : c . append ( document . createTextNode ( o ) )
21
21
}
22
22
} ) (
23
23
".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:1}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:1000;top:24px;left:12px;padding:.5em .65em;font-size:.825em;opacity:0;transform:translateX(-88%)translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{left:12px;top:24px;opacity:1;,pre:hover .docsify-copy-code-button{opacity:1}"
27
27
init : function ( ) {
28
28
return function ( o , e ) {
29
29
o . ready ( function ( ) {
30
- console . warn ( "[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary." ) ;
31
- } ) ;
32
- } ;
30
+ console . warn ( "[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary." )
31
+ } )
32
+ }
33
33
} ,
34
34
} ) ,
35
35
( window . $docsify = window . $docsify || { } ) ,
36
36
( window . $docsify . plugins = [
37
37
function ( o , r ) {
38
38
o . doneEach ( function ( ) {
39
39
var o = Array . apply ( null , document . querySelectorAll ( "pre[data-lang]" ) ) ,
40
- c = { buttonText : "<> Copy code" , errorText : "Error" , successText : "Code copied!" } ;
40
+ c = { buttonText : "<> Copy code" , errorText : "Error" , successText : "Code copied!" }
41
41
r . config . copyCode &&
42
42
Object . keys ( c ) . forEach ( function ( t ) {
43
- var n = r . config . copyCode [ t ] ;
43
+ var n = r . config . copyCode [ t ]
44
44
"string" == typeof n
45
45
? ( c [ t ] = n )
46
46
: "object" === s ( n ) &&
47
47
Object . keys ( n ) . some ( function ( o ) {
48
- var e = - 1 < location . href . indexOf ( o ) ;
49
- return ( c [ t ] = e ? n [ o ] : c [ t ] ) , e ;
50
- } ) ;
51
- } ) ;
48
+ var e = - 1 < location . href . indexOf ( o )
49
+ return ( c [ t ] = e ? n [ o ] : c [ t ] ) , e
50
+ } )
51
+ } )
52
52
var e = [
53
53
'<button class="docsify-copy-code-button">' ,
54
54
'<span class="label">' . concat ( c . buttonText , "</span>" ) ,
55
55
'<span class="error">' . concat ( c . errorText , "</span>" ) ,
56
56
'<span class="success">' . concat ( c . successText , "</span>" ) ,
57
57
"</button>" ,
58
- ] . join ( "" ) ;
58
+ ] . join ( "" )
59
59
o . forEach ( function ( o ) {
60
60
o . insertAdjacentHTML ( "beforeend" , e ) ;
61
- } ) ;
61
+ } )
62
62
} ) ,
63
63
o . mounted ( function ( ) {
64
64
document . querySelector ( ".content" ) . addEventListener ( "click" , function ( o ) {
65
65
if ( o . target . classList . contains ( "docsify-copy-code-button" ) ) {
66
66
var e = "BUTTON" === o . target . tagName ? o . target : o . target . parentNode ,
67
67
t = document . createRange ( ) ,
68
68
n = e . parentNode . querySelector ( "code" ) ,
69
- c = window . getSelection ( ) ;
70
- t . selectNode ( n ) , c . removeAllRanges ( ) , c . addRange ( t ) ;
69
+ c = window . getSelection ( )
70
+ t . selectNode ( n ) , c . removeAllRanges ( ) , c . addRange ( t )
71
71
try {
72
72
document . execCommand ( "copy" ) &&
73
73
( e . classList . add ( "success" ) , e . querySelector ( '.label' ) . style . display = 'none' ,
74
74
setTimeout ( function ( ) {
75
- e . classList . remove ( "success" ) ;
76
- e . querySelector ( '.label' ) . style . display = 'inline' ;
77
- } , 2000 ) ) ;
75
+ e . classList . remove ( "success" )
76
+ e . querySelector ( '.label' ) . style . display = 'inline' ;
77
+ } , 2000 ) )
78
78
} catch ( o ) {
79
79
console . error ( "docsify-copy-code: " . concat ( o ) ) ,
80
80
e . classList . add ( "error" ) ,
81
81
setTimeout ( function ( ) {
82
- e . classList . remove ( "error" ) ;
82
+ e . classList . remove ( "error" )
83
83
} , 2000 ) ;
84
84
}
85
- "function" == typeof ( c = window . getSelection ( ) ) . removeRange ? c . removeRange ( t ) : "function" == typeof c . removeAllRanges && c . removeAllRanges ( ) ;
85
+ "function" == typeof ( c = window . getSelection ( ) ) . removeRange ? c . removeRange ( t ) : "function" == typeof c . removeAllRanges && c . removeAllRanges ( )
86
86
}
87
- } ) ;
88
- } ) ;
87
+ } )
88
+ } )
89
89
} ,
90
- ] . concat ( window . $docsify . plugins || [ ] ) ) ;
91
- } ) ( ) ;
90
+ ] . concat ( window . $docsify . plugins || [ ] ) )
91
+ } ) ( ) ;
0 commit comments