107107 }
108108 /*C*/
109109 . main-title h1 . animated span : nth-child ( 1 ) {
110- color : # d50f25 ;
110+ color : # 3369e8 ;
111111 transition-delay : 200ms ;
112112 }
113113 /*O*/
114114 . main-title h1 . animated span : nth-child ( 2 ) {
115- color : # 3369e8 ;
115+ color : # d50f25 ;
116116 transition-delay : 350ms ;
117117 }
118118 /*D*/
122122 }
123123 /*E*/
124124 . main-title h1 . animated span : nth-child ( 4 ) {
125- color : # d50f25 ;
125+ color : # 3369e8 ;
126126 transition-delay : 650ms ;
127127 }
128128 /*L*/
132132 }
133133 /*F*/
134134 . main-title h1 . animated span : nth-child ( 6 ) {
135- color : # 3369e8 ;
135+ color : # d50f25 ;
136136 transition-delay : 950ms ;
137137 }
138138 . search-form {
208208 overflow : scroll;
209209 -webkit-overflow-scrolling : touch;
210210 }
211+ . variable-btns > . variable-btns__copy {
212+ display : none;
213+ }
211214 @media ( min-width : 62em ) {
212215 . main-container {
213216 padding : 20px 150px ;
243246 . sourcecode-modal . modal-content {
244247 padding-bottom : 0 ;
245248 }
249+ . variable-btns > . variable-btns__copy {
250+ display : block;
251+ }
246252 }
247253 </ style >
248254</ head >
@@ -335,10 +341,11 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
335341 </ div >
336342</ div >
337343< script type ="text/html " template ="variableMenu ">
338- < div class = "btn-group-vertical" role = "group" >
344+ < div class = "btn-group-vertical variable-btns " role = "group" >
339345 < button type = "button" class = "btn btn-secondary" > < a href = "{repo}" target = "_blank" > Repo</ a > < / b u t t o n >
340346 < button type = "button" class = "btn btn-secondary" > < a href = "#{val}" > Search</ a > < / b u t t o n >
341- < button type = "button" class = "btn btn-secondary js-variable-button__code" data - id = "{id}" > Codes < / b u t t o n >
347+ < button type = "button" class = "btn btn-secondary variable-btns__code" data - id = "{id}" > Codes < / b u t t o n >
348+ < button type = "button" class = "btn btn-secondary variable-btns__copy" data - clipboard - text = "{val}" > Copy < / b u t t o n >
342349 </div >
343350</ script >
344351<!-- http://tholman.com/github-corners/ -->
@@ -347,6 +354,7 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
347354< script src ="src/lib/tether.min.js "> </ script >
348355< script src ="src/lib/jquery.min.js "> </ script >
349356< script src ="src/lib/bootstrap.min.js "> </ script >
357+ < script src ="src/lib/ZeroClipboard.min.js "> </ script >
350358< script src ="src/lib/highlight.min.js "> </ script >
351359< script >
352360 $ ( function ( ) {
@@ -653,15 +661,16 @@ <h5 class="variable-wrap" data-id="{id}" data-repo="{repo}" data-url="{url}" dat
653661 els . sourceCodeModal . find ( '.modal-header a' ) . attr ( 'href' , this . dataset . repo ) ;
654662 return els . variableMenuTpl
655663 . replace ( '{id}' , this . dataset . id )
656- . replace ( ' {val}' , this . dataset . val )
664+ . replace ( / \ {v a l \} / g , this . dataset . val )
657665 . replace ( '{repo}' , this . dataset . repo ) ;
658666 } ,
659667 template : '<div class="popover popover--variable" role="tooltip"><div class="popover-arrow"></div><div class="popover-content"></div></div>'
660668 } ) ;
661669 $ ( this ) . popover ( 'show' ) ;
670+ els . variableClipboard = new ZeroClipboard ( $ ( '.variable-btns__copy' ) [ 0 ] ) ;
662671 return false ;
663672 } ) ;
664- els . body . on ( 'click' , '.js- variable-button__code ' , showSourceCode ) ;
673+ els . body . on ( 'click' , '.variable-btns__code ' , showSourceCode ) ;
665674 els . body . on ( 'click' , removeVariableMenus ) ;
666675 els . sourceCodeModal . on ( 'hidden.bs.modal' , function ( ) {
667676 els . sourceCodeContent . text ( '' ) ;
0 commit comments