spiderfw 0.6.21 → 0.6.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/CHANGELOG +33 -0
  2. data/Rakefile +0 -1
  3. data/VERSION +1 -1
  4. data/apps/core/admin/_init.rb +4 -0
  5. data/apps/core/admin/admin.rb +20 -4
  6. data/apps/core/admin/controllers/admin_controller.rb +63 -4
  7. data/apps/core/admin/controllers/app_admin_controller.rb +15 -0
  8. data/apps/core/admin/data/locale/it/LC_MESSAGES/admin.mo +0 -0
  9. data/apps/core/admin/po/admin.pot +33 -0
  10. data/apps/core/admin/po/it/admin.po +34 -0
  11. data/apps/core/admin/public/css/admin.css +13 -0
  12. data/apps/core/admin/public/css/login.css +51 -0
  13. data/apps/core/admin/public/css/sass/admin.css +198 -0
  14. data/apps/core/admin/public/css/sass/bootstrap/bootstrap.css +3107 -0
  15. data/apps/core/admin/public/img/css/header_bg.png +0 -0
  16. data/apps/core/admin/public/img/css/noise.png +0 -0
  17. data/apps/core/admin/public/img/css/side_bg.png +0 -0
  18. data/apps/core/admin/public/img/icons/logout.png +0 -0
  19. data/apps/core/admin/public/img/icons-s845a69dd9f.png +0 -0
  20. data/apps/core/admin/public/js/bootstrap-alerts.js +113 -0
  21. data/apps/core/admin/public/js/bootstrap-buttons.js +62 -0
  22. data/apps/core/admin/public/js/bootstrap-dropdown.js +55 -0
  23. data/apps/core/admin/public/js/bootstrap-modal.js +260 -0
  24. data/apps/core/admin/public/js/bootstrap-popover.js +90 -0
  25. data/apps/core/admin/public/js/bootstrap-scrollspy.js +107 -0
  26. data/apps/core/admin/public/js/bootstrap-tabs.js +80 -0
  27. data/apps/core/admin/public/js/bootstrap-twipsy.js +321 -0
  28. data/apps/core/admin/public/sass/admin.scss +167 -0
  29. data/apps/core/admin/public/sass/bootstrap/bootstrap.scss +29 -0
  30. data/apps/core/admin/public/sass/bootstrap/forms.scss +478 -0
  31. data/apps/core/admin/public/sass/bootstrap/mixins.scss +220 -0
  32. data/apps/core/admin/public/sass/bootstrap/patterns.scss +1062 -0
  33. data/apps/core/admin/public/sass/bootstrap/reset.scss +141 -0
  34. data/apps/core/admin/public/sass/bootstrap/scaffolding.scss +136 -0
  35. data/apps/core/admin/public/sass/bootstrap/tables.scss +224 -0
  36. data/apps/core/admin/public/sass/bootstrap/type.scss +187 -0
  37. data/apps/core/admin/public/sass/bootstrap/variables.scss +60 -0
  38. data/apps/core/admin/public/sass/grid.scss +54 -0
  39. data/apps/core/admin/views/_app_info.shtml +5 -0
  40. data/apps/core/admin/views/admin.layout.shtml +35 -0
  41. data/apps/core/admin/views/index.shtml +1 -1
  42. data/apps/core/admin/views/login.layout.shtml +13 -0
  43. data/apps/core/auth/controllers/mixins/auth_helper.rb +1 -1
  44. data/apps/core/auth/models/super_user.rb +6 -0
  45. data/apps/core/auth/models/user.rb +9 -0
  46. data/apps/core/components/assets.rb +5 -1
  47. data/apps/core/components/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
  48. data/apps/core/components/po/it/spider_components.po +23 -9
  49. data/apps/core/components/po/spider_components.pot +16 -8
  50. data/apps/core/components/public/css/admin.css +0 -12
  51. data/apps/core/components/public/css/crud.css +16 -19
  52. data/apps/core/components/public/css/table.css +11 -5
  53. data/apps/core/components/public/js/less-1.1.3.min.js +16 -0
  54. data/apps/core/components/public/widgets/table.js +1 -1
  55. data/apps/core/components/widgets/admin/admin.rb +10 -0
  56. data/apps/core/components/widgets/admin/admin.shtml +24 -4
  57. data/apps/core/components/widgets/confirm/confirm.rb +2 -2
  58. data/apps/core/components/widgets/confirm/confirm.shtml +5 -2
  59. data/apps/core/components/widgets/crud/crud.rb +10 -1
  60. data/apps/core/components/widgets/crud/crud.shtml +18 -21
  61. data/apps/core/components/widgets/menu/menu.shtml +1 -2
  62. data/apps/core/components/widgets/switcher/switcher.rb +6 -3
  63. data/apps/core/components/widgets/switcher/templates/default.shtml +3 -1
  64. data/apps/core/components/widgets/table/table.rb +3 -2
  65. data/apps/core/components/widgets/table/table.shtml +44 -25
  66. data/apps/core/forms/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
  67. data/apps/core/forms/po/it/spider_forms.po +7 -2
  68. data/apps/core/forms/po/spider_forms.pot +5 -1
  69. data/apps/core/forms/public/css/form.css +3 -3
  70. data/apps/core/forms/public/css/html_area.css +0 -1
  71. data/apps/core/forms/public/date_time.js +4 -3
  72. data/apps/core/forms/public/select.js +5 -4
  73. data/apps/core/forms/tags/element_label.erb +1 -1
  74. data/apps/core/forms/tags/row.erb +1 -1
  75. data/apps/core/forms/widgets/form/form.rb +23 -1
  76. data/apps/core/forms/widgets/form/form.shtml +7 -8
  77. data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +3 -3
  78. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +3 -3
  79. data/apps/core/forms/widgets/inputs/file_input/file_input.rb +4 -2
  80. data/apps/core/forms/widgets/inputs/file_input/file_input.shtml +1 -1
  81. data/apps/core/forms/widgets/inputs/hidden/hidden.shtml +1 -1
  82. data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +2 -2
  83. data/apps/core/forms/widgets/inputs/password/password.shtml +3 -3
  84. data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +2 -2
  85. data/apps/core/forms/widgets/inputs/select/select.shtml +16 -13
  86. data/apps/core/forms/widgets/inputs/text/text.shtml +3 -3
  87. data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +5 -2
  88. data/apps/core/forms/widgets/inputs/time_span/time_span.shtml +3 -3
  89. data/apps/messenger/_init.rb +10 -2
  90. data/apps/messenger/controllers/messenger_admin_controller.rb +53 -0
  91. data/apps/messenger/controllers/messenger_controller.rb +2 -0
  92. data/apps/messenger/controllers/mixins/messenger_helper.rb +2 -2
  93. data/apps/messenger/models/message.rb +1 -1
  94. data/apps/messenger/public/app_icon.png +0 -0
  95. data/apps/messenger/views/admin/_admin.layout.shtml +26 -0
  96. data/apps/messenger/views/admin/index.shtml +13 -0
  97. data/apps/messenger/views/admin/queue.shtml +28 -0
  98. data/apps/messenger/views/index.shtml +3 -3
  99. data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
  100. data/lib/spiderfw/app.rb +10 -1
  101. data/lib/spiderfw/cache/template_cache.rb +21 -22
  102. data/lib/spiderfw/cmd/commands/app.rb +3 -3
  103. data/lib/spiderfw/cmd/commands/setup.rb +1 -1
  104. data/lib/spiderfw/config/options/spider.rb +18 -2
  105. data/lib/spiderfw/controller/controller.rb +9 -3
  106. data/lib/spiderfw/controller/dispatcher.rb +25 -12
  107. data/lib/spiderfw/controller/home_controller.rb +3 -3
  108. data/lib/spiderfw/controller/http_controller.rb +11 -0
  109. data/lib/spiderfw/controller/mixins/static_content.rb +3 -12
  110. data/lib/spiderfw/controller/mixins/visual.rb +21 -20
  111. data/lib/spiderfw/controller/request.rb +1 -3
  112. data/lib/spiderfw/http/adapters/mongrel.rb +1 -1
  113. data/lib/spiderfw/i18n/gettext.rb +14 -0
  114. data/lib/spiderfw/i18n/shtml_parser.rb +2 -2
  115. data/lib/spiderfw/model/base_model.rb +4 -3
  116. data/lib/spiderfw/model/mappers/db_mapper.rb +137 -79
  117. data/lib/spiderfw/model/mappers/mapper.rb +6 -2
  118. data/lib/spiderfw/model/migrations/drop_element.rb +1 -1
  119. data/lib/spiderfw/model/migrations/previous_model.rb +73 -0
  120. data/lib/spiderfw/model/migrations/rename_element.rb +42 -0
  121. data/lib/spiderfw/model/migrations.rb +14 -1
  122. data/lib/spiderfw/model/mixins/tree.rb +65 -19
  123. data/lib/spiderfw/model/model_hash.rb +9 -5
  124. data/lib/spiderfw/model/query.rb +8 -0
  125. data/lib/spiderfw/model/query_funcs.rb +23 -0
  126. data/lib/spiderfw/model/query_set.rb +1 -1
  127. data/lib/spiderfw/model/request.rb +11 -3
  128. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +28 -1
  129. data/lib/spiderfw/model/storage/db/adapters/oracle.rb +10 -10
  130. data/lib/spiderfw/model/storage/db/db_schema.rb +20 -3
  131. data/lib/spiderfw/model/storage/db/db_storage.rb +39 -17
  132. data/lib/spiderfw/setup/app_manager.rb +69 -31
  133. data/lib/spiderfw/setup/setup_task.rb +76 -8
  134. data/lib/spiderfw/spider.rb +21 -1
  135. data/lib/spiderfw/templates/blocks/text.rb +4 -4
  136. data/lib/spiderfw/templates/blocks/text_domain.rb +25 -0
  137. data/lib/spiderfw/templates/blocks/widget.rb +1 -1
  138. data/lib/spiderfw/templates/layout.rb +160 -92
  139. data/lib/spiderfw/templates/resources/less.rb +10 -2
  140. data/lib/spiderfw/templates/resources/sass.rb +66 -9
  141. data/lib/spiderfw/templates/template.rb +35 -10
  142. data/lib/spiderfw/templates/template_blocks.rb +6 -3
  143. data/lib/spiderfw/utils/logger.rb +20 -0
  144. data/lib/spiderfw/utils/memory.rb +7 -3
  145. data/lib/spiderfw/widget/widget.rb +13 -7
  146. data/lib/spiderfw/widget/widget_attributes.rb +2 -2
  147. data/spider.gemspec +1 -0
  148. metadata +68 -11
  149. data/apps/core/admin/views/spider_admin.layout.shtml +0 -23
