Skip to content

Commit

Permalink
Build commit de3a37d
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jul 7, 2024
1 parent b53a85e commit 5dcdb18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
35 changes: 19 additions & 16 deletions api/config/urlConfig/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h2 id="description" class="screen-reader-text h-api-desc">Description</h2>

<p>Each array item should be an object shaped as follows:</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">({</span>
<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">QUnit</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">urlConfig</span><span class="p">.</span><span class="nf">push</span><span class="p">({</span>
<span class="na">id</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span>
<span class="na">label</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span>
<span class="na">tooltip</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="c1">// optional</span>
Expand All @@ -108,22 +108,13 @@ <h2 id="description" class="screen-reader-text h-api-desc">Description</h2>

<p>Each item may also have a <code class="language-plaintext highlighter-rouge">value</code> property:</p>

<p>If <code class="language-plaintext highlighter-rouge">value</code> is undefined, the option will render as a checkbox. The corresponding URL parameter will be set to “true” when the checkbox is checked, and otherwise will be absent.</p>

<p>If <code class="language-plaintext highlighter-rouge">value</code> is a string, the option will render as a checkbox. The corresponding URL parameter will be set to the value when the checkbox is checked, and otherwise will be absent.</p>

<p>If <code class="language-plaintext highlighter-rouge">value</code> is an array, the option will render as a “select one” menu with an empty value as first default option, followed by one option for each item in the array. The corresponding URL parameter will be absent when the empty option is selected, and otherwise will be set to the value of the selected array item.</p>
<p>If <code class="language-plaintext highlighter-rouge">value</code> is undefined, the item will render as a checkbox. The corresponding URL parameter will be set to “true” when the checkbox is checked, and otherwise will be absent.</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">value</span> <span class="o">=</span> <span class="p">[</span> <span class="dl">'</span><span class="s1">foobar</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">baz</span><span class="dl">'</span> <span class="p">];</span>
</code></pre></div></div>
<p>If <code class="language-plaintext highlighter-rouge">value</code> is a string, the item will render as a checkbox. The corresponding URL parameter will be set to the value when the checkbox is checked, and otherwise will be absent.</p>

<p>If <code class="language-plaintext highlighter-rouge">value</code> is an object, the option will render as a “select one” menu as for an array. The keys will be used as option values, and the values will be used as option display labels. The corresponding URL parameter will be absent when the empty option is selected, and otherwise will be set to the object key of the selected property.</p>
<p>If <code class="language-plaintext highlighter-rouge">value</code> is an array, the item will render as a “select one” dropdown menu with an empty value as first default option, followed by one option for each item in the array. The corresponding URL parameter will be absent when the empty option is selected, and otherwise will be set to the value of the selected array item.</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">value</span> <span class="o">=</span> <span class="p">{</span>
<span class="na">foobar</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Foo with bar</span><span class="dl">'</span><span class="p">,</span>
<span class="na">baz</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Baz</span><span class="dl">'</span>
<span class="p">};</span>
</code></pre></div></div>
<p>If <code class="language-plaintext highlighter-rouge">value</code> is an object, the item will render as a dropdown menu. The URL parameter will be set to the key of the selected property, and this will also be available via <code class="language-plaintext highlighter-rouge">QUnit.urlParams[id]</code>. The object values will be used as display label for each option in the dropdown menu. The corresponding URL parameter will be absent when the empty option is selected.</p>

<h2 id="examples">Examples</h2>

Expand All @@ -144,12 +135,24 @@ <h3 id="add-dropdown-menu">Add dropdown menu</h3>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">QUnit</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">urlConfig</span><span class="p">.</span><span class="nf">push</span><span class="p">({</span>
<span class="na">id</span><span class="p">:</span> <span class="dl">'</span><span class="s1">jquery</span><span class="dl">'</span><span class="p">,</span>
<span class="na">label</span><span class="p">:</span> <span class="dl">'</span><span class="s1">jQuery version</span><span class="dl">'</span><span class="p">,</span>
<span class="na">label</span><span class="p">:</span> <span class="dl">'</span><span class="s1">jQuery</span><span class="dl">'</span><span class="p">,</span>
<span class="na">value</span><span class="p">:</span> <span class="p">[</span> <span class="dl">'</span><span class="s1">1.7.2</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">1.8.3</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">1.9.1</span><span class="dl">'</span> <span class="p">],</span>
<span class="na">tooltip</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Which jQuery version to test against.</span><span class="dl">'</span>
<span class="na">tooltip</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Which version of jQuery to test against.</span><span class="dl">'</span>
<span class="p">});</span>
</code></pre></div></div>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">QUnit</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">urlConfig</span><span class="p">.</span><span class="nf">push</span><span class="p">({</span>
<span class="na">id</span><span class="p">:</span> <span class="dl">'</span><span class="s1">jquery</span><span class="dl">'</span><span class="p">,</span>
<span class="na">label</span><span class="p">:</span> <span class="dl">'</span><span class="s1">jQuery</span><span class="dl">'</span><span class="p">,</span>
<span class="na">value</span><span class="p">:</span> <span class="p">{</span> <span class="dl">'</span><span class="s1">1.7.2</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">v1.7.2 (LTS)</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">1.8.3</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">v1.8.3 (Current)</span><span class="dl">'</span> <span class="p">},</span>
<span class="na">tooltip</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Which version of jQuery to test against.</span><span class="dl">'</span>
<span class="p">});</span>

<span class="k">if </span><span class="p">(</span><span class="nx">QUnit</span><span class="p">.</span><span class="nx">urlConfig</span><span class="p">.</span><span class="nx">jquery</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Load jQuery</span>
<span class="p">}</span>
</code></pre></div></div>

</article>
</div>
<aside class="sidebar" role="complementary">
Expand Down
2 changes: 1 addition & 1 deletion feed.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="https://qunitjs.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://qunitjs.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-07-06T23:43:08+00:00</updated><id>https://qunitjs.com/feed.xml</id><title type="html">QUnit</title><subtitle>The powerful, easy-to-use JavaScript testing framework.</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="https://qunitjs.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://qunitjs.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-07-07T01:56:23+00:00</updated><id>https://qunitjs.com/feed.xml</id><title type="html">QUnit</title><subtitle>The powerful, easy-to-use JavaScript testing framework.</subtitle></feed>

0 comments on commit 5dcdb18

Please sign in to comment.