wd_sinatra 1.0.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +1 -4
  3. data/CHANGELOG.md +20 -0
  4. data/Gemfile +0 -2
  5. data/LICENSE +4 -2
  6. data/README.md +28 -19
  7. data/bin/wd_sinatra +7 -25
  8. data/lib/wd_sinatra/app_loader.rb +12 -20
  9. data/lib/wd_sinatra/sinatra_ext.rb +8 -7
  10. data/lib/wd_sinatra/test_helpers.rb +1 -1
  11. data/lib/wd_sinatra/version.rb +2 -4
  12. data/templates/Gemfile +16 -11
  13. data/templates/{Rakefile → Rakefile.tt} +4 -4
  14. data/templates/Thorfile +14 -8
  15. data/templates/api/hello_world.rb +17 -10
  16. data/templates/bin/console +1 -1
  17. data/templates/config.ru.tt +6 -0
  18. data/templates/config/sinatra_config.rb.tt +50 -0
  19. data/templates/lib/{app.rb → app.rb.tt} +4 -1
  20. data/templates/lib/hooks.rb +25 -15
  21. data/templates/test/{test_helpers.rb → test_helpers.rb.tt} +8 -6
  22. data/test/test_helper.rb +0 -4
  23. data/test/ws_list_ext_test.rb +6 -6
  24. data/wd-sinatra.gemspec +11 -7
  25. metadata +72 -104
  26. data/templates/config.ru +0 -5
  27. data/templates/config/middleware.rb +0 -16
  28. data/templates/config/sinatra_config.rb +0 -18
  29. data/templates/lib/body_parser.rb +0 -24
  30. data/templates/lib/tasks/doc.rake +0 -39
  31. data/templates/lib/tasks/doc_generator/bootstrap/.gitignore +0 -4
  32. data/templates/lib/tasks/doc_generator/bootstrap/LICENSE +0 -176
  33. data/templates/lib/tasks/doc_generator/bootstrap/Makefile +0 -47
  34. data/templates/lib/tasks/doc_generator/bootstrap/README.md +0 -105
  35. data/templates/lib/tasks/doc_generator/bootstrap/bootstrap.css +0 -2467
  36. data/templates/lib/tasks/doc_generator/bootstrap/bootstrap.min.css +0 -356
  37. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/css/docs.css +0 -317
  38. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/ico/bootstrap-apple-114x114.png +0 -0
  39. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/ico/bootstrap-apple-57x57.png +0 -0
  40. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/ico/bootstrap-apple-72x72.png +0 -0
  41. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/ico/favicon.ico +0 -0
  42. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/bird.png +0 -0
  43. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/browsers.png +0 -0
  44. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/example-diagram-01.png +0 -0
  45. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/example-diagram-02.png +0 -0
  46. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/example-diagram-03.png +0 -0
  47. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/grid-18px.png +0 -0
  48. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/img/twitter-logo-no-bird.png +0 -0
  49. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/js/application.js +0 -52
  50. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/js/google-code-prettify/prettify.css +0 -94
  51. data/templates/lib/tasks/doc_generator/bootstrap/docs/assets/js/google-code-prettify/prettify.js +0 -28
  52. data/templates/lib/tasks/doc_generator/bootstrap/docs/index.html +0 -2037
  53. data/templates/lib/tasks/doc_generator/bootstrap/docs/javascript.html +0 -798
  54. data/templates/lib/tasks/doc_generator/bootstrap/examples/container-app.html +0 -119
  55. data/templates/lib/tasks/doc_generator/bootstrap/examples/fluid.html +0 -122
  56. data/templates/lib/tasks/doc_generator/bootstrap/examples/hero.html +0 -79
  57. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-alerts.js +0 -124
  58. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-buttons.js +0 -64
  59. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-dropdown.js +0 -55
  60. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-modal.js +0 -260
  61. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-popover.js +0 -90
  62. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-scrollspy.js +0 -107
  63. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-tabs.js +0 -80
  64. data/templates/lib/tasks/doc_generator/bootstrap/js/bootstrap-twipsy.js +0 -321
  65. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/index.html +0 -40
  66. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-alerts.js +0 -41
  67. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-buttons.js +0 -42
  68. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-dropdown.js +0 -52
  69. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-modal.js +0 -151
  70. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-popover.js +0 -76
  71. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-scrollspy.js +0 -31
  72. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-tabs.js +0 -77
  73. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/unit/bootstrap-twipsy.js +0 -81
  74. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/vendor/qunit.css +0 -232
  75. data/templates/lib/tasks/doc_generator/bootstrap/js/tests/vendor/qunit.js +0 -1510
  76. data/templates/lib/tasks/doc_generator/bootstrap/lib/bootstrap.less +0 -26
  77. data/templates/lib/tasks/doc_generator/bootstrap/lib/forms.less +0 -479
  78. data/templates/lib/tasks/doc_generator/bootstrap/lib/mixins.less +0 -222
  79. data/templates/lib/tasks/doc_generator/bootstrap/lib/patterns.less +0 -1060
  80. data/templates/lib/tasks/doc_generator/bootstrap/lib/reset.less +0 -141
  81. data/templates/lib/tasks/doc_generator/bootstrap/lib/scaffolding.less +0 -139
  82. data/templates/lib/tasks/doc_generator/bootstrap/lib/tables.less +0 -224
  83. data/templates/lib/tasks/doc_generator/bootstrap/lib/type.less +0 -187
  84. data/templates/lib/tasks/doc_generator/bootstrap/lib/variables.less +0 -60
  85. data/templates/lib/tasks/doc_generator/template.erb +0 -156
