From 5a1ed0f3933724168a8f21b9a6a2dcee8cb4545c Mon Sep 17 00:00:00 2001 From: MEUNIER Thibaud Date: Sat, 4 Dec 2021 19:40:32 +0100 Subject: [PATCH] nft phase 2 --- about.php | 3 +- blog.php | 1 + index.php | 1 + js/blockexplorer.js | 102 +++++++++++++++++++-- nft.php | 210 ++++++++------------------------------------ 5 files changed, 136 insertions(+), 181 deletions(-) diff --git a/about.php b/about.php index 5e46db7..a4309ec 100644 --- a/about.php +++ b/about.php @@ -172,6 +172,7 @@ @@ -217,7 +218,7 @@
-

Customize your own TOPISTO !

+

Get your own TOPISTO !

Some blocks are special blocks. The first block in History is at height 0, it is called the GENESIS block. diff --git a/blog.php b/blog.php index 35007ae..edb9972 100644 --- a/blog.php +++ b/blog.php @@ -172,6 +172,7 @@

diff --git a/index.php b/index.php index 552c39f..c81b180 100644 --- a/index.php +++ b/index.php @@ -83,6 +83,7 @@
diff --git a/js/blockexplorer.js b/js/blockexplorer.js index 781b927..a207d8a 100644 --- a/js/blockexplorer.js +++ b/js/blockexplorer.js @@ -64,7 +64,7 @@ blockchainExplorer = function(){ return ladateStr; } - function _addInfoForBlock(block) + function _addInfoForBlock(block, p_div_label) { var contenu = ''; var downloadingImage = new Image(); @@ -77,15 +77,19 @@ blockchainExplorer = function(){ blockName = _getblockNameFromHash(block.hash); if (block.hash == _liste_blocks['TOP']) { blockName = 'LAST BLOCK'; - if (_mode == 1) div_label = 'LAST'; + if (_mode == 1) + div_label = 'LAST'; } if (blockName == '') blockName = 'block'; else blockName = ''+blockName+''; + if (p_div_label != null) + div_label = p_div_label; + visibility='hidden'; if (_infos) visibility='visible'; - contenu += '
'; + contenu += '
'; contenu += ' '; contenu += ' '; contenu += ' '; @@ -102,7 +106,7 @@ blockchainExplorer = function(){ $('#info_'+div_label).html(contenu); downloadingImage.onload = function(){ - var div0 = document.getElementById('img_'+block.height); + var div0 = document.getElementById('img_'+div_label); div0.style.backgroundImage = "url(" + this.src + ")"; div0.style.backgroundRepeat = "no-repeat"; div0.style.backgroundPosition = "center"; @@ -292,7 +296,6 @@ blockchainExplorer = function(){ _liste_blocks = []; _liste_blocks['LENGTH'] = 0; - $(document).scrollTop( $("#explorer").offset().top ); $('#blockchain').html(''); if (block_name != 'LAST') block_hash_url += '?block_hash='+_getblocHashFromName(block_name); @@ -328,10 +331,13 @@ blockchainExplorer = function(){ { // Init the selector var select = $('#blockSelector'); - - $.each(_liste_blocks, function (key, bloc) { - select.append(new Option(bloc.name, bloc.name)); - }); + + if (select !== null) { + select.append(new Option('LAST', 'LAST')); + $.each(_known_blocks, function (key, bloc) { + select.append(new Option(bloc.name, bloc.name)); + }); + } } function _init(mode, infos) @@ -350,6 +356,7 @@ blockchainExplorer = function(){ if (parseInt(a.height) > parseInt(b.height)) return -1; return 0; }); + _initBlockSelector(); return true; }); } @@ -372,12 +379,89 @@ blockchainExplorer = function(){ return _liste_blocks['LENGTH']; } + function _initOneBlock(block_name) + { + var block_hash_url = 'data/getBlockInfo.php'; + + $('#blockchain').html(''); + + if (block_name != 'LAST') block_hash_url += '?block_hash='+_getblocHashFromName(block_name); + + $.getJSON(block_hash_url, function( data ) { + allMethod = [ + 'circle', + 'circle_line', + 'circles', + 'circle_spline', + 'circles_spline', + 'line', + 'linegradient', + 'linehashed', + 'linehashedtx', + 'mondrian', + 'peigne', + 'peignealpha', + 'spirale', + 'splinelineblack', + 'splinelineblackalpha', + 'splinelinegradient', + 'splinelinegradientalpha', + 'treemap2', + 'tylerhobbs', + 'veraMolnar' + ]; + + for(i=0;i - - @@ -170,83 +91,30 @@ -
+
'+blockName+''+block.height+'
timestamp   '+_formatDate(block.time)+'