├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── demo
├── bootstrap
│ ├── bootstrap.css
│ └── bootstrap.min.css
├── chosen
│ ├── chosen-sprite.png
│ ├── chosen-sprite@2x.png
│ ├── chosen.css
│ ├── chosen.jquery.js
│ ├── chosen.jquery.min.js
│ ├── chosen.proto.js
│ └── chosen.proto.min.js
├── demo.html
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
├── img
│ ├── folder.png
│ ├── groups.png
│ └── server_new.png
└── js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ ├── html5shiv-3.7.0.js
│ ├── jquery-2.0.3.min.js
│ ├── jquery-2.0.3.min.map
│ ├── prettify.js
│ └── respond-1.3.0.min.js
└── src
├── bootstrap-wizard.css
├── bootstrap-wizard.js
└── bootstrap-wizard.min.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text eol=lf
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
24 | # Repository
25 | *.png binary
26 | *.jpg binary
27 | *.js text
28 | *.css text
29 |
30 | # Bootstrap Glyphicons
31 | *.eot binary
32 | *.ttf binary
33 | *.svg text eol=lf
34 | *.woff binary
35 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 |
131 | # NuGet Packages Directory
132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133 | #packages/
134 |
135 | # Windows Azure Build Output
136 | csx
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.[Pp]ublish.xml
151 | *.pfx
152 | *.publishsettings
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | App_Data/*.mdf
166 | App_Data/*.ldf
167 |
168 | #############
169 | ## Windows detritus
170 | #############
171 |
172 | # Windows image file caches
173 | Thumbs.db
174 | ehthumbs.db
175 |
176 | # Folder config file
177 | Desktop.ini
178 |
179 | # Recycle Bin used on file shares
180 | $RECYCLE.BIN/
181 |
182 | # Mac crap
183 | .DS_Store
184 |
185 |
186 | #############
187 | ## Python
188 | #############
189 |
190 | *.py[co]
191 |
192 | # Packages
193 | *.egg
194 | *.egg-info
195 | dist/
196 | build/
197 | eggs/
198 | parts/
199 | var/
200 | sdist/
201 | develop-eggs/
202 | .installed.cfg
203 |
204 | # Installer logs
205 | pip-log.txt
206 |
207 | # Unit test / coverage reports
208 | .coverage
209 | .tox
210 |
211 | #Translations
212 | *.mo
213 |
214 | #Mr Developer
215 | .mr.developer.cfg
216 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013 Panopta, Andrew Moffat
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Bootstrap Application Wizard
2 | ============================
3 |
4 | This project is no longer maintained. Open issues and PRs will not be resolved.
5 | Please fork if you wish to maintain yourself.
6 |
7 | 
8 |
9 | General
10 | -------
11 | Author
12 | * [Andrew Moffat](https://github.com/amoffat), built @ [Panopta](http://www.panopta.com/)
13 |
14 | Special Thanks
15 | * [Huzaifa Tapal](https://twitter.com/htapal)
16 | * [Jason Abate](https://github.com/jasonabate)
17 | * [John Zimmerman](https://github.com/johnzimmerman)
18 | * [Shabbir Karimi](https://github.com/shabbirkarimi)
19 |
20 | Update bootstrap v3.x
21 | * [Gert-Jan Timmer] (https://github.com/GJRTimmer)
22 |
23 | Contributors
24 | * [Andrew Moffat] (https://github.com/amoffat)
25 | * [bryancallahan] (https://github.com/bryancallahan)
26 | * [che-burashco] (https://github.com/che-burashco)
27 | * [bluetidepro] (https://github.com/bluetidepro)
28 | * [david-proweb] (https://github.com/david-proweb)
29 | * [kachar] (https://github.com/kachar)
30 | * [ludokx] (https://github.com/ludokx)
31 | * [choudeshell] (https://github.com/choudeshell)
32 |
33 |
34 | Dependencies
35 | ------------
36 | * jQuery 2.x
37 | * Bootstrap 3.x
38 |
39 | Installation
40 | ------------
41 | CSS
42 |
43 | ```html
44 |
45 | ```
46 |
47 | Javascript
48 | ```html
49 |
50 | ```
51 |
52 | Usage
53 | -----
54 | #### 1) Create wizard ####
55 |
56 | ```html
57 |
58 | ```
59 |
60 | To set the title of the application wizard use the `data-title` attribute
61 |
62 | #### 2) Create wizard cards ####
63 | Each .wizard-card will be its own step in the Application Wizard, and the h3 tag will be used for its navigation name on the left. Also notice the `data-cardname` attribute on each card. While not required, this can be used to access the cards by a specific name.
64 |
65 | Card Setup
66 | ```html
67 |
68 |
Card 1
69 | Some content
70 |
71 | ```
72 |
73 |
74 | Basic Wizard Setup
75 | ```html
76 |
77 |
78 |
Card 1
79 | Some content
80 |
81 |
82 |
83 |
Card 2
84 | Some content
85 |
86 |
87 | ```
88 |
89 | #### 3) Initialize Wizard ####
90 | After setting up the wizard with it's cards you can initilize it.
91 |
92 | ```javascript
93 | $(function() {
94 | var options = {};
95 | var wizard = $("#some-wizard").wizard(options);
96 | });
97 | ```
98 |
99 |
100 | Wizard
101 | ------
102 |
103 |
104 | #### Wizard Options ####
105 |
106 |
107 | Name
108 | Type
109 | Default
110 | Description
111 |
112 |
113 | keyboard
114 | boolean
115 | true
116 | Closes the modal when escape key is pressed.
117 |
118 |
119 | backdrop
120 | boolean or string `static`
121 | true
122 | Includes a modal-backdrop element. Alternatively, specify `static` for a backdrop which doesn't close the modal on click.
123 |
124 |
125 | show
126 | boolean
127 | false
128 | Shows the modal when initialized.
129 |
130 |
131 | showCancel
132 | boolean
133 | false
134 | Show cancel button when initialized.
135 |
136 |
137 | showClose
138 | boolean
139 | true
140 | Show close button when initialized
141 |
142 |
143 | progressBarCurrent
144 | boolean
145 | false
146 |
147 |
148 |
149 | submitUrl
150 | string
151 | ''
152 | Default submit url
153 |
154 |
155 | increateHeight
156 | integer
157 | 0
158 | Deprecated
159 |
160 |
161 | contentHeight
162 | integer
163 | 300
164 | Default height of content view
165 |
166 |
167 | contentWidth
168 | integer
169 | 580
170 | Default width of wizard dialog, includes step navigation, which takes 28%.
171 |
172 |
173 | buttons
174 | array
175 |
176 | cancelText: "Cancel"
177 | nextText: "Next"
178 | backText: "Back"
179 | submitText: "Submit"
180 | submittingText: "Submitting..."
181 |
182 |
183 |
184 | formClass
185 | string
186 | form-horizontal
187 | Allows the configuration of the class(es) of the form. Default `form-horizontal` is set. Multiple classes are allow by separation of space.
188 |
189 |
190 |
191 |
192 | Logging can be turned on by setting logging before wizard initialization
193 | ```javascript
194 | $.fn.wizard.logging = true;
195 | ```
196 |
197 |
198 |
199 | #### Wizard Methods ####
200 | Usage:
201 | ```javascript
202 | var wizard = $("#some-wizard").wizard({});
203 |
204 | wizard.methodName(arguments);
205 | ```
206 |
207 |
208 |
209 |
210 | Method
211 | Description
212 |
213 |
214 | show()
215 | Displays the wizard
216 |
217 |
218 | hide()
219 | Alias for close()
220 |
221 |
222 | close()
223 | Closes the wizard
224 |
225 |
226 | serialize()
227 | Returns all inputs from the wizard as serialized string, see [jQuery serialize()] (http://api.jquery.com/serialize/). Add-on: standard disabled inputs are not serialized. This function will will also serialize disabled inputs which have a attribute `data-serialize="1"`.
228 |
229 |
230 | serializeArray()
231 | Returns all inputs from the wizard as array object, can be used for sending a JSON object to the server. See [jQuery serializeArray()] (http://api.jquery.com/serializeArray/) Add-on: standard disabled inputs are not serialized. This function will will also serialize disabled inputs which have a attribute `data-serialize="1"`.
232 |
233 |
234 | getActiveCard
235 | Returns a wizardCard object for the active card
236 |
237 |
238 | setTitle(title)
239 | Set the title of the wizard
240 |
241 |
242 | setSubtitle(subTitle)
243 | Sets the secondary, less pronounced title in the wizard header
244 |
245 |
246 | errorPopover(element, msg, allowHtml)
247 | This creates an error popup on element, with content msg.
248 | This is useful being called from a card-level validator,
249 | where you might want to pick specific elements on a card on which to show an error tooltip.
250 | allowHtml (default:false) allows html content as msg argument.
251 |
252 |
253 |
254 | changeNextButton(text, [class])
255 | Changes the “next” button (used to advance steps in the wizard) to have text text and optionally css class cls. This is used internally by the wizard when the last step is reached, to display a green “submit” button, but it may be useful elsewhere.
256 |
257 |
258 | updateProgressBar(percent)
259 | Sets the progress bar in the lower right to percent complete. This typically shouldn’t be touched by user code, but it can be useful to call updateProgressBar(0) after a submit handler returns. [See Submitting Data].
260 |
261 |
262 | hideButtons()
263 | Hides the next and previous buttons. This is only really useful after a submission handler returns. [See Submitting Data].
264 |
265 |
266 | showButtons()
267 | Shows the next and previous buttons. This is only really useful after a submission handler returns. [See Submitting Data].
268 |
269 |
270 | submitSuccess()
271 | Shows the special submit cards. This is only really useful after a submission handler returns. [See Submitting Data].
272 |
273 |
274 | submitError()
275 | Shows the special submit cards. This is only really useful after a submission handler returns. [See Submitting Data].
276 |
277 |
278 | submitFailure()
279 | Shows the special submit cards. This is only really useful after a submission handler returns. [See Submitting Data].
280 |
281 |
282 | reset()
283 | Resets the wizard to its original state. This only resets wizard internals, and does not affect your form elements. If you want to reset those, listen for the `reset` event, and write some code to reset your elements manually.
284 |
285 |
286 | find(selector)
287 | Search for the given selector within the modal. And returns the same result as jQuery.find(selector) function.
288 |
289 |
290 |
291 |
292 |
293 | #### Wizard Events ####
294 | You can register on the follwing wizard events with jQuery's `on(eventName, callback)` function.
295 |
296 | Example registering on the reset event
297 | ```javascript
298 | var wizard = $("#some-wizard").wizard({});
299 |
300 | wizard.on("reset", function() {
301 | // Some reset actions
302 | });
303 | ```
304 |
305 |
306 |
307 |
308 | Event
309 | Description
310 |
311 |
312 | reset
313 | Reset event is called when the dialog is either closed or when submit is done
314 |
315 |
316 | submit
317 | Triggers when the submit button is clicked on the final card
318 |
319 |
320 | closed
321 | Triggers when the wizard is closed
322 |
323 |
324 | incrementCard
325 | Triggers when the next card becomes the current card
326 |
327 |
328 | decrementCard
329 | Triggers when the previous card becomes the current card
330 |
331 |
332 | progressBar
333 | Triggers when the progress bar is incremented. The first argument passed to the callback is the new progress percent from 0 to 100.
334 |
335 |
336 | submitSuccess
337 | Trigger when submit was succesfull
338 |
339 |
340 | submitFailure
341 | Trigger when submit failed
342 |
343 |
344 |
345 | submitError
346 | Triggers when submit encounters an error
347 |
348 |
349 | loading
350 | Triggers after the submit event
351 |
352 |
353 | readySubmit
354 | Triggers when the wizard has reached its final card
355 |
356 |
357 |
358 |
359 | #### Submitting Wizard ####
360 |
361 | The easiest way to submit data to the wizard is to pass in a submitUrl on construction.
362 | ```javascript
363 | var wizard = $("#some-wizard").wizard({submitUrl: "/some_url"});
364 | ```
365 |
366 | When the wizard reaches its last step and the user clicks the submit button, all of the inputs from all of the wizard cards will be aggregated together and POSTed to your submitUrl.
367 |
368 | If you wish to implement your own submit listener, take a look at the source of the Wizard._defaultSubmit method, which is the default submit listener.
369 | ```javascript
370 | function(wizard) {
371 | $.ajax({
372 | type: "POST",
373 | url: wizard.args.submitUrl,
374 | data: wizard.serialize(),
375 | dataType: "json"
376 | }).done(function(response) {
377 | wizard.submitSuccess();
378 | wizard.hideButtons();
379 | wizard.updateProgressBar(0);
380 | }).fail(function() {
381 | wizard.submitFailure();
382 | wizard.hideButtons();
383 | });
384 | }
385 | ```
386 |
387 | The wizard class implements the serialize() and serializeArray() methods of jQuery form elements. These methods will scan through all the form input elements in your wizard cards, aggregate the names and values, and return a data structure for submitting via an ajax call.
388 |
389 | After your submission, depending on whether your submission succeeded, failed, or had an error, you can display a specific hidden card to reflect the submission status. These submission cards must first be defined in the html.
390 | ```html
391 |
392 |
393 |
394 |
395 |
Card 1
396 |
...
397 |
398 |
399 |
400 |
401 |
402 | submission succeeded!
403 |
404 |
405 |
406 | submission had an error
407 |
408 |
409 |
410 | submission failed
411 |
412 |
413 | ```
414 |
415 | These 3 cards are hidden by default and only appear when you specifically activate them. Typically, these cards will be activated by status of an ajax post.
416 | ```javascript
417 | wizard.on("submit", function(wizard) {
418 | $.ajax({
419 | url: "/wizard_submit_url",
420 | type: "POST",
421 | url: wizard.args.submitUrl,
422 | data: wizard.serialize(),
423 | dataType: "json"
424 | }).done(function(response) {
425 | wizard.submitSuccess(); // displays the success card
426 | wizard.hideButtons(); // hides the next and back buttons
427 | wizard.updateProgressBar(0); // sets the progress meter to 0
428 | }).fail(function() {
429 | wizard.submitError(); // display the error card
430 | wizard.hideButtons(); // hides the next and back buttons
431 | });
432 | }
433 | ```
434 | By activating these cards in the ajax request handlers, you can display information relevant to the status of the submit request
435 |
436 | After submission, you may wish to reset the wizard to some default state. See the [reset()] method in the wizard class for details on this.
437 |
438 |
439 | Wizard Cards
440 | ------------------
441 |
442 | #### Access ####
443 | Cards can be accessed through the cards attribute on the wizard object. By default, this is an object whose keys are the text from the h3 tags, and whose values are instances of the WizardCard class. So for example, with the following markup:
444 | ```html
445 |
446 |
447 |
Card 1
448 |
...
449 |
450 |
451 | ```
452 |
453 | You could access this card the following way:
454 | ```javascript
455 | var wizard = $("#some-wizard").wizard();
456 | var card = wizard.cards["Card 1"];
457 | ```
458 |
459 | From this card object, you can call any of the card methods.
460 | You can also set a card’s name specifically by using the `data-cardname` attribute
461 | ```html
462 |
463 |
464 |
Card 1
465 |
...
466 |
467 |
468 | ```
469 |
470 | Now you can access the card by the name “card1″:
471 | ```javascript
472 | var wizard = $("#some-wizard").wizard();
473 | var card = wizard.cards["card1"];
474 | ```
475 |
476 |
477 | #### Validation ####
478 | Most wizard cards will require some kind of validation of the input before proceeding to the next card. This validation is not intended to sanitize malicious data to be trustworthy (this should be done server-side), merely to catch any obvious common problems with the data.
479 |
480 | Validation can be attached inline to form elements by using the attribute `data-validate` on the input.
481 | ```html
482 |
483 |
Card 1
484 | Name
485 |
486 | ```
487 |
488 | When the Next button is clicked for the card, validateName will be called with the element as its first argument. Here’s an example validation function:
489 |
490 | ```javascript
491 | function validateName(el) {
492 | var name = el.val();
493 | var retValue = {};
494 |
495 | if (name == "") {
496 | retValue.status = false;
497 | retValue.msg = "Please enter a name";
498 | }
499 | else {
500 | retValue.status = true;
501 | }
502 |
503 | return retValue;
504 | }
505 | ```
506 |
507 | If the validator returns with an object with .status == false, then an error popup will display on the element and the wizard will not be allowed to progress to the next step. The wizard will only progress when all of the validators on the page return with a status of true.
508 |
509 | Entire cards may be assigned a validation function by using the `data-validate` attribute on the card.
510 | ```html
511 |
512 |
Card 1
513 | Some content
514 |
515 | ```
516 |
517 | `someFunction()` will receive a WizardCard object on which you can manually search for the inputs on that card and validate them. This is useful for validating complex interdependencies between many inputs, for example, if a name field can only be empty if another field is populated.
518 |
519 | The final method for validating entire cards is to subscribe to the the “validate” event and provide a validation function.
520 |
521 | ```javascript
522 | wizard.cards["Card 1"].on("validate", function(card) {
523 | var input = card.el.find("input");
524 | var name = input.val();
525 | if (name == "") {
526 | card.wizard.errorPopover(input, "Name cannot be empty");
527 | return false;
528 | }
529 | return true;
530 | });
531 | ```
532 |
533 | A card-level validation function is slightly different from an input-level validation function. In a card-level function, you are required to display any error popovers, using the wizard object’s errorPopover() method, as well as returning true or false to tell the wizard whether or not it should advance to the next step.
534 |
535 |
536 |
537 | #### Validation Error Popup ####
538 | ##### Input with adjacent button #####
539 | Bootstrap has the possibility to have button adjacent to an input. This causes the error-popover to be misplaced.
540 | To correct this the error-popover has to be placed on the span of the adjacent button.
541 |
542 | To accomplish this the application wizard has smart detection for this. When creating an adjacent button to an input an additionial `id` has to be set on the adjacent `` of the `button`. The `id` name of the span has to be `btn-(ID OF INPUT)`.
543 |
544 | For example within the following card setup. The card uses standard bootstrap v3.x code for an input with adjacent button. The id of the input is `fqdn`. The id of the adjacent span becomes `btn-fqdn`.
545 |
546 | This will cause the error-popop to be correctly displayed when there is an validation error.
547 |
548 | ```html
549 |
550 |
Address
551 |
552 |
566 |
567 | ```
568 |
569 | #### Card CSS ####
570 | If you require to display an selection box overlayed over wizard, like is done within the demo for some of the selects. You have to add the following class to your wizard-card element. `wizard-card-overlay`.
571 |
572 |
573 |
574 | #### Card Methods ####
575 |
576 |
577 | Method
578 | Description
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 | #### Card Events ####
588 | Registering event on cards can be done with the jQuery `on(event, callback)` function on the wizardCard object.
589 |
590 |
591 |
592 | Event
593 | Description
594 |
595 |
596 | loaded
597 | Triggers when the card is first loaded (when the card is selected but has never been selected before). This is useful for lazy-loading content.
598 |
599 |
600 | validate
601 | when the card is being validated. The callback assigned to this can itself be used as a validator if it returns a boolean.
602 |
603 |
604 | selected
605 | Triggers when this card is selected as the active wizard card
606 |
607 |
608 | deselect
609 | Triggers when this card is changed from. The new card will receive the select event, and the old card will receive the deselect event.
610 |
611 |
612 | enabled
613 |
614 |
615 |
616 | disabled
617 |
618 |
619 |
620 | reload
621 | Triggers when the card is first loaded or when the reload() function is called.
622 |
623 |
624 | validate
625 | Called when the card is being validated. The callback assigned to this can serve as a validator itself, if it returns a boolean.
626 |
627 |
628 | validated
629 | Triggers when validation is done
630 |
631 |
632 | invalid
633 | Triggers when validation failed
634 |
635 |
636 | markVisited
637 | Triggers when this card is marked as visited, meaning, typically, that the user can go back to it from a different step
638 |
639 |
640 | unmarkVisited
641 | Triggers removing this card as a visited card
642 |
643 |
644 |
--------------------------------------------------------------------------------
/demo/chosen/chosen-sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/chosen/chosen-sprite.png
--------------------------------------------------------------------------------
/demo/chosen/chosen-sprite@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/chosen/chosen-sprite@2x.png
--------------------------------------------------------------------------------
/demo/chosen/chosen.css:
--------------------------------------------------------------------------------
1 | /* @group Base */
2 | .chzn-container {
3 | font-size: 13px;
4 | position: relative;
5 | display: inline-block;
6 | zoom: 1;
7 | *display: inline;
8 | }
9 | .chzn-container .chzn-drop {
10 | background: #fff;
11 | border: 1px solid #aaa;
12 | border-top: 0;
13 | position: absolute;
14 | top: 29px;
15 | left: 0;
16 | -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17 | -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18 | box-shadow : 0 4px 5px rgba(0,0,0,.15);
19 | z-index: 1010;
20 | }
21 | /* @end */
22 |
23 | /* @group Single Chosen */
24 | .chzn-container-single .chzn-single {
25 | background-color: #ffffff;
26 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27 | background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28 | background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29 | background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30 | background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31 | background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32 | -webkit-border-radius: 5px;
33 | -moz-border-radius : 5px;
34 | border-radius : 5px;
35 | -moz-background-clip : padding;
36 | -webkit-background-clip: padding-box;
37 | background-clip : padding-box;
38 | border: 1px solid #aaaaaa;
39 | -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40 | -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41 | box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42 | display: block;
43 | overflow: hidden;
44 | white-space: nowrap;
45 | position: relative;
46 | height: 23px;
47 | line-height: 24px;
48 | padding: 0 0 0 8px;
49 | color: #444444;
50 | text-decoration: none;
51 | }
52 | .chzn-container-single .chzn-default {
53 | color: #999;
54 | }
55 | .chzn-container-single .chzn-single span {
56 | margin-right: 26px;
57 | display: block;
58 | overflow: hidden;
59 | white-space: nowrap;
60 | -o-text-overflow: ellipsis;
61 | -ms-text-overflow: ellipsis;
62 | text-overflow: ellipsis;
63 | }
64 | .chzn-container-single .chzn-single abbr {
65 | display: block;
66 | position: absolute;
67 | right: 26px;
68 | top: 6px;
69 | width: 12px;
70 | height: 12px;
71 | font-size: 1px;
72 | background: url('chosen-sprite.png') -42px 1px no-repeat;
73 | }
74 | .chzn-container-single .chzn-single abbr:hover {
75 | background-position: -42px -10px;
76 | }
77 | .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78 | background-position: -42px -10px;
79 | }
80 | .chzn-container-single .chzn-single div {
81 | position: absolute;
82 | right: 0;
83 | top: 0;
84 | display: block;
85 | height: 100%;
86 | width: 18px;
87 | }
88 | .chzn-container-single .chzn-single div b {
89 | background: url('chosen-sprite.png') no-repeat 0px 2px;
90 | display: block;
91 | width: 100%;
92 | height: 100%;
93 | }
94 | .chzn-container-single .chzn-search {
95 | padding: 3px 4px;
96 | position: relative;
97 | margin: 0;
98 | white-space: nowrap;
99 | z-index: 1010;
100 | }
101 | .chzn-container-single .chzn-search input {
102 | background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
103 | background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104 | background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105 | background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106 | background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107 | background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108 | margin: 1px 0;
109 | padding: 4px 20px 4px 5px;
110 | outline: 0;
111 | border: 1px solid #aaa;
112 | font-family: sans-serif;
113 | font-size: 1em;
114 | }
115 | .chzn-container-single .chzn-drop {
116 | -webkit-border-radius: 0 0 4px 4px;
117 | -moz-border-radius : 0 0 4px 4px;
118 | border-radius : 0 0 4px 4px;
119 | -moz-background-clip : padding;
120 | -webkit-background-clip: padding-box;
121 | background-clip : padding-box;
122 | }
123 | /* @end */
124 |
125 | .chzn-container-single-nosearch .chzn-search input {
126 | position: absolute;
127 | left: -9000px;
128 | }
129 |
130 | /* @group Multi Chosen */
131 | .chzn-container-multi .chzn-choices {
132 | background-color: #fff;
133 | background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134 | background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135 | background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136 | background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137 | background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138 | border: 1px solid #aaa;
139 | margin: 0;
140 | padding: 0;
141 | cursor: text;
142 | overflow: hidden;
143 | height: auto !important;
144 | height: 1%;
145 | position: relative;
146 | }
147 | .chzn-container-multi .chzn-choices li {
148 | float: left;
149 | list-style: none;
150 | }
151 | .chzn-container-multi .chzn-choices .search-field {
152 | white-space: nowrap;
153 | margin: 0;
154 | padding: 0;
155 | }
156 | .chzn-container-multi .chzn-choices .search-field input {
157 | color: #666;
158 | background: transparent !important;
159 | border: 0 !important;
160 | font-family: sans-serif;
161 | font-size: 100%;
162 | height: 15px;
163 | padding: 5px;
164 | margin: 1px 0;
165 | outline: 0;
166 | -webkit-box-shadow: none;
167 | -moz-box-shadow : none;
168 | box-shadow : none;
169 | }
170 | .chzn-container-multi .chzn-choices .search-field .default {
171 | color: #999;
172 | }
173 | .chzn-container-multi .chzn-choices .search-choice {
174 | -webkit-border-radius: 3px;
175 | -moz-border-radius : 3px;
176 | border-radius : 3px;
177 | -moz-background-clip : padding;
178 | -webkit-background-clip: padding-box;
179 | background-clip : padding-box;
180 | background-color: #e4e4e4;
181 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182 | background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183 | background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184 | background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185 | background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186 | background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187 | -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188 | -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189 | box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190 | color: #333;
191 | border: 1px solid #aaaaaa;
192 | line-height: 13px;
193 | padding: 3px 20px 3px 5px;
194 | margin: 3px 0 3px 5px;
195 | position: relative;
196 | cursor: default;
197 | }
198 | .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199 | background-color: #e4e4e4;
200 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202 | background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203 | background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204 | background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205 | background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206 | background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207 | color: #666;
208 | border: 1px solid #cccccc;
209 | padding-right: 5px;
210 | }
211 | .chzn-container-multi .chzn-choices .search-choice-focus {
212 | background: #d4d4d4;
213 | }
214 | .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215 | display: block;
216 | position: absolute;
217 | right: 3px;
218 | top: 4px;
219 | width: 12px;
220 | height: 12px;
221 | font-size: 1px;
222 | background: url('chosen-sprite.png') -42px 1px no-repeat;
223 | }
224 | .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225 | background-position: -42px -10px;
226 | }
227 | .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228 | background-position: -42px -10px;
229 | }
230 | /* @end */
231 |
232 | /* @group Results */
233 | .chzn-container .chzn-results {
234 | margin: 0 4px 4px 0;
235 | max-height: 240px;
236 | padding: 0 0 0 4px;
237 | position: relative;
238 | overflow-x: hidden;
239 | overflow-y: auto;
240 | -webkit-overflow-scrolling: touch;
241 | }
242 | .chzn-container-multi .chzn-results {
243 | margin: -1px 0 0;
244 | padding: 0;
245 | }
246 | .chzn-container .chzn-results li {
247 | display: none;
248 | line-height: 15px;
249 | padding: 5px 6px;
250 | margin: 0;
251 | list-style: none;
252 | }
253 | .chzn-container .chzn-results .active-result {
254 | cursor: pointer;
255 | display: list-item;
256 | }
257 | .chzn-container .chzn-results .highlighted {
258 | background-color: #3875d7;
259 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260 | background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261 | background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262 | background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263 | background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264 | background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265 | color: #fff;
266 | }
267 | .chzn-container .chzn-results li em {
268 | background: #feffde;
269 | font-style: normal;
270 | }
271 | .chzn-container .chzn-results .highlighted em {
272 | background: transparent;
273 | }
274 | .chzn-container .chzn-results .no-results {
275 | background: #f4f4f4;
276 | display: list-item;
277 | }
278 | .chzn-container .chzn-results .group-result {
279 | cursor: default;
280 | color: #999;
281 | font-weight: bold;
282 | }
283 | .chzn-container .chzn-results .group-option {
284 | padding-left: 15px;
285 | }
286 | .chzn-container-multi .chzn-drop .result-selected {
287 | display: none;
288 | }
289 | .chzn-container .chzn-results-scroll {
290 | background: white;
291 | margin: 0 4px;
292 | position: absolute;
293 | text-align: center;
294 | width: 321px; /* This should by dynamic with js */
295 | z-index: 1;
296 | }
297 | .chzn-container .chzn-results-scroll span {
298 | display: inline-block;
299 | height: 17px;
300 | text-indent: -5000px;
301 | width: 9px;
302 | }
303 | .chzn-container .chzn-results-scroll-down {
304 | bottom: 0;
305 | }
306 | .chzn-container .chzn-results-scroll-down span {
307 | background: url('chosen-sprite.png') no-repeat -4px -3px;
308 | }
309 | .chzn-container .chzn-results-scroll-up span {
310 | background: url('chosen-sprite.png') no-repeat -22px -3px;
311 | }
312 | /* @end */
313 |
314 | /* @group Active */
315 | .chzn-container-active .chzn-single {
316 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317 | -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318 | box-shadow : 0 0 5px rgba(0,0,0,.3);
319 | border: 1px solid #5897fb;
320 | }
321 | .chzn-container-active .chzn-single-with-drop {
322 | border: 1px solid #aaa;
323 | -webkit-box-shadow: 0 1px 0 #fff inset;
324 | -moz-box-shadow : 0 1px 0 #fff inset;
325 | box-shadow : 0 1px 0 #fff inset;
326 | background-color: #eee;
327 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328 | background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329 | background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330 | background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331 | background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332 | background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333 | -webkit-border-bottom-left-radius : 0;
334 | -webkit-border-bottom-right-radius: 0;
335 | -moz-border-radius-bottomleft : 0;
336 | -moz-border-radius-bottomright: 0;
337 | border-bottom-left-radius : 0;
338 | border-bottom-right-radius: 0;
339 | }
340 | .chzn-container-active .chzn-single-with-drop div {
341 | background: transparent;
342 | border-left: none;
343 | }
344 | .chzn-container-active .chzn-single-with-drop div b {
345 | background-position: -18px 2px;
346 | }
347 | .chzn-container-active .chzn-choices {
348 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349 | -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350 | box-shadow : 0 0 5px rgba(0,0,0,.3);
351 | border: 1px solid #5897fb;
352 | }
353 | .chzn-container-active .chzn-choices .search-field input {
354 | color: #111 !important;
355 | }
356 | /* @end */
357 |
358 | /* @group Disabled Support */
359 | .chzn-disabled {
360 | cursor: default;
361 | opacity:0.5 !important;
362 | }
363 | .chzn-disabled .chzn-single {
364 | cursor: default;
365 | }
366 | .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367 | cursor: default;
368 | }
369 |
370 | /* @group Right to Left */
371 | .chzn-rtl { text-align: right; }
372 | .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373 | .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374 |
375 | .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376 | .chzn-rtl .chzn-single abbr {
377 | left: 26px;
378 | right: auto;
379 | }
380 | .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381 | .chzn-rtl .chzn-choices li { float: right; }
382 | .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383 | .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
384 | .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385 | .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386 | .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387 | .chzn-rtl .chzn-search input {
388 | background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
389 | background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390 | background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391 | background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392 | background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393 | background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394 | padding: 4px 5px 4px 20px;
395 | direction: rtl;
396 | }
397 | .chzn-container-single.chzn-rtl .chzn-single div b {
398 | background-position: 6px 2px;
399 | }
400 | .chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
401 | background-position: -12px 2px;
402 | }
403 | /* @end */
404 |
405 | /* @group Retina compatibility */
406 | @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
407 | .chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
408 | background-image: url('chosen-sprite@2x.png') !important;
409 | background-repeat: no-repeat !important;
410 | background-size: 52px 37px !important;
411 | }
412 | }
413 | /* @end */
414 |
--------------------------------------------------------------------------------
/demo/chosen/chosen.jquery.js:
--------------------------------------------------------------------------------
1 | // Chosen, a Select Box Enhancer for jQuery and Protoype
2 | // by Patrick Filler for Harvest, http://getharvest.com
3 | //
4 | // Version 0.9.11
5 | // Full source at https://github.com/harvesthq/chosen
6 | // Copyright (c) 2011 Harvest http://getharvest.com
7 |
8 | // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9 | // This file is generated by `cake build`, do not edit it by hand.
10 | (function() {
11 | var SelectParser;
12 |
13 | SelectParser = (function() {
14 |
15 | function SelectParser() {
16 | this.options_index = 0;
17 | this.parsed = [];
18 | }
19 |
20 | SelectParser.prototype.add_node = function(child) {
21 | if (child.nodeName.toUpperCase() === "OPTGROUP") {
22 | return this.add_group(child);
23 | } else {
24 | return this.add_option(child);
25 | }
26 | };
27 |
28 | SelectParser.prototype.add_group = function(group) {
29 | var group_position, option, _i, _len, _ref, _results;
30 | group_position = this.parsed.length;
31 | this.parsed.push({
32 | array_index: group_position,
33 | group: true,
34 | label: group.label,
35 | children: 0,
36 | disabled: group.disabled
37 | });
38 | _ref = group.childNodes;
39 | _results = [];
40 | for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41 | option = _ref[_i];
42 | _results.push(this.add_option(option, group_position, group.disabled));
43 | }
44 | return _results;
45 | };
46 |
47 | SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48 | if (option.nodeName.toUpperCase() === "OPTION") {
49 | if (option.text !== "") {
50 | if (group_position != null) {
51 | this.parsed[group_position].children += 1;
52 | }
53 | this.parsed.push({
54 | array_index: this.parsed.length,
55 | options_index: this.options_index,
56 | value: option.value,
57 | text: option.text,
58 | html: option.innerHTML,
59 | selected: option.selected,
60 | disabled: group_disabled === true ? group_disabled : option.disabled,
61 | group_array_index: group_position,
62 | classes: option.className,
63 | style: option.style.cssText
64 | });
65 | } else {
66 | this.parsed.push({
67 | array_index: this.parsed.length,
68 | options_index: this.options_index,
69 | empty: true
70 | });
71 | }
72 | return this.options_index += 1;
73 | }
74 | };
75 |
76 | return SelectParser;
77 |
78 | })();
79 |
80 | SelectParser.select_to_array = function(select) {
81 | var child, parser, _i, _len, _ref;
82 | parser = new SelectParser();
83 | _ref = select.childNodes;
84 | for (_i = 0, _len = _ref.length; _i < _len; _i++) {
85 | child = _ref[_i];
86 | parser.add_node(child);
87 | }
88 | return parser.parsed;
89 | };
90 |
91 | this.SelectParser = SelectParser;
92 |
93 | }).call(this);
94 |
95 | /*
96 | Chosen source: generate output using 'cake build'
97 | Copyright (c) 2011 by Harvest
98 | */
99 |
100 |
101 | (function() {
102 | var AbstractChosen, root;
103 |
104 | root = this;
105 |
106 | AbstractChosen = (function() {
107 |
108 | function AbstractChosen(form_field, options) {
109 | this.form_field = form_field;
110 | this.options = options != null ? options : {};
111 | this.is_multiple = this.form_field.multiple;
112 | this.set_default_text();
113 | this.set_default_values();
114 | this.setup();
115 | this.set_up_html();
116 | this.register_observers();
117 | this.finish_setup();
118 | }
119 |
120 | AbstractChosen.prototype.set_default_values = function() {
121 | var _this = this;
122 | this.click_test_action = function(evt) {
123 | return _this.test_active_click(evt);
124 | };
125 | this.activate_action = function(evt) {
126 | return _this.activate_field(evt);
127 | };
128 | this.active_field = false;
129 | this.mouse_on_container = false;
130 | this.results_showing = false;
131 | this.result_highlighted = null;
132 | this.result_single_selected = null;
133 | this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134 | this.disable_search_threshold = this.options.disable_search_threshold || 0;
135 | this.disable_search = this.options.disable_search || false;
136 | this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
137 | this.search_contains = this.options.search_contains || false;
138 | this.choices = 0;
139 | this.single_backstroke_delete = this.options.single_backstroke_delete || false;
140 | this.max_selected_options = this.options.max_selected_options || Infinity;
141 | return this.inherit_select_classes = this.options.inherit_select_classes || false;
142 | };
143 |
144 | AbstractChosen.prototype.set_default_text = function() {
145 | if (this.form_field.getAttribute("data-placeholder")) {
146 | this.default_text = this.form_field.getAttribute("data-placeholder");
147 | } else if (this.is_multiple) {
148 | this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
149 | } else {
150 | this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
151 | }
152 | return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
153 | };
154 |
155 | AbstractChosen.prototype.mouse_enter = function() {
156 | return this.mouse_on_container = true;
157 | };
158 |
159 | AbstractChosen.prototype.mouse_leave = function() {
160 | return this.mouse_on_container = false;
161 | };
162 |
163 | AbstractChosen.prototype.input_focus = function(evt) {
164 | var _this = this;
165 | if (this.is_multiple) {
166 | if (!this.active_field) {
167 | return setTimeout((function() {
168 | return _this.container_mousedown();
169 | }), 50);
170 | }
171 | } else {
172 | if (!this.active_field) {
173 | return this.activate_field();
174 | }
175 | }
176 | };
177 |
178 | AbstractChosen.prototype.input_blur = function(evt) {
179 | var _this = this;
180 | if (!this.mouse_on_container) {
181 | this.active_field = false;
182 | return setTimeout((function() {
183 | return _this.blur_test();
184 | }), 100);
185 | }
186 | };
187 |
188 | AbstractChosen.prototype.result_add_option = function(option) {
189 | var classes, style;
190 | if (!option.disabled) {
191 | option.dom_id = this.container_id + "_o_" + option.array_index;
192 | classes = option.selected && this.is_multiple ? [] : ["active-result"];
193 | if (option.selected) {
194 | classes.push("result-selected");
195 | }
196 | if (option.group_array_index != null) {
197 | classes.push("group-option");
198 | }
199 | if (option.classes !== "") {
200 | classes.push(option.classes);
201 | }
202 | style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
203 | return '' + option.html + ' ';
204 | } else {
205 | return "";
206 | }
207 | };
208 |
209 | AbstractChosen.prototype.results_update_field = function() {
210 | if (!this.is_multiple) {
211 | this.results_reset_cleanup();
212 | }
213 | this.result_clear_highlight();
214 | this.result_single_selected = null;
215 | return this.results_build();
216 | };
217 |
218 | AbstractChosen.prototype.results_toggle = function() {
219 | if (this.results_showing) {
220 | return this.results_hide();
221 | } else {
222 | return this.results_show();
223 | }
224 | };
225 |
226 | AbstractChosen.prototype.results_search = function(evt) {
227 | if (this.results_showing) {
228 | return this.winnow_results();
229 | } else {
230 | return this.results_show();
231 | }
232 | };
233 |
234 | AbstractChosen.prototype.keyup_checker = function(evt) {
235 | var stroke, _ref;
236 | stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
237 | this.search_field_scale();
238 | switch (stroke) {
239 | case 8:
240 | if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
241 | return this.keydown_backstroke();
242 | } else if (!this.pending_backstroke) {
243 | this.result_clear_highlight();
244 | return this.results_search();
245 | }
246 | break;
247 | case 13:
248 | evt.preventDefault();
249 | if (this.results_showing) {
250 | return this.result_select(evt);
251 | }
252 | break;
253 | case 27:
254 | if (this.results_showing) {
255 | this.results_hide();
256 | }
257 | return true;
258 | case 9:
259 | case 38:
260 | case 40:
261 | case 16:
262 | case 91:
263 | case 17:
264 | break;
265 | default:
266 | return this.results_search();
267 | }
268 | };
269 |
270 | AbstractChosen.prototype.generate_field_id = function() {
271 | var new_id;
272 | new_id = this.generate_random_id();
273 | this.form_field.id = new_id;
274 | return new_id;
275 | };
276 |
277 | AbstractChosen.prototype.generate_random_char = function() {
278 | var chars, newchar, rand;
279 | chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
280 | rand = Math.floor(Math.random() * chars.length);
281 | return newchar = chars.substring(rand, rand + 1);
282 | };
283 |
284 | return AbstractChosen;
285 |
286 | })();
287 |
288 | root.AbstractChosen = AbstractChosen;
289 |
290 | }).call(this);
291 |
292 | /*
293 | Chosen source: generate output using 'cake build'
294 | Copyright (c) 2011 by Harvest
295 | */
296 |
297 |
298 | (function() {
299 | var $, Chosen, get_side_border_padding, root,
300 | __hasProp = {}.hasOwnProperty,
301 | __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
302 |
303 | root = this;
304 |
305 | $ = jQuery;
306 |
307 | $.fn.extend({
308 | chosen: function(options) {
309 | var browser, match, ua;
310 | ua = navigator.userAgent.toLowerCase();
311 | match = /(msie) ([\w.]+)/.exec(ua) || [];
312 | browser = {
313 | name: match[1] || "",
314 | version: match[2] || "0"
315 | };
316 | if (browser.name === "msie" && (browser.version === "6.0" || (browser.version === "7.0" && document.documentMode === 7))) {
317 | return this;
318 | }
319 | return this.each(function(input_field) {
320 | var $this;
321 | $this = $(this);
322 | if (!$this.hasClass("chzn-done")) {
323 | return $this.data('chosen', new Chosen(this, options));
324 | }
325 | });
326 | }
327 | });
328 |
329 | Chosen = (function(_super) {
330 |
331 | __extends(Chosen, _super);
332 |
333 | function Chosen() {
334 | return Chosen.__super__.constructor.apply(this, arguments);
335 | }
336 |
337 | Chosen.prototype.setup = function() {
338 | this.form_field_jq = $(this.form_field);
339 | this.current_value = this.form_field_jq.val();
340 | return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
341 | };
342 |
343 | Chosen.prototype.finish_setup = function() {
344 | return this.form_field_jq.addClass("chzn-done");
345 | };
346 |
347 | Chosen.prototype.set_up_html = function() {
348 | var container_classes, container_div, container_props, dd_top, dd_width, sf_width;
349 | this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
350 | this.container_id += "_chzn";
351 | container_classes = ["chzn-container"];
352 | container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
353 | if (this.inherit_select_classes && this.form_field.className) {
354 | container_classes.push(this.form_field.className);
355 | }
356 | if (this.is_rtl) {
357 | container_classes.push("chzn-rtl");
358 | }
359 | this.f_width = this.form_field_jq.outerWidth();
360 | container_props = {
361 | id: this.container_id,
362 | "class": container_classes.join(' '),
363 | style: 'width: ' + this.f_width + 'px;',
364 | title: this.form_field.title
365 | };
366 | container_div = $("
", container_props);
367 | if (this.is_multiple) {
368 | container_div.html('');
369 | } else {
370 | container_div.html('' + this.default_text + '
');
371 | }
372 | this.form_field_jq.hide().after(container_div);
373 | this.container = $('#' + this.container_id);
374 | this.dropdown = this.container.find('div.chzn-drop').first();
375 | dd_top = this.container.height();
376 | dd_width = this.f_width - get_side_border_padding(this.dropdown);
377 | this.dropdown.css({
378 | "width": dd_width + "px",
379 | "top": dd_top + "px"
380 | });
381 | this.search_field = this.container.find('input').first();
382 | this.search_results = this.container.find('ul.chzn-results').first();
383 | this.search_field_scale();
384 | this.search_no_results = this.container.find('li.no-results').first();
385 | if (this.is_multiple) {
386 | this.search_choices = this.container.find('ul.chzn-choices').first();
387 | this.search_container = this.container.find('li.search-field').first();
388 | } else {
389 | this.search_container = this.container.find('div.chzn-search').first();
390 | this.selected_item = this.container.find('.chzn-single').first();
391 | sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
392 | this.search_field.css({
393 | "width": sf_width + "px"
394 | });
395 | }
396 | this.results_build();
397 | this.set_tab_index();
398 | return this.form_field_jq.trigger("liszt:ready", {
399 | chosen: this
400 | });
401 | };
402 |
403 | Chosen.prototype.register_observers = function() {
404 | var _this = this;
405 | this.container.mousedown(function(evt) {
406 | return _this.container_mousedown(evt);
407 | });
408 | this.container.mouseup(function(evt) {
409 | return _this.container_mouseup(evt);
410 | });
411 | this.container.mouseenter(function(evt) {
412 | return _this.mouse_enter(evt);
413 | });
414 | this.container.mouseleave(function(evt) {
415 | return _this.mouse_leave(evt);
416 | });
417 | this.search_results.mouseup(function(evt) {
418 | return _this.search_results_mouseup(evt);
419 | });
420 | this.search_results.mouseover(function(evt) {
421 | return _this.search_results_mouseover(evt);
422 | });
423 | this.search_results.mouseout(function(evt) {
424 | return _this.search_results_mouseout(evt);
425 | });
426 | this.form_field_jq.bind("liszt:updated", function(evt) {
427 | return _this.results_update_field(evt);
428 | });
429 | this.form_field_jq.bind("liszt:activate", function(evt) {
430 | return _this.activate_field(evt);
431 | });
432 | this.form_field_jq.bind("liszt:open", function(evt) {
433 | return _this.container_mousedown(evt);
434 | });
435 | this.search_field.blur(function(evt) {
436 | return _this.input_blur(evt);
437 | });
438 | this.search_field.keyup(function(evt) {
439 | return _this.keyup_checker(evt);
440 | });
441 | this.search_field.keydown(function(evt) {
442 | return _this.keydown_checker(evt);
443 | });
444 | this.search_field.focus(function(evt) {
445 | return _this.input_focus(evt);
446 | });
447 | if (this.is_multiple) {
448 | return this.search_choices.click(function(evt) {
449 | return _this.choices_click(evt);
450 | });
451 | } else {
452 | return this.container.click(function(evt) {
453 | return evt.preventDefault();
454 | });
455 | }
456 | };
457 |
458 | Chosen.prototype.search_field_disabled = function() {
459 | this.is_disabled = this.form_field_jq[0].disabled;
460 | if (this.is_disabled) {
461 | this.container.addClass('chzn-disabled');
462 | this.search_field[0].disabled = true;
463 | if (!this.is_multiple) {
464 | this.selected_item.unbind("focus", this.activate_action);
465 | }
466 | return this.close_field();
467 | } else {
468 | this.container.removeClass('chzn-disabled');
469 | this.search_field[0].disabled = false;
470 | if (!this.is_multiple) {
471 | return this.selected_item.bind("focus", this.activate_action);
472 | }
473 | }
474 | };
475 |
476 | Chosen.prototype.container_mousedown = function(evt) {
477 | var target_closelink;
478 | if (!this.is_disabled) {
479 | target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
480 | if (evt && evt.type === "mousedown" && !this.results_showing) {
481 | evt.preventDefault();
482 | }
483 | if (!this.pending_destroy_click && !target_closelink) {
484 | if (!this.active_field) {
485 | if (this.is_multiple) {
486 | this.search_field.val("");
487 | }
488 | $(document).click(this.click_test_action);
489 | this.results_show();
490 | } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
491 | evt.preventDefault();
492 | this.results_toggle();
493 | }
494 | return this.activate_field();
495 | } else {
496 | return this.pending_destroy_click = false;
497 | }
498 | }
499 | };
500 |
501 | Chosen.prototype.container_mouseup = function(evt) {
502 | if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
503 | return this.results_reset(evt);
504 | }
505 | };
506 |
507 | Chosen.prototype.blur_test = function(evt) {
508 | if (!this.active_field && this.container.hasClass("chzn-container-active")) {
509 | return this.close_field();
510 | }
511 | };
512 |
513 | Chosen.prototype.close_field = function() {
514 | $(document).unbind("click", this.click_test_action);
515 | this.active_field = false;
516 | this.results_hide();
517 | this.container.removeClass("chzn-container-active");
518 | this.winnow_results_clear();
519 | this.clear_backstroke();
520 | this.show_search_field_default();
521 | return this.search_field_scale();
522 | };
523 |
524 | Chosen.prototype.activate_field = function() {
525 | this.container.addClass("chzn-container-active");
526 | this.active_field = true;
527 | this.search_field.val(this.search_field.val());
528 | return this.search_field.focus();
529 | };
530 |
531 | Chosen.prototype.test_active_click = function(evt) {
532 | if ($(evt.target).parents('#' + this.container_id).length) {
533 | return this.active_field = true;
534 | } else {
535 | return this.close_field();
536 | }
537 | };
538 |
539 | Chosen.prototype.results_build = function() {
540 | var content, data, _i, _len, _ref;
541 | this.parsing = true;
542 | this.results_data = root.SelectParser.select_to_array(this.form_field);
543 | if (this.is_multiple && this.choices > 0) {
544 | this.search_choices.find("li.search-choice").remove();
545 | this.choices = 0;
546 | } else if (!this.is_multiple) {
547 | this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
548 | if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
549 | this.container.addClass("chzn-container-single-nosearch");
550 | } else {
551 | this.container.removeClass("chzn-container-single-nosearch");
552 | }
553 | }
554 | content = '';
555 | _ref = this.results_data;
556 | for (_i = 0, _len = _ref.length; _i < _len; _i++) {
557 | data = _ref[_i];
558 | if (data.group) {
559 | content += this.result_add_group(data);
560 | } else if (!data.empty) {
561 | content += this.result_add_option(data);
562 | if (data.selected && this.is_multiple) {
563 | this.choice_build(data);
564 | } else if (data.selected && !this.is_multiple) {
565 | this.selected_item.removeClass("chzn-default").find("span").text(data.text);
566 | if (this.allow_single_deselect) {
567 | this.single_deselect_control_build();
568 | }
569 | }
570 | }
571 | }
572 | this.search_field_disabled();
573 | this.show_search_field_default();
574 | this.search_field_scale();
575 | this.search_results.html(content);
576 | return this.parsing = false;
577 | };
578 |
579 | Chosen.prototype.result_add_group = function(group) {
580 | if (!group.disabled) {
581 | group.dom_id = this.container_id + "_g_" + group.array_index;
582 | return '' + $("
").text(group.label).html() + ' ';
583 | } else {
584 | return "";
585 | }
586 | };
587 |
588 | Chosen.prototype.result_do_highlight = function(el) {
589 | var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
590 | if (el.length) {
591 | this.result_clear_highlight();
592 | this.result_highlight = el;
593 | this.result_highlight.addClass("highlighted");
594 | maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
595 | visible_top = this.search_results.scrollTop();
596 | visible_bottom = maxHeight + visible_top;
597 | high_top = this.result_highlight.position().top + this.search_results.scrollTop();
598 | high_bottom = high_top + this.result_highlight.outerHeight();
599 | if (high_bottom >= visible_bottom) {
600 | return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
601 | } else if (high_top < visible_top) {
602 | return this.search_results.scrollTop(high_top);
603 | }
604 | }
605 | };
606 |
607 | Chosen.prototype.result_clear_highlight = function() {
608 | if (this.result_highlight) {
609 | this.result_highlight.removeClass("highlighted");
610 | }
611 | return this.result_highlight = null;
612 | };
613 |
614 | Chosen.prototype.results_show = function() {
615 | var dd_top;
616 | if (!this.is_multiple) {
617 | this.selected_item.addClass("chzn-single-with-drop");
618 | if (this.result_single_selected) {
619 | this.result_do_highlight(this.result_single_selected);
620 | }
621 | } else if (this.max_selected_options <= this.choices) {
622 | this.form_field_jq.trigger("liszt:maxselected", {
623 | chosen: this
624 | });
625 | return false;
626 | }
627 | dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
628 | this.form_field_jq.trigger("liszt:showing_dropdown", {
629 | chosen: this
630 | });
631 | this.dropdown.css({
632 | "top": dd_top + "px",
633 | "left": 0
634 | });
635 | this.results_showing = true;
636 | this.search_field.focus();
637 | this.search_field.val(this.search_field.val());
638 | return this.winnow_results();
639 | };
640 |
641 | Chosen.prototype.results_hide = function() {
642 | if (!this.is_multiple) {
643 | this.selected_item.removeClass("chzn-single-with-drop");
644 | }
645 | this.result_clear_highlight();
646 | this.form_field_jq.trigger("liszt:hiding_dropdown", {
647 | chosen: this
648 | });
649 | this.dropdown.css({
650 | "left": "-9000px"
651 | });
652 | return this.results_showing = false;
653 | };
654 |
655 | Chosen.prototype.set_tab_index = function(el) {
656 | var ti;
657 | if (this.form_field_jq.attr("tabindex")) {
658 | ti = this.form_field_jq.attr("tabindex");
659 | this.form_field_jq.attr("tabindex", -1);
660 | return this.search_field.attr("tabindex", ti);
661 | }
662 | };
663 |
664 | Chosen.prototype.show_search_field_default = function() {
665 | if (this.is_multiple && this.choices < 1 && !this.active_field) {
666 | this.search_field.val(this.default_text);
667 | return this.search_field.addClass("default");
668 | } else {
669 | this.search_field.val("");
670 | return this.search_field.removeClass("default");
671 | }
672 | };
673 |
674 | Chosen.prototype.search_results_mouseup = function(evt) {
675 | var target;
676 | target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
677 | if (target.length) {
678 | this.result_highlight = target;
679 | this.result_select(evt);
680 | return this.search_field.focus();
681 | }
682 | };
683 |
684 | Chosen.prototype.search_results_mouseover = function(evt) {
685 | var target;
686 | target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
687 | if (target) {
688 | return this.result_do_highlight(target);
689 | }
690 | };
691 |
692 | Chosen.prototype.search_results_mouseout = function(evt) {
693 | if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
694 | return this.result_clear_highlight();
695 | }
696 | };
697 |
698 | Chosen.prototype.choices_click = function(evt) {
699 | evt.preventDefault();
700 | if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
701 | return this.results_show();
702 | }
703 | };
704 |
705 | Chosen.prototype.choice_build = function(item) {
706 | var choice_id, html, link,
707 | _this = this;
708 | if (this.is_multiple && this.max_selected_options <= this.choices) {
709 | this.form_field_jq.trigger("liszt:maxselected", {
710 | chosen: this
711 | });
712 | return false;
713 | }
714 | choice_id = this.container_id + "_c_" + item.array_index;
715 | this.choices += 1;
716 | if (item.disabled) {
717 | html = '' + item.html + ' ';
718 | } else {
719 | html = '' + item.html + ' ';
720 | }
721 | this.search_container.before(html);
722 | link = $('#' + choice_id).find("a").first();
723 | return link.click(function(evt) {
724 | return _this.choice_destroy_link_click(evt);
725 | });
726 | };
727 |
728 | Chosen.prototype.choice_destroy_link_click = function(evt) {
729 | evt.preventDefault();
730 | if (!this.is_disabled) {
731 | this.pending_destroy_click = true;
732 | return this.choice_destroy($(evt.target));
733 | } else {
734 | return evt.stopPropagation;
735 | }
736 | };
737 |
738 | Chosen.prototype.choice_destroy = function(link) {
739 | if (this.result_deselect(link.attr("rel"))) {
740 | this.choices -= 1;
741 | this.show_search_field_default();
742 | if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
743 | this.results_hide();
744 | }
745 | link.parents('li').first().remove();
746 | return this.search_field_scale();
747 | }
748 | };
749 |
750 | Chosen.prototype.results_reset = function() {
751 | this.form_field.options[0].selected = true;
752 | this.selected_item.find("span").text(this.default_text);
753 | if (!this.is_multiple) {
754 | this.selected_item.addClass("chzn-default");
755 | }
756 | this.show_search_field_default();
757 | this.results_reset_cleanup();
758 | this.form_field_jq.trigger("change");
759 | if (this.active_field) {
760 | return this.results_hide();
761 | }
762 | };
763 |
764 | Chosen.prototype.results_reset_cleanup = function() {
765 | this.current_value = this.form_field_jq.val();
766 | return this.selected_item.find("abbr").remove();
767 | };
768 |
769 | Chosen.prototype.result_select = function(evt) {
770 | var high, high_id, item, position;
771 | if (this.result_highlight) {
772 | high = this.result_highlight;
773 | high_id = high.attr("id");
774 | this.result_clear_highlight();
775 | if (this.is_multiple) {
776 | this.result_deactivate(high);
777 | } else {
778 | this.search_results.find(".result-selected").removeClass("result-selected");
779 | this.result_single_selected = high;
780 | this.selected_item.removeClass("chzn-default");
781 | }
782 | high.addClass("result-selected");
783 | position = high_id.substr(high_id.lastIndexOf("_") + 1);
784 | item = this.results_data[position];
785 | item.selected = true;
786 | this.form_field.options[item.options_index].selected = true;
787 | if (this.is_multiple) {
788 | this.choice_build(item);
789 | } else {
790 | this.selected_item.find("span").first().text(item.text);
791 | if (this.allow_single_deselect) {
792 | this.single_deselect_control_build();
793 | }
794 | }
795 | if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
796 | this.results_hide();
797 | }
798 | this.search_field.val("");
799 | if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
800 | this.form_field_jq.trigger("change", {
801 | 'selected': this.form_field.options[item.options_index].value
802 | });
803 | }
804 | this.current_value = this.form_field_jq.val();
805 | return this.search_field_scale();
806 | }
807 | };
808 |
809 | Chosen.prototype.result_activate = function(el) {
810 | return el.addClass("active-result");
811 | };
812 |
813 | Chosen.prototype.result_deactivate = function(el) {
814 | return el.removeClass("active-result");
815 | };
816 |
817 | Chosen.prototype.result_deselect = function(pos) {
818 | var result, result_data;
819 | result_data = this.results_data[pos];
820 | if (!this.form_field.options[result_data.options_index].disabled) {
821 | result_data.selected = false;
822 | this.form_field.options[result_data.options_index].selected = false;
823 | result = $("#" + this.container_id + "_o_" + pos);
824 | result.removeClass("result-selected").addClass("active-result").show();
825 | this.result_clear_highlight();
826 | this.winnow_results();
827 | this.form_field_jq.trigger("change", {
828 | deselected: this.form_field.options[result_data.options_index].value
829 | });
830 | this.search_field_scale();
831 | return true;
832 | } else {
833 | return false;
834 | }
835 | };
836 |
837 | Chosen.prototype.single_deselect_control_build = function() {
838 | if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
839 | return this.selected_item.find("span").first().after(" ");
840 | }
841 | };
842 |
843 | Chosen.prototype.winnow_results = function() {
844 | var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
845 | this.no_results_clear();
846 | results = 0;
847 | searchText = this.search_field.val() === this.default_text ? "" : $('
').text($.trim(this.search_field.val())).html();
848 | regexAnchor = this.search_contains ? "" : "^";
849 | regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
850 | zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
851 | _ref = this.results_data;
852 | for (_i = 0, _len = _ref.length; _i < _len; _i++) {
853 | option = _ref[_i];
854 | if (!option.disabled && !option.empty) {
855 | if (option.group) {
856 | $('#' + option.dom_id).css('display', 'none');
857 | } else if (!(this.is_multiple && option.selected)) {
858 | found = false;
859 | result_id = option.dom_id;
860 | result = $("#" + result_id);
861 | if (regex.test(option.html)) {
862 | found = true;
863 | results += 1;
864 | } else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
865 | parts = option.html.replace(/\[|\]/g, "").split(" ");
866 | if (parts.length) {
867 | for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
868 | part = parts[_j];
869 | if (regex.test(part)) {
870 | found = true;
871 | results += 1;
872 | }
873 | }
874 | }
875 | }
876 | if (found) {
877 | if (searchText.length) {
878 | startpos = option.html.search(zregex);
879 | text = option.html.substr(0, startpos + searchText.length) + '' + option.html.substr(startpos + searchText.length);
880 | text = text.substr(0, startpos) + '' + text.substr(startpos);
881 | } else {
882 | text = option.html;
883 | }
884 | result.html(text);
885 | this.result_activate(result);
886 | if (option.group_array_index != null) {
887 | $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
888 | }
889 | } else {
890 | if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
891 | this.result_clear_highlight();
892 | }
893 | this.result_deactivate(result);
894 | }
895 | }
896 | }
897 | }
898 | if (results < 1 && searchText.length) {
899 | return this.no_results(searchText);
900 | } else {
901 | return this.winnow_results_set_highlight();
902 | }
903 | };
904 |
905 | Chosen.prototype.winnow_results_clear = function() {
906 | var li, lis, _i, _len, _results;
907 | this.search_field.val("");
908 | lis = this.search_results.find("li");
909 | _results = [];
910 | for (_i = 0, _len = lis.length; _i < _len; _i++) {
911 | li = lis[_i];
912 | li = $(li);
913 | if (li.hasClass("group-result")) {
914 | _results.push(li.css('display', 'auto'));
915 | } else if (!this.is_multiple || !li.hasClass("result-selected")) {
916 | _results.push(this.result_activate(li));
917 | } else {
918 | _results.push(void 0);
919 | }
920 | }
921 | return _results;
922 | };
923 |
924 | Chosen.prototype.winnow_results_set_highlight = function() {
925 | var do_high, selected_results;
926 | if (!this.result_highlight) {
927 | selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
928 | do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
929 | if (do_high != null) {
930 | return this.result_do_highlight(do_high);
931 | }
932 | }
933 | };
934 |
935 | Chosen.prototype.no_results = function(terms) {
936 | var no_results_html;
937 | no_results_html = $('' + this.results_none_found + ' " " ');
938 | no_results_html.find("span").first().html(terms);
939 | return this.search_results.append(no_results_html);
940 | };
941 |
942 | Chosen.prototype.no_results_clear = function() {
943 | return this.search_results.find(".no-results").remove();
944 | };
945 |
946 | Chosen.prototype.keydown_arrow = function() {
947 | var first_active, next_sib;
948 | if (!this.result_highlight) {
949 | first_active = this.search_results.find("li.active-result").first();
950 | if (first_active) {
951 | this.result_do_highlight($(first_active));
952 | }
953 | } else if (this.results_showing) {
954 | next_sib = this.result_highlight.nextAll("li.active-result").first();
955 | if (next_sib) {
956 | this.result_do_highlight(next_sib);
957 | }
958 | }
959 | if (!this.results_showing) {
960 | return this.results_show();
961 | }
962 | };
963 |
964 | Chosen.prototype.keyup_arrow = function() {
965 | var prev_sibs;
966 | if (!this.results_showing && !this.is_multiple) {
967 | return this.results_show();
968 | } else if (this.result_highlight) {
969 | prev_sibs = this.result_highlight.prevAll("li.active-result");
970 | if (prev_sibs.length) {
971 | return this.result_do_highlight(prev_sibs.first());
972 | } else {
973 | if (this.choices > 0) {
974 | this.results_hide();
975 | }
976 | return this.result_clear_highlight();
977 | }
978 | }
979 | };
980 |
981 | Chosen.prototype.keydown_backstroke = function() {
982 | var next_available_destroy;
983 | if (this.pending_backstroke) {
984 | this.choice_destroy(this.pending_backstroke.find("a").first());
985 | return this.clear_backstroke();
986 | } else {
987 | next_available_destroy = this.search_container.siblings("li.search-choice").last();
988 | if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
989 | this.pending_backstroke = next_available_destroy;
990 | if (this.single_backstroke_delete) {
991 | return this.keydown_backstroke();
992 | } else {
993 | return this.pending_backstroke.addClass("search-choice-focus");
994 | }
995 | }
996 | }
997 | };
998 |
999 | Chosen.prototype.clear_backstroke = function() {
1000 | if (this.pending_backstroke) {
1001 | this.pending_backstroke.removeClass("search-choice-focus");
1002 | }
1003 | return this.pending_backstroke = null;
1004 | };
1005 |
1006 | Chosen.prototype.keydown_checker = function(evt) {
1007 | var stroke, _ref;
1008 | stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
1009 | this.search_field_scale();
1010 | if (stroke !== 8 && this.pending_backstroke) {
1011 | this.clear_backstroke();
1012 | }
1013 | switch (stroke) {
1014 | case 8:
1015 | this.backstroke_length = this.search_field.val().length;
1016 | break;
1017 | case 9:
1018 | if (this.results_showing && !this.is_multiple) {
1019 | this.result_select(evt);
1020 | }
1021 | this.mouse_on_container = false;
1022 | break;
1023 | case 13:
1024 | evt.preventDefault();
1025 | break;
1026 | case 38:
1027 | evt.preventDefault();
1028 | this.keyup_arrow();
1029 | break;
1030 | case 40:
1031 | this.keydown_arrow();
1032 | break;
1033 | }
1034 | };
1035 |
1036 | Chosen.prototype.search_field_scale = function() {
1037 | var dd_top, div, h, style, style_block, styles, w, _i, _len;
1038 | if (this.is_multiple) {
1039 | h = 0;
1040 | w = 0;
1041 | style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1042 | styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1043 | for (_i = 0, _len = styles.length; _i < _len; _i++) {
1044 | style = styles[_i];
1045 | style_block += style + ":" + this.search_field.css(style) + ";";
1046 | }
1047 | div = $('
', {
1048 | 'style': style_block
1049 | });
1050 | div.text(this.search_field.val());
1051 | $('body').append(div);
1052 | w = div.width() + 25;
1053 | div.remove();
1054 | if (w > this.f_width - 10) {
1055 | w = this.f_width - 10;
1056 | }
1057 | this.search_field.css({
1058 | 'width': w + 'px'
1059 | });
1060 | dd_top = this.container.height();
1061 | return this.dropdown.css({
1062 | "top": dd_top + "px"
1063 | });
1064 | }
1065 | };
1066 |
1067 | Chosen.prototype.generate_random_id = function() {
1068 | var string;
1069 | string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
1070 | while ($("#" + string).length > 0) {
1071 | string += this.generate_random_char();
1072 | }
1073 | return string;
1074 | };
1075 |
1076 | return Chosen;
1077 |
1078 | })(AbstractChosen);
1079 |
1080 | root.Chosen = Chosen;
1081 |
1082 | get_side_border_padding = function(elmt) {
1083 | var side_border_padding;
1084 | return side_border_padding = elmt.outerWidth() - elmt.width();
1085 | };
1086 |
1087 | root.get_side_border_padding = get_side_border_padding;
1088 |
1089 | }).call(this);
1090 |
--------------------------------------------------------------------------------
/demo/chosen/chosen.jquery.min.js:
--------------------------------------------------------------------------------
1 | // Chosen, a Select Box Enhancer for jQuery and Protoype
2 | // by Patrick Filler for Harvest, http://getharvest.com
3 | //
4 | // Version 0.9.11
5 | // Full source at https://github.com/harvesthq/chosen
6 | // Copyright (c) 2011 Harvest http://getharvest.com
7 |
8 | // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9 | // This file is generated by `cake build`, do not edit it by hand.
10 | (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r"+e.html+"")},e.prototype.results_update_field=function(){return this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("
",i),this.is_multiple?r.html(''):r.html(''+this.default_text+'
'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){return e.container_mousedown(t)}),this.container.mouseup(function(t){return e.container_mouseup(t)}),this.container.mouseenter(function(t){return e.mouse_enter(t)}),this.container.mouseleave(function(t){return e.mouse_leave(t)}),this.search_results.mouseup(function(t){return e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){return e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){return e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){return e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){return e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){return e.container_mousedown(t)}),this.search_field.blur(function(t){return e.input_blur(t)}),this.search_field.keyup(function(t){return e.keyup_checker(t)}),this.search_field.keydown(function(t){return e.keydown_checker(t)}),this.search_field.focus(function(t){return e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){return e.choices_click(t)}):this.container.click(function(e){return e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n'+e("
").text(t.label).html()+"")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n'+t.html+" ":r=''+t.html+' ',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after(' ')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("
").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v"+n.html.substr(c+l.length),h=h.substr(0,c)+""+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r'+this.results_none_found+' " "'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a ",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
--------------------------------------------------------------------------------
/demo/chosen/chosen.proto.min.js:
--------------------------------------------------------------------------------
1 | // Chosen, a Select Box Enhancer for jQuery and Protoype
2 | // by Patrick Filler for Harvest, http://getharvest.com
3 | //
4 | // Version 0.9.11
5 | // Full source at https://github.com/harvesthq/chosen
6 | // Copyright (c) 2011 Harvest http://getharvest.com
7 |
8 | // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9 | // This file is generated by `cake build`, do not edit it by hand.
10 | (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r"+e.html+"")},e.prototype.results_update_field=function(){return this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r={}.hasOwnProperty,i=function(e,t){function i(){this.constructor=e}for(var n in t)r.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};n=this,e=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return i(r,e),r.prototype.setup=function(){return this.current_value=this.form_field.value,this.is_rtl=this.form_field.hasClassName("chzn-rtl")},r.prototype.finish_setup=function(){return this.form_field.addClassName("chzn-done")},r.prototype.set_default_values=function(){return r.__super__.set_default_values.call(this),this.single_temp=new Template('#{default}
'),this.multi_temp=new Template(''),this.choice_temp=new Template('#{choice} '),this.choice_noclose_temp=new Template('#{choice} '),this.no_results_temp=new Template(''+this.results_none_found+' "#{terms} " ')},r.prototype.set_up_html=function(){var e,n,r,i,s,o;return this.container_id=this.form_field.identify().replace(/[^\w]/g,"_")+"_chzn",n=["chzn-container"],n.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&n.push(this.form_field.className),this.is_rtl&&n.push("chzn-rtl"),this.f_width=this.form_field.getStyle("width")?parseInt(this.form_field.getStyle("width"),10):this.form_field.getWidth(),r={id:this.container_id,"class":n.join(" "),style:"width: "+this.f_width+"px",title:this.form_field.title},e=this.is_multiple?(new Element("div",r)).update(this.multi_temp.evaluate({"default":this.default_text})):(new Element("div",r)).update(this.single_temp.evaluate({"default":this.default_text})),this.form_field.hide().insert({after:e}),this.container=$(this.container_id),this.dropdown=this.container.down("div.chzn-drop"),i=this.container.getHeight(),s=this.f_width-t(this.dropdown),this.dropdown.setStyle({width:s+"px",top:i+"px"}),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chzn-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chzn-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chzn-search"),this.selected_item=this.container.down(".chzn-single"),o=s-t(this.search_container)-t(this.search_field),this.search_field.setStyle({width:o+"px"})),this.results_build(),this.set_tab_index(),this.form_field.fire("liszt:ready",{chosen:this})},r.prototype.register_observers=function(){var e=this;return this.container.observe("mousedown",function(t){return e.container_mousedown(t)}),this.container.observe("mouseup",function(t){return e.container_mouseup(t)}),this.container.observe("mouseenter",function(t){return e.mouse_enter(t)}),this.container.observe("mouseleave",function(t){return e.mouse_leave(t)}),this.search_results.observe("mouseup",function(t){return e.search_results_mouseup(t)}),this.search_results.observe("mouseover",function(t){return e.search_results_mouseover(t)}),this.search_results.observe("mouseout",function(t){return e.search_results_mouseout(t)}),this.form_field.observe("liszt:updated",function(t){return e.results_update_field(t)}),this.form_field.observe("liszt:activate",function(t){return e.activate_field(t)}),this.form_field.observe("liszt:open",function(t){return e.container_mousedown(t)}),this.search_field.observe("blur",function(t){return e.input_blur(t)}),this.search_field.observe("keyup",function(t){return e.keyup_checker(t)}),this.search_field.observe("keydown",function(t){return e.keydown_checker(t)}),this.search_field.observe("focus",function(t){return e.input_focus(t)}),this.is_multiple?this.search_choices.observe("click",function(t){return e.choices_click(t)}):this.container.observe("click",function(e){return e.preventDefault()})},r.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled;if(this.is_disabled)return this.container.addClassName("chzn-disabled"),this.search_field.disabled=!0,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_action),this.close_field();this.container.removeClassName("chzn-disabled"),this.search_field.disabled=!1;if(!this.is_multiple)return this.selected_item.observe("focus",this.activate_action)},r.prototype.container_mousedown=function(e){var t;if(!this.is_disabled)return t=e!=null?e.target.hasClassName("search-choice-close"):!1,e&&e.type==="mousedown"&&!this.results_showing&&e.stop(),!this.pending_destroy_click&&!t?(this.active_field?!this.is_multiple&&e&&(e.target===this.selected_item||e.target.up("a.chzn-single"))&&this.results_toggle():(this.is_multiple&&this.search_field.clear(),document.observe("click",this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},r.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},r.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClassName("chzn-container-active"))return this.close_field()},r.prototype.close_field=function(){return document.stopObserving("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClassName("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},r.prototype.activate_field=function(){return this.container.addClassName("chzn-container-active"),this.active_field=!0,this.search_field.value=this.search_field.value,this.search_field.focus()},r.prototype.test_active_click=function(e){return e.target.up("#"+this.container_id)?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){var e,t,r,i,s;this.parsing=!0,this.results_data=n.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.select("li.search-choice").invoke("remove"),this.choices=0):this.is_multiple||(this.selected_item.addClassName("chzn-default").down("span").update(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClassName("chzn-container-single-nosearch"):this.container.removeClassName("chzn-container-single-nosearch")),e="",s=this.results_data;for(r=0,i=s.length;r'+e.label.escapeHTML()+"")},r.prototype.result_do_highlight=function(e){var t,n,r,i,s;this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClassName("highlighted"),r=parseInt(this.search_results.getStyle("maxHeight"),10),s=this.search_results.scrollTop,i=r+s,n=this.result_highlight.positionedOffset().top,t=n+this.result_highlight.getHeight();if(t>=i)return this.search_results.scrollTop=t-r>0?t-r:0;if(n0&&this.search_field.value.length<1&&this.results_hide(),e.up("li").remove(),this.search_field_scale()},r.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.down("span").update(this.default_text),this.is_multiple||this.selected_item.addClassName("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),typeof Event.simulate=="function"&&this.form_field.simulate("change");if(this.active_field)return this.results_hide()},r.prototype.results_reset_cleanup=function(){var e;this.current_value=this.form_field.value,e=this.selected_item.down("abbr");if(e)return e.remove()},r.prototype.result_select=function(e){var t,n,r;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.descendants(".result-selected").invoke("removeClassName","result-selected"),this.selected_item.removeClassName("chzn-default"),this.result_single_selected=t),t.addClassName("result-selected"),r=t.id.substr(t.id.lastIndexOf("_")+1),n=this.results_data[r],n.selected=!0,this.form_field.options[n.options_index].selected=!0,this.is_multiple?this.choice_build(n):(this.selected_item.down("span").update(n.html),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.value="",typeof Event.simulate=="function"&&(this.is_multiple||this.form_field.value!==this.current_value)&&this.form_field.simulate("change"),this.current_value=this.form_field.value,this.search_field_scale()},r.prototype.result_activate=function(e){return e.addClassName("active-result")},r.prototype.result_deactivate=function(e){return e.removeClassName("active-result")},r.prototype.result_deselect=function(e){var t,n;return n=this.results_data[e],this.form_field.options[n.options_index].disabled?!1:(n.selected=!1,this.form_field.options[n.options_index].selected=!1,t=$(this.container_id+"_o_"+e),t.removeClassName("result-selected").addClassName("active-result").show(),this.result_clear_highlight(),this.winnow_results(),typeof Event.simulate=="function"&&this.form_field.simulate("change"),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&!this.selected_item.down("abbr"))return this.selected_item.down("span").insert({after:' '})},r.prototype.winnow_results=function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m;this.no_results_clear(),u=0,a=this.search_field.value===this.default_text?"":this.search_field.value.strip().escapeHTML(),s=this.search_contains?"":"^",i=new RegExp(s+a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),c=new RegExp(a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),m=this.results_data;for(h=0,d=m.length;h=0||t.html.indexOf("[")===0)){r=t.html.replace(/\[|\]/g,"").split(" ");if(r.length)for(p=0,v=r.length;p"+t.html.substr(f+a.length),l=l.substr(0,f)+""+l.substr(f)):l=t.html,$(o).innerHTML!==l&&$(o).update(l),this.result_activate($(o)),t.group_array_index!=null&&$(this.results_data[t.group_array_index].dom_id).setStyle({display:"list-item"})):($(o)===this.result_highlight&&this.result_clear_highlight(),this.result_deactivate($(o)))}}return u<1&&a.length?this.no_results(a):this.winnow_results_set_highlight()},r.prototype.winnow_results_clear=function(){var e,t,n,r,i;this.search_field.clear(),t=this.search_results.select("li"),i=[];for(n=0,r=t.length;n0&&this.results_hide(),this.result_clear_highlight())},r.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke();e=this.search_container.siblings().last();if(e&&e.hasClassName("search-choice")&&!e.hasClassName("search-choice-disabled"))return this.pending_backstroke=e,this.pending_backstroke&&this.pending_backstroke.addClassName("search-choice-focus"),this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClassName("search-choice-focus")},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},r.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.value.length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},r.prototype.search_field_scale=function(){var e,t,n,r,i,s,o,u,a;if(this.is_multiple){n=0,o=0,i="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(u=0,a=s.length;uthis.f_width-10&&(o=this.f_width-10),this.search_field.setStyle({width:o+"px"}),e=this.container.getHeight(),this.dropdown.setStyle({top:e+"px"})}},r}(AbstractChosen),n.Chosen=e,Prototype.Browser.IE&&/MSIE (\d+\.\d+);/.test(navigator.userAgent)&&(Prototype.BrowserFeatures.Version=new Number(RegExp.$1)),t=function(e){var t,n;return t=new Element.Layout(e),n=t.get("border-left")+t.get("border-right")+t.get("padding-left")+t.get("padding-right")},n.get_side_border_padding=t}.call(this);
--------------------------------------------------------------------------------
/demo/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Application Wizard Bootstrap v3.x
5 |
6 |
7 |
8 |
9 |
10 |
40 |
41 |
42 |
46 |
47 |
48 |
49 | Back to docs
50 |
51 | Open wizard
52 |
53 |
54 |
55 |
56 |
57 |
58 |
Name & FQDN
59 |
60 |
67 |
68 |
85 |
86 |
97 |
98 |
99 |
100 |
Server Group
101 |
102 |
110 |
111 |
112 |
113 |
Service Selection
114 |
115 |
116 | It's recommended that you select at least one
117 | service, like ping.
118 |
119 |
120 |
156 |
157 |
158 |
159 |
Monitoring Location
160 |
161 |
211 |
212 |
213 |
214 |
Notification Schedule
215 |
216 |
234 |
235 |
250 |
251 |
252 |
253 |
Agent Setup
254 |
255 |
271 |
272 |
273 |
283 |
284 |
285 |
286 |
287 | There was a problem with your submission.
288 | Please correct the errors and re-submit.
289 |
290 |
291 |
292 |
293 |
294 | There was a problem submitting the form.
295 | Please try again in a minute.
296 |
297 |
298 |
299 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
472 |
473 |
474 |
--------------------------------------------------------------------------------
/demo/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/demo/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/demo/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/demo/img/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/img/folder.png
--------------------------------------------------------------------------------
/demo/img/groups.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/img/groups.png
--------------------------------------------------------------------------------
/demo/img/server_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoffat/bootstrap-application-wizard/91c9ba33efa3929be46b68616a128da4470f552e/demo/img/server_new.png
--------------------------------------------------------------------------------
/demo/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.0.2 by @fat and @mdo
3 | * Copyright 2013 Twitter, Inc.
4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0
5 | *
6 | * Designed and built with all the love in the world by @mdo and @fat.
7 | */
8 |
9 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i ').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h
'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
--------------------------------------------------------------------------------
/demo/js/html5shiv-3.7.0.js:
--------------------------------------------------------------------------------
1 | /*
2 | HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3 | */
4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x";
6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML=" ";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
8 | if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^