Giter Site home page Giter Site logo

nfreear / scroll-to-text Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 435 KB

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

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

HTML 66.04% JavaScript 27.09% CSS 6.87%
proxy scrollto highlight fetch

scroll-to-text's Introduction

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.

scroll-to-text's People

Contributors

dependabot[bot] avatar nfreear avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

scrolltotext

scroll-to-text's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.