Browse Source

Additional doc updates

intro
jlukic 9 years ago
parent
commit
5595234789
  1. 3
      server/documents/behaviors/form.html.eco
  2. 9
      server/documents/elements/image.html.eco
  3. 43
      server/documents/hotfix.html.eco
  4. 12
      server/documents/modules/dropdown.html.eco
  5. 18
      server/documents/modules/modal.html.eco
  6. 185
      server/documents/modules/tab.html.eco
  7. 4
      server/files/javascript/docs.js
  8. 40
      server/files/javascript/tab.js
  9. 9
      server/files/stylesheets/docs.css
  10. 2
      server/partials/meta.html.eco

3
server/documents/behaviors/form.html.eco

@ -290,6 +290,9 @@ type : 'UI Behavior'
Calling <code>$('form').form('reset')</code>, or clicking any reset element will return all form values to their <em>default value</em>. This is the value the form fields were set to when the page loaded.
</p>
<p>Calling <code>$('form').form('clear')</code> will remove all values from form fields and reset dropdowns to placeholder text</p>
<div class="ui ignored warning message">
Form <code>reset</code> works by caching default values on page load. For this to work correctly any form that uses reset will need to initialize on page load.
</div>
<div class="ui ignored info message">
Reset and clear will modify all form fields, not just those which have validation rules
</div>

9
server/documents/elements/image.html.eco

@ -82,6 +82,13 @@ themes : ['Default']
<img class="ui medium bordered image" src="/images/wireframe/white-image.png">
</div>
<div class="example">
<h4 class="ui header">Fluid</h4>
<p>An image can take up the width of its container</p>
<img class="ui fluid image" src="/images/wireframe/image.png">
</div>
<div class="example">
<h4 class="ui header">Rounded</h4>
<p>An image may appear rounded</p>
@ -160,7 +167,7 @@ themes : ['Default']
<tbody>
<tr>
<td>Mini</td>
<td>20px</td>
<td>35px</td>
</tr>
<tr>
<td>Tiny</td>

43
server/documents/hotfix.html.eco

@ -10,7 +10,8 @@ type : 'Library'
<!-- TEST JS HERE !-->
<script>
$(document).ready(function() {
$('.ui.checkbox').checkbox({ debug: true });
$('.ui.dropdown').dropdown();
});
</script>
@ -18,37 +19,19 @@ $('.ui.checkbox').checkbox({ debug: true });
<!-- TEST CSS HERE !-->
<style type="text/css">
</style>
<%= @getVersion() %>
<div class="ui container" style="margin-top:5em;">
<div class="ui form">
<div class="grouped fields">
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="size" value="small">
<label>Small</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="size" value="medium">
<label>Medium</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="size" value="large">
<label>Large</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="size" value="x-large">
<label>X-Large</label>
</div>
</div>
</div>
</div>
</div>
<select multiple class="ui fluid dropdown">
<option value="">Skills</option>
<option value="angular">Angular</option>
<option value="css">CSS</option>
<option value="ember">Ember</option>
<option value="html">HTML</option>
<option value="javascript">Javascript</option>
<option value="meteor">Meteor</option>
<option value="node">NodeJS</option>
</select>
</body>

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

@ -877,30 +877,30 @@ themes : ['Default', 'Material']
People You Might Know
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/jenny.jpg">
<img class="ui image" src="/images/avatar/small/jenny.jpg">
Jenny Hess
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/elliot.jpg">
<img class="ui image" src="/images/avatar/small/elliot.jpg">
Elliot Fu
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/stevie.jpg">
<img class="ui image" src="/images/avatar/small/stevie.jpg">
Stevie Feliciano
</div>
<div class="header">
Your Friends' Friends
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/christian.jpg">
<img class="ui image" src="/images/avatar/small/christian.jpg">
Christian
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/matt.jpg">
<img class="ui image" src="/images/avatar/small/matt.jpg">
Matt
</div>
<div class="item">
<img class="ui mini avatar image" src="/images/avatar/small/justen.jpg">
<img class="ui image" src="/images/avatar/small/justen.jpg">
Justen Kitsune
</div>
</div>

