From c3db746ade6705b3ea8cd0e62e550bef08cd9c12 Mon Sep 17 00:00:00 2001 From: User-425 Date: Wed, 6 Sep 2023 09:58:03 +0700 Subject: [PATCH 1/2] chore: Added more comments, and joined table.js --- assets/js/converter.js | 1 + assets/js/log.js | 2 ++ assets/js/main.js | 26 +++++++------------------- assets/js/module.js | 22 +++++++++++++++------- assets/js/table.js | 12 ------------ index.html | 3 +-- 6 files changed, 26 insertions(+), 40 deletions(-) delete mode 100644 assets/js/table.js diff --git a/assets/js/converter.js b/assets/js/converter.js index 28c81b9..9856937 100644 --- a/assets/js/converter.js +++ b/assets/js/converter.js @@ -4,6 +4,7 @@ const cheater = chooser('theCheatF',all_cheater).module; const reverse_cheater = chooser('theCheatF',all_cheater).reverse; const finaller = chooser('undefinedModule',all_cheater).module; + function theUndefiner( str, mapper ) { str = ( str.split( '' ) .map( a => mapper[ a ] ?? a ) diff --git a/assets/js/log.js b/assets/js/log.js index 9ef8785..527433c 100644 --- a/assets/js/log.js +++ b/assets/js/log.js @@ -14,6 +14,7 @@ log = [ var logOutput = ''; +// log templating var logresult = log.map( function( x ) { x = x.replace( /;/g, '
' ); x = x.replace( /-}/g, '' ); @@ -21,6 +22,7 @@ var logresult = log.map( function( x ) { return x; } ); +// loggin with new line logresult.forEach( function( element ) { logOutput += element + '\n'; } ); diff --git a/assets/js/main.js b/assets/js/main.js index 48cab4d..e4f26fc 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,6 +1,10 @@ ezArabicVersion = "2.5.0 (Github Release)"; legacy_mode = "0"; +// Add version to HTML +vrstext = document.getElementById( 'vrs' ); +vrstext.innerHTML = "v".concat( ezArabicVersion ) + // Auto Scroller function textScroller( id , scrl) { if (scrl==true) { @@ -14,7 +18,7 @@ $( 'input' ) .css( 'font-size', $( e.target ) .val() + 'px' ) ); -//copy +// Copy Function function copy( id, inVal ) { var copyText = document.getElementById( id ); if ( inVal == "in" ) { @@ -35,6 +39,7 @@ function copy( id, inVal ) { } ); } +// Table click feature (copy or input) function press( id, inVal ) { table_f = document.getElementById( "tablefeature" ).value; @@ -174,14 +179,6 @@ function clone( obj ) { onscroll( document, headerScrolled ) } - function secret( word ) { - if ( word == "sukses selalu!" ) { - alert( "AMINNN!!" ) - } else { - alert( "Sandi Salah!" ) - } - } - /** * Back to top button */ @@ -247,13 +244,4 @@ function clone( obj ) { } } } ); - - /** - * Animation on scroll - */ - - -} )() - -vrstext = document.getElementById( 'vrs' ); -vrstext.innerHTML = "v".concat( ezArabicVersion ) +} )() \ No newline at end of file diff --git a/assets/js/module.js b/assets/js/module.js index 533a83b..552f4b4 100644 --- a/assets/js/module.js +++ b/assets/js/module.js @@ -244,13 +244,6 @@ function sort( data ) { x.output = x.output.map( ( _, i ) => x.output[ ids[ i ] ] ) } - -// function newModule(m, name){ -// let n_m = new customModule(name,clone(moduleChooser(m))); -// all_module.push(n_m) -// makeOption(name,'moduleSelect') -// } - // Deconstruct to data function moduleDeconstruct3( name ) { let a = []; @@ -294,3 +287,18 @@ for ( let i = 0; i < all_module.length; i++ ) { all_cheater.push( new data( all_module[ i ].name,a , null, null, null, swap(a)) ) } } + +// Function make table +function makeTable( a, e, t, l ) { + var n = "", + c = l; + a.forEach( ( e, l ) => { + n += l % 2 == 0 ? `` : ``; + var r = l + 1; + r % c == 0 && r != a.length && ( n += "" ) + } ), n += "
${e}${e}
", document.getElementById( e ) + .innerHTML = n; +} + +// Run function make table based on module data +makeTable( chooser('Main',all_data).notFlat, "table1", "n_", 4 ), makeTable( chooser('Legacy', all_data).notFlat, "table2", "l_", 4 ); diff --git a/assets/js/table.js b/assets/js/table.js deleted file mode 100644 index 68309cb..0000000 --- a/assets/js/table.js +++ /dev/null @@ -1,12 +0,0 @@ -function makeTable( a, e, t, l ) { - var n = "", - c = l; - a.forEach( ( e, l ) => { - n += l % 2 == 0 ? `` : ``; - var r = l + 1; - r % c == 0 && r != a.length && ( n += "" ) - } ), n += "
${e}${e}
", document.getElementById( e ) - .innerHTML = n; -} - -makeTable( chooser('Main',all_data).notFlat, "table1", "n_", 4 ), makeTable( chooser('Legacy', all_data).notFlat, "table2", "l_", 4 ); diff --git a/index.html b/index.html index eb648ad..102e8f3 100644 --- a/index.html +++ b/index.html @@ -215,9 +215,8 @@ - - + \ No newline at end of file From 36a81ad695960670006ff604e6b98e2072ce4871 Mon Sep 17 00:00:00 2001 From: User-425 Date: Wed, 6 Sep 2023 10:04:34 +0700 Subject: [PATCH 2/2] fix: Mobile dropdown bug --- assets/js/log.js | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/log.js b/assets/js/log.js index 527433c..50be064 100644 --- a/assets/js/log.js +++ b/assets/js/log.js @@ -22,7 +22,7 @@ var logresult = log.map( function( x ) { return x; } ); -// loggin with new line +// logging with new line logresult.forEach( function( element ) { logOutput += element + '\n'; } ); diff --git a/index.html b/index.html index 102e8f3..02ce57e 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@

About - +