Commit 9ae7b282 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial

parent c71c0a09
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Elphel on GitHub</title>
<script src="js/jquery-3.1.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/elphel_messenger.js"></script>
<script src="js/github.js"></script>
<link rel="stylesheet" href="js/github.css">
</head>
<body>
<div id="head"></div>
<div id="content"></div>
<script>
ElphelMessenger.init();
</script>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<div id="help-text">
<h2>Welcome to Elphel</h2>
<i><p>Elphel high performance cameras are free software and hardware designs. Freedom of the users of Elphel products is our top priority - we value and protect it with the <a href='http://www.gnu.org/licenses/gpl.html'><b>GNU General Public License</b></a> that covers all the Elphel software and hardware designs. In 2011 CERN Open Hardware License became available for hardware products and since then Elphel cameras are distributed under <a href='http://www.ohwr.org/projects/cernohl'><b>CERN OHLv1.1</b></a> or newer.</p>
<p>Elphel uses multiple web applications for different activities, each application has its own navigation and internal logic. This page plays a role of a virtual desktop with multiple windows - one for each application. This page search launches simultaneous requests to each application and shows number of results found by each of the applications: Main Website, Development Blog, Wiki (Documentation), Mailing List Archive and Git Repository.</p>
<p>We hope you will find the new sites organization easier to navigate. Please feel free to comment and leave suggestions on our public mailing list.</p>
<p>Elphel team</p></i>
<img title='Home' style='cursor:pointer;' width=40 height=40 src='images/elphel-logo.png'>
<br/>
<br/>
<p>Help:</p>
<table>
<tr>
<td valign='top'>&bull;</td>
<td valign='top'><b>Main</b></td>
<td>Elphel's main website talks about our company, people and products.</td>
</tr>
<tr>
<td valign='top'>&bull;</td>
<td valign='top'><b>Blog</b></td>
<td>On the blog you can read in depth about current projects, find news and events announcements.</td>
</tr>
<tr>
<td valign='top'>&bull;</td>
<td valign='top'><b>Wiki</b></td>
<td>Wiki is for documentation, camera schematics, and parts download - all under GNU GPL and Open Hardware Licence.</td>
</tr>
<tr>
<td valign='top'>&bull;</td>
<td valign='top'><b>Support&nbsp;</b></td>
<td>Mail Archive is a very helpful resource for technical questions, frequently asked as well as rare ones. Searching in archive is the best start if you need help using the camera or developing your application - it is likely that somebody had similar problem and figured this out.</td>
</tr>
<tr>
<td valign='top'>&bull;</td>
<td valign='top'><b>Code</b></td>
<td>All of our software and FPGA projects are hosted at <b><i>https://git.elphel.com</i></b> - available for download under GNU GPLv3 license.</td>
</tr>
</table>
<br/>
<p>Each application window title is a link to the current application address that can be used to open just a single page in a separate window or tab.</p>
<br/>
<p>Technical details:</p>
<p>Each application is embedded into this page as IFRAME HTML element, they communicate with each other and the top page by sending messages. Web server optionally redirects requests for the specific applications to this framed version depending on a referrer URI. So if you come to <b><i>https://blog.elphel.com/some-blog-page</i></b> from external web site (such as a search engine), your browser is redirected to <b><i>https://www.elphel.com/blog/some-page</i></b> and the requested blog post is shown with other applications in the background allowing navigation and search.</p>
<p>No redirection happens if the web address is entered directly (no referrer) or the page is opened from a link on one of Elphel web sites.</p>
<br/>
<br/>
</div>
</body>
</html>
<?php
// subbed with window.location.href=window.location.href?iframe=true in frames.js
/*
if (preg_match("/www\.elphel\.com/",$_SERVER['HTTP_REFERER'])){
header("X-Frame-Options: DENY");
}
*/
$TITLE = "Elphel: Free Software &amp; Open Hardware Imaging";
$HELP = file_get_contents("help.html");
$TARGET_LIST = Array(
Array(
"id" => "www3",
"name" => "Main",
"href" => "https://www3.elphel.com",
"search" => "https://www3.elphel.com/search/node/",
"search_index" => "0",
"color" => "rgba(51,102,153,1)"
),
Array(
"id" => "blog",
"name" => "Blog",
"href" => "https://blog.elphel.com",
"search" => "https://blog.elphel.com?s=",
"search_index" => "1",
"color" => "rgba(102,159,65,1)"
),
Array(
"id" => "wiki",
"name" => "Wiki/Docs",
"href" => "https://wiki.elphel.com/wiki",
"search" => "https://wiki.elphel.com/index.php?title=Special%3ASearch&fulltext=Search&limit=500&search=",
"search_index" => "2",
"color" => "rgba(27,63,137,1)"
),
Array(
"id" => "support",
"name" => "Support",
"href" => "https://www.mail-archive.com/support-list@support.elphel.com",
"search" => "https://www.mail-archive.com/search?l=support-list%40support.elphel.com&a=1&notwords=blog%3A&haswords=",
"search_index" => "3",
"color" => "rgba(182,47,7,1)"
),
Array(
"id" => "code",
"name" => "Code",
"href" => "https://git.elphel.com",
"search" => "https://git.elphel.com/search?utf8=✓&group_id=&project_id=&repository_ref=&search=",
"search_index" => "4",
"color" => "rgba(0,0,0,0.7)"
)
);
// used to decode the major URI request to sub website address
$LIST_IDs = Array();
$LIST_HREFs = Array();
foreach($TARGET_LIST as $v){
array_push($LIST_IDs, $v["id"]);
array_push($LIST_HREFs, $v["href"]);
}
// decode http://{this_iframed_site}/{id}/uri string into
// {href}/uri
$request_uri = $_SERVER['REQUEST_URI'];
$websites = explode("/",$request_uri);
// $tmp_str is the decoded {href}/uri
$tmp_str = "";
if(isset($websites[1])){
$website = $websites[1];
$uri = implode("/",array_slice($websites,2));
foreach($LIST_IDs as $key=>$id){
if ($id==$website){
$tmp_str = $LIST_HREFs[$key]."/".$uri;
break;
}
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $TITLE;?></title>
<script src="js/jquery-3.1.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/elphel_messenger.js"></script>
<script src="js/frames.js"></script>
<link rel="stylesheet" href="js/frames.css">
</head>
<body onresize="resize()">
<div id="panel"></div>
<div id="content"></div>
<?php echo $HELP;?>
<?php
echo "<script>\n";
$targets = Array();
foreach($TARGET_LIST as $target){
$str = " {\n";
$str .= " name: \"".$target['name']."\",\n";
$str .= " color: \"".$target['color']."\",\n";
$str .= " search: \"".$target['search']."\",\n";
$str .= " search_index: ".$target['search_index'].",\n";
$str .= " href: \"".$target['href']."\"\n";
$str .= " }";
array_push($targets,$str);
}
$str = implode(",\n",$targets);
echo " var targets = [\n$str];";
echo " var custom_url=\"$tmp_str\";\n";
echo "</script>\n";
?>
<script>
//defaults
var cols = 5;
var order = [0,1,2,3,4];
var rows = Math.ceil(targets.length/cols);
// constants
var width_base = 1055;
var min_col_width = 100;
var base_vstep = 150;
var iframe_adjustment_base_value = 5;
var iframe_adjustment_selected_value = 3;
</script>
</body>
</html>
/**
* @file elphel_messenger.js
* @brief elphel cross-origin messenger
* @copyright Copyright (C) 2017 Elphel Inc.
* @author Oleg Dzhimiev <oleg@elphel.com>
*
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*/
var ElphelMessenger = {
init: function(callback){
if (window.self==window.top){
//console.log("bingo! "+window.self.location.href);
window.addEventListener("message",callback,false);
}else{
//console.log("not bingo! "+window.self.location.href);
window.top.postMessage({href: window.self.location.href, name: window.self.name,mode:"init"},"*");
alllinks = document.getElementsByTagName("a");
console.log(window.self.name+" found links: "+alllinks.length);
for(var i=0;i<alllinks.length;i++){
alllinks[i].onclick = function(e){
window.top.postMessage({href: this.href, host: this.host, target: window.self.location.host,name: window.self.name,mode:"click"},"*");
//block event propagation
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
};
}
}
},
receiveMessage: function(e){
console.log(e.data.href);
}
}
body{
overflow:hidden;
}
#panel{
/* border: 5px solid green; */
width: 100%;
/* height: 50px; */
border-bottom: 1px solid rgba(250,250,250,0.9);
border-radius: 1px;
background:rgba(20,20,20,0.9);
/* display:none; */
}
#help-text{
position:absolute;
top:0px;
left:0px;
background:rgba(20,20,20,0.9);
/*width:100%;*/
height:100%;
z-index:100;
color:white;
font-family: Helvetica, sans-serif;
font-size:16px;
padding: 20px 100px;
overflow:auto;
}
#subpanel{
/* background:blue; */
overflow:hidden;
}
.target_wrapper{
padding:0px;
font-family: Helvetica, sans-serif;
text-align:center;
display: inline-block;
}
.target_contents{
height: 25px;
line-height:25px;
font-size:20px;
margin:0px 5px 5px 0px;
background:rgba(0,0,0,0);
padding:5px;
color: rgba(240,240,240,1);
cursor:pointer;
border:1px solid white;
}
#content{
}
.content_wrapper{
background:rgba(200,100,100,1);
padding:0px;
margin:0px;
box-shadow: 0px 0px 5px black;
}
.content_contents{
margin:0px 0px 0px 0px;
background:white;
/* padding-left:0px; */
position:absolute;
overflow:hidden;
padding:0px;
}
iframe{
/* border:1px solid rgba(200,200,200,1); */
border:1px solid gray;
height:100%;
overflow:hidden;
}
body{
margin:0px;
}
.content_header{
/* border-top-right-radius: 2px; */
/* border-top-left-radius: 2px; */
text-align:center;
line-height:1.5em;
border: 0px solid black;
background: rgba(0,0,0,0.7);
color:white;
font-weight:bold;
font-family: Helvetica, sans-serif;
padding: 0px 50px 0px 50px;
}
a{
text-decoration:none;
color:white;
}
a:visited, a:link{
color:white;
}
a:hover{
text-decoration:underline;
cursor:pointer;
}
#search{
font-weight:bold;
background: rgba(20,20,20,0.7);
color:white;
padding:10px;
border-radius:2px;
}
.search{
display:inline-block;
color:white;
font-family: Helvetica, sans-serif;
cursor:pointer;
}
.combined_search{
line-height:1.5em;
font-size:1.1em;
padding-left:5px;
}
.search_button{
padding-left:5px;
cursor:pointer;
/* border: 1px solid rgba(250,250,250,0.5); */
}
This diff is collapsed.
body{
font-family: Helvetica, sans-serif;
}
.company-name{
font-size: 2em;
color: rgba(50,50,50,1);
}
.company-name a:visited, .company-name a:link{
color:black;
}
a{
text-decoration:none;
color:black;
}
a:visited, a:link{
color:#4078c0;
}
a:hover{
text-decoration:underline;
cursor:pointer;
}
.company-bio, .repo-description{
color: gray;
}
#head img{
padding:10px;
}
.repo-wrapper{
padding-bottom:0em;
}
.repo-link{
font-family: Helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
}
.repo-description{
font-size: 0.9em;
padding-bottom:1em;
}
hr{
border:0px;
height:1px;
background:rgba(200,200,200,0.5);
}
.repo-updated{
color: gray;
font-size:0.8em;
}
\ No newline at end of file
$(function(){
console.log("init");
init();
});
function init(){
$("#content").css({
padding: "20px"
});
$.ajax({
url: "https://api.github.com/users/elphel",
success: function(data){
var template = `
<table>
<tr>
<td><img width='100' src='`+data.avatar_url+`' /></td>
<td>
<div class='company-name'><a target='_blank' href='`+data.html_url+`'>`+data.name+`</a> on GitHub</div>
<div class='company-bio'>`+data.bio+`</div>
</td>
</tr>
</table>
<table>
<tr>
<td><img width='50' src='https://github.com/fluidicon.png' /></td>
<td><a target='_blank' href='`+data.html_url+`'>`+data.public_repos+` public repositories on GitHub</a>:</td>
</tr>
</table>
`;
$("#head").html(template);
}
});
$.ajax({
url: "https://api.github.com/users/elphel/repos?per_page=60&sort=pushed",
success: function(data){
for(var i=0;i<data.length;i++){
var d = new Date(data[i].pushed_at);
var template = `
<hr/>
<div class='repo-wrapper'>
<div class='repo-link'>
<a target='_blank' href='`+data[i].html_url+`'>`+data[i].name+`</a>
</div>
<div class='repo-description'>`+data[i].description+`</div>
<table>
<tr>
<td><div class='repo-updated'>Updated `+d.toLocaleDateString()+`</div></td>
</tr>
</table>
</div>
`;
//var tmp_div = $("<div>").html(data[i].name);
$("#content").append(template);
}
}
});
}
This diff is collapsed.
This diff is collapsed.
<?php
//need an array
$dict = Array(
"https://www3.elphel.com/search/node/",
"https://blog.elphel.com?s=",
"https://wiki.elphel.com/index.php?title=Special%3ASearch&fulltext=Search&limit=500&search=",
"https://www.mail-archive.com/search?l=support-list%40support.elphel.com&a=1&notwords=blog%3A&haswords=",
"https://git.elphel.com/search?utf8=✓&group_id=&project_id=&repository_ref=&search="
);
$i = $_GET['i'];
$q = $_GET['q'];
$content = file_get_contents("{$dict[$i]}{$q}");
//echo "Opening: {$dict[$i]}{$q}\n";
//echo $content;
switch($i){
case (0):
preg_match_all('/<li class="search-result">/',$content,$matches);
$result = count($matches[0]);
if (intval($result)==10) $result .= "+";
break;
case (1):
preg_match_all('/<div class="post" id=/',$content,$matches);
$result = count($matches[0]);
if (intval($result)==10) $result .= "+";
break;
case (2):
preg_match_all('/<div class=\'searchresult\'>/',$content,$matches);
$result = count($matches[0]);
break;
case (3):
preg_match_all('/[0-9]* matches<\/h2>/',$content,$matches);
preg_match_all('/[0-9]* /',$matches[0][0],$numbers);
$result = $numbers[0][0];
// "searchpg->h3 or look for <h2> containing X matches"
break;
case (4):
preg_match_all('/<span class=\"badge\">\n([0-9]*)\n<\/span>/',$content,$matches);
$result = 0;
foreach($matches[1] as $val){
$result += intval($val);
}
break;
default:
// report n/a
break;
}
echo $result;
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment