0.0.17 • Published 5 years ago

@linalgo/annotate-core v0.0.17

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
5 years ago

annotate-core

Installation

npm i @linalgo/annotate-core

How to use

import { Annotator } from './annotators/annotator';

document.addEventListener('selectionchange', function () {
  let selection = window.getSelection();
  range = selection.getRangeAt(0);
});

function highlight(range: Range) {
  const annotation = annotator.createAnnotation(range, 'test', 'test', document.URL, 'test');
  annotator.showAnnotation(annotation);
  console.log(JSON.stringify(annotation));
}

let range: Range;
const annotator = new Annotator(document, 'mark');
let btn = document.getElementById('button');
btn.addEventListener('click', (e: Event) => highlight(range));
0.0.16

5 years ago

0.0.17

5 years ago

0.0.15

5 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago