1- "use strict" ;
2-
31/*jslint white:true */
42
53function minify ( js ) {
64 return (
7- "javascript:(function()%7B" +
5+ "javascript:(function()%7B%22use%20strict%22%3B%20 " +
86 encodeURIComponent (
97 js
108 . replace ( / [ \r \n \t ] + / gm, " " )
@@ -24,14 +22,13 @@ function normalize(s) {
2422 . replaceAll ( / \x2d + / g, "-" ) ;
2523}
2624
27- // init() is used in HTML
28- // eslint-disable-next-line no-unused-vars
25+ // biome-ignore lint/correctness/noUnusedVariables: init() is used in HTML // eslint-disable-next-line no-unused-vars
2926async function init ( path ) {
30- document . getElementById ( "mininame" ) . oninput = function ( ) {
27+ document . getElementById ( "mininame" ) . oninput = ( ) => {
3128 document . getElementById ( "minified" ) . textContent =
3229 document . getElementById ( "mininame" ) . value ;
3330 } ;
34- document . getElementById ( "plaintext" ) . oninput = function ( ) {
31+ document . getElementById ( "plaintext" ) . oninput = ( ) => {
3532 document . getElementById ( "minified" ) . href = minify (
3633 document . getElementById ( "plaintext" ) . value ,
3734 ) ;
@@ -43,9 +40,7 @@ async function init(path) {
4340 path +
4441 "/main/javascripts/index.json" ,
4542 )
46- . then ( function ( response ) {
47- return response . json ( ) ;
48- } )
43+ . then ( ( response ) => response . json ( ) )
4944 . catch ( console . error ) ;
5045 console . debug ( "Fetched index" ) ;
5146 content . push ( document . createElement ( "hr" ) ) ;
@@ -98,9 +93,7 @@ async function init(path) {
9893 encodeURIComponent ( index [ j ] . name ) +
9994 ".js" ,
10095 )
101- . then ( function ( response ) {
102- return response . text ( ) ;
103- } )
96+ . then ( ( response ) => response . text ( ) )
10497 . catch ( console . error ) ;
10598 console . debug ( "Fetched source code for " + index [ j ] . name ) ;
10699 const book = document . createElement ( "h4" ) ;
@@ -127,16 +120,14 @@ async function init(path) {
127120 bookmarklet . appendChild ( edit ) ;
128121 edit . textContent = "Edit it!" ;
129122 edit . href = "#editor" ;
130- edit . onclick = ( function ( a1 , a2 ) {
131- return function ( ) {
123+ edit . onclick = ( ( a1 , a2 ) => ( ) => {
132124 const e1 = document . getElementById ( "plaintext" ) ;
133125 e1 . value = a1 ;
134126 e1 . dispatchEvent ( new Event ( "input" ) ) ;
135127 const e2 = document . getElementById ( "mininame" ) ;
136128 e2 . value = a2 ;
137129 e2 . dispatchEvent ( new Event ( "input" ) ) ;
138- } ;
139- } ) ( js , index [ j ] . name ) ;
130+ } ) ( js , index [ j ] . name ) ;
140131 }
141132 content . push ( document . createElement ( "hr" ) ) ;
142133 document . getElementById ( "bookmarklets-list" ) . replaceChildren ( ...content ) ;
0 commit comments