...


note … SPLIT UP WALL OF TEXT NODES .. (innerHTML ➔ innerText) … REPLACE BIG CHUNCKS OF TEXT WITH A BUNCH OF SMALLER PARAGRAPHS … SPLIT INTO LINES TODO: scroll into view only if not already visible

note … RESTORE ONLOAD [open] STATE .. f(localStorage) … LISTEN TO DETAILS EVENT .. (mousedown toggle) … DETAILS RADIO-BEHAVIOR .. f(localStorage) … OPEN LINKS HASH TARGETS DETAILS-CONTAINERS .. (details_add_hash_link_onclick_listener);


dom_sentence
 
/*
./script/dom_sentence.js
*/
let dom_sentence_js_data ="data:text/javascript;charset='utf-8',"+ escape(`
`
dom_sentence_event
 
/*
./script/stub/dom_sentence_event.js
*/
let dom_sentence_event_js_data ="data:text/javascript;charset='utf-8',"+ escape(`
`
dom_sentence_util
 
/*
./script/stub/dom_sentence_util.js
*/
let dom_sentence_util_js_data ="data:text/javascript;charset='utf-8',"+ escape(`
`
dom_scroll
 
/*
./script/stub/dom_scroll.js
*/
let dom_scroll_js_data ="data:text/javascript;charset='utf-8',"+ escape(`
`
dom_log
 
/*
./script/stub/dom_log.js
*/
let dom_log_js_data ="data:text/javascript;charset='utf-8',"+ escape(`
`

String.prototype.replace()

The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. If pattern is a string, only the first occurrence will be replaced. The original string is left unchanged

Parameters

regexp (pattern)

A RegExp object or literal. The match or matches are replaced with newSubstr or the value returned by the specified replacerFunction.

substr

A String that is to be replaced by newSubstr. It is treated as a literal string and is not interpreted as a regular expression. Only the first occurrence will be replaced.

newSubstr (replacement)

The String that replaces the substring specified by the specified regexp or substr parameter. A number of special replacement patterns are supported; see the "Specifying a string as a parameter" section below. If newSubstr is an empty string, then the substring given by substr, or the matches for regexp, are removed (rather then being replaced).

replacerFunction (replacement)

A function to be invoked to create the new substring to be used to replace the matches to the given regexp or substr. The arguments supplied to this function are described in the "Specifying a function as a parameter" section below.