Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options grid update and cleanup #423

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions css/main.css
Expand Up @@ -350,6 +350,12 @@ body
.bb-api-sidebar .bb-api-sidenav .nav
{
margin-left: 1em;
display: none;
}

.bb-api-sidebar .bb-api-sidenav li.active .nav
{
display: block;
}

.bb-api-sidebar .bb-api-sidenav .nav a
Expand Down
119 changes: 93 additions & 26 deletions documentation.html
Expand Up @@ -7,8 +7,7 @@
<title>Documentation | Bootbox.js&mdash;alert, confirm and flexible dialogs for the Bootstrap framework</title>

<!-- CSS dependencies -->
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" media="screen" />
<!--<link rel="stylesheet" type="text/css" href="vendor/css/google.prettify.min.css" />-->
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="vendor/css/github.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script>
Expand Down Expand Up @@ -212,6 +211,7 @@ <h4 id="bb-prompt-dialog-options">Prompt options</h4>
<pre class="prettyprint linenums"><code>bootbox.prompt({
size: 'small',
message: "Your message here&hellip;",
value: 'This is the initial value',
callback: function(result){ /* your callback code */ }
})</code></pre>
</section>
Expand Down Expand Up @@ -272,7 +272,7 @@ <h2>Dialog Options</h2>
</tr>
</thead>
<tbody>
<tr>
<tr id="bb-option-message">
<td>
<p>message</p>
<span class="label label-danger">
Expand All @@ -286,7 +286,7 @@ <h2>Dialog Options</h2>
</p>
</td>
</tr>
<tr>
<tr id="bb-option-title">
<td>title</td>
<td>String | Element</td>
<td>
Expand All @@ -295,15 +295,26 @@ <h2>Dialog Options</h2>
</p>
</td>
</tr>
<tr>
<td>locale</td>
<tr id="bb-option-value">
<td>
value
</td>
<td>String</td>
<td>
<p>The default value of the prompt dialog's input element.</p>
<p>
The locale settings used to translate the three standard button labels: OK, CONFIRM, CANCEL
<b>Only valid for prompts.</b>
</p>
<hr />
<p>Default: <code>null</code></p>
</td>
</tr>
<tr id="bb-option-locale">
<td>locale</td>
<td>String</td>
<td>
<p>
Default: <code>en</code>
The locale settings used to translate the three standard button labels: OK, CONFIRM, CANCEL
</p>
<p>Currently available:</p>
<ul class="bb-locales-list">
Expand Down Expand Up @@ -339,9 +350,13 @@ <h2>Dialog Options</h2>
<li><code>zh_CN</code></li>
<li><code>zh_TW</code></li>
</ul>
<hr />
<p>
Default: <code>en</code>
</p>
</td>
</tr>
<tr>
<tr id="bb-option-callback">
<td>
<p>callback</p>
<span class="label label-danger">
Expand All @@ -350,23 +365,25 @@ <h2>Dialog Options</h2>
</td>
<td>Function</td>
<td>
<p class="bg-info">
* Alerts do not require a callback.
<p>
* Alerts <b>do not</b> require a callback.
</p>
<p>
An alert callback should not supply an argument; it will be ignored if it does:
</p>
<pre class="prettyprint"><code>bootbox.alert({ message: "I'm an alert!", callback: function() {} })</code></pre>
<hr />
<p>
Confirm and prompt callbacks must supply an argument for the result.
</p>
<p>
Confirm and prompt callbacks must supply an argument for the result; for confirm, it will be
a <code>true</code> or <code>false</code> value, while the prompt result will hold the value
entered by the user:
For confirm, <code>result</code> will be a <code>true</code> or <code>false</code> value:
</p>
<pre class="prettyprint linenums"><code>bootbox.confirm("Are you sure?", function(result) {
// result will be true or false
}); </code></pre>
<p>
or
For prompt, <code>result</code> will hold the value entered by the user (or <code>null</code> if it was dismissed):
</p>
<pre class="prettyprint linenums"><code>bootbox.prompt("What is your name?", function(result) {
if (result === null) {
Expand All @@ -375,12 +392,13 @@ <h2>Dialog Options</h2>
// result has a value
}
}); </code></pre>
<hr />
<p>
Default: <code>null</code>
</p>
</td>
</tr>
<tr>
<tr id="bb-option-onEscape">
<td>onEscape</td>
<td>Boolean | Function</td>
<td>
Expand All @@ -406,26 +424,28 @@ <h4>Options:</h4>
<td>Hitting the <kbd>ESC</kbd> does <b>not</b> dismiss the dialog.</td>
</tr>
</table>
<hr />
<p>Default: <code>true</code> for alert, confirm, and prompt; <code>null</code> for custom dialogs.</p>
</td>
</tr>
<tr>
<tr id="bb-option-show">
<td>show</td>
<td>Boolean</td>
<td>
<p>Whether the dialog should be shown immediately.</p>
<hr />
<p>Default: <code>true</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-backdrop">
<td>backdrop</td>
<td>Boolean</td>
<td>
<p>
Whether the dialog should be have a backdrop or not. Also determines whether clicking on the
backdrop dismisses the modal.
backdrop dismisses the modal.
</p>
<h4>Options:</h4>
<h4>Options:</h4>
<table class="table table-condensed">
<colgroup>
<col style="width: 150px;" />
Expand All @@ -444,41 +464,48 @@ <h4>Options:</h4>
<td>The backdrop is not displayed.</td>
</tr>
</table>
<p>
<b>Requires Bootbox 4.4.x or newer</b>.
</p>
<hr />
<p>Default: <code>null</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-closeButton">
<td>closeButton</td>
<td>Boolean</td>
<td>
<p>
Whether the dialog should have a close button or not.
</p>
<hr />
<p>Default: <code>true</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-animate">
<td>animate</td>
<td>Boolean</td>
<td>
<p>
Animate the dialog in and out
(requires a browser which <a href="http://caniuse.com/#search=css-animation">supports CSS animations</a>).
</p>
<hr />
<p>Default: <code>true</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-className">
<td>className</td>
<td>String</td>
<td>
<p>
An additional class to apply to the dialog wrapper.
</p>
<hr />
<p>Default: <code>null</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-size">
<td>size</td>
<td>String</td>
<td>
Expand All @@ -489,10 +516,11 @@ <h4>Options:</h4>
<p>
<b>Requires Bootstrap 3.1.0 or newer</b>.
</p>
<hr />
<p>Default: <code>null</code></p>
</td>
</tr>
<tr>
<tr id="bb-option-buttons">
<td>
<p>buttons</p>
<span class="label label-danger">
Expand All @@ -510,6 +538,7 @@ <h4>Options:</h4>
}
}
</code></pre>
<hr />
<h4>Defaults:</h4>
<table>
<colgroup>
Expand Down Expand Up @@ -631,6 +660,44 @@ <h3>bootbox.hideAll()</h3>
</li>
<li>
<a href="#bb-dialog-options">Dialog Options</a>
<ul class="nav">
<li>
<a href="#bb-option-message">message</a>
</li>
<li>
<a href="#bb-option-title">title</a>
</li>
<li>
<a href="#bb-option-value">value</a>
</li>
<li>
<a href="#bb-option-callback">callback</a>
</li>
<li>
<a href="#bb-option-onEscape">onEscape</a>
</li>
<li>
<a href="#bb-option-show">show</a>
</li>
<li>
<a href="#bb-option-backdrop">backdrop</a>
</li>
<li>
<a href="#bb-option-closeButton">closeButton</a>
</li>
<li>
<a href="#bb-option-animate">animate</a>
</li>
<li>
<a href="#bb-option-className">className</a>
</li>
<li>
<a href="#bb-option-size">size</a>
</li>
<li>
<a href="#bb-option-buttons">buttons</a>
</li>
</ul>
</li>
<li>
<a href="#bb-public-methods">Public Methods</a>
Expand Down Expand Up @@ -674,7 +741,7 @@ <h3>bootbox.hideAll()</h3>
</div>
<!-- JS dependencies -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="vendor/js/highlight.pack.js"></script>
<script src="js/example.js"></script>
<script>
Expand Down
4 changes: 2 additions & 2 deletions examples.html
Expand Up @@ -7,7 +7,7 @@
<title>Examples | Bootbox.js&mdash;alert, confirm and flexible dialogs for the Bootstrap framework</title>

<!-- CSS dependencies -->
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script>
var _gaq = _gaq || [];
Expand Down Expand Up @@ -162,7 +162,7 @@ <h1>Examples</h1>
</div>
<!-- JS dependencies -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="js/example.js"></script>
<script>
$(function () {
Expand Down