About

The eLog library was initially developed as a research prototype and later published for lifelogging researchers in 2010 to help them easily analyze heterogenous data and complex visualization. It has been kept growing with the progress of mobile computing environments and recently its UI part is released with GPL v3 license for wider usage. The eLog UI library is optimized for mobile environment and can get easily integrated with existing Web services.

Who We Are

The original work was proposed by Pil Ho and later extended the work with collaboration with 28 researchers around the world who contributed their lifelogs, collaborated for lifelog analysis and share research results to build up an open lifelogging platform for the public. Pil Ho has been keeping the development updating the library following up the progress in mobile computing.

Updates

  • Nov. 2014: Change the web page skin using bootstrap.
  • Nov. 2014: Published elog UI library as GPL v3.
  • Oct. 2014: Version up eLog library and documentation.

 

Inserting iframe to all methods

This method is obsolete due to the significant performace down by mutiple DISQUS comment window loading time but left here for records. The below is the content of disqus_comment_insert.php for shell scripting. It should run right after jsduck compilation. For command options, see the source code below

Bash command:
php disqus_comment_insert.php -d "../elog_doc/output" -s elifelog -c 233nnnn
Source code: disqus_comment_insert.php
 2 ) { /* The 2 accounts for . and .. */
			// All files
			foreach( $files as $file ) {
				if( $file != '.' && $file != '..' && !is_dir($user_dir. $file) ) {
					$ext = preg_replace('/^.*\./', '', $file);
					if ($ext == 'js') {
						$user_file = str_replace("//", "/", $user_dir."/".$file);
						array_push($output, $user_file);
					}
				}
			}
		}
	}

	return $output;
}

function getElementById($doc, $id)
{
    $xpath = new DOMXPath($doc);
    return $xpath->query("//*[@id='$id']")->item(0);
}

function ProcessJsduckDocument($file, $userVariables) {
	
	// If original file exists, read from it
	if (file_exists($file.".bak")) {
		$contents = file_get_contents($file.".bak");
	}
	else {
		$contents = file_get_contents($file);
	}
	
	if ($contents === FALSE) return $contents;
	
	// $contents=preg_replace('/.+?({.+}).+/','$1',$contents); 
	$contents=preg_match_all('/(.+?)({.+})(.+)/', $contents, $output, PREG_SET_ORDER);
	// var_dump($output);
	
	$result = json_decode($output[0][2], true); 

	// var_dump($result['html']); 
	
	// HTML Parsing
	$doc = new DOMDocument(); 
	$doc->loadHTML($result['html']); 
	// echo $doc->saveHTML(); 
	
	$document_name = $result['name'];
	
	foreach ($result['members']['method'] as $method) {
		$method_id = $method['id'];
		$method_name = $method['name'];
		
		// $searchNodes = $doc->getElementsByTagName("div");
		echo $document_name.' '.$method_id.PHP_EOL;
		
		// if (($searchNode = $doc->getElementById($method_id)) !== NULL) {
		if (($searchNode = getElementById($doc, $method_id)) !== NULL) {
			// echo $searchNode->nodeValue, PHP_EOL;	
			foreach ($searchNode->childNodes as $description) {
				if ($description->getAttribute('class') == 'description') {
					foreach ($description->childNodes as $longDescription) {
						if ($longDescription->getAttribute('class') == 'long') {
							// echo $longDescription->nodeValue, PHP_EOL;
							
							$comment_iframe = $doc->createElement('iframe');
							
							/**
							 * iframe frameborder='0' src='disqus_comments.php?disqus_shortname=elifelog&disqus_identifier=Server.admin.Base_CheckUserInformation&disqus_title=Server.admin.Base_CheckUserInformation&disqus_category_id=2331680' class='comment_frame'>
							 */
							 
							 var_dump($options);
							 
							 $sourceUrl = "disqus_comments.php?";
							 $sourceUrl .= "disqus_shortname=".$userVariables["disqus_shortname"];
							 $sourceUrl .= "&disqus_identifier=".$document_name."_".$method_name;
							 $sourceUrl .= "&disqus_title=".$document_name."_".$method_name;
							 $sourceUrl .= "&disqus_category_id=".$userVariables["disqus_category_id"];
							 
							 // $comment_iframe->setAttribute('src', urlencode($sourceUrl));
							 $comment_iframe->setAttribute('src', $sourceUrl);
							 $comment_iframe->setAttribute('frameborder', '0');
							 
							 $longDescription->appendChild($comment_iframe);
						}
					}
				}
			}
		}
	}
	
	// echo $doc->saveHTML(); 
	
	$htmlwithComemnts = $doc->saveHTML();
	
	// strip off body and html tags
	// Search regular expression over multiple lines '/s'
	$htmlwithComemnts=preg_replace('/.+?(\).+/s','$1',$htmlwithComemnts);
	
	$result['html'] = $htmlwithComemnts;
	$resultwithComments = json_encode($result); 

	$contentswithComments = $output[0][1].$resultwithComments.$output[0][3];
	
	// Create a backup if not exists
	if (file_exists($file.".bak") === FALSE) {
		copy($file, $file.".bak");
	}
	
	file_put_contents($file, $contentswithComments);
}


$files = GetUserFileDir($userVariables["document_directory"]);

// var_dump($files);

foreach ($files as $file) {
	ProcessJsduckDocument($file, $userVariables);
}

?>