<commit_before>var emitterWiringPiNumber = -1;
var projectVersion = "1.1.0";

// 2016-07-10 V 1.1.0
//- Add a graphic link to each sensor
// 2016-07-07 V 1.0.0
// - Initial release

$( document ).ready(function()
{
	init();
});

function init()
{
	//
	// Get JSON configuration file
	//
	$.ajax(
	{
	  url: "data/config.json",
	  dataType: 'json',
	  async: false,
	  cache: false,
	  success: function( root )
	  {
		// Store transmitter wiringPi number
		emitterWiringPiNumber = root.emitterWiringPiNumber;
		 
		// Set page titles
		$(document).prop( 'title' , $(document).prop( 'title' ) + " - " + projectVersion );
		$( "div.container h1").text( root.pageTitle );
		  
		var switchesListToAdd = '';
		
		//
		// For each switch configured
		//
		$.each( root.switchesList , function( index , switchToDrive )
		{
			// Define switch id
			var switchId = "switch-" + switchToDrive.channel + "-" + switchToDrive.rcId;
			
			//
			// Compute piece of HTML to insert
			//
			switchesListToAdd += '<div class="col-xs-6 col-lg-3 switch">';
			switchesListToAdd += '  <h2 class="h4">' + switchToDrive.label + '</h2>';
			switchesListToAdd += '  <p>';
			switchesListToAdd += '    <input id="' + switchId + '" name="' + switchId + '" rcId="' + switchToDrive.rcId + '" channel="' + switchToDrive.channel + '" type="checkbox" data-on-color="info" data-off-color="warning" data-size="normal" data-handle-width="50" ';
			// START : Manage switch state
			if( switchToDrive.state == "on" )
			{
				switchesListToAdd += "checked";
			}
			else if( switchToDrive.state == "off" )
			{
				// Nothing to do
			}
			else	switchesListToAdd += 'data-indeterminate="true"';
			switchesListToAdd += '>';
			// END : Manage switch state
			switchesListToAdd += '  </p>';
			switchesListToAdd += '  <h2 class="h6">';<commit_msg>Switch can now be disabled<commit_after>var emitterWiringPiNumber = -1;
var projectVersion = "1.2.0";

// 2016-09-28 V 1.2.0
//   - Disable switch if remote command
//     identifier and channel are empty
// 2016-07-10 V 1.1.0
//   - Add a graphic link to each sensor
// 2016-07-07 V 1.0.0
//   - Initial release

$( document ).ready(function()
{
	init();
});

function init()
{
	//
	// Get JSON configuration file
	//
	$.ajax(
	{
	  url: "data/config.json",
	  dataType: 'json',
	  async: false,
	  cache: false,
	  success: function( root )
	  {
		// Store transmitter wiringPi number
		emitterWiringPiNumber = root.emitterWiringPiNumber;
		 
		// Set page titles
		$(document).prop( 'title' , $(document).prop( 'title' ) + " - " + projectVersion );
		$( "div.container h1").text( root.pageTitle );
		  
		var switchesListToAdd = '';
		
		//
		// For each switch configured
		//
		$.each( root.switchesList , function( index , switchToDrive )
		{
			// Define switch id
			var switchId = "switch-" + switchToDrive.channel + "-" + switchToDrive.rcId;
			
			//
			// Compute piece of HTML to insert
			//
			switchesListToAdd += '<div class="col-xs-6 col-lg-3 switch">';
			switchesListToAdd += '  <h2 class="h4">' + switchToDrive.label + '</h2>';
			switchesListToAdd += '  <p>';
			switchesListToAdd += '    <input id="' + switchId + '" name="' + switchId + '" rcId="' + switchToDrive.rcId + '" channel="' + switchToDrive.channel + '" type="checkbox" data-on-color="info" data-off-color="warning" data-size="normal" data-handle-width="50" ';
			// START : Manage switch state
			if( switchToDrive.state == "on" )
			{
				switchesListToAdd += "checked";
			}
			else if( switchToDrive.state == "off" )
			{
				// Nothing to do
			}
			else	switchesListToAdd += 'data-indeterminate="true"';
			// END : Manage switch state
			// Disable switch if remote command identifier and channel are empty
			if( switchToDrive.rcId == "" && switchToDrive.channel == "" )	switchesListToAdd += ' disabled';
			switchesListToAdd += '>';
			switchesListToAdd += '  </p>';
			switchesListToAdd += '  <h2 class="h6">';
{'fraction_non_alphanumeric': 0.17002808271636458, 'fraction_numerical': 0.02118968598417156, 'mean_word_length': 2.9258517034068134, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2964534', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1320, 'n_words': 311}