18
server/documents/modules/modal.html.eco

@ -1,4 +1,4 @@
---
F---
layout : 'default'
css : 'modal-page'
standalone : true
@ -750,19 +750,12 @@ themes : ['Default', 'Material']
</td>
<td>You can specify custom settings to extend <a href="/modules/dimmer.html">UI dimmer</a></td>
</tr>
<tr>
<td>useCSS</td>
<td>
true
</td>
<td>Whether to use CSS animations instead of fallback javascript animations</td>
</tr>
<tr>
<td>transition</td>
<td>
scale
</td>
<td>Named transition to use when animating menu in and out. <code>Fade</code> is available without including <a href="/modules/transition.html">ui transitions</a></td>
<td>Named transition to use when animating menu in and out, full list can be found in <a href="/modules/transition.html">ui transitions</a> docs.</td>
</tr>
<tr>
<td>duration</td>
@ -778,13 +771,6 @@ themes : ['Default', 'Material']
</td>
<td>Whether additional animations should queue</td>
</tr>
<tr>
<td>easing</td>
<td>
easeOutExpo
</td>
<td>Animation easing is only used if javascript animations are used.</td>
</tr>
</tbody>
</table>

185
server/documents/modules/tab.html.eco

@ -76,7 +76,7 @@ themes : ['Default']
<div class="ui tab" data-tab="examples">
<h2 class="ui dividing header">Examples</h2>
<h2 class="ui dividing header">Basic Examples</h2>
<div class="first example">
<h4 class="ui header">Basic Tabs</h4>
@ -105,44 +105,8 @@ themes : ['Default']
</div>
</div>
<div class="dynamic no example">
<h4 class="header">Retreiving Remote Tab Content</h4>
<p>Using <code>auto: true</code> will load the tab's path from your server with additional headers to specify an in-page request. Additional requests will automatically be loaded from cache without a server request.</p>
<div class="ui ignored info message">
Tab contents defaults to automatically caching in <code>sessionStorage</code> using API's <code>cache: 'local'</code> setting. You can disable this behavior by setting <code>cache: false</code> in <code>apiSettings</code>.
</div>
<div class="ui ignored warning message">
API requests for the following example have been faked using <a href="/behaviors/api.html#using-custom-backends">mockResponseAsync</a> API setting to avoid network overhead.
</div>
<div class="code">
$('.dynamic.example .menu .item')
.tab({
context : 'parent',
auto : true,
path : '/'
})
;
</div>
<div class="ui pointing secondary menu">
<a class="active item" data-tab="first">First</a>
<a class="item" data-tab="second">Second</a>
<a class="item" data-tab="third">Third</a>
</div>
<div class="ui active tab segment" data-tab="first">
<h3 class="ui header">AJAX Tab One</h3>
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
</div>
<div class="ui tab segment" data-tab="second">
</div>
<div class="ui tab segment" data-tab="third">
</div>
</div>
<div class="context example">
<h4 class="ui header">Multiple Tabs on Same Page</h4>
<h4 class="ui header">Multiple Tab Groups</h4>
<p>There are a several of ways to include independent tab groups on the same page, even with history. One of the easiest ways is provide a specific parent context for each tab group.</p>
<div class="ui ignored info message">
If you are using tab contexts inside of tabs, you can also specify <code>childrenOnly: true</code> which will only look for tabs as the immediate children of the given context, or <code>context: 'parent'</code> a special keyword which avoids having to create unique selectors for each group.
@ -192,34 +156,13 @@ themes : ['Default']
<a class="item" data-tab="sixth">Sixth</a>
</div>
<div class="ui tab segment" data-tab="fourth">
<div class="ui top attached tabular menu">
<a class="active item" data-tab="fourth/a">4A</a>
<a class="item" data-tab="fourth/b">4B</a>
<a class="item" data-tab="fourth/c">4C</a>
</div>
<div class="ui bottom attached active tab segment" data-tab="fourth/a">4A</div>
<div class="ui bottom attached tab segment" data-tab="fourth/b">4B</div>
<div class="ui bottom attached tab segment" data-tab="fourth/c">4C</div>
4
</div>
<div class="ui tab segment active" data-tab="fifth">
<div class="ui top attached tabular menu">
<a class="item" data-tab="fifth/a">5A</a>
<a class="item" data-tab="fifth/b">5B</a>
<a class="item active" data-tab="fifth/c">5C</a>
</div>
<div class="ui bottom attached tab segment" data-tab="fifth/a">5A</div>
<div class="ui bottom attached tab segment" data-tab="fifth/b">5B</div>
<div class="ui bottom attached tab segment active" data-tab="fifth/c">5C</div>
<div class="ui active tab segment" data-tab="fifth">
5
</div>
<div class="ui tab segment" data-tab="sixth">
<div class="ui top attached tabular menu">
<a class="item" data-tab="sixth/a">6A</a>
<a class="item" data-tab="sixth/b">6B</a>
<a class="item" data-tab="sixth/c">6C</a>
</div>
<div class="ui bottom attached tab segment" data-tab="sixth/a">6A</div>
<div class="ui bottom attached tab segment" data-tab="sixth/b">6B</div>
<div class="ui bottom attached tab segment" data-tab="sixth/c">6C</div>
6
</div>
<div class="evaluated code" data-type="javascript">
$('#context1 .menu .item')
@ -287,6 +230,87 @@ themes : ['Default']
</div>
</div>
<h2 class="ui dividing header">Remote Examples</h2>
<div class="dynamic no example">
<h4 class="header">Retreiving Remote Content</h4>
<p>Using <code>auto: true</code> will load the tab's path from your server with additional headers to specify an in-page request. When <a href="#settings"><code>cache: true</code></a> is set, re-opening a tab will be loaded from cache without a server request.</p>
<div class="ui ignored warning message">
API requests for the following example have been faked using <a href="/behaviors/api.html#using-custom-backends">mockResponse</a> API setting to avoid network overhead.
</div>
<div class="code">
$('.dynamic.example .menu .item')
.tab({
cache: false,
// faking api request
apiSettings: {
loadingDuration : 300,
mockResponse : function(settings) {
var response = {
first : 'AJAX Tab One',
second : 'AJAX Tab Two',
third : 'AJAX Tab Three'
};
return response[settings.urlData.tab];
}
},
context : 'parent',
auto : true,
path : '/'
})
;
</div>
<div class="ui pointing secondary menu">
<a class="active item" data-tab="first">First</a>
<a class="item" data-tab="second">Second</a>
<a class="item" data-tab="third">Third</a>
</div>
<div class="ui active tab segment" data-tab="first">
<h3 class="ui header">AJAX Tab One</h3>
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
</div>
<div class="ui tab segment" data-tab="second">
</div>
<div class="ui tab segment" data-tab="third">
</div>
</div>
<div class="eval no example">
<h4 class="header">Evaluating Scripts in HTML</h4>
<p>By default, <code>script</code> tags included in HTML will only be evaluated on first load. To change this behavior you can adjust the <code>evaluateScripts</code> setting.</p>
<div class="code">
$('.eval.example .menu .item')
.tab({
evaluateScripts : 'once',
context : 'parent',
auto : true,
path : '/'
})
;
</div>
<div class="ui pointing secondary menu">
<a class="active item" data-tab="first">First</a>
<a class="item" data-tab="second">Second</a>
<a class="item" data-tab="third">Third</a>
</div>
<div class="ui active tab segment" data-tab="first">
<h3 class="ui header">AJAX Tab One</h3>
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
</div>
<div class="ui tab segment" data-tab="second">
</div>
<div class="ui tab segment" data-tab="third">
</div>
</div>
<h2 class="ui dividing header">History Examples</h2>
<div class="history example">
<h4>Using Hash History</h4>
<p>For static sites, or sites that only require simple history, in-page links can be used to trigger different local tab states</p>
@ -336,6 +360,41 @@ themes : ['Default']
</div>
</div>
<div class="state example">
<h4>Using HTML5 State</h4>
<p>For sites that are able to replicate change on the server, tab can automatically map changes in tab navigation to <a href="http://diveintohtml5.info/history.html" target="_blank">html5 state.</a>
</p>
<div class="ui ignored info message">
Since these docs are statically hosted on GitHub Pages, html state is not supported. The following example will cause a "not found" error on page refresh.
</div>
<div class="evaluated code" data-type="javascript">
$('.state.example .menu .item')
.tab({
context : '.state.example',
history : true,
historyType : 'state',
// base url for all other path changes
path : '/modules/tab.html'
})
;
</div>
<div class="ui pointing secondary menu">
<a class="active item" data-tab="olive">Olive</a>
<a class="item" data-tab="apple">Apple</a>
<a class="item" data-tab="cucumber">Cucumber</a>
</div>
<div class="ui active tab segment" data-tab="olive">
Olive tab
</div>
<div class="ui tab segment" data-tab="apple">
Apple tab
</div>
<div class="ui tab segment" data-tab="cucumber">
Cucumber tab
</div>
</div>
</div>