@@ -1,119 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Bootstrap, from Twitter</title>
6
- <meta name="description" content="">
7
- <meta name="author" content="">
8
-
9
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
10
- <!--[if lt IE 9]>
11
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
-
14
- <!-- Le styles -->
15
- <link href="../bootstrap.css" rel="stylesheet">
16
- <style type="text/css">
17
- /* Override some defaults */
18
- html, body {
19
- background-color: #eee;
20
- }
21
- body {
22
- padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
23
- }
24
- .container > footer p {
25
- text-align: center; /* center align it with the container */
26
- }
27
- .container {
28
- width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
29
- }
30
-
31
- /* The white background content wrapper */
32
- .container > .content {
33
- background-color: #fff;
34
- padding: 20px;
35
- margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
36
- -webkit-border-radius: 0 0 6px 6px;
37
- -moz-border-radius: 0 0 6px 6px;
38
- border-radius: 0 0 6px 6px;
39
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
40
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
41
- box-shadow: 0 1px 2px rgba(0,0,0,.15);
42
- }
43
-
44
- /* Page header tweaks */
45
- .page-header {
46
- background-color: #f5f5f5;
47
- padding: 20px 20px 10px;
48
- margin: -20px -20px 20px;
49
- }
50
-
51
- /* Styles you shouldn't keep as they are for displaying this base example only */
52
- .content .span10,
53
- .content .span4 {
54
- min-height: 500px;
55
- }
56
- /* Give a quick and non-cross-browser friendly divider */
57
- .content .span4 {
58
- margin-left: 0;
59
- padding-left: 19px;
60
- border-left: 1px solid #eee;
61
- }
62
-
63
- .topbar .btn {
64
- border: 0;
65
- }
66
-
67
- </style>
68
-
69
- <!-- Le fav and touch icons -->
70
- <link rel="shortcut icon" href="images/favicon.ico">
71
- <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
72
- <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
73
- <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
74
- </head>
75
-
76
- <body>
77
-
78
- <div class="topbar">
79
- <div class="fill">
80
- <div class="container">
81
- <a class="brand" href="#">Project name</a>
82
- <ul class="nav">
83
- <li class="active"><a href="#">Home</a></li>
84
- <li><a href="#about">About</a></li>
85
- <li><a href="#contact">Contact</a></li>
86
- </ul>
87
- <form action="" class="pull-right">
88
- <input class="input-small" type="text" placeholder="Username">
89
- <input class="input-small" type="password" placeholder="Password">
90
- <button class="btn" type="submit">Sign in</button>
91
- </form>
92
- </div>
93
- </div>
94
- </div>
95
-
96
- <div class="container">
97
-
98
- <div class="content">
99
- <div class="page-header">
100
- <h1>Page name <small>Supporting text or tagline</small></h1>
101
- </div>
102
- <div class="row">
103
- <div class="span10">
104
- <h2>Main content</h2>
105
- </div>
106
- <div class="span4">
107
- <h3>Secondary content</h3>
108
- </div>
109
- </div>
110
- </div>
111
-
112
- <footer>
113
- <p>&copy; Company 2011</p>
114
- </footer>
115
-
116
- </div> <!-- /container -->
117
-
118
- </body>
119
- </html>
@@ -1,122 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Bootstrap, from Twitter</title>
6
- <meta name="description" content="">
7
- <meta name="author" content="">
8
-
9
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
10
- <!--[if lt IE 9]>
11
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
-
14
- <!-- Le styles -->
15
- <link href="../bootstrap.css" rel="stylesheet">
16
- <style type="text/css">
17
- body {
18
- padding-top: 60px;
19
- }
20
- </style>
21
-
22
- <!-- Le fav and touch icons -->
23
- <link rel="shortcut icon" href="images/favicon.ico">
24
- <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
25
- <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
26
- <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
27
- </head>
28
-
29
- <body>
30
-
31
- <div class="topbar">
32
- <div class="topbar-inner">
33
- <div class="container-fluid">
34
- <a class="brand" href="#">Project name</a>
35
- <ul class="nav">
36
- <li class="active"><a href="#">Home</a></li>
37
- <li><a href="#about">About</a></li>
38
- <li><a href="#contact">Contact</a></li>
39
- </ul>
40
- <p class="pull-right">Logged in as <a href="#">username</a></p>
41
- </div>
42
- </div>
43
- </div>
44
-
45
- <div class="container-fluid">
46
- <div class="sidebar">
47
- <div class="well">
48
- <h5>Sidebar</h5>
49
- <ul>
50
- <li><a href="#">Link</a></li>
51
- <li><a href="#">Link</a></li>
52
- <li><a href="#">Link</a></li>
53
- <li><a href="#">Link</a></li>
54
- </ul>
55
- <h5>Sidebar</h5>
56
- <ul>
57
- <li><a href="#">Link</a></li>
58
- <li><a href="#">Link</a></li>
59
- <li><a href="#">Link</a></li>
60
- <li><a href="#">Link</a></li>
61
- <li><a href="#">Link</a></li>
62
- <li><a href="#">Link</a></li>
63
- </ul>
64
- <h5>Sidebar</h5>
65
- <ul>
66
- <li><a href="#">Link</a></li>
67
- <li><a href="#">Link</a></li>
68
- </ul>
69
- </div>
70
- </div>
71
- <div class="content">
72
- <!-- Main hero unit for a primary marketing message or call to action -->
73
- <div class="hero-unit">
74
- <h1>Hello, world!</h1>
75
- <p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
76
- <p><a class="btn primary large">Learn more &raquo;</a></p>
77
- </div>
78
- <!-- Example row of columns -->
79
- <div class="row">
80
- <div class="span6">
81
- <h2>Heading</h2>
82
- <p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
83
- <p><a class="btn" href="#">View details &raquo;</a></p>
84
- </div>
85
- <div class="span5">
86
- <h2>Heading</h2>
87
- <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
88
- <p><a class="btn" href="#">View details &raquo;</a></p>
89
- </div>
90
- <div class="span5">
91
- <h2>Heading</h2>
92
- <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
93
- <p><a class="btn" href="#">View details &raquo;</a></p>
94
- </div>
95
- </div>
96
- <hr>
97
- <!-- Example row of columns -->
98
- <div class="row">
99
- <div class="span6">
100
- <h2>Heading</h2>
101
- <p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
102
- <p><a class="btn" href="#">View details &raquo;</a></p>
103
- </div>
104
- <div class="span5">
105
- <h2>Heading</h2>
106
- <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
107
- <p><a class="btn" href="#">View details &raquo;</a></p>
108
- </div>
109
- <div class="span5">
110
- <h2>Heading</h2>
111
- <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
112
- <p><a class="btn" href="#">View details &raquo;</a></p>
113
- </div>
114
- </div>
115
- <footer>
116
- <p>&copy; Company 2011</p>
117
- </footer>
118
- </div>
119
- </div>
120
-
121
- </body>
122
- </html>
@@ -1,79 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Bootstrap, from Twitter</title>
6
- <meta name="description" content="">
7
- <meta name="author" content="">
8
-
9
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
10
- <!--[if lt IE 9]>
11
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
-
14
- <!-- Le styles -->
15
- <link href="../bootstrap.css" rel="stylesheet">
16
- <style type="text/css">
17
- body {
18
- padding-top: 60px;
19
- }
20
- </style>
21
-
22
- <!-- Le fav and touch icons -->
23
- <link rel="shortcut icon" href="images/favicon.ico">
24
- <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
25
- <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
26
- <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
27
- </head>
28
-
29
- <body>
30
-
31
- <div class="topbar">
32
- <div class="fill">
33
- <div class="container">
34
- <a class="brand" href="#">Project name</a>
35
- <ul class="nav">
36
- <li class="active"><a href="#">Home</a></li>
37
- <li><a href="#about">About</a></li>
38
- <li><a href="#contact">Contact</a></li>
39
- </ul>
40
- </div>
41
- </div>
42
- </div>
43
-
44
- <div class="container">
45
-
46
- <!-- Main hero unit for a primary marketing message or call to action -->
47
- <div class="hero-unit">
48
- <h1>Hello, world!</h1>
49
- <p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
50
- <p><a class="btn primary large">Learn more &raquo;</a></p>
51
- </div>
52
-
53
- <!-- Example row of columns -->
54
- <div class="row">
55
- <div class="span-one-third">
56
- <h2>Heading</h2>
57
- <p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
58
- <p><a class="btn" href="#">View details &raquo;</a></p>
59
- </div>
60
- <div class="span-one-third">
61
- <h2>Heading</h2>
62
- <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
63
- <p><a class="btn" href="#">View details &raquo;</a></p>
64
- </div>
65
- <div class="span-one-third">
66
- <h2>Heading</h2>
67
- <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
68
- <p><a class="btn" href="#">View details &raquo;</a></p>
69
- </div>
70
- </div>
71
-
72
- <footer>
73
- <p>&copy; Company 2011</p>
74
- </footer>
75
-
76
- </div> <!-- /container -->
77
-
78
- </body>
79
- </html>
@@ -1,124 +0,0 @@
1
- /* ==========================================================
2
- * bootstrap-alerts.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#alerts
4
- * ==========================================================
5
- * Copyright 2011 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ========================================================== */
19
-
20
-
21
- !function( $ ){
22
-
23
- "use strict"
24
-
25
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
26
- * ======================================================= */
27
-
28
- var transitionEnd
29
-
30
- $(document).ready(function () {
31
-
32
- $.support.transition = (function () {
33
- var thisBody = document.body || document.documentElement
34
- , thisStyle = thisBody.style
35
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
36
- return support
37
- })()
38
-
39
- // set CSS transition event type
40
- if ( $.support.transition ) {
41
- transitionEnd = "TransitionEnd"
42
- if ( $.browser.webkit ) {
43
- transitionEnd = "webkitTransitionEnd"
44
- } else if ( $.browser.mozilla ) {
45
- transitionEnd = "transitionend"
46
- } else if ( $.browser.opera ) {
47
- transitionEnd = "oTransitionEnd"
48
- }
49
- }
50
-
51
- })
52
-
53
- /* ALERT CLASS DEFINITION
54
- * ====================== */
55
-
56
- var Alert = function ( content, options ) {
57
- if (options == 'close') return this.close.call(content)
58
- this.settings = $.extend({}, $.fn.alert.defaults, options)
59
- this.$element = $(content)
60
- .delegate(this.settings.selector, 'click', this.close)
61
- }
62
-
63
- Alert.prototype = {
64
-
65
- close: function (e) {
66
- var $element = $(this)
67
- , className = 'alert-message'
68
-
69
- $element = $element.hasClass(className) ? $element : $element.parent()
70
-
71
- e && e.preventDefault()
72
- $element.removeClass('in')
73
-
74
- function removeElement () {
75
- $element.remove()
76
- }
77
-
78
- $.support.transition && $element.hasClass('fade') ?
79
- $element.bind(transitionEnd, removeElement) :
80
- removeElement()
81
- }
82
-
83
- }
84
-
85
-
86
- /* ALERT PLUGIN DEFINITION
87
- * ======================= */
88
-
89
- $.fn.alert = function ( options ) {
90
-
91
- if ( options === true ) {
92
- return this.data('alert')
93
- }
94
-
95
- return this.each(function () {
96
- var $this = $(this)
97
- , data
98
-
99
- if ( typeof options == 'string' ) {
100
-
101
- data = $this.data('alert')
102
-
103
- if (typeof data == 'object') {
104
- return data[options].call( $this )
105
- }
106
-
107
- }
108
-
109
- $(this).data('alert', new Alert( this, options ))
110
-
111
- })
112
- }
113
-
114
- $.fn.alert.defaults = {
115
- selector: '.close'
116
- }
117
-
118
- $(document).ready(function () {
119
- new Alert($('body'), {
120
- selector: '.alert-message[data-alert] .close'
121
- })
122
- })
123
-
124
- }( window.jQuery || window.ender );
@@ -1,64 +0,0 @@
1
- /* ============================================================
2
- * bootstrap-buttons.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#buttons
4
- * ============================================================
5
- * Copyright 2011 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ============================================================ */
19
-
20
- !function( $ ){
21
-
22
- "use strict"
23
-
24
- function setState(el, state) {
25
- var d = 'disabled'
26
- , $el = $(el)
27
- , data = $el.data()
28
-
29
- state = state + 'Text'
30
- data.resetText || $el.data('resetText', $el.html())
31
-
32
- $el.html( data[state] || $.fn.button.defaults[state] )
33
-
34
- setTimeout(function () {
35
- state == 'loadingText' ?
36
- $el.addClass(d).attr(d, d) :
37
- $el.removeClass(d).removeAttr(d)
38
- }, 0)
39
- }
40
-
41
- function toggle(el) {
42
- $(el).toggleClass('active')
43
- }
44
-
45
- $.fn.button = function(options) {
46
- return this.each(function () {
47
- if (options == 'toggle') {
48
- return toggle(this)
49
- }
50
- options && setState(this, options)
51
- })
52
- }
53
-
54
- $.fn.button.defaults = {
55
- loadingText: 'loading...'
56
- }
57
-
58
- $(function () {
59
- $('body').delegate('.btn[data-toggle]', 'click', function () {
60
- $(this).button('toggle')
61
- })
62
- })
63
-
64
- }( window.jQuery || window.ender );