Check Custom Blockly

Check Custom Blockly

by Lissandro Dittmar

HTML

<div id="banner-message">
  <p>Check for Custom Blockly</p>
  <button>Start check</button>
</div>

<div style="background-color: white;">
  <ol id="liste">
  
  </ol>
</div>

CSS

i {
  color: #669FAB;
}

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#banner-message {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  font-size: 25px;
  text-align: center;
  transition: all 0.2s;
  margin: 0 auto;
  width: 300px;
}

button {
  background: #0084ff;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 15px;
  color: #fff;
}

#banner-message.alt {
  background: #0084ff;
  color: #fff;
  margin-top: 40px;
  width: 200px;
}

#banner-message.alt button {
  background: #fff;
  color: #000;
}

JavaScript

var adapterList = [];

const start = function(){

	for(i=0;i<7;i++){
    $.getJSON( "https://api.github.com/search/repositories?q=iobroker&sort=updated&page=" + i + "&per_page=100", function( data ) {
      $.each( data.items, function( key, val ) {
      	var full_name = val.full_name;
         var link = "https://raw.githubusercontent.com/" + val.full_name + "/master/io-package.json";
         $.getJSON( link, function(res) {
         	if($.inArray(full_name, adapterList) == -1 && res && res.common && res.common.dependencies){
            	adapterList.push(full_name);
            	$('#liste').append( "<li><a href='" + val.html_url + "' target='_blank'>" + res.common.name + "</a> - Dependancies - " + (res.common.dependencies.includes('vis')?"<b style='color: blue;'>true</b>":"false") + " </li>" );
            }
         });
      	
      });
      });
    };
    
}

$("button").on("click", function(){
  start();
});