Browse Source

Begin work on 2.0 intro

intro
jlukic 9 years ago
parent
commit
bc20ae60a4
  1. 116
      server/documents/collections/grid.html.eco
  2. 15
      server/documents/elements/container.html.eco
  3. 16
      server/documents/hotfix.html.eco
  4. 454
      server/documents/introduction/new.html.eco
  5. 8
      server/documents/modules/popup.html.eco
  6. 26
      server/documents/views/item.html.eco
  7. 2
      server/files/javascript/docs.js
  8. 33
      server/files/javascript/icon.js
  9. 107
      server/files/javascript/intro.js
  10. 14
      server/files/stylesheets/docs.css
  11. 1
      server/partials/examples/single/preset-menu.html
  12. 19
      server/partials/inner-menu.html.eco
  13. 17
      server/partials/sidebar.html.eco

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

@ -21,96 +21,6 @@ themes : ['Default']
<div class="ui active intro tab" data-tab="overview">
<h2 class="ui dividing header">New in 2.0</h2>
<div class="example">
<h4 class="ui header">Flexbox</h4>
<p>Grids in 2.0 now use <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes" target="_blank"><code>flexbox</code></a> and are equal height across rows by default.</p>
<div class="ui three column divided grid">
<div class="row">
<div class="column">
<div class="ui segment">
1
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
<div class="ui segment">
3
</div>
</div>
</div>
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Evenly Divided</h4>
<p>The new <a href="#equal-width"><code>equal width</code></a> grid variation adjusts column widths automatically to split their container evenly without having to specify a column count.</p>
<div class="ui equal width grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Containers</h4>
<p><a href="/elements/container.html">Containers</a> have been added as a simpler way to place site content inside grids. Containers are fixed width which make responsive styling simpler.</p>
<div class="ui container">
<div class="ui three column grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">Stretched rows</h4>
<p>The new <a href="#stretched"><code>stretched</code></a> variation adjusts each column's contents to grow to the full height of the column.</p>
<div class="ui three column stretched grid">
<div class="row">
<div class="column">
<div class="ui segment">
1
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
<div class="ui segment">
3
</div>
</div>
</div>
</div>
</div>
<h2 class="ui dividing header">Introduction</h2>
<div class="highlighted example">
@ -132,12 +42,22 @@ themes : ['Default']
<div class="highlighted example">
<h4 class="ui header">Columns</h4>
<p>Grids use columns as an indivisible unit for specifying content width. All grid systems use an arbitrary column count per row. Semantic's default theme assumes <b>16 columns</b>.</p>
<p>Grids divide horizontal space into indivisible units called columns. All content in a grid must specify their width in terms of the grid's column count. Grid systems use an arbitrary column count per row. Semantic's default theme uses <b>16 columns</b>.</p>
<p>The following example specifies each column as <code>four wide</code>, meaning four columns of four, <code>16 / 4 = 4</code> will fit in each grid row.</p>
<p>The default column count, and many more grid features can be customized by adjusting theming variables.</p>
<p>The default column count, and other arbitrary features of grids can be changed by adjusting Semantic UI's underlying theming variables.</p>
<div class="ui grid">
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Rows</h4>
<p>Rows are groups of columns which are aligned horizontally. After each group of columns vertical spacing is added to separate each group of columns, creating vertical rhythm.
<div class="ui grid">
<div class="four wide column"></div>
<div class="four wide column"></div>
@ -152,9 +72,9 @@ themes : ['Default']
<div class="highlighted negative example">
<h4 class="ui header">Gutters</h4>
<p>Grid columns use negative space called "gutters" between columns and rows. Gutters are fixed width spacers which, unlike columns, do not adjust in size as a grid changes.</p>
<p>Since all grid columns receive the same gutters, grids use <a href="http://csswizardry.com/2011/08/building-better-grid-systems/">negative margins</a> to make sure that grids sit flush with outside content.</p>
<p>To have all contents in a grid spaced, including first and last rows, or columns use a <a href="#padded"><code>padded grid</code></a> variation.</p>
<p>Grid columns and rows are separated by negative space called "gutters". Gutters are fixed width spacers which, unlike columns, do not adjust in size as a grid changes.</p>
<p>Since all grid columns in css receive the same gutters, grids use <a href="http://csswizardry.com/2011/08/building-better-grid-systems/">negative margins</a> to make sure that the first and last columns sit flush with content outside the grid.</p>
<p>To have first and last rows or columns include padding, use a <a href="#padded"><code>padded grid</code></a> variation.</p>
<div class="ui top attached button">Button before grid</div>
<div class="ui grid">
<div class="sixteen wide column"></div>
@ -170,9 +90,9 @@ themes : ['Default']
<div class="highlighted negative example">
<h4 class="ui header">Content Width</h4>
<p>Grids do not have a maximum width, and will automatically flow to contain the entire width of the element they are placed inside..</p>
<p><a href="/elements/container.html">Containers</a> are elements designed with a single purpose, to contain content to a reasonable maximum width for display.</p>
<p>Using a <code>grid container</code> is the best way to ensure elements fit appropriately within pages on all devices.</p>
<p>Grids do not have a maximum width, and will automatically flow to contain the entire width of the element they are placed inside.</p>
<p><a href="/elements/container.html">Containers</a> are elements designed to contain content to a reasonable maximum width for display based on the size of the user's screen.</p>
<p>Using grid and container together is the best way to display page contents in a grid.</p>
<div class="ui warning message">
<p>In version <code>1.x</code> of Semantic UI <code>page grid</code> were used to to contain the maximum width of grids holding page content. Page grid have been deprecated in favor for the simpler <code>container</code> element.</p>
</div>

15
server/documents/elements/container.html.eco

@ -27,13 +27,12 @@ themes : ['Default']
<h3 class="ui header">When To Use</h3>
<p>A container is an element designed exclusively for one purpose: to contain page elements to a reasonable maximum width. This is useful to couple with other UI elements like <a href="/collections/grid.html">grid</a> or <a href="/collections/menu.html">menu</a> to restrict their width so that they can be scanned easily by a user.</p>
<p>A container is an element designed to contain page elements to a reasonable maximum width based on the size of a user's screen. This is useful to couple with other UI elements like <a href="/collections/grid.html">grid</a> or <a href="/collections/menu.html">menu</a> to restrict their width to a reasonable size for display.</p>
<p>Containers are designed to responsively adjust their maximum width based on the size of the screen they are appearing.</p>
<h3 class="ui header">Container Sizes</h3>
<p>Containers remain a fixed pixel width at each device size. For exact specifications check the table below</p>
<p>Containers are designed to responsively adjust their maximum width based on the size of the screen they are appearing.</p>
<table class="ui celled definition table">
<thead>
@ -49,15 +48,15 @@ themes : ['Default']
<td>100%</td>
<td>
723px
<i class="help link icon" data-html="Maximum device width with two <code>1em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>768 - (14 * (1 * 2)) - 17</code>">
<i class="circle help link icon" data-html="Maximum device width with two <code>1em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>768 - (14 * (1 * 2)) - 17</code>">
</td>
<td>
933px
<i class="help link icon" data-html="Maximum device width with two <code>1.5em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>992 - (14 * (1.5 * 2)) - 17</code>">
<i class="circle help link icon" data-html="Maximum device width with two <code>1.5em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>992 - (14 * (1.5 * 2)) - 17</code>">
</td>
<td>
1127px
<i class="help link icon" data-html="Maximum device width with two <code>2em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>1200 - (14 * (2 * 2)) - 17</code>">
<i class="circle help link icon" data-html="Maximum device width with two <code>2em</code> gutters and a <code>17px</code> scrollbar width. <div class='ui divider'></div> <code>1200 - (14 * (2 * 2)) - 17</code>">
</td>
</tr>
<tr>
@ -98,6 +97,10 @@ themes : ['Default']
<p>For example to determine tablet container size the following formula is used:</p>
<div class="code" data-type="less">
/* In site.variables */
@tabletBreakpoint : 768px;
/* In container.variables */
@tabletMinimumGutter: (@emSize * 1); /* 1em gutter */
@tabletWidth: @tabletBreakpoint - (@tabletMinimumGutter * 2) - @scrollbarWidth;
</div>

16
server/documents/hotfix.html.eco

@ -50,16 +50,8 @@ $(document).ready(function() {
</style>
<form class="ui container">
<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="ui button one">Button One</div>
<div class="ui button two">Button Two</div>
<div class="ui button three">Button Three</div>
<div class="ui form">
<textarea></textarea>
<textarea rows="3"></textarea>
</div>
</form>

454
server/documents/introduction/new.html.eco

@ -0,0 +1,454 @@
---
layout : 'default'
css : 'divider'
standalone : true
title : 'New In 2.0'
description : 'An introduction to new features in 2.0'
type : 'Introduction'
---
<%- @partial('header') %>
<script src="/javascript/intro.js"></script>
<div class="main ui intro container">
<h2 class="ui dividing header">Introduction</h2>
<p>2.0 brings a whopping <b>98</b> enhancements, <b>105</b> bug fixes, <b>2</b> new components, complete rewrites of several important components like <code>menu</code>, and <code>input</code>, and much more newness.</p>
<p>There's just too much to cover in one page, but we've tried our best to give you examples of some of the new features available in 2.0</p>
<p>To see the full list of what's changed in 2.0 check out the project's release notes.</p>
<a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/RELEASE-NOTES.md" target="_blank" class="ui button">View Release Notes</a>
<h2 class="ui dividing header">Grids</h2>
<div class="example">
<h4 class="ui header">Flexbox</h4>
<p>Grids in 2.0 now use <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes" target="_blank"><code>flexbox</code></a> and are equal height across rows by default.</p>
<div class="ui three column divided grid">
<div class="row">
<div class="column">
<div class="ui segment">
1
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
<div class="ui segment">
3
</div>
</div>
</div>
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Evenly Divided</h4>
<p>The new <a href="#equal-width"><code>equal width</code></a> grid variation adjusts column widths automatically to split their container evenly without having to specify a column count.</p>
<div class="ui equal width grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
<div class="highlighted example">
<h4 class="ui header">Containers</h4>
<p><a href="/elements/container.html">Containers</a> have been added as a simple way to limit content width.</p>
<div class="ui container">
<div class="ui three column grid">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">Stretched rows</h4>
<p>The new <a href="#stretched"><code>stretched</code></a> variation adjusts each column's contents to grow to the full height of the column.</p>
<div class="ui three column stretched grid">
<div class="row">
<div class="column">
<div class="ui segment">
1
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
</div>
<div class="column">
<div class="ui segment">
1
</div>
<div class="ui segment">
2
</div>
<div class="ui segment">
3
</div>
</div>
</div>
</div>
</div>
<h2 class="ui dividing header">Dropdowns</h2>
<div class="dropdown example">
<h4 class="ui header">Multiple Selection</h4>
<p>Multiple select dropdowns are now available, and can generate automatically from standard html selects. </p>
<p>Dropdowns all now support advanced keyboard shortcuts like <code>pagedown</code>, <code>delete</code>, <code>shift+left</code> <code>ctrl+click</code>, and selection using first letter of item.</p>
<select class="ui fluid dropdown" multiple>
<%- @partial('examples/single/state-options') %>
</select>
</div>
<div class="user example">
<h4 class="ui header">User Tagging</h4>
<p>All dropdowns, single and multiple now support user tagging. Values can be automatically tokenized in a hidden input, or using a select</p>
<div class="ignored code" data-type="javascript">
$('.ui.dropdown')
.dropdown({
allowAdditions: true
})
;
</div>
<div class="ui fluid 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>
<div class="remote example">
<h4 class="ui header">Remote Data</h4>
<p>All dropdowns now support loading remote data. Selected name value pairs retrieved remotely are stored in <code>sessionStorage</code> to make sure they appear just as retrieved on page refresh.</p>
<div class="ignored code" data-type="javascript">
// somewhere in app
$.api.settings.api = {
queryTags: '//api.semantic-ui.com/tags/{query}'
};
$('.ui.dropdown')
.dropdown({
apiSettings: {
action: 'queryTags'
}
})
;
</div>
<div class="ui form">
<div class="two fields">
<div class="field">
<label>Favorite Animal</label>
<div class="ui search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search">
<div class="default text">Select one...</div>
</div>
</div>
<div class="field">
<label>Favorite Animals</label>
<div class="ui multiple search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search">
<div class="default text">Select...</div>
</div>
</div>
</div>
</div>
</div>
<div class="dropdown example">
<h4 class="ui header">Nested Menus</h4>
<p>Nested scrolling menus are now supported. These menus support all the same keyboard shortcuts and filtering as regular menus.</p>
<div class="ui floating dropdown labeled icon button">
<i class="filter icon"></i>
<span class="text">Filter Posts</span>
<div class="menu">
<div class="ui icon search input">
<i class="search icon"></i>
<input type="text" placeholder="Search tags...">
</div>
<div class="divider"></div>
<div class="header">
<i class="tags icon"></i>
Tag Label
</div>
<div class="scrolling menu">
<div class="item">
<div class="ui red empty circular label"></div>
Important
</div>
<div class="item">
<div class="ui blue empty circular label"></div>
Announcement
</div>
<div class="item">
<div class="ui black empty circular label"></div>
Cannot Fix
</div>
<div class="item">
<div class="ui purple empty circular label"></div>
News
</div>
<div class="item">
<div class="ui orange empty circular label"></div>
Enhancement
</div>
<div class="item">
<div class="ui yellow empty circular label"></div>
Off Topic
</div>
<div class="item">
<div class="ui pink empty circular label"></div>
Interesting
</div>
<div class="item">
<div class="ui green empty circular label"></div>
Discussion
</div>
</div>
</div>
</div>
</div>
<div class="no example">
<h4 class="ui header">Much More</h4>
<p>Dropdowns support many, many new features, including:</p>
<ul class="ui large bulleted list">
<li>Maximum selection count is supported for multiple selects</li>
<li>Dropdowns will now automatically change direction to open upward if no space is left on the screen</li>
<li>Mutation observers will now watch for changes in menus or the elements they are generated from and will update choices automatically</li>
<li>Elements in all dropdowns can now be "jumped to" by pressing the first letter of the choice</li>
<li>Keyboard shortcuts now include power user shortcuts, <code>shift+select</code> for multiple <code>shift+right</code>, <code>page down</code> and <code>page up</code> and many more.</li>
<li>Custom error messages are now supported with search selects</li>
</ul>
</div>
<h2 class="ui dividing header">Menus</h2>
<div class="example">
<h4 class="ui header">Flexible Menus</h4>
<p>Menus have been completely rewritten to use flexbox. Items inside a menu will automatically adjust to align with other menu items regardless of size.</p>
<div class="ui top attached menu">
<div class="item">
<img src="/images/logo.png">
</div>
<a class="active item">
Bio
</a>
<a class="item">
Photos
</a>
</div>
<div class="ui bottom attached segment">
<img class="ui wireframe image" src="/images/wireframe/paragraph.png">
</div>
</div>
<div class="example">
<h4 class="ui header">Vertical Tabs</h4>
<p>Menus now include a new <code>vertical tabular</code> menu type.</p>
<div class="ui grid">
<div class="four wide column">
<div class="ui vertical fluid tabular menu">
<a class="item active">
Bio
</a>
<a class="item">
Pics
</a>
<a class="item">
Companies
</a>
<a class="item">
Links
</a>
</div>
</div>
<div class="twelve wide stretched column">
<div class="ui segment">
This is an stretched grid column. This segment will always match the tab height
</div>
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">Better Coupling</h4>
<p>Menus now have better coupling with other components like dropdown, search, button, and input.</p>
<div class="ignored code" data-type="javascript">
$('.ui.menu .browse.item')
.popup({
popup : '.classes.popup',
hoverable : true,
position : 'bottom left',
delay : {
show: 300,
hide: 800
}
})
;
</div>
<div class="ignored code" data-type="javascript">
$('.ui.search')
.search({
type: 'category',
apiSettings: {
action: 'categorySearch'
}
})
;
</div>
<div class="ui menu">
<div class="browse link item">Browse</div>
<div class="ui right aligned category search item">
<div class="ui transparent icon input">
<input class="prompt" type="text" placeholder="Search things...">
<i class="search link icon"></i>
</div>
<div class="results"></div>
</div>
</div>
<div class="ui flowing classes popup">
<div class="ui equal width divided grid">
<div class="column">
<h4 class="ui header">Business</h4>
<div class="ui link list">
<a class="item">Design & Urban Ecologies</a>
<a class="item">Fashion Design</a>
<a class="item">Fine Art</a>
<a class="item">Strategic Design</a>
</div>
</div>
<div class="column">
<h4 class="ui header">Liberal Arts</h4>
<div class="ui link list">
<a class="item">Anthropology</a>
<a class="item">Economics</a>
<a class="item">Media Studies</a>
<a class="item">Philosophy</a>
</div>
</div>
<div class="column">
<h4 class="ui header">Social Sciences</h4>
<div class="ui link list">
<a class="item">Food Studies</a>
<a class="item">Journalism</a>
<a class="item">Non Profit Management</a>
</div>
</div>
</div>
</div>
</div>
<h2 class="ui dividing header">API</h2>
<div class="mock example">
<h4 class="ui header">Mocked Responses</h4>
<p>API now supports mocked responses, letting you specify how responses are returned in advance.</p>
<div class="code" data-type="javascript">
$('.toggle.button')
.api({
// lets just pretend this button always returns this JSON
mockResponse: {
success: true
}
})
.state({
text: {
inactive : 'Off',
active : 'On'
}
})
;
</div>
<div class="ui toggle button">
Off
</div>
</div>
<div class="async example">
<h4 class="ui header">Custom Backends</h4>
<p>API can now use custom asynchronous callbacks for resolving API requests, this can let you use other custom XHR backends, or local data to resolve requests.</p>
<div class="code" data-type="javascript">
$('.toggle.button')
.api({
// lets just pretend this button mostly doesnt work
mockResponseAsync: function(settings, callback) {
var
unlikelySuccess = (Math.random() < 0.3),
response = (unlikelySuccess)
? true
: false
;
setTimeout(function() {
callback(response);
}, 500);
}
})
.state({
text: {
inactive : 'Off',
active : 'On'
}
})
;
</div>
<div class="ui toggle button">
Off
</div>
</div>
<div class="remote example">
<h4 class="ui header">Local Caching</h4>
<p>API now supports <code>sessionStorage</code> caching. Using this setting will instantly return results for the same url across a user's session.</p>
<p>Try refreshing the page and searching the same letter, results will appear instantly without a server roundtrip.</p>
<div class="code" data-type="javascript">
$('.ui.dropdown')
.dropdown({
apiSettings: {
cache : 'local',
url: '//api.semantic-ui.com/tags/{query}'
}
})
;
</div>
<div class="ui form">
<div class="field">
<label>Favorite Animal</label>
<div class="ui search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search">
<div class="default text">Select one...</div>
</div>
</div>
</div>
</div>
</div>

8
server/documents/modules/popup.html.eco

@ -326,12 +326,10 @@ themes : ['Default']
<div class="example">
<h4 class="ui header">Wide Popup Menu</h4>
<div class="ignored">
<p>An easier way to display complex content, like a wide popup menu is to have the popup content as a pre- existing part of your page's html.</p>
<p>Using the setting <code>inline: true</code> will let Semantic know to display the next sibling <code>ui popup</code> element after the activator.</p>
<p>An easier way to display complex content, like a wide popup menu is to have the popup content as a pre- existing part of your page's html.</p>
<p>Using the setting <code>inline: true</code> will let Semantic know to display the next sibling <code>ui popup</code> element after the activator.</p>
<p>Tweaking settings like the delay for show, and hide, and making the menu hoverable will help it function more like a dropdown menu</p>
</div>
<p>Tweaking settings like the delay for show, and hide, and making the menu hoverable will help it function more like a dropdown menu</p>
<div class="evaluated code">
$('.example .menu .browse')

26
server/documents/views/item.html.eco

@ -76,8 +76,30 @@ themes : ['Default']
<h2 class="ui dividing header">Content</h2>
<div class="example">
<h4 class="ui header">Image and Content</h4>
<p>A item can contain an image and a content group</p>
<h4 class="ui header">Image</h4>
<p>A item can contain an image</p>
<div class="ui divided items">
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
</div>
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
</div>
<div class="item">
<div class="image">
<img src="/images/wireframe/image.png">
</div>
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">Content</h4>
<p>A item can contain content</p>
<div class="ui divided items">
<div class="item">
<div class="ui tiny image">

2
server/files/javascript/docs.js

@ -72,7 +72,7 @@ semantic.ready = function() {
$example = $('.example'),
$popupExample = $example.not('.no'),
$shownExample = $example.filter('.shown'),
$prerenderedExample = $example.has('.ui.dropdown, .ui.rating, .ui.embed'),
$prerenderedExample = $example.has('.ui.dropdown, .ui.search, .ui.rating, .ui.dimmer, .ui.embed'),
$sidebarButton = $('.fixed.launch.button'),

33
server/files/javascript/icon.js

@ -10,39 +10,6 @@ semantic.icon.ready = function() {
handler
;
// event handlers
handler = {
createTable: function() {
var
$grid = $(this),
columnCount = 5
;
$grid
.find('.column:nth-child('+columnCount+'n+1)')
.each(function() {
var
$group = $(this)
.nextAll(':lt('+ (columnCount - 1) +')')
.andSelf()
;
$group.wrapAll('<div class="row"></div>');
$group.filter('[data-content]').popup({
position: 'top center',
variation: 'large inverted',
transition: 'fade up',
delay: {
show: 200,
hide: 0
}
});
})
.end()
.addClass('middle aligned relaxed')
;
}
};
$grid.each(handler.createTable);
};

107
server/files/javascript/intro.js

@ -0,0 +1,107 @@
semantic.intro = {};
// ready event
semantic.intro.ready = function() {
// selector cache
var handler = {
activate: function() {
if(!$(this).hasClass('dropdown browse')) {
$(this)
.addClass('active')
.closest('.ui.menu')
.find('.item')
.not($(this))
.removeClass('active')
;
}
}
};
// api
$('.mock.example .button')
.api({
// lets just pretend this always works
mockResponse: {
success: true
}
})
.state({
text: {
inactive : 'Off',
active : 'On'
}
})
;
$('.async.example .button')
.api({
// lets just pretend this mostly doesnt work
mockResponseAsync: function(settings, callback) {
var
randomSuccess = (Math.random() < 0.3),
response = (randomSuccess)
? { success: true }
: false
;
setTimeout(function() {
callback(response);
}, 500);
}
})
.state({
text: {
inactive : 'Off',
active : 'On'
}
})
;
// menu
$('.main.container .menu a.item, .main.container .menu .link.item').not('.dropdown.item')
.on('click', handler.activate)
;
$('.ui.menu .browse.item')
.popup({
popup : '.classes.popup',
hoverable : true,
position : 'bottom left',
delay : {
show: 300,
hide: 800
}
})
;
$('.main.container .ui.menu .ui.search')
.search({
type: 'category',
apiSettings: {
action: 'categorySearch'
}
})
;
// dropdowns
$('.dropdown.example .ui.dropdown').dropdown();
$('.user.example .ui.dropdown').dropdown({
allowAdditions: true
});
$('.remote.example .ui.dropdown')
.dropdown({
apiSettings: {
url: '//api.semantic-ui.com/tags/{query}'
}
})
;
};
// attach ready event
$(document)
.ready(semantic.intro.ready)
;

14
server/files/stylesheets/docs.css

@ -70,7 +70,7 @@ code {
font-family: "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace;
font-size: 0.85714em;
font-weight: bold;
padding: 3px 5px;
padding: 0px 5px;
vertical-align: baseline;
}
pre code {
@ -693,11 +693,6 @@ pre code {
#example .main.container > .tab > h2:first-child {
margin-top: 0em;
}
#example .main.container .examples > h2 + p,
#example .main.container > h2 + p,
#example .main.container > .tab > h2 + p {
margin: -2rem 0 2em;
}
/* After Section Header */
#example .example:first-child,
@ -931,6 +926,10 @@ pre code {
animation: none;
}
#example .ui.table .help.icon {
float: right;
}
#example.site .colors.example .column {
padding: 50px 0px;
text-align: center;
@ -1639,9 +1638,6 @@ body.progress.animated .ui.progress .bar {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
#example .right.rail .accordion.menu .active.item {
background-color: transparent;
}
#example .following.menu .menu .active.item {
font-weight: bold;

1
server/partials/examples/single/preset-menu.html

@ -1,4 +1,3 @@
<div class="item" data-value="">Skills</div>
<div class="item" data-value="angular">Angular</div>
<div class="item" data-value="css">CSS</div>
<div class="item" data-value="design">Graphic Design</div>

19
server/partials/inner-menu.html.eco

@ -1,3 +1,4 @@
<% introduction = @getCollection("documents").findAll({type: $in: ['Introduction']},[{title: 1}]).toJSON() %>
<% uiGlobals = @getCollection("documents").findAll({type: $in: ['UI Global']},[{title: 1}]).toJSON() %>
<% uiElements = @getCollection("documents").findAll({type: $in: ['UI Element']},[{title: 1}]).toJSON() %>
<% uiCollections = @getCollection("documents").findAll({type: $in: ['UI Collection']},[{title: 1}]).toJSON() %>
@ -7,13 +8,19 @@
<div class="ui vertical inverted sticky menu">
<a class="item" href="<%= @getZip() %>">
<i class="download icon"></i>
<b>Download</b>
</a>
<a class="item" href="/kitchen-sink.html">
<i class="cubes icon"></i>
<b>UI Examples</b>
<i class="angle right icon"></i>
<b>Getting Started</b>
</a>
<div class="item">
<div class="<%= if @document.elementType is 'introduction' then 'active ' %>header">Introduction</div>
<div class="menu">
<% for element in introduction: %>
<a class="<%= if element.id is @document.id then 'active ' %>item" href="<%= element.url %>">
<%= element.title %>
</a>
<% end %>
</div>
</div>
<div class="item">
<div class="<%= if @document.elementType is 'global' then 'active ' %> header">Globals</div>
<div class="menu">

17
server/partials/sidebar.html.eco

@ -1,3 +1,4 @@
<% introduction = @getCollection("documents").findAll({type: $in: ['Introduction']},[{title: 1}]).toJSON() %>
<% uiGlobals = @getCollection("documents").findAll({type: $in: ['UI Global']},[{title: 1}]).toJSON() %>
<% uiElements = @getCollection("documents").findAll({type: $in: ['UI Element']},[{title: 1}]).toJSON() %>
<% uiCollections = @getCollection("documents").findAll({type: $in: ['UI Collection']},[{title: 1}]).toJSON() %>
@ -13,11 +14,19 @@
<a href="/"><b>UI Docs</b></a>
</div>
<a class="item" href="<%= @getZip() %>">
<i class="download icon"></i> <b>Download</b>
</a>
<a class="item" href="/kitchen-sink.html">
<i class="cubes icon"></i> <b>All UI</b>
<i class="angle right icon"></i>
<b>Getting Started</b>
</a>
<div class="item">
<div class="<%= if @document.elementType is 'introduction' then 'active ' %>header">Introduction</div>
<div class="menu">
<% for element in introduction: %>
<a class="<%= if element.id is @document.id then 'active ' %>item" href="<%= element.url %>">
<%= element.title %>
</a>
<% end %>
</div>
</div>
<div class="item">
<div class="<%= if @document.elementType is 'global' then 'active ' %>header">Globals</div>
<div class="menu">

Loading…
Cancel
Save