@@ -0,0 +1,113 @@
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
+ this.settings = $.extend({}, $.fn.alert.defaults, options)
58
+ this.$element = $(content)
59
+ .delegate(this.settings.selector, 'click', this.close)
60
+ }
61
+
62
+ Alert.prototype = {
63
+
64
+ close: function (e) {
65
+ var $element = $(this).parent('.alert-message')
66
+
67
+ e && e.preventDefault()
68
+ $element.removeClass('in')
69
+
70
+ function removeElement () {
71
+ $element.remove()
72
+ }
73
+
74
+ $.support.transition && $element.hasClass('fade') ?
75
+ $element.bind(transitionEnd, removeElement) :
76
+ removeElement()
77
+ }
78
+
79
+ }
80
+
81
+
82
+ /* ALERT PLUGIN DEFINITION
83
+ * ======================= */
84
+
85
+ $.fn.alert = function ( options ) {
86
+
87
+ if ( options === true ) {
88
+ return this.data('alert')
89
+ }
90
+
91
+ return this.each(function () {
92
+ var $this = $(this)
93
+
94
+ if ( typeof options == 'string' ) {
95
+ return $this.data('alert')[options]()
96
+ }
97
+
98
+ $(this).data('alert', new Alert( this, options ))
99
+
100
+ })
101
+ }
102
+
103
+ $.fn.alert.defaults = {
104
+ selector: '.close'
105
+ }
106
+
107
+ $(document).ready(function () {
108
+ new Alert($('body'), {
109
+ selector: '.alert-message[data-alert] .close'
110
+ })
111
+ })
112
+
113
+ }( window.jQuery || window.ender );
@@ -0,0 +1,62 @@
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
+ state == 'loadingText' ?
35
+ $el.addClass(d).attr(d, d) :
36
+ $el.removeClass(d).removeAttr(d)
37
+ }
38
+
39
+ function toggle(el) {
40
+ $(el).toggleClass('active')
41
+ }
42
+
43
+ $.fn.button = function(options) {
44
+ return this.each(function () {
45
+ if (options == 'toggle') {
46
+ return toggle(this)
47
+ }
48
+ options && setState(this, options)
49
+ })
50
+ }
51
+
52
+ $.fn.button.defaults = {
53
+ loadingText: 'loading...'
54
+ }
55
+
56
+ $(function () {
57
+ $('body').delegate('.btn[data-toggle]', 'click', function () {
58
+ $(this).button('toggle')
59
+ })
60
+ })
61
+
62
+ }( window.jQuery || window.ender );
@@ -0,0 +1,55 @@
1
+ /* ============================================================
2
+ * bootstrap-dropdown.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#dropdown
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
+ /* DROPDOWN PLUGIN DEFINITION
26
+ * ========================== */
27
+
28
+ $.fn.dropdown = function ( selector ) {
29
+ return this.each(function () {
30
+ $(this).delegate(selector || d, 'click', function (e) {
31
+ var li = $(this).parent('li')
32
+ , isActive = li.hasClass('open')
33
+
34
+ clearMenus()
35
+ !isActive && li.toggleClass('open')
36
+ return false
37
+ })
38
+ })
39
+ }
40
+
41
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
42
+ * =================================== */
43
+
44
+ var d = 'a.menu, .dropdown-toggle'
45
+
46
+ function clearMenus() {
47
+ $(d).parent('li').removeClass('open')
48
+ }
49
+
50
+ $(function () {
51
+ $('html').bind("click", clearMenus)
52
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
53
+ })
54
+
55
+ }( window.jQuery || window.ender );
@@ -0,0 +1,260 @@
1
+ /* =========================================================
2
+ * bootstrap-modal.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#modal
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
+
54
+ /* MODAL PUBLIC CLASS DEFINITION
55
+ * ============================= */
56
+
57
+ var Modal = function ( content, options ) {
58
+ this.settings = $.extend({}, $.fn.modal.defaults, options)
59
+ this.$element = $(content)
60
+ .delegate('.close', 'click.modal', $.proxy(this.hide, this))
61
+
62
+ if ( this.settings.show ) {
63
+ this.show()
64
+ }
65
+
66
+ return this
67
+ }
68
+
69
+ Modal.prototype = {
70
+
71
+ toggle: function () {
72
+ return this[!this.isShown ? 'show' : 'hide']()
73
+ }
74
+
75
+ , show: function () {
76
+ var that = this
77
+ this.isShown = true
78
+ this.$element.trigger('show')
79
+
80
+ escape.call(this)
81
+ backdrop.call(this, function () {
82
+ var transition = $.support.transition && that.$element.hasClass('fade')
83
+
84
+ that.$element
85
+ .appendTo(document.body)
86
+ .show()
87
+
88
+ if (transition) {
89
+ that.$element[0].offsetWidth // force reflow
90
+ }
91
+
92
+ that.$element.addClass('in')
93
+
94
+ transition ?
95
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
96
+ that.$element.trigger('shown')
97
+
98
+ })
99
+
100
+ return this
101
+ }
102
+
103
+ , hide: function (e) {
104
+ e && e.preventDefault()
105
+
106
+ if ( !this.isShown ) {
107
+ return this
108
+ }
109
+
110
+ var that = this
111
+ this.isShown = false
112
+
113
+ escape.call(this)
114
+
115
+ this.$element
116
+ .trigger('hide')
117
+ .removeClass('in')
118
+
119
+ $.support.transition && this.$element.hasClass('fade') ?
120
+ hideWithTransition.call(this) :
121
+ hideModal.call(this)
122
+
123
+ return this
124
+ }
125
+
126
+ }
127
+
128
+
129
+ /* MODAL PRIVATE METHODS
130
+ * ===================== */
131
+
132
+ function hideWithTransition() {
133
+ // firefox drops transitionEnd events :{o
134
+ var that = this
135
+ , timeout = setTimeout(function () {
136
+ that.$element.unbind(transitionEnd)
137
+ hideModal.call(that)
138
+ }, 500)
139
+
140
+ this.$element.one(transitionEnd, function () {
141
+ clearTimeout(timeout)
142
+ hideModal.call(that)
143
+ })
144
+ }
145
+
146
+ function hideModal (that) {
147
+ this.$element
148
+ .hide()
149
+ .trigger('hidden')
150
+
151
+ backdrop.call(this)
152
+ }
153
+
154
+ function backdrop ( callback ) {
155
+ var that = this
156
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
157
+ if ( this.isShown && this.settings.backdrop ) {
158
+ var doAnimate = $.support.transition && animate
159
+
160
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
161
+ .appendTo(document.body)
162
+
163
+ if ( this.settings.backdrop != 'static' ) {
164
+ this.$backdrop.click($.proxy(this.hide, this))
165
+ }
166
+
167
+ if ( doAnimate ) {
168
+ this.$backdrop[0].offsetWidth // force reflow
169
+ }
170
+
171
+ this.$backdrop.addClass('in')
172
+
173
+ doAnimate ?
174
+ this.$backdrop.one(transitionEnd, callback) :
175
+ callback()
176
+
177
+ } else if ( !this.isShown && this.$backdrop ) {
178
+ this.$backdrop.removeClass('in')
179
+
180
+ $.support.transition && this.$element.hasClass('fade')?
181
+ this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
182
+ removeBackdrop.call(this)
183
+
184
+ } else if ( callback ) {
185
+ callback()
186
+ }
187
+ }
188
+
189
+ function removeBackdrop() {
190
+ this.$backdrop.remove()
191
+ this.$backdrop = null
192
+ }
193
+
194
+ function escape() {
195
+ var that = this
196
+ if ( this.isShown && this.settings.keyboard ) {
197
+ $(document).bind('keyup.modal', function ( e ) {
198
+ if ( e.which == 27 ) {
199
+ that.hide()
200
+ }
201
+ })
202
+ } else if ( !this.isShown ) {
203
+ $(document).unbind('keyup.modal')
204
+ }
205
+ }
206
+
207
+
208
+ /* MODAL PLUGIN DEFINITION
209
+ * ======================= */
210
+
211
+ $.fn.modal = function ( options ) {
212
+ var modal = this.data('modal')
213
+
214
+ if (!modal) {
215
+
216
+ if (typeof options == 'string') {
217
+ options = {
218
+ show: /show|toggle/.test(options)
219
+ }
220
+ }
221
+
222
+ return this.each(function () {
223
+ $(this).data('modal', new Modal(this, options))
224
+ })
225
+ }
226
+
227
+ if ( options === true ) {
228
+ return modal
229
+ }
230
+
231
+ if ( typeof options == 'string' ) {
232
+ modal[options]()
233
+ } else if ( modal ) {
234
+ modal.toggle()
235
+ }
236
+
237
+ return this
238
+ }
239
+
240
+ $.fn.modal.Modal = Modal
241
+
242
+ $.fn.modal.defaults = {
243
+ backdrop: false
244
+ , keyboard: false
245
+ , show: false
246
+ }
247
+
248
+
249
+ /* MODAL DATA- IMPLEMENTATION
250
+ * ========================== */
251
+
252
+ $(document).ready(function () {
253
+ $('body').delegate('[data-controls-modal]', 'click', function (e) {
254
+ e.preventDefault()
255
+ var $this = $(this).data('show', true)
256
+ $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
257
+ })
258
+ })
259
+
260
+ }( window.jQuery || window.ender );
@@ -0,0 +1,90 @@
1
+ /* ===========================================================
2
+ * bootstrap-popover.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#popover
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
+ var Popover = function ( element, options ) {
26
+ this.$element = $(element)
27
+ this.options = options
28
+ this.enabled = true
29
+ this.fixTitle()
30
+ }
31
+
32
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
33
+ ========================================= */
34
+
35
+ Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
36
+
37
+ setContent: function () {
38
+ var $tip = this.tip()
39
+ $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
40
+ $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
41
+ $tip[0].className = 'popover'
42
+ }
43
+
44
+ , hasContent: function () {
45
+ return this.getTitle() || this.getContent()
46
+ }
47
+
48
+ , getContent: function () {
49
+ var content
50
+ , $e = this.$element
51
+ , o = this.options
52
+
53
+ if (typeof this.options.content == 'string') {
54
+ content = $e.attr(this.options.content)
55
+ } else if (typeof this.options.content == 'function') {
56
+ content = this.options.content.call(this.$element[0])
57
+ }
58
+
59
+ return content
60
+ }
61
+
62
+ , tip: function() {
63
+ if (!this.$tip) {
64
+ this.$tip = $('<div class="popover" />')
65
+ .html(this.options.template)
66
+ }
67
+ return this.$tip
68
+ }
69
+
70
+ })
71
+
72
+
73
+ /* POPOVER PLUGIN DEFINITION
74
+ * ======================= */
75
+
76
+ $.fn.popover = function (options) {
77
+ if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options)
78
+ $.fn.twipsy.initWith.call(this, options, Popover, 'popover')
79
+ return this
80
+ }
81
+
82
+ $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
83
+ placement: 'right'
84
+ , content: 'data-content'
85
+ , template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
86
+ })
87
+
88
+ $.fn.twipsy.rejectAttrOptions.push( 'content' )
89
+
90
+ }( window.jQuery || window.ender );
@@ -0,0 +1,107 @@
1
+ /* =============================================================
2
+ * bootstrap-scrollspy.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
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
+ var $window = $(window)
26
+
27
+ function ScrollSpy( topbar, selector ) {
28
+ var processScroll = $.proxy(this.processScroll, this)
29
+ this.$topbar = $(topbar)
30
+ this.selector = selector || 'li > a'
31
+ this.refresh()
32
+ this.$topbar.delegate(this.selector, 'click', processScroll)
33
+ $window.scroll(processScroll)
34
+ this.processScroll()
35
+ }
36
+
37
+ ScrollSpy.prototype = {
38
+
39
+ refresh: function () {
40
+ this.targets = this.$topbar.find(this.selector).map(function () {
41
+ var href = $(this).attr('href')
42
+ return /^#\w/.test(href) && $(href).length ? href : null
43
+ })
44
+
45
+ this.offsets = $.map(this.targets, function (id) {
46
+ return $(id).offset().top
47
+ })
48
+ }
49
+
50
+ , processScroll: function () {
51
+ var scrollTop = $window.scrollTop() + 10
52
+ , offsets = this.offsets
53
+ , targets = this.targets
54
+ , activeTarget = this.activeTarget
55
+ , i
56
+
57
+ for (i = offsets.length; i--;) {
58
+ activeTarget != targets[i]
59
+ && scrollTop >= offsets[i]
60
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
61
+ && this.activateButton( targets[i] )
62
+ }
63
+ }
64
+
65
+ , activateButton: function (target) {
66
+ this.activeTarget = target
67
+
68
+ this.$topbar
69
+ .find(this.selector).parent('.active')
70
+ .removeClass('active')
71
+
72
+ this.$topbar
73
+ .find(this.selector + '[href="' + target + '"]')
74
+ .parent('li')
75
+ .addClass('active')
76
+ }
77
+
78
+ }
79
+
80
+ /* SCROLLSPY PLUGIN DEFINITION
81
+ * =========================== */
82
+
83
+ $.fn.scrollSpy = function( options ) {
84
+ var scrollspy = this.data('scrollspy')
85
+
86
+ if (!scrollspy) {
87
+ return this.each(function () {
88
+ $(this).data('scrollspy', new ScrollSpy( this, options ))
89
+ })
90
+ }
91
+
92
+ if ( options === true ) {
93
+ return scrollspy
94
+ }
95
+
96
+ if ( typeof options == 'string' ) {
97
+ scrollspy[options]()
98
+ }
99
+
100
+ return this
101
+ }
102
+
103
+ $(document).ready(function () {
104
+ $('body').scrollSpy('[data-scrollspy] li > a')
105
+ })
106
+
107
+ }( window.jQuery || window.ender );