11// Script: PinNote
22// By: Keith Curtis
33// Contact: https://app.roll20.net/users/162065/keithcurtis
4+ var API_Meta = API_Meta || { } ; //eslint-disable-line no-var
5+ API_Meta . PinNote = { offset :Number . MAX_SAFE_INTEGER , lineCount :- 1 } ;
6+ { try { throw new Error ( '' ) ; } catch ( e ) { API_Meta . PinNote . offset = ( parseInt ( e . stack . split ( / \n / ) [ 1 ] . replace ( / ^ .* : ( \d + ) : .* $ / , '$1' ) , 10 ) - 6 ) ; } }
47
5- const pinnote = ( ( ) => {
6- // (() => {
8+
9+ ( ( ) => {
710 'use strict' ;
811
912 const version = '1.0.0' ; //version number set here
@@ -40,17 +43,6 @@ const pinnote = (() => {
4043 ) ;
4144 } ;
4245
43-
44- const normalizeHTML = ( html ) => {
45- if ( ! html ) return html ;
46-
47- return html
48- . replace ( / \r \n / g, '' ) // Windows line endings
49- . replace ( / \n / g, '' ) // Unix line endings
50- . replace ( / \r / g, '' ) ; // Old Mac line endings
51- } ;
52-
53-
5446 /* ============================================================
5547 * HEADER COLOR ENFORCEMENT
5648 * ============================================================ */
@@ -281,8 +273,7 @@ const normalizeHTML = (html) => {
281273 template . footer +
282274 '</div>' ;
283275
284- sendChat ( sender , whisperPrefix + normalizeHTML ( html ) ) ;
285-
276+ sendChat ( sender , whisperPrefix + html ) ;
286277 return ;
287278 }
288279
@@ -346,8 +337,9 @@ const normalizeHTML = (html) => {
346337 template . footer +
347338 '</div>' ;
348339
349- sendChat ( sender , whisperPrefix + normalizeHTML ( html ) ) ;
350-
340+ sendChat ( sender , whisperPrefix + html ) ;
351341 } ) ;
352342
353- } ) ( ) ;
343+ } ) ( ) ;
344+
345+ { try { throw new Error ( '' ) ; } catch ( e ) { API_Meta . PinNote . lineCount = ( parseInt ( e . stack . split ( / \n / ) [ 1 ] . replace ( / ^ .* : ( \d + ) : .* $ / , '$1' ) , 10 ) - API_Meta . PinNote . offset ) ; } }
0 commit comments