55 * (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
66 * -- END LICENSE BLOCK -----------------------------------------------------*/
77
8- ( function ( undefined ) {
9- 'use strict' ;
10- // -- INFORMATIONS BLOCK BEGIN ----------------------------------------------------
11- var informations = {
12- name : 'dcScriptIndexWarning' ,
13- description : 'dcScript for dotclear version 2.7+' ,
14- version : '0.1.0' ,
15- author : 'Gvx' ,
16- copyright : '© 2020 Gvx' ,
17- support : '' ,
18- license : 'http://www.gnu.org/licenses/old-licenses/gpl-2.0.html'
19- } ;
20- // -- INFORMATIONS BLOCK END ------------------------------------------------------
8+ ( function ( undefined ) {
9+ 'use strict' ;
10+ // -- INFORMATIONS BLOCK BEGIN ----------------------------------------------------
11+ var informations = {
12+ name : 'dcScriptIndexWarning' ,
13+ description : 'dcScript for dotclear version 2.7+' ,
14+ version : '0.1.0' ,
15+ author : 'Gvx' ,
16+ copyright : '© 2020 Gvx' ,
17+ support : '' ,
18+ license : 'http://www.gnu.org/licenses/old-licenses/gpl-2.0.html'
19+ } ;
20+ // -- INFORMATIONS BLOCK END ------------------------------------------------------
2121
22- function copy ( element , button ) {
23- if ( element ) {
24- var range = document . createRange ( ) ;
25- var selection = window . getSelection ( ) ;
26- range . selectNode ( element ) ;
27- selection . removeAllRanges ( ) ;
28- selection . addRange ( range ) ;
29- if ( button ) { button . classList . remove ( 'copy_done' ) ; }
30- if ( document . execCommand ( 'copy' ) ) {
31- if ( button ) { button . classList . add ( 'copy_done' ) ; }
32- } else {
33- console . log ( 'Erreur de copie de "' + element . id + '"' ) ;
34- }
35- }
36- }
22+ function copy ( element , button ) {
23+ if ( element ) {
24+ var range = document . createRange ( ) ;
25+ var selection = window . getSelection ( ) ;
26+ range . selectNode ( element ) ;
27+ selection . removeAllRanges ( ) ;
28+ selection . addRange ( range ) ;
29+ if ( button ) { button . classList . remove ( 'copy_done' ) ; }
30+ if ( document . execCommand ( 'copy' ) ) {
31+ if ( button ) { button . classList . add ( 'copy_done' ) ; }
32+ } else {
33+ console . log ( 'Erreur de copie de "' + element . id + '"' ) ;
34+ }
35+ }
36+ }
3737
38- document . addEventListener ( 'DOMContentLoaded' , function ( ) {
39- document . getElementById ( 'copy_key_crypt' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'key_crypt' ) , this ) ; } ) ;
40- document . getElementById ( 'copy_header_code' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'header_code' ) , this ) ; } ) ;
41- document . getElementById ( 'copy_footer_code' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'footer_code' ) , this ) ; } ) ;
42- } ) ;
38+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
39+ document . getElementById ( 'copy_key_crypt' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'key_crypt' ) , this ) ; } ) ;
40+ document . getElementById ( 'copy_header_code' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'header_code' ) , this ) ; } ) ;
41+ document . getElementById ( 'copy_footer_code' ) . addEventListener ( 'click' , function ( ) { copy ( document . getElementById ( 'footer_code' ) , this ) ; } ) ;
42+ } ) ;
4343
44- } ( ) ) ;
44+ } ( ) ) ;
0 commit comments