A lightweight, customizable omnibox in JavaScript

栏目: IT技术 · 发布时间: 5年前

A lightweight, customizable omnibox in JavaScript

jinabox.js is a lightweight, customizable omnibox. You can use it for searching text, images, videos, audios or all kinds of data with a Jina backend .

Quick Start

A lightweight, customizable omnibox in JavaScript

In HTML, include the minified script:

<script src="https://unpkg.com/jinabox"></script>
<script>
    jb = window.JinaBox
    jb.init('http://0.0.0.0:65481/api/search');  // http://0.0.0.0:65481/api/search is the endpoint of the REST gateway of a Jina backend.
</script>

Then, create a container where the searchbar/floater is to appear:

<jina-searchbar/>

<!--or-->

<jina-floater/>

Run one of those prebuilt backend:

  • Pokedex (real image data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.bitsearch-pokedex search
  • Southpark (real text data): docker run -p 45678:45678 jinaai/hub.app.distilbert-southpark
  • MP4 mock (placeholder video data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.iomock.mp4 search
  • Wav mock (placeholder audio data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.iomock.sound search

Now you can drag anything from anywhere (local/browser/webpage) to it and conduct the search.

Ready to learn Jina? Read our 101 tutorials .

Using with a module bundler

npm install jinabox
# or
yarn add jinabox

Features

  • an easy-to-use web component for Jina search backend;
  • allow user to drag-and-drop multi-modal data as queries to search;
  • webcam and mic support (in progress, contribution welcome! :heart: );
  • visualize the search results in a dropdown list or a separate container;
  • highly customizable.

Supported MIME types

MIME type Input (Query) Output (Result) Description
text typing list only Text-only data including any human-readable content, source code, or textual data such as comma-separated value (CSV) formatted data. Examples include text/plain , text/csv , and text/html .
image drag-and-drop <img> containers in list/grid view Image or graphical data including both bitmap and vector still images as well as animated versions of still image formats such as animated GIF or APNG. Common examples are image/jpeg , image/png , and image/svg+xml .
video drag-and-drop, webcam <video> containers in list/grid view Video data or files, such as MP4 movies ( video/mp4 ).
audio drag-and-drop, webcam, mic <audio> containers in list view Audio or music data. Examples include audio/mpeg , audio/vorbis .

Configuration

Settings Description
theme Color theme: persian , pompelmo , honeybee , none
typewriterEffect Enable typewriter effect on the placeholder
typewriterDelayItem Time (ms) delays between every placeholder
typewriterDelayCharacter Time (ms) delays between every character

Browser support

jinabox.js runs on modern browsers supporting Web Audio, including Firefox, Chrome, Safari (desktop and mobile) and Opera.

Troubleshooting

SSL error on my localhost

Try http://localhost:65481/api/search , make sure to use http and localhost , instead of 0.0.0.0 .

License

Copyright (c) 2020 Jina AI Limited. All rights reserved.

Jina is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

YC创业营: 硅谷顶级创业孵化器如何改变世界

YC创业营: 硅谷顶级创业孵化器如何改变世界

兰德尔·斯特罗斯 (Randall Stross) / 苏健 / 浙江人民出版社 / 2014-8-1 / CNY 52.90

在互联网创业成本日益降低、融资却越来越难的今天,硅谷的Y Combinator因何成为全世界创业者趋之若鹜的创业圣地?为什么25岁左右的青年最适合创业?创业者如何才能在遴选面试中脱颖而出?为什么YC特别看好那些主要由黑客组成的创业团队? YC真的歧视女性吗?如何想出能够赢得投资的新点子?创业者应该如何寻找联合创始人? 获准进入Y Combinator及其创业公司全程跟踪批量投资项目的第一人,......一起来看看 《YC创业营: 硅谷顶级创业孵化器如何改变世界》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具