var outlineBrowserData = { version: "0.6.1", serialNum: 0, flTextBasedPermalinks: true, //1/26/17 by DW flProcessEmoji: true, //7/3/17 by DW expandCollapseCallback: function (idnum) { //9/22/17 by DW } } function getExpansionState () { var theList = ""; function stringDelete (s, ix, ct) { var start = ix - 1; var end = (ix + ct) - 1; var s1 = s.substr (0, start); var s2 = s.substr (end); return (s1 + s2); } $(".aOutlineWedgeLink i").each (function () { var flExpanded = $(this).hasClass ("fa-caret-down"); if (flExpanded) { var id = $(this).attr ("id"); //something like idOutlineWedge17 theList += stringDelete (id, 1, "idOutlineWedge".length) + ","; } }); if (theList.length > 0) { theList = stringDelete (theList, theList.length, 1); //remove trailing comma } return (theList); } function applyExpansionState (theList) { var splits = theList.split (","); for (var i = 0; i < splits.length; i++) { var idWedge = "#idOutlineWedge" + splits [i]; var idLevel = "#idOutlineLevel" + splits [i]; $(idWedge).attr ("class", "fa fa-caret-down"); $(idWedge).css ("color", "silver"); $(idLevel).css ("display", "block"); } } function ecOutline (idnum) { var c = document.getElementById ("idOutlineWedge" + idnum), idUL = "#idOutlineLevel" + idnum; if (c.className == "fa fa-caret-down") { c.className = "fa fa-caret-right"; c.style.color = "black"; $(idUL).slideUp (75); } else { c.className = "fa fa-caret-down"; c.style.color = "silver"; $(idUL).slideDown (75, undefined, function () { $(idUL).css ("display", "block"); }); } outlineBrowserData.expandCollapseCallback (idnum); //9/22/17 by DW } function riverGetPermalinkString (urlPermalink, permalinkString) { if (urlPermalink == undefined) { return (""); } if (permalinkString == undefined) { permalinkString = "#"; } return ("
" + permalinkString + "
"); } function renderOutlineBrowser (outline, flMarkdown, urlPermalink, permalinkString, flExpanded) { function stringLower (s) { if (s === undefined) { //1/26/15 by DW return (""); } s = s.toString (); //1/26/15 by DW return (s.toLowerCase ()); } function isAlpha (ch) { return (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))); } function isNumeric (ch) { return ((ch >= '0') && (ch <= '9')); } function stripMarkup (s) { //5/24/14 by DW if ((s === undefined) || (s == null) || (s.length == 0)) { return (""); } return (s.replace (/(<([^>]+)>)/ig, "")); } function innerCaseName (text) { //8/12/14 by DW var s = "", ch, flNextUpper = false; text = stripMarkup (text); for (var i = 0; i < text.length; i++) { ch = text [i]; if (isAlpha (ch) || isNumeric (ch)) { if (flNextUpper) { ch = ch.toUpperCase (); flNextUpper = false; } else { ch = ch.toLowerCase (); } s += ch; } else { if (ch == ' ') { flNextUpper = true; } } } return (s); } function filledString (ch, ct) { //6/4/14 by DW var s = ""; for (var i = 0; i < ct; i++) { s += ch; } return (s); } function getBoolean (val) { //12/5/13 by DW switch (typeof (val)) { case "string": if (val.toLowerCase () == "true") { return (true); } break; case "boolean": return (val); case "number": if (val == 1) { return (true); } break; } return (false); } function beginsWith (s, possibleBeginning, flUnicase) { if (s.length == 0) { //1/1/14 by DW return (false); } if (flUnicase === undefined) { flUnicase = true; } if (flUnicase) { for (var i = 0; i < possibleBeginning.length; i++) { if (stringLower (s [i]) != stringLower (possibleBeginning [i])) { return (false); } } } else { for (var i = 0; i < possibleBeginning.length; i++) { if (s [i] != possibleBeginning [i]) { return (false); } } } return (true); } function hotUpText (s, url) { //7/18/14 by DW if (url === undefined) { //makes it easier to call -- 3/14/14 by DW return (s); } function linkit (s) { return ("" + s + ""); } var ixleft = s.indexOf ("["), ixright = s.indexOf ("]"); if ((ixleft == -1) || (ixright == -1)) { return (linkit (s)); } if (ixright < ixleft) { return (linkit (s)); } var linktext = s.substr (ixleft + 1, ixright - ixleft - 1); //string.mid (s, ixleft, ixright - ixleft + 1); linktext = "" + linktext + ""; var leftpart = s.substr (0, ixleft); var rightpart = s.substr (ixright + 1, s.length); s = leftpart + linktext + rightpart; return (s); } function debugNode (theNode) { var attstext = ""; for (var x in theNode) { if ((x != "subs") && (x != "parent") && (x != "created")) { if (attstext.length > 0) { attstext += ", "; } attstext += x + "=" + theNode [x]; } } return (attstext); } function getNodeType (theNode) { if (theNode.type == "include") { return (theNode.includetype); //this allows include nodes to have types } else { return (theNode.type); } } function getNameAtt (theNode) { var nameatt = theNode.name; if (nameatt === undefined) { nameatt = innerCaseName (theNode.text); } return (nameatt); } function typeIsDoc (theNode) { var type = getNodeType (theNode); return ((type !== undefined) && (type != "include") && (type != "link") && (type != "tweet")); } function getIcon (idnum, flcollapsed) { var wedgedir, color; if (flcollapsed) { wedgedir = "right"; color = "black"; } else { wedgedir = "down"; color = "silver"; } var clickscript = "onclick=\"ecOutline (" + idnum + ")\" "; var icon = ""; return (icon); } function expandableTextLink (theText, idLevel) { return ("" + theText + ""); } var htmltext = "", indentlevel = 0, permalink = riverGetPermalinkString (urlPermalink, permalinkString), outlinelevel = 0; var markdown = undefined; //9/2/21 by DW if (flMarkdown === undefined) { flMarkdown = false; } if (flMarkdown) { markdown = new Markdown.Converter (); } if (flExpanded === undefined) { //10/23/14 by DW flExpanded = riverBrowserData.flOutlinesExpandedByDefault; //4/16/15 by DW } function add (s) { htmltext += filledString ("\t", indentlevel) + s + "\r\n"; } function getHotText (outline) { var origtext = outline.text; var s = hotUpText (outline.text, outline.url); if (s != origtext) { return (s); } else { if (getBoolean (outline.bold)) { //12/6/14 by DW s = "" + s + ""; } return (expandableTextLink (s, outlineBrowserData.serialNum)); } } function hasSubs (outline) { return (outline.subs != undefined) && (outline.subs.length > 0); } function getImgHtml (outline) { //7/15/15 by DW var urlImage = outline.image; if (urlImage === undefined) { urlImage = outline.img; } if ((outline.type !== undefined) || (urlImage === undefined)) { return (""); } else { return (""); } } function gatherStylesFromOutline (outline) { //11/5/14 by DW var atts = new Object (), styles = new Object (); for (var x in outline) { switch (x) { case "color": case "direction": case "font-family": case "font-size": case "font-weight": case "letter-spacing": case "line-height": case "margin-left": case "text-decoration": case "text-shadow": case "text-transform": case "white-space": case "word-spacing": styles [x] = outline [x]; break; } } return (styles); } function getStylesString (outline, flcollapsed) { //11/7/14 by DW var styles = gatherStylesFromOutline (outline), style = ""; if (flcollapsed) { styles.display = "none"; } for (var x in styles) { style += x + ": " + styles [x] + "; "; } if (style.length > 0) { style = " style=\"" + style + "\""; } return (style); } function getSubsMarkdownText (outline) { var s = "", style = getStylesString (outline, false); for (var i = 0; i < outline.subs.length; i++) { var child = outline.subs [i], img = "", imgatt; if (!getBoolean (child.isComment)) { //5/2/15 by DW s += getImgHtml (child) + child.text + "\r\r"; if (hasSubs (child)) { s += getSubsMarkdownText (child); } } } return (s); } function getNodePermalink (theNode) { //6/5/16 by DW var permalinkstring = ""; function textPermalink () { var theName = "", splits = stripMarkup (theNode.text).split (" "); for (var i = 0; i < splits.length; i++) { var ch = splits [i] [0]; if (isAlpha (ch)) { theName += ch.toLowerCase (); } if (theName.length >= 4) { break; } } return (theName); } function datePermalink () { return (new Date (theNode.created).getTime ().toString ()); } if (getBoolean (theNode.flPermalink)) { var theName = "", splits = stripMarkup (theNode.text).split (" "); if (outlineBrowserData.flTextBasedPermalinks) { //1/26/17 by DW theName = textPermalink (); } else { if (theNode.created !== undefined) { theName = datePermalink (); } else { theName = textPermalink (); } } permalinkstring = "" + "#" + ""; } return (permalinkstring); } function getOutlineTextClass (theNode) { //9/20/18 by DW var myClass = "divOutlineText"; if (theNode.flCursor) { myClass += " divOutlineCursor"; } return (" class=\"" + myClass + "\""); } function getNodeText (theNode) { //7/24/22 by DW function getInlineImage (theText, urlImage) { return ("
" + theText + "
"); } function getImageHtml (theNode) { var imgHtml = ""; if (theNode.image !== undefined) { imgHtml = ""; if (theNode.imageLink !== undefined) { //5/26/20 by DW imgHtml = "" + imgHtml + ""; } } return (imgHtml); } var theText = theNode.text; if (theNode.inlineimage !== undefined) { theText = getInlineImage (theText, theNode.inlineimage); } else { if (theNode.image !== undefined) { theText = getImageHtml (theNode) + theText; } } return (theText); } function addChildlessSub (theNode, path) { //5/20/15 by DW var theText = getNodeText (theNode); //7/24/22 by DW if (typeIsDoc (theNode)) { add ("
  • " + theText + "" + getNodePermalink (theNode) + "
  • "); } else { var type = getNodeType (theNode); switch (type) { case "link": add ("
  • " + theText + "" + getNodePermalink (theNode) + "
  • "); break; default: //7/24/22 by DW add ("
  • " + theText + getNodePermalink (theNode) + "
  • "); break; } } } function addSubs (outline, flcollapsed, path) { if (hasSubs (outline)) { var style = getStylesString (outline, flcollapsed), ulAddedClass = ""; if (getBoolean (outline.flNumberedSubs)) { //6/23/17 by DW ulAddedClass = " ulNumberedSubs"; } else { if (getBoolean (outline.flBulletedSubs)) { //8/24/18 by DW ulAddedClass = " ulBulletedSubs"; } else { if (getBoolean (outline.flCodeSubs)) { //4/23/20 by DW ulAddedClass = " ulCodeSubs"; } } } add (""); indentlevel--; outlinelevel--; } } if (hasSubs (outline)) { //9/22/14 by DW add ("
    "); indentlevel++; if (outline.text !== undefined) { //9/2/21 by DW var flTopLevelCollapsed = !flExpanded, theText = getHotText (outline); add ("
    " + getIcon (outlineBrowserData.serialNum, flTopLevelCollapsed) + theText + permalink + "
    "); } if (flMarkdown) { var markdowntext = getSubsMarkdownText (outline), style = ""; if (flTopLevelCollapsed) { //10/23/14 by DW style = " style=\"display: none;\""; } var opendiv = "
    "; add (opendiv + markdown.makeHtml (markdowntext) + "
    "); } else { add ("
    "); indentlevel++; addSubs (outline, flTopLevelCollapsed, ""); add ("
    "); indentlevel--; } add ("
    "); indentlevel--; outlineBrowserData.serialNum++; //9/22/14 by DW } else { var theText = getNodeText (outline); //7/24/22 by DW add ("
    "); indentlevel++; add ("
    " + hotUpText (theText, outline.url) + permalink + "
    "); add ("
    "); indentlevel--; } return (htmltext); }