Capability Manager Enhanced - Version 2.0.3

Version Description

  • 8 Dec 2021 =
    • Fixed : Security issue
Download this release

Release Info

Developer kevinB
Plugin Icon 128x128 Capability Manager Enhanced
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.3.1 to 2.0.3

Files changed (55) hide show
  1. capsman-enhanced.php +6 -26
  2. common/css/admin.css +29 -289
  3. common/img/capabilities-wp-logo.png +0 -0
  4. common/js/admin.dev.js +3 -20
  5. common/js/admin.js +2 -3
  6. common/libs/chosen-v1.8.3/create-example.jquery.html +1473 -0
  7. common/libs/chosen-v1.8.3/create-example.proto.html +1472 -0
  8. common/libs/chosen-v1.8.3/docsupport/chosen.png +0 -0
  9. common/libs/chosen-v1.8.3/docsupport/init.js +11 -0
  10. common/libs/chosen-v1.8.3/docsupport/init.proto.js +16 -0
  11. common/libs/chosen-v1.8.3/docsupport/jquery-1.12.4.min.js +5 -0
  12. common/libs/chosen-v1.8.3/docsupport/jquery-3.2.1.min.js +4 -0
  13. common/libs/chosen-v1.8.3/docsupport/oss-credit.png +0 -0
  14. common/libs/chosen-v1.8.3/docsupport/prism.css +108 -0
  15. common/libs/chosen-v1.8.3/docsupport/prism.js +9 -0
  16. common/libs/chosen-v1.8.3/docsupport/prototype-1.7.0.0.js +6082 -0
  17. common/libs/chosen-v1.8.3/docsupport/style.css +219 -0
  18. common/libs/chosen-v1.8.3/index.html +1473 -0
  19. common/libs/chosen-v1.8.3/index.proto.html +1472 -0
  20. common/libs/chosen-v1.8.3/options.html +311 -0
  21. composer.json +0 -1
  22. framework/lib/formating.php +3 -3
  23. framework/lib/users.php +0 -4
  24. includes-core/CoreAdmin.php +0 -9
  25. includes-core/admin-core.css +0 -63
  26. includes-core/editor-features-promo.php +0 -147
  27. includes-core/pp-capabilities-permissions.php +0 -445
  28. includes/admin-load.php +0 -310
  29. includes/admin.php +1184 -1342
  30. includes/backup-handler.php +0 -6
  31. includes/backup.php +1 -1
  32. includes/cap-helper.php +0 -7
  33. includes/features/admin-features.php +0 -303
  34. includes/features/editor-features-classic.php +0 -87
  35. includes/features/editor-features-gutenberg.php +0 -84
  36. includes/features/editor-features.php +0 -235
  37. includes/features/features-block-script.js +0 -32
  38. includes/features/restrict-admin-features.php +0 -323
  39. includes/features/restrict-editor-features.php +0 -356
  40. includes/filters-admin.php +0 -6
  41. includes/filters.php +72 -23
  42. includes/functions-admin.php +182 -134
  43. includes/functions.php +1 -141
  44. includes/handler.php +4 -10
  45. includes/manager.php +16 -161
  46. includes/network.php +1 -8
  47. includes/pp-handler.php +2 -7
  48. includes/pp-ui.php +18 -8
  49. includes/publishpress-roles.php +1 -1
  50. includes/roles/class/class-pp-roles-actions.php +1 -1
  51. includes/roles/class/class-pp-roles-list-table.php +1 -3
  52. includes/settings.php +3 -5
  53. languages/capsman-enhanced-en_US.mo +0 -0
  54. languages/capsman-enhanced-en_US.po +198 -584
  55. languages/capsman-enhanced.pot +8 -67
capsman-enhanced.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: PublishPress Capabilities
4
  * Plugin URI: https://publishpress.com/capability-manager/
5
  * Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
6
- * Version: 2.3.1
7
  * Author: PublishPress
8
  * Author URI: https://publishpress.com/
9
  * Text Domain: capsman-enhanced
@@ -25,13 +25,13 @@
25
  * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
26
  * @license GNU General Public License version 3
27
  * @link https://publishpress.com/
28
- * @version 2.3.1
29
  */
30
 
31
  if (!defined('CAPSMAN_VERSION')) {
32
- define('CAPSMAN_VERSION', '2.3.1');
33
- define('CAPSMAN_ENH_VERSION', '2.3.1');
34
- define('PUBLISHPRESS_CAPS_VERSION', '2.3.1');
35
  }
36
 
37
  foreach (get_option('active_plugins') as $plugin_file) {
@@ -119,10 +119,8 @@ if ( version_compare(PHP_VERSION, '5.4.0', '<') ) {
119
  load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/languages');
120
 
121
  // @todo: refactor
122
- require_once (dirname(__FILE__) . '/includes/functions-admin.php');
123
-
124
  global $capsman_admin;
125
- require_once (dirname(__FILE__) . '/includes/admin-load.php');
126
  $capsman_admin = new PP_Capabilities_Admin_UI();
127
  }
128
 
@@ -141,21 +139,3 @@ add_action( 'init', '_cme_cap_helper', 49 ); // Press Permit Cap Helper, regist
141
 
142
  if ( is_multisite() )
143
  require_once ( dirname(__FILE__) . '/includes/network.php' );
144
-
145
- // Display message inviting to install Permissions
146
- if (
147
- ((defined('WP_DEBUG') && defined('CAPSMAN_INSTALL_PERMISSIONS')) || (!cme_is_plugin_active('press-permit-core.php') && !cme_is_plugin_active('presspermit-pro.php')))
148
- && !isset( $_GET['pp-after-click'])
149
- && !defined('CAPSMAN_DISABLE_PERMISSIONS_PROMO')
150
- ) {
151
- add_action('init', function() {
152
- global $pagenow;
153
-
154
- if (in_array($pagenow, ['edit.php', 'plugins.php', 'plugin-install.php'])
155
- || ('admin.php' == $pagenow && !empty($_REQUEST['page']) && (false !== strpos($_REQUEST['page'], 'pp-capabilities')))
156
- || (!empty($_REQUEST['action']) && ('ppc_permissions_action' == $_REQUEST['action']))
157
- ) {
158
- require_once ( dirname(__FILE__) . '/includes-core/pp-capabilities-permissions.php' );
159
- }
160
- });
161
- }
3
  * Plugin Name: PublishPress Capabilities
4
  * Plugin URI: https://publishpress.com/capability-manager/
5
  * Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
6
+ * Version: 2.0.3
7
  * Author: PublishPress
8
  * Author URI: https://publishpress.com/
9
  * Text Domain: capsman-enhanced
25
  * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
26
  * @license GNU General Public License version 3
27
  * @link https://publishpress.com/
28
+ * @version 2.0.3
29
  */
30
 
31
  if (!defined('CAPSMAN_VERSION')) {
32
+ define('CAPSMAN_VERSION', '2.0.3');
33
+ define('CAPSMAN_ENH_VERSION', '2.0.3');
34
+ define('PUBLISHPRESS_CAPS_VERSION', '2.0.3');
35
  }
36
 
37
  foreach (get_option('active_plugins') as $plugin_file) {
119
  load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/languages');
120
 
121
  // @todo: refactor
 
 
122
  global $capsman_admin;
123
+ require_once (dirname(__FILE__) . '/includes/functions-admin.php');
124
  $capsman_admin = new PP_Capabilities_Admin_UI();
125
  }
126
 
139
 
140
  if ( is_multisite() )
141
  require_once ( dirname(__FILE__) . '/includes/network.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
common/css/admin.css CHANGED
@@ -36,7 +36,7 @@ a.cap_type {
36
  a.cap_type:hover {
37
  text-decoration: underline;
38
  }
39
-
40
  ul.cme-listhoriz li {
41
  text-align: center;
42
  padding-right: 1em;
@@ -61,7 +61,7 @@ float: left;
61
  margin: 0;
62
  }
63
 
64
-
65
  div.cme-listhoriz h3 {
66
  margin: 0.2em;
67
  }
@@ -70,41 +70,18 @@ div.cme-cap-type-tables {
70
  border: 1px solid black;
71
  }
72
 
73
- /*
74
- table.cme-typecaps {
75
-
76
- }
77
- */
78
-
79
- table .cme-typecaps td:first-of-type {
80
- text-align: left;
81
- }
82
-
83
  table .cme-typecaps td {
84
  text-align: center;
85
  height: 2em;
86
  }
87
 
88
- table .cme-typecaps th:first-of-type {
89
- width: 160px;
90
- }
91
-
92
  table .cme-typecaps th {
93
- cursor: pointer;
94
- text-align: center;
95
  }
96
 
97
  table.cme-typecaps span.cap-x {
98
  display: none;
99
- cursor: pointer;
100
- }
101
-
102
- table.cme-checklist span.cap-x {
103
- cursor: pointer;
104
- }
105
-
106
- table.cme-checklist tr td input[type="checkbox"] {
107
- margin-right: 10px !important;
108
  }
109
 
110
  h3.cme-cap-section {
@@ -258,40 +235,40 @@ table#akmin td.sidebar li.publishpress-contact a{
258
  min-width:600px;
259
  }
260
 
261
- #pp_features div.pp-logo {
262
  text-align: center;
263
  }
264
 
265
- #pp_features div.features-wrap {
266
- margin-left: auto;
267
- margin-right: auto;
268
- text-align: center;
269
  width: 600px;
270
  }
271
 
272
- #pp_features ul.pp-features {
273
- list-style: none;
274
- padding-top:10px;
275
- text-align:left;
276
  margin-left: auto;
277
  }
278
 
279
- #pp_features ul.pp-features li:before {
280
  content: "\2713\0020";
281
  }
282
 
283
- #pp_features ul.pp-features li {
284
  padding-bottom: 5px;
285
  }
286
 
287
- #pp_features img.cme-play {
288
- margin-bottom: -3px;
289
  margin-left: 5px;
290
  }
291
 
292
  div.publishpress-caps-manage span.manage-members {
293
- margin-left:5px;
294
- font-weight:normal;
295
  color: #777;
296
  }
297
 
@@ -300,7 +277,7 @@ div.publishpress-caps-manage span.manage-members a {
300
  }
301
 
302
  div.publishpress-caps-manage span.manage-members a:hover {
303
- text-decoration: underline;
304
  color:#655997;
305
  }
306
 
@@ -313,8 +290,8 @@ div.publishpress-headline .cme-subtext a:hover {
313
  }
314
 
315
  div.publishpress-caps-backup th {
316
- text-align:right;
317
- padding-top:28px;
318
  width: 140px;
319
  }
320
 
@@ -357,7 +334,7 @@ div.pp-caps-backup-button {
357
  }
358
 
359
  div.cme-restore-button {
360
- margin-top: 25px;
361
  padding-left: 5px;
362
  }
363
 
@@ -378,7 +355,7 @@ div.publishpress-caps-backup td.cme-backup-info li.cme-change {
378
  }
379
 
380
  div.publishpress-caps-backup td.cme-backup-info .cme-plus {
381
- font-weight: bold;
382
  color: green;
383
  }
384
 
@@ -396,14 +373,14 @@ span.pp-restore-caps-no-change {
396
  }
397
 
398
  div.publishpress-caps-backup td.cme-backup-info .cme-minus {
399
- font-weight: bold;
400
- color: #a00;
401
  text-decoration: line-through;
402
  }
403
 
404
  div.publishpress-caps-backup td.cme-backup-info .cme-negate {
405
- font-weight: bold;
406
- background-color: #a00;
407
  color: white;
408
  text-decoration: line-through;
409
  }
@@ -432,241 +409,4 @@ div.publishpress-caps-backup td.cme-backup-info .cme-negate {
432
 
433
  table#akmin tr td input[type=checkbox] {
434
  margin: 0;
435
- }
436
-
437
-
438
- .pp-capability-menus {
439
- width: 100%;
440
- overflow: hidden;
441
- background: #fff;
442
- background: linear-gradient(90deg, #fafafa 0%, #fafafa 20%, #fff 20%, #fff 100%);
443
- }
444
-
445
- .pp-capability-menus .pp-capability-menus-wrap {
446
- float: left;
447
- width: 100%;
448
- margin-left: -1px;
449
- margin-right: 20px;
450
- }
451
-
452
-
453
- #pp-capability-menu-wrapper table {
454
- border-right: none;
455
- border-top: none;
456
- border-bottom: none;
457
- }
458
-
459
- #pp-capability-menu-wrapper table td,
460
- #pp-capability-menu-wrapper table th {
461
- padding: 10px;
462
- padding-bottom: 10px;
463
- font-size: 13px;
464
- line-height: 20px;
465
- }
466
-
467
- #pp-capability-menu-wrapper table td h4.ppc-menu-row-section {
468
- margin-bottom: 0;
469
- }
470
-
471
- #pp-capability-menu-wrapper table td {
472
- padding: 9px;
473
- }
474
-
475
- #pp-capability-menu-wrapper tbody tr:last-of-type td {
476
- border-bottom: none;
477
- }
478
-
479
- #pp-capability-menu-wrapper tfoot th {
480
- border-color: #eee;
481
- }
482
-
483
-
484
- table#akmin .pp-capability-menus-select .restrict-column {
485
- width: 70px !important;
486
- text-align: center;
487
- display: table-cell !important;
488
- clear: none !important;
489
- }
490
-
491
- .pp-capability-menus .menu-item-link {
492
- display: inline;
493
- color: #0073aa;
494
- margin: -4px;
495
- line-height: inherit;
496
- padding: 4px 8px;
497
- border: 1px solid transparent;
498
- background: transparent;
499
- border-radius: 0;
500
- outline: none;
501
- -webkit-transition: all 0.25s ease-out;
502
- -moz-transition: all 0.25s ease-out;
503
- -o-transition: all 0.25s ease-out;
504
- transition: all 0.25s ease-out;
505
- }
506
-
507
- .pp-capability-menus .menu-item-link:hover,
508
- .pp-capability-menus .menu-item-link:focus {
509
- border-color: #eee;
510
- background: #fafafa;
511
- cursor: pointer;
512
- }
513
-
514
- .pp-capability-menus .menu-item-link:active {
515
- color: #0073aa;
516
- border-color: #0073aa;
517
- }
518
-
519
- .pp-capability-menus .check-all-menu-link,
520
- .pp-capability-menus .check-all-menu-link:active {
521
- color: #555;
522
- }
523
-
524
- .pp-capability-menus .menu-item-link.restricted,
525
- .pp-capability-menus .menu-item-link.restricted:active {
526
- color: crimson;
527
- }
528
-
529
- .pp-capability-menus .menu-item-link.disabled,
530
- .pp-capability-menus .menu-item-link.disabled:active {
531
- color: #555;
532
- }
533
-
534
- .pp-capability-menus .menu-item-link + .dashicons {
535
- display: none;
536
- margin-top: 1px;
537
- margin-bottom: -1px;
538
- line-height: inherit;
539
- }
540
-
541
- .pp-capability-menus .menu-item-link:hover + .dashicons,
542
- .pp-capability-menus .menu-item-link:focus + .dashicons {
543
- display: inline-block;
544
- }
545
-
546
- .pp-capability-menus-wrapper .button-primary {
547
- margin-bottom: 25px !important;
548
- }
549
-
550
-
551
- .pp-capability-menus-wrapper .tooltip {
552
- position: relative;
553
- display: inline-block;
554
- border-bottom: 1px dotted black;
555
- }
556
-
557
- .pp-capability-menus-wrapper .tooltip .tooltiptext {
558
- visibility: hidden;
559
- width: 120px;
560
- background-color: black;
561
- color: #fff;
562
- text-align: center;
563
- padding: 5px 0;
564
- border-radius: 6px;
565
-
566
- position: absolute;
567
- z-index: 1;
568
- }
569
-
570
- .pp-capability-menus-wrapper .tooltip:hover .tooltiptext {
571
- visibility: visible;
572
- }
573
-
574
- .capabilities_page_pp-capabilities-admin-menus input.ppc-admin-menu-submit,
575
- .capabilities_page_pp-capabilities-nav-menus input.ppc-nav-menu-submit {
576
- margin-bottom: 10px !important;
577
- }
578
-
579
- .pp-capability-menus-wrapper .features-section-header {
580
- padding-left: 35px !important;
581
- }
582
-
583
- /* ====================================================== Main Screen */
584
-
585
- #ppc-capabilities-wrapper {
586
- display: grid;
587
- grid-template-columns: 1fr 4fr;
588
- min-height: 400px;
589
- }
590
-
591
- /*
592
- #ppc-capabilities-wrapper .ppc-capabilities-tabs {
593
-
594
- }
595
- */
596
-
597
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul {
598
- padding: 0;
599
- margin: 0;
600
- display: block;
601
- }
602
-
603
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul > li {
604
- margin: 0;
605
- padding: 15px 12px;
606
- background: #f0f0f1;
607
- cursor: pointer;
608
- border-bottom: 1px solid #ccc;
609
- border-right: 1px solid #ccc;
610
- font-size: 1.1em;
611
- line-height: 1.3em;
612
- }
613
-
614
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul > li:last-child {
615
- margin-bottom: 20px;
616
- }
617
-
618
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul > li.ppc-capabilities-tab-active {
619
- background: #fff;
620
- border-right-color: #fff;
621
- }
622
-
623
- #ppc-capabilities-wrapper .ppc-capabilities-content > div {
624
- padding: 20px;
625
- }
626
-
627
- #ppc-capabilities-wrapper .ppc-capabilities-content > div > h3 {
628
- margin-top: 0;
629
- }
630
-
631
- @media (max-width: 1199px) {
632
-
633
- #ppc-capabilities-wrapper {
634
- display: block;
635
- }
636
-
637
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul > li,
638
- #ppc-capabilities-wrapper .ppc-capabilities-tabs > ul > li.ppc-capabilities-tab-active {
639
- border-right: none;
640
- }
641
-
642
- #publishpress_caps_form #akmin td.content,
643
- #publishpress_caps_form #akmin td.sidebar {
644
- display: block;
645
- padding: 0;
646
- }
647
-
648
- #publishpress_caps_form #akmin td.content {
649
- margin-bottom: 40px;
650
- }
651
- }
652
-
653
- @media (max-width: 782px) {
654
-
655
- table.cme-checklist.form-table tr td {
656
- padding: 15px 10px;
657
- }
658
-
659
- table .cme-typecaps th:first-of-type {
660
- width: 110px;
661
- }
662
-
663
- .pp-capability-menus {
664
- background: linear-gradient(90deg, #fafafa 0%, #fafafa 48px, #fff 48px, #fff 100%);
665
- }
666
-
667
- #pp-capability-menu-wrapper table td,
668
- #pp-capability-menu-wrapper table th {
669
- line-height: 24px;
670
- }
671
-
672
- }
36
  a.cap_type:hover {
37
  text-decoration: underline;
38
  }
39
+
40
  ul.cme-listhoriz li {
41
  text-align: center;
42
  padding-right: 1em;
61
  margin: 0;
62
  }
63
 
64
+
65
  div.cme-listhoriz h3 {
66
  margin: 0.2em;
67
  }
70
  border: 1px solid black;
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
73
  table .cme-typecaps td {
74
  text-align: center;
75
  height: 2em;
76
  }
77
 
 
 
 
 
78
  table .cme-typecaps th {
79
+ padding-left: 0.3em;
80
+ padding-right: 0.3em;
81
  }
82
 
83
  table.cme-typecaps span.cap-x {
84
  display: none;
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  h3.cme-cap-section {
235
  min-width:600px;
236
  }
237
 
238
+ #pp_features div.pp-logo {
239
  text-align: center;
240
  }
241
 
242
+ #pp_features div.features-wrap {
243
+ margin-left: auto;
244
+ margin-right: auto;
245
+ text-align: center;
246
  width: 600px;
247
  }
248
 
249
+ #pp_features ul.pp-features {
250
+ list-style: none;
251
+ padding-top:10px;
252
+ text-align:left;
253
  margin-left: auto;
254
  }
255
 
256
+ #pp_features ul.pp-features li:before {
257
  content: "\2713\0020";
258
  }
259
 
260
+ #pp_features ul.pp-features li {
261
  padding-bottom: 5px;
262
  }
263
 
264
+ #pp_features img.cme-play {
265
+ margin-bottom: -3px;
266
  margin-left: 5px;
267
  }
268
 
269
  div.publishpress-caps-manage span.manage-members {
270
+ margin-left:5px;
271
+ font-weight:normal;
272
  color: #777;
273
  }
274
 
277
  }
278
 
279
  div.publishpress-caps-manage span.manage-members a:hover {
280
+ text-decoration: underline;
281
  color:#655997;
282
  }
283
 
290
  }
291
 
292
  div.publishpress-caps-backup th {
293
+ text-align:right;
294
+ padding-top:28px;
295
  width: 140px;
296
  }
297
 
334
  }
335
 
336
  div.cme-restore-button {
337
+ margin-top: 25px;
338
  padding-left: 5px;
339
  }
340
 
355
  }
356
 
357
  div.publishpress-caps-backup td.cme-backup-info .cme-plus {
358
+ font-weight: bold;
359
  color: green;
360
  }
361
 
373
  }
374
 
375
  div.publishpress-caps-backup td.cme-backup-info .cme-minus {
376
+ font-weight: bold;
377
+ color: #a00;
378
  text-decoration: line-through;
379
  }
380
 
381
  div.publishpress-caps-backup td.cme-backup-info .cme-negate {
382
+ font-weight: bold;
383
+ background-color: #a00;
384
  color: white;
385
  text-decoration: line-through;
386
  }
409
 
410
  table#akmin tr td input[type=checkbox] {
411
  margin: 0;
412
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
common/img/capabilities-wp-logo.png DELETED
Binary file
common/js/admin.dev.js CHANGED
@@ -12,8 +12,6 @@ jQuery(document).ready( function($) {
12
  var cap_name_attr = $(this).parent().find('input[type="checkbox"]').attr('name');
13
  $(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
14
 
15
- $('input[name="' + cap_name_attr + '"]').closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');
16
-
17
  return false;
18
  });
19
 
@@ -23,16 +21,6 @@ jQuery(document).ready( function($) {
23
  $(this).parent().find('input[type="checkbox"]').prop('checked',false);
24
  $(this).parent().find('input.cme-negation-input').remove();
25
 
26
- // Also apply for any other checkboxes with the same name
27
- var cap_name_attr = $(this).next('input[type="checkbox"]').attr('name');
28
-
29
- if (!cap_name_attr) {
30
- cap_name_attr = $(this).next('label').find('input[type="checkbox"]').attr('name');
31
- }
32
-
33
- $('input[name="' + cap_name_attr + '"]').parent().closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');
34
- $('input[name="' + cap_name_attr + '"]').prop('checked',false).parent().find('input.cme-negation-input').remove();
35
-
36
  return false;
37
  });
38
 
@@ -63,8 +51,6 @@ jQuery(document).ready( function($) {
63
 
64
  var cap_name_attr = $(this).find('input[type="checkbox"]').attr('name');
65
  $(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
66
-
67
- $('input[name="' + cap_name_attr + '"]').parent().next('a.neg-cap:visible').click();
68
  });
69
 
70
  return false;
@@ -81,12 +67,9 @@ jQuery(document).ready( function($) {
81
  else
82
  var class_sel = '[class*="post-cap"]';
83
 
84
- var chks = $(this).closest("table")
85
- .find("tr td" + class_sel + ":nth-child(" + (columnNo+1) + ') input[type="checkbox"]:visible');
86
-
87
- $(chks).each(function(i,e) {
88
- $('input[name="' + $(this).attr('name') + '"]').prop('checked', check_val);
89
- });
90
 
91
  $(this).prop('checked_all',check_val);
92
  });
12
  var cap_name_attr = $(this).parent().find('input[type="checkbox"]').attr('name');
13
  $(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
14
 
 
 
15
  return false;
16
  });
17
 
21
  $(this).parent().find('input[type="checkbox"]').prop('checked',false);
22
  $(this).parent().find('input.cme-negation-input').remove();
23
 
 
 
 
 
 
 
 
 
 
 
24
  return false;
25
  });
26
 
51
 
52
  var cap_name_attr = $(this).find('input[type="checkbox"]').attr('name');
53
  $(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
 
 
54
  });
55
 
56
  return false;
67
  else
68
  var class_sel = '[class*="post-cap"]';
69
 
70
+ $(this).closest("table")
71
+ .find("tr td" + class_sel + ":nth-child(" + (columnNo+1) + ') input[type="checkbox"]:visible')
72
+ .prop("checked", check_val);
 
 
 
73
 
74
  $(this).prop('checked_all',check_val);
75
  });
common/js/admin.js CHANGED
@@ -1,4 +1,3 @@
1
- jQuery(document).ready(function($){$('a.neg-cap').attr('title',cmeAdmin.negationCaption);$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);$('span.cap-x').attr('title',cmeAdmin.capNegated);$('table.cme-checklist input[class!="cme-check-all"]').not(':disabled').attr('title',cmeAdmin.chkCaption);$('table.cme-checklist a.neg-cap').click(function(e){$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');$('input[name="'+cap_name_attr+'"]').closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');return false;});$(document).on('click','table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span',function(e){$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$(this).parent().find('input[type="checkbox"]').prop('checked',false);$(this).parent().find('input.cme-negation-input').remove();var cap_name_attr=$(this).next('input[type="checkbox"]').attr('name');if(!cap_name_attr){cap_name_attr=$(this).next('label').find('input[type="checkbox"]').attr('name');}
2
- $('input[name="'+cap_name_attr+'"]').parent().closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$('input[name="'+cap_name_attr+'"]').prop('checked',false).parent().find('input.cme-negation-input').remove();return false;});$("#publishpress_caps_form").bind("keypress",function(e){if(e.keyCode==13){$(document.activeElement).parent().find('input[type="submit"]').first().click();return false;}});$('input.cme-check-all').click(function(e){$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked',$(this).is(":checked"));});$('a.cme-neg-all').click(function(e){$(this).closest('table').find('a.neg-cap:visible').click();return false;});$('a.cme-switch-all').click(function(e){$(this).closest('table').find('td.cap-neg span').click();return false;});$('table.cme-typecaps a.neg-type-caps').click(function(e){$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each(function(){$(this).addClass('cap-neg');var cap_name_attr=$(this).find('input[type="checkbox"]').attr('name');$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');$('input[name="'+cap_name_attr+'"]').parent().next('a.neg-cap:visible').click();});return false;});$('table.cme-typecaps th').click(function(){var columnNo=$(this).index();var check_val=!$(this).prop('checked_all');if($(this).hasClass('term-cap'))
3
  var class_sel='[class*="term-cap"]';else
4
- var class_sel='[class*="post-cap"]';var chks=$(this).closest("table").find("tr td"+class_sel+":nth-child("+(columnNo+1)+') input[type="checkbox"]:visible');$(chks).each(function(i,e){$('input[name="'+$(this).attr('name')+'"]').prop('checked',check_val);});$(this).prop('checked_all',check_val);});$('a.cme-fix-read-cap').click(function(){$('input[name="caps[read]"]').prop('checked',true);$('input[name="SaveRole"]').trigger('click');return false;});});
1
+ jQuery(document).ready(function($){$('a.neg-cap').attr('title',cmeAdmin.negationCaption);$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);$('span.cap-x').attr('title',cmeAdmin.capNegated);$('table.cme-checklist input[class!="cme-check-all"]').not(':disabled').attr('title',cmeAdmin.chkCaption);$('table.cme-checklist a.neg-cap').click(function(e){$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');return false;});$(document).on('click','table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span',function(e){$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$(this).parent().find('input[type="checkbox"]').prop('checked',false);$(this).parent().find('input.cme-negation-input').remove();return false;});$("#publishpress_caps_form").bind("keypress",function(e){if(e.keyCode==13){$(document.activeElement).parent().find('input[type="submit"]').first().click();return false;}});$('input.cme-check-all').click(function(e){$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked',$(this).is(":checked"));});$('a.cme-neg-all').click(function(e){$(this).closest('table').find('a.neg-cap:visible').click();return false;});$('a.cme-switch-all').click(function(e){$(this).closest('table').find('td.cap-neg span').click();return false;});$('table.cme-typecaps a.neg-type-caps').click(function(e){$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each(function(){$(this).addClass('cap-neg');var cap_name_attr=$(this).find('input[type="checkbox"]').attr('name');$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');});return false;});$('table.cme-typecaps th').click(function(){var columnNo=$(this).index();var check_val=!$(this).prop('checked_all');if($(this).hasClass('term-cap'))
 
2
  var class_sel='[class*="term-cap"]';else
3
+ var class_sel='[class*="post-cap"]';$(this).closest("table").find("tr td"+class_sel+":nth-child("+(columnNo+1)+') input[type="checkbox"]:visible').prop("checked",check_val);$(this).prop('checked_all',check_val);});$('a.cme-fix-read-cap').click(function(){$('input[name="caps[read]"]').prop('checked',true);$('input[name="SaveRole"]').trigger('click');return false;});});
common/libs/chosen-v1.8.3/create-example.jquery.html ADDED
@@ -0,0 +1,1473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
+ <link rel="stylesheet" href="docsupport/style.css">
7
+ <link rel="stylesheet" href="docsupport/prism.css">
8
+ <link rel="stylesheet" href="chosen.css">
9
+
10
+ <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
+
12
+ </head>
13
+ <body>
14
+ <form>
15
+ <div id="container">
16
+ <div id="content">
17
+ <header>
18
+ <h1>Chosen <small>(<span id="latest-version">v1.8.3</span>)</small></h1>
19
+ </header>
20
+ <p>Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.</p>
21
+
22
+ <p>
23
+ <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
24
+ <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
25
+ <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
26
+ </p>
27
+
28
+ <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
29
+ <div class="side-by-side clearfix">
30
+ <div>
31
+ <em>Turns This</em>
32
+ <select data-placeholder="Choose a Country..." class="select" tabindex="1">
33
+ <option value=""></option>
34
+ <option value="United States">United States</option>
35
+ <option value="United Kingdom">United Kingdom</option>
36
+ <option value="Afghanistan">Afghanistan</option>
37
+ <option value="Aland Islands">Aland Islands</option>
38
+ <option value="Albania">Albania</option>
39
+ <option value="Algeria">Algeria</option>
40
+ <option value="American Samoa">American Samoa</option>
41
+ <option value="Andorra">Andorra</option>
42
+ <option value="Angola">Angola</option>
43
+ <option value="Anguilla">Anguilla</option>
44
+ <option value="Antarctica">Antarctica</option>
45
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
46
+ <option value="Argentina">Argentina</option>
47
+ <option value="Armenia">Armenia</option>
48
+ <option value="Aruba">Aruba</option>
49
+ <option value="Australia">Australia</option>
50
+ <option value="Austria">Austria</option>
51
+ <option value="Azerbaijan">Azerbaijan</option>
52
+ <option value="Bahamas">Bahamas</option>
53
+ <option value="Bahrain">Bahrain</option>
54
+ <option value="Bangladesh">Bangladesh</option>
55
+ <option value="Barbados">Barbados</option>
56
+ <option value="Belarus">Belarus</option>
57
+ <option value="Belgium">Belgium</option>
58
+ <option value="Belize">Belize</option>
59
+ <option value="Benin">Benin</option>
60
+ <option value="Bermuda">Bermuda</option>
61
+ <option value="Bhutan">Bhutan</option>
62
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
63
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
64
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
65
+ <option value="Botswana">Botswana</option>
66
+ <option value="Bouvet Island">Bouvet Island</option>
67
+ <option value="Brazil">Brazil</option>
68
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
69
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
70
+ <option value="Bulgaria">Bulgaria</option>
71
+ <option value="Burkina Faso">Burkina Faso</option>
72
+ <option value="Burundi">Burundi</option>
73
+ <option value="Cambodia">Cambodia</option>
74
+ <option value="Cameroon">Cameroon</option>
75
+ <option value="Canada">Canada</option>
76
+ <option value="Cape Verde">Cape Verde</option>
77
+ <option value="Cayman Islands">Cayman Islands</option>
78
+ <option value="Central African Republic">Central African Republic</option>
79
+ <option value="Chad">Chad</option>
80
+ <option value="Chile">Chile</option>
81
+ <option value="China">China</option>
82
+ <option value="Christmas Island">Christmas Island</option>
83
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
84
+ <option value="Colombia">Colombia</option>
85
+ <option value="Comoros">Comoros</option>
86
+ <option value="Congo">Congo</option>
87
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
88
+ <option value="Cook Islands">Cook Islands</option>
89
+ <option value="Costa Rica">Costa Rica</option>
90
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
91
+ <option value="Croatia">Croatia</option>
92
+ <option value="Cuba">Cuba</option>
93
+ <option value="Curacao">Curacao</option>
94
+ <option value="Cyprus">Cyprus</option>
95
+ <option value="Czech Republic">Czech Republic</option>
96
+ <option value="Denmark">Denmark</option>
97
+ <option value="Djibouti">Djibouti</option>
98
+ <option value="Dominica">Dominica</option>
99
+ <option value="Dominican Republic">Dominican Republic</option>
100
+ <option value="Ecuador">Ecuador</option>
101
+ <option value="Egypt">Egypt</option>
102
+ <option value="El Salvador">El Salvador</option>
103
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
104
+ <option value="Eritrea">Eritrea</option>
105
+ <option value="Estonia">Estonia</option>
106
+ <option value="Ethiopia">Ethiopia</option>
107
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
108
+ <option value="Faroe Islands">Faroe Islands</option>
109
+ <option value="Fiji">Fiji</option>
110
+ <option value="Finland">Finland</option>
111
+ <option value="France">France</option>
112
+ <option value="French Guiana">French Guiana</option>
113
+ <option value="French Polynesia">French Polynesia</option>
114
+ <option value="French Southern Territories">French Southern Territories</option>
115
+ <option value="Gabon">Gabon</option>
116
+ <option value="Gambia">Gambia</option>
117
+ <option value="Georgia">Georgia</option>
118
+ <option value="Germany">Germany</option>
119
+ <option value="Ghana">Ghana</option>
120
+ <option value="Gibraltar">Gibraltar</option>
121
+ <option value="Greece">Greece</option>
122
+ <option value="Greenland">Greenland</option>
123
+ <option value="Grenada">Grenada</option>
124
+ <option value="Guadeloupe">Guadeloupe</option>
125
+ <option value="Guam">Guam</option>
126
+ <option value="Guatemala">Guatemala</option>
127
+ <option value="Guernsey">Guernsey</option>
128
+ <option value="Guinea">Guinea</option>
129
+ <option value="Guinea-bissau">Guinea-bissau</option>
130
+ <option value="Guyana">Guyana</option>
131
+ <option value="Haiti">Haiti</option>
132
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
133
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
134
+ <option value="Honduras">Honduras</option>
135
+ <option value="Hong Kong">Hong Kong</option>
136
+ <option value="Hungary">Hungary</option>
137
+ <option value="Iceland">Iceland</option>
138
+ <option value="India">India</option>
139
+ <option value="Indonesia">Indonesia</option>
140
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
141
+ <option value="Iraq">Iraq</option>
142
+ <option value="Ireland">Ireland</option>
143
+ <option value="Isle of Man">Isle of Man</option>
144
+ <option value="Israel">Israel</option>
145
+ <option value="Italy">Italy</option>
146
+ <option value="Jamaica">Jamaica</option>
147
+ <option value="Japan">Japan</option>
148
+ <option value="Jersey">Jersey</option>
149
+ <option value="Jordan">Jordan</option>
150
+ <option value="Kazakhstan">Kazakhstan</option>
151
+ <option value="Kenya">Kenya</option>
152
+ <option value="Kiribati">Kiribati</option>
153
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
154
+ <option value="Korea, Republic of">Korea, Republic of</option>
155
+ <option value="Kuwait">Kuwait</option>
156
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
157
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
158
+ <option value="Latvia">Latvia</option>
159
+ <option value="Lebanon">Lebanon</option>
160
+ <option value="Lesotho">Lesotho</option>
161
+ <option value="Liberia">Liberia</option>
162
+ <option value="Libya">Libya</option>
163
+ <option value="Liechtenstein">Liechtenstein</option>
164
+ <option value="Lithuania">Lithuania</option>
165
+ <option value="Luxembourg">Luxembourg</option>
166
+ <option value="Macao">Macao</option>
167
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
168
+ <option value="Madagascar">Madagascar</option>
169
+ <option value="Malawi">Malawi</option>
170
+ <option value="Malaysia">Malaysia</option>
171
+ <option value="Maldives">Maldives</option>
172
+ <option value="Mali">Mali</option>
173
+ <option value="Malta">Malta</option>
174
+ <option value="Marshall Islands">Marshall Islands</option>
175
+ <option value="Martinique">Martinique</option>
176
+ <option value="Mauritania">Mauritania</option>
177
+ <option value="Mauritius">Mauritius</option>
178
+ <option value="Mayotte">Mayotte</option>
179
+ <option value="Mexico">Mexico</option>
180
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
181
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
182
+ <option value="Monaco">Monaco</option>
183
+ <option value="Mongolia">Mongolia</option>
184
+ <option value="Montenegro">Montenegro</option>
185
+ <option value="Montserrat">Montserrat</option>
186
+ <option value="Morocco">Morocco</option>
187
+ <option value="Mozambique">Mozambique</option>
188
+ <option value="Myanmar">Myanmar</option>
189
+ <option value="Namibia">Namibia</option>
190
+ <option value="Nauru">Nauru</option>
191
+ <option value="Nepal">Nepal</option>
192
+ <option value="Netherlands">Netherlands</option>
193
+ <option value="New Caledonia">New Caledonia</option>
194
+ <option value="New Zealand">New Zealand</option>
195
+ <option value="Nicaragua">Nicaragua</option>
196
+ <option value="Niger">Niger</option>
197
+ <option value="Nigeria">Nigeria</option>
198
+ <option value="Niue">Niue</option>
199
+ <option value="Norfolk Island">Norfolk Island</option>
200
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
201
+ <option value="Norway">Norway</option>
202
+ <option value="Oman">Oman</option>
203
+ <option value="Pakistan">Pakistan</option>
204
+ <option value="Palau">Palau</option>
205
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
206
+ <option value="Panama">Panama</option>
207
+ <option value="Papua New Guinea">Papua New Guinea</option>
208
+ <option value="Paraguay">Paraguay</option>
209
+ <option value="Peru">Peru</option>
210
+ <option value="Philippines">Philippines</option>
211
+ <option value="Pitcairn">Pitcairn</option>
212
+ <option value="Poland">Poland</option>
213
+ <option value="Portugal">Portugal</option>
214
+ <option value="Puerto Rico">Puerto Rico</option>
215
+ <option value="Qatar">Qatar</option>
216
+ <option value="Reunion">Reunion</option>
217
+ <option value="Romania">Romania</option>
218
+ <option value="Russian Federation">Russian Federation</option>
219
+ <option value="Rwanda">Rwanda</option>
220
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
221
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
222
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
223
+ <option value="Saint Lucia">Saint Lucia</option>
224
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
225
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
226
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
227
+ <option value="Samoa">Samoa</option>
228
+ <option value="San Marino">San Marino</option>
229
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
230
+ <option value="Saudi Arabia">Saudi Arabia</option>
231
+ <option value="Senegal">Senegal</option>
232
+ <option value="Serbia">Serbia</option>
233
+ <option value="Seychelles">Seychelles</option>
234
+ <option value="Sierra Leone">Sierra Leone</option>
235
+ <option value="Singapore">Singapore</option>
236
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
237
+ <option value="Slovakia">Slovakia</option>
238
+ <option value="Slovenia">Slovenia</option>
239
+ <option value="Solomon Islands">Solomon Islands</option>
240
+ <option value="Somalia">Somalia</option>
241
+ <option value="South Africa">South Africa</option>
242
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
243
+ <option value="South Sudan">South Sudan</option>
244
+ <option value="Spain">Spain</option>
245
+ <option value="Sri Lanka">Sri Lanka</option>
246
+ <option value="Sudan">Sudan</option>
247
+ <option value="Suriname">Suriname</option>
248
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
249
+ <option value="Swaziland">Swaziland</option>
250
+ <option value="Sweden">Sweden</option>
251
+ <option value="Switzerland">Switzerland</option>
252
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
253
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
254
+ <option value="Tajikistan">Tajikistan</option>
255
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
256
+ <option value="Thailand">Thailand</option>
257
+ <option value="Timor-leste">Timor-leste</option>
258
+ <option value="Togo">Togo</option>
259
+ <option value="Tokelau">Tokelau</option>
260
+ <option value="Tonga">Tonga</option>
261
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
262
+ <option value="Tunisia">Tunisia</option>
263
+ <option value="Turkey">Turkey</option>
264
+ <option value="Turkmenistan">Turkmenistan</option>
265
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
266
+ <option value="Tuvalu">Tuvalu</option>
267
+ <option value="Uganda">Uganda</option>
268
+ <option value="Ukraine">Ukraine</option>
269
+ <option value="United Arab Emirates">United Arab Emirates</option>
270
+ <option value="United Kingdom">United Kingdom</option>
271
+ <option value="United States">United States</option>
272
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
273
+ <option value="Uruguay">Uruguay</option>
274
+ <option value="Uzbekistan">Uzbekistan</option>
275
+ <option value="Vanuatu">Vanuatu</option>
276
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
277
+ <option value="Viet Nam">Viet Nam</option>
278
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
279
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
280
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
281
+ <option value="Western Sahara">Western Sahara</option>
282
+ <option value="Yemen">Yemen</option>
283
+ <option value="Zambia">Zambia</option>
284
+ <option value="Zimbabwe">Zimbabwe</option>
285
+ </select>
286
+ </div>
287
+ <div>
288
+ <em>Into This</em>
289
+ <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
290
+ <option value=""></option>
291
+ <option value="United States">United States</option>
292
+ <option value="United Kingdom">United Kingdom</option>
293
+ <option value="Afghanistan">Afghanistan</option>
294
+ <option value="Aland Islands">Aland Islands</option>
295
+ <option value="Albania">Albania</option>
296
+ <option value="Algeria">Algeria</option>
297
+ <option value="American Samoa">American Samoa</option>
298
+ <option value="Andorra">Andorra</option>
299
+ <option value="Angola">Angola</option>
300
+ <option value="Anguilla">Anguilla</option>
301
+ <option value="Antarctica">Antarctica</option>
302
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
303
+ <option value="Argentina">Argentina</option>
304
+ <option value="Armenia">Armenia</option>
305
+ <option value="Aruba">Aruba</option>
306
+ <option value="Australia">Australia</option>
307
+ <option value="Austria">Austria</option>
308
+ <option value="Azerbaijan">Azerbaijan</option>
309
+ <option value="Bahamas">Bahamas</option>
310
+ <option value="Bahrain">Bahrain</option>
311
+ <option value="Bangladesh">Bangladesh</option>
312
+ <option value="Barbados">Barbados</option>
313
+ <option value="Belarus">Belarus</option>
314
+ <option value="Belgium">Belgium</option>
315
+ <option value="Belize">Belize</option>
316
+ <option value="Benin">Benin</option>
317
+ <option value="Bermuda">Bermuda</option>
318
+ <option value="Bhutan">Bhutan</option>
319
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
320
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
321
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
322
+ <option value="Botswana">Botswana</option>
323
+ <option value="Bouvet Island">Bouvet Island</option>
324
+ <option value="Brazil">Brazil</option>
325
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
326
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
327
+ <option value="Bulgaria">Bulgaria</option>
328
+ <option value="Burkina Faso">Burkina Faso</option>
329
+ <option value="Burundi">Burundi</option>
330
+ <option value="Cambodia">Cambodia</option>
331
+ <option value="Cameroon">Cameroon</option>
332
+ <option value="Canada">Canada</option>
333
+ <option value="Cape Verde">Cape Verde</option>
334
+ <option value="Cayman Islands">Cayman Islands</option>
335
+ <option value="Central African Republic">Central African Republic</option>
336
+ <option value="Chad">Chad</option>
337
+ <option value="Chile">Chile</option>
338
+ <option value="China">China</option>
339
+ <option value="Christmas Island">Christmas Island</option>
340
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
341
+ <option value="Colombia">Colombia</option>
342
+ <option value="Comoros">Comoros</option>
343
+ <option value="Congo">Congo</option>
344
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
345
+ <option value="Cook Islands">Cook Islands</option>
346
+ <option value="Costa Rica">Costa Rica</option>
347
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
348
+ <option value="Croatia">Croatia</option>
349
+ <option value="Cuba">Cuba</option>
350
+ <option value="Curacao">Curacao</option>
351
+ <option value="Cyprus">Cyprus</option>
352
+ <option value="Czech Republic">Czech Republic</option>
353
+ <option value="Denmark">Denmark</option>
354
+ <option value="Djibouti">Djibouti</option>
355
+ <option value="Dominica">Dominica</option>
356
+ <option value="Dominican Republic">Dominican Republic</option>
357
+ <option value="Ecuador">Ecuador</option>
358
+ <option value="Egypt">Egypt</option>
359
+ <option value="El Salvador">El Salvador</option>
360
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
361
+ <option value="Eritrea">Eritrea</option>
362
+ <option value="Estonia">Estonia</option>
363
+ <option value="Ethiopia">Ethiopia</option>
364
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
365
+ <option value="Faroe Islands">Faroe Islands</option>
366
+ <option value="Fiji">Fiji</option>
367
+ <option value="Finland">Finland</option>
368
+ <option value="France">France</option>
369
+ <option value="French Guiana">French Guiana</option>
370
+ <option value="French Polynesia">French Polynesia</option>
371
+ <option value="French Southern Territories">French Southern Territories</option>
372
+ <option value="Gabon">Gabon</option>
373
+ <option value="Gambia">Gambia</option>
374
+ <option value="Georgia">Georgia</option>
375
+ <option value="Germany">Germany</option>
376
+ <option value="Ghana">Ghana</option>
377
+ <option value="Gibraltar">Gibraltar</option>
378
+ <option value="Greece">Greece</option>
379
+ <option value="Greenland">Greenland</option>
380
+ <option value="Grenada">Grenada</option>
381
+ <option value="Guadeloupe">Guadeloupe</option>
382
+ <option value="Guam">Guam</option>
383
+ <option value="Guatemala">Guatemala</option>
384
+ <option value="Guernsey">Guernsey</option>
385
+ <option value="Guinea">Guinea</option>
386
+ <option value="Guinea-bissau">Guinea-bissau</option>
387
+ <option value="Guyana">Guyana</option>
388
+ <option value="Haiti">Haiti</option>
389
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
390
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
391
+ <option value="Honduras">Honduras</option>
392
+ <option value="Hong Kong">Hong Kong</option>
393
+ <option value="Hungary">Hungary</option>
394
+ <option value="Iceland">Iceland</option>
395
+ <option value="India">India</option>
396
+ <option value="Indonesia">Indonesia</option>
397
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
398
+ <option value="Iraq">Iraq</option>
399
+ <option value="Ireland">Ireland</option>
400
+ <option value="Isle of Man">Isle of Man</option>
401
+ <option value="Israel">Israel</option>
402
+ <option value="Italy">Italy</option>
403
+ <option value="Jamaica">Jamaica</option>
404
+ <option value="Japan">Japan</option>
405
+ <option value="Jersey">Jersey</option>
406
+ <option value="Jordan">Jordan</option>
407
+ <option value="Kazakhstan">Kazakhstan</option>
408
+ <option value="Kenya">Kenya</option>
409
+ <option value="Kiribati">Kiribati</option>
410
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
411
+ <option value="Korea, Republic of">Korea, Republic of</option>
412
+ <option value="Kuwait">Kuwait</option>
413
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
414
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
415
+ <option value="Latvia">Latvia</option>
416
+ <option value="Lebanon">Lebanon</option>
417
+ <option value="Lesotho">Lesotho</option>
418
+ <option value="Liberia">Liberia</option>
419
+ <option value="Libya">Libya</option>
420
+ <option value="Liechtenstein">Liechtenstein</option>
421
+ <option value="Lithuania">Lithuania</option>
422
+ <option value="Luxembourg">Luxembourg</option>
423
+ <option value="Macao">Macao</option>
424
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
425
+ <option value="Madagascar">Madagascar</option>
426
+ <option value="Malawi">Malawi</option>
427
+ <option value="Malaysia">Malaysia</option>
428
+ <option value="Maldives">Maldives</option>
429
+ <option value="Mali">Mali</option>
430
+ <option value="Malta">Malta</option>
431
+ <option value="Marshall Islands">Marshall Islands</option>
432
+ <option value="Martinique">Martinique</option>
433
+ <option value="Mauritania">Mauritania</option>
434
+ <option value="Mauritius">Mauritius</option>
435
+ <option value="Mayotte">Mayotte</option>
436
+ <option value="Mexico">Mexico</option>
437
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
438
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
439
+ <option value="Monaco">Monaco</option>
440
+ <option value="Mongolia">Mongolia</option>
441
+ <option value="Montenegro">Montenegro</option>
442
+ <option value="Montserrat">Montserrat</option>
443
+ <option value="Morocco">Morocco</option>
444
+ <option value="Mozambique">Mozambique</option>
445
+ <option value="Myanmar">Myanmar</option>
446
+ <option value="Namibia">Namibia</option>
447
+ <option value="Nauru">Nauru</option>
448
+ <option value="Nepal">Nepal</option>
449
+ <option value="Netherlands">Netherlands</option>
450
+ <option value="New Caledonia">New Caledonia</option>
451
+ <option value="New Zealand">New Zealand</option>
452
+ <option value="Nicaragua">Nicaragua</option>
453
+ <option value="Niger">Niger</option>
454
+ <option value="Nigeria">Nigeria</option>
455
+ <option value="Niue">Niue</option>
456
+ <option value="Norfolk Island">Norfolk Island</option>
457
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
458
+ <option value="Norway">Norway</option>
459
+ <option value="Oman">Oman</option>
460
+ <option value="Pakistan">Pakistan</option>
461
+ <option value="Palau">Palau</option>
462
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
463
+ <option value="Panama">Panama</option>
464
+ <option value="Papua New Guinea">Papua New Guinea</option>
465
+ <option value="Paraguay">Paraguay</option>
466
+ <option value="Peru">Peru</option>
467
+ <option value="Philippines">Philippines</option>
468
+ <option value="Pitcairn">Pitcairn</option>
469
+ <option value="Poland">Poland</option>
470
+ <option value="Portugal">Portugal</option>
471
+ <option value="Puerto Rico">Puerto Rico</option>
472
+ <option value="Qatar">Qatar</option>
473
+ <option value="Reunion">Reunion</option>
474
+ <option value="Romania">Romania</option>
475
+ <option value="Russian Federation">Russian Federation</option>
476
+ <option value="Rwanda">Rwanda</option>
477
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
478
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
479
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
480
+ <option value="Saint Lucia">Saint Lucia</option>
481
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
482
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
483
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
484
+ <option value="Samoa">Samoa</option>
485
+ <option value="San Marino">San Marino</option>
486
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
487
+ <option value="Saudi Arabia">Saudi Arabia</option>
488
+ <option value="Senegal">Senegal</option>
489
+ <option value="Serbia">Serbia</option>
490
+ <option value="Seychelles">Seychelles</option>
491
+ <option value="Sierra Leone">Sierra Leone</option>
492
+ <option value="Singapore">Singapore</option>
493
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
494
+ <option value="Slovakia">Slovakia</option>
495
+ <option value="Slovenia">Slovenia</option>
496
+ <option value="Solomon Islands">Solomon Islands</option>
497
+ <option value="Somalia">Somalia</option>
498
+ <option value="South Africa">South Africa</option>
499
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
500
+ <option value="South Sudan">South Sudan</option>
501
+ <option value="Spain">Spain</option>
502
+ <option value="Sri Lanka">Sri Lanka</option>
503
+ <option value="Sudan">Sudan</option>
504
+ <option value="Suriname">Suriname</option>
505
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
506
+ <option value="Swaziland">Swaziland</option>
507
+ <option value="Sweden">Sweden</option>
508
+ <option value="Switzerland">Switzerland</option>
509
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
510
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
511
+ <option value="Tajikistan">Tajikistan</option>
512
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
513
+ <option value="Thailand">Thailand</option>
514
+ <option value="Timor-leste">Timor-leste</option>
515
+ <option value="Togo">Togo</option>
516
+ <option value="Tokelau">Tokelau</option>
517
+ <option value="Tonga">Tonga</option>
518
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
519
+ <option value="Tunisia">Tunisia</option>
520
+ <option value="Turkey">Turkey</option>
521
+ <option value="Turkmenistan">Turkmenistan</option>
522
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
523
+ <option value="Tuvalu">Tuvalu</option>
524
+ <option value="Uganda">Uganda</option>
525
+ <option value="Ukraine">Ukraine</option>
526
+ <option value="United Arab Emirates">United Arab Emirates</option>
527
+ <option value="United Kingdom">United Kingdom</option>
528
+ <option value="United States">United States</option>
529
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
530
+ <option value="Uruguay">Uruguay</option>
531
+ <option value="Uzbekistan">Uzbekistan</option>
532
+ <option value="Vanuatu">Vanuatu</option>
533
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
534
+ <option value="Viet Nam">Viet Nam</option>
535
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
536
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
537
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
538
+ <option value="Western Sahara">Western Sahara</option>
539
+ <option value="Yemen">Yemen</option>
540
+ <option value="Zambia">Zambia</option>
541
+ <option value="Zimbabwe">Zimbabwe</option>
542
+ </select>
543
+ </div>
544
+ </div>
545
+
546
+ <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
547
+ <div class="side-by-side clearfix">
548
+ <div>
549
+ <em>Turns This</em>
550
+ <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
551
+ <option value=""></option>
552
+ <option value="United States">United States</option>
553
+ <option value="United Kingdom">United Kingdom</option>
554
+ <option value="Afghanistan">Afghanistan</option>
555
+ <option value="Aland Islands">Aland Islands</option>
556
+ <option value="Albania">Albania</option>
557
+ <option value="Algeria">Algeria</option>
558
+ <option value="American Samoa">American Samoa</option>
559
+ <option value="Andorra">Andorra</option>
560
+ <option value="Angola">Angola</option>
561
+ <option value="Anguilla">Anguilla</option>
562
+ <option value="Antarctica">Antarctica</option>
563
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
564
+ <option value="Argentina">Argentina</option>
565
+ <option value="Armenia">Armenia</option>
566
+ <option value="Aruba">Aruba</option>
567
+ <option value="Australia">Australia</option>
568
+ <option value="Austria">Austria</option>
569
+ <option value="Azerbaijan">Azerbaijan</option>
570
+ <option value="Bahamas">Bahamas</option>
571
+ <option value="Bahrain">Bahrain</option>
572
+ <option value="Bangladesh">Bangladesh</option>
573
+ <option value="Barbados">Barbados</option>
574
+ <option value="Belarus">Belarus</option>
575
+ <option value="Belgium">Belgium</option>
576
+ <option value="Belize">Belize</option>
577
+ <option value="Benin">Benin</option>
578
+ <option value="Bermuda">Bermuda</option>
579
+ <option value="Bhutan">Bhutan</option>
580
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
581
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
582
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
583
+ <option value="Botswana">Botswana</option>
584
+ <option value="Bouvet Island">Bouvet Island</option>
585
+ <option value="Brazil">Brazil</option>
586
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
587
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
588
+ <option value="Bulgaria">Bulgaria</option>
589
+ <option value="Burkina Faso">Burkina Faso</option>
590
+ <option value="Burundi">Burundi</option>
591
+ <option value="Cambodia">Cambodia</option>
592
+ <option value="Cameroon">Cameroon</option>
593
+ <option value="Canada">Canada</option>
594
+ <option value="Cape Verde">Cape Verde</option>
595
+ <option value="Cayman Islands">Cayman Islands</option>
596
+ <option value="Central African Republic">Central African Republic</option>
597
+ <option value="Chad">Chad</option>
598
+ <option value="Chile">Chile</option>
599
+ <option value="China">China</option>
600
+ <option value="Christmas Island">Christmas Island</option>
601
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
602
+ <option value="Colombia">Colombia</option>
603
+ <option value="Comoros">Comoros</option>
604
+ <option value="Congo">Congo</option>
605
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
606
+ <option value="Cook Islands">Cook Islands</option>
607
+ <option value="Costa Rica">Costa Rica</option>
608
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
609
+ <option value="Croatia">Croatia</option>
610
+ <option value="Cuba">Cuba</option>
611
+ <option value="Curacao">Curacao</option>
612
+ <option value="Cyprus">Cyprus</option>
613
+ <option value="Czech Republic">Czech Republic</option>
614
+ <option value="Denmark">Denmark</option>
615
+ <option value="Djibouti">Djibouti</option>
616
+ <option value="Dominica">Dominica</option>
617
+ <option value="Dominican Republic">Dominican Republic</option>
618
+ <option value="Ecuador">Ecuador</option>
619
+ <option value="Egypt">Egypt</option>
620
+ <option value="El Salvador">El Salvador</option>
621
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
622
+ <option value="Eritrea">Eritrea</option>
623
+ <option value="Estonia">Estonia</option>
624
+ <option value="Ethiopia">Ethiopia</option>
625
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
626
+ <option value="Faroe Islands">Faroe Islands</option>
627
+ <option value="Fiji">Fiji</option>
628
+ <option value="Finland">Finland</option>
629
+ <option value="France">France</option>
630
+ <option value="French Guiana">French Guiana</option>
631
+ <option value="French Polynesia">French Polynesia</option>
632
+ <option value="French Southern Territories">French Southern Territories</option>
633
+ <option value="Gabon">Gabon</option>
634
+ <option value="Gambia">Gambia</option>
635
+ <option value="Georgia">Georgia</option>
636
+ <option value="Germany">Germany</option>
637
+ <option value="Ghana">Ghana</option>
638
+ <option value="Gibraltar">Gibraltar</option>
639
+ <option value="Greece">Greece</option>
640
+ <option value="Greenland">Greenland</option>
641
+ <option value="Grenada">Grenada</option>
642
+ <option value="Guadeloupe">Guadeloupe</option>
643
+ <option value="Guam">Guam</option>
644
+ <option value="Guatemala">Guatemala</option>
645
+ <option value="Guernsey">Guernsey</option>
646
+ <option value="Guinea">Guinea</option>
647
+ <option value="Guinea-bissau">Guinea-bissau</option>
648
+ <option value="Guyana">Guyana</option>
649
+ <option value="Haiti">Haiti</option>
650
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
651
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
652
+ <option value="Honduras">Honduras</option>
653
+ <option value="Hong Kong">Hong Kong</option>
654
+ <option value="Hungary">Hungary</option>
655
+ <option value="Iceland">Iceland</option>
656
+ <option value="India">India</option>
657
+ <option value="Indonesia">Indonesia</option>
658
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
659
+ <option value="Iraq">Iraq</option>
660
+ <option value="Ireland">Ireland</option>
661
+ <option value="Isle of Man">Isle of Man</option>
662
+ <option value="Israel">Israel</option>
663
+ <option value="Italy">Italy</option>
664
+ <option value="Jamaica">Jamaica</option>
665
+ <option value="Japan">Japan</option>
666
+ <option value="Jersey">Jersey</option>
667
+ <option value="Jordan">Jordan</option>
668
+ <option value="Kazakhstan">Kazakhstan</option>
669
+ <option value="Kenya">Kenya</option>
670
+ <option value="Kiribati">Kiribati</option>
671
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
672
+ <option value="Korea, Republic of">Korea, Republic of</option>
673
+ <option value="Kuwait">Kuwait</option>
674
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
675
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
676
+ <option value="Latvia">Latvia</option>
677
+ <option value="Lebanon">Lebanon</option>
678
+ <option value="Lesotho">Lesotho</option>
679
+ <option value="Liberia">Liberia</option>
680
+ <option value="Libya">Libya</option>
681
+ <option value="Liechtenstein">Liechtenstein</option>
682
+ <option value="Lithuania">Lithuania</option>
683
+ <option value="Luxembourg">Luxembourg</option>
684
+ <option value="Macao">Macao</option>
685
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
686
+ <option value="Madagascar">Madagascar</option>
687
+ <option value="Malawi">Malawi</option>
688
+ <option value="Malaysia">Malaysia</option>
689
+ <option value="Maldives">Maldives</option>
690
+ <option value="Mali">Mali</option>
691
+ <option value="Malta">Malta</option>
692
+ <option value="Marshall Islands">Marshall Islands</option>
693
+ <option value="Martinique">Martinique</option>
694
+ <option value="Mauritania">Mauritania</option>
695
+ <option value="Mauritius">Mauritius</option>
696
+ <option value="Mayotte">Mayotte</option>
697
+ <option value="Mexico">Mexico</option>
698
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
699
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
700
+ <option value="Monaco">Monaco</option>
701
+ <option value="Mongolia">Mongolia</option>
702
+ <option value="Montenegro">Montenegro</option>
703
+ <option value="Montserrat">Montserrat</option>
704
+ <option value="Morocco">Morocco</option>
705
+ <option value="Mozambique">Mozambique</option>
706
+ <option value="Myanmar">Myanmar</option>
707
+ <option value="Namibia">Namibia</option>
708
+ <option value="Nauru">Nauru</option>
709
+ <option value="Nepal">Nepal</option>
710
+ <option value="Netherlands">Netherlands</option>
711
+ <option value="New Caledonia">New Caledonia</option>
712
+ <option value="New Zealand">New Zealand</option>
713
+ <option value="Nicaragua">Nicaragua</option>
714
+ <option value="Niger">Niger</option>
715
+ <option value="Nigeria">Nigeria</option>
716
+ <option value="Niue">Niue</option>
717
+ <option value="Norfolk Island">Norfolk Island</option>
718
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
719
+ <option value="Norway">Norway</option>
720
+ <option value="Oman">Oman</option>
721
+ <option value="Pakistan">Pakistan</option>
722
+ <option value="Palau">Palau</option>
723
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
724
+ <option value="Panama">Panama</option>
725
+ <option value="Papua New Guinea">Papua New Guinea</option>
726
+ <option value="Paraguay">Paraguay</option>
727
+ <option value="Peru">Peru</option>
728
+ <option value="Philippines">Philippines</option>
729
+ <option value="Pitcairn">Pitcairn</option>
730
+ <option value="Poland">Poland</option>
731
+ <option value="Portugal">Portugal</option>
732
+ <option value="Puerto Rico">Puerto Rico</option>
733
+ <option value="Qatar">Qatar</option>
734
+ <option value="Reunion">Reunion</option>
735
+ <option value="Romania">Romania</option>
736
+ <option value="Russian Federation">Russian Federation</option>
737
+ <option value="Rwanda">Rwanda</option>
738
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
739
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
740
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
741
+ <option value="Saint Lucia">Saint Lucia</option>
742
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
743
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
744
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
745
+ <option value="Samoa">Samoa</option>
746
+ <option value="San Marino">San Marino</option>
747
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
748
+ <option value="Saudi Arabia">Saudi Arabia</option>
749
+ <option value="Senegal">Senegal</option>
750
+ <option value="Serbia">Serbia</option>
751
+ <option value="Seychelles">Seychelles</option>
752
+ <option value="Sierra Leone">Sierra Leone</option>
753
+ <option value="Singapore">Singapore</option>
754
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
755
+ <option value="Slovakia">Slovakia</option>
756
+ <option value="Slovenia">Slovenia</option>
757
+ <option value="Solomon Islands">Solomon Islands</option>
758
+ <option value="Somalia">Somalia</option>
759
+ <option value="South Africa">South Africa</option>
760
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
761
+ <option value="South Sudan">South Sudan</option>
762
+ <option value="Spain">Spain</option>
763
+ <option value="Sri Lanka">Sri Lanka</option>
764
+ <option value="Sudan">Sudan</option>
765
+ <option value="Suriname">Suriname</option>
766
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
767
+ <option value="Swaziland">Swaziland</option>
768
+ <option value="Sweden">Sweden</option>
769
+ <option value="Switzerland">Switzerland</option>
770
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
771
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
772
+ <option value="Tajikistan">Tajikistan</option>
773
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
774
+ <option value="Thailand">Thailand</option>
775
+ <option value="Timor-leste">Timor-leste</option>
776
+ <option value="Togo">Togo</option>
777
+ <option value="Tokelau">Tokelau</option>
778
+ <option value="Tonga">Tonga</option>
779
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
780
+ <option value="Tunisia">Tunisia</option>
781
+ <option value="Turkey">Turkey</option>
782
+ <option value="Turkmenistan">Turkmenistan</option>
783
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
784
+ <option value="Tuvalu">Tuvalu</option>
785
+ <option value="Uganda">Uganda</option>
786
+ <option value="Ukraine">Ukraine</option>
787
+ <option value="United Arab Emirates">United Arab Emirates</option>
788
+ <option value="United Kingdom">United Kingdom</option>
789
+ <option value="United States">United States</option>
790
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
791
+ <option value="Uruguay">Uruguay</option>
792
+ <option value="Uzbekistan">Uzbekistan</option>
793
+ <option value="Vanuatu">Vanuatu</option>
794
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
795
+ <option value="Viet Nam">Viet Nam</option>
796
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
797
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
798
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
799
+ <option value="Western Sahara">Western Sahara</option>
800
+ <option value="Yemen">Yemen</option>
801
+ <option value="Zambia">Zambia</option>
802
+ <option value="Zimbabwe">Zimbabwe</option>
803
+ </select>
804
+ </div>
805
+ <div>
806
+ <em>Into This</em>
807
+ <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
808
+ <option value=""></option>
809
+ <option value="United States">United States</option>
810
+ <option value="United Kingdom">United Kingdom</option>
811
+ <option value="Afghanistan">Afghanistan</option>
812
+ <option value="Aland Islands">Aland Islands</option>
813
+ <option value="Albania">Albania</option>
814
+ <option value="Algeria">Algeria</option>
815
+ <option value="American Samoa">American Samoa</option>
816
+ <option value="Andorra">Andorra</option>
817
+ <option value="Angola">Angola</option>
818
+ <option value="Anguilla">Anguilla</option>
819
+ <option value="Antarctica">Antarctica</option>
820
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
821
+ <option value="Argentina">Argentina</option>
822
+ <option value="Armenia">Armenia</option>
823
+ <option value="Aruba">Aruba</option>
824
+ <option value="Australia">Australia</option>
825
+ <option value="Austria">Austria</option>
826
+ <option value="Azerbaijan">Azerbaijan</option>
827
+ <option value="Bahamas">Bahamas</option>
828
+ <option value="Bahrain">Bahrain</option>
829
+ <option value="Bangladesh">Bangladesh</option>
830
+ <option value="Barbados">Barbados</option>
831
+ <option value="Belarus">Belarus</option>
832
+ <option value="Belgium">Belgium</option>
833
+ <option value="Belize">Belize</option>
834
+ <option value="Benin">Benin</option>
835
+ <option value="Bermuda">Bermuda</option>
836
+ <option value="Bhutan">Bhutan</option>
837
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
838
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
839
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
840
+ <option value="Botswana">Botswana</option>
841
+ <option value="Bouvet Island">Bouvet Island</option>
842
+ <option value="Brazil">Brazil</option>
843
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
844
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
845
+ <option value="Bulgaria">Bulgaria</option>
846
+ <option value="Burkina Faso">Burkina Faso</option>
847
+ <option value="Burundi">Burundi</option>
848
+ <option value="Cambodia">Cambodia</option>
849
+ <option value="Cameroon">Cameroon</option>
850
+ <option value="Canada">Canada</option>
851
+ <option value="Cape Verde">Cape Verde</option>
852
+ <option value="Cayman Islands">Cayman Islands</option>
853
+ <option value="Central African Republic">Central African Republic</option>
854
+ <option value="Chad">Chad</option>
855
+ <option value="Chile">Chile</option>
856
+ <option value="China">China</option>
857
+ <option value="Christmas Island">Christmas Island</option>
858
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
859
+ <option value="Colombia">Colombia</option>
860
+ <option value="Comoros">Comoros</option>
861
+ <option value="Congo">Congo</option>
862
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
863
+ <option value="Cook Islands">Cook Islands</option>
864
+ <option value="Costa Rica">Costa Rica</option>
865
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
866
+ <option value="Croatia">Croatia</option>
867
+ <option value="Cuba">Cuba</option>
868
+ <option value="Curacao">Curacao</option>
869
+ <option value="Cyprus">Cyprus</option>
870
+ <option value="Czech Republic">Czech Republic</option>
871
+ <option value="Denmark">Denmark</option>
872
+ <option value="Djibouti">Djibouti</option>
873
+ <option value="Dominica">Dominica</option>
874
+ <option value="Dominican Republic">Dominican Republic</option>
875
+ <option value="Ecuador">Ecuador</option>
876
+ <option value="Egypt">Egypt</option>
877
+ <option value="El Salvador">El Salvador</option>
878
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
879
+ <option value="Eritrea">Eritrea</option>
880
+ <option value="Estonia">Estonia</option>
881
+ <option value="Ethiopia">Ethiopia</option>
882
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
883
+ <option value="Faroe Islands">Faroe Islands</option>
884
+ <option value="Fiji">Fiji</option>
885
+ <option value="Finland">Finland</option>
886
+ <option value="France">France</option>
887
+ <option value="French Guiana">French Guiana</option>
888
+ <option value="French Polynesia">French Polynesia</option>
889
+ <option value="French Southern Territories">French Southern Territories</option>
890
+ <option value="Gabon">Gabon</option>
891
+ <option value="Gambia">Gambia</option>
892
+ <option value="Georgia">Georgia</option>
893
+ <option value="Germany">Germany</option>
894
+ <option value="Ghana">Ghana</option>
895
+ <option value="Gibraltar">Gibraltar</option>
896
+ <option value="Greece">Greece</option>
897
+ <option value="Greenland">Greenland</option>
898
+ <option value="Grenada">Grenada</option>
899
+ <option value="Guadeloupe">Guadeloupe</option>
900
+ <option value="Guam">Guam</option>
901
+ <option value="Guatemala">Guatemala</option>
902
+ <option value="Guernsey">Guernsey</option>
903
+ <option value="Guinea">Guinea</option>
904
+ <option value="Guinea-bissau">Guinea-bissau</option>
905
+ <option value="Guyana">Guyana</option>
906
+ <option value="Haiti">Haiti</option>
907
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
908
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
909
+ <option value="Honduras">Honduras</option>
910
+ <option value="Hong Kong">Hong Kong</option>
911
+ <option value="Hungary">Hungary</option>
912
+ <option value="Iceland">Iceland</option>
913
+ <option value="India">India</option>
914
+ <option value="Indonesia">Indonesia</option>
915
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
916
+ <option value="Iraq">Iraq</option>
917
+ <option value="Ireland">Ireland</option>
918
+ <option value="Isle of Man">Isle of Man</option>
919
+ <option value="Israel">Israel</option>
920
+ <option value="Italy">Italy</option>
921
+ <option value="Jamaica">Jamaica</option>
922
+ <option value="Japan">Japan</option>
923
+ <option value="Jersey">Jersey</option>
924
+ <option value="Jordan">Jordan</option>
925
+ <option value="Kazakhstan">Kazakhstan</option>
926
+ <option value="Kenya">Kenya</option>
927
+ <option value="Kiribati">Kiribati</option>
928
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
929
+ <option value="Korea, Republic of">Korea, Republic of</option>
930
+ <option value="Kuwait">Kuwait</option>
931
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
932
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
933
+ <option value="Latvia">Latvia</option>
934
+ <option value="Lebanon">Lebanon</option>
935
+ <option value="Lesotho">Lesotho</option>
936
+ <option value="Liberia">Liberia</option>
937
+ <option value="Libya">Libya</option>
938
+ <option value="Liechtenstein">Liechtenstein</option>
939
+ <option value="Lithuania">Lithuania</option>
940
+ <option value="Luxembourg">Luxembourg</option>
941
+ <option value="Macao">Macao</option>
942
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
943
+ <option value="Madagascar">Madagascar</option>
944
+ <option value="Malawi">Malawi</option>
945
+ <option value="Malaysia">Malaysia</option>
946
+ <option value="Maldives">Maldives</option>
947
+ <option value="Mali">Mali</option>
948
+ <option value="Malta">Malta</option>
949
+ <option value="Marshall Islands">Marshall Islands</option>
950
+ <option value="Martinique">Martinique</option>
951
+ <option value="Mauritania">Mauritania</option>
952
+ <option value="Mauritius">Mauritius</option>
953
+ <option value="Mayotte">Mayotte</option>
954
+ <option value="Mexico">Mexico</option>
955
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
956
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
957
+ <option value="Monaco">Monaco</option>
958
+ <option value="Mongolia">Mongolia</option>
959
+ <option value="Montenegro">Montenegro</option>
960
+ <option value="Montserrat">Montserrat</option>
961
+ <option value="Morocco">Morocco</option>
962
+ <option value="Mozambique">Mozambique</option>
963
+ <option value="Myanmar">Myanmar</option>
964
+ <option value="Namibia">Namibia</option>
965
+ <option value="Nauru">Nauru</option>
966
+ <option value="Nepal">Nepal</option>
967
+ <option value="Netherlands">Netherlands</option>
968
+ <option value="New Caledonia">New Caledonia</option>
969
+ <option value="New Zealand">New Zealand</option>
970
+ <option value="Nicaragua">Nicaragua</option>
971
+ <option value="Niger">Niger</option>
972
+ <option value="Nigeria">Nigeria</option>
973
+ <option value="Niue">Niue</option>
974
+ <option value="Norfolk Island">Norfolk Island</option>
975
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
976
+ <option value="Norway">Norway</option>
977
+ <option value="Oman">Oman</option>
978
+ <option value="Pakistan">Pakistan</option>
979
+ <option value="Palau">Palau</option>
980
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
981
+ <option value="Panama">Panama</option>
982
+ <option value="Papua New Guinea">Papua New Guinea</option>
983
+ <option value="Paraguay">Paraguay</option>
984
+ <option value="Peru">Peru</option>
985
+ <option value="Philippines">Philippines</option>
986
+ <option value="Pitcairn">Pitcairn</option>
987
+ <option value="Poland">Poland</option>
988
+ <option value="Portugal">Portugal</option>
989
+ <option value="Puerto Rico">Puerto Rico</option>
990
+ <option value="Qatar">Qatar</option>
991
+ <option value="Reunion">Reunion</option>
992
+ <option value="Romania">Romania</option>
993
+ <option value="Russian Federation">Russian Federation</option>
994
+ <option value="Rwanda">Rwanda</option>
995
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
996
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
997
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
998
+ <option value="Saint Lucia">Saint Lucia</option>
999
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1000
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1001
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1002
+ <option value="Samoa">Samoa</option>
1003
+ <option value="San Marino">San Marino</option>
1004
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1005
+ <option value="Saudi Arabia">Saudi Arabia</option>
1006
+ <option value="Senegal">Senegal</option>
1007
+ <option value="Serbia">Serbia</option>
1008
+ <option value="Seychelles">Seychelles</option>
1009
+ <option value="Sierra Leone">Sierra Leone</option>
1010
+ <option value="Singapore">Singapore</option>
1011
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1012
+ <option value="Slovakia">Slovakia</option>
1013
+ <option value="Slovenia">Slovenia</option>
1014
+ <option value="Solomon Islands">Solomon Islands</option>
1015
+ <option value="Somalia">Somalia</option>
1016
+ <option value="South Africa">South Africa</option>
1017
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1018
+ <option value="South Sudan">South Sudan</option>
1019
+ <option value="Spain">Spain</option>
1020
+ <option value="Sri Lanka">Sri Lanka</option>
1021
+ <option value="Sudan">Sudan</option>
1022
+ <option value="Suriname">Suriname</option>
1023
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1024
+ <option value="Swaziland">Swaziland</option>
1025
+ <option value="Sweden">Sweden</option>
1026
+ <option value="Switzerland">Switzerland</option>
1027
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1028
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1029
+ <option value="Tajikistan">Tajikistan</option>
1030
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1031
+ <option value="Thailand">Thailand</option>
1032
+ <option value="Timor-leste">Timor-leste</option>
1033
+ <option value="Togo">Togo</option>
1034
+ <option value="Tokelau">Tokelau</option>
1035
+ <option value="Tonga">Tonga</option>
1036
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1037
+ <option value="Tunisia">Tunisia</option>
1038
+ <option value="Turkey">Turkey</option>
1039
+ <option value="Turkmenistan">Turkmenistan</option>
1040
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1041
+ <option value="Tuvalu">Tuvalu</option>
1042
+ <option value="Uganda">Uganda</option>
1043
+ <option value="Ukraine">Ukraine</option>
1044
+ <option value="United Arab Emirates">United Arab Emirates</option>
1045
+ <option value="United Kingdom">United Kingdom</option>
1046
+ <option value="United States">United States</option>
1047
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1048
+ <option value="Uruguay">Uruguay</option>
1049
+ <option value="Uzbekistan">Uzbekistan</option>
1050
+ <option value="Vanuatu">Vanuatu</option>
1051
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1052
+ <option value="Viet Nam">Viet Nam</option>
1053
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
1054
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1055
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
1056
+ <option value="Western Sahara">Western Sahara</option>
1057
+ <option value="Yemen">Yemen</option>
1058
+ <option value="Zambia">Zambia</option>
1059
+ <option value="Zimbabwe">Zimbabwe</option>
1060
+ </select>
1061
+ </div>
1062
+ </div>
1063
+
1064
+ <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1065
+ <div class="side-by-side clearfix">
1066
+ <div>
1067
+ <em>Single Select with Groups</em>
1068
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1069
+ <option value=""></option>
1070
+ <optgroup label="NFC EAST">
1071
+ <option>Dallas Cowboys</option>
1072
+ <option>New York Giants</option>
1073
+ <option>Philadelphia Eagles</option>
1074
+ <option>Washington Redskins</option>
1075
+ </optgroup>
1076
+ <optgroup label="NFC NORTH">
1077
+ <option>Chicago Bears</option>
1078
+ <option>Detroit Lions</option>
1079
+ <option>Green Bay Packers</option>
1080
+ <option>Minnesota Vikings</option>
1081
+ </optgroup>
1082
+ <optgroup label="NFC SOUTH">
1083
+ <option>Atlanta Falcons</option>
1084
+ <option>Carolina Panthers</option>
1085
+ <option>New Orleans Saints</option>
1086
+ <option>Tampa Bay Buccaneers</option>
1087
+ </optgroup>
1088
+ <optgroup label="NFC WEST">
1089
+ <option>Arizona Cardinals</option>
1090
+ <option>St. Louis Rams</option>
1091
+ <option>San Francisco 49ers</option>
1092
+ <option>Seattle Seahawks</option>
1093
+ </optgroup>
1094
+ <optgroup label="AFC EAST">
1095
+ <option>Buffalo Bills</option>
1096
+ <option>Miami Dolphins</option>
1097
+ <option>New England Patriots</option>
1098
+ <option>New York Jets</option>
1099
+ </optgroup>
1100
+ <optgroup label="AFC NORTH">
1101
+ <option>Baltimore Ravens</option>
1102
+ <option>Cincinnati Bengals</option>
1103
+ <option>Cleveland Browns</option>
1104
+ <option>Pittsburgh Steelers</option>
1105
+ </optgroup>
1106
+ <optgroup label="AFC SOUTH">
1107
+ <option>Houston Texans</option>
1108
+ <option>Indianapolis Colts</option>
1109
+ <option>Jacksonville Jaguars</option>
1110
+ <option>Tennessee Titans</option>
1111
+ </optgroup>
1112
+ <optgroup label="AFC WEST">
1113
+ <option>Denver Broncos</option>
1114
+ <option>Kansas City Chiefs</option>
1115
+ <option>Oakland Raiders</option>
1116
+ <option>San Diego Chargers</option>
1117
+ </optgroup>
1118
+ </select>
1119
+ </div>
1120
+ <div>
1121
+ <em>Multiple Select with Groups</em>
1122
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1123
+ <option value=""></option>
1124
+ <optgroup label="NFC EAST">
1125
+ <option>Dallas Cowboys</option>
1126
+ <option>New York Giants</option>
1127
+ <option>Philadelphia Eagles</option>
1128
+ <option>Washington Redskins</option>
1129
+ </optgroup>
1130
+ <optgroup label="NFC NORTH">
1131
+ <option>Chicago Bears</option>
1132
+ <option>Detroit Lions</option>
1133
+ <option>Green Bay Packers</option>
1134
+ <option>Minnesota Vikings</option>
1135
+ </optgroup>
1136
+ <optgroup label="NFC SOUTH">
1137
+ <option>Atlanta Falcons</option>
1138
+ <option>Carolina Panthers</option>
1139
+ <option>New Orleans Saints</option>
1140
+ <option>Tampa Bay Buccaneers</option>
1141
+ </optgroup>
1142
+ <optgroup label="NFC WEST">
1143
+ <option>Arizona Cardinals</option>
1144
+ <option>St. Louis Rams</option>
1145
+ <option>San Francisco 49ers</option>
1146
+ <option>Seattle Seahawks</option>
1147
+ </optgroup>
1148
+ <optgroup label="AFC EAST">
1149
+ <option>Buffalo Bills</option>
1150
+ <option>Miami Dolphins</option>
1151
+ <option>New England Patriots</option>
1152
+ <option>New York Jets</option>
1153
+ </optgroup>
1154
+ <optgroup label="AFC NORTH">
1155
+ <option>Baltimore Ravens</option>
1156
+ <option>Cincinnati Bengals</option>
1157
+ <option>Cleveland Browns</option>
1158
+ <option>Pittsburgh Steelers</option>
1159
+ </optgroup>
1160
+ <optgroup label="AFC SOUTH">
1161
+ <option>Houston Texans</option>
1162
+ <option>Indianapolis Colts</option>
1163
+ <option>Jacksonville Jaguars</option>
1164
+ <option>Tennessee Titans</option>
1165
+ </optgroup>
1166
+ <optgroup label="AFC WEST">
1167
+ <option>Denver Broncos</option>
1168
+ <option>Kansas City Chiefs</option>
1169
+ <option>Oakland Raiders</option>
1170
+ <option>San Diego Chargers</option>
1171
+ </optgroup>
1172
+ </select>
1173
+ </div>
1174
+ </div>
1175
+
1176
+ <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1177
+ <div class="side-by-side clearfix">
1178
+ <p>Chosen automatically highlights selected options and removes disabled options.</p>
1179
+ <div>
1180
+ <em>Single Select</em>
1181
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1182
+ <option value=""></option>
1183
+ <option>American Black Bear</option>
1184
+ <option>Asiatic Black Bear</option>
1185
+ <option>Brown Bear</option>
1186
+ <option>Giant Panda</option>
1187
+ <option selected>Sloth Bear</option>
1188
+ <option disabled>Sun Bear</option>
1189
+ <option>Polar Bear</option>
1190
+ <option disabled>Spectacled Bear</option>
1191
+ </select>
1192
+ </div>
1193
+ <div>
1194
+ <em>Multiple Select</em>
1195
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1196
+ <option value=""></option>
1197
+ <option>American Black Bear</option>
1198
+ <option>Asiatic Black Bear</option>
1199
+ <option>Brown Bear</option>
1200
+ <option>Giant Panda</option>
1201
+ <option selected>Sloth Bear</option>
1202
+ <option disabled>Sun Bear</option>
1203
+ <option selected>Polar Bear</option>
1204
+ <option disabled>Spectacled Bear</option>
1205
+ </select>
1206
+ </div>
1207
+ </div>
1208
+
1209
+ <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1210
+ <div class="side-by-side clearfix">
1211
+ <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1212
+ <pre><code class="language-javascript">$(".chosen-select").chosen({disable_search_threshold: 10});</code></pre>
1213
+ <p></p>
1214
+ <div>
1215
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1216
+ <option value=""></option>
1217
+ <option>American Black Bear</option>
1218
+ <option>Asiatic Black Bear</option>
1219
+ <option>Brown Bear</option>
1220
+ <option>Giant Panda</option>
1221
+ <option selected disabled>Sloth Bear</option>
1222
+ <option disabled>Sun Bear</option>
1223
+ <option selected disabled>Paddington Bear</option>
1224
+ <option selected>Polar Bear</option>
1225
+ <option disabled>Spectacled Bear</option>
1226
+ </select>
1227
+ </div>
1228
+ </div>
1229
+
1230
+ <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1231
+ <div class="side-by-side clearfix">
1232
+ <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1233
+ <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1234
+ <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1235
+ </div>
1236
+
1237
+ <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1238
+ <div class="side-by-side clearfix">
1239
+ <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1240
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({no_results_text: "Oops, nothing found!"}); </code></pre>
1241
+ <p></p>
1242
+ <div>
1243
+ <em>Single Select</em>
1244
+ <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1245
+ <option value=""></option>
1246
+ <option>American Black Bear</option>
1247
+ <option>Asiatic Black Bear</option>
1248
+ <option>Brown Bear</option>
1249
+ <option>Giant Panda</option>
1250
+ <option>Sloth Bear</option>
1251
+ <option>Sun Bear</option>
1252
+ <option>Polar Bear</option>
1253
+ <option>Spectacled Bear</option>
1254
+ </select>
1255
+ </div>
1256
+ <div>
1257
+ <em>Multiple Select</em>
1258
+ <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1259
+ <option value=""></option>
1260
+ <option>American Black Bear</option>
1261
+ <option>Asiatic Black Bear</option>
1262
+ <option>Brown Bear</option>
1263
+ <option>Giant Panda</option>
1264
+ <option>Sloth Bear</option>
1265
+ <option>Sun Bear</option>
1266
+ <option>Polar Bear</option>
1267
+ <option>Spectacled Bear</option>
1268
+ </select>
1269
+ </div>
1270
+ </div>
1271
+
1272
+ <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1273
+ <div class="side-by-side clearfix">
1274
+ <p>You can easily limit how many options the user can select:</p>
1275
+ <pre><code class="language-javascript">$(".chosen-select").chosen({max_selected_options: 5});</code></pre>
1276
+ <p>If you try to select another option with limit reached <code class="language-javascript">chosen:maxselected</code> event is triggered:</p>
1277
+ <pre><code class="language-javascript"> $(".chosen-select").bind("chosen:maxselected", function () { ... }); </code></pre>
1278
+ </div>
1279
+
1280
+ <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1281
+ <div class="side-by-side clearfix">
1282
+ <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1283
+ <div class="side-by-side clearfix">
1284
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1285
+ <option value=""></option>
1286
+ <option>American Black Bear</option>
1287
+ <option>Asiatic Black Bear</option>
1288
+ <option>Brown Bear</option>
1289
+ <option>Giant Panda</option>
1290
+ <option selected>Sloth Bear</option>
1291
+ <option>Sun Bear</option>
1292
+ <option>Polar Bear</option>
1293
+ <option>Spectacled Bear</option>
1294
+ </select>
1295
+ </div>
1296
+ </div>
1297
+
1298
+ <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1299
+ <div class="side-by-side clearfix">
1300
+ <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1301
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1302
+
1303
+ <div>
1304
+ <em>Single Right-to-Left Select</em>
1305
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
+ <option value=""></option>
1307
+ <option>American Black Bear</option>
1308
+ <option>Asiatic Black Bear</option>
1309
+ <option>Brown Bear</option>
1310
+ <option>Giant Panda</option>
1311
+ <option selected>Sloth Bear</option>
1312
+ <option>Polar Bear</option>
1313
+ </select>
1314
+ </div>
1315
+ <div>
1316
+ <em>Multiple Right-to-Left Select</em>
1317
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
+ <option value=""></option>
1319
+ <option>American Black Bear</option>
1320
+ <option>Asiatic Black Bear</option>
1321
+ <option>Brown Bear</option>
1322
+ <option>Giant Panda</option>
1323
+ <option selected>Sloth Bear</option>
1324
+ <option selected>Polar Bear</option>
1325
+ </select>
1326
+ </div>
1327
+ </div>
1328
+
1329
+ <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
+ <div class="side-by-side clearfix">
1331
+ <ul>
1332
+ <li>
1333
+ <h3>Observing Form Field Changes</h3>
1334
+ <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
+ <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
+ </li>
1337
+ <li>
1338
+ <h3>Updating Chosen Dynamically</h3>
1339
+ <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1340
+ <pre><code class="language-javascript">$("#form_field").trigger("chosen:updated");</code></pre>
1341
+ </li>
1342
+ <li>
1343
+ <h3>Destroying Chosen</h3>
1344
+ <p>To destroy Chosen and revert back to the native select:</p>
1345
+ <pre><code class="language-javascript">$("#form_field").chosen("destroy");</code></pre>
1346
+ </li>
1347
+ </ul>
1348
+ </div>
1349
+
1350
+ <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1351
+ <div class="side-by-side clearfix">
1352
+ <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1353
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({width: "95%"}); </code></pre>
1354
+ <div>
1355
+ <em>Single Select</em>
1356
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1357
+ <option value=""></option>
1358
+ <option selected>American Black Bear</option>
1359
+ <option>Asiatic Black Bear</option>
1360
+ <option>Brown Bear</option>
1361
+ <option>Giant Panda</option>
1362
+ <option>Sloth Bear</option>
1363
+ <option>Sun Bear</option>
1364
+ <option>Polar Bear</option>
1365
+ <option>Spectacled Bear</option>
1366
+ </select>
1367
+ </div>
1368
+ <div>
1369
+ <em>Multiple Select</em>
1370
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1371
+ <option value=""></option>
1372
+ <option>American Black Bear</option>
1373
+ <option>Asiatic Black Bear</option>
1374
+ <option>Brown Bear</option>
1375
+ <option selected>Giant Panda</option>
1376
+ <option>Sloth Bear</option>
1377
+ <option>Sun Bear</option>
1378
+ <option>Polar Bear</option>
1379
+ <option>Spectacled Bear</option>
1380
+ </select>
1381
+ </div>
1382
+ </div>
1383
+
1384
+ <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1385
+ <div class="side-by-side clearfix">
1386
+ <p>Use labels just like you would a standard select</p>
1387
+ <p></p>
1388
+ <div>
1389
+ <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1390
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1391
+ <option value=""></option>
1392
+ <option selected>American Black Bear</option>
1393
+ <option>Asiatic Black Bear</option>
1394
+ <option>Brown Bear</option>
1395
+ <option>Giant Panda</option>
1396
+ <option>Sloth Bear</option>
1397
+ <option>Sun Bear</option>
1398
+ <option>Polar Bear</option>
1399
+ <option>Spectacled Bear</option>
1400
+ </select>
1401
+ </div>
1402
+ <div>
1403
+ <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1404
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1405
+ <option value=""></option>
1406
+ <option>American Black Bear</option>
1407
+ <option>Asiatic Black Bear</option>
1408
+ <option>Brown Bear</option>
1409
+ <option selected>Giant Panda</option>
1410
+ <option>Sloth Bear</option>
1411
+ <option>Sun Bear</option>
1412
+ <option>Polar Bear</option>
1413
+ <option>Spectacled Bear</option>
1414
+ </select>
1415
+ </div>
1416
+ </div>
1417
+
1418
+ <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1419
+ <p>Using Chosen is easy as can be.</p>
1420
+ <ol>
1421
+ <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1422
+ <li>Activate the plugin on the select boxes of your choice: <code class="language-javascript">$(".chosen-select").chosen()</code></li>
1423
+ <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1424
+ </ol>
1425
+
1426
+ <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1427
+ <ul class="faqs">
1428
+ <li>
1429
+ <h3>Do you have all the available options documented somewhere?</h3>
1430
+ <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1431
+ </li>
1432
+ <li>
1433
+ <h3>Something doesn't work. Can you fix it?</h3>
1434
+ <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1435
+ </li>
1436
+ <li>
1437
+ <h3>What browsers are supported?</h3>
1438
+ <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1439
+ </li>
1440
+ <li>
1441
+ <h3>Didn't there used to be a Prototype version of Chosen?</h3>
1442
+ <p><a href="index.proto.html">There still is!</a></p>
1443
+ </li>
1444
+ </ul>
1445
+
1446
+ <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
+
1448
+ <ul class="credits">
1449
+ <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
+ <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
+ <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
+ <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
+ </ul>
1454
+
1455
+ <footer>
1456
+ &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
+ </footer>
1458
+
1459
+ </div>
1460
+ </div>
1461
+ <script src="docsupport/jquery-3.2.1.min.js" type="text/javascript"></script>
1462
+ <script src="chosen.jquery.js" type="text/javascript"></script>
1463
+ <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
+ <script src="docsupport/init.js" type="text/javascript" charset="utf-8"></script>
1465
+ </form>
1466
+ <div class="oss-bar">
1467
+ <ul>
1468
+ <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1469
+ <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1470
+ </ul>
1471
+ </div>
1472
+ </body>
1473
+ </html>
common/libs/chosen-v1.8.3/create-example.proto.html ADDED
@@ -0,0 +1,1472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Chosen: A Prototype Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
+ <link rel="stylesheet" href="docsupport/style.css">
7
+ <link rel="stylesheet" href="docsupport/prism.css">
8
+ <link rel="stylesheet" href="chosen.css">
9
+
10
+ <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
+
12
+ </head>
13
+ <body>
14
+ <div id="container">
15
+ <div id="content">
16
+ <header>
17
+ <h1>Chosen - Prototype Version <small>(<span id="latest-version">v1.8.3</span>)</small></h1>
18
+ </header>
19
+ <p>Chosen is a Prototype plugin that makes long, unwieldy select boxes much more user-friendly.</p>
20
+
21
+ <p>
22
+ <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
23
+ <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
24
+ <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
25
+ </p>
26
+
27
+ <p class="jquery-version-refer">Looking for the <a href="index.html">jQuery version?</a></p>
28
+
29
+ <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
30
+ <div class="side-by-side clearfix">
31
+ <div>
32
+ <em>Turns This</em>
33
+ <select data-placeholder="Choose a Country..." class="select" tabindex="1">
34
+ <option value=""></option>
35
+ <option value="United States">United States</option>
36
+ <option value="United Kingdom">United Kingdom</option>
37
+ <option value="Afghanistan">Afghanistan</option>
38
+ <option value="Aland Islands">Aland Islands</option>
39
+ <option value="Albania">Albania</option>
40
+ <option value="Algeria">Algeria</option>
41
+ <option value="American Samoa">American Samoa</option>
42
+ <option value="Andorra">Andorra</option>
43
+ <option value="Angola">Angola</option>
44
+ <option value="Anguilla">Anguilla</option>
45
+ <option value="Antarctica">Antarctica</option>
46
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
47
+ <option value="Argentina">Argentina</option>
48
+ <option value="Armenia">Armenia</option>
49
+ <option value="Aruba">Aruba</option>
50
+ <option value="Australia">Australia</option>
51
+ <option value="Austria">Austria</option>
52
+ <option value="Azerbaijan">Azerbaijan</option>
53
+ <option value="Bahamas">Bahamas</option>
54
+ <option value="Bahrain">Bahrain</option>
55
+ <option value="Bangladesh">Bangladesh</option>
56
+ <option value="Barbados">Barbados</option>
57
+ <option value="Belarus">Belarus</option>
58
+ <option value="Belgium">Belgium</option>
59
+ <option value="Belize">Belize</option>
60
+ <option value="Benin">Benin</option>
61
+ <option value="Bermuda">Bermuda</option>
62
+ <option value="Bhutan">Bhutan</option>
63
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
64
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
65
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
66
+ <option value="Botswana">Botswana</option>
67
+ <option value="Bouvet Island">Bouvet Island</option>
68
+ <option value="Brazil">Brazil</option>
69
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
70
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
71
+ <option value="Bulgaria">Bulgaria</option>
72
+ <option value="Burkina Faso">Burkina Faso</option>
73
+ <option value="Burundi">Burundi</option>
74
+ <option value="Cambodia">Cambodia</option>
75
+ <option value="Cameroon">Cameroon</option>
76
+ <option value="Canada">Canada</option>
77
+ <option value="Cape Verde">Cape Verde</option>
78
+ <option value="Cayman Islands">Cayman Islands</option>
79
+ <option value="Central African Republic">Central African Republic</option>
80
+ <option value="Chad">Chad</option>
81
+ <option value="Chile">Chile</option>
82
+ <option value="China">China</option>
83
+ <option value="Christmas Island">Christmas Island</option>
84
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
85
+ <option value="Colombia">Colombia</option>
86
+ <option value="Comoros">Comoros</option>
87
+ <option value="Congo">Congo</option>
88
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
89
+ <option value="Cook Islands">Cook Islands</option>
90
+ <option value="Costa Rica">Costa Rica</option>
91
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
92
+ <option value="Croatia">Croatia</option>
93
+ <option value="Cuba">Cuba</option>
94
+ <option value="Curacao">Curacao</option>
95
+ <option value="Cyprus">Cyprus</option>
96
+ <option value="Czech Republic">Czech Republic</option>
97
+ <option value="Denmark">Denmark</option>
98
+ <option value="Djibouti">Djibouti</option>
99
+ <option value="Dominica">Dominica</option>
100
+ <option value="Dominican Republic">Dominican Republic</option>
101
+ <option value="Ecuador">Ecuador</option>
102
+ <option value="Egypt">Egypt</option>
103
+ <option value="El Salvador">El Salvador</option>
104
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
105
+ <option value="Eritrea">Eritrea</option>
106
+ <option value="Estonia">Estonia</option>
107
+ <option value="Ethiopia">Ethiopia</option>
108
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
109
+ <option value="Faroe Islands">Faroe Islands</option>
110
+ <option value="Fiji">Fiji</option>
111
+ <option value="Finland">Finland</option>
112
+ <option value="France">France</option>
113
+ <option value="French Guiana">French Guiana</option>
114
+ <option value="French Polynesia">French Polynesia</option>
115
+ <option value="French Southern Territories">French Southern Territories</option>
116
+ <option value="Gabon">Gabon</option>
117
+ <option value="Gambia">Gambia</option>
118
+ <option value="Georgia">Georgia</option>
119
+ <option value="Germany">Germany</option>
120
+ <option value="Ghana">Ghana</option>
121
+ <option value="Gibraltar">Gibraltar</option>
122
+ <option value="Greece">Greece</option>
123
+ <option value="Greenland">Greenland</option>
124
+ <option value="Grenada">Grenada</option>
125
+ <option value="Guadeloupe">Guadeloupe</option>
126
+ <option value="Guam">Guam</option>
127
+ <option value="Guatemala">Guatemala</option>
128
+ <option value="Guernsey">Guernsey</option>
129
+ <option value="Guinea">Guinea</option>
130
+ <option value="Guinea-bissau">Guinea-bissau</option>
131
+ <option value="Guyana">Guyana</option>
132
+ <option value="Haiti">Haiti</option>
133
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
134
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
135
+ <option value="Honduras">Honduras</option>
136
+ <option value="Hong Kong">Hong Kong</option>
137
+ <option value="Hungary">Hungary</option>
138
+ <option value="Iceland">Iceland</option>
139
+ <option value="India">India</option>
140
+ <option value="Indonesia">Indonesia</option>
141
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
142
+ <option value="Iraq">Iraq</option>
143
+ <option value="Ireland">Ireland</option>
144
+ <option value="Isle of Man">Isle of Man</option>
145
+ <option value="Israel">Israel</option>
146
+ <option value="Italy">Italy</option>
147
+ <option value="Jamaica">Jamaica</option>
148
+ <option value="Japan">Japan</option>
149
+ <option value="Jersey">Jersey</option>
150
+ <option value="Jordan">Jordan</option>
151
+ <option value="Kazakhstan">Kazakhstan</option>
152
+ <option value="Kenya">Kenya</option>
153
+ <option value="Kiribati">Kiribati</option>
154
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
155
+ <option value="Korea, Republic of">Korea, Republic of</option>
156
+ <option value="Kuwait">Kuwait</option>
157
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
158
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
159
+ <option value="Latvia">Latvia</option>
160
+ <option value="Lebanon">Lebanon</option>
161
+ <option value="Lesotho">Lesotho</option>
162
+ <option value="Liberia">Liberia</option>
163
+ <option value="Libya">Libya</option>
164
+ <option value="Liechtenstein">Liechtenstein</option>
165
+ <option value="Lithuania">Lithuania</option>
166
+ <option value="Luxembourg">Luxembourg</option>
167
+ <option value="Macao">Macao</option>
168
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
169
+ <option value="Madagascar">Madagascar</option>
170
+ <option value="Malawi">Malawi</option>
171
+ <option value="Malaysia">Malaysia</option>
172
+ <option value="Maldives">Maldives</option>
173
+ <option value="Mali">Mali</option>
174
+ <option value="Malta">Malta</option>
175
+ <option value="Marshall Islands">Marshall Islands</option>
176
+ <option value="Martinique">Martinique</option>
177
+ <option value="Mauritania">Mauritania</option>
178
+ <option value="Mauritius">Mauritius</option>
179
+ <option value="Mayotte">Mayotte</option>
180
+ <option value="Mexico">Mexico</option>
181
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
182
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
183
+ <option value="Monaco">Monaco</option>
184
+ <option value="Mongolia">Mongolia</option>
185
+ <option value="Montenegro">Montenegro</option>
186
+ <option value="Montserrat">Montserrat</option>
187
+ <option value="Morocco">Morocco</option>
188
+ <option value="Mozambique">Mozambique</option>
189
+ <option value="Myanmar">Myanmar</option>
190
+ <option value="Namibia">Namibia</option>
191
+ <option value="Nauru">Nauru</option>
192
+ <option value="Nepal">Nepal</option>
193
+ <option value="Netherlands">Netherlands</option>
194
+ <option value="New Caledonia">New Caledonia</option>
195
+ <option value="New Zealand">New Zealand</option>
196
+ <option value="Nicaragua">Nicaragua</option>
197
+ <option value="Niger">Niger</option>
198
+ <option value="Nigeria">Nigeria</option>
199
+ <option value="Niue">Niue</option>
200
+ <option value="Norfolk Island">Norfolk Island</option>
201
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
202
+ <option value="Norway">Norway</option>
203
+ <option value="Oman">Oman</option>
204
+ <option value="Pakistan">Pakistan</option>
205
+ <option value="Palau">Palau</option>
206
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
207
+ <option value="Panama">Panama</option>
208
+ <option value="Papua New Guinea">Papua New Guinea</option>
209
+ <option value="Paraguay">Paraguay</option>
210
+ <option value="Peru">Peru</option>
211
+ <option value="Philippines">Philippines</option>
212
+ <option value="Pitcairn">Pitcairn</option>
213
+ <option value="Poland">Poland</option>
214
+ <option value="Portugal">Portugal</option>
215
+ <option value="Puerto Rico">Puerto Rico</option>
216
+ <option value="Qatar">Qatar</option>
217
+ <option value="Reunion">Reunion</option>
218
+ <option value="Romania">Romania</option>
219
+ <option value="Russian Federation">Russian Federation</option>
220
+ <option value="Rwanda">Rwanda</option>
221
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
222
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
223
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
224
+ <option value="Saint Lucia">Saint Lucia</option>
225
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
226
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
227
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
228
+ <option value="Samoa">Samoa</option>
229
+ <option value="San Marino">San Marino</option>
230
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
231
+ <option value="Saudi Arabia">Saudi Arabia</option>
232
+ <option value="Senegal">Senegal</option>
233
+ <option value="Serbia">Serbia</option>
234
+ <option value="Seychelles">Seychelles</option>
235
+ <option value="Sierra Leone">Sierra Leone</option>
236
+ <option value="Singapore">Singapore</option>
237
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
238
+ <option value="Slovakia">Slovakia</option>
239
+ <option value="Slovenia">Slovenia</option>
240
+ <option value="Solomon Islands">Solomon Islands</option>
241
+ <option value="Somalia">Somalia</option>
242
+ <option value="South Africa">South Africa</option>
243
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
244
+ <option value="South Sudan">South Sudan</option>
245
+ <option value="Spain">Spain</option>
246
+ <option value="Sri Lanka">Sri Lanka</option>
247
+ <option value="Sudan">Sudan</option>
248
+ <option value="Suriname">Suriname</option>
249
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
250
+ <option value="Swaziland">Swaziland</option>
251
+ <option value="Sweden">Sweden</option>
252
+ <option value="Switzerland">Switzerland</option>
253
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
254
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
255
+ <option value="Tajikistan">Tajikistan</option>
256
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
257
+ <option value="Thailand">Thailand</option>
258
+ <option value="Timor-leste">Timor-leste</option>
259
+ <option value="Togo">Togo</option>
260
+ <option value="Tokelau">Tokelau</option>
261
+ <option value="Tonga">Tonga</option>
262
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
263
+ <option value="Tunisia">Tunisia</option>
264
+ <option value="Turkey">Turkey</option>
265
+ <option value="Turkmenistan">Turkmenistan</option>
266
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
267
+ <option value="Tuvalu">Tuvalu</option>
268
+ <option value="Uganda">Uganda</option>
269
+ <option value="Ukraine">Ukraine</option>
270
+ <option value="United Arab Emirates">United Arab Emirates</option>
271
+ <option value="United Kingdom">United Kingdom</option>
272
+ <option value="United States">United States</option>
273
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
274
+ <option value="Uruguay">Uruguay</option>
275
+ <option value="Uzbekistan">Uzbekistan</option>
276
+ <option value="Vanuatu">Vanuatu</option>
277
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
278
+ <option value="Viet Nam">Viet Nam</option>
279
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
280
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
281
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
282
+ <option value="Western Sahara">Western Sahara</option>
283
+ <option value="Yemen">Yemen</option>
284
+ <option value="Zambia">Zambia</option>
285
+ <option value="Zimbabwe">Zimbabwe</option>
286
+ </select>
287
+ </div>
288
+ <div>
289
+ <em>Into This</em>
290
+ <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
291
+ <option value=""></option>
292
+ <option value="United States">United States</option>
293
+ <option value="United Kingdom">United Kingdom</option>
294
+ <option value="Afghanistan">Afghanistan</option>
295
+ <option value="Aland Islands">Aland Islands</option>
296
+ <option value="Albania">Albania</option>
297
+ <option value="Algeria">Algeria</option>
298
+ <option value="American Samoa">American Samoa</option>
299
+ <option value="Andorra">Andorra</option>
300
+ <option value="Angola">Angola</option>
301
+ <option value="Anguilla">Anguilla</option>
302
+ <option value="Antarctica">Antarctica</option>
303
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
304
+ <option value="Argentina">Argentina</option>
305
+ <option value="Armenia">Armenia</option>
306
+ <option value="Aruba">Aruba</option>
307
+ <option value="Australia">Australia</option>
308
+ <option value="Austria">Austria</option>
309
+ <option value="Azerbaijan">Azerbaijan</option>
310
+ <option value="Bahamas">Bahamas</option>
311
+ <option value="Bahrain">Bahrain</option>
312
+ <option value="Bangladesh">Bangladesh</option>
313
+ <option value="Barbados">Barbados</option>
314
+ <option value="Belarus">Belarus</option>
315
+ <option value="Belgium">Belgium</option>
316
+ <option value="Belize">Belize</option>
317
+ <option value="Benin">Benin</option>
318
+ <option value="Bermuda">Bermuda</option>
319
+ <option value="Bhutan">Bhutan</option>
320
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
321
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
322
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
323
+ <option value="Botswana">Botswana</option>
324
+ <option value="Bouvet Island">Bouvet Island</option>
325
+ <option value="Brazil">Brazil</option>
326
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
327
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
328
+ <option value="Bulgaria">Bulgaria</option>
329
+ <option value="Burkina Faso">Burkina Faso</option>
330
+ <option value="Burundi">Burundi</option>
331
+ <option value="Cambodia">Cambodia</option>
332
+ <option value="Cameroon">Cameroon</option>
333
+ <option value="Canada">Canada</option>
334
+ <option value="Cape Verde">Cape Verde</option>
335
+ <option value="Cayman Islands">Cayman Islands</option>
336
+ <option value="Central African Republic">Central African Republic</option>
337
+ <option value="Chad">Chad</option>
338
+ <option value="Chile">Chile</option>
339
+ <option value="China">China</option>
340
+ <option value="Christmas Island">Christmas Island</option>
341
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
342
+ <option value="Colombia">Colombia</option>
343
+ <option value="Comoros">Comoros</option>
344
+ <option value="Congo">Congo</option>
345
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
346
+ <option value="Cook Islands">Cook Islands</option>
347
+ <option value="Costa Rica">Costa Rica</option>
348
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
349
+ <option value="Croatia">Croatia</option>
350
+ <option value="Cuba">Cuba</option>
351
+ <option value="Curacao">Curacao</option>
352
+ <option value="Cyprus">Cyprus</option>
353
+ <option value="Czech Republic">Czech Republic</option>
354
+ <option value="Denmark">Denmark</option>
355
+ <option value="Djibouti">Djibouti</option>
356
+ <option value="Dominica">Dominica</option>
357
+ <option value="Dominican Republic">Dominican Republic</option>
358
+ <option value="Ecuador">Ecuador</option>
359
+ <option value="Egypt">Egypt</option>
360
+ <option value="El Salvador">El Salvador</option>
361
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
362
+ <option value="Eritrea">Eritrea</option>
363
+ <option value="Estonia">Estonia</option>
364
+ <option value="Ethiopia">Ethiopia</option>
365
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
366
+ <option value="Faroe Islands">Faroe Islands</option>
367
+ <option value="Fiji">Fiji</option>
368
+ <option value="Finland">Finland</option>
369
+ <option value="France">France</option>
370
+ <option value="French Guiana">French Guiana</option>
371
+ <option value="French Polynesia">French Polynesia</option>
372
+ <option value="French Southern Territories">French Southern Territories</option>
373
+ <option value="Gabon">Gabon</option>
374
+ <option value="Gambia">Gambia</option>
375
+ <option value="Georgia">Georgia</option>
376
+ <option value="Germany">Germany</option>
377
+ <option value="Ghana">Ghana</option>
378
+ <option value="Gibraltar">Gibraltar</option>
379
+ <option value="Greece">Greece</option>
380
+ <option value="Greenland">Greenland</option>
381
+ <option value="Grenada">Grenada</option>
382
+ <option value="Guadeloupe">Guadeloupe</option>
383
+ <option value="Guam">Guam</option>
384
+ <option value="Guatemala">Guatemala</option>
385
+ <option value="Guernsey">Guernsey</option>
386
+ <option value="Guinea">Guinea</option>
387
+ <option value="Guinea-bissau">Guinea-bissau</option>
388
+ <option value="Guyana">Guyana</option>
389
+ <option value="Haiti">Haiti</option>
390
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
391
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
392
+ <option value="Honduras">Honduras</option>
393
+ <option value="Hong Kong">Hong Kong</option>
394
+ <option value="Hungary">Hungary</option>
395
+ <option value="Iceland">Iceland</option>
396
+ <option value="India">India</option>
397
+ <option value="Indonesia">Indonesia</option>
398
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
399
+ <option value="Iraq">Iraq</option>
400
+ <option value="Ireland">Ireland</option>
401
+ <option value="Isle of Man">Isle of Man</option>
402
+ <option value="Israel">Israel</option>
403
+ <option value="Italy">Italy</option>
404
+ <option value="Jamaica">Jamaica</option>
405
+ <option value="Japan">Japan</option>
406
+ <option value="Jersey">Jersey</option>
407
+ <option value="Jordan">Jordan</option>
408
+ <option value="Kazakhstan">Kazakhstan</option>
409
+ <option value="Kenya">Kenya</option>
410
+ <option value="Kiribati">Kiribati</option>
411
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
412
+ <option value="Korea, Republic of">Korea, Republic of</option>
413
+ <option value="Kuwait">Kuwait</option>
414
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
415
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
416
+ <option value="Latvia">Latvia</option>
417
+ <option value="Lebanon">Lebanon</option>
418
+ <option value="Lesotho">Lesotho</option>
419
+ <option value="Liberia">Liberia</option>
420
+ <option value="Libya">Libya</option>
421
+ <option value="Liechtenstein">Liechtenstein</option>
422
+ <option value="Lithuania">Lithuania</option>
423
+ <option value="Luxembourg">Luxembourg</option>
424
+ <option value="Macao">Macao</option>
425
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
426
+ <option value="Madagascar">Madagascar</option>
427
+ <option value="Malawi">Malawi</option>
428
+ <option value="Malaysia">Malaysia</option>
429
+ <option value="Maldives">Maldives</option>
430
+ <option value="Mali">Mali</option>
431
+ <option value="Malta">Malta</option>
432
+ <option value="Marshall Islands">Marshall Islands</option>
433
+ <option value="Martinique">Martinique</option>
434
+ <option value="Mauritania">Mauritania</option>
435
+ <option value="Mauritius">Mauritius</option>
436
+ <option value="Mayotte">Mayotte</option>
437
+ <option value="Mexico">Mexico</option>
438
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
439
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
440
+ <option value="Monaco">Monaco</option>
441
+ <option value="Mongolia">Mongolia</option>
442
+ <option value="Montenegro">Montenegro</option>
443
+ <option value="Montserrat">Montserrat</option>
444
+ <option value="Morocco">Morocco</option>
445
+ <option value="Mozambique">Mozambique</option>
446
+ <option value="Myanmar">Myanmar</option>
447
+ <option value="Namibia">Namibia</option>
448
+ <option value="Nauru">Nauru</option>
449
+ <option value="Nepal">Nepal</option>
450
+ <option value="Netherlands">Netherlands</option>
451
+ <option value="New Caledonia">New Caledonia</option>
452
+ <option value="New Zealand">New Zealand</option>
453
+ <option value="Nicaragua">Nicaragua</option>
454
+ <option value="Niger">Niger</option>
455
+ <option value="Nigeria">Nigeria</option>
456
+ <option value="Niue">Niue</option>
457
+ <option value="Norfolk Island">Norfolk Island</option>
458
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
459
+ <option value="Norway">Norway</option>
460
+ <option value="Oman">Oman</option>
461
+ <option value="Pakistan">Pakistan</option>
462
+ <option value="Palau">Palau</option>
463
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
464
+ <option value="Panama">Panama</option>
465
+ <option value="Papua New Guinea">Papua New Guinea</option>
466
+ <option value="Paraguay">Paraguay</option>
467
+ <option value="Peru">Peru</option>
468
+ <option value="Philippines">Philippines</option>
469
+ <option value="Pitcairn">Pitcairn</option>
470
+ <option value="Poland">Poland</option>
471
+ <option value="Portugal">Portugal</option>
472
+ <option value="Puerto Rico">Puerto Rico</option>
473
+ <option value="Qatar">Qatar</option>
474
+ <option value="Reunion">Reunion</option>
475
+ <option value="Romania">Romania</option>
476
+ <option value="Russian Federation">Russian Federation</option>
477
+ <option value="Rwanda">Rwanda</option>
478
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
479
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
480
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
481
+ <option value="Saint Lucia">Saint Lucia</option>
482
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
483
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
484
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
485
+ <option value="Samoa">Samoa</option>
486
+ <option value="San Marino">San Marino</option>
487
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
488
+ <option value="Saudi Arabia">Saudi Arabia</option>
489
+ <option value="Senegal">Senegal</option>
490
+ <option value="Serbia">Serbia</option>
491
+ <option value="Seychelles">Seychelles</option>
492
+ <option value="Sierra Leone">Sierra Leone</option>
493
+ <option value="Singapore">Singapore</option>
494
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
495
+ <option value="Slovakia">Slovakia</option>
496
+ <option value="Slovenia">Slovenia</option>
497
+ <option value="Solomon Islands">Solomon Islands</option>
498
+ <option value="Somalia">Somalia</option>
499
+ <option value="South Africa">South Africa</option>
500
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
501
+ <option value="South Sudan">South Sudan</option>
502
+ <option value="Spain">Spain</option>
503
+ <option value="Sri Lanka">Sri Lanka</option>
504
+ <option value="Sudan">Sudan</option>
505
+ <option value="Suriname">Suriname</option>
506
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
507
+ <option value="Swaziland">Swaziland</option>
508
+ <option value="Sweden">Sweden</option>
509
+ <option value="Switzerland">Switzerland</option>
510
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
511
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
512
+ <option value="Tajikistan">Tajikistan</option>
513
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
514
+ <option value="Thailand">Thailand</option>
515
+ <option value="Timor-leste">Timor-leste</option>
516
+ <option value="Togo">Togo</option>
517
+ <option value="Tokelau">Tokelau</option>
518
+ <option value="Tonga">Tonga</option>
519
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
520
+ <option value="Tunisia">Tunisia</option>
521
+ <option value="Turkey">Turkey</option>
522
+ <option value="Turkmenistan">Turkmenistan</option>
523
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
524
+ <option value="Tuvalu">Tuvalu</option>
525
+ <option value="Uganda">Uganda</option>
526
+ <option value="Ukraine">Ukraine</option>
527
+ <option value="United Arab Emirates">United Arab Emirates</option>
528
+ <option value="United Kingdom">United Kingdom</option>
529
+ <option value="United States">United States</option>
530
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
531
+ <option value="Uruguay">Uruguay</option>
532
+ <option value="Uzbekistan">Uzbekistan</option>
533
+ <option value="Vanuatu">Vanuatu</option>
534
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
535
+ <option value="Viet Nam">Viet Nam</option>
536
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
537
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
538
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
539
+ <option value="Western Sahara">Western Sahara</option>
540
+ <option value="Yemen">Yemen</option>
541
+ <option value="Zambia">Zambia</option>
542
+ <option value="Zimbabwe">Zimbabwe</option>
543
+ </select>
544
+ </div>
545
+ </div>
546
+
547
+ <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
548
+ <div class="side-by-side clearfix">
549
+ <div>
550
+ <em>Turns This</em>
551
+ <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
552
+ <option value=""></option>
553
+ <option value="United States">United States</option>
554
+ <option value="United Kingdom">United Kingdom</option>
555
+ <option value="Afghanistan">Afghanistan</option>
556
+ <option value="Aland Islands">Aland Islands</option>
557
+ <option value="Albania">Albania</option>
558
+ <option value="Algeria">Algeria</option>
559
+ <option value="American Samoa">American Samoa</option>
560
+ <option value="Andorra">Andorra</option>
561
+ <option value="Angola">Angola</option>
562
+ <option value="Anguilla">Anguilla</option>
563
+ <option value="Antarctica">Antarctica</option>
564
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
565
+ <option value="Argentina">Argentina</option>
566
+ <option value="Armenia">Armenia</option>
567
+ <option value="Aruba">Aruba</option>
568
+ <option value="Australia">Australia</option>
569
+ <option value="Austria">Austria</option>
570
+ <option value="Azerbaijan">Azerbaijan</option>
571
+ <option value="Bahamas">Bahamas</option>
572
+ <option value="Bahrain">Bahrain</option>
573
+ <option value="Bangladesh">Bangladesh</option>
574
+ <option value="Barbados">Barbados</option>
575
+ <option value="Belarus">Belarus</option>
576
+ <option value="Belgium">Belgium</option>
577
+ <option value="Belize">Belize</option>
578
+ <option value="Benin">Benin</option>
579
+ <option value="Bermuda">Bermuda</option>
580
+ <option value="Bhutan">Bhutan</option>
581
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
582
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
583
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
584
+ <option value="Botswana">Botswana</option>
585
+ <option value="Bouvet Island">Bouvet Island</option>
586
+ <option value="Brazil">Brazil</option>
587
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
588
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
589
+ <option value="Bulgaria">Bulgaria</option>
590
+ <option value="Burkina Faso">Burkina Faso</option>
591
+ <option value="Burundi">Burundi</option>
592
+ <option value="Cambodia">Cambodia</option>
593
+ <option value="Cameroon">Cameroon</option>
594
+ <option value="Canada">Canada</option>
595
+ <option value="Cape Verde">Cape Verde</option>
596
+ <option value="Cayman Islands">Cayman Islands</option>
597
+ <option value="Central African Republic">Central African Republic</option>
598
+ <option value="Chad">Chad</option>
599
+ <option value="Chile">Chile</option>
600
+ <option value="China">China</option>
601
+ <option value="Christmas Island">Christmas Island</option>
602
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
603
+ <option value="Colombia">Colombia</option>
604
+ <option value="Comoros">Comoros</option>
605
+ <option value="Congo">Congo</option>
606
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
607
+ <option value="Cook Islands">Cook Islands</option>
608
+ <option value="Costa Rica">Costa Rica</option>
609
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
610
+ <option value="Croatia">Croatia</option>
611
+ <option value="Cuba">Cuba</option>
612
+ <option value="Curacao">Curacao</option>
613
+ <option value="Cyprus">Cyprus</option>
614
+ <option value="Czech Republic">Czech Republic</option>
615
+ <option value="Denmark">Denmark</option>
616
+ <option value="Djibouti">Djibouti</option>
617
+ <option value="Dominica">Dominica</option>
618
+ <option value="Dominican Republic">Dominican Republic</option>
619
+ <option value="Ecuador">Ecuador</option>
620
+ <option value="Egypt">Egypt</option>
621
+ <option value="El Salvador">El Salvador</option>
622
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
623
+ <option value="Eritrea">Eritrea</option>
624
+ <option value="Estonia">Estonia</option>
625
+ <option value="Ethiopia">Ethiopia</option>
626
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
627
+ <option value="Faroe Islands">Faroe Islands</option>
628
+ <option value="Fiji">Fiji</option>
629
+ <option value="Finland">Finland</option>
630
+ <option value="France">France</option>
631
+ <option value="French Guiana">French Guiana</option>
632
+ <option value="French Polynesia">French Polynesia</option>
633
+ <option value="French Southern Territories">French Southern Territories</option>
634
+ <option value="Gabon">Gabon</option>
635
+ <option value="Gambia">Gambia</option>
636
+ <option value="Georgia">Georgia</option>
637
+ <option value="Germany">Germany</option>
638
+ <option value="Ghana">Ghana</option>
639
+ <option value="Gibraltar">Gibraltar</option>
640
+ <option value="Greece">Greece</option>
641
+ <option value="Greenland">Greenland</option>
642
+ <option value="Grenada">Grenada</option>
643
+ <option value="Guadeloupe">Guadeloupe</option>
644
+ <option value="Guam">Guam</option>
645
+ <option value="Guatemala">Guatemala</option>
646
+ <option value="Guernsey">Guernsey</option>
647
+ <option value="Guinea">Guinea</option>
648
+ <option value="Guinea-bissau">Guinea-bissau</option>
649
+ <option value="Guyana">Guyana</option>
650
+ <option value="Haiti">Haiti</option>
651
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
652
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
653
+ <option value="Honduras">Honduras</option>
654
+ <option value="Hong Kong">Hong Kong</option>
655
+ <option value="Hungary">Hungary</option>
656
+ <option value="Iceland">Iceland</option>
657
+ <option value="India">India</option>
658
+ <option value="Indonesia">Indonesia</option>
659
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
660
+ <option value="Iraq">Iraq</option>
661
+ <option value="Ireland">Ireland</option>
662
+ <option value="Isle of Man">Isle of Man</option>
663
+ <option value="Israel">Israel</option>
664
+ <option value="Italy">Italy</option>
665
+ <option value="Jamaica">Jamaica</option>
666
+ <option value="Japan">Japan</option>
667
+ <option value="Jersey">Jersey</option>
668
+ <option value="Jordan">Jordan</option>
669
+ <option value="Kazakhstan">Kazakhstan</option>
670
+ <option value="Kenya">Kenya</option>
671
+ <option value="Kiribati">Kiribati</option>
672
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
673
+ <option value="Korea, Republic of">Korea, Republic of</option>
674
+ <option value="Kuwait">Kuwait</option>
675
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
676
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
677
+ <option value="Latvia">Latvia</option>
678
+ <option value="Lebanon">Lebanon</option>
679
+ <option value="Lesotho">Lesotho</option>
680
+ <option value="Liberia">Liberia</option>
681
+ <option value="Libya">Libya</option>
682
+ <option value="Liechtenstein">Liechtenstein</option>
683
+ <option value="Lithuania">Lithuania</option>
684
+ <option value="Luxembourg">Luxembourg</option>
685
+ <option value="Macao">Macao</option>
686
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
687
+ <option value="Madagascar">Madagascar</option>
688
+ <option value="Malawi">Malawi</option>
689
+ <option value="Malaysia">Malaysia</option>
690
+ <option value="Maldives">Maldives</option>
691
+ <option value="Mali">Mali</option>
692
+ <option value="Malta">Malta</option>
693
+ <option value="Marshall Islands">Marshall Islands</option>
694
+ <option value="Martinique">Martinique</option>
695
+ <option value="Mauritania">Mauritania</option>
696
+ <option value="Mauritius">Mauritius</option>
697
+ <option value="Mayotte">Mayotte</option>
698
+ <option value="Mexico">Mexico</option>
699
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
700
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
701
+ <option value="Monaco">Monaco</option>
702
+ <option value="Mongolia">Mongolia</option>
703
+ <option value="Montenegro">Montenegro</option>
704
+ <option value="Montserrat">Montserrat</option>
705
+ <option value="Morocco">Morocco</option>
706
+ <option value="Mozambique">Mozambique</option>
707
+ <option value="Myanmar">Myanmar</option>
708
+ <option value="Namibia">Namibia</option>
709
+ <option value="Nauru">Nauru</option>
710
+ <option value="Nepal">Nepal</option>
711
+ <option value="Netherlands">Netherlands</option>
712
+ <option value="New Caledonia">New Caledonia</option>
713
+ <option value="New Zealand">New Zealand</option>
714
+ <option value="Nicaragua">Nicaragua</option>
715
+ <option value="Niger">Niger</option>
716
+ <option value="Nigeria">Nigeria</option>
717
+ <option value="Niue">Niue</option>
718
+ <option value="Norfolk Island">Norfolk Island</option>
719
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
720
+ <option value="Norway">Norway</option>
721
+ <option value="Oman">Oman</option>
722
+ <option value="Pakistan">Pakistan</option>
723
+ <option value="Palau">Palau</option>
724
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
725
+ <option value="Panama">Panama</option>
726
+ <option value="Papua New Guinea">Papua New Guinea</option>
727
+ <option value="Paraguay">Paraguay</option>
728
+ <option value="Peru">Peru</option>
729
+ <option value="Philippines">Philippines</option>
730
+ <option value="Pitcairn">Pitcairn</option>
731
+ <option value="Poland">Poland</option>
732
+ <option value="Portugal">Portugal</option>
733
+ <option value="Puerto Rico">Puerto Rico</option>
734
+ <option value="Qatar">Qatar</option>
735
+ <option value="Reunion">Reunion</option>
736
+ <option value="Romania">Romania</option>
737
+ <option value="Russian Federation">Russian Federation</option>
738
+ <option value="Rwanda">Rwanda</option>
739
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
740
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
741
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
742
+ <option value="Saint Lucia">Saint Lucia</option>
743
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
744
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
745
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
746
+ <option value="Samoa">Samoa</option>
747
+ <option value="San Marino">San Marino</option>
748
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
749
+ <option value="Saudi Arabia">Saudi Arabia</option>
750
+ <option value="Senegal">Senegal</option>
751
+ <option value="Serbia">Serbia</option>
752
+ <option value="Seychelles">Seychelles</option>
753
+ <option value="Sierra Leone">Sierra Leone</option>
754
+ <option value="Singapore">Singapore</option>
755
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
756
+ <option value="Slovakia">Slovakia</option>
757
+ <option value="Slovenia">Slovenia</option>
758
+ <option value="Solomon Islands">Solomon Islands</option>
759
+ <option value="Somalia">Somalia</option>
760
+ <option value="South Africa">South Africa</option>
761
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
762
+ <option value="South Sudan">South Sudan</option>
763
+ <option value="Spain">Spain</option>
764
+ <option value="Sri Lanka">Sri Lanka</option>
765
+ <option value="Sudan">Sudan</option>
766
+ <option value="Suriname">Suriname</option>
767
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
768
+ <option value="Swaziland">Swaziland</option>
769
+ <option value="Sweden">Sweden</option>
770
+ <option value="Switzerland">Switzerland</option>
771
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
772
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
773
+ <option value="Tajikistan">Tajikistan</option>
774
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
775
+ <option value="Thailand">Thailand</option>
776
+ <option value="Timor-leste">Timor-leste</option>
777
+ <option value="Togo">Togo</option>
778
+ <option value="Tokelau">Tokelau</option>
779
+ <option value="Tonga">Tonga</option>
780
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
781
+ <option value="Tunisia">Tunisia</option>
782
+ <option value="Turkey">Turkey</option>
783
+ <option value="Turkmenistan">Turkmenistan</option>
784
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
785
+ <option value="Tuvalu">Tuvalu</option>
786
+ <option value="Uganda">Uganda</option>
787
+ <option value="Ukraine">Ukraine</option>
788
+ <option value="United Arab Emirates">United Arab Emirates</option>
789
+ <option value="United Kingdom">United Kingdom</option>
790
+ <option value="United States">United States</option>
791
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
792
+ <option value="Uruguay">Uruguay</option>
793
+ <option value="Uzbekistan">Uzbekistan</option>
794
+ <option value="Vanuatu">Vanuatu</option>
795
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
796
+ <option value="Viet Nam">Viet Nam</option>
797
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
798
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
799
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
800
+ <option value="Western Sahara">Western Sahara</option>
801
+ <option value="Yemen">Yemen</option>
802
+ <option value="Zambia">Zambia</option>
803
+ <option value="Zimbabwe">Zimbabwe</option>
804
+ </select>
805
+ </div>
806
+ <div>
807
+ <em>Into This</em>
808
+ <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
809
+ <option value=""></option>
810
+ <option value="United States">United States</option>
811
+ <option value="United Kingdom">United Kingdom</option>
812
+ <option value="Afghanistan">Afghanistan</option>
813
+ <option value="Aland Islands">Aland Islands</option>
814
+ <option value="Albania">Albania</option>
815
+ <option value="Algeria">Algeria</option>
816
+ <option value="American Samoa">American Samoa</option>
817
+ <option value="Andorra">Andorra</option>
818
+ <option value="Angola">Angola</option>
819
+ <option value="Anguilla">Anguilla</option>
820
+ <option value="Antarctica">Antarctica</option>
821
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
822
+ <option value="Argentina">Argentina</option>
823
+ <option value="Armenia">Armenia</option>
824
+ <option value="Aruba">Aruba</option>
825
+ <option value="Australia">Australia</option>
826
+ <option value="Austria">Austria</option>
827
+ <option value="Azerbaijan">Azerbaijan</option>
828
+ <option value="Bahamas">Bahamas</option>
829
+ <option value="Bahrain">Bahrain</option>
830
+ <option value="Bangladesh">Bangladesh</option>
831
+ <option value="Barbados">Barbados</option>
832
+ <option value="Belarus">Belarus</option>
833
+ <option value="Belgium">Belgium</option>
834
+ <option value="Belize">Belize</option>
835
+ <option value="Benin">Benin</option>
836
+ <option value="Bermuda">Bermuda</option>
837
+ <option value="Bhutan">Bhutan</option>
838
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
839
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
840
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
841
+ <option value="Botswana">Botswana</option>
842
+ <option value="Bouvet Island">Bouvet Island</option>
843
+ <option value="Brazil">Brazil</option>
844
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
845
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
846
+ <option value="Bulgaria">Bulgaria</option>
847
+ <option value="Burkina Faso">Burkina Faso</option>
848
+ <option value="Burundi">Burundi</option>
849
+ <option value="Cambodia">Cambodia</option>
850
+ <option value="Cameroon">Cameroon</option>
851
+ <option value="Canada">Canada</option>
852
+ <option value="Cape Verde">Cape Verde</option>
853
+ <option value="Cayman Islands">Cayman Islands</option>
854
+ <option value="Central African Republic">Central African Republic</option>
855
+ <option value="Chad">Chad</option>
856
+ <option value="Chile">Chile</option>
857
+ <option value="China">China</option>
858
+ <option value="Christmas Island">Christmas Island</option>
859
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
860
+ <option value="Colombia">Colombia</option>
861
+ <option value="Comoros">Comoros</option>
862
+ <option value="Congo">Congo</option>
863
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
864
+ <option value="Cook Islands">Cook Islands</option>
865
+ <option value="Costa Rica">Costa Rica</option>
866
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
867
+ <option value="Croatia">Croatia</option>
868
+ <option value="Cuba">Cuba</option>
869
+ <option value="Curacao">Curacao</option>
870
+ <option value="Cyprus">Cyprus</option>
871
+ <option value="Czech Republic">Czech Republic</option>
872
+ <option value="Denmark">Denmark</option>
873
+ <option value="Djibouti">Djibouti</option>
874
+ <option value="Dominica">Dominica</option>
875
+ <option value="Dominican Republic">Dominican Republic</option>
876
+ <option value="Ecuador">Ecuador</option>
877
+ <option value="Egypt">Egypt</option>
878
+ <option value="El Salvador">El Salvador</option>
879
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
880
+ <option value="Eritrea">Eritrea</option>
881
+ <option value="Estonia">Estonia</option>
882
+ <option value="Ethiopia">Ethiopia</option>
883
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
884
+ <option value="Faroe Islands">Faroe Islands</option>
885
+ <option value="Fiji">Fiji</option>
886
+ <option value="Finland">Finland</option>
887
+ <option value="France">France</option>
888
+ <option value="French Guiana">French Guiana</option>
889
+ <option value="French Polynesia">French Polynesia</option>
890
+ <option value="French Southern Territories">French Southern Territories</option>
891
+ <option value="Gabon">Gabon</option>
892
+ <option value="Gambia">Gambia</option>
893
+ <option value="Georgia">Georgia</option>
894
+ <option value="Germany">Germany</option>
895
+ <option value="Ghana">Ghana</option>
896
+ <option value="Gibraltar">Gibraltar</option>
897
+ <option value="Greece">Greece</option>
898
+ <option value="Greenland">Greenland</option>
899
+ <option value="Grenada">Grenada</option>
900
+ <option value="Guadeloupe">Guadeloupe</option>
901
+ <option value="Guam">Guam</option>
902
+ <option value="Guatemala">Guatemala</option>
903
+ <option value="Guernsey">Guernsey</option>
904
+ <option value="Guinea">Guinea</option>
905
+ <option value="Guinea-bissau">Guinea-bissau</option>
906
+ <option value="Guyana">Guyana</option>
907
+ <option value="Haiti">Haiti</option>
908
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
909
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
910
+ <option value="Honduras">Honduras</option>
911
+ <option value="Hong Kong">Hong Kong</option>
912
+ <option value="Hungary">Hungary</option>
913
+ <option value="Iceland">Iceland</option>
914
+ <option value="India">India</option>
915
+ <option value="Indonesia">Indonesia</option>
916
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
917
+ <option value="Iraq">Iraq</option>
918
+ <option value="Ireland">Ireland</option>
919
+ <option value="Isle of Man">Isle of Man</option>
920
+ <option value="Israel">Israel</option>
921
+ <option value="Italy">Italy</option>
922
+ <option value="Jamaica">Jamaica</option>
923
+ <option value="Japan">Japan</option>
924
+ <option value="Jersey">Jersey</option>
925
+ <option value="Jordan">Jordan</option>
926
+ <option value="Kazakhstan">Kazakhstan</option>
927
+ <option value="Kenya">Kenya</option>
928
+ <option value="Kiribati">Kiribati</option>
929
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
930
+ <option value="Korea, Republic of">Korea, Republic of</option>
931
+ <option value="Kuwait">Kuwait</option>
932
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
933
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
934
+ <option value="Latvia">Latvia</option>
935
+ <option value="Lebanon">Lebanon</option>
936
+ <option value="Lesotho">Lesotho</option>
937
+ <option value="Liberia">Liberia</option>
938
+ <option value="Libya">Libya</option>
939
+ <option value="Liechtenstein">Liechtenstein</option>
940
+ <option value="Lithuania">Lithuania</option>
941
+ <option value="Luxembourg">Luxembourg</option>
942
+ <option value="Macao">Macao</option>
943
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
944
+ <option value="Madagascar">Madagascar</option>
945
+ <option value="Malawi">Malawi</option>
946
+ <option value="Malaysia">Malaysia</option>
947
+ <option value="Maldives">Maldives</option>
948
+ <option value="Mali">Mali</option>
949
+ <option value="Malta">Malta</option>
950
+ <option value="Marshall Islands">Marshall Islands</option>
951
+ <option value="Martinique">Martinique</option>
952
+ <option value="Mauritania">Mauritania</option>
953
+ <option value="Mauritius">Mauritius</option>
954
+ <option value="Mayotte">Mayotte</option>
955
+ <option value="Mexico">Mexico</option>
956
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
957
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
958
+ <option value="Monaco">Monaco</option>
959
+ <option value="Mongolia">Mongolia</option>
960
+ <option value="Montenegro">Montenegro</option>
961
+ <option value="Montserrat">Montserrat</option>
962
+ <option value="Morocco">Morocco</option>
963
+ <option value="Mozambique">Mozambique</option>
964
+ <option value="Myanmar">Myanmar</option>
965
+ <option value="Namibia">Namibia</option>
966
+ <option value="Nauru">Nauru</option>
967
+ <option value="Nepal">Nepal</option>
968
+ <option value="Netherlands">Netherlands</option>
969
+ <option value="New Caledonia">New Caledonia</option>
970
+ <option value="New Zealand">New Zealand</option>
971
+ <option value="Nicaragua">Nicaragua</option>
972
+ <option value="Niger">Niger</option>
973
+ <option value="Nigeria">Nigeria</option>
974
+ <option value="Niue">Niue</option>
975
+ <option value="Norfolk Island">Norfolk Island</option>
976
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
977
+ <option value="Norway">Norway</option>
978
+ <option value="Oman">Oman</option>
979
+ <option value="Pakistan">Pakistan</option>
980
+ <option value="Palau">Palau</option>
981
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
982
+ <option value="Panama">Panama</option>
983
+ <option value="Papua New Guinea">Papua New Guinea</option>
984
+ <option value="Paraguay">Paraguay</option>
985
+ <option value="Peru">Peru</option>
986
+ <option value="Philippines">Philippines</option>
987
+ <option value="Pitcairn">Pitcairn</option>
988
+ <option value="Poland">Poland</option>
989
+ <option value="Portugal">Portugal</option>
990
+ <option value="Puerto Rico">Puerto Rico</option>
991
+ <option value="Qatar">Qatar</option>
992
+ <option value="Reunion">Reunion</option>
993
+ <option value="Romania">Romania</option>
994
+ <option value="Russian Federation">Russian Federation</option>
995
+ <option value="Rwanda">Rwanda</option>
996
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
997
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
998
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
999
+ <option value="Saint Lucia">Saint Lucia</option>
1000
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1001
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1002
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1003
+ <option value="Samoa">Samoa</option>
1004
+ <option value="San Marino">San Marino</option>
1005
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1006
+ <option value="Saudi Arabia">Saudi Arabia</option>
1007
+ <option value="Senegal">Senegal</option>
1008
+ <option value="Serbia">Serbia</option>
1009
+ <option value="Seychelles">Seychelles</option>
1010
+ <option value="Sierra Leone">Sierra Leone</option>
1011
+ <option value="Singapore">Singapore</option>
1012
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1013
+ <option value="Slovakia">Slovakia</option>
1014
+ <option value="Slovenia">Slovenia</option>
1015
+ <option value="Solomon Islands">Solomon Islands</option>
1016
+ <option value="Somalia">Somalia</option>
1017
+ <option value="South Africa">South Africa</option>
1018
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1019
+ <option value="South Sudan">South Sudan</option>
1020
+ <option value="Spain">Spain</option>
1021
+ <option value="Sri Lanka">Sri Lanka</option>
1022
+ <option value="Sudan">Sudan</option>
1023
+ <option value="Suriname">Suriname</option>
1024
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1025
+ <option value="Swaziland">Swaziland</option>
1026
+ <option value="Sweden">Sweden</option>
1027
+ <option value="Switzerland">Switzerland</option>
1028
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1029
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1030
+ <option value="Tajikistan">Tajikistan</option>
1031
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1032
+ <option value="Thailand">Thailand</option>
1033
+ <option value="Timor-leste">Timor-leste</option>
1034
+ <option value="Togo">Togo</option>
1035
+ <option value="Tokelau">Tokelau</option>
1036
+ <option value="Tonga">Tonga</option>
1037
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1038
+ <option value="Tunisia">Tunisia</option>
1039
+ <option value="Turkey">Turkey</option>
1040
+ <option value="Turkmenistan">Turkmenistan</option>
1041
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1042
+ <option value="Tuvalu">Tuvalu</option>
1043
+ <option value="Uganda">Uganda</option>
1044
+ <option value="Ukraine">Ukraine</option>
1045
+ <option value="United Arab Emirates">United Arab Emirates</option>
1046
+ <option value="United Kingdom">United Kingdom</option>
1047
+ <option value="United States">United States</option>
1048
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1049
+ <option value="Uruguay">Uruguay</option>
1050
+ <option value="Uzbekistan">Uzbekistan</option>
1051
+ <option value="Vanuatu">Vanuatu</option>
1052
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1053
+ <option value="Viet Nam">Viet Nam</option>
1054
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
1055
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1056
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
1057
+ <option value="Western Sahara">Western Sahara</option>
1058
+ <option value="Yemen">Yemen</option>
1059
+ <option value="Zambia">Zambia</option>
1060
+ <option value="Zimbabwe">Zimbabwe</option>
1061
+ </select>
1062
+ </div>
1063
+ </div>
1064
+
1065
+ <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1066
+ <div class="side-by-side clearfix">
1067
+ <div>
1068
+ <em>Single Select with Groups</em>
1069
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1070
+ <option value=""></option>
1071
+ <optgroup label="NFC EAST">
1072
+ <option>Dallas Cowboys</option>
1073
+ <option>New York Giants</option>
1074
+ <option>Philadelphia Eagles</option>
1075
+ <option>Washington Redskins</option>
1076
+ </optgroup>
1077
+ <optgroup label="NFC NORTH">
1078
+ <option>Chicago Bears</option>
1079
+ <option>Detroit Lions</option>
1080
+ <option>Green Bay Packers</option>
1081
+ <option>Minnesota Vikings</option>
1082
+ </optgroup>
1083
+ <optgroup label="NFC SOUTH">
1084
+ <option>Atlanta Falcons</option>
1085
+ <option>Carolina Panthers</option>
1086
+ <option>New Orleans Saints</option>
1087
+ <option>Tampa Bay Buccaneers</option>
1088
+ </optgroup>
1089
+ <optgroup label="NFC WEST">
1090
+ <option>Arizona Cardinals</option>
1091
+ <option>St. Louis Rams</option>
1092
+ <option>San Francisco 49ers</option>
1093
+ <option>Seattle Seahawks</option>
1094
+ </optgroup>
1095
+ <optgroup label="AFC EAST">
1096
+ <option>Buffalo Bills</option>
1097
+ <option>Miami Dolphins</option>
1098
+ <option>New England Patriots</option>
1099
+ <option>New York Jets</option>
1100
+ </optgroup>
1101
+ <optgroup label="AFC NORTH">
1102
+ <option>Baltimore Ravens</option>
1103
+ <option>Cincinnati Bengals</option>
1104
+ <option>Cleveland Browns</option>
1105
+ <option>Pittsburgh Steelers</option>
1106
+ </optgroup>
1107
+ <optgroup label="AFC SOUTH">
1108
+ <option>Houston Texans</option>
1109
+ <option>Indianapolis Colts</option>
1110
+ <option>Jacksonville Jaguars</option>
1111
+ <option>Tennessee Titans</option>
1112
+ </optgroup>
1113
+ <optgroup label="AFC WEST">
1114
+ <option>Denver Broncos</option>
1115
+ <option>Kansas City Chiefs</option>
1116
+ <option>Oakland Raiders</option>
1117
+ <option>San Diego Chargers</option>
1118
+ </optgroup>
1119
+ </select>
1120
+ </div>
1121
+ <div>
1122
+ <em>Multiple Select with Groups</em>
1123
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1124
+ <option value=""></option>
1125
+ <optgroup label="NFC EAST">
1126
+ <option>Dallas Cowboys</option>
1127
+ <option>New York Giants</option>
1128
+ <option>Philadelphia Eagles</option>
1129
+ <option>Washington Redskins</option>
1130
+ </optgroup>
1131
+ <optgroup label="NFC NORTH">
1132
+ <option>Chicago Bears</option>
1133
+ <option>Detroit Lions</option>
1134
+ <option>Green Bay Packers</option>
1135
+ <option>Minnesota Vikings</option>
1136
+ </optgroup>
1137
+ <optgroup label="NFC SOUTH">
1138
+ <option>Atlanta Falcons</option>
1139
+ <option>Carolina Panthers</option>
1140
+ <option>New Orleans Saints</option>
1141
+ <option>Tampa Bay Buccaneers</option>
1142
+ </optgroup>
1143
+ <optgroup label="NFC WEST">
1144
+ <option>Arizona Cardinals</option>
1145
+ <option>St. Louis Rams</option>
1146
+ <option>San Francisco 49ers</option>
1147
+ <option>Seattle Seahawks</option>
1148
+ </optgroup>
1149
+ <optgroup label="AFC EAST">
1150
+ <option>Buffalo Bills</option>
1151
+ <option>Miami Dolphins</option>
1152
+ <option>New England Patriots</option>
1153
+ <option>New York Jets</option>
1154
+ </optgroup>
1155
+ <optgroup label="AFC NORTH">
1156
+ <option>Baltimore Ravens</option>
1157
+ <option>Cincinnati Bengals</option>
1158
+ <option>Cleveland Browns</option>
1159
+ <option>Pittsburgh Steelers</option>
1160
+ </optgroup>
1161
+ <optgroup label="AFC SOUTH">
1162
+ <option>Houston Texans</option>
1163
+ <option>Indianapolis Colts</option>
1164
+ <option>Jacksonville Jaguars</option>
1165
+ <option>Tennessee Titans</option>
1166
+ </optgroup>
1167
+ <optgroup label="AFC WEST">
1168
+ <option>Denver Broncos</option>
1169
+ <option>Kansas City Chiefs</option>
1170
+ <option>Oakland Raiders</option>
1171
+ <option>San Diego Chargers</option>
1172
+ </optgroup>
1173
+ </select>
1174
+ </div>
1175
+ </div>
1176
+
1177
+ <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1178
+ <div class="side-by-side clearfix">
1179
+ <p>Chosen automatically highlights selected options and removes disabled options.</p>
1180
+ <div>
1181
+ <em>Single Select</em>
1182
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1183
+ <option value=""></option>
1184
+ <option>American Black Bear</option>
1185
+ <option>Asiatic Black Bear</option>
1186
+ <option>Brown Bear</option>
1187
+ <option>Giant Panda</option>
1188
+ <option selected>Sloth Bear</option>
1189
+ <option disabled>Sun Bear</option>
1190
+ <option>Polar Bear</option>
1191
+ <option disabled>Spectacled Bear</option>
1192
+ </select>
1193
+ </div>
1194
+ <div>
1195
+ <em>Multiple Select</em>
1196
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1197
+ <option value=""></option>
1198
+ <option>American Black Bear</option>
1199
+ <option>Asiatic Black Bear</option>
1200
+ <option>Brown Bear</option>
1201
+ <option>Giant Panda</option>
1202
+ <option selected>Sloth Bear</option>
1203
+ <option disabled>Sun Bear</option>
1204
+ <option selected>Polar Bear</option>
1205
+ <option disabled>Spectacled Bear</option>
1206
+ </select>
1207
+ </div>
1208
+ </div>
1209
+
1210
+ <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1211
+ <div class="side-by-side clearfix">
1212
+ <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1213
+ <pre><code class="language-javascript"> new Chosen($("chosen_select_field"),{disable_search_threshold: 10}); </code></pre>
1214
+ <p></p>
1215
+ <div>
1216
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1217
+ <option value=""></option>
1218
+ <option>American Black Bear</option>
1219
+ <option>Asiatic Black Bear</option>
1220
+ <option>Brown Bear</option>
1221
+ <option>Giant Panda</option>
1222
+ <option selected disabled>Sloth Bear</option>
1223
+ <option disabled>Sun Bear</option>
1224
+ <option selected>Paddington Bear</option>
1225
+ <option selected>Polar Bear</option>
1226
+ <option disabled>Spectacled Bear</option>
1227
+ </select>
1228
+ </div>
1229
+ </div>
1230
+
1231
+ <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1232
+ <div class="side-by-side clearfix">
1233
+ <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1234
+ <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1235
+ <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1236
+ </div>
1237
+
1238
+ <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1239
+ <div class="side-by-side clearfix">
1240
+ <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1241
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{no_results_text: "Oops, nothing found!"}); </code></pre>
1242
+
1243
+ <div>
1244
+ <em>Single Select</em>
1245
+ <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1246
+ <option value=""></option>
1247
+ <option>American Black Bear</option>
1248
+ <option>Asiatic Black Bear</option>
1249
+ <option>Brown Bear</option>
1250
+ <option>Giant Panda</option>
1251
+ <option>Sloth Bear</option>
1252
+ <option>Sun Bear</option>
1253
+ <option>Polar Bear</option>
1254
+ <option>Spectacled Bear</option>
1255
+ </select>
1256
+ </div>
1257
+ <div>
1258
+ <em>Multiple Select</em>
1259
+ <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1260
+ <option value=""></option>
1261
+ <option>American Black Bear</option>
1262
+ <option>Asiatic Black Bear</option>
1263
+ <option>Brown Bear</option>
1264
+ <option>Giant Panda</option>
1265
+ <option>Sloth Bear</option>
1266
+ <option>Sun Bear</option>
1267
+ <option>Polar Bear</option>
1268
+ <option>Spectacled Bear</option>
1269
+ </select>
1270
+ </div>
1271
+ </div>
1272
+
1273
+ <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1274
+ <div class="side-by-side clearfix">
1275
+ <p>You can easily limit how many options the user can select:</p>
1276
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{max_selected_options: 5}); </code></pre>
1277
+ <p>If you try to select another option with limit reached <code>chosen:maxselected</code> event is triggered:</p>
1278
+ <pre><code class="language-javascript">$("chosen_select_field").observe("chosen:maxselected", function(evt) { ... }); </code></pre>
1279
+ </div>
1280
+
1281
+ <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1282
+ <div class="side-by-side clearfix">
1283
+ <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1284
+ <div class="side-by-side clearfix">
1285
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1286
+ <option value=""></option>
1287
+ <option>American Black Bear</option>
1288
+ <option>Asiatic Black Bear</option>
1289
+ <option>Brown Bear</option>
1290
+ <option>Giant Panda</option>
1291
+ <option selected>Sloth Bear</option>
1292
+ <option>Sun Bear</option>
1293
+ <option>Polar Bear</option>
1294
+ <option>Spectacled Bear</option>
1295
+ </select>
1296
+ </div>
1297
+ </div>
1298
+
1299
+ <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1300
+ <div class="side-by-side clearfix">
1301
+ <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1302
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1303
+ <div>
1304
+ <em>Single Right-to-Left Select</em>
1305
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
+ <option value=""></option>
1307
+ <option>American Black Bear</option>
1308
+ <option>Asiatic Black Bear</option>
1309
+ <option>Brown Bear</option>
1310
+ <option>Giant Panda</option>
1311
+ <option selected>Sloth Bear</option>
1312
+ <option>Polar Bear</option>
1313
+ </select>
1314
+ </div>
1315
+ <div>
1316
+ <em>Multiple Right-to-Left Select</em>
1317
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
+ <option value=""></option>
1319
+ <option>American Black Bear</option>
1320
+ <option>Asiatic Black Bear</option>
1321
+ <option>Brown Bear</option>
1322
+ <option>Giant Panda</option>
1323
+ <option selected>Sloth Bear</option>
1324
+ <option selected>Polar Bear</option>
1325
+ </select>
1326
+ </div>
1327
+ </div>
1328
+
1329
+ <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
+ <div class="side-by-side clearfix">
1331
+ <ul>
1332
+ <li>
1333
+ <h3>Observing Form Field Changes</h3>
1334
+ <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
+ <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
+ <p><strong>Note:</strong> Prototype doesn't offer support for triggering standard browser events. <a href="https://github.com/kangax/protolicious/blob/5b56fdafcd7d7662c9d648534225039b2e78e371/event.simulate.js">Event.simulate</a> is required to trigger the change event when using the Prototype version.</p>
1337
+ </li>
1338
+ <li>
1339
+ <h3>Updating Chosen Dynamically</h3>
1340
+ <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1341
+ <pre><code class="language-javascript">Event.fire($("form_field"), "chosen:updated");</code></pre>
1342
+ </li>
1343
+ <li>
1344
+ <h3>Destroying Chosen</h3>
1345
+ <p>To destroy Chosen and revert back to the native select, call <code class="language-javascript">destroy</code> on the Chosen instance:</p>
1346
+ <pre><code class="language-javascript">chosen = new Chosen($("form_field"));
1347
+
1348
+ // ...later
1349
+ chosen.destroy();</code></pre>
1350
+ </li>
1351
+ </ul>
1352
+ </div>
1353
+
1354
+ <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1355
+ <div class="side-by-side clearfix">
1356
+ <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1357
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{width: "95%"}); </code></pre>
1358
+ <div>
1359
+ <em>Single Select</em>
1360
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1361
+ <option value=""></option>
1362
+ <option selected>American Black Bear</option>
1363
+ <option>Asiatic Black Bear</option>
1364
+ <option>Brown Bear</option>
1365
+ <option>Giant Panda</option>
1366
+ <option>Sloth Bear</option>
1367
+ <option>Sun Bear</option>
1368
+ <option>Polar Bear</option>
1369
+ <option>Spectacled Bear</option>
1370
+ </select>
1371
+ </div>
1372
+ <div>
1373
+ <em>Multiple Select</em>
1374
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1375
+ <option value=""></option>
1376
+ <option>American Black Bear</option>
1377
+ <option>Asiatic Black Bear</option>
1378
+ <option>Brown Bear</option>
1379
+ <option selected>Giant Panda</option>
1380
+ <option>Sloth Bear</option>
1381
+ <option>Sun Bear</option>
1382
+ <option>Polar Bear</option>
1383
+ <option>Spectacled Bear</option>
1384
+ </select>
1385
+ </div>
1386
+ </div>
1387
+
1388
+ <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1389
+ <div class="side-by-side clearfix">
1390
+ <p>Use labels just like you would a standard select</p>
1391
+ <p></p>
1392
+ <div>
1393
+ <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1394
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1395
+ <option value=""></option>
1396
+ <option selected>American Black Bear</option>
1397
+ <option>Asiatic Black Bear</option>
1398
+ <option>Brown Bear</option>
1399
+ <option>Giant Panda</option>
1400
+ <option>Sloth Bear</option>
1401
+ <option>Sun Bear</option>
1402
+ <option>Polar Bear</option>
1403
+ <option>Spectacled Bear</option>
1404
+ </select>
1405
+ </div>
1406
+ <div>
1407
+ <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1408
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1409
+ <option value=""></option>
1410
+ <option>American Black Bear</option>
1411
+ <option>Asiatic Black Bear</option>
1412
+ <option>Brown Bear</option>
1413
+ <option selected>Giant Panda</option>
1414
+ <option>Sloth Bear</option>
1415
+ <option>Sun Bear</option>
1416
+ <option>Polar Bear</option>
1417
+ <option>Spectacled Bear</option>
1418
+ </select>
1419
+ </div>
1420
+ </div>
1421
+
1422
+ <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1423
+ <p>Using Chosen is easy as can be.</p>
1424
+ <ol>
1425
+ <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1426
+ <li>Activate the plugin by creating a new instance of Chosen: New Chosen(<em>some_form_field</em>,<em>some_options</em>);</li>
1427
+ <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1428
+ </ol>
1429
+
1430
+ <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1431
+ <ul class="faqs">
1432
+ <li>
1433
+ <h3>Do you have all the available options documented somewhere?</h3>
1434
+ <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1435
+ </li>
1436
+ <li>
1437
+ <h3>Something doesn't work. Can you fix it?</h3>
1438
+ <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1439
+ </li>
1440
+ <li>
1441
+ <h3>What browsers are supported?</h3>
1442
+ <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1443
+ </li>
1444
+ </ul>
1445
+
1446
+ <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
+
1448
+ <ul class="credits">
1449
+ <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
+ <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
+ <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
+ <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
+ </ul>
1454
+
1455
+ <footer>
1456
+ &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
+ </footer>
1458
+
1459
+ </div>
1460
+ </div>
1461
+ <script src="docsupport/prototype-1.7.0.0.js" type="text/javascript"></script>
1462
+ <script src="chosen.proto.js" type="text/javascript"></script>
1463
+ <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
+ <script src="docsupport/init.proto.js" type="text/javascript" charset="utf-8"></script>
1465
+ <div class="oss-bar">
1466
+ <ul>
1467
+ <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1468
+ <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1469
+ </ul>
1470
+ </div>
1471
+ </body>
1472
+ </html>
common/libs/chosen-v1.8.3/docsupport/chosen.png ADDED
Binary file
common/libs/chosen-v1.8.3/docsupport/init.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ var config = {
2
+ '.chosen-select' : { create_option: true, skip_no_results: true },
3
+ '.chosen-select-deselect' : { allow_single_deselect: true },
4
+ '.chosen-select-no-single' : { disable_search_threshold: 10 },
5
+ '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
6
+ '.chosen-select-rtl' : { rtl: true },
7
+ '.chosen-select-width' : { width: '95%' }
8
+ }
9
+ for (var selector in config) {
10
+ $(selector).chosen(config[selector]);
11
+ }
common/libs/chosen-v1.8.3/docsupport/init.proto.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.observe('dom:loaded', function(evt) {
2
+ var config = {
3
+ '.chosen-select' : { create_option: true, skip_no_results: true },
4
+ '.chosen-select-deselect' : { allow_single_deselect: true },
5
+ '.chosen-select-no-single' : { disable_search_threshold: 10 },
6
+ '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
7
+ '.chosen-select-rtl' : { rtl: true },
8
+ '.chosen-select-width' : { width: '95%' }
9
+ }
10
+
11
+ for (var selector in config) {
12
+ $$(selector).each(function(element) {
13
+ new Chosen(element, config[selector]);
14
+ });
15
+ }
16
+ });
common/libs/chosen-v1.8.3/docsupport/jquery-1.12.4.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
2
+ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
3
+ }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
4
+ marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({
5
+ padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
common/libs/chosen-v1.8.3/docsupport/jquery-3.2.1.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
2
+ !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
3
+ a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
4
+ null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
common/libs/chosen-v1.8.3/docsupport/oss-credit.png ADDED
Binary file
common/libs/chosen-v1.8.3/docsupport/prism.css ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * okaidia theme for JavaScript, CSS and HTML
3
+ * Loosely based on Monokai textmate theme by http://www.monokai.nl/
4
+ * @author ocodia
5
+ */
6
+
7
+ code[class*="language-"],
8
+ pre[class*="language-"] {
9
+ color: #f8f8f2;
10
+ text-shadow: 0 1px rgba(0,0,0,0.3);
11
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
12
+ direction: ltr;
13
+ text-align: left;
14
+ white-space: pre;
15
+ word-spacing: normal;
16
+
17
+ -moz-tab-size: 4;
18
+ -o-tab-size: 4;
19
+ tab-size: 4;
20
+
21
+ -webkit-hyphens: none;
22
+ -moz-hyphens: none;
23
+ -ms-hyphens: none;
24
+ hyphens: none;
25
+ }
26
+
27
+ /* Code blocks */
28
+ pre[class*="language-"] {
29
+ padding: 1em;
30
+ margin: .5em 0;
31
+ overflow: auto;
32
+ border-radius: 0.3em;
33
+ }
34
+
35
+ :not(pre) > code[class*="language-"],
36
+ pre[class*="language-"] {
37
+ background: #272822;
38
+ }
39
+
40
+ /* Inline code */
41
+ :not(pre) > code[class*="language-"] {
42
+ padding: .1em;
43
+ border-radius: .3em;
44
+ }
45
+
46
+ .token.comment,
47
+ .token.prolog,
48
+ .token.doctype,
49
+ .token.cdata {
50
+ color: slategray;
51
+ }
52
+
53
+ .token.punctuation {
54
+ color: #f8f8f2;
55
+ }
56
+
57
+ .namespace {
58
+ opacity: .7;
59
+ }
60
+
61
+ .token.property,
62
+ .token.tag {
63
+ color: #f92672;
64
+ }
65
+
66
+ .token.boolean,
67
+ .token.number{
68
+ color: #ae81ff;
69
+ }
70
+
71
+ .token.selector,
72
+ .token.attr-name,
73
+ .token.string {
74
+ color: #a6e22e;
75
+ }
76
+
77
+
78
+ .token.operator,
79
+ .token.entity,
80
+ .token.url,
81
+ .language-css .token.string,
82
+ .style .token.string {
83
+ color: #f8f8f2;
84
+ }
85
+
86
+ .token.atrule,
87
+ .token.attr-value
88
+ {
89
+ color: #e6db74;
90
+ }
91
+
92
+
93
+ .token.keyword{
94
+ color: #66d9ef;
95
+ }
96
+
97
+ .token.regex,
98
+ .token.important {
99
+ color: #fd971f;
100
+ }
101
+
102
+ .token.important {
103
+ font-weight: bold;
104
+ }
105
+
106
+ .token.entity {
107
+ cursor: help;
108
+ }
common/libs/chosen-v1.8.3/docsupport/prism.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Prism: Lightweight, robust, elegant syntax highlighting
3
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
4
+ * @author Lea Verou http://lea.verou.me
5
+ */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
6
+ Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
7
+ Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
8
+ Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
9
+ Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
common/libs/chosen-v1.8.3/docsupport/prototype-1.7.0.0.js ADDED
@@ -0,0 +1,6082 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Prototype JavaScript framework, version 1.7
2
+ * (c) 2005-2010 Sam Stephenson
3
+ *
4
+ * Prototype is freely distributable under the terms of an MIT-style license.
5
+ * For details, see the Prototype web site: http://www.prototypejs.org/
6
+ *
7
+ *--------------------------------------------------------------------------*/
8
+
9
+ var Prototype = {
10
+
11
+ Version: '1.7',
12
+
13
+ Browser: (function(){
14
+ var ua = navigator.userAgent;
15
+ var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
16
+ return {
17
+ IE: !!window.attachEvent && !isOpera,
18
+ Opera: isOpera,
19
+ WebKit: ua.indexOf('AppleWebKit/') > -1,
20
+ Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
21
+ MobileSafari: /Apple.*Mobile/.test(ua)
22
+ }
23
+ })(),
24
+
25
+ BrowserFeatures: {
26
+ XPath: !!document.evaluate,
27
+
28
+ SelectorsAPI: !!document.querySelector,
29
+
30
+ ElementExtensions: (function() {
31
+ var constructor = window.Element || window.HTMLElement;
32
+ return !!(constructor && constructor.prototype);
33
+ })(),
34
+ SpecificElementExtensions: (function() {
35
+ if (typeof window.HTMLDivElement !== 'undefined')
36
+ return true;
37
+
38
+ var div = document.createElement('div'),
39
+ form = document.createElement('form'),
40
+ isSupported = false;
41
+
42
+ if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
43
+ isSupported = true;
44
+ }
45
+
46
+ div = form = null;
47
+
48
+ return isSupported;
49
+ })()
50
+ },
51
+
52
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
53
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
54
+
55
+ emptyFunction: function() { },
56
+
57
+ K: function(x) { return x }
58
+ };
59
+
60
+ if (Prototype.Browser.MobileSafari)
61
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
62
+
63
+
64
+ var Abstract = { };
65
+
66
+
67
+ var Try = {
68
+ these: function() {
69
+ var returnValue;
70
+
71
+ for (var i = 0, length = arguments.length; i < length; i++) {
72
+ var lambda = arguments[i];
73
+ try {
74
+ returnValue = lambda();
75
+ break;
76
+ } catch (e) { }
77
+ }
78
+
79
+ return returnValue;
80
+ }
81
+ };
82
+
83
+ /* Based on Alex Arnell's inheritance implementation. */
84
+
85
+ var Class = (function() {
86
+
87
+ var IS_DONTENUM_BUGGY = (function(){
88
+ for (var p in { toString: 1 }) {
89
+ if (p === 'toString') return false;
90
+ }
91
+ return true;
92
+ })();
93
+
94
+ function subclass() {};
95
+ function create() {
96
+ var parent = null, properties = $A(arguments);
97
+ if (Object.isFunction(properties[0]))
98
+ parent = properties.shift();
99
+
100
+ function klass() {
101
+ this.initialize.apply(this, arguments);
102
+ }
103
+
104
+ Object.extend(klass, Class.Methods);
105
+ klass.superclass = parent;
106
+ klass.subclasses = [];
107
+
108
+ if (parent) {
109
+ subclass.prototype = parent.prototype;
110
+ klass.prototype = new subclass;
111
+ parent.subclasses.push(klass);
112
+ }
113
+
114
+ for (var i = 0, length = properties.length; i < length; i++)
115
+ klass.addMethods(properties[i]);
116
+
117
+ if (!klass.prototype.initialize)
118
+ klass.prototype.initialize = Prototype.emptyFunction;
119
+
120
+ klass.prototype.constructor = klass;
121
+ return klass;
122
+ }
123
+
124
+ function addMethods(source) {
125
+ var ancestor = this.superclass && this.superclass.prototype,
126
+ properties = Object.keys(source);
127
+
128
+ if (IS_DONTENUM_BUGGY) {
129
+ if (source.toString != Object.prototype.toString)
130
+ properties.push("toString");
131
+ if (source.valueOf != Object.prototype.valueOf)
132
+ properties.push("valueOf");
133
+ }
134
+
135
+ for (var i = 0, length = properties.length; i < length; i++) {
136
+ var property = properties[i], value = source[property];
137
+ if (ancestor && Object.isFunction(value) &&
138
+ value.argumentNames()[0] == "$super") {
139
+ var method = value;
140
+ value = (function(m) {
141
+ return function() { return ancestor[m].apply(this, arguments); };
142
+ })(property).wrap(method);
143
+
144
+ value.valueOf = method.valueOf.bind(method);
145
+ value.toString = method.toString.bind(method);
146
+ }
147
+ this.prototype[property] = value;
148
+ }
149
+
150
+ return this;
151
+ }
152
+
153
+ return {
154
+ create: create,
155
+ Methods: {
156
+ addMethods: addMethods
157
+ }
158
+ };
159
+ })();
160
+ (function() {
161
+
162
+ var _toString = Object.prototype.toString,
163
+ NULL_TYPE = 'Null',
164
+ UNDEFINED_TYPE = 'Undefined',
165
+ BOOLEAN_TYPE = 'Boolean',
166
+ NUMBER_TYPE = 'Number',
167
+ STRING_TYPE = 'String',
168
+ OBJECT_TYPE = 'Object',
169
+ FUNCTION_CLASS = '[object Function]',
170
+ BOOLEAN_CLASS = '[object Boolean]',
171
+ NUMBER_CLASS = '[object Number]',
172
+ STRING_CLASS = '[object String]',
173
+ ARRAY_CLASS = '[object Array]',
174
+ DATE_CLASS = '[object Date]',
175
+ NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
176
+ typeof JSON.stringify === 'function' &&
177
+ JSON.stringify(0) === '0' &&
178
+ typeof JSON.stringify(Prototype.K) === 'undefined';
179
+
180
+ function Type(o) {
181
+ switch(o) {
182
+ case null: return NULL_TYPE;
183
+ case (void 0): return UNDEFINED_TYPE;
184
+ }
185
+ var type = typeof o;
186
+ switch(type) {
187
+ case 'boolean': return BOOLEAN_TYPE;
188
+ case 'number': return NUMBER_TYPE;
189
+ case 'string': return STRING_TYPE;
190
+ }
191
+ return OBJECT_TYPE;
192
+ }
193
+
194
+ function extend(destination, source) {
195
+ for (var property in source)
196
+ destination[property] = source[property];
197
+ return destination;
198
+ }
199
+
200
+ function inspect(object) {
201
+ try {
202
+ if (isUndefined(object)) return 'undefined';
203
+ if (object === null) return 'null';
204
+ return object.inspect ? object.inspect() : String(object);
205
+ } catch (e) {
206
+ if (e instanceof RangeError) return '...';
207
+ throw e;
208
+ }
209
+ }
210
+
211
+ function toJSON(value) {
212
+ return Str('', { '': value }, []);
213
+ }
214
+
215
+ function Str(key, holder, stack) {
216
+ var value = holder[key],
217
+ type = typeof value;
218
+
219
+ if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
220
+ value = value.toJSON(key);
221
+ }
222
+
223
+ var _class = _toString.call(value);
224
+
225
+ switch (_class) {
226
+ case NUMBER_CLASS:
227
+ case BOOLEAN_CLASS:
228
+ case STRING_CLASS:
229
+ value = value.valueOf();
230
+ }
231
+
232
+ switch (value) {
233
+ case null: return 'null';
234
+ case true: return 'true';
235
+ case false: return 'false';
236
+ }
237
+
238
+ type = typeof value;
239
+ switch (type) {
240
+ case 'string':
241
+ return value.inspect(true);
242
+ case 'number':
243
+ return isFinite(value) ? String(value) : 'null';
244
+ case 'object':
245
+
246
+ for (var i = 0, length = stack.length; i < length; i++) {
247
+ if (stack[i] === value) { throw new TypeError(); }
248
+ }
249
+ stack.push(value);
250
+
251
+ var partial = [];
252
+ if (_class === ARRAY_CLASS) {
253
+ for (var i = 0, length = value.length; i < length; i++) {
254
+ var str = Str(i, value, stack);
255
+ partial.push(typeof str === 'undefined' ? 'null' : str);
256
+ }
257
+ partial = '[' + partial.join(',') + ']';
258
+ } else {
259
+ var keys = Object.keys(value);
260
+ for (var i = 0, length = keys.length; i < length; i++) {
261
+ var key = keys[i], str = Str(key, value, stack);
262
+ if (typeof str !== "undefined") {
263
+ partial.push(key.inspect(true)+ ':' + str);
264
+ }
265
+ }
266
+ partial = '{' + partial.join(',') + '}';
267
+ }
268
+ stack.pop();
269
+ return partial;
270
+ }
271
+ }
272
+
273
+ function stringify(object) {
274
+ return JSON.stringify(object);
275
+ }
276
+
277
+ function toQueryString(object) {
278
+ return $H(object).toQueryString();
279
+ }
280
+
281
+ function toHTML(object) {
282
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
283
+ }
284
+
285
+ function keys(object) {
286
+ if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
287
+ var results = [];
288
+ for (var property in object) {
289
+ if (object.hasOwnProperty(property)) {
290
+ results.push(property);
291
+ }
292
+ }
293
+ return results;
294
+ }
295
+
296
+ function values(object) {
297
+ var results = [];
298
+ for (var property in object)
299
+ results.push(object[property]);
300
+ return results;
301
+ }
302
+
303
+ function clone(object) {
304
+ return extend({ }, object);
305
+ }
306
+
307
+ function isElement(object) {
308
+ return !!(object && object.nodeType == 1);
309
+ }
310
+
311
+ function isArray(object) {
312
+ return _toString.call(object) === ARRAY_CLASS;
313
+ }
314
+
315
+ var hasNativeIsArray = (typeof Array.isArray == 'function')
316
+ && Array.isArray([]) && !Array.isArray({});
317
+
318
+ if (hasNativeIsArray) {
319
+ isArray = Array.isArray;
320
+ }
321
+
322
+ function isHash(object) {
323
+ return object instanceof Hash;
324
+ }
325
+
326
+ function isFunction(object) {
327
+ return _toString.call(object) === FUNCTION_CLASS;
328
+ }
329
+
330
+ function isString(object) {
331
+ return _toString.call(object) === STRING_CLASS;
332
+ }
333
+
334
+ function isNumber(object) {
335
+ return _toString.call(object) === NUMBER_CLASS;
336
+ }
337
+
338
+ function isDate(object) {
339
+ return _toString.call(object) === DATE_CLASS;
340
+ }
341
+
342
+ function isUndefined(object) {
343
+ return typeof object === "undefined";
344
+ }
345
+
346
+ extend(Object, {
347
+ extend: extend,
348
+ inspect: inspect,
349
+ toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
350
+ toQueryString: toQueryString,
351
+ toHTML: toHTML,
352
+ keys: Object.keys || keys,
353
+ values: values,
354
+ clone: clone,
355
+ isElement: isElement,
356
+ isArray: isArray,
357
+ isHash: isHash,
358
+ isFunction: isFunction,
359
+ isString: isString,
360
+ isNumber: isNumber,
361
+ isDate: isDate,
362
+ isUndefined: isUndefined
363
+ });
364
+ })();
365
+ Object.extend(Function.prototype, (function() {
366
+ var slice = Array.prototype.slice;
367
+
368
+ function update(array, args) {
369
+ var arrayLength = array.length, length = args.length;
370
+ while (length--) array[arrayLength + length] = args[length];
371
+ return array;
372
+ }
373
+
374
+ function merge(array, args) {
375
+ array = slice.call(array, 0);
376
+ return update(array, args);
377
+ }
378
+
379
+ function argumentNames() {
380
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
381
+ .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
382
+ .replace(/\s+/g, '').split(',');
383
+ return names.length == 1 && !names[0] ? [] : names;
384
+ }
385
+
386
+ function bind(context) {
387
+ if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
388
+ var __method = this, args = slice.call(arguments, 1);
389
+ return function() {
390
+ var a = merge(args, arguments);
391
+ return __method.apply(context, a);
392
+ }
393
+ }
394
+
395
+ function bindAsEventListener(context) {
396
+ var __method = this, args = slice.call(arguments, 1);
397
+ return function(event) {
398
+ var a = update([event || window.event], args);
399
+ return __method.apply(context, a);
400
+ }
401
+ }
402
+
403
+ function curry() {
404
+ if (!arguments.length) return this;
405
+ var __method = this, args = slice.call(arguments, 0);
406
+ return function() {
407
+ var a = merge(args, arguments);
408
+ return __method.apply(this, a);
409
+ }
410
+ }
411
+
412
+ function delay(timeout) {
413
+ var __method = this, args = slice.call(arguments, 1);
414
+ timeout = timeout * 1000;
415
+ return window.setTimeout(function() {
416
+ return __method.apply(__method, args);
417
+ }, timeout);
418
+ }
419
+
420
+ function defer() {
421
+ var args = update([0.01], arguments);
422
+ return this.delay.apply(this, args);
423
+ }
424
+
425
+ function wrap(wrapper) {
426
+ var __method = this;
427
+ return function() {
428
+ var a = update([__method.bind(this)], arguments);
429
+ return wrapper.apply(this, a);
430
+ }
431
+ }
432
+
433
+ function methodize() {
434
+ if (this._methodized) return this._methodized;
435
+ var __method = this;
436
+ return this._methodized = function() {
437
+ var a = update([this], arguments);
438
+ return __method.apply(null, a);
439
+ };
440
+ }
441
+
442
+ return {
443
+ argumentNames: argumentNames,
444
+ bind: bind,
445
+ bindAsEventListener: bindAsEventListener,
446
+ curry: curry,
447
+ delay: delay,
448
+ defer: defer,
449
+ wrap: wrap,
450
+ methodize: methodize
451
+ }
452
+ })());
453
+
454
+
455
+
456
+ (function(proto) {
457
+
458
+
459
+ function toISOString() {
460
+ return this.getUTCFullYear() + '-' +
461
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
462
+ this.getUTCDate().toPaddedString(2) + 'T' +
463
+ this.getUTCHours().toPaddedString(2) + ':' +
464
+ this.getUTCMinutes().toPaddedString(2) + ':' +
465
+ this.getUTCSeconds().toPaddedString(2) + 'Z';
466
+ }
467
+
468
+
469
+ function toJSON() {
470
+ return this.toISOString();
471
+ }
472
+
473
+ if (!proto.toISOString) proto.toISOString = toISOString;
474
+ if (!proto.toJSON) proto.toJSON = toJSON;
475
+
476
+ })(Date.prototype);
477
+
478
+
479
+ RegExp.prototype.match = RegExp.prototype.test;
480
+
481
+ RegExp.escape = function(str) {
482
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
483
+ };
484
+ var PeriodicalExecuter = Class.create({
485
+ initialize: function(callback, frequency) {
486
+ this.callback = callback;
487
+ this.frequency = frequency;
488
+ this.currentlyExecuting = false;
489
+
490
+ this.registerCallback();
491
+ },
492
+
493
+ registerCallback: function() {
494
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
495
+ },
496
+
497
+ execute: function() {
498
+ this.callback(this);
499
+ },
500
+
501
+ stop: function() {
502
+ if (!this.timer) return;
503
+ clearInterval(this.timer);
504
+ this.timer = null;
505
+ },
506
+
507
+ onTimerEvent: function() {
508
+ if (!this.currentlyExecuting) {
509
+ try {
510
+ this.currentlyExecuting = true;
511
+ this.execute();
512
+ this.currentlyExecuting = false;
513
+ } catch(e) {
514
+ this.currentlyExecuting = false;
515
+ throw e;
516
+ }
517
+ }
518
+ }
519
+ });
520
+ Object.extend(String, {
521
+ interpret: function(value) {
522
+ return value == null ? '' : String(value);
523
+ },
524
+ specialChar: {
525
+ '\b': '\\b',
526
+ '\t': '\\t',
527
+ '\n': '\\n',
528
+ '\f': '\\f',
529
+ '\r': '\\r',
530
+ '\\': '\\\\'
531
+ }
532
+ });
533
+
534
+ Object.extend(String.prototype, (function() {
535
+ var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
536
+ typeof JSON.parse === 'function' &&
537
+ JSON.parse('{"test": true}').test;
538
+
539
+ function prepareReplacement(replacement) {
540
+ if (Object.isFunction(replacement)) return replacement;
541
+ var template = new Template(replacement);
542
+ return function(match) { return template.evaluate(match) };
543
+ }
544
+
545
+ function gsub(pattern, replacement) {
546
+ var result = '', source = this, match;
547
+ replacement = prepareReplacement(replacement);
548
+
549
+ if (Object.isString(pattern))
550
+ pattern = RegExp.escape(pattern);
551
+
552
+ if (!(pattern.length || pattern.source)) {
553
+ replacement = replacement('');
554
+ return replacement + source.split('').join(replacement) + replacement;
555
+ }
556
+
557
+ while (source.length > 0) {
558
+ if (match = source.match(pattern)) {
559
+ result += source.slice(0, match.index);
560
+ result += String.interpret(replacement(match));
561
+ source = source.slice(match.index + match[0].length);
562
+ } else {
563
+ result += source, source = '';
564
+ }
565
+ }
566
+ return result;
567
+ }
568
+
569
+ function sub(pattern, replacement, count) {
570
+ replacement = prepareReplacement(replacement);
571
+ count = Object.isUndefined(count) ? 1 : count;
572
+
573
+ return this.gsub(pattern, function(match) {
574
+ if (--count < 0) return match[0];
575
+ return replacement(match);
576
+ });
577
+ }
578
+
579
+ function scan(pattern, iterator) {
580
+ this.gsub(pattern, iterator);
581
+ return String(this);
582
+ }
583
+
584
+ function truncate(length, truncation) {
585
+ length = length || 30;
586
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
587
+ return this.length > length ?
588
+ this.slice(0, length - truncation.length) + truncation : String(this);
589
+ }
590
+
591
+ function strip() {
592
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
593
+ }
594
+
595
+ function stripTags() {
596
+ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
597
+ }
598
+
599
+ function stripScripts() {
600
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
601
+ }
602
+
603
+ function extractScripts() {
604
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
605
+ matchOne = new RegExp(Prototype.ScriptFragment, 'im');
606
+ return (this.match(matchAll) || []).map(function(scriptTag) {
607
+ return (scriptTag.match(matchOne) || ['', ''])[1];
608
+ });
609
+ }
610
+
611
+ function evalScripts() {
612
+ return this.extractScripts().map(function(script) { return eval(script) });
613
+ }
614
+
615
+ function escapeHTML() {
616
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
617
+ }
618
+
619
+ function unescapeHTML() {
620
+ return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
621
+ }
622
+
623
+
624
+ function toQueryParams(separator) {
625
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
626
+ if (!match) return { };
627
+
628
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
629
+ if ((pair = pair.split('='))[0]) {
630
+ var key = decodeURIComponent(pair.shift()),
631
+ value = pair.length > 1 ? pair.join('=') : pair[0];
632
+
633
+ if (value != undefined) value = decodeURIComponent(value);
634
+
635
+ if (key in hash) {
636
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
637
+ hash[key].push(value);
638
+ }
639
+ else hash[key] = value;
640
+ }
641
+ return hash;
642
+ });
643
+ }
644
+
645
+ function toArray() {
646
+ return this.split('');
647
+ }
648
+
649
+ function succ() {
650
+ return this.slice(0, this.length - 1) +
651
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
652
+ }
653
+
654
+ function times(count) {
655
+ return count < 1 ? '' : new Array(count + 1).join(this);
656
+ }
657
+
658
+ function camelize() {
659
+ return this.replace(/-+(.)?/g, function(match, chr) {
660
+ return chr ? chr.toUpperCase() : '';
661
+ });
662
+ }
663
+
664
+ function capitalize() {
665
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
666
+ }
667
+
668
+ function underscore() {
669
+ return this.replace(/::/g, '/')
670
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
671
+ .replace(/([a-z\d])([A-Z])/g, '$1_$2')
672
+ .replace(/-/g, '_')
673
+ .toLowerCase();
674
+ }
675
+
676
+ function dasherize() {
677
+ return this.replace(/_/g, '-');
678
+ }
679
+
680
+ function inspect(useDoubleQuotes) {
681
+ var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
682
+ if (character in String.specialChar) {
683
+ return String.specialChar[character];
684
+ }
685
+ return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
686
+ });
687
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
688
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
689
+ }
690
+
691
+ function unfilterJSON(filter) {
692
+ return this.replace(filter || Prototype.JSONFilter, '$1');
693
+ }
694
+
695
+ function isJSON() {
696
+ var str = this;
697
+ if (str.blank()) return false;
698
+ str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
699
+ str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
700
+ str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
701
+ return (/^[\],:{}\s]*$/).test(str);
702
+ }
703
+
704
+ function evalJSON(sanitize) {
705
+ var json = this.unfilterJSON(),
706
+ cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
707
+ if (cx.test(json)) {
708
+ json = json.replace(cx, function (a) {
709
+ return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
710
+ });
711
+ }
712
+ try {
713
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
714
+ } catch (e) { }
715
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
716
+ }
717
+
718
+ function parseJSON() {
719
+ var json = this.unfilterJSON();
720
+ return JSON.parse(json);
721
+ }
722
+
723
+ function include(pattern) {
724
+ return this.indexOf(pattern) > -1;
725
+ }
726
+
727
+ function startsWith(pattern) {
728
+ return this.lastIndexOf(pattern, 0) === 0;
729
+ }
730
+
731
+ function endsWith(pattern) {
732
+ var d = this.length - pattern.length;
733
+ return d >= 0 && this.indexOf(pattern, d) === d;
734
+ }
735
+
736
+ function empty() {
737
+ return this == '';
738
+ }
739
+
740
+ function blank() {
741
+ return /^\s*$/.test(this);
742
+ }
743
+
744
+ function interpolate(object, pattern) {
745
+ return new Template(this, pattern).evaluate(object);
746
+ }
747
+
748
+ return {
749
+ gsub: gsub,
750
+ sub: sub,
751
+ scan: scan,
752
+ truncate: truncate,
753
+ strip: String.prototype.trim || strip,
754
+ stripTags: stripTags,
755
+ stripScripts: stripScripts,
756
+ extractScripts: extractScripts,
757
+ evalScripts: evalScripts,
758
+ escapeHTML: escapeHTML,
759
+ unescapeHTML: unescapeHTML,
760
+ toQueryParams: toQueryParams,
761
+ parseQuery: toQueryParams,
762
+ toArray: toArray,
763
+ succ: succ,
764
+ times: times,
765
+ camelize: camelize,
766
+ capitalize: capitalize,
767
+ underscore: underscore,
768
+ dasherize: dasherize,
769
+ inspect: inspect,
770
+ unfilterJSON: unfilterJSON,
771
+ isJSON: isJSON,
772
+ evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
773
+ include: include,
774
+ startsWith: startsWith,
775
+ endsWith: endsWith,
776
+ empty: empty,
777
+ blank: blank,
778
+ interpolate: interpolate
779
+ };
780
+ })());
781
+
782
+ var Template = Class.create({
783
+ initialize: function(template, pattern) {
784
+ this.template = template.toString();
785
+ this.pattern = pattern || Template.Pattern;
786
+ },
787
+
788
+ evaluate: function(object) {
789
+ if (object && Object.isFunction(object.toTemplateReplacements))
790
+ object = object.toTemplateReplacements();
791
+
792
+ return this.template.gsub(this.pattern, function(match) {
793
+ if (object == null) return (match[1] + '');
794
+
795
+ var before = match[1] || '';
796
+ if (before == '\\') return match[2];
797
+
798
+ var ctx = object, expr = match[3],
799
+ pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
800
+
801
+ match = pattern.exec(expr);
802
+ if (match == null) return before;
803
+
804
+ while (match != null) {
805
+ var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
806
+ ctx = ctx[comp];
807
+ if (null == ctx || '' == match[3]) break;
808
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
809
+ match = pattern.exec(expr);
810
+ }
811
+
812
+ return before + String.interpret(ctx);
813
+ });
814
+ }
815
+ });
816
+ Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
817
+
818
+ var $break = { };
819
+
820
+ var Enumerable = (function() {
821
+ function each(iterator, context) {
822
+ var index = 0;
823
+ try {
824
+ this._each(function(value) {
825
+ iterator.call(context, value, index++);
826
+ });
827
+ } catch (e) {
828
+ if (e != $break) throw e;
829
+ }
830
+ return this;
831
+ }
832
+
833
+ function eachSlice(number, iterator, context) {
834
+ var index = -number, slices = [], array = this.toArray();
835
+ if (number < 1) return array;
836
+ while ((index += number) < array.length)
837
+ slices.push(array.slice(index, index+number));
838
+ return slices.collect(iterator, context);
839
+ }
840
+
841
+ function all(iterator, context) {
842
+ iterator = iterator || Prototype.K;
843
+ var result = true;
844
+ this.each(function(value, index) {
845
+ result = result && !!iterator.call(context, value, index);
846
+ if (!result) throw $break;
847
+ });
848
+ return result;
849
+ }
850
+
851
+ function any(iterator, context) {
852
+ iterator = iterator || Prototype.K;
853
+ var result = false;
854
+ this.each(function(value, index) {
855
+ if (result = !!iterator.call(context, value, index))
856
+ throw $break;
857
+ });
858
+ return result;
859
+ }
860
+
861
+ function collect(iterator, context) {
862
+ iterator = iterator || Prototype.K;
863
+ var results = [];
864
+ this.each(function(value, index) {
865
+ results.push(iterator.call(context, value, index));
866
+ });
867
+ return results;
868
+ }
869
+
870
+ function detect(iterator, context) {
871
+ var result;
872
+ this.each(function(value, index) {
873
+ if (iterator.call(context, value, index)) {
874
+ result = value;
875
+ throw $break;
876
+ }
877
+ });
878
+ return result;
879
+ }
880
+
881
+ function findAll(iterator, context) {
882
+ var results = [];
883
+ this.each(function(value, index) {
884
+ if (iterator.call(context, value, index))
885
+ results.push(value);
886
+ });
887
+ return results;
888
+ }
889
+
890
+ function grep(filter, iterator, context) {
891
+ iterator = iterator || Prototype.K;
892
+ var results = [];
893
+
894
+ if (Object.isString(filter))
895
+ filter = new RegExp(RegExp.escape(filter));
896
+
897
+ this.each(function(value, index) {
898
+ if (filter.match(value))
899
+ results.push(iterator.call(context, value, index));
900
+ });
901
+ return results;
902
+ }
903
+
904
+ function include(object) {
905
+ if (Object.isFunction(this.indexOf))
906
+ if (this.indexOf(object) != -1) return true;
907
+
908
+ var found = false;
909
+ this.each(function(value) {
910
+ if (value == object) {
911
+ found = true;
912
+ throw $break;
913
+ }
914
+ });
915
+ return found;
916
+ }
917
+
918
+ function inGroupsOf(number, fillWith) {
919
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
920
+ return this.eachSlice(number, function(slice) {
921
+ while(slice.length < number) slice.push(fillWith);
922
+ return slice;
923
+ });
924
+ }
925
+
926
+ function inject(memo, iterator, context) {
927
+ this.each(function(value, index) {
928
+ memo = iterator.call(context, memo, value, index);
929
+ });
930
+ return memo;
931
+ }
932
+
933
+ function invoke(method) {
934
+ var args = $A(arguments).slice(1);
935
+ return this.map(function(value) {
936
+ return value[method].apply(value, args);
937
+ });
938
+ }
939
+
940
+ function max(iterator, context) {
941
+ iterator = iterator || Prototype.K;
942
+ var result;
943
+ this.each(function(value, index) {
944
+ value = iterator.call(context, value, index);
945
+ if (result == null || value >= result)
946
+ result = value;
947
+ });
948
+ return result;
949
+ }
950
+
951
+ function min(iterator, context) {
952
+ iterator = iterator || Prototype.K;
953
+ var result;
954
+ this.each(function(value, index) {
955
+ value = iterator.call(context, value, index);
956
+ if (result == null || value < result)
957
+ result = value;
958
+ });
959
+ return result;
960
+ }
961
+
962
+ function partition(iterator, context) {
963
+ iterator = iterator || Prototype.K;
964
+ var trues = [], falses = [];
965
+ this.each(function(value, index) {
966
+ (iterator.call(context, value, index) ?
967
+ trues : falses).push(value);
968
+ });
969
+ return [trues, falses];
970
+ }
971
+
972
+ function pluck(property) {
973
+ var results = [];
974
+ this.each(function(value) {
975
+ results.push(value[property]);
976
+ });
977
+ return results;
978
+ }
979
+
980
+ function reject(iterator, context) {
981
+ var results = [];
982
+ this.each(function(value, index) {
983
+ if (!iterator.call(context, value, index))
984
+ results.push(value);
985
+ });
986
+ return results;
987
+ }
988
+
989
+ function sortBy(iterator, context) {
990
+ return this.map(function(value, index) {
991
+ return {
992
+ value: value,
993
+ criteria: iterator.call(context, value, index)
994
+ };
995
+ }).sort(function(left, right) {
996
+ var a = left.criteria, b = right.criteria;
997
+ return a < b ? -1 : a > b ? 1 : 0;
998
+ }).pluck('value');
999
+ }
1000
+
1001
+ function toArray() {
1002
+ return this.map();
1003
+ }
1004
+
1005
+ function zip() {
1006
+ var iterator = Prototype.K, args = $A(arguments);
1007
+ if (Object.isFunction(args.last()))
1008
+ iterator = args.pop();
1009
+
1010
+ var collections = [this].concat(args).map($A);
1011
+ return this.map(function(value, index) {
1012
+ return iterator(collections.pluck(index));
1013
+ });
1014
+ }
1015
+
1016
+ function size() {
1017
+ return this.toArray().length;
1018
+ }
1019
+
1020
+ function inspect() {
1021
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
1022
+ }
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+ return {
1033
+ each: each,
1034
+ eachSlice: eachSlice,
1035
+ all: all,
1036
+ every: all,
1037
+ any: any,
1038
+ some: any,
1039
+ collect: collect,
1040
+ map: collect,
1041
+ detect: detect,
1042
+ findAll: findAll,
1043
+ select: findAll,
1044
+ filter: findAll,
1045
+ grep: grep,
1046
+ include: include,
1047
+ member: include,
1048
+ inGroupsOf: inGroupsOf,
1049
+ inject: inject,
1050
+ invoke: invoke,
1051
+ max: max,
1052
+ min: min,
1053
+ partition: partition,
1054
+ pluck: pluck,
1055
+ reject: reject,
1056
+ sortBy: sortBy,
1057
+ toArray: toArray,
1058
+ entries: toArray,
1059
+ zip: zip,
1060
+ size: size,
1061
+ inspect: inspect,
1062
+ find: detect
1063
+ };
1064
+ })();
1065
+
1066
+ function $A(iterable) {
1067
+ if (!iterable) return [];
1068
+ if ('toArray' in Object(iterable)) return iterable.toArray();
1069
+ var length = iterable.length || 0, results = new Array(length);
1070
+ while (length--) results[length] = iterable[length];
1071
+ return results;
1072
+ }
1073
+
1074
+
1075
+ function $w(string) {
1076
+ if (!Object.isString(string)) return [];
1077
+ string = string.strip();
1078
+ return string ? string.split(/\s+/) : [];
1079
+ }
1080
+
1081
+ Array.from = $A;
1082
+
1083
+
1084
+ (function() {
1085
+ var arrayProto = Array.prototype,
1086
+ slice = arrayProto.slice,
1087
+ _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
1088
+
1089
+ function each(iterator, context) {
1090
+ for (var i = 0, length = this.length >>> 0; i < length; i++) {
1091
+ if (i in this) iterator.call(context, this[i], i, this);
1092
+ }
1093
+ }
1094
+ if (!_each) _each = each;
1095
+
1096
+ function clear() {
1097
+ this.length = 0;
1098
+ return this;
1099
+ }
1100
+
1101
+ function first() {
1102
+ return this[0];
1103
+ }
1104
+
1105
+ function last() {
1106
+ return this[this.length - 1];
1107
+ }
1108
+
1109
+ function compact() {
1110
+ return this.select(function(value) {
1111
+ return value != null;
1112
+ });
1113
+ }
1114
+
1115
+ function flatten() {
1116
+ return this.inject([], function(array, value) {
1117
+ if (Object.isArray(value))
1118
+ return array.concat(value.flatten());
1119
+ array.push(value);
1120
+ return array;
1121
+ });
1122
+ }
1123
+
1124
+ function without() {
1125
+ var values = slice.call(arguments, 0);
1126
+ return this.select(function(value) {
1127
+ return !values.include(value);
1128
+ });
1129
+ }
1130
+
1131
+ function reverse(inline) {
1132
+ return (inline === false ? this.toArray() : this)._reverse();
1133
+ }
1134
+
1135
+ function uniq(sorted) {
1136
+ return this.inject([], function(array, value, index) {
1137
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
1138
+ array.push(value);
1139
+ return array;
1140
+ });
1141
+ }
1142
+
1143
+ function intersect(array) {
1144
+ return this.uniq().findAll(function(item) {
1145
+ return array.detect(function(value) { return item === value });
1146
+ });
1147
+ }
1148
+
1149
+
1150
+ function clone() {
1151
+ return slice.call(this, 0);
1152
+ }
1153
+
1154
+ function size() {
1155
+ return this.length;
1156
+ }
1157
+
1158
+ function inspect() {
1159
+ return '[' + this.map(Object.inspect).join(', ') + ']';
1160
+ }
1161
+
1162
+ function indexOf(item, i) {
1163
+ i || (i = 0);
1164
+ var length = this.length;
1165
+ if (i < 0) i = length + i;
1166
+ for (; i < length; i++)
1167
+ if (this[i] === item) return i;
1168
+ return -1;
1169
+ }
1170
+
1171
+ function lastIndexOf(item, i) {
1172
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
1173
+ var n = this.slice(0, i).reverse().indexOf(item);
1174
+ return (n < 0) ? n : i - n - 1;
1175
+ }
1176
+
1177
+ function concat() {
1178
+ var array = slice.call(this, 0), item;
1179
+ for (var i = 0, length = arguments.length; i < length; i++) {
1180
+ item = arguments[i];
1181
+ if (Object.isArray(item) && !('callee' in item)) {
1182
+ for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
1183
+ array.push(item[j]);
1184
+ } else {
1185
+ array.push(item);
1186
+ }
1187
+ }
1188
+ return array;
1189
+ }
1190
+
1191
+ Object.extend(arrayProto, Enumerable);
1192
+
1193
+ if (!arrayProto._reverse)
1194
+ arrayProto._reverse = arrayProto.reverse;
1195
+
1196
+ Object.extend(arrayProto, {
1197
+ _each: _each,
1198
+ clear: clear,
1199
+ first: first,
1200
+ last: last,
1201
+ compact: compact,
1202
+ flatten: flatten,
1203
+ without: without,
1204
+ reverse: reverse,
1205
+ uniq: uniq,
1206
+ intersect: intersect,
1207
+ clone: clone,
1208
+ toArray: clone,
1209
+ size: size,
1210
+ inspect: inspect
1211
+ });
1212
+
1213
+ var CONCAT_ARGUMENTS_BUGGY = (function() {
1214
+ return [].concat(arguments)[0][0] !== 1;
1215
+ })(1,2)
1216
+
1217
+ if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
1218
+
1219
+ if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
1220
+ if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
1221
+ })();
1222
+ function $H(object) {
1223
+ return new Hash(object);
1224
+ };
1225
+
1226
+ var Hash = Class.create(Enumerable, (function() {
1227
+ function initialize(object) {
1228
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
1229
+ }
1230
+
1231
+
1232
+ function _each(iterator) {
1233
+ for (var key in this._object) {
1234
+ var value = this._object[key], pair = [key, value];
1235
+ pair.key = key;
1236
+ pair.value = value;
1237
+ iterator(pair);
1238
+ }
1239
+ }
1240
+
1241
+ function set(key, value) {
1242
+ return this._object[key] = value;
1243
+ }
1244
+
1245
+ function get(key) {
1246
+ if (this._object[key] !== Object.prototype[key])
1247
+ return this._object[key];
1248
+ }
1249
+
1250
+ function unset(key) {
1251
+ var value = this._object[key];
1252
+ delete this._object[key];
1253
+ return value;
1254
+ }
1255
+
1256
+ function toObject() {
1257
+ return Object.clone(this._object);
1258
+ }
1259
+
1260
+
1261
+
1262
+ function keys() {
1263
+ return this.pluck('key');
1264
+ }
1265
+
1266
+ function values() {
1267
+ return this.pluck('value');
1268
+ }
1269
+
1270
+ function index(value) {
1271
+ var match = this.detect(function(pair) {
1272
+ return pair.value === value;
1273
+ });
1274
+ return match && match.key;
1275
+ }
1276
+
1277
+ function merge(object) {
1278
+ return this.clone().update(object);
1279
+ }
1280
+
1281
+ function update(object) {
1282
+ return new Hash(object).inject(this, function(result, pair) {
1283
+ result.set(pair.key, pair.value);
1284
+ return result;
1285
+ });
1286
+ }
1287
+
1288
+ function toQueryPair(key, value) {
1289
+ if (Object.isUndefined(value)) return key;
1290
+ return key + '=' + encodeURIComponent(String.interpret(value));
1291
+ }
1292
+
1293
+ function toQueryString() {
1294
+ return this.inject([], function(results, pair) {
1295
+ var key = encodeURIComponent(pair.key), values = pair.value;
1296
+
1297
+ if (values && typeof values == 'object') {
1298
+ if (Object.isArray(values)) {
1299
+ var queryValues = [];
1300
+ for (var i = 0, len = values.length, value; i < len; i++) {
1301
+ value = values[i];
1302
+ queryValues.push(toQueryPair(key, value));
1303
+ }
1304
+ return results.concat(queryValues);
1305
+ }
1306
+ } else results.push(toQueryPair(key, values));
1307
+ return results;
1308
+ }).join('&');
1309
+ }
1310
+
1311
+ function inspect() {
1312
+ return '#<Hash:{' + this.map(function(pair) {
1313
+ return pair.map(Object.inspect).join(': ');
1314
+ }).join(', ') + '}>';
1315
+ }
1316
+
1317
+ function clone() {
1318
+ return new Hash(this);
1319
+ }
1320
+
1321
+ return {
1322
+ initialize: initialize,
1323
+ _each: _each,
1324
+ set: set,
1325
+ get: get,
1326
+ unset: unset,
1327
+ toObject: toObject,
1328
+ toTemplateReplacements: toObject,
1329
+ keys: keys,
1330
+ values: values,
1331
+ index: index,
1332
+ merge: merge,
1333
+ update: update,
1334
+ toQueryString: toQueryString,
1335
+ inspect: inspect,
1336
+ toJSON: toObject,
1337
+ clone: clone
1338
+ };
1339
+ })());
1340
+
1341
+ Hash.from = $H;
1342
+ Object.extend(Number.prototype, (function() {
1343
+ function toColorPart() {
1344
+ return this.toPaddedString(2, 16);
1345
+ }
1346
+
1347
+ function succ() {
1348
+ return this + 1;
1349
+ }
1350
+
1351
+ function times(iterator, context) {
1352
+ $R(0, this, true).each(iterator, context);
1353
+ return this;
1354
+ }
1355
+
1356
+ function toPaddedString(length, radix) {
1357
+ var string = this.toString(radix || 10);
1358
+ return '0'.times(length - string.length) + string;
1359
+ }
1360
+
1361
+ function abs() {
1362
+ return Math.abs(this);
1363
+ }
1364
+
1365
+ function round() {
1366
+ return Math.round(this);
1367
+ }
1368
+
1369
+ function ceil() {
1370
+ return Math.ceil(this);
1371
+ }
1372
+
1373
+ function floor() {
1374
+ return Math.floor(this);
1375
+ }
1376
+
1377
+ return {
1378
+ toColorPart: toColorPart,
1379
+ succ: succ,
1380
+ times: times,
1381
+ toPaddedString: toPaddedString,
1382
+ abs: abs,
1383
+ round: round,
1384
+ ceil: ceil,
1385
+ floor: floor
1386
+ };
1387
+ })());
1388
+
1389
+ function $R(start, end, exclusive) {
1390
+ return new ObjectRange(start, end, exclusive);
1391
+ }
1392
+
1393
+ var ObjectRange = Class.create(Enumerable, (function() {
1394
+ function initialize(start, end, exclusive) {
1395
+ this.start = start;
1396
+ this.end = end;
1397
+ this.exclusive = exclusive;
1398
+ }
1399
+
1400
+ function _each(iterator) {
1401
+ var value = this.start;
1402
+ while (this.include(value)) {
1403
+ iterator(value);
1404
+ value = value.succ();
1405
+ }
1406
+ }
1407
+
1408
+ function include(value) {
1409
+ if (value < this.start)
1410
+ return false;
1411
+ if (this.exclusive)
1412
+ return value < this.end;
1413
+ return value <= this.end;
1414
+ }
1415
+
1416
+ return {
1417
+ initialize: initialize,
1418
+ _each: _each,
1419
+ include: include
1420
+ };
1421
+ })());
1422
+
1423
+
1424
+
1425
+ var Ajax = {
1426
+ getTransport: function() {
1427
+ return Try.these(
1428
+ function() {return new XMLHttpRequest()},
1429
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
1430
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
1431
+ ) || false;
1432
+ },
1433
+
1434
+ activeRequestCount: 0
1435
+ };
1436
+
1437
+ Ajax.Responders = {
1438
+ responders: [],
1439
+
1440
+ _each: function(iterator) {
1441
+ this.responders._each(iterator);
1442
+ },
1443
+
1444
+ register: function(responder) {
1445
+ if (!this.include(responder))
1446
+ this.responders.push(responder);
1447
+ },
1448
+
1449
+ unregister: function(responder) {
1450
+ this.responders = this.responders.without(responder);
1451
+ },
1452
+
1453
+ dispatch: function(callback, request, transport, json) {
1454
+ this.each(function(responder) {
1455
+ if (Object.isFunction(responder[callback])) {
1456
+ try {
1457
+ responder[callback].apply(responder, [request, transport, json]);
1458
+ } catch (e) { }
1459
+ }
1460
+ });
1461
+ }
1462
+ };
1463
+
1464
+ Object.extend(Ajax.Responders, Enumerable);
1465
+
1466
+ Ajax.Responders.register({
1467
+ onCreate: function() { Ajax.activeRequestCount++ },
1468
+ onComplete: function() { Ajax.activeRequestCount-- }
1469
+ });
1470
+ Ajax.Base = Class.create({
1471
+ initialize: function(options) {
1472
+ this.options = {
1473
+ method: 'post',
1474
+ asynchronous: true,
1475
+ contentType: 'application/x-www-form-urlencoded',
1476
+ encoding: 'UTF-8',
1477
+ parameters: '',
1478
+ evalJSON: true,
1479
+ evalJS: true
1480
+ };
1481
+ Object.extend(this.options, options || { });
1482
+
1483
+ this.options.method = this.options.method.toLowerCase();
1484
+
1485
+ if (Object.isHash(this.options.parameters))
1486
+ this.options.parameters = this.options.parameters.toObject();
1487
+ }
1488
+ });
1489
+ Ajax.Request = Class.create(Ajax.Base, {
1490
+ _complete: false,
1491
+
1492
+ initialize: function($super, url, options) {
1493
+ $super(options);
1494
+ this.transport = Ajax.getTransport();
1495
+ this.request(url);
1496
+ },
1497
+
1498
+ request: function(url) {
1499
+ this.url = url;
1500
+ this.method = this.options.method;
1501
+ var params = Object.isString(this.options.parameters) ?
1502
+ this.options.parameters :
1503
+ Object.toQueryString(this.options.parameters);
1504
+
1505
+ if (!['get', 'post'].include(this.method)) {
1506
+ params += (params ? '&' : '') + "_method=" + this.method;
1507
+ this.method = 'post';
1508
+ }
1509
+
1510
+ if (params && this.method === 'get') {
1511
+ this.url += (this.url.include('?') ? '&' : '?') + params;
1512
+ }
1513
+
1514
+ this.parameters = params.toQueryParams();
1515
+
1516
+ try {
1517
+ var response = new Ajax.Response(this);
1518
+ if (this.options.onCreate) this.options.onCreate(response);
1519
+ Ajax.Responders.dispatch('onCreate', this, response);
1520
+
1521
+ this.transport.open(this.method.toUpperCase(), this.url,
1522
+ this.options.asynchronous);
1523
+
1524
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
1525
+
1526
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
1527
+ this.setRequestHeaders();
1528
+
1529
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
1530
+ this.transport.send(this.body);
1531
+
1532
+ /* Force Firefox to handle ready state 4 for synchronous requests */
1533
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
1534
+ this.onStateChange();
1535
+
1536
+ }
1537
+ catch (e) {
1538
+ this.dispatchException(e);
1539
+ }
1540
+ },
1541
+
1542
+ onStateChange: function() {
1543
+ var readyState = this.transport.readyState;
1544
+ if (readyState > 1 && !((readyState == 4) && this._complete))
1545
+ this.respondToReadyState(this.transport.readyState);
1546
+ },
1547
+
1548
+ setRequestHeaders: function() {
1549
+ var headers = {
1550
+ 'X-Requested-With': 'XMLHttpRequest',
1551
+ 'X-Prototype-Version': Prototype.Version,
1552
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
1553
+ };
1554
+
1555
+ if (this.method == 'post') {
1556
+ headers['Content-type'] = this.options.contentType +
1557
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
1558
+
1559
+ /* Force "Connection: close" for older Mozilla browsers to work
1560
+ * around a bug where XMLHttpRequest sends an incorrect
1561
+ * Content-length header. See Mozilla Bugzilla #246651.
1562
+ */
1563
+ if (this.transport.overrideMimeType &&
1564
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
1565
+ headers['Connection'] = 'close';
1566
+ }
1567
+
1568
+ if (typeof this.options.requestHeaders == 'object') {
1569
+ var extras = this.options.requestHeaders;
1570
+
1571
+ if (Object.isFunction(extras.push))
1572
+ for (var i = 0, length = extras.length; i < length; i += 2)
1573
+ headers[extras[i]] = extras[i+1];
1574
+ else
1575
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
1576
+ }
1577
+
1578
+ for (var name in headers)
1579
+ this.transport.setRequestHeader(name, headers[name]);
1580
+ },
1581
+
1582
+ success: function() {
1583
+ var status = this.getStatus();
1584
+ return !status || (status >= 200 && status < 300) || status == 304;
1585
+ },
1586
+
1587
+ getStatus: function() {
1588
+ try {
1589
+ if (this.transport.status === 1223) return 204;
1590
+ return this.transport.status || 0;
1591
+ } catch (e) { return 0 }
1592
+ },
1593
+
1594
+ respondToReadyState: function(readyState) {
1595
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
1596
+
1597
+ if (state == 'Complete') {
1598
+ try {
1599
+ this._complete = true;
1600
+ (this.options['on' + response.status]
1601
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
1602
+ || Prototype.emptyFunction)(response, response.headerJSON);
1603
+ } catch (e) {
1604
+ this.dispatchException(e);
1605
+ }
1606
+
1607
+ var contentType = response.getHeader('Content-type');
1608
+ if (this.options.evalJS == 'force'
1609
+ || (this.options.evalJS && this.isSameOrigin() && contentType
1610
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
1611
+ this.evalResponse();
1612
+ }
1613
+
1614
+ try {
1615
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
1616
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
1617
+ } catch (e) {
1618
+ this.dispatchException(e);
1619
+ }
1620
+
1621
+ if (state == 'Complete') {
1622
+ this.transport.onreadystatechange = Prototype.emptyFunction;
1623
+ }
1624
+ },
1625
+
1626
+ isSameOrigin: function() {
1627
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
1628
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
1629
+ protocol: location.protocol,
1630
+ domain: document.domain,
1631
+ port: location.port ? ':' + location.port : ''
1632
+ }));
1633
+ },
1634
+
1635
+ getHeader: function(name) {
1636
+ try {
1637
+ return this.transport.getResponseHeader(name) || null;
1638
+ } catch (e) { return null; }
1639
+ },
1640
+
1641
+ evalResponse: function() {
1642
+ try {
1643
+ return eval((this.transport.responseText || '').unfilterJSON());
1644
+ } catch (e) {
1645
+ this.dispatchException(e);
1646
+ }
1647
+ },
1648
+
1649
+ dispatchException: function(exception) {
1650
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
1651
+ Ajax.Responders.dispatch('onException', this, exception);
1652
+ }
1653
+ });
1654
+
1655
+ Ajax.Request.Events =
1656
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+ Ajax.Response = Class.create({
1666
+ initialize: function(request){
1667
+ this.request = request;
1668
+ var transport = this.transport = request.transport,
1669
+ readyState = this.readyState = transport.readyState;
1670
+
1671
+ if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
1672
+ this.status = this.getStatus();
1673
+ this.statusText = this.getStatusText();
1674
+ this.responseText = String.interpret(transport.responseText);
1675
+ this.headerJSON = this._getHeaderJSON();
1676
+ }
1677
+
1678
+ if (readyState == 4) {
1679
+ var xml = transport.responseXML;
1680
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
1681
+ this.responseJSON = this._getResponseJSON();
1682
+ }
1683
+ },
1684
+
1685
+ status: 0,
1686
+
1687
+ statusText: '',
1688
+
1689
+ getStatus: Ajax.Request.prototype.getStatus,
1690
+
1691
+ getStatusText: function() {
1692
+ try {
1693
+ return this.transport.statusText || '';
1694
+ } catch (e) { return '' }
1695
+ },
1696
+
1697
+ getHeader: Ajax.Request.prototype.getHeader,
1698
+
1699
+ getAllHeaders: function() {
1700
+ try {
1701
+ return this.getAllResponseHeaders();
1702
+ } catch (e) { return null }
1703
+ },
1704
+
1705
+ getResponseHeader: function(name) {
1706
+ return this.transport.getResponseHeader(name);
1707
+ },
1708
+
1709
+ getAllResponseHeaders: function() {
1710
+ return this.transport.getAllResponseHeaders();
1711
+ },
1712
+
1713
+ _getHeaderJSON: function() {
1714
+ var json = this.getHeader('X-JSON');
1715
+ if (!json) return null;
1716
+ json = decodeURIComponent(escape(json));
1717
+ try {
1718
+ return json.evalJSON(this.request.options.sanitizeJSON ||
1719
+ !this.request.isSameOrigin());
1720
+ } catch (e) {
1721
+ this.request.dispatchException(e);
1722
+ }
1723
+ },
1724
+
1725
+ _getResponseJSON: function() {
1726
+ var options = this.request.options;
1727
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
1728
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
1729
+ this.responseText.blank())
1730
+ return null;
1731
+ try {
1732
+ return this.responseText.evalJSON(options.sanitizeJSON ||
1733
+ !this.request.isSameOrigin());
1734
+ } catch (e) {
1735
+ this.request.dispatchException(e);
1736
+ }
1737
+ }
1738
+ });
1739
+
1740
+ Ajax.Updater = Class.create(Ajax.Request, {
1741
+ initialize: function($super, container, url, options) {
1742
+ this.container = {
1743
+ success: (container.success || container),
1744
+ failure: (container.failure || (container.success ? null : container))
1745
+ };
1746
+
1747
+ options = Object.clone(options);
1748
+ var onComplete = options.onComplete;
1749
+ options.onComplete = (function(response, json) {
1750
+ this.updateContent(response.responseText);
1751
+ if (Object.isFunction(onComplete)) onComplete(response, json);
1752
+ }).bind(this);
1753
+
1754
+ $super(url, options);
1755
+ },
1756
+
1757
+ updateContent: function(responseText) {
1758
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
1759
+ options = this.options;
1760
+
1761
+ if (!options.evalScripts) responseText = responseText.stripScripts();
1762
+
1763
+ if (receiver = $(receiver)) {
1764
+ if (options.insertion) {
1765
+ if (Object.isString(options.insertion)) {
1766
+ var insertion = { }; insertion[options.insertion] = responseText;
1767
+ receiver.insert(insertion);
1768
+ }
1769
+ else options.insertion(receiver, responseText);
1770
+ }
1771
+ else receiver.update(responseText);
1772
+ }
1773
+ }
1774
+ });
1775
+
1776
+ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
1777
+ initialize: function($super, container, url, options) {
1778
+ $super(options);
1779
+ this.onComplete = this.options.onComplete;
1780
+
1781
+ this.frequency = (this.options.frequency || 2);
1782
+ this.decay = (this.options.decay || 1);
1783
+
1784
+ this.updater = { };
1785
+ this.container = container;
1786
+ this.url = url;
1787
+
1788
+ this.start();
1789
+ },
1790
+
1791
+ start: function() {
1792
+ this.options.onComplete = this.updateComplete.bind(this);
1793
+ this.onTimerEvent();
1794
+ },
1795
+
1796
+ stop: function() {
1797
+ this.updater.options.onComplete = undefined;
1798
+ clearTimeout(this.timer);
1799
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
1800
+ },
1801
+
1802
+ updateComplete: function(response) {
1803
+ if (this.options.decay) {
1804
+ this.decay = (response.responseText == this.lastText ?
1805
+ this.decay * this.options.decay : 1);
1806
+
1807
+ this.lastText = response.responseText;
1808
+ }
1809
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
1810
+ },
1811
+
1812
+ onTimerEvent: function() {
1813
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
1814
+ }
1815
+ });
1816
+
1817
+
1818
+ function $(element) {
1819
+ if (arguments.length > 1) {
1820
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
1821
+ elements.push($(arguments[i]));
1822
+ return elements;
1823
+ }
1824
+ if (Object.isString(element))
1825
+ element = document.getElementById(element);
1826
+ return Element.extend(element);
1827
+ }
1828
+
1829
+ if (Prototype.BrowserFeatures.XPath) {
1830
+ document._getElementsByXPath = function(expression, parentElement) {
1831
+ var results = [];
1832
+ var query = document.evaluate(expression, $(parentElement) || document,
1833
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
1834
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
1835
+ results.push(Element.extend(query.snapshotItem(i)));
1836
+ return results;
1837
+ };
1838
+ }
1839
+
1840
+ /*--------------------------------------------------------------------------*/
1841
+
1842
+ if (!Node) var Node = { };
1843
+
1844
+ if (!Node.ELEMENT_NODE) {
1845
+ Object.extend(Node, {
1846
+ ELEMENT_NODE: 1,
1847
+ ATTRIBUTE_NODE: 2,
1848
+ TEXT_NODE: 3,
1849
+ CDATA_SECTION_NODE: 4,
1850
+ ENTITY_REFERENCE_NODE: 5,
1851
+ ENTITY_NODE: 6,
1852
+ PROCESSING_INSTRUCTION_NODE: 7,
1853
+ COMMENT_NODE: 8,
1854
+ DOCUMENT_NODE: 9,
1855
+ DOCUMENT_TYPE_NODE: 10,
1856
+ DOCUMENT_FRAGMENT_NODE: 11,
1857
+ NOTATION_NODE: 12
1858
+ });
1859
+ }
1860
+
1861
+
1862
+
1863
+ (function(global) {
1864
+ function shouldUseCache(tagName, attributes) {
1865
+ if (tagName === 'select') return false;
1866
+ if ('type' in attributes) return false;
1867
+ return true;
1868
+ }
1869
+
1870
+ var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
1871
+ try {
1872
+ var el = document.createElement('<input name="x">');
1873
+ return el.tagName.toLowerCase() === 'input' && el.name === 'x';
1874
+ }
1875
+ catch(err) {
1876
+ return false;
1877
+ }
1878
+ })();
1879
+
1880
+ var element = global.Element;
1881
+
1882
+ global.Element = function(tagName, attributes) {
1883
+ attributes = attributes || { };
1884
+ tagName = tagName.toLowerCase();
1885
+ var cache = Element.cache;
1886
+
1887
+ if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) {
1888
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
1889
+ delete attributes.name;
1890
+ return Element.writeAttribute(document.createElement(tagName), attributes);
1891
+ }
1892
+
1893
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
1894
+
1895
+ var node = shouldUseCache(tagName, attributes) ?
1896
+ cache[tagName].cloneNode(false) : document.createElement(tagName);
1897
+
1898
+ return Element.writeAttribute(node, attributes);
1899
+ };
1900
+
1901
+ Object.extend(global.Element, element || { });
1902
+ if (element) global.Element.prototype = element.prototype;
1903
+
1904
+ })(this);
1905
+
1906
+ Element.idCounter = 1;
1907
+ Element.cache = { };
1908
+
1909
+ Element._purgeElement = function(element) {
1910
+ var uid = element._prototypeUID;
1911
+ if (uid) {
1912
+ Element.stopObserving(element);
1913
+ element._prototypeUID = void 0;
1914
+ delete Element.Storage[uid];
1915
+ }
1916
+ }
1917
+
1918
+ Element.Methods = {
1919
+ visible: function(element) {
1920
+ return $(element).style.display != 'none';
1921
+ },
1922
+
1923
+ toggle: function(element) {
1924
+ element = $(element);
1925
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
1926
+ return element;
1927
+ },
1928
+
1929
+ hide: function(element) {
1930
+ element = $(element);
1931
+ element.style.display = 'none';
1932
+ return element;
1933
+ },
1934
+
1935
+ show: function(element) {
1936
+ element = $(element);
1937
+ element.style.display = '';
1938
+ return element;
1939
+ },
1940
+
1941
+ remove: function(element) {
1942
+ element = $(element);
1943
+ element.parentNode.removeChild(element);
1944
+ return element;
1945
+ },
1946
+
1947
+ update: (function(){
1948
+
1949
+ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
1950
+ var el = document.createElement("select"),
1951
+ isBuggy = true;
1952
+ el.innerHTML = "<option value=\"test\">test</option>";
1953
+ if (el.options && el.options[0]) {
1954
+ isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
1955
+ }
1956
+ el = null;
1957
+ return isBuggy;
1958
+ })();
1959
+
1960
+ var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
1961
+ try {
1962
+ var el = document.createElement("table");
1963
+ if (el && el.tBodies) {
1964
+ el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
1965
+ var isBuggy = typeof el.tBodies[0] == "undefined";
1966
+ el = null;
1967
+ return isBuggy;
1968
+ }
1969
+ } catch (e) {
1970
+ return true;
1971
+ }
1972
+ })();
1973
+
1974
+ var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
1975
+ try {
1976
+ var el = document.createElement('div');
1977
+ el.innerHTML = "<link>";
1978
+ var isBuggy = (el.childNodes.length === 0);
1979
+ el = null;
1980
+ return isBuggy;
1981
+ } catch(e) {
1982
+ return true;
1983
+ }
1984
+ })();
1985
+
1986
+ var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
1987
+ TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
1988
+
1989
+ var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
1990
+ var s = document.createElement("script"),
1991
+ isBuggy = false;
1992
+ try {
1993
+ s.appendChild(document.createTextNode(""));
1994
+ isBuggy = !s.firstChild ||
1995
+ s.firstChild && s.firstChild.nodeType !== 3;
1996
+ } catch (e) {
1997
+ isBuggy = true;
1998
+ }
1999
+ s = null;
2000
+ return isBuggy;
2001
+ })();
2002
+
2003
+
2004
+ function update(element, content) {
2005
+ element = $(element);
2006
+ var purgeElement = Element._purgeElement;
2007
+
2008
+ var descendants = element.getElementsByTagName('*'),
2009
+ i = descendants.length;
2010
+ while (i--) purgeElement(descendants[i]);
2011
+
2012
+ if (content && content.toElement)
2013
+ content = content.toElement();
2014
+
2015
+ if (Object.isElement(content))
2016
+ return element.update().insert(content);
2017
+
2018
+ content = Object.toHTML(content);
2019
+
2020
+ var tagName = element.tagName.toUpperCase();
2021
+
2022
+ if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
2023
+ element.text = content;
2024
+ return element;
2025
+ }
2026
+
2027
+ if (ANY_INNERHTML_BUGGY) {
2028
+ if (tagName in Element._insertionTranslations.tags) {
2029
+ while (element.firstChild) {
2030
+ element.removeChild(element.firstChild);
2031
+ }
2032
+ Element._getContentFromAnonymousElement(tagName, content.stripScripts())
2033
+ .each(function(node) {
2034
+ element.appendChild(node)
2035
+ });
2036
+ } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
2037
+ while (element.firstChild) {
2038
+ element.removeChild(element.firstChild);
2039
+ }
2040
+ var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
2041
+ nodes.each(function(node) { element.appendChild(node) });
2042
+ }
2043
+ else {
2044
+ element.innerHTML = content.stripScripts();
2045
+ }
2046
+ }
2047
+ else {
2048
+ element.innerHTML = content.stripScripts();
2049
+ }
2050
+
2051
+ content.evalScripts.bind(content).defer();
2052
+ return element;
2053
+ }
2054
+
2055
+ return update;
2056
+ })(),
2057
+
2058
+ replace: function(element, content) {
2059
+ element = $(element);
2060
+ if (content && content.toElement) content = content.toElement();
2061
+ else if (!Object.isElement(content)) {
2062
+ content = Object.toHTML(content);
2063
+ var range = element.ownerDocument.createRange();
2064
+ range.selectNode(element);
2065
+ content.evalScripts.bind(content).defer();
2066
+ content = range.createContextualFragment(content.stripScripts());
2067
+ }
2068
+ element.parentNode.replaceChild(content, element);
2069
+ return element;
2070
+ },
2071
+
2072
+ insert: function(element, insertions) {
2073
+ element = $(element);
2074
+
2075
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
2076
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
2077
+ insertions = {bottom:insertions};
2078
+
2079
+ var content, insert, tagName, childNodes;
2080
+
2081
+ for (var position in insertions) {
2082
+ content = insertions[position];
2083
+ position = position.toLowerCase();
2084
+ insert = Element._insertionTranslations[position];
2085
+
2086
+ if (content && content.toElement) content = content.toElement();
2087
+ if (Object.isElement(content)) {
2088
+ insert(element, content);
2089
+ continue;
2090
+ }
2091
+
2092
+ content = Object.toHTML(content);
2093
+
2094
+ tagName = ((position == 'before' || position == 'after')
2095
+ ? element.parentNode : element).tagName.toUpperCase();
2096
+
2097
+ childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
2098
+
2099
+ if (position == 'top' || position == 'after') childNodes.reverse();
2100
+ childNodes.each(insert.curry(element));
2101
+
2102
+ content.evalScripts.bind(content).defer();
2103
+ }
2104
+
2105
+ return element;
2106
+ },
2107
+
2108
+ wrap: function(element, wrapper, attributes) {
2109
+ element = $(element);
2110
+ if (Object.isElement(wrapper))
2111
+ $(wrapper).writeAttribute(attributes || { });
2112
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
2113
+ else wrapper = new Element('div', wrapper);
2114
+ if (element.parentNode)
2115
+ element.parentNode.replaceChild(wrapper, element);
2116
+ wrapper.appendChild(element);
2117
+ return wrapper;
2118
+ },
2119
+
2120
+ inspect: function(element) {
2121
+ element = $(element);
2122
+ var result = '<' + element.tagName.toLowerCase();
2123
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
2124
+ var property = pair.first(),
2125
+ attribute = pair.last(),
2126
+ value = (element[property] || '').toString();
2127
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
2128
+ });
2129
+ return result + '>';
2130
+ },
2131
+
2132
+ recursivelyCollect: function(element, property, maximumLength) {
2133
+ element = $(element);
2134
+ maximumLength = maximumLength || -1;
2135
+ var elements = [];
2136
+
2137
+ while (element = element[property]) {
2138
+ if (element.nodeType == 1)
2139
+ elements.push(Element.extend(element));
2140
+ if (elements.length == maximumLength)
2141
+ break;
2142
+ }
2143
+
2144
+ return elements;
2145
+ },
2146
+
2147
+ ancestors: function(element) {
2148
+ return Element.recursivelyCollect(element, 'parentNode');
2149
+ },
2150
+
2151
+ descendants: function(element) {
2152
+ return Element.select(element, "*");
2153
+ },
2154
+
2155
+ firstDescendant: function(element) {
2156
+ element = $(element).firstChild;
2157
+ while (element && element.nodeType != 1) element = element.nextSibling;
2158
+ return $(element);
2159
+ },
2160
+
2161
+ immediateDescendants: function(element) {
2162
+ var results = [], child = $(element).firstChild;
2163
+ while (child) {
2164
+ if (child.nodeType === 1) {
2165
+ results.push(Element.extend(child));
2166
+ }
2167
+ child = child.nextSibling;
2168
+ }
2169
+ return results;
2170
+ },
2171
+
2172
+ previousSiblings: function(element, maximumLength) {
2173
+ return Element.recursivelyCollect(element, 'previousSibling');
2174
+ },
2175
+
2176
+ nextSiblings: function(element) {
2177
+ return Element.recursivelyCollect(element, 'nextSibling');
2178
+ },
2179
+
2180
+ siblings: function(element) {
2181
+ element = $(element);
2182
+ return Element.previousSiblings(element).reverse()
2183
+ .concat(Element.nextSiblings(element));
2184
+ },
2185
+
2186
+ match: function(element, selector) {
2187
+ element = $(element);
2188
+ if (Object.isString(selector))
2189
+ return Prototype.Selector.match(element, selector);
2190
+ return selector.match(element);
2191
+ },
2192
+
2193
+ up: function(element, expression, index) {
2194
+ element = $(element);
2195
+ if (arguments.length == 1) return $(element.parentNode);
2196
+ var ancestors = Element.ancestors(element);
2197
+ return Object.isNumber(expression) ? ancestors[expression] :
2198
+ Prototype.Selector.find(ancestors, expression, index);
2199
+ },
2200
+
2201
+ down: function(element, expression, index) {
2202
+ element = $(element);
2203
+ if (arguments.length == 1) return Element.firstDescendant(element);
2204
+ return Object.isNumber(expression) ? Element.descendants(element)[expression] :
2205
+ Element.select(element, expression)[index || 0];
2206
+ },
2207
+
2208
+ previous: function(element, expression, index) {
2209
+ element = $(element);
2210
+ if (Object.isNumber(expression)) index = expression, expression = false;
2211
+ if (!Object.isNumber(index)) index = 0;
2212
+
2213
+ if (expression) {
2214
+ return Prototype.Selector.find(element.previousSiblings(), expression, index);
2215
+ } else {
2216
+ return element.recursivelyCollect("previousSibling", index + 1)[index];
2217
+ }
2218
+ },
2219
+
2220
+ next: function(element, expression, index) {
2221
+ element = $(element);
2222
+ if (Object.isNumber(expression)) index = expression, expression = false;
2223
+ if (!Object.isNumber(index)) index = 0;
2224
+
2225
+ if (expression) {
2226
+ return Prototype.Selector.find(element.nextSiblings(), expression, index);
2227
+ } else {
2228
+ var maximumLength = Object.isNumber(index) ? index + 1 : 1;
2229
+ return element.recursivelyCollect("nextSibling", index + 1)[index];
2230
+ }
2231
+ },
2232
+
2233
+
2234
+ select: function(element) {
2235
+ element = $(element);
2236
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
2237
+ return Prototype.Selector.select(expressions, element);
2238
+ },
2239
+
2240
+ adjacent: function(element) {
2241
+ element = $(element);
2242
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
2243
+ return Prototype.Selector.select(expressions, element.parentNode).without(element);
2244
+ },
2245
+
2246
+ identify: function(element) {
2247
+ element = $(element);
2248
+ var id = Element.readAttribute(element, 'id');
2249
+ if (id) return id;
2250
+ do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
2251
+ Element.writeAttribute(element, 'id', id);
2252
+ return id;
2253
+ },
2254
+
2255
+ readAttribute: function(element, name) {
2256
+ element = $(element);
2257
+ if (Prototype.Browser.IE) {
2258
+ var t = Element._attributeTranslations.read;
2259
+ if (t.values[name]) return t.values[name](element, name);
2260
+ if (t.names[name]) name = t.names[name];
2261
+ if (name.include(':')) {
2262
+ return (!element.attributes || !element.attributes[name]) ? null :
2263
+ element.attributes[name].value;
2264
+ }
2265
+ }
2266
+ return element.getAttribute(name);
2267
+ },
2268
+
2269
+ writeAttribute: function(element, name, value) {
2270
+ element = $(element);
2271
+ var attributes = { }, t = Element._attributeTranslations.write;
2272
+
2273
+ if (typeof name == 'object') attributes = name;
2274
+ else attributes[name] = Object.isUndefined(value) ? true : value;
2275
+
2276
+ for (var attr in attributes) {
2277
+ name = t.names[attr] || attr;
2278
+ value = attributes[attr];
2279
+ if (t.values[attr]) name = t.values[attr](element, value);
2280
+ if (value === false || value === null)
2281
+ element.removeAttribute(name);
2282
+ else if (value === true)
2283
+ element.setAttribute(name, name);
2284
+ else element.setAttribute(name, value);
2285
+ }
2286
+ return element;
2287
+ },
2288
+
2289
+ getHeight: function(element) {
2290
+ return Element.getDimensions(element).height;
2291
+ },
2292
+
2293
+ getWidth: function(element) {
2294
+ return Element.getDimensions(element).width;
2295
+ },
2296
+
2297
+ classNames: function(element) {
2298
+ return new Element.ClassNames(element);
2299
+ },
2300
+
2301
+ hasClassName: function(element, className) {
2302
+ if (!(element = $(element))) return;
2303
+ var elementClassName = element.className;
2304
+ return (elementClassName.length > 0 && (elementClassName == className ||
2305
+ new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
2306
+ },
2307
+
2308
+ addClassName: function(element, className) {
2309
+ if (!(element = $(element))) return;
2310
+ if (!Element.hasClassName(element, className))
2311
+ element.className += (element.className ? ' ' : '') + className;
2312
+ return element;
2313
+ },
2314
+
2315
+ removeClassName: function(element, className) {
2316
+ if (!(element = $(element))) return;
2317
+ element.className = element.className.replace(
2318
+ new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
2319
+ return element;
2320
+ },
2321
+
2322
+ toggleClassName: function(element, className) {
2323
+ if (!(element = $(element))) return;
2324
+ return Element[Element.hasClassName(element, className) ?
2325
+ 'removeClassName' : 'addClassName'](element, className);
2326
+ },
2327
+
2328
+ cleanWhitespace: function(element) {
2329
+ element = $(element);
2330
+ var node = element.firstChild;
2331
+ while (node) {
2332
+ var nextNode = node.nextSibling;
2333
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
2334
+ element.removeChild(node);
2335
+ node = nextNode;
2336
+ }
2337
+ return element;
2338
+ },
2339
+
2340
+ empty: function(element) {
2341
+ return $(element).innerHTML.blank();
2342
+ },
2343
+
2344
+ descendantOf: function(element, ancestor) {
2345
+ element = $(element), ancestor = $(ancestor);
2346
+
2347
+ if (element.compareDocumentPosition)
2348
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
2349
+
2350
+ if (ancestor.contains)
2351
+ return ancestor.contains(element) && ancestor !== element;
2352
+
2353
+ while (element = element.parentNode)
2354
+ if (element == ancestor) return true;
2355
+
2356
+ return false;
2357
+ },
2358
+
2359
+ scrollTo: function(element) {
2360
+ element = $(element);
2361
+ var pos = Element.cumulativeOffset(element);
2362
+ window.scrollTo(pos[0], pos[1]);
2363
+ return element;
2364
+ },
2365
+
2366
+ getStyle: function(element, style) {
2367
+ element = $(element);
2368
+ style = style == 'float' ? 'cssFloat' : style.camelize();
2369
+ var value = element.style[style];
2370
+ if (!value || value == 'auto') {
2371
+ var css = document.defaultView.getComputedStyle(element, null);
2372
+ value = css ? css[style] : null;
2373
+ }
2374
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
2375
+ return value == 'auto' ? null : value;
2376
+ },
2377
+
2378
+ getOpacity: function(element) {
2379
+ return $(element).getStyle('opacity');
2380
+ },
2381
+
2382
+ setStyle: function(element, styles) {
2383
+ element = $(element);
2384
+ var elementStyle = element.style, match;
2385
+ if (Object.isString(styles)) {
2386
+ element.style.cssText += ';' + styles;
2387
+ return styles.include('opacity') ?
2388
+ element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
2389
+ }
2390
+ for (var property in styles)
2391
+ if (property == 'opacity') element.setOpacity(styles[property]);
2392
+ else
2393
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
2394
+ (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
2395
+ property] = styles[property];
2396
+
2397
+ return element;
2398
+ },
2399
+
2400
+ setOpacity: function(element, value) {
2401
+ element = $(element);
2402
+ element.style.opacity = (value == 1 || value === '') ? '' :
2403
+ (value < 0.00001) ? 0 : value;
2404
+ return element;
2405
+ },
2406
+
2407
+ makePositioned: function(element) {
2408
+ element = $(element);
2409
+ var pos = Element.getStyle(element, 'position');
2410
+ if (pos == 'static' || !pos) {
2411
+ element._madePositioned = true;
2412
+ element.style.position = 'relative';
2413
+ if (Prototype.Browser.Opera) {
2414
+ element.style.top = 0;
2415
+ element.style.left = 0;
2416
+ }
2417
+ }
2418
+ return element;
2419
+ },
2420
+
2421
+ undoPositioned: function(element) {
2422
+ element = $(element);
2423
+ if (element._madePositioned) {
2424
+ element._madePositioned = undefined;
2425
+ element.style.position =
2426
+ element.style.top =
2427
+ element.style.left =
2428
+ element.style.bottom =
2429
+ element.style.right = '';
2430
+ }
2431
+ return element;
2432
+ },
2433
+
2434
+ makeClipping: function(element) {
2435
+ element = $(element);
2436
+ if (element._overflow) return element;
2437
+ element._overflow = Element.getStyle(element, 'overflow') || 'auto';
2438
+ if (element._overflow !== 'hidden')
2439
+ element.style.overflow = 'hidden';
2440
+ return element;
2441
+ },
2442
+
2443
+ undoClipping: function(element) {
2444
+ element = $(element);
2445
+ if (!element._overflow) return element;
2446
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
2447
+ element._overflow = null;
2448
+ return element;
2449
+ },
2450
+
2451
+ clonePosition: function(element, source) {
2452
+ var options = Object.extend({
2453
+ setLeft: true,
2454
+ setTop: true,
2455
+ setWidth: true,
2456
+ setHeight: true,
2457
+ offsetTop: 0,
2458
+ offsetLeft: 0
2459
+ }, arguments[2] || { });
2460
+
2461
+ source = $(source);
2462
+ var p = Element.viewportOffset(source), delta = [0, 0], parent = null;
2463
+
2464
+ element = $(element);
2465
+
2466
+ if (Element.getStyle(element, 'position') == 'absolute') {
2467
+ parent = Element.getOffsetParent(element);
2468
+ delta = Element.viewportOffset(parent);
2469
+ }
2470
+
2471
+ if (parent == document.body) {
2472
+ delta[0] -= document.body.offsetLeft;
2473
+ delta[1] -= document.body.offsetTop;
2474
+ }
2475
+
2476
+ if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
2477
+ if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
2478
+ if (options.setWidth) element.style.width = source.offsetWidth + 'px';
2479
+ if (options.setHeight) element.style.height = source.offsetHeight + 'px';
2480
+ return element;
2481
+ }
2482
+ };
2483
+
2484
+ Object.extend(Element.Methods, {
2485
+ getElementsBySelector: Element.Methods.select,
2486
+
2487
+ childElements: Element.Methods.immediateDescendants
2488
+ });
2489
+
2490
+ Element._attributeTranslations = {
2491
+ write: {
2492
+ names: {
2493
+ className: 'class',
2494
+ htmlFor: 'for'
2495
+ },
2496
+ values: { }
2497
+ }
2498
+ };
2499
+
2500
+ if (Prototype.Browser.Opera) {
2501
+ Element.Methods.getStyle = Element.Methods.getStyle.wrap(
2502
+ function(proceed, element, style) {
2503
+ switch (style) {
2504
+ case 'height': case 'width':
2505
+ if (!Element.visible(element)) return null;
2506
+
2507
+ var dim = parseInt(proceed(element, style), 10);
2508
+
2509
+ if (dim !== element['offset' + style.capitalize()])
2510
+ return dim + 'px';
2511
+
2512
+ var properties;
2513
+ if (style === 'height') {
2514
+ properties = ['border-top-width', 'padding-top',
2515
+ 'padding-bottom', 'border-bottom-width'];
2516
+ }
2517
+ else {
2518
+ properties = ['border-left-width', 'padding-left',
2519
+ 'padding-right', 'border-right-width'];
2520
+ }
2521
+ return properties.inject(dim, function(memo, property) {
2522
+ var val = proceed(element, property);
2523
+ return val === null ? memo : memo - parseInt(val, 10);
2524
+ }) + 'px';
2525
+ default: return proceed(element, style);
2526
+ }
2527
+ }
2528
+ );
2529
+
2530
+ Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
2531
+ function(proceed, element, attribute) {
2532
+ if (attribute === 'title') return element.title;
2533
+ return proceed(element, attribute);
2534
+ }
2535
+ );
2536
+ }
2537
+
2538
+ else if (Prototype.Browser.IE) {
2539
+ Element.Methods.getStyle = function(element, style) {
2540
+ element = $(element);
2541
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
2542
+ var value = element.style[style];
2543
+ if (!value && element.currentStyle) value = element.currentStyle[style];
2544
+
2545
+ if (style == 'opacity') {
2546
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
2547
+ if (value[1]) return parseFloat(value[1]) / 100;
2548
+ return 1.0;
2549
+ }
2550
+
2551
+ if (value == 'auto') {
2552
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
2553
+ return element['offset' + style.capitalize()] + 'px';
2554
+ return null;
2555
+ }
2556
+ return value;
2557
+ };
2558
+
2559
+ Element.Methods.setOpacity = function(element, value) {
2560
+ function stripAlpha(filter){
2561
+ return filter.replace(/alpha\([^\)]*\)/gi,'');
2562
+ }
2563
+ element = $(element);
2564
+ var currentStyle = element.currentStyle;
2565
+ if ((currentStyle && !currentStyle.hasLayout) ||
2566
+ (!currentStyle && element.style.zoom == 'normal'))
2567
+ element.style.zoom = 1;
2568
+
2569
+ var filter = element.getStyle('filter'), style = element.style;
2570
+ if (value == 1 || value === '') {
2571
+ (filter = stripAlpha(filter)) ?
2572
+ style.filter = filter : style.removeAttribute('filter');
2573
+ return element;
2574
+ } else if (value < 0.00001) value = 0;
2575
+ style.filter = stripAlpha(filter) +
2576
+ 'alpha(opacity=' + (value * 100) + ')';
2577
+ return element;
2578
+ };
2579
+
2580
+ Element._attributeTranslations = (function(){
2581
+
2582
+ var classProp = 'className',
2583
+ forProp = 'for',
2584
+ el = document.createElement('div');
2585
+
2586
+ el.setAttribute(classProp, 'x');
2587
+
2588
+ if (el.className !== 'x') {
2589
+ el.setAttribute('class', 'x');
2590
+ if (el.className === 'x') {
2591
+ classProp = 'class';
2592
+ }
2593
+ }
2594
+ el = null;
2595
+
2596
+ el = document.createElement('label');
2597
+ el.setAttribute(forProp, 'x');
2598
+ if (el.htmlFor !== 'x') {
2599
+ el.setAttribute('htmlFor', 'x');
2600
+ if (el.htmlFor === 'x') {
2601
+ forProp = 'htmlFor';
2602
+ }
2603
+ }
2604
+ el = null;
2605
+
2606
+ return {
2607
+ read: {
2608
+ names: {
2609
+ 'class': classProp,
2610
+ 'className': classProp,
2611
+ 'for': forProp,
2612
+ 'htmlFor': forProp
2613
+ },
2614
+ values: {
2615
+ _getAttr: function(element, attribute) {
2616
+ return element.getAttribute(attribute);
2617
+ },
2618
+ _getAttr2: function(element, attribute) {
2619
+ return element.getAttribute(attribute, 2);
2620
+ },
2621
+ _getAttrNode: function(element, attribute) {
2622
+ var node = element.getAttributeNode(attribute);
2623
+ return node ? node.value : "";
2624
+ },
2625
+ _getEv: (function(){
2626
+
2627
+ var el = document.createElement('div'), f;
2628
+ el.onclick = Prototype.emptyFunction;
2629
+ var value = el.getAttribute('onclick');
2630
+
2631
+ if (String(value).indexOf('{') > -1) {
2632
+ f = function(element, attribute) {
2633
+ attribute = element.getAttribute(attribute);
2634
+ if (!attribute) return null;
2635
+ attribute = attribute.toString();
2636
+ attribute = attribute.split('{')[1];
2637
+ attribute = attribute.split('}')[0];
2638
+ return attribute.strip();
2639
+ };
2640
+ }
2641
+ else if (value === '') {
2642
+ f = function(element, attribute) {
2643
+ attribute = element.getAttribute(attribute);
2644
+ if (!attribute) return null;
2645
+ return attribute.strip();
2646
+ };
2647
+ }
2648
+ el = null;
2649
+ return f;
2650
+ })(),
2651
+ _flag: function(element, attribute) {
2652
+ return $(element).hasAttribute(attribute) ? attribute : null;
2653
+ },
2654
+ style: function(element) {
2655
+ return element.style.cssText.toLowerCase();
2656
+ },
2657
+ title: function(element) {
2658
+ return element.title;
2659
+ }
2660
+ }
2661
+ }
2662
+ }
2663
+ })();
2664
+
2665
+ Element._attributeTranslations.write = {
2666
+ names: Object.extend({
2667
+ cellpadding: 'cellPadding',
2668
+ cellspacing: 'cellSpacing'
2669
+ }, Element._attributeTranslations.read.names),
2670
+ values: {
2671
+ checked: function(element, value) {
2672
+ element.checked = !!value;
2673
+ },
2674
+
2675
+ style: function(element, value) {
2676
+ element.style.cssText = value ? value : '';
2677
+ }
2678
+ }
2679
+ };
2680
+
2681
+ Element._attributeTranslations.has = {};
2682
+
2683
+ $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
2684
+ 'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
2685
+ Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
2686
+ Element._attributeTranslations.has[attr.toLowerCase()] = attr;
2687
+ });
2688
+
2689
+ (function(v) {
2690
+ Object.extend(v, {
2691
+ href: v._getAttr2,
2692
+ src: v._getAttr2,
2693
+ type: v._getAttr,
2694
+ action: v._getAttrNode,
2695
+ disabled: v._flag,
2696
+ checked: v._flag,
2697
+ readonly: v._flag,
2698
+ multiple: v._flag,
2699
+ onload: v._getEv,
2700
+ onunload: v._getEv,
2701
+ onclick: v._getEv,
2702
+ ondblclick: v._getEv,
2703
+ onmousedown: v._getEv,
2704
+ onmouseup: v._getEv,
2705
+ onmouseover: v._getEv,
2706
+ onmousemove: v._getEv,
2707
+ onmouseout: v._getEv,
2708
+ onfocus: v._getEv,
2709
+ onblur: v._getEv,
2710
+ onkeypress: v._getEv,
2711
+ onkeydown: v._getEv,
2712
+ onkeyup: v._getEv,
2713
+ onsubmit: v._getEv,
2714
+ onreset: v._getEv,
2715
+ onselect: v._getEv,
2716
+ onchange: v._getEv
2717
+ });
2718
+ })(Element._attributeTranslations.read.values);
2719
+
2720
+ if (Prototype.BrowserFeatures.ElementExtensions) {
2721
+ (function() {
2722
+ function _descendants(element) {
2723
+ var nodes = element.getElementsByTagName('*'), results = [];
2724
+ for (var i = 0, node; node = nodes[i]; i++)
2725
+ if (node.tagName !== "!") // Filter out comment nodes.
2726
+ results.push(node);
2727
+ return results;
2728
+ }
2729
+
2730
+ Element.Methods.down = function(element, expression, index) {
2731
+ element = $(element);
2732
+ if (arguments.length == 1) return element.firstDescendant();
2733
+ return Object.isNumber(expression) ? _descendants(element)[expression] :
2734
+ Element.select(element, expression)[index || 0];
2735
+ }
2736
+ })();
2737
+ }
2738
+
2739
+ }
2740
+
2741
+ else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
2742
+ Element.Methods.setOpacity = function(element, value) {
2743
+ element = $(element);
2744
+ element.style.opacity = (value == 1) ? 0.999999 :
2745
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
2746
+ return element;
2747
+ };
2748
+ }
2749
+
2750
+ else if (Prototype.Browser.WebKit) {
2751
+ Element.Methods.setOpacity = function(element, value) {
2752
+ element = $(element);
2753
+ element.style.opacity = (value == 1 || value === '') ? '' :
2754
+ (value < 0.00001) ? 0 : value;
2755
+
2756
+ if (value == 1)
2757
+ if (element.tagName.toUpperCase() == 'IMG' && element.width) {
2758
+ element.width++; element.width--;
2759
+ } else try {
2760
+ var n = document.createTextNode(' ');
2761
+ element.appendChild(n);
2762
+ element.removeChild(n);
2763
+ } catch (e) { }
2764
+
2765
+ return element;
2766
+ };
2767
+ }
2768
+
2769
+ if ('outerHTML' in document.documentElement) {
2770
+ Element.Methods.replace = function(element, content) {
2771
+ element = $(element);
2772
+
2773
+ if (content && content.toElement) content = content.toElement();
2774
+ if (Object.isElement(content)) {
2775
+ element.parentNode.replaceChild(content, element);
2776
+ return element;
2777
+ }
2778
+
2779
+ content = Object.toHTML(content);
2780
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
2781
+
2782
+ if (Element._insertionTranslations.tags[tagName]) {
2783
+ var nextSibling = element.next(),
2784
+ fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
2785
+ parent.removeChild(element);
2786
+ if (nextSibling)
2787
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
2788
+ else
2789
+ fragments.each(function(node) { parent.appendChild(node) });
2790
+ }
2791
+ else element.outerHTML = content.stripScripts();
2792
+
2793
+ content.evalScripts.bind(content).defer();
2794
+ return element;
2795
+ };
2796
+ }
2797
+
2798
+ Element._returnOffset = function(l, t) {
2799
+ var result = [l, t];
2800
+ result.left = l;
2801
+ result.top = t;
2802
+ return result;
2803
+ };
2804
+
2805
+ Element._getContentFromAnonymousElement = function(tagName, html, force) {
2806
+ var div = new Element('div'),
2807
+ t = Element._insertionTranslations.tags[tagName];
2808
+
2809
+ var workaround = false;
2810
+ if (t) workaround = true;
2811
+ else if (force) {
2812
+ workaround = true;
2813
+ t = ['', '', 0];
2814
+ }
2815
+
2816
+ if (workaround) {
2817
+ div.innerHTML = '&nbsp;' + t[0] + html + t[1];
2818
+ div.removeChild(div.firstChild);
2819
+ for (var i = t[2]; i--; ) {
2820
+ div = div.firstChild;
2821
+ }
2822
+ }
2823
+ else {
2824
+ div.innerHTML = html;
2825
+ }
2826
+ return $A(div.childNodes);
2827
+ };
2828
+
2829
+ Element._insertionTranslations = {
2830
+ before: function(element, node) {
2831
+ element.parentNode.insertBefore(node, element);
2832
+ },
2833
+ top: function(element, node) {
2834
+ element.insertBefore(node, element.firstChild);
2835
+ },
2836
+ bottom: function(element, node) {
2837
+ element.appendChild(node);
2838
+ },
2839
+ after: function(element, node) {
2840
+ element.parentNode.insertBefore(node, element.nextSibling);
2841
+ },
2842
+ tags: {
2843
+ TABLE: ['<table>', '</table>', 1],
2844
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
2845
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
2846
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
2847
+ SELECT: ['<select>', '</select>', 1]
2848
+ }
2849
+ };
2850
+
2851
+ (function() {
2852
+ var tags = Element._insertionTranslations.tags;
2853
+ Object.extend(tags, {
2854
+ THEAD: tags.TBODY,
2855
+ TFOOT: tags.TBODY,
2856
+ TH: tags.TD
2857
+ });
2858
+ })();
2859
+
2860
+ Element.Methods.Simulated = {
2861
+ hasAttribute: function(element, attribute) {
2862
+ attribute = Element._attributeTranslations.has[attribute] || attribute;
2863
+ var node = $(element).getAttributeNode(attribute);
2864
+ return !!(node && node.specified);
2865
+ }
2866
+ };
2867
+
2868
+ Element.Methods.ByTag = { };
2869
+
2870
+ Object.extend(Element, Element.Methods);
2871
+
2872
+ (function(div) {
2873
+
2874
+ if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
2875
+ window.HTMLElement = { };
2876
+ window.HTMLElement.prototype = div['__proto__'];
2877
+ Prototype.BrowserFeatures.ElementExtensions = true;
2878
+ }
2879
+
2880
+ div = null;
2881
+
2882
+ })(document.createElement('div'));
2883
+
2884
+ Element.extend = (function() {
2885
+
2886
+ function checkDeficiency(tagName) {
2887
+ if (typeof window.Element != 'undefined') {
2888
+ var proto = window.Element.prototype;
2889
+ if (proto) {
2890
+ var id = '_' + (Math.random()+'').slice(2),
2891
+ el = document.createElement(tagName);
2892
+ proto[id] = 'x';
2893
+ var isBuggy = (el[id] !== 'x');
2894
+ delete proto[id];
2895
+ el = null;
2896
+ return isBuggy;
2897
+ }
2898
+ }
2899
+ return false;
2900
+ }
2901
+
2902
+ function extendElementWith(element, methods) {
2903
+ for (var property in methods) {
2904
+ var value = methods[property];
2905
+ if (Object.isFunction(value) && !(property in element))
2906
+ element[property] = value.methodize();
2907
+ }
2908
+ }
2909
+
2910
+ var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
2911
+
2912
+ if (Prototype.BrowserFeatures.SpecificElementExtensions) {
2913
+ if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
2914
+ return function(element) {
2915
+ if (element && typeof element._extendedByPrototype == 'undefined') {
2916
+ var t = element.tagName;
2917
+ if (t && (/^(?:object|applet|embed)$/i.test(t))) {
2918
+ extendElementWith(element, Element.Methods);
2919
+ extendElementWith(element, Element.Methods.Simulated);
2920
+ extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
2921
+ }
2922
+ }
2923
+ return element;
2924
+ }
2925
+ }
2926
+ return Prototype.K;
2927
+ }
2928
+
2929
+ var Methods = { }, ByTag = Element.Methods.ByTag;
2930
+
2931
+ var extend = Object.extend(function(element) {
2932
+ if (!element || typeof element._extendedByPrototype != 'undefined' ||
2933
+ element.nodeType != 1 || element == window) return element;
2934
+
2935
+ var methods = Object.clone(Methods),
2936
+ tagName = element.tagName.toUpperCase();
2937
+
2938
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
2939
+
2940
+ extendElementWith(element, methods);
2941
+
2942
+ element._extendedByPrototype = Prototype.emptyFunction;
2943
+ return element;
2944
+
2945
+ }, {
2946
+ refresh: function() {
2947
+ if (!Prototype.BrowserFeatures.ElementExtensions) {
2948
+ Object.extend(Methods, Element.Methods);
2949
+ Object.extend(Methods, Element.Methods.Simulated);
2950
+ }
2951
+ }
2952
+ });
2953
+
2954
+ extend.refresh();
2955
+ return extend;
2956
+ })();
2957
+
2958
+ if (document.documentElement.hasAttribute) {
2959
+ Element.hasAttribute = function(element, attribute) {
2960
+ return element.hasAttribute(attribute);
2961
+ };
2962
+ }
2963
+ else {
2964
+ Element.hasAttribute = Element.Methods.Simulated.hasAttribute;
2965
+ }
2966
+
2967
+ Element.addMethods = function(methods) {
2968
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
2969
+
2970
+ if (!methods) {
2971
+ Object.extend(Form, Form.Methods);
2972
+ Object.extend(Form.Element, Form.Element.Methods);
2973
+ Object.extend(Element.Methods.ByTag, {
2974
+ "FORM": Object.clone(Form.Methods),
2975
+ "INPUT": Object.clone(Form.Element.Methods),
2976
+ "SELECT": Object.clone(Form.Element.Methods),
2977
+ "TEXTAREA": Object.clone(Form.Element.Methods),
2978
+ "BUTTON": Object.clone(Form.Element.Methods)
2979
+ });
2980
+ }
2981
+
2982
+ if (arguments.length == 2) {
2983
+ var tagName = methods;
2984
+ methods = arguments[1];
2985
+ }
2986
+
2987
+ if (!tagName) Object.extend(Element.Methods, methods || { });
2988
+ else {
2989
+ if (Object.isArray(tagName)) tagName.each(extend);
2990
+ else extend(tagName);
2991
+ }
2992
+
2993
+ function extend(tagName) {
2994
+ tagName = tagName.toUpperCase();
2995
+ if (!Element.Methods.ByTag[tagName])
2996
+ Element.Methods.ByTag[tagName] = { };
2997
+ Object.extend(Element.Methods.ByTag[tagName], methods);
2998
+ }
2999
+
3000
+ function copy(methods, destination, onlyIfAbsent) {
3001
+ onlyIfAbsent = onlyIfAbsent || false;
3002
+ for (var property in methods) {
3003
+ var value = methods[property];
3004
+ if (!Object.isFunction(value)) continue;
3005
+ if (!onlyIfAbsent || !(property in destination))
3006
+ destination[property] = value.methodize();
3007
+ }
3008
+ }
3009
+
3010
+ function findDOMClass(tagName) {
3011
+ var klass;
3012
+ var trans = {
3013
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
3014
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
3015
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
3016
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
3017
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
3018
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
3019
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
3020
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
3021
+ "FrameSet", "IFRAME": "IFrame"
3022
+ };
3023
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
3024
+ if (window[klass]) return window[klass];
3025
+ klass = 'HTML' + tagName + 'Element';
3026
+ if (window[klass]) return window[klass];
3027
+ klass = 'HTML' + tagName.capitalize() + 'Element';
3028
+ if (window[klass]) return window[klass];
3029
+
3030
+ var element = document.createElement(tagName),
3031
+ proto = element['__proto__'] || element.constructor.prototype;
3032
+
3033
+ element = null;
3034
+ return proto;
3035
+ }
3036
+
3037
+ var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
3038
+ Element.prototype;
3039
+
3040
+ if (F.ElementExtensions) {
3041
+ copy(Element.Methods, elementPrototype);
3042
+ copy(Element.Methods.Simulated, elementPrototype, true);
3043
+ }
3044
+
3045
+ if (F.SpecificElementExtensions) {
3046
+ for (var tag in Element.Methods.ByTag) {
3047
+ var klass = findDOMClass(tag);
3048
+ if (Object.isUndefined(klass)) continue;
3049
+ copy(T[tag], klass.prototype);
3050
+ }
3051
+ }
3052
+
3053
+ Object.extend(Element, Element.Methods);
3054
+ delete Element.ByTag;
3055
+
3056
+ if (Element.extend.refresh) Element.extend.refresh();
3057
+ Element.cache = { };
3058
+ };
3059
+
3060
+
3061
+ document.viewport = {
3062
+
3063
+ getDimensions: function() {
3064
+ return { width: this.getWidth(), height: this.getHeight() };
3065
+ },
3066
+
3067
+ getScrollOffsets: function() {
3068
+ return Element._returnOffset(
3069
+ window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
3070
+ window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
3071
+ }
3072
+ };
3073
+
3074
+ (function(viewport) {
3075
+ var B = Prototype.Browser, doc = document, element, property = {};
3076
+
3077
+ function getRootElement() {
3078
+ if (B.WebKit && !doc.evaluate)
3079
+ return document;
3080
+
3081
+ if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
3082
+ return document.body;
3083
+
3084
+ return document.documentElement;
3085
+ }
3086
+
3087
+ function define(D) {
3088
+ if (!element) element = getRootElement();
3089
+
3090
+ property[D] = 'client' + D;
3091
+
3092
+ viewport['get' + D] = function() { return element[property[D]] };
3093
+ return viewport['get' + D]();
3094
+ }
3095
+
3096
+ viewport.getWidth = define.curry('Width');
3097
+
3098
+ viewport.getHeight = define.curry('Height');
3099
+ })(document.viewport);
3100
+
3101
+
3102
+ Element.Storage = {
3103
+ UID: 1
3104
+ };
3105
+
3106
+ Element.addMethods({
3107
+ getStorage: function(element) {
3108
+ if (!(element = $(element))) return;
3109
+
3110
+ var uid;
3111
+ if (element === window) {
3112
+ uid = 0;
3113
+ } else {
3114
+ if (typeof element._prototypeUID === "undefined")
3115
+ element._prototypeUID = Element.Storage.UID++;
3116
+ uid = element._prototypeUID;
3117
+ }
3118
+
3119
+ if (!Element.Storage[uid])
3120
+ Element.Storage[uid] = $H();
3121
+
3122
+ return Element.Storage[uid];
3123
+ },
3124
+
3125
+ store: function(element, key, value) {
3126
+ if (!(element = $(element))) return;
3127
+
3128
+ if (arguments.length === 2) {
3129
+ Element.getStorage(element).update(key);
3130
+ } else {
3131
+ Element.getStorage(element).set(key, value);
3132
+ }
3133
+
3134
+ return element;
3135
+ },
3136
+
3137
+ retrieve: function(element, key, defaultValue) {
3138
+ if (!(element = $(element))) return;
3139
+ var hash = Element.getStorage(element), value = hash.get(key);
3140
+
3141
+ if (Object.isUndefined(value)) {
3142
+ hash.set(key, defaultValue);
3143
+ value = defaultValue;
3144
+ }
3145
+
3146
+ return value;
3147
+ },
3148
+
3149
+ clone: function(element, deep) {
3150
+ if (!(element = $(element))) return;
3151
+ var clone = element.cloneNode(deep);
3152
+ clone._prototypeUID = void 0;
3153
+ if (deep) {
3154
+ var descendants = Element.select(clone, '*'),
3155
+ i = descendants.length;
3156
+ while (i--) {
3157
+ descendants[i]._prototypeUID = void 0;
3158
+ }
3159
+ }
3160
+ return Element.extend(clone);
3161
+ },
3162
+
3163
+ purge: function(element) {
3164
+ if (!(element = $(element))) return;
3165
+ var purgeElement = Element._purgeElement;
3166
+
3167
+ purgeElement(element);
3168
+
3169
+ var descendants = element.getElementsByTagName('*'),
3170
+ i = descendants.length;
3171
+
3172
+ while (i--) purgeElement(descendants[i]);
3173
+
3174
+ return null;
3175
+ }
3176
+ });
3177
+
3178
+ (function() {
3179
+
3180
+ function toDecimal(pctString) {
3181
+ var match = pctString.match(/^(\d+)%?$/i);
3182
+ if (!match) return null;
3183
+ return (Number(match[1]) / 100);
3184
+ }
3185
+
3186
+ function getPixelValue(value, property, context) {
3187
+ var element = null;
3188
+ if (Object.isElement(value)) {
3189
+ element = value;
3190
+ value = element.getStyle(property);
3191
+ }
3192
+
3193
+ if (value === null) {
3194
+ return null;
3195
+ }
3196
+
3197
+ if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
3198
+ return window.parseFloat(value);
3199
+ }
3200
+
3201
+ var isPercentage = value.include('%'), isViewport = (context === document.viewport);
3202
+
3203
+ if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
3204
+ var style = element.style.left, rStyle = element.runtimeStyle.left;
3205
+ element.runtimeStyle.left = element.currentStyle.left;
3206
+ element.style.left = value || 0;
3207
+ value = element.style.pixelLeft;
3208
+ element.style.left = style;
3209
+ element.runtimeStyle.left = rStyle;
3210
+
3211
+ return value;
3212
+ }
3213
+
3214
+ if (element && isPercentage) {
3215
+ context = context || element.parentNode;
3216
+ var decimal = toDecimal(value);
3217
+ var whole = null;
3218
+ var position = element.getStyle('position');
3219
+
3220
+ var isHorizontal = property.include('left') || property.include('right') ||
3221
+ property.include('width');
3222
+
3223
+ var isVertical = property.include('top') || property.include('bottom') ||
3224
+ property.include('height');
3225
+
3226
+ if (context === document.viewport) {
3227
+ if (isHorizontal) {
3228
+ whole = document.viewport.getWidth();
3229
+ } else if (isVertical) {
3230
+ whole = document.viewport.getHeight();
3231
+ }
3232
+ } else {
3233
+ if (isHorizontal) {
3234
+ whole = $(context).measure('width');
3235
+ } else if (isVertical) {
3236
+ whole = $(context).measure('height');
3237
+ }
3238
+ }
3239
+
3240
+ return (whole === null) ? 0 : whole * decimal;
3241
+ }
3242
+
3243
+ return 0;
3244
+ }
3245
+
3246
+ function toCSSPixels(number) {
3247
+ if (Object.isString(number) && number.endsWith('px')) {
3248
+ return number;
3249
+ }
3250
+ return number + 'px';
3251
+ }
3252
+
3253
+ function isDisplayed(element) {
3254
+ var originalElement = element;
3255
+ while (element && element.parentNode) {
3256
+ var display = element.getStyle('display');
3257
+ if (display === 'none') {
3258
+ return false;
3259
+ }
3260
+ element = $(element.parentNode);
3261
+ }
3262
+ return true;
3263
+ }
3264
+
3265
+ var hasLayout = Prototype.K;
3266
+ if ('currentStyle' in document.documentElement) {
3267
+ hasLayout = function(element) {
3268
+ if (!element.currentStyle.hasLayout) {
3269
+ element.style.zoom = 1;
3270
+ }
3271
+ return element;
3272
+ };
3273
+ }
3274
+
3275
+ function cssNameFor(key) {
3276
+ if (key.include('border')) key = key + '-width';
3277
+ return key.camelize();
3278
+ }
3279
+
3280
+ Element.Layout = Class.create(Hash, {
3281
+ initialize: function($super, element, preCompute) {
3282
+ $super();
3283
+ this.element = $(element);
3284
+
3285
+ Element.Layout.PROPERTIES.each( function(property) {
3286
+ this._set(property, null);
3287
+ }, this);
3288
+
3289
+ if (preCompute) {
3290
+ this._preComputing = true;
3291
+ this._begin();
3292
+ Element.Layout.PROPERTIES.each( this._compute, this );
3293
+ this._end();
3294
+ this._preComputing = false;
3295
+ }
3296
+ },
3297
+
3298
+ _set: function(property, value) {
3299
+ return Hash.prototype.set.call(this, property, value);
3300
+ },
3301
+
3302
+ set: function(property, value) {
3303
+ throw "Properties of Element.Layout are read-only.";
3304
+ },
3305
+
3306
+ get: function($super, property) {
3307
+ var value = $super(property);
3308
+ return value === null ? this._compute(property) : value;
3309
+ },
3310
+
3311
+ _begin: function() {
3312
+ if (this._prepared) return;
3313
+
3314
+ var element = this.element;
3315
+ if (isDisplayed(element)) {
3316
+ this._prepared = true;
3317
+ return;
3318
+ }
3319
+
3320
+ var originalStyles = {
3321
+ position: element.style.position || '',
3322
+ width: element.style.width || '',
3323
+ visibility: element.style.visibility || '',
3324
+ display: element.style.display || ''
3325
+ };
3326
+
3327
+ element.store('prototype_original_styles', originalStyles);
3328
+
3329
+ var position = element.getStyle('position'),
3330
+ width = element.getStyle('width');
3331
+
3332
+ if (width === "0px" || width === null) {
3333
+ element.style.display = 'block';
3334
+ width = element.getStyle('width');
3335
+ }
3336
+
3337
+ var context = (position === 'fixed') ? document.viewport :
3338
+ element.parentNode;
3339
+
3340
+ element.setStyle({
3341
+ position: 'absolute',
3342
+ visibility: 'hidden',
3343
+ display: 'block'
3344
+ });
3345
+
3346
+ var positionedWidth = element.getStyle('width');
3347
+
3348
+ var newWidth;
3349
+ if (width && (positionedWidth === width)) {
3350
+ newWidth = getPixelValue(element, 'width', context);
3351
+ } else if (position === 'absolute' || position === 'fixed') {
3352
+ newWidth = getPixelValue(element, 'width', context);
3353
+ } else {
3354
+ var parent = element.parentNode, pLayout = $(parent).getLayout();
3355
+
3356
+ newWidth = pLayout.get('width') -
3357
+ this.get('margin-left') -
3358
+ this.get('border-left') -
3359
+ this.get('padding-left') -
3360
+ this.get('padding-right') -
3361
+ this.get('border-right') -
3362
+ this.get('margin-right');
3363
+ }
3364
+
3365
+ element.setStyle({ width: newWidth + 'px' });
3366
+
3367
+ this._prepared = true;
3368
+ },
3369
+
3370
+ _end: function() {
3371
+ var element = this.element;
3372
+ var originalStyles = element.retrieve('prototype_original_styles');
3373
+ element.store('prototype_original_styles', null);
3374
+ element.setStyle(originalStyles);
3375
+ this._prepared = false;
3376
+ },
3377
+
3378
+ _compute: function(property) {
3379
+ var COMPUTATIONS = Element.Layout.COMPUTATIONS;
3380
+ if (!(property in COMPUTATIONS)) {
3381
+ throw "Property not found.";
3382
+ }
3383
+
3384
+ return this._set(property, COMPUTATIONS[property].call(this, this.element));
3385
+ },
3386
+
3387
+ toObject: function() {
3388
+ var args = $A(arguments);
3389
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
3390
+ args.join(' ').split(' ');
3391
+ var obj = {};
3392
+ keys.each( function(key) {
3393
+ if (!Element.Layout.PROPERTIES.include(key)) return;
3394
+ var value = this.get(key);
3395
+ if (value != null) obj[key] = value;
3396
+ }, this);
3397
+ return obj;
3398
+ },
3399
+
3400
+ toHash: function() {
3401
+ var obj = this.toObject.apply(this, arguments);
3402
+ return new Hash(obj);
3403
+ },
3404
+
3405
+ toCSS: function() {
3406
+ var args = $A(arguments);
3407
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
3408
+ args.join(' ').split(' ');
3409
+ var css = {};
3410
+
3411
+ keys.each( function(key) {
3412
+ if (!Element.Layout.PROPERTIES.include(key)) return;
3413
+ if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
3414
+
3415
+ var value = this.get(key);
3416
+ if (value != null) css[cssNameFor(key)] = value + 'px';
3417
+ }, this);
3418
+ return css;
3419
+ },
3420
+
3421
+ inspect: function() {
3422
+ return "#<Element.Layout>";
3423
+ }
3424
+ });
3425
+
3426
+ Object.extend(Element.Layout, {
3427
+ PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
3428
+
3429
+ COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
3430
+
3431
+ COMPUTATIONS: {
3432
+ 'height': function(element) {
3433
+ if (!this._preComputing) this._begin();
3434
+
3435
+ var bHeight = this.get('border-box-height');
3436
+ if (bHeight <= 0) {
3437
+ if (!this._preComputing) this._end();
3438
+ return 0;
3439
+ }
3440
+
3441
+ var bTop = this.get('border-top'),
3442
+ bBottom = this.get('border-bottom');
3443
+
3444
+ var pTop = this.get('padding-top'),
3445
+ pBottom = this.get('padding-bottom');
3446
+
3447
+ if (!this._preComputing) this._end();
3448
+
3449
+ return bHeight - bTop - bBottom - pTop - pBottom;
3450
+ },
3451
+
3452
+ 'width': function(element) {
3453
+ if (!this._preComputing) this._begin();
3454
+
3455
+ var bWidth = this.get('border-box-width');
3456
+ if (bWidth <= 0) {
3457
+ if (!this._preComputing) this._end();
3458
+ return 0;
3459
+ }
3460
+
3461
+ var bLeft = this.get('border-left'),
3462
+ bRight = this.get('border-right');
3463
+
3464
+ var pLeft = this.get('padding-left'),
3465
+ pRight = this.get('padding-right');
3466
+
3467
+ if (!this._preComputing) this._end();
3468
+
3469
+ return bWidth - bLeft - bRight - pLeft - pRight;
3470
+ },
3471
+
3472
+ 'padding-box-height': function(element) {
3473
+ var height = this.get('height'),
3474
+ pTop = this.get('padding-top'),
3475
+ pBottom = this.get('padding-bottom');
3476
+
3477
+ return height + pTop + pBottom;
3478
+ },
3479
+
3480
+ 'padding-box-width': function(element) {
3481
+ var width = this.get('width'),
3482
+ pLeft = this.get('padding-left'),
3483
+ pRight = this.get('padding-right');
3484
+
3485
+ return width + pLeft + pRight;
3486
+ },
3487
+
3488
+ 'border-box-height': function(element) {
3489
+ if (!this._preComputing) this._begin();
3490
+ var height = element.offsetHeight;
3491
+ if (!this._preComputing) this._end();
3492
+ return height;
3493
+ },
3494
+
3495
+ 'border-box-width': function(element) {
3496
+ if (!this._preComputing) this._begin();
3497
+ var width = element.offsetWidth;
3498
+ if (!this._preComputing) this._end();
3499
+ return width;
3500
+ },
3501
+
3502
+ 'margin-box-height': function(element) {
3503
+ var bHeight = this.get('border-box-height'),
3504
+ mTop = this.get('margin-top'),
3505
+ mBottom = this.get('margin-bottom');
3506
+
3507
+ if (bHeight <= 0) return 0;
3508
+
3509
+ return bHeight + mTop + mBottom;
3510
+ },
3511
+
3512
+ 'margin-box-width': function(element) {
3513
+ var bWidth = this.get('border-box-width'),
3514
+ mLeft = this.get('margin-left'),
3515
+ mRight = this.get('margin-right');
3516
+
3517
+ if (bWidth <= 0) return 0;
3518
+
3519
+ return bWidth + mLeft + mRight;
3520
+ },
3521
+
3522
+ 'top': function(element) {
3523
+ var offset = element.positionedOffset();
3524
+ return offset.top;
3525
+ },
3526
+
3527
+ 'bottom': function(element) {
3528
+ var offset = element.positionedOffset(),
3529
+ parent = element.getOffsetParent(),
3530
+ pHeight = parent.measure('height');
3531
+
3532
+ var mHeight = this.get('border-box-height');
3533
+
3534
+ return pHeight - mHeight - offset.top;
3535
+ },
3536
+
3537
+ 'left': function(element) {
3538
+ var offset = element.positionedOffset();
3539
+ return offset.left;
3540
+ },
3541
+
3542
+ 'right': function(element) {
3543
+ var offset = element.positionedOffset(),
3544
+ parent = element.getOffsetParent(),
3545
+ pWidth = parent.measure('width');
3546
+
3547
+ var mWidth = this.get('border-box-width');
3548
+
3549
+ return pWidth - mWidth - offset.left;
3550
+ },
3551
+
3552
+ 'padding-top': function(element) {
3553
+ return getPixelValue(element, 'paddingTop');
3554
+ },
3555
+
3556
+ 'padding-bottom': function(element) {
3557
+ return getPixelValue(element, 'paddingBottom');
3558
+ },
3559
+
3560
+ 'padding-left': function(element) {
3561
+ return getPixelValue(element, 'paddingLeft');
3562
+ },
3563
+
3564
+ 'padding-right': function(element) {
3565
+ return getPixelValue(element, 'paddingRight');
3566
+ },
3567
+
3568
+ 'border-top': function(element) {
3569
+ return getPixelValue(element, 'borderTopWidth');
3570
+ },
3571
+
3572
+ 'border-bottom': function(element) {
3573
+ return getPixelValue(element, 'borderBottomWidth');
3574
+ },
3575
+
3576
+ 'border-left': function(element) {
3577
+ return getPixelValue(element, 'borderLeftWidth');
3578
+ },
3579
+
3580
+ 'border-right': function(element) {
3581
+ return getPixelValue(element, 'borderRightWidth');
3582
+ },
3583
+
3584
+ 'margin-top': function(element) {
3585
+ return getPixelValue(element, 'marginTop');
3586
+ },
3587
+
3588
+ 'margin-bottom': function(element) {
3589
+ return getPixelValue(element, 'marginBottom');
3590
+ },
3591
+
3592
+ 'margin-left': function(element) {
3593
+ return getPixelValue(element, 'marginLeft');
3594
+ },
3595
+
3596
+ 'margin-right': function(element) {
3597
+ return getPixelValue(element, 'marginRight');
3598
+ }
3599
+ }
3600
+ });
3601
+
3602
+ if ('getBoundingClientRect' in document.documentElement) {
3603
+ Object.extend(Element.Layout.COMPUTATIONS, {
3604
+ 'right': function(element) {
3605
+ var parent = hasLayout(element.getOffsetParent());
3606
+ var rect = element.getBoundingClientRect(),
3607
+ pRect = parent.getBoundingClientRect();
3608
+
3609
+ return (pRect.right - rect.right).round();
3610
+ },
3611
+
3612
+ 'bottom': function(element) {
3613
+ var parent = hasLayout(element.getOffsetParent());
3614
+ var rect = element.getBoundingClientRect(),
3615
+ pRect = parent.getBoundingClientRect();
3616
+
3617
+ return (pRect.bottom - rect.bottom).round();
3618
+ }
3619
+ });
3620
+ }
3621
+
3622
+ Element.Offset = Class.create({
3623
+ initialize: function(left, top) {
3624
+ this.left = left.round();
3625
+ this.top = top.round();
3626
+
3627
+ this[0] = this.left;
3628
+ this[1] = this.top;
3629
+ },
3630
+
3631
+ relativeTo: function(offset) {
3632
+ return new Element.Offset(
3633
+ this.left - offset.left,
3634
+ this.top - offset.top
3635
+ );
3636
+ },
3637
+
3638
+ inspect: function() {
3639
+ return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
3640
+ },
3641
+
3642
+ toString: function() {
3643
+ return "[#{left}, #{top}]".interpolate(this);
3644
+ },
3645
+
3646
+ toArray: function() {
3647
+ return [this.left, this.top];
3648
+ }
3649
+ });
3650
+
3651
+ function getLayout(element, preCompute) {
3652
+ return new Element.Layout(element, preCompute);
3653
+ }
3654
+
3655
+ function measure(element, property) {
3656
+ return $(element).getLayout().get(property);
3657
+ }
3658
+
3659
+ function getDimensions(element) {
3660
+ element = $(element);
3661
+ var display = Element.getStyle(element, 'display');
3662
+
3663
+ if (display && display !== 'none') {
3664
+ return { width: element.offsetWidth, height: element.offsetHeight };
3665
+ }
3666
+
3667
+ var style = element.style;
3668
+ var originalStyles = {
3669
+ visibility: style.visibility,
3670
+ position: style.position,
3671
+ display: style.display
3672
+ };
3673
+
3674
+ var newStyles = {
3675
+ visibility: 'hidden',
3676
+ display: 'block'
3677
+ };
3678
+
3679
+ if (originalStyles.position !== 'fixed')
3680
+ newStyles.position = 'absolute';
3681
+
3682
+ Element.setStyle(element, newStyles);
3683
+
3684
+ var dimensions = {
3685
+ width: element.offsetWidth,
3686
+ height: element.offsetHeight
3687
+ };
3688
+
3689
+ Element.setStyle(element, originalStyles);
3690
+
3691
+ return dimensions;
3692
+ }
3693
+
3694
+ function getOffsetParent(element) {
3695
+ element = $(element);
3696
+
3697
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
3698
+ return $(document.body);
3699
+
3700
+ var isInline = (Element.getStyle(element, 'display') === 'inline');
3701
+ if (!isInline && element.offsetParent) return $(element.offsetParent);
3702
+
3703
+ while ((element = element.parentNode) && element !== document.body) {
3704
+ if (Element.getStyle(element, 'position') !== 'static') {
3705
+ return isHtml(element) ? $(document.body) : $(element);
3706
+ }
3707
+ }
3708
+
3709
+ return $(document.body);
3710
+ }
3711
+
3712
+
3713
+ function cumulativeOffset(element) {
3714
+ element = $(element);
3715
+ var valueT = 0, valueL = 0;
3716
+ if (element.parentNode) {
3717
+ do {
3718
+ valueT += element.offsetTop || 0;
3719
+ valueL += element.offsetLeft || 0;
3720
+ element = element.offsetParent;
3721
+ } while (element);
3722
+ }
3723
+ return new Element.Offset(valueL, valueT);
3724
+ }
3725
+
3726
+ function positionedOffset(element) {
3727
+ element = $(element);
3728
+
3729
+ var layout = element.getLayout();
3730
+
3731
+ var valueT = 0, valueL = 0;
3732
+ do {
3733
+ valueT += element.offsetTop || 0;
3734
+ valueL += element.offsetLeft || 0;
3735
+ element = element.offsetParent;
3736
+ if (element) {
3737
+ if (isBody(element)) break;
3738
+ var p = Element.getStyle(element, 'position');
3739
+ if (p !== 'static') break;
3740
+ }
3741
+ } while (element);
3742
+
3743
+ valueL -= layout.get('margin-top');
3744
+ valueT -= layout.get('margin-left');
3745
+
3746
+ return new Element.Offset(valueL, valueT);
3747
+ }
3748
+
3749
+ function cumulativeScrollOffset(element) {
3750
+ var valueT = 0, valueL = 0;
3751
+ do {
3752
+ valueT += element.scrollTop || 0;
3753
+ valueL += element.scrollLeft || 0;
3754
+ element = element.parentNode;
3755
+ } while (element);
3756
+ return new Element.Offset(valueL, valueT);
3757
+ }
3758
+
3759
+ function viewportOffset(forElement) {
3760
+ element = $(element);
3761
+ var valueT = 0, valueL = 0, docBody = document.body;
3762
+
3763
+ var element = forElement;
3764
+ do {
3765
+ valueT += element.offsetTop || 0;
3766
+ valueL += element.offsetLeft || 0;
3767
+ if (element.offsetParent == docBody &&
3768
+ Element.getStyle(element, 'position') == 'absolute') break;
3769
+ } while (element = element.offsetParent);
3770
+
3771
+ element = forElement;
3772
+ do {
3773
+ if (element != docBody) {
3774
+ valueT -= element.scrollTop || 0;
3775
+ valueL -= element.scrollLeft || 0;
3776
+ }
3777
+ } while (element = element.parentNode);
3778
+ return new Element.Offset(valueL, valueT);
3779
+ }
3780
+
3781
+ function absolutize(element) {
3782
+ element = $(element);
3783
+
3784
+ if (Element.getStyle(element, 'position') === 'absolute') {
3785
+ return element;
3786
+ }
3787
+
3788
+ var offsetParent = getOffsetParent(element);
3789
+ var eOffset = element.viewportOffset(),
3790
+ pOffset = offsetParent.viewportOffset();
3791
+
3792
+ var offset = eOffset.relativeTo(pOffset);
3793
+ var layout = element.getLayout();
3794
+
3795
+ element.store('prototype_absolutize_original_styles', {
3796
+ left: element.getStyle('left'),
3797
+ top: element.getStyle('top'),
3798
+ width: element.getStyle('width'),
3799
+ height: element.getStyle('height')
3800
+ });
3801
+
3802
+ element.setStyle({
3803
+ position: 'absolute',
3804
+ top: offset.top + 'px',
3805
+ left: offset.left + 'px',
3806
+ width: layout.get('width') + 'px',
3807
+ height: layout.get('height') + 'px'
3808
+ });
3809
+
3810
+ return element;
3811
+ }
3812
+
3813
+ function relativize(element) {
3814
+ element = $(element);
3815
+ if (Element.getStyle(element, 'position') === 'relative') {
3816
+ return element;
3817
+ }
3818
+
3819
+ var originalStyles =
3820
+ element.retrieve('prototype_absolutize_original_styles');
3821
+
3822
+ if (originalStyles) element.setStyle(originalStyles);
3823
+ return element;
3824
+ }
3825
+
3826
+ if (Prototype.Browser.IE) {
3827
+ getOffsetParent = getOffsetParent.wrap(
3828
+ function(proceed, element) {
3829
+ element = $(element);
3830
+
3831
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
3832
+ return $(document.body);
3833
+
3834
+ var position = element.getStyle('position');
3835
+ if (position !== 'static') return proceed(element);
3836
+
3837
+ element.setStyle({ position: 'relative' });
3838
+ var value = proceed(element);
3839
+ element.setStyle({ position: position });
3840
+ return value;
3841
+ }
3842
+ );
3843
+
3844
+ positionedOffset = positionedOffset.wrap(function(proceed, element) {
3845
+ element = $(element);
3846
+ if (!element.parentNode) return new Element.Offset(0, 0);
3847
+ var position = element.getStyle('position');
3848
+ if (position !== 'static') return proceed(element);
3849
+
3850
+ var offsetParent = element.getOffsetParent();
3851
+ if (offsetParent && offsetParent.getStyle('position') === 'fixed')
3852
+ hasLayout(offsetParent);
3853
+
3854
+ element.setStyle({ position: 'relative' });
3855
+ var value = proceed(element);
3856
+ element.setStyle({ position: position });
3857
+ return value;
3858
+ });
3859
+ } else if (Prototype.Browser.Webkit) {
3860
+ cumulativeOffset = function(element) {
3861
+ element = $(element);
3862
+ var valueT = 0, valueL = 0;
3863
+ do {
3864
+ valueT += element.offsetTop || 0;
3865
+ valueL += element.offsetLeft || 0;
3866
+ if (element.offsetParent == document.body)
3867
+ if (Element.getStyle(element, 'position') == 'absolute') break;
3868
+
3869
+ element = element.offsetParent;
3870
+ } while (element);
3871
+
3872
+ return new Element.Offset(valueL, valueT);
3873
+ };
3874
+ }
3875
+
3876
+
3877
+ Element.addMethods({
3878
+ getLayout: getLayout,
3879
+ measure: measure,
3880
+ getDimensions: getDimensions,
3881
+ getOffsetParent: getOffsetParent,
3882
+ cumulativeOffset: cumulativeOffset,
3883
+ positionedOffset: positionedOffset,
3884
+ cumulativeScrollOffset: cumulativeScrollOffset,
3885
+ viewportOffset: viewportOffset,
3886
+ absolutize: absolutize,
3887
+ relativize: relativize
3888
+ });
3889
+
3890
+ function isBody(element) {
3891
+ return element.nodeName.toUpperCase() === 'BODY';
3892
+ }
3893
+
3894
+ function isHtml(element) {
3895
+ return element.nodeName.toUpperCase() === 'HTML';
3896
+ }
3897
+
3898
+ function isDocument(element) {
3899
+ return element.nodeType === Node.DOCUMENT_NODE;
3900
+ }
3901
+
3902
+ function isDetached(element) {
3903
+ return element !== document.body &&
3904
+ !Element.descendantOf(element, document.body);
3905
+ }
3906
+
3907
+ if ('getBoundingClientRect' in document.documentElement) {
3908
+ Element.addMethods({
3909
+ viewportOffset: function(element) {
3910
+ element = $(element);
3911
+ if (isDetached(element)) return new Element.Offset(0, 0);
3912
+
3913
+ var rect = element.getBoundingClientRect(),
3914
+ docEl = document.documentElement;
3915
+ return new Element.Offset(rect.left - docEl.clientLeft,
3916
+ rect.top - docEl.clientTop);
3917
+ }
3918
+ });
3919
+ }
3920
+ })();
3921
+ window.$$ = function() {
3922
+ var expression = $A(arguments).join(', ');
3923
+ return Prototype.Selector.select(expression, document);
3924
+ };
3925
+
3926
+ Prototype.Selector = (function() {
3927
+
3928
+ function select() {
3929
+ throw new Error('Method "Prototype.Selector.select" must be defined.');
3930
+ }
3931
+
3932
+ function match() {
3933
+ throw new Error('Method "Prototype.Selector.match" must be defined.');
3934
+ }
3935
+
3936
+ function find(elements, expression, index) {
3937
+ index = index || 0;
3938
+ var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
3939
+
3940
+ for (i = 0; i < length; i++) {
3941
+ if (match(elements[i], expression) && index == matchIndex++) {
3942
+ return Element.extend(elements[i]);
3943
+ }
3944
+ }
3945
+ }
3946
+
3947
+ function extendElements(elements) {
3948
+ for (var i = 0, length = elements.length; i < length; i++) {
3949
+ Element.extend(elements[i]);
3950
+ }
3951
+ return elements;
3952
+ }
3953
+
3954
+
3955
+ var K = Prototype.K;
3956
+
3957
+ return {
3958
+ select: select,
3959
+ match: match,
3960
+ find: find,
3961
+ extendElements: (Element.extend === K) ? K : extendElements,
3962
+ extendElement: Element.extend
3963
+ };
3964
+ })();
3965
+ Prototype._original_property = window.Sizzle;
3966
+ /*!
3967
+ * Sizzle CSS Selector Engine - v1.0
3968
+ * Copyright 2009, The Dojo Foundation
3969
+ * Released under the MIT, BSD, and GPL Licenses.
3970
+ * More information: http://sizzlejs.com/
3971
+ */
3972
+ (function(){
3973
+
3974
+ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3975
+ done = 0,
3976
+ toString = Object.prototype.toString,
3977
+ hasDuplicate = false,
3978
+ baseHasDuplicate = true;
3979
+
3980
+ [0, 0].sort(function(){
3981
+ baseHasDuplicate = false;
3982
+ return 0;
3983
+ });
3984
+
3985
+ var Sizzle = function(selector, context, results, seed) {
3986
+ results = results || [];
3987
+ var origContext = context = context || document;
3988
+
3989
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3990
+ return [];
3991
+ }
3992
+
3993
+ if ( !selector || typeof selector !== "string" ) {
3994
+ return results;
3995
+ }
3996
+
3997
+ var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context),
3998
+ soFar = selector;
3999
+
4000
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
4001
+ soFar = m[3];
4002
+
4003
+ parts.push( m[1] );
4004
+
4005
+ if ( m[2] ) {
4006
+ extra = m[3];
4007
+ break;
4008
+ }
4009
+ }
4010
+
4011
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
4012
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
4013
+ set = posProcess( parts[0] + parts[1], context );
4014
+ } else {
4015
+ set = Expr.relative[ parts[0] ] ?
4016
+ [ context ] :
4017
+ Sizzle( parts.shift(), context );
4018
+
4019
+ while ( parts.length ) {
4020
+ selector = parts.shift();
4021
+
4022
+ if ( Expr.relative[ selector ] )
4023
+ selector += parts.shift();
4024
+
4025
+ set = posProcess( selector, set );
4026
+ }
4027
+ }
4028
+ } else {
4029
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
4030
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
4031
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
4032
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
4033
+ }
4034
+
4035
+ if ( context ) {
4036
+ var ret = seed ?
4037
+ { expr: parts.pop(), set: makeArray(seed) } :
4038
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
4039
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
4040
+
4041
+ if ( parts.length > 0 ) {
4042
+ checkSet = makeArray(set);
4043
+ } else {
4044
+ prune = false;
4045
+ }
4046
+
4047
+ while ( parts.length ) {
4048
+ var cur = parts.pop(), pop = cur;
4049
+
4050
+ if ( !Expr.relative[ cur ] ) {
4051
+ cur = "";
4052
+ } else {
4053
+ pop = parts.pop();
4054
+ }
4055
+
4056
+ if ( pop == null ) {
4057
+ pop = context;
4058
+ }
4059
+
4060
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
4061
+ }
4062
+ } else {
4063
+ checkSet = parts = [];
4064
+ }
4065
+ }
4066
+
4067
+ if ( !checkSet ) {
4068
+ checkSet = set;
4069
+ }
4070
+
4071
+ if ( !checkSet ) {
4072
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
4073
+ }
4074
+
4075
+ if ( toString.call(checkSet) === "[object Array]" ) {
4076
+ if ( !prune ) {
4077
+ results.push.apply( results, checkSet );
4078
+ } else if ( context && context.nodeType === 1 ) {
4079
+ for ( var i = 0; checkSet[i] != null; i++ ) {
4080
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
4081
+ results.push( set[i] );
4082
+ }
4083
+ }
4084
+ } else {
4085
+ for ( var i = 0; checkSet[i] != null; i++ ) {
4086
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
4087
+ results.push( set[i] );
4088
+ }
4089
+ }
4090
+ }
4091
+ } else {
4092
+ makeArray( checkSet, results );
4093
+ }
4094
+
4095
+ if ( extra ) {
4096
+ Sizzle( extra, origContext, results, seed );
4097
+ Sizzle.uniqueSort( results );
4098
+ }
4099
+
4100
+ return results;
4101
+ };
4102
+
4103
+ Sizzle.uniqueSort = function(results){
4104
+ if ( sortOrder ) {
4105
+ hasDuplicate = baseHasDuplicate;
4106
+ results.sort(sortOrder);
4107
+
4108
+ if ( hasDuplicate ) {
4109
+ for ( var i = 1; i < results.length; i++ ) {
4110
+ if ( results[i] === results[i-1] ) {
4111
+ results.splice(i--, 1);
4112
+ }
4113
+ }
4114
+ }
4115
+ }
4116
+
4117
+ return results;
4118
+ };
4119
+
4120
+ Sizzle.matches = function(expr, set){
4121
+ return Sizzle(expr, null, null, set);
4122
+ };
4123
+
4124
+ Sizzle.find = function(expr, context, isXML){
4125
+ var set, match;
4126
+
4127
+ if ( !expr ) {
4128
+ return [];
4129
+ }
4130
+
4131
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
4132
+ var type = Expr.order[i], match;
4133
+
4134
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
4135
+ var left = match[1];
4136
+ match.splice(1,1);
4137
+
4138
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
4139
+ match[1] = (match[1] || "").replace(/\\/g, "");
4140
+ set = Expr.find[ type ]( match, context, isXML );
4141
+ if ( set != null ) {
4142
+ expr = expr.replace( Expr.match[ type ], "" );
4143
+ break;
4144
+ }
4145
+ }
4146
+ }
4147
+ }
4148
+
4149
+ if ( !set ) {
4150
+ set = context.getElementsByTagName("*");
4151
+ }
4152
+
4153
+ return {set: set, expr: expr};
4154
+ };
4155
+
4156
+ Sizzle.filter = function(expr, set, inplace, not){
4157
+ var old = expr, result = [], curLoop = set, match, anyFound,
4158
+ isXMLFilter = set && set[0] && isXML(set[0]);
4159
+
4160
+ while ( expr && set.length ) {
4161
+ for ( var type in Expr.filter ) {
4162
+ if ( (match = Expr.match[ type ].exec( expr )) != null ) {
4163
+ var filter = Expr.filter[ type ], found, item;
4164
+ anyFound = false;
4165
+
4166
+ if ( curLoop == result ) {
4167
+ result = [];
4168
+ }
4169
+
4170
+ if ( Expr.preFilter[ type ] ) {
4171
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
4172
+
4173
+ if ( !match ) {
4174
+ anyFound = found = true;
4175
+ } else if ( match === true ) {
4176
+ continue;
4177
+ }
4178
+ }
4179
+
4180
+ if ( match ) {
4181
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
4182
+ if ( item ) {
4183
+ found = filter( item, match, i, curLoop );
4184
+ var pass = not ^ !!found;
4185
+
4186
+ if ( inplace && found != null ) {
4187
+ if ( pass ) {
4188
+ anyFound = true;
4189
+ } else {
4190
+ curLoop[i] = false;
4191
+ }
4192
+ } else if ( pass ) {
4193
+ result.push( item );
4194
+ anyFound = true;
4195
+ }
4196
+ }
4197
+ }
4198
+ }
4199
+
4200
+ if ( found !== undefined ) {
4201
+ if ( !inplace ) {
4202
+ curLoop = result;
4203
+ }
4204
+
4205
+ expr = expr.replace( Expr.match[ type ], "" );
4206
+
4207
+ if ( !anyFound ) {
4208
+ return [];
4209
+ }
4210
+
4211
+ break;
4212
+ }
4213
+ }
4214
+ }
4215
+
4216
+ if ( expr == old ) {
4217
+ if ( anyFound == null ) {
4218
+ throw "Syntax error, unrecognized expression: " + expr;
4219
+ } else {
4220
+ break;
4221
+ }
4222
+ }
4223
+
4224
+ old = expr;
4225
+ }
4226
+
4227
+ return curLoop;
4228
+ };
4229
+
4230
+ var Expr = Sizzle.selectors = {
4231
+ order: [ "ID", "NAME", "TAG" ],
4232
+ match: {
4233
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
4234
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
4235
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
4236
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
4237
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
4238
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
4239
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
4240
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
4241
+ },
4242
+ leftMatch: {},
4243
+ attrMap: {
4244
+ "class": "className",
4245
+ "for": "htmlFor"
4246
+ },
4247
+ attrHandle: {
4248
+ href: function(elem){
4249
+ return elem.getAttribute("href");
4250
+ }
4251
+ },
4252
+ relative: {
4253
+ "+": function(checkSet, part, isXML){
4254
+ var isPartStr = typeof part === "string",
4255
+ isTag = isPartStr && !/\W/.test(part),
4256
+ isPartStrNotTag = isPartStr && !isTag;
4257
+
4258
+ if ( isTag && !isXML ) {
4259
+ part = part.toUpperCase();
4260
+ }
4261
+
4262
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
4263
+ if ( (elem = checkSet[i]) ) {
4264
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
4265
+
4266
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
4267
+ elem || false :
4268
+ elem === part;
4269
+ }
4270
+ }
4271
+
4272
+ if ( isPartStrNotTag ) {
4273
+ Sizzle.filter( part, checkSet, true );
4274
+ }
4275
+ },
4276
+ ">": function(checkSet, part, isXML){
4277
+ var isPartStr = typeof part === "string";
4278
+
4279
+ if ( isPartStr && !/\W/.test(part) ) {
4280
+ part = isXML ? part : part.toUpperCase();
4281
+
4282
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4283
+ var elem = checkSet[i];
4284
+ if ( elem ) {
4285
+ var parent = elem.parentNode;
4286
+ checkSet[i] = parent.nodeName === part ? parent : false;
4287
+ }
4288
+ }
4289
+ } else {
4290
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4291
+ var elem = checkSet[i];
4292
+ if ( elem ) {
4293
+ checkSet[i] = isPartStr ?
4294
+ elem.parentNode :
4295
+ elem.parentNode === part;
4296
+ }
4297
+ }
4298
+
4299
+ if ( isPartStr ) {
4300
+ Sizzle.filter( part, checkSet, true );
4301
+ }
4302
+ }
4303
+ },
4304
+ "": function(checkSet, part, isXML){
4305
+ var doneName = done++, checkFn = dirCheck;
4306
+
4307
+ if ( !/\W/.test(part) ) {
4308
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
4309
+ checkFn = dirNodeCheck;
4310
+ }
4311
+
4312
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
4313
+ },
4314
+ "~": function(checkSet, part, isXML){
4315
+ var doneName = done++, checkFn = dirCheck;
4316
+
4317
+ if ( typeof part === "string" && !/\W/.test(part) ) {
4318
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
4319
+ checkFn = dirNodeCheck;
4320
+ }
4321
+
4322
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
4323
+ }
4324
+ },
4325
+ find: {
4326
+ ID: function(match, context, isXML){
4327
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
4328
+ var m = context.getElementById(match[1]);
4329
+ return m ? [m] : [];
4330
+ }
4331
+ },
4332
+ NAME: function(match, context, isXML){
4333
+ if ( typeof context.getElementsByName !== "undefined" ) {
4334
+ var ret = [], results = context.getElementsByName(match[1]);
4335
+
4336
+ for ( var i = 0, l = results.length; i < l; i++ ) {
4337
+ if ( results[i].getAttribute("name") === match[1] ) {
4338
+ ret.push( results[i] );
4339
+ }
4340
+ }
4341
+
4342
+ return ret.length === 0 ? null : ret;
4343
+ }
4344
+ },
4345
+ TAG: function(match, context){
4346
+ return context.getElementsByTagName(match[1]);
4347
+ }
4348
+ },
4349
+ preFilter: {
4350
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
4351
+ match = " " + match[1].replace(/\\/g, "") + " ";
4352
+
4353
+ if ( isXML ) {
4354
+ return match;
4355
+ }
4356
+
4357
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
4358
+ if ( elem ) {
4359
+ if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
4360
+ if ( !inplace )
4361
+ result.push( elem );
4362
+ } else if ( inplace ) {
4363
+ curLoop[i] = false;
4364
+ }
4365
+ }
4366
+ }
4367
+
4368
+ return false;
4369
+ },
4370
+ ID: function(match){
4371
+ return match[1].replace(/\\/g, "");
4372
+ },
4373
+ TAG: function(match, curLoop){
4374
+ for ( var i = 0; curLoop[i] === false; i++ ){}
4375
+ return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
4376
+ },
4377
+ CHILD: function(match){
4378
+ if ( match[1] == "nth" ) {
4379
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
4380
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
4381
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
4382
+
4383
+ match[2] = (test[1] + (test[2] || 1)) - 0;
4384
+ match[3] = test[3] - 0;
4385
+ }
4386
+
4387
+ match[0] = done++;
4388
+
4389
+ return match;
4390
+ },
4391
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
4392
+ var name = match[1].replace(/\\/g, "");
4393
+
4394
+ if ( !isXML && Expr.attrMap[name] ) {
4395
+ match[1] = Expr.attrMap[name];
4396
+ }
4397
+
4398
+ if ( match[2] === "~=" ) {
4399
+ match[4] = " " + match[4] + " ";
4400
+ }
4401
+
4402
+ return match;
4403
+ },
4404
+ PSEUDO: function(match, curLoop, inplace, result, not){
4405
+ if ( match[1] === "not" ) {
4406
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
4407
+ match[3] = Sizzle(match[3], null, null, curLoop);
4408
+ } else {
4409
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
4410
+ if ( !inplace ) {
4411
+ result.push.apply( result, ret );
4412
+ }
4413
+ return false;
4414
+ }
4415
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
4416
+ return true;
4417
+ }
4418
+
4419
+ return match;
4420
+ },
4421
+ POS: function(match){
4422
+ match.unshift( true );
4423
+ return match;
4424
+ }
4425
+ },
4426
+ filters: {
4427
+ enabled: function(elem){
4428
+ return elem.disabled === false && elem.type !== "hidden";
4429
+ },
4430
+ disabled: function(elem){
4431
+ return elem.disabled === true;
4432
+ },
4433
+ checked: function(elem){
4434
+ return elem.checked === true;
4435
+ },
4436
+ selected: function(elem){
4437
+ elem.parentNode.selectedIndex;
4438
+ return elem.selected === true;
4439
+ },
4440
+ parent: function(elem){
4441
+ return !!elem.firstChild;
4442
+ },
4443
+ empty: function(elem){
4444
+ return !elem.firstChild;
4445
+ },
4446
+ has: function(elem, i, match){
4447
+ return !!Sizzle( match[3], elem ).length;
4448
+ },
4449
+ header: function(elem){
4450
+ return /h\d/i.test( elem.nodeName );
4451
+ },
4452
+ text: function(elem){
4453
+ return "text" === elem.type;
4454
+ },
4455
+ radio: function(elem){
4456
+ return "radio" === elem.type;
4457
+ },
4458
+ checkbox: function(elem){
4459
+ return "checkbox" === elem.type;
4460
+ },
4461
+ file: function(elem){
4462
+ return "file" === elem.type;
4463
+ },
4464
+ password: function(elem){
4465
+ return "password" === elem.type;
4466
+ },
4467
+ submit: function(elem){
4468
+ return "submit" === elem.type;
4469
+ },
4470
+ image: function(elem){
4471
+ return "image" === elem.type;
4472
+ },
4473
+ reset: function(elem){
4474
+ return "reset" === elem.type;
4475
+ },
4476
+ button: function(elem){
4477
+ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
4478
+ },
4479
+ input: function(elem){
4480
+ return /input|select|textarea|button/i.test(elem.nodeName);
4481
+ }
4482
+ },
4483
+ setFilters: {
4484
+ first: function(elem, i){
4485
+ return i === 0;
4486
+ },
4487
+ last: function(elem, i, match, array){
4488
+ return i === array.length - 1;
4489
+ },
4490
+ even: function(elem, i){
4491
+ return i % 2 === 0;
4492
+ },
4493
+ odd: function(elem, i){
4494
+ return i % 2 === 1;
4495
+ },
4496
+ lt: function(elem, i, match){
4497
+ return i < match[3] - 0;
4498
+ },
4499
+ gt: function(elem, i, match){
4500
+ return i > match[3] - 0;
4501
+ },
4502
+ nth: function(elem, i, match){
4503
+ return match[3] - 0 == i;
4504
+ },
4505
+ eq: function(elem, i, match){
4506
+ return match[3] - 0 == i;
4507
+ }
4508
+ },
4509
+ filter: {
4510
+ PSEUDO: function(elem, match, i, array){
4511
+ var name = match[1], filter = Expr.filters[ name ];
4512
+
4513
+ if ( filter ) {
4514
+ return filter( elem, i, match, array );
4515
+ } else if ( name === "contains" ) {
4516
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
4517
+ } else if ( name === "not" ) {
4518
+ var not = match[3];
4519
+
4520
+ for ( var i = 0, l = not.length; i < l; i++ ) {
4521
+ if ( not[i] === elem ) {
4522
+ return false;
4523
+ }
4524
+ }
4525
+
4526
+ return true;
4527
+ }
4528
+ },
4529
+ CHILD: function(elem, match){
4530
+ var type = match[1], node = elem;
4531
+ switch (type) {
4532
+ case 'only':
4533
+ case 'first':
4534
+ while ( (node = node.previousSibling) ) {
4535
+ if ( node.nodeType === 1 ) return false;
4536
+ }
4537
+ if ( type == 'first') return true;
4538
+ node = elem;
4539
+ case 'last':
4540
+ while ( (node = node.nextSibling) ) {
4541
+ if ( node.nodeType === 1 ) return false;
4542
+ }
4543
+ return true;
4544
+ case 'nth':
4545
+ var first = match[2], last = match[3];
4546
+
4547
+ if ( first == 1 && last == 0 ) {
4548
+ return true;
4549
+ }
4550
+
4551
+ var doneName = match[0],
4552
+ parent = elem.parentNode;
4553
+
4554
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
4555
+ var count = 0;
4556
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
4557
+ if ( node.nodeType === 1 ) {
4558
+ node.nodeIndex = ++count;
4559
+ }
4560
+ }
4561
+ parent.sizcache = doneName;
4562
+ }
4563
+
4564
+ var diff = elem.nodeIndex - last;
4565
+ if ( first == 0 ) {
4566
+ return diff == 0;
4567
+ } else {
4568
+ return ( diff % first == 0 && diff / first >= 0 );
4569
+ }
4570
+ }
4571
+ },
4572
+ ID: function(elem, match){
4573
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
4574
+ },
4575
+ TAG: function(elem, match){
4576
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
4577
+ },
4578
+ CLASS: function(elem, match){
4579
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
4580
+ .indexOf( match ) > -1;
4581
+ },
4582
+ ATTR: function(elem, match){
4583
+ var name = match[1],
4584
+ result = Expr.attrHandle[ name ] ?
4585
+ Expr.attrHandle[ name ]( elem ) :
4586
+ elem[ name ] != null ?
4587
+ elem[ name ] :
4588
+ elem.getAttribute( name ),
4589
+ value = result + "",
4590
+ type = match[2],
4591
+ check = match[4];
4592
+
4593
+ return result == null ?
4594
+ type === "!=" :
4595
+ type === "=" ?
4596
+ value === check :
4597
+ type === "*=" ?
4598
+ value.indexOf(check) >= 0 :
4599
+ type === "~=" ?
4600
+ (" " + value + " ").indexOf(check) >= 0 :
4601
+ !check ?
4602
+ value && result !== false :
4603
+ type === "!=" ?
4604
+ value != check :
4605
+ type === "^=" ?
4606
+ value.indexOf(check) === 0 :
4607
+ type === "$=" ?
4608
+ value.substr(value.length - check.length) === check :
4609
+ type === "|=" ?
4610
+ value === check || value.substr(0, check.length + 1) === check + "-" :
4611
+ false;
4612
+ },
4613
+ POS: function(elem, match, i, array){
4614
+ var name = match[2], filter = Expr.setFilters[ name ];
4615
+
4616
+ if ( filter ) {
4617
+ return filter( elem, i, match, array );
4618
+ }
4619
+ }
4620
+ }
4621
+ };
4622
+
4623
+ var origPOS = Expr.match.POS;
4624
+
4625
+ for ( var type in Expr.match ) {
4626
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
4627
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
4628
+ }
4629
+
4630
+ var makeArray = function(array, results) {
4631
+ array = Array.prototype.slice.call( array, 0 );
4632
+
4633
+ if ( results ) {
4634
+ results.push.apply( results, array );
4635
+ return results;
4636
+ }
4637
+
4638
+ return array;
4639
+ };
4640
+
4641
+ try {
4642
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
4643
+
4644
+ } catch(e){
4645
+ makeArray = function(array, results) {
4646
+ var ret = results || [];
4647
+
4648
+ if ( toString.call(array) === "[object Array]" ) {
4649
+ Array.prototype.push.apply( ret, array );
4650
+ } else {
4651
+ if ( typeof array.length === "number" ) {
4652
+ for ( var i = 0, l = array.length; i < l; i++ ) {
4653
+ ret.push( array[i] );
4654
+ }
4655
+ } else {
4656
+ for ( var i = 0; array[i]; i++ ) {
4657
+ ret.push( array[i] );
4658
+ }
4659
+ }
4660
+ }
4661
+
4662
+ return ret;
4663
+ };
4664
+ }
4665
+
4666
+ var sortOrder;
4667
+
4668
+ if ( document.documentElement.compareDocumentPosition ) {
4669
+ sortOrder = function( a, b ) {
4670
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
4671
+ if ( a == b ) {
4672
+ hasDuplicate = true;
4673
+ }
4674
+ return 0;
4675
+ }
4676
+
4677
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
4678
+ if ( ret === 0 ) {
4679
+ hasDuplicate = true;
4680
+ }
4681
+ return ret;
4682
+ };
4683
+ } else if ( "sourceIndex" in document.documentElement ) {
4684
+ sortOrder = function( a, b ) {
4685
+ if ( !a.sourceIndex || !b.sourceIndex ) {
4686
+ if ( a == b ) {
4687
+ hasDuplicate = true;
4688
+ }
4689
+ return 0;
4690
+ }
4691
+
4692
+ var ret = a.sourceIndex - b.sourceIndex;
4693
+ if ( ret === 0 ) {
4694
+ hasDuplicate = true;
4695
+ }
4696
+ return ret;
4697
+ };
4698
+ } else if ( document.createRange ) {
4699
+ sortOrder = function( a, b ) {
4700
+ if ( !a.ownerDocument || !b.ownerDocument ) {
4701
+ if ( a == b ) {
4702
+ hasDuplicate = true;
4703
+ }
4704
+ return 0;
4705
+ }
4706
+
4707
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
4708
+ aRange.setStart(a, 0);
4709
+ aRange.setEnd(a, 0);
4710
+ bRange.setStart(b, 0);
4711
+ bRange.setEnd(b, 0);
4712
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
4713
+ if ( ret === 0 ) {
4714
+ hasDuplicate = true;
4715
+ }
4716
+ return ret;
4717
+ };
4718
+ }
4719
+
4720
+ (function(){
4721
+ var form = document.createElement("div"),
4722
+ id = "script" + (new Date).getTime();
4723
+ form.innerHTML = "<a name='" + id + "'/>";
4724
+
4725
+ var root = document.documentElement;
4726
+ root.insertBefore( form, root.firstChild );
4727
+
4728
+ if ( !!document.getElementById( id ) ) {
4729
+ Expr.find.ID = function(match, context, isXML){
4730
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
4731
+ var m = context.getElementById(match[1]);
4732
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
4733
+ }
4734
+ };
4735
+
4736
+ Expr.filter.ID = function(elem, match){
4737
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
4738
+ return elem.nodeType === 1 && node && node.nodeValue === match;
4739
+ };
4740
+ }
4741
+
4742
+ root.removeChild( form );
4743
+ root = form = null; // release memory in IE
4744
+ })();
4745
+
4746
+ (function(){
4747
+
4748
+ var div = document.createElement("div");
4749
+ div.appendChild( document.createComment("") );
4750
+
4751
+ if ( div.getElementsByTagName("*").length > 0 ) {
4752
+ Expr.find.TAG = function(match, context){
4753
+ var results = context.getElementsByTagName(match[1]);
4754
+
4755
+ if ( match[1] === "*" ) {
4756
+ var tmp = [];
4757
+
4758
+ for ( var i = 0; results[i]; i++ ) {
4759
+ if ( results[i].nodeType === 1 ) {
4760
+ tmp.push( results[i] );
4761
+ }
4762
+ }
4763
+
4764
+ results = tmp;
4765
+ }
4766
+
4767
+ return results;
4768
+ };
4769
+ }
4770
+
4771
+ div.innerHTML = "<a href='#'></a>";
4772
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
4773
+ div.firstChild.getAttribute("href") !== "#" ) {
4774
+ Expr.attrHandle.href = function(elem){
4775
+ return elem.getAttribute("href", 2);
4776
+ };
4777
+ }
4778
+
4779
+ div = null; // release memory in IE
4780
+ })();
4781
+
4782
+ if ( document.querySelectorAll ) (function(){
4783
+ var oldSizzle = Sizzle, div = document.createElement("div");
4784
+ div.innerHTML = "<p class='TEST'></p>";
4785
+
4786
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
4787
+ return;
4788
+ }
4789
+
4790
+ Sizzle = function(query, context, extra, seed){
4791
+ context = context || document;
4792
+
4793
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
4794
+ try {
4795
+ return makeArray( context.querySelectorAll(query), extra );
4796
+ } catch(e){}
4797
+ }
4798
+
4799
+ return oldSizzle(query, context, extra, seed);
4800
+ };
4801
+
4802
+ for ( var prop in oldSizzle ) {
4803
+ Sizzle[ prop ] = oldSizzle[ prop ];
4804
+ }
4805
+
4806
+ div = null; // release memory in IE
4807
+ })();
4808
+
4809
+ if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
4810
+ var div = document.createElement("div");
4811
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
4812
+
4813
+ if ( div.getElementsByClassName("e").length === 0 )
4814
+ return;
4815
+
4816
+ div.lastChild.className = "e";
4817
+
4818
+ if ( div.getElementsByClassName("e").length === 1 )
4819
+ return;
4820
+
4821
+ Expr.order.splice(1, 0, "CLASS");
4822
+ Expr.find.CLASS = function(match, context, isXML) {
4823
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
4824
+ return context.getElementsByClassName(match[1]);
4825
+ }
4826
+ };
4827
+
4828
+ div = null; // release memory in IE
4829
+ })();
4830
+
4831
+ function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4832
+ var sibDir = dir == "previousSibling" && !isXML;
4833
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4834
+ var elem = checkSet[i];
4835
+ if ( elem ) {
4836
+ if ( sibDir && elem.nodeType === 1 ){
4837
+ elem.sizcache = doneName;
4838
+ elem.sizset = i;
4839
+ }
4840
+ elem = elem[dir];
4841
+ var match = false;
4842
+
4843
+ while ( elem ) {
4844
+ if ( elem.sizcache === doneName ) {
4845
+ match = checkSet[elem.sizset];
4846
+ break;
4847
+ }
4848
+
4849
+ if ( elem.nodeType === 1 && !isXML ){
4850
+ elem.sizcache = doneName;
4851
+ elem.sizset = i;
4852
+ }
4853
+
4854
+ if ( elem.nodeName === cur ) {
4855
+ match = elem;
4856
+ break;
4857
+ }
4858
+
4859
+ elem = elem[dir];
4860
+ }
4861
+
4862
+ checkSet[i] = match;
4863
+ }
4864
+ }
4865
+ }
4866
+
4867
+ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4868
+ var sibDir = dir == "previousSibling" && !isXML;
4869
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4870
+ var elem = checkSet[i];
4871
+ if ( elem ) {
4872
+ if ( sibDir && elem.nodeType === 1 ) {
4873
+ elem.sizcache = doneName;
4874
+ elem.sizset = i;
4875
+ }
4876
+ elem = elem[dir];
4877
+ var match = false;
4878
+
4879
+ while ( elem ) {
4880
+ if ( elem.sizcache === doneName ) {
4881
+ match = checkSet[elem.sizset];
4882
+ break;
4883
+ }
4884
+
4885
+ if ( elem.nodeType === 1 ) {
4886
+ if ( !isXML ) {
4887
+ elem.sizcache = doneName;
4888
+ elem.sizset = i;
4889
+ }
4890
+ if ( typeof cur !== "string" ) {
4891
+ if ( elem === cur ) {
4892
+ match = true;
4893
+ break;
4894
+ }
4895
+
4896
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
4897
+ match = elem;
4898
+ break;
4899
+ }
4900
+ }
4901
+
4902
+ elem = elem[dir];
4903
+ }
4904
+
4905
+ checkSet[i] = match;
4906
+ }
4907
+ }
4908
+ }
4909
+
4910
+ var contains = document.compareDocumentPosition ? function(a, b){
4911
+ return a.compareDocumentPosition(b) & 16;
4912
+ } : function(a, b){
4913
+ return a !== b && (a.contains ? a.contains(b) : true);
4914
+ };
4915
+
4916
+ var isXML = function(elem){
4917
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
4918
+ !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
4919
+ };
4920
+
4921
+ var posProcess = function(selector, context){
4922
+ var tmpSet = [], later = "", match,
4923
+ root = context.nodeType ? [context] : context;
4924
+
4925
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
4926
+ later += match[0];
4927
+ selector = selector.replace( Expr.match.PSEUDO, "" );
4928
+ }
4929
+
4930
+ selector = Expr.relative[selector] ? selector + "*" : selector;
4931
+
4932
+ for ( var i = 0, l = root.length; i < l; i++ ) {
4933
+ Sizzle( selector, root[i], tmpSet );
4934
+ }
4935
+
4936
+ return Sizzle.filter( later, tmpSet );
4937
+ };
4938
+
4939
+
4940
+ window.Sizzle = Sizzle;
4941
+
4942
+ })();
4943
+
4944
+ ;(function(engine) {
4945
+ var extendElements = Prototype.Selector.extendElements;
4946
+
4947
+ function select(selector, scope) {
4948
+ return extendElements(engine(selector, scope || document));
4949
+ }
4950
+
4951
+ function match(element, selector) {
4952
+ return engine.matches(selector, [element]).length == 1;
4953
+ }
4954
+
4955
+ Prototype.Selector.engine = engine;
4956
+ Prototype.Selector.select = select;
4957
+ Prototype.Selector.match = match;
4958
+ })(Sizzle);
4959
+
4960
+ window.Sizzle = Prototype._original_property;
4961
+ delete Prototype._original_property;
4962
+
4963
+ var Form = {
4964
+ reset: function(form) {
4965
+ form = $(form);
4966
+ form.reset();
4967
+ return form;
4968
+ },
4969
+
4970
+ serializeElements: function(elements, options) {
4971
+ if (typeof options != 'object') options = { hash: !!options };
4972
+ else if (Object.isUndefined(options.hash)) options.hash = true;
4973
+ var key, value, submitted = false, submit = options.submit, accumulator, initial;
4974
+
4975
+ if (options.hash) {
4976
+ initial = {};
4977
+ accumulator = function(result, key, value) {
4978
+ if (key in result) {
4979
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
4980
+ result[key].push(value);
4981
+ } else result[key] = value;
4982
+ return result;
4983
+ };
4984
+ } else {
4985
+ initial = '';
4986
+ accumulator = function(result, key, value) {
4987
+ return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
4988
+ }
4989
+ }
4990
+
4991
+ return elements.inject(initial, function(result, element) {
4992
+ if (!element.disabled && element.name) {
4993
+ key = element.name; value = $(element).getValue();
4994
+ if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
4995
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
4996
+ result = accumulator(result, key, value);
4997
+ }
4998
+ }
4999
+ return result;
5000
+ });
5001
+ }
5002
+ };
5003
+
5004
+ Form.Methods = {
5005
+ serialize: function(form, options) {
5006
+ return Form.serializeElements(Form.getElements(form), options);
5007
+ },
5008
+
5009
+ getElements: function(form) {
5010
+ var elements = $(form).getElementsByTagName('*'),
5011
+ element,
5012
+ arr = [ ],
5013
+ serializers = Form.Element.Serializers;
5014
+ for (var i = 0; element = elements[i]; i++) {
5015
+ arr.push(element);
5016
+ }
5017
+ return arr.inject([], function(elements, child) {
5018
+ if (serializers[child.tagName.toLowerCase()])
5019
+ elements.push(Element.extend(child));
5020
+ return elements;
5021
+ })
5022
+ },
5023
+
5024
+ getInputs: function(form, typeName, name) {
5025
+ form = $(form);
5026
+ var inputs = form.getElementsByTagName('input');
5027
+
5028
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
5029
+
5030
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
5031
+ var input = inputs[i];
5032
+ if ((typeName && input.type != typeName) || (name && input.name != name))
5033
+ continue;
5034
+ matchingInputs.push(Element.extend(input));
5035
+ }
5036
+
5037
+ return matchingInputs;
5038
+ },
5039
+
5040
+ disable: function(form) {
5041
+ form = $(form);
5042
+ Form.getElements(form).invoke('disable');
5043
+ return form;
5044
+ },
5045
+
5046
+ enable: function(form) {
5047
+ form = $(form);
5048
+ Form.getElements(form).invoke('enable');
5049
+ return form;
5050
+ },
5051
+
5052
+ findFirstElement: function(form) {
5053
+ var elements = $(form).getElements().findAll(function(element) {
5054
+ return 'hidden' != element.type && !element.disabled;
5055
+ });
5056
+ var firstByIndex = elements.findAll(function(element) {
5057
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
5058
+ }).sortBy(function(element) { return element.tabIndex }).first();
5059
+
5060
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
5061
+ return /^(?:input|select|textarea)$/i.test(element.tagName);
5062
+ });
5063
+ },
5064
+
5065
+ focusFirstElement: function(form) {
5066
+ form = $(form);
5067
+ var element = form.findFirstElement();
5068
+ if (element) element.activate();
5069
+ return form;
5070
+ },
5071
+
5072
+ request: function(form, options) {
5073
+ form = $(form), options = Object.clone(options || { });
5074
+
5075
+ var params = options.parameters, action = form.readAttribute('action') || '';
5076
+ if (action.blank()) action = window.location.href;
5077
+ options.parameters = form.serialize(true);
5078
+
5079
+ if (params) {
5080
+ if (Object.isString(params)) params = params.toQueryParams();
5081
+ Object.extend(options.parameters, params);
5082
+ }
5083
+
5084
+ if (form.hasAttribute('method') && !options.method)
5085
+ options.method = form.method;
5086
+
5087
+ return new Ajax.Request(action, options);
5088
+ }
5089
+ };
5090
+
5091
+ /*--------------------------------------------------------------------------*/
5092
+
5093
+
5094
+ Form.Element = {
5095
+ focus: function(element) {
5096
+ $(element).focus();
5097
+ return element;
5098
+ },
5099
+
5100
+ select: function(element) {
5101
+ $(element).select();
5102
+ return element;
5103
+ }
5104
+ };
5105
+
5106
+ Form.Element.Methods = {
5107
+
5108
+ serialize: function(element) {
5109
+ element = $(element);
5110
+ if (!element.disabled && element.name) {
5111
+ var value = element.getValue();
5112
+ if (value != undefined) {
5113
+ var pair = { };
5114
+ pair[element.name] = value;
5115
+ return Object.toQueryString(pair);
5116
+ }
5117
+ }
5118
+ return '';
5119
+ },
5120
+
5121
+ getValue: function(element) {
5122
+ element = $(element);
5123
+ var method = element.tagName.toLowerCase();
5124
+ return Form.Element.Serializers[method](element);
5125
+ },
5126
+
5127
+ setValue: function(element, value) {
5128
+ element = $(element);
5129
+ var method = element.tagName.toLowerCase();
5130
+ Form.Element.Serializers[method](element, value);
5131
+ return element;
5132
+ },
5133
+
5134
+ clear: function(element) {
5135
+ $(element).value = '';
5136
+ return element;
5137
+ },
5138
+
5139
+ present: function(element) {
5140
+ return $(element).value != '';
5141
+ },
5142
+
5143
+ activate: function(element) {
5144
+ element = $(element);
5145
+ try {
5146
+ element.focus();
5147
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
5148
+ !(/^(?:button|reset|submit)$/i.test(element.type))))
5149
+ element.select();
5150
+ } catch (e) { }
5151
+ return element;
5152
+ },
5153
+
5154
+ disable: function(element) {
5155
+ element = $(element);
5156
+ element.disabled = true;
5157
+ return element;
5158
+ },
5159
+
5160
+ enable: function(element) {
5161
+ element = $(element);
5162
+ element.disabled = false;
5163
+ return element;
5164
+ }
5165
+ };
5166
+
5167
+ /*--------------------------------------------------------------------------*/
5168
+
5169
+ var Field = Form.Element;
5170
+
5171
+ var $F = Form.Element.Methods.getValue;
5172
+
5173
+ /*--------------------------------------------------------------------------*/
5174
+
5175
+ Form.Element.Serializers = (function() {
5176
+ function input(element, value) {
5177
+ switch (element.type.toLowerCase()) {
5178
+ case 'checkbox':
5179
+ case 'radio':
5180
+ return inputSelector(element, value);
5181
+ default:
5182
+ return valueSelector(element, value);
5183
+ }
5184
+ }
5185
+
5186
+ function inputSelector(element, value) {
5187
+ if (Object.isUndefined(value))
5188
+ return element.checked ? element.value : null;
5189
+ else element.checked = !!value;
5190
+ }
5191
+
5192
+ function valueSelector(element, value) {
5193
+ if (Object.isUndefined(value)) return element.value;
5194
+ else element.value = value;
5195
+ }
5196
+
5197
+ function select(element, value) {
5198
+ if (Object.isUndefined(value))
5199
+ return (element.type === 'select-one' ? selectOne : selectMany)(element);
5200
+
5201
+ var opt, currentValue, single = !Object.isArray(value);
5202
+ for (var i = 0, length = element.length; i < length; i++) {
5203
+ opt = element.options[i];
5204
+ currentValue = this.optionValue(opt);
5205
+ if (single) {
5206
+ if (currentValue == value) {
5207
+ opt.selected = true;
5208
+ return;
5209
+ }
5210
+ }
5211
+ else opt.selected = value.include(currentValue);
5212
+ }
5213
+ }
5214
+
5215
+ function selectOne(element) {
5216
+ var index = element.selectedIndex;
5217
+ return index >= 0 ? optionValue(element.options[index]) : null;
5218
+ }
5219
+
5220
+ function selectMany(element) {
5221
+ var values, length = element.length;
5222
+ if (!length) return null;
5223
+
5224
+ for (var i = 0, values = []; i < length; i++) {
5225
+ var opt = element.options[i];
5226
+ if (opt.selected) values.push(optionValue(opt));
5227
+ }
5228
+ return values;
5229
+ }
5230
+
5231
+ function optionValue(opt) {
5232
+ return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
5233
+ }
5234
+
5235
+ return {
5236
+ input: input,
5237
+ inputSelector: inputSelector,
5238
+ textarea: valueSelector,
5239
+ select: select,
5240
+ selectOne: selectOne,
5241
+ selectMany: selectMany,
5242
+ optionValue: optionValue,
5243
+ button: valueSelector
5244
+ };
5245
+ })();
5246
+
5247
+ /*--------------------------------------------------------------------------*/
5248
+
5249
+
5250
+ Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
5251
+ initialize: function($super, element, frequency, callback) {
5252
+ $super(callback, frequency);
5253
+ this.element = $(element);
5254
+ this.lastValue = this.getValue();
5255
+ },
5256
+
5257
+ execute: function() {
5258
+ var value = this.getValue();
5259
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
5260
+ this.lastValue != value : String(this.lastValue) != String(value)) {
5261
+ this.callback(this.element, value);
5262
+ this.lastValue = value;
5263
+ }
5264
+ }
5265
+ });
5266
+
5267
+ Form.Element.Observer = Class.create(Abstract.TimedObserver, {
5268
+ getValue: function() {
5269
+ return Form.Element.getValue(this.element);
5270
+ }
5271
+ });
5272
+
5273
+ Form.Observer = Class.create(Abstract.TimedObserver, {
5274
+ getValue: function() {
5275
+ return Form.serialize(this.element);
5276
+ }
5277
+ });
5278
+
5279
+ /*--------------------------------------------------------------------------*/
5280
+
5281
+ Abstract.EventObserver = Class.create({
5282
+ initialize: function(element, callback) {
5283
+ this.element = $(element);
5284
+ this.callback = callback;
5285
+
5286
+ this.lastValue = this.getValue();
5287
+ if (this.element.tagName.toLowerCase() == 'form')
5288
+ this.registerFormCallbacks();
5289
+ else
5290
+ this.registerCallback(this.element);
5291
+ },
5292
+
5293
+ onElementEvent: function() {
5294
+ var value = this.getValue();
5295
+ if (this.lastValue != value) {
5296
+ this.callback(this.element, value);
5297
+ this.lastValue = value;
5298
+ }
5299
+ },
5300
+
5301
+ registerFormCallbacks: function() {
5302
+ Form.getElements(this.element).each(this.registerCallback, this);
5303
+ },
5304
+
5305
+ registerCallback: function(element) {
5306
+ if (element.type) {
5307
+ switch (element.type.toLowerCase()) {
5308
+ case 'checkbox':
5309
+ case 'radio':
5310
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
5311
+ break;
5312
+ default:
5313
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
5314
+ break;
5315
+ }
5316
+ }
5317
+ }
5318
+ });
5319
+
5320
+ Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
5321
+ getValue: function() {
5322
+ return Form.Element.getValue(this.element);
5323
+ }
5324
+ });
5325
+
5326
+ Form.EventObserver = Class.create(Abstract.EventObserver, {
5327
+ getValue: function() {
5328
+ return Form.serialize(this.element);
5329
+ }
5330
+ });
5331
+ (function() {
5332
+
5333
+ var Event = {
5334
+ KEY_BACKSPACE: 8,
5335
+ KEY_TAB: 9,
5336
+ KEY_RETURN: 13,
5337
+ KEY_ESC: 27,
5338
+ KEY_LEFT: 37,
5339
+ KEY_UP: 38,
5340
+ KEY_RIGHT: 39,
5341
+ KEY_DOWN: 40,
5342
+ KEY_DELETE: 46,
5343
+ KEY_HOME: 36,
5344
+ KEY_END: 35,
5345
+ KEY_PAGEUP: 33,
5346
+ KEY_PAGEDOWN: 34,
5347
+ KEY_INSERT: 45,
5348
+
5349
+ cache: {}
5350
+ };
5351
+
5352
+ var docEl = document.documentElement;
5353
+ var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
5354
+ && 'onmouseleave' in docEl;
5355
+
5356
+
5357
+
5358
+ var isIELegacyEvent = function(event) { return false; };
5359
+
5360
+ if (window.attachEvent) {
5361
+ if (window.addEventListener) {
5362
+ isIELegacyEvent = function(event) {
5363
+ return !(event instanceof window.Event);
5364
+ };
5365
+ } else {
5366
+ isIELegacyEvent = function(event) { return true; };
5367
+ }
5368
+ }
5369
+
5370
+ var _isButton;
5371
+
5372
+ function _isButtonForDOMEvents(event, code) {
5373
+ return event.which ? (event.which === code + 1) : (event.button === code);
5374
+ }
5375
+
5376
+ var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
5377
+ function _isButtonForLegacyEvents(event, code) {
5378
+ return event.button === legacyButtonMap[code];
5379
+ }
5380
+
5381
+ function _isButtonForWebKit(event, code) {
5382
+ switch (code) {
5383
+ case 0: return event.which == 1 && !event.metaKey;
5384
+ case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
5385
+ case 2: return event.which == 3;
5386
+ default: return false;
5387
+ }
5388
+ }
5389
+
5390
+ if (window.attachEvent) {
5391
+ if (!window.addEventListener) {
5392
+ _isButton = _isButtonForLegacyEvents;
5393
+ } else {
5394
+ _isButton = function(event, code) {
5395
+ return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
5396
+ _isButtonForDOMEvents(event, code);
5397
+ }
5398
+ }
5399
+ } else if (Prototype.Browser.WebKit) {
5400
+ _isButton = _isButtonForWebKit;
5401
+ } else {
5402
+ _isButton = _isButtonForDOMEvents;
5403
+ }
5404
+
5405
+ function isLeftClick(event) { return _isButton(event, 0) }
5406
+
5407
+ function isMiddleClick(event) { return _isButton(event, 1) }
5408
+
5409
+ function isRightClick(event) { return _isButton(event, 2) }
5410
+
5411
+ function element(event) {
5412
+ event = Event.extend(event);
5413
+
5414
+ var node = event.target, type = event.type,
5415
+ currentTarget = event.currentTarget;
5416
+
5417
+ if (currentTarget && currentTarget.tagName) {
5418
+ if (type === 'load' || type === 'error' ||
5419
+ (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
5420
+ && currentTarget.type === 'radio'))
5421
+ node = currentTarget;
5422
+ }
5423
+
5424
+ if (node.nodeType == Node.TEXT_NODE)
5425
+ node = node.parentNode;
5426
+
5427
+ return Element.extend(node);
5428
+ }
5429
+
5430
+ function findElement(event, expression) {
5431
+ var element = Event.element(event);
5432
+
5433
+ if (!expression) return element;
5434
+ while (element) {
5435
+ if (Object.isElement(element) && Prototype.Selector.match(element, expression)) {
5436
+ return Element.extend(element);
5437
+ }
5438
+ element = element.parentNode;
5439
+ }
5440
+ }
5441
+
5442
+ function pointer(event) {
5443
+ return { x: pointerX(event), y: pointerY(event) };
5444
+ }
5445
+
5446
+ function pointerX(event) {
5447
+ var docElement = document.documentElement,
5448
+ body = document.body || { scrollLeft: 0 };
5449
+
5450
+ return event.pageX || (event.clientX +
5451
+ (docElement.scrollLeft || body.scrollLeft) -
5452
+ (docElement.clientLeft || 0));
5453
+ }
5454
+
5455
+ function pointerY(event) {
5456
+ var docElement = document.documentElement,
5457
+ body = document.body || { scrollTop: 0 };
5458
+
5459
+ return event.pageY || (event.clientY +
5460
+ (docElement.scrollTop || body.scrollTop) -
5461
+ (docElement.clientTop || 0));
5462
+ }
5463
+
5464
+
5465
+ function stop(event) {
5466
+ Event.extend(event);
5467
+ event.preventDefault();
5468
+ event.stopPropagation();
5469
+
5470
+ event.stopped = true;
5471
+ }
5472
+
5473
+
5474
+ Event.Methods = {
5475
+ isLeftClick: isLeftClick,
5476
+ isMiddleClick: isMiddleClick,
5477
+ isRightClick: isRightClick,
5478
+
5479
+ element: element,
5480
+ findElement: findElement,
5481
+
5482
+ pointer: pointer,
5483
+ pointerX: pointerX,
5484
+ pointerY: pointerY,
5485
+
5486
+ stop: stop
5487
+ };
5488
+
5489
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
5490
+ m[name] = Event.Methods[name].methodize();
5491
+ return m;
5492
+ });
5493
+
5494
+ if (window.attachEvent) {
5495
+ function _relatedTarget(event) {
5496
+ var element;
5497
+ switch (event.type) {
5498
+ case 'mouseover':
5499
+ case 'mouseenter':
5500
+ element = event.fromElement;
5501
+ break;
5502
+ case 'mouseout':
5503
+ case 'mouseleave':
5504
+ element = event.toElement;
5505
+ break;
5506
+ default:
5507
+ return null;
5508
+ }
5509
+ return Element.extend(element);
5510
+ }
5511
+
5512
+ var additionalMethods = {
5513
+ stopPropagation: function() { this.cancelBubble = true },
5514
+ preventDefault: function() { this.returnValue = false },
5515
+ inspect: function() { return '[object Event]' }
5516
+ };
5517
+
5518
+ Event.extend = function(event, element) {
5519
+ if (!event) return false;
5520
+
5521
+ if (!isIELegacyEvent(event)) return event;
5522
+
5523
+ if (event._extendedByPrototype) return event;
5524
+ event._extendedByPrototype = Prototype.emptyFunction;
5525
+
5526
+ var pointer = Event.pointer(event);
5527
+
5528
+ Object.extend(event, {
5529
+ target: event.srcElement || element,
5530
+ relatedTarget: _relatedTarget(event),
5531
+ pageX: pointer.x,
5532
+ pageY: pointer.y
5533
+ });
5534
+
5535
+ Object.extend(event, methods);
5536
+ Object.extend(event, additionalMethods);
5537
+
5538
+ return event;
5539
+ };
5540
+ } else {
5541
+ Event.extend = Prototype.K;
5542
+ }
5543
+
5544
+ if (window.addEventListener) {
5545
+ Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
5546
+ Object.extend(Event.prototype, methods);
5547
+ }
5548
+
5549
+ function _createResponder(element, eventName, handler) {
5550
+ var registry = Element.retrieve(element, 'prototype_event_registry');
5551
+
5552
+ if (Object.isUndefined(registry)) {
5553
+ CACHE.push(element);
5554
+ registry = Element.retrieve(element, 'prototype_event_registry', $H());
5555
+ }
5556
+
5557
+ var respondersForEvent = registry.get(eventName);
5558
+ if (Object.isUndefined(respondersForEvent)) {
5559
+ respondersForEvent = [];
5560
+ registry.set(eventName, respondersForEvent);
5561
+ }
5562
+
5563
+ if (respondersForEvent.pluck('handler').include(handler)) return false;
5564
+
5565
+ var responder;
5566
+ if (eventName.include(":")) {
5567
+ responder = function(event) {
5568
+ if (Object.isUndefined(event.eventName))
5569
+ return false;
5570
+
5571
+ if (event.eventName !== eventName)
5572
+ return false;
5573
+
5574
+ Event.extend(event, element);
5575
+ handler.call(element, event);
5576
+ };
5577
+ } else {
5578
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
5579
+ (eventName === "mouseenter" || eventName === "mouseleave")) {
5580
+ if (eventName === "mouseenter" || eventName === "mouseleave") {
5581
+ responder = function(event) {
5582
+ Event.extend(event, element);
5583
+
5584
+ var parent = event.relatedTarget;
5585
+ while (parent && parent !== element) {
5586
+ try { parent = parent.parentNode; }
5587
+ catch(e) { parent = element; }
5588
+ }
5589
+
5590
+ if (parent === element) return;
5591
+
5592
+ handler.call(element, event);
5593
+ };
5594
+ }
5595
+ } else {
5596
+ responder = function(event) {
5597
+ Event.extend(event, element);
5598
+ handler.call(element, event);
5599
+ };
5600
+ }
5601
+ }
5602
+
5603
+ responder.handler = handler;
5604
+ respondersForEvent.push(responder);
5605
+ return responder;
5606
+ }
5607
+
5608
+ function _destroyCache() {
5609
+ for (var i = 0, length = CACHE.length; i < length; i++) {
5610
+ Event.stopObserving(CACHE[i]);
5611
+ CACHE[i] = null;
5612
+ }
5613
+ }
5614
+
5615
+ var CACHE = [];
5616
+
5617
+ if (Prototype.Browser.IE)
5618
+ window.attachEvent('onunload', _destroyCache);
5619
+
5620
+ if (Prototype.Browser.WebKit)
5621
+ window.addEventListener('unload', Prototype.emptyFunction, false);
5622
+
5623
+
5624
+ var _getDOMEventName = Prototype.K,
5625
+ translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
5626
+
5627
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
5628
+ _getDOMEventName = function(eventName) {
5629
+ return (translations[eventName] || eventName);
5630
+ };
5631
+ }
5632
+
5633
+ function observe(element, eventName, handler) {
5634
+ element = $(element);
5635
+
5636
+ var responder = _createResponder(element, eventName, handler);
5637
+
5638
+ if (!responder) return element;
5639
+
5640
+ if (eventName.include(':')) {
5641
+ if (element.addEventListener)
5642
+ element.addEventListener("dataavailable", responder, false);
5643
+ else {
5644
+ element.attachEvent("ondataavailable", responder);
5645
+ element.attachEvent("onlosecapture", responder);
5646
+ }
5647
+ } else {
5648
+ var actualEventName = _getDOMEventName(eventName);
5649
+
5650
+ if (element.addEventListener)
5651
+ element.addEventListener(actualEventName, responder, false);
5652
+ else
5653
+ element.attachEvent("on" + actualEventName, responder);
5654
+ }
5655
+
5656
+ return element;
5657
+ }
5658
+
5659
+ function stopObserving(element, eventName, handler) {
5660
+ element = $(element);
5661
+
5662
+ var registry = Element.retrieve(element, 'prototype_event_registry');
5663
+ if (!registry) return element;
5664
+
5665
+ if (!eventName) {
5666
+ registry.each( function(pair) {
5667
+ var eventName = pair.key;
5668
+ stopObserving(element, eventName);
5669
+ });
5670
+ return element;
5671
+ }
5672
+
5673
+ var responders = registry.get(eventName);
5674
+ if (!responders) return element;
5675
+
5676
+ if (!handler) {
5677
+ responders.each(function(r) {
5678
+ stopObserving(element, eventName, r.handler);
5679
+ });
5680
+ return element;
5681
+ }
5682
+
5683
+ var i = responders.length, responder;
5684
+ while (i--) {
5685
+ if (responders[i].handler === handler) {
5686
+ responder = responders[i];
5687
+ break;
5688
+ }
5689
+ }
5690
+ if (!responder) return element;
5691
+
5692
+ if (eventName.include(':')) {
5693
+ if (element.removeEventListener)
5694
+ element.removeEventListener("dataavailable", responder, false);
5695
+ else {
5696
+ element.detachEvent("ondataavailable", responder);
5697
+ element.detachEvent("onlosecapture", responder);
5698
+ }
5699
+ } else {
5700
+ var actualEventName = _getDOMEventName(eventName);
5701
+ if (element.removeEventListener)
5702
+ element.removeEventListener(actualEventName, responder, false);
5703
+ else
5704
+ element.detachEvent('on' + actualEventName, responder);
5705
+ }
5706
+
5707
+ registry.set(eventName, responders.without(responder));
5708
+
5709
+ return element;
5710
+ }
5711
+
5712
+ function fire(element, eventName, memo, bubble) {
5713
+ element = $(element);
5714
+
5715
+ if (Object.isUndefined(bubble))
5716
+ bubble = true;
5717
+
5718
+ if (element == document && document.createEvent && !element.dispatchEvent)
5719
+ element = document.documentElement;
5720
+
5721
+ var event;
5722
+ if (document.createEvent) {
5723
+ event = document.createEvent('HTMLEvents');
5724
+ event.initEvent('dataavailable', bubble, true);
5725
+ } else {
5726
+ event = document.createEventObject();
5727
+ event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
5728
+ }
5729
+
5730
+ event.eventName = eventName;
5731
+ event.memo = memo || { };
5732
+
5733
+ if (document.createEvent)
5734
+ element.dispatchEvent(event);
5735
+ else
5736
+ element.fireEvent(event.eventType, event);
5737
+
5738
+ return Event.extend(event);
5739
+ }
5740
+
5741
+ Event.Handler = Class.create({
5742
+ initialize: function(element, eventName, selector, callback) {
5743
+ this.element = $(element);
5744
+ this.eventName = eventName;
5745
+ this.selector = selector;
5746
+ this.callback = callback;
5747
+ this.handler = this.handleEvent.bind(this);
5748
+ },
5749
+
5750
+ start: function() {
5751
+ Event.observe(this.element, this.eventName, this.handler);
5752
+ return this;
5753
+ },
5754
+
5755
+ stop: function() {
5756
+ Event.stopObserving(this.element, this.eventName, this.handler);
5757
+ return this;
5758
+ },
5759
+
5760
+ handleEvent: function(event) {
5761
+ var element = Event.findElement(event, this.selector);
5762
+ if (element) this.callback.call(this.element, event, element);
5763
+ }
5764
+ });
5765
+
5766
+ function on(element, eventName, selector, callback) {
5767
+ element = $(element);
5768
+ if (Object.isFunction(selector) && Object.isUndefined(callback)) {
5769
+ callback = selector, selector = null;
5770
+ }
5771
+
5772
+ return new Event.Handler(element, eventName, selector, callback).start();
5773
+ }
5774
+
5775
+ Object.extend(Event, Event.Methods);
5776
+
5777
+ Object.extend(Event, {
5778
+ fire: fire,
5779
+ observe: observe,
5780
+ stopObserving: stopObserving,
5781
+ on: on
5782
+ });
5783
+
5784
+ Element.addMethods({
5785
+ fire: fire,
5786
+
5787
+ observe: observe,
5788
+
5789
+ stopObserving: stopObserving,
5790
+
5791
+ on: on
5792
+ });
5793
+
5794
+ Object.extend(document, {
5795
+ fire: fire.methodize(),
5796
+
5797
+ observe: observe.methodize(),
5798
+
5799
+ stopObserving: stopObserving.methodize(),
5800
+
5801
+ on: on.methodize(),
5802
+
5803
+ loaded: false
5804
+ });
5805
+
5806
+ if (window.Event) Object.extend(window.Event, Event);
5807
+ else window.Event = Event;
5808
+ })();
5809
+
5810
+ (function() {
5811
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
5812
+ Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
5813
+
5814
+ var timer;
5815
+
5816
+ function fireContentLoadedEvent() {
5817
+ if (document.loaded) return;
5818
+ if (timer) window.clearTimeout(timer);
5819
+ document.loaded = true;
5820
+ document.fire('dom:loaded');
5821
+ }
5822
+
5823
+ function checkReadyState() {
5824
+ if (document.readyState === 'complete') {
5825
+ document.stopObserving('readystatechange', checkReadyState);
5826
+ fireContentLoadedEvent();
5827
+ }
5828
+ }
5829
+
5830
+ function pollDoScroll() {
5831
+ try { document.documentElement.doScroll('left'); }
5832
+ catch(e) {
5833
+ timer = pollDoScroll.defer();
5834
+ return;
5835
+ }
5836
+ fireContentLoadedEvent();
5837
+ }
5838
+
5839
+ if (document.addEventListener) {
5840
+ document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
5841
+ } else {
5842
+ document.observe('readystatechange', checkReadyState);
5843
+ if (window == top)
5844
+ timer = pollDoScroll.defer();
5845
+ }
5846
+
5847
+ Event.observe(window, 'load', fireContentLoadedEvent);
5848
+ })();
5849
+
5850
+ Element.addMethods();
5851
+
5852
+ /*------------------------------- DEPRECATED -------------------------------*/
5853
+
5854
+ Hash.toQueryString = Object.toQueryString;
5855
+
5856
+ var Toggle = { display: Element.toggle };
5857
+
5858
+ Element.Methods.childOf = Element.Methods.descendantOf;
5859
+
5860
+ var Insertion = {
5861
+ Before: function(element, content) {
5862
+ return Element.insert(element, {before:content});
5863
+ },
5864
+
5865
+ Top: function(element, content) {
5866
+ return Element.insert(element, {top:content});
5867
+ },
5868
+
5869
+ Bottom: function(element, content) {
5870
+ return Element.insert(element, {bottom:content});
5871
+ },
5872
+
5873
+ After: function(element, content) {
5874
+ return Element.insert(element, {after:content});
5875
+ }
5876
+ };
5877
+
5878
+ var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
5879
+
5880
+ var Position = {
5881
+ includeScrollOffsets: false,
5882
+
5883
+ prepare: function() {
5884
+ this.deltaX = window.pageXOffset
5885
+ || document.documentElement.scrollLeft
5886
+ || document.body.scrollLeft
5887
+ || 0;
5888
+ this.deltaY = window.pageYOffset
5889
+ || document.documentElement.scrollTop
5890
+ || document.body.scrollTop
5891
+ || 0;
5892
+ },
5893
+
5894
+ within: function(element, x, y) {
5895
+ if (this.includeScrollOffsets)
5896
+ return this.withinIncludingScrolloffsets(element, x, y);
5897
+ this.xcomp = x;
5898
+ this.ycomp = y;
5899
+ this.offset = Element.cumulativeOffset(element);
5900
+
5901
+ return (y >= this.offset[1] &&
5902
+ y < this.offset[1] + element.offsetHeight &&
5903
+ x >= this.offset[0] &&
5904
+ x < this.offset[0] + element.offsetWidth);
5905
+ },
5906
+
5907
+ withinIncludingScrolloffsets: function(element, x, y) {
5908
+ var offsetcache = Element.cumulativeScrollOffset(element);
5909
+
5910
+ this.xcomp = x + offsetcache[0] - this.deltaX;
5911
+ this.ycomp = y + offsetcache[1] - this.deltaY;
5912
+ this.offset = Element.cumulativeOffset(element);
5913
+
5914
+ return (this.ycomp >= this.offset[1] &&
5915
+ this.ycomp < this.offset[1] + element.offsetHeight &&
5916
+ this.xcomp >= this.offset[0] &&
5917
+ this.xcomp < this.offset[0] + element.offsetWidth);
5918
+ },
5919
+
5920
+ overlap: function(mode, element) {
5921
+ if (!mode) return 0;
5922
+ if (mode == 'vertical')
5923
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
5924
+ element.offsetHeight;
5925
+ if (mode == 'horizontal')
5926
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
5927
+ element.offsetWidth;
5928
+ },
5929
+
5930
+
5931
+ cumulativeOffset: Element.Methods.cumulativeOffset,
5932
+
5933
+ positionedOffset: Element.Methods.positionedOffset,
5934
+
5935
+ absolutize: function(element) {
5936
+ Position.prepare();
5937
+ return Element.absolutize(element);
5938
+ },
5939
+
5940
+ relativize: function(element) {
5941
+ Position.prepare();
5942
+ return Element.relativize(element);
5943
+ },
5944
+
5945
+ realOffset: Element.Methods.cumulativeScrollOffset,
5946
+
5947
+ offsetParent: Element.Methods.getOffsetParent,
5948
+
5949
+ page: Element.Methods.viewportOffset,
5950
+
5951
+ clone: function(source, target, options) {
5952
+ options = options || { };
5953
+ return Element.clonePosition(target, source, options);
5954
+ }
5955
+ };
5956
+
5957
+ /*--------------------------------------------------------------------------*/
5958
+
5959
+ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
5960
+ function iter(name) {
5961
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
5962
+ }
5963
+
5964
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
5965
+ function(element, className) {
5966
+ className = className.toString().strip();
5967
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
5968
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
5969
+ } : function(element, className) {
5970
+ className = className.toString().strip();
5971
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
5972
+ if (!classNames && !className) return elements;
5973
+
5974
+ var nodes = $(element).getElementsByTagName('*');
5975
+ className = ' ' + className + ' ';
5976
+
5977
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
5978
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
5979
+ (classNames && classNames.all(function(name) {
5980
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
5981
+ }))))
5982
+ elements.push(Element.extend(child));
5983
+ }
5984
+ return elements;
5985
+ };
5986
+
5987
+ return function(className, parentElement) {
5988
+ return $(parentElement || document.body).getElementsByClassName(className);
5989
+ };
5990
+ }(Element.Methods);
5991
+
5992
+ /*--------------------------------------------------------------------------*/
5993
+
5994
+ Element.ClassNames = Class.create();
5995
+ Element.ClassNames.prototype = {
5996
+ initialize: function(element) {
5997
+ this.element = $(element);
5998
+ },
5999
+
6000
+ _each: function(iterator) {
6001
+ this.element.className.split(/\s+/).select(function(name) {
6002
+ return name.length > 0;
6003
+ })._each(iterator);
6004
+ },
6005
+
6006
+ set: function(className) {
6007
+ this.element.className = className;
6008
+ },
6009
+
6010
+ add: function(classNameToAdd) {
6011
+ if (this.include(classNameToAdd)) return;
6012
+ this.set($A(this).concat(classNameToAdd).join(' '));
6013
+ },
6014
+
6015
+ remove: function(classNameToRemove) {
6016
+ if (!this.include(classNameToRemove)) return;
6017
+ this.set($A(this).without(classNameToRemove).join(' '));
6018
+ },
6019
+
6020
+ toString: function() {
6021
+ return $A(this).join(' ');
6022
+ }
6023
+ };
6024
+
6025
+ Object.extend(Element.ClassNames.prototype, Enumerable);
6026
+
6027
+ /*--------------------------------------------------------------------------*/
6028
+
6029
+ (function() {
6030
+ window.Selector = Class.create({
6031
+ initialize: function(expression) {
6032
+ this.expression = expression.strip();
6033
+ },
6034
+
6035
+ findElements: function(rootElement) {
6036
+ return Prototype.Selector.select(this.expression, rootElement);
6037
+ },
6038
+
6039
+ match: function(element) {
6040
+ return Prototype.Selector.match(element, this.expression);
6041
+ },
6042
+
6043
+ toString: function() {
6044
+ return this.expression;
6045
+ },
6046
+
6047
+ inspect: function() {
6048
+ return "#<Selector: " + this.expression + ">";
6049
+ }
6050
+ });
6051
+
6052
+ Object.extend(Selector, {
6053
+ matchElements: function(elements, expression) {
6054
+ var match = Prototype.Selector.match,
6055
+ results = [];
6056
+
6057
+ for (var i = 0, length = elements.length; i < length; i++) {
6058
+ var element = elements[i];
6059
+ if (match(element, expression)) {
6060
+ results.push(Element.extend(element));
6061
+ }
6062
+ }
6063
+ return results;
6064
+ },
6065
+
6066
+ findElement: function(elements, expression, index) {
6067
+ index = index || 0;
6068
+ var matchIndex = 0, element;
6069
+ for (var i = 0, length = elements.length; i < length; i++) {
6070
+ element = elements[i];
6071
+ if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
6072
+ return Element.extend(element);
6073
+ }
6074
+ }
6075
+ },
6076
+
6077
+ findChildElements: function(element, expressions) {
6078
+ var selector = expressions.toArray().join(', ');
6079
+ return Prototype.Selector.select(selector, element || document);
6080
+ }
6081
+ });
6082
+ })();
common/libs/chosen-v1.8.3/docsupport/style.css ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Reset */
2
+ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
3
+
4
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
5
+
6
+ blockquote, q { quotes: none; }
7
+ blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; }
8
+ ins { background-color: #ff9; color: #000; text-decoration: none; }
9
+ mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
10
+ del { text-decoration: line-through; }
11
+ abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
12
+ table { border-collapse: collapse; border-spacing: 0; }
13
+ hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
14
+ input, select { vertical-align: middle; }
15
+
16
+ body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
17
+ select, input, textarea, button { font:99% sans-serif; }
18
+ pre, code, kbd, samp { font-family: monospace, sans-serif; }
19
+
20
+
21
+ body { background: #EEE; color: #444; line-height: 1.4em; }
22
+
23
+ header h1 { color: black; font-size: 2em; line-height: 1.1em; display: inline-block; height: 27px; margin: 20px 0 25px; }
24
+ header h1 small { font-size: 0.6em; }
25
+
26
+ div#content { background: white; border: 1px solid #ccc; border-width: 0 1px 1px; margin: 0 auto; padding: 40px 50px 40px; width: 738px; }
27
+
28
+ footer { color: #999; padding-top: 40px; font-size: 0.8em; text-align: center; }
29
+
30
+ body { font-family: sans-serif; font-size: 1em; }
31
+
32
+ p { margin: 0 0 .7em; max-width: 700px; }
33
+ table+p { margin-top: 1em; }
34
+
35
+ h2 { border-bottom: 1px solid #ccc; font-size: 1.2em; margin: 3em 0 1em 0; font-weight: bold;}
36
+ h3 { font-weight: bold; }
37
+
38
+ h2.intro { border-bottom: none; font-size: 1em; font-weight: normal; margin-top:0; }
39
+
40
+ ul li { list-style: disc; margin-left: 1em; margin-bottom: 1.25em; }
41
+ ol li { margin-left: 1.25em; }
42
+ ol ul, ul ul { margin: .25em 0 0; }
43
+ ol ul li, ul ul li { list-style-type: circle; margin: 0 0 .25em 1em; }
44
+
45
+ li > p { margin-top: .25em; }
46
+
47
+ div.side-by-side { width: 100%; margin-bottom: 1em; }
48
+ div.side-by-side > div { float: left; width: 49%; }
49
+ div.side-by-side > div > em { margin-bottom: 10px; display: block; }
50
+
51
+ .faqs em { display: block; }
52
+
53
+ .clearfix:after {
54
+ content: "\0020";
55
+ display: block;
56
+ height: 0;
57
+ clear: both;
58
+ overflow: hidden;
59
+ visibility: hidden;
60
+ }
61
+
62
+ a { color: #F36C00; outline: none; text-decoration: none; }
63
+ a:hover { text-decoration: underline; }
64
+
65
+ ul.credits li { margin-bottom: .25em; }
66
+
67
+ strong { font-weight: bold; }
68
+ i { font-style: italic; }
69
+
70
+ .button {
71
+ background: #fafafa;
72
+ background: -webkit-linear-gradient(top, #ffffff, #eeeeee);
73
+ background: -moz-linear-gradient(top, #ffffff, #eeeeee);
74
+ background: -o-linear-gradient(top, #ffffff, #eeeeee);
75
+ background: linear-gradient(to bottom, #ffffff, #eeeeee);
76
+ border: 1px solid #bbbbbb;
77
+ border-radius: 4px;
78
+ box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
79
+ color: #555555;
80
+ cursor: pointer;
81
+ display: inline-block;
82
+ font-family: "Helvetica Neue", Arial, Verdana, "Nimbus Sans L", sans-serif;
83
+ font-size: 13px;
84
+ font-weight: 500;
85
+ height: 31px;
86
+ line-height: 28px;
87
+ outline: none;
88
+ padding: 0 13px;
89
+ text-shadow: 0 1px 0 white;
90
+ text-decoration: none;
91
+ vertical-align: middle;
92
+ white-space: nowrap;
93
+ -webkit-font-smoothing: antialiased;
94
+ -webkit-box-sizing: border-box;
95
+ -moz-box-sizing: border-box;
96
+ box-sizing: border-box;
97
+ }
98
+
99
+ .button-blue {
100
+ background: #1385e5;
101
+ background: -webkit-linear-gradient(top, #53b2fc, #1385e5);
102
+ background: -moz-linear-gradient(top, #53b2fc, #1385e5);
103
+ background: -o-linear-gradient(top, #53b2fc, #1385e5);
104
+ background: linear-gradient(to bottom, #53b2fc, #1385e5);
105
+ border-color: #075fa9;
106
+ color: white;
107
+ font-weight: bold;
108
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
109
+ }
110
+
111
+
112
+ /* Tweak navbar brand link to be super sleek
113
+ -------------------------------------------------- */
114
+ .oss-bar {
115
+ top: 0;
116
+ right: 20px;
117
+ position: fixed;
118
+ z-index: 1030;
119
+ }
120
+ .oss-bar ul {
121
+ float: right;
122
+ margin: 0;
123
+ list-style: none;
124
+ }
125
+ .oss-bar ul li {
126
+ list-style: none;
127
+ float: left;
128
+ line-height: 0;
129
+ margin: 0;
130
+ }
131
+ .oss-bar ul li a {
132
+ -moz-box-sizing: border-box;
133
+ -webkit-box-sizing: border-box;
134
+ -ms-box-sizing: border-box;
135
+ box-sizing: border-box;
136
+ border: 0;
137
+ margin-top: -10px;
138
+ display: block;
139
+ height: 58px;
140
+ background: #F36C00 url(oss-credit.png) no-repeat 20px 22px;
141
+ padding: 22px 20px 12px 20px;
142
+ text-indent: 120%; /* stupid padding */
143
+ white-space: nowrap;
144
+ overflow: hidden;
145
+ -webkit-transition: all 0.10s ease-in-out;
146
+ -moz-transition: all 0.10s ease-in-out;
147
+ transition: all 0.15s ease-in-out;
148
+ }
149
+ .oss-bar ul li a:hover {
150
+ margin-top: 0px;
151
+ }
152
+ .oss-bar a.harvest {
153
+ width: 196px;
154
+ background-color: #F36C00;
155
+ background-position: -142px 22px;
156
+ padding-right: 22px; /* optical illusion */
157
+ }
158
+ .oss-bar a.fork {
159
+ width: 162px;
160
+ background-color: #333333;
161
+ }
162
+
163
+ .docs-table th, .docs-table td {
164
+ border: 1px solid #000;
165
+ padding: 4px 6px;
166
+ white-space: nowrap;
167
+ }
168
+
169
+ .docs-table td:last-child {
170
+ white-space: normal;
171
+ }
172
+
173
+ .docs-table th {
174
+ font-weight: bold;
175
+ text-align: left;
176
+ }
177
+
178
+ #content pre[class*=language-] {
179
+ font-size: 14px;
180
+ margin-bottom: 20px;
181
+ }
182
+
183
+ #content pre[class*=language-] code {
184
+ font-size: 14px;
185
+ padding: 0;
186
+ }
187
+
188
+ #content code[class*=language-] {
189
+ font-size: 12px;
190
+ padding: 2px 4px;
191
+ }
192
+
193
+ .anchor {
194
+ color: inherit;
195
+ position: relative;
196
+ }
197
+
198
+ .anchor:hover {
199
+ background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSI3Ij48ZyBmaWxsPSIjNDE0MDQyIj48cGF0aCBkPSJNOS44IDdoLS45bC0uOS0uMWMtLjctLjMtMS40LS43LTEuOC0xLjMtLjItLjEtLjMtLjMtLjMtLjVsLS4zLS40Yy0uMS0uNC0uMi0uOC0uMi0xLjIgMC0uNC4xLS44LjItMS4yaDEuN2MtLjMuNC0uNC44LS40IDEuMiAwIC40LjEuOC4zIDEuMS4xLjIuMi4zLjQuNC4xLjEuMi4yLjQuMy4zLjIuNy4zIDEgLjNoMy40YzEuMiAwIDIuMi0uOSAyLjItMi4xcy0xLTIuMS0yLjItMi4xaC0xLjRjLS4zLS42LS43LTEtMS4yLTEuNGgyLjZjMiAwIDMuNiAxLjYgMy42IDMuNXMtMS42IDMuNS0zLjYgMy41aC0yLjZ6TTguNCAyYy0uMS0uMS0uMi0uMy0uNC0uMy0uMy0uMi0uNy0uMy0xLS4zaC0zLjRjLTEuMiAwLTIuMi45LTIuMiAyLjEgMCAxLjIgMSAyLjEgMi4yIDIuMWgxLjRjLjMuNS43IDEgMS4yIDEuNGgtMi42Yy0yIDAtMy42LTEuNi0zLjYtMy41czEuNi0zLjUgMy42LTMuNWgzLjUwMDAwMDAwMDAwMDAwMDRsLjkuMWMuNy4yIDEuNC43IDEuOCAxLjMuMS4xLjIuMy4zLjUuMS4xLjIuMy4yLjUuMS40LjIuOC4yIDEuMiAwIC40LS4xLjgtLjIgMS4yaC0xLjZjLjMtLjUuNC0uOS40LTEuM3MtLjEtLjgtLjMtMS4xYy0uMS0uMi0uMi0uMy0uNC0uNHoiLz48L2c+PC9zdmc+) 0 50% no-repeat;
200
+ background-size: 21px 9px;
201
+ margin-left: -27px;
202
+ padding-left: 27px;
203
+ text-decoration: none;
204
+ }
205
+
206
+ .select,
207
+ .chosen-select,
208
+ .chosen-select-no-single,
209
+ .chosen-select-no-results,
210
+ .chosen-select-deselect,
211
+ .chosen-select-rtl,
212
+ .chosen-select-width {
213
+ width: 350px;
214
+ }
215
+
216
+ .jquery-version-refer {
217
+ margin-top: 40px;
218
+ font-style: italic;
219
+ }
common/libs/chosen-v1.8.3/index.html ADDED
@@ -0,0 +1,1473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
+ <link rel="stylesheet" href="docsupport/style.css">
7
+ <link rel="stylesheet" href="docsupport/prism.css">
8
+ <link rel="stylesheet" href="chosen.css">
9
+
10
+ <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
+
12
+ </head>
13
+ <body>
14
+ <form>
15
+ <div id="container">
16
+ <div id="content">
17
+ <header>
18
+ <h1>Chosen <small>(<span id="latest-version">v1.8.3</span>)</small></h1>
19
+ </header>
20
+ <p>Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.</p>
21
+
22
+ <p>
23
+ <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
24
+ <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
25
+ <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
26
+ </p>
27
+
28
+ <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
29
+ <div class="side-by-side clearfix">
30
+ <div>
31
+ <em>Turns This</em>
32
+ <select data-placeholder="Choose a Country..." class="select" tabindex="1">
33
+ <option value=""></option>
34
+ <option value="United States">United States</option>
35
+ <option value="United Kingdom">United Kingdom</option>
36
+ <option value="Afghanistan">Afghanistan</option>
37
+ <option value="Aland Islands">Aland Islands</option>
38
+ <option value="Albania">Albania</option>
39
+ <option value="Algeria">Algeria</option>
40
+ <option value="American Samoa">American Samoa</option>
41
+ <option value="Andorra">Andorra</option>
42
+ <option value="Angola">Angola</option>
43
+ <option value="Anguilla">Anguilla</option>
44
+ <option value="Antarctica">Antarctica</option>
45
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
46
+ <option value="Argentina">Argentina</option>
47
+ <option value="Armenia">Armenia</option>
48
+ <option value="Aruba">Aruba</option>
49
+ <option value="Australia">Australia</option>
50
+ <option value="Austria">Austria</option>
51
+ <option value="Azerbaijan">Azerbaijan</option>
52
+ <option value="Bahamas">Bahamas</option>
53
+ <option value="Bahrain">Bahrain</option>
54
+ <option value="Bangladesh">Bangladesh</option>
55
+ <option value="Barbados">Barbados</option>
56
+ <option value="Belarus">Belarus</option>
57
+ <option value="Belgium">Belgium</option>
58
+ <option value="Belize">Belize</option>
59
+ <option value="Benin">Benin</option>
60
+ <option value="Bermuda">Bermuda</option>
61
+ <option value="Bhutan">Bhutan</option>
62
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
63
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
64
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
65
+ <option value="Botswana">Botswana</option>
66
+ <option value="Bouvet Island">Bouvet Island</option>
67
+ <option value="Brazil">Brazil</option>
68
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
69
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
70
+ <option value="Bulgaria">Bulgaria</option>
71
+ <option value="Burkina Faso">Burkina Faso</option>
72
+ <option value="Burundi">Burundi</option>
73
+ <option value="Cambodia">Cambodia</option>
74
+ <option value="Cameroon">Cameroon</option>
75
+ <option value="Canada">Canada</option>
76
+ <option value="Cape Verde">Cape Verde</option>
77
+ <option value="Cayman Islands">Cayman Islands</option>
78
+ <option value="Central African Republic">Central African Republic</option>
79
+ <option value="Chad">Chad</option>
80
+ <option value="Chile">Chile</option>
81
+ <option value="China">China</option>
82
+ <option value="Christmas Island">Christmas Island</option>
83
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
84
+ <option value="Colombia">Colombia</option>
85
+ <option value="Comoros">Comoros</option>
86
+ <option value="Congo">Congo</option>
87
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
88
+ <option value="Cook Islands">Cook Islands</option>
89
+ <option value="Costa Rica">Costa Rica</option>
90
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
91
+ <option value="Croatia">Croatia</option>
92
+ <option value="Cuba">Cuba</option>
93
+ <option value="Curacao">Curacao</option>
94
+ <option value="Cyprus">Cyprus</option>
95
+ <option value="Czech Republic">Czech Republic</option>
96
+ <option value="Denmark">Denmark</option>
97
+ <option value="Djibouti">Djibouti</option>
98
+ <option value="Dominica">Dominica</option>
99
+ <option value="Dominican Republic">Dominican Republic</option>
100
+ <option value="Ecuador">Ecuador</option>
101
+ <option value="Egypt">Egypt</option>
102
+ <option value="El Salvador">El Salvador</option>
103
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
104
+ <option value="Eritrea">Eritrea</option>
105
+ <option value="Estonia">Estonia</option>
106
+ <option value="Ethiopia">Ethiopia</option>
107
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
108
+ <option value="Faroe Islands">Faroe Islands</option>
109
+ <option value="Fiji">Fiji</option>
110
+ <option value="Finland">Finland</option>
111
+ <option value="France">France</option>
112
+ <option value="French Guiana">French Guiana</option>
113
+ <option value="French Polynesia">French Polynesia</option>
114
+ <option value="French Southern Territories">French Southern Territories</option>
115
+ <option value="Gabon">Gabon</option>
116
+ <option value="Gambia">Gambia</option>
117
+ <option value="Georgia">Georgia</option>
118
+ <option value="Germany">Germany</option>
119
+ <option value="Ghana">Ghana</option>
120
+ <option value="Gibraltar">Gibraltar</option>
121
+ <option value="Greece">Greece</option>
122
+ <option value="Greenland">Greenland</option>
123
+ <option value="Grenada">Grenada</option>
124
+ <option value="Guadeloupe">Guadeloupe</option>
125
+ <option value="Guam">Guam</option>
126
+ <option value="Guatemala">Guatemala</option>
127
+ <option value="Guernsey">Guernsey</option>
128
+ <option value="Guinea">Guinea</option>
129
+ <option value="Guinea-bissau">Guinea-bissau</option>
130
+ <option value="Guyana">Guyana</option>
131
+ <option value="Haiti">Haiti</option>
132
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
133
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
134
+ <option value="Honduras">Honduras</option>
135
+ <option value="Hong Kong">Hong Kong</option>
136
+ <option value="Hungary">Hungary</option>
137
+ <option value="Iceland">Iceland</option>
138
+ <option value="India">India</option>
139
+ <option value="Indonesia">Indonesia</option>
140
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
141
+ <option value="Iraq">Iraq</option>
142
+ <option value="Ireland">Ireland</option>
143
+ <option value="Isle of Man">Isle of Man</option>
144
+ <option value="Israel">Israel</option>
145
+ <option value="Italy">Italy</option>
146
+ <option value="Jamaica">Jamaica</option>
147
+ <option value="Japan">Japan</option>
148
+ <option value="Jersey">Jersey</option>
149
+ <option value="Jordan">Jordan</option>
150
+ <option value="Kazakhstan">Kazakhstan</option>
151
+ <option value="Kenya">Kenya</option>
152
+ <option value="Kiribati">Kiribati</option>
153
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
154
+ <option value="Korea, Republic of">Korea, Republic of</option>
155
+ <option value="Kuwait">Kuwait</option>
156
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
157
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
158
+ <option value="Latvia">Latvia</option>
159
+ <option value="Lebanon">Lebanon</option>
160
+ <option value="Lesotho">Lesotho</option>
161
+ <option value="Liberia">Liberia</option>
162
+ <option value="Libya">Libya</option>
163
+ <option value="Liechtenstein">Liechtenstein</option>
164
+ <option value="Lithuania">Lithuania</option>
165
+ <option value="Luxembourg">Luxembourg</option>
166
+ <option value="Macao">Macao</option>
167
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
168
+ <option value="Madagascar">Madagascar</option>
169
+ <option value="Malawi">Malawi</option>
170
+ <option value="Malaysia">Malaysia</option>
171
+ <option value="Maldives">Maldives</option>
172
+ <option value="Mali">Mali</option>
173
+ <option value="Malta">Malta</option>
174
+ <option value="Marshall Islands">Marshall Islands</option>
175
+ <option value="Martinique">Martinique</option>
176
+ <option value="Mauritania">Mauritania</option>
177
+ <option value="Mauritius">Mauritius</option>
178
+ <option value="Mayotte">Mayotte</option>
179
+ <option value="Mexico">Mexico</option>
180
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
181
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
182
+ <option value="Monaco">Monaco</option>
183
+ <option value="Mongolia">Mongolia</option>
184
+ <option value="Montenegro">Montenegro</option>
185
+ <option value="Montserrat">Montserrat</option>
186
+ <option value="Morocco">Morocco</option>
187
+ <option value="Mozambique">Mozambique</option>
188
+ <option value="Myanmar">Myanmar</option>
189
+ <option value="Namibia">Namibia</option>
190
+ <option value="Nauru">Nauru</option>
191
+ <option value="Nepal">Nepal</option>
192
+ <option value="Netherlands">Netherlands</option>
193
+ <option value="New Caledonia">New Caledonia</option>
194
+ <option value="New Zealand">New Zealand</option>
195
+ <option value="Nicaragua">Nicaragua</option>
196
+ <option value="Niger">Niger</option>
197
+ <option value="Nigeria">Nigeria</option>
198
+ <option value="Niue">Niue</option>
199
+ <option value="Norfolk Island">Norfolk Island</option>
200
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
201
+ <option value="Norway">Norway</option>
202
+ <option value="Oman">Oman</option>
203
+ <option value="Pakistan">Pakistan</option>
204
+ <option value="Palau">Palau</option>
205
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
206
+ <option value="Panama">Panama</option>
207
+ <option value="Papua New Guinea">Papua New Guinea</option>
208
+ <option value="Paraguay">Paraguay</option>
209
+ <option value="Peru">Peru</option>
210
+ <option value="Philippines">Philippines</option>
211
+ <option value="Pitcairn">Pitcairn</option>
212
+ <option value="Poland">Poland</option>
213
+ <option value="Portugal">Portugal</option>
214
+ <option value="Puerto Rico">Puerto Rico</option>
215
+ <option value="Qatar">Qatar</option>
216
+ <option value="Reunion">Reunion</option>
217
+ <option value="Romania">Romania</option>
218
+ <option value="Russian Federation">Russian Federation</option>
219
+ <option value="Rwanda">Rwanda</option>
220
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
221
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
222
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
223
+ <option value="Saint Lucia">Saint Lucia</option>
224
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
225
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
226
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
227
+ <option value="Samoa">Samoa</option>
228
+ <option value="San Marino">San Marino</option>
229
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
230
+ <option value="Saudi Arabia">Saudi Arabia</option>
231
+ <option value="Senegal">Senegal</option>
232
+ <option value="Serbia">Serbia</option>
233
+ <option value="Seychelles">Seychelles</option>
234
+ <option value="Sierra Leone">Sierra Leone</option>
235
+ <option value="Singapore">Singapore</option>
236
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
237
+ <option value="Slovakia">Slovakia</option>
238
+ <option value="Slovenia">Slovenia</option>
239
+ <option value="Solomon Islands">Solomon Islands</option>
240
+ <option value="Somalia">Somalia</option>
241
+ <option value="South Africa">South Africa</option>
242
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
243
+ <option value="South Sudan">South Sudan</option>
244
+ <option value="Spain">Spain</option>
245
+ <option value="Sri Lanka">Sri Lanka</option>
246
+ <option value="Sudan">Sudan</option>
247
+ <option value="Suriname">Suriname</option>
248
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
249
+ <option value="Swaziland">Swaziland</option>
250
+ <option value="Sweden">Sweden</option>
251
+ <option value="Switzerland">Switzerland</option>
252
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
253
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
254
+ <option value="Tajikistan">Tajikistan</option>
255
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
256
+ <option value="Thailand">Thailand</option>
257
+ <option value="Timor-leste">Timor-leste</option>
258
+ <option value="Togo">Togo</option>
259
+ <option value="Tokelau">Tokelau</option>
260
+ <option value="Tonga">Tonga</option>
261
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
262
+ <option value="Tunisia">Tunisia</option>
263
+ <option value="Turkey">Turkey</option>
264
+ <option value="Turkmenistan">Turkmenistan</option>
265
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
266
+ <option value="Tuvalu">Tuvalu</option>
267
+ <option value="Uganda">Uganda</option>
268
+ <option value="Ukraine">Ukraine</option>
269
+ <option value="United Arab Emirates">United Arab Emirates</option>
270
+ <option value="United Kingdom">United Kingdom</option>
271
+ <option value="United States">United States</option>
272
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
273
+ <option value="Uruguay">Uruguay</option>
274
+ <option value="Uzbekistan">Uzbekistan</option>
275
+ <option value="Vanuatu">Vanuatu</option>
276
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
277
+ <option value="Viet Nam">Viet Nam</option>
278
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
279
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
280
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
281
+ <option value="Western Sahara">Western Sahara</option>
282
+ <option value="Yemen">Yemen</option>
283
+ <option value="Zambia">Zambia</option>
284
+ <option value="Zimbabwe">Zimbabwe</option>
285
+ </select>
286
+ </div>
287
+ <div>
288
+ <em>Into This</em>
289
+ <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
290
+ <option value=""></option>
291
+ <option value="United States">United States</option>
292
+ <option value="United Kingdom">United Kingdom</option>
293
+ <option value="Afghanistan">Afghanistan</option>
294
+ <option value="Aland Islands">Aland Islands</option>
295
+ <option value="Albania">Albania</option>
296
+ <option value="Algeria">Algeria</option>
297
+ <option value="American Samoa">American Samoa</option>
298
+ <option value="Andorra">Andorra</option>
299
+ <option value="Angola">Angola</option>
300
+ <option value="Anguilla">Anguilla</option>
301
+ <option value="Antarctica">Antarctica</option>
302
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
303
+ <option value="Argentina">Argentina</option>
304
+ <option value="Armenia">Armenia</option>
305
+ <option value="Aruba">Aruba</option>
306
+ <option value="Australia">Australia</option>
307
+ <option value="Austria">Austria</option>
308
+ <option value="Azerbaijan">Azerbaijan</option>
309
+ <option value="Bahamas">Bahamas</option>
310
+ <option value="Bahrain">Bahrain</option>
311
+ <option value="Bangladesh">Bangladesh</option>
312
+ <option value="Barbados">Barbados</option>
313
+ <option value="Belarus">Belarus</option>
314
+ <option value="Belgium">Belgium</option>
315
+ <option value="Belize">Belize</option>
316
+ <option value="Benin">Benin</option>
317
+ <option value="Bermuda">Bermuda</option>
318
+ <option value="Bhutan">Bhutan</option>
319
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
320
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
321
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
322
+ <option value="Botswana">Botswana</option>
323
+ <option value="Bouvet Island">Bouvet Island</option>
324
+ <option value="Brazil">Brazil</option>
325
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
326
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
327
+ <option value="Bulgaria">Bulgaria</option>
328
+ <option value="Burkina Faso">Burkina Faso</option>
329
+ <option value="Burundi">Burundi</option>
330
+ <option value="Cambodia">Cambodia</option>
331
+ <option value="Cameroon">Cameroon</option>
332
+ <option value="Canada">Canada</option>
333
+ <option value="Cape Verde">Cape Verde</option>
334
+ <option value="Cayman Islands">Cayman Islands</option>
335
+ <option value="Central African Republic">Central African Republic</option>
336
+ <option value="Chad">Chad</option>
337
+ <option value="Chile">Chile</option>
338
+ <option value="China">China</option>
339
+ <option value="Christmas Island">Christmas Island</option>
340
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
341
+ <option value="Colombia">Colombia</option>
342
+ <option value="Comoros">Comoros</option>
343
+ <option value="Congo">Congo</option>
344
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
345
+ <option value="Cook Islands">Cook Islands</option>
346
+ <option value="Costa Rica">Costa Rica</option>
347
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
348
+ <option value="Croatia">Croatia</option>
349
+ <option value="Cuba">Cuba</option>
350
+ <option value="Curacao">Curacao</option>
351
+ <option value="Cyprus">Cyprus</option>
352
+ <option value="Czech Republic">Czech Republic</option>
353
+ <option value="Denmark">Denmark</option>
354
+ <option value="Djibouti">Djibouti</option>
355
+ <option value="Dominica">Dominica</option>
356
+ <option value="Dominican Republic">Dominican Republic</option>
357
+ <option value="Ecuador">Ecuador</option>
358
+ <option value="Egypt">Egypt</option>
359
+ <option value="El Salvador">El Salvador</option>
360
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
361
+ <option value="Eritrea">Eritrea</option>
362
+ <option value="Estonia">Estonia</option>
363
+ <option value="Ethiopia">Ethiopia</option>
364
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
365
+ <option value="Faroe Islands">Faroe Islands</option>
366
+ <option value="Fiji">Fiji</option>
367
+ <option value="Finland">Finland</option>
368
+ <option value="France">France</option>
369
+ <option value="French Guiana">French Guiana</option>
370
+ <option value="French Polynesia">French Polynesia</option>
371
+ <option value="French Southern Territories">French Southern Territories</option>
372
+ <option value="Gabon">Gabon</option>
373
+ <option value="Gambia">Gambia</option>
374
+ <option value="Georgia">Georgia</option>
375
+ <option value="Germany">Germany</option>
376
+ <option value="Ghana">Ghana</option>
377
+ <option value="Gibraltar">Gibraltar</option>
378
+ <option value="Greece">Greece</option>
379
+ <option value="Greenland">Greenland</option>
380
+ <option value="Grenada">Grenada</option>
381
+ <option value="Guadeloupe">Guadeloupe</option>
382
+ <option value="Guam">Guam</option>
383
+ <option value="Guatemala">Guatemala</option>
384
+ <option value="Guernsey">Guernsey</option>
385
+ <option value="Guinea">Guinea</option>
386
+ <option value="Guinea-bissau">Guinea-bissau</option>
387
+ <option value="Guyana">Guyana</option>
388
+ <option value="Haiti">Haiti</option>
389
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
390
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
391
+ <option value="Honduras">Honduras</option>
392
+ <option value="Hong Kong">Hong Kong</option>
393
+ <option value="Hungary">Hungary</option>
394
+ <option value="Iceland">Iceland</option>
395
+ <option value="India">India</option>
396
+ <option value="Indonesia">Indonesia</option>
397
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
398
+ <option value="Iraq">Iraq</option>
399
+ <option value="Ireland">Ireland</option>
400
+ <option value="Isle of Man">Isle of Man</option>
401
+ <option value="Israel">Israel</option>
402
+ <option value="Italy">Italy</option>
403
+ <option value="Jamaica">Jamaica</option>
404
+ <option value="Japan">Japan</option>
405
+ <option value="Jersey">Jersey</option>
406
+ <option value="Jordan">Jordan</option>
407
+ <option value="Kazakhstan">Kazakhstan</option>
408
+ <option value="Kenya">Kenya</option>
409
+ <option value="Kiribati">Kiribati</option>
410
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
411
+ <option value="Korea, Republic of">Korea, Republic of</option>
412
+ <option value="Kuwait">Kuwait</option>
413
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
414
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
415
+ <option value="Latvia">Latvia</option>
416
+ <option value="Lebanon">Lebanon</option>
417
+ <option value="Lesotho">Lesotho</option>
418
+ <option value="Liberia">Liberia</option>
419
+ <option value="Libya">Libya</option>
420
+ <option value="Liechtenstein">Liechtenstein</option>
421
+ <option value="Lithuania">Lithuania</option>
422
+ <option value="Luxembourg">Luxembourg</option>
423
+ <option value="Macao">Macao</option>
424
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
425
+ <option value="Madagascar">Madagascar</option>
426
+ <option value="Malawi">Malawi</option>
427
+ <option value="Malaysia">Malaysia</option>
428
+ <option value="Maldives">Maldives</option>
429
+ <option value="Mali">Mali</option>
430
+ <option value="Malta">Malta</option>
431
+ <option value="Marshall Islands">Marshall Islands</option>
432
+ <option value="Martinique">Martinique</option>
433
+ <option value="Mauritania">Mauritania</option>
434
+ <option value="Mauritius">Mauritius</option>
435
+ <option value="Mayotte">Mayotte</option>
436
+ <option value="Mexico">Mexico</option>
437
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
438
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
439
+ <option value="Monaco">Monaco</option>
440
+ <option value="Mongolia">Mongolia</option>
441
+ <option value="Montenegro">Montenegro</option>
442
+ <option value="Montserrat">Montserrat</option>
443
+ <option value="Morocco">Morocco</option>
444
+ <option value="Mozambique">Mozambique</option>
445
+ <option value="Myanmar">Myanmar</option>
446
+ <option value="Namibia">Namibia</option>
447
+ <option value="Nauru">Nauru</option>
448
+ <option value="Nepal">Nepal</option>
449
+ <option value="Netherlands">Netherlands</option>
450
+ <option value="New Caledonia">New Caledonia</option>
451
+ <option value="New Zealand">New Zealand</option>
452
+ <option value="Nicaragua">Nicaragua</option>
453
+ <option value="Niger">Niger</option>
454
+ <option value="Nigeria">Nigeria</option>
455
+ <option value="Niue">Niue</option>
456
+ <option value="Norfolk Island">Norfolk Island</option>
457
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
458
+ <option value="Norway">Norway</option>
459
+ <option value="Oman">Oman</option>
460
+ <option value="Pakistan">Pakistan</option>
461
+ <option value="Palau">Palau</option>
462
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
463
+ <option value="Panama">Panama</option>
464
+ <option value="Papua New Guinea">Papua New Guinea</option>
465
+ <option value="Paraguay">Paraguay</option>
466
+ <option value="Peru">Peru</option>
467
+ <option value="Philippines">Philippines</option>
468
+ <option value="Pitcairn">Pitcairn</option>
469
+ <option value="Poland">Poland</option>
470
+ <option value="Portugal">Portugal</option>
471
+ <option value="Puerto Rico">Puerto Rico</option>
472
+ <option value="Qatar">Qatar</option>
473
+ <option value="Reunion">Reunion</option>
474
+ <option value="Romania">Romania</option>
475
+ <option value="Russian Federation">Russian Federation</option>
476
+ <option value="Rwanda">Rwanda</option>
477
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
478
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
479
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
480
+ <option value="Saint Lucia">Saint Lucia</option>
481
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
482
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
483
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
484
+ <option value="Samoa">Samoa</option>
485
+ <option value="San Marino">San Marino</option>
486
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
487
+ <option value="Saudi Arabia">Saudi Arabia</option>
488
+ <option value="Senegal">Senegal</option>
489
+ <option value="Serbia">Serbia</option>
490
+ <option value="Seychelles">Seychelles</option>
491
+ <option value="Sierra Leone">Sierra Leone</option>
492
+ <option value="Singapore">Singapore</option>
493
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
494
+ <option value="Slovakia">Slovakia</option>
495
+ <option value="Slovenia">Slovenia</option>
496
+ <option value="Solomon Islands">Solomon Islands</option>
497
+ <option value="Somalia">Somalia</option>
498
+ <option value="South Africa">South Africa</option>
499
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
500
+ <option value="South Sudan">South Sudan</option>
501
+ <option value="Spain">Spain</option>
502
+ <option value="Sri Lanka">Sri Lanka</option>
503
+ <option value="Sudan">Sudan</option>
504
+ <option value="Suriname">Suriname</option>
505
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
506
+ <option value="Swaziland">Swaziland</option>
507
+ <option value="Sweden">Sweden</option>
508
+ <option value="Switzerland">Switzerland</option>
509
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
510
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
511
+ <option value="Tajikistan">Tajikistan</option>
512
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
513
+ <option value="Thailand">Thailand</option>
514
+ <option value="Timor-leste">Timor-leste</option>
515
+ <option value="Togo">Togo</option>
516
+ <option value="Tokelau">Tokelau</option>
517
+ <option value="Tonga">Tonga</option>
518
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
519
+ <option value="Tunisia">Tunisia</option>
520
+ <option value="Turkey">Turkey</option>
521
+ <option value="Turkmenistan">Turkmenistan</option>
522
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
523
+ <option value="Tuvalu">Tuvalu</option>
524
+ <option value="Uganda">Uganda</option>
525
+ <option value="Ukraine">Ukraine</option>
526
+ <option value="United Arab Emirates">United Arab Emirates</option>
527
+ <option value="United Kingdom">United Kingdom</option>
528
+ <option value="United States">United States</option>
529
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
530
+ <option value="Uruguay">Uruguay</option>
531
+ <option value="Uzbekistan">Uzbekistan</option>
532
+ <option value="Vanuatu">Vanuatu</option>
533
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
534
+ <option value="Viet Nam">Viet Nam</option>
535
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
536
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
537
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
538
+ <option value="Western Sahara">Western Sahara</option>
539
+ <option value="Yemen">Yemen</option>
540
+ <option value="Zambia">Zambia</option>
541
+ <option value="Zimbabwe">Zimbabwe</option>
542
+ </select>
543
+ </div>
544
+ </div>
545
+
546
+ <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
547
+ <div class="side-by-side clearfix">
548
+ <div>
549
+ <em>Turns This</em>
550
+ <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
551
+ <option value=""></option>
552
+ <option value="United States">United States</option>
553
+ <option value="United Kingdom">United Kingdom</option>
554
+ <option value="Afghanistan">Afghanistan</option>
555
+ <option value="Aland Islands">Aland Islands</option>
556
+ <option value="Albania">Albania</option>
557
+ <option value="Algeria">Algeria</option>
558
+ <option value="American Samoa">American Samoa</option>
559
+ <option value="Andorra">Andorra</option>
560
+ <option value="Angola">Angola</option>
561
+ <option value="Anguilla">Anguilla</option>
562
+ <option value="Antarctica">Antarctica</option>
563
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
564
+ <option value="Argentina">Argentina</option>
565
+ <option value="Armenia">Armenia</option>
566
+ <option value="Aruba">Aruba</option>
567
+ <option value="Australia">Australia</option>
568
+ <option value="Austria">Austria</option>
569
+ <option value="Azerbaijan">Azerbaijan</option>
570
+ <option value="Bahamas">Bahamas</option>
571
+ <option value="Bahrain">Bahrain</option>
572
+ <option value="Bangladesh">Bangladesh</option>
573
+ <option value="Barbados">Barbados</option>
574
+ <option value="Belarus">Belarus</option>
575
+ <option value="Belgium">Belgium</option>
576
+ <option value="Belize">Belize</option>
577
+ <option value="Benin">Benin</option>
578
+ <option value="Bermuda">Bermuda</option>
579
+ <option value="Bhutan">Bhutan</option>
580
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
581
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
582
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
583
+ <option value="Botswana">Botswana</option>
584
+ <option value="Bouvet Island">Bouvet Island</option>
585
+ <option value="Brazil">Brazil</option>
586
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
587
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
588
+ <option value="Bulgaria">Bulgaria</option>
589
+ <option value="Burkina Faso">Burkina Faso</option>
590
+ <option value="Burundi">Burundi</option>
591
+ <option value="Cambodia">Cambodia</option>
592
+ <option value="Cameroon">Cameroon</option>
593
+ <option value="Canada">Canada</option>
594
+ <option value="Cape Verde">Cape Verde</option>
595
+ <option value="Cayman Islands">Cayman Islands</option>
596
+ <option value="Central African Republic">Central African Republic</option>
597
+ <option value="Chad">Chad</option>
598
+ <option value="Chile">Chile</option>
599
+ <option value="China">China</option>
600
+ <option value="Christmas Island">Christmas Island</option>
601
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
602
+ <option value="Colombia">Colombia</option>
603
+ <option value="Comoros">Comoros</option>
604
+ <option value="Congo">Congo</option>
605
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
606
+ <option value="Cook Islands">Cook Islands</option>
607
+ <option value="Costa Rica">Costa Rica</option>
608
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
609
+ <option value="Croatia">Croatia</option>
610
+ <option value="Cuba">Cuba</option>
611
+ <option value="Curacao">Curacao</option>
612
+ <option value="Cyprus">Cyprus</option>
613
+ <option value="Czech Republic">Czech Republic</option>
614
+ <option value="Denmark">Denmark</option>
615
+ <option value="Djibouti">Djibouti</option>
616
+ <option value="Dominica">Dominica</option>
617
+ <option value="Dominican Republic">Dominican Republic</option>
618
+ <option value="Ecuador">Ecuador</option>
619
+ <option value="Egypt">Egypt</option>
620
+ <option value="El Salvador">El Salvador</option>
621
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
622
+ <option value="Eritrea">Eritrea</option>
623
+ <option value="Estonia">Estonia</option>
624
+ <option value="Ethiopia">Ethiopia</option>
625
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
626
+ <option value="Faroe Islands">Faroe Islands</option>
627
+ <option value="Fiji">Fiji</option>
628
+ <option value="Finland">Finland</option>
629
+ <option value="France">France</option>
630
+ <option value="French Guiana">French Guiana</option>
631
+ <option value="French Polynesia">French Polynesia</option>
632
+ <option value="French Southern Territories">French Southern Territories</option>
633
+ <option value="Gabon">Gabon</option>
634
+ <option value="Gambia">Gambia</option>
635
+ <option value="Georgia">Georgia</option>
636
+ <option value="Germany">Germany</option>
637
+ <option value="Ghana">Ghana</option>
638
+ <option value="Gibraltar">Gibraltar</option>
639
+ <option value="Greece">Greece</option>
640
+ <option value="Greenland">Greenland</option>
641
+ <option value="Grenada">Grenada</option>
642
+ <option value="Guadeloupe">Guadeloupe</option>
643
+ <option value="Guam">Guam</option>
644
+ <option value="Guatemala">Guatemala</option>
645
+ <option value="Guernsey">Guernsey</option>
646
+ <option value="Guinea">Guinea</option>
647
+ <option value="Guinea-bissau">Guinea-bissau</option>
648
+ <option value="Guyana">Guyana</option>
649
+ <option value="Haiti">Haiti</option>
650
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
651
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
652
+ <option value="Honduras">Honduras</option>
653
+ <option value="Hong Kong">Hong Kong</option>
654
+ <option value="Hungary">Hungary</option>
655
+ <option value="Iceland">Iceland</option>
656
+ <option value="India">India</option>
657
+ <option value="Indonesia">Indonesia</option>
658
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
659
+ <option value="Iraq">Iraq</option>
660
+ <option value="Ireland">Ireland</option>
661
+ <option value="Isle of Man">Isle of Man</option>
662
+ <option value="Israel">Israel</option>
663
+ <option value="Italy">Italy</option>
664
+ <option value="Jamaica">Jamaica</option>
665
+ <option value="Japan">Japan</option>
666
+ <option value="Jersey">Jersey</option>
667
+ <option value="Jordan">Jordan</option>
668
+ <option value="Kazakhstan">Kazakhstan</option>
669
+ <option value="Kenya">Kenya</option>
670
+ <option value="Kiribati">Kiribati</option>
671
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
672
+ <option value="Korea, Republic of">Korea, Republic of</option>
673
+ <option value="Kuwait">Kuwait</option>
674
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
675
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
676
+ <option value="Latvia">Latvia</option>
677
+ <option value="Lebanon">Lebanon</option>
678
+ <option value="Lesotho">Lesotho</option>
679
+ <option value="Liberia">Liberia</option>
680
+ <option value="Libya">Libya</option>
681
+ <option value="Liechtenstein">Liechtenstein</option>
682
+ <option value="Lithuania">Lithuania</option>
683
+ <option value="Luxembourg">Luxembourg</option>
684
+ <option value="Macao">Macao</option>
685
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
686
+ <option value="Madagascar">Madagascar</option>
687
+ <option value="Malawi">Malawi</option>
688
+ <option value="Malaysia">Malaysia</option>
689
+ <option value="Maldives">Maldives</option>
690
+ <option value="Mali">Mali</option>
691
+ <option value="Malta">Malta</option>
692
+ <option value="Marshall Islands">Marshall Islands</option>
693
+ <option value="Martinique">Martinique</option>
694
+ <option value="Mauritania">Mauritania</option>
695
+ <option value="Mauritius">Mauritius</option>
696
+ <option value="Mayotte">Mayotte</option>
697
+ <option value="Mexico">Mexico</option>
698
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
699
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
700
+ <option value="Monaco">Monaco</option>
701
+ <option value="Mongolia">Mongolia</option>
702
+ <option value="Montenegro">Montenegro</option>
703
+ <option value="Montserrat">Montserrat</option>
704
+ <option value="Morocco">Morocco</option>
705
+ <option value="Mozambique">Mozambique</option>
706
+ <option value="Myanmar">Myanmar</option>
707
+ <option value="Namibia">Namibia</option>
708
+ <option value="Nauru">Nauru</option>
709
+ <option value="Nepal">Nepal</option>
710
+ <option value="Netherlands">Netherlands</option>
711
+ <option value="New Caledonia">New Caledonia</option>
712
+ <option value="New Zealand">New Zealand</option>
713
+ <option value="Nicaragua">Nicaragua</option>
714
+ <option value="Niger">Niger</option>
715
+ <option value="Nigeria">Nigeria</option>
716
+ <option value="Niue">Niue</option>
717
+ <option value="Norfolk Island">Norfolk Island</option>
718
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
719
+ <option value="Norway">Norway</option>
720
+ <option value="Oman">Oman</option>
721
+ <option value="Pakistan">Pakistan</option>
722
+ <option value="Palau">Palau</option>
723
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
724
+ <option value="Panama">Panama</option>
725
+ <option value="Papua New Guinea">Papua New Guinea</option>
726
+ <option value="Paraguay">Paraguay</option>
727
+ <option value="Peru">Peru</option>
728
+ <option value="Philippines">Philippines</option>
729
+ <option value="Pitcairn">Pitcairn</option>
730
+ <option value="Poland">Poland</option>
731
+ <option value="Portugal">Portugal</option>
732
+ <option value="Puerto Rico">Puerto Rico</option>
733
+ <option value="Qatar">Qatar</option>
734
+ <option value="Reunion">Reunion</option>
735
+ <option value="Romania">Romania</option>
736
+ <option value="Russian Federation">Russian Federation</option>
737
+ <option value="Rwanda">Rwanda</option>
738
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
739
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
740
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
741
+ <option value="Saint Lucia">Saint Lucia</option>
742
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
743
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
744
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
745
+ <option value="Samoa">Samoa</option>
746
+ <option value="San Marino">San Marino</option>
747
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
748
+ <option value="Saudi Arabia">Saudi Arabia</option>
749
+ <option value="Senegal">Senegal</option>
750
+ <option value="Serbia">Serbia</option>
751
+ <option value="Seychelles">Seychelles</option>
752
+ <option value="Sierra Leone">Sierra Leone</option>
753
+ <option value="Singapore">Singapore</option>
754
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
755
+ <option value="Slovakia">Slovakia</option>
756
+ <option value="Slovenia">Slovenia</option>
757
+ <option value="Solomon Islands">Solomon Islands</option>
758
+ <option value="Somalia">Somalia</option>
759
+ <option value="South Africa">South Africa</option>
760
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
761
+ <option value="South Sudan">South Sudan</option>
762
+ <option value="Spain">Spain</option>
763
+ <option value="Sri Lanka">Sri Lanka</option>
764
+ <option value="Sudan">Sudan</option>
765
+ <option value="Suriname">Suriname</option>
766
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
767
+ <option value="Swaziland">Swaziland</option>
768
+ <option value="Sweden">Sweden</option>
769
+ <option value="Switzerland">Switzerland</option>
770
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
771
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
772
+ <option value="Tajikistan">Tajikistan</option>
773
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
774
+ <option value="Thailand">Thailand</option>
775
+ <option value="Timor-leste">Timor-leste</option>
776
+ <option value="Togo">Togo</option>
777
+ <option value="Tokelau">Tokelau</option>
778
+ <option value="Tonga">Tonga</option>
779
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
780
+ <option value="Tunisia">Tunisia</option>
781
+ <option value="Turkey">Turkey</option>
782
+ <option value="Turkmenistan">Turkmenistan</option>
783
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
784
+ <option value="Tuvalu">Tuvalu</option>
785
+ <option value="Uganda">Uganda</option>
786
+ <option value="Ukraine">Ukraine</option>
787
+ <option value="United Arab Emirates">United Arab Emirates</option>
788
+ <option value="United Kingdom">United Kingdom</option>
789
+ <option value="United States">United States</option>
790
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
791
+ <option value="Uruguay">Uruguay</option>
792
+ <option value="Uzbekistan">Uzbekistan</option>
793
+ <option value="Vanuatu">Vanuatu</option>
794
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
795
+ <option value="Viet Nam">Viet Nam</option>
796
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
797
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
798
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
799
+ <option value="Western Sahara">Western Sahara</option>
800
+ <option value="Yemen">Yemen</option>
801
+ <option value="Zambia">Zambia</option>
802
+ <option value="Zimbabwe">Zimbabwe</option>
803
+ </select>
804
+ </div>
805
+ <div>
806
+ <em>Into This</em>
807
+ <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
808
+ <option value=""></option>
809
+ <option value="United States">United States</option>
810
+ <option value="United Kingdom">United Kingdom</option>
811
+ <option value="Afghanistan">Afghanistan</option>
812
+ <option value="Aland Islands">Aland Islands</option>
813
+ <option value="Albania">Albania</option>
814
+ <option value="Algeria">Algeria</option>
815
+ <option value="American Samoa">American Samoa</option>
816
+ <option value="Andorra">Andorra</option>
817
+ <option value="Angola">Angola</option>
818
+ <option value="Anguilla">Anguilla</option>
819
+ <option value="Antarctica">Antarctica</option>
820
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
821
+ <option value="Argentina">Argentina</option>
822
+ <option value="Armenia">Armenia</option>
823
+ <option value="Aruba">Aruba</option>
824
+ <option value="Australia">Australia</option>
825
+ <option value="Austria">Austria</option>
826
+ <option value="Azerbaijan">Azerbaijan</option>
827
+ <option value="Bahamas">Bahamas</option>
828
+ <option value="Bahrain">Bahrain</option>
829
+ <option value="Bangladesh">Bangladesh</option>
830
+ <option value="Barbados">Barbados</option>
831
+ <option value="Belarus">Belarus</option>
832
+ <option value="Belgium">Belgium</option>
833
+ <option value="Belize">Belize</option>
834
+ <option value="Benin">Benin</option>
835
+ <option value="Bermuda">Bermuda</option>
836
+ <option value="Bhutan">Bhutan</option>
837
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
838
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
839
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
840
+ <option value="Botswana">Botswana</option>
841
+ <option value="Bouvet Island">Bouvet Island</option>
842
+ <option value="Brazil">Brazil</option>
843
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
844
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
845
+ <option value="Bulgaria">Bulgaria</option>
846
+ <option value="Burkina Faso">Burkina Faso</option>
847
+ <option value="Burundi">Burundi</option>
848
+ <option value="Cambodia">Cambodia</option>
849
+ <option value="Cameroon">Cameroon</option>
850
+ <option value="Canada">Canada</option>
851
+ <option value="Cape Verde">Cape Verde</option>
852
+ <option value="Cayman Islands">Cayman Islands</option>
853
+ <option value="Central African Republic">Central African Republic</option>
854
+ <option value="Chad">Chad</option>
855
+ <option value="Chile">Chile</option>
856
+ <option value="China">China</option>
857
+ <option value="Christmas Island">Christmas Island</option>
858
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
859
+ <option value="Colombia">Colombia</option>
860
+ <option value="Comoros">Comoros</option>
861
+ <option value="Congo">Congo</option>
862
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
863
+ <option value="Cook Islands">Cook Islands</option>
864
+ <option value="Costa Rica">Costa Rica</option>
865
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
866
+ <option value="Croatia">Croatia</option>
867
+ <option value="Cuba">Cuba</option>
868
+ <option value="Curacao">Curacao</option>
869
+ <option value="Cyprus">Cyprus</option>
870
+ <option value="Czech Republic">Czech Republic</option>
871
+ <option value="Denmark">Denmark</option>
872
+ <option value="Djibouti">Djibouti</option>
873
+ <option value="Dominica">Dominica</option>
874
+ <option value="Dominican Republic">Dominican Republic</option>
875
+ <option value="Ecuador">Ecuador</option>
876
+ <option value="Egypt">Egypt</option>
877
+ <option value="El Salvador">El Salvador</option>
878
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
879
+ <option value="Eritrea">Eritrea</option>
880
+ <option value="Estonia">Estonia</option>
881
+ <option value="Ethiopia">Ethiopia</option>
882
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
883
+ <option value="Faroe Islands">Faroe Islands</option>
884
+ <option value="Fiji">Fiji</option>
885
+ <option value="Finland">Finland</option>
886
+ <option value="France">France</option>
887
+ <option value="French Guiana">French Guiana</option>
888
+ <option value="French Polynesia">French Polynesia</option>
889
+ <option value="French Southern Territories">French Southern Territories</option>
890
+ <option value="Gabon">Gabon</option>
891
+ <option value="Gambia">Gambia</option>
892
+ <option value="Georgia">Georgia</option>
893
+ <option value="Germany">Germany</option>
894
+ <option value="Ghana">Ghana</option>
895
+ <option value="Gibraltar">Gibraltar</option>
896
+ <option value="Greece">Greece</option>
897
+ <option value="Greenland">Greenland</option>
898
+ <option value="Grenada">Grenada</option>
899
+ <option value="Guadeloupe">Guadeloupe</option>
900
+ <option value="Guam">Guam</option>
901
+ <option value="Guatemala">Guatemala</option>
902
+ <option value="Guernsey">Guernsey</option>
903
+ <option value="Guinea">Guinea</option>
904
+ <option value="Guinea-bissau">Guinea-bissau</option>
905
+ <option value="Guyana">Guyana</option>
906
+ <option value="Haiti">Haiti</option>
907
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
908
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
909
+ <option value="Honduras">Honduras</option>
910
+ <option value="Hong Kong">Hong Kong</option>
911
+ <option value="Hungary">Hungary</option>
912
+ <option value="Iceland">Iceland</option>
913
+ <option value="India">India</option>
914
+ <option value="Indonesia">Indonesia</option>
915
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
916
+ <option value="Iraq">Iraq</option>
917
+ <option value="Ireland">Ireland</option>
918
+ <option value="Isle of Man">Isle of Man</option>
919
+ <option value="Israel">Israel</option>
920
+ <option value="Italy">Italy</option>
921
+ <option value="Jamaica">Jamaica</option>
922
+ <option value="Japan">Japan</option>
923
+ <option value="Jersey">Jersey</option>
924
+ <option value="Jordan">Jordan</option>
925
+ <option value="Kazakhstan">Kazakhstan</option>
926
+ <option value="Kenya">Kenya</option>
927
+ <option value="Kiribati">Kiribati</option>
928
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
929
+ <option value="Korea, Republic of">Korea, Republic of</option>
930
+ <option value="Kuwait">Kuwait</option>
931
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
932
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
933
+ <option value="Latvia">Latvia</option>
934
+ <option value="Lebanon">Lebanon</option>
935
+ <option value="Lesotho">Lesotho</option>
936
+ <option value="Liberia">Liberia</option>
937
+ <option value="Libya">Libya</option>
938
+ <option value="Liechtenstein">Liechtenstein</option>
939
+ <option value="Lithuania">Lithuania</option>
940
+ <option value="Luxembourg">Luxembourg</option>
941
+ <option value="Macao">Macao</option>
942
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
943
+ <option value="Madagascar">Madagascar</option>
944
+ <option value="Malawi">Malawi</option>
945
+ <option value="Malaysia">Malaysia</option>
946
+ <option value="Maldives">Maldives</option>
947
+ <option value="Mali">Mali</option>
948
+ <option value="Malta">Malta</option>
949
+ <option value="Marshall Islands">Marshall Islands</option>
950
+ <option value="Martinique">Martinique</option>
951
+ <option value="Mauritania">Mauritania</option>
952
+ <option value="Mauritius">Mauritius</option>
953
+ <option value="Mayotte">Mayotte</option>
954
+ <option value="Mexico">Mexico</option>
955
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
956
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
957
+ <option value="Monaco">Monaco</option>
958
+ <option value="Mongolia">Mongolia</option>
959
+ <option value="Montenegro">Montenegro</option>
960
+ <option value="Montserrat">Montserrat</option>
961
+ <option value="Morocco">Morocco</option>
962
+ <option value="Mozambique">Mozambique</option>
963
+ <option value="Myanmar">Myanmar</option>
964
+ <option value="Namibia">Namibia</option>
965
+ <option value="Nauru">Nauru</option>
966
+ <option value="Nepal">Nepal</option>
967
+ <option value="Netherlands">Netherlands</option>
968
+ <option value="New Caledonia">New Caledonia</option>
969
+ <option value="New Zealand">New Zealand</option>
970
+ <option value="Nicaragua">Nicaragua</option>
971
+ <option value="Niger">Niger</option>
972
+ <option value="Nigeria">Nigeria</option>
973
+ <option value="Niue">Niue</option>
974
+ <option value="Norfolk Island">Norfolk Island</option>
975
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
976
+ <option value="Norway">Norway</option>
977
+ <option value="Oman">Oman</option>
978
+ <option value="Pakistan">Pakistan</option>
979
+ <option value="Palau">Palau</option>
980
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
981
+ <option value="Panama">Panama</option>
982
+ <option value="Papua New Guinea">Papua New Guinea</option>
983
+ <option value="Paraguay">Paraguay</option>
984
+ <option value="Peru">Peru</option>
985
+ <option value="Philippines">Philippines</option>
986
+ <option value="Pitcairn">Pitcairn</option>
987
+ <option value="Poland">Poland</option>
988
+ <option value="Portugal">Portugal</option>
989
+ <option value="Puerto Rico">Puerto Rico</option>
990
+ <option value="Qatar">Qatar</option>
991
+ <option value="Reunion">Reunion</option>
992
+ <option value="Romania">Romania</option>
993
+ <option value="Russian Federation">Russian Federation</option>
994
+ <option value="Rwanda">Rwanda</option>
995
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
996
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
997
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
998
+ <option value="Saint Lucia">Saint Lucia</option>
999
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1000
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1001
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1002
+ <option value="Samoa">Samoa</option>
1003
+ <option value="San Marino">San Marino</option>
1004
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1005
+ <option value="Saudi Arabia">Saudi Arabia</option>
1006
+ <option value="Senegal">Senegal</option>
1007
+ <option value="Serbia">Serbia</option>
1008
+ <option value="Seychelles">Seychelles</option>
1009
+ <option value="Sierra Leone">Sierra Leone</option>
1010
+ <option value="Singapore">Singapore</option>
1011
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1012
+ <option value="Slovakia">Slovakia</option>
1013
+ <option value="Slovenia">Slovenia</option>
1014
+ <option value="Solomon Islands">Solomon Islands</option>
1015
+ <option value="Somalia">Somalia</option>
1016
+ <option value="South Africa">South Africa</option>
1017
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1018
+ <option value="South Sudan">South Sudan</option>
1019
+ <option value="Spain">Spain</option>
1020
+ <option value="Sri Lanka">Sri Lanka</option>
1021
+ <option value="Sudan">Sudan</option>
1022
+ <option value="Suriname">Suriname</option>
1023
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1024
+ <option value="Swaziland">Swaziland</option>
1025
+ <option value="Sweden">Sweden</option>
1026
+ <option value="Switzerland">Switzerland</option>
1027
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1028
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1029
+ <option value="Tajikistan">Tajikistan</option>
1030
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1031
+ <option value="Thailand">Thailand</option>
1032
+ <option value="Timor-leste">Timor-leste</option>
1033
+ <option value="Togo">Togo</option>
1034
+ <option value="Tokelau">Tokelau</option>
1035
+ <option value="Tonga">Tonga</option>
1036
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1037
+ <option value="Tunisia">Tunisia</option>
1038
+ <option value="Turkey">Turkey</option>
1039
+ <option value="Turkmenistan">Turkmenistan</option>
1040
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1041
+ <option value="Tuvalu">Tuvalu</option>
1042
+ <option value="Uganda">Uganda</option>
1043
+ <option value="Ukraine">Ukraine</option>
1044
+ <option value="United Arab Emirates">United Arab Emirates</option>
1045
+ <option value="United Kingdom">United Kingdom</option>
1046
+ <option value="United States">United States</option>
1047
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1048
+ <option value="Uruguay">Uruguay</option>
1049
+ <option value="Uzbekistan">Uzbekistan</option>
1050
+ <option value="Vanuatu">Vanuatu</option>
1051
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1052
+ <option value="Viet Nam">Viet Nam</option>
1053
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
1054
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1055
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
1056
+ <option value="Western Sahara">Western Sahara</option>
1057
+ <option value="Yemen">Yemen</option>
1058
+ <option value="Zambia">Zambia</option>
1059
+ <option value="Zimbabwe">Zimbabwe</option>
1060
+ </select>
1061
+ </div>
1062
+ </div>
1063
+
1064
+ <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1065
+ <div class="side-by-side clearfix">
1066
+ <div>
1067
+ <em>Single Select with Groups</em>
1068
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1069
+ <option value=""></option>
1070
+ <optgroup label="NFC EAST">
1071
+ <option>Dallas Cowboys</option>
1072
+ <option>New York Giants</option>
1073
+ <option>Philadelphia Eagles</option>
1074
+ <option>Washington Redskins</option>
1075
+ </optgroup>
1076
+ <optgroup label="NFC NORTH">
1077
+ <option>Chicago Bears</option>
1078
+ <option>Detroit Lions</option>
1079
+ <option>Green Bay Packers</option>
1080
+ <option>Minnesota Vikings</option>
1081
+ </optgroup>
1082
+ <optgroup label="NFC SOUTH">
1083
+ <option>Atlanta Falcons</option>
1084
+ <option>Carolina Panthers</option>
1085
+ <option>New Orleans Saints</option>
1086
+ <option>Tampa Bay Buccaneers</option>
1087
+ </optgroup>
1088
+ <optgroup label="NFC WEST">
1089
+ <option>Arizona Cardinals</option>
1090
+ <option>St. Louis Rams</option>
1091
+ <option>San Francisco 49ers</option>
1092
+ <option>Seattle Seahawks</option>
1093
+ </optgroup>
1094
+ <optgroup label="AFC EAST">
1095
+ <option>Buffalo Bills</option>
1096
+ <option>Miami Dolphins</option>
1097
+ <option>New England Patriots</option>
1098
+ <option>New York Jets</option>
1099
+ </optgroup>
1100
+ <optgroup label="AFC NORTH">
1101
+ <option>Baltimore Ravens</option>
1102
+ <option>Cincinnati Bengals</option>
1103
+ <option>Cleveland Browns</option>
1104
+ <option>Pittsburgh Steelers</option>
1105
+ </optgroup>
1106
+ <optgroup label="AFC SOUTH">
1107
+ <option>Houston Texans</option>
1108
+ <option>Indianapolis Colts</option>
1109
+ <option>Jacksonville Jaguars</option>
1110
+ <option>Tennessee Titans</option>
1111
+ </optgroup>
1112
+ <optgroup label="AFC WEST">
1113
+ <option>Denver Broncos</option>
1114
+ <option>Kansas City Chiefs</option>
1115
+ <option>Oakland Raiders</option>
1116
+ <option>San Diego Chargers</option>
1117
+ </optgroup>
1118
+ </select>
1119
+ </div>
1120
+ <div>
1121
+ <em>Multiple Select with Groups</em>
1122
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1123
+ <option value=""></option>
1124
+ <optgroup label="NFC EAST">
1125
+ <option>Dallas Cowboys</option>
1126
+ <option>New York Giants</option>
1127
+ <option>Philadelphia Eagles</option>
1128
+ <option>Washington Redskins</option>
1129
+ </optgroup>
1130
+ <optgroup label="NFC NORTH">
1131
+ <option>Chicago Bears</option>
1132
+ <option>Detroit Lions</option>
1133
+ <option>Green Bay Packers</option>
1134
+ <option>Minnesota Vikings</option>
1135
+ </optgroup>
1136
+ <optgroup label="NFC SOUTH">
1137
+ <option>Atlanta Falcons</option>
1138
+ <option>Carolina Panthers</option>
1139
+ <option>New Orleans Saints</option>
1140
+ <option>Tampa Bay Buccaneers</option>
1141
+ </optgroup>
1142
+ <optgroup label="NFC WEST">
1143
+ <option>Arizona Cardinals</option>
1144
+ <option>St. Louis Rams</option>
1145
+ <option>San Francisco 49ers</option>
1146
+ <option>Seattle Seahawks</option>
1147
+ </optgroup>
1148
+ <optgroup label="AFC EAST">
1149
+ <option>Buffalo Bills</option>
1150
+ <option>Miami Dolphins</option>
1151
+ <option>New England Patriots</option>
1152
+ <option>New York Jets</option>
1153
+ </optgroup>
1154
+ <optgroup label="AFC NORTH">
1155
+ <option>Baltimore Ravens</option>
1156
+ <option>Cincinnati Bengals</option>
1157
+ <option>Cleveland Browns</option>
1158
+ <option>Pittsburgh Steelers</option>
1159
+ </optgroup>
1160
+ <optgroup label="AFC SOUTH">
1161
+ <option>Houston Texans</option>
1162
+ <option>Indianapolis Colts</option>
1163
+ <option>Jacksonville Jaguars</option>
1164
+ <option>Tennessee Titans</option>
1165
+ </optgroup>
1166
+ <optgroup label="AFC WEST">
1167
+ <option>Denver Broncos</option>
1168
+ <option>Kansas City Chiefs</option>
1169
+ <option>Oakland Raiders</option>
1170
+ <option>San Diego Chargers</option>
1171
+ </optgroup>
1172
+ </select>
1173
+ </div>
1174
+ </div>
1175
+
1176
+ <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1177
+ <div class="side-by-side clearfix">
1178
+ <p>Chosen automatically highlights selected options and removes disabled options.</p>
1179
+ <div>
1180
+ <em>Single Select</em>
1181
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1182
+ <option value=""></option>
1183
+ <option>American Black Bear</option>
1184
+ <option>Asiatic Black Bear</option>
1185
+ <option>Brown Bear</option>
1186
+ <option>Giant Panda</option>
1187
+ <option selected>Sloth Bear</option>
1188
+ <option disabled>Sun Bear</option>
1189
+ <option>Polar Bear</option>
1190
+ <option disabled>Spectacled Bear</option>
1191
+ </select>
1192
+ </div>
1193
+ <div>
1194
+ <em>Multiple Select</em>
1195
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1196
+ <option value=""></option>
1197
+ <option>American Black Bear</option>
1198
+ <option>Asiatic Black Bear</option>
1199
+ <option>Brown Bear</option>
1200
+ <option>Giant Panda</option>
1201
+ <option selected>Sloth Bear</option>
1202
+ <option disabled>Sun Bear</option>
1203
+ <option selected>Polar Bear</option>
1204
+ <option disabled>Spectacled Bear</option>
1205
+ </select>
1206
+ </div>
1207
+ </div>
1208
+
1209
+ <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1210
+ <div class="side-by-side clearfix">
1211
+ <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1212
+ <pre><code class="language-javascript">$(".chosen-select").chosen({disable_search_threshold: 10});</code></pre>
1213
+ <p></p>
1214
+ <div>
1215
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1216
+ <option value=""></option>
1217
+ <option>American Black Bear</option>
1218
+ <option>Asiatic Black Bear</option>
1219
+ <option>Brown Bear</option>
1220
+ <option>Giant Panda</option>
1221
+ <option selected disabled>Sloth Bear</option>
1222
+ <option disabled>Sun Bear</option>
1223
+ <option selected disabled>Paddington Bear</option>
1224
+ <option selected>Polar Bear</option>
1225
+ <option disabled>Spectacled Bear</option>
1226
+ </select>
1227
+ </div>
1228
+ </div>
1229
+
1230
+ <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1231
+ <div class="side-by-side clearfix">
1232
+ <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1233
+ <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1234
+ <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1235
+ </div>
1236
+
1237
+ <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1238
+ <div class="side-by-side clearfix">
1239
+ <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1240
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({no_results_text: "Oops, nothing found!"}); </code></pre>
1241
+ <p></p>
1242
+ <div>
1243
+ <em>Single Select</em>
1244
+ <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1245
+ <option value=""></option>
1246
+ <option>American Black Bear</option>
1247
+ <option>Asiatic Black Bear</option>
1248
+ <option>Brown Bear</option>
1249
+ <option>Giant Panda</option>
1250
+ <option>Sloth Bear</option>
1251
+ <option>Sun Bear</option>
1252
+ <option>Polar Bear</option>
1253
+ <option>Spectacled Bear</option>
1254
+ </select>
1255
+ </div>
1256
+ <div>
1257
+ <em>Multiple Select</em>
1258
+ <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1259
+ <option value=""></option>
1260
+ <option>American Black Bear</option>
1261
+ <option>Asiatic Black Bear</option>
1262
+ <option>Brown Bear</option>
1263
+ <option>Giant Panda</option>
1264
+ <option>Sloth Bear</option>
1265
+ <option>Sun Bear</option>
1266
+ <option>Polar Bear</option>
1267
+ <option>Spectacled Bear</option>
1268
+ </select>
1269
+ </div>
1270
+ </div>
1271
+
1272
+ <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1273
+ <div class="side-by-side clearfix">
1274
+ <p>You can easily limit how many options the user can select:</p>
1275
+ <pre><code class="language-javascript">$(".chosen-select").chosen({max_selected_options: 5});</code></pre>
1276
+ <p>If you try to select another option with limit reached <code class="language-javascript">chosen:maxselected</code> event is triggered:</p>
1277
+ <pre><code class="language-javascript"> $(".chosen-select").bind("chosen:maxselected", function () { ... }); </code></pre>
1278
+ </div>
1279
+
1280
+ <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1281
+ <div class="side-by-side clearfix">
1282
+ <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1283
+ <div class="side-by-side clearfix">
1284
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1285
+ <option value=""></option>
1286
+ <option>American Black Bear</option>
1287
+ <option>Asiatic Black Bear</option>
1288
+ <option>Brown Bear</option>
1289
+ <option>Giant Panda</option>
1290
+ <option selected>Sloth Bear</option>
1291
+ <option>Sun Bear</option>
1292
+ <option>Polar Bear</option>
1293
+ <option>Spectacled Bear</option>
1294
+ </select>
1295
+ </div>
1296
+ </div>
1297
+
1298
+ <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1299
+ <div class="side-by-side clearfix">
1300
+ <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1301
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1302
+
1303
+ <div>
1304
+ <em>Single Right-to-Left Select</em>
1305
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
+ <option value=""></option>
1307
+ <option>American Black Bear</option>
1308
+ <option>Asiatic Black Bear</option>
1309
+ <option>Brown Bear</option>
1310
+ <option>Giant Panda</option>
1311
+ <option selected>Sloth Bear</option>
1312
+ <option>Polar Bear</option>
1313
+ </select>
1314
+ </div>
1315
+ <div>
1316
+ <em>Multiple Right-to-Left Select</em>
1317
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
+ <option value=""></option>
1319
+ <option>American Black Bear</option>
1320
+ <option>Asiatic Black Bear</option>
1321
+ <option>Brown Bear</option>
1322
+ <option>Giant Panda</option>
1323
+ <option selected>Sloth Bear</option>
1324
+ <option selected>Polar Bear</option>
1325
+ </select>
1326
+ </div>
1327
+ </div>
1328
+
1329
+ <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
+ <div class="side-by-side clearfix">
1331
+ <ul>
1332
+ <li>
1333
+ <h3>Observing Form Field Changes</h3>
1334
+ <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
+ <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
+ </li>
1337
+ <li>
1338
+ <h3>Updating Chosen Dynamically</h3>
1339
+ <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1340
+ <pre><code class="language-javascript">$("#form_field").trigger("chosen:updated");</code></pre>
1341
+ </li>
1342
+ <li>
1343
+ <h3>Destroying Chosen</h3>
1344
+ <p>To destroy Chosen and revert back to the native select:</p>
1345
+ <pre><code class="language-javascript">$("#form_field").chosen("destroy");</code></pre>
1346
+ </li>
1347
+ </ul>
1348
+ </div>
1349
+
1350
+ <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1351
+ <div class="side-by-side clearfix">
1352
+ <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1353
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({width: "95%"}); </code></pre>
1354
+ <div>
1355
+ <em>Single Select</em>
1356
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1357
+ <option value=""></option>
1358
+ <option selected>American Black Bear</option>
1359
+ <option>Asiatic Black Bear</option>
1360
+ <option>Brown Bear</option>
1361
+ <option>Giant Panda</option>
1362
+ <option>Sloth Bear</option>
1363
+ <option>Sun Bear</option>
1364
+ <option>Polar Bear</option>
1365
+ <option>Spectacled Bear</option>
1366
+ </select>
1367
+ </div>
1368
+ <div>
1369
+ <em>Multiple Select</em>
1370
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1371
+ <option value=""></option>
1372
+ <option>American Black Bear</option>
1373
+ <option>Asiatic Black Bear</option>
1374
+ <option>Brown Bear</option>
1375
+ <option selected>Giant Panda</option>
1376
+ <option>Sloth Bear</option>
1377
+ <option>Sun Bear</option>
1378
+ <option>Polar Bear</option>
1379
+ <option>Spectacled Bear</option>
1380
+ </select>
1381
+ </div>
1382
+ </div>
1383
+
1384
+ <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1385
+ <div class="side-by-side clearfix">
1386
+ <p>Use labels just like you would a standard select</p>
1387
+ <p></p>
1388
+ <div>
1389
+ <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1390
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1391
+ <option value=""></option>
1392
+ <option selected>American Black Bear</option>
1393
+ <option>Asiatic Black Bear</option>
1394
+ <option>Brown Bear</option>
1395
+ <option>Giant Panda</option>
1396
+ <option>Sloth Bear</option>
1397
+ <option>Sun Bear</option>
1398
+ <option>Polar Bear</option>
1399
+ <option>Spectacled Bear</option>
1400
+ </select>
1401
+ </div>
1402
+ <div>
1403
+ <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1404
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1405
+ <option value=""></option>
1406
+ <option>American Black Bear</option>
1407
+ <option>Asiatic Black Bear</option>
1408
+ <option>Brown Bear</option>
1409
+ <option selected>Giant Panda</option>
1410
+ <option>Sloth Bear</option>
1411
+ <option>Sun Bear</option>
1412
+ <option>Polar Bear</option>
1413
+ <option>Spectacled Bear</option>
1414
+ </select>
1415
+ </div>
1416
+ </div>
1417
+
1418
+ <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1419
+ <p>Using Chosen is easy as can be.</p>
1420
+ <ol>
1421
+ <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1422
+ <li>Activate the plugin on the select boxes of your choice: <code class="language-javascript">$(".chosen-select").chosen()</code></li>
1423
+ <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1424
+ </ol>
1425
+
1426
+ <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1427
+ <ul class="faqs">
1428
+ <li>
1429
+ <h3>Do you have all the available options documented somewhere?</h3>
1430
+ <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1431
+ </li>
1432
+ <li>
1433
+ <h3>Something doesn't work. Can you fix it?</h3>
1434
+ <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1435
+ </li>
1436
+ <li>
1437
+ <h3>What browsers are supported?</h3>
1438
+ <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1439
+ </li>
1440
+ <li>
1441
+ <h3>Didn't there used to be a Prototype version of Chosen?</h3>
1442
+ <p><a href="index.proto.html">There still is!</a></p>
1443
+ </li>
1444
+ </ul>
1445
+
1446
+ <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
+
1448
+ <ul class="credits">
1449
+ <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
+ <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
+ <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
+ <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
+ </ul>
1454
+
1455
+ <footer>
1456
+ &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
+ </footer>
1458
+
1459
+ </div>
1460
+ </div>
1461
+ <script src="docsupport/jquery-3.2.1.min.js" type="text/javascript"></script>
1462
+ <script src="chosen.jquery.js" type="text/javascript"></script>
1463
+ <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
+ <script src="docsupport/init.js" type="text/javascript" charset="utf-8"></script>
1465
+ </form>
1466
+ <div class="oss-bar">
1467
+ <ul>
1468
+ <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1469
+ <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1470
+ </ul>
1471
+ </div>
1472
+ </body>
1473
+ </html>
common/libs/chosen-v1.8.3/index.proto.html ADDED
@@ -0,0 +1,1472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Chosen: A Prototype Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
+ <link rel="stylesheet" href="docsupport/style.css">
7
+ <link rel="stylesheet" href="docsupport/prism.css">
8
+ <link rel="stylesheet" href="chosen.css">
9
+
10
+ <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
+
12
+ </head>
13
+ <body>
14
+ <div id="container">
15
+ <div id="content">
16
+ <header>
17
+ <h1>Chosen - Prototype Version <small>(<span id="latest-version">v1.8.3</span>)</small></h1>
18
+ </header>
19
+ <p>Chosen is a Prototype plugin that makes long, unwieldy select boxes much more user-friendly.</p>
20
+
21
+ <p>
22
+ <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
23
+ <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
24
+ <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
25
+ </p>
26
+
27
+ <p class="jquery-version-refer">Looking for the <a href="index.html">jQuery version?</a></p>
28
+
29
+ <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
30
+ <div class="side-by-side clearfix">
31
+ <div>
32
+ <em>Turns This</em>
33
+ <select data-placeholder="Choose a Country..." class="select" tabindex="1">
34
+ <option value=""></option>
35
+ <option value="United States">United States</option>
36
+ <option value="United Kingdom">United Kingdom</option>
37
+ <option value="Afghanistan">Afghanistan</option>
38
+ <option value="Aland Islands">Aland Islands</option>
39
+ <option value="Albania">Albania</option>
40
+ <option value="Algeria">Algeria</option>
41
+ <option value="American Samoa">American Samoa</option>
42
+ <option value="Andorra">Andorra</option>
43
+ <option value="Angola">Angola</option>
44
+ <option value="Anguilla">Anguilla</option>
45
+ <option value="Antarctica">Antarctica</option>
46
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
47
+ <option value="Argentina">Argentina</option>
48
+ <option value="Armenia">Armenia</option>
49
+ <option value="Aruba">Aruba</option>
50
+ <option value="Australia">Australia</option>
51
+ <option value="Austria">Austria</option>
52
+ <option value="Azerbaijan">Azerbaijan</option>
53
+ <option value="Bahamas">Bahamas</option>
54
+ <option value="Bahrain">Bahrain</option>
55
+ <option value="Bangladesh">Bangladesh</option>
56
+ <option value="Barbados">Barbados</option>
57
+ <option value="Belarus">Belarus</option>
58
+ <option value="Belgium">Belgium</option>
59
+ <option value="Belize">Belize</option>
60
+ <option value="Benin">Benin</option>
61
+ <option value="Bermuda">Bermuda</option>
62
+ <option value="Bhutan">Bhutan</option>
63
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
64
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
65
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
66
+ <option value="Botswana">Botswana</option>
67
+ <option value="Bouvet Island">Bouvet Island</option>
68
+ <option value="Brazil">Brazil</option>
69
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
70
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
71
+ <option value="Bulgaria">Bulgaria</option>
72
+ <option value="Burkina Faso">Burkina Faso</option>
73
+ <option value="Burundi">Burundi</option>
74
+ <option value="Cambodia">Cambodia</option>
75
+ <option value="Cameroon">Cameroon</option>
76
+ <option value="Canada">Canada</option>
77
+ <option value="Cape Verde">Cape Verde</option>
78
+ <option value="Cayman Islands">Cayman Islands</option>
79
+ <option value="Central African Republic">Central African Republic</option>
80
+ <option value="Chad">Chad</option>
81
+ <option value="Chile">Chile</option>
82
+ <option value="China">China</option>
83
+ <option value="Christmas Island">Christmas Island</option>
84
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
85
+ <option value="Colombia">Colombia</option>
86
+ <option value="Comoros">Comoros</option>
87
+ <option value="Congo">Congo</option>
88
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
89
+ <option value="Cook Islands">Cook Islands</option>
90
+ <option value="Costa Rica">Costa Rica</option>
91
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
92
+ <option value="Croatia">Croatia</option>
93
+ <option value="Cuba">Cuba</option>
94
+ <option value="Curacao">Curacao</option>
95
+ <option value="Cyprus">Cyprus</option>
96
+ <option value="Czech Republic">Czech Republic</option>
97
+ <option value="Denmark">Denmark</option>
98
+ <option value="Djibouti">Djibouti</option>
99
+ <option value="Dominica">Dominica</option>
100
+ <option value="Dominican Republic">Dominican Republic</option>
101
+ <option value="Ecuador">Ecuador</option>
102
+ <option value="Egypt">Egypt</option>
103
+ <option value="El Salvador">El Salvador</option>
104
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
105
+ <option value="Eritrea">Eritrea</option>
106
+ <option value="Estonia">Estonia</option>
107
+ <option value="Ethiopia">Ethiopia</option>
108
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
109
+ <option value="Faroe Islands">Faroe Islands</option>
110
+ <option value="Fiji">Fiji</option>
111
+ <option value="Finland">Finland</option>
112
+ <option value="France">France</option>
113
+ <option value="French Guiana">French Guiana</option>
114
+ <option value="French Polynesia">French Polynesia</option>
115
+ <option value="French Southern Territories">French Southern Territories</option>
116
+ <option value="Gabon">Gabon</option>
117
+ <option value="Gambia">Gambia</option>
118
+ <option value="Georgia">Georgia</option>
119
+ <option value="Germany">Germany</option>
120
+ <option value="Ghana">Ghana</option>
121
+ <option value="Gibraltar">Gibraltar</option>
122
+ <option value="Greece">Greece</option>
123
+ <option value="Greenland">Greenland</option>
124
+ <option value="Grenada">Grenada</option>
125
+ <option value="Guadeloupe">Guadeloupe</option>
126
+ <option value="Guam">Guam</option>
127
+ <option value="Guatemala">Guatemala</option>
128
+ <option value="Guernsey">Guernsey</option>
129
+ <option value="Guinea">Guinea</option>
130
+ <option value="Guinea-bissau">Guinea-bissau</option>
131
+ <option value="Guyana">Guyana</option>
132
+ <option value="Haiti">Haiti</option>
133
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
134
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
135
+ <option value="Honduras">Honduras</option>
136
+ <option value="Hong Kong">Hong Kong</option>
137
+ <option value="Hungary">Hungary</option>
138
+ <option value="Iceland">Iceland</option>
139
+ <option value="India">India</option>
140
+ <option value="Indonesia">Indonesia</option>
141
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
142
+ <option value="Iraq">Iraq</option>
143
+ <option value="Ireland">Ireland</option>
144
+ <option value="Isle of Man">Isle of Man</option>
145
+ <option value="Israel">Israel</option>
146
+ <option value="Italy">Italy</option>
147
+ <option value="Jamaica">Jamaica</option>
148
+ <option value="Japan">Japan</option>
149
+ <option value="Jersey">Jersey</option>
150
+ <option value="Jordan">Jordan</option>
151
+ <option value="Kazakhstan">Kazakhstan</option>
152
+ <option value="Kenya">Kenya</option>
153
+ <option value="Kiribati">Kiribati</option>
154
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
155
+ <option value="Korea, Republic of">Korea, Republic of</option>
156
+ <option value="Kuwait">Kuwait</option>
157
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
158
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
159
+ <option value="Latvia">Latvia</option>
160
+ <option value="Lebanon">Lebanon</option>
161
+ <option value="Lesotho">Lesotho</option>
162
+ <option value="Liberia">Liberia</option>
163
+ <option value="Libya">Libya</option>
164
+ <option value="Liechtenstein">Liechtenstein</option>
165
+ <option value="Lithuania">Lithuania</option>
166
+ <option value="Luxembourg">Luxembourg</option>
167
+ <option value="Macao">Macao</option>
168
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
169
+ <option value="Madagascar">Madagascar</option>
170
+ <option value="Malawi">Malawi</option>
171
+ <option value="Malaysia">Malaysia</option>
172
+ <option value="Maldives">Maldives</option>
173
+ <option value="Mali">Mali</option>
174
+ <option value="Malta">Malta</option>
175
+ <option value="Marshall Islands">Marshall Islands</option>
176
+ <option value="Martinique">Martinique</option>
177
+ <option value="Mauritania">Mauritania</option>
178
+ <option value="Mauritius">Mauritius</option>
179
+ <option value="Mayotte">Mayotte</option>
180
+ <option value="Mexico">Mexico</option>
181
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
182
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
183
+ <option value="Monaco">Monaco</option>
184
+ <option value="Mongolia">Mongolia</option>
185
+ <option value="Montenegro">Montenegro</option>
186
+ <option value="Montserrat">Montserrat</option>
187
+ <option value="Morocco">Morocco</option>
188
+ <option value="Mozambique">Mozambique</option>
189
+ <option value="Myanmar">Myanmar</option>
190
+ <option value="Namibia">Namibia</option>
191
+ <option value="Nauru">Nauru</option>
192
+ <option value="Nepal">Nepal</option>
193
+ <option value="Netherlands">Netherlands</option>
194
+ <option value="New Caledonia">New Caledonia</option>
195
+ <option value="New Zealand">New Zealand</option>
196
+ <option value="Nicaragua">Nicaragua</option>
197
+ <option value="Niger">Niger</option>
198
+ <option value="Nigeria">Nigeria</option>
199
+ <option value="Niue">Niue</option>
200
+ <option value="Norfolk Island">Norfolk Island</option>
201
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
202
+ <option value="Norway">Norway</option>
203
+ <option value="Oman">Oman</option>
204
+ <option value="Pakistan">Pakistan</option>
205
+ <option value="Palau">Palau</option>
206
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
207
+ <option value="Panama">Panama</option>
208
+ <option value="Papua New Guinea">Papua New Guinea</option>
209
+ <option value="Paraguay">Paraguay</option>
210
+ <option value="Peru">Peru</option>
211
+ <option value="Philippines">Philippines</option>
212
+ <option value="Pitcairn">Pitcairn</option>
213
+ <option value="Poland">Poland</option>
214
+ <option value="Portugal">Portugal</option>
215
+ <option value="Puerto Rico">Puerto Rico</option>
216
+ <option value="Qatar">Qatar</option>
217
+ <option value="Reunion">Reunion</option>
218
+ <option value="Romania">Romania</option>
219
+ <option value="Russian Federation">Russian Federation</option>
220
+ <option value="Rwanda">Rwanda</option>
221
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
222
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
223
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
224
+ <option value="Saint Lucia">Saint Lucia</option>
225
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
226
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
227
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
228
+ <option value="Samoa">Samoa</option>
229
+ <option value="San Marino">San Marino</option>
230
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
231
+ <option value="Saudi Arabia">Saudi Arabia</option>
232
+ <option value="Senegal">Senegal</option>
233
+ <option value="Serbia">Serbia</option>
234
+ <option value="Seychelles">Seychelles</option>
235
+ <option value="Sierra Leone">Sierra Leone</option>
236
+ <option value="Singapore">Singapore</option>
237
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
238
+ <option value="Slovakia">Slovakia</option>
239
+ <option value="Slovenia">Slovenia</option>
240
+ <option value="Solomon Islands">Solomon Islands</option>
241
+ <option value="Somalia">Somalia</option>
242
+ <option value="South Africa">South Africa</option>
243
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
244
+ <option value="South Sudan">South Sudan</option>
245
+ <option value="Spain">Spain</option>
246
+ <option value="Sri Lanka">Sri Lanka</option>
247
+ <option value="Sudan">Sudan</option>
248
+ <option value="Suriname">Suriname</option>
249
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
250
+ <option value="Swaziland">Swaziland</option>
251
+ <option value="Sweden">Sweden</option>
252
+ <option value="Switzerland">Switzerland</option>
253
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
254
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
255
+ <option value="Tajikistan">Tajikistan</option>
256
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
257
+ <option value="Thailand">Thailand</option>
258
+ <option value="Timor-leste">Timor-leste</option>
259
+ <option value="Togo">Togo</option>
260
+ <option value="Tokelau">Tokelau</option>
261
+ <option value="Tonga">Tonga</option>
262
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
263
+ <option value="Tunisia">Tunisia</option>
264
+ <option value="Turkey">Turkey</option>
265
+ <option value="Turkmenistan">Turkmenistan</option>
266
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
267
+ <option value="Tuvalu">Tuvalu</option>
268
+ <option value="Uganda">Uganda</option>
269
+ <option value="Ukraine">Ukraine</option>
270
+ <option value="United Arab Emirates">United Arab Emirates</option>
271
+ <option value="United Kingdom">United Kingdom</option>
272
+ <option value="United States">United States</option>
273
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
274
+ <option value="Uruguay">Uruguay</option>
275
+ <option value="Uzbekistan">Uzbekistan</option>
276
+ <option value="Vanuatu">Vanuatu</option>
277
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
278
+ <option value="Viet Nam">Viet Nam</option>
279
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
280
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
281
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
282
+ <option value="Western Sahara">Western Sahara</option>
283
+ <option value="Yemen">Yemen</option>
284
+ <option value="Zambia">Zambia</option>
285
+ <option value="Zimbabwe">Zimbabwe</option>
286
+ </select>
287
+ </div>
288
+ <div>
289
+ <em>Into This</em>
290
+ <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
291
+ <option value=""></option>
292
+ <option value="United States">United States</option>
293
+ <option value="United Kingdom">United Kingdom</option>
294
+ <option value="Afghanistan">Afghanistan</option>
295
+ <option value="Aland Islands">Aland Islands</option>
296
+ <option value="Albania">Albania</option>
297
+ <option value="Algeria">Algeria</option>
298
+ <option value="American Samoa">American Samoa</option>
299
+ <option value="Andorra">Andorra</option>
300
+ <option value="Angola">Angola</option>
301
+ <option value="Anguilla">Anguilla</option>
302
+ <option value="Antarctica">Antarctica</option>
303
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
304
+ <option value="Argentina">Argentina</option>
305
+ <option value="Armenia">Armenia</option>
306
+ <option value="Aruba">Aruba</option>
307
+ <option value="Australia">Australia</option>
308
+ <option value="Austria">Austria</option>
309
+ <option value="Azerbaijan">Azerbaijan</option>
310
+ <option value="Bahamas">Bahamas</option>
311
+ <option value="Bahrain">Bahrain</option>
312
+ <option value="Bangladesh">Bangladesh</option>
313
+ <option value="Barbados">Barbados</option>
314
+ <option value="Belarus">Belarus</option>
315
+ <option value="Belgium">Belgium</option>
316
+ <option value="Belize">Belize</option>
317
+ <option value="Benin">Benin</option>
318
+ <option value="Bermuda">Bermuda</option>
319
+ <option value="Bhutan">Bhutan</option>
320
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
321
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
322
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
323
+ <option value="Botswana">Botswana</option>
324
+ <option value="Bouvet Island">Bouvet Island</option>
325
+ <option value="Brazil">Brazil</option>
326
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
327
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
328
+ <option value="Bulgaria">Bulgaria</option>
329
+ <option value="Burkina Faso">Burkina Faso</option>
330
+ <option value="Burundi">Burundi</option>
331
+ <option value="Cambodia">Cambodia</option>
332
+ <option value="Cameroon">Cameroon</option>
333
+ <option value="Canada">Canada</option>
334
+ <option value="Cape Verde">Cape Verde</option>
335
+ <option value="Cayman Islands">Cayman Islands</option>
336
+ <option value="Central African Republic">Central African Republic</option>
337
+ <option value="Chad">Chad</option>
338
+ <option value="Chile">Chile</option>
339
+ <option value="China">China</option>
340
+ <option value="Christmas Island">Christmas Island</option>
341
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
342
+ <option value="Colombia">Colombia</option>
343
+ <option value="Comoros">Comoros</option>
344
+ <option value="Congo">Congo</option>
345
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
346
+ <option value="Cook Islands">Cook Islands</option>
347
+ <option value="Costa Rica">Costa Rica</option>
348
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
349
+ <option value="Croatia">Croatia</option>
350
+ <option value="Cuba">Cuba</option>
351
+ <option value="Curacao">Curacao</option>
352
+ <option value="Cyprus">Cyprus</option>
353
+ <option value="Czech Republic">Czech Republic</option>
354
+ <option value="Denmark">Denmark</option>
355
+ <option value="Djibouti">Djibouti</option>
356
+ <option value="Dominica">Dominica</option>
357
+ <option value="Dominican Republic">Dominican Republic</option>
358
+ <option value="Ecuador">Ecuador</option>
359
+ <option value="Egypt">Egypt</option>
360
+ <option value="El Salvador">El Salvador</option>
361
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
362
+ <option value="Eritrea">Eritrea</option>
363
+ <option value="Estonia">Estonia</option>
364
+ <option value="Ethiopia">Ethiopia</option>
365
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
366
+ <option value="Faroe Islands">Faroe Islands</option>
367
+ <option value="Fiji">Fiji</option>
368
+ <option value="Finland">Finland</option>
369
+ <option value="France">France</option>
370
+ <option value="French Guiana">French Guiana</option>
371
+ <option value="French Polynesia">French Polynesia</option>
372
+ <option value="French Southern Territories">French Southern Territories</option>
373
+ <option value="Gabon">Gabon</option>
374
+ <option value="Gambia">Gambia</option>
375
+ <option value="Georgia">Georgia</option>
376
+ <option value="Germany">Germany</option>
377
+ <option value="Ghana">Ghana</option>
378
+ <option value="Gibraltar">Gibraltar</option>
379
+ <option value="Greece">Greece</option>
380
+ <option value="Greenland">Greenland</option>
381
+ <option value="Grenada">Grenada</option>
382
+ <option value="Guadeloupe">Guadeloupe</option>
383
+ <option value="Guam">Guam</option>
384
+ <option value="Guatemala">Guatemala</option>
385
+ <option value="Guernsey">Guernsey</option>
386
+ <option value="Guinea">Guinea</option>
387
+ <option value="Guinea-bissau">Guinea-bissau</option>
388
+ <option value="Guyana">Guyana</option>
389
+ <option value="Haiti">Haiti</option>
390
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
391
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
392
+ <option value="Honduras">Honduras</option>
393
+ <option value="Hong Kong">Hong Kong</option>
394
+ <option value="Hungary">Hungary</option>
395
+ <option value="Iceland">Iceland</option>
396
+ <option value="India">India</option>
397
+ <option value="Indonesia">Indonesia</option>
398
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
399
+ <option value="Iraq">Iraq</option>
400
+ <option value="Ireland">Ireland</option>
401
+ <option value="Isle of Man">Isle of Man</option>
402
+ <option value="Israel">Israel</option>
403
+ <option value="Italy">Italy</option>
404
+ <option value="Jamaica">Jamaica</option>
405
+ <option value="Japan">Japan</option>
406
+ <option value="Jersey">Jersey</option>
407
+ <option value="Jordan">Jordan</option>
408
+ <option value="Kazakhstan">Kazakhstan</option>
409
+ <option value="Kenya">Kenya</option>
410
+ <option value="Kiribati">Kiribati</option>
411
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
412
+ <option value="Korea, Republic of">Korea, Republic of</option>
413
+ <option value="Kuwait">Kuwait</option>
414
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
415
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
416
+ <option value="Latvia">Latvia</option>
417
+ <option value="Lebanon">Lebanon</option>
418
+ <option value="Lesotho">Lesotho</option>
419
+ <option value="Liberia">Liberia</option>
420
+ <option value="Libya">Libya</option>
421
+ <option value="Liechtenstein">Liechtenstein</option>
422
+ <option value="Lithuania">Lithuania</option>
423
+ <option value="Luxembourg">Luxembourg</option>
424
+ <option value="Macao">Macao</option>
425
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
426
+ <option value="Madagascar">Madagascar</option>
427
+ <option value="Malawi">Malawi</option>
428
+ <option value="Malaysia">Malaysia</option>
429
+ <option value="Maldives">Maldives</option>
430
+ <option value="Mali">Mali</option>
431
+ <option value="Malta">Malta</option>
432
+ <option value="Marshall Islands">Marshall Islands</option>
433
+ <option value="Martinique">Martinique</option>
434
+ <option value="Mauritania">Mauritania</option>
435
+ <option value="Mauritius">Mauritius</option>
436
+ <option value="Mayotte">Mayotte</option>
437
+ <option value="Mexico">Mexico</option>
438
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
439
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
440
+ <option value="Monaco">Monaco</option>
441
+ <option value="Mongolia">Mongolia</option>
442
+ <option value="Montenegro">Montenegro</option>
443
+ <option value="Montserrat">Montserrat</option>
444
+ <option value="Morocco">Morocco</option>
445
+ <option value="Mozambique">Mozambique</option>
446
+ <option value="Myanmar">Myanmar</option>
447
+ <option value="Namibia">Namibia</option>
448
+ <option value="Nauru">Nauru</option>
449
+ <option value="Nepal">Nepal</option>
450
+ <option value="Netherlands">Netherlands</option>
451
+ <option value="New Caledonia">New Caledonia</option>
452
+ <option value="New Zealand">New Zealand</option>
453
+ <option value="Nicaragua">Nicaragua</option>
454
+ <option value="Niger">Niger</option>
455
+ <option value="Nigeria">Nigeria</option>
456
+ <option value="Niue">Niue</option>
457
+ <option value="Norfolk Island">Norfolk Island</option>
458
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
459
+ <option value="Norway">Norway</option>
460
+ <option value="Oman">Oman</option>
461
+ <option value="Pakistan">Pakistan</option>
462
+ <option value="Palau">Palau</option>
463
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
464
+ <option value="Panama">Panama</option>
465
+ <option value="Papua New Guinea">Papua New Guinea</option>
466
+ <option value="Paraguay">Paraguay</option>
467
+ <option value="Peru">Peru</option>
468
+ <option value="Philippines">Philippines</option>
469
+ <option value="Pitcairn">Pitcairn</option>
470
+ <option value="Poland">Poland</option>
471
+ <option value="Portugal">Portugal</option>
472
+ <option value="Puerto Rico">Puerto Rico</option>
473
+ <option value="Qatar">Qatar</option>
474
+ <option value="Reunion">Reunion</option>
475
+ <option value="Romania">Romania</option>
476
+ <option value="Russian Federation">Russian Federation</option>
477
+ <option value="Rwanda">Rwanda</option>
478
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
479
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
480
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
481
+ <option value="Saint Lucia">Saint Lucia</option>
482
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
483
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
484
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
485
+ <option value="Samoa">Samoa</option>
486
+ <option value="San Marino">San Marino</option>
487
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
488
+ <option value="Saudi Arabia">Saudi Arabia</option>
489
+ <option value="Senegal">Senegal</option>
490
+ <option value="Serbia">Serbia</option>
491
+ <option value="Seychelles">Seychelles</option>
492
+ <option value="Sierra Leone">Sierra Leone</option>
493
+ <option value="Singapore">Singapore</option>
494
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
495
+ <option value="Slovakia">Slovakia</option>
496
+ <option value="Slovenia">Slovenia</option>
497
+ <option value="Solomon Islands">Solomon Islands</option>
498
+ <option value="Somalia">Somalia</option>
499
+ <option value="South Africa">South Africa</option>
500
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
501
+ <option value="South Sudan">South Sudan</option>
502
+ <option value="Spain">Spain</option>
503
+ <option value="Sri Lanka">Sri Lanka</option>
504
+ <option value="Sudan">Sudan</option>
505
+ <option value="Suriname">Suriname</option>
506
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
507
+ <option value="Swaziland">Swaziland</option>
508
+ <option value="Sweden">Sweden</option>
509
+ <option value="Switzerland">Switzerland</option>
510
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
511
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
512
+ <option value="Tajikistan">Tajikistan</option>
513
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
514
+ <option value="Thailand">Thailand</option>
515
+ <option value="Timor-leste">Timor-leste</option>
516
+ <option value="Togo">Togo</option>
517
+ <option value="Tokelau">Tokelau</option>
518
+ <option value="Tonga">Tonga</option>
519
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
520
+ <option value="Tunisia">Tunisia</option>
521
+ <option value="Turkey">Turkey</option>
522
+ <option value="Turkmenistan">Turkmenistan</option>
523
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
524
+ <option value="Tuvalu">Tuvalu</option>
525
+ <option value="Uganda">Uganda</option>
526
+ <option value="Ukraine">Ukraine</option>
527
+ <option value="United Arab Emirates">United Arab Emirates</option>
528
+ <option value="United Kingdom">United Kingdom</option>
529
+ <option value="United States">United States</option>
530
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
531
+ <option value="Uruguay">Uruguay</option>
532
+ <option value="Uzbekistan">Uzbekistan</option>
533
+ <option value="Vanuatu">Vanuatu</option>
534
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
535
+ <option value="Viet Nam">Viet Nam</option>
536
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
537
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
538
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
539
+ <option value="Western Sahara">Western Sahara</option>
540
+ <option value="Yemen">Yemen</option>
541
+ <option value="Zambia">Zambia</option>
542
+ <option value="Zimbabwe">Zimbabwe</option>
543
+ </select>
544
+ </div>
545
+ </div>
546
+
547
+ <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
548
+ <div class="side-by-side clearfix">
549
+ <div>
550
+ <em>Turns This</em>
551
+ <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
552
+ <option value=""></option>
553
+ <option value="United States">United States</option>
554
+ <option value="United Kingdom">United Kingdom</option>
555
+ <option value="Afghanistan">Afghanistan</option>
556
+ <option value="Aland Islands">Aland Islands</option>
557
+ <option value="Albania">Albania</option>
558
+ <option value="Algeria">Algeria</option>
559
+ <option value="American Samoa">American Samoa</option>
560
+ <option value="Andorra">Andorra</option>
561
+ <option value="Angola">Angola</option>
562
+ <option value="Anguilla">Anguilla</option>
563
+ <option value="Antarctica">Antarctica</option>
564
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
565
+ <option value="Argentina">Argentina</option>
566
+ <option value="Armenia">Armenia</option>
567
+ <option value="Aruba">Aruba</option>
568
+ <option value="Australia">Australia</option>
569
+ <option value="Austria">Austria</option>
570
+ <option value="Azerbaijan">Azerbaijan</option>
571
+ <option value="Bahamas">Bahamas</option>
572
+ <option value="Bahrain">Bahrain</option>
573
+ <option value="Bangladesh">Bangladesh</option>
574
+ <option value="Barbados">Barbados</option>
575
+ <option value="Belarus">Belarus</option>
576
+ <option value="Belgium">Belgium</option>
577
+ <option value="Belize">Belize</option>
578
+ <option value="Benin">Benin</option>
579
+ <option value="Bermuda">Bermuda</option>
580
+ <option value="Bhutan">Bhutan</option>
581
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
582
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
583
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
584
+ <option value="Botswana">Botswana</option>
585
+ <option value="Bouvet Island">Bouvet Island</option>
586
+ <option value="Brazil">Brazil</option>
587
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
588
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
589
+ <option value="Bulgaria">Bulgaria</option>
590
+ <option value="Burkina Faso">Burkina Faso</option>
591
+ <option value="Burundi">Burundi</option>
592
+ <option value="Cambodia">Cambodia</option>
593
+ <option value="Cameroon">Cameroon</option>
594
+ <option value="Canada">Canada</option>
595
+ <option value="Cape Verde">Cape Verde</option>
596
+ <option value="Cayman Islands">Cayman Islands</option>
597
+ <option value="Central African Republic">Central African Republic</option>
598
+ <option value="Chad">Chad</option>
599
+ <option value="Chile">Chile</option>
600
+ <option value="China">China</option>
601
+ <option value="Christmas Island">Christmas Island</option>
602
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
603
+ <option value="Colombia">Colombia</option>
604
+ <option value="Comoros">Comoros</option>
605
+ <option value="Congo">Congo</option>
606
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
607
+ <option value="Cook Islands">Cook Islands</option>
608
+ <option value="Costa Rica">Costa Rica</option>
609
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
610
+ <option value="Croatia">Croatia</option>
611
+ <option value="Cuba">Cuba</option>
612
+ <option value="Curacao">Curacao</option>
613
+ <option value="Cyprus">Cyprus</option>
614
+ <option value="Czech Republic">Czech Republic</option>
615
+ <option value="Denmark">Denmark</option>
616
+ <option value="Djibouti">Djibouti</option>
617
+ <option value="Dominica">Dominica</option>
618
+ <option value="Dominican Republic">Dominican Republic</option>
619
+ <option value="Ecuador">Ecuador</option>
620
+ <option value="Egypt">Egypt</option>
621
+ <option value="El Salvador">El Salvador</option>
622
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
623
+ <option value="Eritrea">Eritrea</option>
624
+ <option value="Estonia">Estonia</option>
625
+ <option value="Ethiopia">Ethiopia</option>
626
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
627
+ <option value="Faroe Islands">Faroe Islands</option>
628
+ <option value="Fiji">Fiji</option>
629
+ <option value="Finland">Finland</option>
630
+ <option value="France">France</option>
631
+ <option value="French Guiana">French Guiana</option>
632
+ <option value="French Polynesia">French Polynesia</option>
633
+ <option value="French Southern Territories">French Southern Territories</option>
634
+ <option value="Gabon">Gabon</option>
635
+ <option value="Gambia">Gambia</option>
636
+ <option value="Georgia">Georgia</option>
637
+ <option value="Germany">Germany</option>
638
+ <option value="Ghana">Ghana</option>
639
+ <option value="Gibraltar">Gibraltar</option>
640
+ <option value="Greece">Greece</option>
641
+ <option value="Greenland">Greenland</option>
642
+ <option value="Grenada">Grenada</option>
643
+ <option value="Guadeloupe">Guadeloupe</option>
644
+ <option value="Guam">Guam</option>
645
+ <option value="Guatemala">Guatemala</option>
646
+ <option value="Guernsey">Guernsey</option>
647
+ <option value="Guinea">Guinea</option>
648
+ <option value="Guinea-bissau">Guinea-bissau</option>
649
+ <option value="Guyana">Guyana</option>
650
+ <option value="Haiti">Haiti</option>
651
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
652
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
653
+ <option value="Honduras">Honduras</option>
654
+ <option value="Hong Kong">Hong Kong</option>
655
+ <option value="Hungary">Hungary</option>
656
+ <option value="Iceland">Iceland</option>
657
+ <option value="India">India</option>
658
+ <option value="Indonesia">Indonesia</option>
659
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
660
+ <option value="Iraq">Iraq</option>
661
+ <option value="Ireland">Ireland</option>
662
+ <option value="Isle of Man">Isle of Man</option>
663
+ <option value="Israel">Israel</option>
664
+ <option value="Italy">Italy</option>
665
+ <option value="Jamaica">Jamaica</option>
666
+ <option value="Japan">Japan</option>
667
+ <option value="Jersey">Jersey</option>
668
+ <option value="Jordan">Jordan</option>
669
+ <option value="Kazakhstan">Kazakhstan</option>
670
+ <option value="Kenya">Kenya</option>
671
+ <option value="Kiribati">Kiribati</option>
672
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
673
+ <option value="Korea, Republic of">Korea, Republic of</option>
674
+ <option value="Kuwait">Kuwait</option>
675
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
676
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
677
+ <option value="Latvia">Latvia</option>
678
+ <option value="Lebanon">Lebanon</option>
679
+ <option value="Lesotho">Lesotho</option>
680
+ <option value="Liberia">Liberia</option>
681
+ <option value="Libya">Libya</option>
682
+ <option value="Liechtenstein">Liechtenstein</option>
683
+ <option value="Lithuania">Lithuania</option>
684
+ <option value="Luxembourg">Luxembourg</option>
685
+ <option value="Macao">Macao</option>
686
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
687
+ <option value="Madagascar">Madagascar</option>
688
+ <option value="Malawi">Malawi</option>
689
+ <option value="Malaysia">Malaysia</option>
690
+ <option value="Maldives">Maldives</option>
691
+ <option value="Mali">Mali</option>
692
+ <option value="Malta">Malta</option>
693
+ <option value="Marshall Islands">Marshall Islands</option>
694
+ <option value="Martinique">Martinique</option>
695
+ <option value="Mauritania">Mauritania</option>
696
+ <option value="Mauritius">Mauritius</option>
697
+ <option value="Mayotte">Mayotte</option>
698
+ <option value="Mexico">Mexico</option>
699
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
700
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
701
+ <option value="Monaco">Monaco</option>
702
+ <option value="Mongolia">Mongolia</option>
703
+ <option value="Montenegro">Montenegro</option>
704
+ <option value="Montserrat">Montserrat</option>
705
+ <option value="Morocco">Morocco</option>
706
+ <option value="Mozambique">Mozambique</option>
707
+ <option value="Myanmar">Myanmar</option>
708
+ <option value="Namibia">Namibia</option>
709
+ <option value="Nauru">Nauru</option>
710
+ <option value="Nepal">Nepal</option>
711
+ <option value="Netherlands">Netherlands</option>
712
+ <option value="New Caledonia">New Caledonia</option>
713
+ <option value="New Zealand">New Zealand</option>
714
+ <option value="Nicaragua">Nicaragua</option>
715
+ <option value="Niger">Niger</option>
716
+ <option value="Nigeria">Nigeria</option>
717
+ <option value="Niue">Niue</option>
718
+ <option value="Norfolk Island">Norfolk Island</option>
719
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
720
+ <option value="Norway">Norway</option>
721
+ <option value="Oman">Oman</option>
722
+ <option value="Pakistan">Pakistan</option>
723
+ <option value="Palau">Palau</option>
724
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
725
+ <option value="Panama">Panama</option>
726
+ <option value="Papua New Guinea">Papua New Guinea</option>
727
+ <option value="Paraguay">Paraguay</option>
728
+ <option value="Peru">Peru</option>
729
+ <option value="Philippines">Philippines</option>
730
+ <option value="Pitcairn">Pitcairn</option>
731
+ <option value="Poland">Poland</option>
732
+ <option value="Portugal">Portugal</option>
733
+ <option value="Puerto Rico">Puerto Rico</option>
734
+ <option value="Qatar">Qatar</option>
735
+ <option value="Reunion">Reunion</option>
736
+ <option value="Romania">Romania</option>
737
+ <option value="Russian Federation">Russian Federation</option>
738
+ <option value="Rwanda">Rwanda</option>
739
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
740
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
741
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
742
+ <option value="Saint Lucia">Saint Lucia</option>
743
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
744
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
745
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
746
+ <option value="Samoa">Samoa</option>
747
+ <option value="San Marino">San Marino</option>
748
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
749
+ <option value="Saudi Arabia">Saudi Arabia</option>
750
+ <option value="Senegal">Senegal</option>
751
+ <option value="Serbia">Serbia</option>
752
+ <option value="Seychelles">Seychelles</option>
753
+ <option value="Sierra Leone">Sierra Leone</option>
754
+ <option value="Singapore">Singapore</option>
755
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
756
+ <option value="Slovakia">Slovakia</option>
757
+ <option value="Slovenia">Slovenia</option>
758
+ <option value="Solomon Islands">Solomon Islands</option>
759
+ <option value="Somalia">Somalia</option>
760
+ <option value="South Africa">South Africa</option>
761
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
762
+ <option value="South Sudan">South Sudan</option>
763
+ <option value="Spain">Spain</option>
764
+ <option value="Sri Lanka">Sri Lanka</option>
765
+ <option value="Sudan">Sudan</option>
766
+ <option value="Suriname">Suriname</option>
767
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
768
+ <option value="Swaziland">Swaziland</option>
769
+ <option value="Sweden">Sweden</option>
770
+ <option value="Switzerland">Switzerland</option>
771
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
772
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
773
+ <option value="Tajikistan">Tajikistan</option>
774
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
775
+ <option value="Thailand">Thailand</option>
776
+ <option value="Timor-leste">Timor-leste</option>
777
+ <option value="Togo">Togo</option>
778
+ <option value="Tokelau">Tokelau</option>
779
+ <option value="Tonga">Tonga</option>
780
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
781
+ <option value="Tunisia">Tunisia</option>
782
+ <option value="Turkey">Turkey</option>
783
+ <option value="Turkmenistan">Turkmenistan</option>
784
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
785
+ <option value="Tuvalu">Tuvalu</option>
786
+ <option value="Uganda">Uganda</option>
787
+ <option value="Ukraine">Ukraine</option>
788
+ <option value="United Arab Emirates">United Arab Emirates</option>
789
+ <option value="United Kingdom">United Kingdom</option>
790
+ <option value="United States">United States</option>
791
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
792
+ <option value="Uruguay">Uruguay</option>
793
+ <option value="Uzbekistan">Uzbekistan</option>
794
+ <option value="Vanuatu">Vanuatu</option>
795
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
796
+ <option value="Viet Nam">Viet Nam</option>
797
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
798
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
799
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
800
+ <option value="Western Sahara">Western Sahara</option>
801
+ <option value="Yemen">Yemen</option>
802
+ <option value="Zambia">Zambia</option>
803
+ <option value="Zimbabwe">Zimbabwe</option>
804
+ </select>
805
+ </div>
806
+ <div>
807
+ <em>Into This</em>
808
+ <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
809
+ <option value=""></option>
810
+ <option value="United States">United States</option>
811
+ <option value="United Kingdom">United Kingdom</option>
812
+ <option value="Afghanistan">Afghanistan</option>
813
+ <option value="Aland Islands">Aland Islands</option>
814
+ <option value="Albania">Albania</option>
815
+ <option value="Algeria">Algeria</option>
816
+ <option value="American Samoa">American Samoa</option>
817
+ <option value="Andorra">Andorra</option>
818
+ <option value="Angola">Angola</option>
819
+ <option value="Anguilla">Anguilla</option>
820
+ <option value="Antarctica">Antarctica</option>
821
+ <option value="Antigua and Barbuda">Antigua and Barbuda</option>
822
+ <option value="Argentina">Argentina</option>
823
+ <option value="Armenia">Armenia</option>
824
+ <option value="Aruba">Aruba</option>
825
+ <option value="Australia">Australia</option>
826
+ <option value="Austria">Austria</option>
827
+ <option value="Azerbaijan">Azerbaijan</option>
828
+ <option value="Bahamas">Bahamas</option>
829
+ <option value="Bahrain">Bahrain</option>
830
+ <option value="Bangladesh">Bangladesh</option>
831
+ <option value="Barbados">Barbados</option>
832
+ <option value="Belarus">Belarus</option>
833
+ <option value="Belgium">Belgium</option>
834
+ <option value="Belize">Belize</option>
835
+ <option value="Benin">Benin</option>
836
+ <option value="Bermuda">Bermuda</option>
837
+ <option value="Bhutan">Bhutan</option>
838
+ <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
839
+ <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
840
+ <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
841
+ <option value="Botswana">Botswana</option>
842
+ <option value="Bouvet Island">Bouvet Island</option>
843
+ <option value="Brazil">Brazil</option>
844
+ <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
845
+ <option value="Brunei Darussalam">Brunei Darussalam</option>
846
+ <option value="Bulgaria">Bulgaria</option>
847
+ <option value="Burkina Faso">Burkina Faso</option>
848
+ <option value="Burundi">Burundi</option>
849
+ <option value="Cambodia">Cambodia</option>
850
+ <option value="Cameroon">Cameroon</option>
851
+ <option value="Canada">Canada</option>
852
+ <option value="Cape Verde">Cape Verde</option>
853
+ <option value="Cayman Islands">Cayman Islands</option>
854
+ <option value="Central African Republic">Central African Republic</option>
855
+ <option value="Chad">Chad</option>
856
+ <option value="Chile">Chile</option>
857
+ <option value="China">China</option>
858
+ <option value="Christmas Island">Christmas Island</option>
859
+ <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
860
+ <option value="Colombia">Colombia</option>
861
+ <option value="Comoros">Comoros</option>
862
+ <option value="Congo">Congo</option>
863
+ <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
864
+ <option value="Cook Islands">Cook Islands</option>
865
+ <option value="Costa Rica">Costa Rica</option>
866
+ <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
867
+ <option value="Croatia">Croatia</option>
868
+ <option value="Cuba">Cuba</option>
869
+ <option value="Curacao">Curacao</option>
870
+ <option value="Cyprus">Cyprus</option>
871
+ <option value="Czech Republic">Czech Republic</option>
872
+ <option value="Denmark">Denmark</option>
873
+ <option value="Djibouti">Djibouti</option>
874
+ <option value="Dominica">Dominica</option>
875
+ <option value="Dominican Republic">Dominican Republic</option>
876
+ <option value="Ecuador">Ecuador</option>
877
+ <option value="Egypt">Egypt</option>
878
+ <option value="El Salvador">El Salvador</option>
879
+ <option value="Equatorial Guinea">Equatorial Guinea</option>
880
+ <option value="Eritrea">Eritrea</option>
881
+ <option value="Estonia">Estonia</option>
882
+ <option value="Ethiopia">Ethiopia</option>
883
+ <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
884
+ <option value="Faroe Islands">Faroe Islands</option>
885
+ <option value="Fiji">Fiji</option>
886
+ <option value="Finland">Finland</option>
887
+ <option value="France">France</option>
888
+ <option value="French Guiana">French Guiana</option>
889
+ <option value="French Polynesia">French Polynesia</option>
890
+ <option value="French Southern Territories">French Southern Territories</option>
891
+ <option value="Gabon">Gabon</option>
892
+ <option value="Gambia">Gambia</option>
893
+ <option value="Georgia">Georgia</option>
894
+ <option value="Germany">Germany</option>
895
+ <option value="Ghana">Ghana</option>
896
+ <option value="Gibraltar">Gibraltar</option>
897
+ <option value="Greece">Greece</option>
898
+ <option value="Greenland">Greenland</option>
899
+ <option value="Grenada">Grenada</option>
900
+ <option value="Guadeloupe">Guadeloupe</option>
901
+ <option value="Guam">Guam</option>
902
+ <option value="Guatemala">Guatemala</option>
903
+ <option value="Guernsey">Guernsey</option>
904
+ <option value="Guinea">Guinea</option>
905
+ <option value="Guinea-bissau">Guinea-bissau</option>
906
+ <option value="Guyana">Guyana</option>
907
+ <option value="Haiti">Haiti</option>
908
+ <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
909
+ <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
910
+ <option value="Honduras">Honduras</option>
911
+ <option value="Hong Kong">Hong Kong</option>
912
+ <option value="Hungary">Hungary</option>
913
+ <option value="Iceland">Iceland</option>
914
+ <option value="India">India</option>
915
+ <option value="Indonesia">Indonesia</option>
916
+ <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
917
+ <option value="Iraq">Iraq</option>
918
+ <option value="Ireland">Ireland</option>
919
+ <option value="Isle of Man">Isle of Man</option>
920
+ <option value="Israel">Israel</option>
921
+ <option value="Italy">Italy</option>
922
+ <option value="Jamaica">Jamaica</option>
923
+ <option value="Japan">Japan</option>
924
+ <option value="Jersey">Jersey</option>
925
+ <option value="Jordan">Jordan</option>
926
+ <option value="Kazakhstan">Kazakhstan</option>
927
+ <option value="Kenya">Kenya</option>
928
+ <option value="Kiribati">Kiribati</option>
929
+ <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
930
+ <option value="Korea, Republic of">Korea, Republic of</option>
931
+ <option value="Kuwait">Kuwait</option>
932
+ <option value="Kyrgyzstan">Kyrgyzstan</option>
933
+ <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
934
+ <option value="Latvia">Latvia</option>
935
+ <option value="Lebanon">Lebanon</option>
936
+ <option value="Lesotho">Lesotho</option>
937
+ <option value="Liberia">Liberia</option>
938
+ <option value="Libya">Libya</option>
939
+ <option value="Liechtenstein">Liechtenstein</option>
940
+ <option value="Lithuania">Lithuania</option>
941
+ <option value="Luxembourg">Luxembourg</option>
942
+ <option value="Macao">Macao</option>
943
+ <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
944
+ <option value="Madagascar">Madagascar</option>
945
+ <option value="Malawi">Malawi</option>
946
+ <option value="Malaysia">Malaysia</option>
947
+ <option value="Maldives">Maldives</option>
948
+ <option value="Mali">Mali</option>
949
+ <option value="Malta">Malta</option>
950
+ <option value="Marshall Islands">Marshall Islands</option>
951
+ <option value="Martinique">Martinique</option>
952
+ <option value="Mauritania">Mauritania</option>
953
+ <option value="Mauritius">Mauritius</option>
954
+ <option value="Mayotte">Mayotte</option>
955
+ <option value="Mexico">Mexico</option>
956
+ <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
957
+ <option value="Moldova, Republic of">Moldova, Republic of</option>
958
+ <option value="Monaco">Monaco</option>
959
+ <option value="Mongolia">Mongolia</option>
960
+ <option value="Montenegro">Montenegro</option>
961
+ <option value="Montserrat">Montserrat</option>
962
+ <option value="Morocco">Morocco</option>
963
+ <option value="Mozambique">Mozambique</option>
964
+ <option value="Myanmar">Myanmar</option>
965
+ <option value="Namibia">Namibia</option>
966
+ <option value="Nauru">Nauru</option>
967
+ <option value="Nepal">Nepal</option>
968
+ <option value="Netherlands">Netherlands</option>
969
+ <option value="New Caledonia">New Caledonia</option>
970
+ <option value="New Zealand">New Zealand</option>
971
+ <option value="Nicaragua">Nicaragua</option>
972
+ <option value="Niger">Niger</option>
973
+ <option value="Nigeria">Nigeria</option>
974
+ <option value="Niue">Niue</option>
975
+ <option value="Norfolk Island">Norfolk Island</option>
976
+ <option value="Northern Mariana Islands">Northern Mariana Islands</option>
977
+ <option value="Norway">Norway</option>
978
+ <option value="Oman">Oman</option>
979
+ <option value="Pakistan">Pakistan</option>
980
+ <option value="Palau">Palau</option>
981
+ <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
982
+ <option value="Panama">Panama</option>
983
+ <option value="Papua New Guinea">Papua New Guinea</option>
984
+ <option value="Paraguay">Paraguay</option>
985
+ <option value="Peru">Peru</option>
986
+ <option value="Philippines">Philippines</option>
987
+ <option value="Pitcairn">Pitcairn</option>
988
+ <option value="Poland">Poland</option>
989
+ <option value="Portugal">Portugal</option>
990
+ <option value="Puerto Rico">Puerto Rico</option>
991
+ <option value="Qatar">Qatar</option>
992
+ <option value="Reunion">Reunion</option>
993
+ <option value="Romania">Romania</option>
994
+ <option value="Russian Federation">Russian Federation</option>
995
+ <option value="Rwanda">Rwanda</option>
996
+ <option value="Saint Barthelemy">Saint Barthelemy</option>
997
+ <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
998
+ <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
999
+ <option value="Saint Lucia">Saint Lucia</option>
1000
+ <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1001
+ <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1002
+ <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1003
+ <option value="Samoa">Samoa</option>
1004
+ <option value="San Marino">San Marino</option>
1005
+ <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1006
+ <option value="Saudi Arabia">Saudi Arabia</option>
1007
+ <option value="Senegal">Senegal</option>
1008
+ <option value="Serbia">Serbia</option>
1009
+ <option value="Seychelles">Seychelles</option>
1010
+ <option value="Sierra Leone">Sierra Leone</option>
1011
+ <option value="Singapore">Singapore</option>
1012
+ <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1013
+ <option value="Slovakia">Slovakia</option>
1014
+ <option value="Slovenia">Slovenia</option>
1015
+ <option value="Solomon Islands">Solomon Islands</option>
1016
+ <option value="Somalia">Somalia</option>
1017
+ <option value="South Africa">South Africa</option>
1018
+ <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1019
+ <option value="South Sudan">South Sudan</option>
1020
+ <option value="Spain">Spain</option>
1021
+ <option value="Sri Lanka">Sri Lanka</option>
1022
+ <option value="Sudan">Sudan</option>
1023
+ <option value="Suriname">Suriname</option>
1024
+ <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1025
+ <option value="Swaziland">Swaziland</option>
1026
+ <option value="Sweden">Sweden</option>
1027
+ <option value="Switzerland">Switzerland</option>
1028
+ <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1029
+ <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1030
+ <option value="Tajikistan">Tajikistan</option>
1031
+ <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1032
+ <option value="Thailand">Thailand</option>
1033
+ <option value="Timor-leste">Timor-leste</option>
1034
+ <option value="Togo">Togo</option>
1035
+ <option value="Tokelau">Tokelau</option>
1036
+ <option value="Tonga">Tonga</option>
1037
+ <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1038
+ <option value="Tunisia">Tunisia</option>
1039
+ <option value="Turkey">Turkey</option>
1040
+ <option value="Turkmenistan">Turkmenistan</option>
1041
+ <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1042
+ <option value="Tuvalu">Tuvalu</option>
1043
+ <option value="Uganda">Uganda</option>
1044
+ <option value="Ukraine">Ukraine</option>
1045
+ <option value="United Arab Emirates">United Arab Emirates</option>
1046
+ <option value="United Kingdom">United Kingdom</option>
1047
+ <option value="United States">United States</option>
1048
+ <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1049
+ <option value="Uruguay">Uruguay</option>
1050
+ <option value="Uzbekistan">Uzbekistan</option>
1051
+ <option value="Vanuatu">Vanuatu</option>
1052
+ <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1053
+ <option value="Viet Nam">Viet Nam</option>
1054
+ <option value="Virgin Islands, British">Virgin Islands, British</option>
1055
+ <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1056
+ <option value="Wallis and Futuna">Wallis and Futuna</option>
1057
+ <option value="Western Sahara">Western Sahara</option>
1058
+ <option value="Yemen">Yemen</option>
1059
+ <option value="Zambia">Zambia</option>
1060
+ <option value="Zimbabwe">Zimbabwe</option>
1061
+ </select>
1062
+ </div>
1063
+ </div>
1064
+
1065
+ <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1066
+ <div class="side-by-side clearfix">
1067
+ <div>
1068
+ <em>Single Select with Groups</em>
1069
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1070
+ <option value=""></option>
1071
+ <optgroup label="NFC EAST">
1072
+ <option>Dallas Cowboys</option>
1073
+ <option>New York Giants</option>
1074
+ <option>Philadelphia Eagles</option>
1075
+ <option>Washington Redskins</option>
1076
+ </optgroup>
1077
+ <optgroup label="NFC NORTH">
1078
+ <option>Chicago Bears</option>
1079
+ <option>Detroit Lions</option>
1080
+ <option>Green Bay Packers</option>
1081
+ <option>Minnesota Vikings</option>
1082
+ </optgroup>
1083
+ <optgroup label="NFC SOUTH">
1084
+ <option>Atlanta Falcons</option>
1085
+ <option>Carolina Panthers</option>
1086
+ <option>New Orleans Saints</option>
1087
+ <option>Tampa Bay Buccaneers</option>
1088
+ </optgroup>
1089
+ <optgroup label="NFC WEST">
1090
+ <option>Arizona Cardinals</option>
1091
+ <option>St. Louis Rams</option>
1092
+ <option>San Francisco 49ers</option>
1093
+ <option>Seattle Seahawks</option>
1094
+ </optgroup>
1095
+ <optgroup label="AFC EAST">
1096
+ <option>Buffalo Bills</option>
1097
+ <option>Miami Dolphins</option>
1098
+ <option>New England Patriots</option>
1099
+ <option>New York Jets</option>
1100
+ </optgroup>
1101
+ <optgroup label="AFC NORTH">
1102
+ <option>Baltimore Ravens</option>
1103
+ <option>Cincinnati Bengals</option>
1104
+ <option>Cleveland Browns</option>
1105
+ <option>Pittsburgh Steelers</option>
1106
+ </optgroup>
1107
+ <optgroup label="AFC SOUTH">
1108
+ <option>Houston Texans</option>
1109
+ <option>Indianapolis Colts</option>
1110
+ <option>Jacksonville Jaguars</option>
1111
+ <option>Tennessee Titans</option>
1112
+ </optgroup>
1113
+ <optgroup label="AFC WEST">
1114
+ <option>Denver Broncos</option>
1115
+ <option>Kansas City Chiefs</option>
1116
+ <option>Oakland Raiders</option>
1117
+ <option>San Diego Chargers</option>
1118
+ </optgroup>
1119
+ </select>
1120
+ </div>
1121
+ <div>
1122
+ <em>Multiple Select with Groups</em>
1123
+ <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1124
+ <option value=""></option>
1125
+ <optgroup label="NFC EAST">
1126
+ <option>Dallas Cowboys</option>
1127
+ <option>New York Giants</option>
1128
+ <option>Philadelphia Eagles</option>
1129
+ <option>Washington Redskins</option>
1130
+ </optgroup>
1131
+ <optgroup label="NFC NORTH">
1132
+ <option>Chicago Bears</option>
1133
+ <option>Detroit Lions</option>
1134
+ <option>Green Bay Packers</option>
1135
+ <option>Minnesota Vikings</option>
1136
+ </optgroup>
1137
+ <optgroup label="NFC SOUTH">
1138
+ <option>Atlanta Falcons</option>
1139
+ <option>Carolina Panthers</option>
1140
+ <option>New Orleans Saints</option>
1141
+ <option>Tampa Bay Buccaneers</option>
1142
+ </optgroup>
1143
+ <optgroup label="NFC WEST">
1144
+ <option>Arizona Cardinals</option>
1145
+ <option>St. Louis Rams</option>
1146
+ <option>San Francisco 49ers</option>
1147
+ <option>Seattle Seahawks</option>
1148
+ </optgroup>
1149
+ <optgroup label="AFC EAST">
1150
+ <option>Buffalo Bills</option>
1151
+ <option>Miami Dolphins</option>
1152
+ <option>New England Patriots</option>
1153
+ <option>New York Jets</option>
1154
+ </optgroup>
1155
+ <optgroup label="AFC NORTH">
1156
+ <option>Baltimore Ravens</option>
1157
+ <option>Cincinnati Bengals</option>
1158
+ <option>Cleveland Browns</option>
1159
+ <option>Pittsburgh Steelers</option>
1160
+ </optgroup>
1161
+ <optgroup label="AFC SOUTH">
1162
+ <option>Houston Texans</option>
1163
+ <option>Indianapolis Colts</option>
1164
+ <option>Jacksonville Jaguars</option>
1165
+ <option>Tennessee Titans</option>
1166
+ </optgroup>
1167
+ <optgroup label="AFC WEST">
1168
+ <option>Denver Broncos</option>
1169
+ <option>Kansas City Chiefs</option>
1170
+ <option>Oakland Raiders</option>
1171
+ <option>San Diego Chargers</option>
1172
+ </optgroup>
1173
+ </select>
1174
+ </div>
1175
+ </div>
1176
+
1177
+ <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1178
+ <div class="side-by-side clearfix">
1179
+ <p>Chosen automatically highlights selected options and removes disabled options.</p>
1180
+ <div>
1181
+ <em>Single Select</em>
1182
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1183
+ <option value=""></option>
1184
+ <option>American Black Bear</option>
1185
+ <option>Asiatic Black Bear</option>
1186
+ <option>Brown Bear</option>
1187
+ <option>Giant Panda</option>
1188
+ <option selected>Sloth Bear</option>
1189
+ <option disabled>Sun Bear</option>
1190
+ <option>Polar Bear</option>
1191
+ <option disabled>Spectacled Bear</option>
1192
+ </select>
1193
+ </div>
1194
+ <div>
1195
+ <em>Multiple Select</em>
1196
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1197
+ <option value=""></option>
1198
+ <option>American Black Bear</option>
1199
+ <option>Asiatic Black Bear</option>
1200
+ <option>Brown Bear</option>
1201
+ <option>Giant Panda</option>
1202
+ <option selected>Sloth Bear</option>
1203
+ <option disabled>Sun Bear</option>
1204
+ <option selected>Polar Bear</option>
1205
+ <option disabled>Spectacled Bear</option>
1206
+ </select>
1207
+ </div>
1208
+ </div>
1209
+
1210
+ <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1211
+ <div class="side-by-side clearfix">
1212
+ <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1213
+ <pre><code class="language-javascript"> new Chosen($("chosen_select_field"),{disable_search_threshold: 10}); </code></pre>
1214
+ <p></p>
1215
+ <div>
1216
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1217
+ <option value=""></option>
1218
+ <option>American Black Bear</option>
1219
+ <option>Asiatic Black Bear</option>
1220
+ <option>Brown Bear</option>
1221
+ <option>Giant Panda</option>
1222
+ <option selected disabled>Sloth Bear</option>
1223
+ <option disabled>Sun Bear</option>
1224
+ <option selected>Paddington Bear</option>
1225
+ <option selected>Polar Bear</option>
1226
+ <option disabled>Spectacled Bear</option>
1227
+ </select>
1228
+ </div>
1229
+ </div>
1230
+
1231
+ <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1232
+ <div class="side-by-side clearfix">
1233
+ <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1234
+ <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1235
+ <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1236
+ </div>
1237
+
1238
+ <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1239
+ <div class="side-by-side clearfix">
1240
+ <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1241
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{no_results_text: "Oops, nothing found!"}); </code></pre>
1242
+
1243
+ <div>
1244
+ <em>Single Select</em>
1245
+ <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1246
+ <option value=""></option>
1247
+ <option>American Black Bear</option>
1248
+ <option>Asiatic Black Bear</option>
1249
+ <option>Brown Bear</option>
1250
+ <option>Giant Panda</option>
1251
+ <option>Sloth Bear</option>
1252
+ <option>Sun Bear</option>
1253
+ <option>Polar Bear</option>
1254
+ <option>Spectacled Bear</option>
1255
+ </select>
1256
+ </div>
1257
+ <div>
1258
+ <em>Multiple Select</em>
1259
+ <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1260
+ <option value=""></option>
1261
+ <option>American Black Bear</option>
1262
+ <option>Asiatic Black Bear</option>
1263
+ <option>Brown Bear</option>
1264
+ <option>Giant Panda</option>
1265
+ <option>Sloth Bear</option>
1266
+ <option>Sun Bear</option>
1267
+ <option>Polar Bear</option>
1268
+ <option>Spectacled Bear</option>
1269
+ </select>
1270
+ </div>
1271
+ </div>
1272
+
1273
+ <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1274
+ <div class="side-by-side clearfix">
1275
+ <p>You can easily limit how many options the user can select:</p>
1276
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{max_selected_options: 5}); </code></pre>
1277
+ <p>If you try to select another option with limit reached <code>chosen:maxselected</code> event is triggered:</p>
1278
+ <pre><code class="language-javascript">$("chosen_select_field").observe("chosen:maxselected", function(evt) { ... }); </code></pre>
1279
+ </div>
1280
+
1281
+ <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1282
+ <div class="side-by-side clearfix">
1283
+ <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1284
+ <div class="side-by-side clearfix">
1285
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1286
+ <option value=""></option>
1287
+ <option>American Black Bear</option>
1288
+ <option>Asiatic Black Bear</option>
1289
+ <option>Brown Bear</option>
1290
+ <option>Giant Panda</option>
1291
+ <option selected>Sloth Bear</option>
1292
+ <option>Sun Bear</option>
1293
+ <option>Polar Bear</option>
1294
+ <option>Spectacled Bear</option>
1295
+ </select>
1296
+ </div>
1297
+ </div>
1298
+
1299
+ <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1300
+ <div class="side-by-side clearfix">
1301
+ <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1302
+ <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1303
+ <div>
1304
+ <em>Single Right-to-Left Select</em>
1305
+ <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
+ <option value=""></option>
1307
+ <option>American Black Bear</option>
1308
+ <option>Asiatic Black Bear</option>
1309
+ <option>Brown Bear</option>
1310
+ <option>Giant Panda</option>
1311
+ <option selected>Sloth Bear</option>
1312
+ <option>Polar Bear</option>
1313
+ </select>
1314
+ </div>
1315
+ <div>
1316
+ <em>Multiple Right-to-Left Select</em>
1317
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
+ <option value=""></option>
1319
+ <option>American Black Bear</option>
1320
+ <option>Asiatic Black Bear</option>
1321
+ <option>Brown Bear</option>
1322
+ <option>Giant Panda</option>
1323
+ <option selected>Sloth Bear</option>
1324
+ <option selected>Polar Bear</option>
1325
+ </select>
1326
+ </div>
1327
+ </div>
1328
+
1329
+ <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
+ <div class="side-by-side clearfix">
1331
+ <ul>
1332
+ <li>
1333
+ <h3>Observing Form Field Changes</h3>
1334
+ <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
+ <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
+ <p><strong>Note:</strong> Prototype doesn't offer support for triggering standard browser events. <a href="https://github.com/kangax/protolicious/blob/5b56fdafcd7d7662c9d648534225039b2e78e371/event.simulate.js">Event.simulate</a> is required to trigger the change event when using the Prototype version.</p>
1337
+ </li>
1338
+ <li>
1339
+ <h3>Updating Chosen Dynamically</h3>
1340
+ <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1341
+ <pre><code class="language-javascript">Event.fire($("form_field"), "chosen:updated");</code></pre>
1342
+ </li>
1343
+ <li>
1344
+ <h3>Destroying Chosen</h3>
1345
+ <p>To destroy Chosen and revert back to the native select, call <code class="language-javascript">destroy</code> on the Chosen instance:</p>
1346
+ <pre><code class="language-javascript">chosen = new Chosen($("form_field"));
1347
+
1348
+ // ...later
1349
+ chosen.destroy();</code></pre>
1350
+ </li>
1351
+ </ul>
1352
+ </div>
1353
+
1354
+ <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1355
+ <div class="side-by-side clearfix">
1356
+ <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1357
+ <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{width: "95%"}); </code></pre>
1358
+ <div>
1359
+ <em>Single Select</em>
1360
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1361
+ <option value=""></option>
1362
+ <option selected>American Black Bear</option>
1363
+ <option>Asiatic Black Bear</option>
1364
+ <option>Brown Bear</option>
1365
+ <option>Giant Panda</option>
1366
+ <option>Sloth Bear</option>
1367
+ <option>Sun Bear</option>
1368
+ <option>Polar Bear</option>
1369
+ <option>Spectacled Bear</option>
1370
+ </select>
1371
+ </div>
1372
+ <div>
1373
+ <em>Multiple Select</em>
1374
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1375
+ <option value=""></option>
1376
+ <option>American Black Bear</option>
1377
+ <option>Asiatic Black Bear</option>
1378
+ <option>Brown Bear</option>
1379
+ <option selected>Giant Panda</option>
1380
+ <option>Sloth Bear</option>
1381
+ <option>Sun Bear</option>
1382
+ <option>Polar Bear</option>
1383
+ <option>Spectacled Bear</option>
1384
+ </select>
1385
+ </div>
1386
+ </div>
1387
+
1388
+ <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1389
+ <div class="side-by-side clearfix">
1390
+ <p>Use labels just like you would a standard select</p>
1391
+ <p></p>
1392
+ <div>
1393
+ <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1394
+ <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1395
+ <option value=""></option>
1396
+ <option selected>American Black Bear</option>
1397
+ <option>Asiatic Black Bear</option>
1398
+ <option>Brown Bear</option>
1399
+ <option>Giant Panda</option>
1400
+ <option>Sloth Bear</option>
1401
+ <option>Sun Bear</option>
1402
+ <option>Polar Bear</option>
1403
+ <option>Spectacled Bear</option>
1404
+ </select>
1405
+ </div>
1406
+ <div>
1407
+ <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1408
+ <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1409
+ <option value=""></option>
1410
+ <option>American Black Bear</option>
1411
+ <option>Asiatic Black Bear</option>
1412
+ <option>Brown Bear</option>
1413
+ <option selected>Giant Panda</option>
1414
+ <option>Sloth Bear</option>
1415
+ <option>Sun Bear</option>
1416
+ <option>Polar Bear</option>
1417
+ <option>Spectacled Bear</option>
1418
+ </select>
1419
+ </div>
1420
+ </div>
1421
+
1422
+ <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1423
+ <p>Using Chosen is easy as can be.</p>
1424
+ <ol>
1425
+ <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1426
+ <li>Activate the plugin by creating a new instance of Chosen: New Chosen(<em>some_form_field</em>,<em>some_options</em>);</li>
1427
+ <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1428
+ </ol>
1429
+
1430
+ <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1431
+ <ul class="faqs">
1432
+ <li>
1433
+ <h3>Do you have all the available options documented somewhere?</h3>
1434
+ <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1435
+ </li>
1436
+ <li>
1437
+ <h3>Something doesn't work. Can you fix it?</h3>
1438
+ <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1439
+ </li>
1440
+ <li>
1441
+ <h3>What browsers are supported?</h3>
1442
+ <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1443
+ </li>
1444
+ </ul>
1445
+
1446
+ <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
+
1448
+ <ul class="credits">
1449
+ <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
+ <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
+ <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
+ <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
+ </ul>
1454
+
1455
+ <footer>
1456
+ &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
+ </footer>
1458
+
1459
+ </div>
1460
+ </div>
1461
+ <script src="docsupport/prototype-1.7.0.0.js" type="text/javascript"></script>
1462
+ <script src="chosen.proto.js" type="text/javascript"></script>
1463
+ <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
+ <script src="docsupport/init.proto.js" type="text/javascript" charset="utf-8"></script>
1465
+ <div class="oss-bar">
1466
+ <ul>
1467
+ <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1468
+ <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1469
+ </ul>
1470
+ </div>
1471
+ </body>
1472
+ </html>
common/libs/chosen-v1.8.3/options.html ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
+ <link rel="stylesheet" href="docsupport/style.css">
7
+ <link rel="stylesheet" href="docsupport/prism.css">
8
+ <link rel="stylesheet" href="chosen.css">
9
+ <style type="text/css" media="all">
10
+ /* fix rtl for demo */
11
+ .chosen-rtl .chosen-drop { left: -9000px; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <div id="container">
16
+ <div id="content">
17
+ <header>
18
+ <h1>Chosen <small>(<span id="latest-version">v1.8.3</span>)</small></h1>
19
+ </header>
20
+ <p>Chosen has a number of options and attributes that allow you to have full control of your select boxes.</p>
21
+
22
+ <h2><a name="options" class="anchor" href="#options">Options</a></h2>
23
+ <p>The following options are available to pass into Chosen on instantiation.</p>
24
+
25
+ <h3>Example:</h3>
26
+ <pre>
27
+ <code class="language-javascript">$(".my_select_box").chosen({
28
+ disable_search_threshold: 10,
29
+ no_results_text: "Oops, nothing found!",
30
+ width: "95%"
31
+ });</code>
32
+ </pre>
33
+
34
+ <table class="docs-table">
35
+ <tr>
36
+ <th>Option</th><th>Default</th><th>Description</th>
37
+ </tr>
38
+ <tr>
39
+ <td>allow_single_deselect</td>
40
+ <td>false</td>
41
+ <td>When set to <code class="language-javascript">true</code> on a single select, Chosen adds a UI element which selects the first element (if it is blank).</td>
42
+ </tr>
43
+ <tr>
44
+ <td>disable_search</td>
45
+ <td>false</td>
46
+ <td>When set to <code class="language-javascript">true</code>, Chosen will not display the search field (single selects only).</td>
47
+ </tr>
48
+ <tr>
49
+ <td>disable_search_threshold</td>
50
+ <td>0</td>
51
+ <td>Hide the search input on single selects if there are <i>n</i> or fewer options.</td>
52
+ </tr>
53
+ <tr>
54
+ <td>enable_split_word_search</td>
55
+ <td>true</td>
56
+ <td>By default, searching will match on any word within an option tag. Set this option to <code class="language-javascript">false</code> if you want to only match on the entire text of an option tag.</td>
57
+ </tr>
58
+ <tr>
59
+ <td>inherit_select_classes</td>
60
+ <td>false</td>
61
+ <td>When set to <code class="language-javascript">true</code>, Chosen will grab any classes on the original select field and add them to Chosen’s container div.</td>
62
+ </tr>
63
+ <tr>
64
+ <td>max_selected_options</td>
65
+ <td>Infinity</td>
66
+ <td>Limits how many options the user can select. When the limit is reached, the <code class="language-javascript">chosen:maxselected</code> event is triggered.</td>
67
+ </tr>
68
+ <tr>
69
+ <td>no_results_text</td>
70
+ <td>"No results match"</td>
71
+ <td>The text to be displayed when no matching results are found. The current search is shown at the end of the text (<i>e.g.</i>,
72
+ No results match "Bad Search").</td>
73
+ </tr>
74
+ <tr>
75
+ <td>placeholder_text_multiple</td>
76
+ <td>"Select Some Options"</td>
77
+ <td>The text to be displayed as a placeholder when no options are selected for a multiple select.</td>
78
+ </tr>
79
+ <tr>
80
+ <td>placeholder_text_single</td>
81
+ <td>"Select an Option"</td>
82
+ <td>The text to be displayed as a placeholder when no options are selected for a single select.</td>
83
+ </tr>
84
+ <tr>
85
+ <td>search_contains</td>
86
+ <td>false</td>
87
+ <td>By default, Chosen’s search matches starting at the beginning of a word. Setting this option to <code class="language-javascript">true</code> allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.</td>
88
+ </tr>
89
+ <tr>
90
+ <td>group_search</td>
91
+ <td>true</td>
92
+ <td>By default, Chosen will search group labels as well as options, and filter to show all options below matching groups. Set this to <code class="language-javascript">false</code> to search only in the options.</td>
93
+ </tr>
94
+ <tr>
95
+ <td>single_backstroke_delete</td>
96
+ <td>true</td>
97
+ <td>By default, pressing delete/backspace on multiple selects will remove a selected choice. When <code class="language-javascript">false</code>, pressing delete/backspace will highlight the last choice, and a second press deselects it.</td>
98
+ </tr>
99
+ <tr>
100
+ <td>width</td>
101
+ <td>Original select width.</td>
102
+ <td>The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0.</td>
103
+ </tr>
104
+ <tr>
105
+ <td>display_disabled_options</td>
106
+ <td>true</td>
107
+ <td>By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches.</td>
108
+ </tr>
109
+ <tr>
110
+ <td>display_selected_options</td>
111
+ <td>true</td>
112
+ <td>
113
+ <p>By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.</p>
114
+ <p><strong>Note:</strong> this is for multiple selects only. In single selects, the selected result will always be displayed.</p>
115
+ </td>
116
+ </tr>
117
+ <tr>
118
+ <td>include_group_label_in_selected</td>
119
+ <td>false</td>
120
+ <td>
121
+ <p>By default, Chosen only shows the text of a selected option. Setting this option to <code class="language-javascript">true</code> will show the text and group (if any) of the selected option.</p>
122
+ </td>
123
+ </tr>
124
+ <tr>
125
+ <td>max_shown_results</td>
126
+ <td>Infinity</td>
127
+ <td>
128
+ <p>Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options.</p>
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td>case_sensitive_search</td>
133
+ <td>false</td>
134
+ <td>
135
+ <p>By default, Chosen's search is case-insensitive. Setting this option to <code class="language-javascript">true</code> makes the search case-sensitive.</p>
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <td>hide_results_on_select</td>
140
+ <td>true</td>
141
+ <td>
142
+ <p>By default, Chosen's results are hidden after a option is selected. Setting this option to <code class="language-javascript">false</code> will keep the results open after selection. This only applies to multiple selects.</p>
143
+ </td>
144
+ </tr>
145
+ <tr>
146
+ <td>rtl</td>
147
+ <td>false</td>
148
+ <td>
149
+ <p>Chosen supports right-to-left text in select boxes. Set this option to <code class="language-javascript">true</code> to support right-to-left text options.</p>
150
+ <p><strong>Note:</strong> <a href="#classes">the <code class="language-javascript">chosen-rtl</code> class</a> on the select has precedence over this option. However, the classname approach is deprecated and will be removed in future versions of Chosen.</p>
151
+ </td>
152
+ </tr>
153
+ </table>
154
+
155
+ <h2><a name="attributes" class="anchor" href="#attributes">Attributes</a></h2>
156
+ <p>Certain attributes placed on the select tag or its options can be used to configure Chosen.</p>
157
+
158
+ <h3>Example:</h3>
159
+
160
+ <pre>
161
+ <code class="language-markup">&lt;select class="my_select_box" data-placeholder="Select Your Options"&gt;
162
+ &lt;option value="1"&gt;Option 1&lt;/option&gt;
163
+ &lt;option value="2" selected&gt;Option 2&lt;/option&gt;
164
+ &lt;option value="3" disabled&gt;Option 3&lt;/option&gt;
165
+ &lt;/select&gt;</code>
166
+ </pre>
167
+
168
+ <table class="docs-table">
169
+ <tr>
170
+ <th>Attribute</th><th>Description</th>
171
+ </tr>
172
+ <tr>
173
+ <td>data-placeholder</td>
174
+ <td>
175
+ <p>The text to be displayed as a placeholder when no options are selected for a select. Defaults to "Select an Option" for single selects or "Select Some Options" for multiple selects.</p>
176
+ <p><strong>Note:</strong>This attribute overrides anything set in the <code class="language-javascript">placeholder_text_multiple</code> or <code class="language-javascript">placeholder_text_single</code> options.</p>
177
+ </td>
178
+ </tr>
179
+ <tr>
180
+ <td>multiple</td>
181
+ <td>The attribute <code class="language-html">multiple</code> on your select box dictates whether Chosen will render a multiple or single select.</td>
182
+ </tr>
183
+ <tr>
184
+ <td>selected, disabled</td>
185
+ <td>Chosen automatically highlights selected options and disables disabled options.</td>
186
+ </tr>
187
+ </table>
188
+
189
+ <h2><a name="classes" class="anchor" href="#classes">Classes</a></h2>
190
+ <p>Classes placed on the select tag can be used to configure Chosen.</p>
191
+
192
+ <h3>Example:</h3>
193
+
194
+ <pre>
195
+ <code class="language-markup">&lt;select class="my_select_box chosen-rtl"&gt;
196
+ &lt;option value="1"&gt;Option 1&lt;/option&gt;
197
+ &lt;option value="2"&gt;Option 2&lt;/option&gt;
198
+ &lt;option value="3"&gt;Option 3&lt;/option&gt;
199
+ &lt;/select&gt;</code>
200
+ </pre>
201
+
202
+ <table class="docs-table">
203
+ <tr>
204
+ <th>Classname</th>
205
+ <th>Description</th>
206
+ </tr>
207
+ <tr>
208
+ <td>chosen-rtl</td>
209
+ <td>
210
+ <p>Chosen supports right-to-left text in select boxes. Add the class <code class="language-html">chosen-rtl</code> to your select tag to support right-to-left text options.</p>
211
+ <p><strong>Note:</strong> The <code class="language-html">chosen-rtl</code> class will pass through to the Chosen select even when the <code class="language-javascript">inherit_select_classes</code> option is set to <code class="language-javascript">false</code>.</p>
212
+ <p><strong>Note:</strong> This is deprecated in favor of using the <code class="language-javascript">rtl: true</code> option (see the <a href="#options">Options section</a>).</p>
213
+ </td>
214
+ </tr>
215
+ </table>
216
+
217
+ <h2><a name="triggered-events" class="anchor" href="#triggered-events">Triggered Events</a></h2>
218
+ <p>Chosen triggers a number of standard and custom events on the original select field.</p>
219
+
220
+ <h3>Example:</h3>
221
+
222
+ <pre>
223
+ <code class="language-javascript">$('.my_select_box').on('change', function(evt, params) {
224
+ do_something(evt, params);
225
+ });</code>
226
+ </pre>
227
+
228
+ <table class="docs-table">
229
+ <tr>
230
+ <th>Event</th><th>Description</th>
231
+ </tr>
232
+ <tr>
233
+ <td>change</td>
234
+ <td>
235
+ <p>Chosen triggers the standard DOM event whenever a selection is made (it also sends a <code class="language-javascript">selected</code> or <code class="language-javascript">deselected</code> parameter that tells you which option was changed).</p>
236
+ <p><strong>Note:</strong> The selected and deselected parameters are not available for Prototype.</p>
237
+ </td>
238
+ </tr>
239
+ <tr>
240
+ <td>chosen:ready</td>
241
+ <td>Triggered after Chosen has been fully instantiated.</td>
242
+ </tr>
243
+ <tr>
244
+ <td>chosen:maxselected</td>
245
+ <td>Triggered if <code class="language-javascript">max_selected_options</code> is set and that total is broken.</td>
246
+ </tr>
247
+ <tr>
248
+ <td>chosen:showing_dropdown</td>
249
+ <td>Triggered when Chosen’s dropdown is opened.</td>
250
+ </tr>
251
+ <tr>
252
+ <td>chosen:hiding_dropdown</td>
253
+ <td>Triggered when Chosen’s dropdown is closed.</td>
254
+ </tr>
255
+ <tr>
256
+ <td>chosen:no_results</td>
257
+ <td>Triggered when a search returns no matching results.</td>
258
+ </tr>
259
+ </table>
260
+
261
+ <p>
262
+ <strong>Note:</strong> all custom Chosen events (those that begin with <code class="language-javascript">chosen:</code>) also include the <code class="language-javascript">chosen</code> object as a parameter.
263
+ </p>
264
+
265
+ <h2><a name="triggerable-events" class="anchor" href="#triggerable-events">Triggerable Events</a></h2>
266
+ <p>You can trigger several events on the original select field to invoke a behavior in Chosen.</p>
267
+
268
+ <h3>Example:</h3>
269
+
270
+ <pre>
271
+ <code class="language-javascript">// tell Chosen that a select has changed
272
+ $('.my_select_box').trigger('chosen:updated');</code>
273
+ </pre>
274
+
275
+ <table class="docs-table">
276
+ <tr>
277
+ <th>Event</th><th>Description</th>
278
+ </tr>
279
+ <tr>
280
+ <td>chosen:updated</td>
281
+ <td>This event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options).</td>
282
+ </tr>
283
+ <tr>
284
+ <td>chosen:activate</td>
285
+ <td>This is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly.</td>
286
+ </tr>
287
+ <tr>
288
+ <td>chosen:open</td>
289
+ <td>This event activates Chosen and also displays the search results.</td>
290
+ </tr>
291
+ <tr>
292
+ <td>chosen:close</td>
293
+ <td>This event deactivates Chosen and hides the search results.</td>
294
+ </tr>
295
+ </table>
296
+
297
+ <footer>
298
+ &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
299
+ </footer>
300
+
301
+ </div>
302
+ </div>
303
+ <div class="oss-bar">
304
+ <ul>
305
+ <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
306
+ <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
307
+ </ul>
308
+ </div>
309
+ <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
310
+ </body>
311
+ </html>
composer.json CHANGED
@@ -16,7 +16,6 @@
16
  "require": {
17
  "php": ">=5.6.20",
18
  "pimple/pimple": "3.2.3.*",
19
- "publishpress/wordpress-reviews": "^1.1",
20
  "publishpress/wordpress-version-notices": "dev-master"
21
  }
22
  }
16
  "require": {
17
  "php": ">=5.6.20",
18
  "pimple/pimple": "3.2.3.*",
 
19
  "publishpress/wordpress-version-notices": "dev-master"
20
  }
21
  }
framework/lib/formating.php CHANGED
@@ -53,7 +53,7 @@ function ak_admin_error( $message )
53
  {
54
  if ( is_admin() ) {
55
  echo '<div id="error" class="error"><p><strong>' . $message . '</strong></p></div>';
56
- }
57
-
58
- do_action('pp_capabilities_error');
59
  }
53
  {
54
  if ( is_admin() ) {
55
  echo '<div id="error" class="error"><p><strong>' . $message . '</strong></p></div>';
56
+ }
57
+
58
+ do_action('pp_capabilities_error');
59
  }
framework/lib/users.php CHANGED
@@ -85,10 +85,6 @@ function ak_level2caps( $level ) {
85
  * @return int Level found, if no level found, will return 0.
86
  */
87
  function ak_caps2level( $caps ) {
88
- if (!is_array($caps)) {
89
- return 0;
90
- }
91
-
92
  $level = array_reduce( array_keys( $caps ), '_ak_caps2level_CB', 0);
93
  return $level;
94
  }
85
  * @return int Level found, if no level found, will return 0.
86
  */
87
  function ak_caps2level( $caps ) {
 
 
 
 
88
  $level = array_reduce( array_keys( $caps ), '_ak_caps2level_CB', 0);
89
  return $level;
90
  }
includes-core/CoreAdmin.php CHANGED
@@ -30,10 +30,6 @@ class CoreAdmin {
30
  }
31
 
32
  add_action('pp-capabilities-admin-submenus', [$this, 'actCapabilitiesSubmenus']);
33
-
34
- //Editor feature metaboxes promo
35
- add_action('pp_capabilities_features_gutenberg_after_table_tr', [$this, 'metaboxesPromo']);
36
- add_action('pp_capabilities_features_classic_after_table_tr', [$this, 'metaboxesPromo']);
37
  }
38
 
39
  function setUpgradeMenuLink() {
@@ -67,9 +63,4 @@ class CoreAdmin {
67
  wp_enqueue_style('pp-capabilities-admin-core', plugin_dir_url(CME_FILE) . 'includes-core/admin-core.css', [], PUBLISHPRESS_CAPS_VERSION, 'all');
68
  include (dirname(__FILE__) . '/nav-menus-promo.php');
69
  }
70
-
71
- function metaboxesPromo(){
72
- wp_enqueue_style('pp-capabilities-admin-core', plugin_dir_url(CME_FILE) . 'includes-core/admin-core.css', [], PUBLISHPRESS_CAPS_VERSION, 'all');
73
- include (dirname(__FILE__) . '/editor-features-promo.php');
74
- }
75
  }
30
  }
31
 
32
  add_action('pp-capabilities-admin-submenus', [$this, 'actCapabilitiesSubmenus']);
 
 
 
 
33
  }
34
 
35
  function setUpgradeMenuLink() {
63
  wp_enqueue_style('pp-capabilities-admin-core', plugin_dir_url(CME_FILE) . 'includes-core/admin-core.css', [], PUBLISHPRESS_CAPS_VERSION, 'all');
64
  include (dirname(__FILE__) . '/nav-menus-promo.php');
65
  }
 
 
 
 
 
66
  }
includes-core/admin-core.css CHANGED
@@ -95,61 +95,6 @@ div.pp-capability-menus-wrapper-promo select.ppc-nav-menu-role {
95
  height: 370px;
96
  }
97
 
98
- tr.pp-promo-blur {
99
- filter: blur(1.5px);
100
- }
101
-
102
- .pp-promo-overlay-row input[type=checkbox], input[type=radio] {
103
- cursor: not-allowed !important;
104
- }
105
-
106
- .pp-promo-overlay-row .ppc-custom-features-delete {
107
- color: red;
108
- }
109
-
110
- .pp-promo-overlay-row .pp-promo-upgrade-notice {
111
- position: absolute;
112
- margin-top: -100px;
113
- left: calc(50% - 225px);
114
- text-align: center;
115
- background: #655897;
116
- padding: 20px 20px 35px;
117
- border-radius: 6px;
118
- width: 450px;
119
- box-sizing: border-box;
120
- box-shadow: 0 0 25px #ccc;
121
- z-index: 999;
122
- }
123
-
124
- .pp-promo-overlay-row .pp-promo-upgrade-notice p {
125
- line-height: 1.4em;
126
- font-size: 16px;
127
- margin-bottom: 20px !important;
128
- margin-top: 0 !important;
129
- color: #fff;
130
- padding: 0;
131
- }
132
-
133
- .pp-promo-overlay-row .pp-promo-upgrade-notice p:last-of-type {
134
- margin-bottom: 0 !important;
135
- }
136
-
137
- .pp-promo-overlay-row .pp-promo-upgrade-notice a {
138
- font-size: 17px;
139
- background: #FCB223;
140
- color: #000;
141
- font-weight: normal;
142
- text-decoration: none;
143
- padding: 9px 12px;
144
- -webkit-border-radius: 4px;
145
- -moz-border-radius: 4px;
146
- border-radius: 4px;
147
- box-sizing: border-box;
148
- border: 1px solid #fca871;
149
- break-inside: avoid;
150
- white-space: nowrap;
151
- }
152
-
153
  @media (max-width: 979px) {
154
 
155
  #pp-capability-menu-wrapper div.pp-capability-menus-promo .pp-capability-menus-promo-inner img.pp-capability-mobile {
@@ -169,12 +114,4 @@ filter: blur(1.5px);
169
  padding: 20px 20px 35px;
170
  width: 300px;
171
  }
172
-
173
- .pp-promo-overlay-row .pp-promo-upgrade-notice {
174
- left: 0;
175
- padding: 20px 20px 35px;
176
- width: fit-content;
177
- margin-left: 10px;
178
- margin-right: 10px;
179
- }
180
  }
95
  height: 370px;
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  @media (max-width: 979px) {
99
 
100
  #pp-capability-menu-wrapper div.pp-capability-menus-promo .pp-capability-menus-promo-inner img.pp-capability-mobile {
114
  padding: 20px 20px 35px;
115
  width: 300px;
116
  }
 
 
 
 
 
 
 
 
117
  }
includes-core/editor-features-promo.php DELETED
@@ -1,147 +0,0 @@
1
- <?php
2
- /**
3
- * Capability Manager Editor Features Promo.
4
- *
5
- * Copyright 2020, PublishPress <help@publishpress.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * version 2 as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- */
19
-
20
- ?>
21
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
22
-
23
- <td colspan="3">
24
- <h4 class="ppc-menu-row-section"><?php _e('Metaboxes', 'capsman-enhanced'); ?></h4>
25
- </td>
26
- </tr>
27
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
28
-
29
- <td class="menu-column ppc-menu-item">
30
-
31
- <span class="gutenberg menu-item-link">
32
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Checklist', 'capsman-enhanced'); ?> </strong></span>
33
- </td>
34
-
35
- <td class="restrict-column ppc-menu-checkbox">
36
- <input type="checkbox">
37
- </td>
38
- <td class="restrict-column ppc-menu-checkbox">
39
- <input type="checkbox">
40
- </td>
41
- </tr>
42
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
43
- <td class="menu-column ppc-menu-item">
44
- <span class="gutenberg menu-item-link restricted">
45
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Editorial Comments', 'capsman-enhanced'); ?></strong></span>
46
- </td>
47
-
48
- <td class="restrict-column ppc-menu-checkbox">
49
- <input type="checkbox">
50
- </td>
51
- <td class="restrict-column ppc-menu-checkbox">
52
- <input type="checkbox">
53
- </td>
54
- </tr>
55
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
56
- <td class="menu-column ppc-menu-item">
57
- <span class="gutenberg menu-item-link">
58
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Notifications', 'capsman-enhanced'); ?></strong></span>
59
- </td>
60
-
61
- <td class="restrict-column ppc-menu-checkbox">
62
- <input type="checkbox">
63
- </td>
64
- <td class="restrict-column ppc-menu-checkbox">
65
- <input type="checkbox">
66
- </td>
67
- </tr>
68
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
69
- <td class="menu-column ppc-menu-item">
70
- <span class="gutenberg menu-item-link">
71
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('TaxoPress - Settings', 'capsman-enhanced'); ?></strong></span>
72
- </td>
73
-
74
- <td class="restrict-column ppc-menu-checkbox">
75
- <input type="checkbox">
76
- </td>
77
- <td class="restrict-column ppc-menu-checkbox">
78
- <input type="checkbox">
79
- </td>
80
- </tr>
81
-
82
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row">
83
- <td colspan="3">
84
- <div class="pp-promo-upgrade-notice">
85
- <p>
86
- <?php _e('You can hide plugin metaboxes. You can also hide specific items by entering their CSS class or ID. This feature is available in PublishPress Capabilities Pro.',
87
- 'capsman-enhanced'); ?>
88
- </p>
89
- <p>
90
- <a href="https://publishpress.com/links/capabilities-banner" target="_blank">
91
- <?php _e('Upgrade to Pro', 'capsman-enhanced'); ?>
92
- </a>
93
- </p>
94
- </div>
95
- </td>
96
- </tr>
97
-
98
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
99
-
100
- <td colspan="3">
101
- <h4 class="ppc-menu-row-section"><?php _e('Custom Items', 'capsman-enhanced'); ?></h4>
102
- </td>
103
- </tr>
104
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
105
- <td class="menu-column ppc-menu-item">
106
- <span class="gutenberg menu-item-link">
107
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Custom item one', 'capsman-enhanced'); ?> <small>(.custom-plugin-item, #custom-plugin-item)</small> &nbsp; <span
108
- class="ppc-custom-features-delete"><small>(<?php _e('Delete', 'capsman-enhanced'); ?>)</small></span></strong></span>
109
- </td>
110
-
111
- <td class="restrict-column ppc-menu-checkbox">
112
- <input type="checkbox">
113
- </td>
114
- <td class="restrict-column ppc-menu-checkbox">
115
- <input type="checkbox">
116
- </td>
117
- </tr>
118
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
119
- <td class="menu-column ppc-menu-item">
120
- <span class="gutenberg menu-item-link restricted">
121
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Permalink: Descriptive Caption', 'capsman-enhanced'); ?> <small>(.editor-post-link p)</small> &nbsp; <span
122
- class="ppc-custom-features-delete"><small>(<?php _e('Delete', 'capsman-enhanced'); ?>)</small></span> </strong></span>
123
- </td>
124
-
125
- <td class="restrict-column ppc-menu-checkbox">
126
- <input type="checkbox">
127
- </td>
128
- <td class="restrict-column ppc-menu-checkbox">
129
- <input type="checkbox">
130
- </td>
131
- </tr>
132
- <tr class="ppc-menu-row parent-menu pp-promo-overlay-row pp-promo-blur">
133
- <td class="menu-column ppc-menu-item">
134
- <span class="gutenberg menu-item-link">
135
- <strong><i class="dashicons dashicons-arrow-right"></i> <?php _e('Page Attributes: Order', 'capsman-enhanced'); ?> <small>(.editor-page-attributes__order)</small> &nbsp; <span class="ppc-custom-features-delete"><small>(<?php _e('Delete', 'capsman-enhanced'); ?>)</small></span> </strong></span>
136
- </td>
137
-
138
- <td class="restrict-column ppc-menu-checkbox">
139
- <input type="checkbox">
140
- </td>
141
- <td class="restrict-column ppc-menu-checkbox">
142
- <input type="checkbox">
143
- </td>
144
- </tr>
145
-
146
-
147
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes-core/pp-capabilities-permissions.php DELETED
@@ -1,445 +0,0 @@
1
- <?php
2
- /**
3
- * Original Author: danieliser
4
- * Original Author URL: https://danieliser.com
5
- */
6
-
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit;
9
- }
10
-
11
- /**
12
- * Class Ppc_Install_Permissions
13
- *
14
- * This class adds a message inviting to install Permissions
15
- */
16
- if( !class_exists('Ppc_Install_Permissions') ) {
17
- class Ppc_Install_Permissions {
18
-
19
- /**
20
- * Tracking API Endpoint.
21
- *
22
- * @var string
23
- */
24
- public static $api_url = '';
25
-
26
- /**
27
- *
28
- */
29
- public static function init() {
30
- if (!isset( $_GET['pp-after-click'])) {
31
- self::hooks();
32
-
33
- add_action( 'wp_ajax_ppc_permissions_action', array( __CLASS__, 'ajax_handler' ) );
34
- }
35
- }
36
-
37
- /**
38
- * Hook into relevant WP actions.
39
- */
40
- public static function hooks() {
41
- if ( is_admin() && current_user_can( 'edit_posts' ) ) {
42
- self::installed_on();
43
- add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
44
- add_action( 'network_admin_notices', array( __CLASS__, 'admin_notices' ) );
45
- add_action( 'user_admin_notices', array( __CLASS__, 'admin_notices' ) );
46
- }
47
- }
48
-
49
- /**
50
- * Get the install date for comparisons. Sets the date to now if none is found.
51
- *
52
- * @return false|string
53
- */
54
- public static function installed_on() {
55
- $installed_on = get_option( 'ppc_permissions_installed_on', false );
56
-
57
- if ( ! $installed_on ) {
58
- $installed_on = current_time( 'mysql' );
59
- update_option( 'ppc_permissions_installed_on', $installed_on );
60
- }
61
-
62
- return $installed_on;
63
- }
64
-
65
- /**
66
- *
67
- */
68
- public static function ajax_handler() {
69
- $args = wp_parse_args( $_REQUEST, array(
70
- 'group' => self::get_trigger_group(),
71
- 'code' => self::get_trigger_code(),
72
- 'pri' => self::get_current_trigger( 'pri' ),
73
- 'reason' => 'maybe_later',
74
- ) );
75
-
76
- if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'ppc_permissions_action' ) ) {
77
- wp_send_json_error();
78
- }
79
-
80
- try {
81
- $user_id = get_current_user_id();
82
-
83
- $dismissed_triggers = self::dismissed_triggers();
84
- $dismissed_triggers[ $args['group'] ] = $args['pri'];
85
- update_user_meta( $user_id, '_ppc_permissions_dismissed_triggers', $dismissed_triggers );
86
- update_user_meta( $user_id, '_ppc_permissions_last_dismissed', current_time( 'mysql' ) );
87
-
88
- switch ( $args['reason'] ) {
89
- case 'maybe_later':
90
- update_user_meta( $user_id, '_ppc_permissions_last_dismissed', current_time( 'mysql' ) );
91
- break;
92
- case 'am_now':
93
- case 'already_did':
94
- self::already_did( true );
95
- break;
96
- }
97
-
98
- wp_send_json_success();
99
-
100
- } catch ( Exception $e ) {
101
- wp_send_json_error( $e );
102
- }
103
- }
104
-
105
- /**
106
- * @return int|string
107
- */
108
- public static function get_trigger_group() {
109
- static $selected;
110
-
111
- if ( ! isset( $selected ) ) {
112
-
113
- $dismissed_triggers = self::dismissed_triggers();
114
-
115
- $triggers = self::triggers();
116
-
117
- foreach ( $triggers as $g => $group ) {
118
- foreach ( $group['triggers'] as $t => $trigger ) {
119
- if ( ! in_array( false, $trigger['conditions'] ) && ( empty( $dismissed_triggers[ $g ] ) || $dismissed_triggers[ $g ] < $trigger['pri'] ) ) {
120
- $selected = $g;
121
- break;
122
- }
123
- }
124
-
125
- if ( isset( $selected ) ) {
126
- break;
127
- }
128
- }
129
- }
130
-
131
- return $selected;
132
- }
133
-
134
- /**
135
- * @return int|string
136
- */
137
- public static function get_trigger_code() {
138
- static $selected;
139
-
140
- if ( ! isset( $selected ) ) {
141
-
142
- $dismissed_triggers = self::dismissed_triggers();
143
-
144
- foreach ( self::triggers() as $g => $group ) {
145
- foreach ( $group['triggers'] as $t => $trigger ) {
146
- if ( ! in_array( false, $trigger['conditions'] ) && ( empty( $dismissed_triggers[ $g ] ) || $dismissed_triggers[ $g ] < $trigger['pri'] ) ) {
147
- $selected = $t;
148
- break;
149
- }
150
- }
151
-
152
- if ( isset( $selected ) ) {
153
- break;
154
- }
155
- }
156
- }
157
-
158
- return $selected;
159
- }
160
-
161
- /**
162
- * @param null $key
163
- *
164
- * @return bool|mixed|void
165
- */
166
- public static function get_current_trigger( $key = null ) {
167
- $group = self::get_trigger_group();
168
- $code = self::get_trigger_code();
169
-
170
- if ( ! $group || ! $code ) {
171
- return false;
172
- }
173
-
174
- $trigger = self::triggers( $group, $code );
175
-
176
- if(empty($key)){
177
- $return = $trigger;
178
- }elseif(isset($trigger[$key])){
179
- $return = $trigger[$key];
180
- }else {
181
- $return = false;
182
- }
183
-
184
- return $return;
185
- }
186
-
187
- /**
188
- * Returns an array of dismissed trigger groups.
189
- *
190
- * Array contains the group key and highest priority trigger that has been shown previously for each group.
191
- *
192
- * $return = array(
193
- * 'group1' => 20
194
- * );
195
- *
196
- * @return array|mixed
197
- */
198
- public static function dismissed_triggers() {
199
- $user_id = get_current_user_id();
200
-
201
- $dismissed_triggers = get_user_meta( $user_id, '_ppc_permissions_dismissed_triggers', true );
202
-
203
- if ( ! $dismissed_triggers ) {
204
- $dismissed_triggers = array();
205
- }
206
-
207
- return $dismissed_triggers;
208
- }
209
-
210
- /**
211
- * Returns true if the user has opted to never see this again. Or sets the option.
212
- *
213
- * @param bool $set If set this will mark the user as having opted to never see this again.
214
- *
215
- * @return bool
216
- */
217
- public static function already_did( $set = false ) {
218
- $user_id = get_current_user_id();
219
-
220
- if ( $set ) {
221
- update_user_meta( $user_id, '_ppc_permissions_already_did', true );
222
-
223
- return true;
224
- }
225
-
226
- return (bool) get_user_meta( $user_id, '_ppc_permissions_already_did', true );
227
- }
228
-
229
- /**
230
- * Gets a list of triggers.
231
- *
232
- * @param null $group
233
- * @param null $code
234
- *
235
- * @return bool|mixed|void
236
- */
237
- public static function triggers( $group = null, $code = null ) {
238
- static $triggers;
239
-
240
- if ( ! isset( $triggers ) ) {
241
-
242
- $time_message = __( 'Do you want to control permissions for specific posts and pages?', 'capsman-enhanced' );
243
-
244
- $triggers = apply_filters( 'ppc_permissions_triggers', array(
245
- 'time_installed' => array(
246
- 'triggers' => array(
247
- 'one_week' => array(
248
- 'message' => sprintf( $time_message, __( '1 week', 'capsman-enhanced' ) ),
249
- 'conditions' => array(
250
- strtotime( self::installed_on() . ' +1 week' ) < time(),
251
- ),
252
- 'link' => admin_url( 'plugin-install.php?s=publishpress+permissions+control+access&tab=search&type=term&pp-after-click' ),
253
- 'pri' => 10,
254
- ),
255
- ),
256
- 'pri' => 10,
257
- ),
258
- ) );
259
-
260
- // Sort Groups
261
- uasort( $triggers, array( __CLASS__, 'rsort_by_priority' ) );
262
-
263
- // Sort each groups triggers.
264
- foreach ( $triggers as $k => $v ) {
265
- uasort( $triggers[ $k ]['triggers'], array( __CLASS__, 'rsort_by_priority' ) );
266
- }
267
- }
268
-
269
- if ( isset( $group ) ) {
270
- if ( ! isset( $triggers[ $group ] ) ) {
271
- return false;
272
- }
273
-
274
- if (!isset($code)) {
275
- $return = $triggers[$group];
276
- } elseif (isset($triggers[$group]['triggers'][$code])) {
277
- $return = $triggers[$group]['triggers'][$code];
278
- } else {
279
- $return = false;
280
- }
281
-
282
- return $return;
283
- }
284
-
285
- return $triggers;
286
- }
287
-
288
- /**
289
- * Render admin notices if available.
290
- */
291
- public static function admin_notices() {
292
- if ( self::hide_notices() ) {
293
- return;
294
- }
295
-
296
- $group = self::get_trigger_group();
297
- $code = self::get_trigger_code();
298
- $pri = self::get_current_trigger( 'pri' );
299
- $tigger = self::get_current_trigger();
300
-
301
- // Used to anonymously distinguish unique site+user combinations in terms of effectiveness of each trigger.
302
- $uuid = wp_hash( home_url() . '-' . get_current_user_id() );
303
-
304
- ?>
305
-
306
- <script type="text/javascript">
307
- (function ($) {
308
- var trigger = {
309
- group: '<?php echo $group; ?>',
310
- code: '<?php echo $code; ?>',
311
- pri: '<?php echo $pri; ?>'
312
- };
313
-
314
- function dismiss(reason) {
315
- $.ajax({
316
- method: "POST",
317
- dataType: "json",
318
- url: ajaxurl,
319
- data: {
320
- action: 'ppc_permissions_action',
321
- nonce: '<?php echo wp_create_nonce( 'ppc_permissions_action' ); ?>',
322
- group: trigger.group,
323
- code: trigger.code,
324
- pri: trigger.pri,
325
- reason: reason
326
- }
327
- });
328
-
329
- <?php if ( ! empty( self::$api_url ) ) : ?>
330
- $.ajax({
331
- method: "POST",
332
- dataType: "json",
333
- url: '<?php echo self::$api_url; ?>',
334
- data: {
335
- trigger_group: trigger.group,
336
- trigger_code: trigger.code,
337
- reason: reason,
338
- uuid: '<?php echo $uuid; ?>'
339
- }
340
- });
341
- <?php endif; ?>
342
- }
343
-
344
- $(document)
345
- .on('click', '.ppc-notice .ppc-dismiss', function (event) {
346
- var $this = $(this),
347
- reason = $this.data('reason'),
348
- notice = $this.parents('.ppc-notice');
349
-
350
- notice.fadeTo(100, 0, function () {
351
- notice.slideUp(100, function () {
352
- notice.remove();
353
- });
354
- });
355
-
356
- dismiss(reason);
357
- })
358
- .ready(function () {
359
- setTimeout(function () {
360
- $('.ppc-notice button.notice-dismiss').click(function (event) {
361
- dismiss('maybe_later');
362
- });
363
- }, 1000);
364
- });
365
- }(jQuery));
366
- </script>
367
-
368
- <div class="notice notice-success is-dismissible ppc-notice">
369
-
370
- <p>
371
- <?php echo $tigger['message']; ?>
372
- </p>
373
- <p>
374
- <a class="button button-primary ppc-dismiss" target="_blank" href="<?php echo admin_url( 'plugin-install.php?s=publishpress+permissions+control+access&tab=search&type=term&pp-after-click' ) ?>" data-reason="am_now">
375
- <strong><?php _e( 'Install PublishPress Permissions', 'capsman-enhanced' ); ?></strong>
376
- </a>
377
- </p>
378
-
379
- </div>
380
-
381
- <?php
382
- }
383
-
384
- /**
385
- * Checks if notices should be shown.
386
- *
387
- * @return bool
388
- */
389
- public static function hide_notices() {
390
- $conditions = array(
391
- self::already_did(),
392
- self::last_dismissed() && strtotime( self::last_dismissed() . ' +2 weeks' ) > time(),
393
- empty( self::get_trigger_code() ),
394
- );
395
-
396
- return in_array( true, $conditions );
397
- }
398
-
399
- /**
400
- * Gets the last dismissed date.
401
- *
402
- * @return false|string
403
- */
404
- public static function last_dismissed() {
405
- $user_id = get_current_user_id();
406
-
407
- return get_user_meta( $user_id, '_ppc_permissions_last_dismissed', true );
408
- }
409
-
410
- /**
411
- * Sort array by priority value
412
- *
413
- * @param $a
414
- * @param $b
415
- *
416
- * @return int
417
- */
418
- public static function sort_by_priority( $a, $b ) {
419
- if ( ! isset( $a['pri'] ) || ! isset( $b['pri'] ) || $a['pri'] === $b['pri'] ) {
420
- return 0;
421
- }
422
-
423
- return ( $a['pri'] < $b['pri'] ) ? - 1 : 1;
424
- }
425
-
426
- /**
427
- * Sort array in reverse by priority value
428
- *
429
- * @param $a
430
- * @param $b
431
- *
432
- * @return int
433
- */
434
- public static function rsort_by_priority( $a, $b ) {
435
- if ( ! isset( $a['pri'] ) || ! isset( $b['pri'] ) || $a['pri'] === $b['pri'] ) {
436
- return 0;
437
- }
438
-
439
- return ( $a['pri'] < $b['pri'] ) ? 1 : - 1;
440
- }
441
-
442
- }
443
-
444
- Ppc_Install_Permissions::init();
445
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin-load.php DELETED
@@ -1,310 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * PublishPress Capabilities [Free]
5
- *
6
- * Admin execution controller: menu registration and other filters and actions that need to be loaded for every wp-admin URL
7
- *
8
- * This module should not include full functions related to our own plugin screens.
9
- * Instead, use these filter and action handlers to load other classes when needed.
10
- *
11
- */
12
- class PP_Capabilities_Admin_UI {
13
- function __construct() {
14
- global $pagenow;
15
-
16
- /**
17
- * The class responsible for handling notifications
18
- */
19
- require_once (dirname(CME_FILE) . '/classes/pp-capabilities-notices.php');
20
-
21
- add_action('init', [$this, 'featureRestrictionsGutenberg']);
22
-
23
- if (is_admin()) {
24
- add_action('admin_init', [$this, 'featureRestrictionsClassic']);
25
- }
26
-
27
- add_action('admin_enqueue_scripts', [$this, 'adminScripts'], 100);
28
- add_action('admin_print_scripts', [$this, 'adminPrintScripts']);
29
-
30
- add_action('profile_update', [$this, 'action_profile_update'], 10, 2);
31
-
32
- if (is_multisite()) {
33
- add_action('add_user_to_blog', [$this, 'action_profile_update'], 9);
34
- } else {
35
- add_action('user_register', [$this, 'action_profile_update'], 9);
36
- }
37
-
38
- if (is_admin() && (isset($_REQUEST['page']) && (in_array($_REQUEST['page'], ['pp-capabilities', 'pp-capabilities-backup', 'pp-capabilities-roles', 'pp-capabilities-admin-menus', 'pp-capabilities-editor-features', 'pp-capabilities-nav-menus', 'pp-capabilities-settings', 'pp-capabilities-admin-features']))
39
-
40
- || (!empty($_REQUEST['action']) && in_array($_REQUEST['action'], ['pp-roles-add-role', 'pp-roles-delete-role', 'pp-roles-hide-role', 'pp-roles-unhide-role']))
41
- || ( ! empty($_SERVER['SCRIPT_NAME']) && strpos( $_SERVER['SCRIPT_NAME'], 'p-admin/plugins.php' ) && ! empty($_REQUEST['action'] ) )
42
- || ( isset($_GET['action']) && 'reset-defaults' == $_GET['action'] )
43
- || in_array( $pagenow, array( 'users.php', 'user-edit.php', 'profile.php', 'user-new.php' ) )
44
- ) ) {
45
- global $capsman;
46
-
47
- // Run the plugin
48
- require_once ( dirname(CME_FILE) . '/framework/lib/formating.php' );
49
- require_once ( dirname(CME_FILE) . '/framework/lib/users.php' );
50
-
51
- require_once ( dirname(CME_FILE) . '/includes/manager.php' );
52
- $capsman = new CapabilityManager();
53
- } else {
54
- add_action( 'admin_menu', [$this, 'cmeSubmenus'], 20 );
55
- }
56
-
57
- add_action('init', function() { // late execution avoids clash with autoloaders in other plugins
58
- global $pagenow;
59
-
60
- if ((($pagenow == 'admin.php') && isset($_GET['page']) && in_array($_GET['page'], ['pp-capabilities', 'pp-capabilities-roles', 'pp-capabilities-backup'])) // @todo: CSS for button alignment in Editor Features, Admin Features
61
- || (defined('DOING_AJAX') && DOING_AJAX && (false !== strpos($_REQUEST['action'], 'capability-manager-enhanced')))
62
- ) {
63
- if (!class_exists('\PublishPress\WordPressReviews\ReviewsController')) {
64
- include_once PUBLISHPRESS_CAPS_ABSPATH . '/vendor/publishpress/wordpress-reviews/ReviewsController.php';
65
- }
66
-
67
- if (class_exists('\PublishPress\WordPressReviews\ReviewsController')) {
68
- $reviews = new \PublishPress\WordPressReviews\ReviewsController(
69
- 'capability-manager-enhanced',
70
- 'PublishPress Capabilities',
71
- plugin_dir_url(CME_FILE) . 'common/img/capabilities-wp-logo.png'
72
- );
73
-
74
- add_filter('publishpress_wp_reviews_display_banner_capability-manager-enhanced', [$this, 'shouldDisplayBanner']);
75
-
76
- $reviews->init();
77
- }
78
- }
79
- });
80
- }
81
-
82
- public function shouldDisplayBanner() {
83
- global $pagenow;
84
-
85
- return ($pagenow == 'admin.php') && isset($_GET['page']) && in_array($_GET['page'], ['pp-capabilities', 'pp-capabilities-roles', 'pp-capabilities-backup']);
86
- }
87
-
88
- private function applyFeatureRestrictions($editor = 'gutenberg') {
89
- global $pagenow;
90
-
91
- // Return if not a post editor request
92
- if (!in_array($pagenow, ['post.php', 'post-new.php'])) {
93
- return;
94
- }
95
-
96
- static $def_post_types; // avoid redundant filter application
97
-
98
- if (!isset($def_post_types)) {
99
- //$def_post_types = apply_filters('pp_capabilities_feature_post_types', get_post_types(['public' => true]));
100
- $def_post_types = apply_filters('pp_capabilities_feature_post_types', ['post', 'page']);
101
- }
102
-
103
- $post_type = pp_capabilities_get_post_type();
104
-
105
- // Return if not a supported post type
106
- if (!in_array($post_type, $def_post_types)) {
107
- return;
108
- }
109
-
110
- switch ($editor) {
111
- case 'gutenberg':
112
- if (_pp_capabilities_is_block_editor_active()) {
113
- require_once ( dirname(CME_FILE) . '/includes/features/restrict-editor-features.php' );
114
- PP_Capabilities_Post_Features::applyRestrictions($post_type);
115
- }
116
-
117
- break;
118
-
119
- case 'classic':
120
- if (!_pp_capabilities_is_block_editor_active()) {
121
- require_once ( dirname(CME_FILE) . '/includes/features/restrict-editor-features.php' );
122
- PP_Capabilities_Post_Features::adminInitClassic($post_type);
123
- }
124
- }
125
- }
126
-
127
- function featureRestrictionsGutenberg() {
128
- $this->applyFeatureRestrictions();
129
- }
130
-
131
- function featureRestrictionsClassic() {
132
- $this->applyFeatureRestrictions('classic');
133
- }
134
-
135
- function adminScripts() {
136
- global $publishpress;
137
-
138
- if (function_exists('get_current_screen') && (!defined('PUBLISHPRESS_VERSION') || empty($publishpress) || empty($publishpress->modules) || empty($publishpress->modules->roles))) {
139
- $screen = get_current_screen();
140
-
141
- if ('user-edit' === $screen->base || ('user' === $screen->base && 'add' === $screen->action && defined('PP_CAPABILITIES_ADD_USER_MULTI_ROLES'))) {
142
- // Check if we are on the user's profile page
143
- wp_enqueue_script(
144
- 'pp-capabilities-chosen-js',
145
- plugin_dir_url(CME_FILE) . 'common/libs/chosen-v1.8.3/chosen.jquery.js',
146
- ['jquery'],
147
- CAPSMAN_VERSION
148
- );
149
-
150
- wp_enqueue_script(
151
- 'pp-capabilities-roles-profile-js',
152
- plugin_dir_url(CME_FILE) . 'common/js/profile.js',
153
- ['jquery', 'pp-capabilities-chosen-js'],
154
- CAPSMAN_VERSION
155
- );
156
-
157
- wp_enqueue_style(
158
- 'pp-capabilities-chosen-css',
159
- plugin_dir_url(CME_FILE) . 'common/libs/chosen-v1.8.3/chosen.css',
160
- false,
161
- CAPSMAN_VERSION
162
- );
163
- wp_enqueue_style(
164
- 'pp-capabilities-roles-profile-css',
165
- plugin_dir_url(CME_FILE) . 'common/css/profile.css',
166
- ['pp-capabilities-chosen-css'],
167
- CAPSMAN_VERSION
168
- );
169
-
170
- $roles = !empty($_GET['user_id']) ?$this->getUsersRoles($_GET['user_id']) : [];
171
-
172
- if (empty($roles)) {
173
- $roles = (array) get_option('default_role');
174
- }
175
-
176
- wp_localize_script(
177
- 'pp-capabilities-roles-profile-js',
178
- 'ppCapabilitiesProfileData',
179
- [
180
- 'selected_roles' => $roles
181
- ]
182
- );
183
- }
184
- }
185
- }
186
-
187
- function adminPrintScripts() {
188
- // Counteract overzealous menu icon styling in PublishPress <= 3.2.0 :)
189
- if (defined('PUBLISHPRESS_VERSION') && version_compare(constant('PUBLISHPRESS_VERSION'), '3.2.0', '<=') && defined('PP_CAPABILITIES_FIX_ADMIN_ICON')):?>
190
- <style type="text/css">
191
- #toplevel_page_pp-capabilities .dashicons-before::before, #toplevel_page_pp-capabilities .wp-has-current-submenu .dashicons-before::before {
192
- background-image: inherit !important;
193
- content: "\f112" !important;
194
- }
195
- </style>
196
- <?php endif;
197
- }
198
-
199
- /**
200
- * Returns a list of roles with name and display name to populate a select field.
201
- *
202
- * @param int $userId
203
- *
204
- * @return array
205
- */
206
- protected function getUsersRoles($userId)
207
- {
208
- if (empty($userId)) {
209
- return [];
210
- }
211
-
212
- $user = get_user_by('id', $userId);
213
-
214
- if (empty($user)) {
215
- return [];
216
- }
217
-
218
- return $user->roles;
219
- }
220
-
221
- public function action_profile_update($userId, $oldUserData = [])
222
- {
223
- // Check if we need to update the user's roles, allowing to set multiple roles.
224
- if (isset($_POST['pp_roles']) && current_user_can('promote_users')) {
225
- // Remove the user's roles
226
- $user = get_user_by('ID', $userId);
227
-
228
- $newRoles = $_POST['pp_roles'];
229
- $currentRoles = $user->roles;
230
-
231
- if (empty($newRoles) || !is_array($newRoles)) {
232
- return;
233
- }
234
-
235
- // Remove unselected roles
236
- foreach ($currentRoles as $role) {
237
- // Check if it is a bbPress rule. If so, don't remove it.
238
- $isBBPressRole = preg_match('/^bbp_/', $role);
239
-
240
- if (!in_array($role, $newRoles) && !$isBBPressRole) {
241
- $user->remove_role($role);
242
- }
243
- }
244
-
245
- // Add new roles
246
- foreach ($newRoles as $role) {
247
- if (!in_array($role, $currentRoles)) {
248
- $user->add_role($role);
249
- }
250
- }
251
- }
252
- }
253
-
254
-
255
- // perf enhancement: display submenu links without loading framework and plugin code
256
- function cmeSubmenus() {
257
- // First we check if user is administrator and can 'manage_capabilities'.
258
- if (current_user_can('administrator') && ! current_user_can('manage_capabilities')) {
259
- if ($admin = get_role('administrator')) {
260
- $admin->add_cap('manage_capabilities');
261
- }
262
- }
263
-
264
- $cap_name = (is_multisite() && is_super_admin()) ? 'read' : 'manage_capabilities';
265
-
266
- $permissions_title = __('Capabilities', 'capsman-enhanced');
267
-
268
- $menu_order = 72;
269
-
270
- if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
271
- foreach ((array)get_option('active_plugins') as $plugin_file) {
272
- if ( false !== strpos($plugin_file, 'publishpress.php') ) {
273
- $menu_order = 27;
274
- }
275
- }
276
- }
277
-
278
- add_menu_page(
279
- $permissions_title,
280
- $permissions_title,
281
- $cap_name,
282
- 'pp-capabilities',
283
- 'cme_fakefunc',
284
- 'dashicons-admin-network',
285
- $menu_order
286
- );
287
-
288
- add_submenu_page('pp-capabilities', __('Roles', 'capsman-enhanced'), __('Roles', 'capsman-enhanced'), $cap_name, 'pp-capabilities-roles', 'cme_fakefunc');
289
- add_submenu_page('pp-capabilities', __('Editor Features', 'capsman-enhanced'), __('Editor Features', 'capsman-enhanced'), $cap_name, 'pp-capabilities-editor-features', 'cme_fakefunc');
290
- add_submenu_page('pp-capabilities', __('Admin Features', 'capsman-enhanced'), __('Admin Features', 'capsman-enhanced'), $cap_name, 'pp-capabilities-admin-features', 'cme_fakefunc');
291
- add_submenu_page('pp-capabilities', __('Admin Menus', 'capsman-enhanced'), __('Admin Menus', 'capsman-enhanced'), $cap_name, 'pp-capabilities-admin-menus', 'cme_fakefunc');
292
- add_submenu_page('pp-capabilities', __('Nav Menus', 'capsman-enhanced'), __('Nav Menus', 'capsman-enhanced'), $cap_name, 'pp-capabilities-nav-menus', 'cme_fakefunc');
293
- add_submenu_page('pp-capabilities', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'pp-capabilities-backup', 'cme_fakefunc');
294
-
295
- if (defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
296
- add_submenu_page('pp-capabilities', __('Settings', 'capsman-enhanced'), __('Settings', 'capsman-enhanced'), $cap_name, 'pp-capabilities-settings', 'cme_fakefunc');
297
- }
298
-
299
- if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
300
- add_submenu_page(
301
- 'pp-capabilities',
302
- __('Upgrade to Pro', 'capsman-enhanced'),
303
- __('Upgrade to Pro', 'capsman-enhanced'),
304
- 'manage_capabilities',
305
- 'capsman-enhanced',
306
- 'cme_fakefunc'
307
- );
308
- }
309
- }
310
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin.php CHANGED
@@ -1,1342 +1,1184 @@
1
- <?php
2
- /**
3
- * PublishPress Capabilities [Free]
4
- *
5
- * UI output for Capabilities screen.
6
- *
7
- * Provides admin pages to create and manage roles and capabilities.
8
- *
9
- * @author Jordi Canals, Kevin Behrens
10
- * @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
11
- * @license GNU General Public License version 2
12
- * @link https://publishpress.com
13
- *
14
- * Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
- * Modifications Copyright 2020, PublishPress <help@publishpress.com>
16
- *
17
- * This program is free software; you can redistribute it and/or
18
- * modify it under the terms of the GNU General Public License
19
- * version 2 as published by the Free Software Foundation.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- * GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
- **/
29
-
30
- global $capsman, $cme_cap_helper, $current_user;
31
-
32
- do_action('publishpress-caps_manager-load');
33
-
34
- $roles = $this->roles;
35
- $default = $this->current;
36
-
37
- if ( $block_read_removal = _cme_is_read_removal_blocked( $this->current ) ) {
38
- if ( $current = get_role($default) ) {
39
- if ( empty( $current->capabilities['read'] ) ) {
40
- ak_admin_error( sprintf( __( 'Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s.', 'capsman-enhanced' ), '<a href="javascript:void(0)" class="cme-fix-read-cap">', '</a>' ) );
41
- }
42
- }
43
- }
44
-
45
- require_once (dirname(CME_FILE) . '/includes/roles/roles-functions.php');
46
-
47
- require_once( dirname(__FILE__).'/pp-ui.php' );
48
- $pp_ui = new Capsman_PP_UI();
49
-
50
- if( defined('PRESSPERMIT_ACTIVE') ) {
51
- $pp_metagroup_caps = $pp_ui->get_metagroup_caps( $default );
52
- } else {
53
- $pp_metagroup_caps = array();
54
- }
55
- ?>
56
- <div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
57
- <?php /*if( defined('PRESSPERMIT_ACTIVE') ) :
58
- pp_icon();
59
- $style = 'style="height:60px;"';
60
- */
61
- ?>
62
- <?php /* else: */
63
- $style = '';
64
- ?>
65
- <div id="icon-capsman-admin" class="icon32"></div>
66
- <?php /* endif; */ ?>
67
-
68
- <h1 <?php echo $style;?>><?php _e('Role Capabilities', 'capsman-enhanced') ?></h1>
69
-
70
- <?php
71
- echo pp_capabilities_roles()->notify->display();
72
- ?>
73
-
74
- <script type="text/javascript">
75
- /* <![CDATA[ */
76
- jQuery(document).ready( function($) {
77
- $('#publishpress_caps_form').attr('action', 'admin.php?page=pp-capabilities&role=' + $('select[name="role"]').val());
78
-
79
- $('select[name="role"]').change(function(){
80
- window.location = '<?php echo admin_url('admin.php?page=pp-capabilities&role='); ?>' + $(this).val() + '';
81
- });
82
- });
83
- /* ]]> */
84
- </script>
85
-
86
- <form id="publishpress_caps_form" method="post" action="admin.php?page=<?php echo $this->ID ?>">
87
- <?php wp_nonce_field('capsman-general-manager'); ?>
88
-
89
- <?php
90
- $tab = (!empty($_REQUEST['pp_caps_tab'])) ? sanitize_key($_REQUEST['pp_caps_tab']) : 'edit';
91
- ?>
92
-
93
- <input type="hidden" name="pp_caps_tab" value="<?php echo $tab;?>" />
94
-
95
- <p>
96
- <select name="role">
97
- <?php
98
- foreach ( $roles as $role => $name ) {
99
- if (pp_capabilities_is_editable_role($role)) {
100
- $name = translate_user_role($name);
101
- echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' &nbsp;</option>';
102
- }
103
- }
104
- ?>
105
- </select>
106
- </p>
107
-
108
- <fieldset>
109
- <table id="akmin">
110
- <tr>
111
- <td class="content">
112
-
113
- <div style="float:right">
114
- <input type="submit" name="SaveRole" value="<?php echo (in_array(get_locale(), ['en_EN', 'en_US'])) ? 'Save Capabilities' : _e('Save Changes', 'capsman-enhanced'); ?>" class="button-primary" />
115
- </div>
116
-
117
- <?php
118
- global $capsman;
119
- $img_url = $capsman->mod_url . '/images/';
120
- ?>
121
- <div class="publishpress-headline" style="margin-bottom:20px;">
122
- <span class="cme-subtext">
123
- <?php
124
- $msg = __( '<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation.', 'capsman-enhanced' );
125
-
126
- if (defined('PRESSPERMIT_ACTIVE') && function_exists('presspermit')) {
127
- if ($group = presspermit()->groups()->getMetagroup('wp_role', $this->current)) {
128
- $msg = sprintf(
129
- __('<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s.', 'capsman-enhanced'),
130
- '<a href="' . admin_url("admin.php?page=presspermit-edit-permissions&action=edit&agent_id={$group->ID}") . '">',
131
- '</a>'
132
- );
133
- }
134
- }
135
- echo $msg;
136
- ?>
137
- </span>
138
- </div>
139
-
140
- <?php
141
- if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
142
- $pp_ui->show_capability_hints( $default );
143
- }
144
-
145
- if ( MULTISITE ) {
146
- global $wp_roles;
147
- global $wpdb;
148
-
149
- if ( ! empty($_REQUEST['cme_net_sync_role'] ) ) {
150
- $main_site_id = (function_exists('get_main_site_id')) ? get_main_site_id() : 1;
151
- switch_to_blog($main_site_id);
152
- wp_cache_delete( $wpdb->prefix . 'user_roles', 'options' );
153
- }
154
-
155
- ( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
156
- }
157
- $capsman->reinstate_db_roles();
158
-
159
- $current = get_role($default);
160
-
161
- $rcaps = $current->capabilities;
162
-
163
- $is_administrator = current_user_can( 'administrator' ) || (is_multisite() && is_super_admin());
164
-
165
- $custom_types = get_post_types( array( '_builtin' => false ), 'names' );
166
- $custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
167
-
168
- $defined = [];
169
- $defined['type'] = apply_filters('cme_filterable_post_types', get_post_types(['public' => true, 'show_ui' => true], 'object', 'or'));
170
- $defined['taxonomy'] = apply_filters('cme_filterable_taxonomies', get_taxonomies(['public' => true, 'show_ui' => true], 'object', 'or'));
171
-
172
- // bbPress' dynamic role def requires additional code to enforce stored caps
173
- $unfiltered['type'] = apply_filters('presspermit_unfiltered_post_types', ['forum','topic','reply','wp_block']);
174
- $unfiltered['type'] = (defined('PP_CAPABILITIES_NO_LEGACY_FILTERS')) ? $unfiltered['type'] : apply_filters('pp_unfiltered_post_types', $unfiltered['type']);
175
-
176
- $unfiltered['taxonomy'] = apply_filters('presspermit_unfiltered_post_types', ['post_status', 'topic-tag']); // avoid confusion with Edit Flow administrative taxonomy
177
- $unfiltered['taxonomy'] = (defined('PP_CAPABILITIES_NO_LEGACY_FILTERS')) ? $unfiltered['taxonomy'] : apply_filters('pp_unfiltered_taxonomies', $unfiltered['taxonomy']);
178
-
179
- $enabled_taxonomies = cme_get_assisted_taxonomies();
180
-
181
- /*
182
- if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
183
- $cap_properties[''] = array();
184
- $force_distinct_ui = true;
185
- }
186
- */
187
-
188
- $cap_properties['edit']['type'] = array( 'edit_posts' );
189
-
190
- foreach( $defined['type'] as $type_obj ) {
191
- if ( 'attachment' != $type_obj->name ) {
192
- if ( isset( $type_obj->cap->create_posts ) && ( $type_obj->cap->create_posts != $type_obj->cap->edit_posts ) ) {
193
- $cap_properties['edit']['type'][]= 'create_posts';
194
- break;
195
- }
196
- }
197
- }
198
-
199
- $cap_properties['edit']['type'][]= 'edit_others_posts';
200
- $cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
201
-
202
- $cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
203
-
204
- if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
205
- $cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
206
-
207
- $cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
208
- $cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
209
-
210
- if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
211
- $cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
212
- else
213
- $cap_properties['delete']['taxonomy'] = array();
214
-
215
- $cap_properties['read']['type'] = array( 'read_private_posts' );
216
- $cap_properties['read']['taxonomy'] = array();
217
-
218
- $stati = get_post_stati( array( 'internal' => false ) );
219
-
220
- $cap_type_names = array(
221
- '' => __( '&nbsp;', 'capsman-enhanced' ),
222
- 'read' => __( 'Reading', 'capsman-enhanced' ),
223
- 'edit' => __( 'Editing', 'capsman-enhanced' ),
224
- 'delete' => __( 'Deletion', 'capsman-enhanced' )
225
- );
226
-
227
- $cap_tips = array(
228
- 'read_private' => __( 'can read posts which are currently published with private visibility', 'capsman-enhanced' ),
229
- 'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
230
- 'edit_others' => __( 'can edit posts which were created by other users', 'capsman-enhanced' ),
231
- 'edit_published' => __( 'can edit posts which are currently published', 'capsman-enhanced' ),
232
- 'edit_private' => __( 'can edit posts which are currently published with private visibility', 'capsman-enhanced' ),
233
- 'publish' => __( 'can make a post publicly visible', 'capsman-enhanced' ),
234
- 'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
235
- 'delete_others' => __( 'can delete posts which were created by other users', 'capsman-enhanced' ),
236
- 'delete_published' => __( 'can delete posts which are currently published', 'capsman-enhanced' ),
237
- 'delete_private' => __( 'can delete posts which are currently published with private visibility', 'capsman-enhanced' ),
238
- );
239
-
240
- $default_caps = array( 'read_private_posts', 'edit_posts', 'edit_others_posts', 'edit_published_posts', 'edit_private_posts', 'publish_posts', 'delete_posts', 'delete_others_posts', 'delete_published_posts', 'delete_private_posts',
241
- 'read_private_pages', 'edit_pages', 'edit_others_pages', 'edit_published_pages', 'edit_private_pages', 'publish_pages', 'delete_pages', 'delete_others_pages', 'delete_published_pages', 'delete_private_pages',
242
- 'manage_categories'
243
- );
244
- $type_caps = array();
245
- $type_metacaps = array();
246
-
247
- // Role Scoper and PP1 adjust attachment access based only on user's capabilities for the parent post
248
- if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
249
- unset( $defined['type']['attachment'] );
250
- }
251
- ?>
252
-
253
- <script type="text/javascript">
254
- /* <![CDATA[ */
255
- jQuery(document).ready( function($) {
256
- // Tabs and Content display
257
- $('.ppc-capabilities-tabs > ul > li').click( function() {
258
- var $tab = $(this).attr('data-content');
259
- //console.log( $tab );
260
-
261
- $("[name='pp_caps_tab']").val($(this).attr('data-slug'));
262
-
263
- // Show current Content
264
- $('.ppc-capabilities-content > div').hide();
265
- $('#' + $tab).show();
266
-
267
- $('#' + $tab + '-taxonomy').show();
268
-
269
- // Active current Tab
270
- $('.ppc-capabilities-tabs > ul > li').removeClass('ppc-capabilities-tab-active');
271
- $(this).addClass('ppc-capabilities-tab-active');
272
- });
273
- });
274
- /* ]]> */
275
- </script>
276
-
277
- <div id="ppc-capabilities-wrapper" class="postbox">
278
- <div class="ppc-capabilities-tabs">
279
- <ul>
280
- <?php
281
- $active_tab_slug = (!empty($_REQUEST['pp_caps_tab'])) ? sanitize_key($_REQUEST['pp_caps_tab']) : 'edit';
282
- $active_tab_id = "cme-cap-type-tables-{$active_tab_slug}";
283
-
284
- $ppc_tab_active = ' class="ppc-capabilities-tab-active"';
285
-
286
- // caps: edit, delete, read
287
- foreach( array_keys($cap_properties) as $cap_type ) {
288
- $tab_id = "cme-cap-type-tables-$cap_type";
289
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
290
-
291
- echo '<li data-slug="'. $cap_type . '"' . ' data-content="cme-cap-type-tables-' . $cap_type . '"' . $tab_active . '>'
292
- . $cap_type_names[$cap_type] .
293
- '</li>';
294
- }
295
-
296
- if ($extra_tabs = apply_filters('pp_capabilities_extra_post_capability_tabs', [])) {
297
- foreach($extra_tabs as $tab_slug => $tab_caption) {
298
- $tab_id = "cme-cap-type-tables-{$tab_slug}";
299
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
300
-
301
- echo '<li data-slug="' . $tab_slug . '"' . ' data-content="' . $tab_id . '"' . $tab_active . '>'
302
- . $tab_caption .
303
- '</li>';
304
- }
305
- }
306
-
307
- // caps: other
308
- $tab_id = "cme-cap-type-tables-other";
309
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
310
- $tab_caption = __( 'WordPress Core', 'capsman-enhanced' );
311
-
312
- echo '<li data-slug="other" data-content="' . $tab_id . '"' . $tab_active . '>' . $tab_caption . '</li>';
313
-
314
- // caps: plugins
315
- $plugin_caps = [];
316
- if (defined('PUBLISHPRESS_VERSION')) {
317
- $plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
318
- array(
319
- 'edit_metadata',
320
- 'edit_post_subscriptions',
321
- 'pp_manage_roles',
322
- 'pp_set_notification_channel',
323
- 'pp_view_calendar',
324
- 'pp_view_content_overview',
325
- )
326
- );
327
- }
328
-
329
- if (defined('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION')) {
330
- if ($_caps = apply_filters('cme_multiple_authors_capabilities', array())) {
331
- $plugin_caps['PublishPress Authors'] = $_caps;
332
- }
333
- }
334
-
335
- if (defined('PRESSPERMIT_VERSION')) {
336
- $plugin_caps['PublishPress Permissions'] = apply_filters('cme_presspermit_capabilities',
337
- array(
338
- 'edit_own_attachments',
339
- 'list_others_unattached_files',
340
- 'pp_administer_content',
341
- 'pp_assign_roles',
342
- 'pp_associate_any_page',
343
- 'pp_create_groups',
344
- 'pp_create_network_groups',
345
- 'pp_define_moderation',
346
- 'pp_define_post_status',
347
- 'pp_define_privacy',
348
- 'pp_delete_groups',
349
- 'pp_edit_groups',
350
- 'pp_exempt_edit_circle',
351
- 'pp_exempt_read_circle',
352
- 'pp_force_quick_edit',
353
- 'pp_list_all_files',
354
- 'pp_manage_capabilities',
355
- 'pp_manage_members',
356
- 'pp_manage_network_members',
357
- 'pp_manage_settings',
358
- 'pp_moderate_any',
359
- 'pp_set_associate_exceptions',
360
- 'pp_set_edit_exceptions',
361
- 'pp_set_read_exceptions',
362
- 'pp_set_revise_exceptions',
363
- 'pp_set_term_assign_exceptions',
364
- 'pp_set_term_associate_exceptions',
365
- 'pp_set_term_manage_exceptions',
366
- 'pp_unfiltered',
367
- 'set_posts_status',
368
- )
369
- );
370
- }
371
-
372
- if (defined('WC_PLUGIN_FILE')) {
373
- $plugin_caps['WooCommerce'] = apply_filters('cme_woocommerce_capabilities',
374
- array(
375
- 'assign_product_terms',
376
- 'assign_shop_coupon_terms',
377
- 'assign_shop_discount_terms',
378
- 'assign_shop_order_terms',
379
- 'assign_shop_payment_terms',
380
- 'create_shop_orders',
381
- 'delete_others_products',
382
- 'delete_others_shop_coupons',
383
- 'delete_others_shop_discounts',
384
- 'delete_others_shop_orders',
385
- 'delete_others_shop_payments',
386
- 'delete_private_products',
387
- 'delete_private_shop_coupons',
388
- 'delete_private_shop_orders',
389
- 'delete_private_shop_discounts',
390
- 'delete_private_shop_payments',
391
- 'delete_product_terms',
392
- 'delete_products',
393
- 'delete_published_products',
394
- 'delete_published_shop_coupons',
395
- 'delete_published_shop_discounts',
396
- 'delete_published_shop_orders',
397
- 'delete_published_shop_payments',
398
- 'delete_shop_coupons',
399
- 'delete_shop_coupon_terms',
400
- 'delete_shop_discount_terms',
401
- 'delete_shop_discounts',
402
- 'delete_shop_order_terms',
403
- 'delete_shop_orders',
404
- 'delete_shop_payments',
405
- 'delete_shop_payment_terms',
406
- 'edit_others_products',
407
- 'edit_others_shop_coupons',
408
- 'edit_others_shop_discounts',
409
- 'edit_others_shop_orders',
410
- 'edit_others_shop_payments',
411
- 'edit_private_products',
412
- 'edit_private_shop_coupons',
413
- 'edit_private_shop_discounts',
414
- 'edit_private_shop_orders',
415
- 'edit_private_shop_payments',
416
- 'edit_product_terms',
417
- 'edit_products',
418
- 'edit_published_products',
419
- 'edit_published_shop_coupons',
420
- 'edit_published_shop_discounts',
421
- 'edit_published_shop_orders',
422
- 'edit_published_shop_payments',
423
- 'edit_shop_coupon_terms',
424
- 'edit_shop_coupons',
425
- 'edit_shop_discounts',
426
- 'edit_shop_discount_terms',
427
- 'edit_shop_order_terms',
428
- 'edit_shop_orders',
429
- 'edit_shop_payments',
430
- 'edit_shop_payment_terms',
431
- 'export_shop_payments',
432
- 'export_shop_reports',
433
- 'import_shop_discounts',
434
- 'import_shop_payments',
435
- 'manage_product_terms',
436
- 'manage_shop_coupon_terms',
437
- 'manage_shop_discounts',
438
- 'manage_shop_discount_terms',
439
- 'manage_shop_payment_terms',
440
- 'manage_shop_order_terms',
441
- 'manage_shop_settings',
442
- 'manage_woocommerce',
443
- 'publish_products',
444
- 'publish_shop_coupons',
445
- 'publish_shop_discounts',
446
- 'publish_shop_orders',
447
- 'publish_shop_payments',
448
- 'read_private_products',
449
- 'read_private_shop_coupons',
450
- 'read_private_shop_discounts',
451
- 'read_private_shop_payments',
452
- 'read_private_shop_orders',
453
- 'view_admin_dashboard',
454
- 'view_shop_discount_stats',
455
- 'view_shop_payment_stats',
456
- 'view_shop_reports',
457
- 'view_shop_sensitive_data',
458
- 'view_woocommerce_reports',
459
- )
460
- );
461
- }
462
- $plugin_caps = apply_filters('cme_plugin_capabilities', $plugin_caps);
463
- foreach($plugin_caps as $plugin => $__plugin_caps) {
464
- $_plugin_caps = array_fill_keys($__plugin_caps, true);
465
-
466
- $tab_slug = str_replace(' ', '-', strtolower($plugin));
467
- $tab_id = 'cme-cap-type-tables-' . $tab_slug;
468
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
469
-
470
- echo '<li data-slug="' . $tab_slug . '" data-content="' . $tab_id .'"' . $tab_active . '>'
471
- . str_replace('_', ' ', $plugin ) .
472
- '</li>';
473
- }
474
-
475
- $tab_id = "cme-cap-type-tables-invalid";
476
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
477
- $tab_caption = __( 'Invalid Capabilities', 'capsman-enhanced' );
478
- echo '<li id="cme_tab_invalid_caps" data-slug="invalid" data-content="cme-cap-type-tables-' . $tab_id . '"' . $tab_active . ' style="display:none;">' . $tab_caption . '</li>';
479
-
480
- $tab_id = "cme-cap-type-tables-additional";
481
- $tab_active = ($tab_id == $active_tab_id) ? $ppc_tab_active : '';
482
- $tab_caption = __( 'Additional', 'capsman-enhanced' );
483
- echo '<li data-slug="additional" data-content="' . $tab_id . '"' . $tab_active . '>' . $tab_caption . '</li>';
484
- ?>
485
- </ul>
486
- </div>
487
- <div class="ppc-capabilities-content">
488
- <?php
489
- // caps: read, edit, deletion
490
- foreach( array_keys($cap_properties) as $cap_type ) {
491
-
492
- foreach( array_keys($defined) as $item_type ) {
493
- if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
494
- if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
495
- continue;
496
- }
497
-
498
- $any_term_deletion_caps = false;
499
- foreach( array_keys($defined['taxonomy']) as $_tax ) {
500
- if ( isset( $defined['taxonomy'][$_tax]->cap->delete_terms ) && ( 'manage_categories' != $defined['taxonomy'][$_tax]->cap->delete_terms ) && ! in_array( $_tax, $unfiltered['taxonomy'] ) ) {
501
- $any_term_deletion_caps = true;
502
- break;
503
- }
504
- }
505
-
506
- if ( ! $any_term_deletion_caps )
507
- continue;
508
- }
509
-
510
- if ( ! count( $cap_properties[$cap_type][$item_type] ) )
511
- continue;
512
-
513
- $id = "cme-cap-type-tables-$cap_type";
514
- $div_display = ($id == $active_tab_id) ? 'block' : 'none';
515
-
516
- $any_caps = false;
517
-
518
- if ($item_type == 'taxonomy') {
519
- $id .= '-taxonomy';
520
-
521
- ob_start();
522
- }
523
-
524
- echo "<div id='$id' style='display:$div_display;'>";
525
-
526
- $caption_pattern = ('taxonomy' == $item_type) ? __('Term %s Capabilities', 'capability-manager-enhanced') : __('Post %s Capabilities', 'capability-manager-enhanced');
527
-
528
- echo '<h3>' . sprintf($caption_pattern, $cap_type_names[$cap_type]) . '</h3>';
529
- echo "<table class='widefat fixed striped cme-typecaps cme-typecaps-$cap_type'>";
530
-
531
- echo '<thead><tr><th></th>';
532
-
533
- // label cap properties
534
- foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
535
- $prop = str_replace( '_posts', '', $prop );
536
- $prop = str_replace( '_pages', '', $prop );
537
- $prop = str_replace( '_terms', '', $prop );
538
- $tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
539
- $prop = str_replace( '_', '<br />', $prop );
540
- $th_class = ( 'taxonomy' == $item_type ) ? ' class="term-cap"' : ' class="post-cap"';
541
- echo "<th style='text-align:center;' $tip{$th_class}>";
542
-
543
- if ( ( 'delete' != $prop ) || ( 'taxonomy' != $item_type ) || cme_get_detailed_taxonomies() ) {
544
- echo ucwords($prop);
545
- }
546
-
547
- echo '</th>';
548
- }
549
-
550
- echo '</tr></thead>';
551
-
552
- foreach( $defined[$item_type] as $key => $type_obj ) {
553
- if ( in_array( $key, $unfiltered[$item_type] ) )
554
- continue;
555
-
556
- $row = "<tr class='cme_type_{$key}'>";
557
-
558
- if ( $cap_type ) {
559
- if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
560
- continue;
561
-
562
- $type_label = (defined('CME_LEGACY_MENU_NAME_LABEL') && !empty($type_obj->labels->menu_name)) ? $type_obj->labels->menu_name : $type_obj->labels->name;
563
-
564
- $row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_label . '</a>';
565
- $row .= '<a href="#" class="neg-type-caps">&nbsp;x&nbsp;</a>';
566
- $row .= '</td>';
567
-
568
- $display_row = ! empty($force_distinct_ui);
569
- $col_count = 0;
570
-
571
- foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
572
- $td_classes = array();
573
- $checkbox = '';
574
- $title = '';
575
-
576
- if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
577
- || ! in_array( $type_obj->cap->$prop, $default_caps )
578
- || ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
579
-
580
- // if edit_published or edit_private cap is same as edit_posts cap, don't display a checkbox for it
581
- if ( ( ! in_array( $prop, array( 'edit_published_posts', 'edit_private_posts', 'create_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->edit_posts ) )
582
- && ( ! in_array( $prop, array( 'delete_published_posts', 'delete_private_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->delete_posts ) )
583
- && ( ! in_array( $prop, array( 'edit_terms', 'delete_terms' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->manage_terms ) )
584
-
585
- && ( ! in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
586
- || empty($cme_cap_helper->all_taxonomy_caps[$type_obj->cap->$prop])
587
- || ( $cme_cap_helper->all_taxonomy_caps[ $type_obj->cap->$prop ] <= 1 )
588
- || $type_obj->cap->$prop == str_replace( '_terms', "_{$type_obj->name}s", $prop )
589
- || $type_obj->cap->$prop == str_replace( '_terms', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
590
- )
591
-
592
- && ( in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
593
- || empty($cme_cap_helper->all_type_caps[$type_obj->cap->$prop])
594
- || ( $cme_cap_helper->all_type_caps[ $type_obj->cap->$prop ] <= 1 )
595
- || $type_obj->cap->$prop == 'upload_files' && 'create_posts' == $prop && 'attachment' == $type_obj->name
596
- || $type_obj->cap->$prop == str_replace( '_posts', "_{$type_obj->name}s", $prop )
597
- || $type_obj->cap->$prop == str_replace( '_pages', "_{$type_obj->name}s", $prop )
598
- || $type_obj->cap->$prop == str_replace( '_posts', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
599
- || $type_obj->cap->$prop == str_replace( '_pages', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
600
- )
601
- ) {
602
- // only present these term caps up top if we are ensuring that they get enforced separately from manage_terms
603
- if ( in_array( $prop, array( 'edit_terms', 'delete_terms', 'assign_terms' ) ) && ( ! in_array( $type_obj->name, cme_get_detailed_taxonomies() ) || defined( 'OLD_PRESSPERMIT_ACTIVE' ) ) ) {
604
- continue;
605
- }
606
-
607
- $cap_name = $type_obj->cap->$prop;
608
-
609
- if ( 'taxonomy' == $item_type )
610
- $td_classes []= "term-cap";
611
- else
612
- $td_classes []= "post-cap";
613
-
614
- if ( ! empty($pp_metagroup_caps[$cap_name]) )
615
- $td_classes []='cm-has-via-pp';
616
-
617
- if ( $is_administrator || current_user_can($cap_name) ) {
618
- if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
619
- $title = ' title="' . sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name ) . '"';
620
- } else {
621
- $title = ' title="' . $cap_name . '"';
622
- }
623
-
624
- $disabled = '';
625
- $checked = checked(1, ! empty($rcaps[$cap_name]), false );
626
-
627
- $checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" autocomplete="off" value="1" ' . $checked . $disabled . ' />';
628
-
629
- $type_caps [$cap_name] = true;
630
- $display_row = true;
631
- $any_caps = true;
632
- }
633
- } else {
634
- //$td_classes []= "cap-unreg";
635
- $title = 'title="' . sprintf( __( 'shared capability: %s', 'capsman-enhanced' ), esc_attr( $type_obj->cap->$prop ) ) . '"';
636
- }
637
-
638
- if ( isset($rcaps[$cap_name]) && empty($rcaps[$cap_name]) ) {
639
- $td_classes []= "cap-neg";
640
- }
641
- } else {
642
- $td_classes []= "cap-unreg";
643
- }
644
-
645
- $td_class = ( $td_classes ) ? 'class="' . implode(' ', $td_classes) . '"' : '';
646
-
647
- $row .= "<td $td_class $title><span class='cap-x'>X</span>$checkbox";
648
-
649
- if ( false !== strpos( $td_class, 'cap-neg' ) )
650
- $row .= '<input type="hidden" class="cme-negation-input" name="caps[' . $cap_name . ']" value="" />';
651
-
652
- $row .= "</td>";
653
-
654
- $col_count++;
655
- }
656
-
657
- if ('taxonomy' == $item_type) {
658
- for ($i = $col_count; $i < 3; $i++) {
659
- $row .= "<td></td>";
660
- }
661
- }
662
-
663
- if (!empty($type_obj->map_meta_cap) && !defined('PP_CAPABILITIES_NO_INVALID_SECTION')) {
664
- if ('type' == $item_type) {
665
- $type_metacaps[$type_obj->cap->read_post] = true;
666
- $type_metacaps[$type_obj->cap->edit_post] = isset($type_obj->cap->edit_posts) && ($type_obj->cap->edit_post != $type_obj->cap->edit_posts);
667
- $type_metacaps[$type_obj->cap->delete_post] = isset($type_obj->cap->delete_posts) && ($type_obj->cap->delete_post != $type_obj->cap->delete_posts);
668
-
669
- } elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
670
- $type_metacaps[$type_obj->cap->edit_term] = true;
671
- $type_metacaps[$type_obj->cap->delete_term] = true;
672
- }
673
- }
674
- }
675
-
676
- if ( $display_row ) {
677
- $row .= '</tr>';
678
- echo $row;
679
- }
680
- }
681
-
682
- echo '</table>';
683
- echo '</div>';
684
-
685
- if ($item_type == 'taxonomy') {
686
- if ($any_caps) {
687
- ob_flush();
688
- } else {
689
- ob_clean();
690
- }
691
- }
692
-
693
- } // end foreach item type
694
- }
695
-
696
- if (empty($caps_manager_postcaps_section)) {
697
- $caps_manager_postcaps_section = '';
698
- }
699
-
700
- do_action('publishpress-caps_manager_postcaps_section', compact('current', 'rcaps', 'pp_metagroup_caps', 'is_administrator', 'default_caps', 'custom_types', 'defined', 'unfiltered', 'pp_metagroup_caps','caps_manager_postcaps_section', 'active_tab_id'));
701
-
702
- $type_caps = apply_filters('publishpress_caps_manager_typecaps', $type_caps);
703
-
704
- // clicking on post type name toggles corresponding checkbox selections
705
- // caps: other
706
-
707
- $id = "cme-cap-type-tables-other";
708
- $div_display = ($id == $active_tab_id) ? 'block' : 'none';
709
- ?>
710
- <div id="<?php echo $id;?>" style="display:<?php echo $div_display;?>">
711
- <?php
712
-
713
- echo '<h3>' . __( 'WordPress Core Capabilities', 'capsman-enhanced' ) . '</h3>';
714
- echo '<table class="widefat fixed striped form-table cme-checklist"><tr>';
715
-
716
- $checks_per_row = get_option( 'cme_form-rows', 1 );
717
- $i = 0; $first_row = true;
718
-
719
- $core_caps = _cme_core_caps();
720
- foreach( array_keys($core_caps) as $cap_name ) {
721
- if ( ! $is_administrator && ! current_user_can($cap_name) )
722
- continue;
723
-
724
- if ( $i == $checks_per_row ) {
725
- echo '</tr><tr>';
726
- $i = 0;
727
- }
728
-
729
- if ( ! isset( $rcaps[$cap_name] ) )
730
- $class = 'cap-no';
731
- else
732
- $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
733
-
734
- if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
735
- $class .= ' cap-metagroup';
736
- $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
737
- } else {
738
- $title_text = $cap_name;
739
- }
740
-
741
- $disabled = '';
742
- $checked = checked(1, ! empty($rcaps[$cap_name]), false );
743
- $lock_capability = false;
744
- $title = $title_text;
745
-
746
- if ( 'read' == $cap_name ) {
747
- if ( ! empty( $block_read_removal ) ) {
748
- // prevent the read capability from being removed from a core role, but don't force it to be added
749
- if ( $checked || apply_filters( 'pp_caps_force_capability_storage', false, 'read', $default ) ) {
750
- if ( apply_filters( 'pp_caps_lock_capability', true, 'read', $default ) ) {
751
- $lock_capability = true;
752
- $class .= ' cap-locked';
753
- $disabled = 'disabled="disabled"';
754
- if ( 'administrator' != $this->current ) {
755
- $title = esc_attr( __('Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add "dashboard_lockout_ok" capability', 'capsman-enhanced' ) );
756
- }
757
- }
758
- }
759
- }
760
- }
761
-
762
- ?>
763
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
764
- <span>
765
- <?php
766
- echo str_replace( '_', ' ', $cap_name );
767
- ?>
768
- </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
769
- <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
770
- <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
771
- <?php endif; ?>
772
- </td>
773
-
774
- <?php
775
-
776
- if ( $lock_capability ) {
777
- echo '<input type="hidden" name="caps[' . $cap_name . ']" value="1" />';
778
- }
779
-
780
- ++$i;
781
- }
782
-
783
- if ( $i == $checks_per_row ) {
784
- echo '</tr>';
785
- $i = 0;
786
- } elseif ( ! $first_row ) {
787
- // Now close a wellformed table
788
- for ( $i; $i < $checks_per_row; $i++ ){
789
- echo '<td>&nbsp;</td>';
790
- }
791
- echo '</tr>';
792
- }
793
- ?>
794
-
795
- <tr class="cme-bulk-select">
796
- <td colspan="<?php echo $checks_per_row;?>">
797
- <span style="float:right">
798
- <input type="checkbox" class="cme-check-all" autocomplete="off" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
799
- </span>
800
- </td></tr>
801
-
802
- </table>
803
- </div>
804
-
805
- <?php
806
- $all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
807
- $all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
808
-
809
- /*
810
- $publishpress_status_change_caps = array();
811
- foreach( $all_capabilities as $cap_name ) {
812
- if (0 === strpos($cap_name, 'status_change_')) {
813
- $publishpress_status_change_caps []= $cap_name;
814
- }
815
- }
816
- */
817
-
818
- // caps: plugins
819
- $plugin_caps = apply_filters('cme_plugin_capabilities', $plugin_caps);
820
-
821
- foreach($plugin_caps as $plugin => $__plugin_caps) {
822
- $_plugin_caps = array_fill_keys($__plugin_caps, true);
823
-
824
- $id = 'cme-cap-type-tables-' . str_replace( ' ', '-', strtolower($plugin));
825
- $div_display = ($id == $active_tab_id) ? 'block' : 'none';
826
-
827
- echo '<div id="' . $id . '" style="display:' . $div_display . '">';
828
- echo '<table class="widefat fixed striped form-table cme-checklist"><tr>';
829
- echo '<h3 class="cme-cap-section">' . sprintf(__( 'Plugin Capabilities &ndash; %s', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
830
-
831
- $checks_per_row = get_option( 'cme_form-rows', 1 );
832
- $i = 0; $first_row = true;
833
-
834
- foreach( array_keys($_plugin_caps) as $cap_name ) {
835
- if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) ) {
836
- continue;
837
- }
838
-
839
- if ( ! $is_administrator && ! current_user_can($cap_name) )
840
- continue;
841
-
842
- if ( $i == $checks_per_row ) {
843
- echo '</tr><tr>';
844
- $i = 0;
845
- }
846
-
847
- if ( ! isset( $rcaps[$cap_name] ) )
848
- $class = 'cap-no';
849
- else
850
- $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
851
-
852
- if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
853
- $class .= ' cap-metagroup';
854
- $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
855
- } else {
856
- $title_text = $cap_name;
857
- }
858
-
859
- $disabled = '';
860
- $checked = checked(1, ! empty($rcaps[$cap_name]), false );
861
- $title = $title_text;
862
- ?>
863
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
864
- <span>
865
- <?php
866
- echo str_replace( '_', ' ', $cap_name );
867
- ?>
868
- </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
869
- <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
870
- <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
871
- <?php endif; ?>
872
- </td>
873
-
874
- <?php
875
- ++$i;
876
- }
877
-
878
- if ( $i == $checks_per_row ) {
879
- echo '</tr>';
880
- $i = 0;
881
- } elseif ( ! $first_row ) {
882
- // Now close a wellformed table
883
- for ( $i; $i < $checks_per_row; $i++ ){
884
- echo '<td>&nbsp;</td>';
885
- }
886
- echo '</tr>';
887
- }
888
- ?>
889
-
890
- <tr class="cme-bulk-select">
891
- <td colspan="<?php echo $checks_per_row;?>">
892
- <span style="float:right">
893
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
894
- </span>
895
- </td></tr>
896
-
897
- </table>
898
- </div>
899
- <?php
900
- }
901
-
902
- // caps: invalid
903
- if (array_intersect(array_keys(array_filter($type_metacaps)), $all_capabilities) && array_intersect_key($type_metacaps, array_filter($rcaps))) {
904
- $id = "cme-cap-type-tables-invalid";
905
- $div_display = ($id == $active_tab_id) ? 'block' : 'none';
906
-
907
- echo '<div id="' . $id . '" style="display:' . $div_display . '">';
908
- echo '<h3 class="cme-cap-section">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
909
- ?>
910
-
911
- <script type="text/javascript">
912
- /* <![CDATA[ */
913
- jQuery(document).ready( function($) {
914
- $('#cme_tab_invalid_caps').show();
915
- });
916
- /* ]]> */
917
- </script>
918
-
919
- <div>
920
- <span class="cme-subtext">
921
- <?php _e('The following entries have no effect. Please assign desired capabilities in the Read / Edit / Delete grid above.', 'capsman-enhanced');?>
922
- </span>
923
- </div>
924
-
925
- <table class="widefat fixed striped form-table cme-checklist">
926
- <tr>
927
- <?php
928
- $i = 0; $first_row = true;
929
-
930
- foreach( $all_capabilities as $cap_name ) {
931
- if ( ! isset($this->capabilities[$cap_name]) )
932
- $this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
933
- }
934
-
935
- uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
936
-
937
- foreach ( $this->capabilities as $cap_name => $cap ) :
938
- if (!isset($type_metacaps[$cap_name]) || empty($rcaps[$cap_name])) {
939
- continue;
940
- }
941
-
942
- if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
943
- continue;
944
- }
945
-
946
- if ( $i == $checks_per_row ) {
947
- echo '</tr><tr>';
948
- $i = 0; $first_row = false;
949
- }
950
-
951
- if ( ! isset( $rcaps[$cap_name] ) )
952
- $class = 'cap-no';
953
- else
954
- $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
955
-
956
- $title_text = $cap_name;
957
-
958
- $disabled = '';
959
- $checked = checked(1, ! empty($rcaps[$cap_name]), false );
960
- ?>
961
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
962
- <span>
963
- <?php
964
- echo str_replace( '_', ' ', $cap );
965
- ?>
966
- </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
967
- <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
968
- <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
969
- <?php endif; ?>
970
- </td>
971
- <?php
972
- $i++;
973
- endforeach;
974
-
975
- if ( ! empty($lock_manage_caps_capability) ) {
976
- echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
977
- }
978
-
979
- if ( $i == $checks_per_row ) {
980
- echo '</tr><tr>';
981
- $i = 0;
982
- } else {
983
- if ( ! $first_row ) {
984
- // Now close a wellformed table
985
- for ( $i; $i < $checks_per_row; $i++ ){
986
- echo '<td>&nbsp;</td>';
987
- }
988
- echo '</tr>';
989
- }
990
- }
991
- ?>
992
-
993
- </table>
994
- </div>
995
- <?php
996
- } // endif any invalid caps
997
-
998
- $id = "cme-cap-type-tables-additional";
999
- $div_display = ($id == $active_tab_id) ? 'block' : 'none';
1000
- ?>
1001
- <div id="<?php echo $id;?>" style="display:<?php echo $div_display;?>">
1002
- <?php
1003
- // caps: additional
1004
- echo '<h3 class="cme-cap-section">' . __( 'Additional Capabilities', 'capsman-enhanced' ) . '</h3>';
1005
-
1006
- ?>
1007
- <table class="widefat fixed striped form-table cme-checklist">
1008
- <tr>
1009
- <?php
1010
- $i = 0; $first_row = true;
1011
-
1012
- foreach( $all_capabilities as $cap_name ) {
1013
- if ( ! isset($this->capabilities[$cap_name]) )
1014
- $this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
1015
- }
1016
-
1017
- uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
1018
-
1019
- $additional_caps = apply_filters('publishpress_caps_manage_additional_caps', $this->capabilities);
1020
-
1021
- foreach ($additional_caps as $cap_name => $cap) :
1022
-
1023
- if ((isset($type_caps[$cap_name]) && !isset($type_metacaps[$cap_name]))
1024
- || isset($core_caps[$cap_name])
1025
- || (isset($type_metacaps[$cap_name]) && !empty($rcaps[$cap_name])) ) {
1026
- continue;
1027
- }
1028
-
1029
- if (!isset($type_metacaps[$cap_name]) || !empty($rcaps[$cap_name])) {
1030
- foreach(array_keys($plugin_caps) as $plugin) {
1031
- if ( in_array( $cap_name, $plugin_caps[$plugin]) ) {
1032
- continue 2;
1033
- }
1034
- }
1035
- }
1036
-
1037
- if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
1038
- continue;
1039
- }
1040
-
1041
- // Levels are not shown.
1042
- if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
1043
- continue;
1044
- }
1045
-
1046
- if ( $i == $checks_per_row ) {
1047
- echo '</tr><tr>';
1048
- $i = 0; $first_row = false;
1049
- }
1050
-
1051
- if ( ! isset( $rcaps[$cap_name] ) )
1052
- $class = 'cap-no';
1053
- else
1054
- $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
1055
-
1056
- if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
1057
- $class .= ' cap-metagroup';
1058
- $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
1059
- } else {
1060
- $title_text = $cap_name;
1061
- }
1062
-
1063
- $disabled = '';
1064
- $checked = checked(1, ! empty($rcaps[$cap_name]), false );
1065
-
1066
- if ( 'manage_capabilities' == $cap_name ) {
1067
- if (!current_user_can('administrator') && (!is_multisite() || !is_super_admin())) {
1068
- continue;
1069
- } elseif ( 'administrator' == $default ) {
1070
- $class .= ' cap-locked';
1071
- $lock_manage_caps_capability = true;
1072
- $disabled = 'disabled="disabled"';
1073
- }
1074
- }
1075
- ?>
1076
- <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
1077
- <span>
1078
- <?php
1079
- echo str_replace( '_', ' ', $cap );
1080
- ?>
1081
- </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
1082
- <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
1083
- <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
1084
- <?php endif; ?>
1085
- </td>
1086
- <?php
1087
- $i++;
1088
- endforeach;
1089
-
1090
- if ( ! empty($lock_manage_caps_capability) ) {
1091
- echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
1092
- }
1093
-
1094
- if ( $i == $checks_per_row ) {
1095
- echo '</tr><tr>';
1096
- $i = 0;
1097
- } else {
1098
- if ( ! $first_row ) {
1099
- // Now close a wellformed table
1100
- for ( $i; $i < $checks_per_row; $i++ ){
1101
- echo '<td>&nbsp;</td>';
1102
- }
1103
- echo '</tr>';
1104
- }
1105
- }
1106
- ?>
1107
-
1108
- <tr class="cme-bulk-select">
1109
- <td colspan="<?php echo $checks_per_row;?>">
1110
- <span style="float:right">
1111
- <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
1112
- </span>
1113
- </td></tr>
1114
-
1115
- </table>
1116
- </div>
1117
- </div>
1118
- </div>
1119
-
1120
-
1121
- <script type="text/javascript">
1122
- /* <![CDATA[ */
1123
- jQuery(document).ready( function($) {
1124
- $('a[href="#pp-more"]').click( function() {
1125
- $('#pp_features').show();
1126
- return false;
1127
- });
1128
- $('a[href="#pp-hide"]').click( function() {
1129
- $('#pp_features').hide();
1130
- return false;
1131
- });
1132
- });
1133
- /* ]]> */
1134
- </script>
1135
-
1136
- <?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
1137
-
1138
- <div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('PublishPress Permissions', 'capsman-enhanced');?>" /></a></div><div class="features-wrap"><ul class="pp-features">
1139
- <li>
1140
- <?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
1141
- <a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1142
-
1143
- <li>
1144
- <?php _e( "Assign standard WP roles supplementally for a specific post type", 'capsman-enhanced' );?>
1145
- <a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1146
-
1147
- <li>
1148
- <?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
1149
- </li>
1150
-
1151
- <li>
1152
- <?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
1153
- <a href="https://presspermit.com/tutorial/category-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1154
-
1155
- <li>
1156
- <?php _e( "Customize editing permissions per-category or per-post <em>(Pro)</em>", 'capsman-enhanced' );?>
1157
- <a href="https://presspermit.com/tutorial/page-editing-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1158
-
1159
- <li>
1160
- <?php _e( "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>", 'capsman-enhanced' );?>
1161
- <a href="https://presspermit.com/tutorial/custom-post-visibility" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1162
-
1163
- <li>
1164
- <?php _e( "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>", 'capsman-enhanced' );?>
1165
- <a href="https://presspermit.com/tutorial/multi-step-moderation" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1166
-
1167
- <li>
1168
- <?php _e( "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>", 'capsman-enhanced' );?>
1169
- <a href="https://presspermit.com/tutorial/edit-flow-integration" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1170
-
1171
- <li>
1172
- <?php _e( "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>", 'capsman-enhanced' );?>
1173
- <a href="https://presspermit.com/tutorial/published-content-revision" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1174
-
1175
- <li>
1176
- <?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
1177
- </li>
1178
-
1179
- <li>
1180
- <?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
1181
- <a href="https://presspermit.com/tutorial/buddypress-content-permissions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
1182
-
1183
- <li>
1184
- <?php _e( "WPML integration to mirror permissions to translations <em>(Pro)</em>", 'capsman-enhanced' );?>
1185
- </li>
1186
-
1187
- <li>
1188
- <?php _e( "Member support forum", 'capsman-enhanced' );?>
1189
- </li>
1190
-
1191
- </ul></div>
1192
-
1193
- <?php
1194
- echo '<div>';
1195
- printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a></span>' );
1196
- echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
1197
- printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions&nbsp;Pro</a>' );
1198
- echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
1199
- echo '<a href="#pp-hide">hide</a>';
1200
- echo '</div></div>';
1201
-
1202
- ///
1203
- ?>
1204
- <script type="text/javascript">
1205
- /* <![CDATA[ */
1206
- jQuery(document).ready( function($) {
1207
- $('a[href="#toggle_type_caps"]').click( function() {
1208
- var chks = $(this).closest('tr').find('input');
1209
- var set_checked = ! $(chks).first().is(':checked');
1210
-
1211
- $(chks).each(function(i,e) {
1212
- $('input[name="' + $(this).attr('name') + '"]').prop('checked', set_checked);
1213
- });
1214
-
1215
- return false;
1216
- });
1217
-
1218
- $('input[name^="caps["]').click(function() {
1219
- $('input[name="' + $(this).attr('name') + '"]').prop('checked', $(this).prop('checked'));
1220
- });
1221
- });
1222
- /* ]]> */
1223
- </script>
1224
-
1225
- <div style="display:inline-block; float:right;">
1226
- <?php
1227
- $level = ak_caps2level($rcaps);
1228
- ?>
1229
- <span title="<?php _e('Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities.', 'capsman-enhanced');?>">
1230
-
1231
- <?php (in_array(get_locale(), ['en_EN', 'en_US'])) ? printf('Role Level:') : _e('Level:', 'capsman-enhanced');?> <select name="level">
1232
- <?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
1233
- <option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>>&nbsp;<?php echo $l; ?>&nbsp;</option>
1234
- <?php }
1235
- ?>
1236
- </select>
1237
- </span>
1238
-
1239
- </div>
1240
-
1241
- <?php
1242
- $support_pp_only_roles = defined('PRESSPERMIT_ACTIVE');
1243
- cme_network_role_ui( $default );
1244
- ?>
1245
-
1246
- <p class="submit" style="padding-top:0;">
1247
- <input type="hidden" name="action" value="update" />
1248
- <input type="hidden" name="current" value="<?php echo $default; ?>" />
1249
- <input type="submit" name="SaveRole" value="<?php echo (in_array(get_locale(), ['en_EN', 'en_US'])) ? 'Save Capabilities' : _e('Save Changes', 'capsman-enhanced');?>" class="button-primary" /> &nbsp;
1250
-
1251
- <?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
1252
- <a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}&amp;action=delete&amp;role={$default}", 'delete-role_' . $default); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete the %s role.\n\n 'Cancel' to stop, 'OK' to delete.", 'capsman-enhanced'), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', 'capsman-enhanced')?></a>
1253
- <?php endif; ?>
1254
- </p>
1255
-
1256
- </td>
1257
- <td class="sidebar">
1258
- <?php do_action('publishpress-caps_sidebar_top');?>
1259
-
1260
- <dl>
1261
- <dt><?php _e('Add Capability', 'capsman-enhanced'); ?></dt>
1262
- <dd style="text-align:center;">
1263
- <p><input type="text" name="capability-name" class="regular-text" placeholder="<?php echo 'capability_name';?>" /><br />
1264
- <input type="submit" name="AddCap" value="<?php _e('Add to role', 'capsman-enhanced') ?>" class="button" /></p>
1265
- </dd>
1266
- </dl>
1267
-
1268
- <?php
1269
- $pp_ui->pp_types_ui( $defined['type'] );
1270
- $pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
1271
-
1272
- do_action('publishpress-caps_sidebar_bottom');
1273
- ?>
1274
-
1275
- <dl>
1276
- <dt><?php (!in_array(get_locale(), ['en_EN', 'en_US'])) ? _e('Copy this role to', 'capsman-enhanced') : printf('Copy %s Role', translate_user_role($roles[$default])); ?></dt>
1277
- <dd style="text-align:center;">
1278
- <?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
1279
- <p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1280
-
1281
- <?php if( $support_pp_only_roles ) : ?>
1282
- <label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" autocomplete="off" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1283
- <?php endif; ?>
1284
-
1285
- <br />
1286
- <input type="submit" name="CopyRole" value="<?php _e('Copy', 'capsman-enhanced') ?>" class="button" />
1287
- </p>
1288
- </dd>
1289
- </dl>
1290
-
1291
- <dl>
1292
- <dt><?php _e('Rename Role', 'capsman-enhanced'); ?></dt>
1293
- <dd style="text-align:center;">
1294
- <p><input type="text" name="rename-name" class="regular-text" placeholder="<?php _e('New Role Name', 'capsman-enhanced') ?>" />
1295
-
1296
- <br />
1297
- <input type="submit" name="RenameRole" value="<?php _e('Rename', 'capsman-enhanced') ?>" class="button" />
1298
- </p>
1299
- </dd>
1300
- </dl>
1301
- </td>
1302
- </tr>
1303
- </table>
1304
- </fieldset>
1305
- </form>
1306
-
1307
- <?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
1308
- cme_publishpressFooter();
1309
- }
1310
- ?>
1311
- </div>
1312
-
1313
- <?php
1314
- function cme_network_role_ui( $default ) {
1315
- if (!is_multisite() || !is_super_admin() || !is_main_site()) {
1316
- return false;
1317
- }
1318
- ?>
1319
-
1320
- <div style="float:right;margin-left:10px;margin-right:10px">
1321
- <?php
1322
- if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
1323
- $autocreate_roles = array();
1324
- ?>
1325
- <div style="margin-bottom: 5px">
1326
- <label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" autocomplete="off" value="1" <?php echo checked(in_array($default, $autocreate_roles));?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
1327
- </div>
1328
- <div>
1329
- <label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" autocomplete="off" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
1330
- </div>
1331
- <div>
1332
- <label for="cme_net_sync_options" title="<?php echo esc_attr(__('Copy option settings to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_options" id="cme_net_sync_options" autocomplete="off" value="1"> <?php _e('sync options to all sites now', 'capsman-enhanced'); ?> </label>
1333
- </div>
1334
- </div>
1335
- <?php
1336
- return true;
1337
- }
1338
-
1339
- function cme_plugin_info_url( $plugin_slug ) {
1340
- $_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
1341
- return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
1342
- }
1
+ <?php
2
+ /**
3
+ * General Admin for Role Capabilities.
4
+ * Provides admin pages to create and manage roles and capabilities.
5
+ *
6
+ * @author Jordi Canals, Kevin Behrens
7
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
8
+ * @license GNU General Public License version 2
9
+ * @link https://publishpress.com
10
+ *
11
+ *
12
+ * Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
13
+ * Modifications Copyright 2020, PublishPress <help@publishpress.com>
14
+ *
15
+ * This program is free software; you can redistribute it and/or
16
+ * modify it under the terms of the GNU General Public License
17
+ * version 2 as published by the Free Software Foundation.
18
+ *
19
+ * This program is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ * GNU General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU General Public License
25
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
26
+ **/
27
+
28
+ global $capsman, $cme_cap_helper, $current_user;
29
+
30
+ do_action('publishpress-caps_manager-load');
31
+
32
+ $roles = $this->roles;
33
+ $default = $this->current;
34
+
35
+ if ( $block_read_removal = _cme_is_read_removal_blocked( $this->current ) ) {
36
+ if ( $current = get_role($default) ) {
37
+ if ( empty( $current->capabilities['read'] ) ) {
38
+ ak_admin_error( sprintf( __( 'Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s.', 'capsman-enhanced' ), '<a href="javascript:void(0)" class="cme-fix-read-cap">', '</a>' ) );
39
+ }
40
+ }
41
+ }
42
+
43
+ require_once (dirname(CME_FILE) . '/includes/roles/roles-functions.php');
44
+
45
+ require_once( dirname(__FILE__).'/pp-ui.php' );
46
+ $pp_ui = new Capsman_PP_UI();
47
+
48
+ if( defined('PRESSPERMIT_ACTIVE') ) {
49
+ $pp_metagroup_caps = $pp_ui->get_metagroup_caps( $default );
50
+ } else {
51
+ $pp_metagroup_caps = array();
52
+ }
53
+ ?>
54
+ <div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
55
+ <?php /*if( defined('PRESSPERMIT_ACTIVE') ) :
56
+ pp_icon();
57
+ $style = 'style="height:60px;"';
58
+ */
59
+ ?>
60
+ <?php /* else: */
61
+ $style = '';
62
+ ?>
63
+ <div id="icon-capsman-admin" class="icon32"></div>
64
+ <?php /* endif; */ ?>
65
+
66
+ <h1 <?php echo $style;?>><?php _e('Role Capabilities', 'capsman-enhanced') ?></h1>
67
+
68
+ <?php
69
+ echo pp_capabilities_roles()->notify->display();
70
+ ?>
71
+
72
+ <script type="text/javascript">
73
+ /* <![CDATA[ */
74
+ jQuery(document).ready( function($) {
75
+ $('#publishpress_caps_form').attr('action', 'admin.php?page=pp-capabilities&role=' + $('select[name="role"]').val());
76
+
77
+ $('select[name="role"]').change(function(){
78
+ window.location = '<?php echo admin_url('admin.php?page=pp-capabilities&role='); ?>' + $(this).val() + '';
79
+ });
80
+ });
81
+ /* ]]> */
82
+ </script>
83
+
84
+ <form id="publishpress_caps_form" method="post" action="admin.php?page=<?php echo $this->ID ?>">
85
+ <?php wp_nonce_field('capsman-general-manager'); ?>
86
+
87
+ <p>
88
+ <select name="role">
89
+ <?php
90
+ foreach ( $roles as $role => $name ) {
91
+ if (pp_capabilities_is_editable_role($role)) {
92
+ $name = translate_user_role($name);
93
+ echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' &nbsp;</option>';
94
+ }
95
+ }
96
+ ?>
97
+ </select>
98
+ </p>
99
+
100
+ <fieldset>
101
+ <table id="akmin">
102
+ <tr>
103
+ <td class="content">
104
+ <dl>
105
+ <dd>
106
+ <div style="float:right">
107
+ <input type="submit" name="SaveRole" value="<?php echo (in_array(get_locale(), ['en_EN', 'en_US'])) ? 'Save Capabilities' : _e('Save Changes', 'capsman-enhanced'); ?>" class="button-primary" /> &nbsp;
108
+ </div>
109
+
110
+ <?php
111
+ global $capsman;
112
+ $img_url = $capsman->mod_url . '/images/';
113
+ ?>
114
+ <div class="publishpress-headline">
115
+ <span class="cme-subtext">
116
+ <?php
117
+ $msg = __( '<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation.', 'capsman-enhanced' );
118
+
119
+ if (defined('PRESSPERMIT_ACTIVE') && function_exists('presspermit')) {
120
+ if ($group = presspermit()->groups()->getMetagroup('wp_role', $this->current)) {
121
+ $msg = sprintf(
122
+ __('<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s.', 'capsman-enhanced'),
123
+ '<a href="' . admin_url("admin.php?page=presspermit-edit-permissions&action=edit&agent_id={$group->ID}") . '">',
124
+ '</a>'
125
+ );
126
+ }
127
+ }
128
+ echo $msg;
129
+ ?>
130
+ </span>
131
+ </div>
132
+
133
+ <?php
134
+ if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
135
+ $pp_ui->show_capability_hints( $default );
136
+ }
137
+ ?>
138
+
139
+ <script type="text/javascript">
140
+ /* <![CDATA[ */
141
+ jQuery(document).ready( function($) {
142
+ $('a[href="#pp-more"]').click( function() {
143
+ $('#pp_features').show();
144
+ return false;
145
+ });
146
+ $('a[href="#pp-hide"]').click( function() {
147
+ $('#pp_features').hide();
148
+ return false;
149
+ });
150
+ });
151
+ /* ]]> */
152
+ </script>
153
+
154
+ <?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
155
+
156
+ <br /><div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('PublishPress Permissions', 'capsman-enhanced');?>" /></a></div><div class="features-wrap"><ul class="pp-features">
157
+ <li>
158
+ <?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
159
+ <a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
160
+
161
+ <li>
162
+ <?php _e( "Assign standard WP roles supplementally for a specific post type", 'capsman-enhanced' );?>
163
+ <a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
164
+
165
+ <li>
166
+ <?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
167
+ </li>
168
+
169
+ <li>
170
+ <?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
171
+ <a href="https://presspermit.com/tutorial/category-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
172
+
173
+ <li>
174
+ <?php _e( "Customize editing permissions per-category or per-post <em>(Pro)</em>", 'capsman-enhanced' );?>
175
+ <a href="https://presspermit.com/tutorial/page-editing-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
176
+
177
+ <li>
178
+ <?php _e( "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>", 'capsman-enhanced' );?>
179
+ <a href="https://presspermit.com/tutorial/custom-post-visibility" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
180
+
181
+ <li>
182
+ <?php _e( "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>", 'capsman-enhanced' );?>
183
+ <a href="https://presspermit.com/tutorial/multi-step-moderation" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
184
+
185
+ <li>
186
+ <?php _e( "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>", 'capsman-enhanced' );?>
187
+ <a href="https://presspermit.com/tutorial/edit-flow-integration" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
188
+
189
+ <li>
190
+ <?php _e( "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>", 'capsman-enhanced' );?>
191
+ <a href="https://presspermit.com/tutorial/published-content-revision" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
192
+
193
+ <li>
194
+ <?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
195
+ </li>
196
+
197
+ <li>
198
+ <?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
199
+ <a href="https://presspermit.com/tutorial/buddypress-content-permissions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
200
+
201
+ <li>
202
+ <?php _e( "WPML integration to mirror permissions to translations <em>(Pro)</em>", 'capsman-enhanced' );?>
203
+ </li>
204
+
205
+ <li>
206
+ <?php _e( "Member support forum", 'capsman-enhanced' );?>
207
+ </li>
208
+
209
+ </ul></div>
210
+
211
+ <?php
212
+ echo '<div>';
213
+ printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a></span>' );
214
+ echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
215
+ printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions&nbsp;Pro</a>' );
216
+ echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
217
+ echo '<a href="#pp-hide">hide</a>';
218
+ echo '</div></div>';
219
+
220
+ if ( MULTISITE ) {
221
+ global $wp_roles;
222
+ global $wpdb;
223
+
224
+ if ( ! empty($_REQUEST['cme_net_sync_role'] ) ) {
225
+ $main_site_id = (function_exists('get_main_site_id')) ? get_main_site_id() : 1;
226
+ switch_to_blog($main_site_id);
227
+ wp_cache_delete( $wpdb->prefix . 'user_roles', 'options' );
228
+ }
229
+
230
+ ( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
231
+ }
232
+ $capsman->reinstate_db_roles();
233
+
234
+ $current = get_role($default);
235
+
236
+ $rcaps = $current->capabilities;
237
+
238
+ $is_administrator = current_user_can( 'administrator' ) || (is_multisite() && is_super_admin());
239
+
240
+ $custom_types = get_post_types( array( '_builtin' => false ), 'names' );
241
+ $custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
242
+
243
+ $defined = array();
244
+ $defined['type'] = apply_filters('cme_filterable_post_types', get_post_types( array( 'public' => true, 'show_ui' => true), 'object', 'or' ));
245
+ $defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
246
+
247
+ // bbPress' dynamic role def requires additional code to enforce stored caps
248
+ $unfiltered['type'] = apply_filters('presspermit_unfiltered_post_types', ['forum','topic','reply','wp_block']);
249
+ $unfiltered['type'] = (defined('PP_CAPABILITIES_NO_LEGACY_FILTERS')) ? $unfiltered['type'] : apply_filters('pp_unfiltered_post_types', $unfiltered['type']);
250
+
251
+ $unfiltered['taxonomy'] = apply_filters('presspermit_unfiltered_post_types', ['post_status', 'topic-tag']); // avoid confusion with Edit Flow administrative taxonomy
252
+ $unfiltered['taxonomy'] = (defined('PP_CAPABILITIES_NO_LEGACY_FILTERS')) ? $unfiltered['taxonomy'] : apply_filters('pp_unfiltered_post_types', $unfiltered['taxonomy']);
253
+
254
+ $enabled_taxonomies = cme_get_assisted_taxonomies();
255
+
256
+ /*
257
+ if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
258
+ $cap_properties[''] = array();
259
+ $force_distinct_ui = true;
260
+ }
261
+ */
262
+
263
+ $cap_properties['edit']['type'] = array( 'edit_posts' );
264
+
265
+ foreach( $defined['type'] as $type_obj ) {
266
+ if ( 'attachment' != $type_obj->name ) {
267
+ if ( isset( $type_obj->cap->create_posts ) && ( $type_obj->cap->create_posts != $type_obj->cap->edit_posts ) ) {
268
+ $cap_properties['edit']['type'][]= 'create_posts';
269
+ break;
270
+ }
271
+ }
272
+ }
273
+
274
+ $cap_properties['edit']['type'][]= 'edit_others_posts';
275
+ $cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
276
+
277
+ $cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
278
+
279
+ if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
280
+ $cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
281
+
282
+ $cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
283
+ $cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
284
+
285
+ if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
286
+ $cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
287
+ else
288
+ $cap_properties['delete']['taxonomy'] = array();
289
+
290
+ $cap_properties['read']['type'] = array( 'read_private_posts' );
291
+ $cap_properties['read']['taxonomy'] = array();
292
+
293
+ $stati = get_post_stati( array( 'internal' => false ) );
294
+
295
+ $cap_type_names = array(
296
+ '' => __( '&nbsp;', 'capsman-enhanced' ),
297
+ 'read' => __( 'Reading', 'capsman-enhanced' ),
298
+ 'edit' => __( 'Editing Capabilities', 'capsman-enhanced' ),
299
+ 'delete' => __( 'Deletion Capabilities', 'capsman-enhanced' )
300
+ );
301
+
302
+ $cap_tips = array(
303
+ 'read_private' => __( 'can read posts which are currently published with private visibility', 'capsman-enhanced' ),
304
+ 'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
305
+ 'edit_others' => __( 'can edit posts which were created by other users', 'capsman-enhanced' ),
306
+ 'edit_published' => __( 'can edit posts which are currently published', 'capsman-enhanced' ),
307
+ 'edit_private' => __( 'can edit posts which are currently published with private visibility', 'capsman-enhanced' ),
308
+ 'publish' => __( 'can make a post publicly visible', 'capsman-enhanced' ),
309
+ 'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
310
+ 'delete_others' => __( 'can delete posts which were created by other users', 'capsman-enhanced' ),
311
+ 'delete_published' => __( 'can delete posts which are currently published', 'capsman-enhanced' ),
312
+ 'delete_private' => __( 'can delete posts which are currently published with private visibility', 'capsman-enhanced' ),
313
+ );
314
+
315
+ $default_caps = array( 'read_private_posts', 'edit_posts', 'edit_others_posts', 'edit_published_posts', 'edit_private_posts', 'publish_posts', 'delete_posts', 'delete_others_posts', 'delete_published_posts', 'delete_private_posts',
316
+ 'read_private_pages', 'edit_pages', 'edit_others_pages', 'edit_published_pages', 'edit_private_pages', 'publish_pages', 'delete_pages', 'delete_others_pages', 'delete_published_pages', 'delete_private_pages',
317
+ 'manage_categories'
318
+ );
319
+ $type_caps = array();
320
+ $type_metacaps = array();
321
+
322
+ // Role Scoper and PP1 adjust attachment access based only on user's capabilities for the parent post
323
+ if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
324
+ unset( $defined['type']['attachment'] );
325
+ }
326
+
327
+ echo '<ul class="cme-listhoriz">';
328
+
329
+ // cap_types: read, edit, deletion
330
+ foreach( array_keys($cap_properties) as $cap_type ) {
331
+ echo '<li>';
332
+ echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
333
+
334
+ echo "<div class='cme-cap-type-tables cme-cap-type-tables-$cap_type'>";
335
+
336
+ foreach( array_keys($defined) as $item_type ) {
337
+ if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
338
+ if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
339
+ continue;
340
+ }
341
+
342
+ $any_term_deletion_caps = false;
343
+ foreach( array_keys($defined['taxonomy']) as $_tax ) {
344
+ if ( isset( $defined['taxonomy'][$_tax]->cap->delete_terms ) && ( 'manage_categories' != $defined['taxonomy'][$_tax]->cap->delete_terms ) && ! in_array( $_tax, $unfiltered['taxonomy'] ) ) {
345
+ $any_term_deletion_caps = true;
346
+ break;
347
+ }
348
+ }
349
+
350
+ if ( ! $any_term_deletion_caps )
351
+ continue;
352
+ }
353
+
354
+ if ( ! count( $cap_properties[$cap_type][$item_type] ) )
355
+ continue;
356
+
357
+ echo "<table class='cme-typecaps cme-typecaps-$cap_type'>";
358
+
359
+ echo '<tr><th></th>';
360
+
361
+ // label cap properties
362
+ foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
363
+ $prop = str_replace( '_posts', '', $prop );
364
+ $prop = str_replace( '_pages', '', $prop );
365
+ $prop = str_replace( '_terms', '', $prop );
366
+ $tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
367
+ $prop = str_replace( '_', '<br />', $prop );
368
+ $th_class = ( 'taxonomy' == $item_type ) ? ' class="term-cap"' : ' class="post-cap"';
369
+ echo "<th $tip{$th_class}>";
370
+
371
+ if ( ( 'delete' != $prop ) || ( 'taxonomy' != $item_type ) || cme_get_detailed_taxonomies() ) {
372
+ echo ucwords($prop);
373
+ }
374
+
375
+ echo '</th>';
376
+ }
377
+
378
+ echo '</tr>';
379
+
380
+ foreach( $defined[$item_type] as $key => $type_obj ) {
381
+ if ( in_array( $key, $unfiltered[$item_type] ) )
382
+ continue;
383
+
384
+ $row = "<tr class='cme_type_{$key}'>";
385
+
386
+ if ( $cap_type ) {
387
+ if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
388
+ continue;
389
+
390
+ $type_label = (!empty($type_obj->labels->menu_name)) ? $type_obj->labels->menu_name : $type_obj->labels->name;
391
+
392
+ $row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_label . '</a>';
393
+ $row .= '<a href="#" class="neg-type-caps">&nbsp;x&nbsp;</a>';
394
+ $row .= '</td>';
395
+
396
+ $display_row = ! empty($force_distinct_ui);
397
+
398
+ foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
399
+ $td_classes = array();
400
+ $checkbox = '';
401
+ $title = '';
402
+
403
+ if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
404
+ || ! in_array( $type_obj->cap->$prop, $default_caps )
405
+ || ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
406
+
407
+ // if edit_published or edit_private cap is same as edit_posts cap, don't display a checkbox for it
408
+ if ( ( ! in_array( $prop, array( 'edit_published_posts', 'edit_private_posts', 'create_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->edit_posts ) )
409
+ && ( ! in_array( $prop, array( 'delete_published_posts', 'delete_private_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->delete_posts ) )
410
+ && ( ! in_array( $prop, array( 'edit_terms', 'delete_terms' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->manage_terms ) )
411
+
412
+ && ( ! in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
413
+ || empty($cme_cap_helper->all_taxonomy_caps[$type_obj->cap->$prop])
414
+ || ( $cme_cap_helper->all_taxonomy_caps[ $type_obj->cap->$prop ] <= 1 )
415
+ || $type_obj->cap->$prop == str_replace( '_terms', "_{$type_obj->name}s", $prop )
416
+ || $type_obj->cap->$prop == str_replace( '_terms', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
417
+ )
418
+
419
+ && ( in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
420
+ || empty($cme_cap_helper->all_type_caps[$type_obj->cap->$prop])
421
+ || ( $cme_cap_helper->all_type_caps[ $type_obj->cap->$prop ] <= 1 )
422
+ || $type_obj->cap->$prop == 'upload_files' && 'create_posts' == $prop && 'attachment' == $type_obj->name
423
+ || $type_obj->cap->$prop == str_replace( '_posts', "_{$type_obj->name}s", $prop )
424
+ || $type_obj->cap->$prop == str_replace( '_pages', "_{$type_obj->name}s", $prop )
425
+ || $type_obj->cap->$prop == str_replace( '_posts', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
426
+ || $type_obj->cap->$prop == str_replace( '_pages', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
427
+ )
428
+ ) {
429
+ // only present these term caps up top if we are ensuring that they get enforced separately from manage_terms
430
+ if ( in_array( $prop, array( 'edit_terms', 'delete_terms', 'assign_terms' ) ) && ( ! in_array( $type_obj->name, cme_get_detailed_taxonomies() ) || defined( 'OLD_PRESSPERMIT_ACTIVE' ) ) ) {
431
+ continue;
432
+ }
433
+
434
+ $cap_name = $type_obj->cap->$prop;
435
+
436
+ if ( 'taxonomy' == $item_type )
437
+ $td_classes []= "term-cap";
438
+ else
439
+ $td_classes []= "post-cap";
440
+
441
+ if ( ! empty($pp_metagroup_caps[$cap_name]) )
442
+ $td_classes []='cm-has-via-pp';
443
+
444
+ if ( $is_administrator || current_user_can($cap_name) ) {
445
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
446
+ $title = ' title="' . sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name ) . '"';
447
+ } else {
448
+ $title = ' title="' . $cap_name . '"';
449
+ }
450
+
451
+ $disabled = '';
452
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
453
+
454
+ $checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" autocomplete="off" value="1" ' . $checked . $disabled . ' />';
455
+
456
+ $type_caps [$cap_name] = true;
457
+ $display_row = true;
458
+ }
459
+ } else {
460
+ //$td_classes []= "cap-unreg";
461
+ $title = 'title="' . sprintf( __( 'shared capability: %s', 'capsman-enhanced' ), esc_attr( $type_obj->cap->$prop ) ) . '"';
462
+ }
463
+
464
+ if ( isset($rcaps[$cap_name]) && empty($rcaps[$cap_name]) ) {
465
+ $td_classes []= "cap-neg";
466
+ }
467
+ } else {
468
+ $td_classes []= "cap-unreg";
469
+ }
470
+
471
+ $td_class = ( $td_classes ) ? 'class="' . implode(' ', $td_classes) . '"' : '';
472
+
473
+ $row .= "<td $td_class $title><span class='cap-x'>X</span>$checkbox";
474
+
475
+ if ( false !== strpos( $td_class, 'cap-neg' ) )
476
+ $row .= '<input type="hidden" class="cme-negation-input" name="caps[' . $cap_name . ']" value="" />';
477
+
478
+ $row .= "</td>";
479
+ }
480
+
481
+ if (!empty($type_obj->map_meta_cap) && !defined('PP_CAPABILITIES_NO_INVALID_SECTION')) {
482
+ if ('type' == $item_type) {
483
+ $type_metacaps[$type_obj->cap->read_post] = true;
484
+ $type_metacaps[$type_obj->cap->edit_post] = isset($type_obj->cap->edit_posts) && ($type_obj->cap->edit_post != $type_obj->cap->edit_posts);
485
+ $type_metacaps[$type_obj->cap->delete_post] = isset($type_obj->cap->delete_posts) && ($type_obj->cap->delete_post != $type_obj->cap->delete_posts);
486
+
487
+ } elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
488
+ $type_metacaps[$type_obj->cap->edit_term] = true;
489
+ $type_metacaps[$type_obj->cap->delete_term] = true;
490
+ }
491
+ }
492
+ }
493
+
494
+ if ( $display_row ) {
495
+ $row .= '</tr>';
496
+ echo $row;
497
+ }
498
+ }
499
+
500
+ echo '</table>';
501
+
502
+ } // end foreach item type
503
+
504
+ echo '</div>';
505
+
506
+ echo '</li>';
507
+ }
508
+
509
+
510
+ do_action('publishpress-caps_manager_postcaps_section', compact('current', 'rcaps', 'pp_metagroup_caps', 'is_administrator', 'default_caps', 'custom_types', 'defined', 'unfiltered', 'pp_metagroup_caps'));
511
+
512
+ $type_caps = apply_filters('publishpress_caps_manager_typecaps', $type_caps);
513
+
514
+ echo '</ul>';
515
+
516
+ // clicking on post type name toggles corresponding checkbox selections
517
+ ?>
518
+ <script type="text/javascript">
519
+ /* <![CDATA[ */
520
+ jQuery(document).ready( function($) {
521
+ $('a[href="#toggle_type_caps"]').click( function() {
522
+ var chks = $(this).closest('tr').find('input');
523
+ $(chks).prop( 'checked', ! $(chks).first().is(':checked') );
524
+ return false;
525
+ });
526
+
527
+ $('input[name^="caps["]').click(function() {
528
+ $('input[name="' + $(this).attr('name') + '"]').prop('checked', $(this).prop('checked'));
529
+ });
530
+ });
531
+ /* ]]> */
532
+ </script>
533
+ <?php
534
+
535
+ echo '<p>&nbsp;</p><h3>' . __( 'Other WordPress Core Capabilities', 'capsman-enhanced' ) . '</h3>';
536
+ echo '<table class="form-table cme-checklist"><tr>';
537
+
538
+ $checks_per_row = get_option( 'cme_form-rows', 5 );
539
+ $i = 0; $first_row = true;
540
+
541
+ $core_caps = _cme_core_caps();
542
+ foreach( array_keys($core_caps) as $cap_name ) {
543
+ if ( ! $is_administrator && ! current_user_can($cap_name) )
544
+ continue;
545
+
546
+ if ( $i == $checks_per_row ) {
547
+ echo '</tr><tr>';
548
+ $i = 0;
549
+ }
550
+
551
+ if ( ! isset( $rcaps[$cap_name] ) )
552
+ $class = 'cap-no';
553
+ else
554
+ $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
555
+
556
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
557
+ $class .= ' cap-metagroup';
558
+ $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
559
+ } else {
560
+ $title_text = $cap_name;
561
+ }
562
+
563
+ $disabled = '';
564
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
565
+ $lock_capability = false;
566
+ $title = $title_text;
567
+
568
+ if ( 'read' == $cap_name ) {
569
+ if ( ! empty( $block_read_removal ) ) {
570
+ // prevent the read capability from being removed from a core role, but don't force it to be added
571
+ if ( $checked || apply_filters( 'pp_caps_force_capability_storage', false, 'read', $default ) ) {
572
+ if ( apply_filters( 'pp_caps_lock_capability', true, 'read', $default ) ) {
573
+ $lock_capability = true;
574
+ $class .= ' cap-locked';
575
+ $disabled = 'disabled="disabled"';
576
+ if ( 'administrator' != $this->current ) {
577
+ $title = esc_attr( __('Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add "dashboard_lockout_ok" capability', 'capsman-enhanced' ) );
578
+ }
579
+ }
580
+ }
581
+ }
582
+ }
583
+
584
+ ?>
585
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
586
+ <span>
587
+ <?php
588
+ echo str_replace( '_', ' ', $cap_name );
589
+ ?>
590
+ </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
591
+ <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
592
+ <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
593
+ <?php endif; ?>
594
+ </td>
595
+
596
+ <?php
597
+
598
+ if ( $lock_capability ) {
599
+ echo '<input type="hidden" name="caps[' . $cap_name . ']" value="1" />';
600
+ }
601
+
602
+ ++$i;
603
+ }
604
+
605
+ if ( $i == $checks_per_row ) {
606
+ echo '</tr>';
607
+ $i = 0;
608
+ } elseif ( ! $first_row ) {
609
+ // Now close a wellformed table
610
+ for ( $i; $i < $checks_per_row; $i++ ){
611
+ echo '<td>&nbsp;</td>';
612
+ }
613
+ echo '</tr>';
614
+ }
615
+ ?>
616
+
617
+ <tr class="cme-bulk-select">
618
+ <td colspan="<?php echo $checks_per_row;?>">
619
+ <span style="float:right">
620
+ <input type="checkbox" class="cme-check-all" autocomplete="off" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
621
+ </span>
622
+ </td></tr>
623
+
624
+ </table>
625
+ <?php
626
+ $all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
627
+ $all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
628
+
629
+ /*
630
+ $publishpress_status_change_caps = array();
631
+ foreach( $all_capabilities as $cap_name ) {
632
+ if (0 === strpos($cap_name, 'status_change_')) {
633
+ $publishpress_status_change_caps []= $cap_name;
634
+ }
635
+ }
636
+ */
637
+
638
+ $plugin_caps = [];
639
+
640
+ if (defined('PUBLISHPRESS_VERSION')) {
641
+ $plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
642
+ array(
643
+ 'edit_metadata',
644
+ 'edit_post_subscriptions',
645
+ 'pp_manage_roles',
646
+ 'pp_set_notification_channel',
647
+ 'pp_view_calendar',
648
+ 'pp_view_content_overview',
649
+ )
650
+ );
651
+ }
652
+
653
+ if (defined('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION')) {
654
+ if ($_caps = apply_filters('cme_multiple_authors_capabilities', array())) {
655
+ $plugin_caps['PublishPress Authors'] = $_caps;
656
+ }
657
+ }
658
+
659
+ if (defined('PRESSPERMIT_VERSION')) {
660
+ $plugin_caps['PublishPress Permissions'] = apply_filters('cme_presspermit_capabilities',
661
+ array(
662
+ 'edit_own_attachments',
663
+ 'list_others_unattached_files',
664
+ 'pp_administer_content',
665
+ 'pp_assign_roles',
666
+ 'pp_associate_any_page',
667
+ 'pp_create_groups',
668
+ 'pp_create_network_groups',
669
+ 'pp_define_moderation',
670
+ 'pp_define_post_status',
671
+ 'pp_define_privacy',
672
+ 'pp_delete_groups',
673
+ 'pp_edit_groups',
674
+ 'pp_exempt_edit_circle',
675
+ 'pp_exempt_read_circle',
676
+ 'pp_force_quick_edit',
677
+ 'pp_list_all_files',
678
+ 'pp_manage_capabilities',
679
+ 'pp_manage_members',
680
+ 'pp_manage_network_members',
681
+ 'pp_manage_settings',
682
+ 'pp_moderate_any',
683
+ 'pp_set_associate_exceptions',
684
+ 'pp_set_edit_exceptions',
685
+ 'pp_set_read_exceptions',
686
+ 'pp_set_revise_exceptions',
687
+ 'pp_set_term_assign_exceptions',
688
+ 'pp_set_term_associate_exceptions',
689
+ 'pp_set_term_manage_exceptions',
690
+ 'pp_unfiltered',
691
+ 'set_posts_status',
692
+ )
693
+ );
694
+ }
695
+
696
+ if (defined('WC_PLUGIN_FILE')) {
697
+ $plugin_caps['WooCommerce'] = apply_filters('cme_woocommerce_capabilities',
698
+ array(
699
+ 'assign_product_terms',
700
+ 'assign_shop_coupon_terms',
701
+ 'assign_shop_discount_terms',
702
+ 'assign_shop_order_terms',
703
+ 'assign_shop_payment_terms',
704
+ 'create_shop_orders',
705
+ 'delete_others_products',
706
+ 'delete_others_shop_coupons',
707
+ 'delete_others_shop_discounts',
708
+ 'delete_others_shop_orders',
709
+ 'delete_others_shop_payments',
710
+ 'delete_private_products',
711
+ 'delete_private_shop_coupons',
712
+ 'delete_private_shop_orders',
713
+ 'delete_private_shop_discounts',
714
+ 'delete_private_shop_payments',
715
+ 'delete_product_terms',
716
+ 'delete_products',
717
+ 'delete_published_products',
718
+ 'delete_published_shop_coupons',
719
+ 'delete_published_shop_discounts',
720
+ 'delete_published_shop_orders',
721
+ 'delete_published_shop_payments',
722
+ 'delete_shop_coupons',
723
+ 'delete_shop_coupon_terms',
724
+ 'delete_shop_discount_terms',
725
+ 'delete_shop_discounts',
726
+ 'delete_shop_order_terms',
727
+ 'delete_shop_orders',
728
+ 'delete_shop_payments',
729
+ 'delete_shop_payment_terms',
730
+ 'edit_others_products',
731
+ 'edit_others_shop_coupons',
732
+ 'edit_others_shop_discounts',
733
+ 'edit_others_shop_orders',
734
+ 'edit_others_shop_payments',
735
+ 'edit_private_products',
736
+ 'edit_private_shop_coupons',
737
+ 'edit_private_shop_discounts',
738
+ 'edit_private_shop_orders',
739
+ 'edit_private_shop_payments',
740
+ 'edit_product_terms',
741
+ 'edit_products',
742
+ 'edit_published_products',
743
+ 'edit_published_shop_coupons',
744
+ 'edit_published_shop_discounts',
745
+ 'edit_published_shop_orders',
746
+ 'edit_published_shop_payments',
747
+ 'edit_shop_coupon_terms',
748
+ 'edit_shop_coupons',
749
+ 'edit_shop_discounts',
750
+ 'edit_shop_discount_terms',
751
+ 'edit_shop_order_terms',
752
+ 'edit_shop_orders',
753
+ 'edit_shop_payments',
754
+ 'edit_shop_payment_terms',
755
+ 'export_shop_payments',
756
+ 'export_shop_reports',
757
+ 'import_shop_discounts',
758
+ 'import_shop_payments',
759
+ 'manage_product_terms',
760
+ 'manage_shop_coupon_terms',
761
+ 'manage_shop_discounts',
762
+ 'manage_shop_discount_terms',
763
+ 'manage_shop_payment_terms',
764
+ 'manage_shop_order_terms',
765
+ 'manage_shop_settings',
766
+ 'manage_woocommerce',
767
+ 'publish_products',
768
+ 'publish_shop_coupons',
769
+ 'publish_shop_discounts',
770
+ 'publish_shop_orders',
771
+ 'publish_shop_payments',
772
+ 'read_private_products',
773
+ 'read_private_shop_coupons',
774
+ 'read_private_shop_discounts',
775
+ 'read_private_shop_payments',
776
+ 'read_private_shop_orders',
777
+ 'view_admin_dashboard',
778
+ 'view_shop_discount_stats',
779
+ 'view_shop_payment_stats',
780
+ 'view_shop_reports',
781
+ 'view_shop_sensitive_data',
782
+ 'view_woocommerce_reports',
783
+ )
784
+ );
785
+ }
786
+
787
+ $plugin_caps = apply_filters('cme_plugin_capabilities', $plugin_caps);
788
+
789
+ foreach($plugin_caps as $plugin => $__plugin_caps) {
790
+ $_plugin_caps = array_fill_keys($__plugin_caps, true);
791
+
792
+ echo '<h3 class="cme-cap-section">' . sprintf(__( '%s Capabilities', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
793
+ echo '<table class="form-table cme-checklist"><tr>';
794
+
795
+ $checks_per_row = get_option( 'cme_form-rows', 5 );
796
+ $i = 0; $first_row = true;
797
+
798
+ foreach( array_keys($_plugin_caps) as $cap_name ) {
799
+ if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) ) {
800
+ continue;
801
+ }
802
+
803
+ if ( ! $is_administrator && ! current_user_can($cap_name) )
804
+ continue;
805
+
806
+ if ( $i == $checks_per_row ) {
807
+ echo '</tr><tr>';
808
+ $i = 0;
809
+ }
810
+
811
+ if ( ! isset( $rcaps[$cap_name] ) )
812
+ $class = 'cap-no';
813
+ else
814
+ $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
815
+
816
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
817
+ $class .= ' cap-metagroup';
818
+ $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
819
+ } else {
820
+ $title_text = $cap_name;
821
+ }
822
+
823
+ $disabled = '';
824
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
825
+ $title = $title_text;
826
+ ?>
827
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
828
+ <span>
829
+ <?php
830
+ echo str_replace( '_', ' ', $cap_name );
831
+ ?>
832
+ </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
833
+ <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
834
+ <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
835
+ <?php endif; ?>
836
+ </td>
837
+
838
+ <?php
839
+ ++$i;
840
+ }
841
+
842
+ if ( $i == $checks_per_row ) {
843
+ echo '</tr>';
844
+ $i = 0;
845
+ } elseif ( ! $first_row ) {
846
+ // Now close a wellformed table
847
+ for ( $i; $i < $checks_per_row; $i++ ){
848
+ echo '<td>&nbsp;</td>';
849
+ }
850
+ echo '</tr>';
851
+ }
852
+ ?>
853
+
854
+ <tr class="cme-bulk-select">
855
+ <td colspan="<?php echo $checks_per_row;?>">
856
+ <span style="float:right">
857
+ <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
858
+ </span>
859
+ </td></tr>
860
+
861
+ </table>
862
+ <?php
863
+ }
864
+
865
+
866
+ if (array_intersect(array_keys(array_filter($type_metacaps)), $all_capabilities) && array_intersect_key($type_metacaps, array_filter($rcaps))) {
867
+
868
+ echo '<h3 class="cme-cap-section">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
869
+ ?>
870
+
871
+ <div>
872
+ <span class="cme-subtext">
873
+ <?php _e('The following entries have no effect. Please assign desired capabilities in the Read / Edit / Delete grid above.', 'capsman-enhanced');?>
874
+ </span>
875
+ </div>
876
+
877
+ <table class="form-table cme-checklist">
878
+ <tr>
879
+ <?php
880
+ $i = 0; $first_row = true;
881
+
882
+ foreach( $all_capabilities as $cap_name ) {
883
+ if ( ! isset($this->capabilities[$cap_name]) )
884
+ $this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
885
+ }
886
+
887
+ uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
888
+
889
+ foreach ( $this->capabilities as $cap_name => $cap ) :
890
+ if (!isset($type_metacaps[$cap_name]) || empty($rcaps[$cap_name])) {
891
+ continue;
892
+ }
893
+
894
+ if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
895
+ continue;
896
+ }
897
+
898
+ if ( $i == $checks_per_row ) {
899
+ echo '</tr><tr>';
900
+ $i = 0; $first_row = false;
901
+ }
902
+
903
+ if ( ! isset( $rcaps[$cap_name] ) )
904
+ $class = 'cap-no';
905
+ else
906
+ $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
907
+
908
+ $title_text = $cap_name;
909
+
910
+ $disabled = '';
911
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
912
+ ?>
913
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
914
+ <span>
915
+ <?php
916
+ echo str_replace( '_', ' ', $cap );
917
+ ?>
918
+ </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
919
+ <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
920
+ <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
921
+ <?php endif; ?>
922
+ </td>
923
+ <?php
924
+ $i++;
925
+ endforeach;
926
+
927
+ if ( ! empty($lock_manage_caps_capability) ) {
928
+ echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
929
+ }
930
+
931
+ if ( $i == $checks_per_row ) {
932
+ echo '</tr><tr>';
933
+ $i = 0;
934
+ } else {
935
+ if ( ! $first_row ) {
936
+ // Now close a wellformed table
937
+ for ( $i; $i < $checks_per_row; $i++ ){
938
+ echo '<td>&nbsp;</td>';
939
+ }
940
+ echo '</tr>';
941
+ }
942
+ }
943
+ ?>
944
+
945
+ </table><p>&nbsp;</p>
946
+ <?php
947
+ } // endif any invalid caps
948
+
949
+
950
+ echo '<p>&nbsp;</p><h3 class="cme-cap-section">' . __( 'Additional Capabilities', 'capsman-enhanced' ) . '</h3>';
951
+
952
+ ?>
953
+ <table class="form-table cme-checklist">
954
+ <tr>
955
+ <?php
956
+ $i = 0; $first_row = true;
957
+
958
+ foreach( $all_capabilities as $cap_name ) {
959
+ if ( ! isset($this->capabilities[$cap_name]) )
960
+ $this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
961
+ }
962
+
963
+ uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
964
+
965
+ $additional_caps = apply_filters('publishpress_caps_manage_additional_caps', $this->capabilities);
966
+
967
+ foreach ($additional_caps as $cap_name => $cap) :
968
+
969
+ if ((isset($type_caps[$cap_name]) && !isset($type_metacaps[$cap_name]))
970
+ || isset($core_caps[$cap_name])
971
+ || (isset($type_metacaps[$cap_name]) && !empty($rcaps[$cap_name])) ) {
972
+ continue;
973
+ }
974
+
975
+ if (!isset($type_metacaps[$cap_name]) || !empty($rcaps[$cap_name])) {
976
+ foreach(array_keys($plugin_caps) as $plugin) {
977
+ if ( in_array( $cap_name, $plugin_caps[$plugin]) ) {
978
+ continue 2;
979
+ }
980
+ }
981
+ }
982
+
983
+ if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
984
+ continue;
985
+ }
986
+
987
+ // Levels are not shown.
988
+ if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
989
+ continue;
990
+ }
991
+
992
+ if ( $i == $checks_per_row ) {
993
+ echo '</tr><tr>';
994
+ $i = 0; $first_row = false;
995
+ }
996
+
997
+ if ( ! isset( $rcaps[$cap_name] ) )
998
+ $class = 'cap-no';
999
+ else
1000
+ $class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
1001
+
1002
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
1003
+ $class .= ' cap-metagroup';
1004
+ $title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
1005
+ } else {
1006
+ $title_text = $cap_name;
1007
+ }
1008
+
1009
+ $disabled = '';
1010
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
1011
+
1012
+ if ( 'manage_capabilities' == $cap_name ) {
1013
+ if (!current_user_can('administrator') && (!is_multisite() || !is_super_admin())) {
1014
+ continue;
1015
+ } elseif ( 'administrator' == $default ) {
1016
+ $class .= ' cap-locked';
1017
+ $lock_manage_caps_capability = true;
1018
+ $disabled = 'disabled="disabled"';
1019
+ }
1020
+ }
1021
+ ?>
1022
+ <td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" autocomplete="off" value="1" <?php echo $checked . $disabled;?> />
1023
+ <span>
1024
+ <?php
1025
+ echo str_replace( '_', ' ', $cap );
1026
+ ?>
1027
+ </span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
1028
+ <?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
1029
+ <input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
1030
+ <?php endif; ?>
1031
+ </td>
1032
+ <?php
1033
+ $i++;
1034
+ endforeach;
1035
+
1036
+ if ( ! empty($lock_manage_caps_capability) ) {
1037
+ echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
1038
+ }
1039
+
1040
+ if ( $i == $checks_per_row ) {
1041
+ echo '</tr><tr>';
1042
+ $i = 0;
1043
+ } else {
1044
+ if ( ! $first_row ) {
1045
+ // Now close a wellformed table
1046
+ for ( $i; $i < $checks_per_row; $i++ ){
1047
+ echo '<td>&nbsp;</td>';
1048
+ }
1049
+ echo '</tr>';
1050
+ }
1051
+ }
1052
+ ?>
1053
+
1054
+ <tr class="cme-bulk-select">
1055
+ <td colspan="<?php echo $checks_per_row;?>">
1056
+ <span style="float:right">
1057
+ <input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" autocomplete="off" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
1058
+ </span>
1059
+ </td></tr>
1060
+
1061
+ </table>
1062
+
1063
+ <div>
1064
+ <?php
1065
+ $level = ak_caps2level($rcaps);
1066
+ ?>
1067
+ <span title="<?php _e('Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities.', 'capsman-enhanced');?>">
1068
+
1069
+ <?php (in_array(get_locale(), ['en_EN', 'en_US'])) ? printf('Role Level:') : _e('Level:', 'capsman-enhanced');?> <select name="level">
1070
+ <?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
1071
+ <option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>>&nbsp;<?php echo $l; ?>&nbsp;</option>
1072
+ <?php }
1073
+ ?>
1074
+ </select>
1075
+ </span>
1076
+
1077
+ </div>
1078
+ </dd>
1079
+ </dl>
1080
+
1081
+ <?php
1082
+ $support_pp_only_roles = defined('PRESSPERMIT_ACTIVE');
1083
+ cme_network_role_ui( $default );
1084
+ ?>
1085
+
1086
+ <p class="submit">
1087
+ <input type="hidden" name="action" value="update" />
1088
+ <input type="hidden" name="current" value="<?php echo $default; ?>" />
1089
+ <input type="submit" name="SaveRole" value="<?php echo (in_array(get_locale(), ['en_EN', 'en_US'])) ? 'Save Capabilities' : _e('Save Changes', 'capsman-enhanced');?>" class="button-primary" /> &nbsp;
1090
+
1091
+ <?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
1092
+ <a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}&amp;action=delete&amp;role={$default}", 'delete-role_' . $default); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete the %s role.\n\n 'Cancel' to stop, 'OK' to delete.", 'capsman-enhanced'), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', 'capsman-enhanced')?></a>
1093
+ <?php endif; ?>
1094
+ </p>
1095
+
1096
+ </td>
1097
+ <td class="sidebar">
1098
+ <?php do_action('publishpress-caps_sidebar_top');?>
1099
+
1100
+ <dl>
1101
+ <dt><?php _e('Add Capability', 'capsman-enhanced'); ?></dt>
1102
+ <dd style="text-align:center;">
1103
+ <p><input type="text" name="capability-name" class="regular-text" placeholder="<?php echo 'capability_name';?>" /><br />
1104
+ <input type="submit" name="AddCap" value="<?php _e('Add to role', 'capsman-enhanced') ?>" class="button" /></p>
1105
+ </dd>
1106
+ </dl>
1107
+
1108
+ <?php
1109
+ $pp_ui->pp_types_ui( $defined['type'] );
1110
+ $pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
1111
+
1112
+ do_action('publishpress-caps_sidebar_bottom');
1113
+ ?>
1114
+
1115
+ <dl>
1116
+ <dt><?php (!in_array(get_locale(), ['en_EN', 'en_US'])) ? _e('Copy this role to', 'capsman-enhanced') : printf('Copy %s Role', translate_user_role($roles[$default])); ?></dt>
1117
+ <dd style="text-align:center;">
1118
+ <?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
1119
+ <p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
1120
+
1121
+ <?php if( $support_pp_only_roles ) : ?>
1122
+ <label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" autocomplete="off" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
1123
+ <?php endif; ?>
1124
+
1125
+ <br />
1126
+ <input type="submit" name="CopyRole" value="<?php _e('Copy', 'capsman-enhanced') ?>" class="button" />
1127
+ </p>
1128
+ </dd>
1129
+ </dl>
1130
+
1131
+ <dl>
1132
+ <dt><?php _e('Rename Role', 'capsman-enhanced'); ?></dt>
1133
+ <dd style="text-align:center;">
1134
+ <p><input type="text" name="rename-name" class="regular-text" placeholder="<?php _e('New Role Name', 'capsman-enhanced') ?>" />
1135
+
1136
+ <br />
1137
+ <input type="submit" name="RenameRole" value="<?php _e('Rename', 'capsman-enhanced') ?>" class="button" />
1138
+ </p>
1139
+ </dd>
1140
+ </dl>
1141
+ </td>
1142
+ </tr>
1143
+ </table>
1144
+ </fieldset>
1145
+ </form>
1146
+
1147
+ <?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
1148
+ cme_publishpressFooter();
1149
+ }
1150
+ ?>
1151
+ </div>
1152
+
1153
+ <?php
1154
+ function cme_network_role_ui( $default ) {
1155
+ if (!is_multisite() || !is_super_admin() || !is_main_site()) {
1156
+ return false;
1157
+ }
1158
+ ?>
1159
+
1160
+ <div style="float:right;margin-left:10px;margin-right:10px">
1161
+ <?php
1162
+ if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
1163
+ $autocreate_roles = array();
1164
+
1165
+ $checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
1166
+ ?>
1167
+ <div style="margin-bottom: 5px">
1168
+ <label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" autocomplete="off" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
1169
+ </div>
1170
+ <div>
1171
+ <label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" autocomplete="off" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
1172
+ </div>
1173
+ <div>
1174
+ <label for="cme_net_sync_options" title="<?php echo esc_attr(__('Copy option settings to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_options" id="cme_net_sync_options" autocomplete="off" value="1"> <?php _e('sync options to all sites now', 'capsman-enhanced'); ?> </label>
1175
+ </div>
1176
+ </div>
1177
+ <?php
1178
+ return true;
1179
+ }
1180
+
1181
+ function cme_plugin_info_url( $plugin_slug ) {
1182
+ $_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
1183
+ return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
1184
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/backup-handler.php CHANGED
@@ -1,10 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Process update operations from Backup screen
6
- *
7
- */
8
 
9
  class Capsman_BackupHandler
10
  {
1
  <?php
 
 
 
 
 
 
2
 
3
  class Capsman_BackupHandler
4
  {
includes/backup.php CHANGED
@@ -222,7 +222,7 @@ $auto_backups = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb-
222
  ?>
223
 
224
  <h4<?php echo $role_class;?>><?php printf(__('%s (level %s)', 'capsman-enhanced'), translate_user_role($role_caption), $level); ?></h4>
225
-
226
  <?php
227
  $items = [];
228
  $any_changes = false;
222
  ?>
223
 
224
  <h4<?php echo $role_class;?>><?php printf(__('%s (level %s)', 'capsman-enhanced'), translate_user_role($role_caption), $level); ?></h4>
225
+
226
  <?php
227
  $items = [];
228
  $any_changes = false;
includes/cap-helper.php CHANGED
@@ -1,13 +1,6 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
- /*
5
- * PublishPress Capabilities [Free]
6
- *
7
- * For post types and taxonomies with "Type-Specific Capabilities" enabled, modify defined capabilities to be unique
8
- *
9
- */
10
-
11
  // @todo: port improvements back to PP Core
12
 
13
  class CME_Cap_Helper {
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
 
 
 
 
 
 
 
4
  // @todo: port improvements back to PP Core
5
 
6
  class CME_Cap_Helper {
includes/features/admin-features.php DELETED
@@ -1,303 +0,0 @@
1
- <?php
2
- /**
3
- * Capability Manager Admin Features.
4
- * Hide and block selected Admin Features like toolbar, dashboard widgets etc per-role.
5
- *
6
- * Copyright 2020, PublishPress <help@publishpress.com>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- */
20
-
21
- require_once(dirname(CME_FILE) . '/includes/features/restrict-admin-features.php');
22
-
23
- global $capsman;
24
-
25
- $roles = $capsman->roles;
26
- $default_role = $capsman->get_last_role();
27
-
28
-
29
- $disabled_admin_items = !empty(get_option('capsman_disabled_admin_features')) ? (array)get_option('capsman_disabled_admin_features') : [];
30
- $disabled_admin_items = array_key_exists($default_role, $disabled_admin_items) ? (array)$disabled_admin_items[$default_role] : [];
31
-
32
- $admin_features_elements = PP_Capabilities_Admin_Features::elementsLayout();
33
- ?>
34
-
35
- <div class="wrap publishpress-caps-manage pressshack-admin-wrapper pp-capability-menus-wrapper">
36
- <div id="icon-capsman-admin" class="icon32"></div>
37
- <h2><?php _e('Admin Feature Restrictions', 'capabilities-pro'); ?></h2>
38
-
39
- <form method="post" id="ppc-admin-features-form" action="admin.php?page=pp-capabilities-admin-features">
40
- <?php wp_nonce_field('pp-capabilities-admin-features'); ?>
41
-
42
- <fieldset>
43
- <table id="akmin">
44
- <tr>
45
- <td class="content">
46
-
47
- <div class="publishpress-headline">
48
- <span class="cme-subtext">
49
- <span class='pp-capability-role-caption'>
50
- <?php
51
- _e('Note: You are only restricting access to admin features screens. Some plugins may also add features to other areas of WordPress.',
52
- 'capabilities-pro');
53
- ?>
54
- </span>
55
- </span>
56
- </div>
57
- <div class="publishpress-filters">
58
- <select name="ppc-admin-features-role" class="ppc-admin-features-role">
59
- <?php
60
- foreach ($roles as $role => $name) :
61
- $name = translate_user_role($name);
62
- ?>
63
- <option value="<?php echo $role; ?>" <?php selected($default_role,
64
- $role); ?>><?php echo $name; ?></option>
65
- <?php
66
- endforeach;
67
- ?>
68
- </select> &nbsp;
69
-
70
- <img class="loading" src="<?php echo $capsman->mod_url; ?>/images/wpspin_light.gif"
71
- style="display: none">
72
-
73
- <input type="submit" name="admin-features-submit"
74
- value="<?php _e('Save Changes', 'capabilities-pro') ?>"
75
- class="button-primary ppc-admin-features-submit" style="float:right"/>
76
- </div>
77
-
78
- <div id="pp-capability-menu-wrapper" class="postbox">
79
- <div class="pp-capability-menus">
80
-
81
- <div class="pp-capability-menus-wrap">
82
- <div id="pp-capability-menus-general"
83
- class="pp-capability-menus-content editable-role" style="display: block;">
84
-
85
- <table
86
- class="wp-list-table widefat fixed striped pp-capability-menus-select">
87
-
88
- <thead>
89
- <tr class="ppc-menu-row parent-menu">
90
-
91
- <td class="restrict-column ppc-menu-checkbox">
92
- <input id="check-all-item"
93
- class="check-item check-all-menu-item" type="checkbox"/>
94
- </td>
95
- <td class="menu-column ppc-menu-item">
96
- <label for="check-all-item">
97
- <span class="menu-item-link check-all-menu-link">
98
- <strong>
99
- <?php _e('Toggle all', 'capabilities-pro'); ?>
100
- </strong>
101
- </span></label>
102
- </td>
103
-
104
- </tr>
105
- </thead>
106
-
107
- <tfoot>
108
- <tr class="ppc-menu-row parent-menu">
109
-
110
- <td class="restrict-column ppc-menu-checkbox">
111
- <input id="check-all-item-2"
112
- class="check-item check-all-menu-item" type="checkbox"/>
113
- </td>
114
- <td class="menu-column ppc-menu-item">
115
- <label for="check-all-item-2">
116
- <span class="menu-item-link check-all-menu-link">
117
- <strong>
118
- <?php _e('Toggle all', 'capabilities-pro'); ?>
119
- </strong>
120
- </span>
121
- </label>
122
- </td>
123
-
124
- </tr>
125
- </tfoot>
126
-
127
- <tbody>
128
-
129
- <?php
130
- $icon_list = (array)PP_Capabilities_Admin_Features::elementLayoutItemIcons();
131
-
132
- $sn = 0;
133
- foreach ($admin_features_elements as $section_title => $section_elements) {
134
- $sn++;
135
- $section_slug = strtolower(ppc_remove_non_alphanumeric_space_characters($section_title));
136
- $icon_name = isset($icon_list[$section_slug]) ? $icon_list[$section_slug] : '&mdash;';
137
- ?>
138
-
139
-
140
- <tr class="ppc-menu-row parent-menu">
141
-
142
- <td class="features-section-header" colspan="2">
143
- <strong><i
144
- class="dashicons dashicons-<?php echo $icon_name ?>"></i> <?php echo $section_title; ?>
145
- </strong>
146
- </td>
147
-
148
- </tr>
149
-
150
- <?php
151
- foreach ($section_elements as $section_id => $section_array) {
152
- $sn++;
153
- if (!$section_id) {
154
- continue;
155
- }
156
- $item_name = $section_array['label'];
157
- $item_action = $section_array['action'];
158
- $restrict_value = $item_action.'||'.$section_id;
159
- if($item_action === 'ppc_dashboard_widget'){
160
- $restrict_value .= '||'.$section_array['context'];
161
- }
162
- ?>
163
-
164
- <tr class="ppc-menu-row child-menu">
165
-
166
- <td class="restrict-column ppc-menu-checkbox">
167
- <input
168
- id="check-item-<?php echo $sn; ?>"
169
- class="check-item" type="checkbox"
170
- name="capsman_disabled_admin_features[]"
171
- value="<?php echo $restrict_value; ?>"
172
- <?php echo (in_array($restrict_value, $disabled_admin_items)) ? 'checked' : ''; ?>/>
173
- </td>
174
- <td class="menu-column ppc-menu-item'">
175
-
176
- <label for="check-item-<?php echo $sn; ?>">
177
- <span
178
- class="menu-item-link<?php echo (in_array($restrict_value,
179
- $disabled_admin_items)) ? ' restricted' : ''; ?>">
180
- <strong>
181
- <?php
182
- if ((isset($section_array['step']) && $section_array['step'] > 0) && isset($section_array['parent']) && !empty($section_array['parent'])) {
183
- $step_margin = $section_array['step'] * 20;
184
- echo '<span style="margin-left: ' . $step_margin . 'px;"></span>';
185
- echo ' ' . $section_array['position'] . '. ';
186
- } else {
187
- if (isset($icon_list[$section_id])) {
188
- echo '<i class="dashicons dashicons-' . $icon_list[$section_id] . '"></i>';
189
- } else {
190
- echo '&mdash;';
191
- }
192
- }
193
- ?>
194
- <?php echo $item_name; ?>
195
- </strong></span>
196
- </label>
197
- </td>
198
-
199
- </tr>
200
-
201
- <?php
202
- }//end $section_elements subsection loop
203
- }// end $admin_features_elements section loop
204
-
205
- ?>
206
- </tbody>
207
- </table>
208
- </div>
209
-
210
- </div>
211
- </div>
212
- </div>
213
- <input type="submit" name="admin-features-submit"
214
- value="<?php _e('Save Changes', 'capabilities-pro') ?>"
215
- class="button-primary ppc-admin-features-submit"/>
216
- </td>
217
- </tr>
218
- </table>
219
-
220
- </fieldset>
221
-
222
- </form>
223
-
224
- <script type="text/javascript">
225
- /* <![CDATA[ */
226
- jQuery(document).ready(function($) {
227
-
228
- // -------------------------------------------------------------
229
- // reload page for instant reflection if user is updating own role
230
- // -------------------------------------------------------------
231
- <?php if(!empty($ppc_page_reload) && (int)$ppc_page_reload === 1){ ?>
232
- window.location = '<?php echo admin_url('admin.php?page=pp-capabilities-admin-features&role=' . $default_role . ''); ?>'
233
- <?php } ?>
234
-
235
- // -------------------------------------------------------------
236
- // Set form action attribute to include role
237
- // -------------------------------------------------------------
238
- $('#ppc-admin-features-form').attr('action', '<?php echo admin_url('admin.php?page=pp-capabilities-admin-features&role=' . $default_role . ''); ?>')
239
-
240
- // -------------------------------------------------------------
241
- // Instant restricted item class
242
- // -------------------------------------------------------------
243
- $(document).on('change', '.pp-capability-menus-wrapper .ppc-menu-row .check-item', function() {
244
-
245
- if ($(this).is(':checked')) {
246
- //add class if value is checked
247
- $(this).closest('tr').find('.menu-item-link').addClass('restricted')
248
-
249
- //toggle all checkbox
250
- if ($(this).hasClass('check-all-menu-item')) {
251
- $("input[type='checkbox'][name='capsman_disabled_admin_features[]']").prop('checked', true)
252
- $('.menu-item-link').addClass('restricted')
253
- } else {
254
- $('.check-all-menu-link').removeClass('restricted')
255
- $('.check-all-menu-item').prop('checked', false)
256
- }
257
-
258
- } else {
259
- //unchecked value
260
- $(this).closest('tr').find('.menu-item-link').removeClass('restricted')
261
-
262
- //toggle all checkbox
263
- if ($(this).hasClass('check-all-menu-item')) {
264
- $("input[type='checkbox'][name='capsman_disabled_admin_features[]']").prop('checked', false)
265
- $('.menu-item-link').removeClass('restricted')
266
- } else {
267
- $('.check-all-menu-link').removeClass('restricted')
268
- $('.check-all-menu-item').prop('checked', false)
269
- }
270
-
271
- }
272
-
273
- })
274
-
275
- // -------------------------------------------------------------
276
- // Load selected roles menu
277
- // -------------------------------------------------------------
278
- $(document).on('change', '.pp-capability-menus-wrapper .ppc-admin-features-role', function() {
279
-
280
- //disable select
281
- $('.pp-capability-menus-wrapper .ppc-admin-features-role').attr('disabled', true)
282
-
283
- //hide button
284
- $('.pp-capability-menus-wrapper .ppc-admin-features-submit').hide()
285
-
286
- //show loading
287
- $('#pp-capability-menu-wrapper').hide()
288
- $('div.publishpress-caps-manage img.loading').show()
289
-
290
- //go to url
291
- window.location = '<?php echo admin_url('admin.php?page=pp-capabilities-admin-features&role='); ?>' + $(this).val() + ''
292
-
293
- })
294
- })
295
- /* ]]> */
296
- </script>
297
-
298
- <?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
299
- cme_publishpressFooter();
300
- }
301
- ?>
302
- </div>
303
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/editor-features-classic.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- $ce_elements = PP_Capabilities_Post_Features::elementsLayoutClassic();
3
-
4
- $ce_post_disabled = [];
5
-
6
- $def_post_types = apply_filters('pp_capabilities_feature_post_types', ['post', 'page']);
7
-
8
- foreach($def_post_types as $post_type) {
9
- $_disabled = get_option("capsman_feature_restrict_classic_{$post_type}", []);
10
- $ce_post_disabled[$post_type] = !empty($_disabled[$default_role]) ? (array)$_disabled[$default_role] : [];
11
- }
12
- ?>
13
-
14
- <table class="wp-list-table widefat fixed striped pp-capability-menus-select editor-features-classic" <?php if (empty($_REQUEST['ppc-tab']) || ('classic' != $_REQUEST['ppc-tab'])) echo 'style="display:none;"';?>>
15
- <?php foreach(['thead', 'tfoot'] as $tag):?>
16
- <<?php echo $tag;?>>
17
- <tr>
18
- <th class="menu-column"><?php if ('thead' == $tag || !defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {_e('Classic Editor Screen', 'capsman-enhanced');}?></th>
19
-
20
- <?php foreach($def_post_types as $post_type) :
21
- $type_obj = get_post_type_object($post_type);
22
- ?>
23
- <th class="restrict-column ppc-menu-row"><?php printf(__('%s Restrict', 'capsman-enhanced'), $type_obj->labels->singular_name);?><br />
24
- <input class="check-item classic check-all-menu-item" type="checkbox" title="<?php _e('Toggle all', 'capsman-enhanced');?>" data-pp_type="<?php echo $post_type;?>" />
25
- </th>
26
- <?php endforeach;?>
27
- </tr>
28
- </<?php echo $tag;?>>
29
- <?php endforeach;?>
30
-
31
- <tbody>
32
- <?php
33
- foreach ($ce_elements as $section_title => $arr) {
34
- $section_slug = strtolower(ppc_remove_non_alphanumeric_space_characters($section_title));
35
- ?>
36
- <tr class="ppc-menu-row parent-menu">
37
- <td colspan="<?php echo (count($def_post_types) + 1);?>">
38
- <h4 class="ppc-menu-row-section"><?php echo $section_title;?></h4>
39
- <?php
40
- /**
41
- * Add support for section description
42
- *
43
- * @param array $def_post_types Post type.
44
- * @param array $ce_elements All classic editor elements.
45
- * @param array $ce_post_disabled All classic editor disabled post type element.
46
- *
47
- * @since 2.1.1
48
- */
49
- do_action( "pp_capabilities_feature_classic_{$section_slug}_section", $def_post_types, $ce_elements, $ce_post_disabled );
50
- ?>
51
- </td>
52
- </tr>
53
-
54
- <?php
55
- foreach ($arr as $feature_slug => $arr_feature) {
56
- if (!$feature_slug) {
57
- continue;
58
- }
59
- ?>
60
- <tr class="ppc-menu-row parent-menu">
61
- <td class="menu-column ppc-menu-item">
62
- <span class="classic menu-item-link<?php echo (in_array($feature_slug, $ce_post_disabled['post'])) ? ' restricted' : ''; ?>">
63
- <strong><i class="dashicons dashicons-arrow-right"></i>
64
- <?php echo $arr_feature['label']; ?>
65
- </strong></span>
66
- </td>
67
-
68
- <?php foreach($def_post_types as $post_type) :?>
69
- <td class="restrict-column ppc-menu-checkbox">
70
- <input id="cb_<?php echo $post_type . '-' . str_replace(['#', '.'], '_', $feature_slug);?>" class="check-item" type="checkbox"
71
- name="capsman_feature_restrict_classic_<?php echo $post_type;?>[]"
72
- value="<?php echo $feature_slug; ?>" <?php checked(in_array($feature_slug, $ce_post_disabled[$post_type]));?> />
73
- </td>
74
- <?php endforeach;?>
75
- </tr>
76
- <?php
77
- }
78
- }
79
-
80
- do_action('pp_capabilities_features_classic_after_table_tr');
81
- ?>
82
-
83
- </tbody>
84
- </table>
85
-
86
- <?php
87
- do_action('pp_capabilities_features_classic_after_table');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/editor-features-gutenberg.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- $gutenberg_elements = PP_Capabilities_Post_Features::elementsLayout();
3
-
4
- $gutenberg_post_disabled = [];
5
-
6
- $def_post_types = apply_filters('pp_capabilities_feature_post_types', ['post', 'page']);
7
-
8
- foreach($def_post_types as $post_type) {
9
- $_disabled = get_option("capsman_feature_restrict_{$post_type}", []);
10
- $gutenberg_post_disabled[$post_type] = !empty($_disabled[$default_role]) ? (array)$_disabled[$default_role] : [];
11
- }
12
- ?>
13
-
14
- <table class="wp-list-table widefat fixed striped pp-capability-menus-select editor-features-gutenberg" <?php if (!empty($_REQUEST['ppc-tab']) && ('gutenberg' != $_REQUEST['ppc-tab'])) echo 'style="display:none;"';?>>
15
- <?php foreach(['thead', 'tfoot'] as $tag):?>
16
- <<?php echo $tag;?>>
17
- <tr>
18
- <th class="menu-column"><?php if ('thead' == $tag) {_e('Gutenberg Screen', 'capsman-enhanced');}?></th>
19
-
20
- <?php foreach($def_post_types as $post_type) :
21
- $type_obj = get_post_type_object($post_type);
22
- ?>
23
- <th class="restrict-column ppc-menu-row"><?php printf(__('%s Restrict', 'capsman-enhanced'), $type_obj->labels->singular_name);?><br />
24
- <input class="check-item gutenberg check-all-menu-item" type="checkbox" title="<?php _e('Toggle all', 'capsman-enhanced');?>" data-pp_type="<?php echo $post_type;?>" />
25
- </th>
26
- <?php endforeach;?>
27
- </tr>
28
- </<?php echo $tag;?>>
29
- <?php endforeach;?>
30
-
31
- <tbody>
32
- <?php
33
- foreach ($gutenberg_elements as $section_title => $arr) {
34
- $section_slug = strtolower(ppc_remove_non_alphanumeric_space_characters($section_title));
35
- ?>
36
- <tr class="ppc-menu-row parent-menu">
37
- <td colspan="<?php echo (count($def_post_types) + 1);?>">
38
- <h4 class="ppc-menu-row-section"><?php echo $section_title;?></h4>
39
- <?php
40
- /**
41
- * Add support for section description
42
- *
43
- * @param array $def_post_types Post type.
44
- * @param array $gutenberg_elements All gutenberg elements.
45
- * @param array $gutenberg_post_disabled All gutenberg disabled post type element.
46
- *
47
- * @since 2.1.1
48
- */
49
- do_action( "pp_capabilities_feature_gutenberg_{$section_slug}_section", $def_post_types, $gutenberg_elements, $gutenberg_post_disabled );
50
- ?>
51
- </td>
52
- </tr>
53
-
54
- <?php
55
- foreach ($arr as $feature_slug => $arr_feature) {
56
- ?>
57
- <tr class="ppc-menu-row parent-menu">
58
- <td class="menu-column ppc-menu-item">
59
- <span class="gutenberg menu-item-link<?php checked(in_array($feature_slug, $gutenberg_post_disabled['post']), true, 'restricted');?>">
60
- <strong><i class="dashicons dashicons-arrow-right"></i>
61
- <?php echo $arr_feature['label']; ?>
62
- </strong></span>
63
- </td>
64
-
65
- <?php foreach($def_post_types as $post_type) :?>
66
- <td class="restrict-column ppc-menu-checkbox">
67
- <input id="check-item-<?php echo "{$post_type}-{$feature_slug}";?>" class="check-item" type="checkbox"
68
- name="capsman_feature_restrict_<?php echo $post_type;?>[]"
69
- value="<?php echo $feature_slug;?>"<?php checked(in_array($feature_slug, $gutenberg_post_disabled[$post_type]));?> />
70
- </td>
71
- <?php endforeach;?>
72
- </tr>
73
- <?php
74
- }
75
- }
76
-
77
- do_action('pp_capabilities_features_gutenberg_after_table_tr');
78
- ?>
79
-
80
- </tbody>
81
- </table>
82
-
83
- <?php
84
- do_action('pp_capabilities_features_gutenberg_after_table');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/editor-features.php DELETED
@@ -1,235 +0,0 @@
1
- <?php
2
- /**
3
- * Capability Manager Edit Posts Permission.
4
- * Edit Posts permission and visibility per roles.
5
- *
6
- * Copyright 2021, PublishPress <help@publishpress.com>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- */
20
-
21
- require_once (dirname(CME_FILE) . '/includes/features/restrict-editor-features.php');
22
-
23
- global $capsman;
24
- $roles = $capsman->roles;
25
-
26
- $default_role = $capsman->get_last_role();
27
-
28
- $classic_editor = pp_capabilities_is_classic_editor_available();
29
- ?>
30
- <div class="wrap publishpress-caps-manage pressshack-admin-wrapper pp-capability-menus-wrapper">
31
- <div id="icon-capsman-admin" class="icon32"></div>
32
- <h2><?php _e('Editor Feature Restriction', 'capsman-enhanced'); ?></h2>
33
-
34
- <form method="post" id="ppc-editor-features-form"
35
- action="admin.php?page=pp-capabilities-editor-features">
36
- <?php wp_nonce_field('pp-capabilities-editor-features'); ?>
37
-
38
- <table id="akmin">
39
- <tr>
40
- <td class="content">
41
-
42
- <div class="publishpress-headline">
43
- <span class="cme-subtext">
44
- <span class='pp-capability-role-caption'>
45
- <?php
46
- _e('Select editor features to remove. Note that this screen cannot be used to grant additional features to any role.', 'capabilities-pro');
47
- ?>
48
- </span>
49
- </span>
50
- </div>
51
-
52
- <div class="publishpress-filters">
53
- <select name="ppc-editor-features-role" class="ppc-editor-features-role">
54
- <?php
55
- foreach ($roles as $role => $name) :
56
- $name = translate_user_role($name);
57
- ?>
58
- <option value="<?php echo $role;?>" <?php selected($default_role, $role);?>><?php echo $name;?></option>
59
- <?php
60
- endforeach;
61
- ?>
62
- </select> &nbsp;
63
-
64
- <img class="loading" src="<?php echo $capsman->mod_url; ?>/images/wpspin_light.gif" style="display: none">
65
-
66
- <input type="submit" name="editor-features-submit"
67
- value="<?php _e('Save Changes', 'capabilities-pro') ?>"
68
- class="button-primary ppc-editor-features-submit" style="float:right" />
69
-
70
- <input type="hidden" name="ppc-tab" value="<?php echo (!empty($_REQUEST['ppc-tab'])) ? sanitize_key($_REQUEST['ppc-tab']) : 'gutenberg';?>" />
71
- </div>
72
-
73
- <script type="text/javascript">
74
- /* <![CDATA[ */
75
- jQuery(document).ready(function($) {
76
- $('li.gutenberg-tab').click(function() {
77
- $('div.publishpress-filters input[name=ppc-tab]').val('gutenberg');
78
- });
79
-
80
- $('li.classic-tab').click(function() {
81
- $('div.publishpress-filters input[name=ppc-tab]').val('classic');
82
- });
83
- });
84
- /* ]]> */
85
- </script>
86
-
87
- <?php if ($classic_editor) { ?>
88
- <ul class="nav-tab-wrapper">
89
- <li class="editor-features-tab gutenberg-tab nav-tab <?php if (empty($_REQUEST['ppc-tab']) || ('gutenberg' == $_REQUEST['ppc-tab'])) echo 'nav-tab-active';?>"
90
- data-tab=".editor-features-gutenberg"><a href="#"><?php _e('Gutenberg', 'capsman-enhanced') ?></a></li>
91
-
92
- <li class="editor-features-tab classic-tab nav-tab <?php if (!empty($_REQUEST['ppc-tab']) && ('classic' == $_REQUEST['ppc-tab'])) echo 'nav-tab-active';?>"
93
- data-tab=".editor-features-classic"><a href="#"><?php _e('Classic', 'capsman-enhanced') ?></a></li>
94
- </ul>
95
- <?php } ?>
96
-
97
- <div id="pp-capability-menu-wrapper" class="postbox">
98
- <div class="pp-capability-menus">
99
-
100
- <div class="pp-capability-menus-wrap">
101
- <div id="pp-capability-menus-general"
102
- class="pp-capability-menus-content editable-role"
103
- style="display: block;">
104
- <?php
105
- $sn = 0;
106
- include(dirname(__FILE__) . '/editor-features-gutenberg.php');
107
-
108
- if ($classic_editor) {
109
- include(dirname(__FILE__) . '/editor-features-classic.php');
110
- }
111
- ?>
112
-
113
- </div>
114
- </div>
115
-
116
- </div>
117
- </div>
118
-
119
- <input type="submit" name="editor-features-submit"
120
- value="<?php _e('Save Changes', 'capsman-enhanced') ?>"
121
- class="button-primary ppc-editor-features-submit"/> &nbsp;
122
-
123
-
124
- </td>
125
- </tr>
126
- </table>
127
-
128
- </form>
129
-
130
- <?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
131
- cme_publishpressFooter();
132
- }
133
- ?>
134
- </div>
135
-
136
- <style>
137
- span.menu-item-link {
138
- webkit-user-select: none; /* Safari */
139
- -moz-user-select: none; /* Firefox */
140
- -ms-user-select: none; /* IE10+/Edge */
141
- user-select: none; /* Standard */
142
- }
143
-
144
- input.check-all-menu-item {margin-top: 5px !important;}
145
- </style>
146
-
147
- <script type="text/javascript">
148
- /* <![CDATA[ */
149
- jQuery(document).ready(function ($) {
150
-
151
- // -------------------------------------------------------------
152
- // Set form action attribute to include role
153
- // -------------------------------------------------------------
154
- $('#ppc-editor-features-form').attr('action', '<?php echo admin_url('admin.php?page=pp-capabilities-editor-features&role=' . $default_role . ''); ?>');
155
-
156
- // -------------------------------------------------------------
157
- // Instant restricted item class
158
- // -------------------------------------------------------------
159
- $(document).on('change', '.pp-capability-menus-wrapper .ppc-menu-row .check-item', function () {
160
- var current_tab;
161
-
162
- <?php if ($classic_editor) { ?>
163
- if ($('.nav-tab-wrapper .classic-tab').hasClass('nav-tab-active')) {
164
- current_tab = 'classic';
165
- } else {
166
- current_tab = 'gutenberg';
167
- }
168
- <?php } else { ?>
169
- current_tab = 'gutenberg';
170
- <?php } ?>
171
-
172
- //add class if feature is restricted for any post type
173
- var anyRestricted = $(this).closest('tr').find('input:checked').length > 0;
174
- $(this).closest('tr').find('.menu-item-link').toggleClass('restricted', anyRestricted);
175
-
176
- var isChecked = $(this).is(':checked');
177
-
178
- //toggle all checkbox
179
- if ($(this).hasClass('check-all-menu-item')) {
180
- var suffix = ('gutenberg' == current_tab) ? '' : current_tab + '_';
181
- $("input[type='checkbox'][name='capsman_feature_restrict_" + suffix + $(this).data('pp_type') + "[]']").prop('checked', isChecked);
182
-
183
- $('.' + current_tab + '.menu-item-link').each(function(i,e) {
184
- $(this).toggleClass('restricted', $(this).closest('tr').find('input:checked').length > 0);
185
- });
186
- } else {
187
- $('.' + current_tab + '.check-all-menu-link').removeClass('restricted').prop('checked', false);
188
- }
189
- });
190
-
191
- $(document).on("click", "span.menu-item-link", function (e) {
192
- if($(e.target).parent().hasClass('ppc-custom-features-delete')){
193
- return;
194
- }
195
- var chks = $(this).closest('tr').find('input');
196
- $(chks).prop('checked', !$(this).hasClass('restricted'));
197
- $(this).toggleClass('restricted', $(chks).filter(':checked').length);
198
- });
199
-
200
- // -------------------------------------------------------------
201
- // Load selected roles menu
202
- // -------------------------------------------------------------
203
- $(document).on('change', '.pp-capability-menus-wrapper .ppc-editor-features-role', function () {
204
-
205
- //disable select
206
- $('.pp-capability-menus-wrapper .ppc-editor-features-role').attr('disabled', true);
207
-
208
- //hide button
209
- $('.pp-capability-menus-wrapper .ppc-editor-features-submit').hide();
210
-
211
- //show loading
212
- $('#pp-capability-menu-wrapper').hide();
213
- $('div.publishpress-caps-manage img.loading').show();
214
-
215
- //go to url
216
- window.location = '<?php echo admin_url('admin.php?page=pp-capabilities-editor-features&role='); ?>' + $(this).val() + '';
217
-
218
- });
219
-
220
-
221
- // -------------------------------------------------------------
222
- // Editor features tab
223
- // -------------------------------------------------------------
224
- $('.editor-features-tab').click(function (e) {
225
- e.preventDefault();
226
- $('.editor-features-tab').removeClass('nav-tab-active');
227
- $(this).addClass('nav-tab-active');
228
- $('.pp-capability-menus-select').hide();
229
- $($(this).attr('data-tab')).show();
230
- });
231
-
232
- });
233
- /* ]]> */
234
- </script>
235
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/features-block-script.js DELETED
@@ -1,32 +0,0 @@
1
- if(ppc_features.disabled_panel){
2
- var disabled_panel = ppc_features.disabled_panel;
3
- var disabled_panel = disabled_panel.split(',');
4
-
5
- var taxs = ppc_features.taxonomies;
6
- taxs = taxs.split(',');
7
-
8
- taxs.forEach ((tax) => {
9
- if(disabled_panel.includes("taxonomy-panel-" + tax)){
10
- wp.data.dispatch('core/edit-post').removeEditorPanel('taxonomy-panel-' + tax); // category / tag / custom taxonomy
11
- }
12
- });
13
-
14
- if(disabled_panel.includes("featured-image")){
15
- wp.data.dispatch('core/edit-post').removeEditorPanel( 'featured-image' ); // featured image
16
- }
17
- if(disabled_panel.includes("post-link")){
18
- wp.data.dispatch('core/edit-post').removeEditorPanel( 'post-link' ); // permalink
19
- }
20
- if(disabled_panel.includes("page-attributes")){
21
- wp.data.dispatch('core/edit-post').removeEditorPanel( 'page-attributes' ); // page attributes
22
- }
23
- if(disabled_panel.includes("post-excerpt")){
24
- wp.data.dispatch('core/edit-post').removeEditorPanel( 'post-excerpt' ); // Excerpt
25
- }
26
- if(disabled_panel.includes("discussion-panel")){
27
- wp.data.dispatch('core/edit-post').removeEditorPanel( 'discussion-panel' ); // Discussion
28
- }
29
- if(disabled_panel.includes("post-status")){
30
- wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-status' ) ;// Post status
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/restrict-admin-features.php DELETED
@@ -1,323 +0,0 @@
1
- <?php
2
-
3
- class PP_Capabilities_Admin_Features
4
- {
5
-
6
- /**
7
- * Get all admin features layout.
8
- *
9
- * @return array Elements layout.
10
- */
11
- public static function elementsLayout()
12
- {
13
- $elements = [];
14
-
15
- //Add toolbar
16
- $elements[__('Admin Toolbar', 'capsman-enhanced')] = self::formatAdminToolbar();
17
-
18
- //Add dashboard widget
19
- $elements[__('Dashboard widgets', 'capsman-enhanced')] = self::formatDashboardWidgets();
20
-
21
- return apply_filters('pp_capabilities_admin_features_elements', $elements);
22
- }
23
-
24
- /**
25
- * Retrieve all items icons.
26
- *
27
- * @return array Items icons.
28
- */
29
- public static function elementLayoutItemIcons()
30
- {
31
- $icons = [];
32
-
33
- $icons['admintoolbar'] = 'open-folder';
34
- $icons['dashboardwidgets'] = 'dashboard';
35
- $icons['menu-toggle'] = 'menu';
36
- $icons['wp-logo'] = 'wordpress';
37
- $icons['site-name'] = 'admin-home';
38
- $icons['updates'] = 'update';
39
- $icons['comments'] = 'admin-comments';
40
- $icons['new-content'] = 'plus';
41
- $icons['wpseo-menu'] = 'open-folder';
42
- $icons['top-secondary'] = 'admin-users';
43
-
44
- return apply_filters('pp_capabilities_admin_features_icons', $icons);
45
- }
46
-
47
- /**
48
- * Let provide support for known adminbar with empty title due to icon title only.
49
- *
50
- */
51
- public static function elementToolbarTitleFallback($id)
52
- {
53
- $title = [];
54
-
55
- $title['menu-toggle'] = __('Mobile Menu Toggle', 'capsman-enhanced');
56
- $title['wp-logo'] = __('WordPress Logo', 'capsman-enhanced');
57
- $title['wp-logo-external'] = __('WordPress External Links', 'capsman-enhanced');
58
- $title['updates'] = __('Updates', 'capsman-enhanced');
59
- $title['comments'] = __('Comments', 'capsman-enhanced');
60
- $title['top-secondary'] = __('Right bar', 'capsman-enhanced');
61
- $title['user-actions'] = __('User actions', 'capsman-enhanced');
62
- $title['new-content'] = __('New', 'capsman-enhanced');
63
- $title['new-content'] = __('New', 'capsman-enhanced');
64
- $title['user-info'] = __('User Display Name', 'capsman-enhanced');
65
- $title['wpseo-menu'] = __('Yoast SEO', 'capsman-enhanced');
66
-
67
- return isset($title[$id]) ? $title[$id] : $id;
68
- }
69
-
70
- /**
71
- * Get the list of dashboard widgets.
72
- *
73
- * @return array dashboard widgets.
74
- */
75
- public static function dashboardWidgets()
76
- {
77
- global $wp_meta_boxes;
78
-
79
- $screen = is_network_admin() ? 'dashboard-network' : 'dashboard';
80
- $action = is_network_admin() ? 'wp_network_dashboard_setup' : 'wp_dashboard_setup';
81
- $current_screen = get_current_screen();
82
-
83
- //set current screen as dashboard to get widgets
84
- if (!isset($wp_meta_boxes[$screen]) || !is_array($wp_meta_boxes[$screen])) {
85
- require_once ABSPATH . '/wp-admin/includes/dashboard.php';
86
- set_current_screen($screen);
87
- remove_action( $action, [ __CLASS__, 'disableDashboardWidgets' ], 99 );
88
- wp_dashboard_setup();
89
- add_action( $action, [ __CLASS__, 'disableDashboardWidgets' ], 99 );
90
- }
91
-
92
- $widgets = [];
93
- if (isset($wp_meta_boxes[$screen])) {
94
- $widgets = $wp_meta_boxes[$screen];
95
- }
96
-
97
- //set current screen to it original stage
98
- set_current_screen($current_screen);
99
-
100
- return $widgets;
101
- }
102
-
103
- /**
104
- * Format dashboard widgets.
105
- *
106
- * @return array Elements layout item.
107
- */
108
- public static function formatDashboardWidgets()
109
- {
110
- $widgets = self::dashboardWidgets();
111
-
112
- $elements_widget = [];
113
- //add widget that may not be part of wp_meta_boxes
114
- $elements_widget['dashboard_welcome_panel'] = ['label' => __('Welcome panel', 'capsman-enhanced'), 'context' => 'normal', 'action' => 'ppc_dashboard_widget'];
115
- //loop other widgets
116
- foreach ($widgets as $context => $priority) {
117
- foreach ($priority as $data) {
118
- foreach ($data as $id => $widget) {
119
- if ($widget) {
120
- $widget_title = isset($widget['title']) ? wp_strip_all_tags($widget['title']) : '';
121
- $elements_widget[$id] = ['label' => $widget_title, 'context' => $context, 'action' => 'ppc_dashboard_widget'];
122
- }
123
- }
124
- }
125
- }
126
-
127
- return $elements_widget;
128
- }
129
-
130
- /**
131
- * Format admin toolbar.
132
- *
133
- * @return array Elements layout item.
134
- */
135
- public static function formatAdminToolbar()
136
- {
137
- global $toolbar_items;
138
-
139
- $toolbars = (array)$GLOBALS['ppcAdminBar'];
140
- $toolbarTree = self::formatAdminToolbarTree($toolbars);
141
- //set toolbar element with steps
142
- self::setAdminToolbarElement($toolbarTree);
143
-
144
- return $toolbar_items;
145
- }
146
-
147
- /**
148
- * Build multidimensional array for admin toolbar.
149
- *
150
- * @return array.
151
- */
152
- public static function formatAdminToolbarTree(array $items, $parentId = '')
153
- {
154
- $branch = [];
155
-
156
- foreach ($items as $item) {
157
- if ($item['parent'] == $parentId) {
158
- $children = self::formatAdminToolbarTree($items, $item['id']);
159
- if ($children) {
160
- $item['children'] = $children;
161
- }
162
- $branch[] = $item;
163
- }
164
- }
165
-
166
- return $branch;
167
- }
168
-
169
- /**
170
- * Set admin toolbar element.
171
- *
172
- */
173
- public static function setAdminToolbarElement(array $toolbarTrees, $steps = 1, $step_list = [])
174
- {
175
- global $toolbar_items;
176
-
177
- $position = 0;
178
- foreach ($toolbarTrees as $toolbarTree) {
179
- $position++;
180
- $id = $toolbarTree['id'];
181
- $itemTitle = self::cleanTitleText($toolbarTree['title']);
182
-
183
- //let fall back to known title/id if title still empty
184
- if (empty(trim($itemTitle))) {
185
- $itemTitle = self::elementToolbarTitleFallback($id);
186
- }
187
-
188
- $toolbar_items[$id] = ['label' => $itemTitle,
189
- 'parent' => $toolbarTree['parent'],
190
- 'step' => $steps,
191
- 'position' => $position,
192
- 'action' => 'ppc_adminbar'
193
- ];
194
- foreach ($toolbarTree as $key => $value) {
195
- if (is_array($value)) {
196
- self::setAdminToolbarElement($value, $steps + 1, $step_list);
197
- }
198
- }
199
- }
200
- }
201
-
202
- /**
203
- * Process admin features title.
204
- *
205
- */
206
- public static function cleanTitleText($title)
207
- {
208
- //strip span and div content
209
- $title = preg_replace('#(<span.*?>).*?(</span>)#', '', $title);
210
- $title = preg_replace('#(<img.*?>)#', '', $title);
211
-
212
- //strip other html tags
213
- $title = strip_tags($title);
214
-
215
- return $title;
216
- }
217
-
218
- /**
219
- * Get array elements that starts with a specific word
220
- *
221
- * @param array $restricted_features All restricted elements to check agains.
222
- * @param string $start_with The word to look for in array.
223
- *
224
- * @return array Filtered array.
225
- */
226
- public static function adminFeaturesRestrictedElements($restricted_elements, $start_with = 'ppc_adminbar')
227
- {
228
- //get all items of the array starting with the specified string.
229
- $new_elements = array_filter(
230
- $restricted_elements,
231
- function($value, $key) use ($start_with) {return strpos($value, $start_with) === 0;}, ARRAY_FILTER_USE_BOTH
232
- );
233
-
234
- return $new_elements;
235
- }
236
-
237
-
238
- /**
239
- * Apply admin feature restrictions
240
- */
241
- public static function adminFeaturedRestriction()
242
- {
243
- global $ppc_disabled_toolbar, $ppc_disabled_widget;
244
- // Get all user roles.
245
- $user_roles = wp_get_current_user()->roles;
246
- $disabled_features = get_option("capsman_disabled_admin_features", []);
247
-
248
- $all_disabled_elements = [];
249
-
250
- foreach ($user_roles as $role) {
251
- if (!empty($disabled_features[$role])) {
252
- $all_disabled_elements[] = $disabled_features[$role];
253
- }
254
- }
255
-
256
- //merge all array values incase it's more than role
257
- //$all_disabled_elements = array_merge(...$all_disabled_elements); // This is a PHP 7.4 operator
258
- $all_disabled_elements = (is_array($all_disabled_elements) && isset($all_disabled_elements[0])) ? array_merge($all_disabled_elements[0]) : [];
259
-
260
- //disable toolbar
261
- $ppc_disabled_toolbar = self::adminFeaturesRestrictedElements($all_disabled_elements, 'ppc_adminbar');
262
- if(count($ppc_disabled_toolbar) > 0){
263
- add_action( 'wp_before_admin_bar_render', [ __CLASS__, 'disableDashboardBar' ], 99 );
264
- }
265
-
266
- if(is_admin()){
267
- $ppc_disabled_widget = self::adminFeaturesRestrictedElements($all_disabled_elements, 'ppc_dashboard_widget');
268
- //disable widget
269
- if(count($ppc_disabled_widget) > 0){
270
- add_action( 'wp_dashboard_setup', [ __CLASS__, 'disableDashboardWidgets' ], 99 );
271
- add_action( 'wp_network_dashboard_setup', [ __CLASS__, 'disableDashboardWidgets' ], 99 );
272
- }
273
- }
274
- }
275
-
276
- /**
277
- * Disable admin bar.
278
- *
279
- */
280
- public static function disableDashboardBar() {
281
- global $wp_admin_bar, $ppc_disabled_toolbar;
282
- $admin_bar_options = (array)$ppc_disabled_toolbar;
283
- $admin_bar_items = (array)$GLOBALS['ppcAdminBar'];
284
-
285
- if (count($admin_bar_options) > 0 && ( is_array($admin_bar_items) || is_object($admin_bar_items) ) ) {
286
- foreach ($admin_bar_items as $barItem) {
287
- $id = $barItem['id'];
288
- $item_id = 'ppc_adminbar||'.$id;
289
- if ($id && in_array($item_id, $admin_bar_options)) {
290
- $wp_admin_bar->remove_menu($id);
291
- }
292
- }
293
- }
294
-
295
- }
296
-
297
- /**
298
- * Disable dashboard widgets.
299
- *
300
- */
301
- public static function disableDashboardWidgets() {
302
- global $ppc_disabled_widget;
303
-
304
- $widgets = (array)$ppc_disabled_widget;
305
-
306
- if ( count($widgets) === 0 ) {
307
- return;
308
- }
309
-
310
- foreach ( $widgets as $widget) {
311
- $widget_data = explode("||", $widget);
312
- $widget_id = $widget_data[1];
313
- $widget_content = $widget_data[2];
314
-
315
- if ( $widget_id === 'dashboard_welcome_panel' ) {
316
- remove_action( 'welcome_panel', 'wp_welcome_panel' );
317
- }else{
318
- remove_meta_box( $widget_id, get_current_screen()->base, $widget_content );
319
- }
320
- }
321
- }
322
-
323
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/features/restrict-editor-features.php DELETED
@@ -1,356 +0,0 @@
1
- <?php
2
-
3
- class PP_Capabilities_Post_Features {
4
-
5
- /**
6
- * Recursive search in array.
7
- *
8
- * @param string $needle
9
- * @param array $haystack
10
- *
11
- * @return bool
12
- */
13
- private static function recursiveInArray($needle, $haystack)
14
- {
15
- if ('' === $haystack) {
16
- return false;
17
- }
18
-
19
- if (!$haystack) {
20
- return false;
21
- }
22
-
23
- foreach ($haystack as $stalk) {
24
- if ($needle === $stalk
25
- || (is_array($stalk)
26
- && self::recursiveInArray($needle, $stalk)
27
- )
28
- ) {
29
- return true;
30
- }
31
- }
32
-
33
- return false;
34
- }
35
-
36
- public static function elementsLayoutClassic()
37
- {
38
- $elements = [];
39
-
40
- $elements[__('Top Tabs', 'capsman-enhanced')] = [
41
- '#contextual-help-link-wrap' => ['label' => __('Help', 'capsman-enhanced')],
42
- '#screen-options-link-wrap' => ['label' => __('Screen Options', 'capsman-enhanced')],
43
- ];
44
-
45
- $elements[__('Editor', 'capsman-enhanced')] = [
46
- '.page-title-action' => ['label' => __('Add New', 'capsman-enhanced')],
47
- '#title' => ['label' => __('Title', 'capsman-enhanced'), 'elements' => '#titlediv, #title, #titlewrap'],
48
- '#postdivrich' => ['label' => __('Editor', 'capsman-enhanced')],
49
- '#pageslugdiv' => ['label' => __('Permalink', 'capsman-enhanced')],
50
- '#media_buttons' => ['label' => __('Media Buttons (all)', 'capsman-enhanced'), 'elements' => '#media-buttons, #wp-content-media-buttons'],
51
- '#html_editor_button' => ['label' => __('HTML Editor Button', 'capsman-enhanced'),'elements' => '#editor-toolbar #edButtonHTML, #quicktags, #content-html, .wp-switch-editor.switch-html'],
52
- '#wp-word-count' => ['label' => __('Word count', 'capsman-enhanced')],
53
- ];
54
-
55
- $elements[__('Publish Box', 'capsman-enhanced')] = [
56
- '#submitdiv' => ['label' => __('Publish Box', 'capsman-enhanced')],
57
- '#save-post' => ['label' => __('Save Draft', 'capsman-enhanced')],
58
- '#post-preview' => ['label' => __('Preview', 'capsman-enhanced')],
59
- '.misc-pub-post-status' => ['label' => __('Publish Status ', 'capsman-enhanced')],
60
- '.misc-pub-visibility' => ['label' => __('Publish Visibility', 'capsman-enhanced')],
61
- '#passworddiv' => ['label' => __('Password Protect This Post', 'capsman-enhanced')],
62
- '#misc-publishing-actions' => ['label' => __('Publish Actions', 'capsman-enhanced')],
63
- '.misc-pub-curtime' => ['label' => __('Publish Schedule', 'capsman-enhanced')],
64
- '#date' => ['label' => __('Date', 'capsman-enhanced'), 'elements' => '#date, #datediv, th.column-date, td.date, div.curtime'],
65
- '#publish' => ['label' => __('Publish', 'capsman-enhanced')],
66
- ];
67
-
68
- $elements[__('Taxonomy Boxes', 'capsman-enhanced')] = [
69
- '#category' => ['label' => __('Categories', 'capsman-enhanced'), 'elements' => '#categories, #categorydiv, #categorydivsb, th.column-categories, td.categories'],
70
- '#category-add-toggle' => ['label' => __('Add New Category', 'capsman-enhanced')],
71
- '#post_tag' => ['label' => __('Tags', 'capsman-enhanced'), 'elements' => '#tags, #tagsdiv,#tagsdivsb,#tagsdiv-post_tag, th.column-tags, td.tags'],
72
- ];
73
-
74
- end($elements);
75
- $k = key($elements);
76
-
77
- foreach (get_taxonomies(['show_ui' => true], 'object') as $taxonomy => $tx_obj) {
78
- if (!in_array($taxonomy, ['category', 'post_tag', 'link_category'])) {
79
- $elements[$k]["#{$tx_obj->name}div"] = ['label' => $tx_obj->label];
80
- }
81
- }
82
-
83
- $elements[__('Page Boxes', 'capsman-enhanced')] = [
84
- '#pageparentdiv' => ['label' => __('Page Attributes', 'capsman-enhanced')],
85
- '#parent_id' => ['label' => __('Parent', 'capsman-enhanced'), 'elements' => 'p.parent-id-label-wrapper, #parent_id'],
86
- '#page_template' => ['label' => __('Page Template', 'capsman-enhanced')],
87
- 'p.menu-order-label-wrapper' => ['label' => __('Order', 'capsman-enhanced')],
88
- ];
89
-
90
- $elements[__('Other Boxes', 'capsman-enhanced')] = [
91
- '#postimagediv' => ['label' => __('Featured Image', 'capsman-enhanced')],
92
- '#slug' => ['label' => __('Post Slug', 'capsman-enhanced'), 'elements' => '#slugdiv,#edit-slug-box'],
93
- '#commentstatusdiv' => ['label' => __('Discussion', 'capsman-enhanced')],
94
- ];
95
-
96
- end($elements);
97
- $k = key($elements);
98
-
99
- /*
100
- __('Related, Shortcuts', 'capsman-enhanced') => '.side-info',
101
- __('Messages', 'capsman-enhanced') => '#notice',
102
- __('h2: Advanced Options', 'capsman-enhanced') => '#post-body h2',
103
- */
104
-
105
- $post_type_supports = [];
106
-
107
- $def_post_types = apply_filters('pp_capabilities_feature_post_types', ['post', 'page']);
108
-
109
- foreach($def_post_types as $post_type) {
110
- $post_type_supports = array_merge($post_type_supports, get_all_post_type_supports($post_type));
111
- }
112
-
113
- foreach (array_keys($post_type_supports) as $feature) {
114
- $label = ucfirst(str_replace(['-', '_'], ' ', $feature));
115
-
116
- switch ($feature) {
117
- case 'excerpt' :
118
- $id = 'postexcerpt';
119
- break;
120
-
121
- case 'custom-fields' :
122
- $id = 'postcustom';
123
- break;
124
-
125
- case 'post-formats' :
126
- $id = 'format';
127
- break;
128
-
129
- case 'author':
130
- case 'excerpt':
131
- case 'trackbacks':
132
- case 'comments':
133
- case 'revisions':
134
- //default:
135
- $id = $feature;
136
- break;
137
-
138
- default:
139
- continue 2;
140
- }
141
-
142
- $elements[$k][$feature] = [
143
- 'label' => $label,
144
- 'elements' => '#' . $id
145
- . ', #' . $id . 'div'
146
- . ', th.column-' . $id
147
- . ', td.' . $id
148
- ]; //th and td for raw in edit screen
149
- }
150
-
151
- return apply_filters('pp_capabilities_post_feature_elements_classic', $elements);
152
- }
153
-
154
-
155
- /**
156
- * Classic Editor screen: Output Styles to Hide UI elements for Editor Features configured as restricted
157
- */
158
- public static function applyRestrictionsClassic()
159
- {
160
- $restrict_elements = [];
161
-
162
- if (!$post_type = pp_capabilities_get_post_type()) {
163
- return;
164
- }
165
-
166
- // Only restrictions associated with this user's role(s) will be applied
167
- $role_restrictions = array_intersect_key(
168
- get_option("capsman_feature_restrict_classic_{$post_type}", []),
169
- array_fill_keys(wp_get_current_user()->roles, true)
170
- );
171
-
172
- foreach($role_restrictions as $features) {
173
- $restrict_elements = array_merge($restrict_elements, self::getElements($features, ['editor_type' => 'classic']));
174
- }
175
-
176
- // apply the stored restrictions by css
177
- if ($restrict_elements = array_unique($restrict_elements)) {
178
- echo '<style>' . implode(',', $restrict_elements) . ' {display:none !important;}</style>';
179
- }
180
- }
181
-
182
- /**
183
- * Classic Editor: Apply / Queue editor feature restrictions
184
- */
185
- public static function adminInitClassic($post_type)
186
- {
187
- // Get all user roles.
188
- $user_roles = wp_get_current_user()->roles;
189
- $ce_post_disabled = get_option("capsman_feature_restrict_classic_{$post_type}", []);
190
-
191
- $disabled_elements_post_ = [];
192
- $disabled_elements_post_all = [];
193
-
194
- foreach ($user_roles as $role) {
195
- if (!empty($ce_post_disabled[$role])) {
196
- $disabled_elements_post_[$role] = (array)$ce_post_disabled[$role];
197
- }
198
-
199
- if (!empty($disabled_elements_post_[$role])) {
200
- $disabled_elements_post_all[] = $disabled_elements_post_[$role];
201
- }
202
- }
203
-
204
- // Set default editor tinymce
205
- if (self::recursiveInArray(
206
- '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
207
- $disabled_elements_post_all
208
- )
209
- ) {
210
- add_filter('wp_default_editor', function($default) {
211
- return 'tinymce';
212
- });
213
- }
214
-
215
- // Remove media buttons
216
- if (self::recursiveInArray('media_buttons', $disabled_elements_post_all)
217
- ) {
218
- remove_action('media_buttons', 'media_buttons');
219
- }
220
-
221
- // set meta-box post option
222
- add_action('admin_head', ['PP_Capabilities_Post_Features', 'applyRestrictionsClassic'], 1);
223
- }
224
-
225
- /**
226
- * Gutenberg Editor: Hide UI elements for editor features configured as restricted
227
- */
228
- public static function applyRestrictions($post_type)
229
- {
230
- $restrict_elements = [];
231
-
232
- // Only restrictions associated with this user's role(s) will be applied
233
- $role_restrictions = array_intersect_key(
234
- get_option("capsman_feature_restrict_{$post_type}", []),
235
- array_fill_keys(wp_get_current_user()->roles, true)
236
- );
237
-
238
- foreach($role_restrictions as $features) {
239
- $restrict_elements = array_merge($restrict_elements, self::getElements($features));
240
- }
241
-
242
- // apply the stored restrictions by js and css
243
- if ($restrict_elements = array_unique($restrict_elements)) {
244
-
245
- // script file
246
- wp_register_script(
247
- 'ppc-features-block-script',
248
- plugin_dir_url(CME_FILE) . 'includes/features/features-block-script.js',
249
- ['wp-blocks', 'wp-edit-post']
250
- );
251
-
252
- //localize script
253
- wp_localize_script(
254
- 'ppc-features-block-script',
255
- 'ppc_features',
256
- [
257
- 'disabled_panel' => implode(',', $restrict_elements),
258
- 'taxonomies' => implode(",", get_taxonomies())
259
- ]
260
- );
261
-
262
- // register block editor script
263
- register_block_type(
264
- 'ppc/features-block-script',
265
- ['editor_script' => 'ppc-features-block-script']
266
- );
267
-
268
- echo '<style>' . implode(',', $restrict_elements) . ' {display:none !important;}</style>';
269
- }
270
- }
271
-
272
- private static function getElements($feature_names, $args = []) {
273
- $is_classic = (!empty($args['editor_type']) && ('classic' == $args['editor_type']));
274
-
275
- $feature_names = (array) $feature_names;
276
-
277
- $arr = ($is_classic) ? self::elementsLayoutClassic() : self::elementsLayout();
278
-
279
- $elements = [];
280
-
281
- foreach($arr as $section_features) {
282
- foreach($section_features as $_feature_name => $feature_info) {
283
- if (in_array($_feature_name, $feature_names)) {
284
- if (!empty($feature_info['elements'])) {
285
- $elements = array_merge($elements, explode(',', $feature_info['elements']));
286
- } else {
287
- $elements[]= $_feature_name;
288
- }
289
- }
290
- }
291
- }
292
-
293
- return $elements;
294
- }
295
-
296
- public static function elementsLayout()
297
- {
298
- $elements = [
299
- __('Top Bar - Left', 'capabilities-pro') => [
300
- 'add_block' => ['label' => __('Add block', 'capsman-enhanced'), 'elements' => '.edit-post-header-toolbar .edit-post-header-toolbar__inserter-toggle.has-icon'],
301
- 'modes' => ['label' => __('Modes', 'capsman-enhanced'), 'elements' => '.edit-post-header-toolbar .components-dropdown:first-of-type'],
302
- 'undo' => ['label' => __('Undo', 'capsman-enhanced'), 'elements' => '.edit-post-header-toolbar .editor-history__undo'],
303
- 'redo' => ['label' => __('Redo', 'capsman-enhanced'), 'elements' => '.edit-post-header-toolbar .editor-history__redo'],
304
- 'details' => ['label' => __('Details', 'capsman-enhanced'), 'elements' => '.edit-post-header__toolbar .table-of-contents'],
305
- 'outline' => ['label' => __('Outline', 'capsman-enhanced'), 'elements' => '.edit-post-header__toolbar .edit-post-header-toolbar__list-view-toggle'],
306
- ],
307
-
308
- __('Top Bar - Right', 'capabilities-pro') => [
309
- 'save_draft' => ['label' => __('Save Draft', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .components-button.editor-post-save-draft'],
310
- 'switch_to_draft' => ['label' => __('Switch to draft', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .components-button.editor-post-switch-to-draft'],
311
- 'preview' => ['label' => __('Preview', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .block-editor-post-preview__dropdown'],
312
- 'publish' => ['label' => __('Publish / Update', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .editor-post-publish-button__button'],
313
- 'settings' => ['label' => __('Settings', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .interface-pinned-items button'],
314
- 'options' => ['label' => __('Options', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .edit-post-more-menu .components-button'],
315
- ],
316
-
317
- __('Body', 'capabilities-pro') => [
318
- 'edit_title' => ['label' => __('Edit title', 'capsman-enhanced'), 'elements' => '.wp-block.editor-post-title__block'],
319
- 'content' => ['label' => __('Content', 'capsman-enhanced'), 'elements' => '.block-editor-block-list__layout'],
320
- ],
321
-
322
- __('Document Panel', 'capabilities-pro') => [
323
- 'status_visibility' => ['label' => __('Status & visibility', 'capsman-enhanced'), 'elements' => 'post-status'],
324
- 'permalink' => ['label' => __('Permalink', 'capsman-enhanced'), 'elements' => 'post-link'],
325
- 'categories' => ['label' => __('Categories', 'capsman-enhanced'), 'elements' => 'taxonomy-panel-category'],
326
- 'tags' => ['label' => __('Tags', 'capsman-enhanced'), 'elements' => 'taxonomy-panel-post_tag'],
327
- ]
328
- ];
329
-
330
- end($elements);
331
- $k = key($elements);
332
-
333
- foreach (get_taxonomies(['show_ui' => true], 'object') as $taxonomy => $tx_obj) {
334
- if (!in_array($taxonomy, ['category', 'post_tag', 'link_category'])) {
335
- $elements[$k][$tx_obj->name] = ['label' => $tx_obj->label, 'elements' => "taxonomy-panel-$taxonomy"];
336
- }
337
- }
338
-
339
- $elements[$k] = array_merge($elements[$k], [
340
- 'featured_image' => ['label' => __('Featured image', 'capsman-enhanced'), 'elements' => 'featured-image'],
341
- 'excerpt' => ['label' => __('Excerpt', 'capsman-enhanced'), 'elements' => 'post-excerpt'],
342
- 'discussion' => ['label' => __('Discussion', 'capsman-enhanced'), 'elements' => 'discussion-panel'],
343
- 'post_attributes' => ['label' => __('Post Attributes', 'capsman-enhanced'), 'elements' => 'page-attributes'],
344
- ]);
345
-
346
- $elements[__('Block Panel', 'capabilities-pro')] = [
347
- 'block_panel' => ['label' => __('Block Panel', 'capsman-enhanced'), 'elements' => '.block-editor-block-inspector'],
348
- 'paragraph' => ['label' => __('Paragraph', 'capsman-enhanced'), 'elements' => '.block-editor-block-card'],
349
- 'typography' => ['label' => __('Typography', 'capsman-enhanced'), 'elements' => '.block-editor-block-inspector .components-panel__body:first-of-type'],
350
- 'color' => ['label' => __('Color settings', 'capsman-enhanced'), 'elements' => '.block-editor-panel-color-gradient-settings'],
351
- 'text_settings' => ['label' => __('Text settings', 'capsman-enhanced'), 'elements' => '.block-editor-panel-color-gradient-settings + .components-panel__body'],
352
- ];
353
-
354
- return apply_filters('pp_capabilities_post_feature_elements', $elements);
355
- }
356
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/filters-admin.php CHANGED
@@ -1,10 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Filters which are loaded for certain admin URLs
6
- *
7
- */
8
  class CME_AdminMenuNoPrivWorkaround {
9
  var $create_posts_cap = '';
10
 
1
  <?php
 
 
 
 
 
 
2
  class CME_AdminMenuNoPrivWorkaround {
3
  var $create_posts_cap = '';
4
 
includes/filters.php CHANGED
@@ -1,13 +1,6 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
- /*
5
- * PublishPress Capabilities [Free]
6
- *
7
- * Load general purpose filters which need to execute for any URL, even front end
8
- *
9
- */
10
-
11
  /**
12
  * class CME_Extensions
13
  *
@@ -38,8 +31,8 @@ if ( defined( 'WC_PLUGIN_FILE' ) ) {
38
  if (!defined('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND')) {
39
  global $wp_version;
40
  if (version_compare($wp_version, '4.9.7', '>=')) { // avoid any issues with old REST API implementations
41
- require_once (dirname(__FILE__) . '/filters-wp_rest_workarounds.php');
42
- new PublishPress\Capabilities\WP_REST_Workarounds();
43
  }
44
  }
45
 
@@ -53,6 +46,9 @@ if ( is_admin() ) {
53
 
54
  add_filter('plugin_action_links_' . plugin_basename(CME_FILE), '_cme_fltPluginActionLinks', 10, 2);
55
 
 
 
 
56
  add_action('plugins_loaded', '_cme_migrate_pp_options');
57
 
58
  add_filter('cme_filterable_post_types', '_cme_filterable_post_types');
@@ -91,6 +87,59 @@ function _cme_migrate_pp_options() {
91
  }
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  // allow edit_terms, delete_terms, assign_terms capabilities to function separately from manage_terms
96
  function _cme_remap_term_meta_cap ( $caps, $cap, $user_id, $args ) {
@@ -212,31 +261,31 @@ function cme_get_assisted_post_types() {
212
  // Note: this intentionally does NOT share Press Permit' option name, for back compat reasons
213
  // Enabling filtered taxonomies in PP previously did not cause the edit_terms, delete_terms, assign_terms capabilities to be enforced
214
  function cme_get_assisted_taxonomies() {
215
- $tx_args = ['public' => true, 'show_ui' => true];
216
- $taxonomies = apply_filters('cme_filterable_taxonomies', get_taxonomies($tx_args, 'object', 'or'));
217
- $taxonomies = array_combine(array_keys($taxonomies), array_keys($taxonomies));
218
-
219
- if ($omit_taxonomies = apply_filters('pp_unfiltered_taxonomies', [])) {
220
- $taxonomies = array_diff($taxonomies, (array) $omit_taxonomies);
221
  }
222
 
223
  $option_name = (defined('PPC_VERSION') && !defined('PRESSPERMIT_VERSION')) ? 'pp_enabled_taxonomies' : 'presspermit_enabled_taxonomies';
224
- $enabled = (array) get_option( $option_name, []);
225
  $taxonomies = array_intersect( $taxonomies, array_keys( array_filter( $enabled ) ) );
226
 
227
  return apply_filters( 'cme_assisted_taxonomies', $taxonomies, $tx_args );
228
  }
229
 
230
  function cme_get_detailed_taxonomies() {
231
- $tx_args = ['public' => true, 'show_ui' => true];
232
- $taxonomies = apply_filters('cme_filterable_taxonomies', get_taxonomies($tx_args, 'object', 'or'));
233
- $taxonomies = array_combine(array_keys($taxonomies), array_keys($taxonomies));
234
-
235
- if ($omit_taxonomies = apply_filters('pp_unfiltered_taxonomies', [])) {
236
- $taxonomies = array_diff($taxonomies, (array) $omit_taxonomies);
237
  }
238
 
239
- $enabled = (array) get_option('cme_detailed_taxonomies', []);
240
  $taxonomies = array_intersect( $taxonomies, array_keys( array_filter( $enabled ) ) );
241
 
242
  return apply_filters( 'cme_detailed_taxonomies', $taxonomies, $tx_args );
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
 
 
 
 
 
 
 
4
  /**
5
  * class CME_Extensions
6
  *
31
  if (!defined('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND')) {
32
  global $wp_version;
33
  if (version_compare($wp_version, '4.9.7', '>=')) { // avoid any issues with old REST API implementations
34
+ require_once (dirname(__FILE__) . '/filters-wp_rest_workarounds.php');
35
+ new PublishPress\Capabilities\WP_REST_Workarounds();
36
  }
37
  }
38
 
46
 
47
  add_filter('plugin_action_links_' . plugin_basename(CME_FILE), '_cme_fltPluginActionLinks', 10, 2);
48
 
49
+
50
+ add_filter('pp_custom_status_list', 'cme_filter_custom_status_list', 10, 2);
51
+
52
  add_action('plugins_loaded', '_cme_migrate_pp_options');
53
 
54
  add_filter('cme_filterable_post_types', '_cme_filterable_post_types');
87
  }
88
  }
89
 
90
+ /**
91
+ * Filters the list of custom statuses
92
+ *
93
+ * @param array $custom_statuses
94
+ * @param WP_Post $post
95
+ *
96
+ * @return array
97
+ */
98
+ function cme_filter_custom_status_list($custom_statuses, $post)
99
+ {
100
+ if (!get_option('cme_custom_status_control')) {
101
+ return $custom_statuses;
102
+ }
103
+
104
+ if (class_exists('publishpress') && method_exists('publishpress', 'instance')) {
105
+ $publishpress = publishpress::instance();
106
+ } else {
107
+ global $publishpress;
108
+ }
109
+
110
+ if (empty($publishpress)) {
111
+ return $custom_statuses;
112
+ }
113
+
114
+ $filtered = [];
115
+ $option_group = 'global';
116
+
117
+ $default_status = !empty($publishpress->custom_status->module->options->default_status) ? $publishpress->custom_status->module->options->default_status : 'draft';
118
+
119
+ if ( ! is_null($post)) {
120
+ // Adding a new post? Set the correct default status
121
+ if ('auto-draft' === $post->post_status) {
122
+ $post->post_status = $default_status;
123
+ }
124
+ }
125
+
126
+ foreach ($custom_statuses as &$status) {
127
+ $slug = str_replace('-', '_', $status->slug);
128
+
129
+ // Check if the user, or any of his user groups are capable to use the status. If not, but it is the
130
+ // current status, we still display it.
131
+ if (('draft' == $slug)
132
+ || current_user_can('status_change_' . $slug)
133
+ || (is_null($post) ? false : $status->slug === $post->post_status)
134
+ || $status->slug === $default_status
135
+ ) {
136
+ $filtered[] = $status;
137
+ }
138
+ }
139
+
140
+ return $filtered;
141
+ }
142
+
143
 
144
  // allow edit_terms, delete_terms, assign_terms capabilities to function separately from manage_terms
145
  function _cme_remap_term_meta_cap ( $caps, $cap, $user_id, $args ) {
261
  // Note: this intentionally does NOT share Press Permit' option name, for back compat reasons
262
  // Enabling filtered taxonomies in PP previously did not cause the edit_terms, delete_terms, assign_terms capabilities to be enforced
263
  function cme_get_assisted_taxonomies() {
264
+ $tx_args = array( 'public' => true );
265
+
266
+ $taxonomies = get_taxonomies( $tx_args );
267
+
268
+ if ( $omit_taxonomies = apply_filters( 'pp_unfiltered_taxonomies', array() ) ) {
269
+ $taxonomies = array_diff_key( $taxonomies, array_fill_keys( (array) $omit_taxonomies, true ) );
270
  }
271
 
272
  $option_name = (defined('PPC_VERSION') && !defined('PRESSPERMIT_VERSION')) ? 'pp_enabled_taxonomies' : 'presspermit_enabled_taxonomies';
273
+ $enabled = (array) get_option( $option_name, array() );
274
  $taxonomies = array_intersect( $taxonomies, array_keys( array_filter( $enabled ) ) );
275
 
276
  return apply_filters( 'cme_assisted_taxonomies', $taxonomies, $tx_args );
277
  }
278
 
279
  function cme_get_detailed_taxonomies() {
280
+ $tx_args = array( 'public' => true );
281
+
282
+ $taxonomies = get_taxonomies( $tx_args );
283
+
284
+ if ( $omit_taxonomies = apply_filters( 'pp_unfiltered_taxonomies', array() ) ) {
285
+ $taxonomies = array_diff_key( $taxonomies, array_fill_keys( (array) $omit_taxonomies, true ) );
286
  }
287
 
288
+ $enabled = (array) get_option( 'cme_detailed_taxonomies', array() );
289
  $taxonomies = array_intersect( $taxonomies, array_keys( array_filter( $enabled ) ) );
290
 
291
  return apply_filters( 'cme_detailed_taxonomies', $taxonomies, $tx_args );
includes/functions-admin.php CHANGED
@@ -1,166 +1,214 @@
1
  <?php
2
 
3
- /*
4
- * PublishPress Capabilities [Free]
5
- *
6
- * Functions available to wp-admin requests, which are not contained within a class
7
- *
8
- */
9
 
10
- function cme_fakefunc() {
11
- }
 
 
12
 
13
- function pp_capabilities_get_post_id()
14
- {
15
- global $post;
16
 
17
- if (defined('REST_REQUEST') && REST_REQUEST) {
18
- if ($_post_id = apply_filters('presspermit_rest_post_id', 0)) {
19
- return $_post_id;
20
- }
21
- }
22
 
23
- if (!empty($post) && is_object($post)) {
24
- if ('auto-draft' == $post->post_status) {
25
- return 0;
26
  } else {
27
- return $post->ID;
28
  }
29
 
30
- } elseif (isset($_REQUEST['post'])) {
31
- return (int)$_REQUEST['post'];
32
-
33
- } elseif (isset($_REQUEST['post_ID'])) {
34
- return (int)$_REQUEST['post_ID'];
35
-
36
- } elseif (isset($_REQUEST['post_id'])) {
37
- return (int)$_REQUEST['post_id'];
38
-
39
- } elseif (defined('WOOCOMMERCE_VERSION') && !empty($_REQUEST['product_id'])) {
40
- return (int)$_REQUEST['product_id'];
 
 
 
 
 
 
41
  }
42
- }
43
 
44
- /**
45
- * Based on Edit Flow's \Block_Editor_Compatible::should_apply_compat method.
46
- *
47
- * @return bool
48
- */
49
- function _pp_capabilities_is_block_editor_active($post_type = '', $args = [])
50
- {
51
- global $current_user, $wp_version;
52
-
53
- $defaults = ['suppress_filter' => false, 'force_refresh' => false];
54
- $args = array_merge($defaults, $args);
55
- $suppress_filter = $args['suppress_filter'];
56
-
57
- // Check if Revisionary lower than v1.3 is installed. It disables Gutenberg.
58
- if (defined('REVISIONARY_VERSION') && version_compare(REVISIONARY_VERSION, '1.3-beta', '<')) {
59
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
 
62
- static $buffer;
63
- if (!isset($buffer)) {
64
- $buffer = [];
 
 
 
 
 
 
 
65
  }
66
 
67
- if (!$post_type = pp_capabilities_get_post_type()) {
68
- return true;
69
- }
 
 
 
 
 
 
 
 
 
 
 
70
 
71
- if ($post_type_obj = get_post_type_object($post_type)) {
72
- if (!$post_type_obj->show_in_rest) {
73
- return false;
74
  }
75
- }
76
 
77
- if (isset($buffer[$post_type]) && empty($args['force_refresh']) && !$suppress_filter) {
78
- return $buffer[$post_type];
79
  }
80
 
81
- if (class_exists('Classic_Editor')) {
82
- if (isset($_REQUEST['classic-editor__forget']) && (isset($_REQUEST['classic']) || isset($_REQUEST['classic-editor']))) {
83
- return false;
84
- } elseif (isset($_REQUEST['classic-editor__forget']) && !isset($_REQUEST['classic']) && !isset($_REQUEST['classic-editor'])) {
85
- return true;
86
- } elseif (get_option('classic-editor-allow-users') === 'allow') {
87
- if ($post_id = pp_capabilities_get_post_id()) {
88
- $which = get_post_meta( $post_id, 'classic-editor-remember', true );
89
-
90
- if ('block-editor' == $which) {
91
- return true;
92
- } elseif ('classic-editor' == $which) {
93
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
- } else {
96
- $use_block = ('block' == get_user_meta($current_user->ID, 'wp_classic-editor-settings'));
97
- return $use_block && apply_filters('use_block_editor_for_post_type', $use_block, $post_type, PHP_INT_MAX);
98
  }
99
  }
100
  }
101
 
102
- $pluginsState = array(
103
- 'classic-editor' => class_exists( 'Classic_Editor' ), // is_plugin_active('classic-editor/classic-editor.php'),
104
- 'gutenberg' => function_exists( 'the_gutenberg_project' ), //is_plugin_active('gutenberg/gutenberg.php'),
105
- 'gutenberg-ramp' => class_exists('Gutenberg_Ramp'),
106
- );
107
-
108
- $conditions = [];
 
109
 
110
- if ($suppress_filter) remove_filter('use_block_editor_for_post_type', $suppress_filter, 10, 2);
111
 
112
- /**
113
- * 5.0:
114
- *
115
- * Classic editor either disabled or enabled (either via an option or with GET argument).
116
- * It's a hairy conditional :(
117
- */
118
- // phpcs:ignore WordPress.VIP.SuperGlobalInputUsage.AccessDetected, WordPress.Security.NonceVerification.NoNonceVerification
119
- $conditions[] = (version_compare($wp_version, '5.0', '>=') || $pluginsState['gutenberg'])
120
- && ! $pluginsState['classic-editor']
121
- && ! $pluginsState['gutenberg-ramp']
122
- && apply_filters('use_block_editor_for_post_type', true, $post_type, PHP_INT_MAX);
123
-
124
- $conditions[] = version_compare($wp_version, '5.0', '>=')
125
- && $pluginsState['classic-editor']
126
- && (get_option('classic-editor-replace') === 'block'
127
- && ! isset($_GET['classic-editor__forget']));
128
-
129
- $conditions[] = version_compare($wp_version, '5.0', '>=')
130
- && $pluginsState['classic-editor']
131
- && (get_option('classic-editor-replace') === 'classic'
132
- && isset($_GET['classic-editor__forget']));
133
-
134
- $conditions[] = $pluginsState['gutenberg-ramp']
135
- && apply_filters('use_block_editor_for_post', true, get_post(pp_capabilities_get_post_id()), PHP_INT_MAX);
136
-
137
- // Returns true if at least one condition is true.
138
- $result = count(
139
- array_filter($conditions,
140
- function ($c) {
141
- return (bool)$c;
142
- }
143
- )
144
- ) > 0;
145
-
146
- if (!$suppress_filter) {
147
- $buffer[$post_type] = $result;
 
 
 
 
 
148
  }
149
 
150
- // Returns true if at least one condition is true.
151
- return $result;
152
  }
153
 
154
- /**
155
- * Remove all non-alphanumeric and space characters from a string.
156
- *
157
- * @param string $string .
158
- *
159
- * @return string
160
- *
161
- * @since 2.1.1
162
- */
163
- function ppc_remove_non_alphanumeric_space_characters($string)
164
- {
165
- return preg_replace("/(\W)+/", "", $string);
166
  }
1
  <?php
2
 
3
+ class PP_Capabilities_Admin_UI {
4
+ function __construct() {
5
+ global $pagenow;
 
 
 
6
 
7
+ /**
8
+ * The class responsible for handling notifications
9
+ */
10
+ require_once (dirname(CME_FILE) . '/classes/pp-capabilities-notices.php');
11
 
12
+ add_action('admin_enqueue_scripts', [$this, 'adminScripts']);
13
+ add_action('admin_print_scripts', [$this, 'adminPrintScripts']);
 
14
 
15
+ add_action('profile_update', [$this, 'action_profile_update'], 10, 2);
 
 
 
 
16
 
17
+ if (is_multisite()) {
18
+ add_action('add_user_to_blog', [$this, 'action_profile_update'], 9);
 
19
  } else {
20
+ add_action('user_register', [$this, 'action_profile_update'], 9);
21
  }
22
 
23
+ if (is_admin() && (isset($_REQUEST['page']) && (in_array($_REQUEST['page'], ['pp-capabilities', 'pp-capabilities-backup', 'pp-capabilities-roles', 'pp-capabilities-admin-menus', 'pp-capabilities-nav-menus', 'pp-capabilities-settings']))
24
+ || (!empty($_REQUEST['action']) && in_array($_REQUEST['action'], ['pp-roles-add-role', 'pp-roles-delete-role', 'pp-roles-hide-role', 'pp-roles-unhide-role']))
25
+ || ( ! empty($_SERVER['SCRIPT_NAME']) && strpos( $_SERVER['SCRIPT_NAME'], 'p-admin/plugins.php' ) && ! empty($_REQUEST['action'] ) )
26
+ || ( isset($_GET['action']) && 'reset-defaults' == $_GET['action'] )
27
+ || in_array( $pagenow, array( 'users.php', 'user-edit.php', 'profile.php', 'user-new.php' ) )
28
+ ) ) {
29
+ global $capsman;
30
+
31
+ // Run the plugin
32
+ require_once ( dirname(CME_FILE) . '/framework/lib/formating.php' );
33
+ require_once ( dirname(CME_FILE) . '/framework/lib/users.php' );
34
+
35
+ require_once ( dirname(CME_FILE) . '/includes/manager.php' );
36
+ $capsman = new CapabilityManager();
37
+ } else {
38
+ add_action( 'admin_menu', [$this, 'cmeSubmenus'], 20 );
39
+ }
40
  }
 
41
 
42
+ function adminScripts() {
43
+ global $publishpress;
44
+
45
+ if (function_exists('get_current_screen') && (!defined('PUBLISHPRESS_VERSION') || empty($publishpress) || empty($publishpress->modules) || empty($publishpress->modules->roles))) {
46
+ $screen = get_current_screen();
47
+
48
+ if ('user-edit' === $screen->base || ('user' === $screen->base && 'add' === $screen->action)) {
49
+ // Check if we are on the user's profile page
50
+ wp_enqueue_script(
51
+ 'pp-capabilities-chosen-js',
52
+ plugin_dir_url(CME_FILE) . 'common/libs/chosen-v1.8.3/chosen.jquery.js',
53
+ ['jquery'],
54
+ CAPSMAN_VERSION
55
+ );
56
+
57
+ wp_enqueue_script(
58
+ 'pp-capabilities-roles-profile-js',
59
+ plugin_dir_url(CME_FILE) . 'common/js/profile.js',
60
+ ['jquery', 'pp-capabilities-chosen-js'],
61
+ CAPSMAN_VERSION
62
+ );
63
+
64
+ wp_enqueue_style(
65
+ 'pp-capabilities-chosen-css',
66
+ plugin_dir_url(CME_FILE) . 'common/libs/chosen-v1.8.3/chosen.css',
67
+ false,
68
+ CAPSMAN_VERSION
69
+ );
70
+ wp_enqueue_style(
71
+ 'pp-capabilities-roles-profile-css',
72
+ plugin_dir_url(CME_FILE) . 'common/css/profile.css',
73
+ ['pp-capabilities-chosen-css'],
74
+ CAPSMAN_VERSION
75
+ );
76
+
77
+ $userId = isset($_GET['user_id']) ? (int)$_GET['user_id'] : 0;
78
+
79
+ wp_localize_script(
80
+ 'pp-capabilities-roles-profile-js',
81
+ 'ppCapabilitiesProfileData',
82
+ [
83
+ 'selected_roles' => ($userId) ? $this->getUsersRoles($userId) : (array) get_option('default_role'),
84
+ ]
85
+ );
86
+ }
87
+ }
88
  }
89
 
90
+ function adminPrintScripts() {
91
+ // Counteract overzealous menu icon styling in PublishPress <= 3.2.0 :)
92
+ if (defined('PUBLISHPRESS_VERSION') && version_compare(constant('PUBLISHPRESS_VERSION'), '3.2.0', '<=') && defined('PP_CAPABILITIES_FIX_ADMIN_ICON')):?>
93
+ <style type="text/css">
94
+ #toplevel_page_pp-capabilities .dashicons-before::before, #toplevel_page_pp-capabilities .wp-has-current-submenu .dashicons-before::before {
95
+ background-image: inherit !important;
96
+ content: "\f112" !important;
97
+ }
98
+ </style>
99
+ <?php endif;
100
  }
101
 
102
+ /**
103
+ * Returns a list of roles with name and display name to populate a select field.
104
+ *
105
+ * @param int $userId
106
+ *
107
+ * @return array
108
+ */
109
+ protected function getUsersRoles($userId)
110
+ {
111
+ if (empty($userId)) {
112
+ return [];
113
+ }
114
+
115
+ $user = get_user_by('id', $userId);
116
 
117
+ if (empty($user)) {
118
+ return [];
 
119
  }
 
120
 
121
+ return $user->roles;
 
122
  }
123
 
124
+ public function action_profile_update($userId, $oldUserData = [])
125
+ {
126
+ // Check if we need to update the user's roles, allowing to set multiple roles.
127
+ if (isset($_POST['pp_roles']) && current_user_can('promote_users')) {
128
+ // Remove the user's roles
129
+ $user = get_user_by('ID', $userId);
130
+
131
+ $newRoles = $_POST['pp_roles'];
132
+ $currentRoles = $user->roles;
133
+
134
+ if (empty($newRoles) || !is_array($newRoles)) {
135
+ return;
136
+ }
137
+
138
+ // Remove unselected roles
139
+ foreach ($currentRoles as $role) {
140
+ // Check if it is a bbPress rule. If so, don't remove it.
141
+ $isBBPressRole = preg_match('/^bbp_/', $role);
142
+
143
+ if (!in_array($role, $newRoles) && !$isBBPressRole) {
144
+ $user->remove_role($role);
145
+ }
146
+ }
147
+
148
+ // Add new roles
149
+ foreach ($newRoles as $role) {
150
+ if (!in_array($role, $currentRoles)) {
151
+ $user->add_role($role);
152
  }
 
 
 
153
  }
154
  }
155
  }
156
 
157
+ // perf enhancement: display submenu links without loading framework and plugin code
158
+ function cmeSubmenus() {
159
+ // First we check if user is administrator and can 'manage_capabilities'.
160
+ if (current_user_can('administrator') && ! current_user_can('manage_capabilities')) {
161
+ if ($admin = get_role('administrator')) {
162
+ $admin->add_cap('manage_capabilities');
163
+ }
164
+ }
165
 
166
+ $cap_name = (is_multisite() && is_super_admin()) ? 'read' : 'manage_capabilities';
167
 
168
+ $permissions_title = __('Capabilities', 'capsman-enhanced');
169
+
170
+ $menu_order = 72;
171
+
172
+ if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
173
+ foreach ((array)get_option('active_plugins') as $plugin_file) {
174
+ if ( false !== strpos($plugin_file, 'publishpress.php') ) {
175
+ $menu_order = 27;
176
+ }
177
+ }
178
+ }
179
+
180
+ add_menu_page(
181
+ $permissions_title,
182
+ $permissions_title,
183
+ $cap_name,
184
+ 'pp-capabilities',
185
+ 'cme_fakefunc',
186
+ 'dashicons-admin-network',
187
+ $menu_order
188
+ );
189
+
190
+ add_submenu_page('pp-capabilities', __('Roles', 'capsman-enhanced'), __('Roles', 'capsman-enhanced'), $cap_name, 'pp-capabilities-roles', 'cme_fakefunc');
191
+ add_submenu_page('pp-capabilities', __('Admin Menus', 'capsman-enhanced'), __('Admin Menus', 'capsman-enhanced'), $cap_name, 'pp-capabilities-admin-menus', 'cme_fakefunc');
192
+ add_submenu_page('pp-capabilities', __('Nav Menus', 'capsman-enhanced'), __('Nav Menus', 'capsman-enhanced'), $cap_name, 'pp-capabilities-nav-menus', 'cme_fakefunc');
193
+ add_submenu_page('pp-capabilities', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'pp-capabilities-backup', 'cme_fakefunc');
194
+
195
+ if (defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
196
+ add_submenu_page('pp-capabilities', __('Settings', 'capsman-enhanced'), __('Settings', 'capsman-enhanced'), $cap_name, 'pp-capabilities-settings', 'cme_fakefunc');
197
+ }
198
+
199
+ if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
200
+ add_submenu_page(
201
+ 'pp-capabilities',
202
+ __('Upgrade to Pro', 'capsman-enhanced'),
203
+ __('Upgrade to Pro', 'capsman-enhanced'),
204
+ 'manage_capabilities',
205
+ 'capsman-enhanced',
206
+ 'cme_fakefunc'
207
+ );
208
+ }
209
  }
210
 
 
 
211
  }
212
 
213
+ function cme_fakefunc() {
 
 
 
 
 
 
 
 
 
 
 
214
  }
includes/functions.php CHANGED
@@ -1,13 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Functions available for any URL, which are not contained within a class
6
- *
7
- * For performance and code separation, do not include functions that are only needed for wp-admin requests
8
- *
9
- */
10
-
11
  function pp_capabilities_is_editable_role($role_name, $args = []) {
12
  static $editable_roles;
13
 
@@ -17,7 +8,7 @@ function pp_capabilities_is_editable_role($role_name, $args = []) {
17
 
18
  if (!isset($editable_roles) || !empty($args['force_refresh'])) {
19
  $all_roles = wp_roles()->roles;
20
- $editable_roles = apply_filters('editable_roles', $all_roles, $args);
21
  }
22
 
23
  return apply_filters('pp_capabilities_editable_role', isset($editable_roles[$role_name]), $role_name);
@@ -130,134 +121,3 @@ function pp_capabilities_update_permissions_option($option_basename, $option_val
130
  {
131
  function_exists('presspermit') ? presspermit()->updateOption($option_basename, $option_val) : pp_update_option($option_basename, $option_val);
132
  }
133
-
134
- /**
135
- * Get post type.
136
- *
137
- * @return null|string String of the post type.
138
- */
139
- function pp_capabilities_get_post_type()
140
- {
141
- global $post, $typenow, $current_screen;
142
-
143
- // We have a post so we can just get the post type from that.
144
- if ($post && $post->post_type) {
145
- return $post->post_type;
146
- }
147
-
148
- // Check the global $typenow - set in admin.php
149
- if ($typenow) {
150
- return $typenow;
151
- }
152
-
153
- // Check the global $current_screen object - set in screen.php
154
- if ($current_screen && $current_screen->post_type) {
155
- return $current_screen->post_type;
156
- }
157
-
158
- if (isset($_GET['post']) && !is_array($_GET['post'])) {
159
- $post_id = (int) esc_attr($_GET['post']);
160
-
161
- } elseif (isset($_POST['post_ID'])) {
162
- $post_id = (int) esc_attr($_POST['post_ID']);
163
- }
164
-
165
- if (!empty($post_id)) {
166
- return get_post_type($post_id);
167
- }
168
-
169
- // lastly check the post_type querystring
170
- if (isset($_REQUEST['post_type'])) {
171
- return sanitize_key($_REQUEST['post_type']);
172
- }
173
-
174
- return 'post';
175
- }
176
-
177
- /**
178
- * Check if Classic Editor plugin is available.
179
- *
180
- * @return bool
181
- */
182
- function pp_capabilities_is_classic_editor_available()
183
- {
184
- global $wp_version;
185
-
186
- return class_exists('Classic_Editor')
187
- || function_exists( 'the_gutenberg_project' )
188
- || class_exists('Gutenberg_Ramp')
189
- || version_compare($wp_version, '5.0', '<')
190
- || (function_exists('et_get_option') && 'on' === et_get_option('et_enable_classic_editor', 'off'));
191
- }
192
-
193
-
194
- /**
195
- * Get admin bar node and set as global for our usage.
196
- * Due to admin toolbar, this function need to run in frontend as well
197
- *
198
- * @return array||object $wp_admin_bar nodes.
199
- */
200
- function ppc_features_get_admin_bar_nodes($wp_admin_bar){
201
-
202
- $adminBarNode = is_object($wp_admin_bar) ? $wp_admin_bar->get_nodes() : '';
203
- $ppcAdminBar = [];
204
-
205
- if (is_array($adminBarNode) || is_object($adminBarNode)) {
206
- foreach ($adminBarNode as $adminBarnode) {
207
- $id = $adminBarnode->id;
208
- $title = $adminBarnode->title;
209
- $parent = $adminBarnode->parent;
210
- $ppcAdminBar[$id] = array('id' => $id, 'title' => $title, 'parent' => $parent);
211
- }
212
- }
213
-
214
- $GLOBALS['ppcAdminBar'] = $ppcAdminBar;
215
- }
216
- add_action('admin_bar_menu', 'ppc_features_get_admin_bar_nodes', 999);
217
-
218
- /**
219
- * Implement admin features restriction.
220
- * Due to admin toolbar, this function need to run in frontend as well
221
- *
222
- */
223
- function ppc_admin_feature_restrictions() {
224
- require_once ( dirname(CME_FILE) . '/includes/features/restrict-admin-features.php' );
225
- PP_Capabilities_Admin_Features::adminFeaturedRestriction();
226
- }
227
- add_action('plugins_loaded', 'ppc_admin_feature_restrictions');
228
-
229
- /**
230
- * List of capabilities admin pages
231
- *
232
- */
233
- function pp_capabilities_admin_pages(){
234
-
235
- $pp_capabilities_pages = [
236
- 'pp-capabilities',
237
- 'pp-capabilities-roles',
238
- 'pp-capabilities-admin-menus',
239
- 'pp-capabilities-nav-menus',
240
- 'pp-capabilities-editor-features',
241
- 'pp-capabilities-backup',
242
- 'pp-capabilities-settings',
243
- 'pp-capabilities-admin-features'
244
- ];
245
-
246
- return apply_filters('pp_capabilities_admin_pages', $pp_capabilities_pages);
247
- }
248
-
249
- /**
250
- * Check if user is in capabilities admin page
251
- *
252
- */
253
- function is_pp_capabilities_admin_page(){
254
-
255
- $pp_capabilities_pages = pp_capabilities_admin_pages();
256
-
257
- $is_pp_capabilities_page = false;
258
- if ( isset( $_GET['page'] ) && in_array( $_GET['page'], $pp_capabilities_pages )) {
259
- $is_pp_capabilities_page = true;
260
- }
261
-
262
- return apply_filters('is_pp_capabilities_admin_page', $is_pp_capabilities_page);
263
- }
1
  <?php
 
 
 
 
 
 
 
 
 
2
  function pp_capabilities_is_editable_role($role_name, $args = []) {
3
  static $editable_roles;
4
 
8
 
9
  if (!isset($editable_roles) || !empty($args['force_refresh'])) {
10
  $all_roles = wp_roles()->roles;
11
+ $editable_roles = apply_filters('editable_roles', $all_roles);
12
  }
13
 
14
  return apply_filters('pp_capabilities_editable_role', isset($editable_roles[$role_name]), $role_name);
121
  {
122
  function_exists('presspermit') ? presspermit()->updateOption($option_basename, $option_val) : pp_update_option($option_basename, $option_val);
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/handler.php CHANGED
@@ -1,11 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Process update operations from the Capabilities screen
6
- *
7
- */
8
-
9
  class CapsmanHandler
10
  {
11
  var $cm;
@@ -33,7 +26,7 @@ class CapsmanHandler
33
  if ( ! empty($post['CreateRole']) ) {
34
  if ( $newrole = $this->createRole($post['create-name']) ) {
35
  ak_admin_notify(__('New role created.', 'capsman-enhanced'));
36
- $this->cm->set_current_role($newrole);
37
  } else {
38
  if ( empty($post['create-name']) && in_array(get_locale(), ['en_EN', 'en_US']) )
39
  ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
@@ -52,14 +45,14 @@ class CapsmanHandler
52
  update_option($wp_roles->role_key, $wp_roles->roles);
53
 
54
  ak_admin_notify(sprintf(__('Role "%s" (id %s) renamed to "%s"', 'capsman-enhanced'), $old_title, strtolower($current->name), $new_title));
55
- $this->cm->set_current_role($current->name);
56
  }
57
  // Copy current role to a new one.
58
  } elseif ( ! empty($post['CopyRole']) ) {
59
  $current = get_role($post['current']);
60
  if ( $newrole = $this->createRole($post['copy-name'], $current->capabilities) ) {
61
  ak_admin_notify(__('New role created.', 'capsman-enhanced'));
62
- $this->cm->set_current_role($newrole);
63
  } else {
64
  if ( empty($post['copy-name']) && in_array(get_locale(), ['en_EN', 'en_US']) )
65
  ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
@@ -364,6 +357,7 @@ class CapsmanHandler
364
  foreach ( $del_caps as $cap => $grant) {
365
  $blog_role->remove_cap($cap);
366
  }
 
367
  } else {
368
  $wp_roles->add_role( $role_name, $role_caption, $new_caps );
369
  }
1
  <?php
 
 
 
 
 
 
 
2
  class CapsmanHandler
3
  {
4
  var $cm;
26
  if ( ! empty($post['CreateRole']) ) {
27
  if ( $newrole = $this->createRole($post['create-name']) ) {
28
  ak_admin_notify(__('New role created.', 'capsman-enhanced'));
29
+ $this->cm->current = $newrole;
30
  } else {
31
  if ( empty($post['create-name']) && in_array(get_locale(), ['en_EN', 'en_US']) )
32
  ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
45
  update_option($wp_roles->role_key, $wp_roles->roles);
46
 
47
  ak_admin_notify(sprintf(__('Role "%s" (id %s) renamed to "%s"', 'capsman-enhanced'), $old_title, strtolower($current->name), $new_title));
48
+ $this->cm->current = $current->name;
49
  }
50
  // Copy current role to a new one.
51
  } elseif ( ! empty($post['CopyRole']) ) {
52
  $current = get_role($post['current']);
53
  if ( $newrole = $this->createRole($post['copy-name'], $current->capabilities) ) {
54
  ak_admin_notify(__('New role created.', 'capsman-enhanced'));
55
+ $this->cm->current = $newrole;
56
  } else {
57
  if ( empty($post['copy-name']) && in_array(get_locale(), ['en_EN', 'en_US']) )
58
  ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
357
  foreach ( $del_caps as $cap => $grant) {
358
  $blog_role->remove_cap($cap);
359
  }
360
+
361
  } else {
362
  $wp_roles->add_role( $role_name, $role_caption, $new_caps );
363
  }
includes/manager.php CHANGED
@@ -1,14 +1,7 @@
1
  <?php
2
  /**
3
- * PublishPress Capabilities [Free]
4
- *
5
  * Plugin to create and manage roles and capabilities.
6
- *
7
- * This is the plugin's original controller module, which is due for some refactoring.
8
- * It registers and handles menus, loads javascript, and processes or routes update operations from the Capabilities screen.
9
- *
10
- * Note: for lower overhead, this module is only loaded for Capabilities Pro URLs.
11
- * For all other wp-admin URLs, menus are registered by a separate skeleton module.
12
  *
13
  * @author Jordi Canals, Kevin Behrens
14
  * @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
@@ -175,36 +168,27 @@ class CapabilityManager
175
  */
176
  function adminStyles()
177
  {
178
- if (empty($_REQUEST['page'])
179
- || !in_array(
180
- $_REQUEST['page'],
181
- ['pp-capabilities', 'pp-capabilities-roles', 'pp-capabilities-admin-menus', 'pp-capabilities-nav-menus', 'pp-capabilities-editor-features', 'pp-capabilities-backup', 'pp-capabilities-settings', 'pp-capabilities-admin-features']
182
- )
183
- ) {
184
  return;
185
- }
186
 
187
  wp_enqueue_style('cme-admin-common', $this->mod_url . '/common/css/pressshack-admin.css', [], PUBLISHPRESS_CAPS_VERSION);
188
 
189
  wp_register_style( $this->ID . 'framework_admin', $this->mod_url . '/framework/styles/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
190
- wp_enqueue_style( $this->ID . 'framework_admin');
191
 
192
- wp_register_style( $this->ID . '_admin', $this->mod_url . '/common/css/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
193
- wp_enqueue_style( $this->ID . '_admin');
194
 
195
  $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
196
  $url = $this->mod_url . "/common/js/admin{$suffix}.js";
197
  wp_enqueue_script( 'cme_admin', $url, array('jquery'), PUBLISHPRESS_CAPS_VERSION, true );
198
- wp_localize_script( 'cme_admin', 'cmeAdmin', [
199
  'negationCaption' => __( 'Explicity negate this capability by storing as disabled', 'capsman-enhanced' ),
200
  'typeCapsNegationCaption' => __( 'Explicitly negate these capabilities by storing as disabled', 'capsman-enhanced' ),
201
  'typeCapUnregistered' => __( 'Post type registration does not define this capability distinctly', 'capsman-enhanced' ),
202
  'capNegated' => __( 'This capability is explicitly negated. Click to add/remove normally.', 'capsman-enhanced' ),
203
  'chkCaption' => __( 'Add or remove this capability from the WordPress role', 'capsman-enhanced' ),
204
- 'switchableCaption' => __( 'Add or remove capability from the role normally', 'capsman-enhanced' ) ,
205
- 'deleteWarning' => __( 'Are you sure you want to delete this item ?', 'capsman-enhanced' ),
206
- 'saveWarning' => __( 'Add or clear custom item entry before saving changes.', 'capsman-enhanced' )
207
- ]
208
  );
209
  }
210
 
@@ -244,26 +228,6 @@ class CapabilityManager
244
  add_filter( 'plugins_loaded', array( &$this, 'processRoleUpdate' ) );
245
  }
246
 
247
- public function set_current_role($role_name) {
248
- global $current_user;
249
-
250
- if ($role_name && !empty($current_user) && !empty($current_user->ID)) {
251
- update_option("capsman_last_role_{$current_user->ID}", $role_name);
252
- }
253
- }
254
-
255
- public function get_last_role() {
256
- global $current_user;
257
-
258
- $role_name = get_option("capsman_last_role_{$current_user->ID}");
259
-
260
- if (!$role_name || !get_role($role_name)) {
261
- $role_name = get_option('default_role');
262
- }
263
-
264
- return $role_name;
265
- }
266
-
267
  // Direct query of stored role definitions
268
  function log_db_roles( $legacy_arg = '' ) {
269
  global $wpdb;
@@ -367,11 +331,7 @@ class CapabilityManager
367
  }
368
  );
369
  }
370
-
371
- add_submenu_page('pp-capabilities', __('Editor Features', 'capsman-enhanced'), __('Editor Features', 'capsman-enhanced'), $cap_name, 'pp-capabilities-editor-features', [$this, 'ManageEditorFeatures']);
372
-
373
- add_submenu_page('pp-capabilities', __('Admin Features', 'capsman-enhanced'), __('Admin Features', 'capsman-enhanced'), $cap_name, 'pp-capabilities-admin-features', [$this, 'ManageAdminFeatures']);
374
-
375
  do_action('pp-capabilities-admin-submenus');
376
 
377
  add_submenu_page('pp-capabilities', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'pp-capabilities-backup', array($this, 'backupTool'));
@@ -400,8 +360,8 @@ class CapabilityManager
400
 
401
  function($arr) {
402
  return [
403
- 'cb' => '<input type="checkbox"/>',
404
- 'name' => __('Name', 'capsman-enhanced'),
405
  'role' => __('Role', 'capsman-enhanced'),
406
  'count' => __('Users', 'capsman-enhanced'),
407
  ];
@@ -444,111 +404,6 @@ class CapabilityManager
444
  require_once ( dirname(CME_FILE) . '/includes/roles/roles.php' );
445
  }
446
 
447
-
448
- /**
449
- * Manages Editor Features
450
- *
451
- * @return void
452
- */
453
- public function ManageEditorFeatures() {
454
- if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) {
455
- // TODO: Implement exceptions.
456
- wp_die('<strong>' .__('You do not have permission to manage editor features.', 'capabilities-pro') . '</strong>');
457
- }
458
-
459
- $this->generateNames();
460
- $roles = array_keys($this->roles);
461
-
462
- if (!isset($this->current)) {
463
- if (empty($_POST) && !empty($_REQUEST['role'])) {
464
- $this->set_current_role($_REQUEST['role']);
465
- }
466
- }
467
-
468
- if (!isset($this->current) || !get_role($this->current)) {
469
- $this->current = get_option('default_role');
470
- }
471
-
472
- if (!in_array($this->current, $roles)) {
473
- $this->current = array_shift($roles);
474
- }
475
-
476
- if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['ppc-editor-features-role'])) {
477
- $this->set_current_role($_POST['ppc-editor-features-role']);
478
-
479
- $classic_editor = pp_capabilities_is_classic_editor_available();
480
-
481
- //$def_post_types = apply_filters('pp_capabilities_feature_post_types', get_post_types(['public' => true]));
482
- $def_post_types = apply_filters('pp_capabilities_feature_post_types', ['post', 'page']);
483
-
484
- foreach ($def_post_types as $post_type) {
485
- if ($classic_editor) {
486
- $posted_settings = (isset($_POST["capsman_feature_restrict_classic_{$post_type}"])) ? $_POST["capsman_feature_restrict_classic_{$post_type}"] : [];
487
- $post_features_option = get_option("capsman_feature_restrict_classic_{$post_type}", []);
488
- $post_features_option[$_POST['ppc-editor-features-role']] = $posted_settings;
489
- update_option("capsman_feature_restrict_classic_{$post_type}", $post_features_option, false);
490
- }
491
-
492
- $posted_settings = (isset($_POST["capsman_feature_restrict_{$post_type}"])) ? $_POST["capsman_feature_restrict_{$post_type}"] : [];
493
- $post_features_option = get_option("capsman_feature_restrict_{$post_type}", []);
494
- $post_features_option[$_POST['ppc-editor-features-role']] = $posted_settings;
495
- update_option("capsman_feature_restrict_{$post_type}", $post_features_option, false);
496
- }
497
-
498
- ak_admin_notify(__('Settings updated.', 'capabilities-pro'));
499
- }
500
-
501
- do_action('pp_capabilities_editor_features');
502
- include(dirname(CME_FILE) . '/includes/features/editor-features.php');
503
- }
504
-
505
- /**
506
- * Manages Admin Features
507
- *
508
- * @return void
509
- */
510
- public function ManageAdminFeatures() {
511
- if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) {
512
- // TODO: Implement exceptions.
513
- wp_die('<strong>' .__('You do not have permission to manage admin features.', 'capabilities-pro') . '</strong>');
514
- }
515
-
516
- $this->generateNames();
517
- $roles = array_keys($this->roles);
518
-
519
- if (!isset($this->current)) {
520
- if (empty($_POST) && !empty($_REQUEST['role'])) {
521
- $this->set_current_role($_REQUEST['role']);
522
- }
523
- }
524
-
525
- if (!isset($this->current) || !get_role($this->current)) {
526
- $this->current = get_option('default_role');
527
- }
528
-
529
- if (!in_array($this->current, $roles)) {
530
- $this->current = array_shift($roles);
531
- }
532
-
533
- if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['ppc-admin-features-role'])) {
534
- $this->set_current_role($_POST['ppc-admin-features-role']);
535
-
536
- $disabled_admin_items = !empty(get_option('capsman_disabled_admin_features')) ? (array)get_option('capsman_disabled_admin_features') : [];
537
- $disabled_admin_items[$_POST['ppc-admin-features-role']] = isset($_POST['capsman_disabled_admin_features']) ? $_POST['capsman_disabled_admin_features'] : '';
538
-
539
- update_option('capsman_disabled_admin_features', $disabled_admin_items, false);
540
-
541
- //set reload option for instant reflection if user is updating own role
542
- if(in_array($_POST['ppc-admin-features-role'], wp_get_current_user()->roles)){
543
- $ppc_page_reload = '1';
544
- }
545
-
546
- ak_admin_notify(__('Settings updated.', 'capabilities-pro'));
547
- }
548
-
549
- include(dirname(CME_FILE) . '/includes/features/admin-features.php');
550
- }
551
-
552
  /**
553
  * Sets the 'manage_capabilities' cap to the administrator role.
554
  *
@@ -575,7 +430,7 @@ class CapabilityManager
575
  {
576
  global $current_user;
577
 
578
- if (function_exists('wp_get_current_user') || defined('PP_CAPABILITIES_ROLES_FILTER_EARLY_EXECUTION')) { // Avoid downstream fatal error from premature current_user_can() call if get_editable_roles() is called too early
579
  $this->generateNames();
580
  $valid = array_keys($this->roles);
581
 
@@ -721,12 +576,12 @@ class CapabilityManager
721
  wp_die(__('The selected role is not editable.', 'capsman-enhanced'));
722
  }
723
 
724
- $this->set_current_role($role);
725
  }
726
  }
727
 
728
  if (!isset($this->current) || !get_role($this->current)) {
729
- $this->current = $this->get_last_role();
730
  }
731
 
732
  if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
@@ -754,12 +609,12 @@ class CapabilityManager
754
  $post['caps'] = array();
755
  }
756
 
 
 
757
  // Select a new role.
758
  if ( ! empty($post['LoadRole']) ) {
759
- $this->set_current_role($post['role']);
760
  } else {
761
- $this->set_current_role($post['current']);
762
-
763
  require_once( dirname(__FILE__).'/handler.php' );
764
  $capsman_modify = new CapsmanHandler( $this );
765
  $capsman_modify->processAdminGeneral( $post );
1
  <?php
2
  /**
3
+ * Capability Manager.
 
4
  * Plugin to create and manage roles and capabilities.
 
 
 
 
 
 
5
  *
6
  * @author Jordi Canals, Kevin Behrens
7
  * @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
168
  */
169
  function adminStyles()
170
  {
171
+ if ( empty( $_REQUEST['page'] ) || ! in_array( $_REQUEST['page'], array( 'pp-capabilities', 'pp-capabilities-roles', 'pp-capabilities-admin-menus', 'pp-capabilities-nav-menus', 'pp-capabilities-backup', 'pp-capabilities-settings' ) ) )
 
 
 
 
 
172
  return;
 
173
 
174
  wp_enqueue_style('cme-admin-common', $this->mod_url . '/common/css/pressshack-admin.css', [], PUBLISHPRESS_CAPS_VERSION);
175
 
176
  wp_register_style( $this->ID . 'framework_admin', $this->mod_url . '/framework/styles/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
177
+ wp_enqueue_style( $this->ID . 'framework_admin');
178
 
179
+ wp_register_style( $this->ID . '_admin', $this->mod_url . '/common/css/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
180
+ wp_enqueue_style( $this->ID . '_admin');
181
 
182
  $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
183
  $url = $this->mod_url . "/common/js/admin{$suffix}.js";
184
  wp_enqueue_script( 'cme_admin', $url, array('jquery'), PUBLISHPRESS_CAPS_VERSION, true );
185
+ wp_localize_script( 'cme_admin', 'cmeAdmin', array(
186
  'negationCaption' => __( 'Explicity negate this capability by storing as disabled', 'capsman-enhanced' ),
187
  'typeCapsNegationCaption' => __( 'Explicitly negate these capabilities by storing as disabled', 'capsman-enhanced' ),
188
  'typeCapUnregistered' => __( 'Post type registration does not define this capability distinctly', 'capsman-enhanced' ),
189
  'capNegated' => __( 'This capability is explicitly negated. Click to add/remove normally.', 'capsman-enhanced' ),
190
  'chkCaption' => __( 'Add or remove this capability from the WordPress role', 'capsman-enhanced' ),
191
+ 'switchableCaption' => __( 'Add or remove capability from the role normally', 'capsman-enhanced' ) )
 
 
 
192
  );
193
  }
194
 
228
  add_filter( 'plugins_loaded', array( &$this, 'processRoleUpdate' ) );
229
  }
230
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  // Direct query of stored role definitions
232
  function log_db_roles( $legacy_arg = '' ) {
233
  global $wpdb;
331
  }
332
  );
333
  }
334
+
 
 
 
 
335
  do_action('pp-capabilities-admin-submenus');
336
 
337
  add_submenu_page('pp-capabilities', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'pp-capabilities-backup', array($this, 'backupTool'));
360
 
361
  function($arr) {
362
  return [
363
+ 'cb' => '<input type="checkbox"/>',
364
+ 'name' => __('Name', 'capsman-enhanced'),
365
  'role' => __('Role', 'capsman-enhanced'),
366
  'count' => __('Users', 'capsman-enhanced'),
367
  ];
404
  require_once ( dirname(CME_FILE) . '/includes/roles/roles.php' );
405
  }
406
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  /**
408
  * Sets the 'manage_capabilities' cap to the administrator role.
409
  *
430
  {
431
  global $current_user;
432
 
433
+ if (function_exists('wp_get_current_user')) { // Avoid downstream fatal error from premature current_user_can() call if get_editable_roles() is called too early
434
  $this->generateNames();
435
  $valid = array_keys($this->roles);
436
 
576
  wp_die(__('The selected role is not editable.', 'capsman-enhanced'));
577
  }
578
 
579
+ $this->current = $role;
580
  }
581
  }
582
 
583
  if (!isset($this->current) || !get_role($this->current)) {
584
+ $this->current = get_option('default_role');
585
  }
586
 
587
  if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
609
  $post['caps'] = array();
610
  }
611
 
612
+ $this->current = $post['current'];
613
+
614
  // Select a new role.
615
  if ( ! empty($post['LoadRole']) ) {
616
+ $this->current = $post['role'];
617
  } else {
 
 
618
  require_once( dirname(__FILE__).'/handler.php' );
619
  $capsman_modify = new CapsmanHandler( $this );
620
  $capsman_modify->processAdminGeneral( $post );
includes/network.php CHANGED
@@ -1,11 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Multisite-related functions / filter handlers
6
- *
7
- */
8
-
9
  add_action( 'wpmu_new_blog', '_cme_new_blog' );
10
  function _cme_new_blog( $new_blog_id ) {
11
  if ( $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) ) {
@@ -74,7 +67,7 @@ function _cme_new_blog( $new_blog_id ) {
74
  if ( defined('PRESSPERMIT_ACTIVE') ) {
75
  pp_capabilities_update_permissions_option('supplemental_role_defs', $blog_pp_only);
76
  }
77
-
78
  restore_current_blog();
79
  ( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
80
 
1
  <?php
 
 
 
 
 
 
 
2
  add_action( 'wpmu_new_blog', '_cme_new_blog' );
3
  function _cme_new_blog( $new_blog_id ) {
4
  if ( $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) ) {
67
  if ( defined('PRESSPERMIT_ACTIVE') ) {
68
  pp_capabilities_update_permissions_option('supplemental_role_defs', $blog_pp_only);
69
  }
70
+
71
  restore_current_blog();
72
  ( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
73
 
includes/pp-handler.php CHANGED
@@ -1,10 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Process updates to Type-Specific Types / Taxonomies, Detailed Taxonomies
6
- *
7
- */
8
 
9
  function _cme_update_pp_usage() {
10
  static $updated;
@@ -59,7 +53,7 @@ function _cme_update_pp_usage() {
59
  // ensure smooth transition if Press Permit Core is deactivated
60
  update_option( 'cme_enabled_post_types', $value );
61
  }
62
-
63
  if (defined('PRESSPERMIT_ACTIVE') && in_array($option_basename, ['enabled_post_types', 'enabled_taxonomies'])) {
64
  pp_capabilities_update_permissions_option($option_basename, $value);
65
  }
@@ -95,3 +89,4 @@ function _cme_update_pp_usage() {
95
 
96
  return $updated;
97
  }
 
1
  <?php
 
 
 
 
 
 
2
 
3
  function _cme_update_pp_usage() {
4
  static $updated;
53
  // ensure smooth transition if Press Permit Core is deactivated
54
  update_option( 'cme_enabled_post_types', $value );
55
  }
56
+
57
  if (defined('PRESSPERMIT_ACTIVE') && in_array($option_basename, ['enabled_post_types', 'enabled_taxonomies'])) {
58
  pp_capabilities_update_permissions_option($option_basename, $value);
59
  }
89
 
90
  return $updated;
91
  }
92
+
includes/pp-ui.php CHANGED
@@ -1,12 +1,4 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Capabilities UI: PublishPress Permissions integration
6
- *
7
- * This module also contains the Settings UI for Type-Specific Types / Taxonomies, which were previously a front end to PublishPress Permissions
8
- *
9
- */
10
 
11
  class Capsman_PP_UI {
12
  function get_metagroup_caps( $default ) {
@@ -78,6 +70,24 @@ class Capsman_PP_UI {
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  // Note: CME can now impose type-specific capabilities without Press Permit Core active
82
  function pp_types_ui( $defined_types ) {
83
  ?>
1
  <?php
 
 
 
 
 
 
 
 
2
 
3
  class Capsman_PP_UI {
4
  function get_metagroup_caps( $default ) {
70
  }
71
  }
72
 
73
+ function pp_only_roles_ui( $default ) {
74
+ $support_pp_only_roles = defined('PRESSPERMIT_ACTIVE') || version_compare( PP_VERSION, '1.0-beta1.4', '>=');
75
+ ?>
76
+
77
+ <?php if ( $support_pp_only_roles && ! in_array( $default, array( /*'subscriber', 'contributor', 'author', 'editor',*/ 'administrator' ) ) ) : ?>
78
+ <div style="float:right">
79
+ <?php
80
+ pp_refresh_options();
81
+ $pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
82
+ $checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
83
+ ?>
84
+ <label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" autocomplete="off" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
85
+ </div>
86
+ <?php endif; ?>
87
+ <?php
88
+ return $support_pp_only_roles;
89
+ }
90
+
91
  // Note: CME can now impose type-specific capabilities without Press Permit Core active
92
  function pp_types_ui( $defined_types ) {
93
  ?>
includes/publishpress-roles.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  class CME_PublishPressRoles {
3
- public static function scripts() {
4
  ?>
5
  <script type="text/javascript">
6
  /* <![CDATA[ */
1
  <?php
2
  class CME_PublishPressRoles {
3
+ function scripts() {
4
  ?>
5
  <script type="text/javascript">
6
  /* <![CDATA[ */
includes/roles/class/class-pp-roles-actions.php CHANGED
@@ -185,7 +185,7 @@ class Pp_Roles_Actions
185
  * Validate input data
186
  */
187
  require_once(dirname(CME_FILE).'/includes/handler.php');
188
- $capsman_handler = new CapsmanHandler();
189
  $role = $capsman_handler->createNewName($_REQUEST['name']);
190
 
191
  /**
185
  * Validate input data
186
  */
187
  require_once(dirname(CME_FILE).'/includes/handler.php');
188
+ $capsman_handler = new CapsmanHandler();
189
  $role = $capsman_handler->createNewName($_REQUEST['name']);
190
 
191
  /**
includes/roles/class/class-pp-roles-list-table.php CHANGED
@@ -261,9 +261,7 @@ class PP_Capabilities_Roles_List_Table extends WP_List_Table
261
  ['page' => 'pp-capabilities', 'role' => esc_attr($item['role'])],
262
  admin_url('admin.php')
263
  ),
264
- esc_html($item['name']),
265
- $role_states
266
- );
267
  } else {
268
  $out = esc_html($item['name']);
269
  }
261
  ['page' => 'pp-capabilities', 'role' => esc_attr($item['role'])],
262
  admin_url('admin.php')
263
  ),
264
+ esc_html($item['name']), $role_states);
 
 
265
  } else {
266
  $out = esc_html($item['name']);
267
  }
includes/settings.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
2
- /*
3
- * PublishPress Capabilities [Free]
4
- *
5
- * Settings UI
6
- *
7
  */
8
 
9
  global $wpdb;
1
  <?php
2
+ /**
3
+ * Capability Manager Settings
4
+ *
 
 
5
  */
6
 
7
  global $wpdb;
languages/capsman-enhanced-en_US.mo CHANGED
Binary file
languages/capsman-enhanced-en_US.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: PublishPress Capabilities\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2021-08-25 10:44-0400\n"
6
- "PO-Revision-Date: 2021-08-25 10:44-0400\n"
7
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
8
  "Language-Team: PublishPress <help@publishpress.com>\n"
9
  "Language: en_US\n"
@@ -13,7 +13,7 @@ msgstr ""
13
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
14
  "X-Poedit-Basepath: F:/snapshot/capability-manager-enhanced\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Generator: Poedit 2.4.3\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-KeywordsList: __;_e;_c;_x;__ngettext\n"
19
  "X-Poedit-Basepath: ..\n"
@@ -31,16 +31,16 @@ msgstr ""
31
  msgid "<strong>This plugin can be deleted.</strong>"
32
  msgstr ""
33
 
34
- #: capsman-enhanced.php:98
35
  msgid "Warning:"
36
  msgstr ""
37
 
38
- #: capsman-enhanced.php:99
39
  #, php-format
40
  msgid "The active plugin %s is not compatible with your PHP version."
41
  msgstr ""
42
 
43
- #: capsman-enhanced.php:101
44
  #, php-format
45
  msgid "%s is required for this plugin."
46
  msgstr ""
@@ -49,11 +49,11 @@ msgstr ""
49
  msgid "Settings saved."
50
  msgstr ""
51
 
52
- #: includes-core/CoreAdmin.php:57 includes/admin-load.php:260
53
  msgid "Admin Menus"
54
  msgstr ""
55
 
56
- #: includes-core/CoreAdmin.php:58 includes/admin-load.php:261
57
  msgid "Nav Menus"
58
  msgstr ""
59
 
@@ -62,9 +62,7 @@ msgid "Admin Menu Restrictions"
62
  msgstr ""
63
 
64
  #: includes-core/admin-menus-promo.php:48 includes-core/nav-menus-promo.php:52
65
- #: includes/admin.php:109 includes/admin.php:1096
66
- #: includes/features/editor-features.php:67
67
- #: includes/features/editor-features.php:120 includes/settings.php:56
68
  msgid "Save Changes"
69
  msgstr ""
70
 
@@ -74,64 +72,12 @@ msgid ""
74
  "PublishPress Capabilities Pro"
75
  msgstr ""
76
 
77
- #: includes-core/admin-menus-promo.php:62
78
- #: includes-core/editor-features-promo.php:91
79
- #: includes-core/nav-menus-promo.php:67 includes/admin-load.php:271
80
- #: includes/admin-load.php:272 includes/manager.php:384
81
- #: includes/manager.php:385
82
  msgid "Upgrade to Pro"
83
  msgstr ""
84
 
85
- #: includes-core/editor-features-promo.php:24
86
- msgid "Metaboxes"
87
- msgstr ""
88
-
89
- #: includes-core/editor-features-promo.php:32
90
- msgid "Checklist"
91
- msgstr ""
92
-
93
- #: includes-core/editor-features-promo.php:45
94
- msgid "Editorial Comments"
95
- msgstr ""
96
-
97
- #: includes-core/editor-features-promo.php:58
98
- msgid "Notifications"
99
- msgstr ""
100
-
101
- #: includes-core/editor-features-promo.php:71
102
- msgid "TaxoPress - Settings"
103
- msgstr ""
104
-
105
- #: includes-core/editor-features-promo.php:86
106
- msgid ""
107
- "You can select plugin metaboxes to hide, or enter a class or ID for custom "
108
- "items. This feature is available in PublishPress Capabilities Pro."
109
- msgstr ""
110
-
111
- #: includes-core/editor-features-promo.php:101
112
- msgid "Custom Items"
113
- msgstr ""
114
-
115
- #: includes-core/editor-features-promo.php:107
116
- msgid "Custom item one"
117
- msgstr ""
118
-
119
- #: includes-core/editor-features-promo.php:108
120
- #: includes-core/editor-features-promo.php:122
121
- #: includes-core/editor-features-promo.php:135
122
- #: includes/roles/class/class-pp-roles-list-table.php:168
123
- #: includes/roles/class/class-pp-roles-list-table.php:307
124
- msgid "Delete"
125
- msgstr ""
126
-
127
- #: includes-core/editor-features-promo.php:121
128
- msgid "Permalink: Descriptive Caption"
129
- msgstr ""
130
-
131
- #: includes-core/editor-features-promo.php:135
132
- msgid "Page Attributes: Order"
133
- msgstr ""
134
-
135
  #: includes-core/nav-menus-promo.php:29
136
  msgid "Navigation Menu Restrictions"
137
  msgstr ""
@@ -142,47 +88,24 @@ msgid ""
142
  "PublishPress Capabilities Pro"
143
  msgstr ""
144
 
145
- #: includes/admin-load.php:236 includes/manager.php:337
146
- #: includes/roles/class/class-pp-roles-list-table.php:125
147
- msgid "Capabilities"
148
- msgstr ""
149
-
150
- #: includes/admin-load.php:258 includes/manager.php:359
151
- #: includes/roles/roles.php:4
152
- msgid "Roles"
153
- msgstr ""
154
-
155
- #: includes/admin-load.php:259 includes/manager.php:371
156
- msgid "Editor Features"
157
- msgstr ""
158
-
159
- #: includes/admin-load.php:262 includes/backup.php:47 includes/manager.php:375
160
- msgid "Backup"
161
- msgstr ""
162
-
163
- #: includes/admin-load.php:265
164
- #: includes/features/restrict-editor-features.php:313 includes/manager.php:378
165
- msgid "Settings"
166
- msgstr ""
167
-
168
- #: includes/admin.php:40
169
  #, php-format
170
  msgid ""
171
  "Warning: This role cannot access the dashboard without the read capability. "
172
  "%1$sClick here to fix this now%2$s."
173
  msgstr ""
174
 
175
- #: includes/admin.php:68
176
  msgid "Role Capabilities"
177
  msgstr ""
178
 
179
- #: includes/admin.php:119
180
  msgid ""
181
  "<strong>Note:</strong> Capability changes <strong>remain in the database</"
182
  "strong> after plugin deactivation."
183
  msgstr ""
184
 
185
- #: includes/admin.php:124
186
  #, php-format
187
  msgid ""
188
  "<strong>Note:</strong> Capability changes <strong>remain in the database</"
@@ -190,222 +113,225 @@ msgid ""
190
  "%sPermission Group%s."
191
  msgstr ""
192
 
193
- #: includes/admin.php:158 includes/settings.php:40
194
  msgid "PublishPress Permissions"
195
  msgstr ""
196
 
197
- #: includes/admin.php:160
198
  msgid ""
199
  "Automatically define type-specific capabilities for your custom post types "
200
  "and taxonomies"
201
  msgstr ""
202
 
203
- #: includes/admin.php:164
204
  msgid "Assign standard WP roles supplementally for a specific post type"
205
  msgstr ""
206
 
207
- #: includes/admin.php:168
208
  msgid ""
209
  "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
210
  msgstr ""
211
 
212
- #: includes/admin.php:172
213
  msgid "Customize reading permissions per-category or per-post"
214
  msgstr ""
215
 
216
- #: includes/admin.php:176
217
  msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
218
  msgstr ""
219
 
220
- #: includes/admin.php:180
221
  msgid ""
222
  "Custom Post Visibility statuses, fully implemented throughout wp-admin "
223
  "<em>(Pro)</em>"
224
  msgstr ""
225
 
226
- #: includes/admin.php:184
227
  msgid ""
228
  "Custom Moderation statuses for access-controlled, multi-step publishing "
229
  "workflow <em>(Pro)</em>"
230
  msgstr ""
231
 
232
- #: includes/admin.php:188
233
  msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
234
  msgstr ""
235
 
236
- #: includes/admin.php:192
237
  msgid ""
238
  "Customize the moderated editing of published content with Revisionary or "
239
  "Post Forking <em>(Pro)</em>"
240
  msgstr ""
241
 
242
- #: includes/admin.php:196
243
  msgid ""
244
  "Grant Spectator, Participant or Moderator access to specific bbPress forums "
245
  "<em>(Pro)</em>"
246
  msgstr ""
247
 
248
- #: includes/admin.php:200
249
  msgid ""
250
  "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
251
  msgstr ""
252
 
253
- #: includes/admin.php:204
254
  msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
255
  msgstr ""
256
 
257
- #: includes/admin.php:208
258
  msgid "Member support forum"
259
  msgstr ""
260
 
261
- #: includes/admin.php:215
262
  #, php-format
263
  msgid "%1$sgrab%2$s %3$s"
264
  msgstr ""
265
 
266
- #: includes/admin.php:215
267
  #, php-format
268
  msgid "%s (free install)"
269
  msgstr ""
270
 
271
- #: includes/admin.php:217
272
  #, php-format
273
  msgid "%1$sbuy%2$s %3$s"
274
  msgstr ""
275
 
276
- #: includes/admin.php:217
277
  #, php-format
278
  msgid "%s info/purchase"
279
  msgstr ""
280
 
281
- #: includes/admin.php:298
282
  msgid "&nbsp;"
283
  msgstr ""
284
 
285
- #: includes/admin.php:299
286
  msgid "Reading"
287
  msgstr ""
288
 
289
- #: includes/admin.php:300
290
  msgid "Editing Capabilities"
291
  msgstr ""
292
 
293
- #: includes/admin.php:301
294
  msgid "Deletion Capabilities"
295
  msgstr ""
296
 
297
- #: includes/admin.php:305
298
  msgid "can read posts which are currently published with private visibility"
299
  msgstr ""
300
 
301
- #: includes/admin.php:306
302
  msgid ""
303
  "has basic editing capability (but may need other capabilities based on post "
304
  "status and ownership)"
305
  msgstr ""
306
 
307
- #: includes/admin.php:307
308
  msgid "can edit posts which were created by other users"
309
  msgstr ""
310
 
311
- #: includes/admin.php:308
312
  msgid "can edit posts which are currently published"
313
  msgstr ""
314
 
315
- #: includes/admin.php:309
316
  msgid "can edit posts which are currently published with private visibility"
317
  msgstr ""
318
 
319
- #: includes/admin.php:310
320
  msgid "can make a post publicly visible"
321
  msgstr ""
322
 
323
- #: includes/admin.php:311
324
  msgid ""
325
  "has basic deletion capability (but may need other capabilities based on post "
326
  "status and ownership)"
327
  msgstr ""
328
 
329
- #: includes/admin.php:312
330
  msgid "can delete posts which were created by other users"
331
  msgstr ""
332
 
333
- #: includes/admin.php:313
334
  msgid "can delete posts which are currently published"
335
  msgstr ""
336
 
337
- #: includes/admin.php:314
338
  msgid "can delete posts which are currently published with private visibility"
339
  msgstr ""
340
 
341
- #: includes/admin.php:448 includes/admin.php:565 includes/admin.php:825
342
- #: includes/admin.php:1011
343
  #, php-format
344
  msgid "%s: assigned by Permission Group"
345
  msgstr ""
346
 
347
- #: includes/admin.php:463
348
  #, php-format
349
  msgid "shared capability: %s"
350
  msgstr ""
351
 
352
- #: includes/admin.php:542
353
  msgid "Other WordPress Core Capabilities"
354
  msgstr ""
355
 
356
- #: includes/admin.php:584
357
  msgid ""
358
  "Lockout Prevention: To remove read capability, first remove WordPress "
359
  "admin / editing capabilities, or add \"dashboard_lockout_ok\" capability"
360
  msgstr ""
361
 
362
- #: includes/admin.php:627 includes/admin.php:864 includes/admin.php:1064
 
363
  msgid "check/uncheck all"
364
  msgstr ""
365
 
366
- #: includes/admin.php:627 includes/admin.php:864 includes/admin.php:1064
 
367
  msgid "negate all (storing as disabled capabilities)"
368
  msgstr ""
369
 
370
- #: includes/admin.php:627 includes/admin.php:864 includes/admin.php:1064
 
371
  msgid "negate none (add/remove all capabilities normally)"
372
  msgstr ""
373
 
374
- #: includes/admin.php:799
375
  #, php-format
376
  msgid "%s Capabilities"
377
  msgstr ""
378
 
379
- #: includes/admin.php:875
380
- msgid "Invalid Capabilities"
381
  msgstr ""
382
 
383
- #: includes/admin.php:880
384
  msgid ""
385
- "The following entries have no effect. Please assign desired capabilities in "
386
- "the Read / Edit / Delete grid above."
387
  msgstr ""
388
 
389
- #: includes/admin.php:957
390
- msgid "Additional Capabilities"
391
  msgstr ""
392
 
393
- #: includes/admin.php:1074
394
  msgid ""
395
  "Role level is mostly deprecated. However, it still determines eligibility "
396
  "for Post Author assignment and limits the application of user editing "
397
  "capabilities."
398
  msgstr ""
399
 
400
- #: includes/admin.php:1076
401
  msgid "Level:"
402
  msgstr ""
403
 
404
- #: includes/admin.php:1099
405
  msgid "Delete this role"
406
  msgstr ""
407
 
408
- #: includes/admin.php:1099
409
  #, php-format
410
  msgid ""
411
  "You are about to delete the %s role.\n"
@@ -413,106 +339,97 @@ msgid ""
413
  " 'Cancel' to stop, 'OK' to delete."
414
  msgstr ""
415
 
416
- #: includes/admin.php:1099
417
  msgid "Delete Role"
418
  msgstr ""
419
 
420
- #: includes/admin.php:1108
421
  msgid "Add Capability"
422
  msgstr ""
423
 
424
- #: includes/admin.php:1111
425
  msgid "Add to role"
426
  msgstr ""
427
 
428
- #: includes/admin.php:1123
429
  msgid "Copy this role to"
430
  msgstr ""
431
 
432
- #: includes/admin.php:1126
433
- #: includes/roles/class/class-pp-roles-list-table.php:80
434
  msgid "Role Name"
435
  msgstr ""
436
 
437
- #: includes/admin.php:1129
438
  msgid ""
439
  "Make role available for supplemental assignment to Permission Groups only"
440
  msgstr ""
441
 
442
- #: includes/admin.php:1129
443
  msgid "hidden"
444
  msgstr ""
445
 
446
- #: includes/admin.php:1133
447
  msgid "Copy"
448
  msgstr ""
449
 
450
- #: includes/admin.php:1139
451
  msgid "Rename Role"
452
  msgstr ""
453
 
454
- #: includes/admin.php:1141
455
  msgid "New Role Name"
456
  msgstr ""
457
 
458
- #: includes/admin.php:1144
459
  msgid "Rename"
460
  msgstr ""
461
 
462
- #: includes/admin.php:1173
463
  msgid "Create this role definition in new (future) sites"
464
  msgstr ""
465
 
466
- #: includes/admin.php:1173
467
  msgid "include in new sites"
468
  msgstr ""
469
 
470
- #: includes/admin.php:1176
471
  msgid "Copy / update this role definition to all sites now"
472
  msgstr ""
473
 
474
- #: includes/admin.php:1176
475
  msgid "sync role to all sites now"
476
  msgstr ""
477
 
478
- #: includes/admin.php:1179
479
- msgid "Copy option settings to all sites now"
480
- msgstr ""
481
-
482
- #: includes/admin.php:1179
483
- msgid "sync options to all sites now"
484
- msgstr ""
485
-
486
- #: includes/backup-handler.php:15 includes/manager.php:813
487
  msgid "You do not have permission to restore roles."
488
  msgstr ""
489
 
490
- #: includes/backup-handler.php:48
491
  msgid "New backup saved."
492
  msgstr ""
493
 
494
- #: includes/backup-handler.php:64
495
  msgid "Roles and Capabilities restored from initial backup."
496
  msgstr ""
497
 
498
- #: includes/backup-handler.php:66 includes/backup-handler.php:75
499
- #: includes/backup-handler.php:84
500
  msgid "Restore failed. No backup found."
501
  msgstr ""
502
 
503
- #: includes/backup-handler.php:73
504
  msgid "Roles and Capabilities restored from last backup."
505
  msgstr ""
506
 
507
- #: includes/backup-handler.php:82
508
  msgid "Roles and Capabilities restored from selected auto-backup."
509
  msgstr ""
510
 
511
- #: includes/backup-handler.php:102
512
  msgid "Needed function to create default roles not found!"
513
  msgstr ""
514
 
515
- #: includes/backup-handler.php:115
516
  msgid "Roles and Capabilities reset to WordPress defaults"
517
  msgstr ""
518
 
@@ -525,6 +442,11 @@ msgstr ""
525
  msgid "Restore"
526
  msgstr ""
527
 
 
 
 
 
 
528
  #: includes/backup.php:48
529
  msgid "Reset Roles"
530
  msgstr ""
@@ -625,489 +547,221 @@ msgstr ""
625
  msgid "%s (level %s)"
626
  msgstr ""
627
 
628
- #: includes/backup.php:264
629
- msgid "No changes"
630
- msgstr ""
631
-
632
- #: includes/backup.php:281
633
  msgid "Reset WordPress Defaults"
634
  msgstr ""
635
 
636
- #: includes/backup.php:283
637
  msgid "WARNING:"
638
  msgstr ""
639
 
640
- #: includes/backup.php:283
641
  msgid ""
642
  "Reseting default Roles and Capabilities will set them to the WordPress "
643
  "install defaults."
644
  msgstr ""
645
 
646
- #: includes/backup.php:287
647
  msgid ""
648
  "If you have installed any plugin that adds new roles or capabilities, these "
649
  "will be lost."
650
  msgstr ""
651
 
652
- #: includes/backup.php:289
653
  msgid "It is recommended to use this only as a last resource!"
654
  msgstr ""
655
 
656
- #: includes/backup.php:292
657
  msgid "Reset Roles and Capabilities to WordPress defaults"
658
  msgstr ""
659
 
660
- #: includes/backup.php:294
661
  msgid ""
662
  "You are about to reset Roles and Capabilities to WordPress defaults.\n"
663
  " 'Cancel' to stop, 'OK' to reset."
664
  msgstr ""
665
 
666
- #: includes/backup.php:294
667
  msgid "Reset to WordPress defaults"
668
  msgstr ""
669
 
670
- #: includes/features/editor-features-classic.php:22
671
- msgid "Classic Editor Screen"
672
- msgstr ""
673
-
674
- #: includes/features/editor-features-classic.php:27
675
- #: includes/features/editor-features-gutenberg.php:27
676
  #, php-format
677
- msgid "%s Restrict"
678
- msgstr ""
679
-
680
- #: includes/features/editor-features-classic.php:28
681
- #: includes/features/editor-features-gutenberg.php:28
682
- msgid "Toggle all"
683
- msgstr ""
684
-
685
- #: includes/features/editor-features-gutenberg.php:22
686
- msgid "Gutenberg Screen"
687
- msgstr ""
688
-
689
- #: includes/features/editor-features.php:32
690
- msgid "Editor Feature Restriction"
691
- msgstr ""
692
-
693
- #: includes/features/editor-features.php:46
694
- msgid ""
695
- "Select editor features to remove. Note that this screen cannot be used to "
696
- "grant additional features to any role."
697
- msgstr ""
698
-
699
- #: includes/features/editor-features.php:90
700
- msgid "Gutenberg"
701
- msgstr ""
702
-
703
- #: includes/features/editor-features.php:93
704
- msgid "Classic"
705
- msgstr ""
706
-
707
- #: includes/features/restrict-editor-features.php:40
708
- msgid "Top Tabs"
709
- msgstr ""
710
-
711
- #: includes/features/restrict-editor-features.php:41
712
- msgid "Help"
713
- msgstr ""
714
-
715
- #: includes/features/restrict-editor-features.php:42
716
- msgid "Screen Options"
717
- msgstr ""
718
-
719
- #: includes/features/restrict-editor-features.php:45
720
- #: includes/features/restrict-editor-features.php:48
721
- msgid "Editor"
722
  msgstr ""
723
 
724
- #: includes/features/restrict-editor-features.php:46
725
  #: includes/filters-woocommerce.php:33
726
  msgid "Add New"
727
  msgstr ""
728
 
729
- #: includes/features/restrict-editor-features.php:47
730
- msgid "Title"
731
- msgstr ""
732
-
733
- #: includes/features/restrict-editor-features.php:49
734
- #: includes/features/restrict-editor-features.php:324
735
- msgid "Permalink"
736
- msgstr ""
737
-
738
- #: includes/features/restrict-editor-features.php:50
739
- msgid "Media Buttons (all)"
740
- msgstr ""
741
-
742
- #: includes/features/restrict-editor-features.php:51
743
- msgid "HTML Editor Button"
744
- msgstr ""
745
-
746
- #: includes/features/restrict-editor-features.php:52
747
- msgid "Word count"
748
- msgstr ""
749
-
750
- #: includes/features/restrict-editor-features.php:55
751
- #: includes/features/restrict-editor-features.php:56
752
- msgid "Publish Box"
753
- msgstr ""
754
-
755
- #: includes/features/restrict-editor-features.php:57
756
- #: includes/features/restrict-editor-features.php:309
757
- msgid "Save Draft"
758
- msgstr ""
759
-
760
- #: includes/features/restrict-editor-features.php:58
761
- #: includes/features/restrict-editor-features.php:311
762
- msgid "Preview"
763
- msgstr ""
764
-
765
- #: includes/features/restrict-editor-features.php:59
766
- msgid "Publish Status "
767
- msgstr ""
768
-
769
- #: includes/features/restrict-editor-features.php:60
770
- msgid "Publish Visibility"
771
- msgstr ""
772
-
773
- #: includes/features/restrict-editor-features.php:61
774
- msgid "Password Protect This Post"
775
- msgstr ""
776
-
777
- #: includes/features/restrict-editor-features.php:62
778
- msgid "Publish Actions"
779
- msgstr ""
780
-
781
- #: includes/features/restrict-editor-features.php:63
782
- msgid "Publish Schedule"
783
- msgstr ""
784
-
785
- #: includes/features/restrict-editor-features.php:64
786
- msgid "Date"
787
- msgstr ""
788
-
789
- #: includes/features/restrict-editor-features.php:65
790
- msgid "Publish"
791
- msgstr ""
792
-
793
- #: includes/features/restrict-editor-features.php:68
794
- msgid "Taxonomy Boxes"
795
- msgstr ""
796
-
797
- #: includes/features/restrict-editor-features.php:69
798
- #: includes/features/restrict-editor-features.php:325
799
- msgid "Categories"
800
- msgstr ""
801
-
802
- #: includes/features/restrict-editor-features.php:70
803
- msgid "Add New Category"
804
- msgstr ""
805
-
806
- #: includes/features/restrict-editor-features.php:71
807
- #: includes/features/restrict-editor-features.php:326
808
- msgid "Tags"
809
- msgstr ""
810
-
811
- #: includes/features/restrict-editor-features.php:83
812
- msgid "Page Boxes"
813
- msgstr ""
814
-
815
- #: includes/features/restrict-editor-features.php:84
816
- msgid "Page Attributes"
817
- msgstr ""
818
-
819
- #: includes/features/restrict-editor-features.php:85
820
- msgid "Parent"
821
- msgstr ""
822
-
823
- #: includes/features/restrict-editor-features.php:86
824
- msgid "Page Template"
825
- msgstr ""
826
-
827
- #: includes/features/restrict-editor-features.php:87
828
- msgid "Order"
829
- msgstr ""
830
-
831
- #: includes/features/restrict-editor-features.php:90
832
- msgid "Other Boxes"
833
- msgstr ""
834
-
835
- #: includes/features/restrict-editor-features.php:91
836
- msgid "Featured Image"
837
- msgstr ""
838
-
839
- #: includes/features/restrict-editor-features.php:92
840
- msgid "Post Slug"
841
- msgstr ""
842
-
843
- #: includes/features/restrict-editor-features.php:93
844
- #: includes/features/restrict-editor-features.php:342
845
- msgid "Discussion"
846
- msgstr ""
847
-
848
- #: includes/features/restrict-editor-features.php:299
849
- msgid "Top Bar - Left"
850
- msgstr ""
851
-
852
- #: includes/features/restrict-editor-features.php:300
853
- msgid "Add block"
854
- msgstr ""
855
-
856
- #: includes/features/restrict-editor-features.php:301
857
- msgid "Modes"
858
- msgstr ""
859
-
860
- #: includes/features/restrict-editor-features.php:302
861
- msgid "Undo"
862
- msgstr ""
863
-
864
- #: includes/features/restrict-editor-features.php:303
865
- msgid "Redo"
866
- msgstr ""
867
-
868
- #: includes/features/restrict-editor-features.php:304
869
- msgid "Details"
870
- msgstr ""
871
-
872
- #: includes/features/restrict-editor-features.php:305
873
- msgid "Outline"
874
- msgstr ""
875
-
876
- #: includes/features/restrict-editor-features.php:308
877
- msgid "Top Bar - Right"
878
- msgstr ""
879
-
880
- #: includes/features/restrict-editor-features.php:310
881
- msgid "Switch to draft"
882
- msgstr ""
883
-
884
- #: includes/features/restrict-editor-features.php:312
885
- msgid "Publish / Update"
886
- msgstr ""
887
-
888
- #: includes/features/restrict-editor-features.php:314
889
- msgid "Options"
890
- msgstr ""
891
-
892
- #: includes/features/restrict-editor-features.php:317
893
- msgid "Body"
894
- msgstr ""
895
-
896
- #: includes/features/restrict-editor-features.php:318
897
- msgid "Edit title"
898
- msgstr ""
899
-
900
- #: includes/features/restrict-editor-features.php:319
901
- msgid "Content"
902
- msgstr ""
903
-
904
- #: includes/features/restrict-editor-features.php:322
905
- msgid "Document Panel"
906
- msgstr ""
907
-
908
- #: includes/features/restrict-editor-features.php:323
909
- msgid "Status & visibility"
910
- msgstr ""
911
-
912
- #: includes/features/restrict-editor-features.php:340
913
- msgid "Featured image"
914
- msgstr ""
915
-
916
- #: includes/features/restrict-editor-features.php:341
917
- msgid "Excerpt"
918
- msgstr ""
919
-
920
- #: includes/features/restrict-editor-features.php:343
921
- msgid "Post Attributes"
922
- msgstr ""
923
-
924
- #: includes/features/restrict-editor-features.php:346
925
- #: includes/features/restrict-editor-features.php:347
926
- msgid "Block Panel"
927
- msgstr ""
928
-
929
- #: includes/features/restrict-editor-features.php:348
930
- msgid "Paragraph"
931
- msgstr ""
932
-
933
- #: includes/features/restrict-editor-features.php:349
934
- msgid "Typography"
935
- msgstr ""
936
-
937
- #: includes/features/restrict-editor-features.php:350
938
- msgid "Color settings"
939
  msgstr ""
940
 
941
- #: includes/features/restrict-editor-features.php:351
942
- msgid "Text settings"
 
943
  msgstr ""
944
 
945
- #: includes/filters-woocommerce.php:32
946
- #, php-format
947
- msgid "All %s"
948
  msgstr ""
949
 
950
- #: includes/filters.php:263
951
- msgid "Edit Roles"
952
  msgstr ""
953
 
954
- #: includes/handler.php:35 includes/handler.php:61
955
  msgid "New role created."
956
  msgstr ""
957
 
958
- #: includes/handler.php:41 includes/handler.php:67
959
  msgid "Error: Failed creating the new role."
960
  msgstr ""
961
 
962
- #: includes/handler.php:54
963
  #, php-format
964
  msgid "Role \"%s\" (id %s) renamed to \"%s\""
965
  msgstr ""
966
 
967
- #: includes/handler.php:133
968
  msgid "Incorrect capability name."
969
  msgstr ""
970
 
971
- #: includes/handler.php:138
972
  msgid "Type / Taxonomy settings saved."
973
  msgstr ""
974
 
975
- #: includes/handler.php:144
976
  msgid "Bad form received."
977
  msgstr ""
978
 
979
- #: includes/handler.php:267
980
  msgid "You cannot remove Manage Capabilities from Administrators"
981
  msgstr ""
982
 
983
- #: includes/manager.php:199
 
 
 
 
 
 
 
 
 
 
 
984
  msgid "Explicity negate this capability by storing as disabled"
985
  msgstr ""
986
 
987
- #: includes/manager.php:200
988
  msgid "Explicitly negate these capabilities by storing as disabled"
989
  msgstr ""
990
 
991
- #: includes/manager.php:201
992
  msgid "Post type registration does not define this capability distinctly"
993
  msgstr ""
994
 
995
- #: includes/manager.php:202
996
  msgid "This capability is explicitly negated. Click to add/remove normally."
997
  msgstr ""
998
 
999
- #: includes/manager.php:203
1000
  msgid "Add or remove this capability from the WordPress role"
1001
  msgstr ""
1002
 
1003
- #: includes/manager.php:204
1004
  msgid "Add or remove capability from the role normally"
1005
  msgstr ""
1006
 
1007
- #: includes/manager.php:205
1008
- msgid "Are you sure you want to delete this item ?"
1009
- msgstr ""
1010
-
1011
- #: includes/manager.php:206
1012
- msgid "Add or clear custom item entry before saving changes."
1013
  msgstr ""
1014
 
1015
- #: includes/manager.php:402 includes/roles/roles.php:33
 
 
1016
  msgid "Name"
1017
  msgstr ""
1018
 
1019
- #: includes/manager.php:403
1020
- #: includes/roles/class/class-pp-roles-list-table.php:81
1021
- msgid "Role"
1022
- msgstr ""
1023
-
1024
- #: includes/manager.php:404
1025
- #: includes/roles/class/class-pp-roles-list-table.php:82
1026
  msgid "Users"
1027
  msgstr ""
1028
 
1029
- #: includes/manager.php:431
1030
  msgid "You do not have permission to manage roles."
1031
  msgstr ""
1032
 
1033
- #: includes/manager.php:448
1034
- msgid "You do not have permission to manage editor features."
1035
- msgstr ""
1036
-
1037
- #: includes/manager.php:490
1038
- msgid "Settings updated."
1039
- msgstr ""
1040
-
1041
- #: includes/manager.php:593 includes/manager.php:634
1042
  msgid "You do not have permission to manage capabilities."
1043
  msgstr ""
1044
 
1045
- #: includes/manager.php:648
1046
  msgid "New capability added to role."
1047
  msgstr ""
1048
 
1049
- #: includes/manager.php:666
1050
- msgid "The selected role is not editable."
1051
- msgstr ""
1052
-
1053
- #: includes/manager.php:693
1054
  msgid "Bad form Received"
1055
  msgstr ""
1056
 
1057
- #: includes/manager.php:843
1058
  #, php-format
1059
  msgid "If you like %s, please leave us a %s rating. Thank you!"
1060
  msgstr ""
1061
 
1062
- #: includes/manager.php:854
1063
  msgid "About PublishPress Capabilities"
1064
  msgstr ""
1065
 
1066
- #: includes/manager.php:854
1067
  msgid "About"
1068
  msgstr ""
1069
 
1070
- #: includes/manager.php:856
1071
  msgid "Capabilites Documentation"
1072
  msgstr ""
1073
 
1074
- #: includes/manager.php:856
1075
  msgid "Documentation"
1076
  msgstr ""
1077
 
1078
- #: includes/manager.php:858
1079
  msgid "Contact the PublishPress team"
1080
  msgstr ""
1081
 
1082
- #: includes/manager.php:858
1083
  msgid "Contact"
1084
  msgstr ""
1085
 
1086
- #: includes/pp-ui.php:50
1087
  #, php-format
1088
  msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
1089
  msgstr ""
1090
 
1091
- #: includes/pp-ui.php:52
1092
  #, php-format
1093
  msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
1094
  msgstr ""
1095
 
1096
- #: includes/pp-ui.php:57
1097
  #, php-format
1098
  msgid ""
1099
  "\"Posts\" capabilities selected here also define type-specific role "
1100
  "assignment for Permission Groups%s."
1101
  msgstr ""
1102
 
1103
- #: includes/pp-ui.php:59
1104
  #, php-format
1105
  msgid ""
1106
  "\"Posts\" capabilities selected here also define type-specific role "
1107
  "assignment for Permit Groups%s."
1108
  msgstr ""
1109
 
1110
- #: includes/pp-ui.php:67
1111
  #, php-format
1112
  msgid ""
1113
  "Capabilities for custom statuses can be manually added here. (See "
@@ -1115,14 +769,14 @@ msgid ""
1115
  "specific roles%s are usually more convenient, though."
1116
  msgstr ""
1117
 
1118
- #: includes/pp-ui.php:69
1119
  msgid ""
1120
  "Capabilities for custom statuses can be manually added here. Or activate the "
1121
  "PP Custom Post Statuses extension to assign status-specific supplemental "
1122
  "roles."
1123
  msgstr ""
1124
 
1125
- #: includes/pp-ui.php:72
1126
  msgid ""
1127
  "Capabilities for custom statuses can be manually added to a role here (see "
1128
  "Conditions > Status > Capability Mapping for applicable names). However, it "
@@ -1130,115 +784,75 @@ msgid ""
1130
  "status-specific role."
1131
  msgstr ""
1132
 
1133
- #: includes/pp-ui.php:85
 
 
 
 
1134
  msgid "Type-Specific Capabilities"
1135
  msgstr ""
1136
 
1137
- #: includes/pp-ui.php:88
1138
  msgid "Ensure permissions can be controlled separately from other post types."
1139
  msgstr ""
1140
 
1141
- #: includes/pp-ui.php:151
1142
  msgid ""
1143
  "Make selected post types require a different capability to add new posts."
1144
  msgstr ""
1145
 
1146
- #: includes/pp-ui.php:151
1147
  msgid "Use create_posts capability"
1148
  msgstr ""
1149
 
1150
- #: includes/pp-ui.php:159 includes/pp-ui.php:222 includes/pp-ui.php:278
1151
  msgid "Update"
1152
  msgstr ""
1153
 
1154
- #: includes/pp-ui.php:169
1155
  msgid "Taxonomy-Specific Capabilities"
1156
  msgstr ""
1157
 
1158
- #: includes/pp-ui.php:172
1159
  msgid "Ensure permissions can be controlled separately from other taxonomies."
1160
  msgstr ""
1161
 
1162
- #: includes/pp-ui.php:227
1163
  msgid "Detailed Taxonomy Capabilities"
1164
  msgstr ""
1165
 
1166
- #: includes/pp-ui.php:230
1167
  msgid ""
1168
  "Enforce Edit, Delete and Assign capabilities separately from Management "
1169
  "capability."
1170
  msgstr ""
1171
 
1172
- #: includes/roles/class/class-pp-roles-actions.php:143
1173
  msgid "You do not have sufficient permissions to perform this action."
1174
  msgstr ""
1175
 
1176
- #: includes/roles/class/class-pp-roles-actions.php:159
1177
  msgid "Your link has expired, refresh the page and try again."
1178
  msgstr ""
1179
 
1180
- #: includes/roles/class/class-pp-roles-actions.php:180
1181
- #: includes/roles/class/class-pp-roles-actions.php:298
1182
- #: includes/roles/class/class-pp-roles-actions.php:412
1183
- #: includes/roles/class/class-pp-roles-actions.php:473
1184
  msgid "Missing parameters, refresh the page and try again."
1185
  msgstr ""
1186
 
1187
- #: includes/roles/class/class-pp-roles-actions.php:214
1188
  msgid ""
1189
  "Something went wrong, the system wasn't able to create the role, refresh the "
1190
  "page and try again."
1191
  msgstr ""
1192
 
1193
- #: includes/roles/class/class-pp-roles-actions.php:306
1194
- #, php-format
1195
- msgid ""
1196
- "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
1197
- msgstr ""
1198
-
1199
- #: includes/roles/class/class-pp-roles-actions.php:322
1200
  msgid "Deleting a system role is not allowed."
1201
  msgstr ""
1202
 
1203
- #: includes/roles/class/class-pp-roles-actions.php:345
1204
- #, php-format
1205
- msgid "%1$d users moved to default role %2$s."
1206
- msgstr ""
1207
-
1208
- #: includes/roles/class/class-pp-roles-actions.php:350
1209
- #, php-format
1210
- msgid "The role %1$s was successfully deleted. %2$s"
1211
- msgstr ""
1212
-
1213
- #: includes/roles/class/class-pp-roles-actions.php:356
1214
- #, php-format
1215
- msgid "The selected %1$s roles were successfully deleted. %2$s"
1216
- msgstr ""
1217
-
1218
- #: includes/roles/class/class-pp-roles-actions.php:369
1219
- msgid "The role could not be deleted."
1220
- msgstr ""
1221
-
1222
- #: includes/roles/class/class-pp-roles-actions.php:423
1223
- #, php-format
1224
- msgid "The role %1$s was successfully hidden."
1225
- msgstr ""
1226
-
1227
- #: includes/roles/class/class-pp-roles-actions.php:484
1228
- #, php-format
1229
- msgid "The role %1$s was successfully unhidden."
1230
- msgstr ""
1231
-
1232
- #: includes/roles/class/class-pp-roles-list-table.php:130
1233
- msgid "(non-editable role)"
1234
- msgstr ""
1235
-
1236
- #: includes/roles/class/class-pp-roles-list-table.php:150
1237
- msgid "Unhide"
1238
- msgstr ""
1239
-
1240
- #: includes/roles/class/class-pp-roles-list-table.php:189
1241
- msgid "Hide"
1242
  msgstr ""
1243
 
1244
  #: includes/roles/roles-functions.php:32
@@ -1270,27 +884,27 @@ msgstr ""
1270
  msgid "Description here."
1271
  msgstr ""
1272
 
1273
- #: includes/settings.php:14
1274
  msgid "Capabilities Settings"
1275
  msgstr ""
1276
 
1277
- #: includes/settings.php:24
1278
  msgid "Related Permissions Plugins"
1279
  msgstr ""
1280
 
1281
- #: includes/settings.php:29
1282
  msgid "PublishPress"
1283
  msgstr ""
1284
 
1285
- #: includes/settings.php:34
1286
  msgid "PublishPress Authors"
1287
  msgstr ""
1288
 
1289
- #: includes/settings.php:46
1290
  msgid "PublishPress Revisions"
1291
  msgstr ""
1292
 
1293
- #: includes/settings.php:48
1294
  msgid "Help / Contact Form"
1295
  msgstr ""
1296
 
2
  msgstr ""
3
  "Project-Id-Version: PublishPress Capabilities\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2021-05-06 13:51-0400\n"
6
+ "PO-Revision-Date: 2021-05-06 13:51-0400\n"
7
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
8
  "Language-Team: PublishPress <help@publishpress.com>\n"
9
  "Language: en_US\n"
13
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
14
  "X-Poedit-Basepath: F:/snapshot/capability-manager-enhanced\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Generator: Poedit 2.4.2\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-KeywordsList: __;_e;_c;_x;__ngettext\n"
19
  "X-Poedit-Basepath: ..\n"
31
  msgid "<strong>This plugin can be deleted.</strong>"
32
  msgstr ""
33
 
34
+ #: capsman-enhanced.php:102
35
  msgid "Warning:"
36
  msgstr ""
37
 
38
+ #: capsman-enhanced.php:103
39
  #, php-format
40
  msgid "The active plugin %s is not compatible with your PHP version."
41
  msgstr ""
42
 
43
+ #: capsman-enhanced.php:105
44
  #, php-format
45
  msgid "%s is required for this plugin."
46
  msgstr ""
49
  msgid "Settings saved."
50
  msgstr ""
51
 
52
+ #: includes-core/CoreAdmin.php:55 includes/functions-admin.php:37
53
  msgid "Admin Menus"
54
  msgstr ""
55
 
56
+ #: includes-core/CoreAdmin.php:56 includes/functions-admin.php:38
57
  msgid "Nav Menus"
58
  msgstr ""
59
 
62
  msgstr ""
63
 
64
  #: includes-core/admin-menus-promo.php:48 includes-core/nav-menus-promo.php:52
65
+ #: includes/admin.php:99 includes/admin.php:1079 includes/settings.php:54
 
 
66
  msgid "Save Changes"
67
  msgstr ""
68
 
72
  "PublishPress Capabilities Pro"
73
  msgstr ""
74
 
75
+ #: includes-core/admin-menus-promo.php:62 includes-core/nav-menus-promo.php:67
76
+ #: includes/functions-admin.php:45 includes/functions-admin.php:46
77
+ #: includes/manager.php:334 includes/manager.php:335
 
 
78
  msgid "Upgrade to Pro"
79
  msgstr ""
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  #: includes-core/nav-menus-promo.php:29
82
  msgid "Navigation Menu Restrictions"
83
  msgstr ""
88
  "PublishPress Capabilities Pro"
89
  msgstr ""
90
 
91
+ #: includes/admin.php:38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  #, php-format
93
  msgid ""
94
  "Warning: This role cannot access the dashboard without the read capability. "
95
  "%1$sClick here to fix this now%2$s."
96
  msgstr ""
97
 
98
+ #: includes/admin.php:64
99
  msgid "Role Capabilities"
100
  msgstr ""
101
 
102
+ #: includes/admin.php:109
103
  msgid ""
104
  "<strong>Note:</strong> Capability changes <strong>remain in the database</"
105
  "strong> after plugin deactivation."
106
  msgstr ""
107
 
108
+ #: includes/admin.php:114
109
  #, php-format
110
  msgid ""
111
  "<strong>Note:</strong> Capability changes <strong>remain in the database</"
113
  "%sPermission Group%s."
114
  msgstr ""
115
 
116
+ #: includes/admin.php:148 includes/settings.php:38
117
  msgid "PublishPress Permissions"
118
  msgstr ""
119
 
120
+ #: includes/admin.php:150
121
  msgid ""
122
  "Automatically define type-specific capabilities for your custom post types "
123
  "and taxonomies"
124
  msgstr ""
125
 
126
+ #: includes/admin.php:154
127
  msgid "Assign standard WP roles supplementally for a specific post type"
128
  msgstr ""
129
 
130
+ #: includes/admin.php:158
131
  msgid ""
132
  "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
133
  msgstr ""
134
 
135
+ #: includes/admin.php:162
136
  msgid "Customize reading permissions per-category or per-post"
137
  msgstr ""
138
 
139
+ #: includes/admin.php:166
140
  msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
141
  msgstr ""
142
 
143
+ #: includes/admin.php:170
144
  msgid ""
145
  "Custom Post Visibility statuses, fully implemented throughout wp-admin "
146
  "<em>(Pro)</em>"
147
  msgstr ""
148
 
149
+ #: includes/admin.php:174
150
  msgid ""
151
  "Custom Moderation statuses for access-controlled, multi-step publishing "
152
  "workflow <em>(Pro)</em>"
153
  msgstr ""
154
 
155
+ #: includes/admin.php:178
156
  msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
157
  msgstr ""
158
 
159
+ #: includes/admin.php:182
160
  msgid ""
161
  "Customize the moderated editing of published content with Revisionary or "
162
  "Post Forking <em>(Pro)</em>"
163
  msgstr ""
164
 
165
+ #: includes/admin.php:186
166
  msgid ""
167
  "Grant Spectator, Participant or Moderator access to specific bbPress forums "
168
  "<em>(Pro)</em>"
169
  msgstr ""
170
 
171
+ #: includes/admin.php:190
172
  msgid ""
173
  "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
174
  msgstr ""
175
 
176
+ #: includes/admin.php:194
177
  msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
178
  msgstr ""
179
 
180
+ #: includes/admin.php:198
181
  msgid "Member support forum"
182
  msgstr ""
183
 
184
+ #: includes/admin.php:205
185
  #, php-format
186
  msgid "%1$sgrab%2$s %3$s"
187
  msgstr ""
188
 
189
+ #: includes/admin.php:205
190
  #, php-format
191
  msgid "%s (free install)"
192
  msgstr ""
193
 
194
+ #: includes/admin.php:207
195
  #, php-format
196
  msgid "%1$sbuy%2$s %3$s"
197
  msgstr ""
198
 
199
+ #: includes/admin.php:207
200
  #, php-format
201
  msgid "%s info/purchase"
202
  msgstr ""
203
 
204
+ #: includes/admin.php:287
205
  msgid "&nbsp;"
206
  msgstr ""
207
 
208
+ #: includes/admin.php:288
209
  msgid "Reading"
210
  msgstr ""
211
 
212
+ #: includes/admin.php:289
213
  msgid "Editing Capabilities"
214
  msgstr ""
215
 
216
+ #: includes/admin.php:290
217
  msgid "Deletion Capabilities"
218
  msgstr ""
219
 
220
+ #: includes/admin.php:294
221
  msgid "can read posts which are currently published with private visibility"
222
  msgstr ""
223
 
224
+ #: includes/admin.php:295
225
  msgid ""
226
  "has basic editing capability (but may need other capabilities based on post "
227
  "status and ownership)"
228
  msgstr ""
229
 
230
+ #: includes/admin.php:296
231
  msgid "can edit posts which were created by other users"
232
  msgstr ""
233
 
234
+ #: includes/admin.php:297
235
  msgid "can edit posts which are currently published"
236
  msgstr ""
237
 
238
+ #: includes/admin.php:298
239
  msgid "can edit posts which are currently published with private visibility"
240
  msgstr ""
241
 
242
+ #: includes/admin.php:299
243
  msgid "can make a post publicly visible"
244
  msgstr ""
245
 
246
+ #: includes/admin.php:300
247
  msgid ""
248
  "has basic deletion capability (but may need other capabilities based on post "
249
  "status and ownership)"
250
  msgstr ""
251
 
252
+ #: includes/admin.php:301
253
  msgid "can delete posts which were created by other users"
254
  msgstr ""
255
 
256
+ #: includes/admin.php:302
257
  msgid "can delete posts which are currently published"
258
  msgstr ""
259
 
260
+ #: includes/admin.php:303
261
  msgid "can delete posts which are currently published with private visibility"
262
  msgstr ""
263
 
264
+ #: includes/admin.php:437 includes/admin.php:547 includes/admin.php:809
265
+ #: includes/admin.php:904 includes/admin.php:1001
266
  #, php-format
267
  msgid "%s: assigned by Permission Group"
268
  msgstr ""
269
 
270
+ #: includes/admin.php:452
271
  #, php-format
272
  msgid "shared capability: %s"
273
  msgstr ""
274
 
275
+ #: includes/admin.php:524
276
  msgid "Other WordPress Core Capabilities"
277
  msgstr ""
278
 
279
+ #: includes/admin.php:566
280
  msgid ""
281
  "Lockout Prevention: To remove read capability, first remove WordPress "
282
  "admin / editing capabilities, or add \"dashboard_lockout_ok\" capability"
283
  msgstr ""
284
 
285
+ #: includes/admin.php:609 includes/admin.php:848 includes/admin.php:957
286
+ #: includes/admin.php:1044
287
  msgid "check/uncheck all"
288
  msgstr ""
289
 
290
+ #: includes/admin.php:609 includes/admin.php:848 includes/admin.php:957
291
+ #: includes/admin.php:1044
292
  msgid "negate all (storing as disabled capabilities)"
293
  msgstr ""
294
 
295
+ #: includes/admin.php:609 includes/admin.php:848 includes/admin.php:957
296
+ #: includes/admin.php:1044
297
  msgid "negate none (add/remove all capabilities normally)"
298
  msgstr ""
299
 
300
+ #: includes/admin.php:783
301
  #, php-format
302
  msgid "%s Capabilities"
303
  msgstr ""
304
 
305
+ #: includes/admin.php:856
306
+ msgid "Additional Capabilities"
307
  msgstr ""
308
 
309
+ #: includes/admin.php:966
310
  msgid ""
311
+ "Meta capabilities are used in code as placeholders for other capabilities. "
312
+ "Assiging to a role has no effect."
313
  msgstr ""
314
 
315
+ #: includes/admin.php:967
316
+ msgid "Invalid Capabilities"
317
  msgstr ""
318
 
319
+ #: includes/admin.php:1057
320
  msgid ""
321
  "Role level is mostly deprecated. However, it still determines eligibility "
322
  "for Post Author assignment and limits the application of user editing "
323
  "capabilities."
324
  msgstr ""
325
 
326
+ #: includes/admin.php:1059
327
  msgid "Level:"
328
  msgstr ""
329
 
330
+ #: includes/admin.php:1082
331
  msgid "Delete this role"
332
  msgstr ""
333
 
334
+ #: includes/admin.php:1082
335
  #, php-format
336
  msgid ""
337
  "You are about to delete the %s role.\n"
339
  " 'Cancel' to stop, 'OK' to delete."
340
  msgstr ""
341
 
342
+ #: includes/admin.php:1082
343
  msgid "Delete Role"
344
  msgstr ""
345
 
346
+ #: includes/admin.php:1091
347
  msgid "Add Capability"
348
  msgstr ""
349
 
350
+ #: includes/admin.php:1094
351
  msgid "Add to role"
352
  msgstr ""
353
 
354
+ #: includes/admin.php:1106
355
  msgid "Copy this role to"
356
  msgstr ""
357
 
358
+ #: includes/admin.php:1109
 
359
  msgid "Role Name"
360
  msgstr ""
361
 
362
+ #: includes/admin.php:1112 includes/pp-ui.php:84
363
  msgid ""
364
  "Make role available for supplemental assignment to Permission Groups only"
365
  msgstr ""
366
 
367
+ #: includes/admin.php:1112
368
  msgid "hidden"
369
  msgstr ""
370
 
371
+ #: includes/admin.php:1116
372
  msgid "Copy"
373
  msgstr ""
374
 
375
+ #: includes/admin.php:1122
376
  msgid "Rename Role"
377
  msgstr ""
378
 
379
+ #: includes/admin.php:1124
380
  msgid "New Role Name"
381
  msgstr ""
382
 
383
+ #: includes/admin.php:1127
384
  msgid "Rename"
385
  msgstr ""
386
 
387
+ #: includes/admin.php:1158
388
  msgid "Create this role definition in new (future) sites"
389
  msgstr ""
390
 
391
+ #: includes/admin.php:1158
392
  msgid "include in new sites"
393
  msgstr ""
394
 
395
+ #: includes/admin.php:1161
396
  msgid "Copy / update this role definition to all sites now"
397
  msgstr ""
398
 
399
+ #: includes/admin.php:1161
400
  msgid "sync role to all sites now"
401
  msgstr ""
402
 
403
+ #: includes/backup-handler.php:9 includes/manager.php:701
 
 
 
 
 
 
 
 
404
  msgid "You do not have permission to restore roles."
405
  msgstr ""
406
 
407
+ #: includes/backup-handler.php:42
408
  msgid "New backup saved."
409
  msgstr ""
410
 
411
+ #: includes/backup-handler.php:58
412
  msgid "Roles and Capabilities restored from initial backup."
413
  msgstr ""
414
 
415
+ #: includes/backup-handler.php:60 includes/backup-handler.php:69
416
+ #: includes/backup-handler.php:78
417
  msgid "Restore failed. No backup found."
418
  msgstr ""
419
 
420
+ #: includes/backup-handler.php:67
421
  msgid "Roles and Capabilities restored from last backup."
422
  msgstr ""
423
 
424
+ #: includes/backup-handler.php:76
425
  msgid "Roles and Capabilities restored from selected auto-backup."
426
  msgstr ""
427
 
428
+ #: includes/backup-handler.php:96
429
  msgid "Needed function to create default roles not found!"
430
  msgstr ""
431
 
432
+ #: includes/backup-handler.php:109
433
  msgid "Roles and Capabilities reset to WordPress defaults"
434
  msgstr ""
435
 
442
  msgid "Restore"
443
  msgstr ""
444
 
445
+ #: includes/backup.php:47 includes/functions-admin.php:39
446
+ #: includes/manager.php:325
447
+ msgid "Backup"
448
+ msgstr ""
449
+
450
  #: includes/backup.php:48
451
  msgid "Reset Roles"
452
  msgstr ""
547
  msgid "%s (level %s)"
548
  msgstr ""
549
 
550
+ #: includes/backup.php:259
 
 
 
 
551
  msgid "Reset WordPress Defaults"
552
  msgstr ""
553
 
554
+ #: includes/backup.php:262
555
  msgid "WARNING:"
556
  msgstr ""
557
 
558
+ #: includes/backup.php:262
559
  msgid ""
560
  "Reseting default Roles and Capabilities will set them to the WordPress "
561
  "install defaults."
562
  msgstr ""
563
 
564
+ #: includes/backup.php:266
565
  msgid ""
566
  "If you have installed any plugin that adds new roles or capabilities, these "
567
  "will be lost."
568
  msgstr ""
569
 
570
+ #: includes/backup.php:268
571
  msgid "It is recommended to use this only as a last resource!"
572
  msgstr ""
573
 
574
+ #: includes/backup.php:271
575
  msgid "Reset Roles and Capabilities to WordPress defaults"
576
  msgstr ""
577
 
578
+ #: includes/backup.php:273
579
  msgid ""
580
  "You are about to reset Roles and Capabilities to WordPress defaults.\n"
581
  " 'Cancel' to stop, 'OK' to reset."
582
  msgstr ""
583
 
584
+ #: includes/backup.php:273
585
  msgid "Reset to WordPress defaults"
586
  msgstr ""
587
 
588
+ #: includes/filters-woocommerce.php:32
 
 
 
 
 
589
  #, php-format
590
+ msgid "All %s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
  msgstr ""
592
 
 
593
  #: includes/filters-woocommerce.php:33
594
  msgid "Add New"
595
  msgstr ""
596
 
597
+ #: includes/filters.php:312
598
+ msgid "Edit Roles"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  msgstr ""
600
 
601
+ #: includes/functions-admin.php:14 includes/manager.php:289
602
+ #: includes/roles/class/class-pp-roles-list-table.php:120
603
+ msgid "Capabilities"
604
  msgstr ""
605
 
606
+ #: includes/functions-admin.php:36 includes/manager.php:311
607
+ #: includes/roles/roles.php:4
608
+ msgid "Roles"
609
  msgstr ""
610
 
611
+ #: includes/functions-admin.php:40 includes/manager.php:328
612
+ msgid "Settings"
613
  msgstr ""
614
 
615
+ #: includes/handler.php:23 includes/handler.php:49
616
  msgid "New role created."
617
  msgstr ""
618
 
619
+ #: includes/handler.php:29 includes/handler.php:55
620
  msgid "Error: Failed creating the new role."
621
  msgstr ""
622
 
623
+ #: includes/handler.php:42
624
  #, php-format
625
  msgid "Role \"%s\" (id %s) renamed to \"%s\""
626
  msgstr ""
627
 
628
+ #: includes/handler.php:111
629
  msgid "Incorrect capability name."
630
  msgstr ""
631
 
632
+ #: includes/handler.php:116
633
  msgid "Type / Taxonomy settings saved."
634
  msgstr ""
635
 
636
+ #: includes/handler.php:122
637
  msgid "Bad form received."
638
  msgstr ""
639
 
640
+ #: includes/handler.php:245
641
  msgid "You cannot remove Manage Capabilities from Administrators"
642
  msgstr ""
643
 
644
+ #: includes/handler.php:357
645
+ #, php-format
646
+ msgid ""
647
+ "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
648
+ msgstr ""
649
+
650
+ #: includes/handler.php:404
651
+ #, php-format
652
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
653
+ msgstr ""
654
+
655
+ #: includes/manager.php:174
656
  msgid "Explicity negate this capability by storing as disabled"
657
  msgstr ""
658
 
659
+ #: includes/manager.php:175
660
  msgid "Explicitly negate these capabilities by storing as disabled"
661
  msgstr ""
662
 
663
+ #: includes/manager.php:176
664
  msgid "Post type registration does not define this capability distinctly"
665
  msgstr ""
666
 
667
+ #: includes/manager.php:177
668
  msgid "This capability is explicitly negated. Click to add/remove normally."
669
  msgstr ""
670
 
671
+ #: includes/manager.php:178
672
  msgid "Add or remove this capability from the WordPress role"
673
  msgstr ""
674
 
675
+ #: includes/manager.php:179
676
  msgid "Add or remove capability from the role normally"
677
  msgstr ""
678
 
679
+ #: includes/manager.php:352
680
+ #: includes/roles/class/class-pp-roles-list-table.php:77
681
+ msgid "Role"
 
 
 
682
  msgstr ""
683
 
684
+ #: includes/manager.php:353
685
+ #: includes/roles/class/class-pp-roles-list-table.php:78
686
+ #: includes/roles/roles.php:33
687
  msgid "Name"
688
  msgstr ""
689
 
690
+ #: includes/manager.php:354
691
+ #: includes/roles/class/class-pp-roles-list-table.php:79
 
 
 
 
 
692
  msgid "Users"
693
  msgstr ""
694
 
695
+ #: includes/manager.php:381
696
  msgid "You do not have permission to manage roles."
697
  msgstr ""
698
 
699
+ #: includes/manager.php:487 includes/manager.php:528
 
 
 
 
 
 
 
 
700
  msgid "You do not have permission to manage capabilities."
701
  msgstr ""
702
 
703
+ #: includes/manager.php:542
704
  msgid "New capability added to role."
705
  msgstr ""
706
 
707
+ #: includes/manager.php:581
 
 
 
 
708
  msgid "Bad form Received"
709
  msgstr ""
710
 
711
+ #: includes/manager.php:731
712
  #, php-format
713
  msgid "If you like %s, please leave us a %s rating. Thank you!"
714
  msgstr ""
715
 
716
+ #: includes/manager.php:742
717
  msgid "About PublishPress Capabilities"
718
  msgstr ""
719
 
720
+ #: includes/manager.php:742
721
  msgid "About"
722
  msgstr ""
723
 
724
+ #: includes/manager.php:744
725
  msgid "Capabilites Documentation"
726
  msgstr ""
727
 
728
+ #: includes/manager.php:744
729
  msgid "Documentation"
730
  msgstr ""
731
 
732
+ #: includes/manager.php:746
733
  msgid "Contact the PublishPress team"
734
  msgstr ""
735
 
736
+ #: includes/manager.php:746
737
  msgid "Contact"
738
  msgstr ""
739
 
740
+ #: includes/pp-ui.php:42
741
  #, php-format
742
  msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
743
  msgstr ""
744
 
745
+ #: includes/pp-ui.php:44
746
  #, php-format
747
  msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
748
  msgstr ""
749
 
750
+ #: includes/pp-ui.php:49
751
  #, php-format
752
  msgid ""
753
  "\"Posts\" capabilities selected here also define type-specific role "
754
  "assignment for Permission Groups%s."
755
  msgstr ""
756
 
757
+ #: includes/pp-ui.php:51
758
  #, php-format
759
  msgid ""
760
  "\"Posts\" capabilities selected here also define type-specific role "
761
  "assignment for Permit Groups%s."
762
  msgstr ""
763
 
764
+ #: includes/pp-ui.php:59
765
  #, php-format
766
  msgid ""
767
  "Capabilities for custom statuses can be manually added here. (See "
769
  "specific roles%s are usually more convenient, though."
770
  msgstr ""
771
 
772
+ #: includes/pp-ui.php:61
773
  msgid ""
774
  "Capabilities for custom statuses can be manually added here. Or activate the "
775
  "PP Custom Post Statuses extension to assign status-specific supplemental "
776
  "roles."
777
  msgstr ""
778
 
779
+ #: includes/pp-ui.php:64
780
  msgid ""
781
  "Capabilities for custom statuses can be manually added to a role here (see "
782
  "Conditions > Status > Capability Mapping for applicable names). However, it "
784
  "status-specific role."
785
  msgstr ""
786
 
787
+ #: includes/pp-ui.php:84
788
+ msgid "hidden role"
789
+ msgstr ""
790
+
791
+ #: includes/pp-ui.php:95
792
  msgid "Type-Specific Capabilities"
793
  msgstr ""
794
 
795
+ #: includes/pp-ui.php:98
796
  msgid "Ensure permissions can be controlled separately from other post types."
797
  msgstr ""
798
 
799
+ #: includes/pp-ui.php:161
800
  msgid ""
801
  "Make selected post types require a different capability to add new posts."
802
  msgstr ""
803
 
804
+ #: includes/pp-ui.php:161
805
  msgid "Use create_posts capability"
806
  msgstr ""
807
 
808
+ #: includes/pp-ui.php:169 includes/pp-ui.php:232 includes/pp-ui.php:288
809
  msgid "Update"
810
  msgstr ""
811
 
812
+ #: includes/pp-ui.php:179
813
  msgid "Taxonomy-Specific Capabilities"
814
  msgstr ""
815
 
816
+ #: includes/pp-ui.php:182
817
  msgid "Ensure permissions can be controlled separately from other taxonomies."
818
  msgstr ""
819
 
820
+ #: includes/pp-ui.php:237
821
  msgid "Detailed Taxonomy Capabilities"
822
  msgstr ""
823
 
824
+ #: includes/pp-ui.php:240
825
  msgid ""
826
  "Enforce Edit, Delete and Assign capabilities separately from Management "
827
  "capability."
828
  msgstr ""
829
 
830
+ #: includes/roles/class/class-pp-roles-actions.php:126
831
  msgid "You do not have sufficient permissions to perform this action."
832
  msgstr ""
833
 
834
+ #: includes/roles/class/class-pp-roles-actions.php:142
835
  msgid "Your link has expired, refresh the page and try again."
836
  msgstr ""
837
 
838
+ #: includes/roles/class/class-pp-roles-actions.php:163
839
+ #: includes/roles/class/class-pp-roles-actions.php:269
 
 
840
  msgid "Missing parameters, refresh the page and try again."
841
  msgstr ""
842
 
843
+ #: includes/roles/class/class-pp-roles-actions.php:197
844
  msgid ""
845
  "Something went wrong, the system wasn't able to create the role, refresh the "
846
  "page and try again."
847
  msgstr ""
848
 
849
+ #: includes/roles/class/class-pp-roles-actions.php:284
 
 
 
 
 
 
850
  msgid "Deleting a system role is not allowed."
851
  msgstr ""
852
 
853
+ #: includes/roles/class/class-pp-roles-list-table.php:134
854
+ #: includes/roles/class/class-pp-roles-list-table.php:242
855
+ msgid "Delete"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
856
  msgstr ""
857
 
858
  #: includes/roles/roles-functions.php:32
884
  msgid "Description here."
885
  msgstr ""
886
 
887
+ #: includes/settings.php:12
888
  msgid "Capabilities Settings"
889
  msgstr ""
890
 
891
+ #: includes/settings.php:22
892
  msgid "Related Permissions Plugins"
893
  msgstr ""
894
 
895
+ #: includes/settings.php:27
896
  msgid "PublishPress"
897
  msgstr ""
898
 
899
+ #: includes/settings.php:32
900
  msgid "PublishPress Authors"
901
  msgstr ""
902
 
903
+ #: includes/settings.php:44
904
  msgid "PublishPress Revisions"
905
  msgstr ""
906
 
907
+ #: includes/settings.php:46
908
  msgid "Help / Contact Form"
909
  msgstr ""
910
 
languages/capsman-enhanced.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: PublishPress Capabilities\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2021-08-25 10:44-0400\n"
7
  "PO-Revision-Date: 2020-10-08 11:17-0500\n"
8
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
9
  "Language-Team: PublishPress <help@publishpress.com>\n"
@@ -14,7 +14,7 @@ msgstr ""
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "Language: en_US\n"
17
- "X-Generator: Poedit 2.4.3\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPath-1: includes\n"
20
  "X-Poedit-SearchPath-2: includes-core\n"
@@ -45,11 +45,11 @@ msgstr ""
45
  msgid "Settings saved."
46
  msgstr ""
47
 
48
- #: includes-core/CoreAdmin.php:57 includes/admin-load.php:260
49
  msgid "Admin Menus"
50
  msgstr ""
51
 
52
- #: includes-core/CoreAdmin.php:58 includes/admin-load.php:261
53
  msgid "Nav Menus"
54
  msgstr ""
55
 
@@ -58,9 +58,7 @@ msgid "Admin Menu Restrictions"
58
  msgstr ""
59
 
60
  #: includes-core/admin-menus-promo.php:48 includes-core/nav-menus-promo.php:52
61
- #: includes/admin.php:109 includes/admin.php:1096
62
- #: includes/features/editor-features.php:67
63
- #: includes/features/editor-features.php:120 includes/settings.php:56
64
  msgid "Save Changes"
65
  msgstr ""
66
 
@@ -68,62 +66,12 @@ msgstr ""
68
  msgid "You can restrict access to admin menu screens. This feature is available in PublishPress Capabilities Pro"
69
  msgstr ""
70
 
71
- #: includes-core/admin-menus-promo.php:62
72
- #: includes-core/editor-features-promo.php:91
73
- #: includes-core/nav-menus-promo.php:67 includes/admin-load.php:271
74
- #: includes/admin-load.php:272 includes/manager.php:384
75
- #: includes/manager.php:385
76
  msgid "Upgrade to Pro"
77
  msgstr ""
78
 
79
- #: includes-core/editor-features-promo.php:24
80
- msgid "Metaboxes"
81
- msgstr ""
82
-
83
- #: includes-core/editor-features-promo.php:32
84
- msgid "Checklist"
85
- msgstr ""
86
-
87
- #: includes-core/editor-features-promo.php:45
88
- msgid "Editorial Comments"
89
- msgstr ""
90
-
91
- #: includes-core/editor-features-promo.php:58
92
- msgid "Notifications"
93
- msgstr ""
94
-
95
- #: includes-core/editor-features-promo.php:71
96
- msgid "TaxoPress - Settings"
97
- msgstr ""
98
-
99
- #: includes-core/editor-features-promo.php:86
100
- msgid "You can select plugin metaboxes to hide, or enter a class or ID for custom items. This feature is available in PublishPress Capabilities Pro."
101
- msgstr ""
102
-
103
- #: includes-core/editor-features-promo.php:101
104
- msgid "Custom Items"
105
- msgstr ""
106
-
107
- #: includes-core/editor-features-promo.php:107
108
- msgid "Custom item one"
109
- msgstr ""
110
-
111
- #: includes-core/editor-features-promo.php:108
112
- #: includes-core/editor-features-promo.php:122
113
- #: includes-core/editor-features-promo.php:135
114
- #: includes/roles/class/class-pp-roles-list-table.php:168
115
- #: includes/roles/class/class-pp-roles-list-table.php:307
116
- msgid "Delete"
117
- msgstr ""
118
-
119
- #: includes-core/editor-features-promo.php:121
120
- msgid "Permalink: Descriptive Caption"
121
- msgstr ""
122
-
123
- #: includes-core/editor-features-promo.php:135
124
- msgid "Page Attributes: Order"
125
- msgstr ""
126
-
127
  #: includes-core/nav-menus-promo.php:29
128
  msgid "Navigation Menu Restrictions"
129
  msgstr ""
@@ -132,240 +80,217 @@ msgstr ""
132
  msgid "You can restrict access to navigation menus. This feature is available in PublishPress Capabilities Pro"
133
  msgstr ""
134
 
135
- #: includes/admin-load.php:236 includes/manager.php:337
136
- #: includes/roles/class/class-pp-roles-list-table.php:125
137
- msgid "Capabilities"
138
- msgstr ""
139
-
140
- #: includes/admin-load.php:258 includes/manager.php:359
141
- #: includes/roles/roles.ph
3
  msgstr ""
4
  "Project-Id-Version: PublishPress Capabilities\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2021-05-06 13:51-0400\n"
7
  "PO-Revision-Date: 2020-10-08 11:17-0500\n"
8
  "Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
9
  "Language-Team: PublishPress <help@publishpress.com>\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "Language: en_US\n"
17
+ "X-Generator: Poedit 2.4.2\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPath-1: includes\n"
20
  "X-Poedit-SearchPath-2: includes-core\n"
45
  msgid "Settings saved."
46
  msgstr ""
47
 
48
+ #: includes-core/CoreAdmin.php:53 includes/functions-admin.php:191
49
  msgid "Admin Menus"
50
  msgstr ""
51
 
52
+ #: includes-core/CoreAdmin.php:54 includes/functions-admin.php:192
53
  msgid "Nav Menus"
54
  msgstr ""
55
 
58
  msgstr ""
59
 
60
  #: includes-core/admin-menus-promo.php:48 includes-core/nav-menus-promo.php:52
61
+ #: includes/admin.php:107 includes/admin.php:1089 includes/settings.php:54
 
 
62
  msgid "Save Changes"
63
  msgstr ""
64
 
66
  msgid "You can restrict access to admin menu screens. This feature is available in PublishPress Capabilities Pro"
67
  msgstr ""
68
 
69
+ #: includes-core/admin-menus-promo.php:62 includes-core/nav-menus-promo.php:67
70
+ #: includes/functions-admin.php:202 includes/functions-admin.php:203
71
+ #: includes/manager.php:346 includes/manager.php:347
 
 
72
  msgid "Upgrade to Pro"
73
  msgstr ""
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  #: includes-core/nav-menus-promo.php:29
76
  msgid "Navigation Menu Restrictions"
77
  msgstr ""
80
  msgid "You can restrict access to navigation menus. This feature is available in PublishPress Capabilities Pro"
81
  msgstr ""
82