|
|
<!doctype html>
|
|
|
<html class="no-js" lang="en">
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<meta name="author" content="Lednerb">
|
|
|
<meta name="description" content="Bilberry Premium Theme for Hugo.">
|
|
|
<meta name="keywords" content="blog,personal,responsive,search,font awesome,pages,posts,multilingual,highlight.js,syntax highlighting,premium,shortcuts">
|
|
|
<meta name="generator" content="Hugo 0.50" />
|
|
|
<title> 尿尿發電 讓手機永遠都滿格 | My cool new Blog</title>
|
|
|
<meta name="description" content="尿尿發電 讓手機永遠都滿格 - Bilberry Premium Theme for Hugo.">
|
|
|
<meta itemprop="name" content="尿尿發電 讓手機永遠都滿格">
|
|
|
<meta itemprop="description" content="尿尿發電 讓手機永遠都滿格 - Bilberry Premium Theme for Hugo.">
|
|
|
<meta property="og:title" content="尿尿發電 讓手機永遠都滿格">
|
|
|
<meta property="og:description" content="尿尿發電 讓手機永遠都滿格 - Bilberry Premium Theme for Hugo.">
|
|
|
<meta property="og:image" content="https://www.gravatar.com/avatar/88188b6cc451928eba90e8400bc68086?size=200">
|
|
|
<meta property="og:url" content="https://h.cowbay.org/article/e5-b0-bf-e5-b0-bf-e7-99-bc-e9-9b-bb-e8-ae-93-e6-89-8b-e6-a9-9f-e6-b0-b8-e9-81-a0-e9-83-bd-e6-bb-bf-e6-a0-bc/">
|
|
|
<meta property="og:site_name" content="My cool new Blog">
|
|
|
<meta property="og:type" content="article">
|
|
|
<link rel="icon" type="image/png" href="https://h.cowbay.org/favicon-32x32.png" sizes="32x32">
|
|
|
<link rel="icon" type="image/png" href="https://h.cowbay.org/favicon-16x16.png" sizes="16x16">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://h.cowbay.org/sass/combined.min.717098cb5503581e75f12e486a847ca410bf8367d4d8713f4c37affc868c5a1d.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
<body class="bilberry-hugo-theme">
|
|
|
|
|
|
<nav>
|
|
|
|
|
|
<div class="container">
|
|
|
<ul class="topnav">
|
|
|
|
|
|
|
|
|
<li><a href="/page/about-bilberry/">About Bilberry</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="https://github.com/Lednerb/bilberry-hugo-theme" target="_blank">Github</a></li>
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
<div id="search-box" class="search">
|
|
|
<i class="fa fa-search"></i>
|
|
|
<input id="search" type="text" placeholder="Search ...">
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
<header>
|
|
|
<div class="container">
|
|
|
<div class="logo">
|
|
|
<a href="/" class="logo">
|
|
|
|
|
|
<img src="https://www.gravatar.com/avatar/88188b6cc451928eba90e8400bc68086?d=mm&size=200" alt="">
|
|
|
|
|
|
|
|
|
<span class="overlay"><i class="fa fa-home"></i></span>
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="titles">
|
|
|
<h3 class="title"><a href="/">My cool new Blog</a></h3>
|
|
|
|
|
|
<span class="subtitle">Hello World! This is the most epic subtitle ever.</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="languages">
|
|
|
|
|
|
|
|
|
<a href="/en" class="active">en</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a href="/de">de</a>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="toggler">
|
|
|
|
|
|
<i class="fa fa-bars" aria-hidden="true"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
|
|
|
<div class="main container">
|
|
|
|
|
|
|
|
|
<div class="article-wrapper u-cf single">
|
|
|
|
|
|
<a class="bubble" href="/article/e5-b0-bf-e5-b0-bf-e7-99-bc-e9-9b-bb-e8-ae-93-e6-89-8b-e6-a9-9f-e6-b0-b8-e9-81-a0-e9-83-bd-e6-bb-bf-e6-a0-bc/">
|
|
|
<i class="fa fa-fw fa-pencil"></i>
|
|
|
</a>
|
|
|
|
|
|
<article class="default article">
|
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
<h3><a href="/article/e5-b0-bf-e5-b0-bf-e7-99-bc-e9-9b-bb-e8-ae-93-e6-89-8b-e6-a9-9f-e6-b0-b8-e9-81-a0-e9-83-bd-e6-bb-bf-e6-a0-bc/">尿尿發電 讓手機永遠都滿格</a></h3>
|
|
|
<div class="meta">
|
|
|
|
|
|
|
|
|
<span class="date moment">2014-10-16</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="categories">
|
|
|
|
|
|
<a href="/categories/%E6%9C%AA%E5%88%86%E9%A1%9E">未分類</a>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<p><table style="width: 100%;" border="0" cellspacing="3" cellpadding="0">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td width="76%">
|
|
|
<div id="story_title" class="story_title">尿尿發電 讓手機永遠都滿格</div>
|
|
|
<div id="bq"></div></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<table style="width: 100%;" border="0" cellspacing="3" cellpadding="0">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td width="130%"><img src="http://s.udn.com.tw/2010/images/linedot.gif" alt="" /></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>
|
|
|
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td class="story_author" width="75%">
|
|
|
<div id="story_author">【經濟日報╱文/編譯余曉惠】</div></td>
|
|
|
<td class="story_author" width="25%">
|
|
|
<div id="story_update" align="right">2014.10.04 08:39 am</div></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="story_author"></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td valign="top">
|
|
|
<div id="story" class="story">
|
|
|
<div>
|
|
|
<table class="border" border="0" cellspacing="0" cellpadding="6" align="center">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td width="200">
|
|
|
<div id="media_file" align="center"><img src="http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567625.jpg?sn=14123813561993" alt="" /></div></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="photo_explanation"><span id="media_desc"><span id="media_desc_1">習慣小解完馬上沖水?別急!布里斯托機器人學實驗室(Bristol Robotics Laboratory,BRL)能把尿轉化成電力,幫手機充電。</span></span>
|
|
|
<span id="media_producer_1"><span id="media_producer">圖/網路</span><a href="http://www.facebook.com/sharer.php?s=100&amp;p[images][0]=http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567625.jpg?sn=14123813561993&amp;p[url]=http://udn.com/NEWS/WORLD/WOR4/8977566.shtml?ch=fb_share_photo&amp;p[summary]=%E7%BF%92%E6%85%A3%E5%B0%8F%E8%A7%A3%E5%AE%8C%E9%A6%AC%E4%B8%8A%E6%B2%96%E6%B0%B4%EF%BC%9F%E5%88%A5%E6%80%A5%EF%BC%81%E5%B8%83%E9%87%8C%E6%96%AF%E6%89%98%E6%A9%9F%E5%99%A8%E4%BA%BA%E5%AD%B8%E5%AF%A6%E9%A9%97%E5%AE%A4%EF%BC%88Bristol%20Robotics%20Laboratory%EF%BC%8CBRL%EF%BC%89%E8%83%BD%E6%8A%8A%E5%B0%BF%E8%BD%89%E5%8C%96%E6%88%90%E9%9B%BB%E5%8A%9B%EF%BC%8C%E5%B9%AB%E6%89%8B%E6%A9%9F%E5%85%85%E9%9B%BB%E3%80%82&amp;p[title]=%E5%B0%BF%E5%B0%BF%E7%99%BC%E9%9B%BB%20%E8%AE%93%E6%89%8B%E6%A9%9F%E6%B0%B8%E9%81%A0%E9%83%BD%E6%BB%BF%E6%A0%BC%20%7C%20%E5%9C%8B%E9%9A%9B%E8%90%AC%E8%B1%A1%20%7C%20%E5%85%A8%E7%90%83%E8%A7%80%E5%AF%9F%20%7C%20%E8%81%AF%E5%90%88%E6%96%B0%E8%81%9E%E7%B6%B2"><img src="http://s.udn.com.tw/2010MAIN/img/fb_share.png" alt="" /></a></span></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
習慣小解完馬上沖水?別急!布里斯托機器人學實驗室(Bristol Robotics Laboratory,BRL)能把尿轉化成電力,幫手機充電。</p>
|
|
|
|
|
|
<p>這個作法聽來有點荒唐,但在今年初由印度生技部和蓋茲基金會共同主辦的「廁所改造展」上,英國布里斯托大學和西英格蘭大學合組的BRL團隊,展示這種有特殊功能的小便斗。</p>
|
|
|
|
|
|
<p>布里斯托生物能源中心主任艾羅包洛斯(Yannis Ieropoulos)說:「原理很簡單,只要讓小便斗排水管直接通向微生物燃料電池(MFCs)就成了。不用幫浦,也不必準備什麼過濾網或細胞膜。」</p>
|
|
|
|
|
|
<p>艾羅包洛斯說,微生物燃料電池可以透過活生生的微生物體,把有機物質直接轉化為電力。</p>
|
|
|
|
|
|
<p>這種電力是微生物自然生命循環的的副產品,當他們吃下愈多尿液這種東西,就能產生愈多能量,提供更多電力。</p>
|
|
|
|
|
|
<p>目前全球每年可生產超過6兆公噸的尿液,代表發展成再生能源的商機很可觀。
|
|
|
<div>
|
|
|
<table class="border" border="0" cellspacing="0" cellpadding="6" align="center">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td width="200">
|
|
|
<div id="media_file" align="center"><img src="http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567621.jpg?sn=14123813561993" alt="" /></div></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="photo_explanation"><span id="media_desc"><span id="media_desc_1"><a href="http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567623.jpg"><strong>點此看大圖。</strong></a> 圖/經濟日報提供</span></span>
|
|
|
<span id="media_producer_1"><span id="media_producer"> </span><a href="http://www.facebook.com/sharer.php?s=100&amp;p[images][0]=http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567621.jpg?sn=14123813561993&amp;p[url]=http://udn.com/NEWS/WORLD/WOR4/8977566.shtml?ch=fb_share_photo&amp;p[summary]=%E9%BB%9E%E6%AD%A4%E7%9C%8B%E5%A4%A7%E5%9C%96%E3%80%82%20%E5%9C%96%EF%BC%8F%E7%B6%93%E6%BF%9F%E6%97%A5%E5%A0%B1%E6%8F%90%E4%BE%9B&amp;p[title]=%E5%B0%BF%E5%B0%BF%E7%99%BC%E9%9B%BB%20%E8%AE%93%E6%89%8B%E6%A9%9F%E6%B0%B8%E9%81%A0%E9%83%BD%E6%BB%BF%E6%A0%BC%20%7C%20%E5%9C%8B%E9%9A%9B%E8%90%AC%E8%B1%A1%20%7C%20%E5%85%A8%E7%90%83%E8%A7%80%E5%AF%9F%20%7C%20%E8%81%AF%E5%90%88%E6%96%B0%E8%81%9E%E7%B6%B2"><img src="http://s.udn.com.tw/2010MAIN/img/fb_share.png" alt="" /></a></span></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
BRL團隊利用尿液發電的微生物燃料電池,已經可供智慧手機傳簡訊、短時間通話與瀏覽網頁。</p>
|
|
|
|
|
|
<p>艾羅包洛斯說:「打電話是手機最耗電的功能,但我們會努力提高發電量,延長使用時間。」</p>
|
|
|
|
|
|
<p>這個計畫已經獲得蓋茲基金會等機構投資,未來將應用在廁所不足、供電不穩的開發中國家。</p>
|
|
|
|
|
|
<p>BRL團隊還希望把這種「電力尿」(urine-tricity)推廣到富裕國家,只要把微生物燃料電池加裝在現成的廁所,就能發電。終極目標則是善用廢物來生產能源,同時改善環境衛生,提高人類的生活品質。
|
|
|
<table class="border" border="0" cellspacing="0" cellpadding="6" align="right">
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td width="200">
|
|
|
<div id="media_file" align="center"><img src="http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567626.jpg?sn=14123813561993" alt="" /></div></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="photo_explanation"><span id="media_desc"><span id="media_desc_1"> </span></span>
|
|
|
<span id="media_producer_1"><span id="media_producer"> </span><a href="http://www.facebook.com/sharer.php?s=100&amp;p[images][0]=http://uc.udn.com.tw/NEWS/MEDIA/8977566-3567626.jpg?sn=14123813561993&amp;p[url]=http://udn.com/NEWS/WORLD/WOR4/8977566.shtml?ch=fb_share_photo&amp;p[summary]=%20&amp;p[title]=%E5%B0%BF%E5%B0%BF%E7%99%BC%E9%9B%BB%20%E8%AE%93%E6%89%8B%E6%A9%9F%E6%B0%B8%E9%81%A0%E9%83%BD%E6%BB%BF%E6%A0%BC%20%7C%20%E5%9C%8B%E9%9A%9B%E8%90%AC%E8%B1%A1%20%7C%20%E5%85%A8%E7%90%83%E8%A7%80%E5%AF%9F%20%7C%20%E8%81%AF%E5%90%88%E6%96%B0%E8%81%9E%E7%B6%B2"><img src="http://s.udn.com.tw/2010MAIN/img/fb_share.png" alt="" /></a></span></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
哥本哈根資訊科技大學(ITU)有一群科學家,也在研究如何把尿轉化成微生物燃料電池並發電,但不同之處在於,他們自己研發出名為「EVOBOT」的機器人,專門負責重複性高且耗時費力的實驗,用來證明初步研究結果的準確性。利用機器人做實驗,引發人類有朝一日被機器人取代的辯論,不過丹麥實驗室技術員協會(DALT)認為目前沒有這個問題。</p>
|
|
|
|
|
|
<p>協會主席巴恩韓森說,未來打算把EVOBOT送到率先研究微生物燃料電池的布里斯托大學,協助他們進行更多研究。</p>
|
|
|
|
|
|
<p></div></p>
|
|
|
|
|
|
<p><span id="source_name" class="story">【2014/10/04 經濟日報】</span><span class="author"><a href="http://udn.com/">@ </a><a href="http://udn.com/">http://udn.com/</a></span></p>
|
|
|
|
|
|
<p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</p>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="footer no-tags">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div id="disqus_thread"></div>
|
|
|
<script type="application/javascript">
|
|
|
var disqus_config = function () {
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
(function() {
|
|
|
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
|
|
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
|
|
|
return;
|
|
|
}
|
|
|
var d = document, s = d.createElement('script'); s.async = true;
|
|
|
s.src = '//' + "bilberry-hugo-theme" + '.disqus.com/embed.js';
|
|
|
s.setAttribute('data-timestamp', +new Date());
|
|
|
(d.head || d.body).appendChild(s);
|
|
|
})();
|
|
|
</script>
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
|
|
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<footer>
|
|
|
<div class="container">
|
|
|
|
|
|
|
|
|
<div class="recent-posts">
|
|
|
<strong>Latest posts</strong>
|
|
|
<ul>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/google-550-5-7-1-sloution/">寄信給google被退信 錯誤 550-5.7.1的解法</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/netdata-linux-system-performance-monitor-dashboard/">Netdata Linux System Performance Monitor Dashboard</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/linux-performance-monitor-dashboard-netdata-md/">Linux 底下極其詳細的System performace Monitor Dashboard - Netdata</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/syntax-test/">Syntax Test</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/psql-create-role-and-assign-priviledges/">psql create role and assign priviledges</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/study-url/">Study URL</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/article/rsync-time-backup/">[筆記] Linux 底下好用的備份工具 rsync-time-backup</a>
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="categories">
|
|
|
<a href="/categories/"><strong>Categories</strong></a>
|
|
|
<ul>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/%E6%9C%AA%E5%88%86%E9%A1%9E">未分類 (86)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/%E5%B7%A5%E4%BD%9C%E7%AD%86%E8%A8%98">工作筆記 (68)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/%E5%85%B6%E4%BB%96">其他 (46)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/%E7%AD%86%E8%A8%98">筆記 (30)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/%E5%89%AA%E5%A0%B1">剪報 (18)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/starting">Starting (5)</a>
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
<a href="/categories/blog">Blog (4)</a>
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="right">
|
|
|
|
|
|
<div class="external-profiles">
|
|
|
<strong>Social media</strong>
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://twitter.com/TheRealLednerb" target="_blank"><i class="fa fa-twitter-adblock-proof"></i></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/Lednerb" target="_blank"><i class="fa fa-github"></i></a>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="languages">
|
|
|
<strong>Other languages</strong>
|
|
|
|
|
|
|
|
|
<a href="/en" class="active">en</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a href="/de">de</a>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</footer>
|
|
|
|
|
|
|
|
|
<div class="credits">
|
|
|
<div class="container">
|
|
|
<div class="copyright">
|
|
|
<a href="https://github.com/Lednerb" target="_blank">
|
|
|
©
|
|
|
|
|
|
2017
|
|
|
|
|
|
by Lednerb
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
<div class="author">
|
|
|
<a href="https://github.com/Lednerb/bilberry-hugo-theme" target="_blank">Bilberry Hugo Theme</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="https://h.cowbay.org/js/externalDependencies.39c47e10e241eae2947b3fe21809c572.js" integrity="md5-OcR+EOJB6uKUez/iGAnFcg=="></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="https://h.cowbay.org/js/theme.ff50ae6dc1bfc220b23bf69dbb41b54e.js" integrity="md5-/1CubcG/wiCyO/adu0G1Tg=="></script>
|
|
|
|
|
|
<script>
|
|
|
$(".moment").each(function() {
|
|
|
$(this).text(
|
|
|
moment( $(this).text() )
|
|
|
.locale( "en" )
|
|
|
.format('LL')
|
|
|
);
|
|
|
});
|
|
|
|
|
|
$(".footnote-return sup").html("");
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
var client = algoliasearch("Y2C4RWMPXW", "50ea7f8c41c0ad233926e0be2b769ed1");
|
|
|
var index = client.initIndex("default-content");
|
|
|
|
|
|
$('#search').autocomplete({ hint: false, autoselect: true, debug: false },
|
|
|
[
|
|
|
{
|
|
|
|
|
|
source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, filters: 'language: en' }),
|
|
|
|
|
|
displayKey: function(suggestion) {
|
|
|
return suggestion.title || suggestion.author
|
|
|
},
|
|
|
templates: {
|
|
|
suggestion: function(suggestion) {
|
|
|
return "<span class='entry " + suggestion.type + "'>"
|
|
|
+ "<span class='title'>" + suggestion.title + "</span>"
|
|
|
+ "<span class='fa fa-fw " + suggestion.iconClass + "'></span>"
|
|
|
+ "</span>"
|
|
|
;
|
|
|
},
|
|
|
empty: function() {
|
|
|
return "<span class='empty'>Nothing found.</span>"
|
|
|
},
|
|
|
footer: function() {
|
|
|
return '<div class="branding">Powered by <img src="https:\/\/h.cowbay.org\/dist\/algolia-logo-light.svg" /></div>'
|
|
|
}
|
|
|
|
|
|
},
|
|
|
}
|
|
|
])
|
|
|
.on('autocomplete:selected', function(event, suggestion, dataset) {
|
|
|
window.location = (suggestion.url);
|
|
|
})
|
|
|
.keypress(function (event, suggestion) {
|
|
|
if (event.which == 13) {
|
|
|
window.location = (suggestion.url);
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
</html>
|