Add license

This commit is contained in:
Daniel Imms
2017-02-09 20:12:35 -08:00
parent 551159e0c3
commit 55cb43d70b
2 changed files with 19 additions and 8 deletions
+4
View File
@@ -1,3 +1,7 @@
/**
* @license MIT
*/
/**
* C0 control codes
* See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
+15 -8
View File
@@ -1,9 +1,10 @@
/**
* The time to wait after a row is changed before it is linkified. This prevents
* the costly operation of searching every row multiple times, pntentially a
* huge aount of times.
* @license MIT
*/
const TIME_BEFORE_LINKIFY = 200;
export type LinkHandler = (uri: string) => void;
type LinkMatcher = {id: number, regex: RegExp, handler: LinkHandler};
const protocolClause = '(https?:\\/\\/)';
const domainCharacterSet = '[\\da-z\\.-]+';
@@ -20,12 +21,18 @@ const start = '(?:^|' + negatedDomainCharacterSet + ')(';
const end = ')($|' + negatedPathCharacterSet + ')';
const strictUrlRegex = new RegExp(start + protocolClause + bodyClause + end);
export type LinkHandler = (uri: string) => void;
type LinkMatcher = {id: number, regex: RegExp, handler: LinkHandler};
/**
* The ID of the built in http(s) link matcher.
*/
const HYPERTEXT_LINK_MATCHER_ID = 0;
/**
* The time to wait after a row is changed before it is linkified. This prevents
* the costly operation of searching every row multiple times, pntentially a
* huge aount of times.
*/
const TIME_BEFORE_LINKIFY = 200;
/**
* The Linkifier applies links to rows shortly after they have been refreshed.
*/