Browse Source

Merge branch 'master' of github.com:jlukic/Semantic-UI into popup

Conflicts:
	RELEASE NOTES.md
	build/packaged/css/semantic.min.css
	build/packaged/javascript/semantic.min.js
	rtl/packaged/css/semantic.min.css
	rtl/packaged/javascript/semantic.min.js
pull/2229/head
jlukic 11 years ago
parent
commit
88b5cc4b47
13 changed files with 493 additions and 384 deletions
  1. 2
      CONTRIBUTING.md
  2. 18
      RELEASE NOTES.md
  3. 2
      build/packaged/css/semantic.min.css
  4. 2
      build/packaged/javascript/semantic.min.js
  5. 2
      rtl/packaged/css/semantic.min.css
  6. 2
      rtl/packaged/javascript/semantic.min.js
  7. 745
      server/documents/modules/popup.html.eco
  8. 42
      server/files/javascript/semantic.js
  9. 18
      server/files/stylesheets/semantic.css
  10. 17
      server/partials/header.html.eco
  11. 20
      server/partials/tab-header.html.eco
  12. 2
      src/collections/menu.less
  13. 5
      src/modules/tab.js

2
CONTRIBUTING.md

@ -107,7 +107,7 @@ Docpad should now run an instance of semantic-ui.com locally you can access at `
If you are working on fixing a UI component that is part of Semantic, your best bet is to work actively on the file in `/src/{type}/{elementname}/` while running a watch script from grunt. This will rebuild the docs after you make changes, so you can see if you have corrected the issue you are fixing.
To see exactly what this is doing you can check out our [commented gruntfile](https://github.com/jlukic/Semantic-UI/blob/master/node/Gruntfile.js)
To see exactly what this is doing you can check out our [commented gruntfile](https://github.com/jlukic/Semantic-UI/blob/master/Gruntfile.js)
```bash
grunt

18
RELEASE NOTES.md

@ -1,11 +1,17 @@
## RELEASE NOTES
### Version 0.6.4 - Oct 15, 2013
### Version 0.7.0 - Oct 17, 2013
**New**
- Popups can now have a different target element than itself
- Popups can now have a different target than itself
- Adds onTabInit for local tabs on first load
**Fixes**
- Fixes border radius on tabular menu
- Removes vertical label width line missing units
- Fixes pointing dropdown to appear correctly in menu
- Fixes issue with borders on selection dropdown
- Popup fixed a bug where "top right" placed popup might sometimes be too large
- Popup will not reshow a visible popup on hover
- Popup .toggle() now always hides/shows popup correctly
@ -15,12 +21,18 @@
**Updates**
- Ribbon labels now have a shadow color
- Popups are no longer inline by default
- Optimizes dimmer init on modal to occur on modal init and not modal show
- Popup metadata attribute arrowOffset is now offset for simplicities sake
- Adds more popup examples
- Popup default duration is now 200ms (slighty slower)
- Popup border now uses RGBA to look sexier on dark backgrounds
- Popup no-longer receives class name 'visible' on show, this allows popups to be used on dropdowns and other elements with a visible state
- Optimizes dimmer init on modal to occur on modal init and not modal show
### Version 0.6.4 - Oct 16, 2013
**Fixes**
- Fixes issue where browser default action, like link clicking, was prevented on dropdown item click
### Version 0.6.3 - Oct 15, 2013

2
build/packaged/css/semantic.min.css
File diff suppressed because it is too large
View File

2
build/packaged/javascript/semantic.min.js
File diff suppressed because it is too large
View File

2
rtl/packaged/css/semantic.min.css
File diff suppressed because it is too large
View File

2
rtl/packaged/javascript/semantic.min.js
File diff suppressed because it is too large
View File

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

