]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Separate JS includes for alerts and popovers
authorJulian Thilo <bigj95t@gmail.com>
Mon, 17 Mar 2014 14:58:03 +0000 (15:58 +0100)
committerJulian Thilo <bigj95t@gmail.com>
Mon, 17 Mar 2014 14:58:03 +0000 (15:58 +0100)
/cc @mdo

docs/_includes/js/alerts.html [new file with mode: 0644]
docs/_includes/js/popovers.html
docs/javascript.html

diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html
new file mode 100644 (file)
index 0000000..04bbd43
--- /dev/null
@@ -0,0 +1,71 @@
+<div class="bs-docs-section">
+  <h1 id="alerts" class="page-header">Alert messages <small>alert.js</small></h1>
+
+  <h2 id="alerts-examples">Example alerts</h2>
+  <p>Add dismiss functionality to all alert messages with this plugin.</p>
+  <div class="bs-example">
+    <div class="alert alert-warning fade in" role="alert">
+      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+      <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
+    </div>
+  </div><!-- /example -->
+
+  <div class="bs-example">
+    <div class="alert alert-danger fade in" role="alert">
+      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+      <h4>Oh snap! You got an error!</h4>
+      <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
+      <p>
+        <button type="button" class="btn btn-danger">Take this action</button>
+        <button type="button" class="btn btn-default">Or do this</button>
+      </p>
+    </div>
+  </div><!-- /example -->
+
+
+  <h2 id="alerts-usage">Usage</h2>
+  <p>Enable dismissal of an alert via JavaScript:</p>
+  {% highlight js %}$(".alert").alert(){% endhighlight %}
+
+  <h3>Markup</h3>
+  <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p>
+  {% highlight html %}<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>{% endhighlight %}
+
+  <h3>Methods</h3>
+
+  <h4>$().alert()</h4>
+  <p>Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p>
+
+  <h4>.alert('close')</h4>
+  <p>Closes an alert.</p>
+  {% highlight js %}$(".alert").alert('close'){% endhighlight %}
+
+
+  <h3>Events</h3>
+  <p>Bootstrap's alert class exposes a few events for hooking into alert functionality.</p>
+  <div class="table-responsive">
+    <table class="table table-bordered table-striped">
+      <thead>
+        <tr>
+          <th style="width: 150px;">Event Type</th>
+          <th>Description</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>close.bs.alert</td>
+          <td>This event fires immediately when the <code>close</code> instance method is called.</td>
+        </tr>
+        <tr>
+          <td>closed.bs.alert</td>
+          <td>This event is fired when the alert has been closed (will wait for CSS transitions to complete).</td>
+        </tr>
+      </tbody>
+    </table>
+  </div><!-- /.table-responsive -->
+{% highlight js %}
+$('#my-alert').bind('closed.bs.alert', function () {
+  // do something…
+})
+{% endhighlight %}
+</div>
index 7bf515ad4b6035b90c19f9a164e11d3a10146c00..56e3600aa45a7d518dcf7d2c8ea1065ada7a53b0 100644 (file)
@@ -263,79 +263,3 @@ $('#myPopover').on('hidden.bs.popover', function () {
 })
 {% endhighlight %}
 </div>
-
-
-
-<!-- Alert
-================================================== -->
-<div class="bs-docs-section">
-  <h1 id="alerts" class="page-header">Alert messages <small>alert.js</small></h1>
-
-  <h2 id="alerts-examples">Example alerts</h2>
-  <p>Add dismiss functionality to all alert messages with this plugin.</p>
-  <div class="bs-example">
-    <div class="alert alert-warning fade in" role="alert">
-      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
-      <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
-    </div>
-  </div><!-- /example -->
-
-  <div class="bs-example">
-    <div class="alert alert-danger fade in" role="alert">
-      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
-      <h4>Oh snap! You got an error!</h4>
-      <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
-      <p>
-        <button type="button" class="btn btn-danger">Take this action</button>
-        <button type="button" class="btn btn-default">Or do this</button>
-      </p>
-    </div>
-  </div><!-- /example -->
-
-
-  <h2 id="alerts-usage">Usage</h2>
-  <p>Enable dismissal of an alert via JavaScript:</p>
-  {% highlight js %}$(".alert").alert(){% endhighlight %}
-
-  <h3>Markup</h3>
-  <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p>
-  {% highlight html %}<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>{% endhighlight %}
-
-  <h3>Methods</h3>
-
-  <h4>$().alert()</h4>
-  <p>Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p>
-
-  <h4>.alert('close')</h4>
-  <p>Closes an alert.</p>
-  {% highlight js %}$(".alert").alert('close'){% endhighlight %}
-
-
-  <h3>Events</h3>
-  <p>Bootstrap's alert class exposes a few events for hooking into alert functionality.</p>
-  <div class="table-responsive">
-    <table class="table table-bordered table-striped">
-      <thead>
-        <tr>
-          <th style="width: 150px;">Event Type</th>
-          <th>Description</th>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td>close.bs.alert</td>
-          <td>This event fires immediately when the <code>close</code> instance method is called.</td>
-        </tr>
-        <tr>
-          <td>closed.bs.alert</td>
-          <td>This event is fired when the alert has been closed (will wait for CSS transitions to complete).</td>
-        </tr>
-      </tbody>
-    </table>
-  </div><!-- /.table-responsive -->
-{% highlight js %}
-$('#my-alert').bind('closed.bs.alert', function () {
-  // do something…
-})
-{% endhighlight %}
-</div>
index c7671c7eac31f2e80d51b358d67c86b37b748bc3..e6151cb27c4c3f6399f747d7156ad3c318a03d30 100644 (file)
@@ -13,6 +13,7 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug
 {% include js/tabs.html %}
 {% include js/tooltips.html %}
 {% include js/popovers.html %}
+{% include js/alerts.html %}
 {% include js/buttons.html %}
 {% include js/collapse.html %}
 {% include js/carousel.html %}