nfreear / scroll-to-text

Javascript proxy to serve a web-page and scroll to an arbitrary text. [WIP]

Home Page:https://scrolltotext.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build & test status — Travis-CI

scroll-to-text

A Javascript-based proxy to serve a web-page, and highlight and scroll to an arbitrary text.

Read the blog post.

Features:

  • Supports single or multiple words;
  • Scrolls to the Nth occurrence of the word/phrase;
  • Supports non-Latin characters (e.g. accent characters ...) (multi-lingual?);
  • URL parameter to modify the highlight background colour;
  • Smooth-scrolling implemented;

Install .. build .. test .. serve

npm install
npm build
npm test
npm start

Web API

With minimal parameters in the request URL:

  • /?url={URL}&text={MY TEXT}

With optional occurrence number:

  • /?url={URL}&text={MY TEXT}&occurrence={N}

With optional highlight background colour keywords:

  • /?url={URL}&text={MY TEXT}&bg={BACKGROUND COLOUR NAME}

API examples:

  • /?url=http://kiplingsociety.co.uk/poems_if.htm&text=Kings
  • /?url=http://kiplingsociety.co.uk/poems_if.htm&text=Kings&bg=pink

Examples

Limitations

  • Not supported in MS Internet Explorer (works in Chrome, Firefox; other browsers not yet tested)
  • highlight-phrase.js can sometimes corrupt the proxied HTML page(!)
  • Case-sensitive text 'searching';
  • Need to wire in the form;
  • Need a loading spinner;
  • ... ?

Included

The following are included and extended as part of scroll-to-text:

Disclaimer

I claim no ownership over the web-content presented [below] via the 'scroll-to-text' proxy service, and accept no responsibility for it. Images and other resources may be missing from proxied content (browser security restrictions?) This is prototype software which may contain bugs!


© 2018-2019 Nick Freear & contributors | License: MIT.

About

Javascript proxy to serve a web-page and scroll to an arbitrary text. [WIP]

https://scrolltotext.github.io


Languages

Language:HTML 66.0%Language:JavaScript 27.1%Language:CSS 6.9%