@ -8,99 +8,114 @@ type : 'UI Module'
---
<script src="/javascript/popup.js"></script>
<%- @partial('header') %>
<%- @partial('header', { tabs: 'module' }) %>
<div class="main container">
<div class="peek">
<div class="ui vertical pointing secondary menu">
<a class="active item">Usage</a>
<a class="item">Types</a>
<a class="item">Variations</a>
<a class="item">Examples</a>
<a class="item">Settings</a>
<div class="ui active tab" data-tab="definition">
<div class="peek">
<div class="ui vertical pointing secondary menu">
<a class="active item">Types</a>
<a class="item">Variations</a>
</div>
</div>
<h2 class="ui dividing header">Types</h2>
<div class="example">
<h3 class="ui header">Popup</h3>
<p>A standard popup</p>
<i class="large heart circular icon link" data-content="Hello, I am a pop-up."></i>
</div>
<div class="example">
<h3 class="ui header">Title</h3>
<p>A popup can be formatted with a title</p>
<i class="circular heart icon link" data-title="Dog Breeds" data-content="There are many types of dogs. We don't have time to list them all"></i>
</div>
<div class="example">
<h3 class="ui header">HTML</h3>
<p>A popup can be formatted with html</p>
<i class="circular heart icon link" data-html="<div class='ui red button'>Button</div>"></i>
</div>
<h2 class="ui dividing header">Variations</h2>
<div class="example">
<h3 class="ui header">Size</h3>
<p>A popup can be large or small</p>
<i class="circular heart icon link" data-content="Hello. This is a small popup" data-variation="small"></i>
<i class="circular heart icon link" data-content="Hello. This is a large popup" data-variation="large"></i>
</div>
<div class="example">
<h3 class="ui header">Inverted</h3>
<p>A popup can have its colors inverted</p>
<i class="circular heart icon link" data-content="Hello. This is an inverted popup" data-variation="inverted"></i>
</div>
</div>
<h2 class="ui dividing header">Usage</h2>
<h4 class="ui header">Initializing an popup</h4>
<div class="code">
<div class="ui tab" data-tab="usage">
<h2 class="ui dividing header">Usage</h2>
<h3 class="ui header">Initializing an popup</h3>
<div class="code">
$('.ui.popup')
.popup()
;
</div>
</div>
<div class="no example">
<h4 class="ui header">Including metadata</h4>
<p>Frequently used metadata like, title, content, html, or offset or variation, can be included in html metadata<p>
<div class="ui info icon ignored message">
<i class="info icon"></i>
<div class="content">
<div class="header">Specifying Content</div>
<p>Popups can specify content in three ways:<p>
<ul class="list">
<li>Using html <code>title</code> attribute</li>
<li>Using <code>data-content</code> attribute</li>
<li>Using the content property in the initialization of the popup</li>
</ul>
<div class="no example">
<h3 class="ui header">Including content with HTML Metadata</h3>
<p>Frequently used settings like, title, content, html, or offset or variation, can be included in html metadata<p>
<div class="ui info icon ignored message">
<i class="info icon"></i>
<div class="content">
<div class="header">Specifying Content</div>
<p>Popups can specify content in three ways:<p>
<ul class="list">
<li>Using html <code>title</code> attribute</li>
<li>Using <code>data-content</code> attribute</li>
<li>Using <code>data-html</code> for specific html</li>
<li>Using the content property in the initialization of the popup</li>
</ul>
<p>Popups can also specify some other frequently used settings using metadata<p>
<ul class="list">
<li><code>data-variation</code>: the popup variation to use </li>
<li><code>data-offset</code>: a pixel offset correction for popup</li>
<li><code>data-position</code>: the side to position popup on</li>
<li><code>data-variation</code>: the popup variation to use </li>
</ul>
</div>
</div>
</div>
<div class="code" data-type="html">
<i class="heart icon" title="Hello I am a popup"></i>
</div>
<div class="ui horizontal divider">Or</div>
<div class="code">
<h4 class="ui header">Initializing with javascript content</h4>
<div class="code" data-type="html">
<i class="heart icon" title="Hello I am a popup"></i>
</div>
<div class="ui horizontal divider">Or</div>
<h4 class="ui header">Initializing with metadata</h4>
<div class="code">
$('.ui.popup')
.popup({
content: 'Hello I am a popup'
})
;
</div>
</div>
</div>
</div>
<h2 class="ui dividing header">Types</h2>
<div class="example">
<h4 class="ui header">Popup</h4>
<p>A standard popup</p>
<i class="large heart circular icon link" data-content="Hello, I am a pop-up."></i>
</div>
<div class="example">
<h4 class="ui header">Title</h4>
<p>A popup can be formatted with a title</p>
<i class="circular heart icon link" data-title="Dog Breeds" data-content="There are many types of dogs. We don't have time to list them all"></i>
</div>
<div class="example">
<h4 class="ui header">HTML</h4>
<p>A popup can be formatted with html</p>
<i class="circular heart icon link" data-html="<div class='ui red button'>Button</div>"></i>
</div>
<h2 class="ui dividing header">Variations</h2>
<div class="example">
<h4 class="ui header">Size</h4>
<p>A popup can be large or small</p>
<i class="circular heart icon link" data-content="Hello. This is a small popup" data-variation="small"></i>
<i class="circular heart icon link" data-content="Hello. This is a large popup" data-variation="large"></i>
</div>
<div class="example">
<h4 class="ui header">Inverted</h4>
<p>A popup can have its colors inverted</p>
<i class="circular heart icon link" data-content="Hello. This is an inverted popup" data-variation="inverted"></i>
</div>
<div class="ui tab" data-tab="examples">
<h2 class="ui dividing header">Examples</h2>
<h2 class="ui dividing header">Examples</h2>
<div class="example">
<h4 class="ui header">Specifying a trigger event</h4>
<p>A popup trigger event can be specified</p>
<div class="evaluated code">
<div class="example">
<h3 class="ui header">Specifying a trigger event</h3>
<p>A popup trigger event can be specified</p>
<div class="evaluated code">
$('.example .teal.button')
.popup({
on: 'click'
@ -111,18 +126,18 @@ type : 'UI Module'
on: 'focus'
})
;
</div>
<div class="ui teal button" data-title="Using click events" data-content="Clicked popups will close if you click away, but not if you click inside the popup">Click Me</div>
<div class="ui icon input">
<input type="text" placeholder="Focus me..." data-content="You can use me to enter data">
<i class="search icon"></i>
</div>
</div>
<div class="ui teal button" data-title="Using click events" data-content="Clicked popups will close if you click away, but not if you click inside the popup">Click Me</div>
<div class="ui icon input">
<input type="text" placeholder="Focus me..." data-content="You can use me to enter data">
<i class="search icon">
</i>
</div>
<div class="example">
<h4 class="ui header">Target Element</h4>
<p>A popup can specify a different target element than itself to show a popup</p>
<div class="evaluated code">
<div class="example">
<h3 class="ui header">Target Element</h3>
<p>A popup can specify a different target element than itself to show a popup</p>
<div class="evaluated code">
$('.test.button')
.popup({
position : 'top right',
@ -131,80 +146,80 @@ type : 'UI Module'
content : 'My favorite dog would like other dogs as much as themself'
})
;
</div>
<div class="ui basic test button">Hover Me</div>
<div class="ui divider"></div>
<img class="medium ui test image" src="/images/demo/photo.jpg">
<h4 class="ui header">Inline or relative to page</h4>
<p>A popup can either be inserted directly after an element, or added as a child element to the page's <code>body</code>.</p>
<div class="ui warning message">
An inline popup will remain in your page's html after being hidden, while a non-inline popup will remove itself after being hidden.
</div>
<div class="ui info message">
If you want to style each popup individually it makes sense to keep popup <code>inline: true</code>. If you are worried that your pop up might mistakingly inherit styles that it shouldn't, you should set <code>inline: false</code>.
</div>
<div class="code" data-type="css">
</div>
<div class="ui basic test button">Hover Me</div>
<div class="ui divider"></div>
<img class="medium ui test image" src="/images/demo/photo.jpg">
<h3 class="ui header">Inline or relative to page</h3>
<p>A popup can either be inserted directly after an element, or added as a child element to the page's <code>body</code>.</p>
<div class="ui warning message">
An inline popup will remain in your page's html after being hidden, while a non-inline popup will remove itself after being hidden.
</div>
<div class="ui info message">
If you want to style each popup individually it makes sense to keep popup <code>inline: true</code>. If you are worried that your pop up might mistakingly inherit styles that it shouldn't, you should set <code>inline: false</code>.
</div>
<div class="code" data-type="css">
/* this will only style the popup if inline is true */
.example .popup {
color: #FF0000;
}
</div>
<div class="evaluated code">
</div>
<div class="evaluated code">
$('.inline.icon')
.popup({
inline: true
})
;
</div>
<i class="heart circular icon link" data-content="This is a child element to the page's body and will not be styled" ></i>
<i class="mail inline circular icon link" data-content="This popup was inserted inline and will be styled" ></i>
</div>
<i class="heart circular icon link" data-content="This is a child element to the page's body and will not be styled" ></i>
<i class="mail inline circular icon link" data-content="This popup was inserted inline and will be styled" ></i>
</div>
<div class="position example">
<h4 class="ui header">Positioning</h4>
<p>A popup can be positioned to any side of an element. If space is not available, it will automatically search for a similar alternative position to use.</p>
<div class="ui segment">
<i class="square inverted red heart icon link" data-content="Top Left" data-position="top left"></i>
<i class="square inverted red heart icon link" data-content="Top Center" data-position="top center"></i>
<i class="square inverted red heart icon link" data-content="Top Right" data-position="top right"></i>
<i class="square inverted red heart icon link" data-content="Right Center" data-position="right center"></i>
<i class="square inverted red heart icon link" data-content="Bottom Right" data-position="bottom right"></i>
<i class="square inverted red heart icon link" data-content="Bottom Center" data-position="bottom center"></i>
<i class="square inverted red heart icon link" data-content="Bottom Left" data-position="bottom left"></i>
<i class="square inverted red heart icon link" data-content="Left Center" data-position="left center"></i>
</div>
</div>
<div class="example">
<h4 class="ui header">Specifying an offset</h4>
<p>A popup position can be adjusted manually by specifying an offset propery using <code>data-offset="value"</code></p>
<i class="heart circular icon link" data-offset="50" data-content="As expected this popup is way off to the right"></i>
</div>
<div class="position example">
<h3 class="ui header">Positioning</h3>
<p>A popup can be positioned to any side of an element. If space is not available, it will automatically search for a similar alternative position to use.</p>
<div class="ui segment">
<i class="square inverted red heart icon link" data-content="Top Left" data-position="top left"></i>
<i class="square inverted red heart icon link" data-content="Top Center" data-position="top center"></i>
<i class="square inverted red heart icon link" data-content="Top Right" data-position="top right"></i>
<i class="square inverted red heart icon link" data-content="Right Center" data-position="right center"></i>
<i class="square inverted red heart icon link" data-content="Bottom Right" data-position="bottom right"></i>
<i class="square inverted red heart icon link" data-content="Bottom Center" data-position="bottom center"></i>
<i class="square inverted red heart icon link" data-content="Bottom Left" data-position="bottom left"></i>
<i class="square inverted red heart icon link" data-content="Left Center" data-position="left center"></i>
</div>
</div>
<div class="example">
<h3 class="ui header">Specifying an offset</h3>
<p>A popup position can be adjusted manually by specifying an offset propery using <code>data-offset="value"</code></p>
<div class="no example">
<h4 class="ui header">Transitions</h4>
<p>A popup can use any named ui transition.</p>
<i class="large demo home circular link icon" data-title="Home" data-content="The place where you keep your dog"></i> Home
<i class="heart circular icon link" data-offset="50" data-content="As expected this popup is way off to the right"></i>
</div>
<div class="ui divider"></div>
<div class="ui selection dropdown">
<input type="hidden" name="transition">
<i class="dropdown icon"></i>
<div class="default text">Choose a transition</div>
<div class="menu">
<div class="item">Horizontal Flip</div>
<div class="item">Vertical Flip</div>
<div class="item">Fade Up</div>
<div class="item">Fade</div>
<div class="item">Scale</div>
<div class="no example">
<h3 class="ui header">Transitions</h3>
<p>A popup can use any named ui transition.</p>
<i class="large demo home circular link icon" data-title="Home" data-content="The place where you keep your dog"></i> Home
<div class="ui divider"></div>
<div class="ui selection dropdown">
<input type="hidden" name="transition">
<i class="dropdown icon"></i>
<div class="default text">Choose a transition</div>
<div class="menu">
<div class="item">Horizontal Flip</div>
<div class="item">Vertical Flip</div>
<div class="item">Fade Up</div>
<div class="item">Fade</div>
<div class="item">Scale</div>
</div>
</div>
</div>
<div class="ui clearing divider"></div>
<div class="evaluated code">
<div class="ui clearing divider"></div>
<div class="evaluated code">
$('.selection')
.dropdown({
onChange: function(value) {
@ -217,196 +232,200 @@ type : 'UI Module'
}
})
;
</div>
</div>
</div>
<h2 class="ui dividing header">Behavior</h2>
All the following behaviors can be called using the syntax <code>$('.foo').sidebar('behavior name', argumentOne, argumentTwo)</code>
<table class="ui definition celled table segment">
<tr>
<td>attach events(selector, event)</td>
<td>Attaches sidebar action to given selector. Default event if none specified is toggle</td>
</tr>
<tr>
<td>show</td>
<td>Shows popup</td>
</tr>
<tr>
<td>hide</td>
<td>Hides popup</td>
</tr>
<tr>
<td>hide all</td>
<td>Hides all visible pop ups on the page</td>
</tr>
<tr>
<td>toggle</td>
<td>Toggles visibility of popup</td>
</tr>
<tr>
<td>is visible</td>
<td>Returns whether popup is visible</td>
</tr>
<tr>
<td>is hidden</td>
<td>Returns whether popup is hidden</td>
</tr>
<tr>
<td>exists</td>
<td>Returns whether popup is created and inserted into the page</td>
</tr>
<tr>
<td>set position</td>
<td>Repositions a popup</td>
</tr>
<tr>
<td>remove</td>
<td>Removes popup from the page</td>
</tr>
</table>
<h2 class="ui dividing header">Settings</h2>
<h3 class="ui header">
Popup Settings
<div class="sub header">Settings to configure popup behavior</div>
</h3>
<table class="ui red celled definition table segment">
<thead>
<th>Setting</th>
<th class="four wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>position</td>
<td>top center</td>
<td>Position that the popup should appear</td>
</tr>
<tr>
<td>inline</td>
<td>false</td>
<td>If a popup is inline it will be created next to current element, allowing for local css rules to apply. It will not be removed from the DOM after being hidden. Otherwise popups will appended to body and removed after being hidden.</td>
</tr>
<tr>
<td>preserve</td>
<td>false</td>
<td>Whether popup contents should be preserved in the page after being hidden, allowing it to re-appear slightly faster on subsequent loads.</td>
</tr>
<tr>
<td>on</td>
<td>hover</td>
<td>Event used to trigger popup. Can be either <b>focus, click or hover</b></td>
</tr>
<tr>
<td>delay</td>
<td>150</td>
<td>Delay in milliseconds before showing a popup when using hover or focus events.</td>
</tr>
<tr>
<td>transition</td>
<td>
slide down
</td>
<td>Named transition to use when animating menu in and out. Fade and slide down are available without including <a href="/modules/transition.html">ui transitions</a></td>
</tr>
<tr>
<td>duration</td>
<td>
250
</td>
<td>Duration of animation events</td>
</tr>
<div class="ui tab" data-tab="behaviors">
<h2 class="ui dividing header">Behavior</h2>
All the following behaviors can be called using the syntax <code>$('.foo').sidebar('behavior name', argumentOne, argumentTwo)</code>
<table class="ui definition celled table segment">
<tr>
<td>closable</td>
<td>true</td>
<td>When using <code>on: 'click'</code> specifies whether clicking the page should close the popup</td>
<td>attach events(selector, event)</td>
<td>Attaches sidebar action to given selector. Default event if none specified is toggle</td>
</tr>
<tr>
<td>target</td>
<td>false</td>
<td>If a selector or jQuery object is specified this allows the popup to be positioned relative to that element.</td>
<td>show</td>
<td>Shows popup</td>
</tr>
<tr>
<td>distanceAway</td>
<td>0</td>
<td>Offset for distance of popup from element</td>
<td>hide</td>
<td>Hides popup</td>
</tr>
<tr>
<td>offset</td>
<td>0</td>
<td>Offset in pixels from calculated position</td>
<td>hide all</td>
<td>Hides all visible pop ups on the page</td>
</tr>
<tr>
<td>maxSearchDepth</td>
<td>10</td>
<td>Number of iterations before giving up search for popup position when a popup cannot fit on screen</td>
<td>toggle</td>
<td>Toggles visibility of popup</td>
</tr>
</tbody>
</table>
<h3 class="ui header">
Content Settings
<div class="sub header">Settings to specify popup contents</div>
</h3>
<table class="ui red celled definition table segment">
<thead>
<th>Setting</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>variation</td>
<td>Popup variation to use, can use multiple variations with a space delimiter</td>
<td>is visible</td>
<td>Returns whether popup is visible</td>
</tr>
<tr>
<td>content</td>
<td>Content to display</td>
<td>is hidden</td>
<td>Returns whether popup is hidden</td>
</tr>
<tr>
<td>title</td>
<td>Title to display alongside content</td>
<td>exists</td>
<td>Returns whether popup is created and inserted into the page</td>
</tr>
<tr>
<td>html</td>
<td>HTML content to display instead of preformatted title and content</td>
<td>set position</td>
<td>Repositions a popup</td>
</tr>
</tbody>
</table>
<h3 class="ui header">
DOM Settings
<div class="sub header">DOM settings specify how this module should interface with the DOM</div>
</h3>
<table class="ui celled purple definition table segment">
<thead>
<th>Setting</th>
<th class="six wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>namespace</td>
<td>popup</td>
<td>Event namespace. Makes sure module teardown does not effect other events attached to an element.</td>
<td>remove</td>
<td>Removes popup from the page</td>
</tr>
<tr>
<td>selector</td>
<td>
<div class="code">
</table>
</div>
<div class="ui tab" data-tab="settings">
<h2 class="ui dividing header">Settings</h2>
<h3 class="ui header">
Popup Settings
<div class="sub header">Settings to configure popup behavior</div>
</h3>
<table class="ui red celled definition table segment">
<thead>
<th>Setting</th>
<th class="four wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>position</td>
<td>top center</td>
<td>Position that the popup should appear</td>
</tr>
<tr>
<td>inline</td>
<td>false</td>
<td>If a popup is inline it will be created next to current element, allowing for local css rules to apply. It will not be removed from the DOM after being hidden. Otherwise popups will appended to body and removed after being hidden.</td>
</tr>
<tr>
<td>preserve</td>
<td>false</td>
<td>Whether popup contents should be preserved in the page after being hidden, allowing it to re-appear slightly faster on subsequent loads.</td>
</tr>
<tr>
<td>on</td>
<td>hover</td>
<td>Event used to trigger popup. Can be either <b>focus, click or hover</b></td>
</tr>
<tr>
<td>delay</td>
<td>150</td>
<td>Delay in milliseconds before showing a popup when using hover or focus events.</td>
</tr>
<tr>
<td>transition</td>
<td>
slide down
</td>
<td>Named transition to use when animating menu in and out. Fade and slide down are available without including <a href="/modules/transition.html">ui transitions</a></td>
</tr>
<tr>
<td>duration</td>
<td>
250
</td>
<td>Duration of animation events</td>
</tr>
<tr>
<td>closable</td>
<td>true</td>
<td>When using <code>on: 'click'</code> specifies whether clicking the page should close the popup</td>
</tr>
<tr>
<td>target</td>
<td>false</td>
<td>If a selector or jQuery object is specified this allows the popup to be positioned relative to that element.</td>
</tr>
<tr>
<td>distanceAway</td>
<td>0</td>
<td>Offset for distance of popup from element</td>
</tr>
<tr>
<td>offset</td>
<td>0</td>
<td>Offset in pixels from calculated position</td>
</tr>
<tr>
<td>maxSearchDepth</td>
<td>10</td>
<td>Number of iterations before giving up search for popup position when a popup cannot fit on screen</td>
</tr>
</tbody>
</table>
<h3 class="ui header">
Content Settings
<div class="sub header">Settings to specify popup contents</div>
</h3>
<table class="ui red celled definition table segment">
<thead>
<th>Setting</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>variation</td>
<td>Popup variation to use, can use multiple variations with a space delimiter</td>
</tr>
<tr>
<td>content</td>
<td>Content to display</td>
</tr>
<tr>
<td>title</td>
<td>Title to display alongside content</td>
</tr>
<tr>
<td>html</td>
<td>HTML content to display instead of preformatted title and content</td>
</tr>
</tbody>
</table>
<h3 class="ui header">
DOM Settings
<div class="sub header">DOM settings specify how this module should interface with the DOM</div>
</h3>
<table class="ui celled purple definition table segment">
<thead>
<th>Setting</th>
<th class="six wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>namespace</td>
<td>popup</td>
<td>Event namespace. Makes sure module teardown does not effect other events attached to an element.</td>
</tr>
<tr>
<td>selector</td>
<td>
<div class="code">
selector : {
popup : '.ui.popup'
}
</div>
</td>
<td>DOM Selectors used internally</td>
</tr>
<tr>
<td>metadata</td>
<td>
<div class="code">
</div>
</td>
<td>DOM Selectors used internally</td>
</tr>
<tr>
<td>metadata</td>
<td>
<div class="code">
metadata: {
content : 'content',
html : 'html',
@ -415,75 +434,77 @@ type : 'UI Module'
title : 'title',
variation : 'variation'
}
</div>
</td>
<td>HTML Data attributes used to store data</td>
</tr>
<tr>
<td>className</td>
<td>
<div class="code">
</div>
</td>
<td>HTML Data attributes used to store data</td>
</tr>
<tr>
<td>className</td>
<td>
<div class="code">
className : {
loading : 'loading',
popup : 'ui popup',
position : 'top left center bottom right',
visible : 'visible'
}
</div>
</td>
<td>Class names used to attach style to state</td>
</tr>
</tbody>
</table>
<div class="ui horizontal divider"><i class="icon setting"></i></div>
<h3 class="ui header">
Debug Settings
<div class="sub header">Debug settings controls debug output to the console</div>
</h3>
<table class="ui blue celled definition table segment">
<thead>
<th>Setting</th>
<th class="four wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>name</td>
<td>Sidebar</td>
<td>Name used in debug logs</td>
</tr>
<tr>
<td>debug</td>
<td>True</td>
<td>Provides standard debug output to console</td>
</tr>
<tr>
<td>performance</td>
<td>True</td>
<td>Provides standard debug output to console</td>
</tr>
<tr>
<td>verbose</td>
<td>True</td>
<td>Provides ancillary debug output to console</td>
</tr>
<tr>
<td>errors</td>
<td colspan="2">
<div class="code">
</div>
</td>
<td>Class names used to attach style to state</td>
</tr>
</tbody>
</table>
<div class="ui horizontal divider"><i class="icon setting"></i></div>
<h3 class="ui header">
Debug Settings
<div class="sub header">Debug settings controls debug output to the console</div>
</h3>
<table class="ui blue celled definition table segment">
<thead>
<th>Setting</th>
<th class="four wide">Default</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>name</td>
<td>Sidebar</td>
<td>Name used in debug logs</td>
</tr>
<tr>
<td>debug</td>
<td>True</td>
<td>Provides standard debug output to console</td>
</tr>
<tr>
<td>performance</td>
<td>True</td>
<td>Provides standard debug output to console</td>
</tr>
<tr>
<td>verbose</td>
<td>True</td>
<td>Provides ancillary debug output to console</td>
</tr>
<tr>
<td>errors</td>
<td colspan="2">
<div class="code">
error: {
content : 'Your popup has no content specified',
method : 'The method you called is not defined.',
recursion : 'Popup attempted to reposition element to fit, but could not find an adequate position.'
}
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>

42
server/files/javascript/semantic.js

@ -26,16 +26,22 @@ semantic.ready = function() {
// selector cache
var
$peek = $('.peek'),
$peekItem = $peek.children('.menu').children('a.item'),
$peekSubItem = $peek.find('.item .menu .item'),
$ui = $('.ui').not('.hover, .down'),
$swap = $('.theme.menu .item'),
$menu = $('#menu'),
$hideMenu = $('#menu .hide.item'),
$sortTable = $('.sortable.table'),
$demo = $('.demo'),
$waypoints = $('.main.container').find('h2').first().siblings('h2').addBack(),
$waypoints = $peek.closest('.tab, .container').find('h2').first().siblings('h2').addBack(),
$menuPopup = $('.ui.main.menu .popup.item'),
$menuDropdown = $('.ui.main.menu .dropdown'),
$pageTabs = $('.tab.segment .tabular.menu .item'),
$downloadDropdown = $('.download.buttons .dropdown'),
@ -53,9 +59,6 @@ semantic.ready = function() {
$increaseFont = $('.font .increase'),
$decreaseFont = $('.font .decrease'),
$peek = $('.peek'),
$peekItem = $peek.children('.menu').children('a.item'),
$peekSubItem = $peek.find('.item .menu .item'),
$code = $('div.code').not('.existing'),
$existingCode = $('.existing.code'),
@ -336,6 +339,19 @@ semantic.ready = function() {
;
},
makeCode: function() {
if(window.ace !== undefined) {
$code
.filter(':visible')
.each(handler.initializeCode)
;
$existingCode
.filter(':visible')
.each(handler.createAnnotation)
;
}
},
initializeCode: function() {
var
$code = $(this).show(),
@ -522,7 +538,7 @@ semantic.ready = function() {
$menu = $header.parent(),
$subHeaderGroup = $header.find('.item'),
$headerGroup = $menu.children(),
$waypoint = $('h2').eq( $headerGroup.index( $header ) )
$waypoint = $('h2').eq( $headerGroup.index( $header ) ),
$subWaypoint = $waypoint.nextAll('h3').eq( $subHeaderGroup.index($subHeader) ),
offset = $subWaypoint.offset().top - 80
;
@ -598,14 +614,18 @@ semantic.ready = function() {
;
}
if(window.ace !== undefined) {
$code
.each(handler.initializeCode)
;
$existingCode
.each(handler.createAnnotation)
if( $pageTabs.size() > 0 ) {
$pageTabs
.tab({
history: false,
onTabInit: handler.makeCode
})
;
}
else {
handler.makeCode();
}
handler.createIcon();

18
server/files/stylesheets/semantic.css

@ -94,11 +94,12 @@ pre {
background-color: #F0F0F0;
}
code {
background-color: #F0F0F0;
border: 1px solid #E0E0E0;
background-color: rgba(0, 0, 0, 0.07);
border: 1px solid rgba(0, 0, 0, 0.1);
display: inline-block;
font-family: Courier New;
font-size: 14px;
margin: 0.25em;
padding: 0.125em 0.25em;
vertical-align: middle;
}
@ -155,6 +156,19 @@ a:hover {
background-color: #FFFFFF;
border-bottom: 1px solid #DDDDDD;
}
#example > .tab.segment {
padding-bottom: 0em;
}
#example > .tab.segment .tabular.menu {
margin: 2rem 0em 0em;
border-bottom: none;
}
#example > .tab.segment .tabular.menu .active.item {
background-color: #FAFAFA;
}
#example .download.menu {
margin-top: 0em;
margin-bottom: 3rem;

17
server/partials/header.html.eco

@ -1,10 +1,14 @@
<div class="segment">
<% @tabs = { definition: 'Definition', usage: 'Usage', examples: 'Examples', behaviors: 'Behaviors', settings: 'Settings' } if @tabs == 'module' %>
<div class="<% if @tabs?: %>tab <% end %>segment">
<div class="container">
<div class="introduction">
<h1 class="ui dividing header">
<%=@document.title %>
<% if @document.status?: %><span class="ui label"><%= @document.status %></span><% end %>
</h1>
<p><%=@document.description %></p>
<% if @document.type is 'UI Element' or @document.type is 'UI View' or @document.type is 'UI Collection' or @document.type is 'UI Module': %>
<div class="ui basic labeled icon toggle overview button">
@ -12,6 +16,17 @@
<i class="book icon"></i>
</div>
<% end %>
<% index = 0 %>
<% if @tabs?: %>
<div class="ui tabular menu">
<% for id, name of @tabs: %>
<a class="<%= if index == 0 then 'active ' %>item" data-tab="<%= id %>"><%= name %></a>
<% index++ %>
<% end %>
</div>
<% end %>
</div>
<div class="advertisement">
<div id="carbonads-container"><div class="carbonad"><div id="azcarbon"></div><script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/51619/azcarbon_2_1_0_HORIZ"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script></div></div>

20
server/partials/tab-header.html.eco

@ -0,0 +1,20 @@
<div class="tab segment">
<div class="container">
<div class="introduction">
<h1 class="ui dividing header">
<%=@document.title %>
<% if @document.status?: %><span class="ui label"><%= @document.status %></span><% end %>
</h1>
<p><%=@document.description %></p>
<% if @document.type is 'UI Element' or @document.type is 'UI View' or @document.type is 'UI Collection' or @document.type is 'UI Module': %>
<div class="ui basic labeled icon toggle overview button">
Definition
<i class="book icon"></i>
</div>
<% end %>
</div>
<div class="advertisement">
<div id="carbonads-container"><div class="carbonad"><div id="azcarbon"></div><script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/51619/azcarbon_2_1_0_HORIZ"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script></div></div>
</div>
</div>
</div>

2
src/collections/menu.less

@ -688,6 +688,8 @@
background-color: transparent;
border-bottom: 1px solid #DCDDDE;
border-radius: 0em;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;

5
src/modules/tab.js

@ -234,6 +234,11 @@
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
if( !module.cache.read(currentPath) ) {
module.debug('First time tab loaded calling tab init');
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
module.cache.add(currentPath, true);
}
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
}

Loading…
Cancel
Save