├── misc └── favicon.ico ├── riverBrowserIncludes ├── emojify.css ├── emojify.js ├── riverbrowser.css ├── dateFormat.js ├── outlinebrowser.js ├── riverbrowser.js └── emojify2.js ├── basicincludes2 ├── app.js ├── beep.js ├── menus.js ├── ga.js ├── jBeep.min.js ├── menus.css ├── alertdialog.js ├── confirmdialog.js ├── askdialog.js ├── app.css ├── strftime.js ├── appprefs.js └── bootstrap.min.js ├── concord ├── outlinedialog.css ├── tableeditor.css ├── concordKeyboard.js ├── tableeditor.js ├── outlinedialog.js ├── arrowpad.js ├── concord.css ├── twoutliner.js ├── buildrss.js └── xml.js ├── package.json ├── README.md ├── LICENSE ├── feedviewer ├── styles.css ├── index.html └── code.js ├── filelist.opml └── river5 └── serverhomepage.html /misc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scripting/cdn/master/misc/favicon.ico -------------------------------------------------------------------------------- /riverBrowserIncludes/emojify.css: -------------------------------------------------------------------------------- 1 | .emoji { 2 | width: 1em; 3 | height: 1em; 4 | display: inline-block; 5 | margin-bottom: 0; 6 | } 7 | -------------------------------------------------------------------------------- /basicincludes2/app.js: -------------------------------------------------------------------------------- 1 | function aboutDialog () { 2 | alertDialog (appConsts.productnameForDisplay + " v" + appConsts.version + "."); 3 | } 4 | -------------------------------------------------------------------------------- /concord/outlinedialog.css: -------------------------------------------------------------------------------- 1 | .divOutlineDialog { 2 | } 3 | .divOutlineDialogOutline { 4 | font-family: "Arial"; 5 | font-size: 16px; 6 | line-height: 22px; 7 | min-height: 200px; 8 | } 9 | .divOutlineDialogTitle { 10 | font-weight: bold; 11 | } 12 | -------------------------------------------------------------------------------- /basicincludes2/beep.js: -------------------------------------------------------------------------------- 1 | document.write (""); 2 | function speakerBeep () { //12/4/14 by DW 3 | jBeep ("http://outliner.smallpicture.com/js/jBeep/beep.wav"); 4 | } 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "davecdn", 3 | "description": "A package containing files I want to access over jsdelivr cdn.", 4 | "author": "Dave Winer ", 5 | "version": "0.4.4", 6 | "homepage": "https://github.com/scripting/cdn", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/scripting/cdn" 10 | }, 11 | "dependencies" : { 12 | }, 13 | "license": "MIT", 14 | "engines": { 15 | "node": "*" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /riverBrowserIncludes/emojify.js: -------------------------------------------------------------------------------- 1 | document.write (""); 2 | document.write (""); 3 | 4 | 5 | function emojiProcess (s, myDirectory) { 6 | if (myDirectory === undefined) { //1/11/17 by DW 7 | myDirectory = "http://fargo.io/code/emojify/images/emoji"; 8 | } 9 | else { 10 | if (endsWith (myDirectory, "/")) { //1/11/17 by DW 11 | myDirectory = stringDelete (myDirectory, myDirectory.length, 1); 12 | } 13 | } 14 | emojify.setConfig ({ 15 | img_dir: myDirectory 16 | }); 17 | s = emojify.replace (s, function (emoji, name) { 18 | return "" + name + ""; 19 | }); 20 | return (s); 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Every file in this package is accessible through jsdelivr. 2 | 3 | For example 4 | 5 | 1. https://cdn.jsdelivr.net/npm/davecdn/concord/concord.js 6 | 7 | 2. https://cdn.jsdelivr.net/npm/davecdn/concord/arrowpad.js 8 | 9 | 3. https://cdn.jsdelivr.net/npm/davecdn/concord/concord.css 10 | 11 | 4. https://cdn.jsdelivr.net/npm/davecdn/concord/concordKeyboard.js 12 | 13 | 5. https://cdn.jsdelivr.net/npm/davecdn/concord/outliner.js 14 | 15 | 6. https://cdn.jsdelivr.net/npm/davecdn/concord/twoutliner.js 16 | 17 | 7. https://cdn.jsdelivr.net/npm/davecdn/concord/xml.js 18 | 19 | 8. https://cdn.jsdelivr.net/npm/davecdn/concord/tableeditor.js 20 | 21 | 9. https://cdn.jsdelivr.net/npm/davecdn/concord/tableeditor.css 22 | 23 | 10. https://cdn.jsdelivr.net/npm/davecdn/concord/buildrss.js 24 | 25 | More info as it is available. 26 | 27 | 4/21/18; 6:59:34 PM by DW 28 | 29 | -------------------------------------------------------------------------------- /concord/tableeditor.css: -------------------------------------------------------------------------------- 1 | .divAttsDialog { 2 | font-family: Ubuntu; 3 | } 4 | .divAttsDialog .modal { 5 | left: 40%; 6 | width: 740px; 7 | } 8 | .divAttsDialog .btn { 9 | width: 80px; 10 | margin-left: 5px; 11 | } 12 | .tableAttributeEditor { 13 | margin-left: auto; 14 | margin-right: auto; 15 | margin-top: 10px; 16 | margin-bottom: 20px; 17 | } 18 | .tableAttributeEditor td { 19 | font-size: 14px; 20 | border: none; 21 | padding: 0; 22 | } 23 | .tableAttributeEditor thead td { 24 | font-size: 14px; 25 | font-weight: bold; 26 | padding: 3px; 27 | } 28 | .tableAttributeEditor input { 29 | width: 300px; 30 | font-size: 16px; 31 | height: 32px; 32 | margin: 5px; 33 | padding: 0; 34 | 35 | padding-left: 2px; 36 | padding-right: 2px; 37 | } 38 | .divAttsDialog .modal-body { 39 | padding-top: 5px; 40 | padding-bottom: 5px; 41 | } 42 | .divAttsDialog #idAddButton { 43 | width: 1.5em; 44 | } 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Dave Winer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /basicincludes2/menus.js: -------------------------------------------------------------------------------- 1 | var twittericon = ""; //7/22/14 by DW 2 | 3 | function nukeDisabledMenuItems () { //11/16/15 by DW 4 | $(".dropdown-menu li").each (function () { 5 | if ($(this).hasClass ("disabled")) { 6 | $(this).children ().first ().attr ("onclick", ""); //nuke the command 7 | } 8 | }); 9 | } 10 | function initMenus () { 11 | document.getElementById ("idMenuProductName").innerHTML = appConsts.productnameForDisplay; 12 | document.getElementById ("idMenuAboutProductName").innerHTML = appConsts.productnameForDisplay; 13 | $("#idMenubar .dropdown-menu li").each (function () { 14 | var li = $(this); 15 | var liContent = li.html (); 16 | liContent = liContent.replace ("Cmd-", getCmdKeyPrefix ()); 17 | li.html (liContent); 18 | }); 19 | nukeDisabledMenuItems (); 20 | } 21 | function initTwitterMenuItems () { 22 | twUpdateTwitterMenuItem ("idTwitterConnectMenuItem"); 23 | twUpdateTwitterUsername ("idTwitterUsername"); 24 | $("#idTwitterIcon").html (twittericon); 25 | } 26 | function initFacebookMenuItems () { 27 | fbUpdateFacebookMenuItem ("idFacebookConnectMenuItem"); 28 | } 29 | -------------------------------------------------------------------------------- /basicincludes2/ga.js: -------------------------------------------------------------------------------- 1 | 2 | var whenLastGoogleAnalyticsPing = new Date (0); 3 | 4 | 5 | function initGoogleAnalytics (theDomain, theGoogleAccount) { //7/11/15 by DW -- new optional param 6 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 7 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 8 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 9 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 10 | 11 | if (theDomain === undefined) { //7/11/15 by DW 12 | try { 13 | theDomain = appConsts.domain; 14 | } 15 | catch (err) { 16 | theDomain = window.location.hostname; 17 | } 18 | } 19 | if (theGoogleAccount === undefined) { //8/8/16 by DW 20 | theGoogleAccount = "UA-39531990-1"; 21 | } 22 | 23 | ga('create', theGoogleAccount, theDomain); 24 | ga('send', 'pageview'); 25 | } 26 | function pingGoogleAnalytics () { 27 | if (secondsSince (whenLastGoogleAnalyticsPing) >= 300) { //ping google analytics every 5 minutes 28 | if (secondsSince (whenLastUserAction) <= 300) { //don't ping if the user isn't doing anything 29 | ga ("send", "pageview"); 30 | } 31 | whenLastGoogleAnalyticsPing = new Date (); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /basicincludes2/jBeep.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jBeep 3 | * 4 | * Play WAV beeps easily in javascript! 5 | * Tested on all popular browsers and works perfectly, including IE6. 6 | * 7 | * @date 10-19-2012 8 | * @license MIT 9 | * @author Everton (www.ultraduz.com.br) 10 | * @version 1.0 11 | * @params soundFile The .WAV sound path 12 | */ 13 | function jBeep(a){if(!a)a="jBeep/jBeep.wav";var b,c,d;d=true;try{if(typeof document.createElement("audio").play=="undefined")d=false}catch(e){d=false}c=document.getElementsByTagName("body")[0];if(!c)c=document.getElementsByTagName("html")[0];b=document.getElementById("jBeep");if(b)c.removeChild(b);if(d){b=document.createElement("audio");b.setAttribute("id","jBeep");b.setAttribute("src",a);b.play()}else if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){b=document.createElement("bgsound");b.setAttribute("id","jBeep");b.setAttribute("loop",1);b.setAttribute("src",a);c.appendChild(b)}else{var f;b=document.createElement("object");b.setAttribute("id","jBeep");b.setAttribute("type","audio/wav");b.setAttribute("style","display:none;");b.setAttribute("data",a);f=document.createElement("param");f.setAttribute("name","autostart");f.setAttribute("value","false");b.appendChild(f);c.appendChild(b);try{b.Play()}catch(e){b.object.Play()}}} -------------------------------------------------------------------------------- /basicincludes2/menus.css: -------------------------------------------------------------------------------- 1 | .divMenubar { 2 | } 3 | .divMenubar .container { 4 | width: 840px; 5 | } 6 | .divMenubar .dropdown { 7 | font-family: Ubuntu; 8 | font-size: 16px; 9 | margin-top: 5px; 10 | margin-bottom: 5px; 11 | } 12 | .divMenubar .navbar .nav > li > a { 13 | font-size: 16px; 14 | letter-spacing: .05em; 15 | padding-top: 12px; 16 | padding-left: 8px; padding-right: 8px; //6/3/13 by DW 17 | outline: none !important; 18 | } 19 | .dropdown-menu > li > a { 20 | cursor: pointer; 21 | } 22 | .navbar-inner { 23 | -moz-border-radius: 0; 24 | -moz-border-radius: none; 25 | -moz-box-shadow: none; 26 | background-image: none; 27 | border-radius: 0; 28 | } 29 | .divMenubar .brand { 30 | margin-top: 5px; 31 | margin-bottom: 5px; 32 | } 33 | .divMenubar .nav li { 34 | font-family: Ubuntu; 35 | font-size: 16px; 36 | font-weight: bold; 37 | } 38 | .menuKeystroke { 39 | float: right; 40 | margin-left: 25px; 41 | } 42 | .menuKeystroke:before { 43 | content: ""; 44 | } 45 | #idMenuProductName { 46 | font-family: Rancho; 47 | font-size: 32px; 48 | } 49 | .divNavSocialMediaLinks { 50 | margin-top: 15px; 51 | font-size: 1.3em; 52 | float: right; 53 | } 54 | .divNavSocialMediaLinks .nav>li>a { 55 | display: inline; 56 | } 57 | .divNavSocialMediaLinks .aSocialMediaLink { 58 | letter-spacing: 14px; 59 | } 60 | -------------------------------------------------------------------------------- /basicincludes2/alertdialog.js: -------------------------------------------------------------------------------- 1 | var flAlertDialogSetUp = false, alertDialogCallback = undefined; 2 | 3 | function setupAlertDialog () { 4 | var s = 5 | "
\"alert
OK
" 6 | $("body").prepend (s); 7 | $("#idAlertDialog").on ("keydown", function (event) { //5/6/13 by DW 8 | if (event.which == 13) { 9 | okAlertDialog (); 10 | return (false); 11 | } 12 | }); 13 | return (s); 14 | } 15 | function okAlertDialog () { 16 | $("#idAlertDialog").modal ('hide'); 17 | if (alertDialogCallback !== undefined) { 18 | alertDialogCallback (); 19 | } 20 | alertDialogCallback = undefined; 21 | }; 22 | function alertDialog (prompt, callback) { 23 | if (!flAlertDialogSetUp) { 24 | setupAlertDialog (); 25 | flAlertDialogSetUp = true; 26 | } 27 | document.getElementById ("idAlertDialogPrompt").innerHTML = prompt; 28 | $("#idAlertDialog").modal ("show"); 29 | alertDialogCallback = callback; 30 | } 31 | -------------------------------------------------------------------------------- /basicincludes2/confirmdialog.js: -------------------------------------------------------------------------------- 1 | var flConfirmDialogSetUp = false; 2 | var confirmDialogCallback; 3 | 4 | function setupConfirmDialog () { 5 | var s = 6 | "
" 7 | $("body").prepend (s) 8 | $("#idConfirmDialog").on ("keydown", function (event) { //5/6/13 by DW 9 | if (event.which == 13) { 10 | okConfirmDialog (); 11 | return (false); 12 | } 13 | }); 14 | return (s); 15 | } 16 | function closeConfirmDialog () { 17 | $("#idConfirmDialog").modal ('hide'); 18 | }; 19 | function okConfirmDialog () { 20 | $("#idConfirmDialog").modal ('hide'); 21 | confirmDialogCallback (); 22 | }; 23 | function confirmDialog (prompt, callback) { 24 | if (!flConfirmDialogSetUp) { 25 | setupConfirmDialog (); 26 | flConfirmDialogSetUp = true; 27 | } 28 | document.getElementById ("idConfirmDialogPrompt").innerHTML = prompt; 29 | confirmDialogCallback = callback; 30 | $("#idConfirmDialog").modal ("show"); 31 | } 32 | -------------------------------------------------------------------------------- /basicincludes2/askdialog.js: -------------------------------------------------------------------------------- 1 | var flAskDialogSetUp = false; 2 | var askDialogCallback; 3 | 4 | 5 | function okAskDialog () { 6 | var input = document.getElementById ("idAskDialogInput"); 7 | closeAskDialog (); 8 | askDialogCallback (input.value, false); 9 | }; 10 | function cancelAskDialog () { 11 | askDialogCallback ("", true); 12 | closeAskDialog (); 13 | } 14 | function setupAskDialog (callback) { 15 | if (flAskDialogSetUp) { 16 | callback (); 17 | } 18 | else { 19 | readHttpFile ("http://fargo.io/code/node/shared/askdialog.html", function (s) { 20 | $("body").prepend (s); 21 | $("#idAskDialogInput").on ("keydown", function (event) { //3/22/13 by DW 22 | if (event.which == 13) { 23 | okAskDialog (); 24 | return (false); 25 | } 26 | }); 27 | flAskDialogSetUp = true; 28 | callback (); 29 | }); 30 | } 31 | } 32 | function closeAskDialog () { 33 | $("#idAskDialog").modal ('hide'); 34 | }; 35 | function askDialog (prompt, defaultvalue, placeholder, askcallback, type) { 36 | var input; 37 | if (defaultvalue === undefined) { 38 | defaultvalue = ""; 39 | } 40 | if (placeholder === undefined) { 41 | placeholder = ""; 42 | } 43 | if (type === undefined) { 44 | type = "text"; 45 | } 46 | 47 | setupAskDialog (function () { 48 | input = document.getElementById ("idAskDialogInput"); 49 | if (defaultvalue === undefined) { 50 | defaultvalue = ""; 51 | } 52 | input.value = defaultvalue; 53 | input.type = type; 54 | input.placeholder = placeholder; 55 | askDialogCallback = askcallback; 56 | document.getElementById ("idAskDialogPrompt").innerHTML = prompt; 57 | $("#idAskDialog").on ("shown", function () { 58 | input.focus (); 59 | input.select (); 60 | }); 61 | $("#idAskDialog").modal ("show"); 62 | }); 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /concord/concordKeyboard.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Small Picture, Inc. 2 | 3 | 4 | var concordKeystrokes = { 5 | "backspace": "backspace", 6 | "tab": "tab", 7 | "return": "return", 8 | "delete": "delete", 9 | "uparrow": "cursor-up", 10 | "downarrow": "cursor-down", 11 | "leftarrow": "cursor-left", 12 | "rightarrow": "cursor-right", 13 | 14 | "meta-A": "select-all", 15 | "meta-B": "bolden", 16 | "meta-C": "copy", 17 | "meta-D": "reorg-down", 18 | "meta-F": "find", //9/19/13 by DW 19 | "meta-I": "italicize", 20 | "meta-L": "reorg-left", 21 | "meta-R": "reorg-right", 22 | "meta-U": "reorg-up", 23 | "meta-V": "paste", 24 | "meta-X": "cut", 25 | "meta-Z": "undo", 26 | 27 | "meta-[": "promote", 28 | "meta-]": "demote", 29 | 30 | "meta-\\": "toggle-comment", 31 | "meta-/": "run-selection", 32 | "meta-`": "toggle-render", 33 | "meta-,": "toggle-expand" 34 | } 35 | function concordMetaizeKeystroke (event) { //9/17/13 by DW 36 | var flmeta = event.metaKey || event.ctrlKey, ch = event.which; 37 | if ((ch >= 65) && (ch <= 90)) { //meta-A through meta-Z 38 | if (flmeta) { 39 | return ("meta-" + String.fromCharCode (ch)); 40 | } 41 | } 42 | switch (ch) { 43 | case 8: 44 | return ("backspace"); 45 | case 9: 46 | return ("tab"); 47 | case 13: 48 | return ("return"); 49 | case 37: 50 | return ("leftarrow"); 51 | case 38: 52 | return ("uparrow"); 53 | case 39: 54 | return ("rightarrow"); 55 | case 40: 56 | return ("downarrow"); 57 | case 46: 58 | return ("delete"); 59 | case 188: 60 | if (flmeta) { 61 | return ("meta-,"); 62 | } 63 | case 190: 64 | if (flmeta) { 65 | return ("meta-."); 66 | } 67 | case 191: 68 | if (flmeta) { 69 | return ("meta-/"); 70 | } 71 | case 192: 72 | if (flmeta) { 73 | return ("meta-`"); 74 | } 75 | case 219: 76 | if (flmeta) { 77 | return ("meta-["); 78 | } 79 | case 220: 80 | if (flmeta) { 81 | return ("meta-\\"); 82 | } 83 | case 221: 84 | if (flmeta) { 85 | return ("meta-]"); 86 | } 87 | } 88 | return (ch); 89 | } 90 | function concordGetKeystroke (event) { //9/17/13 by DW 91 | var s = concordMetaizeKeystroke (event); 92 | if (concordKeystrokes [s] != undefined) { 93 | var val = concordKeystrokes [s]; 94 | if (val.length > 0) { //2/23/14 by DW 95 | return (val); 96 | } 97 | } 98 | return (s); 99 | } 100 | -------------------------------------------------------------------------------- /concord/tableeditor.js: -------------------------------------------------------------------------------- 1 | var idTable = "idAttEditTable"; 2 | var tableEditCallback; 3 | 4 | 5 | function tabEdDeleteRow (r) { 6 | var table = document.getElementById (idTable); 7 | var ixrow = r.parentNode.parentNode.parentNode.rowIndex; 8 | table.deleteRow (ixrow); 9 | } 10 | function tabEdDeleteAllRows () { 11 | var table = document.getElementById (idTable); 12 | $(table).empty (); 13 | } 14 | function tabEdAddRow (name, value, flSetFocus) { 15 | var table = document.getElementById (idTable); 16 | var row = table.insertRow (-1); 17 | 18 | var cell1 = row.insertCell (0); 19 | var cell2 = row.insertCell (1); 20 | var cell3 = row.insertCell (2); 21 | 22 | cell1.innerHTML = ""; //11/3/14 by DW -- encode the name too. 23 | cell2.innerHTML = ""; 24 | cell3.innerHTML = ""; 25 | 26 | if (flSetFocus) { 27 | cell1.firstChild.focus (); 28 | } 29 | } 30 | function tabEdAddButtonClick () { 31 | tabEdAddRow ("", "", true); 32 | } 33 | function tabEdClose () { 34 | $("#idAttsDialog").modal ("hide"); 35 | }; 36 | function tabEdOkClick () { 37 | var table = document.getElementById (idTable), i, row; 38 | var atts = {}; 39 | for (i = 0; i < table.rows.length; i++) { 40 | var row = table.rows [i] 41 | var str1 = row.cells [0].childNodes [0].value, str2 = row.cells [1].childNodes [0].value; 42 | atts [str1] = str2; 43 | } 44 | 45 | if (tableEditCallback != undefined) { 46 | tableEditCallback (atts); 47 | } 48 | tabEdClose (); 49 | }; 50 | function tabEdShow (title, obj, callback) { 51 | function showDialog () { 52 | function setupAttsDialog () { 53 | tabEdDeleteAllRows (); 54 | for (var p in obj) { 55 | if (obj.hasOwnProperty (p)) { 56 | tabEdAddRow (p, obj [p], false); 57 | } 58 | } 59 | var table = document.getElementById (idTable); 60 | if (table.rows.length == 0) { 61 | tabEdAddRow ("", "", false); 62 | } 63 | } 64 | tableEditCallback = callback; //called when the user clicks OK 65 | $("#idAttsDialog").bind ("show", function () { 66 | setupAttsDialog (); 67 | $("#idTabEdTitle").html (title); 68 | }); 69 | $("#idAttsDialog").modal ("show"); 70 | } 71 | if ($("#idAttsDialog").length == 0) { //hasn't been loaded yet 72 | readHttpFile ("http://fargo.io/code/shared/tableeditor.html", function (s) { 73 | $("body").prepend (s); 74 | showDialog (); 75 | }); 76 | } 77 | else { 78 | showDialog (); 79 | } 80 | }; 81 | -------------------------------------------------------------------------------- /basicincludes2/app.css: -------------------------------------------------------------------------------- 1 | /* prefs */ 2 | .divPrefsDialog { 3 | font-family: Arial; 4 | font-size: 16px; 5 | line-height: 140%; 6 | } 7 | .divPrefsDialog p { 8 | font-family: Arial; 9 | font-size: 16px; 10 | line-height: 140%; 11 | min-height: 10px; 12 | margin-bottom: 1.3em; 13 | } 14 | .divPrefsDialog label { 15 | display: inline; 16 | float: left; 17 | text-align: right; 18 | padding-top: 4px; 19 | width: 130px; 20 | margin-right: .5em; 21 | font-family: Arial; 22 | font-size: 16px; 23 | } 24 | .divPrefsDialog fieldset { /* 4/30/13 by DW */ 25 | margin-left: 5px; 26 | margin-right: 5px; 27 | } 28 | .divPrefsDialog .clearfix { 29 | margin-bottom: 18px; 30 | } 31 | .divPrefsDialog .uneditable-input { 32 | -moz-box-shadow: 0; 33 | border: none; 34 | } 35 | .divPrefsDialog .divPrefsCheckbox { 36 | margin-left: 140px; 37 | margin-top: -2px; 38 | } 39 | .divPrefsDialog .divPrefsRadioList { 40 | margin-left: 140px; 41 | line-height: 200%; 42 | } 43 | .divPrefsDialog h3 { 44 | margin-top: 10px; 45 | margin-bottom: 6px; 46 | } 47 | .divPrefsDialog .divPrefsCheckbox input { 48 | margin-top: 0; 49 | } 50 | .divPrefsDialog textarea { 51 | width: 530px; 52 | height: auto; 53 | display: inline-block; 54 | } 55 | .divPrefsDialog .row { 56 | line-height: 24px; 57 | margin-bottom: 12px; 58 | } 59 | .divPrefsDialog red { 60 | color: red; 61 | } 62 | .divPrefsDialog h4 { 63 | font-size: 22px; 64 | padding-top: 15px; 65 | padding-bottom: 12px; /* 4/12/12 DW -- increased from 5px */ 66 | } 67 | 68 | .divPrefsDialog .xlarge { 69 | width: 530px; 70 | font-size: 16px; 71 | height: auto; 72 | } 73 | .divPrefsDialog input { 74 | margin-bottom: 0; 75 | } 76 | 77 | .divPrefsDialog .nav { 78 | margin-bottom: 18px; 79 | } 80 | .divDialogElements input { 81 | font-size: 18px; 82 | padding: 3px; 83 | height: 32px; 84 | } 85 | .divDialogElements .xlarge { 86 | width: 530px; 87 | font-size: 16px; 88 | height: auto; 89 | } 90 | .divDialogElements .numberPrefsInput { 91 | width: 50px; 92 | } 93 | .divDialogElements textarea { 94 | width: 530px; 95 | height: auto; 96 | display: inline-block; 97 | font-size: 16px; 98 | } 99 | .divDialogElements input[type="checkbox"] { 100 | margin-right: 3px; 101 | margin-top: -1px; 102 | } 103 | .divButton { 104 | padding-top: 12px; 105 | } 106 | .divPrefsDialog .modal { 107 | left: 40%; 108 | width: 740px; 109 | } 110 | .divPrefsDialog .btn { 111 | width: 80px; 112 | margin-left: 5px; 113 | } 114 | .divPrefsDialog .ui-input-text, .divPrefsDialog .ui-checkbox { /* 4/11/13 by DW */ 115 | display: inline-block; 116 | } 117 | -------------------------------------------------------------------------------- /feedviewer/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Ubuntu; 3 | font-size: 18px; 4 | background-color: whitesmoke; 5 | } 6 | .divPageBody { 7 | width: 80%; 8 | margin-top: 20px; 9 | margin-left: auto; 10 | margin-right: auto; 11 | margin-bottom: 400px; 12 | } 13 | .divTopFeedTitle { 14 | font-size: 42px; 15 | font-weight: bold; 16 | margin-top: .2em; 17 | margin-bottom: .75em; 18 | text-rendering: optimizeLegibility; 19 | color: black; 20 | } 21 | .divTopFeedTitle a { 22 | color: black; 23 | } 24 | .divTopFeedDescription { 25 | font-size: 16px; 26 | margin-left: 3px; 27 | } 28 | .divWhenLastNewItem { 29 | font-size: 16px; 30 | margin-left: 3px; 31 | } 32 | .divFeedItems { 33 | } 34 | .divItemHeader a { 35 | color: black; 36 | font-weight: normal; 37 | } 38 | .divItem { 39 | border-bottom: 1px dotted silver; 40 | padding-bottom: 3px; 41 | margin-top: 25px; 42 | } 43 | .divTopOfPage { 44 | } 45 | .divLeftPanel { 46 | display: table-cell; 47 | width: 50%; 48 | margin-right: 40px; 49 | } 50 | .divRightPanel { 51 | display: table-cell; 52 | border: 1px solid silver; 53 | background-color: white; 54 | width: 50%; 55 | height: 100%; 56 | padding: 3px; 57 | } 58 | .divFeedDisplay { 59 | display: table; 60 | } 61 | .tdLeftPanel { 62 | width: 50%; 63 | vertical-align: top; 64 | border-right: 1px solid silver; 65 | padding: 3px; 66 | } 67 | .tdRightPanel { 68 | vertical-align: top; 69 | width: 50%; 70 | } 71 | .divFeedItem { 72 | padding-top: 7px; 73 | padding-bottom: 7px; 74 | padding-left: 7px; 75 | border-bottom: 1px solid silver; 76 | cursor: pointer; 77 | } 78 | .divItemTitle { 79 | font-weight: bold; 80 | margin-bottom: 5px; 81 | } 82 | .divItemBody { 83 | line-height: 140%; 84 | } 85 | .itemHighlighted { 86 | color: white; 87 | background-color: #086DD6; 88 | } 89 | pre { 90 | margin: 0; 91 | } 92 | 93 | 94 | 95 | .divFullDescription { 96 | font-family: "Georgia"; 97 | font-size: 18px; 98 | line-height: 140%; 99 | } 100 | .divContentTitle, .divTopFeedTitle { 101 | font-size: 32px; 102 | font-weight: bold; 103 | margin-top: .5em; 104 | margin-bottom: .5em; 105 | text-rendering: optimizeLegibility; 106 | color: darkslategray; 107 | } 108 | .divContentTitle a { 109 | color: darkslategray; 110 | } 111 | .divItemContent { 112 | padding-left: 30px; 113 | padding-right: 30px; 114 | position: fixed; 115 | } 116 | .divWhenItem { 117 | font-size: 15px; 118 | opacity: .6; 119 | margin-top: 5px; 120 | } 121 | .divContentPubDateLine, .divWhenLastNewItem { 122 | width: 100%; 123 | font-size: 18px; 124 | color: darkgray; 125 | border-bottom: 1px solid gainsboro; 126 | padding-bottom: 5px; 127 | margin-bottom: 20px; 128 | } 129 | 130 | 131 | /* styles for tablet */ 132 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { 133 | .divPageBody { 134 | width: 98%; 135 | } 136 | .divContentPubDateLine, .divWhenLastNewItem { 137 | font-size: 16px; 138 | } 139 | .divContentTitle, .divTopFeedTitle { 140 | font-size: 24px; 141 | } 142 | .divFullDescription { 143 | font-size: 17px; 144 | } 145 | } 146 | 147 | -------------------------------------------------------------------------------- /feedviewer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple Feed Viewer 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 44 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 |
43 |
45 | 46 | 47 | 48 |
49 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /concord/outlinedialog.js: -------------------------------------------------------------------------------- 1 | var flOutlineDialogSetUp = false; 2 | var urlOutlineDialogHtml = "http://fargo.io/code/shared/outlinedialog.html"; 3 | var outlineDialogFont = "Arial", outlineDialogFontSize = "17", outlineDialogLineHeight = "24"; 4 | 5 | var savedOutlineDialogState = { 6 | idoutliner: "", 7 | callback: "" 8 | }; 9 | 10 | 11 | var idOrigOutliner, savedOpmlText; 12 | 13 | document.write (""); 14 | 15 | function closeOutlineDialog (flSave) { 16 | var opmltext = opOutlineToXml (); 17 | idDefaultOutliner = savedOutlineDialogState.idoutliner; 18 | $("#idOutlineDialog").modal ("hide"); 19 | 20 | setTimeout (function () { //2/27/16 by DW -- wait a second before deleting styles, give dialog a chance to be hidden 21 | if (savedOutlineDialogState.styleNode !== undefined) { 22 | document.getElementsByTagName ("head") [0].removeChild (savedOutlineDialogState.styleNode); 23 | delete savedOutlineDialogState.styleNode; 24 | } 25 | }, 1000); 26 | 27 | if (savedOutlineDialogState.callback !== undefined) { 28 | savedOutlineDialogState.callback (flSave, opmltext); 29 | } 30 | } 31 | function cancelOutlineDialog () { 32 | closeOutlineDialog (false); 33 | } 34 | function okOutlineDialog () { 35 | closeOutlineDialog (true); 36 | } 37 | function extraButtonOutlineDialog () { 38 | if (savedOutlineDialogState.extraButtonCallback !== undefined) { 39 | savedOutlineDialogState.extraButtonCallback (opOutlineToXml ()); 40 | } 41 | } 42 | function setupOutlineDialog (callback) { 43 | if (flOutlineDialogSetUp) { 44 | if (callback != undefined) { 45 | callback (); 46 | } 47 | } 48 | else { 49 | readHttpFileThruProxy (urlOutlineDialogHtml, undefined, function (s) { 50 | if (s === undefined) { //4/7/16 by DW 51 | alertDialog ("There was a problem reading the outline dialog."); 52 | } 53 | else { 54 | $("body").prepend (s); 55 | $("#idOutlineDialogInput").on ("keydown", function (event) { 56 | if (event.which == 13) { 57 | okOutlineDialog (); 58 | return (false); 59 | } 60 | }); 61 | flAskDialogSetUp = true; 62 | if (callback != undefined) { 63 | callback (); 64 | } 65 | } 66 | }); 67 | } 68 | } 69 | function outlineDialog (dialogTitle, opmltext, flReadOnly, callback, afterOpenCallback, extraButtonTitle, extraButtonCallback, styles) { 70 | savedOutlineDialogState.callback = callback; 71 | setupOutlineDialog (function () { 72 | var headers; 73 | savedOutlineDialogState.idoutliner = idDefaultOutliner; //save so we can restore it later 74 | idDefaultOutliner = "idOutlineDialogOutline"; //this is the one in the dialog 75 | opInitOutliner (opmltext, getBoolean (flReadOnly)); 76 | $("#idOutlineDialogTitle").text (dialogTitle); 77 | if (flReadOnly) { 78 | $("#idOutlineDialogCancelButton").css ("visibility", "hidden"); 79 | } 80 | //set up the extraButton -- 2/25/16 by DW 81 | if (extraButtonTitle !== undefined) { 82 | savedOutlineDialogState.extraButtonCallback = extraButtonCallback; 83 | $("#idOutlineDialogExtraButton").css ("display", "block"); 84 | $("#idOutlineDialogExtraButton").text (extraButtonTitle); 85 | } 86 | else { 87 | savedOutlineDialogState.extraButtonCallback = undefined; 88 | $("#idOutlineDialogExtraButton").css ("display", "none"); 89 | } 90 | //insert styles, if specified -- 2/27/16 by DW 91 | var styleNode = document.createElement ("style"); 92 | var styleText = document.createTextNode (styles); 93 | styleNode.type = "text/css"; 94 | styleNode.appendChild (styleText); 95 | document.getElementsByTagName ("head") [0].appendChild (styleNode); 96 | savedOutlineDialogState.styleNode = styleNode; //so we can delete it later 97 | $("#idOutlineDialog").modal ("show"); 98 | if (afterOpenCallback !== undefined) { //9/21/15 by DW 99 | afterOpenCallback (); 100 | } 101 | $("#idOutlineDialogOutline").on ("shown", function () { //5/4/15 by DW 102 | $("#idOutlineDialogOutline").focus (); 103 | }); 104 | }); 105 | } 106 | -------------------------------------------------------------------------------- /basicincludes2/strftime.js: -------------------------------------------------------------------------------- 1 | // version 0.11 by Daniel Rench 2 | // More information: http://dren.ch/strftime/ 3 | // This is public domain software 4 | 5 | Number.prototype.pad = 6 | function (n,p) { 7 | var s = '' + this; 8 | p = p || '0'; 9 | while (s.length < n) s = p + s; 10 | return s; 11 | }; 12 | 13 | Date.prototype.months = [ 14 | 'January', 'February', 'March', 'April', 'May', 'June', 'July', 15 | 'August', 'September', 'October', 'November', 'December' 16 | ]; 17 | Date.prototype.weekdays = [ 18 | 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 19 | 'Thursday', 'Friday', 'Saturday' 20 | ]; 21 | Date.prototype.dpm = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; 22 | 23 | Date.prototype.strftime_f = { 24 | A: function (d) { return d.weekdays[d.getDay()] }, 25 | a: function (d) { return d.weekdays[d.getDay()].substring(0,3) }, 26 | B: function (d) { return d.months[d.getMonth()] }, 27 | b: function (d) { return d.months[d.getMonth()].substring(0,3) }, 28 | C: function (d) { return Math.floor(d.getFullYear()/100); }, 29 | c: function (d) { return d.toString() }, 30 | D: function (d) { 31 | return d.strftime_f.m(d) + '/' + 32 | d.strftime_f.d(d) + '/' + d.strftime_f.y(d); 33 | }, 34 | d: function (d) { return d.getDate().pad(2,'0') }, 35 | e: function (d) { return d.getDate().pad(2,' ') }, 36 | F: function (d) { 37 | return d.strftime_f.Y(d) + '-' + d.strftime_f.m(d) + '-' + 38 | d.strftime_f.d(d); 39 | }, 40 | H: function (d) { return d.getHours().pad(2,'0') }, 41 | I: function (d) { return ((d.getHours() % 12 || 12).pad(2)) }, 42 | j: function (d) { 43 | var t = d.getDate(); 44 | var m = d.getMonth() - 1; 45 | if (m > 1) { 46 | var y = d.getYear(); 47 | if (((y % 100) == 0) && ((y % 400) == 0)) ++t; 48 | else if ((y % 4) == 0) ++t; 49 | } 50 | while (m > -1) t += d.dpm[m--]; 51 | return t.pad(3,'0'); 52 | }, 53 | k: function (d) { return d.getHours().pad(2,' ') }, 54 | l: function (d) { return ((d.getHours() % 12 || 12).pad(2,' ')) }, 55 | M: function (d) { return d.getMinutes().pad(2,'0') }, 56 | m: function (d) { return (d.getMonth()+1).pad(2,'0') }, 57 | n: function (d) { return "\n" }, 58 | p: function (d) { return (d.getHours() > 11) ? 'PM' : 'AM' }, 59 | R: function (d) { return d.strftime_f.H(d) + ':' + d.strftime_f.M(d) }, 60 | r: function (d) { 61 | return d.strftime_f.I(d) + ':' + d.strftime_f.M(d) + ':' + 62 | d.strftime_f.S(d) + ' ' + d.strftime_f.p(d); 63 | }, 64 | S: function (d) { return d.getSeconds().pad(2,'0') }, 65 | s: function (d) { return Math.floor(d.getTime()/1000) }, 66 | T: function (d) { 67 | return d.strftime_f.H(d) + ':' + d.strftime_f.M(d) + ':' + 68 | d.strftime_f.S(d); 69 | }, 70 | t: function (d) { return "\t" }, 71 | /* U: function (d) { return false }, */ 72 | u: function (d) { return(d.getDay() || 7) }, 73 | /* V: function (d) { return false }, */ 74 | v: function (d) { 75 | return d.strftime_f.e(d) + '-' + d.strftime_f.b(d) + '-' + 76 | d.strftime_f.Y(d); 77 | }, 78 | /* W: function (d) { return false }, */ 79 | w: function (d) { return d.getDay() }, 80 | X: function (d) { return d.toTimeString() }, // wrong? 81 | x: function (d) { return d.toDateString() }, // wrong? 82 | Y: function (d) { return d.getFullYear() }, 83 | y: function (d) { return (d.getYear() % 100).pad(2) }, 84 | // Z: function (d) { return d.toString().match(/\((.+)\)$/)[1]; }, 85 | // z: function (d) { return d.getTimezoneOffset() }, // wrong 86 | // z: function (d) { return d.toString().match(/\sGMT([+-]\d+)/)[1]; }, 87 | '%': function (d) { return '%' } 88 | }; 89 | 90 | Date.prototype.strftime_f['+'] = Date.prototype.strftime_f.c; 91 | Date.prototype.strftime_f.h = Date.prototype.strftime_f.b; 92 | 93 | Date.prototype.strftime = 94 | function (fmt) { 95 | var r = ''; 96 | var n = 0; 97 | while(n < fmt.length) { 98 | var c = fmt.substring(n, n+1); 99 | if (c == '%') { 100 | c = fmt.substring(++n, n+1); 101 | r += (this.strftime_f[c]) ? this.strftime_f[c](this) : c; 102 | } else r += c; 103 | ++n; 104 | } 105 | return r; 106 | }; 107 | -------------------------------------------------------------------------------- /filelist.opml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nodeEditorSuite.cdnForAll.fileList 6 | Sat, 21 Apr 2018 22:53:35 GMT 7 | Sat, 21 Apr 2018 23:25:50 GMT 8 | Dave Winer 9 | http://davewiner.com/ 10 | 1, 14, 18, 38, 48, 51 11 | 23 12 | 270 13 | 505 14 | 946 15 | 1363 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /concord/arrowpad.js: -------------------------------------------------------------------------------- 1 | var flArrowPadSetUp = false; 2 | var flArrowPadReadOnly = false; //2/20/15 by DW 3 | 4 | 5 | 6 | function setupArrowPad (callback) { 7 | if (flArrowPadSetUp) { 8 | callback (); 9 | } 10 | else { 11 | readHttpFile ("http://fargo.io/code/shared/arrowpad.html", function (s) { 12 | $("body").prepend (s); 13 | flArrowPadSetUp = true; 14 | callback (); 15 | }); 16 | } 17 | } 18 | function arrowPadVisible () { 19 | if (flArrowPadSetUp) { 20 | return (document.getElementById ("idArrowPad").style.visibility == "visible"); 21 | } 22 | else { 23 | return (false); 24 | } 25 | } 26 | function updateArrowPad (canExpandCallback) { 27 | setupArrowPad (function () { 28 | var arrowEnable = function (idArrow, direction) { 29 | var arrow = document.getElementById (idArrow), flenabled; 30 | if (opInTextMode () || getBoolean (localStorage.flReorgMode)) { 31 | flenabled = canReorg (direction); 32 | } 33 | else { 34 | flenabled = canGo (direction); 35 | } 36 | if (flenabled) { 37 | arrow.style.color = "white"; 38 | } 39 | else { 40 | arrow.style.color = "gray"; 41 | } 42 | } 43 | //expand button 44 | var button = document.getElementById ("idExpandButton"); 45 | var s = "Expand", classname = "btn disabled"; 46 | if (opHasSubs ()) { 47 | if (opSubsExpanded ()) { 48 | s = "Collapse"; 49 | } 50 | classname = "btn"; 51 | } 52 | 53 | if (canExpandCallback != undefined) { //7/10/14 by DW 54 | if (canExpandCallback ()) { //it's enabled 55 | classname = "btn"; 56 | s = "Expand"; 57 | } 58 | } 59 | 60 | button.innerHTML = s; 61 | button.className = classname; 62 | //four arrows 63 | arrowEnable ("idLeftArrow", left); 64 | arrowEnable ("idRightArrow", right); 65 | arrowEnable ("idUpArrow", up); 66 | arrowEnable ("idDownArrow", down); 67 | //arrow mode button 68 | var button = document.getElementById ("idArrowModeButton"), s = "Navigate"; 69 | if (opInTextMode () || (localStorage.flReorgMode == "true")) { 70 | s = "Reorg"; 71 | } 72 | button.innerHTML = s; 73 | //menu command string 74 | var s; 75 | if (arrowPadVisible ()) { 76 | s = "Hide arrow pad"; 77 | } 78 | else { 79 | s = "Show arrow pad"; 80 | } 81 | document.getElementById ("idArrowPadCommandString").innerHTML = s; 82 | }); 83 | } 84 | function arrowClick (direction) { 85 | if (direction == "right") { 86 | opExpand (); 87 | } 88 | if (opInTextMode () || (localStorage.flReorgMode == "true")) { 89 | opReorg (direction, 1); 90 | } 91 | else { 92 | opGo (direction, 1); 93 | } 94 | updateArrowPad (); 95 | } 96 | function canGo (direction) { 97 | var cursor = $(opGetActiveOutliner()).concord ().op.getCursor (), x; 98 | switch (direction) { 99 | case up: 100 | x = cursor.prev (); 101 | break; 102 | case down: 103 | x = cursor.next (); 104 | break; 105 | case left: 106 | x = cursor.parents (".concord-node:first"); 107 | break; 108 | case right: 109 | x = cursor.children("ol").children(".concord-node:first"); 110 | break; 111 | } 112 | return (x.length == 1); 113 | } 114 | function canReorg (direction) { 115 | var cursor = $(opGetActiveOutliner()).concord ().op.getCursor (), x; 116 | switch (direction) { 117 | case up: 118 | x = cursor.prev (); 119 | break; 120 | case down: 121 | x = cursor.next (); 122 | break; 123 | case left: 124 | x = cursor.parent (); 125 | return (!x.hasClass ("concord-root")); 126 | case right: 127 | x = cursor.prev (); 128 | break; 129 | } 130 | return (x.length == 1); 131 | } 132 | function toggleExpand () { 133 | if (document.getElementById ("idExpandButton").innerHTML == "Expand") { 134 | opExpand (); 135 | } 136 | else { 137 | if (opHasSubs ()) { 138 | if (opSubsExpanded ()) { 139 | opCollapse (); 140 | } 141 | else { 142 | opExpand (); 143 | } 144 | updateArrowPad (); 145 | } 146 | else { 147 | speakerBeep (); 148 | } 149 | } 150 | } 151 | function toggleReorgMode () { 152 | if (localStorage.flReorgMode == "false") { 153 | localStorage.flReorgMode = "true"; 154 | } 155 | else { 156 | localStorage.flReorgMode = "false"; 157 | } 158 | if (opInTextMode ()) { 159 | opSetTextMode (false); 160 | } 161 | updateArrowPad (); 162 | } 163 | function hideArrowPad () { 164 | document.getElementById ("idArrowPad").style.visibility = "hidden"; 165 | } 166 | function showArrowPad () { 167 | setupArrowPad (function () { 168 | if (flArrowPadReadOnly) { //2/20/15 by DW 169 | localStorage.flReorgMode = "false"; 170 | document.getElementById ("idArrowModeButton").disabled = true; 171 | } 172 | document.getElementById ("idArrowPad").style.visibility = "visible"; 173 | }); 174 | } 175 | function toggleArrowPad () { 176 | if (arrowPadVisible ()) { 177 | hideArrowPad (); 178 | } 179 | else { 180 | showArrowPad (); 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /riverBrowserIncludes/riverbrowser.css: -------------------------------------------------------------------------------- 1 | .divRiverContainer { 2 | max-width: 675px; 3 | margin-left: auto; 4 | margin-right: auto; 5 | } 6 | .divRiverContainer a { 7 | color: #1E68A6; 8 | } 9 | .divRiverInTab { 10 | border: 1px solid #ddd; 11 | background-color: whitesmoke; 12 | } 13 | .divRiversBody { 14 | } 15 | .divRiverDisplay { 16 | font-family: "Lora", "Georgia"; 17 | width: 500px; 18 | margin-left: auto; 19 | margin-right: auto; 20 | } 21 | .divTweetInRiver { 22 | color: green; 23 | visibility: hidden; 24 | } 25 | 26 | .divRiverSection { 27 | padding: 0.5em 0 0; 28 | border-top: 1px solid #bbb; 29 | margin: 2em 0 0; 30 | } 31 | .divFeedTitle { 32 | font-family: Ubuntu; 33 | color: #777777; 34 | float: left; 35 | padding: 0 8px 0 0; 36 | margin: -17px 0 0 0; 37 | font-size: 12px; 38 | font-weight: normal; 39 | line-height: 1.2em; 40 | background: whitesmoke; 41 | } 42 | .spFeedUpdateTime { 43 | font-family: Ubuntu; 44 | float: right; 45 | padding: 0 0 0 8px; 46 | color: #777777; 47 | margin: -17px 0 0 0; 48 | font-size: 12px; 49 | font-weight: normal; 50 | line-height: 1.2em; 51 | background: whitesmoke; 52 | } 53 | .divItem { 54 | margin-top: 10px; 55 | } 56 | .divItemHeader { 57 | font-family: "Ubuntu"; 58 | font-weight: bold; 59 | line-height: 125%; 60 | margin-bottom: 7px; 61 | color: #65798D; 62 | } 63 | .divItemFooter { 64 | clear: both; 65 | margin: 0 20px 0 0; 66 | font-size: 0.6875em; 67 | color: #666; 68 | } 69 | .imgFavIcon { 70 | position: relative; 71 | top: -1px; 72 | float: left; 73 | margin: 0 6px 0 -22px; 74 | border: 0; 75 | vertical-align: middle; 76 | } 77 | .divItemDescription { 78 | margin: 0 0 5px; 79 | font-size: 0.85em; 80 | line-height: 135%; 81 | color: #333; 82 | } 83 | .spTimeDifference { 84 | font-family: Ubuntu; 85 | font-size: 12px; 86 | color: #777777; 87 | } 88 | .spShareLink, .spEnclosureLink { 89 | margin-left: .5em; 90 | cursor: pointer; 91 | font-size: 12px; 92 | } 93 | .spShareLink a, .spEnclosureLink a { 94 | color: silver; 95 | text-decoration: none; 96 | } 97 | .divInterItemSpacer { 98 | height: 10px; 99 | } 100 | .divRiverTabs { 101 | font-family: Ubuntu; 102 | font-size: 16px; 103 | } 104 | .divRiverTabs .active { 105 | font-weight: bold; 106 | } 107 | .divRiverTabs a { 108 | color: #777777; 109 | } 110 | .divRiverTabs .nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus { 111 | background-color: whitesmoke; 112 | } 113 | .divVersionNumber { 114 | font-family: Ubuntu; 115 | } 116 | .divRenderedOutline { 117 | } 118 | .divOutlineSubs li { 119 | list-style-type: none; 120 | } 121 | .divRenderedOutline .ulOutlineList { 122 | padding: 0; 123 | } 124 | .divRenderedOutline .divOutlineText { 125 | line-height: 135%; 126 | font-size: 0.85em; 127 | min-height: 0.85em; 128 | color: black; 129 | margin-bottom: 10px; 130 | } 131 | .divRenderedOutline .divMarkdownSubs { 132 | line-height: 150%; 133 | font-size: 0.85em; 134 | color: black; 135 | } 136 | .divOutlineHead { 137 | font-weight: bold; 138 | } 139 | .divRenderedOutline .divOutlineHead .aOutlineTextLink { 140 | color: #1E68A6; 141 | } 142 | .divRenderedOutline .liHasSubs ul { 143 | } 144 | .divRenderedOutline .liNoSubs { 145 | } 146 | .divRenderedOutline .spOutlineIcon { 147 | margin-right: -11px; 148 | } 149 | .divRenderedOutline .aOutlineWedgeLink { 150 | color: black; 151 | } 152 | .divRenderedOutline .aOutlineWedgeLink i { 153 | color: black; 154 | cursor: pointer; 155 | position: relative; 156 | width: .5em; 157 | left: -1em; 158 | } 159 | .divRenderedOutline .aTwitterLink { 160 | font-size: 0.9em; 161 | cursor: pointer; 162 | position: relative; 163 | width: .5em; 164 | left: -1.4em; 165 | margin-right: -4px; 166 | opacity: .4; 167 | } 168 | .divRenderedOutline .aImageIconLink { 169 | font-size: 0.9em; 170 | cursor: pointer; 171 | position: relative; 172 | width: .5em; 173 | left: -1.4em; 174 | margin-right: -7px; 175 | opacity: .4; 176 | } 177 | .divRenderedOutline .divRenderedImage { 178 | margin-bottom: 2px; 179 | } 180 | 181 | .divRenderedOutline .aOutlineTextLink { 182 | cursor: pointer; 183 | color: black; 184 | text-decoration: none; 185 | } 186 | .divRenderedOutline .spPermalink { 187 | } 188 | .divRenderedOutline .spPermalink a { 189 | text-decoration: none; 190 | color: purple; 191 | font-size: 10px; 192 | font-weight: normal; 193 | vertical-align: top; 194 | margin-left: 3px; 195 | } 196 | .divRenderedOutline code { 197 | display: inline; 198 | border: none; 199 | color: black; 200 | font-size: .85em; 201 | } 202 | 203 | .spBoldHead { 204 | font-weight: bold; 205 | } 206 | 207 | /* 6/15/17 by DW */ 208 | .spRiverPermaLink { 209 | float: right; 210 | margin-top: 2px; 211 | margin-left: .4em; 212 | } 213 | .spRiverPermaLink a { 214 | font-family: "Ubuntu"; 215 | color: purple; 216 | opacity: 0.5; 217 | font-weight: normal; 218 | font-size: 14px; 219 | cursor: pointer; 220 | } 221 | /* 2/5/16 by DW */ 222 | .divGetRiverError { 223 | font-family: "Ubuntu"; 224 | font-size: 20px; 225 | margin-top: 2em; 226 | margin-bottom: 3em; 227 | line-height: 145%; 228 | } 229 | 230 | -------------------------------------------------------------------------------- /concord/concord.css: -------------------------------------------------------------------------------- 1 | .concord{ 2 | font-family: Geneva, Arial; 3 | font-size: 12pt; 4 | margin: 0; 5 | padding: 0; 6 | border: 0; 7 | line-height: 20px; 8 | list-style-type: none; 9 | color: #000; 10 | } 11 | .concord ol{ 12 | list-style-type: none; 13 | padding: 0 0 0 16px; 14 | margin: 0; 15 | clear: both; 16 | } 17 | .concord .concord-node{ 18 | clear:left; 19 | display: block; 20 | min-height: 20px; 21 | } 22 | .concord .concord-node .concord-wrapper{ 23 | display: inline-block; 24 | /* background: url('http://static.smallpicture.com/concord-assets/wedge.png') no-repeat 3px 8px; */ 25 | background-repeat: no-repeat; 26 | position: relative; 27 | padding-left: 20px; 28 | /* float: left; */ 29 | /* margin-bottom: 3px; */ 30 | } 31 | .concord .concord-node.concord-comment .node-icon:before{ 32 | content: "\f100" !important; 33 | } 34 | .concord .concord-node > .concord-wrapper.type-icon .node-icon { 35 | position: absolute; 36 | top: 0; 37 | left: 0; 38 | color: silver; 39 | cursor: default; 40 | } 41 | .concord .concord-node.collapsed > .concord-wrapper.type-icon .node-icon { 42 | color: #000; 43 | } 44 | .concord .concord-node[opml-type='link'] > .concord-wrapper.type-icon .node-icon { 45 | cursor: pointer; 46 | } 47 | .concord .concord-node.collapsed.selected > .concord-wrapper.type-icon .node-icon { 48 | color: #fff; 49 | } 50 | .concord .concord-node.selected.collapsed > .concord-wrapper.type-icon .node-icon.icon-caret-right { 51 | color: #fff; 52 | } 53 | .concord .concord-node.selected > .concord-wrapper.type-icon .node-icon.icon-caret-right { 54 | color: silver; 55 | } 56 | .concord .concord-node.collapsed > .concord-wrapper{ 57 | /* background-image: url('http://static.smallpicture.com/concord-assets/wedgeParent.png'); */ 58 | } 59 | .concord .concord-node.concord-comment.collapsed > .concord-wrapper{ 60 | /* background-image: url('http://static.smallpicture.com/concord-assets/commentParent.png') !important; */ 61 | } 62 | .concord .concord-node.selected.collapsed > .concord-wrapper{ 63 | /* background-image: url('http://static.smallpicture.com/concord-assets/wedgeParentWhite.png'); */ 64 | } 65 | .concord .concord-node.concord-comment.selected.collapsed > .concord-wrapper{ 66 | /* background-image: url('http://static.smallpicture.com/concord-assets/commentParentWhite.png') !important; */ 67 | } 68 | .concord .concord-node.selected.collapsed > .concord-wrapper.type-icon{ 69 | background-image: none; 70 | } 71 | .concord .concord-node.drop-sibling > .concord-wrapper .node-icon:before { 72 | content: "\f063" !important; 73 | } 74 | .concord .concord-node.drop-sibling > .concord-wrapper .node-icon { 75 | color: black !important; 76 | } 77 | .concord .concord-node.drop-child > .concord-wrapper .node-icon:before { 78 | content: "\f061" !important; 79 | } 80 | .concord .concord-node.drop-child > .concord-wrapper .node-icon{ 81 | color: black !important; 82 | transform:rotate(45deg); 83 | -ms-transform:rotate(45deg); /* IE 9 */ 84 | -webkit-transform:rotate(45deg); /* Safari and Chrome */ 85 | } 86 | .concord .concord-node .concord-wrapper .concord-text{ 87 | cursor: text; 88 | min-height: 20px; 89 | line-height: 20px; 90 | /* float: left; */ 91 | display: inline-block; 92 | outline: none !important; 93 | font-family: Geneva, Arial; 94 | font-size: 12pt; 95 | color: #000; 96 | min-width: 10px; 97 | white-space: pre-wrap; 98 | } 99 | .concord.dragging .concord-node .concord-wrapper .concord-text{ 100 | cursor: pointer; 101 | } 102 | .concord.readonly .concord-node .concord-wrapper .concord-text{ 103 | cursor: default !important; 104 | } 105 | .concord .concord-node.selected > .concord-wrapper{ 106 | background-color: #000; 107 | padding-right: 2px; 108 | } 109 | .concord .concord-node.selected > .concord-wrapper .concord-text{ 110 | color: #fff; 111 | } 112 | .concord .concord-node.collapsed > ol{ 113 | display: none; 114 | } 115 | .concord.dragging{ 116 | cursor: pointer !important; 117 | } 118 | #flip form{ 119 | display: inline; 120 | } 121 | .concord-text a, .concord-text a:visited{ 122 | cursor: pointer; 123 | } 124 | .concord-node.selected > .concord-wrapper .concord-text a, .concord-node.selected > .concord-wrapper .concord-text a:visited{ 125 | color: yellow; 126 | } 127 | .ui-loader-default{ 128 | display: none; 129 | } 130 | .icon-wordpress { 131 | min-width: 20px; 132 | background: url('http://static.smallpicture.com/concord-assets/wordpress128.png') no-repeat; 133 | background-size: 100% auto; 134 | } 135 | /** FONT AWESOME STYLES **/ 136 | li [class^="icon-"], .nav li [class^="icon-"], li [class*=" icon-"], .nav li [class*=" icon-"] { 137 | display: inline-block; 138 | width: 1.25em; 139 | text-align: center; 140 | } 141 | a [class^="icon-"], a [class*=" icon-"] { 142 | display: inline-block; 143 | } 144 | 145 | li [class^="fa-"], .nav li [class^="fa-"], li [class*=" fa-"], .nav li [class*=" fa-"] { 146 | display: inline-block; 147 | width: 1.25em; 148 | text-align: center; 149 | } 150 | a [class^="fa-"], a [class*=" fa-"] { 151 | display: inline-block; 152 | } 153 | -------------------------------------------------------------------------------- /riverBrowserIncludes/dateFormat.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Date Format 1.2.3 3 | * (c) 2007-2009 Steven Levithan 4 | * MIT license 5 | * 6 | * Includes enhancements by Scott Trenda 7 | * and Kris Kowal 8 | * 9 | * Accepts a date, a mask, or a date and a mask. 10 | * Returns a formatted version of the given date. 11 | * The date defaults to the current date/time. 12 | * The mask defaults to dateFormat.masks.default. 13 | * 14 | * http://blog.stevenlevithan.com/archives/date-time-format 15 | */ 16 | 17 | var dateFormat = function () { 18 | var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, 19 | timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, 20 | timezoneClip = /[^-+\dA-Z]/g, 21 | pad = function (val, len) { 22 | val = String(val); 23 | len = len || 2; 24 | while (val.length < len) val = "0" + val; 25 | return val; 26 | }; 27 | 28 | // Regexes and supporting functions are cached through closure 29 | return function (date, mask, utc) { 30 | var dF = dateFormat; 31 | 32 | // You can't provide utc if you skip other args (use the "UTC:" mask prefix) 33 | if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { 34 | mask = date; 35 | date = undefined; 36 | } 37 | 38 | // Passing date through Date applies Date.parse, if necessary 39 | date = date ? new Date(date) : new Date; 40 | if (isNaN(date)) throw SyntaxError("invalid date"); 41 | 42 | mask = String(dF.masks[mask] || mask || dF.masks["default"]); 43 | 44 | // Allow setting the utc argument via the mask 45 | if (mask.slice(0, 4) == "UTC:") { 46 | mask = mask.slice(4); 47 | utc = true; 48 | } 49 | 50 | var _ = utc ? "getUTC" : "get", 51 | d = date[_ + "Date"](), 52 | D = date[_ + "Day"](), 53 | m = date[_ + "Month"](), 54 | y = date[_ + "FullYear"](), 55 | H = date[_ + "Hours"](), 56 | M = date[_ + "Minutes"](), 57 | s = date[_ + "Seconds"](), 58 | L = date[_ + "Milliseconds"](), 59 | o = utc ? 0 : date.getTimezoneOffset(), 60 | flags = { 61 | d: d, 62 | dd: pad(d), 63 | ddd: dF.i18n.dayNames[D], 64 | dddd: dF.i18n.dayNames[D + 7], 65 | m: m + 1, 66 | mm: pad(m + 1), 67 | mmm: dF.i18n.monthNames[m], 68 | mmmm: dF.i18n.monthNames[m + 12], 69 | yy: String(y).slice(2), 70 | yyyy: y, 71 | h: H % 12 || 12, 72 | hh: pad(H % 12 || 12), 73 | H: H, 74 | HH: pad(H), 75 | M: M, 76 | MM: pad(M), 77 | s: s, 78 | ss: pad(s), 79 | l: pad(L, 3), 80 | L: pad(L > 99 ? Math.round(L / 10) : L), 81 | t: H < 12 ? "a" : "p", 82 | tt: H < 12 ? "am" : "pm", 83 | T: H < 12 ? "A" : "P", 84 | TT: H < 12 ? "AM" : "PM", 85 | Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), 86 | o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), 87 | S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] 88 | }; 89 | 90 | return mask.replace(token, function ($0) { 91 | return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); 92 | }); 93 | }; 94 | }(); 95 | 96 | // Some common format strings 97 | dateFormat.masks = { 98 | "default": "HH:MM:ss dd mmm yyyy ", // 17:46:21 09 Jun 2007 99 | shortDate: "m/d/yy", // 6/9/07 100 | mediumDate: "d mmm yyyy", // 9 Jun 2007 101 | longDate: "d mmmm yyyy", // 9 June 2007 102 | fullDate: "dddd, mmmm d, yyyy", // Saturday, June 9, 2007 103 | shortTime: "h:MM TT", // 5:46 PM 104 | mediumTime: "h:MM:ss TT", // 5:46:21 PM 105 | longTime: "h:MM:ss TT Z", // 5:46:21 PM EST 106 | isoDate: "yyyy-mm-dd", // 2007-06-09 107 | isoTime: "HH:MM:ss", // 17:46:21 108 | isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", // 2007-06-09T17:46:21 109 | isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'", // 2007-06-09T22:46:21Z 110 | 111 | timeDate: "h:MM:ss TT; dd mmm" // 5:46:21 PM; 09 Jun 112 | }; 113 | 114 | // Internationalization strings 115 | dateFormat.i18n = { 116 | dayNames: [ 117 | "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 118 | "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" 119 | ], 120 | monthNames: [ 121 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 122 | "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" 123 | ] 124 | }; 125 | 126 | // For convenience... 127 | Date.prototype.format = function (mask, utc) { 128 | return dateFormat(this, mask, utc); 129 | }; 130 | 131 | 132 | /* 133 | * Relative time formats 134 | * Modified from http://ejohn.org/blog/javascript-pretty-date/#comment-297458 135 | */ 136 | 137 | function timeDifference(date){ 138 | var date = new Date(date); 139 | var seconds = (new Date - new Date(date)) / 1000; 140 | 141 | var i = 0, f; 142 | while (f = timeDifference.formats[i++]) if (seconds < f[0]) 143 | return f[2] ? Math.floor(seconds / f[2]) + ' ' + f[1] + ' ago' : f[1]; 144 | // Crude fix for feeds with no supplied pubDate (e.g. huffington post wikileaks rss) 145 | // JSON file marks them as 01 Dec 1999; look for anything over 10 years old 146 | if (seconds > 315569260) { 147 | return 'Recently'; 148 | } 149 | return dateFormat(date, 'longDate'); 150 | }; 151 | 152 | timeDifference.formats = [ 153 | [-1, 'Recently'], // Deals with times in the future 154 | [60, 'seconds', 1], 155 | [120, '1 minute ago'], 156 | [3600, 'minutes', 60], 157 | [7200, '1 hour ago'], 158 | [86400, 'hours', 3600], 159 | [172800, 'Yesterday'], 160 | [604800, 'days', 86400], 161 | [1209600, '1 week ago'], 162 | [2678400, 'weeks', 604800] 163 | ]; -------------------------------------------------------------------------------- /feedviewer/code.js: -------------------------------------------------------------------------------- 1 | var myProductName = "feedViewer", myVersion = "0.40a"; 2 | 3 | var urlServer = "http://river5.scripting.com/getfeedriver?url="; 4 | 5 | var urlRiverJson = "http://localhost:1337/getfeedriver?url=http://scripting.com/rss.xml"; 6 | 7 | var globalFeedStruct; 8 | 9 | const lastUpdateFormat = "%A, %B %e, %Y at %l:%M %p"; 10 | 11 | 12 | var ixLastCursor = undefined; 13 | var idItemPrefix = "idItem_"; 14 | 15 | 16 | function notEmpty (s) { 17 | if (s === undefined) { 18 | return (false); 19 | } 20 | if (s.length == 0) { 21 | return (false); 22 | } 23 | return (true); 24 | } 25 | function setCursor (ixInArray, flCursorOnItem) { 26 | if (ixInArray !== undefined) { 27 | var item = $("#" + idItemPrefix + ixInArray); 28 | if (flCursorOnItem) { 29 | item.addClass ("itemHighlighted"); 30 | } 31 | else { 32 | item.removeClass ("itemHighlighted"); 33 | } 34 | } 35 | } 36 | function moveCursorTo (ixInArray) { 37 | if (ixLastCursor !== undefined) { 38 | setCursor (ixLastCursor, false); 39 | } 40 | setCursor (ixInArray, true); 41 | ixLastCursor = ixInArray; 42 | $("#idItemContent").html (renderItemContent (globalFeedStruct.title, globalFeedStruct.items [ixInArray])); 43 | } 44 | function moveCursorUp () { 45 | if (ixLastCursor >= globalFeedStruct.items.length - 1) { 46 | speakerBeep (); 47 | } 48 | else { 49 | moveCursorTo (ixLastCursor + 1); 50 | } 51 | } 52 | function moveCursorDown () { 53 | if (ixLastCursor <= 0) { 54 | speakerBeep (); 55 | } 56 | else { 57 | moveCursorTo (ixLastCursor - 1); 58 | } 59 | } 60 | function renderFeedtem (item, arrayIndex) { 61 | var htmltext = "", indentlevel = 0; 62 | function add (s) { 63 | htmltext += filledString ("\t", indentlevel) + s + "\n"; 64 | } 65 | 66 | add ("
"); indentlevel++; 67 | 68 | if (notEmpty (item.title)) { 69 | add ("
" + item.title + "
"); 70 | } 71 | if (notEmpty (item.body)) { 72 | add ("
" + maxStringLength (item.body, 140, true, false) + "
"); 73 | } 74 | 75 | 76 | add ("
" + getFacebookTimeString (item.pubDate) + "
"); 77 | 78 | 79 | add ("
"); indentlevel--; 80 | 81 | return (htmltext); 82 | } 83 | function renderItemContent (feedTitle, item) { 84 | var htmltext = "", indentlevel = 0; 85 | function add (s) { 86 | htmltext += filledString ("\t", indentlevel) + s + "\n"; 87 | } 88 | function getItemLink () { 89 | if (notEmpty (item.permalink)) { 90 | return (item.permalink); 91 | } 92 | else { 93 | if (notEmpty (item.link)) { 94 | return (item.link); 95 | } 96 | else { 97 | return (undefined); 98 | } 99 | } 100 | } 101 | 102 | var pubDateString = formatDate (item.pubDate, lastUpdateFormat) + "."; 103 | add ("
" + pubDateString + "
"); 104 | 105 | if (false) { //(item.outline !== undefined) { 106 | var outlineHtml = renderOutlineBrowser (item.outline, false, undefined, undefined, true); 107 | return ("
" + outlineHtml + "
"); 108 | } 109 | else { 110 | if (notEmpty (item.title)) { 111 | 112 | var titleLink = item.title, link = getItemLink (); 113 | if (link !== undefined) { 114 | titleLink = "" + titleLink + ""; 115 | } 116 | 117 | add ("
" + titleLink + "
"); 118 | } 119 | if (item.fullDescription !== undefined) { 120 | add ("
" + item.fullDescription + "
"); 121 | } 122 | else { 123 | add ("
" + item.description + "
"); 124 | } 125 | } 126 | return (htmltext); 127 | } 128 | function displayFeed (urlRiverJson) { 129 | readHttpFile (urlRiverJson, function (jsontext) { 130 | var jstruct = JSON.parse (jsontext); 131 | function getNewstPubdate () { 132 | var d = new Date (0); 133 | for (var i = 0; i < jstruct.items.length; i++) { 134 | var item = jstruct.items [i], thisDate = new Date (item.pubdate); 135 | if (thisDate > d) { 136 | d = thisDate; 137 | } 138 | } 139 | return (d); 140 | } 141 | $("#idFeedTitle").html ("" + jstruct.title + ""); 142 | $("#idWhenLastNewItem").html ("Last new item: " + formatDate (getNewstPubdate (), lastUpdateFormat) + "."); 143 | 144 | for (var i = jstruct.items.length - 1; i >= 0; i--) { 145 | var item = jstruct.items [i]; 146 | if (item.pubDate === undefined) { 147 | item.pubDate = item.pubdate; 148 | } 149 | item.body = item.description; 150 | 151 | $("#idFeedItems").append (renderFeedtem (item, i)); 152 | } 153 | 154 | globalFeedStruct = jstruct; 155 | 156 | $('[data-toggle="tooltip"]').tooltip (); 157 | 158 | moveCursorTo (jstruct.items.length - 1); 159 | $(".divFeedItem").click (function () { 160 | var id = $(this).attr ("id"); 161 | var ixarray = Number (stringNthField (id, "_", 2)); 162 | console.log ("id == " + id + ", ixarray == " + ixarray); 163 | moveCursorTo (ixarray); 164 | console.log (jsonStringify (jstruct.items [ixarray])); 165 | event.stopPropagation (); 166 | event.preventDefault (); 167 | }); 168 | }); 169 | } 170 | 171 | function updateTimes () { 172 | var whenstart = new Date (); 173 | $(".divWhenItem").each (function () { 174 | var ix = Number ($(this).data ("ix")); 175 | var pubDate = globalFeedStruct.items [ix].pubDate; 176 | $(this).html (getFacebookTimeString (pubDate)); 177 | }); 178 | console.log ("updateTimes: " + secondsSince (whenstart) + " secs."); 179 | } 180 | function everyMinute () { 181 | console.log ("everyMinute: " + new Date ().toLocaleTimeString ()); 182 | updateTimes (); 183 | } 184 | function everySecond () { 185 | } 186 | function startup () { 187 | var urlParam = getURLParameter ("url"), serverParam = getURLParameter ("server"); 188 | console.log ("startup"); 189 | hitCounter (); 190 | initGoogleAnalytics (window.location.hostname); 191 | if (serverParam != "null") { 192 | urlServer = "http://" + serverParam + "/getfeedriver?url="; 193 | } 194 | if (urlParam != "null") { 195 | urlRiverJson = urlServer + urlParam; 196 | } 197 | displayFeed (urlRiverJson); 198 | $("body").keydown (function (ev) { 199 | console.log ("keydown == " + ev.which); 200 | switch (ev.which) { 201 | case 37: //left arrow 202 | break; 203 | case 38: //up arrow 204 | moveCursorUp (); 205 | break; 206 | case 39: //right arrow 207 | break; 208 | case 40: //down arrow 209 | moveCursorDown (); 210 | break; 211 | } 212 | ev.stopPropagation (); 213 | ev.preventDefault (); 214 | }); 215 | self.setInterval (everySecond, 1000); 216 | self.setInterval (everyMinute, 60000); 217 | } 218 | -------------------------------------------------------------------------------- /basicincludes2/appprefs.js: -------------------------------------------------------------------------------- 1 | 2 | var saveAppPrefsCallback = undefined; //4/24/15 by DW 3 | var pathAppPrefs = "appPrefs.json"; 4 | 5 | function prefsToStorage () { 6 | var jsontext = JSON.stringify (appPrefs, undefined, 4), whenstart = new Date (); 7 | localStorage.appPrefs = jsontext; 8 | if (getBoolean (appPrefs.flServerBasedPrefs)) { 9 | twUploadFile (pathAppPrefs, jsontext, "application/json", true, function (data) { 10 | var archivepath = getDatePath (whenstart) + pathAppPrefs; 11 | twUploadFile (archivepath, jsontext, "application/json", true, function (data) { 12 | console.log ("prefsToStorage: uploaded \"" + archivepath + "\" to server in " + secondsSince (whenstart) + " secs."); 13 | }); 14 | }); 15 | } 16 | } 17 | function storageToPrefs (callback) { 18 | if (getBoolean (appPrefs.flServerBasedPrefs)) { 19 | var whenstart = new Date (); 20 | twGetFile (pathAppPrefs, true, true, function (error, data) { 21 | if (data != undefined) { 22 | var storedPrefs = JSON.parse (data.filedata); 23 | for (var x in storedPrefs) { 24 | appPrefs [x] = storedPrefs [x]; 25 | } 26 | console.log ("storageToPrefs: downloaded from server in " + secondsSince (whenstart) + " secs."); 27 | if (callback != undefined) { //8/16/14 by DW 28 | callback (); 29 | } 30 | } 31 | else { //call the callback even on an error 32 | if (callback != undefined) { 33 | var errorInfo = { 34 | flFileNotFound: false 35 | }; 36 | if (error.status == 500) { 37 | var s3response = JSON.parse (error.responseText); 38 | if (s3response.code == "NoSuchKey") { 39 | errorInfo.flFileNotFound = true; 40 | } 41 | } 42 | callback (errorInfo); 43 | } 44 | } 45 | }); 46 | } 47 | else { 48 | if (localStorage.appPrefs != undefined) { 49 | var storedPrefs = JSON.parse (localStorage.appPrefs); 50 | for (var x in storedPrefs) { 51 | appPrefs [x] = storedPrefs [x]; 52 | } 53 | } 54 | if (callback != undefined) { //11/6/14 by DW 55 | callback (); 56 | } 57 | } 58 | } 59 | function storageStartup (callback) { //11/7/14 by DW 60 | storageToPrefs (function (errorInfo) { 61 | var flStartupFail = false; 62 | if (errorInfo != undefined) { 63 | console.log ("storageStartup: errorInfo == " + jsonStringify (errorInfo)); 64 | if (errorInfo.flFileNotFound != undefined) { 65 | if (!errorInfo.flFileNotFound) { //some error other than file-not-found (which is a benign error, first-time user 66 | if (callback != undefined) { //startup fail 67 | callback (false); 68 | flStartupFail = true; 69 | } 70 | } 71 | } 72 | } 73 | if (!flStartupFail) { 74 | if (callback != undefined) { //good start 75 | callback (true); 76 | } 77 | } 78 | }); 79 | } 80 | function prefsToCookie () { 81 | prefsToStorage (); 82 | } 83 | function twitterToPrefs (twitterUserInfo) { //fill in RSS prefs from Twitter -- 8/7/14 by DW 84 | if (!appPrefs.flRssPrefsInitialized) { 85 | appPrefs.rssTitle = twitterUserInfo.name; 86 | appPrefs.rssDescription = twitterUserInfo.description; 87 | appPrefs.flRssPrefsInitialized = true; 88 | appPrefs.rssLink = twitterUserInfo.url; 89 | prefsToStorage (); 90 | twDerefUrl (twitterUserInfo.url, function (longUrl) { //try to unshorten the URL 91 | appPrefs.rssLink = longUrl; 92 | prefsToStorage (); 93 | }); 94 | } 95 | } 96 | function prefsDialogShow (saveCallback) { 97 | saveAppPrefsCallback = saveCallback; //4/24/15 by DW 98 | 99 | try { //6/7/14 by DW 100 | concord.stopListening (); //3/11/13 by DW 101 | } 102 | catch (err) { 103 | } 104 | 105 | $("#idPrefsDialog").modal ('show'); 106 | prefsSetDefaultValues (); //3/9/17 by DW 107 | 108 | $("#idPrefsDialog").on ("keydown", function (event) { //1/26/15 by DW 109 | if (event.which == 13) { 110 | prefsOkClicked (); 111 | return (false); 112 | } 113 | }); 114 | }; 115 | function prefsCloseDialog (event) { 116 | try { //6/7/14 by DW 117 | concord.resumeListening (); //3/11/13 by DW 118 | } 119 | catch (err) { 120 | } 121 | 122 | if (event !== undefined) { //4/11/16 by DW 123 | event.stopPropagation (); 124 | } 125 | 126 | $("#idPrefsDialog").modal ('hide'); 127 | }; 128 | function prefsGetValuesFromDialog () {//11/23/15 by DW 129 | var inputs = document.getElementById ("idPrefsDialog").getElementsByTagName ("input"), i; 130 | for (var i = 0; i < inputs.length; i++) { 131 | if (inputs [i].type == "checkbox") { 132 | appPrefs [inputs [i].name] = inputs [i].checked; 133 | } 134 | else { 135 | appPrefs [inputs [i].name] = inputs [i].value; 136 | } 137 | } 138 | 139 | var textareas = document.getElementById ("idPrefsDialog").getElementsByTagName ("textarea"), i; 140 | for (var i = 0; i < textareas.length; i++) { 141 | appPrefs [textareas [i].name] = textareas [i].value; 142 | } 143 | } 144 | function prefsSetDefaultValues () { //3/9/17 by DW 145 | var inputs = document.getElementById ("idPrefsDialog").getElementsByTagName ("input"), i; 146 | for (var i = 0; i < inputs.length; i++) { 147 | if (appPrefs [inputs [i].name] != undefined) { 148 | if (inputs [i].type == "checkbox") { 149 | inputs [i].checked = appPrefs [inputs [i].name]; 150 | } 151 | else { 152 | inputs [i].value = appPrefs [inputs [i].name]; 153 | } 154 | } 155 | } 156 | 157 | var textareas = document.getElementById ("idPrefsDialog").getElementsByTagName ("textarea"), i; 158 | for (var i = 0; i < textareas.length; i++) { 159 | if (appPrefs [textareas [i].name] != undefined) { 160 | textareas [i].value = appPrefs [textareas [i].name]; 161 | } 162 | } 163 | } 164 | function prefsOkClicked () { 165 | prefsGetValuesFromDialog (); //11/23/15 by DW 166 | 167 | 168 | prefsCloseDialog (); 169 | 170 | try { //1/9/18 by DW -- it's a pain to always have to set this up, now you don't ;-) 171 | applyPrefs (); 172 | } 173 | catch (err) { 174 | } 175 | 176 | if (saveAppPrefsCallback === undefined) { //4/24/15 by DW 177 | prefsToCookie (); 178 | } 179 | else { 180 | saveAppPrefsCallback (); 181 | } 182 | }; 183 | function getStoredPrefs (callback) { //9/6/14 by DW 184 | var whenstart = new Date (); 185 | twGetFile (pathAppPrefs, true, true, function (error, data) { 186 | if (data != undefined) { 187 | var storedPrefs = JSON.parse (data.filedata); 188 | for (var x in storedPrefs) { 189 | appPrefs [x] = storedPrefs [x]; 190 | } 191 | console.log ("getStoredPrefs: downloaded from server in " + secondsSince (whenstart) + " secs."); 192 | if (callback != undefined) { //8/16/14 by DW 193 | callback (); 194 | } 195 | } 196 | else { //don't call the callback on an error, just put up an alert. hope the user follows our advice! ;-) 197 | if (callback != undefined) { 198 | var responsestruct = JSON.parse (error.responseText); 199 | alert ("Error connecting to server: \"" + responsestruct.message + "\" Please reload the page to try again."); 200 | } 201 | } 202 | }); 203 | } 204 | $(document).ready (function () { 205 | $("#idPrefsDialog").bind ('show', function () { 206 | prefsSetDefaultValues (); 207 | }); 208 | }); 209 | -------------------------------------------------------------------------------- /concord/twoutliner.js: -------------------------------------------------------------------------------- 1 | function twFindTweetWithId (idToFind) { 2 | var fl = false; 3 | $(opGetActiveOutliner ()).concord ().op.visitAll (function (headline) { 4 | var id = headline.attributes.getOne ("tweetId"); 5 | if (id == idToFind) { 6 | fl = true; 7 | return (false); //stop looking 8 | } 9 | else { 10 | return (true); //keep looking 11 | } 12 | }); 13 | return (fl); 14 | } 15 | function twGetTweetInfo (idTweet, callback) { 16 | function encode (s) { 17 | return (encodeURIComponent (s)); 18 | } 19 | $.ajax({ 20 | type: "GET", 21 | url: twGetDefaultServer () + "gettweetinfo" + "?oauth_token=" + encode (localStorage.twOauthToken) + "&oauth_token_secret=" + encode (localStorage.twOauthTokenSecret) + "&id=" + encode (idTweet), 22 | success: function (data) { 23 | callback (data); 24 | }, 25 | error: function (status) { 26 | console.log ("twGetTweetInfo: error == " + JSON.stringify (status, undefined, 4)); 27 | }, 28 | dataType: "json" 29 | }); 30 | } 31 | function twOutlinerGetMyTweets () { 32 | var flFirstGetMyTweets = true; 33 | if (appPrefs.lastSeenMyTweetId != undefined) { 34 | if (appPrefs.lastSeenMyTweetId.length > 0) { 35 | flFirstGetMyTweets = false; 36 | } 37 | } 38 | twGetMyTweets (localStorage.twUserId, function (myTweets) { 39 | var starttime = new Date (); 40 | for (var i = 0; i < myTweets.length; i++) { 41 | var thisTweet = myTweets [i]; 42 | if (!flFirstGetMyTweets) { //the first time we don't add them to the outline 43 | if (thisTweet.in_reply_to_status_id_str == null) { //an original tweet, not a reply 44 | if (!twFindTweetWithId (thisTweet.id_str)) { //we don't already have it 45 | newPostWithoutIcon (hotUpText (thisTweet.text)); 46 | twSetHeadlineAtts (thisTweet); 47 | opSetOneAtt ("cssTextClass", "newTweetReply"); 48 | } 49 | } 50 | } 51 | //maintain localStorage.lastSeenMyTweetId 52 | if ((localStorage.lastSeenMyTweetId == undefined) || (thisTweet.id_str > localStorage.lastSeenMyTweetId)) { 53 | localStorage.lastSeenMyTweetId = thisTweet.id_str; 54 | } 55 | } 56 | }, localStorage.lastSeenMyTweetId); 57 | } 58 | function twOutlinerGetTwitterReplies (flBeepIfNoReplies, callback) { 59 | var timestamp = new Date ().getTime (), ctreplies = 0; 60 | var oldcursor = opGetCursor (); 61 | whenLastReplyCheck = new Date (); 62 | if (flBeepIfNoReplies === undefined) { 63 | if (appPrefs.flBeepIfNoReplies === undefined) { 64 | flBeepIfNoReplies = false; 65 | } 66 | else { 67 | flBeepIfNoReplies = appPrefs.flBeepIfNoReplies; 68 | } 69 | } 70 | 71 | console.log ("twOutlinerGetTwitterReplies: appPrefs.lastSeenMyTweetId == " + appPrefs.lastSeenMyTweetId); 72 | 73 | twGetTwitterReplies (localStorage.twUserId, appPrefs.lastSeenMyTweetId, function (myTweets) { 74 | console.log ("twOutlinerGetTwitterReplies: myTweets.length == " + myTweets.length); 75 | opVisitAll (function (headline) { 76 | var cssClass = headline.attributes.getOne ("cssTextClass"); 77 | if (cssClass == "newTweetReply") { 78 | var atts = headline.attributes.getAll (); 79 | delete atts ["cssTextClass"]; 80 | headline.attributes.setGroup (atts); 81 | } 82 | for (var i = 0; i < myTweets.length; i++) { 83 | var id = headline.attributes.getOne ("tweetId"), thisTweet = myTweets [i]; 84 | if (id != undefined) { 85 | if (thisTweet.in_reply_to_status_id_str == id) { 86 | if (!twFindTweetWithId (thisTweet.id_str)) { 87 | var screenName = thisTweet.user.screen_name; 88 | var tweetText = popTweetNameAtStart (thisTweet.text); 89 | tweetText = hotUpText ("@" + screenName + ": " + tweetText); 90 | headline.insert (tweetText, right); 91 | opSetOneAtt ("type", "tweet"); 92 | opSetOneAtt ("tweetId", thisTweet.id_str); 93 | opSetOneAtt ("tweetUserName", screenName); 94 | opSetOneAtt ("created", thisTweet.created_at); 95 | opSetOneAtt ("cssTextClass", "newTweetReply"); 96 | if (appPrefs.flExpandToShowReplies) { 97 | opExpandTo (getCursorRef ()); 98 | } 99 | ctreplies++; 100 | } 101 | } 102 | } 103 | 104 | if (appPrefs.lastSeenMyTweetId === undefined) { 105 | appPrefs.lastSeenMyTweetId = thisTweet.id_str; 106 | } 107 | else { 108 | if (thisTweet.id_str > appPrefs.lastSeenMyTweetId) { 109 | appPrefs.lastSeenMyTweetId = thisTweet.id_str; 110 | } 111 | else { 112 | } 113 | } 114 | } 115 | }); 116 | 117 | if (ctreplies > 0) { //1/30/17 by DW 118 | opSetCursor (oldcursor); 119 | } 120 | 121 | if ((ctreplies == 0) && flBeepIfNoReplies) { 122 | speakerBeep (); 123 | } 124 | if (callback != undefined) { 125 | callback (); 126 | } 127 | }); 128 | } 129 | function twOutlinerTweet (twitterStatus, inReplyToId, origcursor, otherguysname) { 130 | twTweet (twitterStatus, inReplyToId, function (data) { 131 | var urlReplyTo = ""; 132 | lastTweetData = data; 133 | origcursor.attributes.setOne ("type", "tweet"); 134 | origcursor.attributes.setOne ("tweetId", data.id_str); 135 | origcursor.attributes.setOne ("tweetUserName", data.user.screen_name); 136 | if (data.in_reply_to_status_id_str != null) { 137 | origcursor.attributes.setOne ("tweetInReplyToId", data.in_reply_to_status_id_str); 138 | } 139 | if (appPrefs.flTweetToPorkChopServer) { 140 | var url = opGetOneAtt ("url"); 141 | if (url == undefined) { 142 | url = ""; 143 | } 144 | if (otherguysname != undefined) { 145 | urlReplyTo = "http://twitter.com/" + otherguysname + "/status/" + inReplyToId; 146 | } 147 | sendToPorkChopServer (localStorage.twScreenName, origcursor.getLineText (), url, urlReplyTo); 148 | } 149 | }); 150 | } 151 | function twSendStatus (s, callback) { //8/27/14 by DW -- a streamlined interface for sending a tweet 152 | twTweet (s, undefined, function (tweetData) { 153 | if (callback != undefined) { 154 | callback (tweetData); 155 | } 156 | }); 157 | } 158 | function twSetHeadlineAtts (thisTweet) { //6/21/14 by DW 159 | opSetOneAtt ("type", "tweet"); 160 | opSetOneAtt ("tweetId", thisTweet.id_str); 161 | opSetOneAtt ("tweetUserName", thisTweet.user.screen_name); 162 | opSetOneAtt ("created", thisTweet.created_at); 163 | } 164 | function twTweetFromOutline (flJustReturnText, flConfirmTweets, idoutliner, flAddUrlIfPresent) { 165 | function getCursorRef () { 166 | var theCursor = $(idoutliner).concord ().op.getCursor (); 167 | return ($(idoutliner).concord ().op.setCursorContext (theCursor)) 168 | } 169 | var origcursor = getCursorRef (), text = opGetLineText (), ctlevels = 0, idparent = undefined, otherguysname = undefined; 170 | var tweetLength = text.length; //8/8/14 by DW 171 | if (flAddUrlIfPresent === undefined) { //12/8/14 by DW 172 | flAddUrlIfPresent = true; 173 | } 174 | if (flJustReturnText === undefined) { 175 | flJustReturnText = false; 176 | } 177 | $(idoutliner).concord ().op.visitToSummit (function (op) { 178 | if (ctlevels++ == 1) { 179 | idparent = op.attributes.getOne ("tweetId"); 180 | if (idparent != undefined) { 181 | otherguysname = op.attributes.getOne ("tweetUserName"); 182 | } 183 | return (false); 184 | } 185 | return (true); 186 | }); 187 | if (idparent == undefined) { 188 | idparent = 0; 189 | } 190 | if (otherguysname != undefined) { 191 | text = "@" + otherguysname + " -- " + text; 192 | } 193 | if (flAddUrlIfPresent) { //look for a url 194 | var shortUrl = opGetOneAtt ("shortUrl"); 195 | if (shortUrl != undefined) { 196 | text += " " + shortUrl; 197 | tweetLength += twGetUrlLength (); 198 | } 199 | else { 200 | var urlRenderedPage = opGetOneAtt ("urlRenderedPage"); 201 | if (urlRenderedPage != undefined) { 202 | text += " " + urlRenderedPage; 203 | tweetLength += twGetUrlLength (); 204 | } 205 | } 206 | } 207 | if (flJustReturnText) { 208 | return (text); 209 | } 210 | if (tweetLength > appPrefs.maxTweetLength) { 211 | alertDialog ("Can't tweet because the text is longer than " + appPrefs.maxTweetLength + " characters."); 212 | return; 213 | } 214 | if (flConfirmTweets) { 215 | confirmDialog ("Send the text to your Twitter followers?", function () { 216 | twOutlinerTweet (text, idparent, origcursor, otherguysname); 217 | }); 218 | } 219 | else { 220 | twOutlinerTweet (text, idparent, origcursor, otherguysname); 221 | } 222 | } 223 | function twGetCursorTweetUrl () { //5/25/17 by DW 224 | return ("http://twitter.com/" + opGetOneAtt ("tweetUserName") + "/status/" + opGetOneAtt ("tweetId")) 225 | } 226 | function twViewCursorTweet () { 227 | window.open (twGetCursorTweetUrl ()) 228 | } 229 | -------------------------------------------------------------------------------- /concord/buildrss.js : -------------------------------------------------------------------------------- 1 | var urlGetRssEnclosureInfo = "http://pub2.fargo.io:5347/getEnclosureInfo?url="; 2 | 3 | 4 | var rssCloudDefaults = { //6/5/15 by DW 5 | domain: "rpc.rsscloud.io", 6 | port: 5337, 7 | path: "/pleaseNotify" 8 | } 9 | function rssCloudPing (urlServer, urlFeed) { //6/5/15 by DW 10 | if (urlServer === undefined) { 11 | urlServer = "http://" + rssCloudDefaults.domain + ":" + rssCloudDefaults.port + rssCloudDefaults.path; 12 | } 13 | $.post (urlServer, {url: urlFeed}, function (data, status) { 14 | console.log ("rssCloudPing: urlServer == " + urlServer + ", urlFeed == " + urlFeed + ", status == " + status); 15 | }); 16 | } 17 | function getRssEnclosureInfo (obj, callback) { 18 | var jxhr = $.ajax ({ 19 | url: urlGetRssEnclosureInfo + encodeURIComponent (obj.enclosure.url), 20 | dataType: "jsonp", 21 | timeout: 30000, 22 | jsonpCallback : "getData" 23 | }) 24 | .success (function (data, status) { 25 | if (data.flError != undefined) { //2/15/14 by DW 26 | obj.enclosure.flError = true; 27 | } 28 | else { 29 | obj.enclosure.type = data.type; 30 | obj.enclosure.length = data.length; 31 | if (callback != undefined) { 32 | callback (); 33 | } 34 | } 35 | }) 36 | .error (function (status) { 37 | console.log ("getEnclosureInfo: Error getting type and length -- " + jsonStringify (status)); 38 | obj.enclosure.flError = true; 39 | }); 40 | } 41 | function buildRssFeed (headElements, historyArray) { 42 | function encode (s) { 43 | var lines = encodeXml (s).split (String.fromCharCode (10)); 44 | var returnedstring = ""; 45 | for (var i = 0; i < lines.length; i++) { 46 | returnedstring += trimWhitespace (lines [i]); 47 | if (i < (lines.length - 1)) { 48 | returnedstring += " "; 49 | } 50 | } 51 | return (returnedstring); 52 | } 53 | function facebookEncodeContent (item, bodystring) { 54 | 55 | var htmltext = ""; 56 | function multipleReplaceAll (s, adrTable, flCaseSensitive, startCharacters, endCharacters) { 57 | if(flCaseSensitive===undefined){ 58 | flCaseSensitive = false; 59 | } 60 | if(startCharacters===undefined){ 61 | startCharacters=""; 62 | } 63 | if(endCharacters===undefined){ 64 | endCharacters=""; 65 | } 66 | for( var item in adrTable){ 67 | var replacementValue = adrTable[item]; 68 | var regularExpressionModifier = "g"; 69 | if(!flCaseSensitive){ 70 | regularExpressionModifier = "gi"; 71 | } 72 | var regularExpressionString = (startCharacters+item+endCharacters).replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); 73 | var regularExpression = new RegExp(regularExpressionString, regularExpressionModifier); 74 | s = s.replace(regularExpression, replacementValue); 75 | } 76 | return s; 77 | } 78 | function massageHtml (s) { 79 | var replaceTable = { 80 | "

": "

", 81 | "

": "", 82 | "

": "" 83 | }; 84 | return (multipleReplaceAll (s, replaceTable, false)); 85 | } 86 | function add (s) { 87 | htmltext += filledString ("\t", indentlevel) + s + "\n"; 88 | } 89 | function formatDate (d) { 90 | 91 | return (""); //temp hack 92 | 93 | d = new Date (d); 94 | return (d.toLocaleDateString () + "; " + d.toLocaleTimeString ()); 95 | } 96 | add (""); 97 | add (""); 98 | add (""); indentlevel++; 99 | //head 100 | add (""); indentlevel++; 101 | add (""); 102 | add (""); 103 | add (""); //2/24/16 by DW 104 | add (""); 105 | add (""); indentlevel--; 106 | //body 107 | add (""); indentlevel++; 108 | add ("
"); indentlevel++; 109 | add ("
"); indentlevel++; 110 | add ("

" + item.title + "

"); 111 | add (""); 112 | if (item.whenupdate !== undefined) { 113 | add (""); 114 | } 115 | add ("
" + item.name + "
"); //2/24/16 by DW 116 | add (massageHtml (bodystring)); 117 | add ("
"); indentlevel--; 118 | add ("
"); indentlevel--; 119 | add (""); indentlevel--; 120 | add (""); indentlevel--; 121 | return (htmltext); 122 | } 123 | function whenMostRecentTweet () { 124 | if (historyArray.length > 0) { 125 | return (new Date (historyArray [0].when)); 126 | } 127 | else { 128 | return (new Date (0)); 129 | } 130 | } 131 | function buildOutlineXml (theOutline) { 132 | function addOutline (outline) { 133 | var s = " 0); 136 | } 137 | function addAtt (name) { 138 | if (outline [name] != undefined) { 139 | s += " " + name + "=\"" + encode (outline [name]) + "\" "; 140 | } 141 | } 142 | addAtt ("text"); 143 | addAtt ("type"); 144 | addAtt ("created"); 145 | addAtt ("name"); 146 | 147 | if (hasSubs (outline)) { 148 | add (s + ">"); 149 | indentlevel++; 150 | for (var i = 0; i < outline.subs.length; i++) { 151 | addOutline (outline.subs [i]); 152 | } 153 | add (""); 154 | indentlevel--; 155 | } 156 | else { 157 | add (s + "/>"); 158 | } 159 | 160 | } 161 | addOutline (theOutline); 162 | return (xmltext); 163 | } 164 | function markdownProcess (s) { //7/24/15 by DW 165 | var md = new Markdown.Converter (), theList = s.split ("

"), markdowntext = ""; 166 | for (var i = 0; i < theList.length; i++) { 167 | var lt = theList [i]; 168 | if ((lt.length > 0) && (lt != "

") && (lt != "

")) { 169 | markdowntext += "

" + md.makeHtml (lt) + "

"; 170 | } 171 | } 172 | return (markdowntext); 173 | } 174 | var xmltext = "", indentlevel = 0, starttime = new Date (); nowstring = starttime.toGMTString (); 175 | var username = headElements.twitterScreenName, maxitems = headElements.maxFeedItems, contentNamespaceDecl = "", facebookNamespaceDecl = ""; 176 | function add (s) { 177 | xmltext += filledString ("\t", indentlevel) + s + "\n"; 178 | } 179 | function addAccount (servicename, username) { 180 | if ((username != undefined) && (username.length > 0)) { 181 | add ("" + encode (username) + ""); 182 | } 183 | } 184 | add ("") 185 | add ("") 186 | 187 | if (getBoolean (headElements.flUseContentEncoded)) { //2/22/16 by DW 188 | contentNamespaceDecl = " xmlns:content=\"http://purl.org/rss/1.0/modules/content/\""; 189 | } 190 | if (getBoolean (headElements.flFacebookEncodeContent)) { //3/7/16 by DW 191 | facebookNamespaceDecl = " xmlns:IA=\"http://rss2.io/ia/\""; 192 | } 193 | 194 | add (""); indentlevel++ 195 | add (""); indentlevel++; 196 | //add header elements 197 | add ("" + encode (headElements.title) + ""); 198 | add ("" + encode (headElements.link) + ""); 199 | add ("" + encode (headElements.description) + ""); 200 | add ("" + whenMostRecentTweet ().toUTCString () + ""); 201 | add ("" + nowstring + ""); 202 | add ("" + encode (headElements.language) + ""); 203 | add ("" + headElements.generator + ""); 204 | add ("" + headElements.docs + ""); 205 | 206 | // element -- 6/5/15 by DW 207 | if (headElements.flRssCloudEnabled) { 208 | add ("") 209 | } 210 | 211 | addAccount ("twitter", username); 212 | //add items 213 | var ctitems = 0; 214 | for (var i = 0; (i < historyArray.length) && (ctitems < maxitems); i++) { 215 | var item = historyArray [i]; 216 | if ((!getBoolean (headElements.flTitledItemsOnly)) || (item.title !== undefined)) { //2/22/16 by DW 217 | var itemcreated = twTwitterDateToGMT (item.when), itemtext = encode (item.text); 218 | var linktotweet = encode ("https://twitter.com/" + username + "/status/" + item.idTweet); 219 | add (""); indentlevel++; 220 | if (item.title !== undefined) { //3/4/15 by DW 221 | add ("" + encode (item.title) + ""); 222 | } 223 | //description -- 3/26/15 by DW 224 | function addDescriptionElement (s) { 225 | add ("" + encode (s) + ""); 226 | if (getBoolean (headElements.flUseContentEncoded)) { 227 | add (""); indentlevel--; 233 | } 234 | } 235 | if (getBoolean (item.flMarkdown)) { 236 | if (getBoolean (item.flPgfLevelMarkdown)) { //7/24/15 by DW 237 | addDescriptionElement (markdownProcess (item.text)); 238 | } 239 | else { 240 | addDescriptionElement (new Markdown.Converter ().makeHtml (item.text)); 241 | } 242 | } 243 | else { 244 | addDescriptionElement (item.text); 245 | } 246 | add ("" + itemcreated + ""); 247 | //link -- 8/12/14 by DW 248 | if (item.link != undefined) { 249 | add ("" + encode (item.link) + ""); 250 | } 251 | else { 252 | add ("" + linktotweet + ""); 253 | } 254 | //source:linkShort -- 8/26/14 by DW 255 | if (item.linkShort != undefined) { 256 | add ("" + encode (item.linkShort) + ""); 257 | } 258 | //guid -- 8/12/14 by DW 259 | if (item.guid != undefined) { 260 | if (getBoolean (item.guid.flPermalink)) { 261 | add ("" + encode (item.guid.value) + ""); 262 | } 263 | else { 264 | add ("" + encode (item.guid.value) + ""); 265 | } 266 | } 267 | else { 268 | add ("" + linktotweet + ""); 269 | } 270 | //enclosure -- 8/11/14 by DW 271 | if (item.enclosure != undefined) { 272 | var enc = item.enclosure; 273 | if ((enc.url != undefined) && (enc.type != undefined) && (enc.length != undefined)) { 274 | add (""); 275 | } 276 | } 277 | //source:markdown -- 3/26/15 by DW 278 | if (getBoolean (item.flMarkdown)) { 279 | add ("" + itemtext + ""); 280 | } 281 | //source:jsonUrl -- 3/24/15 by DW 282 | if (item.linkJson !== undefined) { 283 | add ("" + encode (item.linkJson) + ""); 284 | } 285 | //source:outline 286 | if (item.outline != undefined) { //10/15/14 by DW 287 | buildOutlineXml (item.outline); 288 | } 289 | else { 290 | var outlineTextAtt = itemtext; //12/14/16 by DW 291 | if (item.title !== undefined) { 292 | if (item.title.length > 0) { 293 | outlineTextAtt = encode (item.title); 294 | } 295 | } 296 | if (item.idTweet != undefined) { 297 | add (""); 298 | } 299 | else { //12/14/16 by DW 300 | if (item.enclosure != undefined) { //9/23/14 by DW 301 | var enc = item.enclosure; 302 | if (enc.type != undefined) { //10/25/14 by DW 303 | if (beginsWith (enc.type.toLowerCase (), "image")) { 304 | add (""); 305 | } 306 | } 307 | } 308 | } 309 | } 310 | add (""); indentlevel--; 311 | ctitems++; 312 | } 313 | } 314 | add (""); indentlevel--; 315 | add (""); indentlevel--; 316 | return (xmltext); 317 | } 318 | -------------------------------------------------------------------------------- /river5/serverhomepage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | River5 4 | 5 | 6 | 7 | 8 | 209 | 235 | 236 | 237 |
238 |
239 | 264 |
265 |
266 |
267 |
268 |
269 |
270 | 272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |   282 |
283 |
284 |
285 |
286 |   287 |
288 |
289 |
290 | 295 | 296 | 297 | -------------------------------------------------------------------------------- /riverBrowserIncludes/outlinebrowser.js: -------------------------------------------------------------------------------- 1 | //code that displays an outline jstruct in javascript 2 | 3 | 4 | 5 | var outlineBrowserData = { 6 | version: "0.5.1", 7 | serialNum: 0, 8 | flTextBasedPermalinks: true, //1/26/17 by DW 9 | flProcessEmoji: true, //7/3/17 by DW 10 | expandCollapseCallback: function (idnum) { //9/22/17 by DW 11 | } 12 | } 13 | 14 | function getExpansionState () { 15 | var theList = ""; 16 | function stringDelete (s, ix, ct) { 17 | var start = ix - 1; 18 | var end = (ix + ct) - 1; 19 | var s1 = s.substr (0, start); 20 | var s2 = s.substr (end); 21 | return (s1 + s2); 22 | } 23 | $(".aOutlineWedgeLink i").each (function () { 24 | var flExpanded = $(this).hasClass ("fa-caret-down"); 25 | if (flExpanded) { 26 | var id = $(this).attr ("id"); //something like idOutlineWedge17 27 | theList += stringDelete (id, 1, "idOutlineWedge".length) + ","; 28 | } 29 | }); 30 | if (theList.length > 0) { 31 | theList = stringDelete (theList, theList.length, 1); //remove trailing comma 32 | } 33 | return (theList); 34 | } 35 | function applyExpansionState (theList) { 36 | var splits = theList.split (","); 37 | for (var i = 0; i < splits.length; i++) { 38 | var idWedge = "#idOutlineWedge" + splits [i]; 39 | var idLevel = "#idOutlineLevel" + splits [i]; 40 | $(idWedge).attr ("class", "fa fa-caret-down"); 41 | $(idWedge).css ("color", "silver"); 42 | $(idLevel).css ("display", "block"); 43 | } 44 | } 45 | 46 | function ecOutline (idnum) { 47 | var c = document.getElementById ("idOutlineWedge" + idnum), idUL = "#idOutlineLevel" + idnum; 48 | if (c.className == "fa fa-caret-down") { 49 | c.className = "fa fa-caret-right"; 50 | c.style.color = "black"; 51 | $(idUL).slideUp (75); 52 | } 53 | else { 54 | c.className = "fa fa-caret-down"; 55 | c.style.color = "silver"; 56 | $(idUL).slideDown (75, undefined, function () { 57 | 58 | $(idUL).css ("display", "block"); 59 | 60 | }); 61 | } 62 | outlineBrowserData.expandCollapseCallback (idnum); //9/22/17 by DW 63 | } 64 | function riverGetPermalinkString (urlPermalink, permalinkString) { 65 | if (urlPermalink == undefined) { 66 | return (""); 67 | } 68 | if (permalinkString == undefined) { 69 | permalinkString = "#"; 70 | } 71 | return (""); 72 | } 73 | function renderOutlineBrowser (outline, flMarkdown, urlPermalink, permalinkString, flExpanded) { 74 | function stringLower (s) { 75 | if (s === undefined) { //1/26/15 by DW 76 | return (""); 77 | } 78 | s = s.toString (); //1/26/15 by DW 79 | return (s.toLowerCase ()); 80 | } 81 | function isAlpha (ch) { 82 | return (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))); 83 | } 84 | function isNumeric (ch) { 85 | return ((ch >= '0') && (ch <= '9')); 86 | } 87 | function stripMarkup (s) { //5/24/14 by DW 88 | if ((s === undefined) || (s == null) || (s.length == 0)) { 89 | return (""); 90 | } 91 | return (s.replace (/(<([^>]+)>)/ig, "")); 92 | } 93 | function innerCaseName (text) { //8/12/14 by DW 94 | var s = "", ch, flNextUpper = false; 95 | text = stripMarkup (text); 96 | for (var i = 0; i < text.length; i++) { 97 | ch = text [i]; 98 | if (isAlpha (ch) || isNumeric (ch)) { 99 | if (flNextUpper) { 100 | ch = ch.toUpperCase (); 101 | flNextUpper = false; 102 | } 103 | else { 104 | ch = ch.toLowerCase (); 105 | } 106 | s += ch; 107 | } 108 | else { 109 | if (ch == ' ') { 110 | flNextUpper = true; 111 | } 112 | } 113 | } 114 | return (s); 115 | } 116 | function filledString (ch, ct) { //6/4/14 by DW 117 | var s = ""; 118 | for (var i = 0; i < ct; i++) { 119 | s += ch; 120 | } 121 | return (s); 122 | } 123 | function getBoolean (val) { //12/5/13 by DW 124 | switch (typeof (val)) { 125 | case "string": 126 | if (val.toLowerCase () == "true") { 127 | return (true); 128 | } 129 | break; 130 | case "boolean": 131 | return (val); 132 | case "number": 133 | if (val == 1) { 134 | return (true); 135 | } 136 | break; 137 | } 138 | return (false); 139 | } 140 | function beginsWith (s, possibleBeginning, flUnicase) { 141 | if (s.length == 0) { //1/1/14 by DW 142 | return (false); 143 | } 144 | if (flUnicase === undefined) { 145 | flUnicase = true; 146 | } 147 | if (flUnicase) { 148 | for (var i = 0; i < possibleBeginning.length; i++) { 149 | if (stringLower (s [i]) != stringLower (possibleBeginning [i])) { 150 | return (false); 151 | } 152 | } 153 | } 154 | else { 155 | for (var i = 0; i < possibleBeginning.length; i++) { 156 | if (s [i] != possibleBeginning [i]) { 157 | return (false); 158 | } 159 | } 160 | } 161 | return (true); 162 | } 163 | function hotUpText (s, url) { //7/18/14 by DW 164 | 165 | if (url === undefined) { //makes it easier to call -- 3/14/14 by DW 166 | return (s); 167 | } 168 | 169 | function linkit (s) { 170 | return ("" + s + ""); 171 | } 172 | var ixleft = s.indexOf ("["), ixright = s.indexOf ("]"); 173 | if ((ixleft == -1) || (ixright == -1)) { 174 | return (linkit (s)); 175 | } 176 | if (ixright < ixleft) { 177 | return (linkit (s)); 178 | } 179 | 180 | var linktext = s.substr (ixleft + 1, ixright - ixleft - 1); //string.mid (s, ixleft, ixright - ixleft + 1); 181 | linktext = "" + linktext + ""; 182 | 183 | var leftpart = s.substr (0, ixleft); 184 | var rightpart = s.substr (ixright + 1, s.length); 185 | s = leftpart + linktext + rightpart; 186 | return (s); 187 | } 188 | function debugNode (theNode) { 189 | var attstext = ""; 190 | for (var x in theNode) { 191 | if ((x != "subs") && (x != "parent") && (x != "created")) { 192 | if (attstext.length > 0) { 193 | attstext += ", "; 194 | } 195 | attstext += x + "=" + theNode [x]; 196 | } 197 | } 198 | return (attstext); 199 | } 200 | function getNodeType (theNode) { 201 | if (theNode.type == "include") { 202 | return (theNode.includetype); //this allows include nodes to have types 203 | } 204 | else { 205 | return (theNode.type); 206 | } 207 | } 208 | function getNameAtt (theNode) { 209 | var nameatt = theNode.name; 210 | if (nameatt === undefined) { 211 | nameatt = innerCaseName (theNode.text); 212 | } 213 | return (nameatt); 214 | } 215 | function typeIsDoc (theNode) { 216 | var type = getNodeType (theNode); 217 | return ((type !== undefined) && (type != "include") && (type != "link") && (type != "tweet")); 218 | } 219 | function getIcon (idnum, flcollapsed) { 220 | var wedgedir, color; 221 | if (flcollapsed) { 222 | wedgedir = "right"; 223 | color = "black"; 224 | } 225 | else { 226 | wedgedir = "down"; 227 | color = "silver"; 228 | } 229 | 230 | var clickscript = "onclick=\"ecOutline (" + idnum + ")\" "; 231 | var icon = ""; 232 | return (icon); 233 | } 234 | function expandableTextLink (theText, idLevel) { 235 | return ("" + theText + ""); 236 | } 237 | var htmltext = "", indentlevel = 0, permalink = riverGetPermalinkString (urlPermalink, permalinkString), outlinelevel = 0; 238 | var markdown = new Markdown.Converter (); 239 | if (flMarkdown === undefined) { 240 | flMarkdown = false; 241 | } 242 | if (flExpanded === undefined) { //10/23/14 by DW 243 | flExpanded = riverBrowserData.flOutlinesExpandedByDefault; //4/16/15 by DW 244 | } 245 | function add (s) { 246 | htmltext += filledString ("\t", indentlevel) + s + "\r\n"; 247 | } 248 | function getHotText (outline) { 249 | var origtext = outline.text; 250 | var s = hotUpText (outline.text, outline.url); 251 | if (s != origtext) { 252 | return (s); 253 | } 254 | else { 255 | if (getBoolean (outline.bold)) { //12/6/14 by DW 256 | s = "" + s + ""; 257 | } 258 | return (expandableTextLink (s, outlineBrowserData.serialNum)); 259 | } 260 | } 261 | function hasSubs (outline) { 262 | return (outline.subs != undefined) && (outline.subs.length > 0); 263 | } 264 | function getImgHtml (outline) { //7/15/15 by DW 265 | if ((outline.type !== undefined) || (outline.img === undefined)) { 266 | return (""); 267 | } 268 | else { 269 | return (""); 270 | } 271 | } 272 | function gatherStylesFromOutline (outline) { //11/5/14 by DW 273 | var atts = new Object (), styles = new Object (); 274 | for (var x in outline) { 275 | switch (x) { 276 | case "color": 277 | case "direction": 278 | case "font-family": 279 | case "font-size": 280 | case "font-weight": 281 | case "letter-spacing": 282 | case "line-height": 283 | case "margin-left": 284 | case "text-decoration": 285 | case "text-shadow": 286 | case "text-transform": 287 | case "white-space": 288 | case "word-spacing": 289 | styles [x] = outline [x]; 290 | break; 291 | } 292 | } 293 | return (styles); 294 | } 295 | function getStylesString (outline, flcollapsed) { //11/7/14 by DW 296 | var styles = gatherStylesFromOutline (outline), style = ""; 297 | if (flcollapsed) { 298 | styles.display = "none"; 299 | } 300 | for (var x in styles) { 301 | style += x + ": " + styles [x] + "; "; 302 | } 303 | if (style.length > 0) { 304 | style = " style=\"" + style + "\""; 305 | } 306 | return (style); 307 | } 308 | function getSubsMarkdownText (outline) { 309 | var s = "", style = getStylesString (outline, false); 310 | for (var i = 0; i < outline.subs.length; i++) { 311 | var child = outline.subs [i], img = "", imgatt; 312 | if (!getBoolean (child.isComment)) { //5/2/15 by DW 313 | s += getImgHtml (child) + child.text + "\r\r"; 314 | if (hasSubs (child)) { 315 | s += getSubsMarkdownText (child); 316 | } 317 | } 318 | } 319 | return (s); 320 | } 321 | function getNodePermalink (theNode) { //6/5/16 by DW 322 | var permalinkstring = ""; 323 | function textPermalink () { 324 | var theName = "", splits = stripMarkup (theNode.text).split (" "); 325 | for (var i = 0; i < splits.length; i++) { 326 | var ch = splits [i] [0]; 327 | if (isAlpha (ch)) { 328 | theName += ch.toLowerCase (); 329 | } 330 | if (theName.length >= 4) { 331 | break; 332 | } 333 | } 334 | return (theName); 335 | } 336 | function datePermalink () { 337 | return (new Date (theNode.created).getTime ().toString ()); 338 | } 339 | if (getBoolean (theNode.flPermalink)) { 340 | var theName = "", splits = stripMarkup (theNode.text).split (" "); 341 | if (outlineBrowserData.flTextBasedPermalinks) { //1/26/17 by DW 342 | theName = textPermalink (); 343 | } 344 | else { 345 | if (theNode.created !== undefined) { 346 | theName = datePermalink (); 347 | } 348 | else { 349 | theName = textPermalink (); 350 | } 351 | } 352 | permalinkstring = "" + "#" + ""; 353 | } 354 | return (permalinkstring); 355 | } 356 | function addChildlessSub (theNode, path) { //5/20/15 by DW 357 | if (typeIsDoc (theNode)) { 358 | add ("
  • " + theNode.text + "" + getNodePermalink (theNode) + "
  • "); 359 | } 360 | else { 361 | var type = getNodeType (theNode); 362 | switch (type) { 363 | case "link": 364 | add ("
  • " + theNode.text + "" + getNodePermalink (theNode) + "
  • "); 365 | break; 366 | default: 367 | add ("
  • " + theNode.text + getNodePermalink (theNode) + "
  • "); 368 | break; 369 | } 370 | } 371 | } 372 | function addSubs (outline, flcollapsed, path) { 373 | if (hasSubs (outline)) { 374 | var style = getStylesString (outline, flcollapsed), ulAddedClass = ""; 375 | if (getBoolean (outline.flNumberedSubs)) { //6/23/17 by DW 376 | ulAddedClass = " ulNumberedSubs"; 377 | } 378 | add ("
      "); indentlevel++; outlinelevel++; 379 | for (var i = 0; i < outline.subs.length; i++) { 380 | var child = outline.subs [i], flchildcollapsed = getBoolean (child.collapse), img = getImgHtml (child); 381 | if (!beginsWith (child.text, ""); indentlevel++; 386 | var textlink = expandableTextLink (child.text, outlineBrowserData.serialNum); 387 | add ("
      " + getIcon (outlineBrowserData.serialNum, flchildcollapsed) + img + textlink + getNodePermalink (child) + "
      "); 388 | addSubs (child, flchildcollapsed, childpath + "/"); 389 | add (""); indentlevel--; 390 | } 391 | else { 392 | addChildlessSub (child, childpath); 393 | } 394 | } 395 | } 396 | } 397 | add ("
    "); indentlevel--; outlinelevel--; 398 | } 399 | } 400 | 401 | 402 | if (hasSubs (outline)) { //9/22/14 by DW 403 | var flTopLevelCollapsed = !flExpanded, theText = getHotText (outline); 404 | add ("
    "); indentlevel++; 405 | add ("
    " + getIcon (outlineBrowserData.serialNum, flTopLevelCollapsed) + theText + permalink + "
    "); 406 | 407 | if (flMarkdown) { 408 | var markdowntext = getSubsMarkdownText (outline), style = ""; 409 | if (flTopLevelCollapsed) { //10/23/14 by DW 410 | style = " style=\"display: none;\""; 411 | } 412 | var opendiv = "
    "; 413 | add (opendiv + markdown.makeHtml (markdowntext) + "
    "); 414 | } 415 | else { 416 | add ("
    "); indentlevel++; 417 | addSubs (outline, flTopLevelCollapsed, ""); 418 | add ("
    "); indentlevel--; 419 | } 420 | 421 | add ("
    "); indentlevel--; 422 | 423 | outlineBrowserData.serialNum++; //9/22/14 by DW 424 | } 425 | else { 426 | add ("
    "); indentlevel++; 427 | add ("
    " + hotUpText (outline.text, outline.url) + permalink + "
    "); 428 | add ("
    "); indentlevel--; 429 | } 430 | 431 | 432 | return (htmltext); 433 | } 434 | -------------------------------------------------------------------------------- /concord/xml.js: -------------------------------------------------------------------------------- 1 | var lineEnding = "\r\n"; 2 | 3 | function isPoundItem (s) { //#name "value" 4 | if (s.length > 0) { 5 | if (s [0] == "#") { 6 | s = stringDelete (s, 1, 1); 7 | for (var i = 0; i < s.length; i++) { 8 | if (s [i] == " ") { 9 | s = stringDelete (s, 1, i); 10 | s = trimWhitespace (s); 11 | if (s.length >= 2) { 12 | if ((s [0] == "\"") && (s [s.length - 1] == "\"")) { 13 | return (true); 14 | } 15 | } 16 | break; 17 | } 18 | } 19 | //if it's something like #glossary, return true 20 | if (isPoundItemTableName (s)) { 21 | return (true); 22 | } 23 | } 24 | } 25 | return (false); 26 | } 27 | function isPoundItemTableName (name) { 28 | switch (trimWhitespace (stringLower (name))) { 29 | case "glossary": 30 | case "templates": 31 | case "finalfilter": //12/8/13 by DW 32 | case "macros": //12/16/13 by DW 33 | case "style": //1/4/14 by DW 34 | case "menus": 35 | return (true); 36 | } 37 | return (false); 38 | } 39 | function xmlGetValue (adrx, name) { 40 | return (adrx.children (name).text ()); 41 | } 42 | function xmlGetAddress (adrx, name) { 43 | return (adrx.find (name)); 44 | } 45 | function xmlGetAttribute (adrx, name) { 46 | return ($(adrx).attr (name)); 47 | } 48 | function xmlGetTextAtt (adrx) { 49 | var s = xmlGetAttribute (adrx, "text"); 50 | if (s === undefined) { 51 | s = ""; 52 | } 53 | return (s); 54 | } 55 | function xmlIsComment (adrx) { 56 | return (xmlGetAttribute (adrx, "isComment") == "true"); 57 | } 58 | function xmlSetAttribute (adrx, name, value) { 59 | $(adrx).attr (name, value); 60 | } 61 | function xmlDeleteAttribute (adrx, name) { 62 | $(adrx).removeAttr (name); 63 | } 64 | function xmlGatherAttributes (adrx, theTable) { 65 | if (adrx.attributes != undefined) { 66 | for (var i = 0; i < adrx.attributes.length; i++) { 67 | var att = adrx.attributes [i]; 68 | if (att.specified) { 69 | theTable [att.name] = att.value; 70 | } 71 | } 72 | } 73 | } 74 | function xmlHasSubs (adrx) { 75 | return ($(adrx).children ().length > 0); //use jQuery to get answer -- 12/30/13 by DW 76 | 77 | }; 78 | function xmlGetSub1 (adrx) { 79 | var sub1; 80 | xmlOneLevelVisit (adrx, function (adrx) { 81 | if (!xmlIsComment (adrx)) { 82 | sub1 = adrx; 83 | return (false); 84 | } 85 | return (true); 86 | }); 87 | return (sub1); 88 | } 89 | function xmlGetParent (adrx) { //3/4/14 by DW 90 | return ($(adrx).parent ()); 91 | } 92 | function xmlGetNext (adrx) { //4/11/14 by DW 93 | return ($(adrx).next ()); 94 | } 95 | function xmlGetPrev (adrx) { //4/11/14 by DW 96 | return ($(adrx).prev ()); 97 | } 98 | function xmlGetNodeName (adrx) { 99 | var name = xmlGetAttribute (adrx, "name"); 100 | if (name != undefined) { 101 | return (name); 102 | } 103 | return (getCanonicalName (xmlGetTextAtt (adrx))); 104 | } 105 | function xmlGetDivWithData (adrx, divname) { //3/23/14 by DW 106 | var s = "
    "); 120 | } 121 | function xmlNodesAreSiblings (adr1, adr2) { //1/10/14 by DW 122 | return ($(adr1).parent () == $(adr2).parent ()); 123 | } 124 | function xmlIsDocumentNode (adrx) { 125 | var type = xmlGetAttribute (adrx, "type"); 126 | return ((type != undefined) && (type != "include") && (type != "link")); 127 | } 128 | function xmlGetNodeNameProp (adrx) { //12/10/13 by DW 129 | return ($(adrx).prop ("nodeName")); 130 | } 131 | function xmlNodeIsContent (adrx) { //12/2/13 by DW 132 | if (xmlGetNodeNameProp (adrx) != "outline") { //12/10/13 by DW 133 | return (false); 134 | } 135 | return ((!xmlIsComment (adrx)) && (!isPoundItem (xmlGetTextAtt (adrx)))); 136 | } 137 | function xmlReadFile (url) { //a synchronous file read 138 | return ($.ajax ({ 139 | url: getReadHttpUrl () + "?url=" + encodeURIComponent (url) + "&type=" + encodeURIComponent ("text/plain"), 140 | headers: {"Accept": "text/x-opml"}, 141 | async: false, 142 | dataType: "text" , 143 | timeout: 30000 144 | }).responseText); 145 | } 146 | function xmlExpandInclude (adrx) { 147 | var typeatt = xmlGetAttribute (adrx, "type"); 148 | if (typeatt == "include") { 149 | var urlatt = xmlGetAttribute (adrx, "url"); 150 | if (urlatt != undefined) { 151 | try { 152 | var opmltext = xmlReadFile (urlatt); 153 | var xstruct = $($.parseXML (opmltext)); 154 | var adropml = xmlGetAddress (xstruct, "opml"); 155 | var adrbody = xmlGetAddress (adropml, "body"); 156 | $(adrbody).children ("outline").each (function () { 157 | var adrcopy = this.cloneNode (true); 158 | adrx.appendChild (adrcopy); 159 | }); 160 | xmlDeleteAttribute (adrx, "type"); 161 | xmlDeleteAttribute (adrx, "url"); 162 | } 163 | catch (err) { 164 | console.log ("xmlExpandInclude, error expanding: " + urlatt + ", " + err.message); 165 | } 166 | 167 | } 168 | } 169 | } 170 | function xmlVisit (adrx, callback, level, path) { 171 | if (level === undefined) { 172 | level = 0; 173 | } 174 | if (path === undefined) { 175 | path = ""; 176 | } 177 | $(adrx).children ("outline").each (function () { 178 | var flvisitsubs = true, name = xmlGetNodeName (this); 179 | xmlExpandInclude (this); 180 | if (callback != undefined) { 181 | if (!callback (this, level, path + name)) { 182 | flvisitsubs = false; 183 | } 184 | } 185 | if (flvisitsubs) { 186 | if (!xmlVisit (this, callback, level + 1, path + name + "/")) { 187 | return (false); 188 | } 189 | } 190 | }); 191 | return (true); 192 | } 193 | function xmlOneLevelVisit (adrx, callback) { 194 | $(adrx).children ("outline").each (function () { 195 | xmlExpandInclude (this); 196 | if (callback != undefined) { 197 | if (!callback (this)) { 198 | return (false); 199 | } 200 | } 201 | return (true); 202 | }); 203 | } 204 | function xmlHasSubDocs (adrx) { //1/10/14 by DW -- return true if the node has any subs that are document nodes 205 | var flhassubdocs = false; 206 | xmlVisit (adrx, function (adrx, level, path) { 207 | if (flhassubdocs) { //unwind levels of recursion 208 | return (false); 209 | } 210 | if (xmlIsComment (adrx) || isPoundItem (xmlGetTextAtt (adrx))) { 211 | return (false); 212 | } 213 | if (xmlIsDocumentNode (adrx)) { 214 | flhassubdocs = true; 215 | return (false); 216 | } 217 | return (true); 218 | }); 219 | return (flhassubdocs); 220 | } 221 | function xmlStoryVisit (adrsummit, adrmustvisit, callback) { //12/28/13 by DW 222 | var fldone = false; 223 | xmlVisit (adrsummit, function (adrx, level, path) { 224 | if (fldone) { 225 | return (false); 226 | } 227 | if (xmlIsComment (adrx) || isPoundItem (xmlGetTextAtt (adrx))) { //12/31/13 by DW 228 | return (false); 229 | } 230 | if (xmlIsDocumentNode (adrx) || (adrx == adrmustvisit)) { 231 | if (callback != undefined) { 232 | var name = xmlGetNodeName (this); 233 | if (!callback (adrx, level, path + name)) { 234 | fldone = true; 235 | } 236 | } 237 | return (false); //don't visit inside document nodes 238 | } 239 | return (true); 240 | }); 241 | } 242 | function xmlFind (adrparent, nameToLookFor) { 243 | var s = stringLower (nameToLookFor), adrfound; 244 | xmlOneLevelVisit (adrparent, function (adrsub) { 245 | if (xmlNodeIsContent (adrsub)) { 246 | if (stringLower (xmlGetNodeName (adrsub)) == s) { 247 | adrfound = adrsub; 248 | return (false); 249 | } 250 | } 251 | return (true); 252 | }); 253 | return (adrfound); 254 | } 255 | function xmlGetImgAtt (adrx) { //3/9/14 by DW 256 | var imgatt = xmlGetAttribute (adrx, "img"), img = ""; 257 | if (imgatt != undefined) { 258 | var urlatt = xmlGetAttribute (adrx, "url"), textatt = xmlGetTextAtt (adrx); 259 | if (textatt.length > 0) { //4/11/14 by DW 260 | img = ""; 261 | } 262 | else { 263 | img = "
    "; 264 | } 265 | if (urlatt != undefined) { 266 | img = "" + img + "" 267 | } 268 | img += lineEnding; 269 | } 270 | return (img); 271 | } 272 | function xmlGetPermalinkValue (when) { //3/11/14 by DW 273 | var num = Number (when), name; 274 | if (num < 0) { 275 | num = -num; 276 | } 277 | name = "a" + (num / 1000); 278 | return (name); 279 | } 280 | function getXstuctBody (xstruct) { 281 | var adropml, adrbody; 282 | adropml = xmlGetAddress (xstruct, "opml"); 283 | adrbody = xmlGetAddress (adropml, "body"); 284 | return (adrbody); 285 | } 286 | function getXstuctHead (xstruct) { //11/11/14 by DW 287 | var adropml, adrhead; 288 | adropml = xmlGetAddress (xstruct, "opml"); 289 | adrhead = xmlGetAddress (adropml, "head"); 290 | return (adrhead); 291 | } 292 | function xmlNotComment (adrx) { //7/10/14 by DW 293 | if (xmlIsComment (adrx)) { 294 | return (false); 295 | } 296 | if (isPoundItem (xmlGetTextAtt (adrx))) { 297 | return (false); 298 | } 299 | return (true); 300 | } 301 | function xmlStringify (xstruct) { //7/17/15 by DW 302 | var oSerializer = new XMLSerializer (); 303 | var xmlString = oSerializer.serializeToString (xstruct [0]); 304 | return (xmlString); 305 | } 306 | function xmlGetSubText (adrx, flAddTabsNewlines) { //11/17/15 by DW 307 | var htmltext = ""; 308 | if (flAddTabsNewlines === undefined) { //8/11/16 by DW 309 | flAddTabsNewlines = true; 310 | } 311 | xmlVisit (adrx, function (adrx, level) { 312 | var textatt = xmlGetTextAtt (adrx); 313 | if (xmlIsComment (adrx)) { 314 | return (false); 315 | } 316 | 317 | if (flAddTabsNewlines) { 318 | htmltext += filledString ("\t", level) + textatt + lineEnding; 319 | } 320 | else { 321 | 322 | htmltext += textatt; 323 | } 324 | 325 | return (true); 326 | }); 327 | return (htmltext); 328 | } 329 | function xmlGetStringFromOutline (opmltext) { //2/24/16 by DW 330 | var xstruct = $($.parseXML (opmltext)), ctread = 0; 331 | var adropml = xmlGetAddress (xstruct, "opml"); 332 | var adrbody = xmlGetAddress (adropml, "body"); 333 | var subtext = xmlGetSubText (adrbody); 334 | return (subtext); 335 | } 336 | function xmlGetSubValues (adrx) { //10/12/16 by DW 337 | var values = new Object (); 338 | $(adrx).children ().each (function () { 339 | var name = xmlGetNodeNameProp (this); 340 | if (name.length > 0) { 341 | var val = $(this).prop ("textContent"); 342 | values [name] = val; 343 | } 344 | }); 345 | return (values); 346 | } 347 | function xmlCountSibs (adrx) { //1/6/17 by DW 348 | var adrparent = xmlGetParent (adrx), ct = 0; 349 | xmlOneLevelVisit (adrx, function (adrsub) { 350 | ct++; 351 | }); 352 | return (ct - 1); 353 | } 354 | function xmlBuildMenusFromOpmltext (opmltext, idMenuToInsertAfter, evalCallback, newMenuCommandCallback, menuIdPrefix) { //1/17/17 by DW 355 | var xstruct = $($.parseXML (opmltext)), ctScriptMenus = 0; 356 | var adrbody = getXstuctBody (xstruct); 357 | function installApp (urlApp, liMenuItem, menuNameLink, callback) { 358 | readHttpFileThruProxy (urlApp, undefined, function (jsontext) { 359 | if (jsontext !== undefined) { 360 | var jstruct = JSON.parse (jsontext); 361 | menuNameLink.html (jstruct.name); 362 | readHttpFileThruProxy (jstruct.urlMenu, undefined, function (opmltext) { 363 | var xstruct = $($.parseXML (opmltext)), ctScriptMenus = 0; 364 | var adrbody = getXstuctBody (xstruct); 365 | getSubMenu (adrbody, liMenuItem, true) 366 | }); 367 | } 368 | }); 369 | } 370 | function getSubMenu (adrMenuInOutline, liMenuItem, flSubMenu) { 371 | var ulSubMenu = $("
      "), myClass = "dropdown"; 372 | if (flSubMenu) { 373 | myClass = "dropdown-submenu"; 374 | } 375 | liMenuItem.addClass (myClass); 376 | ulSubMenu.addClass ("dropdown-menu"); 377 | 378 | 379 | xmlOneLevelVisit (adrMenuInOutline, function (adrSubMenuItem) { 380 | if (!xmlIsComment (adrSubMenuItem)) { 381 | var textatt = xmlGetTextAtt (adrSubMenuItem), nametext = textatt, liSubMenuItem; 382 | var cmdKeyPrefix = getCmdKeyPrefix (), cmdKeyAtt = xmlGetAttribute (adrSubMenuItem, "cmdKey"); 383 | 384 | if (textatt == "-") { 385 | liSubMenuItem = $("
    • "); 386 | } 387 | else { 388 | liSubMenuItem = $("
    • "); 389 | var menuNameLink = $(""); 390 | menuNameLink.attr ("href", "#"); 391 | menuNameLink.attr ("tabindex", "-1"); 392 | if (cmdKeyAtt !== undefined) { 393 | nametext = "" + cmdKeyPrefix + cmdKeyAtt + "" + nametext; 394 | } 395 | menuNameLink.html (nametext); 396 | liSubMenuItem.append (menuNameLink); 397 | 398 | if (getBoolean (xmlGetAttribute (adrSubMenuItem, "flSubMenu"))) { 399 | getSubMenu (adrSubMenuItem, liSubMenuItem, true); 400 | } 401 | else { 402 | var urlApp = xmlGetAttribute (adrSubMenuItem, "urlApp"); 403 | if (urlApp !== undefined) { 404 | console.log ("getSubMenu: adding app, url == \"" + urlApp + "\"."); 405 | installApp (urlApp, liSubMenuItem, menuNameLink, function () { 406 | }); 407 | } 408 | else { 409 | var subtext = trimWhitespace (xmlGetSubText (adrSubMenuItem)); 410 | if (subtext.length > 0) { 411 | menuNameLink.data ("script", subtext); 412 | 413 | var whenCreated = xmlGetAttribute (adrSubMenuItem, "created"); //1/22/17 by DW 414 | if (whenCreated !== undefined) { 415 | menuNameLink.data ("created", whenCreated); 416 | } 417 | 418 | menuNameLink.click (function (event) { 419 | var s = $(this).data ("script"); 420 | event.preventDefault (); 421 | if (evalCallback !== undefined) { 422 | evalCallback (s, this); //1/22/17 by DW -- added new param, this, so caller can access the DOM node directly, used in pngWriter 423 | } 424 | else { 425 | eval (s); 426 | } 427 | }); 428 | 429 | if (newMenuCommandCallback !== undefined) { //1/22/17 by DW 430 | newMenuCommandCallback (subtext, menuNameLink); 431 | } 432 | } 433 | else { 434 | liSubMenuItem.addClass ("disabled"); 435 | } 436 | } 437 | } 438 | } 439 | 440 | ulSubMenu.append (liSubMenuItem); 441 | } 442 | return (true); //keep visiting 443 | }); 444 | 445 | 446 | liMenuItem.append (ulSubMenu) 447 | } 448 | if (menuIdPrefix === undefined) { //6/11/17 by DW 449 | menuIdPrefix = "idScriptMenu"; 450 | } 451 | xmlOneLevelVisit (adrbody, function (adrmenu) { 452 | if (!xmlIsComment (adrmenu)) { 453 | var menuName = xmlGetTextAtt (adrmenu); 454 | var liDropdown = $("
    • "); 455 | var idThisMenu = menuIdPrefix + ++ctScriptMenus; 456 | liDropdown.addClass ("dropdown"); 457 | liDropdown.attr ("id", idThisMenu); 458 | var menuNameLink = $(""); 459 | menuNameLink.addClass ("dropdown-toggle"); 460 | menuNameLink.attr ("href", "#"); 461 | menuNameLink.attr ("data-toggle", "dropdown"); 462 | menuNameLink.text (menuName); 463 | menuNameLink.append (" "); 464 | liDropdown.append (menuNameLink); 465 | 466 | 467 | 468 | getSubMenu (adrmenu, liDropdown, false); //get the submenu, attach it to the menu item 469 | 470 | 471 | 472 | 473 | 474 | liDropdown.insertAfter ("#" + idMenuToInsertAfter); 475 | idMenuToInsertAfter = idThisMenu; 476 | } 477 | return (true); //keep visiting 478 | }); 479 | } 480 | function xmlCompile (xmltext) { //3/27/17 by DW 481 | return ($($.parseXML (xmltext))); 482 | } 483 | function xmlGetSubsFromOpml (opmltext) { //3/27/17 by DW 484 | function gatherSubs (adrx) { 485 | xmlOneLevelVisit (adrx, function (adrsub) { 486 | if (xmlHasSubs (adrsub)) { 487 | gatherSubs (adrsub); 488 | } 489 | else { 490 | var atts = new Object (); 491 | xmlGatherAttributes (adrsub, atts); 492 | subsArray.push (atts); 493 | } 494 | return (true); 495 | }); 496 | } 497 | var xstruct = xmlCompile (opmltext); 498 | var adrbody = getXstuctBody (xstruct); 499 | var subsArray = []; 500 | gatherSubs (adrbody); 501 | return (subsArray); 502 | } 503 | -------------------------------------------------------------------------------- /riverBrowserIncludes/riverbrowser.js: -------------------------------------------------------------------------------- 1 | 2 | document.write (''); 3 | document.write (''); 4 | document.write (''); 5 | document.write (''); 6 | document.write (''); 7 | document.write (''); 8 | document.write (''); 9 | document.write (''); //6/18/15 by DW 10 | document.write (''); 11 | 12 | var riverBrowserData = { 13 | version: "0.4.7", 14 | enclosureIconHtml: "", 15 | flEnclosureIcon: true, 16 | flShareIcon: true, 17 | flOutlinesExpandedByDefault: false, //4/16/15 by DW 18 | urlTwitterServer: "http://twitter2.radio3.io:5342/", //6/18/15 by DW 19 | theRiver: undefined, //6/18/15 by DW -- used to be global 20 | urlLinkBlogTool: "http://radio3.io/", //4/3/17 by DW 21 | getExtraFooterCallback: function (item, theFooter) { 22 | return (theFooter); 23 | }, 24 | includeFeedInRiverCallback: function (feed) { 25 | return (true); 26 | }, 27 | includeItemInRiverCallback: function (item) { 28 | return (true); 29 | }, 30 | createLinkCallback: function (url, linktext, title) { 31 | var titleAtt = ""; 32 | if (title !== undefined) { 33 | titleAtt = " title=\"" + title + "\""; 34 | } 35 | return ("" + linktext + ""); 36 | }, 37 | openWindowCallback: function (url) { //4/3/17 by DW 38 | window.open (url); 39 | }, 40 | getFaviconCallback: function (feed) { //7/8/17 by DW 41 | var favicon = ""; 42 | return (favicon); 43 | } 44 | }; 45 | 46 | function getItemEnclosureUrl (item) { //4/14/15 by DW 47 | if (item.enclosure != undefined) { 48 | var theEnclosure = item.enclosure [0]; 49 | if ((theEnclosure != undefined) && (theEnclosure.url != undefined)) { 50 | return (theEnclosure.url); 51 | } 52 | } 53 | return (undefined); 54 | } 55 | function findRiverItem (theRiver, iditem, callback) { //4/14/15 by DW 56 | var feeds = theRiver.updatedFeeds.updatedFeed; 57 | console.log ("findRiverItem: iditem == " + iditem); 58 | for (var i = 0; i < feeds.length; i++) { 59 | var feed = feeds [i]; 60 | for (var j = 0; j < feed.item.length; j++) { 61 | var item = feed.item [j]; 62 | if (item.id === iditem) { 63 | if (callback !== undefined) { 64 | callback (item); 65 | } 66 | return; 67 | } 68 | 69 | } 70 | } 71 | } 72 | function shareClick (iditem) { 73 | var feeds = riverBrowserData.theRiver.updatedFeeds.updatedFeed, urlLinkBlogTool = riverBrowserData.urlLinkBlogTool; 74 | try { 75 | if (appPrefs.urlLinkBlogTool != undefined) { //10/3/14 by DW 76 | urlLinkBlogTool = appPrefs.urlLinkBlogTool; 77 | } 78 | } 79 | catch (err) { 80 | } 81 | 82 | function encode (s) { 83 | return (encodeURIComponent (s)); 84 | } 85 | for (var i = 0; i < feeds.length; i++) { 86 | var feed = feeds [i]; 87 | for (var j = 0; j < feed.item.length; j++) { 88 | var item = feed.item [j]; 89 | if (item.id == iditem) { 90 | var urlShare = urlLinkBlogTool + "?"; 91 | function addParam (name, val) { 92 | if (val != undefined) { 93 | if (val.length > 0) { 94 | urlShare += name + "=" + encode (val) + "&"; 95 | } 96 | } 97 | 98 | 99 | } 100 | 101 | if ((item.outline != undefined) && (item.outline.type != "tweet")) { //plain jane outline, don't send the body, it's too big for a linkblog entry 102 | addParam ("title", item.title); 103 | addParam ("link", item.link); 104 | } 105 | else { 106 | addParam ("title", item.title); 107 | addParam ("link", item.link); 108 | } 109 | 110 | if (endsWith (urlShare, "&")) { 111 | urlShare = urlShare.substr (0, urlShare.length - 1); //pop last char 112 | } 113 | 114 | riverBrowserData.openWindowCallback (urlShare); //4/3/17 by DW 115 | 116 | return; 117 | } 118 | } 119 | } 120 | 121 | } 122 | function riverInitTwitterServer () { //6/18/15 by DW 123 | if (twStorageData.urlTwitterServer === undefined) { 124 | twStorageData.urlTwitterServer = riverBrowserData.urlTwitterServer; 125 | } 126 | } 127 | function ecTweet (idnum, idtweet) { 128 | var c = document.getElementById ("idOutlineWedge" + idnum), idUL = "idOutlineLevel" + idnum; 129 | if (c.style.color == "silver") { 130 | c.style.color = "#4099FF"; 131 | $("#" + idUL).slideUp (75); 132 | } 133 | else { 134 | c.style.color = "silver"; 135 | riverInitTwitterServer (); //6/18/15 by DW 136 | twViewTweet (idtweet, idUL, function () { 137 | $("#" + idUL).slideDown (75); 138 | }); 139 | } 140 | } 141 | function ecImage (idnum) { 142 | var c = document.getElementById ("idOutlineWedge" + idnum), idUL = "#idOutlineLevel" + idnum; 143 | if (c.style.color == "silver") { 144 | c.style.color = "black"; 145 | $(idUL).slideUp (75); 146 | } 147 | else { 148 | c.style.color = "silver"; 149 | $(idUL).slideDown (75); 150 | } 151 | } 152 | function getIconForTweet (idnum, idtweet, flcollapsed) { //9/22/14 by DW 153 | var color; 154 | if (flcollapsed) { 155 | color = "#4099FF"; 156 | } 157 | else { 158 | color = "silver"; 159 | } 160 | 161 | var clickscript = "onclick=\"ecTweet (" + idnum + ", '" + idtweet + "')\" "; 162 | var iconchar = ""; 163 | var icon = "" + iconchar + ""; 164 | return (icon); 165 | } 166 | function getIconForImage (idnum, flcollapsed) { //9/23/14 by DW 167 | var color; 168 | if (flcollapsed) { 169 | color = "black"; 170 | } 171 | else { 172 | color = "silver"; 173 | } 174 | 175 | var clickscript = "onclick=\"ecImage (" + idnum + ")\" "; 176 | var iconchar = ""; 177 | var icon = "" + iconchar + ""; 178 | return (icon); 179 | } 180 | function getShareLink (item) { //9/22/14 by DW 181 | if (riverBrowserData.flShareIcon) { 182 | var sharescript = "shareClick ('" + item.id + "');"; 183 | var sharelink = ""; 184 | return (sharelink); 185 | } 186 | else { 187 | return (""); 188 | } 189 | } 190 | function getEnclosureLink (item) { //9/22/14 by DW 191 | if (riverBrowserData.flEnclosureIcon) { 192 | var enclosurelink = ""; 193 | if (item.enclosure != undefined) { 194 | var theEnclosure = item.enclosure [0]; 195 | if ((theEnclosure != undefined) && (theEnclosure.url != undefined)) { 196 | } 197 | enclosurelink = "" + riverBrowserData.enclosureIconHtml + ""; 198 | } 199 | return (enclosurelink); 200 | } 201 | else { 202 | return (""); 203 | } 204 | } 205 | function getItemFooter (item) { //9/22/14 by DW 206 | var sharelink = getShareLink (item); 207 | var enclosurelink = getEnclosureLink (item); 208 | var timediff; 209 | 210 | try { //2/10/16 by DW 211 | timediff = timeDifference (item.pubDate); 212 | } 213 | catch (err) { 214 | timediff = "Recently"; 215 | } 216 | 217 | var itemfooter = "" + timediff + "" + enclosurelink + sharelink; 218 | return ("
      " + riverBrowserData.getExtraFooterCallback (item, itemfooter) + "
      "); 219 | } 220 | function getItemPermalink (item) { //6/15/17 by DW 221 | var title = "Direct link to this item."; 222 | return ("#"); 223 | } 224 | function expandableTweetTextLink (theText, idTweet, idLevel) { 225 | return ("" + theText + ""); 226 | } 227 | function expandableImageTextLink (theText, idLevel) { 228 | return ("" + theText + ""); 229 | } 230 | function riverRenderOutline (outline, flMarkdown, urlPermalink, permalinkString, flExpanded) { 231 | return (renderOutlineBrowser (outline, flMarkdown, urlPermalink, permalinkString, flExpanded)); 232 | } 233 | function riverRenderTypedOutline (outline, urlPermalink, permalinkString, flExpanded) { //10/23/14 by DW -- experiment 234 | var itemhtml, permalink = riverGetPermalinkString (urlPermalink, permalinkString); 235 | if (flExpanded === undefined) { 236 | flExpanded = false; 237 | } 238 | switch (outline.type) { 239 | case "tweet": 240 | var flTweetCollapsed = true, style = ""; 241 | if (flTweetCollapsed) { 242 | style = " style=\"display: none;\""; 243 | } 244 | var tweetlinetext = getIconForTweet (outlineBrowserData.serialNum, outline.tweetid, flTweetCollapsed) + expandableTweetTextLink (outline.text, outline.tweetid, outlineBrowserData.serialNum); 245 | var tweethead = "
      " + tweetlinetext + "
      "; 246 | var idDiv = "idOutlineLevel" + outlineBrowserData.serialNum++, idTweet = outline.tweetid; 247 | var tweetbody = "
      <tweet id=" + idTweet + ">
      "; 248 | itemhtml = tweethead + tweetbody; 249 | break; 250 | case "image": 251 | var imagelinetext = getIconForImage (outlineBrowserData.serialNum, !flExpanded) + expandableImageTextLink (outline.text, outlineBrowserData.serialNum); 252 | var style = " style=\"display: none;\""; 253 | if (flExpanded) { 254 | style = ""; 255 | } 256 | var imagehead = "
      " + imagelinetext + permalink + "
      "; 257 | var idDiv = "idOutlineLevel" + outlineBrowserData.serialNum++, idTweet = outline.tweetid; 258 | var imgelement = ""; 259 | if (urlPermalink != undefined) { //10/25/14 by DW 260 | imgelement = "" + imgelement + ""; 261 | } 262 | var imagebody = "
      " + imgelement + "
      "; 263 | itemhtml = imagehead + imagebody; 264 | break; 265 | case "outline": 266 | var flMarkdown = false; //2/17/15 by DW 267 | if (outline.flMarkdown !== undefined) { 268 | flMarkdown = getBoolean (outline.flMarkdown); 269 | } 270 | else { 271 | if (outline.flmarkdown !== undefined) { 272 | flMarkdown = getBoolean (outline.flmarkdown); 273 | } 274 | } 275 | itemhtml = riverRenderOutline (outline, flMarkdown, urlPermalink, permalinkString, flExpanded); 276 | break; 277 | default: 278 | itemhtml = riverRenderOutline (outline, true, urlPermalink, permalinkString, flExpanded); 279 | break; 280 | } 281 | itemhtml = emojiProcess (itemhtml); //11/4/14 by DW 282 | return (itemhtml); 283 | } 284 | function createRiverLink (url, linktext, title) { //12/17/15 by DW 285 | return (riverBrowserData.createLinkCallback (url, linktext, title)); 286 | } 287 | function renderThroughOutlineBrowser (item) { 288 | if (item.outline === undefined) { 289 | return (false); 290 | } 291 | if (item.outline.type === undefined) { 292 | return (false); 293 | } 294 | if (item.outline.subs === undefined) { 295 | return (false); 296 | } 297 | return (true); 298 | } 299 | function renderRiveritem (item, serialnum) { 300 | var itemhtml = "", title, body, itemlink, sharelink, idItem = "idItem" + serialnum, enclosurelink = ""; 301 | if (renderThroughOutlineBrowser (item)) { 302 | switch (item.outline.type) { 303 | case "tweet": 304 | var flTweetCollapsed = true, style = ""; 305 | if (flTweetCollapsed) { 306 | style = " style=\"display: none;\""; 307 | } 308 | var tweetlinetext = getIconForTweet (outlineBrowserData.serialNum, item.outline.tweetid, flTweetCollapsed) + expandableTweetTextLink (item.outline.text, item.outline.tweetid, outlineBrowserData.serialNum); 309 | var tweethead = "
      " + tweetlinetext + "
      "; 310 | var idDiv = "idOutlineLevel" + outlineBrowserData.serialNum++, idTweet = item.outline.tweetid; 311 | var tweetbody = "
      <tweet id=" + idTweet + ">
      "; 312 | itemhtml = tweethead + tweetbody + getItemFooter (item); 313 | break; 314 | case "image": 315 | var imagelinetext = getIconForImage (outlineBrowserData.serialNum, true) + expandableImageTextLink (item.outline.text, outlineBrowserData.serialNum); 316 | var style = " style=\"display: none;\""; 317 | var imagehead = "
      " + imagelinetext + "
      "; 318 | var idDiv = "idOutlineLevel" + outlineBrowserData.serialNum++, idTweet = item.outline.tweetid; 319 | var imagebody = "
      "; 320 | itemhtml = imagehead + imagebody + getItemFooter (item); 321 | break; 322 | case "outline": 323 | var flMarkdown = true; 324 | if (item.outline.flMarkdown != undefined) { 325 | flMarkdown = getBoolean (item.outline.flMarkdown); 326 | } 327 | else { 328 | if (item.outline.flmarkdown != undefined) { 329 | flMarkdown = getBoolean (item.outline.flmarkdown); 330 | } 331 | } 332 | itemhtml = getItemPermalink (item) + riverRenderOutline (item.outline, flMarkdown) + getItemFooter (item); 333 | break; 334 | default: 335 | itemhtml = riverRenderOutline (item.outline, true) + getItemFooter (item); //11/3/14 by DW 336 | break; 337 | } 338 | } 339 | else { 340 | //set title, body 341 | if (item.title.length > 0) { 342 | title = item.title; 343 | body = item.body; 344 | } 345 | else { 346 | title = item.body; 347 | body = ""; 348 | } 349 | //set itemlink 350 | if (item.link.length > 0) { 351 | itemlink = createRiverLink (item.link, title, undefined); //"" + title + ""; 352 | } 353 | else { 354 | itemlink = title; 355 | } 356 | itemlink = "
      " + itemlink + "
      "; 357 | 358 | var itembody = "
      " + body + "
      "; 359 | itemhtml = itemlink + itembody + getItemFooter (item); 360 | } 361 | return ("
      " + itemhtml + "
      "); 362 | } 363 | function freshRiverDisplay (idRiver) { 364 | var feeds = riverBrowserData.theRiver.updatedFeeds.updatedFeed, idSerialNum = 0; 365 | $("#" + idRiver).empty (); 366 | for (var i = 0; i < feeds.length; i++) { 367 | var feed = feeds [i], feedLink, whenFeedUpdated, favicon = "", items = "", linksSeen = new Object (); 368 | if (riverBrowserData.includeFeedInRiverCallback (feed)) { 369 | function linkNotSeen (link) { //10/27/17 by DW 370 | if (link === undefined) { 371 | return (true); 372 | } 373 | else { 374 | return (linksSeen [item.link] === undefined); 375 | } 376 | } 377 | 378 | //set feedLink 379 | feedLink = feed.feedTitle; 380 | if ((feed.websiteUrl != null) && (feed.websiteUrl.length > 0)) { 381 | feedLink = createRiverLink (feed.websiteUrl, feedLink, "Web page"); //"" + feedLink + ""; 382 | favicon = riverBrowserData.getFaviconCallback (feed); //7/8/17 by DW 383 | } 384 | if (feed.feedUrl.length > 0) { 385 | feedLink += " (" + createRiverLink (feed.feedUrl, "Feed", "Link to RSS feed") + ")"; //" (Feed)"; 386 | } 387 | //set whenFeedUpdated 388 | whenFeedUpdated = feed.whenLastUpdate; 389 | //set items 390 | for (var j = 0; j < feed.item.length; j++) { 391 | var item = feed.item [j], title, body, itemlink, itemhtml, sharelink, idItem = "idItem" + idSerialNum++, enclosurelink = ""; 392 | if (linkNotSeen (item.link)) { //10/27/17 by DW 393 | if (riverBrowserData.includeItemInRiverCallback (item)) { 394 | if (j > 0) { 395 | items += "
      "; 396 | } 397 | var itemhtml = renderRiveritem (item, idSerialNum++); 398 | items += itemhtml; 399 | linksSeen [item.link] = true; //10/27/17 by DW 400 | } 401 | } 402 | } 403 | items = emojiProcess (items); //10/11/14 by DW 404 | 405 | var title = "
      " + favicon + feedLink+ "
      "; 406 | var updated = "" + dateFormat (whenFeedUpdated, "timeDate") + ""; 407 | var head = "
      " + updated + title + "
      "; 408 | 409 | $("#" + idRiver).append ("
      " + head + items + "
      "); 410 | } 411 | } 412 | } 413 | function onGetRiverStream (updatedFeeds) { 414 | } 415 | function httpGetRiver (urlRiver, idRiver, callback) { 416 | var whenstart = new Date (); 417 | if (idRiver === undefined) { //10/5/14 by DW 418 | idRiver = "idRiverDisplay"; 419 | } 420 | urlLastRiverGet = urlRiver; 421 | $.ajax ({ 422 | url: urlRiver, 423 | jsonpCallback : "onGetRiverStream", 424 | success: function (data) { 425 | console.log ("httpGetRiver: read took " + secondsSince (whenstart) + " secs."); 426 | riverBrowserData.theRiver = data; 427 | freshRiverDisplay (idRiver); 428 | if (callback != undefined) { 429 | callback (); 430 | } 431 | }, 432 | error: function (status) { 433 | console.log ("httpGetRiver: error status == " + jsonStringify (status)); 434 | $("#" + idRiver).html ("
      Can't display the river because the file does not exist, or there was an error accessing it over the net.
      "); 435 | if (callback != undefined) { 436 | callback (); 437 | } 438 | }, 439 | dataType: "jsonp" 440 | }); 441 | } 442 | -------------------------------------------------------------------------------- /riverBrowserIncludes/emojify2.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | 3 | 'use strict'; 4 | 5 | var emojify = (function () { 6 | // Get DOM as local variable for simplicity's sake 7 | var document = global.window.document; 8 | 9 | /** 10 | * NB! 11 | * The namedEmojiString variable is updated automatically by the 12 | * `update.sh` script. Do not remove the markers as this will 13 | * cause `update.sh` to stop working. 14 | */ 15 | var namedEmojiString = 16 | //##EMOJILISTSTART 17 | "+1,-1,100,109,1234,8ball,a,ab,abc,abcd,accept,aerial_tramway,airplane,alarm_clock,alien,ambulance,anchor,angel,anger,angry,anguished,ant,apple,aquarius,aries,arrow_backward,arrow_double_down,arrow_double_up,arrow_down,arrow_down_small,arrow_forward,arrow_heading_down,arrow_heading_up,arrow_left,arrow_lower_left,arrow_lower_right,arrow_right,arrow_right_hook,arrow_up,arrow_up_down,arrow_up_small,arrow_upper_left,arrow_upper_right,arrows_clockwise,arrows_counterclockwise,art,articulated_lorry,astonished,atm,b,baby,baby_bottle,baby_chick,baby_symbol,baggage_claim,balloon,ballot_box_with_check,bamboo,banana,bangbang,bank,bar_chart,barber,baseball,basketball,bath,bathtub,battery,bear,bee,beer,beers,beetle,beginner,bell,bento,bicyclist,bike,bikini,bird,birthday,black_circle,black_joker,black_nib,black_square,black_square_button,blossom,blowfish,blue_book,blue_car,blue_heart,blush,boar,boat,bomb,book,bookmark,bookmark_tabs,books,boom,boot,bouquet,bow,bowling,bowtie,boy,bread,bride_with_veil,bridge_at_night,briefcase,broken_heart,bug,bulb,bullettrain_front,bullettrain_side,bus,busstop,bust_in_silhouette,busts_in_silhouette,cactus,cake,calendar,calling,camel,camera,cancer,candy,capital_abcd,capricorn,car,card_index,carousel_horse,cat,cat2,cd,chart,chart_with_downwards_trend,chart_with_upwards_trend,checkered_flag,cherries,cherry_blossom,chestnut,chicken,children_crossing,chocolate_bar,christmas_tree,church,cinema,circus_tent,city_sunrise,city_sunset,cl,clap,clapper,clipboard,clock1,clock10,clock1030,clock11,clock1130,clock12,clock1230,clock130,clock2,clock230,clock3,clock330,clock4,clock430,clock5,clock530,clock6,clock630,clock7,clock730,clock8,clock830,clock9,clock930,closed_book,closed_lock_with_key,closed_umbrella,cloud,clubs,cn,cocktail,coffee,cold_sweat,collision,computer,confetti_ball,confounded,confused,congratulations,construction,construction_worker,convenience_store,cookie,cool,cop,copyright,corn,couple,couple_with_heart,couplekiss,cow,cow2,credit_card,crocodile,crossed_flags,crown,cry,crying_cat_face,crystal_ball,cupid,curly_loop,currency_exchange,curry,custard,customs,cyclone,dancer,dancers,dango,dart,dash,date,de,deciduous_tree,department_store,diamond_shape_with_a_dot_inside,diamonds,disappointed,disappointed_relieved,dizzy,dizzy_face,do_not_litter,dog,dog2,dollar,dolls,dolphin,donut,door,doughnut,dragon,dragon_face,dress,dromedary_camel,droplet,dvd,e-mail,ear,ear_of_rice,earth_africa,earth_americas,earth_asia,egg,eggplant,eight,eight_pointed_black_star,eight_spoked_asterisk,electric_plug,elephant,email,end,envelope,es,euro,european_castle,european_post_office,evergreen_tree,exclamation,expressionless,eyeglasses,eyes,facepunch,factory,fallen_leaf,family,fast_forward,fax,fearful,feelsgood,feet,ferris_wheel,file_folder,finnadie,fire,fire_engine,fireworks,first_quarter_moon,first_quarter_moon_with_face,fish,fish_cake,fishing_pole_and_fish,fist,five,flags,flashlight,floppy_disk,flower_playing_cards,flushed,foggy,football,fork_and_knife,fountain,four,four_leaf_clover,fr,free,fried_shrimp,fries,frog,frowning,fu,fuelpump,full_moon,full_moon_with_face,game_die,gb,gem,gemini,ghost,gift,gift_heart,girl,globe_with_meridians,goat,goberserk,godmode,golf,grapes,green_apple,green_book,green_heart,grey_exclamation,grey_question,grimacing,grin,grinning,guardsman,guitar,gun,haircut,hamburger,hammer,hamster,hand,handbag,hankey,hash,hatched_chick,hatching_chick,headphones,hear_no_evil,heart,heart_decoration,heart_eyes,heart_eyes_cat,heartbeat,heartpulse,hearts,heavy_check_mark,heavy_division_sign,heavy_dollar_sign,heavy_exclamation_mark,heavy_minus_sign,heavy_multiplication_x,heavy_plus_sign,helicopter,herb,hibiscus,high_brightness,high_heel,hocho,honey_pot,honeybee,horse,horse_racing,hospital,hotel,hotsprings,hourglass,hourglass_flowing_sand,house,house_with_garden,hurtrealbad,hushed,ice_cream,icecream,id,ideograph_advantage,imp,inbox_tray,incoming_envelope,information_desk_person,information_source,innocent,interrobang,iphone,it,izakaya_lantern,jack_o_lantern,japan,japanese_castle,japanese_goblin,japanese_ogre,jeans,joy,joy_cat,jp,key,keycap_ten,kimono,kiss,kissing,kissing_cat,kissing_closed_eyes,kissing_face,kissing_heart,kissing_smiling_eyes,koala,koko,kr,large_blue_circle,large_blue_diamond,large_orange_diamond,last_quarter_moon,last_quarter_moon_with_face,laughing,leaves,ledger,left_luggage,left_right_arrow,leftwards_arrow_with_hook,lemon,leo,leopard,libra,light_rail,link,lips,lipstick,lock,lock_with_ink_pen,lollipop,loop,loudspeaker,love_hotel,love_letter,low_brightness,m,mag,mag_right,mahjong,mailbox,mailbox_closed,mailbox_with_mail,mailbox_with_no_mail,man,man_with_gua_pi_mao,man_with_turban,mans_shoe,maple_leaf,mask,massage,meat_on_bone,mega,melon,memo,mens,metal,metro,microphone,microscope,milky_way,minibus,minidisc,mobile_phone_off,money_with_wings,moneybag,monkey,monkey_face,monorail,moon,mortar_board,mount_fuji,mountain_bicyclist,mountain_cableway,mountain_railway,mouse,mouse2,movie_camera,moyai,muscle,mushroom,musical_keyboard,musical_note,musical_score,mute,nail_care,name_badge,neckbeard,necktie,negative_squared_cross_mark,neutral_face,new,new_moon,new_moon_with_face,newspaper,ng,nine,no_bell,no_bicycles,no_entry,no_entry_sign,no_good,no_mobile_phones,no_mouth,no_pedestrians,no_smoking,non-potable_water,nose,notebook,notebook_with_decorative_cover,notes,nut_and_bolt,o,o2,ocean,octocat,octopus,oden,office,ok,ok_hand,ok_woman,older_man,older_woman,on,oncoming_automobile,oncoming_bus,oncoming_police_car,oncoming_taxi,one,open_file_folder,open_hands,open_mouth,ophiuchus,orange_book,outbox_tray,ox,page_facing_up,page_with_curl,pager,palm_tree,panda_face,paperclip,parking,part_alternation_mark,partly_sunny,passport_control,paw_prints,peach,pear,pencil,pencil2,penguin,pensive,performing_arts,persevere,person_frowning,person_with_blond_hair,person_with_pouting_face,phone,pig,pig2,pig_nose,pill,pineapple,pisces,pizza,plus1,point_down,point_left,point_right,point_up,point_up_2,police_car,poodle,poop,post_office,postal_horn,postbox,potable_water,pouch,poultry_leg,pound,pouting_cat,pray,princess,punch,purple_heart,purse,pushpin,put_litter_in_its_place,question,rabbit,rabbit2,racehorse,radio,radio_button,rage,rage1,rage2,rage3,rage4,railway_car,rainbow,raised_hand,raised_hands,raising_hand,ram,ramen,rat,recycle,red_car,red_circle,registered,relaxed,relieved,repeat,repeat_one,restroom,revolving_hearts,rewind,ribbon,rice,rice_ball,rice_cracker,rice_scene,ring,rocket,roller_coaster,rooster,rose,rotating_light,round_pushpin,rowboat,ru,rugby_football,runner,running,running_shirt_with_sash,sa,sagittarius,sailboat,sake,sandal,santa,satellite,satisfied,saxophone,school,school_satchel,scissors,scorpius,scream,scream_cat,scroll,seat,secret,see_no_evil,seedling,seven,shaved_ice,sheep,shell,ship,shipit,shirt,shit,shoe,shower,signal_strength,six,six_pointed_star,ski,skull,sleeping,sleepy,slot_machine,small_blue_diamond,small_orange_diamond,small_red_triangle,small_red_triangle_down,smile,smile_cat,smiley,smiley_cat,smiling_imp,smirk,smirk_cat,smoking,snail,snake,snowboarder,snowflake,snowman,sob,soccer,soon,sos,sound,space_invader,spades,spaghetti,sparkler,sparkles,sparkling_heart,speak_no_evil,speaker,speech_balloon,speedboat,squirrel,star,star2,stars,station,statue_of_liberty,steam_locomotive,stew,straight_ruler,strawberry,stuck_out_tongue,stuck_out_tongue_closed_eyes,stuck_out_tongue_winking_eye,sun_with_face,sunflower,sunglasses,sunny,sunrise,sunrise_over_mountains,surfer,sushi,suspect,suspension_railway,sweat,sweat_drops,sweat_smile,sweet_potato,swimmer,symbols,syringe,tada,tanabata_tree,tangerine,taurus,taxi,tea,telephone,telephone_receiver,telescope,tennis,tent,thought_balloon,three,thumbsdown,thumbsup,ticket,tiger,tiger2,tired_face,tm,toilet,tokyo_tower,tomato,tongue,top,tophat,tractor,traffic_light,train,train2,tram,triangular_flag_on_post,triangular_ruler,trident,triumph,trolleybus,trollface,trophy,tropical_drink,tropical_fish,truck,trumpet,tshirt,tulip,turtle,tv,twisted_rightwards_arrows,two,two_hearts,two_men_holding_hands,two_women_holding_hands,u5272,u5408,u55b6,u6307,u6708,u6709,u6e80,u7121,u7533,u7981,u7a7a,uk,umbrella,unamused,underage,unlock,up,us,v,vertical_traffic_light,vhs,vibration_mode,video_camera,video_game,violin,virgo,volcano,vs,walking,waning_crescent_moon,waning_gibbous_moon,warning,watch,water_buffalo,watermelon,wave,wavy_dash,waxing_crescent_moon,waxing_gibbous_moon,wc,weary,wedding,whale,whale2,wheelchair,white_check_mark,white_circle,white_flower,white_square,white_square_button,wind_chime,wine_glass,wink,wink2,wolf,woman,womans_clothes,womans_hat,womens,worried,wrench,x,yellow_heart,yen,yum,zap,zero,zzz"; 18 | //##EMOJILISTEND 19 | 20 | 21 | var namedEmoji = namedEmojiString.split(/,/); 22 | 23 | /* A hash with the named emoji as keys */ 24 | var namedMatchHash = namedEmoji.reduce(function(memo, v) { 25 | memo[v] = true; 26 | return memo; 27 | }, {}); 28 | 29 | /* List of emoticons used in the regular expression */ 30 | var emoticons = { 31 | /* :..: */ named: /:([a-z0-9A-Z_-]+):/, 32 | /* :-) */ blush: /:-?\)/g, 33 | /* :-o */ scream: /:-o/gi, 34 | /* :-] */ smirk: /[:;]-?]/g, 35 | /* :-D */ smiley: /[:;]-?d/gi, 36 | /* X-D */ stuck_out_tongue_closed_eyes: /x-d/gi, 37 | /* ;-p */ stuck_out_tongue_winking_eye: /[:;]-?p/gi, 38 | /* :-[ */ rage: /:-?[\[@]/g, 39 | /* :-( */ disappointed: /:-?\(/g, 40 | /* :'-( */ sob: /:['’]-?\(|:'\(/g, 41 | /* :-* */ kissing_heart: /:-?\*/g, 42 | /* ;-) */ wink: /;-?\)/g, 43 | /* :-/ */ pensive: /:-?\//g, 44 | /* :-s */ confounded: /:-?s/gi, 45 | /* :-| */ flushed: /:-?\|/g, 46 | /* :-$ */ relaxed: /:-?\$/g, 47 | /* :-x */ mask: /:-x/gi, 48 | /* <3 */ heart: /<3|<3/g, 49 | /* "; 121 | } 122 | 123 | function Validator() { 124 | this.lastEmojiTerminatedAt = -1; 125 | } 126 | 127 | Validator.prototype = { 128 | validate: function(match, index, input) { 129 | var self = this; 130 | 131 | /* Validator */ 132 | var emojiName = getEmojiNameForMatch(match); 133 | if(!emojiName) { return; } 134 | 135 | var m = match[0]; 136 | var length = m.length; 137 | // var index = match.index; 138 | // var input = match.input; 139 | 140 | function success() { 141 | self.lastEmojiTerminatedAt = length + index; 142 | return emojiName; 143 | } 144 | 145 | /* Any smiley thats 3 chars long is probably a smiley */ 146 | if(m.length > 2) { return success(); } 147 | 148 | /* At the beginning? */ 149 | if(index === 0) { return success(); } 150 | 151 | /* At the end? */ 152 | if(input.length === m.length + index) { return success(); } 153 | 154 | /* Has a whitespace before? */ 155 | if(isWhitespace(input.charAt(index - 1))) { return success(); } 156 | 157 | /* Has a whitespace after? */ 158 | if(isWhitespace(input.charAt(m.length + index))) { return success(); } 159 | 160 | /* Has an emoji before? */ 161 | if(this.lastEmojiTerminatedAt === index) { return success(); } 162 | 163 | return; 164 | } 165 | }; 166 | 167 | function emojifyString (htmlString, replacer) { 168 | if(!htmlString) { return htmlString; } 169 | if(!replacer) { replacer = defaultReplacer; } 170 | 171 | var validator = new Validator(); 172 | 173 | return htmlString.replace(emojiMegaRe, function() { 174 | var matches = Array.prototype.slice.call(arguments, 0, -2); 175 | var index = arguments[arguments.length - 2]; 176 | var input = arguments[arguments.length - 1]; 177 | var emojiName = validator.validate(matches, index, input); 178 | if(emojiName) { 179 | return replacer(arguments[0], emojiName); 180 | } 181 | 182 | /* Did not validate, return the original value */ 183 | return arguments[0]; 184 | }); 185 | 186 | } 187 | 188 | function run(el) { 189 | // Check if an element was not passed. 190 | if(typeof el === 'undefined'){ 191 | // Check if an element was configured. If not, default to the body. 192 | if (defaultConfig.only_crawl_id) { 193 | el = document.getElementById(defaultConfig.only_crawl_id); 194 | } else { 195 | el = document.body; 196 | } 197 | } 198 | 199 | var ignoredTags = defaultConfig.ignored_tags; 200 | 201 | var nodeIterator = document.createTreeWalker( 202 | el, 203 | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, 204 | function(node) { 205 | if(node.nodeType !== 1) { 206 | /* Text Node? Good! */ 207 | return NodeFilter.FILTER_ACCEPT; 208 | } 209 | 210 | if(ignoredTags[node.tagName] || node.classList.contains('no-emojify')) { 211 | return NodeFilter.FILTER_REJECT; 212 | } 213 | 214 | return NodeFilter.FILTER_SKIP; 215 | }, 216 | false); 217 | 218 | var nodeList = []; 219 | var node; 220 | while((node = nodeIterator.nextNode()) !== null) { 221 | nodeList.push(node); 222 | } 223 | 224 | nodeList.forEach(function(node) { 225 | var match; 226 | var matches = []; 227 | var validator = new Validator(); 228 | 229 | while ((match = emojiMegaRe.exec(node.data)) !== null) { 230 | if(validator.validate(match, match.index, match.input)) { 231 | matches.push(match); 232 | } 233 | } 234 | 235 | for (var i = matches.length; i-- > 0;) { 236 | /* Replace the text with the emoji */ 237 | var emojiName = getEmojiNameForMatch(matches[i]); 238 | insertEmojicon(node, matches[i], emojiName); 239 | } 240 | }); 241 | } 242 | 243 | return { 244 | // Sane defaults 245 | defaultConfig: defaultConfig, 246 | emojiNames: namedEmoji, 247 | setConfig: function (newConfig) { 248 | Object.keys(defaultConfig).forEach(function(f) { 249 | if(f in newConfig) { 250 | defaultConfig[f] = newConfig[f]; 251 | } 252 | }); 253 | }, 254 | 255 | replace: emojifyString, 256 | 257 | // Main method 258 | run: run 259 | }; 260 | })(); 261 | 262 | global.emojify = emojify; 263 | 264 | 265 | if (typeof define === 'function' && define.amd) { 266 | define([], function() { 267 | return emojify; 268 | }); 269 | } 270 | 271 | return emojify; 272 | 273 | 274 | })(this); 275 | 276 | 277 | function emojiProcess (s, myDirectory) { 278 | if (myDirectory === undefined) { //1/11/17 by DW 279 | myDirectory = "http://fargo.io/code/emojify/images/emoji"; 280 | } 281 | else { 282 | if (endsWith (myDirectory, "/")) { //1/11/17 by DW 283 | myDirectory = stringDelete (myDirectory, myDirectory.length, 1); 284 | } 285 | } 286 | emojify.setConfig ({ 287 | img_dir: myDirectory 288 | }); 289 | s = emojify.replace (s, function (emoji, name) { 290 | return "" + name + ""; 291 | }); 292 | return (s); 293 | } 294 | -------------------------------------------------------------------------------- /basicincludes2/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
      ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

      '}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
    • ',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); --------------------------------------------------------------------------------