Browse Source

Various docs fixes

mobile
jlukic 10 years ago
parent
commit
412294d720
  1. 2
      package.json
  2. 23
      server/documents/behaviors/api.html.eco
  3. 12
      server/documents/collections/grid.html.eco
  4. 38
      server/documents/hotfix.html
  5. 135
      server/documents/modules/dropdown.html.eco
  6. 4
      server/files/javascript/docs.js
  7. 2
      server/partials/header.html.eco

2
package.json

@ -11,7 +11,7 @@
},
"dependencies": {
"docpad": "~6.78.1",
"docpad-plugin-copy": "~2.1.0",
"docpad-plugin-copy": "~2.1.3",
"docpad-plugin-eco": "~2.1.0",
"docpad-plugin-partials": "~2.9.2"
},

23
server/documents/behaviors/api.html.eco

@ -648,7 +648,7 @@ type : 'UI Behavior'
};
},
onSuccess: function() {
// this will always fire
// success is ensured from onResponse
}
})
;
@ -867,6 +867,27 @@ type : 'UI Behavior'
<td>false</td>
<td>Whether to serialize closest form and include in request</td>
</tr>
<tr>
<td>throttle</td>
<td>
0
</td>
<td>How long to wait when a request is made before triggering request, useful for rate limiting <code>oninput</code></td>
</tr>
<tr>
<td>throttleFirstRequest</td>
<td>
true
</td>
<td>When set to false will not delay the first request made, when no others are queued</td>
</tr>
<tr>
<td>interruptRequests</td>
<td>
false
</td>
<td>Whether an API request can occur while another request is still pending</td>
</tr>
<tr>
<td>loadingDuration</td>
<td>0</td>

12
server/documents/collections/grid.html.eco

@ -282,12 +282,12 @@ themes : ['Default']
</div>
<h2 class="ui dividing header">Responsive Page Grids</h2>
<h2 class="ui dividing header">Responsive Grids</h2>
<div class="highlighted example">
<h4 class="ui header">Adding Page Gutters</h4>
<p>A page grid is a type of grid designed to provide a responsive container for wrapping the entire contents of your page.</p>
<div class="ui page grid">
<h4 class="ui header">Using Containers</h4>
<p>a <a href="/elements/container.html">container</a> can be used alongside a grid to provide a responsive, fixed width container for wrapping the entire contents of your page.</p>
<div class="ui grid container">
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
@ -300,8 +300,8 @@ themes : ['Default']
</div>
<div class="no example">
<h4 class="ui header">Page Grid Breakpoints</h4>
<p>Semantic's page grid, by default, uses percentage values for page gutters. This means your page container will <b>constantly adjust</b> as the browser width changes, giving you the largest possible space for each breakpoint.</p>
<h4 class="ui header">Container Breakpoints</h4>
<p>Containers . This means your page container will <b>constantly adjust</b> as the browser width changes, giving you the largest possible space for each breakpoint.</p>
<p>Grids, rows, and columns can receive responsive classes to make them appear only on a particular device.</p>
<table class="ui celled definition table">
<thead>

38
server/documents/hotfix.html

