mes 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +1 -0
- data/bin/mes +11 -0
- data/lib/middleman_ember_scaffold/cli/generators.rb +21 -0
- data/lib/middleman_ember_scaffold/cli.rb +91 -0
- data/lib/middleman_ember_scaffold/generators/scaffold.rb +22 -0
- data/lib/middleman_ember_scaffold/load_paths.rb +1 -0
- data/lib/middleman_ember_scaffold/template/Capfile +4 -0
- data/lib/middleman_ember_scaffold/template/Gemfile +10 -0
- data/lib/middleman_ember_scaffold/template/README.md +30 -0
- data/lib/middleman_ember_scaffold/template/component.json +14 -0
- data/lib/middleman_ember_scaffold/template/components/ember/component.json +20 -0
- data/lib/middleman_ember_scaffold/template/components/ember/ember.js +27755 -0
- data/lib/middleman_ember_scaffold/template/components/ember/ember.min.js +20 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/README.md +4 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/component.json +22 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data-spade.js +1 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.amd.js +7819 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.js +8769 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.min.js +12 -0
- data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.prod.js +7802 -0
- data/lib/middleman_ember_scaffold/template/components/handlebars/component.json +17 -0
- data/lib/middleman_ember_scaffold/template/components/handlebars/handlebars.js +2201 -0
- data/lib/middleman_ember_scaffold/template/components/handlebars/handlebars.runtime.js +321 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/component.json +14 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/composer.json +26 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/jquery-migrate.js +496 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/jquery-migrate.min.js +3 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/jquery.js +9597 -0
- data/lib/middleman_ember_scaffold/template/components/jquery/jquery.min.js +5 -0
- data/lib/middleman_ember_scaffold/template/config/deploy.rb +66 -0
- data/lib/middleman_ember_scaffold/template/config.rb +91 -0
- data/lib/middleman_ember_scaffold/template/source/app/application.coffee +15 -0
- data/lib/middleman_ember_scaffold/template/source/app/controllers/application_controller.coffee +1 -0
- data/lib/middleman_ember_scaffold/template/source/app/controllers/index_controller.coffee +1 -0
- data/lib/middleman_ember_scaffold/template/source/app/main.coffee +17 -0
- data/lib/middleman_ember_scaffold/template/source/app/models/foo.coffee +1 -0
- data/lib/middleman_ember_scaffold/template/source/app/routes.coffee +11 -0
- data/lib/middleman_ember_scaffold/template/source/app/views/application_view.coffee +2 -0
- data/lib/middleman_ember_scaffold/template/source/app/views/index_view.coffee +2 -0
- data/lib/middleman_ember_scaffold/template/source/index.html.haml +1 -0
- data/lib/middleman_ember_scaffold/template/source/layout.haml +8 -0
- data/lib/middleman_ember_scaffold/template/source/stylesheets/application.css.scss +2 -0
- data/lib/middleman_ember_scaffold/template/source/stylesheets/variables.scss +279 -0
- data/lib/middleman_ember_scaffold/template/source/templates_emblem/application/index.emblem +2 -0
- data/lib/middleman_ember_scaffold/template/source/templates_emblem/application.emblem +4 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/.gitkeep +0 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-dropdown.js +165 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-modal.js +374 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-modalmanager.js +412 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-popover.js +114 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-tabs.js +144 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-tooltip.js +361 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/date.js +104 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/ember-data.js +8769 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/ember.js +27755 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/handlebars.js +2201 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/jquery.js +9597 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/jquery.validate.min.js +2 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/json2.js +480 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/underscore.js +1 -0
- data/lib/middleman_ember_scaffold/template/vendor/javascripts/utils.js +19 -0
- data/lib/middleman_ember_scaffold/template/vendor/stylesheets/.gitkeep +0 -0
- data/lib/middleman_ember_scaffold/template/watch +2 -0
- data/lib/middleman_ember_scaffold/version.rb +3 -0
- data/lib/middleman_ember_scaffold.rb +5 -0
- data/mes.gemspec +24 -0
- metadata +167 -0
@@ -0,0 +1,279 @@
|
|
1
|
+
//
|
2
|
+
// Variables
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
// Custom Colors
|
6
|
+
|
7
|
+
$blueMuted: #55a7da !default;
|
8
|
+
$greenMuted: #7ebc79 !default;
|
9
|
+
$orangeMuted: #f9c357 !default;
|
10
|
+
$grayMuted: #7e7e7e !default;
|
11
|
+
|
12
|
+
// Global values
|
13
|
+
// --------------------------------------------------
|
14
|
+
|
15
|
+
|
16
|
+
// Grays
|
17
|
+
// -------------------------
|
18
|
+
$black: #000 !default;
|
19
|
+
$grayDarker: #222 !default;
|
20
|
+
$grayDark: #333 !default;
|
21
|
+
$gray: #555 !default;
|
22
|
+
$grayLight: #898989 !default;
|
23
|
+
$grayLighter: #f4f4f4 !default;
|
24
|
+
$white: #fff !default;
|
25
|
+
|
26
|
+
|
27
|
+
// Accent colors
|
28
|
+
// -------------------------
|
29
|
+
$blue: #027ecc !default;
|
30
|
+
$blueDark: #28436b !default;
|
31
|
+
$green: #46a546 !default;
|
32
|
+
$red: #9d261d !default;
|
33
|
+
$yellow: #ffc40d !default;
|
34
|
+
$orange: #f89406 !default;
|
35
|
+
$pink: #c3325f !default;
|
36
|
+
$purple: #7a43b6 !default;
|
37
|
+
|
38
|
+
|
39
|
+
// Scaffolding
|
40
|
+
// -------------------------
|
41
|
+
$bodyBackground: $white !default;
|
42
|
+
$textColor: $grayDark !default;
|
43
|
+
|
44
|
+
|
45
|
+
// Links
|
46
|
+
// -------------------------
|
47
|
+
$linkColor: $blue !default;
|
48
|
+
$linkColorHover: darken($linkColor, 15%) !default;
|
49
|
+
|
50
|
+
|
51
|
+
// Typography
|
52
|
+
// -------------------------
|
53
|
+
$sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
54
|
+
$serifFontFamily: Georgia, "Times New Roman", Times, serif !default;
|
55
|
+
$monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace !default;
|
56
|
+
|
57
|
+
$baseFontSize: 14px !default;
|
58
|
+
$baseFontFamily: $sansFontFamily !default;
|
59
|
+
$baseLineHeight: 20px !default;
|
60
|
+
$altFontFamily: $serifFontFamily !default;
|
61
|
+
|
62
|
+
$headingsFontFamily: inherit !default; // empty to use BS default, $baseFontFamily
|
63
|
+
$headingsFontWeight: bold !default; // instead of browser default, bold
|
64
|
+
$headingsColor: inherit !default; // empty to use BS default, $textColor
|
65
|
+
|
66
|
+
|
67
|
+
// Tables
|
68
|
+
// -------------------------
|
69
|
+
$tableBackground: transparent !default; // overall background-color
|
70
|
+
$tableBackgroundAccent: #f9f9f9 !default; // for striping
|
71
|
+
$tableBackgroundHover: #f5f5f5 !default; // for hover
|
72
|
+
$tableBorder: #c8c8c8 !default; // table and cell border
|
73
|
+
|
74
|
+
|
75
|
+
// Buttons
|
76
|
+
// -------------------------
|
77
|
+
$btnBackground: $white !default;
|
78
|
+
$btnBackgroundHighlight: darken($white, 10%) !default;
|
79
|
+
$btnBorder: #bbb !default;
|
80
|
+
|
81
|
+
$btnPrimaryBackground: $linkColor !default;
|
82
|
+
$btnPrimaryBackgroundHighlight: adjust-hue($btnPrimaryBackground, 20%) !default;
|
83
|
+
|
84
|
+
$btnInfoBackground: #5bc0de !default;
|
85
|
+
$btnInfoBackgroundHighlight: #2f96b4 !default;
|
86
|
+
|
87
|
+
$btnSuccessBackground: #62c462 !default;
|
88
|
+
$btnSuccessBackgroundHighlight: #51a351 !default;
|
89
|
+
|
90
|
+
$btnWarningBackground: lighten($orange, 15%) !default;
|
91
|
+
$btnWarningBackgroundHighlight: $orange !default;
|
92
|
+
|
93
|
+
$btnDangerBackground: #ee5f5b !default;
|
94
|
+
$btnDangerBackgroundHighlight: #bd362f !default;
|
95
|
+
|
96
|
+
$btnInverseBackground: #444 !default;
|
97
|
+
$btnInverseBackgroundHighlight: $grayDarker !default;
|
98
|
+
|
99
|
+
|
100
|
+
// Forms
|
101
|
+
// -------------------------
|
102
|
+
$inputBackground: $white !default;
|
103
|
+
$inputBorder: #ccc !default;
|
104
|
+
$inputBorderRadius: 3px !default;
|
105
|
+
$inputDisabledBackground: $grayLighter !default;
|
106
|
+
$formActionsBackground: #f5f5f5 !default;
|
107
|
+
|
108
|
+
// Dropdowns
|
109
|
+
// -------------------------
|
110
|
+
$dropdownBackground: $white !default;
|
111
|
+
$dropdownBorder: rgba(0,0,0,.2) !default;
|
112
|
+
$dropdownDividerTop: #e5e5e5 !default;
|
113
|
+
$dropdownDividerBottom: $white !default;
|
114
|
+
|
115
|
+
$dropdownLinkColor: $grayDark !default;
|
116
|
+
|
117
|
+
$dropdownLinkColorActive: $dropdownLinkColor !default;
|
118
|
+
$dropdownLinkBackgroundActive: $linkColor !default;
|
119
|
+
|
120
|
+
$dropdownLinkColorHover: $white !default;
|
121
|
+
$dropdownLinkBackgroundHover: $dropdownLinkBackgroundActive !default;
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
// COMPONENT VARIABLES
|
126
|
+
// --------------------------------------------------
|
127
|
+
|
128
|
+
// Z-index master list
|
129
|
+
// -------------------------
|
130
|
+
// Used for a bird's eye view of components dependent on the z-axis
|
131
|
+
// Try to avoid customizing these :)
|
132
|
+
$zindexDropdown: 1000 !default;
|
133
|
+
$zindexPopover: 1010 !default;
|
134
|
+
$zindexTooltip: 1030 !default;
|
135
|
+
$zindexFixedNavbar: 1030 !default;
|
136
|
+
$zindexModalBackdrop: 1040 !default;
|
137
|
+
$zindexModal: 1050 !default;
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
// Input placeholder text color
|
143
|
+
// -------------------------
|
144
|
+
$placeholderText: $grayLight !default;
|
145
|
+
|
146
|
+
|
147
|
+
// Hr border color
|
148
|
+
// -------------------------
|
149
|
+
$hrBorder: $grayLighter !default;
|
150
|
+
|
151
|
+
|
152
|
+
// Wells
|
153
|
+
// -------------------------
|
154
|
+
$wellBackground: #f5f5f5 !default;
|
155
|
+
|
156
|
+
|
157
|
+
// Navbar
|
158
|
+
// -------------------------
|
159
|
+
$navbarCollapseWidth: 979px !default;
|
160
|
+
|
161
|
+
$navbarHeight: 40px !default;
|
162
|
+
$navbarBackgroundHighlight: #ffffff !default;
|
163
|
+
$navbarBackground: darken($navbarBackgroundHighlight, 5%) !default;
|
164
|
+
$navbarBorder: darken($navbarBackground, 12%) !default;
|
165
|
+
|
166
|
+
$navbarText: $gray !default;
|
167
|
+
$navbarLinkColor: $gray !default;
|
168
|
+
$navbarLinkColorHover: $grayDark !default;
|
169
|
+
$navbarLinkColorActive: $gray !default;
|
170
|
+
$navbarLinkBackgroundHover: transparent !default;
|
171
|
+
$navbarLinkBackgroundActive: darken($navbarBackground, 5%) !default;
|
172
|
+
|
173
|
+
$navbarBrandColor: $navbarLinkColor !default;
|
174
|
+
|
175
|
+
// Inverted navbar
|
176
|
+
$navbarInverseBackground: #111111 !default;
|
177
|
+
$navbarInverseBackgroundHighlight: #222222 !default;
|
178
|
+
$navbarInverseBorder: #252525 !default;
|
179
|
+
|
180
|
+
$navbarInverseText: $grayLight !default;
|
181
|
+
$navbarInverseLinkColor: $grayLight !default;
|
182
|
+
$navbarInverseLinkColorHover: $white !default;
|
183
|
+
$navbarInverseLinkColorActive: $navbarInverseLinkColorHover !default;
|
184
|
+
$navbarInverseLinkBackgroundHover: transparent !default;
|
185
|
+
$navbarInverseLinkBackgroundActive: $navbarInverseBackground !default;
|
186
|
+
|
187
|
+
$navbarInverseSearchBackground: lighten($navbarInverseBackground, 25%) !default;
|
188
|
+
$navbarInverseSearchBackgroundFocus: $white !default;
|
189
|
+
$navbarInverseSearchBorder: $navbarInverseBackground !default;
|
190
|
+
$navbarInverseSearchPlaceholderColor: #ccc !default;
|
191
|
+
|
192
|
+
$navbarInverseBrandColor: $navbarInverseLinkColor !default;
|
193
|
+
|
194
|
+
|
195
|
+
// Pagination
|
196
|
+
// -------------------------
|
197
|
+
$paginationBackground: #fff !default;
|
198
|
+
$paginationBorder: #ddd !default;
|
199
|
+
$paginationActiveBackground: #f5f5f5 !default;
|
200
|
+
|
201
|
+
|
202
|
+
// Hero unit
|
203
|
+
// -------------------------
|
204
|
+
$heroUnitBackground: $grayLighter !default;
|
205
|
+
$heroUnitHeadingColor: inherit !default;
|
206
|
+
$heroUnitLeadColor: inherit !default;
|
207
|
+
|
208
|
+
|
209
|
+
// Form states and alerts
|
210
|
+
// -------------------------
|
211
|
+
$warningText: #c09853 !default;
|
212
|
+
$warningBackground: #fcf8e3 !default;
|
213
|
+
$warningBorder: darken(adjust-hue($warningBackground, -10), 3%) !default;
|
214
|
+
|
215
|
+
$errorText: #b94a48 !default;
|
216
|
+
$errorBackground: #f2dede !default;
|
217
|
+
$errorBorder: darken(adjust-hue($errorBackground, -10), 3%) !default;
|
218
|
+
|
219
|
+
$successText: #468847 !default;
|
220
|
+
$successBackground: #dff0d8 !default;
|
221
|
+
$successBorder: darken(adjust-hue($successBackground, -10), 5%) !default;
|
222
|
+
|
223
|
+
$infoText: #3a87ad !default;
|
224
|
+
$infoBackground: #d9edf7 !default;
|
225
|
+
$infoBorder: darken(adjust-hue($infoBackground, -10), 7%) !default;
|
226
|
+
|
227
|
+
|
228
|
+
// Tooltips and popovers
|
229
|
+
// -------------------------
|
230
|
+
$tooltipColor: #fff !default;
|
231
|
+
$tooltipBackground: #000 !default;
|
232
|
+
$tooltipArrowWidth: 5px !default;
|
233
|
+
$tooltipArrowColor: $tooltipBackground !default;
|
234
|
+
|
235
|
+
$popoverBackground: #fff !default;
|
236
|
+
$popoverArrowWidth: 10px !default;
|
237
|
+
$popoverArrowColor: #fff !default;
|
238
|
+
$popoverTitleBackground: darken($popoverBackground, 3%) !default;
|
239
|
+
|
240
|
+
// Special enhancement for popovers
|
241
|
+
$popoverArrowOuterWidth: $popoverArrowWidth + 1 !default;
|
242
|
+
$popoverArrowOuterColor: rgba(0,0,0,.25) !default;
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
// GRID
|
247
|
+
// --------------------------------------------------
|
248
|
+
|
249
|
+
|
250
|
+
// Default 940px grid
|
251
|
+
// -------------------------
|
252
|
+
$gridColumns: 12 !default;
|
253
|
+
$gridColumnWidth: 60px !default;
|
254
|
+
$gridGutterWidth: 20px !default;
|
255
|
+
$gridRowWidth: ($gridColumns * $gridColumnWidth) + ($gridGutterWidth * ($gridColumns - 1)) !default;
|
256
|
+
|
257
|
+
// 1200px min
|
258
|
+
$gridColumnWidth1200: 70px !default;
|
259
|
+
$gridGutterWidth1200: 30px !default;
|
260
|
+
$gridRowWidth1200: ($gridColumns * $gridColumnWidth1200) + ($gridGutterWidth1200 * ($gridColumns - 1)) !default;
|
261
|
+
|
262
|
+
// 768px-979px
|
263
|
+
$gridColumnWidth768: 42px !default;
|
264
|
+
$gridGutterWidth768: 20px !default;
|
265
|
+
$gridRowWidth768: ($gridColumns * $gridColumnWidth768) + ($gridGutterWidth768 * ($gridColumns - 1)) !default;
|
266
|
+
|
267
|
+
|
268
|
+
// Fluid grid
|
269
|
+
// -------------------------
|
270
|
+
$fluidGridColumnWidth: percentage($gridColumnWidth/$gridRowWidth) !default;
|
271
|
+
$fluidGridGutterWidth: percentage($gridGutterWidth/$gridRowWidth) !default;
|
272
|
+
|
273
|
+
// 1200px min
|
274
|
+
$fluidGridColumnWidth1200: percentage($gridColumnWidth1200/$gridRowWidth1200) !default;
|
275
|
+
$fluidGridGutterWidth1200: percentage($gridGutterWidth1200/$gridRowWidth1200) !default;
|
276
|
+
|
277
|
+
// 768px-979px
|
278
|
+
$fluidGridColumnWidth768: percentage($gridColumnWidth768/$gridRowWidth768) !default;
|
279
|
+
$fluidGridGutterWidth768: percentage($gridGutterWidth768/$gridRowWidth768) !default;
|
File without changes
|
@@ -0,0 +1,165 @@
|
|
1
|
+
/* ============================================================
|
2
|
+
* bootstrap-dropdown.js v2.3.1
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
|
+
* ============================================================
|
5
|
+
* Copyright 2012 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"; // jshint ;_;
|
24
|
+
|
25
|
+
|
26
|
+
/* DROPDOWN CLASS DEFINITION
|
27
|
+
* ========================= */
|
28
|
+
|
29
|
+
var toggle = '[data-toggle=dropdown]'
|
30
|
+
, Dropdown = function (element) {
|
31
|
+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
|
+
$('html').on('click.dropdown.data-api', function () {
|
33
|
+
$el.parent().removeClass('open')
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
Dropdown.prototype = {
|
38
|
+
|
39
|
+
constructor: Dropdown
|
40
|
+
|
41
|
+
, toggle: function (e) {
|
42
|
+
var $this = $(this)
|
43
|
+
, $parent
|
44
|
+
, isActive
|
45
|
+
|
46
|
+
if ($this.is('.disabled, :disabled')) return
|
47
|
+
|
48
|
+
$parent = getParent($this)
|
49
|
+
|
50
|
+
isActive = $parent.hasClass('open')
|
51
|
+
|
52
|
+
clearMenus()
|
53
|
+
|
54
|
+
if (!isActive) {
|
55
|
+
$parent.toggleClass('open')
|
56
|
+
}
|
57
|
+
|
58
|
+
$this.focus()
|
59
|
+
|
60
|
+
return false
|
61
|
+
}
|
62
|
+
|
63
|
+
, keydown: function (e) {
|
64
|
+
var $this
|
65
|
+
, $items
|
66
|
+
, $active
|
67
|
+
, $parent
|
68
|
+
, isActive
|
69
|
+
, index
|
70
|
+
|
71
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
72
|
+
|
73
|
+
$this = $(this)
|
74
|
+
|
75
|
+
e.preventDefault()
|
76
|
+
e.stopPropagation()
|
77
|
+
|
78
|
+
if ($this.is('.disabled, :disabled')) return
|
79
|
+
|
80
|
+
$parent = getParent($this)
|
81
|
+
|
82
|
+
isActive = $parent.hasClass('open')
|
83
|
+
|
84
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
85
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
86
|
+
return $this.click()
|
87
|
+
}
|
88
|
+
|
89
|
+
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
90
|
+
|
91
|
+
if (!$items.length) return
|
92
|
+
|
93
|
+
index = $items.index($items.filter(':focus'))
|
94
|
+
|
95
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
96
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
97
|
+
if (!~index) index = 0
|
98
|
+
|
99
|
+
$items
|
100
|
+
.eq(index)
|
101
|
+
.focus()
|
102
|
+
}
|
103
|
+
|
104
|
+
}
|
105
|
+
|
106
|
+
function clearMenus() {
|
107
|
+
$(toggle).each(function () {
|
108
|
+
getParent($(this)).removeClass('open')
|
109
|
+
})
|
110
|
+
}
|
111
|
+
|
112
|
+
function getParent($this) {
|
113
|
+
var selector = $this.attr('data-target')
|
114
|
+
, $parent
|
115
|
+
|
116
|
+
if (!selector) {
|
117
|
+
selector = $this.attr('href')
|
118
|
+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
119
|
+
}
|
120
|
+
|
121
|
+
$parent = selector && $(selector)
|
122
|
+
|
123
|
+
if (!$parent || !$parent.length) $parent = $this.parent()
|
124
|
+
|
125
|
+
return $parent
|
126
|
+
}
|
127
|
+
|
128
|
+
|
129
|
+
/* DROPDOWN PLUGIN DEFINITION
|
130
|
+
* ========================== */
|
131
|
+
|
132
|
+
var old = $.fn.dropdown
|
133
|
+
|
134
|
+
$.fn.dropdown = function (option) {
|
135
|
+
return this.each(function () {
|
136
|
+
var $this = $(this)
|
137
|
+
, data = $this.data('dropdown')
|
138
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
139
|
+
if (typeof option == 'string') data[option].call($this)
|
140
|
+
})
|
141
|
+
}
|
142
|
+
|
143
|
+
$.fn.dropdown.Constructor = Dropdown
|
144
|
+
|
145
|
+
|
146
|
+
/* DROPDOWN NO CONFLICT
|
147
|
+
* ==================== */
|
148
|
+
|
149
|
+
$.fn.dropdown.noConflict = function () {
|
150
|
+
$.fn.dropdown = old
|
151
|
+
return this
|
152
|
+
}
|
153
|
+
|
154
|
+
|
155
|
+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
156
|
+
* =================================== */
|
157
|
+
|
158
|
+
$(document)
|
159
|
+
.on('click.dropdown.data-api', clearMenus)
|
160
|
+
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
161
|
+
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
|
162
|
+
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
163
|
+
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
164
|
+
|
165
|
+
}(window.jQuery);
|