4
server/files/javascript/docs.js

@ -1206,7 +1206,7 @@ semantic.ready = function() {
handler.createIcon();
if(expertiseLevel < 2) {
if(expertiseLevel < 2 && $(window).width() > 640) {
$popupExample
.each(function() {
$(this)
@ -1226,7 +1226,7 @@ semantic.ready = function() {
.find('i.code')
.on('click', function() {
$.cookie('expertiseLevel', 2, {
expires: 90
expires: 365
});
})
;

40
server/files/javascript/tab.js

@ -4,16 +4,13 @@ semantic.dropdown = {};
semantic.dropdown.ready = function() {
$.fn.api.settings.mockResponseAsync = function(settings, callback) {
$.fn.api.settings.mockResponse = function(settings) {
var response = {
first : '<h3 class="ui header">AJAX Tab One</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">',
second : '<h3 class="ui header">AJAX Tab Two</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">',
third : '<h3 class="ui header">AJAX Tab Three</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">'
first : '<h3 class="ui header">AJAX Tab One</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">',
second : '<h3 class="ui header">AJAX Tab Two</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">',
third : '<h3 class="ui header">AJAX Tab Three</h3><img class="ui wireframe image" src="/images/wireframe/paragraph.png"><img class="ui wireframe image" src="/images/wireframe/paragraph.png">'
};
// do any asynchronous task here
setTimeout(function() {
callback( response[settings.urlData.tab] );
}, 200);
return response[settings.urlData.tab];
};
$('.first.example .menu .item')
@ -38,9 +35,32 @@ semantic.dropdown.ready = function() {
$('.dynamic.example .menu .item')
.tab({
context : '.dynamic.example',
apiSettings: {
loadingDuration: 300
},
cache : false,
context : 'parent',
auto : true,
history : false,
path : '/'
})
;
$('.eval.example .menu .item')
.tab({
// faking api request
apiSettings: {
mockResponse : function(settings) {
var response = {
first : '<script>alert("JS Fired Once");</script>AJAX Tab One',
second : '<script>alert("JS Fired Once");</script>AJAX Tab Two',
third : '<script>alert("JS Fired Once");</script>AJAX Tab Three'
};
return response[settings.urlData.tab];
}
},
context : 'parent',
auto : true,
history : false,
path : '/'
})
;

9
server/files/stylesheets/docs.css

@ -756,6 +756,12 @@ blockquote .author {
display: none;
}
#example .fixed.example iframe {
border: none;
width: 100%;
height: 350px;
}
/* Requires Clear */
#example .clearing.example {
overflow: hidden;
@ -2215,8 +2221,7 @@ code .chunk {
@media only screen and (max-width: 768px) {
/* Hide Some Fixed Menu Content (Pagination, Search) */
#example .fixed.menu > .container > .section.item,
#example .fixed.menu > .container > .right.menu > .item:last-child {
#example .fixed.menu > .container > .section.item {
display: none;
}

2
server/partials/meta.html.eco

@ -1,7 +1,7 @@
<!-- Standard Meta -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<link rel="image_src" type="image/jpeg" href="/images/logo.png" />

Loading…
Cancel
Save