@ -40,35 +40,17 @@ $(document).ready(function() {
</style>
<div class="ui container" style="padding-top:300px;">
<div class="ui selection dropdown">
<input type="hidden" name="test">
<div class="default text">Select</div> <i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="normal">String value</div>
<div class="item" data-value="two">String value</div>
<div class="item" data-value="1">1</div>
<div class="item" data-value="three">String value</div>
<div class="item" data-value="true">Boolean value</div>
<div class="ui two column middle aligned very relaxed fitted stackable grid">
<div class="column">
<a class="ui green button">Upload a document</a>
<input type="file" name="documents" multiple="multiple" class="ui input hidden"/>
</div>
</div>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="test">
<div class="default text">Select</div> <i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="normal">String value</div>
<div class="item" data-value="two">String value</div>
<div class="item" data-value="1">1</div>
<div class="item" data-value="three">String value</div>
<div class="item" data-value="true">Boolean value</div>
<div class="ui vertical divider">
Or
</div>
<div class="center aligned column">
<a class="ui green button">Enter your text</a>
<textarea class="ui input hidden"></textarea>
</div>
</div>
<div class="ui divider"></div>
<div class="ui button" id="bt1">Set to string value</div>
<div class="ui button" id="bt2">Set to boolean value</div>
<div class="ui button" id="bt3">Set to numeric value</div>
<div class="ui button" id="bt4">Clear</div>
<div class="ui button" id="bt5">Restore Defaults</div>
<div class="ui button" id="bt6">Set Text</div>
</div>

135
server/documents/modules/dropdown.html.eco

@ -1201,12 +1201,71 @@ themes : ['Default', 'Material']
<h2 class="ui header">Selection Dropdowns</h2>
<div class="remote example">
<div class="max example">
<h4 class="ui header">Maximum Selections</h4>
<p>Using <code>maxSelections</code> lets you force a maximum number of selections. You can also use <a href="http://laptop-vm:9778/behaviors/form.html#validation-rules">form validation</a> rules to specify minimum and maximum validation settings for multi-selects inside forms.</p>
<div class="ui sub header">Selection</div>
<select multiple name="skills" class="ui fluid dropdown">
<%- @partial('examples/single/skill-menu') %>
</select>
<div class="ui sub header">Search Selection</div>
<div class="ui fluid multiple search selection dropdown">
<input type="hidden" name="country">
<i class="dropdown icon"></i>
<div class="default text">Select Country</div>
<%- @partial('examples/single/flag-menu') %>
</div>
<div class="evaluated code" data-type="javascript">
$('.max.example .ui.dropdown')
.dropdown({
maxSelections: 3
})
;
</div>
</div>
<div class="tag example">
<h4 class="ui header">Tagging and User Additions</h4>
<p>Using <code>allowAdditions: true</code> gives users the ability to add their own options. This can work with either single or multiple search select dropdowns</p>
<div class="ui ignored warning message">
Although all dropdowns support <code>select</code> initialization, custom choices <b>will not be saved on page refresh</b> unless you use a hidden input. This is because <code>option</code> created dynamically are not preserved on page refresh.
</div>
<div class="ui sub header">Single</div>
<select name="skills" class="ui fluid search dropdown">
<%- @partial('examples/single/skill-menu') %>
</select>
<div class="ui sub header">Multiple</div>
<div class="ui fluid multiple search selection dropdown">
<input name="tags" type="hidden" />
<i class="dropdown icon"></i>
<div class="default text">Skills</div>
<div class="menu">
<%- @partial('examples/single/preset-menu') %>
</div>
</div>
<div class="evaluated code" data-type="javascript">
$('.tag.example .ui.dropdown')
.dropdown({
allowAdditions: true
})
;
</div>
</div>
<div class="remote no example">
<h4 class="ui header">Remote Content</h4>
<p>Search selection dropdowns can specify <a href="/behaviors/api.html">API settings</a> for retrieving values remotely, this can use either a named API <code>action</code> or <code>url</code>.</p>
<p class="ignored">Using API can allow users to select choices from large datasets that would be too large to include directly in page markups.</p>
<p class="ignored">If your backend is not designed to return the correct markup you can use API's <code><a href="/behaviors/api.html#adjusting-server-responses">onResponse</a></code> callback to adjust the format of an API response after it is received from the server.</p>
<p class="ignored">Requests for the same API endpoints will automatically cached locally, to avoid server roundtrips. You can disable this by adjusting the <code>cache</code> API setting.</p>
<div class="ui ignored positive message">When a user refreshes the page, selection labels are automatically recreated by using <code>sessionStorage</code> to store the corresponding names for selected values. You can disable this feature by setting <code>saveRemoteData: false</code></div>
<div class="ui warning ignored message">If your backend is not designed to return the correct markup you can use API's <code><a href="/behaviors/api.html#adjusting-server-responses">onResponse</a></code> callback to adjust the format of an API response after it is received from the server.</div>
<div class="ui form">
<div class="two fields">
@ -1241,6 +1300,7 @@ themes : ['Default', 'Material']
;
</div>
<div class="code" data-type="JSON">
// Expected server response
{
"success": true,
"results": [
@ -1269,65 +1329,6 @@ themes : ['Default', 'Material']
</div>
</div>
<div class="max example">
<h4 class="ui header">Maximum Selections</h4>
<p>Using <code>maxSelections</code> lets you force a maximum number of selections. You can also use <a href="http://laptop-vm:9778/behaviors/form.html#validation-rules">form validation</a> rules to specify minimum and maximum validation settings for multi-selects inside forms.</p>
<div class="ui sub header">Selection</div>
<select multiple name="skills" class="ui fluid dropdown">
<%- @partial('examples/single/skill-menu') %>
</select>
<div class="ui sub header">Search Selection</div>
<div class="ui fluid multiple search selection dropdown">
<input type="hidden" name="country">
<i class="dropdown icon"></i>
<div class="default text">Select Country</div>
<%- @partial('examples/single/flag-menu') %>
</div>
<div class="evaluated code" data-type="javascript">
$('.max.example .ui.dropdown')
.dropdown({
maxSelections: 3
})
;
</div>
</div>
<div class="tag example">
<h4 class="ui header">Tagging and User Additions</h4>
<p>Using <code>allowAdditions: true</code> gives users the ability to add their own options. This can work with either single or multiple search select dropdowns</p>
<div class="ui ignored warning message">
Although all dropdowns support <code>select</code> initialization, custom choices <b>will not be saved on page refresh</b> unless you use a hidden input. This is because <code>option</code> created dynamically are not preserved on page refresh.
</div>
<div class="ui sub header">Single</div>
<select name="skills" class="ui fluid search dropdown">
<%- @partial('examples/single/skill-menu') %>
</select>
<div class="ui sub header">Multiple</div>
<div class="ui fluid multiple search selection dropdown">
<input name="tags" type="hidden" />
<i class="dropdown icon"></i>
<div class="default text">Skills</div>
<div class="menu">
<%- @partial('examples/single/preset-menu') %>
</div>
</div>
<div class="evaluated code" data-type="javascript">
$('.tag.example .ui.dropdown')
.dropdown({
allowAdditions: true
})
;
</div>
</div>
<div class="no label example">
<h4 class="ui header">Text Labels</h4>
<p>Sometimes multiselect include options which are long and would appear awkwardly as labels. Setting <code>useLabels: false</code> will display a selected count, and allow reselection directly from the menu.</p>
@ -1390,6 +1391,18 @@ themes : ['Default', 'Material']
<div class="restore dropdown example">
<h4 class="ui header">Restoring Defaults</h4>
<p>You can restore a dropdown to its value set on page load</p>
<div class="ui multiple selection dropdown">
<input name="gender" type="hidden" value="default,default2" />
<div class="text">Default</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="0">Value</div>
<div class="item" data-value="1">Another Value</div>
<div class="item" data-value="default">Default Value</div>
<div class="item" data-value="default2">Second Default</div>
</div>
</div>
<div class="ui selection dropdown">
<input name="gender" type="hidden" value="default" />
<div class="text">Default</div>

4
server/files/javascript/docs.js

@ -785,8 +785,7 @@ semantic.ready = function() {
code += $this.get(0).outerHTML + "\n";
}
else {
code += $this.removeAttr('tabindex').removeAttr('style').get(0).outerHTML + "\n";
code = code.replace(/tabindex=".*"/, '');
code += $this.removeAttr('style').get(0).outerHTML + "\n";
}
}
})
@ -1244,7 +1243,6 @@ semantic.ready = function() {
duration : 350,
position : 'bottom center',
on : 'click',
variation : 'basic',
onHidden : handler.resetDownloads
})
;

2
server/partials/header.html.eco

@ -69,7 +69,7 @@
<div class="ui download primary button">
Download
</div>
<div class="ui flowing download popup">
<div class="ui flowing download basic popup">
<div class="ui divided equal width relaxed center aligned choice grid">
<div class="framework column">
<h4 class="ui center aligned header">UI Framework</h4>

Loading…
Cancel
Save