0.0.17 • Published 4 years ago

@linalgo/annotate-core v0.0.17

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
4 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

4 years ago

0.0.17

4 years ago

0.0.15

4 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago