diff --git a/docs/build.sh b/docs/build.sh index 195b50e..b56ee0f 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,4 +1,4 @@ -make qthelp +make html cp -R build/qthelp/* ../help rm ../help/SavvyCAN.q* diff --git a/help/_static/alabaster.css b/help/_static/alabaster.css new file mode 100644 index 0000000..517cb43 --- /dev/null +++ b/help/_static/alabaster.css @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + + + + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 17px; + background-color: white; + color: #000; + margin: 0; + padding: 0; +} + + +div.document { + width: 940px; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 220px; +} + +div.sphinxsidebar { + width: 220px; + font-size: 14px; + line-height: 1.5; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +div.body > .section { + text-align: left; +} + +div.footer { + width: 940px; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +p.caption { + font-family: ; + font-size: inherit; +} + + +div.relations { + display: none; +} + + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0; + margin: -10px 0 0 0px; + text-align: center; +} + +div.sphinxsidebarwrapper h1.logo { + margin-top: -10px; + text-align: center; + margin-bottom: 5px; + text-align: left; +} + +div.sphinxsidebarwrapper h1.logo-name { + margin-top: 0px; +} + +div.sphinxsidebarwrapper p.blurb { + margin-top: 0; + font-style: normal; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: 'Garamond', 'Georgia', serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar ul li.toctree-l1 > a { + font-size: 120%; +} + +div.sphinxsidebar ul li.toctree-l2 > a { + font-size: 110%; +} + +div.sphinxsidebar input { + border: 1px solid #CCC; + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 1em; +} + +div.sphinxsidebar hr { + border: none; + height: 1px; + color: #AAA; + background: #AAA; + + text-align: left; + margin-left: 0; + width: 50%; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #DDD; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; + background: #EAEAEA; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + margin: 20px 0px; + padding: 10px 30px; + background-color: #FCC; + border: 1px solid #FAA; +} + +div.admonition tt.xref, div.admonition a tt { + border-bottom: 1px solid #fafafa; +} + +dd div.admonition { + margin-left: -60px; + padding-left: 60px; +} + +div.admonition p.admonition-title { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: white; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.note { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.seealso { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.topic { + background-color: #eee; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt, code { + font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +.hll { + background-color: #FFC; + margin: 0 -12px; + padding: 0 12px; + display: block; +} + +img.screenshot { +} + +tt.descname, tt.descclassname, code.descname, code.descclassname { + font-size: 0.95em; +} + +tt.descname, code.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #EEE; + background: #FDFDFD; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.field-list p { + margin-bottom: 0.8em; +} + +table.footnote td.label { + width: .1px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + /* Matches the 30px from the narrow-screen "li > ul" selector below */ + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #EEE; + padding: 7px 30px; + margin: 15px 0px; + line-height: 1.3em; +} + +dl pre, blockquote pre, li pre { + margin-left: 0; + padding-left: 30px; +} + +dl dl pre { + margin-left: -90px; + padding-left: 90px; +} + +tt, code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, code.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid white; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +/* Don't put an underline on images */ +a.image-reference, a.image-reference:hover { + border-bottom: none; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt, a:hover code { + background: #EEE; +} + + +@media screen and (max-width: 870px) { + + div.sphinxsidebar { + display: none; + } + + div.document { + width: 100%; + + } + + div.documentwrapper { + margin-left: 0; + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + } + + div.bodywrapper { + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; + } + + ul { + margin-left: 0; + } + + li > ul { + /* Matches the 30px from the "ul, ol" selector above */ + margin-left: 30px; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .bodywrapper { + margin: 0; + } + + .footer { + width: auto; + } + + .github { + display: none; + } + + + +} + + + +@media screen and (max-width: 875px) { + + body { + margin: 0; + padding: 20px 30px; + } + + div.documentwrapper { + float: none; + background: white; + } + + div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: #FFF; + } + + div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, + div.sphinxsidebar h3 a { + color: white; + } + + div.sphinxsidebar a { + color: #AAA; + } + + div.sphinxsidebar p.logo { + display: none; + } + + div.document { + width: 100%; + margin: 0; + } + + div.footer { + display: none; + } + + div.bodywrapper { + margin: 0; + } + + div.body { + min-height: 0; + padding: 0; + } + + .rtd_doc_footer { + display: none; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .footer { + width: auto; + } + + .github { + display: none; + } +} + + +/* misc. */ + +.revsys-inline { + display: none!important; +} + +/* Make nested-list/multi-paragraph items look better in Releases changelog + * pages. Without this, docutils' magical list fuckery causes inconsistent + * formatting between different release sub-lists. + */ +div#changelog > div.section > ul > li > p:only-child { + margin-bottom: 0; +} + +/* Hide fugly table cell borders in ..bibliography:: directive output */ +table.docutils.citation, table.docutils.citation td, table.docutils.citation th { + border: none; + /* Below needed in some edge cases; if not applied, bottom shadows appear */ + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} \ No newline at end of file diff --git a/help/_static/basic.css b/help/_static/basic.css index 0807176..b3bdc00 100644 --- a/help/_static/basic.css +++ b/help/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -15,6 +15,12 @@ div.clearer { clear: both; } +div.section::after { + display: block; + content: ''; + clear: left; +} + /* -- relbar ---------------------------------------------------------------- */ div.related { @@ -231,6 +237,16 @@ a.headerlink { visibility: hidden; } +a.brackets:before, +span.brackets > a:before{ + content: "["; +} + +a.brackets:after, +span.brackets > a:after { + content: "]"; +} + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -261,19 +277,25 @@ p.rubric { font-weight: bold; } -img.align-left, .figure.align-left, object.align-left { +img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } -img.align-right, .figure.align-right, object.align-right { +img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } -img.align-center, .figure.align-center, object.align-center { +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; @@ -287,30 +309,41 @@ img.align-center, .figure.align-center, object.align-center { text-align: center; } +.align-default { + text-align: center; +} + .align-right { text-align: right; } /* -- sidebars -------------------------------------------------------------- */ -div.sidebar { +div.sidebar, +aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; - padding: 7px 7px 0 7px; + padding: 7px; background-color: #ffe; width: 40%; float: right; + clear: right; + overflow-x: auto; } p.sidebar-title { font-weight: bold; } +div.admonition, div.topic, blockquote { + clear: left; +} + /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; - padding: 7px 7px 0 7px; + padding: 7px; margin: 10px 0 10px 0; } @@ -332,10 +365,6 @@ div.admonition dt { font-weight: bold; } -div.admonition dl { - margin-bottom: 0; -} - p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; @@ -346,9 +375,30 @@ div.body p.centered { margin-top: 25px; } +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + /* -- tables ---------------------------------------------------------------- */ table.docutils { + margin-top: 10px; + margin-bottom: 10px; border: 0; border-collapse: collapse; } @@ -358,6 +408,11 @@ table.align-center { margin-right: auto; } +table.align-default { + margin-left: auto; + margin-right: auto; +} + table caption span.caption-number { font-style: italic; } @@ -391,22 +446,34 @@ table.citation td { border-bottom: none; } +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + /* -- figures --------------------------------------------------------------- */ -div.figure { +div.figure, figure { margin: 0.5em; padding: 0.5em; } -div.figure p.caption { +div.figure p.caption, figcaption { padding: 0.3em; } -div.figure p.caption span.caption-number { +div.figure p.caption span.caption-number, +figcaption span.caption-number { font-style: italic; } -div.figure p.caption span.caption-text { +div.figure p.caption span.caption-text, +figcaption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ @@ -433,6 +500,10 @@ table.field-list td, table.field-list th { /* -- hlist styles ---------------------------------------------------------- */ +table.hlist { + margin: 1em 0; +} + table.hlist td { vertical-align: top; } @@ -460,11 +531,78 @@ ol.upperroman { list-style: upper-roman; } +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +dl.footnote > dt, +dl.citation > dt { + float: left; + margin-right: 0.5em; +} + +dl.footnote > dd, +dl.citation > dd { + margin-bottom: 0em; +} + +dl.footnote > dd:after, +dl.citation > dd:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dt:after { + content: ":"; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + dl { margin-bottom: 15px; } -dd p { +dd > :first-child { margin-top: 0px; } @@ -478,6 +616,11 @@ dd { margin-left: 30px; } +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + dt:target, span.highlighted { background-color: #fbe54e; } @@ -537,6 +680,12 @@ dl.glossary dt { font-style: oblique; } +.classifier:before { + font-style: normal; + margin: 0.5em; + content: ":"; +} + abbr, acronym { border-bottom: dotted 1px; cursor: help; @@ -549,6 +698,10 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } +pre, div[class*="highlight-"] { + clear: both; +} + span.pre { -moz-hyphens: none; -ms-hyphens: none; @@ -556,22 +709,57 @@ span.pre { hyphens: none; } +div[class*="highlight-"] { + margin: 1em 0; +} + td.linenos pre { - padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { - margin-left: 0.5em; + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; } table.highlighttable td { - padding: 0 0.5em 0 0.5em; + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; } div.code-block-caption { + margin-top: 1em; padding: 2px 5px; font-size: small; } @@ -580,8 +768,10 @@ div.code-block-caption code { background-color: transparent; } -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; +table.highlighttable td.linenos, +span.linenos, +div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; } div.code-block-caption span.caption-number { @@ -593,11 +783,7 @@ div.code-block-caption span.caption-text { } div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; + margin: 1em 0; } code.descname { @@ -648,8 +834,7 @@ span.eqno { } span.eqno a.headerlink { - position: relative; - left: 0px; + position: absolute; z-index: 1; } diff --git a/help/_static/custom.css b/help/_static/custom.css new file mode 100644 index 0000000..2a924f1 --- /dev/null +++ b/help/_static/custom.css @@ -0,0 +1 @@ +/* This file intentionally left blank. */ diff --git a/help/_static/doctools.js b/help/_static/doctools.js index 344db17..61ac9d2 100644 --- a/help/_static/doctools.js +++ b/help/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,9 +29,14 @@ if (!window.console || !console.firebug) { /** * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** @@ -87,14 +92,13 @@ jQuery.fn.highlightText = function(text, className) { node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { - var bbox = span.getBBox(); var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect.x.baseVal.value = bbox.x; + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; rect.y.baseVal.value = bbox.y; rect.width.baseVal.value = bbox.width; rect.height.baseVal.value = bbox.height; rect.setAttribute('class', className); - var parentOfText = node.parentNode.parentNode; addItems.push({ "parent": node.parentNode, "target": rect}); @@ -284,10 +288,12 @@ var Documentation = { }, initOnKeyListeners: function() { - $(document).keyup(function(event) { + $(document).keydown(function(event) { var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { + // don't navigate when in search box, textarea, dropdown or button + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' + && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey + && !event.shiftKey) { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); diff --git a/help/_static/documentation_options.js b/help/_static/documentation_options.js index 0bdc960..2aad40d 100644 --- a/help/_static/documentation_options.js +++ b/help/_static/documentation_options.js @@ -3,8 +3,10 @@ var DOCUMENTATION_OPTIONS = { VERSION: '189', LANGUAGE: 'None', COLLAPSE_INDEX: false, + BUILDER: 'html', FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, + NAVIGATION_WITH_KEYS: false }; \ No newline at end of file diff --git a/help/_static/jquery.js b/help/_static/jquery.js index 7e32910..b8eb73c 100644 --- a/help/_static/jquery.js +++ b/help/_static/jquery.js @@ -1,5 +1,5 @@ /*! - * jQuery JavaScript Library v3.3.1-dfsg + * jQuery JavaScript Library v3.5.1 * https://jquery.com/ * * Includes Sizzle.js @@ -8,8 +8,6 @@ * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license - * - * Date: 2019-04-19T06:52Z */ ( function( global, factory ) { @@ -43,17 +41,20 @@ // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common // enough that all such attempts are guarded in a try block. - +"use strict"; var arr = []; -var document = window.document; - var getProto = Object.getPrototypeOf; var slice = arr.slice; -var concat = arr.concat; +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + var push = arr.push; @@ -86,25 +87,40 @@ var isWindow = function isWindow( obj ) { }; +var document = window.document; + var preservedScriptAttributes = { type: true, src: true, + nonce: true, noModule: true }; - function DOMEval( code, doc, node ) { + function DOMEval( code, node, doc ) { doc = doc || document; - var i, + var i, val, script = doc.createElement( "script" ); script.text = code; if ( node ) { for ( i in preservedScriptAttributes ) { - if ( node[ i ] ) { - script[ i ] = node[ i ]; + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); } } } @@ -129,7 +145,7 @@ function toType( obj ) { var - version = "3.3.1", + version = "3.5.1", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -137,11 +153,7 @@ var // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + }; jQuery.fn = jQuery.prototype = { @@ -207,6 +219,18 @@ jQuery.fn = jQuery.prototype = { return this.eq( -1 ); }, + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); @@ -258,7 +282,6 @@ jQuery.extend = jQuery.fn.extend = function() { // Extend the base object for ( name in options ) { - src = target[ name ]; copy = options[ name ]; // Prevent Object.prototype pollution @@ -270,14 +293,17 @@ jQuery.extend = jQuery.fn.extend = function() { // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; - if ( copyIsArray ) { - copyIsArray = false; - clone = src && Array.isArray( src ) ? src : []; - + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; + clone = src; } + copyIsArray = false; // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); @@ -330,9 +356,6 @@ jQuery.extend( { }, isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 var name; for ( name in obj ) { @@ -341,9 +364,10 @@ jQuery.extend( { return true; }, - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); }, each: function( obj, callback ) { @@ -367,13 +391,6 @@ jQuery.extend( { return obj; }, - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; @@ -460,7 +477,7 @@ jQuery.extend( { } // Flatten any nested arrays - return concat.apply( [], ret ); + return flat( ret ); }, // A global GUID counter for objects @@ -477,7 +494,7 @@ if ( typeof Symbol === "function" ) { // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { +function( _i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); @@ -499,17 +516,16 @@ function isArrayLike( obj ) { } var Sizzle = /*! - * Sizzle CSS Selector Engine v2.3.3 + * Sizzle CSS Selector Engine v2.3.5 * https://sizzlejs.com/ * - * Copyright jQuery Foundation and other contributors + * Copyright JS Foundation and other contributors * Released under the MIT license - * http://jquery.org/license + * https://js.foundation/ * - * Date: 2016-08-08 + * Date: 2020-03-14 */ -(function( window ) { - +( function( window ) { var i, support, Expr, @@ -540,6 +556,7 @@ var i, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), + nonnativeSelectorCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; @@ -548,61 +565,71 @@ var i, }, // Instance methods - hasOwn = ({}).hasOwnProperty, + hasOwn = ( {} ).hasOwnProperty, arr = [], pop = arr.pop, - push_native = arr.push, + pushNative = arr.push, push = arr.push, slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { - if ( list[i] === elem ) { + if ( list[ i ] === elem ) { return i; } } return -1; }, - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), @@ -613,16 +640,19 @@ var i, "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, + rhtml = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, @@ -635,18 +665,21 @@ var i, // CSS escapes // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair high < 0 ? - // BMP codepoint String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, @@ -662,7 +695,8 @@ var i, } // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped @@ -677,9 +711,9 @@ var i, setDocument(); }, - disabledAncestor = addCombinator( + inDisabledFieldset = addCombinator( function( elem ) { - return elem.disabled === true && ("form" in elem || "label" in elem); + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; }, { dir: "parentNode", next: "legend" } ); @@ -687,18 +721,20 @@ var i, // Optimize for push.apply( _, NodeList ) try { push.apply( - (arr = slice.call( preferredDoc.childNodes )), + ( arr = slice.call( preferredDoc.childNodes ) ), preferredDoc.childNodes ); + // Support: Android<4.0 // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { - push_native.apply( target, slice.call(els) ); + pushNative.apply( target, slice.call( els ) ); } : // Support: IE<9 @@ -706,8 +742,9 @@ try { function( target, els ) { var j = target.length, i = 0; + // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} + while ( ( target[ j++ ] = els[ i++ ] ) ) {} target.length = j - 1; } }; @@ -731,24 +768,21 @@ function Sizzle( selector, context, results, seed ) { // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } + setDocument( context ); context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { // ID selector - if ( (m = match[1]) ) { + if ( ( m = match[ 1 ] ) ) { // Document context if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { + if ( ( elem = context.getElementById( m ) ) ) { // Support: IE, Opera, Webkit // TODO: identify versions @@ -767,7 +801,7 @@ function Sizzle( selector, context, results, seed ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && + if ( newContext && ( elem = newContext.getElementById( m ) ) && contains( context, elem ) && elem.id === m ) { @@ -777,12 +811,12 @@ function Sizzle( selector, context, results, seed ) { } // Type selector - } else if ( match[2] ) { + } else if ( match[ 2 ] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); @@ -792,50 +826,62 @@ function Sizzle( selector, context, results, seed ) { // Take advantage of querySelectorAll if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 + // Support: IE 8 only // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); } newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; } - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); } } } @@ -856,12 +902,14 @@ function createCache() { var keys = []; function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries delete cache[ keys.shift() ]; } - return (cache[ key + " " ] = value); + return ( cache[ key + " " ] = value ); } return cache; } @@ -880,17 +928,19 @@ function markFunction( fn ) { * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { - var el = document.createElement("fieldset"); + var el = document.createElement( "fieldset" ); try { return !!fn( el ); - } catch (e) { + } catch ( e ) { return false; } finally { + // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } + // release memory in IE el = null; } @@ -902,11 +952,11 @@ function assert( fn ) { * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { - var arr = attrs.split("|"), + var arr = attrs.split( "|" ), i = arr.length; while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; + Expr.attrHandle[ arr[ i ] ] = handler; } } @@ -928,7 +978,7 @@ function siblingCheck( a, b ) { // Check if b follows a if ( cur ) { - while ( (cur = cur.nextSibling) ) { + while ( ( cur = cur.nextSibling ) ) { if ( cur === b ) { return -1; } @@ -956,7 +1006,7 @@ function createInputPseudo( type ) { function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; + return ( name === "input" || name === "button" ) && elem.type === type; }; } @@ -999,7 +1049,7 @@ function createDisabledPseudo( disabled ) { // Where there is no isDisabled, check manually /* jshint -W018 */ elem.isDisabled !== !disabled && - disabledAncestor( elem ) === disabled; + inDisabledFieldset( elem ) === disabled; } return elem.disabled === disabled; @@ -1021,21 +1071,21 @@ function createDisabledPseudo( disabled ) { * @param {Function} fn */ function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { + return markFunction( function( argument ) { argument = +argument; - return markFunction(function( seed, matches ) { + return markFunction( function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); } } - }); - }); + } ); + } ); } /** @@ -1056,10 +1106,13 @@ support = Sizzle.support = {}; * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; + var namespace = elem.namespaceURI, + docElem = ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); }; /** @@ -1072,7 +1125,11 @@ setDocument = Sizzle.setDocument = function( node ) { doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } @@ -1081,10 +1138,14 @@ setDocument = Sizzle.setDocument = function( node ) { docElem = document.documentElement; documentIsHTML = !isXML( document ); - // Support: IE 9-11, Edge + // Support: IE 9 - 11+, Edge 12 - 18+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { // Support: IE 11, Edge if ( subWindow.addEventListener ) { @@ -1096,25 +1157,36 @@ setDocument = Sizzle.setDocument = function( node ) { } } + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) - support.attributes = assert(function( el ) { + support.attributes = assert( function( el ) { el.className = "i"; - return !el.getAttribute("className"); - }); + return !el.getAttribute( "className" ); + } ); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); @@ -1123,38 +1195,38 @@ setDocument = Sizzle.setDocument = function( node ) { // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { + support.getById = assert( function( el ) { docElem.appendChild( el ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); + } ); // ID filter and find if ( support.getById ) { - Expr.filter["ID"] = function( id ) { + Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - return elem.getAttribute("id") === attrId; + return elem.getAttribute( "id" ) === attrId; }; }; - Expr.find["ID"] = function( id, context ) { + Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var elem = context.getElementById( id ); return elem ? [ elem ] : []; } }; } else { - Expr.filter["ID"] = function( id ) { + Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); + elem.getAttributeNode( "id" ); return node && node.value === attrId; }; }; // Support: IE 6 - 7 only // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { + Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var node, i, elems, elem = context.getElementById( id ); @@ -1162,7 +1234,7 @@ setDocument = Sizzle.setDocument = function( node ) { if ( elem ) { // Verify the id attribute - node = elem.getAttributeNode("id"); + node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } @@ -1170,8 +1242,8 @@ setDocument = Sizzle.setDocument = function( node ) { // Fall back on getElementsByName elems = context.getElementsByName( id ); i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } @@ -1184,7 +1256,7 @@ setDocument = Sizzle.setDocument = function( node ) { } // Tag - Expr.find["TAG"] = support.getElementsByTagName ? + Expr.find[ "TAG" ] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); @@ -1199,12 +1271,13 @@ setDocument = Sizzle.setDocument = function( node ) { var elem, tmp = [], i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { - while ( (elem = results[i++]) ) { + while ( ( elem = results[ i++ ] ) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } @@ -1216,7 +1289,7 @@ setDocument = Sizzle.setDocument = function( node ) { }; // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } @@ -1237,10 +1310,14 @@ setDocument = Sizzle.setDocument = function( node ) { // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + // Build QSA regex // Regex strategy adopted from Diego Perini - assert(function( el ) { + assert( function( el ) { + + var input; + // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, @@ -1254,78 +1331,98 @@ setDocument = Sizzle.setDocument = function( node ) { // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { + if ( !el.querySelectorAll( "[selected]" ).length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibling-combinator selector` fails if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); + rbuggyQSA.push( ".#.+[+~]" ); } - }); - assert(function( el ) { + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { el.innerHTML = "" + ""; // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); + var input = document.createElement( "input" ); input.setAttribute( "type", "hidden" ); el.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { + if ( el.querySelectorAll( "[name=d]" ).length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: IE9-11+ // IE's :disabled selector does not pick up the children of disabled fieldsets docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } + // Support: Opera 10 - 11 only // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); } - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { - assert(function( el ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( el, "*" ); @@ -1334,11 +1431,11 @@ setDocument = Sizzle.setDocument = function( node ) { // Gecko does not error, returns false instead matches.call( el, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); - }); + } ); } - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); /* Contains ---------------------------------------------------------------------- */ @@ -1355,11 +1452,11 @@ setDocument = Sizzle.setDocument = function( node ) { adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); + ) ); } : function( a, b ) { if ( b ) { - while ( (b = b.parentNode) ) { + while ( ( b = b.parentNode ) ) { if ( b === a ) { return true; } @@ -1388,7 +1485,11 @@ setDocument = Sizzle.setDocument = function( node ) { } // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected @@ -1396,13 +1497,24 @@ setDocument = Sizzle.setDocument = function( node ) { // Disconnected nodes if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { return -1; } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { return 1; } @@ -1415,6 +1527,7 @@ setDocument = Sizzle.setDocument = function( node ) { return compare & 4 ? -1 : 1; } : function( a, b ) { + // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; @@ -1430,8 +1543,14 @@ setDocument = Sizzle.setDocument = function( node ) { // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ aup ? -1 : bup ? 1 : sortInput ? @@ -1445,26 +1564,32 @@ setDocument = Sizzle.setDocument = function( node ) { // Otherwise we need full lists of their ancestors for comparison cur = a; - while ( (cur = cur.parentNode) ) { + while ( ( cur = cur.parentNode ) ) { ap.unshift( cur ); } cur = b; - while ( (cur = cur.parentNode) ) { + while ( ( cur = cur.parentNode ) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { + while ( ap[ i ] === bp[ i ] ) { i++; } return i ? + // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : + siblingCheck( ap[ i ], bp[ i ] ) : // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ 0; }; @@ -1476,16 +1601,10 @@ Sizzle.matches = function( expr, elements ) { }; Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); + setDocument( elem ); if ( support.matchesSelector && documentIsHTML && - !compilerCache[ expr + " " ] && + !nonnativeSelectorCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { @@ -1494,32 +1613,46 @@ Sizzle.matchesSelector = function( elem, expr ) { // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { return ret; } - } catch (e) {} + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { + // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { + // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : @@ -1529,13 +1662,13 @@ Sizzle.attr = function( elem, name ) { val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? + ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : null; }; Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); + return ( sel + "" ).replace( rcssescape, fcssescape ); }; Sizzle.error = function( msg ) { @@ -1558,7 +1691,7 @@ Sizzle.uniqueSort = function( results ) { results.sort( sortOrder ); if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { + while ( ( elem = results[ i++ ] ) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } @@ -1586,17 +1719,21 @@ getText = Sizzle.getText = function( elem ) { nodeType = elem.nodeType; if ( !nodeType ) { + // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { + while ( ( node = elem[ i++ ] ) ) { + // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { + // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); @@ -1605,6 +1742,7 @@ getText = Sizzle.getText = function( elem ) { } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } + // Do not include comment or processing instruction nodes return ret; @@ -1632,19 +1770,21 @@ Expr = Sizzle.selectors = { preFilter: { "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) @@ -1655,22 +1795,25 @@ Expr = Sizzle.selectors = { 7 sign of y-component 8 y of y-component */ - match[1] = match[1].toLowerCase(); + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); } return match; @@ -1678,26 +1821,28 @@ Expr = Sizzle.selectors = { "PSEUDO": function( match ) { var excess, - unquoted = !match[6] && match[2]; + unquoted = !match[ 6 ] && match[ 2 ]; - if ( matchExpr["CHILD"].test( match[0] ) ) { + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { return null; } // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && + ( excess = tokenize( unquoted, true ) ) && + // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) @@ -1710,7 +1855,9 @@ Expr = Sizzle.selectors = { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? - function() { return true; } : + function() { + return true; + } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; @@ -1720,10 +1867,16 @@ Expr = Sizzle.selectors = { var pattern = classCache[ className + " " ]; return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); }, "ATTR": function( name, operator, check ) { @@ -1739,6 +1892,8 @@ Expr = Sizzle.selectors = { result += ""; + /* eslint-disable max-len */ + return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : @@ -1747,10 +1902,12 @@ Expr = Sizzle.selectors = { operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; + /* eslint-enable max-len */ + }; }, - "CHILD": function( type, what, argument, first, last ) { + "CHILD": function( type, what, _argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; @@ -1762,7 +1919,7 @@ Expr = Sizzle.selectors = { return !!elem.parentNode; } : - function( elem, context, xml ) { + function( elem, _context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, @@ -1776,7 +1933,7 @@ Expr = Sizzle.selectors = { if ( simple ) { while ( dir ) { node = elem; - while ( (node = node[ dir ]) ) { + while ( ( node = node[ dir ] ) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { @@ -1784,6 +1941,7 @@ Expr = Sizzle.selectors = { return false; } } + // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } @@ -1799,22 +1957,22 @@ Expr = Sizzle.selectors = { // ...in a gzip-friendly way node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); + outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); + ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; - while ( (node = ++nodeIndex && node && node[ dir ] || + while ( ( node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { + ( diff = nodeIndex = 0 ) || start.pop() ) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { @@ -1824,16 +1982,18 @@ Expr = Sizzle.selectors = { } } else { + // Use previously-cached element index if available if ( useCache ) { + // ...in a gzip-friendly way node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); + outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); + ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; @@ -1843,9 +2003,10 @@ Expr = Sizzle.selectors = { // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : @@ -1854,12 +2015,13 @@ Expr = Sizzle.selectors = { // Cache the index of each encountered element if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); + outerCache = node[ expando ] || + ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); + ( outerCache[ node.uniqueID ] = {} ); uniqueCache[ type ] = [ dirruns, diff ]; } @@ -1880,6 +2042,7 @@ Expr = Sizzle.selectors = { }, "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters @@ -1899,15 +2062,15 @@ Expr = Sizzle.selectors = { if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { + markFunction( function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); } - }) : + } ) : function( elem ) { return fn( elem, 0, args ); }; @@ -1918,8 +2081,10 @@ Expr = Sizzle.selectors = { }, pseudos: { + // Potentially complex pseudos - "not": markFunction(function( selector ) { + "not": markFunction( function( selector ) { + // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators @@ -1928,39 +2093,40 @@ Expr = Sizzle.selectors = { matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { + markFunction( function( seed, matches, _context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); } } - }) : - function( elem, context, xml ) { - input[0] = elem; + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; matcher( input, null, xml, results ); + // Don't keep the element (issue #299) - input[0] = null; + input[ 0 ] = null; return !results.pop(); }; - }), + } ), - "has": markFunction(function( selector ) { + "has": markFunction( function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; - }), + } ), - "contains": markFunction(function( text ) { + "contains": markFunction( function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; }; - }), + } ), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value @@ -1970,25 +2136,26 @@ Expr = Sizzle.selectors = { // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { + // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { + if ( !ridentifier.test( lang || "" ) ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { - if ( (elemLang = documentIsHTML ? + if ( ( elemLang = documentIsHTML ? elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); return false; }; - }), + } ), // Miscellaneous "target": function( elem ) { @@ -2001,7 +2168,9 @@ Expr = Sizzle.selectors = { }, "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); }, // Boolean properties @@ -2009,16 +2178,20 @@ Expr = Sizzle.selectors = { "disabled": createDisabledPseudo( true ), "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); }, "selected": function( elem ) { + // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions elem.parentNode.selectedIndex; } @@ -2027,6 +2200,7 @@ Expr = Sizzle.selectors = { // Contents "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) @@ -2040,7 +2214,7 @@ Expr = Sizzle.selectors = { }, "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); + return !Expr.pseudos[ "empty" ]( elem ); }, // Element/input types @@ -2064,57 +2238,62 @@ Expr = Sizzle.selectors = { // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); }, // Position-in-collection - "first": createPositionalPseudo(function() { + "first": createPositionalPseudo( function() { return [ 0 ]; - }), + } ), - "last": createPositionalPseudo(function( matchIndexes, length ) { + "last": createPositionalPseudo( function( _matchIndexes, length ) { return [ length - 1 ]; - }), + } ), - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; - }), + } ), - "even": createPositionalPseudo(function( matchIndexes, length ) { + "even": createPositionalPseudo( function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), - "odd": createPositionalPseudo(function( matchIndexes, length ) { + "odd": createPositionalPseudo( function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; - }) + } ) } }; -Expr.pseudos["nth"] = Expr.pseudos["eq"]; +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { @@ -2145,37 +2324,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) { while ( soFar ) { // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { if ( match ) { + // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; + soFar = soFar.slice( match[ 0 ].length ) || soFar; } - groups.push( (tokens = []) ); + groups.push( ( tokens = [] ) ); } matched = false; // Combinators - if ( (match = rcombinators.exec( soFar )) ) { + if ( ( match = rcombinators.exec( soFar ) ) ) { matched = match.shift(); - tokens.push({ + tokens.push( { value: matched, + // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); + type: match[ 0 ].replace( rtrim, " " ) + } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { matched = match.shift(); - tokens.push({ + tokens.push( { value: matched, type: type, matches: match - }); + } ); soFar = soFar.slice( matched.length ); } } @@ -2192,6 +2373,7 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) { soFar.length : soFar ? Sizzle.error( selector ) : + // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; @@ -2201,7 +2383,7 @@ function toSelector( tokens ) { len = tokens.length, selector = ""; for ( ; i < len; i++ ) { - selector += tokens[i].value; + selector += tokens[ i ].value; } return selector; } @@ -2214,9 +2396,10 @@ function addCombinator( matcher, combinator, base ) { doneName = done++; return combinator.first ? + // Check against closest ancestor/preceding element function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } @@ -2231,7 +2414,7 @@ function addCombinator( matcher, combinator, base ) { // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; @@ -2239,27 +2422,29 @@ function addCombinator( matcher, combinator, base ) { } } } else { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); if ( skip && skip === elem.nodeName.toLowerCase() ) { elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && + } else if ( ( oldCache = uniqueCache[ key ] ) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); + return ( newCache[ 2 ] = oldCache[ 2 ] ); } else { + // Reuse newcache so results back-propagate to previous elements uniqueCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { return true; } } @@ -2275,20 +2460,20 @@ function elementMatcher( matchers ) { function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { + if ( !matchers[ i ]( elem, context, xml ) ) { return false; } } return true; } : - matchers[0]; + matchers[ 0 ]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); + Sizzle( selector, contexts[ i ], results ); } return results; } @@ -2301,7 +2486,7 @@ function condense( unmatched, map, filter, context, xml ) { mapped = map != null; for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { + if ( ( elem = unmatched[ i ] ) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { @@ -2321,14 +2506,18 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } - return markFunction(function( seed, results, context, xml ) { + return markFunction( function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? @@ -2336,6 +2525,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS elems, matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? @@ -2359,8 +2549,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); } } } @@ -2368,25 +2558,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { - if ( (elem = matcherOut[i]) ) { + if ( ( elem = matcherOut[ i ] ) ) { + // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); + temp.push( ( matcherIn[ i ] = elem ) ); } } - postFinder( null, (matcherOut = []), temp, xml ); + postFinder( null, ( matcherOut = [] ), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - seed[temp] = !(results[temp] = elem); + seed[ temp ] = !( results[ temp ] = elem ); } } } @@ -2404,14 +2596,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS push.apply( results, matcherOut ); } } - }); + } ); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) @@ -2423,38 +2615,43 @@ function matcherFromTokens( tokens ) { }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? + ( checkContext = context ).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { + if ( Expr.relative[ tokens[ j ].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), j < len && toSelector( tokens ) ); } @@ -2475,28 +2672,40 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { unmatched = seed && [], setMatched = [], contextBackup = outermostContext, + // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), len = elems.length; if ( outermost ) { - outermostContext = context === document || context || outermost; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { if ( byElement && elem ) { j = 0; - if ( !context && elem.ownerDocument !== document ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { setDocument( elem ); xml = !documentIsHTML; } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { results.push( elem ); break; } @@ -2508,8 +2717,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // Track unmatched elements for set filters if ( bySet ) { + // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { + if ( ( elem = !matcher && elem ) ) { matchedCount--; } @@ -2533,16 +2743,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; - while ( (matcher = setMatchers[j++]) ) { + while ( ( matcher = setMatchers[ j++ ] ) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); } } } @@ -2583,13 +2794,14 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { cached = compilerCache[ selector + " " ]; if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { - cached = matcherFromTokens( match[i] ); + cached = matcherFromTokens( match[ i ] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { @@ -2598,7 +2810,10 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { } // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); // Save selector and tokenization cached.selector = selector; @@ -2618,7 +2833,7 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); results = results || []; @@ -2627,11 +2842,12 @@ select = Sizzle.select = function( selector, context, results, seed ) { if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; if ( !context ) { return results; @@ -2644,20 +2860,22 @@ select = Sizzle.select = function( selector, context, results, seed ) { } // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; while ( i-- ) { - token = tokens[i]; + token = tokens[ i ]; // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { + if ( Expr.relative[ ( type = token.type ) ] ) { break; } - if ( (find = Expr.find[ type ]) ) { + if ( ( find = Expr.find[ type ] ) ) { + // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); @@ -2688,7 +2906,7 @@ select = Sizzle.select = function( selector, context, results, seed ) { // One-time assignments // Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function @@ -2699,58 +2917,59 @@ setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( el ) { +support.sortDetached = assert( function( el ) { + // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; -}); + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); // Support: IE<8 // Prevent attribute/property "interpolation" // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( el ) { +if ( !assert( function( el ) { el.innerHTML = ""; - return el.firstChild.getAttribute("href") === "#" ; -}) ) { + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } - }); + } ); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( el ) { +if ( !support.attributes || !assert( function( el ) { el.innerHTML = ""; el.firstChild.setAttribute( "value", "" ); return el.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } - }); + } ); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( el ) { - return el.getAttribute("disabled") == null; -}) ) { +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? + ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : - null; + null; } - }); + } ); } return Sizzle; -})( window ); +} )( window ); @@ -3119,7 +3338,7 @@ jQuery.each( { parents: function( elem ) { return dir( elem, "parentNode" ); }, - parentsUntil: function( elem, i, until ) { + parentsUntil: function( elem, _i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { @@ -3134,10 +3353,10 @@ jQuery.each( { prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, - nextUntil: function( elem, i, until ) { + nextUntil: function( elem, _i, until ) { return dir( elem, "nextSibling", until ); }, - prevUntil: function( elem, i, until ) { + prevUntil: function( elem, _i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { @@ -3147,18 +3366,24 @@ jQuery.each( { return siblings( elem.firstChild ); }, contents: function( elem ) { - if ( nodeName( elem, "iframe" ) ) { - return elem.contentDocument; - } + if ( elem.contentDocument != null && - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { - return jQuery.merge( [], elem.childNodes ); + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { @@ -3490,7 +3715,7 @@ jQuery.extend( { var fns = arguments; return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { + jQuery.each( tuples, function( _i, tuple ) { // Map tuples (progress, done, fail) to arguments (done, fail, progress) var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; @@ -3943,7 +4168,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { // ...except when executing function values } else { bulk = fn; - fn = function( elem, key, value ) { + fn = function( elem, _key, value ) { return bulk.call( jQuery( elem ), value ); }; } @@ -3978,7 +4203,7 @@ var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g; // Used by camelCase as callback to replace() -function fcamelCase( all, letter ) { +function fcamelCase( _all, letter ) { return letter.toUpperCase(); } @@ -4467,6 +4692,26 @@ var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } var isHiddenWithinTree = function( elem, el ) { // isHiddenWithinTree might be called from jQuery#filter function; @@ -4481,32 +4726,11 @@ var isHiddenWithinTree = function( elem, el ) { // Support: Firefox <=43 - 45 // Disconnected elements can have computed display: none, so first confirm that elem is // in the document. - jQuery.contains( elem.ownerDocument, elem ) && + isAttached( elem ) && jQuery.css( elem, "display" ) === "none"; }; -var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - function adjustCSS( elem, prop, valueParts, tween ) { @@ -4523,7 +4747,8 @@ function adjustCSS( elem, prop, valueParts, tween ) { unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { @@ -4670,17 +4895,46 @@ jQuery.fn.extend( { } ); var rcheckableType = ( /^(?:checkbox|radio)$/i ); -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); -// We have to close these tags to support XHTML (#13200) -var wrapMap = { +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // Support: IE <=9 only - option: [ 1, "" ], + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten @@ -4693,12 +4947,14 @@ var wrapMap = { _default: [ 0, "", "" ] }; -// Support: IE <=9 only -wrapMap.optgroup = wrapMap.option; - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + function getAll( context, tag ) { @@ -4742,7 +4998,7 @@ function setGlobalEval( elems, refElements ) { var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, contains, j, + var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, @@ -4806,13 +5062,13 @@ function buildFragment( elems, context, scripts, selection, ignored ) { continue; } - contains = jQuery.contains( elem.ownerDocument, elem ); + attached = isAttached( elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history - if ( contains ) { + if ( attached ) { setGlobalEval( tmp ); } @@ -4831,34 +5087,6 @@ function buildFragment( elems, context, scripts, selection, ignored ) { } -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -} )(); -var documentElement = document.documentElement; - - - var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, @@ -4872,8 +5100,19 @@ function returnFalse() { return false; } +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + // Support: IE <=9 only -// See #13393 for more info +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 function safeActiveElement() { try { return document.activeElement; @@ -4956,8 +5195,8 @@ jQuery.event = { special, handlers, type, namespaces, origType, elemData = dataPriv.get( elem ); - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { return; } @@ -4981,7 +5220,7 @@ jQuery.event = { // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { - events = elemData.events = {}; + events = elemData.events = Object.create( null ); } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { @@ -5139,12 +5378,15 @@ jQuery.event = { dispatch: function( nativeEvent ) { - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - var i, j, ret, matched, handleObj, handlerQueue, args = new Array( arguments.length ), - handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event @@ -5173,9 +5415,10 @@ jQuery.event = { while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; @@ -5299,39 +5542,51 @@ jQuery.event = { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, - focus: { - - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { - this.click(); - return false; + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; }, - // For cross-browser consistency, don't fire native .click() on links + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack _default: function( event ) { - return nodeName( event.target, "a" ); + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); } }, @@ -5348,6 +5603,93 @@ jQuery.event = { } }; +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + return result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + jQuery.removeEvent = function( elem, type, handle ) { // This "if" is needed for plain objects @@ -5460,6 +5802,7 @@ jQuery.each( { shiftKey: true, view: true, "char": true, + code: true, charCode: true, key: true, keyCode: true, @@ -5506,6 +5849,33 @@ jQuery.each( { } }, jQuery.event.addProp ); +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + delegateType: delegateType + }; +} ); + // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout @@ -5591,13 +5961,6 @@ jQuery.fn.extend( { var - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - // Support: IE <=10 - 11, Edge 12 - 13 only // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ @@ -5634,7 +5997,7 @@ function restoreScript( elem ) { } function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + var i, l, type, pdataOld, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; @@ -5642,13 +6005,11 @@ function cloneCopyEvent( src, dest ) { // 1. Copy private data: events, handlers, etc. if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); + pdataOld = dataPriv.get( src ); events = pdataOld.events; if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; + dataPriv.remove( dest, "handle events" ); for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { @@ -5684,7 +6045,7 @@ function fixInput( src, dest ) { function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays - args = concat.apply( [], args ); + args = flat( args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, @@ -5756,11 +6117,13 @@ function domManip( collection, args, callback, ignored ) { if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); } } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); } } } @@ -5782,7 +6145,7 @@ function remove( elem, selector, keepData ) { } if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + if ( keepData && isAttached( node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); @@ -5794,13 +6157,13 @@ function remove( elem, selector, keepData ) { jQuery.extend( { htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1>" ); + return html; }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); + inPage = isAttached( elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && @@ -6056,6 +6419,27 @@ var getStyles = function( elem ) { return view.getComputedStyle( elem ); }; +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); @@ -6096,8 +6480,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); // Support: IE 9 only // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) div.style.position = "absolute"; - scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; documentElement.removeChild( container ); @@ -6111,7 +6497,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); } var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableMarginLeftVal, + reliableTrDimensionsVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); @@ -6146,6 +6532,35 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); scrollboxSize: function() { computeStyleTests(); return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px"; + tr.style.height = "1px"; + trChild.style.height = "9px"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; } } ); } )(); @@ -6168,7 +6583,7 @@ function curCSS( elem, name, computed ) { if ( computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + if ( ret === "" && !isAttached( elem ) ) { ret = jQuery.style( elem, name ); } @@ -6224,30 +6639,13 @@ function addGetHookIf( conditionFn, hookFn ) { } -var +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }, - - cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style; - -// Return a css property mapped to a potentially vendor prefixed property +// Return a vendor-prefixed property or undefined function vendorPropName( name ) { - // Shortcut for names that are not vendor prefixed - if ( name in emptyStyle ) { - return name; - } - // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; @@ -6260,17 +6658,34 @@ function vendorPropName( name ) { } } -// Return a property mapped along what jQuery.cssProps suggests or to -// a vendor prefixed property. +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property function finalPropName( name ) { - var ret = jQuery.cssProps[ name ]; - if ( !ret ) { - ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; } - return ret; + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; } -function setPositiveNumber( elem, value, subtract ) { + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { // Any relative (+/-) values have already been // normalized at this point @@ -6341,7 +6756,10 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed delta - extra - 0.5 - ) ); + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; } return delta; @@ -6351,9 +6769,16 @@ function getWidthOrHeight( elem, dimension, extra ) { // Start with computed style var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + val = curCSS( elem, dimension, styles ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox; + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); // Support: Firefox <=54 // Return a confounding non-pixel value or feign ignorance, as appropriate. @@ -6364,22 +6789,38 @@ function getWidthOrHeight( elem, dimension, extra ) { val = "auto"; } - // Check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = valueIsBorderBox && - ( support.boxSizingReliable() || val === elem.style[ dimension ] ); - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - if ( val === "auto" || - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) { + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || - val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ]; + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - // offsetWidth/offsetHeight provide border-box values - valueIsBorderBox = true; + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } } // Normalize "" and auto @@ -6425,6 +6866,13 @@ jQuery.extend( { "flexGrow": true, "flexShrink": true, "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, "lineHeight": true, "opacity": true, "order": true, @@ -6480,7 +6928,9 @@ jQuery.extend( { } // If a number was passed in, add the unit (except for certain CSS properties) - if ( type === "number" ) { + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } @@ -6554,7 +7004,7 @@ jQuery.extend( { } } ); -jQuery.each( [ "height", "width" ], function( i, dimension ) { +jQuery.each( [ "height", "width" ], function( _i, dimension ) { jQuery.cssHooks[ dimension ] = { get: function( elem, computed, extra ) { if ( computed ) { @@ -6580,18 +7030,29 @@ jQuery.each( [ "height", "width" ], function( i, dimension ) { set: function( elem, value, extra ) { var matches, styles = getStyles( elem ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra && boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ); + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; // Account for unreliable border-box dimensions by comparing offset* to computed and // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && support.scrollboxSize() === styles.position ) { + if ( isBorderBox && scrollboxSizeBuggy ) { subtract -= Math.ceil( elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - parseFloat( styles[ dimension ] ) - @@ -6759,9 +7220,9 @@ Tween.propHooks = { // Use .style if available and use plain properties where available. if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && - ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || - jQuery.cssHooks[ tween.prop ] ) ) { + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; @@ -7316,7 +7777,7 @@ jQuery.fn.extend( { clearQueue = type; type = undefined; } - if ( clearQueue && type !== false ) { + if ( clearQueue ) { this.queue( type || "fx", [] ); } @@ -7399,7 +7860,7 @@ jQuery.fn.extend( { } } ); -jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? @@ -7620,7 +8081,7 @@ boolHook = { } }; -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = function( elem, name, isXML ) { @@ -8244,7 +8705,9 @@ jQuery.extend( jQuery.event, { special.bindType || type; // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + handle = ( + dataPriv.get( cur, "events" ) || Object.create( null ) + )[ event.type ] && dataPriv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); @@ -8355,7 +8818,10 @@ if ( !support.focusin ) { jQuery.event.special[ fix ] = { setup: function() { - var doc = this.ownerDocument || this, + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ); if ( !attaches ) { @@ -8364,7 +8830,7 @@ if ( !support.focusin ) { dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { - var doc = this.ownerDocument || this, + var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ) - 1; if ( !attaches ) { @@ -8380,7 +8846,7 @@ if ( !support.focusin ) { } var location = window.location; -var nonce = Date.now(); +var nonce = { guid: Date.now() }; var rquery = ( /\?/ ); @@ -8468,6 +8934,10 @@ jQuery.param = function( a, traditional ) { encodeURIComponent( value == null ? "" : value ); }; + if ( a == null ) { + return ""; + } + // If an array was passed in, assume that it is an array of form elements. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { @@ -8508,7 +8978,7 @@ jQuery.fn.extend( { rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ) - .map( function( i, elem ) { + .map( function( _i, elem ) { var val = jQuery( this ).val(); if ( val == null ) { @@ -8970,12 +9440,14 @@ jQuery.extend( { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); } } - match = responseHeaders[ key.toLowerCase() ]; + match = responseHeaders[ key.toLowerCase() + " " ]; } - return match == null ? null : match; + return match == null ? null : match.join( ", " ); }, // Raw string @@ -9119,7 +9591,8 @@ jQuery.extend( { // Add or update anti-cache param if needed if ( s.cache === false ) { cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; } // Put hash and anti-cache on the URL that will be requested (gh-1732) @@ -9252,6 +9725,11 @@ jQuery.extend( { response = ajaxHandleResponses( s, jqXHR, responses ); } + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); @@ -9342,7 +9820,7 @@ jQuery.extend( { } } ); -jQuery.each( [ "get", "post" ], function( i, method ) { +jQuery.each( [ "get", "post" ], function( _i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // Shift arguments if data argument was omitted @@ -9363,8 +9841,17 @@ jQuery.each( [ "get", "post" ], function( i, method ) { }; } ); +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); -jQuery._evalUrl = function( url ) { + +jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { url: url, @@ -9374,7 +9861,16 @@ jQuery._evalUrl = function( url ) { cache: true, async: false, global: false, - "throws": true + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } } ); }; @@ -9657,24 +10153,21 @@ jQuery.ajaxPrefilter( "script", function( s ) { // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { - // This transport only deals with cross domain requests - if ( s.crossDomain ) { + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { var script, callback; return { send: function( _, complete ) { - script = jQuery( " + + + + + + + + + + + + +
+
-

43. Bisector Window

+

43. Bisector Window

.

_images/Bisector.png
-

44. Using the Bisector Window

+

44. Using the Bisector Window

The purpose of this window is obviously to split the list of frames into two pieces. You have many options for how to do this. You can split by:

ID Range - Grab a set of frames between two values. Note that you cannot pick and choose frame IDs here but rather just use a list. If you want to pick and choose then use the filter interface on the main form and then save the filtered list from the File menu.

Frame Number - You can split right at a given frame number. All frames up to that number will be on one side with all the rest on the other.

@@ -32,8 +47,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/connectionwindow.html b/help/connectionwindow.html index b0431c6..a213433 100644 --- a/help/connectionwindow.html +++ b/help/connectionwindow.html @@ -1,21 +1,36 @@ - - + + + - - - 9. Connection Window - - + + + 9. Connection Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

9. Connection Window

+

9. Connection Window

.

_images/ConnectionWindow.png

The connection window is used to add, remove, and modify connections. At the moment it is possible @@ -26,7 +41,7 @@ bit, and Vector, PeakCAN, and TinyCAN on supported OS’s.

Teensy 3.1-3.6, Macchina M2, EVTV ESP32 Due.

-

10. Connecting To A Dongle

+

10. Connecting To A Dongle

SavvyCAN is able to connect to GVRET compatible devices to capture new traffic. These devices will present as serial ports on the connected PC. To connect to a dongle select the proper serial port and click “Create New Connection”. @@ -55,7 +70,7 @@ to a textbox. Enter the IP address of the remote (but still local to your LAN) I this works with EVTV ESP32 boards and M2 boards.

-

11. Debugging Connection Problems

+

11. Debugging Connection Problems

GVRET devices present as serial ports and have significant configuration options. However, the ability to configure so many things and the ability to compile the firmware yourself both come as a double edged sword. They present many opportunities for things @@ -74,8 +89,149 @@ ending (Cr, Lf, CrLf, any will work).

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/customsender.html b/help/customsender.html index 6f00d0b..740e8b3 100644 --- a/help/customsender.html +++ b/help/customsender.html @@ -1,126 +1,282 @@ - - + + + - - - 74. Custom Sender Window - - + + + 74. Custom Sender Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

74. Custom Sender Window

+

74. Custom Sender Window

.

_images/CustomSender.png
-

75. General Overview

+

75. General Overview

This window allows you to create custom frames that will be sent out on one of the can buses. The uses are endless. It can be used to generate valid traffic to control connected hardware. It can be used to test out various ideas you might have for now to interact with other devices. It can replay frames from one bus into the other bus but with modifications.

-

76. Layout of the View

+

76. Layout of the View

This screen is laid out as a data grid.

    -
  • The first field is “En” which stands for Enabled. If the checkbox is checked -then this line will be active.
  • -
  • The second field is “Bus” and sets which bus to use for sending.
  • -
  • The third field is “ID” and is the ID to use for sending. It can be specified in hex or decimal formats.
  • -
  • The fourth field is “Len” and sets the number of data bytes for this frame.
  • -
  • The fifth field is “Data” and specifies what values will be sent for the next frame. These values can be -automatically updated by the modifiers which will be covered later on.
  • -
  • The sixth field is “Trigger” which specifies when this frame will be sent. Proper syntax for triggers is -covered later.
  • -
  • The seventh field is “Modifications” which specifies how the data bytes for this frame will be changed for -the next frame sent. Full syntax for this is covered later on.
  • -
  • The final field is “Count” and is automatically filled out with the number of frames that have been sent as -a result of this line.
  • +
  • The first field is “En” which stands for Enabled. If the checkbox is checked +then this line will be active.

  • +
  • The second field is “Bus” and sets which bus to use for sending.

  • +
  • The third field is “ID” and is the ID to use for sending. It can be specified in hex or decimal formats.

  • +
  • The fourth field is “Len” and sets the number of data bytes for this frame.

  • +
  • The fifth field is “Data” and specifies what values will be sent for the next frame. These values can be +automatically updated by the modifiers which will be covered later on.

  • +
  • The sixth field is “Trigger” which specifies when this frame will be sent. Proper syntax for triggers is +covered later.

  • +
  • The seventh field is “Modifications” which specifies how the data bytes for this frame will be changed for +the next frame sent. Full syntax for this is covered later on.

  • +
  • The final field is “Count” and is automatically filled out with the number of frames that have been sent as +a result of this line.

-

77. Writing Trigger Rules

+

77. Writing Trigger Rules

It should first be noted that each line can contain multiple triggers. Each trigger is separated by a comma ‘,’.

Triggers are allowed to have one or more conditions. Each condition contained within a single trigger is separated by a space ‘ ‘.

-

The program implments the following conditions:

+

The program implements the following conditions:

    -
  • id - Set the trigger to activate when a frame with the given ID is received. The syntax is ‘id’ -followed by the numeric ID you want to match. Example: ‘id0x200’
  • -
  • ms - Set the number of milliseconds to wait. This condition acts differently depending on whether +
  • id - Set the trigger to activate when a frame with the given ID is received. The syntax is ‘id’ +followed by the numeric ID you want to match. Example: ‘id0x200’

  • +
  • ms - Set the number of milliseconds to wait. This condition acts differently depending on whether you have set ID matching as well. If so then ms will cause a delay of the requested number of milliseconds after receiving a frame with the ID. If not, the trigger will constantly fire every time the requested number of milliseconds have elapsed. The syntax is the number of desired milliseconds followed by ‘ms’. For example: -‘40ms’.

  • -
  • x - Only allow this trigger to fire a set number of times. The syntax is the number of times you want the trigger -to fire followed by ‘x’. For example: ‘100x’.
  • -
  • bus - Only trigger when a frame with the given ID comes in on the specified bus. Otherwise the triggering frame -could come from either bus. The syntax is ‘bus’ followed by either ‘0’ or ‘1’. For example: ‘bus0’
  • +‘40ms’.

    +
  • x - Only allow this trigger to fire a set number of times. The syntax is the number of times you want the trigger +to fire followed by ‘x’. For example: ‘100x’.

  • +
  • bus - Only trigger when a frame with the given ID comes in on the specified bus. Otherwise the triggering frame +could come from either bus. The syntax is ‘bus’ followed by either ‘0’ or ‘1’. For example: ‘bus0’

Now, a full example of a trigger line: “id0x200 5ms 10x bus0,1000ms” This trigger means: Trigger when a frame with ID 0x200 comes in on bus 0. Wait 5 milliseconds before sending and only allow this to happen at most 10 times. Also, always trigger every 1 second and never stop doing this.

-

78. Writing Modifications

+

78. Writing Modifications

As with the triggers, you can have multiple modifications per line; each of which is separated by a comma ‘,’.

Modifications always start with a data byte to modify The syntax is ‘D’ or ‘d’ followed by a number 0 through 7. For example: ‘D4’. This is then always followed by an equal sign ‘=’. Thereafter there is a string of operands and operations.

Operands have a special syntax. Each operand can have multiple sections separated by colons ‘:’.

    -
  • D - A data byte. Specifies which data byte 0 - 7 from the given frame to use for this operation. If specified +
  • D - A data byte. Specifies which data byte 0 - 7 from the given frame to use for this operation. If specified on its own it will reference the data in the “Data” section of this line. The syntax is ‘d’ or ‘D’ followed -by a number 0 - 7. Example: ‘D3’.

  • -
  • ID - Instead of grabbing data from this line’s data bytes grab it from the last frame received with the given ID. -Syntax: ‘ID’ followed by a colon ‘:’ followed by the ID to match against. Example: ‘ID:0x200’
  • -
  • BUS - Restrict which bus the frame used for grabbing the data bytes can come in on. Syntax: ‘BUS’ followed by -a colon ‘:’ followed by 0 or 1 to specify which bus to use. Example: ‘BUS:0’
  • -
  • <NUMBER> - Instead of using a data byte from somewhere you can instead use a numeric literal. The syntax is +by a number 0 - 7. Example: ‘D3’.

  • +
  • ID - Instead of grabbing data from this line’s data bytes grab it from the last frame received with the given ID. +Syntax: ‘ID’ followed by a colon ‘:’ followed by the ID to match against. Example: ‘ID:0x200’

  • +
  • BUS - Restrict which bus the frame used for grabbing the data bytes can come in on. Syntax: ‘BUS’ followed by +a colon ‘:’ followed by 0 or 1 to specify which bus to use. Example: ‘BUS:0’

  • +
  • <NUMBER> - Instead of using a data byte from somewhere you can instead use a numeric literal. The syntax is the same as any number - either a series of numbers or 0x followed by a series of numbers and A - F to specify -a hexadecimal number. Example: 0x10.

  • +a hexadecimal number. Example: 0x10.

A few full examples of operands:

    -
  • “bus:0:id:0x120:D3” = Grab byte 3 from the last frame with ID 0x120 that came in on bus 0.
  • -
  • “0x200” = Use the numeric value 0x200 directly.
  • -
  • “id:0x200:D7” = Grab byte 7 from the last frame received with ID 0x200.
  • +
  • “bus:0:id:0x120:D3” = Grab byte 3 from the last frame with ID 0x120 that came in on bus 0.

  • +
  • “0x200” = Use the numeric value 0x200 directly.

  • +
  • “id:0x200:D7” = Grab byte 7 from the last frame received with ID 0x200.

Each operand is usually followed by an operation and then a second operand. If no operation or second operand is found that is also OK. Thus a modifier can be as simple as “D0 = D1” if you choose. Operands can also be directly chained such that the output of the last operation is used as the left hand operand for the next operation. This will be shown later on.

Modifiers can use the following operations:

    -
  • + - Add the two operands together. Example: “D1 + D2”
  • -
  • - - Subtract the second operand from the first operand. Example: “D1 - D2”
  • -
  • * - Multiply the two operands together. Example: “D1 * D2”
  • -
  • / - Divide the first operand by the second operand. Example: “D1 / D2”
  • -
  • & - Do the bitfield operation AND on the two operands. Example: D1 & 0x20
  • -
  • | - Do the bitfield operation OR on the two operands. Example: D1 | 0x10
  • -
  • ^ - Do the bitfield operation XOR on the two operands. Example: D1 ^ 0xD2
  • +
  • + - Add the two operands together. Example: “D1 + D2”

  • +
  • - - Subtract the second operand from the first operand. Example: “D1 - D2”

  • +
  • * - Multiply the two operands together. Example: “D1 * D2”

  • +
  • / - Divide the first operand by the second operand. Example: “D1 / D2”

  • +
  • & - Do the bitfield operation AND on the two operands. Example: D1 & 0x20

  • +
  • | - Do the bitfield operation OR on the two operands. Example: D1 | 0x10

  • +
  • ^ - Do the bitfield operation XOR on the two operands. Example: D1 ^ 0xD2

Putting all of that together yields complete modifiers. For simplicity all operations are done left to right. There is no special order of operations like in normal mathematics.

Here are a few examples:

    -
  • “D0=D0+1” = Take the value in D0 within this line’s data bytes, add 1, and store it back in D0.
  • -
  • “D1=ID:0x200:D3+ID:0x200:D4&0xF0” = Grab byte 3 from the most recently received frame with ID 0x200 and add it -to byte 4 from the same received frame. AND this new value with 0xF0 and finally store it in D1 of the data bytes for this line.
  • -
  • “D2=D4 * 10 + D3 & 0x3F” = Multiply byte 4 by 10, add the new value to byte 3, AND the resulting value by 0x3F and store it in byte 2.
  • +
  • “D0=D0+1” = Take the value in D0 within this line’s data bytes, add 1, and store it back in D0.

  • +
  • “D1=ID:0x200:D3+ID:0x200:D4&0xF0” = Grab byte 3 from the most recently received frame with ID 0x200 and add it +to byte 4 from the same received frame. AND this new value with 0xF0 and finally store it in D1 of the data bytes for this line.

  • +
  • “D2=D4 * 10 + D3 & 0x3F” = Multiply byte 4 by 10, add the new value to byte 3, AND the resulting value by 0x3F and store it in byte 2.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/dbc_editor.html b/help/dbc_editor.html index 9ac2cee..ee3649a 100644 --- a/help/dbc_editor.html +++ b/help/dbc_editor.html @@ -1,40 +1,196 @@ - - + + + - - - 17. DBC Message Editor - - + + + 17. DBC Message Editor — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

17. DBC Message Editor

+

17. DBC Message Editor

.

_images/DBCEditor.png
-

18. Working with Nodes

+

18. Working with Nodes

In DBC files a node is a device on the CAN bus. For instance, the engine control unit (ECU) would be a node as would a motor controller, a battery charger, or any other device that is connected to the CAN bus. DBC files let you define nodes that are set as either the sender or receiver of a message. This allows messages to be organized for more easy retrieval. To add a new node click on the empty row beneath the last defined node and type a new name and optionally a comment. The comment is not used by SavvyCAN but can be filled out for your own reference. When a node is selected in the top list you will then see in the bottom a listing of every message it sends.

-

19. Working with Messages

-

The bottom list is all of the messages that are sent by the selected node. A message is defined based on its message ID. The message ID is the CAN id used for this message. For normal DBC files this creates a one to one correspondance of ID to a given CAN ID. For J1939 messages special masking is done and so more than one actual CAN id will map to the given message ID but still only one specific J1939 PGN will come through. Once a message ID is entered in for a new message it will attempt to auto populate the Data Len column with the number of data bytes that message has. This is only for your information, it is not used by SavvyCAN. You can give the DBC message a meaningful name. The “Fg” and “Bg” columns can be clicked on to set a color. This will set the foreground and background color to use for this message. These colors will be used in the main frame view on the main screen when you click “Interpret Frames.” Clicking on the “Signals” column will bring up the signals editor for that message so that you can edit, add, or remove signals from the message. The “Comments” column is once again not used by SavvyCAN and only for your viewing reference.

+

19. Working with Messages

+

The bottom list is all of the messages that are sent by the selected node. A message is defined based on its message ID. The message ID is the CAN id used for this message. For normal DBC files this creates a one to one correspondence of ID to a given CAN ID. For J1939 messages special masking is done and so more than one actual CAN id will map to the given message ID but still only one specific J1939 PGN will come through. Once a message ID is entered in for a new message it will attempt to auto populate the Data Len column with the number of data bytes that message has. This is only for your information, it is not used by SavvyCAN. You can give the DBC message a meaningful name. The “Fg” and “Bg” columns can be clicked on to set a color. This will set the foreground and background color to use for this message. These colors will be used in the main frame view on the main screen when you click “Interpret Frames.” Clicking on the “Signals” column will bring up the signals editor for that message so that you can edit, add, or remove signals from the message. The “Comments” column is once again not used by SavvyCAN and only for your viewing reference.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/dbc_manager.html b/help/dbc_manager.html index 2a8ab9c..25aa14c 100644 --- a/help/dbc_manager.html +++ b/help/dbc_manager.html @@ -1,37 +1,193 @@ - - + + + - - - 14. DBC File Manager - - + + + 14. DBC File Manager — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

14. DBC File Manager

+

14. DBC File Manager

.

_images/DBCManager.png
-

15. Working with DBC Files

-

This screen allows you to load and save DBC files. SavvyCAN supports loading more than one DBC file at a time. It can even use more than one DBC file per bus. But, “Associated Bus” can be used to associate a given DBC file to only one bus. If you don’t need to associate to any specific bus then set this value to -1 which means “any bus.” The J1939 button causes SavvyCAN to mask out J1939 message IDs to conform to J1939 signalling. You can create a brand new DBC file by clicking “Create new DBC” button. It will be automatically named a unique name for you. You probably don’t want that name though. Any time you save a DBC file its name will automatically update in the list. The “Load”, “Save”, “Remove”, “Edit” buttons are all straight forward. You can also edit a DBC file by double clicking it in the list.

+

15. Working with DBC Files

+

This screen allows you to load and save DBC files. SavvyCAN supports loading more than one DBC file at a time. It can even use more than one DBC file per bus. But, “Associated Bus” can be used to associate a given DBC file to only one bus. If you don’t need to associate to any specific bus then set this value to -1 which means “any bus.” The J1939 button causes SavvyCAN to mask out J1939 message IDs to conform to J1939 signaling. You can create a brand new DBC file by clicking “Create new DBC” button. It will be automatically named a unique name for you. You probably don’t want that name though. Any time you save a DBC file its name will automatically update in the list. The “Load”, “Save”, “Remove”, “Edit” buttons are all straight forward. You can also edit a DBC file by double clicking it in the list.

-

16. DBC File Ordering

-

The “Move Up” and “Move Down” buttons can be used to change the order of DBC files. Why would you care? DBC files are accessed in the order they are in the list. When a frame is interpreted the system goes through the DBC files in order. It selects the first DBC file that is associated to the bus the message came in on and that imprements the correct message ID. So, if you have multiple DBC files it is possible that the order might matter.

+

16. DBC File Ordering

+

The “Move Up” and “Move Down” buttons can be used to change the order of DBC files. Why would you care? DBC files are accessed in the order they are in the list. When a frame is interpreted the system goes through the DBC files in order. It selects the first DBC file that is associated to the bus the message came in on and that implements the correct message ID. So, if you have multiple DBC files it is possible that the order might matter.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/filecomparison.html b/help/filecomparison.html index 39c1ef5..3e7e6cc 100644 --- a/help/filecomparison.html +++ b/help/filecomparison.html @@ -1,50 +1,65 @@ - - + + + - - - 55. File Comparison Window - - + + + 55. File Comparison Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

55. File Comparison Window

+

55. File Comparison Window

.

_images/FileComparator.png
-

56. The Purpose of the File Comparator

+

56. The Purpose of the File Comparator

This screen can be used to figure out what is different between a set of files. On one side you have a single file. This is called the “File of interest”. On the other side you have any list of files. They’re not listed any longer as actual files. The program can load frames from any number of files and dump them all into the same “bucket” of frames. You can thus load up a batch of files and compare them against the one “File of interest.” The purpose of this is to figure out what is different. Are there IDs found only on one side? For IDs found on both sides are there bits set only on one side and not the other? This can be used to find stubborn data that you are having trouble locating. One use is to capture a large amount of traffic to use as “background noise” of sorts. Perhaps drive around for a long time or let the vehicle idle for some time but never do the thing you need to find. Then do another capture and do the thing you’re missing a few times. Perhaps you’re looking for a gear shift signal. You could capture a large batch of frames while idling. Then, in a second capture shift several times. Now, compare the two. Somewhere in the differences should be the gear selection you couldn’t find. The list ought to be much more narrow than just “shooting in the dark” so to speak.

-

57. The layout of the differences list

+

57. The layout of the differences list

In the differences list you’ll find three main tree nodes:

    -
  1. IDs found only in <file of interest>

    +
  2. IDs found only in <file of interest>

      -
    • In sub nodes you’ll find every ID found only in the file of interest and not in any of the reference files.
    • +
    • In sub nodes you’ll find every ID found only in the file of interest and not in any of the reference files.

  3. -
  4. IDs found only in reference frames

    +
  5. IDs found only in reference frames

      -
    • In theory this should be a fairly small list. Here are any IDs never seen in the file of interest
    • +
    • In theory this should be a fairly small list. Here are any IDs never seen in the file of interest

  6. -
  7. IDs found in both

    +
  8. IDs found in both

      -
    • Here is where the interesting information lies. The sub nodes here are found in both places. A list of all differences will be shown sub nodes of each ID node. Here you can see bits set only in one side or the other. You can also find values only found on one side or the other. These might be candidates for your mystery signal.
    • +
    • Here is where the interesting information lies. The sub nodes here are found in both places. A list of all differences will be shown sub nodes of each ID node. Here you can see bits set only in one side or the other. You can also find values only found on one side or the other. These might be candidates for your mystery signal.

  9. @@ -53,8 +68,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/flowview.html b/help/flowview.html index 3cec926..3caf58e 100644 --- a/help/flowview.html +++ b/help/flowview.html @@ -1,60 +1,216 @@ - - + + + - - - 35. Flow View Window - - + + + 35. Flow View Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

35. Flow View Window

+

35. Flow View Window

.

_images/FlowView.png
-

36. The Purpose of Flow View

+

36. The Purpose of Flow View

Flow view is meant to show a view of what “happens to” the data for a given ID as time goes on. The flow is a flow of time or messages going by. The goal is to visualize what is going on as time passes. The screen is very busy but everything has the same goal - to show the data bytes across the list of all frames with that ID.

-

37. Selecting an ID to Flow

+

37. Selecting an ID to Flow

Along the left most side of the window is a list of every frame ID captured so far. You can select any of these IDs. Once you select an ID you’ll see the number of frames with that ID just to the right of the IDs list (in the bottom of the Playback Control box).

-

38. Viewing the Flow

+

38. Viewing the Flow

There are a variety of ways that the data bytes for the current frame are displayed. Toward the middle of the window there are 8 text boxes that show the current value of each data byte. At the right of the window are two visualizations. On the top there is an 8x8 grid that visualizes every possible bit in a CAN message. Bits which are white are currently 0 or off. Bits which are black are 1 or on. Bits that are green are newly on in this frame. They were 0/off in the reference. Bits which are red are newly off in this frame. Those bits were 1/on in the reference.

Below the 8x8 grid view is a graph based view. The “+” in the center marks the “current” time. You can thus see both into the future and the past (relative to the current frame) in this view. All 8 data bytes are graphed according to their value. You can thus see in the graph what the value is doing as time ticks by.

Between these three views you should have a very good idea of how the data bytes change over time.

-

39. Controlling the Flow

+

39. Controlling the Flow

The screen has many ways to control the flow. The “Playback Control” box has 6 icons in a 3x2 grid. The upper icons mean (from left to right): Go back one frame, Stop, Go forward one frame. The bottom icons mean: Play backward, pause, Play forward. Playback speed is used to control how quickly the flow happens. You can raise and lower this value even as the flow is playing back and it will change the flow speed in realtime. You can select “Loop Playback” to keep looping over and over. It is possible to select “0” as the frame interval. This will make the program progress as quickly as it can. This probably will not be much faster than a frame interval of 1 but it will be a bit faster.

-

40. Additional control options

+

40. Additional control options

Below the “Playback Control” box is a set of three check boxes. “Live Mode” will cause the flow view to keep the current frame at the latest received frame from the capture hardware. This is thus a “real time” option where the flow will happen in real time as frames come in. “Synchronize windows” causes the flowing in this window to update the position in the main window so that the main window is always at the current position in flow playback. “Graph by timestamp” causes the “Time Axis” at the bottom of the graph view to be in seconds or microseconds. Deselecting this will cause that axis to instead be in frame number.

-

41. Reference Values

+

41. Reference Values

Previously it was mentioned that bits in the 8x8 grid are colored based on whether they are newly on/off or steady state compared to the reference. What is the reference? Well, look to the left of the 8x8 grid. The reference values here are used for reference with the 8x8 grid. You can set these values to something static and then see how bits compare to that static reference. Or, above the reference values is a checkbox called “Auto Reference” if this is clicked then the last frame is used as a reference for the current one. There are advantages to both options. A static reference can be used to see how things change compared to, say, the very first frame. Auto reference shows how the data changed from frame to frame. Either might yield interesting findings. The default values for static reference are taken from the values that the first frame has. You are free to change them to any value 0 through 0xFF.

-

42. Seeking to Specific Values

+

42. Seeking to Specific Values

Lastly, it is possible to seek to specific values. “Data Seek Values” normally default to -1. But, if a value other than -1 is found in one of these boxes then it will be used as a seek value. Any time the flow is playing back (either forward or backward) it will compare to the seek values. If there is a match then playback will automatically stop. This can be used to quickly play things back until you get to a specific value. One use would be to seek to a known value that precedes an important section you want to analyze in more depth. Also, in this same vein, if you click in the 8x8 grid of bits you will see that the cell you clicked on has the text turn blue and become bold. Any bit that you’ve selected this way will also act as a way to stop playback. If that bit changes, either being set or unset, then playback will stop. Click the cell again to deselect it.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/framedetails.html b/help/framedetails.html index a404c3d..cf4966e 100644 --- a/help/framedetails.html +++ b/help/framedetails.html @@ -1,37 +1,193 @@ - - + + + - - - 53. Frame Details Window - - + + + 53. Frame Details Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

53. Frame Details Window

+

53. Frame Details Window

.

_images/FrameInfoWindow.png
-

54. The Purpose of Frame Details Window

+

54. The Purpose of Frame Details Window

This window is used to get detailed statistics about frames.

It provides information about a given frame ID across all frames with that ID. You can get such information as the number of frames, the number of data bytes that frame ID has, the average interval between frames with that ID, and the minimum and maximum interval.

-

Also listed are detailed statistics for each data byte in that frame. Each byte has listed which bits changed, the range of values found, and a histogram both graphically (at the righthand side of the window) and textually. The textual representation shows the number of times a specific value occurred.

+

Also listed are detailed statistics for each data byte in that frame. Each byte has listed which bits changed, the range of values found, and a histogram both graphically (at the right-hand side of the window) and textually. The textual representation shows the number of times a specific value occurred.

The top right graph is a histogram of all the bits and the number of times each bit was set. This can be used to quickly visually see where data has changed.

The bottom right graph is of each individual byte as its value varies over time. All textual information can be saved to a text file for later analysis.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/fuzzingwindow.html b/help/fuzzingwindow.html index da838c7..bf93a5f 100644 --- a/help/fuzzingwindow.html +++ b/help/fuzzingwindow.html @@ -1,64 +1,220 @@ - - + + + - - - 58. Fuzzing Window - - + + + 58. Fuzzing Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

58. Fuzzing Window

+

58. Fuzzing Window

.

_images/FuzzingWindow.png
-

59. The Purpose of Fuzzing

+

59. The Purpose of Fuzzing

Some people are big fans of fuzzing, some people have no use for it. There usually isn’t much in between. So, what is fuzzing and why would you want to do it? Fuzzing is intentionally sending random information to see what happens. It’s pretty much the “shotgun” solution - you fire birdshot into the air and see if it hits anything. Does that sound a bit dangerous? It kind of is. So, why do it? It might help you to find frame IDs that control things. It might help you to find a data byte that controls something. Used carefully it can be used to figure out how different values affect things.

-

60. Fuzzing is Dangerous

+

60. Fuzzing is Dangerous

You have now been warned. Sending random garbage over the CAN bus to see what happens could mess something up. It just might put your vehicle into gear and cause you to drive over a box full of kittens. Be careful! Never fuzz a car unless you’re right there and you can stop it. Even better, don’t do it unless your car is up on a hoist or jacks and can’t drive over anyone. Even still, there is a small chance you could cause an adverse effect to your car. If you break something you own the pieces.

-

61. Controlling the Fuzzy Beast

+

61. Controlling the Fuzzy Beast

So, you want to give it a try? Let’s do it! First of all, you can set the delay between frames and the burst rate. The delay is in milliseconds but can be set as low as 0. If the delay is set to 0 then the system will attempt to send frames as fast as it can. However, even then you may not get quite as many frames per second as you’d like. Even at 0 it will still be scheduled by your operating system and so might not quite get to the speed you want. The burst rate can cause the program to send one than one frame each interval. This is useful as a CAN bus could potentially support 2000 to 8000 frames per second. If you need rapid frame sending your best bet is to set the sending interval to 1-2ms and then adjust the burst rate until you get your desired sending rate. Then you can set the number of bytes to send. Ordinarily this would be the full 8 but you can experiment with smaller frames. You can set to send on a specific bus. That’s all the simple settings. It gets a bit more complicated now.

The “ID Scanning” box has two radio buttons:

    -
  1. Sequential will go from “Start ID” to “End ID” then reset back to Start over and over.
  2. -
  3. Random will pick IDs at random in the range between Start and End
  4. +
  5. Sequential will go from “Start ID” to “End ID” then reset back to Start over and over.

  6. +
  7. Random will pick IDs at random in the range between Start and End

But, perhaps you don’t want to fuzz IDs like that? The next box is “ID Selection” and the choices are:

    -
  1. Range of IDs - this uses the aforementioned Start and End IDs
  2. -
  3. Filter list - This causes it to pick frame IDs from the list below either sequentially or randomly according to the radio boxes under “ID Scanning”
  4. +
  5. Range of IDs - this uses the aforementioned Start and End IDs

  6. +
  7. Filter list - This causes it to pick frame IDs from the list below either sequentially or randomly according to the radio boxes under “ID Scanning”

The last box is “Bit Scanning”

    -
  1. Sequential causes it to scan bits in logically sequential order. That is, the first available fuzzing bit is set then the just the second, then the first two, etc. This causes all of the fuzzed bits to sequentially set in order.
  2. -
  3. Sweep causes the system to set the first one, then unset that one and set the second bit, then unset that, etc. Thus the fuzzed bit sweeps and only one fuzzed bit is set at once.
  4. -
  5. Random will randomly pick whether each fuzzed bit is set or not.
  6. +
  7. Sequential causes it to scan bits in logically sequential order. That is, the first available fuzzing bit is set then the just the second, then the first two, etc. This causes all of the fuzzed bits to sequentially set in order.

  8. +
  9. Sweep causes the system to set the first one, then unset that one and set the second bit, then unset that, etc. Thus the fuzzed bit sweeps and only one fuzzed bit is set at once.

  10. +
  11. Random will randomly pick whether each fuzzed bit is set or not.

In order to fuzz bits you need to set which bits to fuzz and which not to. As listed at the bottom of the window, there is a color code to the 8x8 grid. Clicking cells in the grid will toggle them between their various values. White bits are never set, black bits are always set no matter what, green bits follow the fuzzing pattern you specified in “Bit Scanning” You can also set the bytes directly with the text boxes above the 8x8 grid. Setting a hexadecimal value in these -boxes will set the relavent bits in the 8x8 grid. You must press the ENTER/RETURN key to set the values. Merely changing the value will not update it (as a safety measure).

+boxes will set the relevant bits in the 8x8 grid. You must press the ENTER/RETURN key to set the values. Merely changing the value will not update it (as a safety measure).

-

62. Pulling the Trigger

+

62. Pulling the Trigger

Once you’ve configured everything click “Start Fuzzing” to give it a shot. You will see the number of frames sent so far listed below the button. Approximately four times per second the current value for each byte is copied into the text boxes just above the 8x8 grid. This can be used to see what is going on and to ensure that it is working the way you want it to. You can stop the fuzzing by pushing the start button again.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/genindex.html b/help/genindex.html index 2a661e0..62a670c 100644 --- a/help/genindex.html +++ b/help/genindex.html @@ -1,18 +1,30 @@ - + - + - - - Index - - + + + Index — SavvyCAN 189 documentation + + + + + + + + + + + + + +
+
@@ -24,8 +36,144 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/graphsetup.html b/help/graphsetup.html index a460dd5..6593757 100644 --- a/help/graphsetup.html +++ b/help/graphsetup.html @@ -1,34 +1,49 @@ - - + + + - - - 31. Graph Setup - - + + + 31. Graph Setup — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

31. Graph Setup

+

31. Graph Setup

.

_images/GraphSetup.png
-

32. Setting up a Graph

+

32. Setting up a Graph

This same screen is used whether you are creating a new graph or editing an existing graph. If you are creating a new graph then you have two options.

-

33. Graphing a DBC Signal

+

33. Graphing a DBC Signal

If you want to graph a signal from a DBC file that you have loaded then pick the Message from the combo box. Picking a message will then allow you to pick a signal within that message. After selecting both the message and the signal then click the “Copy Signal Parameters” button. This will fill out the left hand side with the proper values for you automatically.

-

34. Manual Signal Graphing (Or Editing)

+

34. Manual Signal Graphing (Or Editing)

If you want to manually create a signal or edit an existing signal then you will find the relevant fields on the left hand size of the window.

“Name” is for your reference and will be shown on the Graphing Window.

“ID” is the frame ID to use for this graph. You can enter in either decimal or hex. Hex values are preceded by 0x

@@ -45,8 +60,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/graphwindow.html b/help/graphwindow.html index a9b13dd..a86d53d 100644 --- a/help/graphwindow.html +++ b/help/graphwindow.html @@ -1,61 +1,217 @@ - - + + + - - - 22. Graphing Window - - + + + 22. Graphing Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

22. Graphing Window

+

22. Graphing Window

.

_images/GraphingView.png
-

23. Creating a new Graph

+

23. Creating a new Graph

Right click in the graph window to bring up a popup menu. The last entry in the first section is “Add new graph”. This brings up the Graph Setup Window. From there you can create a new graph.

-

24. Selecting a Graph

+

24. Selecting a Graph

You can select a graph either by clicking on it or by clicking its name in the list of graphs up that the top right.

-

25. Editing a Graph

+

25. Editing a Graph

You can either double click its name in the list of graphs at the top right or select the graph, right click, and select “Edit Selected Graph”

-

26. Deleting Graphs

+

26. Deleting Graphs

There are two options. You can select a graph, right click, and select “Remove selected graph” or you can right click and select “Remove All Graphs”

-

27. Moving Around

+

27. Moving Around

Left clicking and dragging in the graphing area will allow you to pan around. The mouse wheel (if you have one) will let you zoom in and out. If you select the numbers on either the X or Y axis then you’ll be able to pan and zoom on just that axis leaving the other alone. This is useful in order to expand or shrink the time axis or to rescale the vertical axis to better fit the data in view. The “+” key will zoom in, the “-” key zooms out. You can also zoom in and out from the pop up window that appears when you right click. If you’ve messed up your view and can’t figure out how to fix it then right click and select “Reset View” to get a nice view of all the data again.

-

28. Loading and Saving Graphs

-

It can be beneficial to create a set of graphs that can be used over and over. You can save the currently setup graphs to a file and then load it later. Right click on the graphing window and use “Save graph defintions to file” and “Load graph definitions from file” to do this. You can also save a picture of the graphing window. PDF, PNG, and JPG are supported. Lastly, you can save a spreadsheet of all the graphed points.

+

28. Loading and Saving Graphs

+

It can be beneficial to create a set of graphs that can be used over and over. You can save the currently setup graphs to a file and then load it later. Right click on the graphing window and use “Save graph definitions to file” and “Load graph definitions from file” to do this. You can also save a picture of the graphing window. PDF, PNG, and JPG are supported. Lastly, you can save a spreadsheet of all the graphed points.

-

29. Real Time Graphing

+

29. Real Time Graphing

Sometimes it is useful to graph while data are still being captured. When this is done it is additionally handy if the view follows the new data. In the right click pop up menu you will find “Follow end of graph”. It is a checkbox. When it is on the current view will follow the end of the data captured. The “window” you’ve set up will scroll. That is, the zoom and vertical calibration will stay the same and only the “Time Axis” will scroll such that the end of the capture is always at the right hand side of the graphing window.

-

30. Hidden Tricks

+

30. Hidden Tricks

If you double click on a graphed line the main window will scroll and the frame that produced the nearest data point to where you clicked will be selected. Additionally, if you selected “Synchronize Windows” in Flow view then the graphing view will synchronize to Flow view as well.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/index.html b/help/index.html index 0bcc2e0..b4b0da1 100644 --- a/help/index.html +++ b/help/index.html @@ -1,21 +1,35 @@ - - + + + - - - Welcome to SavvyCAN V189 documentation! - - + + + Welcome to SavvyCAN V189 documentation! — SavvyCAN 189 documentation + + + + + + + + + + + + + + +
+
+
+ + + + + \ No newline at end of file diff --git a/help/isotp_decoder.html b/help/isotp_decoder.html index 3868cba..05263dc 100644 --- a/help/isotp_decoder.html +++ b/help/isotp_decoder.html @@ -1,26 +1,41 @@ - - + + + - - - 63. ISO-TP Decoder - - + + + 63. ISO-TP Decoder — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

63. ISO-TP Decoder

+

63. ISO-TP Decoder

.

_images/ISOTPDecoder.png
-

64. Using the ISO-TP Decoder

+

64. Using the ISO-TP Decoder

This window scans the existing captured frames and newly captured frames to see if it can find CAN traffic that seems to conform to the ISO-TP standard. ISO-TP is used to send multi-frame messages and as an encoding standard that forms the base for other protocols such as UDS and ODBII (which is essentially itself a subset of UDS).

The main list at the top shows any messages that seem to conform to ISO-TP. There will very likely be messages here which aren’t really ISO-TP. You can deselect IDs that seem to generate false positives so that they quit showing up in this list. As you can see in the picture only the ids 0x7E0 through 0x7EA were selected. These IDs are standard for UDS communication. If you want to immediately recalculate the results to exclude the deselected IDs then push “Interpret Previously Captured Frames” to regenerate the whole list. Otherwise the effect of changing the ID selections will only happen for newly captured frames.

The “Show incomplete and/or corrupted messages” checkbox will cause a lot of false positives and should only be used as a last resort if you suspect that you might have some dropped traffic.

@@ -30,8 +45,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/mainscreen.html b/help/mainscreen.html index 4f758ec..b130f45 100644 --- a/help/mainscreen.html +++ b/help/mainscreen.html @@ -1,53 +1,68 @@ - - + + + - - - 1. Main / Start Up Screen - - + + + 1. Main / Start Up Screen — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

1. Main / Start Up Screen

+

1. Main / Start Up Screen

_images/MainScreen.png

This screen embodies the core of the program. Here you will find the master list of all frames. Also, here you can navigate to the other aspects of the program. You can have multiple sub-windows open at once - in fact, quite often this is very beneficial.

-

2. The Main Frame List

+

2. The Main Frame List

The main frame list takes up the majority of the main screen. This list consists of the following sections:

    -
  • Timestamp: The timestamp is either in microseconds or seconds. This is a setting in preferences. Either way, the timestamp can have +
  • Timestamp: The timestamp is either in microseconds or seconds. This is a setting in preferences. Either way, the timestamp can have microsecond resolution. The difference is just whether there is a decimal point or not. GVRET has the ability to maintain full microsecond -resolution for timestamping purposes. There is a third timing mode where the timestamp can be customized and is based upon the actual “clock” time.

  • -
  • ID: The ID is specified either in hexadecimal or decimal (a preference you can set). This is the message identifier sent over the CAN bus.
  • -
  • Ext: 0 = Standard message (11 bit ID). 1 = Extended message (29 bit ID)
  • -
  • Dir: Either “Rx” or “Tx” to show whether SavvyCAN has received or sent this message.
  • -
  • Bus: SavvyCAN supports a variety of capture hardware. GVRET compatible devices can support more than one bus. The bus a frame came in on -is specified here. Many file formats do not specify bus and thus all frames will be loaded as bus 0.
  • -
  • Len: The number of data bytes that were sent with this frame. It can range from 0 to 8.
  • -
  • Data: All of the data bytes separated by spaces. Can be in either hexadecimal or decimal (preference). If “Interpet Frames” is checked you will +resolution for timestamping purposes. There is a third timing mode where the timestamp can be customized and is based upon the actual “clock” time.

  • +
  • ID: The ID is specified either in hexadecimal or decimal (a preference you can set). This is the message identifier sent over the CAN bus.

  • +
  • Ext: 0 = Standard message (11 bit ID). 1 = Extended message (29 bit ID)

  • +
  • Dir: Either “Rx” or “Tx” to show whether SavvyCAN has received or sent this message.

  • +
  • Bus: SavvyCAN supports a variety of capture hardware. GVRET compatible devices can support more than one bus. The bus a frame came in on +is specified here. Many file formats do not specify bus and thus all frames will be loaded as bus 0.

  • +
  • Len: The number of data bytes that were sent with this frame. It can range from 0 to 8.

  • +
  • Data: All of the data bytes separated by spaces. Can be in either hexadecimal or decimal (preference). If “Interpret Frames” is checked you will also see extra data at the end of any frames that have DBC data. To see the rest of this data click upon the frame in the list. It will -automatically expand to show all signals attached to that frame.

  • +automatically expand to show all signals attached to that frame.

-

3. The Bottom Statusbar

+

3. The Bottom Statusbar

At the very bottom of the main screen is a status bar with two sections.

    -
  • The first section shows the connection status. You will see the number of currently connected buses here.
  • -
  • The second second section shows which file is currently loaded. This is updated by loading or saving.
  • +
  • The first section shows the connection status. You will see the number of currently connected buses here.

  • +
  • The second section shows which file is currently loaded. This is updated by loading or saving.

-

4. The Rest of the Main Window

+

4. The Rest of the Main Window

To the right of the main frames list is an area that shows the total number of captured frames and the frames per second. Total frames might not match the number of shown frames. If you’ve deselected any IDs in the filter list then fewer frames will be shown. Frames per second is calculated as an average and so will wind up or down when there is a sudden change.

@@ -56,49 +71,48 @@ connected without capturing traffic for a short time. This can help to not captu

The “Normalize Frame Timing” button is used to reset the lowest timestamp to “0” and offset all other timestamps accordingly. This is useful to remove the starting offset when you start up the GVRET board long before actual traffic starts. SavvyCAN is designed such that this doesn’t really matter most of the time but normalizing the timing might be useful to help correlate the timing between two different captures.

-

The “Clear Frames” button will erase all captured messages. They will be irreversably erased and all memory will be freed.

+

The “Clear Frames” button will erase all captured messages. They will be irreversibly erased and all memory will be freed.

The “Auto Scroll Window” checkbox will cause the main frame list to hunt toward the bottom of the list as frames come in. It will normally not be quite at the very bottom as, for performance reasons, the program runs at quarter second updates to things like the auto scroll. Thus, the main list will be scrolled to the bottom four times per second.

The “Interpret Frames” checkbox is used to specify whether the loaded DBC file should be used to interpret all available messages and signals. One might want this off for performance reasons (interpreting takes some extra processor power and RAM) or to declutter the main frame list.

The “Overwrite Mode” checkbox is used to ensure that only the newest frame for each message ID is shown. That is, if 100 messages with ID 0x105 come in you -will see only the newest one. This is generally used along side “Interpret Frames” to interpret frames and always see the up-to-date information.

+will see only the newest one. This is generally used alongside “Interpret Frames” to interpret frames and always see the up-to-date information.

“Frame Filtering” provides a list of all the frame IDs seen so far. Any ID which is checked will be shown in the main list. Any ID which is unchecked will not. This can be used to hone in on frames of importance while hiding frames that are currently of no interest. The filtered list can be saved as well.

-

5. Loading And Saving Frames

+

5. Loading And Saving Frames

What CANBus analysis tool would be complete without an easy way to load and save frames?

-
-
SavvyCAN can load and save in several formats (a few of which are listed below):
-
    -
  • CRTD: This format was made by Mark Webb-Johnson for OVMS (open vehicle monitoring system) and other related tools. It is a reasonably -readable and compact format.
  • -
  • GVRET: This is the native format for GVRET and SavvyCAN. The GVRET format saves more information such as the bus a frame originated on. This format is in CSV -(comma delimited) format and as such can easily be loaded into your favorite spreadsheet program as well.
  • -
  • Generic ID/DATA - Another CSV format. This is a very cut down format with limited information.
  • -
  • BusMaster - This is the format output by the BusMaster CANBus program. BusMaster is an open source Windows-only somewhat clone +
    +
    SavvyCAN can load and save in several formats (a few of which are listed below):
      +
    • CRTD: This format was made by Mark Webb-Johnson for OVMS (open vehicle monitoring system) and other related tools. It is a reasonably +readable and compact format.

    • +
    • GVRET: This is the native format for GVRET and SavvyCAN. The GVRET format saves more information such as the bus a frame originated on. This format is in CSV +(comma delimited) format and as such can easily be loaded into your favorite spreadsheet program as well.

    • +
    • Generic ID/DATA - Another CSV format. This is a very cut down format with limited information.

    • +
    • BusMaster - This is the format output by the BusMaster CANBus program. BusMaster is an open source Windows-only somewhat clone of CANAlyzer (the 800lb gorilla in the analysis space). The ability to load and save in this format makes SavvyCAN fully capable -of swapping data with BusMaster should you need to do so.

    • -
    • Microchip - Format output by Microchip CANBus tools. Perhaps you have logs that were captured with a $100 Microchip dongle? You can load them in SavvyCAN.
    • +of swapping data with BusMaster should you need to do so.

      +
    • Microchip - Format output by Microchip CANBus tools. Perhaps you have logs that were captured with a $100 Microchip dongle? You can load them in SavvyCAN.

    There are many other formats supported. Some are only supported for writing, some only for reading. The list of supported formats is expanded every so often.

-

6. Filters

+

6. Filters

You might notice that there are three entries in the file menu that mention filters. SavvyCAN can filter messages so that you only see some of the messages coming in on the bus. It still saves all incoming messages but you are able to filter which you will view at any given time. SavvyCAN allows for loading and saving the list of frames you’d like to view so that you can easily switch “sets” of frames to view. Also, when saving you can optionally save just the frames that you have filtered instead of every captured frame. Filters are set in the lower -righthand of the this screen. All IDs are selected by default. To deselect an ID click on the checkbox next to it. You can also deselect +right-hand of the this screen. All IDs are selected by default. To deselect an ID click on the checkbox next to it. You can also deselect all IDs or select all IDs. These are useful if you only want to view a couple of IDs (click None then the few you need) or you just want to remove a couple (click All and then deselect the ones you don’t care about).

-

7. What is DBC and why would I care?!

+

7. What is DBC and why would I care?!

I’m glad you asked. DBC is a file format used to specify how “signals” are stored in “messages.” A message is essentially a unique packet of data sent on the CAN bus. Ordinarily this message is differentiated by frame ID. Each ID is a different message (usually). A signal is a piece of data stored in a message. For instance, ID 0x105 might be a message from the vehicle control unit to the motor @@ -110,7 +124,7 @@ understood by users of the program. Also, other windows can use the DBC file for to figure out the actual details of that signal.

-

8. How DBC interacts with the main screen:

+

8. How DBC interacts with the main screen?

First of all, one can load and save DBC files from the “DBC File Manager” found in the File menu. Also in the File menu it is possible to save the currently loaded frames but with DBC decoding. This is somewhat like the normal saving functionality with a two differences: there is only one output format and that format has all signals contained in each message listed and decoded.

@@ -118,8 +132,149 @@ and that format has all signals contained in each message listed and decoded.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/playbackwindow.html b/help/playbackwindow.html index 4673070..c776f58 100644 --- a/help/playbackwindow.html +++ b/help/playbackwindow.html @@ -1,53 +1,209 @@ - - + + + - - - 70. Playback Window - - + + + 70. Playback Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

70. Playback Window

+

70. Playback Window

.

_images/Playback.png
-

71. Preparing Frames for Playback

+

71. Preparing Frames for Playback

The first order of business is to load some CAN frames that you’d like to play back onto a CAN bus. In the lower left is a section titled “Playback Sequence”. It is so named because this playback interface can play a chain of different CAN captures very configurably. It consists of a list of captures to playback along with how many times to play each sequence item. For instance, you could play a file twice then go to the next, then play a third one four times. A playback item can either come from a file (Load File) or from the current list of captured frames on the main window (Load Captured Data). If you load the currently captured frames it truly means “currently”. That is, if more traffic comes in it will not play that new traffic back. A snapshot is taken at the time you push the button. Each sequence item has its own list of ID filters. In this way you can send only some of the frame IDs from the capture and this list can be different for each file or capture you load. The list of ID filters can be saved and loaded to make the process faster in the future.

Once you’ve set up a sequence of frames to playback you can also decide whether you’d like to loop that sequence forever or not. Up above the Playback Sequence and ID Filtering sections is the “Loop Sequence” checkbox.

-

72. Playing Back Frames

+

72. Playing Back Frames

The playback window can send frames on a specific bus, all buses (be careful with that!) or “From File.” Some file formats store which bus each frame came in on. Also, the main window stores that info. So, captures that stored the bus properly could be used to send frames out multiple buses always to the proper bus for the frame in question. But, if you load a capture without this info it will default to bus 0 so bear that in mind.

The next order of business is frame timing. There are two approaches possible here. If you click “Use original frame timing from captured frames” then frames will be sent out in approximately the same timing as they came in with. The word approximately is used because it is difficult to get 1ms timing precision on a desktop OS. Frames that come in rapidly might have a 2-3ms jitter. In practice this is almost always irrelevant. This setting is suitable for nearly all uses.

Alternatively, it is also possible to send on a set schedule. With the “Use original” checkbox not checked you can set a playback speed in milliseconds and a burst rate. Burst means that it’ll send that many frames every tick. So, if you have a burst of 5 and a timing of 10ms then every 10ms 5 frames will be sent. This mode can provide for a predictable number of frames per second and could be useful to test how quickly a device really requires traffic without faulting. But, it will potentially drastically alter the timing of frames compared to their timing when they were captured.

The top of the window has a series of 6 icons all in a row:

    -
  1. White Left Arrow - Play the last frame (just one frame)
  2. -
  3. Pause sign - Pause playback
  4. -
  5. Green Left Arrow - Play frames backward
  6. -
  7. Blue Stop Button - Stop playback and return to the first frame in the first capture in the sequence
  8. -
  9. Green Right Arrow - Play frames forward
  10. -
  11. White Right Arrow - Play the next frame (just one frame)
  12. +
  13. White Left Arrow - Play the last frame (just one frame)

  14. +
  15. Pause sign - Pause playback

  16. +
  17. Green Left Arrow - Play frames backward

  18. +
  19. Blue Stop Button - Stop playback and return to the first frame in the first capture in the sequence

  20. +
  21. Green Right Arrow - Play frames forward

  22. +
  23. White Right Arrow - Play the next frame (just one frame)

-

73. Playback Status

+

73. Playback Status

Below the number spinners for Playback Speed and Burst Rate is text that displays the currently playing sequence item along with the current frame within that capture.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/preferences.html b/help/preferences.html index 4a9ee6b..3a5ee63 100644 --- a/help/preferences.html +++ b/help/preferences.html @@ -1,29 +1,44 @@ - - + + + - - - 12. Preference Window - - + + + 12. Preference Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

12. Preference Window

+

12. Preference Window

.

_images/Preferences.png
-

13. Setting Preferences

+

13. Setting Preferences

There are a variety of preferences that can be set in the program and persisted for future sessions.

“Save/Restore window positions and sizes”: If this is set then the size and placement of the various windows in this application will be saved when the program is closed and loaded when each window is brought back up in the future. This can be used to create your own preferred layout. If you’d rather things come up in their default state every time then you can uncheck this box.

-

“Display values as hexadecimal”: A lot of the time people who are doing CAN reverse engineering like to see values in hexadecimal (base 16) instead of the more familar decimal (base 10) system. Checking this box will cause most of the values in the application to show up in hex. This applies to CAN ids and data bytes. Unchecking this causes values to default to decimal instead. The reason for using hex is that each hex digit is 4 bits. Integers on a computer tend to be in multiples of 8 - 8, 16, 32, 64. So, hex digits have a direct mapping to the underlying binary. Decimal does not have this correspondance AT ALL. But, the choice is yours.

+

“Display values as hexadecimal”: A lot of the time people who are doing CAN reverse engineering like to see values in hexadecimal (base 16) instead of the more familiar decimal (base 10) system. Checking this box will cause most of the values in the application to show up in hex. This applies to CAN ids and data bytes. Unchecking this causes values to default to decimal instead. The reason for using hex is that each hex digit is 4 bits. Integers on a computer tend to be in multiples of 8 - 8, 16, 32, 64. So, hex digits have a direct mapping to the underlying binary. Decimal does not have this correspondence AT ALL. But, the choice is yours.

“Require validation of GVRET connection”: GVRET style devices run over a serial connection. Serial connections can be finicky sometimes and so the connection can be validated to prove that everything is really still operating and talking. There probably isn’t any reason to turn this off except while debugging to see if it changes anything. Mostly just don’t touch this.

“Time Keeping”: There are a variety of ways one could timestamp CAN frames as they come into the program. Selecting “Seconds” will cause the timestamp to be expressed as seconds since the frame list was last cleared. This tends to be an easy choice to work with. “Microseconds” will express the timestamp as millionths of a second since the last time the frame list was cleared. This is exactly like “Seconds” mode but without any decimal point. You might find this to be a bit hard to conceptualize. The last option is “System Clock” this will timestamp frames with the current system time when the frame came in. This is still very precise but now you’ll get an absolute time stamp with the full date and time. The display of this mode can be changed by editing the “Time Format String” value. It defaults to an output that looks like “JAN-10 12:34:53.234” But you can set it to other values. Look here to find a reference for how you can create new format strings: http://doc.qt.io/qt-4.8/qdatetime.html#toString

“Use filtered frames in sub-windows”: The main window has a filtering interface where you can uncheck IDs to hide them. Ordinarily when you bring up one of the other windows it will still use the main unfiltered list. Sometimes you really do want to deal with the filtered list of frames even in the other windows. If this is checked then the other windows will see the filtered list and not the unfiltered actual list of frames that have been captured.

@@ -40,8 +55,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/rangestate.html b/help/rangestate.html index d7211c8..d1ed47b 100644 --- a/help/rangestate.html +++ b/help/rangestate.html @@ -1,44 +1,200 @@ - - + + + - - - 65. Range State Window - - + + + 65. Range State Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

65. Range State Window

+

65. Range State Window

.

_images/RangeState.png
-

66. Using the Range State Window

+

66. Using the Range State Window

The purpose of this window is to search for signals that look like they might be important. That’s a rather nebulous description. But, the idea is to find signals that seem to vary somewhat coherently. As you can see in the picture in this help, the displayed signal has some jumps but they look like they might “be something.” That’s the idea. It will generate a lot of false positives but it will still provide some decent ideas for where to look for signals. It is up to you to figure out if the signal is anything important or anything you can use.

To use it first set up the follow things:

    -
  1. The ID Filter list - Deselect any IDs you don’t want to search.
  2. -
  3. Sensitivity - This is a subjective measurement. It doesn’t affect the results a lot but changing this value back and forth can alter what the program thinks is a relevant signal.
  4. -
  5. Min Signal Size - The smallest signal you want to search for. You can search for signals all of the way down to 1 bit if you’re feeling adventurous.
  6. -
  7. Max Signal Size - The largest signal you want to search for. The range between Min and Max changes how long the process will take. If you set Min to 8 and Max to 16 then it will search for signals with 8, 9, 10, 11, 12, 13, 14, 15, 16 bits. You will get duplicates as the same basic set of bits will be used for all of the sizes.
  8. -
  9. Granularity - Sets the bit jump width. What is bit jump width? The number of bits that we move over each time we search for a new signal. If you have a granularity of 1 and a minimum signal width of 8 then it will search starting at bit 0 for an 8 bit message then starting at bit 1 then bit 2, etc. If you set a granularity of 8 then it will search for an 8 bit signal at bit 0 then search at bit 8, then 16, etc. So this sets how finely we will search for signals. A lot of times signals will be found on byte edges so a granularity of 8 will cause all signal searches to start on byte boundaries and this will be OK for many things. But, some designers are more devious and place signals at uneven boundaries. You might need finer granularity to find such signals.
  10. -
  11. Signal Mode - For signals over 8 bits there is a choice to make. Signals over 8 bits can be either in big or little endian mode. This relates to whether bit 0 of a signal is the highest or lowest value. You can search for only big endian signals, only little endian, or try it both ways. Usually the developer of a CAN device will stick to one or the other but not always.
  12. -
  13. Signed Mode - Likewise, any signal over 1 bit could be either unsigned or signed. Signed signals have their highest bit as 1 for negative numbers and 0 for positive numbers. You can search for only unsigned signals, only signed, or try it both ways. There really isn’t any rhyme or reason for when a signal would be signed or unsigned. It could easily be both ways so unless you’re sure it’s probably safest to allow the program to try it both ways and you can pick which looks best.
  14. +
  15. The ID Filter list - Deselect any IDs you don’t want to search.

  16. +
  17. Sensitivity - This is a subjective measurement. It doesn’t affect the results a lot but changing this value back and forth can alter what the program thinks is a relevant signal.

  18. +
  19. Min Signal Size - The smallest signal you want to search for. You can search for signals all of the way down to 1 bit if you’re feeling adventurous.

  20. +
  21. Max Signal Size - The largest signal you want to search for. The range between Min and Max changes how long the process will take. If you set Min to 8 and Max to 16 then it will search for signals with 8, 9, 10, 11, 12, 13, 14, 15, 16 bits. You will get duplicates as the same basic set of bits will be used for all of the sizes.

  22. +
  23. Granularity - Sets the bit jump width. What is bit jump width? The number of bits that we move over each time we search for a new signal. If you have a granularity of 1 and a minimum signal width of 8 then it will search starting at bit 0 for an 8 bit message then starting at bit 1 then bit 2, etc. If you set a granularity of 8 then it will search for an 8 bit signal at bit 0 then search at bit 8, then 16, etc. So this sets how finely we will search for signals. A lot of times signals will be found on byte edges so a granularity of 8 will cause all signal searches to start on byte boundaries and this will be OK for many things. But, some designers are more devious and place signals at uneven boundaries. You might need finer granularity to find such signals.

  24. +
  25. Signal Mode - For signals over 8 bits there is a choice to make. Signals over 8 bits can be either in big or little endian mode. This relates to whether bit 0 of a signal is the highest or lowest value. You can search for only big endian signals, only little endian, or try it both ways. Usually the developer of a CAN device will stick to one or the other but not always.

  26. +
  27. Signed Mode - Likewise, any signal over 1 bit could be either unsigned or signed. Signed signals have their highest bit as 1 for negative numbers and 0 for positive numbers. You can search for only unsigned signals, only signed, or try it both ways. There really isn’t any rhyme or reason for when a signal would be signed or unsigned. It could easily be both ways so unless you’re sure it’s probably safest to allow the program to try it both ways and you can pick which looks best.

Once you’ve got it all set up click “Recalculate Candidate Signals.” Be prepared to wait depending on what options you selected. Once it is done processing you’ll get a list of candidates in the upper list labeled “Candidate Signals.” Here you can see all of the signals it found. You get the ID, the starting bit (remember, bits start at 0 and go through 63), the length, and whether it was signed/unsigned and big/little endian. If you click on or otherwise select a signal in this list then a graphical view of it will appear in the graphing area beneath. You might try the arrow keys Up and Down to move through the list. You can even hold down the arrow key and let it rapidly scroll. As it scrolls through the signals you can look at the graph and stop when you see a signal that catches your eye. This is useful as you can have hundreds of candidates and it is tedious to view them explicitly one at a time.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/scriptingwindow.html b/help/scriptingwindow.html index 930123b..383ebf4 100644 --- a/help/scriptingwindow.html +++ b/help/scriptingwindow.html @@ -1,43 +1,57 @@ - - + + + - - - 79. Scripting Interface - - + + + 79. Scripting Interface — SavvyCAN 189 documentation + + + + + + + + + + + + + + +
+
-

79. Scripting Interface

+

79. Scripting Interface

.

_images/ScriptingWindow.png
-

80. Purpose of the Scripting Interface

+

80. Purpose of the Scripting Interface

To give you an open ended place where you can write JavaScript files that do whatever you need them to do. You can load several files at once and they’ll all work at the same time. Scripts can expose parameters that can then be edited by you while the program is running. They also update 4 times per second so they can be used to give feedback of the current state of the script as well. But, it is safer to give status in the “Log Window” instead. However, for values that might need to be seen and frequently updated it might be easiest to show them as “Public Variables”.

-

81. Managing Scripts

+

81. Managing Scripts

In the bottom left is the “Loaded Scripts” list. You can create a new script by clicking the “New” button below the list. The new script will have a random name until you save it. The “Del” button will delete the currently selected script but it will ask you first. The “Load” button will load a new script from a file. The “Save” button is above the main script view which is in the upper right of the window. “Revert” will revert the script to the last version that was compiled. Any changes you’ve made since compiling well be reverted. “Recompile” is used to compile the script and begin running the new version.

-

82. Getting Script Status

+

82. Getting Script Status

There are two places you can look for the status of a script. The “Log Window” is directly below the script source code editor. This window is shared between all scripts and shows the status of compiling scripts as well as log messages from each script. The script name that sent the log message is prepended. The number before the script name is the amount of time the scripting window had been open for when the message was sent. This unified interface can be used to keep an eye on all of the running scripts and to debug issues when a script is compiled. Any compile errors will show up in the log window. You can set the checkbox on “Auto Scroll Log Window” to make it continue to stay at the bottom of the log. You can clear the log at any time as well.

The other way to see script status is to use the “Public Variables” interface. Here you will find variables that were registered by the current script. Each script has its own list so information that needs to be updated frequently and/or specific to a script and easily accessible should be registered here. But, public variables can have their value set by you, the user, as well. So, care should be taken not to edit variables used for script feedback and scripts shouldn’t try to change the value of variables used for input to the program.

-

83. Writing Scripts

+

83. Writing Scripts

You are more or less free to write JavaScript scripts but, of course, you aren’t in a web browser so browser specific functions are just not there. In their place are a couple of JS objects that allow the script to interface with the CAN buses connected to SavvyCAN. Also, certain functions can be created to automatically register callbacks.

-

84. Callback Functions

+

84. Callback Functions

These functions can be created in your scripts to enable certain functionality:

setup () - If you create a function named setup then it will be called as soon as the script starts. Yes, you probably could just dump code into no function at all right into the file but that’s bad form!

tick () - If you registered to receive a periodic tick within your setup function then the script interface will call this function for every tick. You can do whatever you need to periodically do here. But, you get only one tick handler so if you need multiple tick rates you’ll have to create a fast tick here and dispatch from this function at different rates yourself.

@@ -46,33 +60,33 @@

gotUDSMessage (bus, id, service, subfunc, len, data) - UDS messages are transmitted over ISO-TP but with additional structure. If you’re looking to interface directly at the UDS level then you can create this function to have it automatically registered. As with raw CAN and ISO-TP you still need to specify which messages IDs you are interested in.

-

85. The host Object

+

85. The host Object

The first object you can use is “host” This object handles setup of the tick timer as well as logging output and registration of public variables.

host.setTickInterval(interval) - If the interval is more than 0 then your tick callback will be called every “interval” milliseconds. If a value of 0 is passed then the tick timer will be stopped.

host.log(text) - Send text to the log window. It will be timestamped, marked according to which script sent it, and placed into the log window.

host.addParameter(“variablename”) - Add the named variable to the list of public variables. From then on any changes that you make in the GUI will immediately show up in the script and any changes the script makes to a value will reflect in the GUI within 250ms. Remember to use quotes around the variable name. You want to pass the variable name, not its value.

-

86. The can Object

+

86. The can Object

This object is your interface to raw CAN. It has the following functions:

can.setFilter(id, mask, bus) - register to receive messages based on an ID, Mask, and Bus. It works like this. First the bus is compared. If it doesn’t match the frame is not delivered to you. Then, the incoming frame has its ID ANDed with your mask. Let’s say your mask is 0x7F0 and the incoming frame has an ID of 0x235. 0x235 AND 0x7F0 is 0x230. This value is compared to the ID you passed. So, if your filter ID is 0x230 then the frame is accepted and you will get a callback with the frame. Otherwise the frame is not delivered to you. This masking setup is very common in CAN bus interfaces. Basically, the mask allows a single filter to accept a range of IDs. 0x7F0 would accept 16 different IDs (0x230 through 0x23F in this case). 0x700 accepts 256 different IDs, etc.

can.clearFilters() - remove all filters and revert to a clean state. You will no longer receive any CAN callbacks unless you create more filters with setFilter.

can.sendFrame(bus, id, length, data) - Send a CAN frame out the given bus. The CAN id will be what you set as will the length. The length can thus be different from the actual length of “data” which should be a valid javascript array. The length can not exceed 8. The frame will be sent as soon as possible so long as that bus is connected and not in listen only mode.

-

87. The isotp Object

+

87. The isotp Object

isotp.setFilter(id, mask, bus) - Exactly like the raw CAN version in the can object. Allows you to register a filter so that you can receive ISO-TP traffic from the filtered addresses. It should be noted that you’ll essentially only get traffic that seems to be able to be turned into ISO-TP traffic. Any CAN frames obviously not ISO-TP will be rejected.

isotp.clearFilters() - Clear all ISO-TP filters and no longer receive ISO-TP traffic.

isotp.sendISOTP(bus, id, length, data) - As in the can version. The difference here is that ISO-TP messages can be longer than 8 bytes and so might get turned into a multi-frame set of messages with flow control. This is handled for you by SavvyCAN so you needn’t handle of the details of the exchange.

-

88. The uds Object

+

88. The uds Object

uds.setFilter(id, mask, bus) - Exactly like the other two setFilter functions. Register for a set of IDs to be interpreted as UDS (if possible) and sent through to your callback. Any obviously not UDS traffic will be discarded.

uds.clearFilter() - Remove all filters and quit receiving UDS traffic.

uds.sendUDS(bus, id, service, sublen, subfunc, length, data) - Sends a UDS message out from the script. service must be between 0 and 255, subfunc can be larger than one byte if needed. data is only needed for extended payloads as the actual UDS protocol is handled by the service and subfunc parameters.

-

89. A full example script

+

89. A full example script

var newID = 0; //set this to the ID you want your RLEC to become
 
 function setup ()
@@ -123,8 +137,148 @@
 
 
           
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/search.html b/help/search.html new file mode 100644 index 0000000..74950b7 --- /dev/null +++ b/help/search.html @@ -0,0 +1,189 @@ + + + + + + + + Search — SavvyCAN 189 documentation + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+
+ +

+ Please activate JavaScript to enable the search + functionality. +

+
+

+ Searching for multiple words only shows matches that contain + all words. +

+
+ + + +
+ +
+ +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/help/searchindex.js b/help/searchindex.js new file mode 100644 index 0000000..eccb0b5 --- /dev/null +++ b/help/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({docnames:["bisector","connectionwindow","customsender","dbc_editor","dbc_manager","filecomparison","flowview","framedetails","fuzzingwindow","graphsetup","graphwindow","index","isotp_decoder","mainscreen","playbackwindow","preferences","rangestate","scriptingwindow","signaleditor","sniffer","temporalwindow","uds_scanner"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["bisector.rst","connectionwindow.rst","customsender.rst","dbc_editor.rst","dbc_manager.rst","filecomparison.rst","flowview.rst","framedetails.rst","fuzzingwindow.rst","graphsetup.rst","graphwindow.rst","index.rst","isotp_decoder.rst","mainscreen.rst","playbackwindow.rst","preferences.rst","rangestate.rst","scriptingwindow.rst","signaleditor.rst","sniffer.rst","temporalwindow.rst","uds_scanner.rst"],objects:{},objnames:{},objtypes:{},terms:{"0x0":17,"0x0d":17,"0x0f":17,"0x10":[2,12,18],"0x105":13,"0x12":12,"0x120":2,"0x15":17,"0x20":2,"0x200":2,"0x230":17,"0x235":17,"0x23f":17,"0x300":20,"0x3f":2,"0x700":17,"0x7e0":[12,17,21],"0x7e7":21,"0x7ea":12,"0x7f":12,"0x7f0":17,"0xaa":17,"0xd":17,"0xd2":2,"0xf":17,"0xf0":2,"0xff":6,"100":13,"1000m":2,"100x":2,"10m":14,"10x":2,"1ms":14,"2000":8,"200m":19,"234":15,"250m":17,"255":17,"256":17,"2ms":8,"34v":18,"3ms":14,"3x2":6,"40m":2,"543":20,"5ms":2,"8000":8,"800lb":13,"8x8":[6,8,9,18],"break":8,"byte":[2,3,6,7,8,11,12,13,15,16,17,18,21],"case":[0,17,18,21],"catch":16,"default":[6,13,14,15,21],"final":2,"float":18,"function":[11,12,13,20,21],"import":[6,13,16],"long":[5,13,16,17,21],"new":[0,1,2,3,4,9,11,14,15,16,17,18,19],"public":17,"return":[8,14,21],"short":13,"static":[6,15],"switch":[9,13],"try":[1,8,12,15,16,17,21],"var":17,"while":[5,10,13,15,17,19],AND:[2,17],ANDed:17,And:11,Are:5,BUS:2,Bus:[2,4,13,15,17],But:[1,4,6,8,14,15,16,17,18,19,21],For:[2,3,5,13,14,16,18,20],IDs:[0,4,5,6,8,11,12,13,14,15,16,17,20,21],NOT:19,Not:18,One:[5,6,13],That:[8,10,13,14,16,17,20,21],The:[0,1,2,3,4,9,10,11,12,14,15,16,18,19,20,21],Then:[1,5,8,17,21],There:[2,6,8,10,12,13,14,15,16,17,18,20,21],These:[1,2,3,5,9,12,13,17,19,21],UDS:[11,12,17],Use:[2,12,14,15],Used:8,Using:11,With:[14,15,19],Yes:17,abil:[1,13],abl:[0,1,10,13,17],about:[7,12,13],abov:[0,6,8,9,14,17,18,19],absolut:15,acceler:15,accept:[1,17,21],access:[4,17,21],accord:[6,8,17],accordingli:13,acknowledg:1,across:[6,7],act:[2,6],activ:[2,19,20],actual:[3,5,9,13,15,17,19,21],adapt:21,add:[1,2,3,10,12,17,18,19],added:[15,18],adding:18,addit:[11,12,17,18],addition:[1,10,13,21],addparamet:17,addr:21,address:[1,12,17,21],adjust:8,advanc:11,advantag:6,adventur:[1,16],advers:8,affect:[8,16,20],aforement:8,after:[0,2,9,15,18,19],again:[3,6,8,10,19,20],against:[2,5],aid:19,air:8,all:[0,1,2,3,4,5,6,7,8,10,12,13,14,15,16,17,18,19,20,21],allow:[2,3,4,9,10,13,16,17,18,19,21],almost:[14,21],alon:10,along:[6,14],alongsid:13,alreadi:[18,19],also:[1,2,4,5,6,7,8,10,13,14,15,17,18,21],alter:[14,16],altern:14,alwai:[2,6,8,10,13,14,16,18],amount:[5,17],analysi:[7,13],analyz:6,ani:[0,1,2,3,4,5,6,12,13,15,16,17,18,19,20,21],anoth:[5,13,15,18,21],answer:[20,21],antialias:15,anyon:[8,18],anyth:[8,15,16,21],anywher:21,appear:[10,16],appli:[9,15],applic:[0,15],approach:14,appropri:18,approxim:[8,14],area:[10,13,15,16,19],aren:[12,17,21],around:[5,11,17,19,21],arrai:17,arrow:[14,16],ask:[13,17],aspect:13,associ:[4,13,19],assum:12,attach:13,attempt:[3,8,21],auto:[3,6,13,15,17],automat:[1,2,4,6,9,13,15,17],autoscrol:15,avail:[8,13],averag:[7,13],awai:19,axi:[6,10,20],back:[1,2,6,8,11,15,16,19,20],background:[3,5,20],backward:[6,14],bad:17,bar:13,base:[3,6,9,12,13,15,17],basic:[16,17],batch:5,batteri:3,baud:1,bear:14,beast:11,becaus:[1,14,20],becom:[6,17],been:[2,8,15,17,19],befor:[2,9,13,17,21],begin:[17,19],being:[6,10,12,13,18,21],below:[6,8,13,14,17],beneath:[3,16],benefici:[10,13],best:[8,15,16],bet:8,better:[8,9,10,13,15],between:[0,1,5,6,7,8,9,13,16,17],bia:[9,18],big:[8,9,16,18],binari:[1,15],birdshot:8,bisector:11,bit:[1,5,6,7,8,9,11,13,15,16,18],bitfield:2,black:[6,8,18,19],blanket:21,block:19,blue:[6,14],board:[1,13],bold:6,both:[1,5,6,7,9,15,16,20],bottom:[3,6,7,8,11,15,17],bound:21,boundari:[16,18],box:[6,8,9,12,15,18],brand:4,bright:20,bring:[3,9,10,15,20],brought:15,browser:17,bucket:5,build:19,built:1,burst:[8,14],bus0:2,bus:[1,2,3,4,8,12,13,14,15,17,20,21],buse:[1,2,13,14,17],busi:[6,14,19],busmast:13,button:[0,4,8,9,13,14,17,19],calcul:[0,13],calibr:10,call:[5,6,17],callback:11,came:[2,4,13,14,15,20],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21],can_util:19,canalyz:13,canbu:[1,13],candid:[5,16],candu:1,cannot:0,cansniff:19,capabl:13,captur:[1,5,6,10,12,13,14,15,20,21],car:8,care:[4,8,11,14,17,21],carefulli:8,casual:21,caus:[1,2,4,6,8,9,12,13,15,16,19,21],caution:19,cell:[1,6,8],center:6,certain:17,certainli:21,chain:[2,14],challeng:[17,21],chanc:8,chang:[1,2,4,6,7,8,9,12,13,15,16,17,18,19,21],changer:17,charg:19,charger:3,cheat:21,check:[2,6,13,14,15,17,18,19,21],checkbox:[1,2,6,10,12,13,14,15,17,18,19,21],choic:[8,15,16,19],choos:[0,2,18],circl:20,clean:17,clear:[13,15,17],clearfilt:17,click:[0,1,3,4,6,8,9,10,12,13,14,15,16,17,18,19,20],clock:[13,15],clone:13,close:[15,19,20],clutter:21,code:[8,17,20],coher:16,colon:2,color:[3,6,8,9,19,20],column:3,combo:9,come:[1,2,3,6,13,14,15,17,19,20,21],comma:[2,13],command:[1,19],comment:[3,18],common:[17,21],commonli:12,commun:12,compact:13,compar:[6,11,14,17],comparison:11,compat:[1,13],compil:[1,17],complet:[2,13,19],compliant:21,complic:[8,18],comput:15,concept:[18,21],conceptu:15,condit:[2,21],configur:[1,8,14],conform:[4,12],connect:[2,3,11,13,15,17,18,21],consist:[13,14,19],consol:1,constantli:2,consult:1,contain:[2,13],content:11,continu:17,control:[2,3,11,12,13,17,20],conveni:[0,15],copi:[8,9],core:13,correct:[4,12,21],correctli:19,correl:13,correspond:[3,15],corrupt:12,could:[1,2,5,8,14,15,16,17,18,20,21],couldn:5,count:2,coupl:[13,17,21],cours:17,cover:[2,17],crack:21,cracker:21,creat:[1,2,3,4,9,11,15,17,18,20],crlf:1,cross:18,crtd:13,csv:13,ctrl:21,current:[1,6,8,10,13,14,15,17,18],custom:[11,13,21],cut:[13,21],cycl:19,danger:[11,21],dark:5,data:[2,3,5,6,7,8,9,10,12,13,14,15,17,18,19,21],databyt:17,date:[13,15,19],dbc:11,deal:[15,21],debug:[11,15,17],decent:16,decid:14,decim:[2,9,13,15],declutt:[13,19],decod:[11,13],decrement:19,dedic:1,defin:[3,11,13,21],definit:10,del:17,delai:[2,8],delet:[11,17],delimit:13,deliv:17,deni:21,dens:9,densiti:[19,20],depend:[2,16,21],deprec:1,depth:6,descript:16,deselect:[6,12,13,16,18,21],design:[13,16],desir:[2,8,13],desktop:14,detail:[1,11,12,13,17,18],detect:1,determin:21,develop:[16,21],devic:[1,2,3,13,14,15,16,21],deviou:16,diagnost:[12,21],did:17,didn:17,differ:[2,8,9,11,13,14,17,18,21],differenti:13,difficult:14,digit:15,dir:13,direct:15,directli:[2,8,17,18],disabl:13,disappear:19,discard:17,dispatch:17,displai:[6,14,15,16,18,19],divid:2,doc:15,document:[1,15],doe:[8,12,15,21],doesn:[13,16,17,19,21],doing:[2,6,15,18],don:[1,4,8,9,13,15,16,19,21],done:[2,3,10,16,20],dongl:[11,13],doubl:[1,4,10,18],doubt:15,down:[1,4,13,16,19,21],download:21,drag:10,drastic:[14,19],drive:[5,8,13],driver:1,drop:12,dual:20,due:1,dump:[5,17],duplic:16,dynam:15,each:[1,2,5,6,7,8,13,14,15,16,17,18,19,20,21],easi:[3,13,15,21],easier:[12,13,18],easiest:17,easili:[13,16,17],ecu:[3,12,21],edg:[1,16],edit:[3,4,11,15,17],editor:[11,17],effect:[8,12,15,18],either:[2,3,6,8,9,10,13,14,15,16,18],elaps:2,elev:21,els:18,elsewher:0,embodi:13,empti:[3,18],enabl:[1,2,13,15,17],encod:[12,13],end:[1,8,10,13,17,21],endian:[9,16,18],endless:2,engin:[3,15],ensur:[8,13,15],enter:[1,3,8,9,18,21],entri:[10,13,18,21],equal:2,eras:13,error:[12,17],esp32:1,essenti:[12,13,17,19,20,21],etc:[8,16,17],even:[4,6,8,15,16,19],everi:[2,3,5,6,9,13,14,15,17,18],everyth:[6,8,13,15],evtv:1,evtvdu:1,exactli:[15,17,19],exampl:[2,11],exce:17,except:[15,19],exchang:[17,19],exclud:12,exist:[9,12,18],expand:[10,13,15],expect:18,experi:8,expir:11,explicitli:16,expos:17,express:15,ext:13,extend:[1,12,13,17,21],extra:13,eye:[16,17],fact:13,fade:11,fail:12,fairli:5,fals:[12,16],familiar:15,fan:8,far:[6,8,13],fast:[8,17],faster:[6,14,15],fault:14,favorit:[13,15],featur:21,feedback:17,feel:[1,16],few:[2,5,13,21],fewer:13,field:[2,9],fifth:2,figur:[5,8,10,13,16],file:[0,3,7,9,10,11,13,14,17],fill:[1,2,3,9,18],filter:[0,8,11,14,15,16,17,19],find:[5,6,8,9,10,12,13,15,16,17,21],fine:[16,19],finer:16,finicki:15,fire:[2,8,20],firmwar:[1,21],first:[1,2,4,6,8,10,13,14,16,17,21],fit:10,fix:[10,21],flow:[10,11,15,17],follow:[1,2,8,10,13,16,17],foreground:3,forev:[14,19,21],form:[0,1,12,15,17,21],format:[0,2,13,14,15],forth:16,forward:[4,6,14],found:[1,2,5,6,7,12,13,16,18],four:[8,13,14,19],fourth:2,frame:[0,2,3,4,5,6,8,9,10,11,12,15,17,18,19,20],free:[6,17,19],freed:13,frequent:17,freshli:19,friendli:18,from:[0,1,2,3,5,6,8,9,10,13,14,17,18,19,21],full:[2,8,11,13,15],fulli:13,fun:19,further:21,futur:[6,14,15,19],fuzz:[11,21],fuzzi:11,garbag:8,gear:[5,8,13],gener:[11,12,13,16,18,19,20,21],get:[1,6,7,8,10,11,12,14,15,16,19,20,21],give:[3,8,17,19,20],given:[0,2,3,4,6,7,13,17,18,19,20],glad:13,goal:6,goe:[4,6],going:[1,6,8,21],good:[6,15,18],gorilla:13,got:[16,17],gotcanfram:17,gotisotpmessag:17,gotudsmessag:17,grab:[0,2,9],grai:18,grain:19,granular:16,graph:[6,7,11,13,15,16,20],graphic:[7,16,19,20],green:[6,8,14,18,19],grid:[2,6,8,9,18],guess:21,gui:17,gvret:[1,13,15],had:[17,21],hand:[2,7,9,10,13,21],handi:[10,19],handl:17,handler:17,happen:[2,6,8,12],hard:15,hardwar:[1,2,6,13,15,21],has:[1,3,6,7,8,13,14,15,16,17,18,19,21],have:[0,1,2,4,5,6,8,9,10,12,13,14,15,16,17,18,19,21],haven:19,haystack:19,head:12,help:[1,8,12,13,16,19],here:[0,2,5,6,12,13,14,15,16,17,19],hex:[1,2,9,15],hexadecim:[2,8,13,15],hidden:11,hide:[13,15,19],higher:21,highest:16,highlight:18,histogram:7,hit:8,hoist:8,hold:16,hone:13,host:[1,11],how:[0,2,6,8,9,10,11,14,15,16,18,20,21],howev:[1,8,17,21],html:15,http:15,huge:21,human:18,hundr:16,hunt:13,icon:[6,14],id0x200:2,idea:[2,6,16,19],identifi:13,idl:5,ids:[12,15],ignor:[19,21],imagin:0,immedi:[12,17],implement:[0,2,4,21],inact:11,incom:[13,17],incomplet:12,increment:19,independ:20,indic:21,individu:7,infinit:15,info:[14,15],inform:[3,5,7,8,13,15,17,18,21],input:17,instanc:[1,3,13,14,18],instead:[0,2,6,13,15,17,19,21],integ:[15,18],intention:8,interact:[2,11],interest:[5,6,13,17,19],interfac:[0,11,14,15,21],interpret:[3,4,12,13,17,18],interv:[6,7,8,17,19],invert:13,involv:18,irrelev:14,irrevers:13,isn:[8,12,15,16,20,21],iso:[11,17],isotp:11,issu:17,item:[14,18,21],its:[2,3,4,7,10,14,17],itself:[12,20],j1939:[3,4],jack:8,jan:15,javascript:17,jitter:14,johnson:13,jpg:10,jump:[16,19],just:[0,5,6,8,10,13,14,15,17,18,20,21],keep:[6,13,15,17,19,21],kei:[8,10,16,18,20],kind:8,kitten:8,know:[18,21],known:[6,18,21],label:16,laid:2,lan:1,larg:[5,15],larger:17,largest:16,last:[1,2,3,6,8,10,12,14,15,17,19],lastli:[6,10],later:[2,7,10,17,19],latest:6,layout:[11,15],lead:18,leav:[1,10,15],left:[1,2,6,9,10,12,14,17,18],len:[2,3,9,13,17],length:[9,16,17,18],less:[9,17],let:[3,5,8,10,16,17,21],level:[17,21],lies:5,light:19,like:[0,2,8,9,12,13,14,15,16,17,18,20,21],likewis:16,limit:13,line:[1,2,9,10,19],linux:[1,19],list:[0,1,3,4,6,7,8,10,11,12,14,15,16,17,18,19,21],listen:[1,17],liter:2,littl:[9,16,18],live:6,load:[0,4,5,9,11,14,15,17],local:1,locat:5,log:[1,13,17],logic:8,longer:[5,17],look:[5,6,15,16,17,19,21],loop:[6,14,15],lot:[12,13,15,16,20],low:8,lower:[6,12,13,14,19,21],lowest:[13,16,18],macchina:1,machin:15,made:[13,17],mai:8,main:[0,3,5,6,10,11,12,14,15,17,18],maintain:13,major:13,make:[6,13,14,16,17,18],manag:[11,13],mani:[0,1,6,8,9,13,14,16,18,20,21],manual:11,map:[3,13,15,20],mark:[6,13,17,18,20],mask:[3,4,9,17,19],master:13,match:[2,6,13,17],mathemat:2,matter:[4,8,13,21],max:[16,18],maximum:7,mean:[0,2,4,6,12,13,14,18,20,21],meaning:3,meant:[6,21],measur:[8,16],mechan:21,memori:13,mention:[6,13],menu:[0,10,13],mere:[8,15],mess:[8,10,20],messag:[1,4,6,9,11,12,13,16,17,18,21],microchip:13,microsecond:[6,13,15],middl:6,might:[1,2,4,5,6,8,9,12,13,14,15,16,17,18,19,21],millionth:15,millisecond:[2,8,14,17],min:[16,18],mind:[14,21],mine:15,minimum:[7,16],miss:5,mode:[1,6,9,13,14,15,16,17,18,19,21],modern:15,modif:11,modifi:[1,2,19,20],moment:[1,18],monitor:13,moon:21,more:[0,2,3,4,5,6,8,12,13,14,15,16,17,18,19,21],most:[1,2,6,13,15,19,20,21],mostli:15,motor:[3,13],mous:10,move:[4,11,16],much:[0,5,6,8,12],multi:[12,17],multipl:[2,4,13,14,15,17],multiplex:18,multiplexor:18,multipli:[2,9,18],must:[1,8,17],mute:11,mysteri:5,name:[3,4,9,10,13,14,17,18],narrow:[1,5,21],nativ:13,navig:13,nearest:10,nearli:[14,21],neat:15,nebul:[16,20],need:[4,5,8,13,16,17,18,21],needl:19,needn:17,neg:16,never:[2,5,8,11],newer:1,newest:13,newid:17,newli:[6,12],next:[2,8,13,14,18],nice:[0,10],node:[5,11,15,18,21],nois:5,none:[13,21],normal:[1,2,3,6,13,18,21],notch:11,notdata3:17,notdata4:17,note:[0,1,2,17,18,21],notic:13,now:[0,1,2,5,8,15,18],number:[0,2,3,5,6,7,8,10,13,14,15,16,17,18,19,21],numer:2,object:11,obvious:[0,17],occur:7,odbii:12,odd:9,off:[6,12,13,15],offset:[9,13,21],often:[9,13],old:19,older:1,onc:[3,6,8,9,12,13,14,16,17,18,19,21],one:[0,2,3,4,5,6,8,9,10,13,14,15,16,17,18,20,21],ones:13,onli:[1,2,3,4,5,8,9,10,12,13,14,15,16,17,18,19,21],onto:14,open:[13,17],opengl:15,oper:[1,2,8,15,21],operand:2,opportun:1,option:[0,1,3,9,10,11,13,15,16,21],order:[2,8,10,11,14,18,19],ordinarili:[1,8,13,15],organ:3,origin:[13,14],other:[0,2,3,5,6,10,12,13,15,16,17,18,20,21],otherwis:[1,2,12,16,17,18],ought:5,out:[1,2,3,4,5,8,9,10,13,14,16,17,18,21],output:[2,13,15,17,19],outsid:1,over:[6,7,8,10,13,15,16,17,20],overview:11,overwrit:13,ovm:13,own:[2,3,8,14,15,17],packet:13,pan:[10,20],paramet:[9,17,21],park:[13,18],particular:18,pass:[6,12,17],passthrough:1,past:6,pattern:8,paus:[6,14],payload:17,pdf:10,peakcan:1,peopl:[8,15],per:[2,4,8,13,14,17],percentag:0,perfect:21,perfectli:19,perform:[13,15],perhap:[5,8,13],period:[17,21],persist:15,person:[15,21],pgn:3,pick:[0,8,9,16],pictur:[10,12,16,19],piec:[0,8,13,18],place:[5,16,17,18,20],placement:15,plai:[6,11],plain:21,playback:[6,11,15],plot:20,png:10,point:[9,10,13,15,18,20],pop:10,popul:3,popup:10,port:1,portion:19,posit:[6,12,15,16,18],possibl:[1,4,6,13,14,17,20,21],potenti:[8,14,15,19,21],power:13,practic:[14,15],preced:[6,9],precis:[14,15,18],predict:14,prefer:[11,13,21],prepar:[11,16],prepend:17,present:[1,18,21],press:8,pretti:[0,8],previous:[6,12],probabl:[4,6,15,16,17,21],problem:11,process:[0,14,16],processor:13,produc:10,program:[1,2,5,6,8,13,15,16,17,19,21],progress:6,proper:[1,2,9,14,21],properli:[12,14],protect:21,protocol:[12,17,21],prove:15,provid:[7,13,14,16,18],pull:11,pure:18,purpos:[0,11,13,16,19],push:[1,8,12,14,19],put:[2,8],qdatetim:15,quarter:13,queri:21,question:[14,20],quickli:[6,7,14],quit:[8,12,13,17,18,19,21],quot:17,radio:8,rais:6,ram:13,random:[8,9,17,21],randomli:[8,9,18],rang:[0,7,8,11,13,17,18,21],rapid:[8,20],rapidli:[14,16],rate:[1,8,14,17],rather:[0,15,16],raw:[1,17],read:[13,18,21],readabl:13,real:[6,11,21],realli:[0,12,13,14,15,16],realtim:6,reason:[13,15,16],recalcul:[12,16],receiv:[2,3,6,13,17,18],recent:[2,19],recompil:17,red:[6,19],reduc:21,refer:[0,2,3,5,9,11,15,18],referenc:15,reflect:17,regener:12,regist:[1,17],registr:17,reject:17,rel:6,relat:[13,16],relationship:13,relev:[1,8,9,15,16],rememb:[12,13,16,17,19],remot:1,remov:[1,3,4,10,13,17],renam:18,reopen:15,repeatedli:19,replac:0,replai:2,repli:21,repres:19,represent:[7,20],reprogram:17,request:[2,12,21],requir:[14,15,18],rescal:10,reset:[8,10,13,19,20,21],resolut:13,resort:12,respond:21,respons:[12,21],rest:[0,9,11,18],restor:15,restrict:2,result:[2,12,16,21],resum:13,retriev:3,revers:15,revert:17,rhyme:16,right:[0,2,6,7,8,10,13,14,17,18,21],rlec:17,row:[3,14],rule:11,run:[13,15,17,19],safe:15,safer:17,safest:16,safeti:8,sai:[1,6,12,17,19,21],same:[2,5,6,9,10,14,16,17,20,21],save:[0,4,7,11,14,15,17],savvycan:[0,1,3,4,13,17],scale:[9,13,18],scan:[8,11,12],schedul:[8,14],scope:1,scratch:18,screen:[2,3,4,5,6,9,11,15],script:[11,21],scroll:[10,13,15,16,17],search:[16,21],second:[1,2,5,6,8,13,14,15,17,19,20,21],section:[1,2,6,10,13,14],secur:[17,21],see:[0,1,3,5,6,7,8,12,13,15,16,17,18,19,21],seek:11,seem:[12,16,17,21],seen:[5,13,17,19],select:[1,3,4,5,8,9,11,12,13,15,16,17,18,19,20,21],selector:21,send:[1,2,3,8,12,14,15,17,18,21],sender:[3,11],sendfram:17,sendisotp:17,sendud:17,sensit:[16,21],sent:[2,3,8,13,14,17,18,21],separ:[1,2,13,19],sequenc:14,sequenti:8,seri:[2,14],serial:[1,15],serialbu:1,servic:[12,17,21],session:[12,15,21],set:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,17,18,19,21],setfilt:17,settickinterv:17,setup:[10,11,17],seventh:2,sever:[5,13,17],share:17,shift:5,shoot:[5,21],shot:8,shotgun:8,should:[0,1,2,5,6,12,13,15,17,18],shouldn:17,show:[1,6,7,12,13,15,17,19,20,21],shown:[2,5,9,13,18,19],shrink:10,side:[0,5,6,7,9,10,18],sign:[2,9,14,16,18],signal:[3,4,5,11,13,16],signific:1,similar:[19,20],simpl:[2,8,21],simplic:2,sinc:[13,15,17],singl:[1,2,5,17,18],situat:21,sixth:2,size:[9,15,16,21],skip:[18,21],slap:21,small:[5,8,20],smaller:8,smallest:16,snapshot:14,sniffer:11,socketcan:1,solut:8,some:[1,5,8,12,13,14,15,16,19,21],someon:21,someth:[6,8,16,18],sometim:[10,15,21],somewhat:[13,16,18,19,20],somewher:[2,5],soon:17,sorri:0,sort:[5,18],sound:[8,19],sourc:[13,17],space:[1,2,13,20],speak:5,special:[2,3,21],specif:[3,4,7,8,11,14,17,18],specifi:[2,8,9,13,17,18],speed:[1,6,8,9,14,15],spinner:14,split:0,spreadsheet:[10,13],stai:[10,17],stamp:15,stand:2,standard:[12,13,20,21],starkli:19,start:[1,2,8,9,11,15,16,17,18,21],state:[6,11,15,17],statist:7,statu:[1,11,13],statusbar:[1,11],steadi:6,stick:[16,19],still:[1,3,8,10,13,15,16,17,18,19,21],stop:[2,6,8,14,16,17],store:[2,13,14],straight:4,strang:19,streak:20,stride:9,string:[2,15,18],structur:17,stubborn:5,stupidli:21,style:15,sub:[5,12,13,15,21],subfunc:17,subfunct:21,subject:16,sublen:17,subset:12,substitut:18,subtract:2,success:17,sudden:13,suitabl:14,support:[0,1,4,8,10,12,13,21],sure:[0,16],suspect:12,suspend:13,swap:13,sweep:[8,21],sword:1,synchron:[6,10],syntax:2,system:[1,4,8,13,15,17,19,21],tabl:[1,12,18],take:[2,13,16,21],taken:[6,14,15,17],talk:15,task:21,tediou:16,teensi:1,tell:21,temporarili:13,tend:15,test:[2,13,14,21],tester:21,text:[1,6,7,8,12,14,17,18],textbox:1,textual:[7,13],than:[3,4,5,6,8,12,13,17,21],thei:[1,4,5,6,12,13,14,15,16,17,18,19,20,21],them:[1,5,6,8,9,13,15,16,17,18,19,21],theori:5,thereaft:2,thi:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21],thing:[0,1,5,6,8,9,12,13,15,16,19,21],think:[9,16],third:[2,13,14],thoroughli:21,those:[6,12,19,21],though:4,three:[5,6,13],through:[1,2,3,4,6,12,16,17,21],thu:[2,5,6,8,13,17,18,19,21],tick:[6,14,17],time:[0,1,2,4,5,6,7,8,11,13,14,15,16,17,18,20,21],timer:17,timespan:19,timestamp:[6,13,15,17],tin:19,tinycan:1,titl:14,togeth:2,toggl:[8,12,19],told:19,too:[18,20,21],took:21,tool:[1,13],top:[3,6,7,10,12,14,18],topic:[18,19],torqu:13,tostr:[15,17],total:[0,13],touch:15,toward:[6,13],traffic:[1,2,5,12,13,14,17,20,21],transmit:17,tree:[5,15],tri:21,trick:11,trigger:11,troubl:5,truli:14,turbo:19,turn:[6,15,17,18,19],twice:14,two:[0,2,5,6,8,9,10,13,14,17],type:[1,3,18,21],uds:11,unchang:19,uncheck:[13,15,19],uncommon:9,under:8,underli:15,understood:13,uneven:16,unfilt:15,unfortun:21,unifi:17,uniqu:[4,13,18],unit:[3,13,18],unless:[8,12,16,17],unlik:21,unlock:21,unnotch:11,unset:[6,8,19],unsign:[9,16,18],until:[6,8,17],unusu:18,updat:[1,2,4,6,8,13,17,19],upon:13,upper:[6,16,17,18,21],use:[0,1,2,3,4,5,6,8,9,10,13,15,16,17,18,19,21],used:[1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,21],useful:[8,10,13,14,16,19,21],user:[13,17],uses:[2,8,14,18],using:[2,9,15],usual:[2,8,13,16,19,21],valid:[1,2,15,17,19,21],valu:[0,1,2,4,5,7,8,9,11,13,15,16,17,18],vari:[1,7,16],variabl:17,variablenam:17,varieti:[1,6,13,15,19],variou:[2,8,15,21],vector:1,vehicl:[5,8,12,13,21],vein:6,verbos:19,veri:[1,6,9,12,13,14,15,17,19,20,21],version:[17,19],vertic:10,via:1,view:[3,10,11,13,15,16,17,18,20],visibl:19,visual:[6,7,19],voltag:18,wai:[6,8,13,14,15,16,17,18,19],wait:[2,16,21],want:[0,2,4,6,8,9,12,13,15,16,17,19,21],warn:8,watch:19,web:17,webb:13,well:[0,1,2,6,10,13,17,18,21],were:[0,6,12,13,14,17,19],what:[1,2,5,6,8,11,12,16,17,18,19,20,21],whatev:[1,17],wheel:10,when:[1,2,3,4,10,13,14,15,16,17,18,19,20,21],whenev:17,where:[1,5,6,7,10,13,15,16,17,20],wherea:18,whether:[2,6,8,9,13,14,15,16,21],which:[0,2,4,6,7,8,12,13,14,15,16,17,18,19,20,21],white:[6,8,14,19],who:15,whole:12,why:[4,8,11,21],wide:[1,21],width:16,wildcard:21,wind:13,window:[9,11,12,17,18],wire:1,within:[1,2,9,13,14,17,19,20],without:[13,14,15,19,20],won:[1,12,21],word:14,work:[0,1,8,11,12,15,17,18,19,21],would:[0,3,4,6,8,11,16,17,18,20],write:[11,13],wrong:1,xor:2,yet:0,yield:[2,6],you:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21],your:[1,3,5,8,9,10,12,13,15,16,17,18,19,21],yourself:[1,13,17],zoom:[10,20]},titles:["43. Bisector Window","9. Connection Window","74. Custom Sender Window","17. DBC Message Editor","14. DBC File Manager","55. File Comparison Window","35. Flow View Window","53. Frame Details Window","58. Fuzzing Window","31. Graph Setup","22. Graphing Window","Welcome to SavvyCAN V189 documentation!","63. ISO-TP Decoder","1. Main / Start Up Screen","70. Playback Window","12. Preference Window","65. Range State Window","79. Scripting Interface","20. DBC Signal Editor","45. Sniffer Window","Temporal Window","67. UDS Scan Window"],titleterms:{"byte":19,"function":17,"new":10,And:13,IDs:19,The:[5,6,7,8,13,17],UDS:21,Using:[0,12,16,19,20,21],addit:6,advanc:19,around:10,back:14,beast:8,bisector:0,bit:19,bottom:13,callback:17,can:17,care:13,compar:5,comparison:5,connect:1,control:[6,8],creat:10,custom:2,danger:8,dbc:[3,4,9,13,18],debug:1,decod:12,defin:18,delet:10,detail:7,differ:5,document:11,dongl:1,edit:[9,10,18],editor:[3,18],exampl:17,expir:19,fade:19,file:[4,5],filter:13,flow:6,frame:[7,13,14],full:17,fuzz:8,fuzzi:8,gener:2,get:17,graph:[9,10],hidden:10,host:17,how:13,inact:19,interact:13,interfac:17,iso:12,isotp:17,layout:[2,5],list:[5,13],load:[10,13],main:13,manag:[4,17],manual:9,messag:3,modif:2,move:10,mute:19,never:19,node:3,notch:19,object:17,option:[6,19],order:4,overview:2,plai:14,playback:14,prefer:15,prepar:14,problem:1,pull:8,purpos:[5,6,7,8,17,21],rang:16,real:10,refer:6,rest:13,rule:2,save:[10,13],savvycan:11,scan:21,screen:13,script:17,seek:6,select:[6,10],sender:2,set:[9,15],setup:9,signal:[9,18],sniffer:19,specif:6,start:13,state:16,statu:[14,17],statusbar:13,tempor:20,time:10,trick:10,trigger:[2,8],uds:17,unnotch:19,v189:11,valu:6,view:[2,6,19],welcom:11,what:13,why:13,window:[0,1,2,5,6,7,8,10,13,14,15,16,19,20,21],work:[3,4],would:13,write:[2,17]}}) \ No newline at end of file diff --git a/help/signaleditor.html b/help/signaleditor.html index 6746727..af974fc 100644 --- a/help/signaleditor.html +++ b/help/signaleditor.html @@ -1,26 +1,41 @@ - - + + + - - - 20. DBC Signal Editor - - + + + 20. DBC Signal Editor — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

20. DBC Signal Editor

+

20. DBC Signal Editor

.

_images/SignalEditor.png
-

21. Defining and Editing Signals

+

21. Defining and Editing Signals

If you’re starting from scratch or otherwise adding a signal then you will need to right click in the list box in the upper left of the window. From there select “Add a New Signal.” This will create a randomly named signal that you can then edit.

Otherwise, select a signal to edit. The details of it will fill out the rest of the window.

On the right side you can rename the signal and you’ll see that it is renamed in the list as well.

@@ -45,8 +60,149 @@
+
+
+
+ + + + + \ No newline at end of file diff --git a/help/sniffer.html b/help/sniffer.html index 6228e4a..f7886b2 100644 --- a/help/sniffer.html +++ b/help/sniffer.html @@ -1,38 +1,53 @@ - - + + + - - - 45. Sniffer Window - - + + + 45. Sniffer Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

45. Sniffer Window

+

45. Sniffer Window

.

_images/Sniffer.png
-

46. Using the Sniffer Window

+

46. Using the Sniffer Window

This window is essentially a turbo charged graphical version of the linux can_utils program “cansniffer”. The general idea here is to display a list of frames such that you only see frames that are actively updating. If a given ID has not been seen in 5 seconds the ID portion will turn RED and then disappear from the list. In this way only frames that are updating are in the list. They are -ordered by ID. Bytes that have deincremented will be red and bytes that have incremented +ordered by ID. Bytes that have decremented will be red and bytes that have incremented will be green. You can use the “Filters” area to mask away some IDs so that they never show up. This can help to declutter the list.

This window updates with a 200ms interval.

-

47. Notching and Unnotching

+

47. Notching and Unnotching

While the window is running it keeps a running list each 200ms cycle of all the bits that changed in that timespan. Each 200ms this list is backed up and reset. If you push the notch button the system will remember all the bits that were set in the last 200ms window @@ -43,13 +58,13 @@ can build up a set of bits to ignore. Un-notching causes all notched (ignored) b reset and thus all changes will be colored once again.

-

48. Advanced Options

+

48. Advanced Options

All of the above was valid if you do not check any of the four checkboxes. With the checkboxes unchecked this window is very close to cansniffer on the command line. But, what fun is that? These checkboxes modify the way the window works in a variety of ways.

-

49. Never Expire IDs

+

49. Never Expire IDs

This checkbox will do exactly what it says on the tin. Instead of frame ID’s expiring after 5 seconds of inactivity they will stick around forever. This can be useful so that the ID you are watching doesn’t jump up and down as IDs expire and potentially come back later on or new IDs @@ -57,7 +72,7 @@ are seen. With no expiration you will get a more consistent view of the IDs. You to filter away IDs you are not interested in.

-

50. Mute notched bits

+

50. Mute notched bits

This checkbox might sound a bit strange. With this checked any bytes that you have notched will ignore any notched bits and not even change the display to update if only notched bits were changed. This completely hides all notched data. The view of the frames will then NOT perfectly or correctly @@ -66,21 +81,162 @@ is handy when you are looking for a needle in a haystack and you don’t want th already told the program to notch them away.

-

51. Fade inactive bytes

+

51. Fade inactive bytes

This can be used with mute or without but has a similar purpose. When this is checked any bytes that haven’t updated recently will begin to fade away to white. They never quite get all the way to disappearing but will fade to be very light. In this way only data which is actively changing will be very visible. This drastically aids in helping you to ignore any bytes that are not changing.

-

52. View Bits

+

52. View Bits

This option changes the view very starkly. This is the view shown in the picture associated with this topic. When View Bits is selected the display will change to show each bit within the bytes as separate blocks that each can separately be black when set and unchanged, white when unset and unchanged, red when freshly unset, and green when freshly set. This allows for a very fine grained view. Fade inactive, and never expire still work as usual. This mode might be a bit “busy” and lowers the number of IDs you can see at once. But, the choice is yours. You give up some density in exchange for verbosity.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/temporalwindow.html b/help/temporalwindow.html index 4c73b9e..3a87c53 100644 --- a/help/temporalwindow.html +++ b/help/temporalwindow.html @@ -1,26 +1,39 @@ - - + + + - - - Temporal Window - - + + + Temporal Window — SavvyCAN 189 documentation + + + + + + + + + + + + + +
+
-

Temporal Window

+

Temporal Window

.

_images/TemporalWindow.png
-

Using the Temporal Window

+

Using the Temporal Window

This window gives a dual graphical representation of CAN IDs over time. For each frame in the capture a circle is placed on the graph at a point given by the time when the frame came in on the X axis and the frame ID on the Y axis. That is, a frame with ID 0x300 that comes in at 23.543 seconds would be plotted at the point 23.543, 0x300. The graph background is color coded for “density.” That brings up @@ -36,8 +49,147 @@ to independently control. To control both again click in the graph itself.

+
+
+
+ + + + + \ No newline at end of file diff --git a/help/uds_scanner.html b/help/uds_scanner.html index fde43d1..daba11d 100644 --- a/help/uds_scanner.html +++ b/help/uds_scanner.html @@ -1,46 +1,202 @@ - - + + + - - - 67. UDS Scan Window - - + + + 67. UDS Scan Window — SavvyCAN 189 documentation + + + + + + + + + + + + + + + +
+
-

67. UDS Scan Window

+

67. UDS Scan Window

.

_images/UDS_Scanner.png
-

68. Purpose of the UDS Scan Window

+

68. Purpose of the UDS Scan Window

This is essentially another CAN fuzzing window but a very special one. This window is meant to search for UDS compliant (or nearly compliant) nodes on the CAN bus. It can also be used to do a blanket search for services, sub functions, and data items on a known UDS node.

-

69. Using the UDS Scan Window

+

69. Using the UDS Scan Window

UDS queries are sent out on the bus from “Starting ID” to “Ending ID”. Usually UDS compliant ECUs will respond to 0x7E0 through 0x7E7 which is why those are the defaults. Some vehicles use UDS “like” protocols on other IDs. Usually UDS nodes reply with an ID 8 higher than the request ID. This is thus the default in the program. However, some nodes cheat and do not do this. It is quite common for responses to come from an address 16 higher instead. To deal with this situation there is a checkbox “Allow adaptive reply offset.” If this is checked then replies will be accepted no matter what address they come from. Deselecting this will cause only replies of the proper offset to be accepted. The offset defaults to 8 but can be changed with the “Reply Offset” selector. Additionally, you can select which bus to scan and set how long you want to wait for replies.

“Show tests with no Replies” - This checkbox does what it says. It is a personal preference whether you’d like to see an entry in the list for scans that returned no results. Sometimes an ECU will just plain ignore messages it doesn’t like. In that case you have the option to see an entry in the list telling you that the message was ignored or whether you’d prefer to reduce clutter and just skip anything that had no reply.

You need to also set a type of scan to do. You can select more than one type but if you don’t set any then you aren’t going to see any results. Keep that in mind as none are checked by default.

“Read By ID” - UDS allows one to read data from the ECU by an ID number. These are not defined anywhere and are custom to each ECU. But, you can use this to scan a range of IDs to see if you get a response to any of them. There is no real standard for how many bytes the ID will be. It could be 1, it could be 2, 3, 4. It’s likely to be around 2. You can set the number of subfunction bytes which will set the size of the ID. Then you can set the upper and lower bound to scan.

“Read By Addr” - You can also read data by address. Like IDs the address could be different sizes depending on the hardware you are querying. This works the same as reading by ID but by address instead.

-

“Session Ctrl” - UDS has the concept of session type. Some types are “normal” “extended diagnostics” “programmming”. Scanning for session type will try them all and let you know which the device supports. However, note that you might get a response that indicates that conditions are not correct or that access was denied. This probably means that the mode is actually supported but you’d have to do the right things first. This is still useful information. This scan window is too simple to use for further cracking of such things but the scripting interface is the perfect thing to use instead.

+

“Session Ctrl” - UDS has the concept of session type. Some types are “normal” “extended diagnostics” “programming”. Scanning for session type will try them all and let you know which the device supports. However, note that you might get a response that indicates that conditions are not correct or that access was denied. This probably means that the mode is actually supported but you’d have to do the right things first. This is still useful information. This scan window is too simple to use for further cracking of such things but the scripting interface is the perfect thing to use instead.

“ECU Reset” - The ECU might also support being reset by a UDS message. This scan type will try the various reset types and see which are supported.

-

“Security Access” - When a device is first started and normally operating it will generally not allow you to do potentially dangerous or sensitive operations such as downloading firmware or changing parameters. To do these things you need to enter a different security level. The security access mechanism is used for this. There are a few different security levels that are likely to be supported. This scan type will attempt to find secutity levels and see if they are protected or not. That is, unfortunately for the casual cracker, most of the time the elevate security levels will be protected by a challenge/response system. The ECU will send you a challenge in the form of one or more random looking bytes. You are tasked with returning the proper response for those challenge bytes. You generally don’t have very many guesses before your hands are slapped. Sometimes the C/R is actually fixed and you can just capture valid traffic once and then use the same response forever. Sometimes the C/R is stupidly easy or there are only a couple of different possible answers. Sometimes the ECU developer actually took more than 2 seconds to implement these features and your work will be cut out for you. This scan type will find which levels the ECU seems to support but is unlikely to actually unlock them.

+

“Security Access” - When a device is first started and normally operating it will generally not allow you to do potentially dangerous or sensitive operations such as downloading firmware or changing parameters. To do these things you need to enter a different security level. The security access mechanism is used for this. There are a few different security levels that are likely to be supported. This scan type will attempt to find security levels and see if they are protected or not. That is, unfortunately for the casual cracker, most of the time the elevate security levels will be protected by a challenge/response system. The ECU will send you a challenge in the form of one or more random looking bytes. You are tasked with returning the proper response for those challenge bytes. You generally don’t have very many guesses before your hands are slapped. Sometimes the C/R is actually fixed and you can just capture valid traffic once and then use the same response forever. Sometimes the C/R is stupidly easy or there are only a couple of different possible answers. Sometimes the ECU developer actually took more than 2 seconds to implement these features and your work will be cut out for you. This scan type will find which levels the ECU seems to support but is unlikely to actually unlock them.

“Tester Present” - A scan that tries to see if tester present is supported. It almost certainly is. This scan can be used to sweep a wide range of addresses just to narrow down the list of addresses to scan more thoroughly. Normally tester present is sent periodically by a connected device just to let the ECU know that someone is still there.

“Wildcard” - Allows for you to set a lower and upper range for the service byte as well as the number of subfunction bytes and the range there as well. This allows for UDS fuzzing by shooting the moon and trying a huge range of traffic just to see what is supported and what isn’t. This test can take a VERY long time if you aren’t careful but will thoroughly determine what the ECU will support and what it won’t.

+
+
+
+ + + + + \ No newline at end of file