Version Description
(17/06/2016) = * fixed issue: responsive subscribe form * fixed issue: jQuery was loaded from a different folder on some WP installations * fixed issue: errors after update (strstr on empty strings because of saving empty lines on exclude list) * fixed issue: if "Redirection" from "General" tab is active, also redirects ajax calls * fixed issue: settings page title was wrong placed * "contact" feature update - nice email template + reply-to email header * refactoring for some methods * all assets are now minified * rewrite count db records function (used on subscribers count) * compatible with https://github.com/afragen/github-updater * compatible with wp-cli http://wp-cli.org/ * improved responsivity * improved roles access; now you can set multiple roles (editor, author, subscriber, contributor) and administrator will always have access to backend and frontend * it_IT translation by benedettogit (https://github.com/benedettogit) * updated all language files (need help for 100% translation)
Release Info
| Developer | GeorgeJipa |
| Plugin | |
| Version | 2.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.3 to 2.0.4
- assets/css/chosen.css +448 -0
- assets/css/chosen.min.css +11 -0
- assets/css/index.php +2 -2
- assets/css/jquery-ui-timepicker-addon.css +30 -0
- assets/css/jquery-ui-timepicker-addon.min.css +1 -0
- assets/css/style-admin.css +148 -118
- assets/css/style-admin.min.css +1 -0
- assets/css/style.css +462 -462
- assets/css/style.min.css +1 -0
- assets/images/chosen-sprite.png +0 -0
- assets/images/chosen-sprite@2x.png +0 -0
- assets/images/index.php +2 -2
- assets/images/resources/ayoshop.jpg +0 -0
- assets/images/resources/flatui.jpg +0 -0
- assets/images/resources/linecons.jpg +0 -0
- assets/images/resources/startup-wordpress.jpg +0 -0
- assets/index.php +2 -2
- assets/js/chosen.jquery.js +1284 -0
- assets/js/chosen.jquery.min.js +1 -0
- assets/js/index.php +2 -2
- assets/js/jquery-ui-timepicker-addon.js +181 -93
- assets/js/jquery-ui-timepicker-addon.min.js +2 -0
- assets/js/jquery.countdown.js +43 -11
- assets/js/jquery.countdown.min.js +1 -6
- assets/js/jquery.plugin.js +1 -1
- assets/js/jquery.plugin.min.js +1 -4
- assets/js/jquery.validate.js +494 -319
- assets/js/jquery.validate.min.js +1 -4
- assets/js/scripts-admin-global.js +20 -0
- assets/js/scripts-admin-global.min.js +1 -0
- assets/js/scripts-admin.js +40 -11
- assets/js/scripts-admin.min.js +1 -0
- assets/js/scripts.js +101 -90
- assets/js/scripts.min.js +1 -0
- includes/classes/index.php +2 -2
- includes/classes/wp-maintenance-mode-admin.php +521 -405
- includes/classes/wp-maintenance-mode-shortcodes.php +76 -76
- includes/classes/wp-maintenance-mode.php +745 -713
- includes/functions/helpers.php +89 -30
- includes/functions/index.php +2 -2
- includes/index.php +2 -2
- index.php +2 -2
- languages/index.php +2 -2
- languages/wp-maintenance-mode-de_DE.mo +0 -0
- languages/wp-maintenance-mode-de_DE.po +532 -459
- languages/wp-maintenance-mode-en_US.mo +0 -0
- languages/wp-maintenance-mode-en_US.po +491 -435
- languages/wp-maintenance-mode-es_ES.mo +0 -0
- languages/wp-maintenance-mode-es_ES.po +539 -464
- languages/wp-maintenance-mode-fa_IR.mo +0 -0
- languages/wp-maintenance-mode-fa_IR.po +498 -0
- languages/wp-maintenance-mode-fr_FR.mo +0 -0
- languages/wp-maintenance-mode-fr_FR.po +535 -465
- languages/wp-maintenance-mode-it_IT.mo +0 -0
- languages/wp-maintenance-mode-it_IT.po +528 -0
- languages/wp-maintenance-mode-nb_NO.mo +0 -0
- languages/wp-maintenance-mode-nb_NO.po +527 -0
- languages/wp-maintenance-mode-nl_NL.mo +0 -0
- languages/wp-maintenance-mode-nl_NL.po +532 -460
- languages/wp-maintenance-mode-pl_PL.mo +0 -0
- languages/wp-maintenance-mode-pl_PL.po +530 -0
- languages/wp-maintenance-mode-pt_BR.mo +0 -0
- languages/wp-maintenance-mode-pt_BR.po +605 -535
- languages/wp-maintenance-mode-pt_PT.mo +0 -0
- languages/wp-maintenance-mode-pt_PT.po +543 -463
- languages/wp-maintenance-mode-ro_RO.mo +0 -0
- languages/wp-maintenance-mode-ro_RO.po +553 -470
- languages/wp-maintenance-mode-ru_RU.mo +0 -0
- languages/wp-maintenance-mode-ru_RU.po +538 -463
- languages/wp-maintenance-mode-sv_SE.mo +0 -0
- languages/wp-maintenance-mode-sv_SE.po +529 -457
- readme.md +105 -105
- readme.txt +381 -364
- uninstall.php +35 -35
- views/contact.php +98 -0
- views/index.php +2 -2
- views/loginform.php +8 -8
- views/maintenance.php +120 -119
- views/notice.php +9 -4
- views/promo-codepad.php +10 -0
- views/settings.php +440 -429
- views/sidebar.php +55 -39
- wp-maintenance-mode.php +71 -64
|
@@ -0,0 +1,448 @@
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
/*!
|
| 2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
| 3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
| 4 |
+
|
| 5 |
+
Version 1.5.1
|
| 6 |
+
Full source at https://github.com/harvesthq/chosen
|
| 7 |
+
Copyright (c) 2011-2016 Harvest http://getharvest.com
|
| 8 |
+
|
| 9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
| 10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/* @group Base */
|
| 14 |
+
.chosen-container {
|
| 15 |
+
position: relative;
|
| 16 |
+
display: inline-block;
|
| 17 |
+
vertical-align: middle;
|
| 18 |
+
font-size: 13px;
|
| 19 |
+
-webkit-user-select: none;
|
| 20 |
+
-moz-user-select: none;
|
| 21 |
+
user-select: none;
|
| 22 |
+
}
|
| 23 |
+
.chosen-container * {
|
| 24 |
+
-webkit-box-sizing: border-box;
|
| 25 |
+
-moz-box-sizing: border-box;
|
| 26 |
+
box-sizing: border-box;
|
| 27 |
+
}
|
| 28 |
+
.chosen-container .chosen-drop {
|
| 29 |
+
position: absolute;
|
| 30 |
+
top: 100%;
|
| 31 |
+
left: -9999px;
|
| 32 |
+
z-index: 1010;
|
| 33 |
+
width: 100%;
|
| 34 |
+
border: 1px solid #aaa;
|
| 35 |
+
border-top: 0;
|
| 36 |
+
background: #fff;
|
| 37 |
+
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
|
| 38 |
+
}
|
| 39 |
+
.chosen-container.chosen-with-drop .chosen-drop {
|
| 40 |
+
left: 0;
|
| 41 |
+
}
|
| 42 |
+
.chosen-container a {
|
| 43 |
+
cursor: pointer;
|
| 44 |
+
}
|
| 45 |
+
.chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
|
| 46 |
+
margin-right: 4px;
|
| 47 |
+
overflow: hidden;
|
| 48 |
+
white-space: nowrap;
|
| 49 |
+
text-overflow: ellipsis;
|
| 50 |
+
font-weight: normal;
|
| 51 |
+
color: #999999;
|
| 52 |
+
}
|
| 53 |
+
.chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
|
| 54 |
+
content: ":";
|
| 55 |
+
padding-left: 2px;
|
| 56 |
+
vertical-align: top;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* @end */
|
| 60 |
+
/* @group Single Chosen */
|
| 61 |
+
.chosen-container-single .chosen-single {
|
| 62 |
+
position: relative;
|
| 63 |
+
display: block;
|
| 64 |
+
overflow: hidden;
|
| 65 |
+
padding: 0 0 0 8px;
|
| 66 |
+
height: 25px;
|
| 67 |
+
border: 1px solid #aaa;
|
| 68 |
+
border-radius: 5px;
|
| 69 |
+
background-color: #fff;
|
| 70 |
+
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
|
| 71 |
+
background: -webkit-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
| 72 |
+
background: -moz-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
| 73 |
+
background: -o-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
| 74 |
+
background: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
| 75 |
+
background-clip: padding-box;
|
| 76 |
+
box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
|
| 77 |
+
color: #444;
|
| 78 |
+
text-decoration: none;
|
| 79 |
+
white-space: nowrap;
|
| 80 |
+
line-height: 24px;
|
| 81 |
+
}
|
| 82 |
+
.chosen-container-single .chosen-default {
|
| 83 |
+
color: #999;
|
| 84 |
+
}
|
| 85 |
+
.chosen-container-single .chosen-single span {
|
| 86 |
+
display: block;
|
| 87 |
+
overflow: hidden;
|
| 88 |
+
margin-right: 26px;
|
| 89 |
+
text-overflow: ellipsis;
|
| 90 |
+
white-space: nowrap;
|
| 91 |
+
}
|
| 92 |
+
.chosen-container-single .chosen-single-with-deselect span {
|
| 93 |
+
margin-right: 38px;
|
| 94 |
+
}
|
| 95 |
+
.chosen-container-single .chosen-single abbr {
|
| 96 |
+
position: absolute;
|
| 97 |
+
top: 6px;
|
| 98 |
+
right: 26px;
|
| 99 |
+
display: block;
|
| 100 |
+
width: 12px;
|
| 101 |
+
height: 12px;
|
| 102 |
+
background: url('chosen-sprite.png') -42px 1px no-repeat;
|
| 103 |
+
font-size: 1px;
|
| 104 |
+
}
|
| 105 |
+
.chosen-container-single .chosen-single abbr:hover {
|
| 106 |
+
background-position: -42px -10px;
|
| 107 |
+
}
|
| 108 |
+
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
|
| 109 |
+
background-position: -42px -10px;
|
| 110 |
+
}
|
| 111 |
+
.chosen-container-single .chosen-single div {
|
| 112 |
+
position: absolute;
|
| 113 |
+
top: 0;
|
| 114 |
+
right: 0;
|
| 115 |
+
display: block;
|
| 116 |
+
width: 18px;
|
| 117 |
+
height: 100%;
|
| 118 |
+
}
|
| 119 |
+
.chosen-container-single .chosen-single div b {
|
| 120 |
+
display: block;
|
| 121 |
+
width: 100%;
|
| 122 |
+
height: 100%;
|
| 123 |
+
background: url('chosen-sprite.png') no-repeat 0px 2px;
|
| 124 |
+
}
|
| 125 |
+
.chosen-container-single .chosen-search {
|
| 126 |
+
position: relative;
|
| 127 |
+
z-index: 1010;
|
| 128 |
+
margin: 0;
|
| 129 |
+
padding: 3px 4px;
|
| 130 |
+
white-space: nowrap;
|
| 131 |
+
}
|
| 132 |
+
.chosen-container-single .chosen-search input[type="text"] {
|
| 133 |
+
margin: 1px 0;
|
| 134 |
+
padding: 4px 20px 4px 5px;
|
| 135 |
+
width: 100%;
|
| 136 |
+
height: auto;
|
| 137 |
+
outline: 0;
|
| 138 |
+
border: 1px solid #aaa;
|
| 139 |
+
background: white url('chosen-sprite.png') no-repeat 100% -20px;
|
| 140 |
+
background: url('chosen-sprite.png') no-repeat 100% -20px;
|
| 141 |
+
font-size: 1em;
|
| 142 |
+
font-family: sans-serif;
|
| 143 |
+
line-height: normal;
|
| 144 |
+
border-radius: 0;
|
| 145 |
+
}
|
| 146 |
+
.chosen-container-single .chosen-drop {
|
| 147 |
+
margin-top: -1px;
|
| 148 |
+
border-radius: 0 0 4px 4px;
|
| 149 |
+
background-clip: padding-box;
|
| 150 |
+
}
|
| 151 |
+
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
|
| 152 |
+
position: absolute;
|
| 153 |
+
left: -9999px;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/* @end */
|
| 157 |
+
/* @group Results */
|
| 158 |
+
.chosen-container .chosen-results {
|
| 159 |
+
color: #444;
|
| 160 |
+
position: relative;
|
| 161 |
+
overflow-x: hidden;
|
| 162 |
+
overflow-y: auto;
|
| 163 |
+
margin: 0 4px 4px 0;
|
| 164 |
+
padding: 0 0 0 4px;
|
| 165 |
+
max-height: 240px;
|
| 166 |
+
-webkit-overflow-scrolling: touch;
|
| 167 |
+
}
|
| 168 |
+
.chosen-container .chosen-results li {
|
| 169 |
+
display: none;
|
| 170 |
+
margin: 0;
|
| 171 |
+
padding: 5px 6px;
|
| 172 |
+
list-style: none;
|
| 173 |
+
line-height: 15px;
|
| 174 |
+
word-wrap: break-word;
|
| 175 |
+
-webkit-touch-callout: none;
|
| 176 |
+
}
|
| 177 |
+
.chosen-container .chosen-results li.active-result {
|
| 178 |
+
display: list-item;
|
| 179 |
+
cursor: pointer;
|
| 180 |
+
}
|
| 181 |
+
.chosen-container .chosen-results li.disabled-result {
|
| 182 |
+
display: list-item;
|
| 183 |
+
color: #ccc;
|
| 184 |
+
cursor: default;
|
| 185 |
+
}
|
| 186 |
+
.chosen-container .chosen-results li.highlighted {
|
| 187 |
+
background-color: #3875d7;
|
| 188 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
|
| 189 |
+
background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
|
| 190 |
+
background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
|
| 191 |
+
background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
|
| 192 |
+
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
|
| 193 |
+
color: #fff;
|
| 194 |
+
}
|
| 195 |
+
.chosen-container .chosen-results li.no-results {
|
| 196 |
+
color: #777;
|
| 197 |
+
display: list-item;
|
| 198 |
+
background: #f4f4f4;
|
| 199 |
+
}
|
| 200 |
+
.chosen-container .chosen-results li.group-result {
|
| 201 |
+
display: list-item;
|
| 202 |
+
font-weight: bold;
|
| 203 |
+
cursor: default;
|
| 204 |
+
}
|
| 205 |
+
.chosen-container .chosen-results li.group-option {
|
| 206 |
+
padding-left: 15px;
|
| 207 |
+
}
|
| 208 |
+
.chosen-container .chosen-results li em {
|
| 209 |
+
font-style: normal;
|
| 210 |
+
text-decoration: underline;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
/* @end */
|
| 214 |
+
/* @group Multi Chosen */
|
| 215 |
+
.chosen-container-multi .chosen-choices {
|
| 216 |
+
position: relative;
|
| 217 |
+
overflow: hidden;
|
| 218 |
+
margin: 0;
|
| 219 |
+
padding: 0 5px;
|
| 220 |
+
width: 100%;
|
| 221 |
+
height: auto !important;
|
| 222 |
+
height: 1%;
|
| 223 |
+
border: 1px solid #aaa;
|
| 224 |
+
background-color: #fff;
|
| 225 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
| 226 |
+
background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
|
| 227 |
+
background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
|
| 228 |
+
background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
|
| 229 |
+
background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
|
| 230 |
+
cursor: text;
|
| 231 |
+
}
|
| 232 |
+
.chosen-container-multi .chosen-choices li {
|
| 233 |
+
float: left;
|
| 234 |
+
list-style: none;
|
| 235 |
+
}
|
| 236 |
+
.chosen-container-multi .chosen-choices li.search-field {
|
| 237 |
+
margin: 0;
|
| 238 |
+
padding: 0;
|
| 239 |
+
white-space: nowrap;
|
| 240 |
+
}
|
| 241 |
+
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
|
| 242 |
+
margin: 1px 0;
|
| 243 |
+
padding: 0;
|
| 244 |
+
height: 25px;
|
| 245 |
+
outline: 0;
|
| 246 |
+
border: 0 !important;
|
| 247 |
+
background: transparent !important;
|
| 248 |
+
box-shadow: none;
|
| 249 |
+
color: #999;
|
| 250 |
+
font-size: 100%;
|
| 251 |
+
font-family: sans-serif;
|
| 252 |
+
line-height: normal;
|
| 253 |
+
border-radius: 0;
|
| 254 |
+
}
|
| 255 |
+
.chosen-container-multi .chosen-choices li.search-choice {
|
| 256 |
+
position: relative;
|
| 257 |
+
margin: 3px 5px 3px 0;
|
| 258 |
+
padding: 3px 20px 3px 5px;
|
| 259 |
+
border: 1px solid #aaa;
|
| 260 |
+
max-width: 100%;
|
| 261 |
+
border-radius: 3px;
|
| 262 |
+
background-color: #eeeeee;
|
| 263 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
| 264 |
+
background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 265 |
+
background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 266 |
+
background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 267 |
+
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 268 |
+
background-size: 100% 19px;
|
| 269 |
+
background-repeat: repeat-x;
|
| 270 |
+
background-clip: padding-box;
|
| 271 |
+
box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
| 272 |
+
color: #333;
|
| 273 |
+
line-height: 13px;
|
| 274 |
+
cursor: default;
|
| 275 |
+
}
|
| 276 |
+
.chosen-container-multi .chosen-choices li.search-choice span {
|
| 277 |
+
word-wrap: break-word;
|
| 278 |
+
}
|
| 279 |
+
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
|
| 280 |
+
position: absolute;
|
| 281 |
+
top: 4px;
|
| 282 |
+
right: 3px;
|
| 283 |
+
display: block;
|
| 284 |
+
width: 12px;
|
| 285 |
+
height: 12px;
|
| 286 |
+
background: url('../images/chosen-sprite.png') -42px 1px no-repeat;
|
| 287 |
+
font-size: 1px;
|
| 288 |
+
}
|
| 289 |
+
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
|
| 290 |
+
background-position: -42px -10px;
|
| 291 |
+
}
|
| 292 |
+
.chosen-container-multi .chosen-choices li.search-choice-disabled {
|
| 293 |
+
padding-right: 5px;
|
| 294 |
+
border: 1px solid #ccc;
|
| 295 |
+
background-color: #e4e4e4;
|
| 296 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
| 297 |
+
background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 298 |
+
background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 299 |
+
background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 300 |
+
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
| 301 |
+
color: #666;
|
| 302 |
+
}
|
| 303 |
+
.chosen-container-multi .chosen-choices li.search-choice-focus {
|
| 304 |
+
background: #d4d4d4;
|
| 305 |
+
}
|
| 306 |
+
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
|
| 307 |
+
background-position: -42px -10px;
|
| 308 |
+
}
|
| 309 |
+
.chosen-container-multi .chosen-results {
|
| 310 |
+
margin: 0;
|
| 311 |
+
padding: 0;
|
| 312 |
+
}
|
| 313 |
+
.chosen-container-multi .chosen-drop .result-selected {
|
| 314 |
+
display: list-item;
|
| 315 |
+
color: #ccc;
|
| 316 |
+
cursor: default;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
/* @end */
|
| 320 |
+
/* @group Active */
|
| 321 |
+
.chosen-container-active .chosen-single {
|
| 322 |
+
border: 1px solid #5897fb;
|
| 323 |
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
| 324 |
+
}
|
| 325 |
+
.chosen-container-active.chosen-with-drop .chosen-single {
|
| 326 |
+
border: 1px solid #aaa;
|
| 327 |
+
-moz-border-radius-bottomright: 0;
|
| 328 |
+
border-bottom-right-radius: 0;
|
| 329 |
+
-moz-border-radius-bottomleft: 0;
|
| 330 |
+
border-bottom-left-radius: 0;
|
| 331 |
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
|
| 332 |
+
background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
|
| 333 |
+
background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
|
| 334 |
+
background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
|
| 335 |
+
background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
|
| 336 |
+
box-shadow: 0 1px 0 #fff inset;
|
| 337 |
+
}
|
| 338 |
+
.chosen-container-active.chosen-with-drop .chosen-single div {
|
| 339 |
+
border-left: none;
|
| 340 |
+
background: transparent;
|
| 341 |
+
}
|
| 342 |
+
.chosen-container-active.chosen-with-drop .chosen-single div b {
|
| 343 |
+
background-position: -18px 2px;
|
| 344 |
+
}
|
| 345 |
+
.chosen-container-active .chosen-choices {
|
| 346 |
+
border: 1px solid #5897fb;
|
| 347 |
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
| 348 |
+
}
|
| 349 |
+
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
|
| 350 |
+
color: #222 !important;
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
/* @end */
|
| 354 |
+
/* @group Disabled Support */
|
| 355 |
+
.chosen-disabled {
|
| 356 |
+
opacity: 0.5 !important;
|
| 357 |
+
cursor: default;
|
| 358 |
+
}
|
| 359 |
+
.chosen-disabled .chosen-single {
|
| 360 |
+
cursor: default;
|
| 361 |
+
}
|
| 362 |
+
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
|
| 363 |
+
cursor: default;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
/* @end */
|
| 367 |
+
/* @group Right to Left */
|
| 368 |
+
.chosen-rtl {
|
| 369 |
+
text-align: right;
|
| 370 |
+
}
|
| 371 |
+
.chosen-rtl .chosen-single {
|
| 372 |
+
overflow: visible;
|
| 373 |
+
padding: 0 8px 0 0;
|
| 374 |
+
}
|
| 375 |
+
.chosen-rtl .chosen-single span {
|
| 376 |
+
margin-right: 0;
|
| 377 |
+
margin-left: 26px;
|
| 378 |
+
direction: rtl;
|
| 379 |
+
}
|
| 380 |
+
.chosen-rtl .chosen-single-with-deselect span {
|
| 381 |
+
margin-left: 38px;
|
| 382 |
+
}
|
| 383 |
+
.chosen-rtl .chosen-single div {
|
| 384 |
+
right: auto;
|
| 385 |
+
left: 3px;
|
| 386 |
+
}
|
| 387 |
+
.chosen-rtl .chosen-single abbr {
|
| 388 |
+
right: auto;
|
| 389 |
+
left: 26px;
|
| 390 |
+
}
|
| 391 |
+
.chosen-rtl .chosen-choices li {
|
| 392 |
+
float: right;
|
| 393 |
+
}
|
| 394 |
+
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
|
| 395 |
+
direction: rtl;
|
| 396 |
+
}
|
| 397 |
+
.chosen-rtl .chosen-choices li.search-choice {
|
| 398 |
+
margin: 3px 5px 3px 0;
|
| 399 |
+
padding: 3px 5px 3px 19px;
|
| 400 |
+
}
|
| 401 |
+
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
|
| 402 |
+
right: auto;
|
| 403 |
+
left: 4px;
|
| 404 |
+
}
|
| 405 |
+
.chosen-rtl.chosen-container-single-nosearch .chosen-search,
|
| 406 |
+
.chosen-rtl .chosen-drop {
|
| 407 |
+
left: 9999px;
|
| 408 |
+
}
|
| 409 |
+
.chosen-rtl.chosen-container-single .chosen-results {
|
| 410 |
+
margin: 0 0 4px 4px;
|
| 411 |
+
padding: 0 4px 0 0;
|
| 412 |
+
}
|
| 413 |
+
.chosen-rtl .chosen-results li.group-option {
|
| 414 |
+
padding-right: 15px;
|
| 415 |
+
padding-left: 0;
|
| 416 |
+
}
|
| 417 |
+
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
|
| 418 |
+
border-right: none;
|
| 419 |
+
}
|
| 420 |
+
.chosen-rtl .chosen-search input[type="text"] {
|
| 421 |
+
padding: 4px 5px 4px 20px;
|
| 422 |
+
background: white url('../images/chosen-sprite.png') no-repeat -30px -20px;
|
| 423 |
+
background: url('../images/chosen-sprite.png') no-repeat -30px -20px;
|
| 424 |
+
direction: rtl;
|
| 425 |
+
}
|
| 426 |
+
.chosen-rtl.chosen-container-single .chosen-single div b {
|
| 427 |
+
background-position: 6px 2px;
|
| 428 |
+
}
|
| 429 |
+
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
|
| 430 |
+
background-position: -12px 2px;
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
/* @end */
|
| 434 |
+
/* @group Retina compatibility */
|
| 435 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
|
| 436 |
+
.chosen-rtl .chosen-search input[type="text"],
|
| 437 |
+
.chosen-container-single .chosen-single abbr,
|
| 438 |
+
.chosen-container-single .chosen-single div b,
|
| 439 |
+
.chosen-container-single .chosen-search input[type="text"],
|
| 440 |
+
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
|
| 441 |
+
.chosen-container .chosen-results-scroll-down span,
|
| 442 |
+
.chosen-container .chosen-results-scroll-up span {
|
| 443 |
+
background-image: url('../images/chosen-sprite@2x.png') !important;
|
| 444 |
+
background-size: 52px 37px !important;
|
| 445 |
+
background-repeat: no-repeat !important;
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
/* @end */
|
|
@@ -0,0 +1,11 @@
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
/*!
|
| 2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
| 3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
| 4 |
+
|
| 5 |
+
Version 1.5.1
|
| 6 |
+
Full source at https://github.com/harvesthq/chosen
|
| 7 |
+
Copyright (c) 2011-2016 Harvest http://getharvest.com
|
| 8 |
+
|
| 9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
| 10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
| 11 |
+
*/.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover,.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) 0 2px no-repeat}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:url(chosen-sprite.png) 100% -20px no-repeat;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:0 0!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../images/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close,.chosen-disabled .chosen-single{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl .chosen-drop,.chosen-rtl.chosen-container-single-nosearch .chosen-search{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:url(../images/chosen-sprite.png) -30px -20px no-repeat;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span,.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container-single .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-rtl .chosen-search input[type=text]{background-image:url(../images/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -0,0 +1,30 @@
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
|
| 2 |
+
.ui-timepicker-div dl { text-align: left; }
|
| 3 |
+
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
|
| 4 |
+
.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; }
|
| 5 |
+
.ui-timepicker-div td { font-size: 90%; }
|
| 6 |
+
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
|
| 7 |
+
.ui-timepicker-div .ui_tpicker_unit_hide{ display: none; }
|
| 8 |
+
|
| 9 |
+
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input { background: none; color: inherit; border: none; outline: none; border-bottom: solid 1px #555; width: 95%; }
|
| 10 |
+
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus { border-bottom-color: #aaa; }
|
| 11 |
+
|
| 12 |
+
.ui-timepicker-rtl{ direction: rtl; }
|
| 13 |
+
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
|
| 14 |
+
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
|
| 15 |
+
.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }
|
| 16 |
+
|
| 17 |
+
/* Shortened version style */
|
| 18 |
+
.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; }
|
| 19 |
+
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
|
| 20 |
+
.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; }
|
| 21 |
+
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; }
|
| 22 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; }
|
| 23 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
|
| 24 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; }
|
| 25 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
|
| 26 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; }
|
| 27 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
|
| 28 |
+
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; }
|
| 29 |
+
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
|
| 30 |
+
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:none;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
|
@@ -1,118 +1,148 @@
|
|
| 1 |
-
h2.wpmm-title {
|
| 2 |
-
background: url('../images/icon-48.png') no-repeat left center;
|
| 3 |
-
line-height: 42px;
|
| 4 |
-
margin-bottom: 30px;
|
| 5 |
-
height: 48px;
|
| 6 |
-
padding-left: 55px;
|
| 7 |
-
}
|
| 8 |
-
|
| 9 |
-
/* WRAP*/
|
| 10 |
-
.wpmm-wrapper {
|
| 11 |
-
display: table;
|
| 12 |
-
width: 100%;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
.wpmm-wrapper #content {
|
| 16 |
-
min-width: 800px;
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
.wpmm-wrapper #sidebar {
|
| 20 |
-
padding: 0 0 0 20px;
|
| 21 |
-
width: 280px;
|
| 22 |
-
}
|
| 23 |
-
|
| 24 |
-
.wpmm-wrapper #sidebar .sidebar_box {
|
| 25 |
-
background: none repeat scroll 0 0 #fff;
|
| 26 |
-
border: 1px solid #e5e5e5;
|
| 27 |
-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
| 28 |
-
min-width: 255px;
|
| 29 |
-
line-height: 1;
|
| 30 |
-
margin-bottom: 20px;
|
| 31 |
-
padding: 0;
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
.wpmm-wrapper #sidebar .sidebar_box h3 {
|
| 35 |
-
margin: 0;
|
| 36 |
-
padding: 8px 12px;
|
| 37 |
-
border-bottom: 1px solid #ececec;
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
.wpmm-wrapper #sidebar .sidebar_box .inside {
|
| 41 |
-
margin: 6px 0 0;
|
| 42 |
-
font-size: 13px;
|
| 43 |
-
line-height: 1.4em;
|
| 44 |
-
padding: 0 12px 12px;
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
.wpmm-wrapper .wrapper-cell {
|
| 48 |
-
display: table-cell;
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
.wpmm-wrapper .hidden {
|
| 52 |
-
display: none;
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
/* TABS */
|
| 56 |
-
.nav-tab-wrapper {
|
| 57 |
-
border-bottom: 1px solid #ccc;
|
| 58 |
-
padding-bottom: 0;
|
| 59 |
-
padding-left: 10px;
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
-
.nav-tab-wrapper a {
|
| 63 |
-
font-size: 15px;
|
| 64 |
-
font-weight: 700;
|
| 65 |
-
line-height: 24px;
|
| 66 |
-
padding: 6px 10px;
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
/* TABS CONTENT */
|
| 70 |
-
.tabs-content {
|
| 71 |
-
margin-top: 20px;
|
| 72 |
-
padding-left: 10px;
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
.tabs-content .wp-color-result {
|
| 76 |
-
margin-bottom: -2px;
|
| 77 |
-
}
|
| 78 |
-
|
| 79 |
-
.tabs-content ul.bg_list {
|
| 80 |
-
float: left;
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
.tabs-content ul.bg_list li {
|
| 84 |
-
float: left;
|
| 85 |
-
margin-right: 7px;
|
| 86 |
-
opacity: 0.4;
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
.tabs-content ul.bg_list li.active {
|
| 90 |
-
opacity: 1;
|
| 91 |
-
}
|
| 92 |
-
|
| 93 |
-
.tabs-content ul.bg_list li input {
|
| 94 |
-
display: none;
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
.tabs-content .countdown_details input {
|
| 98 |
-
width: 70px;
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
.tabs-content .countdown_details .margin_left {
|
| 102 |
-
margin-left: 30px;
|
| 103 |
-
}
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
#sidebar .
|
| 112 |
-
margin-top: 10px;
|
| 113 |
-
margin-bottom: -
|
| 114 |
-
}
|
| 115 |
-
|
| 116 |
-
#sidebar .resources_box
|
| 117 |
-
margin-
|
| 118 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
h2.wpmm-title {
|
| 2 |
+
background: url('../images/icon-48.png') no-repeat left center;
|
| 3 |
+
line-height: 42px !important;
|
| 4 |
+
margin-bottom: 30px !important;
|
| 5 |
+
height: 48px;
|
| 6 |
+
padding-left: 55px !important;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
/* WRAP*/
|
| 10 |
+
.wpmm-wrapper {
|
| 11 |
+
display: table;
|
| 12 |
+
width: 100%;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.wpmm-wrapper #content {
|
| 16 |
+
min-width: 800px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.wpmm-wrapper #sidebar {
|
| 20 |
+
padding: 0 0 0 20px;
|
| 21 |
+
width: 280px;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.wpmm-wrapper #sidebar .sidebar_box {
|
| 25 |
+
background: none repeat scroll 0 0 #fff;
|
| 26 |
+
border: 1px solid #e5e5e5;
|
| 27 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
| 28 |
+
min-width: 255px;
|
| 29 |
+
line-height: 1;
|
| 30 |
+
margin-bottom: 20px;
|
| 31 |
+
padding: 0;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.wpmm-wrapper #sidebar .sidebar_box h3 {
|
| 35 |
+
margin: 0;
|
| 36 |
+
padding: 8px 12px;
|
| 37 |
+
border-bottom: 1px solid #ececec;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.wpmm-wrapper #sidebar .sidebar_box .inside {
|
| 41 |
+
margin: 6px 0 0;
|
| 42 |
+
font-size: 13px;
|
| 43 |
+
line-height: 1.4em;
|
| 44 |
+
padding: 0 12px 12px;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.wpmm-wrapper .wrapper-cell {
|
| 48 |
+
display: table-cell;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.wpmm-wrapper .hidden {
|
| 52 |
+
display: none;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* TABS */
|
| 56 |
+
.nav-tab-wrapper {
|
| 57 |
+
border-bottom: 1px solid #ccc;
|
| 58 |
+
padding-bottom: 0;
|
| 59 |
+
padding-left: 10px;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.nav-tab-wrapper a {
|
| 63 |
+
font-size: 15px;
|
| 64 |
+
font-weight: 700;
|
| 65 |
+
line-height: 24px;
|
| 66 |
+
padding: 6px 10px;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
/* TABS CONTENT */
|
| 70 |
+
.tabs-content {
|
| 71 |
+
margin-top: 20px;
|
| 72 |
+
padding-left: 10px;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.tabs-content .wp-color-result {
|
| 76 |
+
margin-bottom: -2px;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.tabs-content ul.bg_list {
|
| 80 |
+
float: left;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.tabs-content ul.bg_list li {
|
| 84 |
+
float: left;
|
| 85 |
+
margin-right: 7px;
|
| 86 |
+
opacity: 0.4;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.tabs-content ul.bg_list li.active {
|
| 90 |
+
opacity: 1;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.tabs-content ul.bg_list li input {
|
| 94 |
+
display: none;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.tabs-content .countdown_details input {
|
| 98 |
+
width: 70px;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.tabs-content .countdown_details .margin_left {
|
| 102 |
+
margin-left: 30px;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.tabs-content .wp-picker-holder {
|
| 106 |
+
position:absolute;
|
| 107 |
+
z-index:9999999;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/* SIDEBARS */
|
| 111 |
+
#sidebar .info_box ul {
|
| 112 |
+
margin-top: 10px;
|
| 113 |
+
margin-bottom: -5px;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
#sidebar .resources_box ul, #sidebar .themes_box ul {
|
| 117 |
+
margin-top: 10px;
|
| 118 |
+
margin-bottom: -15px;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
#sidebar .resources_box li, #sidebar .themes_box li {
|
| 122 |
+
margin-bottom: 10px;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
/* CHOSEN.JS MULTISELECT */
|
| 126 |
+
.chosen-select {
|
| 127 |
+
width: 195px !important;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.chosen-container {
|
| 131 |
+
width: 195px !important;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
.chosen-container-active .chosen-choices {
|
| 135 |
+
box-shadow: none !important;
|
| 136 |
+
background-image: none !important;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.chosen-container-multi .chosen-choices {
|
| 140 |
+
border: 1px solid #ddd !important;
|
| 141 |
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset !important;
|
| 142 |
+
background-image: none !important;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
.chosen-container .chosen-results li.highlighted {
|
| 146 |
+
background-color: #0074a2 !important;
|
| 147 |
+
background-image: none !important;
|
| 148 |
+
}
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
h2.wpmm-title{background:url(../images/icon-48.png) left center no-repeat;line-height:42px!important;margin-bottom:30px!important;height:48px;padding-left:55px!important}.wpmm-wrapper{display:table;width:100%}.wpmm-wrapper #content{min-width:800px}.wpmm-wrapper #sidebar{padding:0 0 0 20px;width:280px}.wpmm-wrapper #sidebar .sidebar_box{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);min-width:255px;line-height:1;margin-bottom:20px;padding:0}.wpmm-wrapper #sidebar .sidebar_box h3{margin:0;padding:8px 12px;border-bottom:1px solid #ececec}.wpmm-wrapper #sidebar .sidebar_box .inside{margin:6px 0 0;font-size:13px;line-height:1.4em;padding:0 12px 12px}.wpmm-wrapper .wrapper-cell{display:table-cell}.wpmm-wrapper .hidden{display:none}.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0;padding-left:10px}.nav-tab-wrapper a{font-size:15px;font-weight:700;line-height:24px;padding:6px 10px}.tabs-content{margin-top:20px;padding-left:10px}.tabs-content .wp-color-result{margin-bottom:-2px}.tabs-content ul.bg_list{float:left}.tabs-content ul.bg_list li{float:left;margin-right:7px;opacity:.4}.tabs-content ul.bg_list li.active{opacity:1}.tabs-content ul.bg_list li input{display:none}.tabs-content .countdown_details input{width:70px}.tabs-content .countdown_details .margin_left{margin-left:30px}.tabs-content .wp-picker-holder{position:absolute;z-index:9999999}#sidebar .info_box ul{margin-top:10px;margin-bottom:-5px}#sidebar .resources_box ul,#sidebar .themes_box ul{margin-top:10px;margin-bottom:-15px}#sidebar .resources_box li,#sidebar .themes_box li{margin-bottom:10px}.chosen-container,.chosen-select{width:195px!important}.chosen-container-active .chosen-choices{box-shadow:none!important;background-image:none!important}.chosen-container-multi .chosen-choices{border:1px solid #ddd!important;box-shadow:0 1px 2px rgba(0,0,0,.07) inset!important;background-image:none!important}.chosen-container .chosen-results li.highlighted{background-color:#0074a2!important;background-image:none!important}
|
|
@@ -1,462 +1,462 @@
|
|
| 1 |
-
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
|
| 2 |
-
margin: 0;
|
| 3 |
-
padding: 0;
|
| 4 |
-
border: 0;
|
| 5 |
-
font-size: 100%;
|
| 6 |
-
font: inherit;
|
| 7 |
-
vertical-align: baseline;
|
| 8 |
-
text-decoration: none;
|
| 9 |
-
}
|
| 10 |
-
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
|
| 11 |
-
display: block;
|
| 12 |
-
}
|
| 13 |
-
body {
|
| 14 |
-
line-height: 1;
|
| 15 |
-
}
|
| 16 |
-
ol, ul {
|
| 17 |
-
list-style: none;
|
| 18 |
-
}
|
| 19 |
-
blockquote, q {
|
| 20 |
-
display: block;
|
| 21 |
-
width: 500px;
|
| 22 |
-
margin: 0 auto;
|
| 23 |
-
text-align: left;
|
| 24 |
-
position: relative;
|
| 25 |
-
font-style: italic;
|
| 26 |
-
}
|
| 27 |
-
blockquote:before, blockquote:after, q:before, q:after {
|
| 28 |
-
content: '"';
|
| 29 |
-
content: none;
|
| 30 |
-
}
|
| 31 |
-
input, button {
|
| 32 |
-
-webkit-appearance: none;
|
| 33 |
-
border-radius: 0;
|
| 34 |
-
}
|
| 35 |
-
table {
|
| 36 |
-
border-collapse: collapse;
|
| 37 |
-
border-spacing: 0;
|
| 38 |
-
}
|
| 39 |
-
em, i {
|
| 40 |
-
font-style: italic;
|
| 41 |
-
}
|
| 42 |
-
del {
|
| 43 |
-
text-decoration: line-through;
|
| 44 |
-
}
|
| 45 |
-
strong, b {
|
| 46 |
-
font-weight: bold;
|
| 47 |
-
}
|
| 48 |
-
ol {
|
| 49 |
-
width: 600px;
|
| 50 |
-
margin: 0 auto;
|
| 51 |
-
text-align: left;
|
| 52 |
-
}
|
| 53 |
-
ol li {
|
| 54 |
-
list-style-type: decimal;
|
| 55 |
-
}
|
| 56 |
-
ul {
|
| 57 |
-
width: 600px;
|
| 58 |
-
margin: 0 auto;
|
| 59 |
-
text-align: left;
|
| 60 |
-
}
|
| 61 |
-
ul li {
|
| 62 |
-
list-style: disc;
|
| 63 |
-
}
|
| 64 |
-
a {
|
| 65 |
-
color: inherit;
|
| 66 |
-
text-decoration: underline;
|
| 67 |
-
}
|
| 68 |
-
body, html {
|
| 69 |
-
min-height: 100%;
|
| 70 |
-
/*height: 100%;*/
|
| 71 |
-
}
|
| 72 |
-
body {
|
| 73 |
-
background-color: #fff;
|
| 74 |
-
color: #1b1f23;
|
| 75 |
-
font-family: Helvetica Neue, Arial, sans-serif;
|
| 76 |
-
}
|
| 77 |
-
.wrap {
|
| 78 |
-
width: 605px;
|
| 79 |
-
margin: 100px auto 0;
|
| 80 |
-
text-align: center;
|
| 81 |
-
}
|
| 82 |
-
.wrap h1 {
|
| 83 |
-
font-size: 30px;
|
| 84 |
-
font-weight: 700;
|
| 85 |
-
margin: 0 0 90px;
|
| 86 |
-
}
|
| 87 |
-
.wrap h2 {
|
| 88 |
-
font-size: 24px;
|
| 89 |
-
font-weight: 400;
|
| 90 |
-
line-height: 45px;
|
| 91 |
-
margin: 0 0 80px;
|
| 92 |
-
}
|
| 93 |
-
.wrap h3 {
|
| 94 |
-
font-size: 24px;
|
| 95 |
-
font-weight: 400px;
|
| 96 |
-
margin: 0 0 45px;
|
| 97 |
-
}
|
| 98 |
-
.wrap .author_link {
|
| 99 |
-
margin-top: 15px;
|
| 100 |
-
color: #616161;
|
| 101 |
-
margin: 0 0 50px;
|
| 102 |
-
}
|
| 103 |
-
.wrap .author_link a {
|
| 104 |
-
color: #000;
|
| 105 |
-
}
|
| 106 |
-
/**
|
| 107 |
-
* COUNTDOWN
|
| 108 |
-
**/
|
| 109 |
-
|
| 110 |
-
.wrap .countdown {
|
| 111 |
-
margin: 0 0 85px;
|
| 112 |
-
}
|
| 113 |
-
.wrap .countdown span {
|
| 114 |
-
font-size: 30px;
|
| 115 |
-
}
|
| 116 |
-
/**
|
| 117 |
-
* SUBSCRIBE FORM
|
| 118 |
-
**/
|
| 119 |
-
|
| 120 |
-
.wrap form.subscribe_form {
|
| 121 |
-
width: 465px;
|
| 122 |
-
margin: 0 0 75px;
|
| 123 |
-
display: inline-block;
|
| 124 |
-
border: 3px solid #e0e0e0;
|
| 125 |
-
box-sizing: border-box;
|
| 126 |
-
}
|
| 127 |
-
.wrap form.subscribe_form input {
|
| 128 |
-
margin: 0;
|
| 129 |
-
outline: 0;
|
| 130 |
-
border: 0;
|
| 131 |
-
float: left;
|
| 132 |
-
font-size: 18px;
|
| 133 |
-
padding: 20px 25px;
|
| 134 |
-
box-sizing: content-box;
|
| 135 |
-
}
|
| 136 |
-
.wrap form.subscribe_form input[type="text"] {
|
| 137 |
-
width: 245px;
|
| 138 |
-
}
|
| 139 |
-
.wrap form.subscribe_form input[type="submit"] {
|
| 140 |
-
background: #000;
|
| 141 |
-
color: #fff;
|
| 142 |
-
float: right;
|
| 143 |
-
cursor: pointer;
|
| 144 |
-
padding: 20px 30px;
|
| 145 |
-
border-left: 3px solid #e0e0e0;
|
| 146 |
-
}
|
| 147 |
-
.wrap form.subscribe_form input[type="submit"]:hover {
|
| 148 |
-
background: #fff;
|
| 149 |
-
color: #000;
|
| 150 |
-
border-left: 3px solid #e0e0e0;
|
| 151 |
-
}
|
| 152 |
-
.wrap form.subscribe_form input[type="submit"]:active {
|
| 153 |
-
background: #1e1e1e;
|
| 154 |
-
color: #fff;
|
| 155 |
-
}
|
| 156 |
-
.wrap form.subscribe_form .error {
|
| 157 |
-
color: red;
|
| 158 |
-
}
|
| 159 |
-
.wrap form.subscribe_form label.error {
|
| 160 |
-
display: none !important;
|
| 161 |
-
}
|
| 162 |
-
/**
|
| 163 |
-
* LOGIN FORM
|
| 164 |
-
**/
|
| 165 |
-
|
| 166 |
-
.wrap form.login_form {
|
| 167 |
-
width: 100%;
|
| 168 |
-
margin: 15px 0 0;
|
| 169 |
-
}
|
| 170 |
-
.wrap form.login_form input {
|
| 171 |
-
display: inline-block;
|
| 172 |
-
box-sizing: border-box;
|
| 173 |
-
-moz-box-sizing: border-box;
|
| 174 |
-
-webkit-box-sizing: border-box;
|
| 175 |
-
border: 3px solid #E2E2E2;
|
| 176 |
-
font-family: Helvetica Neue, Arial, sans-serif;
|
| 177 |
-
font-size: 16px;
|
| 178 |
-
margin: 0 10px 0 0;
|
| 179 |
-
outline: 0;
|
| 180 |
-
padding: 15px;
|
| 181 |
-
}
|
| 182 |
-
.wrap form.login_form input[type="submit"] {
|
| 183 |
-
background: #000;
|
| 184 |
-
color: #fff;
|
| 185 |
-
margin: 0;
|
| 186 |
-
border-color: #000;
|
| 187 |
-
font-weight: bold;
|
| 188 |
-
padding: 15px 30px;
|
| 189 |
-
cursor: pointer;
|
| 190 |
-
}
|
| 191 |
-
.wrap form.login_form input[type="submit"]:active {
|
| 192 |
-
position: relative;
|
| 193 |
-
top: 1px;
|
| 194 |
-
}
|
| 195 |
-
/**
|
| 196 |
-
* SOCIAL NETWORKS
|
| 197 |
-
**/
|
| 198 |
-
|
| 199 |
-
.wrap .social {
|
| 200 |
-
margin: 0 0 70px;
|
| 201 |
-
}
|
| 202 |
-
.wrap .social a {
|
| 203 |
-
width: 22px;
|
| 204 |
-
height: 22px;
|
| 205 |
-
margin: 0 0 20px 55px;
|
| 206 |
-
background-image: url('../images/icn_sprite.png');
|
| 207 |
-
background-repeat: no-repeat;
|
| 208 |
-
display: inline-block;
|
| 209 |
-
text-indent: -999em;
|
| 210 |
-
}
|
| 211 |
-
.wrap .social a:first-of-type {
|
| 212 |
-
margin: 0 0 20px 0;
|
| 213 |
-
}
|
| 214 |
-
.wrap .social .git {
|
| 215 |
-
background-position: 0 0;
|
| 216 |
-
}
|
| 217 |
-
.wrap .social .fb {
|
| 218 |
-
background-position: -240px 0;
|
| 219 |
-
}
|
| 220 |
-
.wrap .social .tw {
|
| 221 |
-
background-position: -162px 0px;
|
| 222 |
-
}
|
| 223 |
-
.wrap .social .rss {
|
| 224 |
-
background-position: -402px 0;
|
| 225 |
-
}
|
| 226 |
-
.wrap .social .mail {
|
| 227 |
-
background-position: -560px 0;
|
| 228 |
-
}
|
| 229 |
-
.wrap .social .pin {
|
| 230 |
-
background-position: -322px 0;
|
| 231 |
-
}
|
| 232 |
-
.wrap .social .dribbble {
|
| 233 |
-
background-position: -82px 0;
|
| 234 |
-
}
|
| 235 |
-
.wrap .social .gplus {
|
| 236 |
-
background-position: -486px 0;
|
| 237 |
-
}
|
| 238 |
-
.wrap .social .linkedin {
|
| 239 |
-
background-position: -633px 0;
|
| 240 |
-
}
|
| 241 |
-
/**
|
| 242 |
-
* CONTACT FORM
|
| 243 |
-
**/
|
| 244 |
-
|
| 245 |
-
.wrap .contact_us {
|
| 246 |
-
color: #000;
|
| 247 |
-
border: 3px solid #000;
|
| 248 |
-
font-size: 18px;
|
| 249 |
-
padding: 15px 40px;
|
| 250 |
-
display: inline-block;
|
| 251 |
-
margin: 0 0 70px;
|
| 252 |
-
}
|
| 253 |
-
.wrap .contact_us:hover {
|
| 254 |
-
background: #000;
|
| 255 |
-
color: #fff;
|
| 256 |
-
}
|
| 257 |
-
.contact_us {
|
| 258 |
-
text-decoration: none;
|
| 259 |
-
}
|
| 260 |
-
.contact {
|
| 261 |
-
position: fixed;
|
| 262 |
-
display: none;
|
| 263 |
-
top: 0;
|
| 264 |
-
bottom: 0;
|
| 265 |
-
left: 0;
|
| 266 |
-
right: 0;
|
| 267 |
-
background: rgba(27, 31, 35, 0.95);
|
| 268 |
-
}
|
| 269 |
-
.contact label.error {
|
| 270 |
-
color: red;
|
| 271 |
-
float: left;
|
| 272 |
-
font-size: 11px;
|
| 273 |
-
padding-top: 10px;
|
| 274 |
-
}
|
| 275 |
-
.contact .form {
|
| 276 |
-
width: 520px;
|
| 277 |
-
text-align: center;
|
| 278 |
-
padding: 40px;
|
| 279 |
-
background: #f9f9f9;
|
| 280 |
-
box-sizing: border-box;
|
| 281 |
-
margin: 100px auto;
|
| 282 |
-
transition: 0.2s transform ease-in-out;
|
| 283 |
-
}
|
| 284 |
-
.contact .form input, .contact .form textarea {
|
| 285 |
-
padding: 15px 20px;
|
| 286 |
-
margin: 0;
|
| 287 |
-
outline: 0;
|
| 288 |
-
width: 100%;
|
| 289 |
-
background: #f9f9f9;
|
| 290 |
-
border: 3px solid #e0e0e0;
|
| 291 |
-
font-size: 18px;
|
| 292 |
-
font-family: Helvetica Neue, Arial, sans-serif;
|
| 293 |
-
box-sizing: border-box;
|
| 294 |
-
resize: none;
|
| 295 |
-
}
|
| 296 |
-
.contact .form textarea {
|
| 297 |
-
height: 175px;
|
| 298 |
-
padding: 20px;
|
| 299 |
-
}
|
| 300 |
-
.contact .form input[type="text"]::-webkit-input-placeholder, .contact .form textarea::-webkit-input-placeholder {
|
| 301 |
-
color: #dadada;
|
| 302 |
-
}
|
| 303 |
-
.contact .form input[type="text"]::-moz-input-placeholder, .contact .form textarea::-moz-input-placeholder {
|
| 304 |
-
color: #dadada;
|
| 305 |
-
}
|
| 306 |
-
.contact .form input[type="text"]::-ms-input-placeholder, .contact .form textarea::-ms-input-placeholder {
|
| 307 |
-
color: #dadada;
|
| 308 |
-
}
|
| 309 |
-
.contact .form .col {
|
| 310 |
-
width: 205px;
|
| 311 |
-
margin: 0 0 30px;
|
| 312 |
-
display: inline-block;
|
| 313 |
-
float: left;
|
| 314 |
-
}
|
| 315 |
-
.contact .form .col.last {
|
| 316 |
-
float: right;
|
| 317 |
-
}
|
| 318 |
-
.contact .form .submit {
|
| 319 |
-
margin: 30px 0 0;
|
| 320 |
-
text-align: center;
|
| 321 |
-
clear: left;
|
| 322 |
-
}
|
| 323 |
-
.contact .form .submit input {
|
| 324 |
-
cursor: pointer;
|
| 325 |
-
display: inline-block;
|
| 326 |
-
background: #1b1f24;
|
| 327 |
-
color: #fff;
|
| 328 |
-
border: 0;
|
| 329 |
-
padding: 20px 45px;
|
| 330 |
-
width: auto;
|
| 331 |
-
}
|
| 332 |
-
/*======= MOVE ANIMATION =======*/
|
| 333 |
-
|
| 334 |
-
.contact .move_top {
|
| 335 |
-
transform: perspective(1000px) translateY(-200px);
|
| 336 |
-
}
|
| 337 |
-
.contact .move_bottom {
|
| 338 |
-
transform: perspective(1000px) translateY(0);
|
| 339 |
-
}
|
| 340 |
-
/*======= ZOOM ANIMATION =======*/
|
| 341 |
-
|
| 342 |
-
.contact .zoom {
|
| 343 |
-
transform: perspective(1000px) scale(0.5);
|
| 344 |
-
transition: 0.3s transform ease-in-out;
|
| 345 |
-
}
|
| 346 |
-
.contact .zoomed {
|
| 347 |
-
transform: perspective(1000px) scale(1);
|
| 348 |
-
}
|
| 349 |
-
/*======= FOLD ANIMATION =======*/
|
| 350 |
-
|
| 351 |
-
.contact .fold {
|
| 352 |
-
transform: perspective(1000px) rotateY(90deg);
|
| 353 |
-
}
|
| 354 |
-
.contact .unfold {
|
| 355 |
-
transform: perspective(1000px) rotateY(0);
|
| 356 |
-
}
|
| 357 |
-
/**
|
| 358 |
-
* EDITS WHEN HAVE BACKGROUND CLASS
|
| 359 |
-
**/
|
| 360 |
-
|
| 361 |
-
.background {
|
| 362 |
-
background: url('../images/backgrounds/bg1.jpg') no-repeat center top fixed;
|
| 363 |
-
background-size: cover;
|
| 364 |
-
}
|
| 365 |
-
.background .countdown span {
|
| 366 |
-
color: #fff;
|
| 367 |
-
}
|
| 368 |
-
.background form.subscribe_form input[type="submit"] {
|
| 369 |
-
color: #000;
|
| 370 |
-
background: #fff;
|
| 371 |
-
}
|
| 372 |
-
.background form.subscribe_form input[type="text"] {
|
| 373 |
-
background: transparent;
|
| 374 |
-
color: #fff;
|
| 375 |
-
}
|
| 376 |
-
.background form.subscribe_form input.error[type="text"] {
|
| 377 |
-
color: red;
|
| 378 |
-
}
|
| 379 |
-
.background form.subscribe_form input[type="text"]::-webkit-input-placeholder {
|
| 380 |
-
color: #fff;
|
| 381 |
-
}
|
| 382 |
-
.background form.subscribe_form input[type="text"]::-moz-input-placeholder {
|
| 383 |
-
color: #fff;
|
| 384 |
-
}
|
| 385 |
-
.background form.subscribe_form input[type="text"]::-ms-input-placeholder {
|
| 386 |
-
color: #fff;
|
| 387 |
-
}
|
| 388 |
-
.background .contact_us {
|
| 389 |
-
color: #fff;
|
| 390 |
-
border-color: #fff;
|
| 391 |
-
}
|
| 392 |
-
/**
|
| 393 |
-
* MEDIA QUERIES (RESPONSIVE)
|
| 394 |
-
**/
|
| 395 |
-
|
| 396 |
-
@media only screen and (max-width: 700px) {
|
| 397 |
-
.wrap form.login_form {
|
| 398 |
-
width: 80%;
|
| 399 |
-
margin: 15px auto 0;
|
| 400 |
-
}
|
| 401 |
-
.wrap form.login_form input {
|
| 402 |
-
width: 49%;
|
| 403 |
-
margin: 0 2% 0 0;
|
| 404 |
-
}
|
| 405 |
-
.wrap form.login_form input[type="password"] {
|
| 406 |
-
margin: 0;
|
| 407 |
-
}
|
| 408 |
-
.wrap form.login_form input[type="submit"] {
|
| 409 |
-
width: 100%;
|
| 410 |
-
margin: 15px 0 0;
|
| 411 |
-
}
|
| 412 |
-
}
|
| 413 |
-
@media only screen and (max-width: 550px) {
|
| 414 |
-
.wrap {
|
| 415 |
-
width: 90%;
|
| 416 |
-
margin: 50px auto 0;
|
| 417 |
-
}
|
| 418 |
-
.wrap h1 {
|
| 419 |
-
margin: 0 0 50px;
|
| 420 |
-
}
|
| 421 |
-
.wrap h2, .wrap h3 {
|
| 422 |
-
font-size: 18px;
|
| 423 |
-
}
|
| 424 |
-
.wrap form {
|
| 425 |
-
box-sizing: border-box;
|
| 426 |
-
width: 100%;
|
| 427 |
-
}
|
| 428 |
-
.wrap form input {
|
| 429 |
-
box-sizing: border-box;
|
| 430 |
-
}
|
| 431 |
-
.wrap form input[type="text"], .wrap form input[type="submit"] {
|
| 432 |
-
width: 100%;
|
| 433 |
-
}
|
| 434 |
-
.wrap .contact_us {
|
| 435 |
-
margin: 0 0 50px;
|
| 436 |
-
}
|
| 437 |
-
.contact .form {
|
| 438 |
-
width: 90%;
|
| 439 |
-
}
|
| 440 |
-
.contact .form p.col {
|
| 441 |
-
width: 100%;
|
| 442 |
-
}
|
| 443 |
-
.contact .form input[type="submit"] {
|
| 444 |
-
width: 100%;
|
| 445 |
-
}
|
| 446 |
-
.wrap form.login_form {
|
| 447 |
-
width: 90%;
|
| 448 |
-
}
|
| 449 |
-
.wrap form.login_form input {
|
| 450 |
-
width: 100%;
|
| 451 |
-
margin: 0 0 10px 0;
|
| 452 |
-
}
|
| 453 |
-
.wrap form.login_form input[type="submit"] {
|
| 454 |
-
margin: 10px 0 0;
|
| 455 |
-
}
|
| 456 |
-
ul, ol {
|
| 457 |
-
width: 80%;
|
| 458 |
-
}
|
| 459 |
-
blockquote, q {
|
| 460 |
-
width: 70%;
|
| 461 |
-
}
|
| 462 |
-
}
|
| 1 |
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
|
| 2 |
+
margin: 0;
|
| 3 |
+
padding: 0;
|
| 4 |
+
border: 0;
|
| 5 |
+
font-size: 100%;
|
| 6 |
+
font: inherit;
|
| 7 |
+
vertical-align: baseline;
|
| 8 |
+
text-decoration: none;
|
| 9 |
+
}
|
| 10 |
+
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
|
| 11 |
+
display: block;
|
| 12 |
+
}
|
| 13 |
+
body {
|
| 14 |
+
line-height: 1;
|
| 15 |
+
}
|
| 16 |
+
ol, ul {
|
| 17 |
+
list-style: none;
|
| 18 |
+
}
|
| 19 |
+
blockquote, q {
|
| 20 |
+
display: block;
|
| 21 |
+
width: 500px;
|
| 22 |
+
margin: 0 auto;
|
| 23 |
+
text-align: left;
|
| 24 |
+
position: relative;
|
| 25 |
+
font-style: italic;
|
| 26 |
+
}
|
| 27 |
+
blockquote:before, blockquote:after, q:before, q:after {
|
| 28 |
+
content: '"';
|
| 29 |
+
content: none;
|
| 30 |
+
}
|
| 31 |
+
input, button {
|
| 32 |
+
-webkit-appearance: none;
|
| 33 |
+
border-radius: 0;
|
| 34 |
+
}
|
| 35 |
+
table {
|
| 36 |
+
border-collapse: collapse;
|
| 37 |
+
border-spacing: 0;
|
| 38 |
+
}
|
| 39 |
+
em, i {
|
| 40 |
+
font-style: italic;
|
| 41 |
+
}
|
| 42 |
+
del {
|
| 43 |
+
text-decoration: line-through;
|
| 44 |
+
}
|
| 45 |
+
strong, b {
|
| 46 |
+
font-weight: bold;
|
| 47 |
+
}
|
| 48 |
+
ol {
|
| 49 |
+
width: 600px;
|
| 50 |
+
margin: 0 auto;
|
| 51 |
+
text-align: left;
|
| 52 |
+
}
|
| 53 |
+
ol li {
|
| 54 |
+
list-style-type: decimal;
|
| 55 |
+
}
|
| 56 |
+
ul {
|
| 57 |
+
width: 600px;
|
| 58 |
+
margin: 0 auto;
|
| 59 |
+
text-align: left;
|
| 60 |
+
}
|
| 61 |
+
ul li {
|
| 62 |
+
list-style: disc;
|
| 63 |
+
}
|
| 64 |
+
a {
|
| 65 |
+
color: inherit;
|
| 66 |
+
text-decoration: underline;
|
| 67 |
+
}
|
| 68 |
+
body, html {
|
| 69 |
+
min-height: 100%;
|
| 70 |
+
/*height: 100%;*/
|
| 71 |
+
}
|
| 72 |
+
body {
|
| 73 |
+
background-color: #fff;
|
| 74 |
+
color: #1b1f23;
|
| 75 |
+
font-family: Helvetica Neue, Arial, sans-serif;
|
| 76 |
+
}
|
| 77 |
+
.wrap {
|
| 78 |
+
width: 605px;
|
| 79 |
+
margin: 100px auto 0;
|
| 80 |
+
text-align: center;
|
| 81 |
+
}
|
| 82 |
+
.wrap h1 {
|
| 83 |
+
font-size: 30px;
|
| 84 |
+
font-weight: 700;
|
| 85 |
+
margin: 0 0 90px;
|
| 86 |
+
}
|
| 87 |
+
.wrap h2 {
|
| 88 |
+
font-size: 24px;
|
| 89 |
+
font-weight: 400;
|
| 90 |
+
line-height: 45px;
|
| 91 |
+
margin: 0 0 80px;
|
| 92 |
+
}
|
| 93 |
+
.wrap h3 {
|
| 94 |
+
font-size: 24px;
|
| 95 |
+
font-weight: 400px;
|
| 96 |
+
margin: 0 0 45px;
|
| 97 |
+
}
|
| 98 |
+
.wrap .author_link {
|
| 99 |
+
margin-top: 15px;
|
| 100 |
+
color: #616161;
|
| 101 |
+
margin: 0 0 50px;
|
| 102 |
+
}
|
| 103 |
+
.wrap .author_link a {
|
| 104 |
+
color: #000;
|
| 105 |
+
}
|
| 106 |
+
/**
|
| 107 |
+
* COUNTDOWN
|
| 108 |
+
**/
|
| 109 |
+
|
| 110 |
+
.wrap .countdown {
|
| 111 |
+
margin: 0 0 85px;
|
| 112 |
+
}
|
| 113 |
+
.wrap .countdown span {
|
| 114 |
+
font-size: 30px;
|
| 115 |
+
}
|
| 116 |
+
/**
|
| 117 |
+
* SUBSCRIBE FORM
|
| 118 |
+
**/
|
| 119 |
+
|
| 120 |
+
.wrap form.subscribe_form {
|
| 121 |
+
width: 465px;
|
| 122 |
+
margin: 0 0 75px;
|
| 123 |
+
display: inline-block;
|
| 124 |
+
border: 3px solid #e0e0e0;
|
| 125 |
+
box-sizing: border-box;
|
| 126 |
+
}
|
| 127 |
+
.wrap form.subscribe_form input {
|
| 128 |
+
margin: 0;
|
| 129 |
+
outline: 0;
|
| 130 |
+
border: 0;
|
| 131 |
+
float: left;
|
| 132 |
+
font-size: 18px;
|
| 133 |
+
padding: 20px 25px;
|
| 134 |
+
box-sizing: content-box;
|
| 135 |
+
}
|
| 136 |
+
.wrap form.subscribe_form input[type="text"] {
|
| 137 |
+
width: 245px;
|
| 138 |
+
}
|
| 139 |
+
.wrap form.subscribe_form input[type="submit"] {
|
| 140 |
+
background: #000;
|
| 141 |
+
color: #fff;
|
| 142 |
+
float: right;
|
| 143 |
+
cursor: pointer;
|
| 144 |
+
padding: 20px 30px;
|
| 145 |
+
border-left: 3px solid #e0e0e0;
|
| 146 |
+
}
|
| 147 |
+
.wrap form.subscribe_form input[type="submit"]:hover {
|
| 148 |
+
background: #fff;
|
| 149 |
+
color: #000;
|
| 150 |
+
border-left: 3px solid #e0e0e0;
|
| 151 |
+
}
|
| 152 |
+
.wrap form.subscribe_form input[type="submit"]:active {
|
| 153 |
+
background: #1e1e1e;
|
| 154 |
+
color: #fff;
|
| 155 |
+
}
|
| 156 |
+
.wrap form.subscribe_form .error {
|
| 157 |
+
color: red;
|
| 158 |
+
}
|
| 159 |
+
.wrap form.subscribe_form label.error {
|
| 160 |
+
display: none !important;
|
| 161 |
+
}
|
| 162 |
+
/**
|
| 163 |
+
* LOGIN FORM
|
| 164 |
+
**/
|
| 165 |
+
|
| 166 |
+
.wrap form.login_form {
|
| 167 |
+
width: 100%;
|
| 168 |
+
margin: 15px 0 0;
|
| 169 |
+
}
|
| 170 |
+
.wrap form.login_form input {
|
| 171 |
+
display: inline-block;
|
| 172 |
+
box-sizing: border-box;
|
| 173 |
+
-moz-box-sizing: border-box;
|
| 174 |
+
-webkit-box-sizing: border-box;
|
| 175 |
+
border: 3px solid #E2E2E2;
|
| 176 |
+
font-family: Helvetica Neue, Arial, sans-serif;
|
| 177 |
+
font-size: 16px;
|
| 178 |
+
margin: 0 10px 0 0;
|
| 179 |
+
outline: 0;
|
| 180 |
+
padding: 15px;
|
| 181 |
+
}
|
| 182 |
+
.wrap form.login_form input[type="submit"] {
|
| 183 |
+
background: #000;
|
| 184 |
+
color: #fff;
|
| 185 |
+
margin: 0;
|
| 186 |
+
border-color: #000;
|
| 187 |
+
font-weight: bold;
|
| 188 |
+
padding: 15px 30px;
|
| 189 |
+
cursor: pointer;
|
| 190 |
+
}
|
| 191 |
+
.wrap form.login_form input[type="submit"]:active {
|
| 192 |
+
position: relative;
|
| 193 |
+
top: 1px;
|
| 194 |
+
}
|
| 195 |
+
/**
|
| 196 |
+
* SOCIAL NETWORKS
|
| 197 |
+
**/
|
| 198 |
+
|
| 199 |
+
.wrap .social {
|
| 200 |
+
margin: 0 0 70px;
|
| 201 |
+
}
|
| 202 |
+
.wrap .social a {
|
| 203 |
+
width: 22px;
|
| 204 |
+
height: 22px;
|
| 205 |
+
margin: 0 0 20px 55px;
|
| 206 |
+
background-image: url('../images/icn_sprite.png');
|
| 207 |
+
background-repeat: no-repeat;
|
| 208 |
+
display: inline-block;
|
| 209 |
+
text-indent: -999em;
|
| 210 |
+
}
|
| 211 |
+
.wrap .social a:first-of-type {
|
| 212 |
+
margin: 0 0 20px 0;
|
| 213 |
+
}
|
| 214 |
+
.wrap .social .git {
|
| 215 |
+
background-position: 0 0;
|
| 216 |
+
}
|
| 217 |
+
.wrap .social .fb {
|
| 218 |
+
background-position: -240px 0;
|
| 219 |
+
}
|
| 220 |
+
.wrap .social .tw {
|
| 221 |
+
background-position: -162px 0px;
|
| 222 |
+
}
|
| 223 |
+
.wrap .social .rss {
|
| 224 |
+
background-position: -402px 0;
|
| 225 |
+
}
|
| 226 |
+
.wrap .social .mail {
|
| 227 |
+
background-position: -560px 0;
|
| 228 |
+
}
|
| 229 |
+
.wrap .social .pin {
|
| 230 |
+
background-position: -322px 0;
|
| 231 |
+
}
|
| 232 |
+
.wrap .social .dribbble {
|
| 233 |
+
background-position: -82px 0;
|
| 234 |
+
}
|
| 235 |
+
.wrap .social .gplus {
|
| 236 |
+
background-position: -486px 0;
|
| 237 |
+
}
|
| 238 |
+
.wrap .social .linkedin {
|
| 239 |
+
background-position: -633px 0;
|
| 240 |
+
}
|
| 241 |
+
/**
|
| 242 |
+
* CONTACT FORM
|
| 243 |
+
**/
|
| 244 |
+
|
| 245 |
+
.wrap .contact_us {
|
| 246 |
+
color: #000;
|
| 247 |
+
border: 3px solid #000;
|
| 248 |
+
font-size: 18px;
|
| 249 |
+
padding: 15px 40px;
|
| 250 |
+
display: inline-block;
|
| 251 |
+
margin: 0 0 70px;
|
| 252 |
+
}
|
| 253 |
+
.wrap .contact_us:hover {
|
| 254 |
+
background: #000;
|
| 255 |
+
color: #fff;
|
| 256 |
+
}
|
| 257 |
+
.contact_us {
|
| 258 |
+
text-decoration: none;
|
| 259 |
+
}
|
| 260 |
+
.contact {
|
| 261 |
+
position: fixed;
|
| 262 |
+
display: none;
|
| 263 |
+
top: 0;
|
| 264 |
+
bottom: 0;
|
| 265 |
+
left: 0;
|
| 266 |
+
right: 0;
|
| 267 |
+
background: rgba(27, 31, 35, 0.95);
|
| 268 |
+
}
|
| 269 |
+
.contact label.error {
|
| 270 |
+
color: red;
|
| 271 |
+
float: left;
|
| 272 |
+
font-size: 11px;
|
| 273 |
+
padding-top: 10px;
|
| 274 |
+
}
|
| 275 |
+
.contact .form {
|
| 276 |
+
width: 520px;
|
| 277 |
+
text-align: center;
|
| 278 |
+
padding: 40px;
|
| 279 |
+
background: #f9f9f9;
|
| 280 |
+
box-sizing: border-box;
|
| 281 |
+
margin: 100px auto;
|
| 282 |
+
transition: 0.2s transform ease-in-out;
|
| 283 |
+
}
|
| 284 |
+
.contact .form input, .contact .form textarea {
|
| 285 |
+
padding: 15px 20px;
|
| 286 |
+
margin: 0;
|
| 287 |
+
outline: 0;
|
| 288 |
+
width: 100%;
|
| 289 |
+
background: #f9f9f9;
|
| 290 |
+
border: 3px solid #e0e0e0;
|
| 291 |
+
font-size: 18px;
|
| 292 |
+
font-family: Helvetica Neue, Arial, sans-serif;
|
| 293 |
+
box-sizing: border-box;
|
| 294 |
+
resize: none;
|
| 295 |
+
}
|
| 296 |
+
.contact .form textarea {
|
| 297 |
+
height: 175px;
|
| 298 |
+
padding: 20px;
|
| 299 |
+
}
|
| 300 |
+
.contact .form input[type="text"]::-webkit-input-placeholder, .contact .form textarea::-webkit-input-placeholder {
|
| 301 |
+
color: #dadada;
|
| 302 |
+
}
|
| 303 |
+
.contact .form input[type="text"]::-moz-input-placeholder, .contact .form textarea::-moz-input-placeholder {
|
| 304 |
+
color: #dadada;
|
| 305 |
+
}
|
| 306 |
+
.contact .form input[type="text"]::-ms-input-placeholder, .contact .form textarea::-ms-input-placeholder {
|
| 307 |
+
color: #dadada;
|
| 308 |
+
}
|
| 309 |
+
.contact .form .col {
|
| 310 |
+
width: 205px;
|
| 311 |
+
margin: 0 0 30px;
|
| 312 |
+
display: inline-block;
|
| 313 |
+
float: left;
|
| 314 |
+
}
|
| 315 |
+
.contact .form .col.last {
|
| 316 |
+
float: right;
|
| 317 |
+
}
|
| 318 |
+
.contact .form .submit {
|
| 319 |
+
margin: 30px 0 0;
|
| 320 |
+
text-align: center;
|
| 321 |
+
clear: left;
|
| 322 |
+
}
|
| 323 |
+
.contact .form .submit input {
|
| 324 |
+
cursor: pointer;
|
| 325 |
+
display: inline-block;
|
| 326 |
+
background: #1b1f24;
|
| 327 |
+
color: #fff;
|
| 328 |
+
border: 0;
|
| 329 |
+
padding: 20px 45px;
|
| 330 |
+
width: auto;
|
| 331 |
+
}
|
| 332 |
+
/*======= MOVE ANIMATION =======*/
|
| 333 |
+
|
| 334 |
+
.contact .move_top {
|
| 335 |
+
transform: perspective(1000px) translateY(-200px);
|
| 336 |
+
}
|
| 337 |
+
.contact .move_bottom {
|
| 338 |
+
transform: perspective(1000px) translateY(0);
|
| 339 |
+
}
|
| 340 |
+
/*======= ZOOM ANIMATION =======*/
|
| 341 |
+
|
| 342 |
+
.contact .zoom {
|
| 343 |
+
transform: perspective(1000px) scale(0.5);
|
| 344 |
+
transition: 0.3s transform ease-in-out;
|
| 345 |
+
}
|
| 346 |
+
.contact .zoomed {
|
| 347 |
+
transform: perspective(1000px) scale(1);
|
| 348 |
+
}
|
| 349 |
+
/*======= FOLD ANIMATION =======*/
|
| 350 |
+
|
| 351 |
+
.contact .fold {
|
| 352 |
+
transform: perspective(1000px) rotateY(90deg);
|
| 353 |
+
}
|
| 354 |
+
.contact .unfold {
|
| 355 |
+
transform: perspective(1000px) rotateY(0);
|
| 356 |
+
}
|
| 357 |
+
/**
|
| 358 |
+
* EDITS WHEN HAVE BACKGROUND CLASS
|
| 359 |
+
**/
|
| 360 |
+
|
| 361 |
+
.background {
|
| 362 |
+
background: url('../images/backgrounds/bg1.jpg') no-repeat center top fixed;
|
| 363 |
+
background-size: cover;
|
| 364 |
+
}
|
| 365 |
+
.background .countdown span {
|
| 366 |
+
color: #fff;
|
| 367 |
+
}
|
| 368 |
+
.background form.subscribe_form input[type="submit"] {
|
| 369 |
+
color: #000;
|
| 370 |
+
background: #fff;
|
| 371 |
+
}
|
| 372 |
+
.background form.subscribe_form input[type="text"] {
|
| 373 |
+
background: transparent;
|
| 374 |
+
color: #fff;
|
| 375 |
+
}
|
| 376 |
+
.background form.subscribe_form input.error[type="text"] {
|
| 377 |
+
color: red;
|
| 378 |
+
}
|
| 379 |
+
.background form.subscribe_form input[type="text"]::-webkit-input-placeholder {
|
| 380 |
+
color: #fff;
|
| 381 |
+
}
|
| 382 |
+
.background form.subscribe_form input[type="text"]::-moz-input-placeholder {
|
| 383 |
+
color: #fff;
|
| 384 |
+
}
|
| 385 |
+
.background form.subscribe_form input[type="text"]::-ms-input-placeholder {
|
| 386 |
+
color: #fff;
|
| 387 |
+
}
|
| 388 |
+
.background .contact_us {
|
| 389 |
+
color: #fff;
|
| 390 |
+
border-color: #fff;
|
| 391 |
+
}
|
| 392 |
+
/**
|
| 393 |
+
* MEDIA QUERIES (RESPONSIVE)
|
| 394 |
+
**/
|
| 395 |
+
|
| 396 |
+
@media only screen and (max-width: 700px) {
|
| 397 |
+
.wrap form.login_form {
|
| 398 |
+
width: 80%;
|
| 399 |
+
margin: 15px auto 0;
|
| 400 |
+
}
|
| 401 |
+
.wrap form.login_form input {
|
| 402 |
+
width: 49%;
|
| 403 |
+
margin: 0 2% 0 0;
|
| 404 |
+
}
|
| 405 |
+
.wrap form.login_form input[type="password"] {
|
| 406 |
+
margin: 0;
|
| 407 |
+
}
|
| 408 |
+
.wrap form.login_form input[type="submit"] {
|
| 409 |
+
width: 100%;
|
| 410 |
+
margin: 15px 0 0;
|
| 411 |
+
}
|
| 412 |
+
}
|
| 413 |
+
@media only screen and (max-width: 550px) {
|
| 414 |
+
.wrap {
|
| 415 |
+
width: 90%;
|
| 416 |
+
margin: 50px auto 0;
|
| 417 |
+
}
|
| 418 |
+
.wrap h1 {
|
| 419 |
+
margin: 0 0 50px;
|
| 420 |
+
}
|
| 421 |
+
.wrap h2, .wrap h3 {
|
| 422 |
+
font-size: 18px;
|
| 423 |
+
}
|
| 424 |
+
.wrap form.subscribe_form { // .wrap form
|
| 425 |
+
box-sizing: border-box;
|
| 426 |
+
width: 100%;
|
| 427 |
+
}
|
| 428 |
+
.wrap form.subscribe_form input { // .wrap form
|
| 429 |
+
box-sizing: border-box;
|
| 430 |
+
}
|
| 431 |
+
.wrap form input[type="text"], .wrap form input[type="submit"] {
|
| 432 |
+
width: 100%;
|
| 433 |
+
}
|
| 434 |
+
.wrap .contact_us {
|
| 435 |
+
margin: 0 0 50px;
|
| 436 |
+
}
|
| 437 |
+
.contact .form {
|
| 438 |
+
width: 90%;
|
| 439 |
+
}
|
| 440 |
+
.contact .form p.col {
|
| 441 |
+
width: 100%;
|
| 442 |
+
}
|
| 443 |
+
.contact .form input[type="submit"] {
|
| 444 |
+
width: 100%;
|
| 445 |
+
}
|
| 446 |
+
.wrap form.login_form {
|
| 447 |
+
width: 90%;
|
| 448 |
+
}
|
| 449 |
+
.wrap form.login_form input {
|
| 450 |
+
width: 100%;
|
| 451 |
+
margin: 0 0 10px 0;
|
| 452 |
+
}
|
| 453 |
+
.wrap form.login_form input[type="submit"] {
|
| 454 |
+
margin: 10px 0 0;
|
| 455 |
+
}
|
| 456 |
+
ul, ol {
|
| 457 |
+
width: 80%;
|
| 458 |
+
}
|
| 459 |
+
blockquote, q {
|
| 460 |
+
width: 70%;
|
| 461 |
+
}
|
| 462 |
+
}
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline;text-decoration:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{display:block;width:500px;margin:0 auto;text-align:left;position:relative;font-style:italic}blockquote:after,blockquote:before,q:after,q:before{content:'"';content:none}button,input{-webkit-appearance:none;border-radius:0}table{border-collapse:collapse;border-spacing:0}em,i{font-style:italic}del{text-decoration:line-through}b,strong{font-weight:700}ol{width:600px;margin:0 auto;text-align:left}ol li{list-style-type:decimal}ul{width:600px;margin:0 auto;text-align:left}ul li{list-style:disc}a{color:inherit;text-decoration:underline}body,html{min-height:100%}body{background-color:#fff;color:#1b1f23;font-family:Helvetica Neue,Arial,sans-serif}.wrap{width:605px;margin:100px auto 0;text-align:center}.wrap h1{font-size:30px;font-weight:700;margin:0 0 90px}.wrap h2{font-size:24px;font-weight:400;line-height:45px;margin:0 0 80px}.wrap h3{font-size:24px;font-weight:400px;margin:0 0 45px}.wrap .author_link{color:#616161;margin:0 0 50px}.wrap .author_link a{color:#000}.wrap .countdown{margin:0 0 85px}.wrap .countdown span{font-size:30px}.wrap form.subscribe_form{width:465px;margin:0 0 75px;display:inline-block;border:3px solid #e0e0e0;box-sizing:border-box}.wrap form.subscribe_form input{margin:0;outline:0;border:0;float:left;font-size:18px;padding:20px 25px;box-sizing:content-box}.wrap form.subscribe_form input[type=text]{width:245px}.wrap form.subscribe_form input[type=submit]{background:#000;color:#fff;float:right;cursor:pointer;padding:20px 30px;border-left:3px solid #e0e0e0}.wrap form.subscribe_form input[type=submit]:hover{background:#fff;color:#000;border-left:3px solid #e0e0e0}.wrap form.subscribe_form input[type=submit]:active{background:#1e1e1e;color:#fff}.wrap form.subscribe_form .error{color:red}.wrap form.subscribe_form label.error{display:none!important}.wrap form.login_form{width:100%;margin:15px 0 0}.wrap form.login_form input{display:inline-block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:3px solid #E2E2E2;font-family:Helvetica Neue,Arial,sans-serif;font-size:16px;margin:0 10px 0 0;outline:0;padding:15px}.wrap form.login_form input[type=submit]{background:#000;color:#fff;margin:0;border-color:#000;font-weight:700;padding:15px 30px;cursor:pointer}.wrap form.login_form input[type=submit]:active{position:relative;top:1px}.wrap .social{margin:0 0 70px}.wrap .social a{width:22px;height:22px;margin:0 0 20px 55px;background-image:url(../images/icn_sprite.png);background-repeat:no-repeat;display:inline-block;text-indent:-999em}.wrap .social a:first-of-type{margin:0 0 20px}.wrap .social .git{background-position:0 0}.wrap .social .fb{background-position:-240px 0}.wrap .social .tw{background-position:-162px 0}.wrap .social .rss{background-position:-402px 0}.wrap .social .mail{background-position:-560px 0}.wrap .social .pin{background-position:-322px 0}.wrap .social .dribbble{background-position:-82px 0}.wrap .social .gplus{background-position:-486px 0}.wrap .social .linkedin{background-position:-633px 0}.wrap .contact_us{color:#000;border:3px solid #000;font-size:18px;padding:15px 40px;display:inline-block;margin:0 0 70px}.wrap .contact_us:hover{background:#000;color:#fff}.contact_us{text-decoration:none}.contact{position:fixed;display:none;top:0;bottom:0;left:0;right:0;background:rgba(27,31,35,.95)}.contact label.error{color:red;float:left;font-size:11px;padding-top:10px}.contact .form{width:520px;text-align:center;padding:40px;background:#f9f9f9;box-sizing:border-box;margin:100px auto;transition:.2s transform ease-in-out}.contact .form input,.contact .form textarea{padding:15px 20px;margin:0;outline:0;width:100%;background:#f9f9f9;border:3px solid #e0e0e0;font-size:18px;font-family:Helvetica Neue,Arial,sans-serif;box-sizing:border-box;resize:none}.contact .form textarea{height:175px;padding:20px}.contact .form input[type=text]::-webkit-input-placeholder,.contact .form textarea::-webkit-input-placeholder{color:#dadada}.contact .form input[type=text]::-moz-input-placeholder,.contact .form textarea::-moz-input-placeholder{color:#dadada}.contact .form input[type=text]::-ms-input-placeholder,.contact .form textarea::-ms-input-placeholder{color:#dadada}.contact .form .col{width:205px;margin:0 0 30px;display:inline-block;float:left}.contact .form .col.last{float:right}.contact .form .submit{margin:30px 0 0;text-align:center;clear:left}.contact .form .submit input{cursor:pointer;display:inline-block;background:#1b1f24;color:#fff;border:0;padding:20px 45px;width:auto}.contact .move_top{transform:perspective(1000px) translateY(-200px)}.contact .move_bottom{transform:perspective(1000px) translateY(0)}.contact .zoom{transform:perspective(1000px) scale(0.5);transition:.3s transform ease-in-out}.contact .zoomed{transform:perspective(1000px) scale(1)}.contact .fold{transform:perspective(1000px) rotateY(90deg)}.contact .unfold{transform:perspective(1000px) rotateY(0)}.background{background:url(../images/backgrounds/bg1.jpg) center top/cover no-repeat fixed}.background .countdown span{color:#fff}.background form.subscribe_form input[type=submit]{color:#000;background:#fff}.background form.subscribe_form input[type=text]{background:0 0;color:#fff}.background form.subscribe_form input.error[type=text]{color:red}.background form.subscribe_form input[type=text]::-webkit-input-placeholder{color:#fff}.background form.subscribe_form input[type=text]::-moz-input-placeholder{color:#fff}.background form.subscribe_form input[type=text]::-ms-input-placeholder{color:#fff}.background .contact_us{color:#fff;border-color:#fff}@media only screen and (max-width:700px){.wrap form.login_form{width:80%;margin:15px auto 0}.wrap form.login_form input{width:49%;margin:0 2% 0 0}.wrap form.login_form input[type=password]{margin:0}.wrap form.login_form input[type=submit]{width:100%;margin:15px 0 0}}@media only screen and (max-width:550px){.wrap{width:90%;margin:50px auto 0}.wrap h1{margin:0 0 50px}.wrap h2,.wrap h3{font-size:18px}.wrap form.subscribe_form{// .wrap form box-sizing:border-box;width:100%}.wrap form.subscribe_form input{// .wrap form box-sizing:border-box}.wrap form input[type=submit],.wrap form input[type=text]{width:100%}.wrap .contact_us{margin:0 0 50px}.contact .form{width:90%}.contact .form input[type=submit],.contact .form p.col{width:100%}.wrap form.login_form{width:90%}.wrap form.login_form input{width:100%;margin:0 0 10px}.wrap form.login_form input[type=submit]{margin:10px 0 0}ol,ul{width:80%}blockquote,q{width:70%}}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -0,0 +1,1284 @@
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
/*!
|
| 2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
| 3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
| 4 |
+
|
| 5 |
+
Version 1.5.1
|
| 6 |
+
Full source at https://github.com/harvesthq/chosen
|
| 7 |
+
Copyright (c) 2011-2016 Harvest http://getharvest.com
|
| 8 |
+
|
| 9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
| 10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
(function() {
|
| 14 |
+
var $, AbstractChosen, Chosen, SelectParser, _ref,
|
| 15 |
+
__hasProp = {}.hasOwnProperty,
|
| 16 |
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
| 17 |
+
|
| 18 |
+
SelectParser = (function() {
|
| 19 |
+
function SelectParser() {
|
| 20 |
+
this.options_index = 0;
|
| 21 |
+
this.parsed = [];
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
SelectParser.prototype.add_node = function(child) {
|
| 25 |
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
| 26 |
+
return this.add_group(child);
|
| 27 |
+
} else {
|
| 28 |
+
return this.add_option(child);
|
| 29 |
+
}
|
| 30 |
+
};
|
| 31 |
+
|
| 32 |
+
SelectParser.prototype.add_group = function(group) {
|
| 33 |
+
var group_position, option, _i, _len, _ref, _results;
|
| 34 |
+
group_position = this.parsed.length;
|
| 35 |
+
this.parsed.push({
|
| 36 |
+
array_index: group_position,
|
| 37 |
+
group: true,
|
| 38 |
+
label: this.escapeExpression(group.label),
|
| 39 |
+
title: group.title ? group.title : void 0,
|
| 40 |
+
children: 0,
|
| 41 |
+
disabled: group.disabled,
|
| 42 |
+
classes: group.className
|
| 43 |
+
});
|
| 44 |
+
_ref = group.childNodes;
|
| 45 |
+
_results = [];
|
| 46 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 47 |
+
option = _ref[_i];
|
| 48 |
+
_results.push(this.add_option(option, group_position, group.disabled));
|
| 49 |
+
}
|
| 50 |
+
return _results;
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
| 54 |
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
| 55 |
+
if (option.text !== "") {
|
| 56 |
+
if (group_position != null) {
|
| 57 |
+
this.parsed[group_position].children += 1;
|
| 58 |
+
}
|
| 59 |
+
this.parsed.push({
|
| 60 |
+
array_index: this.parsed.length,
|
| 61 |
+
options_index: this.options_index,
|
| 62 |
+
value: option.value,
|
| 63 |
+
text: option.text,
|
| 64 |
+
html: option.innerHTML,
|
| 65 |
+
title: option.title ? option.title : void 0,
|
| 66 |
+
selected: option.selected,
|
| 67 |
+
disabled: group_disabled === true ? group_disabled : option.disabled,
|
| 68 |
+
group_array_index: group_position,
|
| 69 |
+
group_label: group_position != null ? this.parsed[group_position].label : null,
|
| 70 |
+
classes: option.className,
|
| 71 |
+
style: option.style.cssText
|
| 72 |
+
});
|
| 73 |
+
} else {
|
| 74 |
+
this.parsed.push({
|
| 75 |
+
array_index: this.parsed.length,
|
| 76 |
+
options_index: this.options_index,
|
| 77 |
+
empty: true
|
| 78 |
+
});
|
| 79 |
+
}
|
| 80 |
+
return this.options_index += 1;
|
| 81 |
+
}
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
SelectParser.prototype.escapeExpression = function(text) {
|
| 85 |
+
var map, unsafe_chars;
|
| 86 |
+
if ((text == null) || text === false) {
|
| 87 |
+
return "";
|
| 88 |
+
}
|
| 89 |
+
if (!/[\&\<\>\"\'\`]/.test(text)) {
|
| 90 |
+
return text;
|
| 91 |
+
}
|
| 92 |
+
map = {
|
| 93 |
+
"<": "<",
|
| 94 |
+
">": ">",
|
| 95 |
+
'"': """,
|
| 96 |
+
"'": "'",
|
| 97 |
+
"`": "`"
|
| 98 |
+
};
|
| 99 |
+
unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
|
| 100 |
+
return text.replace(unsafe_chars, function(chr) {
|
| 101 |
+
return map[chr] || "&";
|
| 102 |
+
});
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
return SelectParser;
|
| 106 |
+
|
| 107 |
+
})();
|
| 108 |
+
|
| 109 |
+
SelectParser.select_to_array = function(select) {
|
| 110 |
+
var child, parser, _i, _len, _ref;
|
| 111 |
+
parser = new SelectParser();
|
| 112 |
+
_ref = select.childNodes;
|
| 113 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 114 |
+
child = _ref[_i];
|
| 115 |
+
parser.add_node(child);
|
| 116 |
+
}
|
| 117 |
+
return parser.parsed;
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
AbstractChosen = (function() {
|
| 121 |
+
function AbstractChosen(form_field, options) {
|
| 122 |
+
this.form_field = form_field;
|
| 123 |
+
this.options = options != null ? options : {};
|
| 124 |
+
if (!AbstractChosen.browser_is_supported()) {
|
| 125 |
+
return;
|
| 126 |
+
}
|
| 127 |
+
this.is_multiple = this.form_field.multiple;
|
| 128 |
+
this.set_default_text();
|
| 129 |
+
this.set_default_values();
|
| 130 |
+
this.setup();
|
| 131 |
+
this.set_up_html();
|
| 132 |
+
this.register_observers();
|
| 133 |
+
this.on_ready();
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
AbstractChosen.prototype.set_default_values = function() {
|
| 137 |
+
var _this = this;
|
| 138 |
+
this.click_test_action = function(evt) {
|
| 139 |
+
return _this.test_active_click(evt);
|
| 140 |
+
};
|
| 141 |
+
this.activate_action = function(evt) {
|
| 142 |
+
return _this.activate_field(evt);
|
| 143 |
+
};
|
| 144 |
+
this.active_field = false;
|
| 145 |
+
this.mouse_on_container = false;
|
| 146 |
+
this.results_showing = false;
|
| 147 |
+
this.result_highlighted = null;
|
| 148 |
+
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
| 149 |
+
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
| 150 |
+
this.disable_search = this.options.disable_search || false;
|
| 151 |
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
| 152 |
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
| 153 |
+
this.search_contains = this.options.search_contains || false;
|
| 154 |
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
| 155 |
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
| 156 |
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
| 157 |
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
| 158 |
+
this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
| 159 |
+
this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
|
| 160 |
+
return this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
|
| 161 |
+
};
|
| 162 |
+
|
| 163 |
+
AbstractChosen.prototype.set_default_text = function() {
|
| 164 |
+
if (this.form_field.getAttribute("data-placeholder")) {
|
| 165 |
+
this.default_text = this.form_field.getAttribute("data-placeholder");
|
| 166 |
+
} else if (this.is_multiple) {
|
| 167 |
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
| 168 |
+
} else {
|
| 169 |
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
| 170 |
+
}
|
| 171 |
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
AbstractChosen.prototype.choice_label = function(item) {
|
| 175 |
+
if (this.include_group_label_in_selected && (item.group_label != null)) {
|
| 176 |
+
return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
|
| 177 |
+
} else {
|
| 178 |
+
return item.html;
|
| 179 |
+
}
|
| 180 |
+
};
|
| 181 |
+
|
| 182 |
+
AbstractChosen.prototype.mouse_enter = function() {
|
| 183 |
+
return this.mouse_on_container = true;
|
| 184 |
+
};
|
| 185 |
+
|
| 186 |
+
AbstractChosen.prototype.mouse_leave = function() {
|
| 187 |
+
return this.mouse_on_container = false;
|
| 188 |
+
};
|
| 189 |
+
|
| 190 |
+
AbstractChosen.prototype.input_focus = function(evt) {
|
| 191 |
+
var _this = this;
|
| 192 |
+
if (this.is_multiple) {
|
| 193 |
+
if (!this.active_field) {
|
| 194 |
+
return setTimeout((function() {
|
| 195 |
+
return _this.container_mousedown();
|
| 196 |
+
}), 50);
|
| 197 |
+
}
|
| 198 |
+
} else {
|
| 199 |
+
if (!this.active_field) {
|
| 200 |
+
return this.activate_field();
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
};
|
| 204 |
+
|
| 205 |
+
AbstractChosen.prototype.input_blur = function(evt) {
|
| 206 |
+
var _this = this;
|
| 207 |
+
if (!this.mouse_on_container) {
|
| 208 |
+
this.active_field = false;
|
| 209 |
+
return setTimeout((function() {
|
| 210 |
+
return _this.blur_test();
|
| 211 |
+
}), 100);
|
| 212 |
+
}
|
| 213 |
+
};
|
| 214 |
+
|
| 215 |
+
AbstractChosen.prototype.results_option_build = function(options) {
|
| 216 |
+
var content, data, data_content, shown_results, _i, _len, _ref;
|
| 217 |
+
content = '';
|
| 218 |
+
shown_results = 0;
|
| 219 |
+
_ref = this.results_data;
|
| 220 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 221 |
+
data = _ref[_i];
|
| 222 |
+
data_content = '';
|
| 223 |
+
if (data.group) {
|
| 224 |
+
data_content = this.result_add_group(data);
|
| 225 |
+
} else {
|
| 226 |
+
data_content = this.result_add_option(data);
|
| 227 |
+
}
|
| 228 |
+
if (data_content !== '') {
|
| 229 |
+
shown_results++;
|
| 230 |
+
content += data_content;
|
| 231 |
+
}
|
| 232 |
+
if (options != null ? options.first : void 0) {
|
| 233 |
+
if (data.selected && this.is_multiple) {
|
| 234 |
+
this.choice_build(data);
|
| 235 |
+
} else if (data.selected && !this.is_multiple) {
|
| 236 |
+
this.single_set_selected_text(this.choice_label(data));
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
if (shown_results >= this.max_shown_results) {
|
| 240 |
+
break;
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
return content;
|
| 244 |
+
};
|
| 245 |
+
|
| 246 |
+
AbstractChosen.prototype.result_add_option = function(option) {
|
| 247 |
+
var classes, option_el;
|
| 248 |
+
if (!option.search_match) {
|
| 249 |
+
return '';
|
| 250 |
+
}
|
| 251 |
+
if (!this.include_option_in_results(option)) {
|
| 252 |
+
return '';
|
| 253 |
+
}
|
| 254 |
+
classes = [];
|
| 255 |
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
| 256 |
+
classes.push("active-result");
|
| 257 |
+
}
|
| 258 |
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
| 259 |
+
classes.push("disabled-result");
|
| 260 |
+
}
|
| 261 |
+
if (option.selected) {
|
| 262 |
+
classes.push("result-selected");
|
| 263 |
+
}
|
| 264 |
+
if (option.group_array_index != null) {
|
| 265 |
+
classes.push("group-option");
|
| 266 |
+
}
|
| 267 |
+
if (option.classes !== "") {
|
| 268 |
+
classes.push(option.classes);
|
| 269 |
+
}
|
| 270 |
+
option_el = document.createElement("li");
|
| 271 |
+
option_el.className = classes.join(" ");
|
| 272 |
+
option_el.style.cssText = option.style;
|
| 273 |
+
option_el.setAttribute("data-option-array-index", option.array_index);
|
| 274 |
+
option_el.innerHTML = option.search_text;
|
| 275 |
+
if (option.title) {
|
| 276 |
+
option_el.title = option.title;
|
| 277 |
+
}
|
| 278 |
+
return this.outerHTML(option_el);
|
| 279 |
+
};
|
| 280 |
+
|
| 281 |
+
AbstractChosen.prototype.result_add_group = function(group) {
|
| 282 |
+
var classes, group_el;
|
| 283 |
+
if (!(group.search_match || group.group_match)) {
|
| 284 |
+
return '';
|
| 285 |
+
}
|
| 286 |
+
if (!(group.active_options > 0)) {
|
| 287 |
+
return '';
|
| 288 |
+
}
|
| 289 |
+
classes = [];
|
| 290 |
+
classes.push("group-result");
|
| 291 |
+
if (group.classes) {
|
| 292 |
+
classes.push(group.classes);
|
| 293 |
+
}
|
| 294 |
+
group_el = document.createElement("li");
|
| 295 |
+
group_el.className = classes.join(" ");
|
| 296 |
+
group_el.innerHTML = group.search_text;
|
| 297 |
+
if (group.title) {
|
| 298 |
+
group_el.title = group.title;
|
| 299 |
+
}
|
| 300 |
+
return this.outerHTML(group_el);
|
| 301 |
+
};
|
| 302 |
+
|
| 303 |
+
AbstractChosen.prototype.results_update_field = function() {
|
| 304 |
+
this.set_default_text();
|
| 305 |
+
if (!this.is_multiple) {
|
| 306 |
+
this.results_reset_cleanup();
|
| 307 |
+
}
|
| 308 |
+
this.result_clear_highlight();
|
| 309 |
+
this.results_build();
|
| 310 |
+
if (this.results_showing) {
|
| 311 |
+
return this.winnow_results();
|
| 312 |
+
}
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
AbstractChosen.prototype.reset_single_select_options = function() {
|
| 316 |
+
var result, _i, _len, _ref, _results;
|
| 317 |
+
_ref = this.results_data;
|
| 318 |
+
_results = [];
|
| 319 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 320 |
+
result = _ref[_i];
|
| 321 |
+
if (result.selected) {
|
| 322 |
+
_results.push(result.selected = false);
|
| 323 |
+
} else {
|
| 324 |
+
_results.push(void 0);
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
return _results;
|
| 328 |
+
};
|
| 329 |
+
|
| 330 |
+
AbstractChosen.prototype.results_toggle = function() {
|
| 331 |
+
if (this.results_showing) {
|
| 332 |
+
return this.results_hide();
|
| 333 |
+
} else {
|
| 334 |
+
return this.results_show();
|
| 335 |
+
}
|
| 336 |
+
};
|
| 337 |
+
|
| 338 |
+
AbstractChosen.prototype.results_search = function(evt) {
|
| 339 |
+
if (this.results_showing) {
|
| 340 |
+
return this.winnow_results();
|
| 341 |
+
} else {
|
| 342 |
+
return this.results_show();
|
| 343 |
+
}
|
| 344 |
+
};
|
| 345 |
+
|
| 346 |
+
AbstractChosen.prototype.winnow_results = function() {
|
| 347 |
+
var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
|
| 348 |
+
this.no_results_clear();
|
| 349 |
+
results = 0;
|
| 350 |
+
searchText = this.get_search_text();
|
| 351 |
+
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
| 352 |
+
zregex = new RegExp(escapedSearchText, 'i');
|
| 353 |
+
regex = this.get_search_regex(escapedSearchText);
|
| 354 |
+
_ref = this.results_data;
|
| 355 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 356 |
+
option = _ref[_i];
|
| 357 |
+
option.search_match = false;
|
| 358 |
+
results_group = null;
|
| 359 |
+
if (this.include_option_in_results(option)) {
|
| 360 |
+
if (option.group) {
|
| 361 |
+
option.group_match = false;
|
| 362 |
+
option.active_options = 0;
|
| 363 |
+
}
|
| 364 |
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
| 365 |
+
results_group = this.results_data[option.group_array_index];
|
| 366 |
+
if (results_group.active_options === 0 && results_group.search_match) {
|
| 367 |
+
results += 1;
|
| 368 |
+
}
|
| 369 |
+
results_group.active_options += 1;
|
| 370 |
+
}
|
| 371 |
+
option.search_text = option.group ? option.label : option.html;
|
| 372 |
+
if (!(option.group && !this.group_search)) {
|
| 373 |
+
option.search_match = this.search_string_match(option.search_text, regex);
|
| 374 |
+
if (option.search_match && !option.group) {
|
| 375 |
+
results += 1;
|
| 376 |
+
}
|
| 377 |
+
if (option.search_match) {
|
| 378 |
+
if (searchText.length) {
|
| 379 |
+
startpos = option.search_text.search(zregex);
|
| 380 |
+
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
|
| 381 |
+
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
| 382 |
+
}
|
| 383 |
+
if (results_group != null) {
|
| 384 |
+
results_group.group_match = true;
|
| 385 |
+
}
|
| 386 |
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
| 387 |
+
option.search_match = true;
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
}
|
| 391 |
+
}
|
| 392 |
+
this.result_clear_highlight();
|
| 393 |
+
if (results < 1 && searchText.length) {
|
| 394 |
+
this.update_results_content("");
|
| 395 |
+
return this.no_results(searchText);
|
| 396 |
+
} else {
|
| 397 |
+
this.update_results_content(this.results_option_build());
|
| 398 |
+
return this.winnow_results_set_highlight();
|
| 399 |
+
}
|
| 400 |
+
};
|
| 401 |
+
|
| 402 |
+
AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
|
| 403 |
+
var regex_anchor;
|
| 404 |
+
regex_anchor = this.search_contains ? "" : "^";
|
| 405 |
+
return new RegExp(regex_anchor + escaped_search_string, 'i');
|
| 406 |
+
};
|
| 407 |
+
|
| 408 |
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
| 409 |
+
var part, parts, _i, _len;
|
| 410 |
+
if (regex.test(search_string)) {
|
| 411 |
+
return true;
|
| 412 |
+
} else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
|
| 413 |
+
parts = search_string.replace(/\[|\]/g, "").split(" ");
|
| 414 |
+
if (parts.length) {
|
| 415 |
+
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
| 416 |
+
part = parts[_i];
|
| 417 |
+
if (regex.test(part)) {
|
| 418 |
+
return true;
|
| 419 |
+
}
|
| 420 |
+
}
|
| 421 |
+
}
|
| 422 |
+
}
|
| 423 |
+
};
|
| 424 |
+
|
| 425 |
+
AbstractChosen.prototype.choices_count = function() {
|
| 426 |
+
var option, _i, _len, _ref;
|
| 427 |
+
if (this.selected_option_count != null) {
|
| 428 |
+
return this.selected_option_count;
|
| 429 |
+
}
|
| 430 |
+
this.selected_option_count = 0;
|
| 431 |
+
_ref = this.form_field.options;
|
| 432 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
| 433 |
+
option = _ref[_i];
|
| 434 |
+
if (option.selected) {
|
| 435 |
+
this.selected_option_count += 1;
|
| 436 |
+
}
|
| 437 |
+
}
|
| 438 |
+
return this.selected_option_count;
|
| 439 |
+
};
|
| 440 |
+
|
| 441 |
+
AbstractChosen.prototype.choices_click = function(evt) {
|
| 442 |
+
evt.preventDefault();
|
| 443 |
+
if (!(this.results_showing || this.is_disabled)) {
|
| 444 |
+
return this.results_show();
|
| 445 |
+
}
|
| 446 |
+
};
|
| 447 |
+
|
| 448 |
+
AbstractChosen.prototype.keyup_checker = function(evt) {
|
| 449 |
+
var stroke, _ref;
|
| 450 |
+
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
| 451 |
+
this.search_field_scale();
|
| 452 |
+
switch (stroke) {
|
| 453 |
+
case 8:
|
| 454 |
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
| 455 |
+
return this.keydown_backstroke();
|
| 456 |
+
} else if (!this.pending_backstroke) {
|
| 457 |
+
this.result_clear_highlight();
|
| 458 |
+
return this.results_search();
|
| 459 |
+
}
|
| 460 |
+
break;
|
| 461 |
+
case 13:
|
| 462 |
+
evt.preventDefault();
|
| 463 |
+
if (this.results_showing) {
|
| 464 |
+
return this.result_select(evt);
|
| 465 |
+
}
|
| 466 |
+
break;
|
| 467 |
+
case 27:
|
| 468 |
+
if (this.results_showing) {
|
| 469 |
+
this.results_hide();
|
| 470 |
+
}
|
| 471 |
+
return true;
|
| 472 |
+
case 9:
|
| 473 |
+
case 38:
|
| 474 |
+
case 40:
|
| 475 |
+
case 16:
|
| 476 |
+
case 91:
|
| 477 |
+
case 17:
|
| 478 |
+
case 18:
|
| 479 |
+
break;
|
| 480 |
+
default:
|
| 481 |
+
return this.results_search();
|
| 482 |
+
}
|
| 483 |
+
};
|
| 484 |
+
|
| 485 |
+
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
| 486 |
+
var _this = this;
|
| 487 |
+
return setTimeout((function() {
|
| 488 |
+
return _this.results_search();
|
| 489 |
+
}), 50);
|
| 490 |
+
};
|
| 491 |
+
|
| 492 |
+
AbstractChosen.prototype.container_width = function() {
|
| 493 |
+
if (this.options.width != null) {
|
| 494 |
+
return this.options.width;
|
| 495 |
+
} else {
|
| 496 |
+
return "" + this.form_field.offsetWidth + "px";
|
| 497 |
+
}
|
| 498 |
+
};
|
| 499 |
+
|
| 500 |
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
| 501 |
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
| 502 |
+
return false;
|
| 503 |
+
}
|
| 504 |
+
if (!this.display_disabled_options && option.disabled) {
|
| 505 |
+
return false;
|
| 506 |
+
}
|
| 507 |
+
if (option.empty) {
|
| 508 |
+
return false;
|
| 509 |
+
}
|
| 510 |
+
return true;
|
| 511 |
+
};
|
| 512 |
+
|
| 513 |
+
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
| 514 |
+
this.touch_started = true;
|
| 515 |
+
return this.search_results_mouseover(evt);
|
| 516 |
+
};
|
| 517 |
+
|
| 518 |
+
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
| 519 |
+
this.touch_started = false;
|
| 520 |
+
return this.search_results_mouseout(evt);
|
| 521 |
+
};
|
| 522 |
+
|
| 523 |
+
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
| 524 |
+
if (this.touch_started) {
|
| 525 |
+
return this.search_results_mouseup(evt);
|
| 526 |
+
}
|
| 527 |
+
};
|
| 528 |
+
|
| 529 |
+
AbstractChosen.prototype.outerHTML = function(element) {
|
| 530 |
+
var tmp;
|
| 531 |
+
if (element.outerHTML) {
|
| 532 |
+
return element.outerHTML;
|
| 533 |
+
}
|
| 534 |
+
tmp = document.createElement("div");
|
| 535 |
+
tmp.appendChild(element);
|
| 536 |
+
return tmp.innerHTML;
|
| 537 |
+
};
|
| 538 |
+
|
| 539 |
+
AbstractChosen.browser_is_supported = function() {
|
| 540 |
+
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
|
| 541 |
+
return false;
|
| 542 |
+
}
|
| 543 |
+
if (/Android/i.test(window.navigator.userAgent)) {
|
| 544 |
+
if (/Mobile/i.test(window.navigator.userAgent)) {
|
| 545 |
+
return false;
|
| 546 |
+
}
|
| 547 |
+
}
|
| 548 |
+
if (/IEMobile/i.test(window.navigator.userAgent)) {
|
| 549 |
+
return false;
|
| 550 |
+
}
|
| 551 |
+
if (/Windows Phone/i.test(window.navigator.userAgent)) {
|
| 552 |
+
return false;
|
| 553 |
+
}
|
| 554 |
+
if (/BlackBerry/i.test(window.navigator.userAgent)) {
|
| 555 |
+
return false;
|
| 556 |
+
}
|
| 557 |
+
if (/BB10/i.test(window.navigator.userAgent)) {
|
| 558 |
+
return false;
|
| 559 |
+
}
|
| 560 |
+
if (window.navigator.appName === "Microsoft Internet Explorer") {
|
| 561 |
+
return document.documentMode >= 8;
|
| 562 |
+
}
|
| 563 |
+
return true;
|
| 564 |
+
};
|
| 565 |
+
|
| 566 |
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
| 567 |
+
|
| 568 |
+
AbstractChosen.default_single_text = "Select an Option";
|
| 569 |
+
|
| 570 |
+
AbstractChosen.default_no_result_text = "No results match";
|
| 571 |
+
|
| 572 |
+
return AbstractChosen;
|
| 573 |
+
|
| 574 |
+
})();
|
| 575 |
+
|
| 576 |
+
$ = jQuery;
|
| 577 |
+
|
| 578 |
+
$.fn.extend({
|
| 579 |
+
chosen: function(options) {
|
| 580 |
+
if (!AbstractChosen.browser_is_supported()) {
|
| 581 |
+
return this;
|
| 582 |
+
}
|
| 583 |
+
return this.each(function(input_field) {
|
| 584 |
+
var $this, chosen;
|
| 585 |
+
$this = $(this);
|
| 586 |
+
chosen = $this.data('chosen');
|
| 587 |
+
if (options === 'destroy') {
|
| 588 |
+
if (chosen instanceof Chosen) {
|
| 589 |
+
chosen.destroy();
|
| 590 |
+
}
|
| 591 |
+
return;
|
| 592 |
+
}
|
| 593 |
+
if (!(chosen instanceof Chosen)) {
|
| 594 |
+
$this.data('chosen', new Chosen(this, options));
|
| 595 |
+
}
|
| 596 |
+
});
|
| 597 |
+
}
|
| 598 |
+
});
|
| 599 |
+
|
| 600 |
+
Chosen = (function(_super) {
|
| 601 |
+
__extends(Chosen, _super);
|
| 602 |
+
|
| 603 |
+
function Chosen() {
|
| 604 |
+
_ref = Chosen.__super__.constructor.apply(this, arguments);
|
| 605 |
+
return _ref;
|
| 606 |
+
}
|
| 607 |
+
|
| 608 |
+
Chosen.prototype.setup = function() {
|
| 609 |
+
this.form_field_jq = $(this.form_field);
|
| 610 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
| 611 |
+
return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
|
| 612 |
+
};
|
| 613 |
+
|
| 614 |
+
Chosen.prototype.set_up_html = function() {
|
| 615 |
+
var container_classes, container_props;
|
| 616 |
+
container_classes = ["chosen-container"];
|
| 617 |
+
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
| 618 |
+
if (this.inherit_select_classes && this.form_field.className) {
|
| 619 |
+
container_classes.push(this.form_field.className);
|
| 620 |
+
}
|
| 621 |
+
if (this.is_rtl) {
|
| 622 |
+
container_classes.push("chosen-rtl");
|
| 623 |
+
}
|
| 624 |
+
container_props = {
|
| 625 |
+
'class': container_classes.join(' '),
|
| 626 |
+
'style': "width: " + (this.container_width()) + ";",
|
| 627 |
+
'title': this.form_field.title
|
| 628 |
+
};
|
| 629 |
+
if (this.form_field.id.length) {
|
| 630 |
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
| 631 |
+
}
|
| 632 |
+
this.container = $("<div />", container_props);
|
| 633 |
+
if (this.is_multiple) {
|
| 634 |
+
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
|
| 635 |
+
} else {
|
| 636 |
+
this.container.html('<a class="chosen-single chosen-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
|
| 637 |
+
}
|
| 638 |
+
this.form_field_jq.hide().after(this.container);
|
| 639 |
+
this.dropdown = this.container.find('div.chosen-drop').first();
|
| 640 |
+
this.search_field = this.container.find('input').first();
|
| 641 |
+
this.search_results = this.container.find('ul.chosen-results').first();
|
| 642 |
+
this.search_field_scale();
|
| 643 |
+
this.search_no_results = this.container.find('li.no-results').first();
|
| 644 |
+
if (this.is_multiple) {
|
| 645 |
+
this.search_choices = this.container.find('ul.chosen-choices').first();
|
| 646 |
+
this.search_container = this.container.find('li.search-field').first();
|
| 647 |
+
} else {
|
| 648 |
+
this.search_container = this.container.find('div.chosen-search').first();
|
| 649 |
+
this.selected_item = this.container.find('.chosen-single').first();
|
| 650 |
+
}
|
| 651 |
+
this.results_build();
|
| 652 |
+
this.set_tab_index();
|
| 653 |
+
return this.set_label_behavior();
|
| 654 |
+
};
|
| 655 |
+
|
| 656 |
+
Chosen.prototype.on_ready = function() {
|
| 657 |
+
return this.form_field_jq.trigger("chosen:ready", {
|
| 658 |
+
chosen: this
|
| 659 |
+
});
|
| 660 |
+
};
|
| 661 |
+
|
| 662 |
+
Chosen.prototype.register_observers = function() {
|
| 663 |
+
var _this = this;
|
| 664 |
+
this.container.bind('touchstart.chosen', function(evt) {
|
| 665 |
+
_this.container_mousedown(evt);
|
| 666 |
+
return evt.preventDefault();
|
| 667 |
+
});
|
| 668 |
+
this.container.bind('touchend.chosen', function(evt) {
|
| 669 |
+
_this.container_mouseup(evt);
|
| 670 |
+
return evt.preventDefault();
|
| 671 |
+
});
|
| 672 |
+
this.container.bind('mousedown.chosen', function(evt) {
|
| 673 |
+
_this.container_mousedown(evt);
|
| 674 |
+
});
|
| 675 |
+
this.container.bind('mouseup.chosen', function(evt) {
|
| 676 |
+
_this.container_mouseup(evt);
|
| 677 |
+
});
|
| 678 |
+
this.container.bind('mouseenter.chosen', function(evt) {
|
| 679 |
+
_this.mouse_enter(evt);
|
| 680 |
+
});
|
| 681 |
+
this.container.bind('mouseleave.chosen', function(evt) {
|
| 682 |
+
_this.mouse_leave(evt);
|
| 683 |
+
});
|
| 684 |
+
this.search_results.bind('mouseup.chosen', function(evt) {
|
| 685 |
+
_this.search_results_mouseup(evt);
|
| 686 |
+
});
|
| 687 |
+
this.search_results.bind('mouseover.chosen', function(evt) {
|
| 688 |
+
_this.search_results_mouseover(evt);
|
| 689 |
+
});
|
| 690 |
+
this.search_results.bind('mouseout.chosen', function(evt) {
|
| 691 |
+
_this.search_results_mouseout(evt);
|
| 692 |
+
});
|
| 693 |
+
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
|
| 694 |
+
_this.search_results_mousewheel(evt);
|
| 695 |
+
});
|
| 696 |
+
this.search_results.bind('touchstart.chosen', function(evt) {
|
| 697 |
+
_this.search_results_touchstart(evt);
|
| 698 |
+
});
|
| 699 |
+
this.search_results.bind('touchmove.chosen', function(evt) {
|
| 700 |
+
_this.search_results_touchmove(evt);
|
| 701 |
+
});
|
| 702 |
+
this.search_results.bind('touchend.chosen', function(evt) {
|
| 703 |
+
_this.search_results_touchend(evt);
|
| 704 |
+
});
|
| 705 |
+
this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
|
| 706 |
+
_this.results_update_field(evt);
|
| 707 |
+
});
|
| 708 |
+
this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
|
| 709 |
+
_this.activate_field(evt);
|
| 710 |
+
});
|
| 711 |
+
this.form_field_jq.bind("chosen:open.chosen", function(evt) {
|
| 712 |
+
_this.container_mousedown(evt);
|
| 713 |
+
});
|
| 714 |
+
this.form_field_jq.bind("chosen:close.chosen", function(evt) {
|
| 715 |
+
_this.input_blur(evt);
|
| 716 |
+
});
|
| 717 |
+
this.search_field.bind('blur.chosen', function(evt) {
|
| 718 |
+
_this.input_blur(evt);
|
| 719 |
+
});
|
| 720 |
+
this.search_field.bind('keyup.chosen', function(evt) {
|
| 721 |
+
_this.keyup_checker(evt);
|
| 722 |
+
});
|
| 723 |
+
this.search_field.bind('keydown.chosen', function(evt) {
|
| 724 |
+
_this.keydown_checker(evt);
|
| 725 |
+
});
|
| 726 |
+
this.search_field.bind('focus.chosen', function(evt) {
|
| 727 |
+
_this.input_focus(evt);
|
| 728 |
+
});
|
| 729 |
+
this.search_field.bind('cut.chosen', function(evt) {
|
| 730 |
+
_this.clipboard_event_checker(evt);
|
| 731 |
+
});
|
| 732 |
+
this.search_field.bind('paste.chosen', function(evt) {
|
| 733 |
+
_this.clipboard_event_checker(evt);
|
| 734 |
+
});
|
| 735 |
+
if (this.is_multiple) {
|
| 736 |
+
return this.search_choices.bind('click.chosen', function(evt) {
|
| 737 |
+
_this.choices_click(evt);
|
| 738 |
+
});
|
| 739 |
+
} else {
|
| 740 |
+
return this.container.bind('click.chosen', function(evt) {
|
| 741 |
+
evt.preventDefault();
|
| 742 |
+
});
|
| 743 |
+
}
|
| 744 |
+
};
|
| 745 |
+
|
| 746 |
+
Chosen.prototype.destroy = function() {
|
| 747 |
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
| 748 |
+
if (this.search_field[0].tabIndex) {
|
| 749 |
+
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
| 750 |
+
}
|
| 751 |
+
this.container.remove();
|
| 752 |
+
this.form_field_jq.removeData('chosen');
|
| 753 |
+
return this.form_field_jq.show();
|
| 754 |
+
};
|
| 755 |
+
|
| 756 |
+
Chosen.prototype.search_field_disabled = function() {
|
| 757 |
+
this.is_disabled = this.form_field_jq[0].disabled;
|
| 758 |
+
if (this.is_disabled) {
|
| 759 |
+
this.container.addClass('chosen-disabled');
|
| 760 |
+
this.search_field[0].disabled = true;
|
| 761 |
+
if (!this.is_multiple) {
|
| 762 |
+
this.selected_item.unbind("focus.chosen", this.activate_action);
|
| 763 |
+
}
|
| 764 |
+
return this.close_field();
|
| 765 |
+
} else {
|
| 766 |
+
this.container.removeClass('chosen-disabled');
|
| 767 |
+
this.search_field[0].disabled = false;
|
| 768 |
+
if (!this.is_multiple) {
|
| 769 |
+
return this.selected_item.bind("focus.chosen", this.activate_action);
|
| 770 |
+
}
|
| 771 |
+
}
|
| 772 |
+
};
|
| 773 |
+
|
| 774 |
+
Chosen.prototype.container_mousedown = function(evt) {
|
| 775 |
+
if (!this.is_disabled) {
|
| 776 |
+
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
| 777 |
+
evt.preventDefault();
|
| 778 |
+
}
|
| 779 |
+
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
| 780 |
+
if (!this.active_field) {
|
| 781 |
+
if (this.is_multiple) {
|
| 782 |
+
this.search_field.val("");
|
| 783 |
+
}
|
| 784 |
+
$(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
|
| 785 |
+
this.results_show();
|
| 786 |
+
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
|
| 787 |
+
evt.preventDefault();
|
| 788 |
+
this.results_toggle();
|
| 789 |
+
}
|
| 790 |
+
return this.activate_field();
|
| 791 |
+
}
|
| 792 |
+
}
|
| 793 |
+
};
|
| 794 |
+
|
| 795 |
+
Chosen.prototype.container_mouseup = function(evt) {
|
| 796 |
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
| 797 |
+
return this.results_reset(evt);
|
| 798 |
+
}
|
| 799 |
+
};
|
| 800 |
+
|
| 801 |
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
| 802 |
+
var delta;
|
| 803 |
+
if (evt.originalEvent) {
|
| 804 |
+
delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
|
| 805 |
+
}
|
| 806 |
+
if (delta != null) {
|
| 807 |
+
evt.preventDefault();
|
| 808 |
+
if (evt.type === 'DOMMouseScroll') {
|
| 809 |
+
delta = delta * 40;
|
| 810 |
+
}
|
| 811 |
+
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
| 812 |
+
}
|
| 813 |
+
};
|
| 814 |
+
|
| 815 |
+
Chosen.prototype.blur_test = function(evt) {
|
| 816 |
+
if (!this.active_field && this.container.hasClass("chosen-container-active")) {
|
| 817 |
+
return this.close_field();
|
| 818 |
+
}
|
| 819 |
+
};
|
| 820 |
+
|
| 821 |
+
Chosen.prototype.close_field = function() {
|
| 822 |
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
| 823 |
+
this.active_field = false;
|
| 824 |
+
this.results_hide();
|
| 825 |
+
this.container.removeClass("chosen-container-active");
|
| 826 |
+
this.clear_backstroke();
|
| 827 |
+
this.show_search_field_default();
|
| 828 |
+
return this.search_field_scale();
|
| 829 |
+
};
|
| 830 |
+
|
| 831 |
+
Chosen.prototype.activate_field = function() {
|
| 832 |
+
this.container.addClass("chosen-container-active");
|
| 833 |
+
this.active_field = true;
|
| 834 |
+
this.search_field.val(this.search_field.val());
|
| 835 |
+
return this.search_field.focus();
|
| 836 |
+
};
|
| 837 |
+
|
| 838 |
+
Chosen.prototype.test_active_click = function(evt) {
|
| 839 |
+
var active_container;
|
| 840 |
+
active_container = $(evt.target).closest('.chosen-container');
|
| 841 |
+
if (active_container.length && this.container[0] === active_container[0]) {
|
| 842 |
+
return this.active_field = true;
|
| 843 |
+
} else {
|
| 844 |
+
return this.close_field();
|
| 845 |
+
}
|
| 846 |
+
};
|
| 847 |
+
|
| 848 |
+
Chosen.prototype.results_build = function() {
|
| 849 |
+
this.parsing = true;
|
| 850 |
+
this.selected_option_count = null;
|
| 851 |
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
| 852 |
+
if (this.is_multiple) {
|
| 853 |
+
this.search_choices.find("li.search-choice").remove();
|
| 854 |
+
} else if (!this.is_multiple) {
|
| 855 |
+
this.single_set_selected_text();
|
| 856 |
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
| 857 |
+
this.search_field[0].readOnly = true;
|
| 858 |
+
this.container.addClass("chosen-container-single-nosearch");
|
| 859 |
+
} else {
|
| 860 |
+
this.search_field[0].readOnly = false;
|
| 861 |
+
this.container.removeClass("chosen-container-single-nosearch");
|
| 862 |
+
}
|
| 863 |
+
}
|
| 864 |
+
this.update_results_content(this.results_option_build({
|
| 865 |
+
first: true
|
| 866 |
+
}));
|
| 867 |
+
this.search_field_disabled();
|
| 868 |
+
this.show_search_field_default();
|
| 869 |
+
this.search_field_scale();
|
| 870 |
+
return this.parsing = false;
|
| 871 |
+
};
|
| 872 |
+
|
| 873 |
+
Chosen.prototype.result_do_highlight = function(el) {
|
| 874 |
+
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
| 875 |
+
if (el.length) {
|
| 876 |
+
this.result_clear_highlight();
|
| 877 |
+
this.result_highlight = el;
|
| 878 |
+
this.result_highlight.addClass("highlighted");
|
| 879 |
+
maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
|
| 880 |
+
visible_top = this.search_results.scrollTop();
|
| 881 |
+
visible_bottom = maxHeight + visible_top;
|
| 882 |
+
high_top = this.result_highlight.position().top + this.search_results.scrollTop();
|
| 883 |
+
high_bottom = high_top + this.result_highlight.outerHeight();
|
| 884 |
+
if (high_bottom >= visible_bottom) {
|
| 885 |
+
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
|
| 886 |
+
} else if (high_top < visible_top) {
|
| 887 |
+
return this.search_results.scrollTop(high_top);
|
| 888 |
+
}
|
| 889 |
+
}
|
| 890 |
+
};
|
| 891 |
+
|
| 892 |
+
Chosen.prototype.result_clear_highlight = function() {
|
| 893 |
+
if (this.result_highlight) {
|
| 894 |
+
this.result_highlight.removeClass("highlighted");
|
| 895 |
+
}
|
| 896 |
+
return this.result_highlight = null;
|
| 897 |
+
};
|
| 898 |
+
|
| 899 |
+
Chosen.prototype.results_show = function() {
|
| 900 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
| 901 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
| 902 |
+
chosen: this
|
| 903 |
+
});
|
| 904 |
+
return false;
|
| 905 |
+
}
|
| 906 |
+
this.container.addClass("chosen-with-drop");
|
| 907 |
+
this.results_showing = true;
|
| 908 |
+
this.search_field.focus();
|
| 909 |
+
this.search_field.val(this.search_field.val());
|
| 910 |
+
this.winnow_results();
|
| 911 |
+
return this.form_field_jq.trigger("chosen:showing_dropdown", {
|
| 912 |
+
chosen: this
|
| 913 |
+
});
|
| 914 |
+
};
|
| 915 |
+
|
| 916 |
+
Chosen.prototype.update_results_content = function(content) {
|
| 917 |
+
return this.search_results.html(content);
|
| 918 |
+
};
|
| 919 |
+
|
| 920 |
+
Chosen.prototype.results_hide = function() {
|
| 921 |
+
if (this.results_showing) {
|
| 922 |
+
this.result_clear_highlight();
|
| 923 |
+
this.container.removeClass("chosen-with-drop");
|
| 924 |
+
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
| 925 |
+
chosen: this
|
| 926 |
+
});
|
| 927 |
+
}
|
| 928 |
+
return this.results_showing = false;
|
| 929 |
+
};
|
| 930 |
+
|
| 931 |
+
Chosen.prototype.set_tab_index = function(el) {
|
| 932 |
+
var ti;
|
| 933 |
+
if (this.form_field.tabIndex) {
|
| 934 |
+
ti = this.form_field.tabIndex;
|
| 935 |
+
this.form_field.tabIndex = -1;
|
| 936 |
+
return this.search_field[0].tabIndex = ti;
|
| 937 |
+
}
|
| 938 |
+
};
|
| 939 |
+
|
| 940 |
+
Chosen.prototype.set_label_behavior = function() {
|
| 941 |
+
var _this = this;
|
| 942 |
+
this.form_field_label = this.form_field_jq.parents("label");
|
| 943 |
+
if (!this.form_field_label.length && this.form_field.id.length) {
|
| 944 |
+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
| 945 |
+
}
|
| 946 |
+
if (this.form_field_label.length > 0) {
|
| 947 |
+
return this.form_field_label.bind('click.chosen', function(evt) {
|
| 948 |
+
if (_this.is_multiple) {
|
| 949 |
+
return _this.container_mousedown(evt);
|
| 950 |
+
} else {
|
| 951 |
+
return _this.activate_field();
|
| 952 |
+
}
|
| 953 |
+
});
|
| 954 |
+
}
|
| 955 |
+
};
|
| 956 |
+
|
| 957 |
+
Chosen.prototype.show_search_field_default = function() {
|
| 958 |
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
| 959 |
+
this.search_field.val(this.default_text);
|
| 960 |
+
return this.search_field.addClass("default");
|
| 961 |
+
} else {
|
| 962 |
+
this.search_field.val("");
|
| 963 |
+
return this.search_field.removeClass("default");
|
| 964 |
+
}
|
| 965 |
+
};
|
| 966 |
+
|
| 967 |
+
Chosen.prototype.search_results_mouseup = function(evt) {
|
| 968 |
+
var target;
|
| 969 |
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
| 970 |
+
if (target.length) {
|
| 971 |
+
this.result_highlight = target;
|
| 972 |
+
this.result_select(evt);
|
| 973 |
+
return this.search_field.focus();
|
| 974 |
+
}
|
| 975 |
+
};
|
| 976 |
+
|
| 977 |
+
Chosen.prototype.search_results_mouseover = function(evt) {
|
| 978 |
+
var target;
|
| 979 |
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
| 980 |
+
if (target) {
|
| 981 |
+
return this.result_do_highlight(target);
|
| 982 |
+
}
|
| 983 |
+
};
|
| 984 |
+
|
| 985 |
+
Chosen.prototype.search_results_mouseout = function(evt) {
|
| 986 |
+
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
|
| 987 |
+
return this.result_clear_highlight();
|
| 988 |
+
}
|
| 989 |
+
};
|
| 990 |
+
|
| 991 |
+
Chosen.prototype.choice_build = function(item) {
|
| 992 |
+
var choice, close_link,
|
| 993 |
+
_this = this;
|
| 994 |
+
choice = $('<li />', {
|
| 995 |
+
"class": "search-choice"
|
| 996 |
+
}).html("<span>" + (this.choice_label(item)) + "</span>");
|
| 997 |
+
if (item.disabled) {
|
| 998 |
+
choice.addClass('search-choice-disabled');
|
| 999 |
+
} else {
|
| 1000 |
+
close_link = $('<a />', {
|
| 1001 |
+
"class": 'search-choice-close',
|
| 1002 |
+
'data-option-array-index': item.array_index
|
| 1003 |
+
});
|
| 1004 |
+
close_link.bind('click.chosen', function(evt) {
|
| 1005 |
+
return _this.choice_destroy_link_click(evt);
|
| 1006 |
+
});
|
| 1007 |
+
choice.append(close_link);
|
| 1008 |
+
}
|
| 1009 |
+
return this.search_container.before(choice);
|
| 1010 |
+
};
|
| 1011 |
+
|
| 1012 |
+
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
| 1013 |
+
evt.preventDefault();
|
| 1014 |
+
evt.stopPropagation();
|
| 1015 |
+
if (!this.is_disabled) {
|
| 1016 |
+
return this.choice_destroy($(evt.target));
|
| 1017 |
+
}
|
| 1018 |
+
};
|
| 1019 |
+
|
| 1020 |
+
Chosen.prototype.choice_destroy = function(link) {
|
| 1021 |
+
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
| 1022 |
+
this.show_search_field_default();
|
| 1023 |
+
if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
|
| 1024 |
+
this.results_hide();
|
| 1025 |
+
}
|
| 1026 |
+
link.parents('li').first().remove();
|
| 1027 |
+
return this.search_field_scale();
|
| 1028 |
+
}
|
| 1029 |
+
};
|
| 1030 |
+
|
| 1031 |
+
Chosen.prototype.results_reset = function() {
|
| 1032 |
+
this.reset_single_select_options();
|
| 1033 |
+
this.form_field.options[0].selected = true;
|
| 1034 |
+
this.single_set_selected_text();
|
| 1035 |
+
this.show_search_field_default();
|
| 1036 |
+
this.results_reset_cleanup();
|
| 1037 |
+
this.form_field_jq.trigger("change");
|
| 1038 |
+
if (this.active_field) {
|
| 1039 |
+
return this.results_hide();
|
| 1040 |
+
}
|
| 1041 |
+
};
|
| 1042 |
+
|
| 1043 |
+
Chosen.prototype.results_reset_cleanup = function() {
|
| 1044 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
| 1045 |
+
return this.selected_item.find("abbr").remove();
|
| 1046 |
+
};
|
| 1047 |
+
|
| 1048 |
+
Chosen.prototype.result_select = function(evt) {
|
| 1049 |
+
var high, item;
|
| 1050 |
+
if (this.result_highlight) {
|
| 1051 |
+
high = this.result_highlight;
|
| 1052 |
+
this.result_clear_highlight();
|
| 1053 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
| 1054 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
| 1055 |
+
chosen: this
|
| 1056 |
+
});
|
| 1057 |
+
return false;
|
| 1058 |
+
}
|
| 1059 |
+
if (this.is_multiple) {
|
| 1060 |
+
high.removeClass("active-result");
|
| 1061 |
+
} else {
|
| 1062 |
+
this.reset_single_select_options();
|
| 1063 |
+
}
|
| 1064 |
+
high.addClass("result-selected");
|
| 1065 |
+
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
| 1066 |
+
item.selected = true;
|
| 1067 |
+
this.form_field.options[item.options_index].selected = true;
|
| 1068 |
+
this.selected_option_count = null;
|
| 1069 |
+
if (this.is_multiple) {
|
| 1070 |
+
this.choice_build(item);
|
| 1071 |
+
} else {
|
| 1072 |
+
this.single_set_selected_text(this.choice_label(item));
|
| 1073 |
+
}
|
| 1074 |
+
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
|
| 1075 |
+
this.results_hide();
|
| 1076 |
+
}
|
| 1077 |
+
this.show_search_field_default();
|
| 1078 |
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
| 1079 |
+
this.form_field_jq.trigger("change", {
|
| 1080 |
+
'selected': this.form_field.options[item.options_index].value
|
| 1081 |
+
});
|
| 1082 |
+
}
|
| 1083 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
| 1084 |
+
evt.preventDefault();
|
| 1085 |
+
return this.search_field_scale();
|
| 1086 |
+
}
|
| 1087 |
+
};
|
| 1088 |
+
|
| 1089 |
+
Chosen.prototype.single_set_selected_text = function(text) {
|
| 1090 |
+
if (text == null) {
|
| 1091 |
+
text = this.default_text;
|
| 1092 |
+
}
|
| 1093 |
+
if (text === this.default_text) {
|
| 1094 |
+
this.selected_item.addClass("chosen-default");
|
| 1095 |
+
} else {
|
| 1096 |
+
this.single_deselect_control_build();
|
| 1097 |
+
this.selected_item.removeClass("chosen-default");
|
| 1098 |
+
}
|
| 1099 |
+
return this.selected_item.find("span").html(text);
|
| 1100 |
+
};
|
| 1101 |
+
|
| 1102 |
+
Chosen.prototype.result_deselect = function(pos) {
|
| 1103 |
+
var result_data;
|
| 1104 |
+
result_data = this.results_data[pos];
|
| 1105 |
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
| 1106 |
+
result_data.selected = false;
|
| 1107 |
+
this.form_field.options[result_data.options_index].selected = false;
|
| 1108 |
+
this.selected_option_count = null;
|
| 1109 |
+
this.result_clear_highlight();
|
| 1110 |
+
if (this.results_showing) {
|
| 1111 |
+
this.winnow_results();
|
| 1112 |
+
}
|
| 1113 |
+
this.form_field_jq.trigger("change", {
|
| 1114 |
+
deselected: this.form_field.options[result_data.options_index].value
|
| 1115 |
+
});
|
| 1116 |
+
this.search_field_scale();
|
| 1117 |
+
return true;
|
| 1118 |
+
} else {
|
| 1119 |
+
return false;
|
| 1120 |
+
}
|
| 1121 |
+
};
|
| 1122 |
+
|
| 1123 |
+
Chosen.prototype.single_deselect_control_build = function() {
|
| 1124 |
+
if (!this.allow_single_deselect) {
|
| 1125 |
+
return;
|
| 1126 |
+
}
|
| 1127 |
+
if (!this.selected_item.find("abbr").length) {
|
| 1128 |
+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
| 1129 |
+
}
|
| 1130 |
+
return this.selected_item.addClass("chosen-single-with-deselect");
|
| 1131 |
+
};
|
| 1132 |
+
|
| 1133 |
+
Chosen.prototype.get_search_text = function() {
|
| 1134 |
+
return $('<div/>').text($.trim(this.search_field.val())).html();
|
| 1135 |
+
};
|
| 1136 |
+
|
| 1137 |
+
Chosen.prototype.winnow_results_set_highlight = function() {
|
| 1138 |
+
var do_high, selected_results;
|
| 1139 |
+
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
| 1140 |
+
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
| 1141 |
+
if (do_high != null) {
|
| 1142 |
+
return this.result_do_highlight(do_high);
|
| 1143 |
+
}
|
| 1144 |
+
};
|
| 1145 |
+
|
| 1146 |
+
Chosen.prototype.no_results = function(terms) {
|
| 1147 |
+
var no_results_html;
|
| 1148 |
+
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
| 1149 |
+
no_results_html.find("span").first().html(terms);
|
| 1150 |
+
this.search_results.append(no_results_html);
|
| 1151 |
+
return this.form_field_jq.trigger("chosen:no_results", {
|
| 1152 |
+
chosen: this
|
| 1153 |
+
});
|
| 1154 |
+
};
|
| 1155 |
+
|
| 1156 |
+
Chosen.prototype.no_results_clear = function() {
|
| 1157 |
+
return this.search_results.find(".no-results").remove();
|
| 1158 |
+
};
|
| 1159 |
+
|
| 1160 |
+
Chosen.prototype.keydown_arrow = function() {
|
| 1161 |
+
var next_sib;
|
| 1162 |
+
if (this.results_showing && this.result_highlight) {
|
| 1163 |
+
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
| 1164 |
+
if (next_sib) {
|
| 1165 |
+
return this.result_do_highlight(next_sib);
|
| 1166 |
+
}
|
| 1167 |
+
} else {
|
| 1168 |
+
return this.results_show();
|
| 1169 |
+
}
|
| 1170 |
+
};
|
| 1171 |
+
|
| 1172 |
+
Chosen.prototype.keyup_arrow = function() {
|
| 1173 |
+
var prev_sibs;
|
| 1174 |
+
if (!this.results_showing && !this.is_multiple) {
|
| 1175 |
+
return this.results_show();
|
| 1176 |
+
} else if (this.result_highlight) {
|
| 1177 |
+
prev_sibs = this.result_highlight.prevAll("li.active-result");
|
| 1178 |
+
if (prev_sibs.length) {
|
| 1179 |
+
return this.result_do_highlight(prev_sibs.first());
|
| 1180 |
+
} else {
|
| 1181 |
+
if (this.choices_count() > 0) {
|
| 1182 |
+
this.results_hide();
|
| 1183 |
+
}
|
| 1184 |
+
return this.result_clear_highlight();
|
| 1185 |
+
}
|
| 1186 |
+
}
|
| 1187 |
+
};
|
| 1188 |
+
|
| 1189 |
+
Chosen.prototype.keydown_backstroke = function() {
|
| 1190 |
+
var next_available_destroy;
|
| 1191 |
+
if (this.pending_backstroke) {
|
| 1192 |
+
this.choice_destroy(this.pending_backstroke.find("a").first());
|
| 1193 |
+
return this.clear_backstroke();
|
| 1194 |
+
} else {
|
| 1195 |
+
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
| 1196 |
+
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
| 1197 |
+
this.pending_backstroke = next_available_destroy;
|
| 1198 |
+
if (this.single_backstroke_delete) {
|
| 1199 |
+
return this.keydown_backstroke();
|
| 1200 |
+
} else {
|
| 1201 |
+
return this.pending_backstroke.addClass("search-choice-focus");
|
| 1202 |
+
}
|
| 1203 |
+
}
|
| 1204 |
+
}
|
| 1205 |
+
};
|
| 1206 |
+
|
| 1207 |
+
Chosen.prototype.clear_backstroke = function() {
|
| 1208 |
+
if (this.pending_backstroke) {
|
| 1209 |
+
this.pending_backstroke.removeClass("search-choice-focus");
|
| 1210 |
+
}
|
| 1211 |
+
return this.pending_backstroke = null;
|
| 1212 |
+
};
|
| 1213 |
+
|
| 1214 |
+
Chosen.prototype.keydown_checker = function(evt) {
|
| 1215 |
+
var stroke, _ref1;
|
| 1216 |
+
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
|
| 1217 |
+
this.search_field_scale();
|
| 1218 |
+
if (stroke !== 8 && this.pending_backstroke) {
|
| 1219 |
+
this.clear_backstroke();
|
| 1220 |
+
}
|
| 1221 |
+
switch (stroke) {
|
| 1222 |
+
case 8:
|
| 1223 |
+
this.backstroke_length = this.search_field.val().length;
|
| 1224 |
+
break;
|
| 1225 |
+
case 9:
|
| 1226 |
+
if (this.results_showing && !this.is_multiple) {
|
| 1227 |
+
this.result_select(evt);
|
| 1228 |
+
}
|
| 1229 |
+
this.mouse_on_container = false;
|
| 1230 |
+
break;
|
| 1231 |
+
case 13:
|
| 1232 |
+
if (this.results_showing) {
|
| 1233 |
+
evt.preventDefault();
|
| 1234 |
+
}
|
| 1235 |
+
break;
|
| 1236 |
+
case 32:
|
| 1237 |
+
if (this.disable_search) {
|
| 1238 |
+
evt.preventDefault();
|
| 1239 |
+
}
|
| 1240 |
+
break;
|
| 1241 |
+
case 38:
|
| 1242 |
+
evt.preventDefault();
|
| 1243 |
+
this.keyup_arrow();
|
| 1244 |
+
break;
|
| 1245 |
+
case 40:
|
| 1246 |
+
evt.preventDefault();
|
| 1247 |
+
this.keydown_arrow();
|
| 1248 |
+
break;
|
| 1249 |
+
}
|
| 1250 |
+
};
|
| 1251 |
+
|
| 1252 |
+
Chosen.prototype.search_field_scale = function() {
|
| 1253 |
+
var div, f_width, h, style, style_block, styles, w, _i, _len;
|
| 1254 |
+
if (this.is_multiple) {
|
| 1255 |
+
h = 0;
|
| 1256 |
+
w = 0;
|
| 1257 |
+
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
| 1258 |
+
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
| 1259 |
+
for (_i = 0, _len = styles.length; _i < _len; _i++) {
|
| 1260 |
+
style = styles[_i];
|
| 1261 |
+
style_block += style + ":" + this.search_field.css(style) + ";";
|
| 1262 |
+
}
|
| 1263 |
+
div = $('<div />', {
|
| 1264 |
+
'style': style_block
|
| 1265 |
+
});
|
| 1266 |
+
div.text(this.search_field.val());
|
| 1267 |
+
$('body').append(div);
|
| 1268 |
+
w = div.width() + 25;
|
| 1269 |
+
div.remove();
|
| 1270 |
+
f_width = this.container.outerWidth();
|
| 1271 |
+
if (w > f_width - 10) {
|
| 1272 |
+
w = f_width - 10;
|
| 1273 |
+
}
|
| 1274 |
+
return this.search_field.css({
|
| 1275 |
+
'width': w + 'px'
|
| 1276 |
+
});
|
| 1277 |
+
}
|
| 1278 |
+
};
|
| 1279 |
+
|
| 1280 |
+
return Chosen;
|
| 1281 |
+
|
| 1282 |
+
})(AbstractChosen);
|
| 1283 |
+
|
| 1284 |
+
}).call(this);
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
(function(){var a,b,c,d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},a.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;f>e;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},a.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},a.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||a.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||a.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||a.default_no_result_text},a.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,b.group&&!this.group_search||(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},a.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},a.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},a.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:!a.empty},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.browser_is_supported=function(){return/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:/IEMobile/i.test(window.navigator.userAgent)?!1:/Windows Phone/i.test(window.navigator.userAgent)?!1:/BlackBerry/i.test(window.navigator.userAgent)?!1:/BB10/i.test(window.navigator.userAgent)?!1:"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!0},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(b){var e,f;return e=a(this),f=e.data("chosen"),"destroy"===d?void(f instanceof c&&f.destroy()):void(f instanceof c||e.data("chosen",new c(this,d)))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return g(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},c.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},c.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},c.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},c.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},c.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},c.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},c.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},c.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},c.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},c.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},c.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},c.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},c.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},c}(b)}).call(this);
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -7,7 +7,13 @@
|
|
| 7 |
Â
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
|
| 8 |
Â
*/
|
| 9 |
Â
|
| 10 |
-
(function (
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 11 |
Â
|
| 12 |
Â
/*
|
| 13 |
Â
* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
|
|
@@ -26,7 +32,7 @@
|
|
| 26 |
Â
}
|
| 27 |
Â
});
|
| 28 |
Â
|
| 29 |
-
/*
|
| 30 |
Â
* Timepicker manager.
|
| 31 |
Â
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
|
| 32 |
Â
* Settings for (groups of) time pickers are maintained in an instance object,
|
|
@@ -107,8 +113,10 @@
|
|
| 107 |
Â
addSliderAccess: false,
|
| 108 |
Â
sliderAccessArgs: null,
|
| 109 |
Â
controlType: 'slider',
|
|
Â
|
|
| 110 |
Â
defaultValue: null,
|
| 111 |
-
parse: 'strict'
|
|
Â
|
|
| 112 |
Â
};
|
| 113 |
Â
$.extend(this._defaults, this.regional['']);
|
| 114 |
Â
};
|
|
@@ -151,7 +159,7 @@
|
|
| 151 |
Â
support: {},
|
| 152 |
Â
control: null,
|
| 153 |
Â
|
| 154 |
-
/*
|
| 155 |
Â
* Override the default settings for all instances of the time picker.
|
| 156 |
Â
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
|
| 157 |
Â
* @return {Object} the manager object
|
|
@@ -191,7 +199,7 @@
|
|
| 191 |
Â
},
|
| 192 |
Â
onChangeMonthYear: function (year, month, dp_inst) {
|
| 193 |
Â
// Update the time as well : this prevents the time from disappearing from the $input field.
|
| 194 |
-
tp_inst._updateDateTime(dp_inst);
|
| 195 |
Â
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
|
| 196 |
Â
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
|
| 197 |
Â
}
|
|
@@ -207,7 +215,7 @@
|
|
| 207 |
Â
};
|
| 208 |
Â
for (i in overrides) {
|
| 209 |
Â
if (overrides.hasOwnProperty(i)) {
|
| 210 |
-
fns[i] = opts[i] || null;
|
| 211 |
Â
}
|
| 212 |
Â
}
|
| 213 |
Â
|
|
@@ -224,7 +232,7 @@
|
|
| 224 |
Â
|
| 225 |
Â
// detect which units are supported
|
| 226 |
Â
tp_inst.support = detectSupport(
|
| 227 |
-
tp_inst._defaults.timeFormat +
|
| 228 |
Â
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
|
| 229 |
Â
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
|
| 230 |
Â
|
|
@@ -313,11 +321,12 @@
|
|
| 313 |
Â
* add our sliders to the calendar
|
| 314 |
Â
*/
|
| 315 |
Â
_addTimePicker: function (dp_inst) {
|
| 316 |
-
var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
|
| 317 |
Â
|
| 318 |
Â
this.timeDefined = this._parseTime(currDT);
|
| 319 |
Â
this._limitMinMaxDateTime(dp_inst, false);
|
| 320 |
Â
this._injectTimePicker();
|
|
Â
|
|
| 321 |
Â
},
|
| 322 |
Â
|
| 323 |
Â
/*
|
|
@@ -354,6 +363,16 @@
|
|
| 354 |
Â
}
|
| 355 |
Â
},
|
| 356 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 357 |
Â
/*
|
| 358 |
Â
* generate and inject html for timepicker into ui datepicker
|
| 359 |
Â
*/
|
|
@@ -372,9 +391,9 @@
|
|
| 372 |
Â
|
| 373 |
Â
// Prevent displaying twice
|
| 374 |
Â
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
| 375 |
-
var noDisplay = '
|
| 376 |
-
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label
|
| 377 |
-
'<dd class="ui_tpicker_time
|
| 378 |
Â
|
| 379 |
Â
// Create the markup
|
| 380 |
Â
for (i = 0, l = this.units.length; i < l; i++) {
|
|
@@ -388,8 +407,8 @@
|
|
| 388 |
Â
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
|
| 389 |
Â
gridSize[litem] = 0;
|
| 390 |
Â
|
| 391 |
-
html += '<dt class="ui_tpicker_' + litem + '_label
|
| 392 |
-
'<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider
|
| 393 |
Â
|
| 394 |
Â
if (show && o[litem + 'Grid'] > 0) {
|
| 395 |
Â
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
|
|
@@ -412,11 +431,11 @@
|
|
| 412 |
Â
}
|
| 413 |
Â
html += '</dd>';
|
| 414 |
Â
}
|
| 415 |
-
|
| 416 |
Â
// Timezone
|
| 417 |
Â
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
|
| 418 |
-
html += '<dt class="ui_tpicker_timezone_label
|
| 419 |
-
html += '<dd class="ui_tpicker_timezone
|
| 420 |
Â
|
| 421 |
Â
// Create the elements from string
|
| 422 |
Â
html += '</dl></div>';
|
|
@@ -427,7 +446,7 @@
|
|
| 427 |
Â
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
| 428 |
Â
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
| 429 |
Â
}
|
| 430 |
-
|
| 431 |
Â
// add sliders, adjust grids, add events
|
| 432 |
Â
for (i = 0, l = tp_inst.units.length; i < l; i++) {
|
| 433 |
Â
litem = tp_inst.units[i];
|
|
@@ -462,7 +481,7 @@
|
|
| 462 |
Â
}
|
| 463 |
Â
}
|
| 464 |
Â
}
|
| 465 |
-
|
| 466 |
Â
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
| 467 |
Â
|
| 468 |
Â
tp_inst._onTimeChange();
|
|
@@ -499,9 +518,10 @@
|
|
| 499 |
Â
this.timezone_select.change(function () {
|
| 500 |
Â
tp_inst._onTimeChange();
|
| 501 |
Â
tp_inst._onSelectHandler();
|
|
Â
|
|
| 502 |
Â
});
|
| 503 |
Â
// End timezone options
|
| 504 |
-
|
| 505 |
Â
// inject timepicker into datepicker
|
| 506 |
Â
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
| 507 |
Â
if ($buttonPanel.length) {
|
|
@@ -510,7 +530,21 @@
|
|
| 510 |
Â
$dp.append($tp);
|
| 511 |
Â
}
|
| 512 |
Â
|
| 513 |
-
this.$timeObj = $tp.find('.
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 514 |
Â
|
| 515 |
Â
if (this.inst !== null) {
|
| 516 |
Â
var timeDefined = this.timeDefined;
|
|
@@ -523,7 +557,7 @@
|
|
| 523 |
Â
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
| 524 |
Â
rtl = this._defaults.isRTL;
|
| 525 |
Â
sliderAccessArgs.isRTL = rtl;
|
| 526 |
-
|
| 527 |
Â
setTimeout(function () { // fix for inline mode
|
| 528 |
Â
if ($tp.find('.ui-slider-access').length === 0) {
|
| 529 |
Â
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
|
@@ -675,44 +709,44 @@
|
|
| 675 |
Â
}
|
| 676 |
Â
}
|
| 677 |
Â
|
| 678 |
-
if (dp_inst.settings.minTime!==null) {
|
| 679 |
-
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
|
| 680 |
Â
if (this.hour<tempMinTime.getHours()) {
|
| 681 |
Â
this.hour=this._defaults.hourMin=tempMinTime.getHours();
|
| 682 |
-
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 683 |
Â
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
|
| 684 |
Â
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 685 |
-
} else {
|
| 686 |
Â
if (this._defaults.hourMin<tempMinTime.getHours()) {
|
| 687 |
Â
this._defaults.hourMin=tempMinTime.getHours();
|
| 688 |
-
this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 689 |
Â
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
|
| 690 |
-
this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 691 |
Â
} else {
|
| 692 |
Â
this._defaults.minuteMin=0;
|
| 693 |
Â
}
|
| 694 |
-
}
|
| 695 |
Â
}
|
| 696 |
-
|
| 697 |
-
if (dp_inst.settings.maxTime!==null) {
|
| 698 |
Â
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
|
| 699 |
Â
if (this.hour>tempMaxTime.getHours()) {
|
| 700 |
-
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
|
|
Â
|
|
|
Â
|
|
| 701 |
Â
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 702 |
-
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
|
| 703 |
-
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 704 |
Â
} else {
|
| 705 |
Â
if (this._defaults.hourMax>tempMaxTime.getHours()) {
|
| 706 |
Â
this._defaults.hourMax=tempMaxTime.getHours();
|
| 707 |
-
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 708 |
Â
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
|
| 709 |
-
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 710 |
Â
} else {
|
| 711 |
Â
this._defaults.minuteMax=59;
|
| 712 |
Â
}
|
| 713 |
-
}
|
| 714 |
Â
}
|
| 715 |
-
|
| 716 |
Â
if (adjustSliders !== undefined && adjustSliders === true) {
|
| 717 |
Â
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
|
| 718 |
Â
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
|
|
@@ -806,11 +840,11 @@
|
|
| 806 |
Â
// If the update was done using the sliders, update the input field.
|
| 807 |
Â
var hasChanged = (
|
| 808 |
Â
hour !== parseInt(this.hour,10) || // sliders should all be numeric
|
| 809 |
-
minute !== parseInt(this.minute,10) ||
|
| 810 |
-
second !== parseInt(this.second,10) ||
|
| 811 |
-
millisec !== parseInt(this.millisec,10) ||
|
| 812 |
-
microsec !== parseInt(this.microsec,10) ||
|
| 813 |
-
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
|
| 814 |
Â
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
|
| 815 |
Â
);
|
| 816 |
Â
|
|
@@ -849,10 +883,15 @@
|
|
| 849 |
Â
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
|
| 850 |
Â
if (this.$timeObj) {
|
| 851 |
Â
if (pickerTimeFormat === o.timeFormat) {
|
| 852 |
-
this.$timeObj.
|
| 853 |
Â
}
|
| 854 |
Â
else {
|
| 855 |
-
this.$timeObj.
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 856 |
Â
}
|
| 857 |
Â
}
|
| 858 |
Â
|
|
@@ -880,8 +919,8 @@
|
|
| 880 |
Â
*/
|
| 881 |
Â
_updateDateTime: function (dp_inst) {
|
| 882 |
Â
dp_inst = this.inst || dp_inst;
|
| 883 |
-
var dtTmp = (dp_inst.currentYear > 0?
|
| 884 |
-
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
|
| 885 |
Â
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
| 886 |
Â
dt = $.datepicker._daylightSavingAdjust(dtTmp),
|
| 887 |
Â
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
|
@@ -891,7 +930,7 @@
|
|
| 891 |
Â
timeAvailable = dt !== null && this.timeDefined;
|
| 892 |
Â
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
| 893 |
Â
var formattedDateTime = this.formattedDate;
|
| 894 |
-
|
| 895 |
Â
// if a slider was changed but datepicker doesn't have a value yet, set it
|
| 896 |
Â
if (dp_inst.lastVal === "") {
|
| 897 |
Â
dp_inst.currentYear = dp_inst.selectedYear;
|
|
@@ -901,7 +940,7 @@
|
|
| 901 |
Â
|
| 902 |
Â
/*
|
| 903 |
Â
* remove following lines to force every changes in date picker to change the input value
|
| 904 |
-
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
| 905 |
Â
* If the user manually empty the value in the input field, the date picker will never change selected value.
|
| 906 |
Â
*/
|
| 907 |
Â
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
|
|
@@ -926,7 +965,7 @@
|
|
| 926 |
Â
var altFormattedDateTime = '',
|
| 927 |
Â
altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
|
| 928 |
Â
altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
| 929 |
-
|
| 930 |
Â
if (!this._defaults.timeOnly) {
|
| 931 |
Â
if (this._defaults.altFormat) {
|
| 932 |
Â
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
|
@@ -993,7 +1032,7 @@
|
|
| 993 |
Â
stop: function (event, ui) {
|
| 994 |
Â
tp_inst._onSelectHandler();
|
| 995 |
Â
}
|
| 996 |
-
});
|
| 997 |
Â
},
|
| 998 |
Â
options: function (tp_inst, obj, unit, opts, val) {
|
| 999 |
Â
if (tp_inst._defaults.isRTL) {
|
|
@@ -1006,7 +1045,7 @@
|
|
| 1006 |
Â
}
|
| 1007 |
Â
return obj.slider(opts);
|
| 1008 |
Â
}
|
| 1009 |
-
var min = opts.min,
|
| 1010 |
Â
max = opts.max;
|
| 1011 |
Â
opts.min = opts.max = null;
|
| 1012 |
Â
if (min !== undefined) {
|
|
@@ -1038,7 +1077,7 @@
|
|
| 1038 |
Â
// select methods
|
| 1039 |
Â
select: {
|
| 1040 |
Â
create: function (tp_inst, obj, unit, val, min, max, step) {
|
| 1041 |
-
var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
|
| 1042 |
Â
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
|
| 1043 |
Â
|
| 1044 |
Â
for (var i = min; i <= max; i += step) {
|
|
@@ -1057,6 +1096,7 @@
|
|
| 1057 |
Â
$(sel).appendTo(obj).change(function (e) {
|
| 1058 |
Â
tp_inst._onTimeChange();
|
| 1059 |
Â
tp_inst._onSelectHandler();
|
|
Â
|
|
| 1060 |
Â
});
|
| 1061 |
Â
|
| 1062 |
Â
return obj;
|
|
@@ -1068,10 +1108,10 @@
|
|
| 1068 |
Â
if (val === undefined) {
|
| 1069 |
Â
return $t.data(opts);
|
| 1070 |
Â
}
|
| 1071 |
-
o[opts] = val;
|
| 1072 |
Â
}
|
| 1073 |
Â
else { o = opts; }
|
| 1074 |
-
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min
|
| 1075 |
Â
},
|
| 1076 |
Â
value: function (tp_inst, obj, unit, val) {
|
| 1077 |
Â
var $t = obj.children('select');
|
|
@@ -1235,7 +1275,7 @@
|
|
| 1235 |
Â
ampm = '';
|
| 1236 |
Â
resTime.ampm = '';
|
| 1237 |
Â
} else {
|
| 1238 |
-
ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
|
| 1239 |
Â
resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
|
| 1240 |
Â
}
|
| 1241 |
Â
}
|
|
@@ -1303,11 +1343,11 @@
|
|
| 1303 |
Â
}
|
| 1304 |
Â
catch (err2) {
|
| 1305 |
Â
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
|
| 1306 |
-
}
|
| 1307 |
Â
}
|
| 1308 |
Â
return false;
|
| 1309 |
Â
}; // end looseParse
|
| 1310 |
-
|
| 1311 |
Â
if (typeof o.parse === "function") {
|
| 1312 |
Â
return o.parse(timeFormat, timeString, o);
|
| 1313 |
Â
}
|
|
@@ -1393,14 +1433,17 @@
|
|
| 1393 |
Â
$.datepicker._base_selectDate = $.datepicker._selectDate;
|
| 1394 |
Â
$.datepicker._selectDate = function (id, dateStr) {
|
| 1395 |
Â
var inst = this._getInst($(id)[0]),
|
| 1396 |
-
tp_inst = this._get(inst, 'timepicker')
|
|
Â
|
|
| 1397 |
Â
|
| 1398 |
Â
if (tp_inst && inst.settings.showTimepicker) {
|
| 1399 |
Â
tp_inst._limitMinMaxDateTime(inst, true);
|
|
Â
|
|
| 1400 |
Â
inst.inline = inst.stay_open = true;
|
| 1401 |
Â
//This way the onSelect handler called from calendarpicker get the full dateTime
|
| 1402 |
Â
this._base_selectDate(id, dateStr);
|
| 1403 |
-
inst.inline =
|
|
Â
|
|
| 1404 |
Â
this._notifyChange(inst);
|
| 1405 |
Â
this._updateDatepicker(inst);
|
| 1406 |
Â
} else {
|
|
@@ -1453,11 +1496,11 @@
|
|
| 1453 |
Â
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
| 1454 |
Â
.replace(/T/g, ampm ? 'AP' : '')
|
| 1455 |
Â
.replace(/tt/g, ampm ? 'apm' : '')
|
| 1456 |
-
.replace(/t/g, ampm ? 'ap' : '') +
|
| 1457 |
-
" " + tp_inst._defaults.separator +
|
| 1458 |
-
tp_inst._defaults.timeSuffix +
|
| 1459 |
-
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
| 1460 |
-
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
| 1461 |
Â
dateChars,
|
| 1462 |
Â
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
| 1463 |
Â
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
|
@@ -1480,11 +1523,11 @@
|
|
| 1480 |
Â
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
| 1481 |
Â
date = this._getDate(inst),
|
| 1482 |
Â
formatCfg = $.datepicker._getFormatConfig(inst),
|
| 1483 |
-
altFormattedDateTime = '',
|
| 1484 |
-
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
| 1485 |
Â
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
| 1486 |
Â
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
| 1487 |
-
|
| 1488 |
Â
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
| 1489 |
Â
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
|
| 1490 |
Â
if (tp_inst._defaults.altFormat) {
|
|
@@ -1498,7 +1541,7 @@
|
|
| 1498 |
Â
}
|
| 1499 |
Â
}
|
| 1500 |
Â
else {
|
| 1501 |
-
$.datepicker._base_updateAlternate(inst);
|
| 1502 |
Â
}
|
| 1503 |
Â
};
|
| 1504 |
Â
|
|
@@ -1524,18 +1567,23 @@
|
|
| 1524 |
Â
};
|
| 1525 |
Â
|
| 1526 |
Â
/*
|
| 1527 |
-
* override "Today" button to also grab the time.
|
| 1528 |
Â
*/
|
| 1529 |
Â
$.datepicker._base_gotoToday = $.datepicker._gotoToday;
|
| 1530 |
Â
$.datepicker._gotoToday = function (id) {
|
| 1531 |
-
var inst = this._getInst($(id)[0])
|
| 1532 |
-
$dp = inst.dpDiv;
|
| 1533 |
Â
this._base_gotoToday(id);
|
| 1534 |
Â
var tp_inst = this._get(inst, 'timepicker');
|
| 1535 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1536 |
Â
var now = new Date();
|
|
Â
|
|
| 1537 |
Â
this._setTime(inst, now);
|
| 1538 |
-
|
|
Â
|
|
| 1539 |
Â
};
|
| 1540 |
Â
|
| 1541 |
Â
/*
|
|
@@ -1587,7 +1635,7 @@
|
|
| 1587 |
Â
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
| 1588 |
Â
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
|
| 1589 |
Â
|
| 1590 |
-
//check if within min/max times..
|
| 1591 |
Â
tp_inst._limitMinMaxDateTime(inst, true);
|
| 1592 |
Â
|
| 1593 |
Â
tp_inst._onTimeChange();
|
|
@@ -1655,9 +1703,9 @@
|
|
| 1655 |
Â
} else {
|
| 1656 |
Â
tp_date = date;
|
| 1657 |
Â
}
|
| 1658 |
-
|
| 1659 |
-
// This is important if you are using the timezone option, javascript's Date
|
| 1660 |
-
// object will only return the timezone offset for the current locale, so we
|
| 1661 |
Â
// adjust it accordingly. If not using timezone option this won't matter..
|
| 1662 |
Â
// If a timezone is different in tp, keep the timezone as is
|
| 1663 |
Â
if (tp_inst && tp_date) {
|
|
@@ -1665,8 +1713,8 @@
|
|
| 1665 |
Â
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
| 1666 |
Â
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
|
| 1667 |
Â
}
|
| 1668 |
-
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
| 1669 |
-
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
|
| 1670 |
Â
}
|
| 1671 |
Â
|
| 1672 |
Â
this._updateDatepicker(inst);
|
|
@@ -1693,19 +1741,39 @@
|
|
| 1693 |
Â
}
|
| 1694 |
Â
|
| 1695 |
Â
var date = this._getDate(inst);
|
| 1696 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1697 |
Â
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
| 1698 |
Â
date.setMicroseconds(tp_inst.microsec);
|
| 1699 |
Â
|
| 1700 |
-
// This is important if you are using the timezone option, javascript's Date
|
| 1701 |
-
// object will only return the timezone offset for the current locale, so we
|
| 1702 |
Â
// adjust it accordingly. If not using timezone option this won't matter..
|
| 1703 |
Â
if (tp_inst.timezone != null) {
|
| 1704 |
Â
// look out for DST if tz wasn't specified
|
| 1705 |
Â
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
| 1706 |
Â
tp_inst.timezone = date.getTimezoneOffset() * -1;
|
| 1707 |
Â
}
|
| 1708 |
-
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
| 1709 |
Â
}
|
| 1710 |
Â
}
|
| 1711 |
Â
return date;
|
|
@@ -1767,7 +1835,10 @@
|
|
| 1767 |
Â
onselect = null,
|
| 1768 |
Â
overrides = tp_inst._defaults.evnts,
|
| 1769 |
Â
fns = {},
|
| 1770 |
-
prop
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1771 |
Â
if (typeof name === 'string') { // if min/max was set with the string
|
| 1772 |
Â
if (name === 'minDate' || name === 'minDateTime') {
|
| 1773 |
Â
min = value;
|
|
@@ -1825,13 +1896,24 @@
|
|
| 1825 |
Â
} else if (onselect) {
|
| 1826 |
Â
tp_inst._defaults.onSelect = onselect;
|
| 1827 |
Â
}
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1828 |
Â
}
|
| 1829 |
Â
if (value === undefined) {
|
| 1830 |
Â
return this._base_optionDatepicker.call($.datepicker, target, name);
|
| 1831 |
Â
}
|
| 1832 |
Â
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
| 1833 |
Â
};
|
| 1834 |
-
|
| 1835 |
Â
/*
|
| 1836 |
Â
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
|
| 1837 |
Â
* it will return false for all objects
|
|
@@ -1989,7 +2071,7 @@
|
|
| 1989 |
Â
hours = (off - minutes) / 60,
|
| 1990 |
Â
iso = iso8601 ? ':' : '',
|
| 1991 |
Â
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
|
| 1992 |
-
|
| 1993 |
Â
if (tz === '+00:00') {
|
| 1994 |
Â
return 'Z';
|
| 1995 |
Â
}
|
|
@@ -2009,7 +2091,7 @@
|
|
| 2009 |
Â
}
|
| 2010 |
Â
|
| 2011 |
Â
if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
|
| 2012 |
-
return tzString;
|
| 2013 |
Â
}
|
| 2014 |
Â
|
| 2015 |
Â
return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
|
|
@@ -2020,13 +2102,15 @@
|
|
| 2020 |
Â
/**
|
| 2021 |
Â
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
|
| 2022 |
Â
* @param {Date} date
|
|
Â
|
|
| 2023 |
Â
* @param {string} toTimezone formatted like "+0500", "-1245"
|
| 2024 |
Â
* @return {Date}
|
| 2025 |
Â
*/
|
| 2026 |
-
$.timepicker.timezoneAdjust = function (date, toTimezone) {
|
|
Â
|
|
| 2027 |
Â
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
|
| 2028 |
Â
if (!isNaN(toTz)) {
|
| 2029 |
-
date.setMinutes(date.getMinutes() + -
|
| 2030 |
Â
}
|
| 2031 |
Â
return date;
|
| 2032 |
Â
};
|
|
@@ -2133,6 +2217,7 @@
|
|
| 2133 |
Â
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
|
| 2134 |
Â
}
|
| 2135 |
Â
}
|
|
Â
|
|
| 2136 |
Â
if (date.getTime) {
|
| 2137 |
Â
other[method].call(other, 'option', option, date);
|
| 2138 |
Â
}
|
|
@@ -2158,8 +2243,10 @@
|
|
| 2158 |
Â
}, options, options.end));
|
| 2159 |
Â
|
| 2160 |
Â
checkDates(startTime, endTime);
|
|
Â
|
|
| 2161 |
Â
selected(startTime, endTime, 'minDate');
|
| 2162 |
Â
selected(endTime, startTime, 'maxDate');
|
|
Â
|
|
| 2163 |
Â
return $([startTime.get(0), endTime.get(0)]);
|
| 2164 |
Â
};
|
| 2165 |
Â
|
|
@@ -2168,9 +2255,10 @@
|
|
| 2168 |
Â
* @param {Object} err pass any type object to log to the console during error or debugging
|
| 2169 |
Â
* @return {void}
|
| 2170 |
Â
*/
|
| 2171 |
-
$.timepicker.log = function (
|
| 2172 |
-
|
| 2173 |
-
|
|
Â
|
|
| 2174 |
Â
}
|
| 2175 |
Â
};
|
| 2176 |
Â
|
|
@@ -2206,4 +2294,4 @@
|
|
| 2206 |
Â
*/
|
| 2207 |
Â
$.timepicker.version = "@@version";
|
| 2208 |
Â
|
| 2209 |
-
})
|
| 7 |
Â
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
|
| 8 |
Â
*/
|
| 9 |
Â
|
| 10 |
+
(function (factory) {
|
| 11 |
+
if (typeof define === 'function' && define.amd) {
|
| 12 |
+
define(['jquery', 'jquery-ui'], factory);
|
| 13 |
+
} else {
|
| 14 |
+
factory(jQuery);
|
| 15 |
+
}
|
| 16 |
+
}(function ($) {
|
| 17 |
Â
|
| 18 |
Â
/*
|
| 19 |
Â
* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
|
| 32 |
Â
}
|
| 33 |
Â
});
|
| 34 |
Â
|
| 35 |
+
/*
|
| 36 |
Â
* Timepicker manager.
|
| 37 |
Â
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
|
| 38 |
Â
* Settings for (groups of) time pickers are maintained in an instance object,
|
| 113 |
Â
addSliderAccess: false,
|
| 114 |
Â
sliderAccessArgs: null,
|
| 115 |
Â
controlType: 'slider',
|
| 116 |
+
oneLine: false,
|
| 117 |
Â
defaultValue: null,
|
| 118 |
+
parse: 'strict',
|
| 119 |
+
afterInject: null
|
| 120 |
Â
};
|
| 121 |
Â
$.extend(this._defaults, this.regional['']);
|
| 122 |
Â
};
|
| 159 |
Â
support: {},
|
| 160 |
Â
control: null,
|
| 161 |
Â
|
| 162 |
+
/*
|
| 163 |
Â
* Override the default settings for all instances of the time picker.
|
| 164 |
Â
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
|
| 165 |
Â
* @return {Object} the manager object
|
| 199 |
Â
},
|
| 200 |
Â
onChangeMonthYear: function (year, month, dp_inst) {
|
| 201 |
Â
// Update the time as well : this prevents the time from disappearing from the $input field.
|
| 202 |
+
// tp_inst._updateDateTime(dp_inst);
|
| 203 |
Â
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
|
| 204 |
Â
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
|
| 205 |
Â
}
|
| 215 |
Â
};
|
| 216 |
Â
for (i in overrides) {
|
| 217 |
Â
if (overrides.hasOwnProperty(i)) {
|
| 218 |
+
fns[i] = opts[i] || this._defaults[i] || null;
|
| 219 |
Â
}
|
| 220 |
Â
}
|
| 221 |
Â
|
| 232 |
Â
|
| 233 |
Â
// detect which units are supported
|
| 234 |
Â
tp_inst.support = detectSupport(
|
| 235 |
+
tp_inst._defaults.timeFormat +
|
| 236 |
Â
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
|
| 237 |
Â
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
|
| 238 |
Â
|
| 321 |
Â
* add our sliders to the calendar
|
| 322 |
Â
*/
|
| 323 |
Â
_addTimePicker: function (dp_inst) {
|
| 324 |
+
var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());
|
| 325 |
Â
|
| 326 |
Â
this.timeDefined = this._parseTime(currDT);
|
| 327 |
Â
this._limitMinMaxDateTime(dp_inst, false);
|
| 328 |
Â
this._injectTimePicker();
|
| 329 |
+
this._afterInject();
|
| 330 |
Â
},
|
| 331 |
Â
|
| 332 |
Â
/*
|
| 363 |
Â
}
|
| 364 |
Â
},
|
| 365 |
Â
|
| 366 |
+
/*
|
| 367 |
+
* Handle callback option after injecting timepicker
|
| 368 |
+
*/
|
| 369 |
+
_afterInject: function() {
|
| 370 |
+
var o = this.inst.settings;
|
| 371 |
+
if ($.isFunction(o.afterInject)) {
|
| 372 |
+
o.afterInject.call(this);
|
| 373 |
+
}
|
| 374 |
+
},
|
| 375 |
+
|
| 376 |
Â
/*
|
| 377 |
Â
* generate and inject html for timepicker into ui datepicker
|
| 378 |
Â
*/
|
| 391 |
Â
|
| 392 |
Â
// Prevent displaying twice
|
| 393 |
Â
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
| 394 |
+
var noDisplay = ' ui_tpicker_unit_hide',
|
| 395 |
+
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' +
|
| 396 |
+
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';
|
| 397 |
Â
|
| 398 |
Â
// Create the markup
|
| 399 |
Â
for (i = 0, l = this.units.length; i < l; i++) {
|
| 407 |
Â
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
|
| 408 |
Â
gridSize[litem] = 0;
|
| 409 |
Â
|
| 410 |
+
html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
|
| 411 |
+
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';
|
| 412 |
Â
|
| 413 |
Â
if (show && o[litem + 'Grid'] > 0) {
|
| 414 |
Â
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
|
| 431 |
Â
}
|
| 432 |
Â
html += '</dd>';
|
| 433 |
Â
}
|
| 434 |
+
|
| 435 |
Â
// Timezone
|
| 436 |
Â
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
|
| 437 |
+
html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
|
| 438 |
+
html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>';
|
| 439 |
Â
|
| 440 |
Â
// Create the elements from string
|
| 441 |
Â
html += '</dl></div>';
|
| 446 |
Â
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
| 447 |
Â
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
| 448 |
Â
}
|
| 449 |
+
|
| 450 |
Â
// add sliders, adjust grids, add events
|
| 451 |
Â
for (i = 0, l = tp_inst.units.length; i < l; i++) {
|
| 452 |
Â
litem = tp_inst.units[i];
|
| 481 |
Â
}
|
| 482 |
Â
}
|
| 483 |
Â
}
|
| 484 |
+
|
| 485 |
Â
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
| 486 |
Â
|
| 487 |
Â
tp_inst._onTimeChange();
|
| 518 |
Â
this.timezone_select.change(function () {
|
| 519 |
Â
tp_inst._onTimeChange();
|
| 520 |
Â
tp_inst._onSelectHandler();
|
| 521 |
+
tp_inst._afterInject();
|
| 522 |
Â
});
|
| 523 |
Â
// End timezone options
|
| 524 |
+
|
| 525 |
Â
// inject timepicker into datepicker
|
| 526 |
Â
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
| 527 |
Â
if ($buttonPanel.length) {
|
| 530 |
Â
$dp.append($tp);
|
| 531 |
Â
}
|
| 532 |
Â
|
| 533 |
+
this.$timeObj = $tp.find('.ui_tpicker_time_input');
|
| 534 |
+
this.$timeObj.change(function () {
|
| 535 |
+
var timeFormat = tp_inst.inst.settings.timeFormat;
|
| 536 |
+
var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
|
| 537 |
+
var update = new Date();
|
| 538 |
+
if (parsedTime) {
|
| 539 |
+
update.setHours(parsedTime.hour);
|
| 540 |
+
update.setMinutes(parsedTime.minute);
|
| 541 |
+
update.setSeconds(parsedTime.second);
|
| 542 |
+
$.datepicker._setTime(tp_inst.inst, update);
|
| 543 |
+
} else {
|
| 544 |
+
this.value = tp_inst.formattedTime;
|
| 545 |
+
this.blur();
|
| 546 |
+
}
|
| 547 |
+
});
|
| 548 |
Â
|
| 549 |
Â
if (this.inst !== null) {
|
| 550 |
Â
var timeDefined = this.timeDefined;
|
| 557 |
Â
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
| 558 |
Â
rtl = this._defaults.isRTL;
|
| 559 |
Â
sliderAccessArgs.isRTL = rtl;
|
| 560 |
+
|
| 561 |
Â
setTimeout(function () { // fix for inline mode
|
| 562 |
Â
if ($tp.find('.ui-slider-access').length === 0) {
|
| 563 |
Â
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
| 709 |
Â
}
|
| 710 |
Â
}
|
| 711 |
Â
|
| 712 |
+
if (dp_inst.settings.minTime!==null) {
|
| 713 |
+
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
|
| 714 |
Â
if (this.hour<tempMinTime.getHours()) {
|
| 715 |
Â
this.hour=this._defaults.hourMin=tempMinTime.getHours();
|
| 716 |
+
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 717 |
Â
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
|
| 718 |
Â
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 719 |
+
} else {
|
| 720 |
Â
if (this._defaults.hourMin<tempMinTime.getHours()) {
|
| 721 |
Â
this._defaults.hourMin=tempMinTime.getHours();
|
| 722 |
+
this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 723 |
Â
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
|
| 724 |
+
this._defaults.minuteMin=tempMinTime.getMinutes();
|
| 725 |
Â
} else {
|
| 726 |
Â
this._defaults.minuteMin=0;
|
| 727 |
Â
}
|
| 728 |
+
}
|
| 729 |
Â
}
|
| 730 |
+
|
| 731 |
+
if (dp_inst.settings.maxTime!==null) {
|
| 732 |
Â
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
|
| 733 |
Â
if (this.hour>tempMaxTime.getHours()) {
|
| 734 |
+
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
|
| 735 |
+
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 736 |
+
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
|
| 737 |
Â
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
|
Â
|
|
|
Â
|
|
| 738 |
Â
} else {
|
| 739 |
Â
if (this._defaults.hourMax>tempMaxTime.getHours()) {
|
| 740 |
Â
this._defaults.hourMax=tempMaxTime.getHours();
|
| 741 |
+
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 742 |
Â
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
|
| 743 |
+
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
| 744 |
Â
} else {
|
| 745 |
Â
this._defaults.minuteMax=59;
|
| 746 |
Â
}
|
| 747 |
+
}
|
| 748 |
Â
}
|
| 749 |
+
|
| 750 |
Â
if (adjustSliders !== undefined && adjustSliders === true) {
|
| 751 |
Â
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
|
| 752 |
Â
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
|
| 840 |
Â
// If the update was done using the sliders, update the input field.
|
| 841 |
Â
var hasChanged = (
|
| 842 |
Â
hour !== parseInt(this.hour,10) || // sliders should all be numeric
|
| 843 |
+
minute !== parseInt(this.minute,10) ||
|
| 844 |
+
second !== parseInt(this.second,10) ||
|
| 845 |
+
millisec !== parseInt(this.millisec,10) ||
|
| 846 |
+
microsec !== parseInt(this.microsec,10) ||
|
| 847 |
+
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
|
| 848 |
Â
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
|
| 849 |
Â
);
|
| 850 |
Â
|
| 883 |
Â
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
|
| 884 |
Â
if (this.$timeObj) {
|
| 885 |
Â
if (pickerTimeFormat === o.timeFormat) {
|
| 886 |
+
this.$timeObj.val(this.formattedTime + pickerTimeSuffix);
|
| 887 |
Â
}
|
| 888 |
Â
else {
|
| 889 |
+
this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
|
| 890 |
+
}
|
| 891 |
+
if (this.$timeObj[0].setSelectionRange) {
|
| 892 |
+
var sPos = this.$timeObj[0].selectionStart;
|
| 893 |
+
var ePos = this.$timeObj[0].selectionEnd;
|
| 894 |
+
this.$timeObj[0].setSelectionRange(sPos, ePos);
|
| 895 |
Â
}
|
| 896 |
Â
}
|
| 897 |
Â
|
| 919 |
Â
*/
|
| 920 |
Â
_updateDateTime: function (dp_inst) {
|
| 921 |
Â
dp_inst = this.inst || dp_inst;
|
| 922 |
+
var dtTmp = (dp_inst.currentYear > 0?
|
| 923 |
+
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
|
| 924 |
Â
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
| 925 |
Â
dt = $.datepicker._daylightSavingAdjust(dtTmp),
|
| 926 |
Â
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
| 930 |
Â
timeAvailable = dt !== null && this.timeDefined;
|
| 931 |
Â
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
| 932 |
Â
var formattedDateTime = this.formattedDate;
|
| 933 |
+
|
| 934 |
Â
// if a slider was changed but datepicker doesn't have a value yet, set it
|
| 935 |
Â
if (dp_inst.lastVal === "") {
|
| 936 |
Â
dp_inst.currentYear = dp_inst.selectedYear;
|
| 940 |
Â
|
| 941 |
Â
/*
|
| 942 |
Â
* remove following lines to force every changes in date picker to change the input value
|
| 943 |
+
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
| 944 |
Â
* If the user manually empty the value in the input field, the date picker will never change selected value.
|
| 945 |
Â
*/
|
| 946 |
Â
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
|
| 965 |
Â
var altFormattedDateTime = '',
|
| 966 |
Â
altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
|
| 967 |
Â
altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
| 968 |
+
|
| 969 |
Â
if (!this._defaults.timeOnly) {
|
| 970 |
Â
if (this._defaults.altFormat) {
|
| 971 |
Â
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
| 1032 |
Â
stop: function (event, ui) {
|
| 1033 |
Â
tp_inst._onSelectHandler();
|
| 1034 |
Â
}
|
| 1035 |
+
});
|
| 1036 |
Â
},
|
| 1037 |
Â
options: function (tp_inst, obj, unit, opts, val) {
|
| 1038 |
Â
if (tp_inst._defaults.isRTL) {
|
| 1045 |
Â
}
|
| 1046 |
Â
return obj.slider(opts);
|
| 1047 |
Â
}
|
| 1048 |
+
var min = opts.min,
|
| 1049 |
Â
max = opts.max;
|
| 1050 |
Â
opts.min = opts.max = null;
|
| 1051 |
Â
if (min !== undefined) {
|
| 1077 |
Â
// select methods
|
| 1078 |
Â
select: {
|
| 1079 |
Â
create: function (tp_inst, obj, unit, val, min, max, step) {
|
| 1080 |
+
var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
|
| 1081 |
Â
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
|
| 1082 |
Â
|
| 1083 |
Â
for (var i = min; i <= max; i += step) {
|
| 1096 |
Â
$(sel).appendTo(obj).change(function (e) {
|
| 1097 |
Â
tp_inst._onTimeChange();
|
| 1098 |
Â
tp_inst._onSelectHandler();
|
| 1099 |
+
tp_inst._afterInject();
|
| 1100 |
Â
});
|
| 1101 |
Â
|
| 1102 |
Â
return obj;
|
| 1108 |
Â
if (val === undefined) {
|
| 1109 |
Â
return $t.data(opts);
|
| 1110 |
Â
}
|
| 1111 |
+
o[opts] = val;
|
| 1112 |
Â
}
|
| 1113 |
Â
else { o = opts; }
|
| 1114 |
+
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
|
| 1115 |
Â
},
|
| 1116 |
Â
value: function (tp_inst, obj, unit, val) {
|
| 1117 |
Â
var $t = obj.children('select');
|
| 1275 |
Â
ampm = '';
|
| 1276 |
Â
resTime.ampm = '';
|
| 1277 |
Â
} else {
|
| 1278 |
+
ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM';
|
| 1279 |
Â
resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
|
| 1280 |
Â
}
|
| 1281 |
Â
}
|
| 1343 |
Â
}
|
| 1344 |
Â
catch (err2) {
|
| 1345 |
Â
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
|
| 1346 |
+
}
|
| 1347 |
Â
}
|
| 1348 |
Â
return false;
|
| 1349 |
Â
}; // end looseParse
|
| 1350 |
+
|
| 1351 |
Â
if (typeof o.parse === "function") {
|
| 1352 |
Â
return o.parse(timeFormat, timeString, o);
|
| 1353 |
Â
}
|
| 1433 |
Â
$.datepicker._base_selectDate = $.datepicker._selectDate;
|
| 1434 |
Â
$.datepicker._selectDate = function (id, dateStr) {
|
| 1435 |
Â
var inst = this._getInst($(id)[0]),
|
| 1436 |
+
tp_inst = this._get(inst, 'timepicker'),
|
| 1437 |
+
was_inline;
|
| 1438 |
Â
|
| 1439 |
Â
if (tp_inst && inst.settings.showTimepicker) {
|
| 1440 |
Â
tp_inst._limitMinMaxDateTime(inst, true);
|
| 1441 |
+
was_inline = inst.inline;
|
| 1442 |
Â
inst.inline = inst.stay_open = true;
|
| 1443 |
Â
//This way the onSelect handler called from calendarpicker get the full dateTime
|
| 1444 |
Â
this._base_selectDate(id, dateStr);
|
| 1445 |
+
inst.inline = was_inline;
|
| 1446 |
+
inst.stay_open = false;
|
| 1447 |
Â
this._notifyChange(inst);
|
| 1448 |
Â
this._updateDatepicker(inst);
|
| 1449 |
Â
} else {
|
| 1496 |
Â
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
| 1497 |
Â
.replace(/T/g, ampm ? 'AP' : '')
|
| 1498 |
Â
.replace(/tt/g, ampm ? 'apm' : '')
|
| 1499 |
+
.replace(/t/g, ampm ? 'ap' : '') +
|
| 1500 |
+
" " + tp_inst._defaults.separator +
|
| 1501 |
+
tp_inst._defaults.timeSuffix +
|
| 1502 |
+
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
| 1503 |
+
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
| 1504 |
Â
dateChars,
|
| 1505 |
Â
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
| 1506 |
Â
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
| 1523 |
Â
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
| 1524 |
Â
date = this._getDate(inst),
|
| 1525 |
Â
formatCfg = $.datepicker._getFormatConfig(inst),
|
| 1526 |
+
altFormattedDateTime = '',
|
| 1527 |
+
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
| 1528 |
Â
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
| 1529 |
Â
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
| 1530 |
+
|
| 1531 |
Â
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
| 1532 |
Â
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
|
| 1533 |
Â
if (tp_inst._defaults.altFormat) {
|
| 1541 |
Â
}
|
| 1542 |
Â
}
|
| 1543 |
Â
else {
|
| 1544 |
+
$.datepicker._base_updateAlternate(inst);
|
| 1545 |
Â
}
|
| 1546 |
Â
};
|
| 1547 |
Â
|
| 1567 |
Â
};
|
| 1568 |
Â
|
| 1569 |
Â
/*
|
| 1570 |
+
* override "Today" button to also grab the time and set it to input field.
|
| 1571 |
Â
*/
|
| 1572 |
Â
$.datepicker._base_gotoToday = $.datepicker._gotoToday;
|
| 1573 |
Â
$.datepicker._gotoToday = function (id) {
|
| 1574 |
+
var inst = this._getInst($(id)[0]);
|
|
Â
|
|
| 1575 |
Â
this._base_gotoToday(id);
|
| 1576 |
Â
var tp_inst = this._get(inst, 'timepicker');
|
| 1577 |
+
if (!tp_inst) {
|
| 1578 |
+
return;
|
| 1579 |
+
}
|
| 1580 |
+
|
| 1581 |
+
var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
|
| 1582 |
Â
var now = new Date();
|
| 1583 |
+
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));
|
| 1584 |
Â
this._setTime(inst, now);
|
| 1585 |
+
this._setDate(inst, now);
|
| 1586 |
+
tp_inst._onSelectHandler();
|
| 1587 |
Â
};
|
| 1588 |
Â
|
| 1589 |
Â
/*
|
| 1635 |
Â
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
| 1636 |
Â
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
|
| 1637 |
Â
|
| 1638 |
+
//check if within min/max times..
|
| 1639 |
Â
tp_inst._limitMinMaxDateTime(inst, true);
|
| 1640 |
Â
|
| 1641 |
Â
tp_inst._onTimeChange();
|
| 1703 |
Â
} else {
|
| 1704 |
Â
tp_date = date;
|
| 1705 |
Â
}
|
| 1706 |
+
|
| 1707 |
+
// This is important if you are using the timezone option, javascript's Date
|
| 1708 |
+
// object will only return the timezone offset for the current locale, so we
|
| 1709 |
Â
// adjust it accordingly. If not using timezone option this won't matter..
|
| 1710 |
Â
// If a timezone is different in tp, keep the timezone as is
|
| 1711 |
Â
if (tp_inst && tp_date) {
|
| 1713 |
Â
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
| 1714 |
Â
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
|
| 1715 |
Â
}
|
| 1716 |
+
date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);
|
| 1717 |
+
tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);
|
| 1718 |
Â
}
|
| 1719 |
Â
|
| 1720 |
Â
this._updateDatepicker(inst);
|
| 1741 |
Â
}
|
| 1742 |
Â
|
| 1743 |
Â
var date = this._getDate(inst);
|
| 1744 |
+
|
| 1745 |
+
var currDT = null;
|
| 1746 |
+
|
| 1747 |
+
if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {
|
| 1748 |
+
currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val();
|
| 1749 |
+
}
|
| 1750 |
+
else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) {
|
| 1751 |
+
/**
|
| 1752 |
+
* in case the datetimepicker has been applied to a non-input tag for inline UI,
|
| 1753 |
+
* and the user has not configured the plugin to display only time in altInput,
|
| 1754 |
+
* pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
|
| 1755 |
+
*
|
| 1756 |
+
* @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values
|
| 1757 |
+
*/
|
| 1758 |
+
currDT = tp_inst.$altInput.val();
|
| 1759 |
+
}
|
| 1760 |
+
else {
|
| 1761 |
+
currDT = tp_inst.$input.val();
|
| 1762 |
+
}
|
| 1763 |
+
|
| 1764 |
+
if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
|
| 1765 |
Â
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
| 1766 |
Â
date.setMicroseconds(tp_inst.microsec);
|
| 1767 |
Â
|
| 1768 |
+
// This is important if you are using the timezone option, javascript's Date
|
| 1769 |
+
// object will only return the timezone offset for the current locale, so we
|
| 1770 |
Â
// adjust it accordingly. If not using timezone option this won't matter..
|
| 1771 |
Â
if (tp_inst.timezone != null) {
|
| 1772 |
Â
// look out for DST if tz wasn't specified
|
| 1773 |
Â
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
| 1774 |
Â
tp_inst.timezone = date.getTimezoneOffset() * -1;
|
| 1775 |
Â
}
|
| 1776 |
+
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));
|
| 1777 |
Â
}
|
| 1778 |
Â
}
|
| 1779 |
Â
return date;
|
| 1835 |
Â
onselect = null,
|
| 1836 |
Â
overrides = tp_inst._defaults.evnts,
|
| 1837 |
Â
fns = {},
|
| 1838 |
+
prop,
|
| 1839 |
+
ret,
|
| 1840 |
+
oldVal,
|
| 1841 |
+
$target;
|
| 1842 |
Â
if (typeof name === 'string') { // if min/max was set with the string
|
| 1843 |
Â
if (name === 'minDate' || name === 'minDateTime') {
|
| 1844 |
Â
min = value;
|
| 1896 |
Â
} else if (onselect) {
|
| 1897 |
Â
tp_inst._defaults.onSelect = onselect;
|
| 1898 |
Â
}
|
| 1899 |
+
|
| 1900 |
+
// Datepicker will override our date when we call _base_optionDatepicker when
|
| 1901 |
+
// calling minDate/maxDate, so we will first grab the value, call
|
| 1902 |
+
// _base_optionDatepicker, then set our value back.
|
| 1903 |
+
if(min || max){
|
| 1904 |
+
$target = $(target);
|
| 1905 |
+
oldVal = $target.datetimepicker('getDate');
|
| 1906 |
+
ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
| 1907 |
+
$target.datetimepicker('setDate', oldVal);
|
| 1908 |
+
return ret;
|
| 1909 |
+
}
|
| 1910 |
Â
}
|
| 1911 |
Â
if (value === undefined) {
|
| 1912 |
Â
return this._base_optionDatepicker.call($.datepicker, target, name);
|
| 1913 |
Â
}
|
| 1914 |
Â
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
| 1915 |
Â
};
|
| 1916 |
+
|
| 1917 |
Â
/*
|
| 1918 |
Â
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
|
| 1919 |
Â
* it will return false for all objects
|
| 2071 |
Â
hours = (off - minutes) / 60,
|
| 2072 |
Â
iso = iso8601 ? ':' : '',
|
| 2073 |
Â
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
|
| 2074 |
+
|
| 2075 |
Â
if (tz === '+00:00') {
|
| 2076 |
Â
return 'Z';
|
| 2077 |
Â
}
|
| 2091 |
Â
}
|
| 2092 |
Â
|
| 2093 |
Â
if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
|
| 2094 |
+
return parseInt(tzString, 10);
|
| 2095 |
Â
}
|
| 2096 |
Â
|
| 2097 |
Â
return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
|
| 2102 |
Â
/**
|
| 2103 |
Â
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
|
| 2104 |
Â
* @param {Date} date
|
| 2105 |
+
* @param {string} fromTimezone formatted like "+0500", "-1245"
|
| 2106 |
Â
* @param {string} toTimezone formatted like "+0500", "-1245"
|
| 2107 |
Â
* @return {Date}
|
| 2108 |
Â
*/
|
| 2109 |
+
$.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {
|
| 2110 |
+
var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);
|
| 2111 |
Â
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
|
| 2112 |
Â
if (!isNaN(toTz)) {
|
| 2113 |
+
date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz));
|
| 2114 |
Â
}
|
| 2115 |
Â
return date;
|
| 2116 |
Â
};
|
| 2217 |
Â
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
|
| 2218 |
Â
}
|
| 2219 |
Â
}
|
| 2220 |
+
|
| 2221 |
Â
if (date.getTime) {
|
| 2222 |
Â
other[method].call(other, 'option', option, date);
|
| 2223 |
Â
}
|
| 2243 |
Â
}, options, options.end));
|
| 2244 |
Â
|
| 2245 |
Â
checkDates(startTime, endTime);
|
| 2246 |
+
|
| 2247 |
Â
selected(startTime, endTime, 'minDate');
|
| 2248 |
Â
selected(endTime, startTime, 'maxDate');
|
| 2249 |
+
|
| 2250 |
Â
return $([startTime.get(0), endTime.get(0)]);
|
| 2251 |
Â
};
|
| 2252 |
Â
|
| 2255 |
Â
* @param {Object} err pass any type object to log to the console during error or debugging
|
| 2256 |
Â
* @return {void}
|
| 2257 |
Â
*/
|
| 2258 |
+
$.timepicker.log = function () {
|
| 2259 |
+
// Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.
|
| 2260 |
+
if (window.console && window.console.log && window.console.log.apply) {
|
| 2261 |
+
window.console.log.apply(window.console, Array.prototype.slice.call(arguments));
|
| 2262 |
Â
}
|
| 2263 |
Â
};
|
| 2264 |
Â
|
| 2294 |
Â
*/
|
| 2295 |
Â
$.timepicker.version = "@@version";
|
| 2296 |
Â
|
| 2297 |
+
}));
|
|
@@ -0,0 +1,2 @@
|
|
|
Â
|
|
|
Â
|
| 1 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"@@version"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),0!==tp_inst._defaults.minDate&&0!==tp_inst._defaults.minDateTime||(tp_inst._defaults.minDate=new Date),0!==tp_inst._defaults.maxDate&&0!==tp_inst._defaults.maxDateTime||(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"><input class="ui_tpicker_time_input" '+(b.timeInput?"":"disabled")+"/></dd>";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time_input"),this.$timeObj.change(function(){var a=c.inst.settings.timeFormat,b=$.datepicker.parseTime(a,this.value),d=new Date;b?(d.setHours(b.hour),d.setMinutes(b.minute),d.setSeconds(b.second),$.datepicker._setTime(c.inst,d)):(this.value=c.formattedTime,this.blur())}),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);null!==this.hourMinOriginal&&null!==this.minuteMinOriginal&&null!==this.secondMinOriginal&&null!==this.millisecMinOriginal&&null!==this.microsecMinOriginal||(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);null!==this.hourMaxOriginal&&null!==this.minuteMaxOriginal&&null!==this.secondMaxOriginal&&null!==this.millisecMaxOriginal||(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();if(k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&(h===g.timeFormat?this.$timeObj.val(this.formattedTime+i):this.$timeObj.val($.datepicker.formatTime(h,this,g)+i),this.$timeObj[0].setSelectionRange)){var l=this.$timeObj[0].selectionStart,m=this.$timeObj[0].selectionEnd;this.$timeObj[0].setSelectionRange(l,m)}this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");
|
| 2 |
+
if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]);this._base_gotoToday(a);var c=this._get(b,"timepicker");if(c){var d=$.timepicker.timezoneOffsetNumber(c.timezone),e=new Date;e.setMinutes(e.getMinutes()+e.getTimezoneOffset()+parseInt(d,10)),this._setTime(b,e),this._setDate(b,e),c._onSelectHandler()}},$.datepicker._disableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,$.timepicker.timezoneOffsetString(-d.getTimezoneOffset()),f.timezone),e=$.timepicker.timezoneAdjust(e,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset()),f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f=null;return f=d.$altInput&&d._defaults.altFieldTimeOnly?d.$input.val()+" "+d.$altInput.val():"INPUT"!==d.$input.get(0).tagName&&d.$altInput?d.$altInput.val():d.$input.val(),e&&d._parseTime(f,!c.settings.timeOnly)&&(e.setHours(d.hour,d.minute,d.second,d.millisec),e.setMicroseconds(d.microsec),null!=d.timezone&&(d.support.timezone||null!==d._defaults.timezone||(d.timezone=-1*e.getTimezoneOffset()),e=$.timepicker.timezoneAdjust(e,d.timezone,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset())))),e}return this._base_getDateDatepicker(a,b)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(a,b,c){var d;try{d=this._base_parseDate(a,b,c)}catch(e){if(!(e.indexOf(":")>=0))throw e;d=this._base_parseDate(a,b.substring(0,b.length-(e.length-e.indexOf(":")-2)),c),$.timepicker.log("Error parsing the date string: "+e+"\ndate string = "+b+"\ndate format = "+a)}return d},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(a,b,c,d){var e=this._get(a,"timepicker");return e?(e._updateDateTime(a),e.$input.val()):this._base_formatDate(a)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(a,b,c){var d,e=this._getInst(a);if(!e)return null;var f=this._get(e,"timepicker");if(f){var g,h,i,j,k=null,l=null,m=null,n=f._defaults.evnts,o={};if("string"==typeof b){if("minDate"===b||"minDateTime"===b)k=c;else if("maxDate"===b||"maxDateTime"===b)l=c;else if("onSelect"===b)m=c;else if(n.hasOwnProperty(b)){if("undefined"==typeof c)return n[b];o[b]=c,d={}}}else if("object"==typeof b){b.minDate?k=b.minDate:b.minDateTime?k=b.minDateTime:b.maxDate?l=b.maxDate:b.maxDateTime&&(l=b.maxDateTime);for(g in n)n.hasOwnProperty(g)&&b[g]&&(o[g]=b[g])}for(g in o)o.hasOwnProperty(g)&&(n[g]=o[g],d||(d=$.extend({},b)),delete d[g]);if(d&&isEmptyObject(d))return;if(k?(k=0===k?new Date:new Date(k),f._defaults.minDate=k,f._defaults.minDateTime=k):l?(l=0===l?new Date:new Date(l),f._defaults.maxDate=l,f._defaults.maxDateTime=l):m&&(f._defaults.onSelect=m),k||l)return j=$(a),i=j.datetimepicker("getDate"),h=this._base_optionDatepicker.call($.datepicker,a,d||b,c),j.datetimepicker("setDate",i),h}return void 0===c?this._base_optionDatepicker.call($.datepicker,a,b):this._base_optionDatepicker.call($.datepicker,a,d||b,c)};var isEmptyObject=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0},extendRemove=function(a,b){$.extend(a,b);for(var c in b)null!==b[c]&&void 0!==b[c]||(a[c]=b[c]);return a},detectSupport=function(a){var b=a.replace(/'.*?'/g,"").toLowerCase(),c=function(a,b){return-1!==a.indexOf(b)};return{hour:c(b,"h"),minute:c(b,"m"),second:c(b,"s"),millisec:c(b,"l"),microsec:c(b,"c"),timezone:c(b,"z"),ampm:c(b,"t")&&c(a,"h"),iso8601:c(a,"Z")}},convert24to12=function(a){return a%=12,0===a&&(a=12),String(a)},computeEffectiveSetting=function(a,b){return a&&a[b]?a[b]:$.timepicker._defaults[b]},splitDateTime=function(a,b){var c=computeEffectiveSetting(b,"separator"),d=computeEffectiveSetting(b,"timeFormat"),e=d.split(c),f=e.length,g=a.split(c),h=g.length;return h>1?{dateString:g.splice(0,h-f).join(c),timeString:g.splice(0,f).join(c)}:{dateString:a,timeString:""}},parseDateTimeInternal=function(a,b,c,d,e){var f,g,h;if(g=splitDateTime(c,e),f=$.datepicker._base_parseDate(a,g.dateString,d),""===g.timeString)return{date:f};if(h=$.datepicker.parseTime(b,g.timeString,e),!h)throw"Wrong time format";return{date:f,timeObj:h}},selectLocalTimezone=function(a,b){if(a&&a.timezone_select){var c=b||new Date;a.timezone_select.val(-c.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(a,b){if(isNaN(a)||a>840||-720>a)return a;var c=a,d=c%60,e=(c-d)/60,f=b?":":"",g=(c>=0?"+":"-")+("0"+Math.abs(e)).slice(-2)+f+("0"+Math.abs(d)).slice(-2);return"+00:00"===g?"Z":g},$.timepicker.timezoneOffsetNumber=function(a){var b=a.toString().replace(":","");return"Z"===b.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(b)?("-"===b.substr(0,1)?-1:1)*(60*parseInt(b.substr(1,2),10)+parseInt(b.substr(3,2),10)):parseInt(a,10)},$.timepicker.timezoneAdjust=function(a,b,c){var d=$.timepicker.timezoneOffsetNumber(b),e=$.timepicker.timezoneOffsetNumber(c);return isNaN(e)||a.setMinutes(a.getMinutes()+-d- -e),a},$.timepicker.timeRange=function(a,b,c){return $.timepicker.handleRange("timepicker",a,b,c)},$.timepicker.datetimeRange=function(a,b,c){$.timepicker.handleRange("datetimepicker",a,b,c)},$.timepicker.dateRange=function(a,b,c){$.timepicker.handleRange("datepicker",a,b,c)},$.timepicker.handleRange=function(a,b,c,d){function e(e,f){var g=b[a]("getDate"),h=c[a]("getDate"),i=e[a]("getDate");if(null!==g){var j=new Date(g.getTime()),k=new Date(g.getTime());j.setMilliseconds(j.getMilliseconds()+d.minInterval),k.setMilliseconds(k.getMilliseconds()+d.maxInterval),d.minInterval>0&&j>h?c[a]("setDate",j):d.maxInterval>0&&h>k?c[a]("setDate",k):g>h&&f[a]("setDate",i)}}function f(b,c,e){if(b.val()){var f=b[a].call(b,"getDate");null!==f&&d.minInterval>0&&("minDate"===e&&f.setMilliseconds(f.getMilliseconds()+d.minInterval),"maxDate"===e&&f.setMilliseconds(f.getMilliseconds()-d.minInterval)),f.getTime&&c[a].call(c,"option",e,f)}}d=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},d);var g=!1;return"timepicker"===a&&(g=!0,a="datetimepicker"),$.fn[a].call(b,$.extend({timeOnly:g,onClose:function(a,b){e($(this),c)},onSelect:function(a){f($(this),c,"minDate")}},d,d.start)),$.fn[a].call(c,$.extend({timeOnly:g,onClose:function(a,c){e($(this),b)},onSelect:function(a){f($(this),b,"maxDate")}},d,d.end)),e(b,c),f(b,c,"minDate"),f(c,b,"maxDate"),$([b.get(0),c.get(0)])},$.timepicker.log=function(){window.console&&window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+Math.floor(a/1e3)),this.microseconds=a%1e3,this}),$.timepicker.version="@@version"}});
|
|
@@ -1,7 +1,7 @@
|
|
| 1 |
Â
/* http://keith-wood.name/countdown.html
|
| 2 |
-
Countdown for jQuery v2.0.
|
| 3 |
Â
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
|
| 4 |
-
Available under the MIT (
|
| 5 |
Â
Please attribute the author if you use it. */
|
| 6 |
Â
|
| 7 |
Â
(function($) { // Hide scope, no $ conflict
|
|
@@ -253,6 +253,40 @@
|
|
| 253 |
Â
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
|
| 254 |
Â
},
|
| 255 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 256 |
Â
_instSettings: function(elem, options) {
|
| 257 |
Â
return {_periods: [0, 0, 0, 0, 0, 0, 0]};
|
| 258 |
Â
},
|
|
@@ -375,8 +409,6 @@
|
|
| 375 |
Â
@param inst {object} The current settings for this instance.
|
| 376 |
Â
@param recalc {boolean} True if until or since are set. */
|
| 377 |
Â
_adjustSettings: function(elem, inst, recalc) {
|
| 378 |
-
var now;
|
| 379 |
-
var serverOffset = 0;
|
| 380 |
Â
var serverEntry = null;
|
| 381 |
Â
for (var i = 0; i < this._serverSyncs.length; i++) {
|
| 382 |
Â
if (this._serverSyncs[i][0] == inst.options.serverSync) {
|
|
@@ -385,14 +417,14 @@
|
|
| 385 |
Â
}
|
| 386 |
Â
}
|
| 387 |
Â
if (serverEntry != null) {
|
| 388 |
-
|
| 389 |
-
|
| 390 |
Â
}
|
| 391 |
Â
else {
|
| 392 |
Â
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
| 393 |
Â
inst.options.serverSync.apply(elem[0], []) : null);
|
| 394 |
-
|
| 395 |
-
|
| 396 |
Â
this._serverSyncs.push([inst.options.serverSync, serverOffset]);
|
| 397 |
Â
}
|
| 398 |
Â
var timezone = inst.options.timezone;
|
|
@@ -778,8 +810,8 @@
|
|
| 778 |
Â
var periods = [0, 0, 0, 0, 0, 0, 0];
|
| 779 |
Â
if (show[Y] || show[O]) {
|
| 780 |
Â
// Treat end of months as the same
|
| 781 |
-
|
| 782 |
-
|
| 783 |
Â
var sameDay = (until.getDate() == now.getDate() ||
|
| 784 |
Â
(until.getDate() >= Math.min(lastNow, lastUntil) &&
|
| 785 |
Â
now.getDate() >= Math.min(lastNow, lastUntil)));
|
|
@@ -795,7 +827,7 @@
|
|
| 795 |
Â
// Adjust for months difference and end of month if necessary
|
| 796 |
Â
now = new Date(now.getTime());
|
| 797 |
Â
var wasLastDay = (now.getDate() == lastNow);
|
| 798 |
-
|
| 799 |
Â
now.getMonth() + periods[O]);
|
| 800 |
Â
if (now.getDate() > lastDay) {
|
| 801 |
Â
now.setDate(lastDay);
|
| 1 |
Â
/* http://keith-wood.name/countdown.html
|
| 2 |
+
Countdown for jQuery v2.0.2.
|
| 3 |
Â
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
|
| 4 |
+
Available under the MIT (http://keith-wood.name/licence.html) license.
|
| 5 |
Â
Please attribute the author if you use it. */
|
| 6 |
Â
|
| 7 |
Â
(function($) { // Hide scope, no $ conflict
|
| 253 |
Â
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
|
| 254 |
Â
},
|
| 255 |
Â
|
| 256 |
+
/** Resynchronise the countdowns with the server.
|
| 257 |
+
@example $.countdown.resync() */
|
| 258 |
+
resync: function() {
|
| 259 |
+
var self = this;
|
| 260 |
+
$('.' + this._getMarker()).each(function() { // Each countdown
|
| 261 |
+
var inst = $.data(this, self.name);
|
| 262 |
+
if (inst.options.serverSync) { // If synced
|
| 263 |
+
var serverSync = null;
|
| 264 |
+
for (var i = 0; i < self._serverSyncs.length; i++) {
|
| 265 |
+
if (self._serverSyncs[i][0] == inst.options.serverSync) { // Find sync details
|
| 266 |
+
serverSync = self._serverSyncs[i];
|
| 267 |
+
break;
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
if (serverSync[2] == null) { // Recalculate if missing
|
| 271 |
+
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
| 272 |
+
inst.options.serverSync.apply(this, []) : null);
|
| 273 |
+
serverSync[2] =
|
| 274 |
+
(serverResult ? new Date().getTime() - serverResult.getTime() : 0) - serverSync[1];
|
| 275 |
+
}
|
| 276 |
+
if (inst._since) { // Apply difference
|
| 277 |
+
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverSync[2]);
|
| 278 |
+
}
|
| 279 |
+
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverSync[2]);
|
| 280 |
+
}
|
| 281 |
+
});
|
| 282 |
+
for (var i = 0; i < self._serverSyncs.length; i++) { // Update sync details
|
| 283 |
+
if (self._serverSyncs[i][2] != null) {
|
| 284 |
+
self._serverSyncs[i][1] += self._serverSyncs[i][2];
|
| 285 |
+
delete self._serverSyncs[i][2];
|
| 286 |
+
}
|
| 287 |
+
}
|
| 288 |
+
},
|
| 289 |
+
|
| 290 |
Â
_instSettings: function(elem, options) {
|
| 291 |
Â
return {_periods: [0, 0, 0, 0, 0, 0, 0]};
|
| 292 |
Â
},
|
| 409 |
Â
@param inst {object} The current settings for this instance.
|
| 410 |
Â
@param recalc {boolean} True if until or since are set. */
|
| 411 |
Â
_adjustSettings: function(elem, inst, recalc) {
|
|
Â
|
|
|
Â
|
|
| 412 |
Â
var serverEntry = null;
|
| 413 |
Â
for (var i = 0; i < this._serverSyncs.length; i++) {
|
| 414 |
Â
if (this._serverSyncs[i][0] == inst.options.serverSync) {
|
| 417 |
Â
}
|
| 418 |
Â
}
|
| 419 |
Â
if (serverEntry != null) {
|
| 420 |
+
var serverOffset = (inst.options.serverSync ? serverEntry : 0);
|
| 421 |
+
var now = new Date();
|
| 422 |
Â
}
|
| 423 |
Â
else {
|
| 424 |
Â
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
| 425 |
Â
inst.options.serverSync.apply(elem[0], []) : null);
|
| 426 |
+
var now = new Date();
|
| 427 |
+
var serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
|
| 428 |
Â
this._serverSyncs.push([inst.options.serverSync, serverOffset]);
|
| 429 |
Â
}
|
| 430 |
Â
var timezone = inst.options.timezone;
|
| 810 |
Â
var periods = [0, 0, 0, 0, 0, 0, 0];
|
| 811 |
Â
if (show[Y] || show[O]) {
|
| 812 |
Â
// Treat end of months as the same
|
| 813 |
+
var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth());
|
| 814 |
+
var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth());
|
| 815 |
Â
var sameDay = (until.getDate() == now.getDate() ||
|
| 816 |
Â
(until.getDate() >= Math.min(lastNow, lastUntil) &&
|
| 817 |
Â
now.getDate() >= Math.min(lastNow, lastUntil)));
|
| 827 |
Â
// Adjust for months difference and end of month if necessary
|
| 828 |
Â
now = new Date(now.getTime());
|
| 829 |
Â
var wasLastDay = (now.getDate() == lastNow);
|
| 830 |
+
var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y],
|
| 831 |
Â
now.getMonth() + periods[O]);
|
| 832 |
Â
if (now.getDate() > lastDay) {
|
| 833 |
Â
now.setDate(lastDay);
|
|
@@ -1,6 +1 @@
|
|
| 1 |
-
/* http://keith-wood.name/countdown.html
|
| 2 |
-
Countdown for jQuery v2.0.1.
|
| 3 |
-
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
|
| 4 |
-
Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
|
| 5 |
-
Please attribute the author if you use it. */
|
| 6 |
-
(function($){var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.JQPlugin.createPlugin({name:w,defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:'dHMS',layout:'',compact:false,padZeroes:false,significant:0,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{'':{labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],whichLabels:null,digits:['0','1','2','3','4','5','6','7','8','9'],timeSeparator:':',isRTL:false}},_getters:['getTimes'],_rtlClass:w+'-rtl',_sectionClass:w+'-section',_amountClass:w+'-amount',_periodClass:w+'-period',_rowClass:w+'-row',_holdingClass:w+'-holding',_showClass:w+'-show',_descrClass:w+'-descr',_timerElems:[],_init:function(){var c=this;this._super();this._serverSyncs=[];var d=(typeof Date.now=='function'?Date.now:function(){return new Date().getTime()});var e=(window.performance&&typeof window.performance.now=='function');function timerCallBack(a){var b=(a<1e12?(e?(performance.now()+performance.timing.navigationStart):d()):a||d());if(b-g>=1000){c._updateElems();g=b}f(timerCallBack)}var f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var g=0;if(!f||$.noRequestAnimationFrame){$.noRequestAnimationFrame=null;setInterval(function(){c._updateElems()},980)}else{g=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||d();f(timerCallBack)}},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_instSettings:function(a,b){return{_periods:[0,0,0,0,0,0,0]}},_addElem:function(a){if(!this._hasElem(a)){this._timerElems.push(a)}},_hasElem:function(a){return($.inArray(a,this._timerElems)>-1)},_removeElem:function(b){this._timerElems=$.map(this._timerElems,function(a){return(a==b?null:a)})},_updateElems:function(){for(var i=this._timerElems.length-1;i>=0;i--){this._updateCountdown(this._timerElems[i])}},_optionsChanged:function(a,b,c){if(c.layout){c.layout=c.layout.replace(/</g,'<').replace(/>/g,'>')}this._resetExtraLabels(b.options,c);var d=(b.options.timezone!=c.timezone);$.extend(b.options,c);this._adjustSettings(a,b,c.until!=null||c.since!=null||d);var e=new Date();if((b._since&&b._since<e)||(b._until&&b._until>e)){this._addElem(a[0])}this._updateCountdown(a,b)},_updateCountdown:function(a,b){a=a.jquery?a:$(a);b=b||this._getInst(a);if(!b){return}a.html(this._generateHTML(b)).toggleClass(this._rtlClass,b.options.isRTL);if($.isFunction(b.options.onTick)){var c=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date());if(b.options.tickInterval==1||this.periodsToSeconds(c)%b.options.tickInterval==0){b.options.onTick.apply(a[0],[c])}}var d=b._hold!='pause'&&(b._since?b._now.getTime()<b._since.getTime():b._now.getTime()>=b._until.getTime());if(d&&!b._expiring){b._expiring=true;if(this._hasElem(a[0])||b.options.alwaysExpire){this._removeElem(a[0]);if($.isFunction(b.options.onExpiry)){b.options.onExpiry.apply(a[0],[])}if(b.options.expiryText){var e=b.options.layout;b.options.layout=b.options.expiryText;this._updateCountdown(a[0],b);b.options.layout=e}if(b.options.expiryUrl){window.location=b.options.expiryUrl}}b._expiring=false}else if(b._hold=='pause'){this._removeElem(a[0])}},_resetExtraLabels:function(a,b){for(var n in b){if(n.match(/[Ll]abels[02-9]|compactLabels1/)){a[n]=b[n]}}for(var n in a){if(n.match(/[Ll]abels[02-9]|compactLabels1/)&&typeof b[n]==='undefined'){a[n]=null}}},_adjustSettings:function(a,b,c){var d;var e=0;var f=null;for(var i=0;i<this._serverSyncs.length;i++){if(this._serverSyncs[i][0]==b.options.serverSync){f=this._serverSyncs[i][1];break}}if(f!=null){e=(b.options.serverSync?f:0);d=new Date()}else{var g=($.isFunction(b.options.serverSync)?b.options.serverSync.apply(a[0],[]):null);d=new Date();e=(g?d.getTime()-g.getTime():0);this._serverSyncs.push([b.options.serverSync,e])}var h=b.options.timezone;h=(h==null?-d.getTimezoneOffset():h);if(c||(!c&&b._until==null&&b._since==null)){b._since=b.options.since;if(b._since!=null){b._since=this.UTCDate(h,this._determineTime(b._since,null));if(b._since&&e){b._since.setMilliseconds(b._since.getMilliseconds()+e)}}b._until=this.UTCDate(h,this._determineTime(b.options.until,d));if(e){b._until.setMilliseconds(b._until.getMilliseconds()+e)}}b._show=this._determineShow(b)},_preDestroy:function(a,b){this._removeElem(a[0]);a.empty()},pause:function(a){this._hold(a,'pause')},lap:function(a){this._hold(a,'lap')},resume:function(a){this._hold(a,null)},toggle:function(a){var b=$.data(a,this.name)||{};this[!b._hold?'pause':'resume'](a)},toggleLap:function(a){var b=$.data(a,this.name)||{};this[!b._hold?'lap':'resume'](a)},_hold:function(a,b){var c=$.data(a,this.name);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addElem(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,this.name,c);this._updateCountdown(a,c)}},getTimes:function(a){var b=$.data(a,this.name);return(!b?null:(b._hold=='pause'?b._savePeriods:(!b._hold?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date()))))},_determineTime:function(k,l){var m=this;var n=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var o=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,m._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,m._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var p=(k==null?l:(typeof k=='string'?o(k):(typeof k=='number'?n(k):k)));if(p)p.setMilliseconds(0);return p},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(c){var d=this;c._periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,c.options.significant,new Date()));var e=false;var f=0;var g=c.options.significant;var h=$.extend({},c._show);for(var i=Y;i<=S;i++){e|=(c._show[i]=='?'&&c._periods[i]>0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=(c.options.compact?c.options.compactLabels:c.options.labels);var l=c.options.whichLabels||this._normalLabels;var m=function(a){var b=c.options['compactLabels'+l(c._periods[a])];return(h[a]?d._translateDigits(c,c._periods[a])+(b?b[a]:k[a])+' ':'')};var n=(c.options.padZeroes?2:1);var o=function(a){var b=c.options['labels'+l(c._periods[a])];return((!c.options.significant&&h[a])||(c.options.significant&&j[a])?'<span class="'+d._sectionClass+'">'+'<span class="'+d._amountClass+'">'+d._minDigits(c,c._periods[a],n)+'</span>'+'<span class="'+d._periodClass+'">'+(b?b[a]:k[a])+'</span></span>':'')};return(c.options.layout?this._buildLayout(c,h,c.options.layout,c.options.compact,c.options.significant,j):((c.options.compact?'<span class="'+this._rowClass+' '+this._amountClass+(c._hold?' '+this._holdingClass:'')+'">'+m(Y)+m(O)+m(W)+m(D)+(h[H]?this._minDigits(c,c._periods[H],2):'')+(h[M]?(h[H]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[M],2):'')+(h[S]?(h[H]||h[M]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[S],2):''):'<span class="'+this._rowClass+' '+this._showClass+(c.options.significant||f)+(c._hold?' '+this._holdingClass:'')+'">'+o(Y)+o(O)+o(W)+o(D)+o(H)+o(M)+o(S))+'</span>'+(c.options.description?'<span class="'+this._rowClass+' '+this._descrClass+'">'+c.options.description+'</span>':'')))},_buildLayout:function(c,d,e,f,g,h){var j=c.options[f?'compactLabels':'labels'];var k=c.options.whichLabels||this._normalLabels;var l=function(a){return(c.options[(f?'compactLabels':'labels')+k(c._periods[a])]||j)[a]};var m=function(a,b){return c.options.digits[Math.floor(a/b)%10]};var o={desc:c.options.description,sep:c.options.timeSeparator,yl:l(Y),yn:this._minDigits(c,c._periods[Y],1),ynn:this._minDigits(c,c._periods[Y],2),ynnn:this._minDigits(c,c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:this._minDigits(c,c._periods[O],1),onn:this._minDigits(c,c._periods[O],2),onnn:this._minDigits(c,c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:this._minDigits(c,c._periods[W],1),wnn:this._minDigits(c,c._periods[W],2),wnnn:this._minDigits(c,c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:this._minDigits(c,c._periods[D],1),dnn:this._minDigits(c,c._periods[D],2),dnnn:this._minDigits(c,c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:this._minDigits(c,c._periods[H],1),hnn:this._minDigits(c,c._periods[H],2),hnnn:this._minDigits(c,c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:this._minDigits(c,c._periods[M],1),mnn:this._minDigits(c,c._periods[M],2),mnnn:this._minDigits(c,c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:this._minDigits(c,c._periods[S],1),snn:this._minDigits(c,c._periods[S],2),snnn:this._minDigits(c,c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}([\\s\\S]*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:function(a,b,c){b=''+b;if(b.length>=c){return this._translateDigits(a,b)}b='0000000000'+b;return this._translateDigits(a,b.substr(b.length-c))},_translateDigits:function(b,c){return(''+c).replace(/[0-9]/g,function(a){return b.options.digits[a]})},_determineShow:function(a){var b=a.options.format;var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);var g=new Date(c._now.getTime());if(c._since){if(f.getTime()<c._since.getTime()){c._now=f=g}else{f=c._since}}else{g.setTime(c._until.getTime());if(f.getTime()>c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=this._getDaysInMonth(f.getFullYear(),f.getMonth());var j=this._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.getDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()<f.getDate()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?Math.floor(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=new Date(f.getTime());var n=(f.getDate()==i);var o=this._getDaysInMonth(f.getFullYear()+h[Y],f.getMonth()+h[O]);if(f.getDate()>o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,3600);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}})})(jQuery);
|
| 1 |
+
!function(a){var b="countdown",c=0,d=1,e=2,f=3,g=4,h=5,i=6;a.JQPlugin.createPlugin({name:b,defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:!1,padZeroes:!1,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:!1,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{"":{labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,digits:["0","1","2","3","4","5","6","7","8","9"],timeSeparator:":",isRTL:!1}},_getters:["getTimes"],_rtlClass:b+"-rtl",_sectionClass:b+"-section",_amountClass:b+"-amount",_periodClass:b+"-period",_rowClass:b+"-row",_holdingClass:b+"-holding",_showClass:b+"-show",_descrClass:b+"-descr",_timerElems:[],_init:function(){function b(a){var h=1e12>a?e?performance.now()+performance.timing.navigationStart:d():a||d();h-g>=1e3&&(c._updateElems(),g=h),f(b)}var c=this;this._super(),this._serverSyncs=[];var d="function"==typeof Date.now?Date.now:function(){return(new Date).getTime()},e=window.performance&&"function"==typeof window.performance.now,f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null,g=0;!f||a.noRequestAnimationFrame?(a.noRequestAnimationFrame=null,setInterval(function(){c._updateElems()},980)):(g=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||d(),f(b))},UTCDate:function(a,b,c,d,e,f,g,h){"object"==typeof b&&b.constructor==Date&&(h=b.getMilliseconds(),g=b.getSeconds(),f=b.getMinutes(),e=b.getHours(),d=b.getDate(),c=b.getMonth(),b=b.getFullYear());var i=new Date;return i.setUTCFullYear(b),i.setUTCDate(1),i.setUTCMonth(c||0),i.setUTCDate(d||1),i.setUTCHours(e||0),i.setUTCMinutes((f||0)-(Math.abs(a)<30?60*a:a)),i.setUTCSeconds(g||0),i.setUTCMilliseconds(h||0),i},periodsToSeconds:function(a){return 31557600*a[0]+2629800*a[1]+604800*a[2]+86400*a[3]+3600*a[4]+60*a[5]+a[6]},resync:function(){var b=this;a("."+this._getMarker()).each(function(){var c=a.data(this,b.name);if(c.options.serverSync){for(var d=null,e=0;e<b._serverSyncs.length;e++)if(b._serverSyncs[e][0]==c.options.serverSync){d=b._serverSyncs[e];break}if(null==d[2]){var f=a.isFunction(c.options.serverSync)?c.options.serverSync.apply(this,[]):null;d[2]=(f?(new Date).getTime()-f.getTime():0)-d[1]}c._since&&c._since.setMilliseconds(c._since.getMilliseconds()+d[2]),c._until.setMilliseconds(c._until.getMilliseconds()+d[2])}});for(var c=0;c<b._serverSyncs.length;c++)null!=b._serverSyncs[c][2]&&(b._serverSyncs[c][1]+=b._serverSyncs[c][2],delete b._serverSyncs[c][2])},_instSettings:function(a,b){return{_periods:[0,0,0,0,0,0,0]}},_addElem:function(a){this._hasElem(a)||this._timerElems.push(a)},_hasElem:function(b){return a.inArray(b,this._timerElems)>-1},_removeElem:function(b){this._timerElems=a.map(this._timerElems,function(a){return a==b?null:a})},_updateElems:function(){for(var a=this._timerElems.length-1;a>=0;a--)this._updateCountdown(this._timerElems[a])},_optionsChanged:function(b,c,d){d.layout&&(d.layout=d.layout.replace(/</g,"<").replace(/>/g,">")),this._resetExtraLabels(c.options,d);var e=c.options.timezone!=d.timezone;a.extend(c.options,d),this._adjustSettings(b,c,null!=d.until||null!=d.since||e);var f=new Date;(c._since&&c._since<f||c._until&&c._until>f)&&this._addElem(b[0]),this._updateCountdown(b,c)},_updateCountdown:function(b,c){if(b=b.jquery?b:a(b),c=c||this._getInst(b)){if(b.html(this._generateHTML(c)).toggleClass(this._rtlClass,c.options.isRTL),a.isFunction(c.options.onTick)){var d="lap"!=c._hold?c._periods:this._calculatePeriods(c,c._show,c.options.significant,new Date);1!=c.options.tickInterval&&this.periodsToSeconds(d)%c.options.tickInterval!=0||c.options.onTick.apply(b[0],[d])}var e="pause"!=c._hold&&(c._since?c._now.getTime()<c._since.getTime():c._now.getTime()>=c._until.getTime());if(e&&!c._expiring){if(c._expiring=!0,this._hasElem(b[0])||c.options.alwaysExpire){if(this._removeElem(b[0]),a.isFunction(c.options.onExpiry)&&c.options.onExpiry.apply(b[0],[]),c.options.expiryText){var f=c.options.layout;c.options.layout=c.options.expiryText,this._updateCountdown(b[0],c),c.options.layout=f}c.options.expiryUrl&&(window.location=c.options.expiryUrl)}c._expiring=!1}else"pause"==c._hold&&this._removeElem(b[0])}},_resetExtraLabels:function(a,b){for(var c in b)c.match(/[Ll]abels[02-9]|compactLabels1/)&&(a[c]=b[c]);for(var c in a)c.match(/[Ll]abels[02-9]|compactLabels1/)&&"undefined"==typeof b[c]&&(a[c]=null)},_adjustSettings:function(b,c,d){for(var e=null,f=0;f<this._serverSyncs.length;f++)if(this._serverSyncs[f][0]==c.options.serverSync){e=this._serverSyncs[f][1];break}if(null!=e)var g=c.options.serverSync?e:0,h=new Date;else{var i=a.isFunction(c.options.serverSync)?c.options.serverSync.apply(b[0],[]):null,h=new Date,g=i?h.getTime()-i.getTime():0;this._serverSyncs.push([c.options.serverSync,g])}var j=c.options.timezone;j=null==j?-h.getTimezoneOffset():j,(d||!d&&null==c._until&&null==c._since)&&(c._since=c.options.since,null!=c._since&&(c._since=this.UTCDate(j,this._determineTime(c._since,null)),c._since&&g&&c._since.setMilliseconds(c._since.getMilliseconds()+g)),c._until=this.UTCDate(j,this._determineTime(c.options.until,h)),g&&c._until.setMilliseconds(c._until.getMilliseconds()+g)),c._show=this._determineShow(c)},_preDestroy:function(a,b){this._removeElem(a[0]),a.empty()},pause:function(a){this._hold(a,"pause")},lap:function(a){this._hold(a,"lap")},resume:function(a){this._hold(a,null)},toggle:function(b){var c=a.data(b,this.name)||{};this[c._hold?"resume":"pause"](b)},toggleLap:function(b){var c=a.data(b,this.name)||{};this[c._hold?"resume":"lap"](b)},_hold:function(b,c){var d=a.data(b,this.name);if(d){if("pause"==d._hold&&!c){d._periods=d._savePeriods;var e=d._since?"-":"+";d[d._since?"_since":"_until"]=this._determineTime(e+d._periods[0]+"y"+e+d._periods[1]+"o"+e+d._periods[2]+"w"+e+d._periods[3]+"d"+e+d._periods[4]+"h"+e+d._periods[5]+"m"+e+d._periods[6]+"s"),this._addElem(b)}d._hold=c,d._savePeriods="pause"==c?d._periods:null,a.data(b,this.name,d),this._updateCountdown(b,d)}},getTimes:function(b){var c=a.data(b,this.name);return c?"pause"==c._hold?c._savePeriods:c._hold?this._calculatePeriods(c,c._show,c.options.significant,new Date):c._periods:null},_determineTime:function(a,b){var c=this,d=function(a){var b=new Date;return b.setTime(b.getTime()+1e3*a),b},e=function(a){a=a.toLowerCase();for(var b=new Date,d=b.getFullYear(),e=b.getMonth(),f=b.getDate(),g=b.getHours(),h=b.getMinutes(),i=b.getSeconds(),j=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g,k=j.exec(a);k;){switch(k[2]||"s"){case"s":i+=parseInt(k[1],10);break;case"m":h+=parseInt(k[1],10);break;case"h":g+=parseInt(k[1],10);break;case"d":f+=parseInt(k[1],10);break;case"w":f+=7*parseInt(k[1],10);break;case"o":e+=parseInt(k[1],10),f=Math.min(f,c._getDaysInMonth(d,e));break;case"y":d+=parseInt(k[1],10),f=Math.min(f,c._getDaysInMonth(d,e))}k=j.exec(a)}return new Date(d,e,f,g,h,i,0)},f=null==a?b:"string"==typeof a?e(a):"number"==typeof a?d(a):a;return f&&f.setMilliseconds(0),f},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(b){var j=this;b._periods=b._hold?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date);for(var k=!1,l=0,m=b.options.significant,n=a.extend({},b._show),o=c;i>=o;o++)k|="?"==b._show[o]&&b._periods[o]>0,n[o]="?"!=b._show[o]||k?b._show[o]:null,l+=n[o]?1:0,m-=b._periods[o]>0?1:0;for(var p=[!1,!1,!1,!1,!1,!1,!1],o=i;o>=c;o--)b._show[o]&&(b._periods[o]?p[o]=!0:(p[o]=m>0,m--));var q=b.options.compact?b.options.compactLabels:b.options.labels,r=b.options.whichLabels||this._normalLabels,s=function(a){var c=b.options["compactLabels"+r(b._periods[a])];return n[a]?j._translateDigits(b,b._periods[a])+(c?c[a]:q[a])+" ":""},t=b.options.padZeroes?2:1,u=function(a){var c=b.options["labels"+r(b._periods[a])];return!b.options.significant&&n[a]||b.options.significant&&p[a]?'<span class="'+j._sectionClass+'"><span class="'+j._amountClass+'">'+j._minDigits(b,b._periods[a],t)+'</span><span class="'+j._periodClass+'">'+(c?c[a]:q[a])+"</span></span>":""};return b.options.layout?this._buildLayout(b,n,b.options.layout,b.options.compact,b.options.significant,p):(b.options.compact?'<span class="'+this._rowClass+" "+this._amountClass+(b._hold?" "+this._holdingClass:"")+'">'+s(c)+s(d)+s(e)+s(f)+(n[g]?this._minDigits(b,b._periods[g],2):"")+(n[h]?(n[g]?b.options.timeSeparator:"")+this._minDigits(b,b._periods[h],2):"")+(n[i]?(n[g]||n[h]?b.options.timeSeparator:"")+this._minDigits(b,b._periods[i],2):""):'<span class="'+this._rowClass+" "+this._showClass+(b.options.significant||l)+(b._hold?" "+this._holdingClass:"")+'">'+u(c)+u(d)+u(e)+u(f)+u(g)+u(h)+u(i))+"</span>"+(b.options.description?'<span class="'+this._rowClass+" "+this._descrClass+'">'+b.options.description+"</span>":"")},_buildLayout:function(b,j,k,l,m,n){for(var o=b.options[l?"compactLabels":"labels"],p=b.options.whichLabels||this._normalLabels,q=function(a){return(b.options[(l?"compactLabels":"labels")+p(b._periods[a])]||o)[a]},r=function(a,c){return b.options.digits[Math.floor(a/c)%10]},s={desc:b.options.description,sep:b.options.timeSeparator,yl:q(c),yn:this._minDigits(b,b._periods[c],1),ynn:this._minDigits(b,b._periods[c],2),ynnn:this._minDigits(b,b._periods[c],3),y1:r(b._periods[c],1),y10:r(b._periods[c],10),y100:r(b._periods[c],100),y1000:r(b._periods[c],1e3),ol:q(d),on:this._minDigits(b,b._periods[d],1),onn:this._minDigits(b,b._periods[d],2),onnn:this._minDigits(b,b._periods[d],3),o1:r(b._periods[d],1),o10:r(b._periods[d],10),o100:r(b._periods[d],100),o1000:r(b._periods[d],1e3),wl:q(e),wn:this._minDigits(b,b._periods[e],1),wnn:this._minDigits(b,b._periods[e],2),wnnn:this._minDigits(b,b._periods[e],3),w1:r(b._periods[e],1),w10:r(b._periods[e],10),w100:r(b._periods[e],100),w1000:r(b._periods[e],1e3),dl:q(f),dn:this._minDigits(b,b._periods[f],1),dnn:this._minDigits(b,b._periods[f],2),dnnn:this._minDigits(b,b._periods[f],3),d1:r(b._periods[f],1),d10:r(b._periods[f],10),d100:r(b._periods[f],100),d1000:r(b._periods[f],1e3),hl:q(g),hn:this._minDigits(b,b._periods[g],1),hnn:this._minDigits(b,b._periods[g],2),hnnn:this._minDigits(b,b._periods[g],3),h1:r(b._periods[g],1),h10:r(b._periods[g],10),h100:r(b._periods[g],100),h1000:r(b._periods[g],1e3),ml:q(h),mn:this._minDigits(b,b._periods[h],1),mnn:this._minDigits(b,b._periods[h],2),mnnn:this._minDigits(b,b._periods[h],3),m1:r(b._periods[h],1),m10:r(b._periods[h],10),m100:r(b._periods[h],100),m1000:r(b._periods[h],1e3),sl:q(i),sn:this._minDigits(b,b._periods[i],1),snn:this._minDigits(b,b._periods[i],2),snnn:this._minDigits(b,b._periods[i],3),s1:r(b._periods[i],1),s10:r(b._periods[i],10),s100:r(b._periods[i],100),s1000:r(b._periods[i],1e3)},t=k,u=c;i>=u;u++){var v="yowdhms".charAt(u),w=new RegExp("\\{"+v+"<\\}([\\s\\S]*)\\{"+v+">\\}","g");t=t.replace(w,!m&&j[u]||m&&n[u]?"$1":"")}return a.each(s,function(a,b){var c=new RegExp("\\{"+a+"\\}","g");t=t.replace(c,b)}),t},_minDigits:function(a,b,c){return b=""+b,b.length>=c?this._translateDigits(a,b):(b="0000000000"+b,this._translateDigits(a,b.substr(b.length-c)))},_translateDigits:function(a,b){return(""+b).replace(/[0-9]/g,function(b){return a.options.digits[b]})},_determineShow:function(a){var b=a.options.format,j=[];return j[c]=b.match("y")?"?":b.match("Y")?"!":null,j[d]=b.match("o")?"?":b.match("O")?"!":null,j[e]=b.match("w")?"?":b.match("W")?"!":null,j[f]=b.match("d")?"?":b.match("D")?"!":null,j[g]=b.match("h")?"?":b.match("H")?"!":null,j[h]=b.match("m")?"?":b.match("M")?"!":null,j[i]=b.match("s")?"?":b.match("S")?"!":null,j},_calculatePeriods:function(a,b,j,k){a._now=k,a._now.setMilliseconds(0);var l=new Date(a._now.getTime());a._since?k.getTime()<a._since.getTime()?a._now=k=l:k=a._since:(l.setTime(a._until.getTime()),k.getTime()>a._until.getTime()&&(a._now=k=l));var m=[0,0,0,0,0,0,0];if(b[c]||b[d]){var n=this._getDaysInMonth(k.getFullYear(),k.getMonth()),o=this._getDaysInMonth(l.getFullYear(),l.getMonth()),p=l.getDate()==k.getDate()||l.getDate()>=Math.min(n,o)&&k.getDate()>=Math.min(n,o),q=function(a){return 60*(60*a.getHours()+a.getMinutes())+a.getSeconds()},r=Math.max(0,12*(l.getFullYear()-k.getFullYear())+l.getMonth()-k.getMonth()+(l.getDate()<k.getDate()&&!p||p&&q(l)<q(k)?-1:0));m[c]=b[c]?Math.floor(r/12):0,m[d]=b[d]?r-12*m[c]:0,k=new Date(k.getTime());var s=k.getDate()==n,t=this._getDaysInMonth(k.getFullYear()+m[c],k.getMonth()+m[d]);k.getDate()>t&&k.setDate(t),k.setFullYear(k.getFullYear()+m[c]),k.setMonth(k.getMonth()+m[d]),s&&k.setDate(t)}var u=Math.floor((l.getTime()-k.getTime())/1e3),v=function(a,c){m[a]=b[a]?Math.floor(u/c):0,u-=m[a]*c};if(v(e,604800),v(f,86400),v(g,3600),v(h,60),v(i,1),u>0&&!a._since)for(var w=[1,12,4.3482,7,24,60,60],x=i,y=1,z=i;z>=c;z--)b[z]&&(m[x]>=y&&(m[x]=0,u=1),u>0&&(m[z]++,u=0,x=z,y=1)),y*=w[z];if(j)for(var z=c;i>=z;z++)j&&m[z]?j--:j||(m[z]=0);return m}})}(jQuery);
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
@@ -74,7 +74,7 @@
|
|
| 74 |
Â
|
| 75 |
Â
/** Abstract base class for collection plugins v1.0.1.
|
| 76 |
Â
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
|
| 77 |
-
Licensed under the MIT (
|
| 78 |
Â
@module $.JQPlugin
|
| 79 |
Â
@abstract */
|
| 80 |
Â
JQClass.classes.JQPlugin = JQClass.extend({
|
| 74 |
Â
|
| 75 |
Â
/** Abstract base class for collection plugins v1.0.1.
|
| 76 |
Â
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
|
| 77 |
+
Licensed under the MIT (http://keith-wood.name/licence.html) license.
|
| 78 |
Â
@module $.JQPlugin
|
| 79 |
Â
@abstract */
|
| 80 |
Â
JQClass.classes.JQPlugin = JQClass.extend({
|
|
@@ -1,4 +1 @@
|
|
| 1 |
-
|
| 2 |
-
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
|
| 3 |
-
Licensed under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. */
|
| 4 |
-
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
|
| 1 |
+
!function(){var a=!1;window.JQClass=function(){},JQClass.classes={},JQClass.extend=function b(c){function d(){!a&&this._init&&this._init.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in c)f[g]="function"==typeof c[g]&&"function"==typeof e[g]?function(a,b){return function(){var c=this._super;this._super=function(b){return e[a].apply(this,b||[])};var d=b.apply(this,arguments);return this._super=c,d}}(g,c[g]):c[g];return d.prototype=f,d.prototype.constructor=d,d.extend=b,d}}(),function($){function camelCase(a){return a.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}JQClass.classes.JQPlugin=JQClass.extend({name:"plugin",defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return"is-"+this.name},_init:function(){$.extend(this.defaultOptions,this.regionalOptions&&this.regionalOptions[""]||{});var a=camelCase(this.name);$[a]=this,$.fn[a]=function(b){var c=Array.prototype.slice.call(arguments,1);return $[a]._isNotChained(b,c)?$[a][b].apply($[a],[this[0]].concat(c)):this.each(function(){if("string"==typeof b){if("_"===b[0]||!$[a][b])throw"Unknown method: "+b;$[a][b].apply($[a],[this].concat(c))}else $[a]._attach(this,b)})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){return"option"===a&&(0===b.length||1===b.length&&"string"==typeof b[0])?!0:$.inArray(a,this._getters)>-1},_attach:function(a,b){if(a=$(a),!a.hasClass(this._getMarker())){a.addClass(this._getMarker()),b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c),this._postAttach(a,c),this.option(a,b)}},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(elem){try{var data=elem.data(this.name.toLowerCase())||"";data=data.replace(/'/g,'"'),data=data.replace(/([a-zA-Z0-9]+):/g,function(a,b,c){var d=data.substring(0,c).match(/"/g);return d&&d.length%2!==0?b+":":'"'+b+'":'}),data=$.parseJSON("{"+data+"}");for(var name in data){var value=data[name];"string"==typeof value&&value.match(/^new Date\((.*)\)$/)&&(data[name]=eval(value))}return data}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||"string"==typeof b&&null==c){var e=(d||{}).options;return e&&b?e[b]:e}if(a.hasClass(this._getMarker())){var e=b||{};"string"==typeof b&&(e={},e[b]=c),this._optionsChanged(a,d,e),$.extend(d.options,e)}},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a),a.hasClass(this._getMarker())&&(this._preDestroy(a,this._getInst(a)),a.removeData(this.name).removeClass(this._getMarker()))},_preDestroy:function(a,b){}}),$.JQPlugin={createPlugin:function(a,b){"object"==typeof a&&(b=a,a="JQPlugin"),a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b),new JQClass.classes[c]}}}(jQuery);
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
@@ -1,24 +1,27 @@
|
|
| 1 |
-
/*!
|
| 2 |
-
* jQuery Validation Plugin v1.
|
| 3 |
-
*
|
| 4 |
-
* http://jqueryvalidation.org/
|
| 5 |
-
*
|
| 6 |
-
* Copyright (c)
|
| 7 |
-
* Released under the MIT license
|
| 8 |
-
*/
|
| 9 |
-
(function( factory ) {
|
| 10 |
-
if ( typeof define === "function" && define.amd ) {
|
| 11 |
-
define( ["jquery"], factory );
|
| 12 |
-
} else {
|
| 13 |
-
factory(
|
| 14 |
-
}
|
| 15 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 16 |
Â
|
| 17 |
-
$.extend($.fn, {
|
| 18 |
Â
// http://jqueryvalidation.org/validate/
|
| 19 |
Â
validate: function( options ) {
|
| 20 |
Â
|
| 21 |
-
//
|
| 22 |
Â
if ( !this.length ) {
|
| 23 |
Â
if ( options && options.debug && window.console ) {
|
| 24 |
Â
console.warn( "Nothing selected, can't validate, returning nothing." );
|
|
@@ -26,7 +29,7 @@ $.extend($.fn, {
|
|
| 26 |
Â
return;
|
| 27 |
Â
}
|
| 28 |
Â
|
| 29 |
-
//
|
| 30 |
Â
var validator = $.data( this[ 0 ], "validator" );
|
| 31 |
Â
if ( validator ) {
|
| 32 |
Â
return validator;
|
|
@@ -40,48 +43,55 @@ $.extend($.fn, {
|
|
| 40 |
Â
|
| 41 |
Â
if ( validator.settings.onsubmit ) {
|
| 42 |
Â
|
| 43 |
-
this.
|
| 44 |
Â
if ( validator.settings.submitHandler ) {
|
| 45 |
Â
validator.submitButton = event.target;
|
| 46 |
Â
}
|
| 47 |
-
|
| 48 |
-
|
|
Â
|
|
| 49 |
Â
validator.cancelSubmit = true;
|
| 50 |
Â
}
|
| 51 |
Â
|
| 52 |
-
//
|
| 53 |
-
if ( $(
|
| 54 |
Â
validator.cancelSubmit = true;
|
| 55 |
Â
}
|
| 56 |
-
});
|
| 57 |
Â
|
| 58 |
-
//
|
| 59 |
-
this.
|
| 60 |
Â
if ( validator.settings.debug ) {
|
| 61 |
-
|
|
Â
|
|
| 62 |
Â
event.preventDefault();
|
| 63 |
Â
}
|
| 64 |
Â
function handle() {
|
| 65 |
-
var hidden;
|
| 66 |
Â
if ( validator.settings.submitHandler ) {
|
| 67 |
Â
if ( validator.submitButton ) {
|
| 68 |
-
|
|
Â
|
|
| 69 |
Â
hidden = $( "<input type='hidden'/>" )
|
| 70 |
Â
.attr( "name", validator.submitButton.name )
|
| 71 |
Â
.val( $( validator.submitButton ).val() )
|
| 72 |
Â
.appendTo( validator.currentForm );
|
| 73 |
Â
}
|
| 74 |
-
validator.settings.submitHandler.call( validator, validator.currentForm, event );
|
| 75 |
Â
if ( validator.submitButton ) {
|
| 76 |
-
|
|
Â
|
|
| 77 |
Â
hidden.remove();
|
| 78 |
Â
}
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 79 |
Â
return false;
|
| 80 |
Â
}
|
| 81 |
Â
return true;
|
| 82 |
Â
}
|
| 83 |
Â
|
| 84 |
-
//
|
| 85 |
Â
if ( validator.cancelSubmit ) {
|
| 86 |
Â
validator.cancelSubmit = false;
|
| 87 |
Â
return handle();
|
|
@@ -96,38 +106,41 @@ $.extend($.fn, {
|
|
| 96 |
Â
validator.focusInvalid();
|
| 97 |
Â
return false;
|
| 98 |
Â
}
|
| 99 |
-
});
|
| 100 |
Â
}
|
| 101 |
Â
|
| 102 |
Â
return validator;
|
| 103 |
Â
},
|
|
Â
|
|
| 104 |
Â
// http://jqueryvalidation.org/valid/
|
| 105 |
Â
valid: function() {
|
| 106 |
-
var valid, validator;
|
| 107 |
Â
|
| 108 |
Â
if ( $( this[ 0 ] ).is( "form" ) ) {
|
| 109 |
Â
valid = this.validate().form();
|
| 110 |
Â
} else {
|
|
Â
|
|
| 111 |
Â
valid = true;
|
| 112 |
Â
validator = $( this[ 0 ].form ).validate();
|
| 113 |
Â
this.each( function() {
|
| 114 |
Â
valid = validator.element( this ) && valid;
|
| 115 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 116 |
Â
}
|
| 117 |
Â
return valid;
|
| 118 |
Â
},
|
| 119 |
-
|
| 120 |
-
removeAttrs: function( attributes ) {
|
| 121 |
-
var result = {},
|
| 122 |
-
$element = this;
|
| 123 |
-
$.each( attributes.split( /\s/ ), function( index, value ) {
|
| 124 |
-
result[ value ] = $element.attr( value );
|
| 125 |
-
$element.removeAttr( value );
|
| 126 |
-
});
|
| 127 |
-
return result;
|
| 128 |
-
},
|
| 129 |
Â
// http://jqueryvalidation.org/rules/
|
| 130 |
Â
rules: function( command, argument ) {
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 131 |
Â
var element = this[ 0 ],
|
| 132 |
Â
settings, staticRules, existingRules, data, param, filtered;
|
| 133 |
Â
|
|
@@ -138,7 +151,8 @@ $.extend($.fn, {
|
|
| 138 |
Â
switch ( command ) {
|
| 139 |
Â
case "add":
|
| 140 |
Â
$.extend( existingRules, $.validator.normalizeRule( argument ) );
|
| 141 |
-
|
|
Â
|
|
| 142 |
Â
delete existingRules.messages;
|
| 143 |
Â
staticRules[ element.name ] = existingRules;
|
| 144 |
Â
if ( argument.messages ) {
|
|
@@ -157,7 +171,7 @@ $.extend($.fn, {
|
|
| 157 |
Â
if ( method === "required" ) {
|
| 158 |
Â
$( element ).removeAttr( "aria-required" );
|
| 159 |
Â
}
|
| 160 |
-
});
|
| 161 |
Â
return filtered;
|
| 162 |
Â
}
|
| 163 |
Â
}
|
|
@@ -171,7 +185,7 @@ $.extend($.fn, {
|
|
| 171 |
Â
$.validator.staticRules( element )
|
| 172 |
Â
), element );
|
| 173 |
Â
|
| 174 |
-
//
|
| 175 |
Â
if ( data.required ) {
|
| 176 |
Â
param = data.required;
|
| 177 |
Â
delete data.required;
|
|
@@ -179,34 +193,38 @@ $.extend($.fn, {
|
|
| 179 |
Â
$( element ).attr( "aria-required", "true" );
|
| 180 |
Â
}
|
| 181 |
Â
|
| 182 |
-
//
|
| 183 |
Â
if ( data.remote ) {
|
| 184 |
Â
param = data.remote;
|
| 185 |
Â
delete data.remote;
|
| 186 |
-
data = $.extend( data, { remote: param });
|
| 187 |
Â
}
|
| 188 |
Â
|
| 189 |
Â
return data;
|
| 190 |
Â
}
|
| 191 |
-
});
|
| 192 |
Â
|
| 193 |
Â
// Custom selectors
|
| 194 |
Â
$.extend( $.expr[ ":" ], {
|
|
Â
|
|
| 195 |
Â
// http://jqueryvalidation.org/blank-selector/
|
| 196 |
Â
blank: function( a ) {
|
| 197 |
Â
return !$.trim( "" + $( a ).val() );
|
| 198 |
Â
},
|
|
Â
|
|
| 199 |
Â
// http://jqueryvalidation.org/filled-selector/
|
| 200 |
Â
filled: function( a ) {
|
| 201 |
-
|
|
Â
|
|
| 202 |
Â
},
|
|
Â
|
|
| 203 |
Â
// http://jqueryvalidation.org/unchecked-selector/
|
| 204 |
Â
unchecked: function( a ) {
|
| 205 |
Â
return !$( a ).prop( "checked" );
|
| 206 |
Â
}
|
| 207 |
-
});
|
| 208 |
Â
|
| 209 |
-
//
|
| 210 |
Â
$.validator = function( options, form ) {
|
| 211 |
Â
this.settings = $.extend( true, {}, $.validator.defaults, options );
|
| 212 |
Â
this.currentForm = form;
|
|
@@ -222,6 +240,9 @@ $.validator.format = function( source, params ) {
|
|
| 222 |
Â
return $.validator.format.apply( this, args );
|
| 223 |
Â
};
|
| 224 |
Â
}
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 225 |
Â
if ( arguments.length > 2 && params.constructor !== Array ) {
|
| 226 |
Â
params = $.makeArray( arguments ).slice( 1 );
|
| 227 |
Â
}
|
|
@@ -231,8 +252,8 @@ $.validator.format = function( source, params ) {
|
|
| 231 |
Â
$.each( params, function( i, n ) {
|
| 232 |
Â
source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() {
|
| 233 |
Â
return n;
|
| 234 |
-
});
|
| 235 |
-
});
|
| 236 |
Â
return source;
|
| 237 |
Â
};
|
| 238 |
Â
|
|
@@ -243,8 +264,10 @@ $.extend( $.validator, {
|
|
| 243 |
Â
groups: {},
|
| 244 |
Â
rules: {},
|
| 245 |
Â
errorClass: "error",
|
|
Â
|
|
| 246 |
Â
validClass: "valid",
|
| 247 |
Â
errorElement: "label",
|
|
Â
|
|
| 248 |
Â
focusInvalid: true,
|
| 249 |
Â
errorContainer: $( [] ),
|
| 250 |
Â
errorLabelContainer: $( [] ),
|
|
@@ -254,8 +277,8 @@ $.extend( $.validator, {
|
|
| 254 |
Â
onfocusin: function( element ) {
|
| 255 |
Â
this.lastActive = element;
|
| 256 |
Â
|
| 257 |
-
//
|
| 258 |
-
if ( this.settings.focusCleanup
|
| 259 |
Â
if ( this.settings.unhighlight ) {
|
| 260 |
Â
this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
|
| 261 |
Â
}
|
|
@@ -268,18 +291,39 @@ $.extend( $.validator, {
|
|
| 268 |
Â
}
|
| 269 |
Â
},
|
| 270 |
Â
onkeyup: function( element, event ) {
|
| 271 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 272 |
Â
return;
|
| 273 |
-
} else if ( element.name in this.submitted || element
|
| 274 |
Â
this.element( element );
|
| 275 |
Â
}
|
| 276 |
Â
},
|
| 277 |
Â
onclick: function( element ) {
|
| 278 |
-
|
|
Â
|
|
| 279 |
Â
if ( element.name in this.submitted ) {
|
| 280 |
Â
this.element( element );
|
| 281 |
Â
|
| 282 |
-
//
|
| 283 |
Â
} else if ( element.parentNode.name in this.submitted ) {
|
| 284 |
Â
this.element( element.parentNode );
|
| 285 |
Â
}
|
|
@@ -314,14 +358,14 @@ $.extend( $.validator, {
|
|
| 314 |
Â
dateISO: "Please enter a valid date ( ISO ).",
|
| 315 |
Â
number: "Please enter a valid number.",
|
| 316 |
Â
digits: "Please enter only digits.",
|
| 317 |
-
creditcard: "Please enter a valid credit card number.",
|
| 318 |
Â
equalTo: "Please enter the same value again.",
|
| 319 |
Â
maxlength: $.validator.format( "Please enter no more than {0} characters." ),
|
| 320 |
Â
minlength: $.validator.format( "Please enter at least {0} characters." ),
|
| 321 |
Â
rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ),
|
| 322 |
Â
range: $.validator.format( "Please enter a value between {0} and {1}." ),
|
| 323 |
Â
max: $.validator.format( "Please enter a value less than or equal to {0}." ),
|
| 324 |
-
min: $.validator.format( "Please enter a value greater than or equal to {0}." )
|
|
Â
|
|
| 325 |
Â
},
|
| 326 |
Â
|
| 327 |
Â
autoCreateRanges: false,
|
|
@@ -347,34 +391,35 @@ $.extend( $.validator, {
|
|
| 347 |
Â
}
|
| 348 |
Â
$.each( value, function( index, name ) {
|
| 349 |
Â
groups[ name ] = key;
|
| 350 |
-
});
|
| 351 |
-
});
|
| 352 |
Â
rules = this.settings.rules;
|
| 353 |
Â
$.each( rules, function( key, value ) {
|
| 354 |
Â
rules[ key ] = $.validator.normalizeRule( value );
|
| 355 |
-
});
|
| 356 |
Â
|
| 357 |
Â
function delegate( event ) {
|
| 358 |
-
var validator = $.data( this
|
| 359 |
Â
eventType = "on" + event.type.replace( /^validate/, "" ),
|
| 360 |
Â
settings = validator.settings;
|
| 361 |
-
if ( settings[ eventType ] &&
|
| 362 |
-
settings[ eventType ].call( validator, this
|
| 363 |
Â
}
|
| 364 |
Â
}
|
|
Â
|
|
| 365 |
Â
$( this.currentForm )
|
| 366 |
-
.
|
| 367 |
-
"[type='
|
| 368 |
-
"[type='email'], [type='datetime'], [type='date'], [type='month'], " +
|
| 369 |
-
"[type='week'], [type='time'], [type='datetime-local'], " +
|
| 370 |
-
"[type='
|
| 371 |
-
|
| 372 |
Â
// Support: Chrome, oldIE
|
| 373 |
Â
// "select" is provided as event.target when clicking a option
|
| 374 |
-
.
|
| 375 |
Â
|
| 376 |
Â
if ( this.settings.invalidHandler ) {
|
| 377 |
-
$( this.currentForm ).
|
| 378 |
Â
}
|
| 379 |
Â
|
| 380 |
Â
// Add aria-required to any Static/Data/Class required fields before first validation
|
|
@@ -386,9 +431,9 @@ $.extend( $.validator, {
|
|
| 386 |
Â
form: function() {
|
| 387 |
Â
this.checkForm();
|
| 388 |
Â
$.extend( this.submitted, this.errorMap );
|
| 389 |
-
this.invalid = $.extend({}, this.errorMap );
|
| 390 |
Â
if ( !this.valid() ) {
|
| 391 |
-
$( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
|
| 392 |
Â
}
|
| 393 |
Â
this.showErrors();
|
| 394 |
Â
return this.valid();
|
|
@@ -406,9 +451,9 @@ $.extend( $.validator, {
|
|
| 406 |
Â
element: function( element ) {
|
| 407 |
Â
var cleanElement = this.clean( element ),
|
| 408 |
Â
checkElement = this.validationTargetFor( cleanElement ),
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
Â
|
| 413 |
Â
if ( checkElement === undefined ) {
|
| 414 |
Â
delete this.invalid[ cleanElement.name ];
|
|
@@ -416,40 +461,61 @@ $.extend( $.validator, {
|
|
| 416 |
Â
this.prepareElement( checkElement );
|
| 417 |
Â
this.currentElements = $( checkElement );
|
| 418 |
Â
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 422 |
Â
} else {
|
| 423 |
Â
this.invalid[ checkElement.name ] = true;
|
| 424 |
Â
}
|
| 425 |
-
}
|
| 426 |
-
// Add aria-invalid status for screen readers
|
| 427 |
-
$( element ).attr( "aria-invalid", !result );
|
| 428 |
Â
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 432 |
Â
}
|
| 433 |
-
|
| 434 |
Â
return result;
|
| 435 |
Â
},
|
| 436 |
Â
|
| 437 |
Â
// http://jqueryvalidation.org/Validator.showErrors/
|
| 438 |
Â
showErrors: function( errors ) {
|
| 439 |
Â
if ( errors ) {
|
| 440 |
-
|
|
Â
|
|
|
Â
|
|
| 441 |
Â
$.extend( this.errorMap, errors );
|
| 442 |
-
this.errorList =
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
//
|
| 450 |
Â
this.successList = $.grep( this.successList, function( element ) {
|
| 451 |
Â
return !( element.name in errors );
|
| 452 |
-
});
|
| 453 |
Â
}
|
| 454 |
Â
if ( this.settings.showErrors ) {
|
| 455 |
Â
this.settings.showErrors.call( this, this.errorMap, this.errorList );
|
|
@@ -463,14 +529,31 @@ $.extend( $.validator, {
|
|
| 463 |
Â
if ( $.fn.resetForm ) {
|
| 464 |
Â
$( this.currentForm ).resetForm();
|
| 465 |
Â
}
|
|
Â
|
|
| 466 |
Â
this.submitted = {};
|
| 467 |
-
this.lastElement = null;
|
| 468 |
Â
this.prepareForm();
|
| 469 |
Â
this.hideErrors();
|
| 470 |
-
this.elements()
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 471 |
Â
.removeClass( this.settings.errorClass )
|
| 472 |
-
.
|
| 473 |
-
|
| 474 |
Â
},
|
| 475 |
Â
|
| 476 |
Â
numberOfInvalids: function() {
|
|
@@ -482,7 +565,9 @@ $.extend( $.validator, {
|
|
| 482 |
Â
var count = 0,
|
| 483 |
Â
i;
|
| 484 |
Â
for ( i in obj ) {
|
| 485 |
-
|
|
Â
|
|
|
Â
|
|
| 486 |
Â
}
|
| 487 |
Â
return count;
|
| 488 |
Â
},
|
|
@@ -507,13 +592,15 @@ $.extend( $.validator, {
|
|
| 507 |
Â
focusInvalid: function() {
|
| 508 |
Â
if ( this.settings.focusInvalid ) {
|
| 509 |
Â
try {
|
| 510 |
-
$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [])
|
| 511 |
Â
.filter( ":visible" )
|
| 512 |
Â
.focus()
|
| 513 |
-
|
|
Â
|
|
| 514 |
Â
.trigger( "focusin" );
|
| 515 |
Â
} catch ( e ) {
|
| 516 |
-
|
|
Â
|
|
| 517 |
Â
}
|
| 518 |
Â
}
|
| 519 |
Â
},
|
|
@@ -522,31 +609,37 @@ $.extend( $.validator, {
|
|
| 522 |
Â
var lastActive = this.lastActive;
|
| 523 |
Â
return lastActive && $.grep( this.errorList, function( n ) {
|
| 524 |
Â
return n.element.name === lastActive.name;
|
| 525 |
-
}).length === 1 && lastActive;
|
| 526 |
Â
},
|
| 527 |
Â
|
| 528 |
Â
elements: function() {
|
| 529 |
Â
var validator = this,
|
| 530 |
Â
rulesCache = {};
|
| 531 |
Â
|
| 532 |
-
//
|
| 533 |
Â
return $( this.currentForm )
|
| 534 |
-
.find( "input, select, textarea" )
|
| 535 |
-
.not( ":submit, :reset, :image,
|
| 536 |
Â
.not( this.settings.ignore )
|
| 537 |
Â
.filter( function() {
|
| 538 |
-
|
|
Â
|
|
| 539 |
Â
console.error( "%o has no name assigned", this );
|
| 540 |
Â
}
|
| 541 |
Â
|
| 542 |
-
//
|
| 543 |
-
if ( this.
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 544 |
Â
return false;
|
| 545 |
Â
}
|
| 546 |
Â
|
| 547 |
-
rulesCache[
|
| 548 |
Â
return true;
|
| 549 |
-
});
|
| 550 |
Â
},
|
| 551 |
Â
|
| 552 |
Â
clean: function( selector ) {
|
|
@@ -558,12 +651,16 @@ $.extend( $.validator, {
|
|
| 558 |
Â
return $( this.settings.errorElement + "." + errorClass, this.errorContext );
|
| 559 |
Â
},
|
| 560 |
Â
|
| 561 |
-
|
| 562 |
Â
this.successList = [];
|
| 563 |
Â
this.errorList = [];
|
| 564 |
Â
this.errorMap = {};
|
| 565 |
Â
this.toShow = $( [] );
|
| 566 |
Â
this.toHide = $( [] );
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 567 |
Â
this.currentElements = $( [] );
|
| 568 |
Â
},
|
| 569 |
Â
|
|
@@ -578,19 +675,48 @@ $.extend( $.validator, {
|
|
| 578 |
Â
},
|
| 579 |
Â
|
| 580 |
Â
elementValue: function( element ) {
|
| 581 |
-
var
|
| 582 |
-
|
| 583 |
-
|
| 584 |
Â
|
| 585 |
Â
if ( type === "radio" || type === "checkbox" ) {
|
| 586 |
-
return
|
| 587 |
Â
} else if ( type === "number" && typeof element.validity !== "undefined" ) {
|
| 588 |
-
return element.validity.badInput ?
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 589 |
Â
}
|
| 590 |
Â
|
| 591 |
-
val = $element.val();
|
| 592 |
Â
if ( typeof val === "string" ) {
|
| 593 |
-
return val.replace(/\r/g, "" );
|
| 594 |
Â
}
|
| 595 |
Â
return val;
|
| 596 |
Â
},
|
|
@@ -601,18 +727,33 @@ $.extend( $.validator, {
|
|
| 601 |
Â
var rules = $( element ).rules(),
|
| 602 |
Â
rulesCount = $.map( rules, function( n, i ) {
|
| 603 |
Â
return i;
|
| 604 |
-
}).length,
|
| 605 |
Â
dependencyMismatch = false,
|
| 606 |
Â
val = this.elementValue( element ),
|
| 607 |
Â
result, method, rule;
|
| 608 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 609 |
Â
for ( method in rules ) {
|
| 610 |
Â
rule = { method: method, parameters: rules[ method ] };
|
| 611 |
Â
try {
|
| 612 |
-
|
| 613 |
Â
result = $.validator.methods[ method ].call( this, val, element, rule.parameters );
|
| 614 |
Â
|
| 615 |
-
//
|
| 616 |
Â
// don't mark it as valid when there are no other rules
|
| 617 |
Â
if ( result === "dependency-mismatch" && rulesCount === 1 ) {
|
| 618 |
Â
dependencyMismatch = true;
|
|
@@ -633,6 +774,10 @@ $.extend( $.validator, {
|
|
| 633 |
Â
if ( this.settings.debug && window.console ) {
|
| 634 |
Â
console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
|
| 635 |
Â
}
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 636 |
Â
throw e;
|
| 637 |
Â
}
|
| 638 |
Â
}
|
|
@@ -645,7 +790,7 @@ $.extend( $.validator, {
|
|
| 645 |
Â
return true;
|
| 646 |
Â
},
|
| 647 |
Â
|
| 648 |
-
//
|
| 649 |
Â
// specified in the element's HTML5 data attribute
|
| 650 |
Â
// return the generic message if present and no method specific message is present
|
| 651 |
Â
customDataMessage: function( element, method ) {
|
|
@@ -653,15 +798,15 @@ $.extend( $.validator, {
|
|
| 653 |
Â
method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" );
|
| 654 |
Â
},
|
| 655 |
Â
|
| 656 |
-
//
|
| 657 |
Â
customMessage: function( name, method ) {
|
| 658 |
Â
var m = this.settings.messages[ name ];
|
| 659 |
-
return m && ( m.constructor === String ? m : m[ method ]);
|
| 660 |
Â
},
|
| 661 |
Â
|
| 662 |
-
//
|
| 663 |
Â
findDefined: function() {
|
| 664 |
-
for ( var i = 0; i < arguments.length; i++) {
|
| 665 |
Â
if ( arguments[ i ] !== undefined ) {
|
| 666 |
Â
return arguments[ i ];
|
| 667 |
Â
}
|
|
@@ -669,30 +814,34 @@ $.extend( $.validator, {
|
|
| 669 |
Â
return undefined;
|
| 670 |
Â
},
|
| 671 |
Â
|
| 672 |
-
defaultMessage: function( element,
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
// title is never undefined, so handle empty string as undefined
|
| 677 |
-
!this.settings.ignoreTitle && element.title || undefined,
|
| 678 |
-
$.validator.messages[ method ],
|
| 679 |
-
"<strong>Warning: No message defined for " + element.name + "</strong>"
|
| 680 |
-
);
|
| 681 |
-
},
|
| 682 |
Â
|
| 683 |
-
|
| 684 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 685 |
Â
theregex = /\$?\{(\d+)\}/g;
|
| 686 |
Â
if ( typeof message === "function" ) {
|
| 687 |
Â
message = message.call( this, rule.parameters, element );
|
| 688 |
Â
} else if ( theregex.test( message ) ) {
|
| 689 |
Â
message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters );
|
| 690 |
Â
}
|
| 691 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 692 |
Â
message: message,
|
| 693 |
Â
element: element,
|
| 694 |
Â
method: rule.method
|
| 695 |
-
});
|
| 696 |
Â
|
| 697 |
Â
this.errorMap[ element.name ] = message;
|
| 698 |
Â
this.submitted[ element.name ] = message;
|
|
@@ -737,23 +886,27 @@ $.extend( $.validator, {
|
|
| 737 |
Â
},
|
| 738 |
Â
|
| 739 |
Â
invalidElements: function() {
|
| 740 |
-
return $( this.errorList ).map(function() {
|
| 741 |
Â
return this.element;
|
| 742 |
-
});
|
| 743 |
Â
},
|
| 744 |
Â
|
| 745 |
Â
showLabel: function( element, message ) {
|
| 746 |
-
var place, group, errorID,
|
| 747 |
Â
error = this.errorsFor( element ),
|
| 748 |
Â
elementID = this.idOrName( element ),
|
| 749 |
Â
describedBy = $( element ).attr( "aria-describedby" );
|
|
Â
|
|
| 750 |
Â
if ( error.length ) {
|
| 751 |
-
|
|
Â
|
|
| 752 |
Â
error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
|
| 753 |
-
|
|
Â
|
|
| 754 |
Â
error.html( message );
|
| 755 |
Â
} else {
|
| 756 |
-
|
|
Â
|
|
| 757 |
Â
error = $( "<" + this.settings.errorElement + ">" )
|
| 758 |
Â
.attr( "id", elementID + "-error" )
|
| 759 |
Â
.addClass( this.settings.errorClass )
|
|
@@ -762,7 +915,8 @@ $.extend( $.validator, {
|
|
| 762 |
Â
// Maintain reference to the element to be placed into the DOM
|
| 763 |
Â
place = error;
|
| 764 |
Â
if ( this.settings.wrapper ) {
|
| 765 |
-
|
|
Â
|
|
| 766 |
Â
// actually showing the wrapped element is handled elsewhere
|
| 767 |
Â
place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent();
|
| 768 |
Â
}
|
|
@@ -776,17 +930,20 @@ $.extend( $.validator, {
|
|
| 776 |
Â
|
| 777 |
Â
// Link error back to the element
|
| 778 |
Â
if ( error.is( "label" ) ) {
|
|
Â
|
|
| 779 |
Â
// If the error is a label, then associate using 'for'
|
| 780 |
Â
error.attr( "for", elementID );
|
| 781 |
-
|
| 782 |
Â
// If the element is not a child of an associated label, then it's necessary
|
| 783 |
Â
// to explicitly apply aria-describedby
|
| 784 |
-
|
| 785 |
Â
errorID = error.attr( "id" );
|
|
Â
|
|
| 786 |
Â
// Respect existing non-error aria-describedby
|
| 787 |
Â
if ( !describedBy ) {
|
| 788 |
Â
describedBy = errorID;
|
| 789 |
-
} else if ( !describedBy.match( new RegExp( "
|
|
Â
|
|
| 790 |
Â
// Add to end of list if not already present
|
| 791 |
Â
describedBy += " " + errorID;
|
| 792 |
Â
}
|
|
@@ -795,12 +952,13 @@ $.extend( $.validator, {
|
|
| 795 |
Â
// If this element is grouped, then assign to all elements in the same group
|
| 796 |
Â
group = this.groups[ element.name ];
|
| 797 |
Â
if ( group ) {
|
| 798 |
-
|
|
Â
|
|
| 799 |
Â
if ( testgroup === group ) {
|
| 800 |
-
$( "[name='" + name + "']",
|
| 801 |
Â
.attr( "aria-describedby", error.attr( "id" ) );
|
| 802 |
Â
}
|
| 803 |
-
});
|
| 804 |
Â
}
|
| 805 |
Â
}
|
| 806 |
Â
}
|
|
@@ -816,28 +974,41 @@ $.extend( $.validator, {
|
|
| 816 |
Â
},
|
| 817 |
Â
|
| 818 |
Â
errorsFor: function( element ) {
|
| 819 |
-
var name = this.idOrName( element ),
|
| 820 |
Â
describer = $( element ).attr( "aria-describedby" ),
|
| 821 |
Â
selector = "label[for='" + name + "'], label[for='" + name + "'] *";
|
| 822 |
-
|
|
Â
|
|
| 823 |
Â
if ( describer ) {
|
| 824 |
-
selector = selector + ", #" +
|
|
Â
|
|
| 825 |
Â
}
|
|
Â
|
|
| 826 |
Â
return this
|
| 827 |
Â
.errors()
|
| 828 |
Â
.filter( selector );
|
| 829 |
Â
},
|
| 830 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 831 |
Â
idOrName: function( element ) {
|
| 832 |
Â
return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );
|
| 833 |
Â
},
|
| 834 |
Â
|
| 835 |
Â
validationTargetFor: function( element ) {
|
| 836 |
-
|
|
Â
|
|
| 837 |
Â
if ( this.checkable( element ) ) {
|
| 838 |
-
element = this.findByName( element.name )
|
| 839 |
Â
}
|
| 840 |
-
|
|
Â
|
|
|
Â
|
|
| 841 |
Â
},
|
| 842 |
Â
|
| 843 |
Â
checkable: function( element ) {
|
|
@@ -845,7 +1016,7 @@ $.extend( $.validator, {
|
|
| 845 |
Â
},
|
| 846 |
Â
|
| 847 |
Â
findByName: function( name ) {
|
| 848 |
-
return $( this.currentForm ).find( "[name='" + name + "']" );
|
| 849 |
Â
},
|
| 850 |
Â
|
| 851 |
Â
getLength: function( value, element ) {
|
|
@@ -861,7 +1032,7 @@ $.extend( $.validator, {
|
|
| 861 |
Â
},
|
| 862 |
Â
|
| 863 |
Â
depend: function( param, element ) {
|
| 864 |
-
return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true;
|
| 865 |
Â
},
|
| 866 |
Â
|
| 867 |
Â
dependTypes: {
|
|
@@ -884,32 +1055,47 @@ $.extend( $.validator, {
|
|
| 884 |
Â
startRequest: function( element ) {
|
| 885 |
Â
if ( !this.pending[ element.name ] ) {
|
| 886 |
Â
this.pendingRequest++;
|
|
Â
|
|
| 887 |
Â
this.pending[ element.name ] = true;
|
| 888 |
Â
}
|
| 889 |
Â
},
|
| 890 |
Â
|
| 891 |
Â
stopRequest: function( element, valid ) {
|
| 892 |
Â
this.pendingRequest--;
|
| 893 |
-
|
|
Â
|
|
| 894 |
Â
if ( this.pendingRequest < 0 ) {
|
| 895 |
Â
this.pendingRequest = 0;
|
| 896 |
Â
}
|
| 897 |
Â
delete this.pending[ element.name ];
|
|
Â
|
|
| 898 |
Â
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
|
| 899 |
Â
$( this.currentForm ).submit();
|
| 900 |
Â
this.formSubmitted = false;
|
| 901 |
-
} else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) {
|
| 902 |
-
$( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
|
| 903 |
Â
this.formSubmitted = false;
|
| 904 |
Â
}
|
| 905 |
Â
},
|
| 906 |
Â
|
| 907 |
-
previousValue: function( element ) {
|
| 908 |
Â
return $.data( element, "previousValue" ) || $.data( element, "previousValue", {
|
| 909 |
Â
old: null,
|
| 910 |
Â
valid: true,
|
| 911 |
-
message: this.defaultMessage( element,
|
| 912 |
-
});
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 913 |
Â
}
|
| 914 |
Â
|
| 915 |
Â
},
|
|
@@ -940,13 +1126,36 @@ $.extend( $.validator, {
|
|
| 940 |
Â
if ( classes ) {
|
| 941 |
Â
$.each( classes.split( " " ), function() {
|
| 942 |
Â
if ( this in $.validator.classRuleSettings ) {
|
| 943 |
-
$.extend( rules, $.validator.classRuleSettings[ this ]);
|
| 944 |
Â
}
|
| 945 |
-
});
|
| 946 |
Â
}
|
| 947 |
Â
return rules;
|
| 948 |
Â
},
|
| 949 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 950 |
Â
attributeRules: function( element ) {
|
| 951 |
Â
var rules = {},
|
| 952 |
Â
$element = $( element ),
|
|
@@ -955,36 +1164,26 @@ $.extend( $.validator, {
|
|
| 955 |
Â
|
| 956 |
Â
for ( method in $.validator.methods ) {
|
| 957 |
Â
|
| 958 |
-
//
|
| 959 |
Â
if ( method === "required" ) {
|
| 960 |
Â
value = element.getAttribute( method );
|
|
Â
|
|
| 961 |
Â
// Some browsers return an empty string for the required attribute
|
| 962 |
Â
// and non-HTML5 browsers might have required="" markup
|
| 963 |
Â
if ( value === "" ) {
|
| 964 |
Â
value = true;
|
| 965 |
Â
}
|
| 966 |
-
|
|
Â
|
|
| 967 |
Â
value = !!value;
|
| 968 |
Â
} else {
|
| 969 |
Â
value = $element.attr( method );
|
| 970 |
Â
}
|
| 971 |
Â
|
| 972 |
-
|
| 973 |
-
// allows type="date" and others to be compared as strings
|
| 974 |
-
if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
|
| 975 |
-
value = Number( value );
|
| 976 |
-
}
|
| 977 |
-
|
| 978 |
-
if ( value || value === 0 ) {
|
| 979 |
-
rules[ method ] = value;
|
| 980 |
-
} else if ( type === method && type !== "range" ) {
|
| 981 |
-
// exception: the jquery validate 'range' method
|
| 982 |
-
// does not test for the html5 'range' type
|
| 983 |
-
rules[ method ] = true;
|
| 984 |
-
}
|
| 985 |
Â
}
|
| 986 |
Â
|
| 987 |
-
// maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
|
| 988 |
Â
if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {
|
| 989 |
Â
delete rules.maxlength;
|
| 990 |
Â
}
|
|
@@ -993,13 +1192,14 @@ $.extend( $.validator, {
|
|
| 993 |
Â
},
|
| 994 |
Â
|
| 995 |
Â
dataRules: function( element ) {
|
| 996 |
-
var
|
| 997 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 998 |
Â
for ( method in $.validator.methods ) {
|
| 999 |
Â
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
|
| 1000 |
-
|
| 1001 |
-
rules[ method ] = value;
|
| 1002 |
-
}
|
| 1003 |
Â
}
|
| 1004 |
Â
return rules;
|
| 1005 |
Â
},
|
|
@@ -1015,9 +1215,11 @@ $.extend( $.validator, {
|
|
| 1015 |
Â
},
|
| 1016 |
Â
|
| 1017 |
Â
normalizeRules: function( rules, element ) {
|
| 1018 |
-
|
|
Â
|
|
| 1019 |
Â
$.each( rules, function( prop, val ) {
|
| 1020 |
-
|
|
Â
|
|
| 1021 |
Â
if ( val === false ) {
|
| 1022 |
Â
delete rules[ prop ];
|
| 1023 |
Â
return;
|
|
@@ -1035,42 +1237,44 @@ $.extend( $.validator, {
|
|
| 1035 |
Â
if ( keepRule ) {
|
| 1036 |
Â
rules[ prop ] = val.param !== undefined ? val.param : true;
|
| 1037 |
Â
} else {
|
|
Â
|
|
| 1038 |
Â
delete rules[ prop ];
|
| 1039 |
Â
}
|
| 1040 |
Â
}
|
| 1041 |
-
});
|
| 1042 |
Â
|
| 1043 |
-
//
|
| 1044 |
Â
$.each( rules, function( rule, parameter ) {
|
| 1045 |
-
rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter;
|
| 1046 |
-
});
|
| 1047 |
Â
|
| 1048 |
-
//
|
| 1049 |
-
$.each([ "minlength", "maxlength" ], function() {
|
| 1050 |
Â
if ( rules[ this ] ) {
|
| 1051 |
Â
rules[ this ] = Number( rules[ this ] );
|
| 1052 |
Â
}
|
| 1053 |
-
});
|
| 1054 |
-
$.each([ "rangelength", "range" ], function() {
|
| 1055 |
Â
var parts;
|
| 1056 |
Â
if ( rules[ this ] ) {
|
| 1057 |
Â
if ( $.isArray( rules[ this ] ) ) {
|
| 1058 |
-
rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ];
|
| 1059 |
Â
} else if ( typeof rules[ this ] === "string" ) {
|
| 1060 |
-
parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ );
|
| 1061 |
-
rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ];
|
| 1062 |
Â
}
|
| 1063 |
Â
}
|
| 1064 |
-
});
|
| 1065 |
Â
|
| 1066 |
Â
if ( $.validator.autoCreateRanges ) {
|
| 1067 |
-
|
| 1068 |
-
|
|
Â
|
|
| 1069 |
Â
rules.range = [ rules.min, rules.max ];
|
| 1070 |
Â
delete rules.min;
|
| 1071 |
Â
delete rules.max;
|
| 1072 |
Â
}
|
| 1073 |
-
if ( rules.minlength && rules.maxlength ) {
|
| 1074 |
Â
rules.rangelength = [ rules.minlength, rules.maxlength ];
|
| 1075 |
Â
delete rules.minlength;
|
| 1076 |
Â
delete rules.maxlength;
|
|
@@ -1086,7 +1290,7 @@ $.extend( $.validator, {
|
|
| 1086 |
Â
var transformed = {};
|
| 1087 |
Â
$.each( data.split( /\s/ ), function() {
|
| 1088 |
Â
transformed[ this ] = true;
|
| 1089 |
-
});
|
| 1090 |
Â
data = transformed;
|
| 1091 |
Â
}
|
| 1092 |
Â
return data;
|
|
@@ -1101,28 +1305,32 @@ $.extend( $.validator, {
|
|
| 1101 |
Â
}
|
| 1102 |
Â
},
|
| 1103 |
Â
|
|
Â
|
|
| 1104 |
Â
methods: {
|
| 1105 |
Â
|
| 1106 |
Â
// http://jqueryvalidation.org/required-method/
|
| 1107 |
Â
required: function( value, element, param ) {
|
| 1108 |
-
|
|
Â
|
|
| 1109 |
Â
if ( !this.depend( param, element ) ) {
|
| 1110 |
Â
return "dependency-mismatch";
|
| 1111 |
Â
}
|
| 1112 |
Â
if ( element.nodeName.toLowerCase() === "select" ) {
|
| 1113 |
-
|
|
Â
|
|
| 1114 |
Â
var val = $( element ).val();
|
| 1115 |
Â
return val && val.length > 0;
|
| 1116 |
Â
}
|
| 1117 |
Â
if ( this.checkable( element ) ) {
|
| 1118 |
Â
return this.getLength( value, element ) > 0;
|
| 1119 |
Â
}
|
| 1120 |
-
return
|
| 1121 |
Â
},
|
| 1122 |
Â
|
| 1123 |
Â
// http://jqueryvalidation.org/email-method/
|
| 1124 |
Â
email: function( value, element ) {
|
| 1125 |
-
|
|
Â
|
|
| 1126 |
Â
// Retrieved 2014-01-14
|
| 1127 |
Â
// If you have a problem with this implementation, report a bug against the above spec
|
| 1128 |
Â
// Or use custom methods to implement your own email validation
|
|
@@ -1131,8 +1339,12 @@ $.extend( $.validator, {
|
|
| 1131 |
Â
|
| 1132 |
Â
// http://jqueryvalidation.org/url-method/
|
| 1133 |
Â
url: function( value, element ) {
|
| 1134 |
-
|
| 1135 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1136 |
Â
},
|
| 1137 |
Â
|
| 1138 |
Â
// http://jqueryvalidation.org/date-method/
|
|
@@ -1147,7 +1359,7 @@ $.extend( $.validator, {
|
|
| 1147 |
Â
|
| 1148 |
Â
// http://jqueryvalidation.org/number-method/
|
| 1149 |
Â
number: function( value, element ) {
|
| 1150 |
-
return this.optional( element ) ||
|
| 1151 |
Â
},
|
| 1152 |
Â
|
| 1153 |
Â
// http://jqueryvalidation.org/digits-method/
|
|
@@ -1155,59 +1367,21 @@ $.extend( $.validator, {
|
|
| 1155 |
Â
return this.optional( element ) || /^\d+$/.test( value );
|
| 1156 |
Â
},
|
| 1157 |
Â
|
| 1158 |
-
// http://jqueryvalidation.org/creditcard-method/
|
| 1159 |
-
// based on http://en.wikipedia.org/wiki/Luhn/
|
| 1160 |
-
creditcard: function( value, element ) {
|
| 1161 |
-
if ( this.optional( element ) ) {
|
| 1162 |
-
return "dependency-mismatch";
|
| 1163 |
-
}
|
| 1164 |
-
// accept only spaces, digits and dashes
|
| 1165 |
-
if ( /[^0-9 \-]+/.test( value ) ) {
|
| 1166 |
-
return false;
|
| 1167 |
-
}
|
| 1168 |
-
var nCheck = 0,
|
| 1169 |
-
nDigit = 0,
|
| 1170 |
-
bEven = false,
|
| 1171 |
-
n, cDigit;
|
| 1172 |
-
|
| 1173 |
-
value = value.replace( /\D/g, "" );
|
| 1174 |
-
|
| 1175 |
-
// Basing min and max length on
|
| 1176 |
-
// http://developer.ean.com/general_info/Valid_Credit_Card_Types
|
| 1177 |
-
if ( value.length < 13 || value.length > 19 ) {
|
| 1178 |
-
return false;
|
| 1179 |
-
}
|
| 1180 |
-
|
| 1181 |
-
for ( n = value.length - 1; n >= 0; n--) {
|
| 1182 |
-
cDigit = value.charAt( n );
|
| 1183 |
-
nDigit = parseInt( cDigit, 10 );
|
| 1184 |
-
if ( bEven ) {
|
| 1185 |
-
if ( ( nDigit *= 2 ) > 9 ) {
|
| 1186 |
-
nDigit -= 9;
|
| 1187 |
-
}
|
| 1188 |
-
}
|
| 1189 |
-
nCheck += nDigit;
|
| 1190 |
-
bEven = !bEven;
|
| 1191 |
-
}
|
| 1192 |
-
|
| 1193 |
-
return ( nCheck % 10 ) === 0;
|
| 1194 |
-
},
|
| 1195 |
-
|
| 1196 |
Â
// http://jqueryvalidation.org/minlength-method/
|
| 1197 |
Â
minlength: function( value, element, param ) {
|
| 1198 |
-
var length = $.isArray( value ) ? value.length : this.getLength(
|
| 1199 |
Â
return this.optional( element ) || length >= param;
|
| 1200 |
Â
},
|
| 1201 |
Â
|
| 1202 |
Â
// http://jqueryvalidation.org/maxlength-method/
|
| 1203 |
Â
maxlength: function( value, element, param ) {
|
| 1204 |
-
var length = $.isArray( value ) ? value.length : this.getLength(
|
| 1205 |
Â
return this.optional( element ) || length <= param;
|
| 1206 |
Â
},
|
| 1207 |
Â
|
| 1208 |
Â
// http://jqueryvalidation.org/rangelength-method/
|
| 1209 |
Â
rangelength: function( value, element, param ) {
|
| 1210 |
-
var length = $.isArray( value ) ? value.length : this.getLength(
|
| 1211 |
Â
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
|
| 1212 |
Â
},
|
| 1213 |
Â
|
|
@@ -1226,47 +1400,64 @@ $.extend( $.validator, {
|
|
| 1226 |
Â
return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
|
| 1227 |
Â
},
|
| 1228 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1229 |
Â
// http://jqueryvalidation.org/equalTo-method/
|
| 1230 |
Â
equalTo: function( value, element, param ) {
|
| 1231 |
-
|
| 1232 |
-
//
|
| 1233 |
Â
var target = $( param );
|
| 1234 |
-
if ( this.settings.onfocusout ) {
|
| 1235 |
-
target.
|
| 1236 |
Â
$( element ).valid();
|
| 1237 |
-
});
|
| 1238 |
Â
}
|
| 1239 |
Â
return value === target.val();
|
| 1240 |
Â
},
|
| 1241 |
Â
|
| 1242 |
Â
// http://jqueryvalidation.org/remote-method/
|
| 1243 |
-
remote: function( value, element, param ) {
|
| 1244 |
Â
if ( this.optional( element ) ) {
|
| 1245 |
Â
return "dependency-mismatch";
|
| 1246 |
Â
}
|
| 1247 |
Â
|
| 1248 |
-
|
| 1249 |
-
|
|
Â
|
|
|
Â
|
|
| 1250 |
Â
|
| 1251 |
-
if (!this.settings.messages[ element.name ] ) {
|
| 1252 |
Â
this.settings.messages[ element.name ] = {};
|
| 1253 |
Â
}
|
| 1254 |
-
previous.originalMessage = this.settings.messages[ element.name ]
|
| 1255 |
-
this.settings.messages[ element.name ]
|
| 1256 |
Â
|
| 1257 |
Â
param = typeof param === "string" && { url: param } || param;
|
| 1258 |
-
|
| 1259 |
-
if ( previous.old ===
|
| 1260 |
Â
return previous.valid;
|
| 1261 |
Â
}
|
| 1262 |
Â
|
| 1263 |
-
previous.old =
|
| 1264 |
Â
validator = this;
|
| 1265 |
Â
this.startRequest( element );
|
| 1266 |
Â
data = {};
|
| 1267 |
Â
data[ element.name ] = value;
|
| 1268 |
Â
$.ajax( $.extend( true, {
|
| 1269 |
-
url: param,
|
| 1270 |
Â
mode: "abort",
|
| 1271 |
Â
port: "validate" + element.name,
|
| 1272 |
Â
dataType: "json",
|
|
@@ -1276,18 +1467,19 @@ $.extend( $.validator, {
|
|
| 1276 |
Â
var valid = response === true || response === "true",
|
| 1277 |
Â
errors, message, submitted;
|
| 1278 |
Â
|
| 1279 |
-
validator.settings.messages[ element.name ]
|
| 1280 |
Â
if ( valid ) {
|
| 1281 |
Â
submitted = validator.formSubmitted;
|
| 1282 |
-
validator.
|
|
Â
|
|
| 1283 |
Â
validator.formSubmitted = submitted;
|
| 1284 |
Â
validator.successList.push( element );
|
| 1285 |
-
|
| 1286 |
Â
validator.showErrors();
|
| 1287 |
Â
} else {
|
| 1288 |
Â
errors = {};
|
| 1289 |
-
message = response || validator.defaultMessage( element,
|
| 1290 |
-
errors[ element.name ] = previous.message =
|
| 1291 |
Â
validator.invalid[ element.name ] = true;
|
| 1292 |
Â
validator.showErrors( errors );
|
| 1293 |
Â
}
|
|
@@ -1297,61 +1489,44 @@ $.extend( $.validator, {
|
|
| 1297 |
Â
}, param ) );
|
| 1298 |
Â
return "pending";
|
| 1299 |
Â
}
|
| 1300 |
-
|
| 1301 |
Â
}
|
| 1302 |
Â
|
| 1303 |
-
});
|
| 1304 |
-
|
| 1305 |
-
|
| 1306 |
-
throw "$.format has been deprecated. Please use $.validator.format instead.";
|
| 1307 |
-
};
|
| 1308 |
-
|
| 1309 |
-
// ajax mode: abort
|
| 1310 |
Â
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
|
| 1311 |
Â
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
|
| 1312 |
Â
|
| 1313 |
Â
var pendingRequests = {},
|
| 1314 |
Â
ajax;
|
|
Â
|
|
| 1315 |
Â
// Use a prefilter if available (1.5+)
|
| 1316 |
Â
if ( $.ajaxPrefilter ) {
|
| 1317 |
-
$.ajaxPrefilter(function( settings, _, xhr ) {
|
| 1318 |
Â
var port = settings.port;
|
| 1319 |
Â
if ( settings.mode === "abort" ) {
|
| 1320 |
-
if ( pendingRequests[port] ) {
|
| 1321 |
-
pendingRequests[port].abort();
|
| 1322 |
Â
}
|
| 1323 |
-
pendingRequests[port] = xhr;
|
| 1324 |
Â
}
|
| 1325 |
-
});
|
| 1326 |
Â
} else {
|
|
Â
|
|
| 1327 |
Â
// Proxy ajax
|
| 1328 |
Â
ajax = $.ajax;
|
| 1329 |
Â
$.ajax = function( settings ) {
|
| 1330 |
Â
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
|
| 1331 |
Â
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
|
| 1332 |
Â
if ( mode === "abort" ) {
|
| 1333 |
-
if ( pendingRequests[port] ) {
|
| 1334 |
-
pendingRequests[port].abort();
|
| 1335 |
Â
}
|
| 1336 |
-
pendingRequests[port] = ajax.apply(this, arguments);
|
| 1337 |
-
return pendingRequests[port];
|
| 1338 |
Â
}
|
| 1339 |
-
return ajax.apply(this, arguments);
|
| 1340 |
Â
};
|
| 1341 |
Â
}
|
| 1342 |
-
|
| 1343 |
-
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
|
| 1344 |
-
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
|
| 1345 |
-
|
| 1346 |
-
$.extend($.fn, {
|
| 1347 |
-
validateDelegate: function( delegate, type, handler ) {
|
| 1348 |
-
return this.bind(type, function( event ) {
|
| 1349 |
-
var target = $(event.target);
|
| 1350 |
-
if ( target.is(delegate) ) {
|
| 1351 |
-
return handler.apply(target, arguments);
|
| 1352 |
-
}
|
| 1353 |
-
});
|
| 1354 |
-
}
|
| 1355 |
-
});
|
| 1356 |
-
|
| 1357 |
Â
}));
|
| 1 |
+
/*!
|
| 2 |
+
* jQuery Validation Plugin v1.15.0
|
| 3 |
+
*
|
| 4 |
+
* http://jqueryvalidation.org/
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 2016 Jörn Zaefferer
|
| 7 |
+
* Released under the MIT license
|
| 8 |
+
*/
|
| 9 |
+
(function( factory ) {
|
| 10 |
+
if ( typeof define === "function" && define.amd ) {
|
| 11 |
+
define( ["jquery"], factory );
|
| 12 |
+
} else if (typeof module === "object" && module.exports) {
|
| 13 |
+
module.exports = factory( require( "jquery" ) );
|
| 14 |
+
} else {
|
| 15 |
+
factory( jQuery );
|
| 16 |
+
}
|
| 17 |
+
}(function( $ ) {
|
| 18 |
+
|
| 19 |
+
$.extend( $.fn, {
|
| 20 |
Â
|
|
Â
|
|
| 21 |
Â
// http://jqueryvalidation.org/validate/
|
| 22 |
Â
validate: function( options ) {
|
| 23 |
Â
|
| 24 |
+
// If nothing is selected, return nothing; can't chain anyway
|
| 25 |
Â
if ( !this.length ) {
|
| 26 |
Â
if ( options && options.debug && window.console ) {
|
| 27 |
Â
console.warn( "Nothing selected, can't validate, returning nothing." );
|
| 29 |
Â
return;
|
| 30 |
Â
}
|
| 31 |
Â
|
| 32 |
+
// Check if a validator for this form was already created
|
| 33 |
Â
var validator = $.data( this[ 0 ], "validator" );
|
| 34 |
Â
if ( validator ) {
|
| 35 |
Â
return validator;
|
| 43 |
Â
|
| 44 |
Â
if ( validator.settings.onsubmit ) {
|
| 45 |
Â
|
| 46 |
+
this.on( "click.validate", ":submit", function( event ) {
|
| 47 |
Â
if ( validator.settings.submitHandler ) {
|
| 48 |
Â
validator.submitButton = event.target;
|
| 49 |
Â
}
|
| 50 |
+
|
| 51 |
+
// Allow suppressing validation by adding a cancel class to the submit button
|
| 52 |
+
if ( $( this ).hasClass( "cancel" ) ) {
|
| 53 |
Â
validator.cancelSubmit = true;
|
| 54 |
Â
}
|
| 55 |
Â
|
| 56 |
+
// Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
|
| 57 |
+
if ( $( this ).attr( "formnovalidate" ) !== undefined ) {
|
| 58 |
Â
validator.cancelSubmit = true;
|
| 59 |
Â
}
|
| 60 |
+
} );
|
| 61 |
Â
|
| 62 |
+
// Validate the form on submit
|
| 63 |
+
this.on( "submit.validate", function( event ) {
|
| 64 |
Â
if ( validator.settings.debug ) {
|
| 65 |
+
|
| 66 |
+
// Prevent form submit to be able to see console output
|
| 67 |
Â
event.preventDefault();
|
| 68 |
Â
}
|
| 69 |
Â
function handle() {
|
| 70 |
+
var hidden, result;
|
| 71 |
Â
if ( validator.settings.submitHandler ) {
|
| 72 |
Â
if ( validator.submitButton ) {
|
| 73 |
+
|
| 74 |
+
// Insert a hidden input as a replacement for the missing submit button
|
| 75 |
Â
hidden = $( "<input type='hidden'/>" )
|
| 76 |
Â
.attr( "name", validator.submitButton.name )
|
| 77 |
Â
.val( $( validator.submitButton ).val() )
|
| 78 |
Â
.appendTo( validator.currentForm );
|
| 79 |
Â
}
|
| 80 |
+
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
|
| 81 |
Â
if ( validator.submitButton ) {
|
| 82 |
+
|
| 83 |
+
// And clean up afterwards; thanks to no-block-scope, hidden can be referenced
|
| 84 |
Â
hidden.remove();
|
| 85 |
Â
}
|
| 86 |
+
if ( result !== undefined ) {
|
| 87 |
+
return result;
|
| 88 |
+
}
|
| 89 |
Â
return false;
|
| 90 |
Â
}
|
| 91 |
Â
return true;
|
| 92 |
Â
}
|
| 93 |
Â
|
| 94 |
+
// Prevent submit for invalid forms or custom submit handlers
|
| 95 |
Â
if ( validator.cancelSubmit ) {
|
| 96 |
Â
validator.cancelSubmit = false;
|
| 97 |
Â
return handle();
|
| 106 |
Â
validator.focusInvalid();
|
| 107 |
Â
return false;
|
| 108 |
Â
}
|
| 109 |
+
} );
|
| 110 |
Â
}
|
| 111 |
Â
|
| 112 |
Â
return validator;
|
| 113 |
Â
},
|
| 114 |
+
|
| 115 |
Â
// http://jqueryvalidation.org/valid/
|
| 116 |
Â
valid: function() {
|
| 117 |
+
var valid, validator, errorList;
|
| 118 |
Â
|
| 119 |
Â
if ( $( this[ 0 ] ).is( "form" ) ) {
|
| 120 |
Â
valid = this.validate().form();
|
| 121 |
Â
} else {
|
| 122 |
+
errorList = [];
|
| 123 |
Â
valid = true;
|
| 124 |
Â
validator = $( this[ 0 ].form ).validate();
|
| 125 |
Â
this.each( function() {
|
| 126 |
Â
valid = validator.element( this ) && valid;
|
| 127 |
+
if ( !valid ) {
|
| 128 |
+
errorList = errorList.concat( validator.errorList );
|
| 129 |
+
}
|
| 130 |
+
} );
|
| 131 |
+
validator.errorList = errorList;
|
| 132 |
Â
}
|
| 133 |
Â
return valid;
|
| 134 |
Â
},
|
| 135 |
+
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 136 |
Â
// http://jqueryvalidation.org/rules/
|
| 137 |
Â
rules: function( command, argument ) {
|
| 138 |
+
|
| 139 |
+
// If nothing is selected, return nothing; can't chain anyway
|
| 140 |
+
if ( !this.length ) {
|
| 141 |
+
return;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
Â
var element = this[ 0 ],
|
| 145 |
Â
settings, staticRules, existingRules, data, param, filtered;
|
| 146 |
Â
|
| 151 |
Â
switch ( command ) {
|
| 152 |
Â
case "add":
|
| 153 |
Â
$.extend( existingRules, $.validator.normalizeRule( argument ) );
|
| 154 |
+
|
| 155 |
+
// Remove messages from rules, but allow them to be set separately
|
| 156 |
Â
delete existingRules.messages;
|
| 157 |
Â
staticRules[ element.name ] = existingRules;
|
| 158 |
Â
if ( argument.messages ) {
|
| 171 |
Â
if ( method === "required" ) {
|
| 172 |
Â
$( element ).removeAttr( "aria-required" );
|
| 173 |
Â
}
|
| 174 |
+
} );
|
| 175 |
Â
return filtered;
|
| 176 |
Â
}
|
| 177 |
Â
}
|
| 185 |
Â
$.validator.staticRules( element )
|
| 186 |
Â
), element );
|
| 187 |
Â
|
| 188 |
+
// Make sure required is at front
|
| 189 |
Â
if ( data.required ) {
|
| 190 |
Â
param = data.required;
|
| 191 |
Â
delete data.required;
|
| 193 |
Â
$( element ).attr( "aria-required", "true" );
|
| 194 |
Â
}
|
| 195 |
Â
|
| 196 |
+
// Make sure remote is at back
|
| 197 |
Â
if ( data.remote ) {
|
| 198 |
Â
param = data.remote;
|
| 199 |
Â
delete data.remote;
|
| 200 |
+
data = $.extend( data, { remote: param } );
|
| 201 |
Â
}
|
| 202 |
Â
|
| 203 |
Â
return data;
|
| 204 |
Â
}
|
| 205 |
+
} );
|
| 206 |
Â
|
| 207 |
Â
// Custom selectors
|
| 208 |
Â
$.extend( $.expr[ ":" ], {
|
| 209 |
+
|
| 210 |
Â
// http://jqueryvalidation.org/blank-selector/
|
| 211 |
Â
blank: function( a ) {
|
| 212 |
Â
return !$.trim( "" + $( a ).val() );
|
| 213 |
Â
},
|
| 214 |
+
|
| 215 |
Â
// http://jqueryvalidation.org/filled-selector/
|
| 216 |
Â
filled: function( a ) {
|
| 217 |
+
var val = $( a ).val();
|
| 218 |
+
return val !== null && !!$.trim( "" + val );
|
| 219 |
Â
},
|
| 220 |
+
|
| 221 |
Â
// http://jqueryvalidation.org/unchecked-selector/
|
| 222 |
Â
unchecked: function( a ) {
|
| 223 |
Â
return !$( a ).prop( "checked" );
|
| 224 |
Â
}
|
| 225 |
+
} );
|
| 226 |
Â
|
| 227 |
+
// Constructor for validator
|
| 228 |
Â
$.validator = function( options, form ) {
|
| 229 |
Â
this.settings = $.extend( true, {}, $.validator.defaults, options );
|
| 230 |
Â
this.currentForm = form;
|
| 240 |
Â
return $.validator.format.apply( this, args );
|
| 241 |
Â
};
|
| 242 |
Â
}
|
| 243 |
+
if ( params === undefined ) {
|
| 244 |
+
return source;
|
| 245 |
+
}
|
| 246 |
Â
if ( arguments.length > 2 && params.constructor !== Array ) {
|
| 247 |
Â
params = $.makeArray( arguments ).slice( 1 );
|
| 248 |
Â
}
|
| 252 |
Â
$.each( params, function( i, n ) {
|
| 253 |
Â
source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() {
|
| 254 |
Â
return n;
|
| 255 |
+
} );
|
| 256 |
+
} );
|
| 257 |
Â
return source;
|
| 258 |
Â
};
|
| 259 |
Â
|
| 264 |
Â
groups: {},
|
| 265 |
Â
rules: {},
|
| 266 |
Â
errorClass: "error",
|
| 267 |
+
pendingClass: "pending",
|
| 268 |
Â
validClass: "valid",
|
| 269 |
Â
errorElement: "label",
|
| 270 |
+
focusCleanup: false,
|
| 271 |
Â
focusInvalid: true,
|
| 272 |
Â
errorContainer: $( [] ),
|
| 273 |
Â
errorLabelContainer: $( [] ),
|
| 277 |
Â
onfocusin: function( element ) {
|
| 278 |
Â
this.lastActive = element;
|
| 279 |
Â
|
| 280 |
+
// Hide error label and remove error class on focus if enabled
|
| 281 |
+
if ( this.settings.focusCleanup ) {
|
| 282 |
Â
if ( this.settings.unhighlight ) {
|
| 283 |
Â
this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
|
| 284 |
Â
}
|
| 291 |
Â
}
|
| 292 |
Â
},
|
| 293 |
Â
onkeyup: function( element, event ) {
|
| 294 |
+
|
| 295 |
+
// Avoid revalidate the field when pressing one of the following keys
|
| 296 |
+
// Shift => 16
|
| 297 |
+
// Ctrl => 17
|
| 298 |
+
// Alt => 18
|
| 299 |
+
// Caps lock => 20
|
| 300 |
+
// End => 35
|
| 301 |
+
// Home => 36
|
| 302 |
+
// Left arrow => 37
|
| 303 |
+
// Up arrow => 38
|
| 304 |
+
// Right arrow => 39
|
| 305 |
+
// Down arrow => 40
|
| 306 |
+
// Insert => 45
|
| 307 |
+
// Num lock => 144
|
| 308 |
+
// AltGr key => 225
|
| 309 |
+
var excludedKeys = [
|
| 310 |
+
16, 17, 18, 20, 35, 36, 37,
|
| 311 |
+
38, 39, 40, 45, 144, 225
|
| 312 |
+
];
|
| 313 |
+
|
| 314 |
+
if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) {
|
| 315 |
Â
return;
|
| 316 |
+
} else if ( element.name in this.submitted || element.name in this.invalid ) {
|
| 317 |
Â
this.element( element );
|
| 318 |
Â
}
|
| 319 |
Â
},
|
| 320 |
Â
onclick: function( element ) {
|
| 321 |
+
|
| 322 |
+
// Click on selects, radiobuttons and checkboxes
|
| 323 |
Â
if ( element.name in this.submitted ) {
|
| 324 |
Â
this.element( element );
|
| 325 |
Â
|
| 326 |
+
// Or option elements, check parent select in that case
|
| 327 |
Â
} else if ( element.parentNode.name in this.submitted ) {
|
| 328 |
Â
this.element( element.parentNode );
|
| 329 |
Â
}
|
| 358 |
Â
dateISO: "Please enter a valid date ( ISO ).",
|
| 359 |
Â
number: "Please enter a valid number.",
|
| 360 |
Â
digits: "Please enter only digits.",
|
|
Â
|
|
| 361 |
Â
equalTo: "Please enter the same value again.",
|
| 362 |
Â
maxlength: $.validator.format( "Please enter no more than {0} characters." ),
|
| 363 |
Â
minlength: $.validator.format( "Please enter at least {0} characters." ),
|
| 364 |
Â
rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ),
|
| 365 |
Â
range: $.validator.format( "Please enter a value between {0} and {1}." ),
|
| 366 |
Â
max: $.validator.format( "Please enter a value less than or equal to {0}." ),
|
| 367 |
+
min: $.validator.format( "Please enter a value greater than or equal to {0}." ),
|
| 368 |
+
step: $.validator.format( "Please enter a multiple of {0}." )
|
| 369 |
Â
},
|
| 370 |
Â
|
| 371 |
Â
autoCreateRanges: false,
|
| 391 |
Â
}
|
| 392 |
Â
$.each( value, function( index, name ) {
|
| 393 |
Â
groups[ name ] = key;
|
| 394 |
+
} );
|
| 395 |
+
} );
|
| 396 |
Â
rules = this.settings.rules;
|
| 397 |
Â
$.each( rules, function( key, value ) {
|
| 398 |
Â
rules[ key ] = $.validator.normalizeRule( value );
|
| 399 |
+
} );
|
| 400 |
Â
|
| 401 |
Â
function delegate( event ) {
|
| 402 |
+
var validator = $.data( this.form, "validator" ),
|
| 403 |
Â
eventType = "on" + event.type.replace( /^validate/, "" ),
|
| 404 |
Â
settings = validator.settings;
|
| 405 |
+
if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) {
|
| 406 |
+
settings[ eventType ].call( validator, this, event );
|
| 407 |
Â
}
|
| 408 |
Â
}
|
| 409 |
+
|
| 410 |
Â
$( this.currentForm )
|
| 411 |
+
.on( "focusin.validate focusout.validate keyup.validate",
|
| 412 |
+
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
|
| 413 |
+
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
|
| 414 |
+
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
|
| 415 |
+
"[type='radio'], [type='checkbox'], [contenteditable]", delegate )
|
| 416 |
+
|
| 417 |
Â
// Support: Chrome, oldIE
|
| 418 |
Â
// "select" is provided as event.target when clicking a option
|
| 419 |
+
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );
|
| 420 |
Â
|
| 421 |
Â
if ( this.settings.invalidHandler ) {
|
| 422 |
+
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
|
| 423 |
Â
}
|
| 424 |
Â
|
| 425 |
Â
// Add aria-required to any Static/Data/Class required fields before first validation
|
| 431 |
Â
form: function() {
|
| 432 |
Â
this.checkForm();
|
| 433 |
Â
$.extend( this.submitted, this.errorMap );
|
| 434 |
+
this.invalid = $.extend( {}, this.errorMap );
|
| 435 |
Â
if ( !this.valid() ) {
|
| 436 |
+
$( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
|
| 437 |
Â
}
|
| 438 |
Â
this.showErrors();
|
| 439 |
Â
return this.valid();
|
| 451 |
Â
element: function( element ) {
|
| 452 |
Â
var cleanElement = this.clean( element ),
|
| 453 |
Â
checkElement = this.validationTargetFor( cleanElement ),
|
| 454 |
+
v = this,
|
| 455 |
+
result = true,
|
| 456 |
+
rs, group;
|
| 457 |
Â
|
| 458 |
Â
if ( checkElement === undefined ) {
|
| 459 |
Â
delete this.invalid[ cleanElement.name ];
|
| 461 |
Â
this.prepareElement( checkElement );
|
| 462 |
Â
this.currentElements = $( checkElement );
|
| 463 |
Â
|
| 464 |
+
// If this element is grouped, then validate all group elements already
|
| 465 |
+
// containing a value
|
| 466 |
+
group = this.groups[ checkElement.name ];
|
| 467 |
+
if ( group ) {
|
| 468 |
+
$.each( this.groups, function( name, testgroup ) {
|
| 469 |
+
if ( testgroup === group && name !== checkElement.name ) {
|
| 470 |
+
cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) );
|
| 471 |
+
if ( cleanElement && cleanElement.name in v.invalid ) {
|
| 472 |
+
v.currentElements.push( cleanElement );
|
| 473 |
+
result = result && v.check( cleanElement );
|
| 474 |
+
}
|
| 475 |
+
}
|
| 476 |
+
} );
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
rs = this.check( checkElement ) !== false;
|
| 480 |
+
result = result && rs;
|
| 481 |
+
if ( rs ) {
|
| 482 |
+
this.invalid[ checkElement.name ] = false;
|
| 483 |
Â
} else {
|
| 484 |
Â
this.invalid[ checkElement.name ] = true;
|
| 485 |
Â
}
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 486 |
Â
|
| 487 |
+
if ( !this.numberOfInvalids() ) {
|
| 488 |
+
|
| 489 |
+
// Hide error containers on last error
|
| 490 |
+
this.toHide = this.toHide.add( this.containers );
|
| 491 |
+
}
|
| 492 |
+
this.showErrors();
|
| 493 |
+
|
| 494 |
+
// Add aria-invalid status for screen readers
|
| 495 |
+
$( element ).attr( "aria-invalid", !rs );
|
| 496 |
Â
}
|
| 497 |
+
|
| 498 |
Â
return result;
|
| 499 |
Â
},
|
| 500 |
Â
|
| 501 |
Â
// http://jqueryvalidation.org/Validator.showErrors/
|
| 502 |
Â
showErrors: function( errors ) {
|
| 503 |
Â
if ( errors ) {
|
| 504 |
+
var validator = this;
|
| 505 |
+
|
| 506 |
+
// Add items to error list and map
|
| 507 |
Â
$.extend( this.errorMap, errors );
|
| 508 |
+
this.errorList = $.map( this.errorMap, function( message, name ) {
|
| 509 |
+
return {
|
| 510 |
+
message: message,
|
| 511 |
+
element: validator.findByName( name )[ 0 ]
|
| 512 |
+
};
|
| 513 |
+
} );
|
| 514 |
+
|
| 515 |
+
// Remove items from success list
|
| 516 |
Â
this.successList = $.grep( this.successList, function( element ) {
|
| 517 |
Â
return !( element.name in errors );
|
| 518 |
+
} );
|
| 519 |
Â
}
|
| 520 |
Â
if ( this.settings.showErrors ) {
|
| 521 |
Â
this.settings.showErrors.call( this, this.errorMap, this.errorList );
|
| 529 |
Â
if ( $.fn.resetForm ) {
|
| 530 |
Â
$( this.currentForm ).resetForm();
|
| 531 |
Â
}
|
| 532 |
+
this.invalid = {};
|
| 533 |
Â
this.submitted = {};
|
|
Â
|
|
| 534 |
Â
this.prepareForm();
|
| 535 |
Â
this.hideErrors();
|
| 536 |
+
var elements = this.elements()
|
| 537 |
+
.removeData( "previousValue" )
|
| 538 |
+
.removeAttr( "aria-invalid" );
|
| 539 |
+
|
| 540 |
+
this.resetElements( elements );
|
| 541 |
+
},
|
| 542 |
+
|
| 543 |
+
resetElements: function( elements ) {
|
| 544 |
+
var i;
|
| 545 |
+
|
| 546 |
+
if ( this.settings.unhighlight ) {
|
| 547 |
+
for ( i = 0; elements[ i ]; i++ ) {
|
| 548 |
+
this.settings.unhighlight.call( this, elements[ i ],
|
| 549 |
+
this.settings.errorClass, "" );
|
| 550 |
+
this.findByName( elements[ i ].name ).removeClass( this.settings.validClass );
|
| 551 |
+
}
|
| 552 |
+
} else {
|
| 553 |
+
elements
|
| 554 |
Â
.removeClass( this.settings.errorClass )
|
| 555 |
+
.removeClass( this.settings.validClass );
|
| 556 |
+
}
|
| 557 |
Â
},
|
| 558 |
Â
|
| 559 |
Â
numberOfInvalids: function() {
|
| 565 |
Â
var count = 0,
|
| 566 |
Â
i;
|
| 567 |
Â
for ( i in obj ) {
|
| 568 |
+
if ( obj[ i ] ) {
|
| 569 |
+
count++;
|
| 570 |
+
}
|
| 571 |
Â
}
|
| 572 |
Â
return count;
|
| 573 |
Â
},
|
| 592 |
Â
focusInvalid: function() {
|
| 593 |
Â
if ( this.settings.focusInvalid ) {
|
| 594 |
Â
try {
|
| 595 |
+
$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )
|
| 596 |
Â
.filter( ":visible" )
|
| 597 |
Â
.focus()
|
| 598 |
+
|
| 599 |
+
// Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
|
| 600 |
Â
.trigger( "focusin" );
|
| 601 |
Â
} catch ( e ) {
|
| 602 |
+
|
| 603 |
+
// Ignore IE throwing errors when focusing hidden elements
|
| 604 |
Â
}
|
| 605 |
Â
}
|
| 606 |
Â
},
|
| 609 |
Â
var lastActive = this.lastActive;
|
| 610 |
Â
return lastActive && $.grep( this.errorList, function( n ) {
|
| 611 |
Â
return n.element.name === lastActive.name;
|
| 612 |
+
} ).length === 1 && lastActive;
|
| 613 |
Â
},
|
| 614 |
Â
|
| 615 |
Â
elements: function() {
|
| 616 |
Â
var validator = this,
|
| 617 |
Â
rulesCache = {};
|
| 618 |
Â
|
| 619 |
+
// Select all valid inputs inside the form (no submit or reset buttons)
|
| 620 |
Â
return $( this.currentForm )
|
| 621 |
+
.find( "input, select, textarea, [contenteditable]" )
|
| 622 |
+
.not( ":submit, :reset, :image, :disabled" )
|
| 623 |
Â
.not( this.settings.ignore )
|
| 624 |
Â
.filter( function() {
|
| 625 |
+
var name = this.name || $( this ).attr( "name" ); // For contenteditable
|
| 626 |
+
if ( !name && validator.settings.debug && window.console ) {
|
| 627 |
Â
console.error( "%o has no name assigned", this );
|
| 628 |
Â
}
|
| 629 |
Â
|
| 630 |
+
// Set form expando on contenteditable
|
| 631 |
+
if ( this.hasAttribute( "contenteditable" ) ) {
|
| 632 |
+
this.form = $( this ).closest( "form" )[ 0 ];
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
// Select only the first element for each name, and only those with rules specified
|
| 636 |
+
if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
|
| 637 |
Â
return false;
|
| 638 |
Â
}
|
| 639 |
Â
|
| 640 |
+
rulesCache[ name ] = true;
|
| 641 |
Â
return true;
|
| 642 |
+
} );
|
| 643 |
Â
},
|
| 644 |
Â
|
| 645 |
Â
clean: function( selector ) {
|
| 651 |
Â
return $( this.settings.errorElement + "." + errorClass, this.errorContext );
|
| 652 |
Â
},
|
| 653 |
Â
|
| 654 |
+
resetInternals: function() {
|
| 655 |
Â
this.successList = [];
|
| 656 |
Â
this.errorList = [];
|
| 657 |
Â
this.errorMap = {};
|
| 658 |
Â
this.toShow = $( [] );
|
| 659 |
Â
this.toHide = $( [] );
|
| 660 |
+
},
|
| 661 |
+
|
| 662 |
+
reset: function() {
|
| 663 |
+
this.resetInternals();
|
| 664 |
Â
this.currentElements = $( [] );
|
| 665 |
Â
},
|
| 666 |
Â
|
| 675 |
Â
},
|
| 676 |
Â
|
| 677 |
Â
elementValue: function( element ) {
|
| 678 |
+
var $element = $( element ),
|
| 679 |
+
type = element.type,
|
| 680 |
+
val, idx;
|
| 681 |
Â
|
| 682 |
Â
if ( type === "radio" || type === "checkbox" ) {
|
| 683 |
+
return this.findByName( element.name ).filter( ":checked" ).val();
|
| 684 |
Â
} else if ( type === "number" && typeof element.validity !== "undefined" ) {
|
| 685 |
+
return element.validity.badInput ? "NaN" : $element.val();
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
if ( element.hasAttribute( "contenteditable" ) ) {
|
| 689 |
+
val = $element.text();
|
| 690 |
+
} else {
|
| 691 |
+
val = $element.val();
|
| 692 |
+
}
|
| 693 |
+
|
| 694 |
+
if ( type === "file" ) {
|
| 695 |
+
|
| 696 |
+
// Modern browser (chrome & safari)
|
| 697 |
+
if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) {
|
| 698 |
+
return val.substr( 12 );
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
// Legacy browsers
|
| 702 |
+
// Unix-based path
|
| 703 |
+
idx = val.lastIndexOf( "/" );
|
| 704 |
+
if ( idx >= 0 ) {
|
| 705 |
+
return val.substr( idx + 1 );
|
| 706 |
+
}
|
| 707 |
+
|
| 708 |
+
// Windows-based path
|
| 709 |
+
idx = val.lastIndexOf( "\\" );
|
| 710 |
+
if ( idx >= 0 ) {
|
| 711 |
+
return val.substr( idx + 1 );
|
| 712 |
+
}
|
| 713 |
+
|
| 714 |
+
// Just the file name
|
| 715 |
+
return val;
|
| 716 |
Â
}
|
| 717 |
Â
|
|
Â
|
|
| 718 |
Â
if ( typeof val === "string" ) {
|
| 719 |
+
return val.replace( /\r/g, "" );
|
| 720 |
Â
}
|
| 721 |
Â
return val;
|
| 722 |
Â
},
|
| 727 |
Â
var rules = $( element ).rules(),
|
| 728 |
Â
rulesCount = $.map( rules, function( n, i ) {
|
| 729 |
Â
return i;
|
| 730 |
+
} ).length,
|
| 731 |
Â
dependencyMismatch = false,
|
| 732 |
Â
val = this.elementValue( element ),
|
| 733 |
Â
result, method, rule;
|
| 734 |
Â
|
| 735 |
+
// If a normalizer is defined for this element, then
|
| 736 |
+
// call it to retreive the changed value instead
|
| 737 |
+
// of using the real one.
|
| 738 |
+
// Note that `this` in the normalizer is `element`.
|
| 739 |
+
if ( typeof rules.normalizer === "function" ) {
|
| 740 |
+
val = rules.normalizer.call( element, val );
|
| 741 |
+
|
| 742 |
+
if ( typeof val !== "string" ) {
|
| 743 |
+
throw new TypeError( "The normalizer should return a string value." );
|
| 744 |
+
}
|
| 745 |
+
|
| 746 |
+
// Delete the normalizer from rules to avoid treating
|
| 747 |
+
// it as a pre-defined method.
|
| 748 |
+
delete rules.normalizer;
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
Â
for ( method in rules ) {
|
| 752 |
Â
rule = { method: method, parameters: rules[ method ] };
|
| 753 |
Â
try {
|
|
Â
|
|
| 754 |
Â
result = $.validator.methods[ method ].call( this, val, element, rule.parameters );
|
| 755 |
Â
|
| 756 |
+
// If a method indicates that the field is optional and therefore valid,
|
| 757 |
Â
// don't mark it as valid when there are no other rules
|
| 758 |
Â
if ( result === "dependency-mismatch" && rulesCount === 1 ) {
|
| 759 |
Â
dependencyMismatch = true;
|
| 774 |
Â
if ( this.settings.debug && window.console ) {
|
| 775 |
Â
console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
|
| 776 |
Â
}
|
| 777 |
+
if ( e instanceof TypeError ) {
|
| 778 |
+
e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
|
| 779 |
+
}
|
| 780 |
+
|
| 781 |
Â
throw e;
|
| 782 |
Â
}
|
| 783 |
Â
}
|
| 790 |
Â
return true;
|
| 791 |
Â
},
|
| 792 |
Â
|
| 793 |
+
// Return the custom message for the given element and validation method
|
| 794 |
Â
// specified in the element's HTML5 data attribute
|
| 795 |
Â
// return the generic message if present and no method specific message is present
|
| 796 |
Â
customDataMessage: function( element, method ) {
|
| 798 |
Â
method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" );
|
| 799 |
Â
},
|
| 800 |
Â
|
| 801 |
+
// Return the custom message for the given element name and validation method
|
| 802 |
Â
customMessage: function( name, method ) {
|
| 803 |
Â
var m = this.settings.messages[ name ];
|
| 804 |
+
return m && ( m.constructor === String ? m : m[ method ] );
|
| 805 |
Â
},
|
| 806 |
Â
|
| 807 |
+
// Return the first defined argument, allowing empty strings
|
| 808 |
Â
findDefined: function() {
|
| 809 |
+
for ( var i = 0; i < arguments.length; i++ ) {
|
| 810 |
Â
if ( arguments[ i ] !== undefined ) {
|
| 811 |
Â
return arguments[ i ];
|
| 812 |
Â
}
|
| 814 |
Â
return undefined;
|
| 815 |
Â
},
|
| 816 |
Â
|
| 817 |
+
defaultMessage: function( element, rule ) {
|
| 818 |
+
var message = this.findDefined(
|
| 819 |
+
this.customMessage( element.name, rule.method ),
|
| 820 |
+
this.customDataMessage( element, rule.method ),
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 821 |
Â
|
| 822 |
+
// 'title' is never undefined, so handle empty string as undefined
|
| 823 |
+
!this.settings.ignoreTitle && element.title || undefined,
|
| 824 |
+
$.validator.messages[ rule.method ],
|
| 825 |
+
"<strong>Warning: No message defined for " + element.name + "</strong>"
|
| 826 |
+
),
|
| 827 |
Â
theregex = /\$?\{(\d+)\}/g;
|
| 828 |
Â
if ( typeof message === "function" ) {
|
| 829 |
Â
message = message.call( this, rule.parameters, element );
|
| 830 |
Â
} else if ( theregex.test( message ) ) {
|
| 831 |
Â
message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters );
|
| 832 |
Â
}
|
| 833 |
+
|
| 834 |
+
return message;
|
| 835 |
+
},
|
| 836 |
+
|
| 837 |
+
formatAndAdd: function( element, rule ) {
|
| 838 |
+
var message = this.defaultMessage( element, rule );
|
| 839 |
+
|
| 840 |
+
this.errorList.push( {
|
| 841 |
Â
message: message,
|
| 842 |
Â
element: element,
|
| 843 |
Â
method: rule.method
|
| 844 |
+
} );
|
| 845 |
Â
|
| 846 |
Â
this.errorMap[ element.name ] = message;
|
| 847 |
Â
this.submitted[ element.name ] = message;
|
| 886 |
Â
},
|
| 887 |
Â
|
| 888 |
Â
invalidElements: function() {
|
| 889 |
+
return $( this.errorList ).map( function() {
|
| 890 |
Â
return this.element;
|
| 891 |
+
} );
|
| 892 |
Â
},
|
| 893 |
Â
|
| 894 |
Â
showLabel: function( element, message ) {
|
| 895 |
+
var place, group, errorID, v,
|
| 896 |
Â
error = this.errorsFor( element ),
|
| 897 |
Â
elementID = this.idOrName( element ),
|
| 898 |
Â
describedBy = $( element ).attr( "aria-describedby" );
|
| 899 |
+
|
| 900 |
Â
if ( error.length ) {
|
| 901 |
+
|
| 902 |
+
// Refresh error/success class
|
| 903 |
Â
error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
|
| 904 |
+
|
| 905 |
+
// Replace message on existing label
|
| 906 |
Â
error.html( message );
|
| 907 |
Â
} else {
|
| 908 |
+
|
| 909 |
+
// Create error element
|
| 910 |
Â
error = $( "<" + this.settings.errorElement + ">" )
|
| 911 |
Â
.attr( "id", elementID + "-error" )
|
| 912 |
Â
.addClass( this.settings.errorClass )
|
| 915 |
Â
// Maintain reference to the element to be placed into the DOM
|
| 916 |
Â
place = error;
|
| 917 |
Â
if ( this.settings.wrapper ) {
|
| 918 |
+
|
| 919 |
+
// Make sure the element is visible, even in IE
|
| 920 |
Â
// actually showing the wrapped element is handled elsewhere
|
| 921 |
Â
place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent();
|
| 922 |
Â
}
|
| 930 |
Â
|
| 931 |
Â
// Link error back to the element
|
| 932 |
Â
if ( error.is( "label" ) ) {
|
| 933 |
+
|
| 934 |
Â
// If the error is a label, then associate using 'for'
|
| 935 |
Â
error.attr( "for", elementID );
|
| 936 |
+
|
| 937 |
Â
// If the element is not a child of an associated label, then it's necessary
|
| 938 |
Â
// to explicitly apply aria-describedby
|
| 939 |
+
} else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) {
|
| 940 |
Â
errorID = error.attr( "id" );
|
| 941 |
+
|
| 942 |
Â
// Respect existing non-error aria-describedby
|
| 943 |
Â
if ( !describedBy ) {
|
| 944 |
Â
describedBy = errorID;
|
| 945 |
+
} else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) {
|
| 946 |
+
|
| 947 |
Â
// Add to end of list if not already present
|
| 948 |
Â
describedBy += " " + errorID;
|
| 949 |
Â
}
|
| 952 |
Â
// If this element is grouped, then assign to all elements in the same group
|
| 953 |
Â
group = this.groups[ element.name ];
|
| 954 |
Â
if ( group ) {
|
| 955 |
+
v = this;
|
| 956 |
+
$.each( v.groups, function( name, testgroup ) {
|
| 957 |
Â
if ( testgroup === group ) {
|
| 958 |
+
$( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm )
|
| 959 |
Â
.attr( "aria-describedby", error.attr( "id" ) );
|
| 960 |
Â
}
|
| 961 |
+
} );
|
| 962 |
Â
}
|
| 963 |
Â
}
|
| 964 |
Â
}
|
| 974 |
Â
},
|
| 975 |
Â
|
| 976 |
Â
errorsFor: function( element ) {
|
| 977 |
+
var name = this.escapeCssMeta( this.idOrName( element ) ),
|
| 978 |
Â
describer = $( element ).attr( "aria-describedby" ),
|
| 979 |
Â
selector = "label[for='" + name + "'], label[for='" + name + "'] *";
|
| 980 |
+
|
| 981 |
+
// 'aria-describedby' should directly reference the error element
|
| 982 |
Â
if ( describer ) {
|
| 983 |
+
selector = selector + ", #" + this.escapeCssMeta( describer )
|
| 984 |
+
.replace( /\s+/g, ", #" );
|
| 985 |
Â
}
|
| 986 |
+
|
| 987 |
Â
return this
|
| 988 |
Â
.errors()
|
| 989 |
Â
.filter( selector );
|
| 990 |
Â
},
|
| 991 |
Â
|
| 992 |
+
// See https://api.jquery.com/category/selectors/, for CSS
|
| 993 |
+
// meta-characters that should be escaped in order to be used with JQuery
|
| 994 |
+
// as a literal part of a name/id or any selector.
|
| 995 |
+
escapeCssMeta: function( string ) {
|
| 996 |
+
return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" );
|
| 997 |
+
},
|
| 998 |
+
|
| 999 |
Â
idOrName: function( element ) {
|
| 1000 |
Â
return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );
|
| 1001 |
Â
},
|
| 1002 |
Â
|
| 1003 |
Â
validationTargetFor: function( element ) {
|
| 1004 |
+
|
| 1005 |
+
// If radio/checkbox, validate first element in group instead
|
| 1006 |
Â
if ( this.checkable( element ) ) {
|
| 1007 |
+
element = this.findByName( element.name );
|
| 1008 |
Â
}
|
| 1009 |
+
|
| 1010 |
+
// Always apply ignore filter
|
| 1011 |
+
return $( element ).not( this.settings.ignore )[ 0 ];
|
| 1012 |
Â
},
|
| 1013 |
Â
|
| 1014 |
Â
checkable: function( element ) {
|
| 1016 |
Â
},
|
| 1017 |
Â
|
| 1018 |
Â
findByName: function( name ) {
|
| 1019 |
+
return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" );
|
| 1020 |
Â
},
|
| 1021 |
Â
|
| 1022 |
Â
getLength: function( value, element ) {
|
| 1032 |
Â
},
|
| 1033 |
Â
|
| 1034 |
Â
depend: function( param, element ) {
|
| 1035 |
+
return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true;
|
| 1036 |
Â
},
|
| 1037 |
Â
|
| 1038 |
Â
dependTypes: {
|
| 1055 |
Â
startRequest: function( element ) {
|
| 1056 |
Â
if ( !this.pending[ element.name ] ) {
|
| 1057 |
Â
this.pendingRequest++;
|
| 1058 |
+
$( element ).addClass( this.settings.pendingClass );
|
| 1059 |
Â
this.pending[ element.name ] = true;
|
| 1060 |
Â
}
|
| 1061 |
Â
},
|
| 1062 |
Â
|
| 1063 |
Â
stopRequest: function( element, valid ) {
|
| 1064 |
Â
this.pendingRequest--;
|
| 1065 |
+
|
| 1066 |
+
// Sometimes synchronization fails, make sure pendingRequest is never < 0
|
| 1067 |
Â
if ( this.pendingRequest < 0 ) {
|
| 1068 |
Â
this.pendingRequest = 0;
|
| 1069 |
Â
}
|
| 1070 |
Â
delete this.pending[ element.name ];
|
| 1071 |
+
$( element ).removeClass( this.settings.pendingClass );
|
| 1072 |
Â
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
|
| 1073 |
Â
$( this.currentForm ).submit();
|
| 1074 |
Â
this.formSubmitted = false;
|
| 1075 |
+
} else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {
|
| 1076 |
+
$( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
|
| 1077 |
Â
this.formSubmitted = false;
|
| 1078 |
Â
}
|
| 1079 |
Â
},
|
| 1080 |
Â
|
| 1081 |
+
previousValue: function( element, method ) {
|
| 1082 |
Â
return $.data( element, "previousValue" ) || $.data( element, "previousValue", {
|
| 1083 |
Â
old: null,
|
| 1084 |
Â
valid: true,
|
| 1085 |
+
message: this.defaultMessage( element, { method: method } )
|
| 1086 |
+
} );
|
| 1087 |
+
},
|
| 1088 |
+
|
| 1089 |
+
// Cleans up all forms and elements, removes validator-specific events
|
| 1090 |
+
destroy: function() {
|
| 1091 |
+
this.resetForm();
|
| 1092 |
+
|
| 1093 |
+
$( this.currentForm )
|
| 1094 |
+
.off( ".validate" )
|
| 1095 |
+
.removeData( "validator" )
|
| 1096 |
+
.find( ".validate-equalTo-blur" )
|
| 1097 |
+
.off( ".validate-equalTo" )
|
| 1098 |
+
.removeClass( "validate-equalTo-blur" );
|
| 1099 |
Â
}
|
| 1100 |
Â
|
| 1101 |
Â
},
|
| 1126 |
Â
if ( classes ) {
|
| 1127 |
Â
$.each( classes.split( " " ), function() {
|
| 1128 |
Â
if ( this in $.validator.classRuleSettings ) {
|
| 1129 |
+
$.extend( rules, $.validator.classRuleSettings[ this ] );
|
| 1130 |
Â
}
|
| 1131 |
+
} );
|
| 1132 |
Â
}
|
| 1133 |
Â
return rules;
|
| 1134 |
Â
},
|
| 1135 |
Â
|
| 1136 |
+
normalizeAttributeRule: function( rules, type, method, value ) {
|
| 1137 |
+
|
| 1138 |
+
// Convert the value to a number for number inputs, and for text for backwards compability
|
| 1139 |
+
// allows type="date" and others to be compared as strings
|
| 1140 |
+
if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
|
| 1141 |
+
value = Number( value );
|
| 1142 |
+
|
| 1143 |
+
// Support Opera Mini, which returns NaN for undefined minlength
|
| 1144 |
+
if ( isNaN( value ) ) {
|
| 1145 |
+
value = undefined;
|
| 1146 |
+
}
|
| 1147 |
+
}
|
| 1148 |
+
|
| 1149 |
+
if ( value || value === 0 ) {
|
| 1150 |
+
rules[ method ] = value;
|
| 1151 |
+
} else if ( type === method && type !== "range" ) {
|
| 1152 |
+
|
| 1153 |
+
// Exception: the jquery validate 'range' method
|
| 1154 |
+
// does not test for the html5 'range' type
|
| 1155 |
+
rules[ method ] = true;
|
| 1156 |
+
}
|
| 1157 |
+
},
|
| 1158 |
+
|
| 1159 |
Â
attributeRules: function( element ) {
|
| 1160 |
Â
var rules = {},
|
| 1161 |
Â
$element = $( element ),
|
| 1164 |
Â
|
| 1165 |
Â
for ( method in $.validator.methods ) {
|
| 1166 |
Â
|
| 1167 |
+
// Support for <input required> in both html5 and older browsers
|
| 1168 |
Â
if ( method === "required" ) {
|
| 1169 |
Â
value = element.getAttribute( method );
|
| 1170 |
+
|
| 1171 |
Â
// Some browsers return an empty string for the required attribute
|
| 1172 |
Â
// and non-HTML5 browsers might have required="" markup
|
| 1173 |
Â
if ( value === "" ) {
|
| 1174 |
Â
value = true;
|
| 1175 |
Â
}
|
| 1176 |
+
|
| 1177 |
+
// Force non-HTML5 browsers to return bool
|
| 1178 |
Â
value = !!value;
|
| 1179 |
Â
} else {
|
| 1180 |
Â
value = $element.attr( method );
|
| 1181 |
Â
}
|
| 1182 |
Â
|
| 1183 |
+
this.normalizeAttributeRule( rules, type, method, value );
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1184 |
Â
}
|
| 1185 |
Â
|
| 1186 |
+
// 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
|
| 1187 |
Â
if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {
|
| 1188 |
Â
delete rules.maxlength;
|
| 1189 |
Â
}
|
| 1192 |
Â
},
|
| 1193 |
Â
|
| 1194 |
Â
dataRules: function( element ) {
|
| 1195 |
+
var rules = {},
|
| 1196 |
+
$element = $( element ),
|
| 1197 |
+
type = element.getAttribute( "type" ),
|
| 1198 |
+
method, value;
|
| 1199 |
+
|
| 1200 |
Â
for ( method in $.validator.methods ) {
|
| 1201 |
Â
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
|
| 1202 |
+
this.normalizeAttributeRule( rules, type, method, value );
|
|
Â
|
|
|
Â
|
|
| 1203 |
Â
}
|
| 1204 |
Â
return rules;
|
| 1205 |
Â
},
|
| 1215 |
Â
},
|
| 1216 |
Â
|
| 1217 |
Â
normalizeRules: function( rules, element ) {
|
| 1218 |
+
|
| 1219 |
+
// Handle dependency check
|
| 1220 |
Â
$.each( rules, function( prop, val ) {
|
| 1221 |
+
|
| 1222 |
+
// Ignore rule when param is explicitly false, eg. required:false
|
| 1223 |
Â
if ( val === false ) {
|
| 1224 |
Â
delete rules[ prop ];
|
| 1225 |
Â
return;
|
| 1237 |
Â
if ( keepRule ) {
|
| 1238 |
Â
rules[ prop ] = val.param !== undefined ? val.param : true;
|
| 1239 |
Â
} else {
|
| 1240 |
+
$.data( element.form, "validator" ).resetElements( $( element ) );
|
| 1241 |
Â
delete rules[ prop ];
|
| 1242 |
Â
}
|
| 1243 |
Â
}
|
| 1244 |
+
} );
|
| 1245 |
Â
|
| 1246 |
+
// Evaluate parameters
|
| 1247 |
Â
$.each( rules, function( rule, parameter ) {
|
| 1248 |
+
rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter;
|
| 1249 |
+
} );
|
| 1250 |
Â
|
| 1251 |
+
// Clean number parameters
|
| 1252 |
+
$.each( [ "minlength", "maxlength" ], function() {
|
| 1253 |
Â
if ( rules[ this ] ) {
|
| 1254 |
Â
rules[ this ] = Number( rules[ this ] );
|
| 1255 |
Â
}
|
| 1256 |
+
} );
|
| 1257 |
+
$.each( [ "rangelength", "range" ], function() {
|
| 1258 |
Â
var parts;
|
| 1259 |
Â
if ( rules[ this ] ) {
|
| 1260 |
Â
if ( $.isArray( rules[ this ] ) ) {
|
| 1261 |
+
rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];
|
| 1262 |
Â
} else if ( typeof rules[ this ] === "string" ) {
|
| 1263 |
+
parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ );
|
| 1264 |
+
rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ];
|
| 1265 |
Â
}
|
| 1266 |
Â
}
|
| 1267 |
+
} );
|
| 1268 |
Â
|
| 1269 |
Â
if ( $.validator.autoCreateRanges ) {
|
| 1270 |
+
|
| 1271 |
+
// Auto-create ranges
|
| 1272 |
+
if ( rules.min != null && rules.max != null ) {
|
| 1273 |
Â
rules.range = [ rules.min, rules.max ];
|
| 1274 |
Â
delete rules.min;
|
| 1275 |
Â
delete rules.max;
|
| 1276 |
Â
}
|
| 1277 |
+
if ( rules.minlength != null && rules.maxlength != null ) {
|
| 1278 |
Â
rules.rangelength = [ rules.minlength, rules.maxlength ];
|
| 1279 |
Â
delete rules.minlength;
|
| 1280 |
Â
delete rules.maxlength;
|
| 1290 |
Â
var transformed = {};
|
| 1291 |
Â
$.each( data.split( /\s/ ), function() {
|
| 1292 |
Â
transformed[ this ] = true;
|
| 1293 |
+
} );
|
| 1294 |
Â
data = transformed;
|
| 1295 |
Â
}
|
| 1296 |
Â
return data;
|
| 1305 |
Â
}
|
| 1306 |
Â
},
|
| 1307 |
Â
|
| 1308 |
+
// http://jqueryvalidation.org/jQuery.validator.methods/
|
| 1309 |
Â
methods: {
|
| 1310 |
Â
|
| 1311 |
Â
// http://jqueryvalidation.org/required-method/
|
| 1312 |
Â
required: function( value, element, param ) {
|
| 1313 |
+
|
| 1314 |
+
// Check if dependency is met
|
| 1315 |
Â
if ( !this.depend( param, element ) ) {
|
| 1316 |
Â
return "dependency-mismatch";
|
| 1317 |
Â
}
|
| 1318 |
Â
if ( element.nodeName.toLowerCase() === "select" ) {
|
| 1319 |
+
|
| 1320 |
+
// Could be an array for select-multiple or a string, both are fine this way
|
| 1321 |
Â
var val = $( element ).val();
|
| 1322 |
Â
return val && val.length > 0;
|
| 1323 |
Â
}
|
| 1324 |
Â
if ( this.checkable( element ) ) {
|
| 1325 |
Â
return this.getLength( value, element ) > 0;
|
| 1326 |
Â
}
|
| 1327 |
+
return value.length > 0;
|
| 1328 |
Â
},
|
| 1329 |
Â
|
| 1330 |
Â
// http://jqueryvalidation.org/email-method/
|
| 1331 |
Â
email: function( value, element ) {
|
| 1332 |
+
|
| 1333 |
+
// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
|
| 1334 |
Â
// Retrieved 2014-01-14
|
| 1335 |
Â
// If you have a problem with this implementation, report a bug against the above spec
|
| 1336 |
Â
// Or use custom methods to implement your own email validation
|
| 1339 |
Â
|
| 1340 |
Â
// http://jqueryvalidation.org/url-method/
|
| 1341 |
Â
url: function( value, element ) {
|
| 1342 |
+
|
| 1343 |
+
// Copyright (c) 2010-2013 Diego Perini, MIT licensed
|
| 1344 |
+
// https://gist.github.com/dperini/729294
|
| 1345 |
+
// see also https://mathiasbynens.be/demo/url-regex
|
| 1346 |
+
// modified to allow protocol-relative URLs
|
| 1347 |
+
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
|
| 1348 |
Â
},
|
| 1349 |
Â
|
| 1350 |
Â
// http://jqueryvalidation.org/date-method/
|
| 1359 |
Â
|
| 1360 |
Â
// http://jqueryvalidation.org/number-method/
|
| 1361 |
Â
number: function( value, element ) {
|
| 1362 |
+
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
|
| 1363 |
Â
},
|
| 1364 |
Â
|
| 1365 |
Â
// http://jqueryvalidation.org/digits-method/
|
| 1367 |
Â
return this.optional( element ) || /^\d+$/.test( value );
|
| 1368 |
Â
},
|
| 1369 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1370 |
Â
// http://jqueryvalidation.org/minlength-method/
|
| 1371 |
Â
minlength: function( value, element, param ) {
|
| 1372 |
+
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
| 1373 |
Â
return this.optional( element ) || length >= param;
|
| 1374 |
Â
},
|
| 1375 |
Â
|
| 1376 |
Â
// http://jqueryvalidation.org/maxlength-method/
|
| 1377 |
Â
maxlength: function( value, element, param ) {
|
| 1378 |
+
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
| 1379 |
Â
return this.optional( element ) || length <= param;
|
| 1380 |
Â
},
|
| 1381 |
Â
|
| 1382 |
Â
// http://jqueryvalidation.org/rangelength-method/
|
| 1383 |
Â
rangelength: function( value, element, param ) {
|
| 1384 |
+
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
|
| 1385 |
Â
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
|
| 1386 |
Â
},
|
| 1387 |
Â
|
| 1400 |
Â
return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
|
| 1401 |
Â
},
|
| 1402 |
Â
|
| 1403 |
+
// http://jqueryvalidation.org/step-method/
|
| 1404 |
+
step: function( value, element, param ) {
|
| 1405 |
+
var type = $( element ).attr( "type" ),
|
| 1406 |
+
errorMessage = "Step attribute on input type " + type + " is not supported.",
|
| 1407 |
+
supportedTypes = [ "text", "number", "range" ],
|
| 1408 |
+
re = new RegExp( "\\b" + type + "\\b" ),
|
| 1409 |
+
notSupported = type && !re.test( supportedTypes.join() );
|
| 1410 |
+
|
| 1411 |
+
// Works only for text, number and range input types
|
| 1412 |
+
// TODO find a way to support input types date, datetime, datetime-local, month, time and week
|
| 1413 |
+
if ( notSupported ) {
|
| 1414 |
+
throw new Error( errorMessage );
|
| 1415 |
+
}
|
| 1416 |
+
return this.optional( element ) || ( value % param === 0 );
|
| 1417 |
+
},
|
| 1418 |
+
|
| 1419 |
Â
// http://jqueryvalidation.org/equalTo-method/
|
| 1420 |
Â
equalTo: function( value, element, param ) {
|
| 1421 |
+
|
| 1422 |
+
// Bind to the blur event of the target in order to revalidate whenever the target field is updated
|
| 1423 |
Â
var target = $( param );
|
| 1424 |
+
if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) {
|
| 1425 |
+
target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() {
|
| 1426 |
Â
$( element ).valid();
|
| 1427 |
+
} );
|
| 1428 |
Â
}
|
| 1429 |
Â
return value === target.val();
|
| 1430 |
Â
},
|
| 1431 |
Â
|
| 1432 |
Â
// http://jqueryvalidation.org/remote-method/
|
| 1433 |
+
remote: function( value, element, param, method ) {
|
| 1434 |
Â
if ( this.optional( element ) ) {
|
| 1435 |
Â
return "dependency-mismatch";
|
| 1436 |
Â
}
|
| 1437 |
Â
|
| 1438 |
+
method = typeof method === "string" && method || "remote";
|
| 1439 |
+
|
| 1440 |
+
var previous = this.previousValue( element, method ),
|
| 1441 |
+
validator, data, optionDataString;
|
| 1442 |
Â
|
| 1443 |
+
if ( !this.settings.messages[ element.name ] ) {
|
| 1444 |
Â
this.settings.messages[ element.name ] = {};
|
| 1445 |
Â
}
|
| 1446 |
+
previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ];
|
| 1447 |
+
this.settings.messages[ element.name ][ method ] = previous.message;
|
| 1448 |
Â
|
| 1449 |
Â
param = typeof param === "string" && { url: param } || param;
|
| 1450 |
+
optionDataString = $.param( $.extend( { data: value }, param.data ) );
|
| 1451 |
+
if ( previous.old === optionDataString ) {
|
| 1452 |
Â
return previous.valid;
|
| 1453 |
Â
}
|
| 1454 |
Â
|
| 1455 |
+
previous.old = optionDataString;
|
| 1456 |
Â
validator = this;
|
| 1457 |
Â
this.startRequest( element );
|
| 1458 |
Â
data = {};
|
| 1459 |
Â
data[ element.name ] = value;
|
| 1460 |
Â
$.ajax( $.extend( true, {
|
|
Â
|
|
| 1461 |
Â
mode: "abort",
|
| 1462 |
Â
port: "validate" + element.name,
|
| 1463 |
Â
dataType: "json",
|
| 1467 |
Â
var valid = response === true || response === "true",
|
| 1468 |
Â
errors, message, submitted;
|
| 1469 |
Â
|
| 1470 |
+
validator.settings.messages[ element.name ][ method ] = previous.originalMessage;
|
| 1471 |
Â
if ( valid ) {
|
| 1472 |
Â
submitted = validator.formSubmitted;
|
| 1473 |
+
validator.resetInternals();
|
| 1474 |
+
validator.toHide = validator.errorsFor( element );
|
| 1475 |
Â
validator.formSubmitted = submitted;
|
| 1476 |
Â
validator.successList.push( element );
|
| 1477 |
+
validator.invalid[ element.name ] = false;
|
| 1478 |
Â
validator.showErrors();
|
| 1479 |
Â
} else {
|
| 1480 |
Â
errors = {};
|
| 1481 |
+
message = response || validator.defaultMessage( element, { method: method, parameters: value } );
|
| 1482 |
+
errors[ element.name ] = previous.message = message;
|
| 1483 |
Â
validator.invalid[ element.name ] = true;
|
| 1484 |
Â
validator.showErrors( errors );
|
| 1485 |
Â
}
|
| 1489 |
Â
}, param ) );
|
| 1490 |
Â
return "pending";
|
| 1491 |
Â
}
|
|
Â
|
|
| 1492 |
Â
}
|
| 1493 |
Â
|
| 1494 |
+
} );
|
| 1495 |
+
|
| 1496 |
+
// Ajax mode: abort
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1497 |
Â
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
|
| 1498 |
Â
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
|
| 1499 |
Â
|
| 1500 |
Â
var pendingRequests = {},
|
| 1501 |
Â
ajax;
|
| 1502 |
+
|
| 1503 |
Â
// Use a prefilter if available (1.5+)
|
| 1504 |
Â
if ( $.ajaxPrefilter ) {
|
| 1505 |
+
$.ajaxPrefilter( function( settings, _, xhr ) {
|
| 1506 |
Â
var port = settings.port;
|
| 1507 |
Â
if ( settings.mode === "abort" ) {
|
| 1508 |
+
if ( pendingRequests[ port ] ) {
|
| 1509 |
+
pendingRequests[ port ].abort();
|
| 1510 |
Â
}
|
| 1511 |
+
pendingRequests[ port ] = xhr;
|
| 1512 |
Â
}
|
| 1513 |
+
} );
|
| 1514 |
Â
} else {
|
| 1515 |
+
|
| 1516 |
Â
// Proxy ajax
|
| 1517 |
Â
ajax = $.ajax;
|
| 1518 |
Â
$.ajax = function( settings ) {
|
| 1519 |
Â
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
|
| 1520 |
Â
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
|
| 1521 |
Â
if ( mode === "abort" ) {
|
| 1522 |
+
if ( pendingRequests[ port ] ) {
|
| 1523 |
+
pendingRequests[ port ].abort();
|
| 1524 |
Â
}
|
| 1525 |
+
pendingRequests[ port ] = ajax.apply( this, arguments );
|
| 1526 |
+
return pendingRequests[ port ];
|
| 1527 |
Â
}
|
| 1528 |
+
return ajax.apply( this, arguments );
|
| 1529 |
Â
};
|
| 1530 |
Â
}
|
| 1531 |
+
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 1532 |
Â
}));
|
|
@@ -1,4 +1 @@
|
|
| 1 |
-
/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
|
| 2 |
-
* http://jqueryvalidation.org/
|
| 3 |
-
* Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
|
| 4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id"),i?i.match(new RegExp("\b"+f+"\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
|
| 1 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){if(this.length){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable]",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=h&&g.check(e)))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)a[b]&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]),d in c||!b.objectLength(a(this).rules())?!1:(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);if("function"==typeof f.normalizer){if(i=f.normalizer.call(b,i),"string"!=typeof i)throw new TypeError("The normalizer should return a string value.");delete f.normalizer}for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e=a(c).attr("type"),f="Step attribute on input type "+e+" is not supported.",g=["text","number","range"],h=new RegExp("\\b"+e+"\\b"),i=e&&!h.test(g.join());if(i)throw new Error(f);return this.optional(c)||b%d===0},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})});
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
@@ -0,0 +1,20 @@
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
jQuery(function($) {
|
| 2 |
+
/**
|
| 3 |
+
* DISMISS NOTICES
|
| 4 |
+
*
|
| 5 |
+
* @since 2.0.4
|
| 6 |
+
*/
|
| 7 |
+
$('.wpmm_notices').on('click', '.notice-dismiss', function() {
|
| 8 |
+
var notice_key = $(this).parent().data('key');
|
| 9 |
+
|
| 10 |
+
$.post(ajaxurl, {
|
| 11 |
+
action: 'wpmm_dismiss_notices',
|
| 12 |
+
notice_key: notice_key
|
| 13 |
+
}, function(response) {
|
| 14 |
+
if (!response.success) {
|
| 15 |
+
// alert(response.data);
|
| 16 |
+
return false;
|
| 17 |
+
}
|
| 18 |
+
}, 'json');
|
| 19 |
+
});
|
| 20 |
+
});
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
jQuery(function(a){a(".wpmm_notices").on("click",".notice-dismiss",function(){var b=a(this).parent().data("key");a.post(ajaxurl,{action:"wpmm_dismiss_notices",notice_key:b},function(a){return a.success?void 0:!1},"json")})});
|
|
@@ -3,7 +3,7 @@ jQuery(function($) {
|
|
| 3 |
Â
* TABS
|
| 4 |
Â
*/
|
| 5 |
Â
var hash = window.location.hash;
|
| 6 |
-
if (hash
|
| 7 |
Â
$('.nav-tab-wrapper').children().removeClass('nav-tab-active');
|
| 8 |
Â
$('.nav-tab-wrapper a[href="' + hash + '"]').addClass('nav-tab-active');
|
| 9 |
Â
|
|
@@ -28,6 +28,12 @@ jQuery(function($) {
|
|
| 28 |
Â
*/
|
| 29 |
Â
$('.color_picker_trigger').wpColorPicker();
|
| 30 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 31 |
Â
/**
|
| 32 |
Â
* BACKGROUND UPLOADER
|
| 33 |
Â
*/
|
|
@@ -54,7 +60,7 @@ jQuery(function($) {
|
|
| 54 |
Â
image_custom_uploader.on('select', function() {
|
| 55 |
Â
attachment = image_custom_uploader.state().get('selection').first().toJSON();
|
| 56 |
Â
var url = '';
|
| 57 |
-
url = attachment
|
| 58 |
Â
$('.upload_image_url').val(url);
|
| 59 |
Â
});
|
| 60 |
Â
|
|
@@ -68,12 +74,13 @@ jQuery(function($) {
|
|
| 68 |
Â
show_bg_type = function(selected_val) {
|
| 69 |
Â
$('.design_bg_types').hide();
|
| 70 |
Â
$('#show_' + selected_val).show();
|
| 71 |
-
}
|
|
Â
|
|
| 72 |
Â
show_bg_type($('#design_bg_type').val());
|
| 73 |
Â
|
| 74 |
Â
$('#design_bg_type').change(function() {
|
| 75 |
Â
var selected_val = $(this).val();
|
| 76 |
-
|
| 77 |
Â
show_bg_type(selected_val);
|
| 78 |
Â
});
|
| 79 |
Â
|
|
@@ -92,19 +99,41 @@ jQuery(function($) {
|
|
| 92 |
Â
$('<iframe />').attr('src', wpmm_vars.ajax_url + '?action=wpmm_subscribers_export').appendTo('body').hide();
|
| 93 |
Â
});
|
| 94 |
Â
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 95 |
Â
/**
|
| 96 |
Â
* RESET SETTINGS
|
| 97 |
Â
*/
|
| 98 |
Â
$('.reset_settings').click(function() {
|
| 99 |
Â
var tab = $(this).data('tab');
|
| 100 |
Â
|
| 101 |
-
$.
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 108 |
Â
});
|
| 109 |
Â
|
| 110 |
Â
/**
|
| 3 |
Â
* TABS
|
| 4 |
Â
*/
|
| 5 |
Â
var hash = window.location.hash;
|
| 6 |
+
if (hash !== '') {
|
| 7 |
Â
$('.nav-tab-wrapper').children().removeClass('nav-tab-active');
|
| 8 |
Â
$('.nav-tab-wrapper a[href="' + hash + '"]').addClass('nav-tab-active');
|
| 9 |
Â
|
| 28 |
Â
*/
|
| 29 |
Â
$('.color_picker_trigger').wpColorPicker();
|
| 30 |
Â
|
| 31 |
+
/**
|
| 32 |
+
* CHOSEN.JS MULTISELECT
|
| 33 |
+
* @used for "Backend role" and "Frontend role" -> General tab
|
| 34 |
+
*/
|
| 35 |
+
$('.chosen-select').chosen({disable_search_threshold: 10});
|
| 36 |
+
|
| 37 |
Â
/**
|
| 38 |
Â
* BACKGROUND UPLOADER
|
| 39 |
Â
*/
|
| 60 |
Â
image_custom_uploader.on('select', function() {
|
| 61 |
Â
attachment = image_custom_uploader.state().get('selection').first().toJSON();
|
| 62 |
Â
var url = '';
|
| 63 |
+
url = attachment.url;
|
| 64 |
Â
$('.upload_image_url').val(url);
|
| 65 |
Â
});
|
| 66 |
Â
|
| 74 |
Â
show_bg_type = function(selected_val) {
|
| 75 |
Â
$('.design_bg_types').hide();
|
| 76 |
Â
$('#show_' + selected_val).show();
|
| 77 |
+
};
|
| 78 |
+
|
| 79 |
Â
show_bg_type($('#design_bg_type').val());
|
| 80 |
Â
|
| 81 |
Â
$('#design_bg_type').change(function() {
|
| 82 |
Â
var selected_val = $(this).val();
|
| 83 |
+
|
| 84 |
Â
show_bg_type(selected_val);
|
| 85 |
Â
});
|
| 86 |
Â
|
| 99 |
Â
$('<iframe />').attr('src', wpmm_vars.ajax_url + '?action=wpmm_subscribers_export').appendTo('body').hide();
|
| 100 |
Â
});
|
| 101 |
Â
|
| 102 |
+
/**
|
| 103 |
+
* SUBSCRIBERS EMPTY LIST
|
| 104 |
+
*
|
| 105 |
+
* @since 2.0.4
|
| 106 |
+
*/
|
| 107 |
+
$('#subscribers-empty-list').click(function() {
|
| 108 |
+
$.post(wpmm_vars.ajax_url, {
|
| 109 |
+
action: 'wpmm_subscribers_empty_list'
|
| 110 |
+
}, function(response) {
|
| 111 |
+
if (!response.success) {
|
| 112 |
+
alert(response.data);
|
| 113 |
+
return false;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
$('#subscribers_wrap').html(response.data);
|
| 117 |
+
}, 'json');
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
Â
/**
|
| 121 |
Â
* RESET SETTINGS
|
| 122 |
Â
*/
|
| 123 |
Â
$('.reset_settings').click(function() {
|
| 124 |
Â
var tab = $(this).data('tab');
|
| 125 |
Â
|
| 126 |
+
$.post(wpmm_vars.ajax_url, {
|
| 127 |
+
action: 'wpmm_reset_settings',
|
| 128 |
+
tab: tab
|
| 129 |
+
}, function(response) {
|
| 130 |
+
if (!response.success) {
|
| 131 |
+
alert(response.data);
|
| 132 |
+
return false;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
window.location.reload(true);
|
| 136 |
+
}, 'json');
|
| 137 |
Â
});
|
| 138 |
Â
|
| 139 |
Â
/**
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
jQuery(function(a){var b=window.location.hash;""!==b&&(a(".nav-tab-wrapper").children().removeClass("nav-tab-active"),a('.nav-tab-wrapper a[href="'+b+'"]').addClass("nav-tab-active"),a(".tabs-content").children().addClass("hidden"),a(".tabs-content div"+b.replace("#","#tab-")).removeClass("hidden")),a(".nav-tab-wrapper a").click(function(){var b=a(this).attr("href").replace("#","#tab-");a(this).parent().children().removeClass("nav-tab-active"),a(this).addClass("nav-tab-active"),a(".tabs-content").children().addClass("hidden"),a(".tabs-content div"+b).removeClass("hidden")}),a(".color_picker_trigger").wpColorPicker(),a(".chosen-select").chosen({disable_search_threshold:10});var c;a("#upload_image_trigger").click(function(b){return b.preventDefault(),c?void c.open():(c=wp.media.frames.file_frame=wp.media({title:"Upload Background",button:{text:"Choose Background"},multiple:!1}),c.on("select",function(){attachment=c.state().get("selection").first().toJSON();var b="";b=attachment.url,a(".upload_image_url").val(b)}),void c.open())}),show_bg_type=function(b){a(".design_bg_types").hide(),a("#show_"+b).show()},show_bg_type(a("#design_bg_type").val()),a("#design_bg_type").change(function(){var b=a(this).val();show_bg_type(b)}),a("ul.bg_list li").click(function(){a(this).parent().children().removeClass("active"),a(this).addClass("active")}),a("#subscribers-export").click(function(){a("<iframe />").attr("src",wpmm_vars.ajax_url+"?action=wpmm_subscribers_export").appendTo("body").hide()}),a("#subscribers-empty-list").click(function(){a.post(wpmm_vars.ajax_url,{action:"wpmm_subscribers_empty_list"},function(b){return b.success?void a("#subscribers_wrap").html(b.data):(alert(b.data),!1)},"json")}),a(".reset_settings").click(function(){var b=a(this).data("tab");a.post(wpmm_vars.ajax_url,{action:"wpmm_reset_settings",tab:b},function(a){return a.success?void window.location.reload(!0):(alert(a.data),!1)},"json")}),a(".countdown_start").datetimepicker({timeFormat:"HH:mm:ss",dateFormat:"dd-mm-yy"})});
|
|
@@ -1,91 +1,102 @@
|
|
| 1 |
-
jQuery(function($) {
|
| 2 |
-
/**
|
| 3 |
-
* COUNTDOWN
|
| 4 |
-
*/
|
| 5 |
-
if ($('.countdown').length > 0) {
|
| 6 |
-
var countDate = new Date($('.countdown').data('start'));
|
| 7 |
-
countDate = new Date($('.countdown').data('end'));
|
| 8 |
-
$('.countdown').countdown({
|
| 9 |
-
until: countDate,
|
| 10 |
-
compact: true,
|
| 11 |
-
layout: '<span class="day">{dn}</span> <span class="separator">:</span> <span class="hour">{hnn}</span> <span class="separator">:</span> <span class="minutes">{mnn}</span> <span class="separator">:</span> <span class="seconds">{snn}</span>'
|
| 12 |
-
});
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* SOCIAL LINKS
|
| 17 |
-
*/
|
| 18 |
-
if ($('.social').length > 0) {
|
| 19 |
-
var link_target = $('.social').data('target');
|
| 20 |
-
|
| 21 |
-
if (link_target == 1) {
|
| 22 |
-
$('.social a').attr('target', '_blank');
|
| 23 |
-
}
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
/**
|
| 27 |
-
* SUBSCRIBE FORM
|
| 28 |
-
*/
|
| 29 |
-
if ($('.subscribe_form').length > 0) {
|
| 30 |
-
// validate form
|
| 31 |
-
$('.subscribe_form').validate({
|
| 32 |
-
submitHandler: function(form) {
|
| 33 |
-
$.post(wpmm_vars.ajax_url, {
|
| 34 |
-
action: 'wpmm_add_subscriber',
|
| 35 |
-
email: $('.email_input', $('.subscribe_form')).val()
|
| 36 |
-
}, function(
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
$('.
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 91 |
Â
});
|
| 1 |
+
jQuery(function($) {
|
| 2 |
+
/**
|
| 3 |
+
* COUNTDOWN
|
| 4 |
+
*/
|
| 5 |
+
if ($('.countdown').length > 0) {
|
| 6 |
+
var countDate = new Date($('.countdown').data('start'));
|
| 7 |
+
countDate = new Date($('.countdown').data('end'));
|
| 8 |
+
$('.countdown').countdown({
|
| 9 |
+
until: countDate,
|
| 10 |
+
compact: true,
|
| 11 |
+
layout: '<span class="day">{dn}</span> <span class="separator">:</span> <span class="hour">{hnn}</span> <span class="separator">:</span> <span class="minutes">{mnn}</span> <span class="separator">:</span> <span class="seconds">{snn}</span>'
|
| 12 |
+
});
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* SOCIAL LINKS
|
| 17 |
+
*/
|
| 18 |
+
if ($('.social').length > 0) {
|
| 19 |
+
var link_target = $('.social').data('target');
|
| 20 |
+
|
| 21 |
+
if (link_target == 1) {
|
| 22 |
+
$('.social a').attr('target', '_blank');
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* SUBSCRIBE FORM
|
| 28 |
+
*/
|
| 29 |
+
if ($('.subscribe_form').length > 0) {
|
| 30 |
+
// validate form
|
| 31 |
+
$('.subscribe_form').validate({
|
| 32 |
+
submitHandler: function(form) {
|
| 33 |
+
$.post(wpmm_vars.ajax_url, {
|
| 34 |
+
action: 'wpmm_add_subscriber',
|
| 35 |
+
email: $('.email_input', $('.subscribe_form')).val()
|
| 36 |
+
}, function(response) {
|
| 37 |
+
if (!response.success) {
|
| 38 |
+
alert(response.data);
|
| 39 |
+
return false;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
$('.subscribe_wrapper').html(response.data);
|
| 43 |
+
}, 'json');
|
| 44 |
+
|
| 45 |
+
return false;
|
| 46 |
+
}
|
| 47 |
+
});
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* CONTACT FORM
|
| 52 |
+
*/
|
| 53 |
+
if ($('.contact').length > 0) {
|
| 54 |
+
// show form
|
| 55 |
+
$('.contact_us').click(function() {
|
| 56 |
+
var open_contact = $(this).data('open'),
|
| 57 |
+
close_contact = $(this).data('close');
|
| 58 |
+
|
| 59 |
+
$('.contact').fadeIn(200);
|
| 60 |
+
$('.' + open_contact).addClass(close_contact);
|
| 61 |
+
});
|
| 62 |
+
|
| 63 |
+
// validate form
|
| 64 |
+
$('.contact_form').validate({
|
| 65 |
+
submitHandler: function(form) {
|
| 66 |
+
$.post(wpmm_vars.ajax_url, {
|
| 67 |
+
action: 'wpmm_send_contact',
|
| 68 |
+
name: $('.name_input', $('.contact_form')).val(),
|
| 69 |
+
email: $('.email_input', $('.contact_form')).val(),
|
| 70 |
+
content: $('.content_textarea', $('.contact_form')).val()
|
| 71 |
+
}, function(response) {
|
| 72 |
+
if (!response.success) {
|
| 73 |
+
alert(response.data);
|
| 74 |
+
return false;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
$('.contact .form').append('<div class="response">' + response.data + '</div>');
|
| 78 |
+
$('.contact .form .contact_form').hide();
|
| 79 |
+
|
| 80 |
+
setTimeout(function() {
|
| 81 |
+
$('.contact').hide();
|
| 82 |
+
$('.contact .form .response').remove();
|
| 83 |
+
$('.contact .form .contact_form').trigger('reset');
|
| 84 |
+
$('.contact .form .contact_form').show();
|
| 85 |
+
}, 2000);
|
| 86 |
+
}, 'json');
|
| 87 |
+
|
| 88 |
+
return false;
|
| 89 |
+
}
|
| 90 |
+
});
|
| 91 |
+
|
| 92 |
+
// hide form
|
| 93 |
+
$('body').on('click', '.contact', function(e) {
|
| 94 |
+
if ($(e.target).hasClass('contact')) {
|
| 95 |
+
var close_contact = $('.contact_us').data('close');
|
| 96 |
+
$('.form', $(this)).removeClass(close_contact);
|
| 97 |
+
|
| 98 |
+
$(this).hide();
|
| 99 |
+
}
|
| 100 |
+
});
|
| 101 |
+
}
|
| 102 |
Â
});
|
|
@@ -0,0 +1 @@
|
|
|
Â
|
| 1 |
+
jQuery(function(a){if(a(".countdown").length>0){var b=new Date(a(".countdown").data("start"));b=new Date(a(".countdown").data("end")),a(".countdown").countdown({until:b,compact:!0,layout:'<span class="day">{dn}</span> <span class="separator">:</span> <span class="hour">{hnn}</span> <span class="separator">:</span> <span class="minutes">{mnn}</span> <span class="separator">:</span> <span class="seconds">{snn}</span>'})}if(a(".social").length>0){var c=a(".social").data("target");1==c&&a(".social a").attr("target","_blank")}a(".subscribe_form").length>0&&a(".subscribe_form").validate({submitHandler:function(b){return a.post(wpmm_vars.ajax_url,{action:"wpmm_add_subscriber",email:a(".email_input",a(".subscribe_form")).val()},function(b){return b.success?void a(".subscribe_wrapper").html(b.data):(alert(b.data),!1)},"json"),!1}}),a(".contact").length>0&&(a(".contact_us").click(function(){var b=a(this).data("open"),c=a(this).data("close");a(".contact").fadeIn(200),a("."+b).addClass(c)}),a(".contact_form").validate({submitHandler:function(b){return a.post(wpmm_vars.ajax_url,{action:"wpmm_send_contact",name:a(".name_input",a(".contact_form")).val(),email:a(".email_input",a(".contact_form")).val(),content:a(".content_textarea",a(".contact_form")).val()},function(b){return b.success?(a(".contact .form").append('<div class="response">'+b.data+"</div>"),a(".contact .form .contact_form").hide(),void setTimeout(function(){a(".contact").hide(),a(".contact .form .response").remove(),a(".contact .form .contact_form").trigger("reset"),a(".contact .form .contact_form").show()},2e3)):(alert(b.data),!1)},"json"),!1}}),a("body").on("click",".contact",function(b){if(a(b.target).hasClass("contact")){var c=a(".contact_us").data("close");a(".form",a(this)).removeClass(c),a(this).hide()}}))});
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -1,406 +1,522 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
if (!class_exists('WP_Maintenance_Mode_Admin')) {
|
| 4 |
-
|
| 5 |
-
class WP_Maintenance_Mode_Admin {
|
| 6 |
-
|
| 7 |
-
protected static $instance = null;
|
| 8 |
-
protected $plugin_slug;
|
| 9 |
-
protected $plugin_settings;
|
| 10 |
-
protected $plugin_default_settings;
|
| 11 |
-
protected $plugin_basename;
|
| 12 |
-
protected $plugin_screen_hook_suffix = null;
|
| 13 |
-
|
| 14 |
-
private
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
$
|
| 18 |
-
$this->
|
| 19 |
-
$this->
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
add_filter('
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
*
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
global
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
*
|
| 149 |
-
*
|
| 150 |
-
* @
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
*
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
//
|
| 280 |
-
$_POST['options']['
|
| 281 |
-
$_POST['options']['
|
| 282 |
-
if (!empty($_POST['options']['
|
| 283 |
-
$_POST['options']['
|
| 284 |
-
$custom_css['
|
| 285 |
-
}
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 406 |
Â
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
if (!class_exists('WP_Maintenance_Mode_Admin')) {
|
| 4 |
+
|
| 5 |
+
class WP_Maintenance_Mode_Admin {
|
| 6 |
+
|
| 7 |
+
protected static $instance = null;
|
| 8 |
+
protected $plugin_slug;
|
| 9 |
+
protected $plugin_settings;
|
| 10 |
+
protected $plugin_default_settings;
|
| 11 |
+
protected $plugin_basename;
|
| 12 |
+
protected $plugin_screen_hook_suffix = null;
|
| 13 |
+
|
| 14 |
+
private $dismissed_notices_key = 'wpmm_dismissed_notices';
|
| 15 |
+
|
| 16 |
+
private function __construct() {
|
| 17 |
+
$plugin = WP_Maintenance_Mode::get_instance();
|
| 18 |
+
$this->plugin_slug = $plugin->get_plugin_slug();
|
| 19 |
+
$this->plugin_settings = $plugin->get_plugin_settings();
|
| 20 |
+
$this->plugin_default_settings = $plugin->default_settings();
|
| 21 |
+
$this->plugin_basename = plugin_basename(WPMM_PATH . $this->plugin_slug . '.php');
|
| 22 |
+
|
| 23 |
+
// Load admin style sheet and JavaScript.
|
| 24 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
|
| 25 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
| 26 |
+
|
| 27 |
+
// Add the options page and menu item.
|
| 28 |
+
add_action('admin_menu', array($this, 'add_plugin_menu'));
|
| 29 |
+
|
| 30 |
+
// Add an action link pointing to the options page
|
| 31 |
+
if (is_multisite() && is_plugin_active_for_network($this->plugin_basename)) {
|
| 32 |
+
// settings link will point to admin_url of the main blog, not to network_admin_url
|
| 33 |
+
add_filter('network_admin_plugin_action_links_' . $this->plugin_basename, array($this, 'add_settings_link'));
|
| 34 |
+
} else {
|
| 35 |
+
add_filter('plugin_action_links_' . $this->plugin_basename, array($this, 'add_settings_link'));
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
// Add admin notices
|
| 39 |
+
add_action('admin_notices', array($this, 'add_notices'));
|
| 40 |
+
|
| 41 |
+
// Add ajax methods
|
| 42 |
+
add_action('wp_ajax_wpmm_subscribers_export', array($this, 'subscribers_export'));
|
| 43 |
+
add_action('wp_ajax_wpmm_subscribers_empty_list', array($this, 'subscribers_empty_list'));
|
| 44 |
+
add_action('wp_ajax_wpmm_dismiss_notices', array($this, 'dismiss_notices'));
|
| 45 |
+
add_action('wp_ajax_wpmm_reset_settings', array($this, 'reset_settings'));
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
public static function get_instance() {
|
| 49 |
+
if (null == self::$instance) {
|
| 50 |
+
self::$instance = new self;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
return self::$instance;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* Load CSS files
|
| 58 |
+
*
|
| 59 |
+
* @since 2.0.0
|
| 60 |
+
* @global object $wp_scripts
|
| 61 |
+
* @return type
|
| 62 |
+
*/
|
| 63 |
+
public function enqueue_admin_styles() {
|
| 64 |
+
global $wp_scripts;
|
| 65 |
+
|
| 66 |
+
if (!isset($this->plugin_screen_hook_suffix)) {
|
| 67 |
+
return;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
$screen = get_current_screen();
|
| 71 |
+
if ($this->plugin_screen_hook_suffix == $screen->id) {
|
| 72 |
+
$ui = $wp_scripts->query('jquery-ui-core');
|
| 73 |
+
|
| 74 |
+
wp_enqueue_style($this->plugin_slug . '-admin-jquery-ui-styles', '//ajax.googleapis.com/ajax/libs/jqueryui/' . (!empty($ui->ver) ? $ui->ver : '1.11.4') . '/themes/smoothness/jquery-ui' . WPMM_ASSETS_SUFFIX . '.css', array(), WP_Maintenance_Mode::VERSION);
|
| 75 |
+
wp_enqueue_style($this->plugin_slug . '-admin-chosen', WPMM_CSS_URL . 'chosen' . WPMM_ASSETS_SUFFIX . '.css', array(), WP_Maintenance_Mode::VERSION);
|
| 76 |
+
wp_enqueue_style($this->plugin_slug . '-admin-timepicker-addon-script', WPMM_CSS_URL . 'jquery-ui-timepicker-addon' . WPMM_ASSETS_SUFFIX . '.css', array(), WP_Maintenance_Mode::VERSION);
|
| 77 |
+
wp_enqueue_style($this->plugin_slug . '-admin-styles', WPMM_CSS_URL . 'style-admin' . WPMM_ASSETS_SUFFIX . '.css', array('wp-color-picker'), WP_Maintenance_Mode::VERSION);
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
/**
|
| 82 |
+
* Load JS files and their dependencies
|
| 83 |
+
*
|
| 84 |
+
* @since 2.0.0
|
| 85 |
+
* @return
|
| 86 |
+
*/
|
| 87 |
+
public function enqueue_admin_scripts() {
|
| 88 |
+
if (!isset($this->plugin_screen_hook_suffix)) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
$screen = get_current_screen();
|
| 93 |
+
if ($this->plugin_screen_hook_suffix == $screen->id) {
|
| 94 |
+
wp_enqueue_media();
|
| 95 |
+
wp_enqueue_script($this->plugin_slug . '-admin-timepicker-addon-script', WPMM_JS_URL . 'jquery-ui-timepicker-addon' . WPMM_ASSETS_SUFFIX . '.js', array('jquery', 'jquery-ui-datepicker'), WP_Maintenance_Mode::VERSION);
|
| 96 |
+
wp_enqueue_script($this->plugin_slug . '-admin-script', WPMM_JS_URL . 'scripts-admin' . WPMM_ASSETS_SUFFIX . '.js', array('jquery', 'wp-color-picker'), WP_Maintenance_Mode::VERSION);
|
| 97 |
+
wp_enqueue_script($this->plugin_slug . '-admin-chosen', WPMM_JS_URL . 'chosen.jquery' . WPMM_ASSETS_SUFFIX . '.js', array(), WP_Maintenance_Mode::VERSION);
|
| 98 |
+
wp_localize_script($this->plugin_slug . '-admin-script', 'wpmm_vars', array(
|
| 99 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
| 100 |
+
'plugin_url' => admin_url('options-general.php?page=' . $this->plugin_slug)
|
| 101 |
+
));
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
// For global actions like dismiss notices
|
| 105 |
+
wp_enqueue_script($this->plugin_slug . '-admin-global', WPMM_JS_URL . 'scripts-admin-global' . WPMM_ASSETS_SUFFIX . '.js', array('jquery'), WP_Maintenance_Mode::VERSION);
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* Export subscribers list in CSV format (refactor @ 2.0.4)
|
| 110 |
+
*
|
| 111 |
+
* @since 2.0.0
|
| 112 |
+
* @global object $wpdb
|
| 113 |
+
* @throws Exception
|
| 114 |
+
*/
|
| 115 |
+
public function subscribers_export() {
|
| 116 |
+
global $wpdb;
|
| 117 |
+
|
| 118 |
+
try {
|
| 119 |
+
// check capabilities
|
| 120 |
+
if (!current_user_can('manage_options')) {
|
| 121 |
+
throw new Exception(__('You do not have access to this resource.', $this->plugin_slug));
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
// get subscribers and export
|
| 125 |
+
$results = $wpdb->get_results("SELECT email, insert_date FROM {$wpdb->prefix}wpmm_subscribers ORDER BY id_subscriber DESC", ARRAY_A);
|
| 126 |
+
if (!empty($results)) {
|
| 127 |
+
$filename = 'subscribers-list-' . date('Y-m-d') . '.csv';
|
| 128 |
+
|
| 129 |
+
header('Content-Type: text/csv');
|
| 130 |
+
header('Content-Disposition: attachment;filename=' . $filename);
|
| 131 |
+
|
| 132 |
+
$fp = fopen('php://output', 'w');
|
| 133 |
+
|
| 134 |
+
fputcsv($fp, array('email', 'insert_date'));
|
| 135 |
+
foreach ($results as $item) {
|
| 136 |
+
fputcsv($fp, $item);
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
fclose($fp);
|
| 140 |
+
}
|
| 141 |
+
} catch (Exception $ex) {
|
| 142 |
+
wp_send_json_error($ex->getMessage());
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* Empty subscribers list
|
| 148 |
+
*
|
| 149 |
+
* @since 2.0.4
|
| 150 |
+
* @global object $wpdb
|
| 151 |
+
* @throws Exception
|
| 152 |
+
*/
|
| 153 |
+
public function subscribers_empty_list() {
|
| 154 |
+
global $wpdb;
|
| 155 |
+
|
| 156 |
+
try {
|
| 157 |
+
// check capabilities
|
| 158 |
+
if (!current_user_can('manage_options')) {
|
| 159 |
+
throw new Exception(__('You do not have access to this resource.', $this->plugin_slug));
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// delete all subscribers
|
| 163 |
+
$wpdb->query("DELETE FROM {$wpdb->prefix}wpmm_subscribers");
|
| 164 |
+
|
| 165 |
+
wp_send_json_success(sprintf(__('You have %d subscriber(s)', $this->plugin_slug), 0));
|
| 166 |
+
} catch (Exception $ex) {
|
| 167 |
+
wp_send_json_error($ex->getMessage());
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* Reset settings (refactor @ 2.0.4)
|
| 173 |
+
*
|
| 174 |
+
* @since 2.0.0
|
| 175 |
+
* @throws Exception
|
| 176 |
+
*/
|
| 177 |
+
public function reset_settings() {
|
| 178 |
+
try {
|
| 179 |
+
// check capabilities
|
| 180 |
+
if (!current_user_can('manage_options')) {
|
| 181 |
+
throw new Exception(__('You do not have access to this resource.', $this->plugin_slug));
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
// check tab existence
|
| 185 |
+
if (empty($_REQUEST['tab'])) {
|
| 186 |
+
throw new Exception(__('The tab slug must not be empty.', $this->plugin_slug));
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
$tab = $_REQUEST['tab'];
|
| 190 |
+
if (empty($this->plugin_default_settings[$tab])) {
|
| 191 |
+
throw new Exception(__('The tab slug must exist.', $this->plugin_slug));
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
// update options using the default values
|
| 195 |
+
$this->plugin_settings[$tab] = $this->plugin_default_settings[$tab];
|
| 196 |
+
update_option('wpmm_settings', $this->plugin_settings);
|
| 197 |
+
|
| 198 |
+
wp_send_json_success();
|
| 199 |
+
} catch (Exception $ex) {
|
| 200 |
+
wp_send_json_error($ex->getMessage());
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* Add plugin in Settings menu
|
| 206 |
+
*
|
| 207 |
+
* @since 2.0.0
|
| 208 |
+
*/
|
| 209 |
+
public function add_plugin_menu() {
|
| 210 |
+
$this->plugin_screen_hook_suffix = add_options_page(
|
| 211 |
+
__('WP Maintenance Mode', $this->plugin_slug), __('WP Maintenance Mode', $this->plugin_slug), 'manage_options', $this->plugin_slug, array($this, 'display_plugin_settings')
|
| 212 |
+
);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
/**
|
| 216 |
+
* Settings page
|
| 217 |
+
*
|
| 218 |
+
* @since 2.0.0
|
| 219 |
+
* @global object $wp_roles
|
| 220 |
+
*/
|
| 221 |
+
public function display_plugin_settings() {
|
| 222 |
+
global $wp_roles;
|
| 223 |
+
|
| 224 |
+
// save settings
|
| 225 |
+
$this->save_plugin_settings();
|
| 226 |
+
|
| 227 |
+
// show settings
|
| 228 |
+
include_once(WPMM_VIEWS_PATH . 'settings.php');
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
/**
|
| 232 |
+
* Save settings
|
| 233 |
+
*
|
| 234 |
+
* @since 2.0.0
|
| 235 |
+
*/
|
| 236 |
+
public function save_plugin_settings() {
|
| 237 |
+
if (!empty($_POST) && !empty($_POST['tab'])) {
|
| 238 |
+
if (!wp_verify_nonce($_POST['_wpnonce'], 'tab-' . $_POST['tab'])) {
|
| 239 |
+
die('Security check!');
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
// DO SOME SANITIZATIONS
|
| 243 |
+
$tab = $_POST['tab'];
|
| 244 |
+
switch ($tab) {
|
| 245 |
+
case 'general':
|
| 246 |
+
$_POST['options']['general']['status'] = (int) $_POST['options']['general']['status'];
|
| 247 |
+
if (!empty($_POST['options']['general']['status']) && $_POST['options']['general']['status'] == 1) {
|
| 248 |
+
$_POST['options']['general']['status_date'] = date('Y-m-d H:i:s');
|
| 249 |
+
}
|
| 250 |
+
$_POST['options']['general']['bypass_bots'] = (int) $_POST['options']['general']['bypass_bots'];
|
| 251 |
+
$_POST['options']['general']['backend_role'] = !empty($_POST['options']['general']['backend_role']) ? $_POST['options']['general']['backend_role'] : array();
|
| 252 |
+
$_POST['options']['general']['frontend_role'] = !empty($_POST['options']['general']['frontend_role']) ? $_POST['options']['general']['frontend_role'] : array();
|
| 253 |
+
$_POST['options']['general']['meta_robots'] = (int) $_POST['options']['general']['meta_robots'];
|
| 254 |
+
$_POST['options']['general']['redirection'] = esc_url($_POST['options']['general']['redirection']);
|
| 255 |
+
if (!empty($_POST['options']['general']['exclude'])) {
|
| 256 |
+
$exclude_array = explode("\n", $_POST['options']['general']['exclude']);
|
| 257 |
+
// we need to be sure that empty lines will not be saved
|
| 258 |
+
$_POST['options']['general']['exclude'] = array_filter(array_map('trim', $exclude_array));
|
| 259 |
+
} else {
|
| 260 |
+
$_POST['options']['general']['exclude'] = array();
|
| 261 |
+
}
|
| 262 |
+
$_POST['options']['general']['notice'] = (int) $_POST['options']['general']['notice'];
|
| 263 |
+
$_POST['options']['general']['admin_link'] = (int) $_POST['options']['general']['admin_link'];
|
| 264 |
+
|
| 265 |
+
// delete cache when is already activated, when is activated and when is deactivated
|
| 266 |
+
if (
|
| 267 |
+
isset($this->plugin_settings['general']['status']) && isset($_POST['options']['general']['status']) &&
|
| 268 |
+
(
|
| 269 |
+
($this->plugin_settings['general']['status'] == 1 && in_array($_POST['options']['general']['status'], array(0, 1))) ||
|
| 270 |
+
($this->plugin_settings['general']['status'] == 0 && $_POST['options']['general']['status'] == 1)
|
| 271 |
+
)
|
| 272 |
+
) {
|
| 273 |
+
$this->delete_cache();
|
| 274 |
+
}
|
| 275 |
+
break;
|
| 276 |
+
case 'design':
|
| 277 |
+
$custom_css = array();
|
| 278 |
+
|
| 279 |
+
// CONTENT & CUSTOM CSS
|
| 280 |
+
$_POST['options']['design']['title'] = sanitize_text_field($_POST['options']['design']['title']);
|
| 281 |
+
$_POST['options']['design']['heading'] = sanitize_text_field($_POST['options']['design']['heading']);
|
| 282 |
+
if (!empty($_POST['options']['design']['heading_color'])) {
|
| 283 |
+
$_POST['options']['design']['heading_color'] = sanitize_text_field($_POST['options']['design']['heading_color']);
|
| 284 |
+
$custom_css['heading_color'] = '.wrap h1 { color: ' . $_POST['options']['design']['heading_color'] . '; }';
|
| 285 |
+
}
|
| 286 |
+
add_filter('safe_style_css', array($this, 'add_safe_style_css')); // add before we save
|
| 287 |
+
$_POST['options']['design']['text'] = wp_kses_post($_POST['options']['design']['text']);
|
| 288 |
+
remove_filter('safe_style_css', array($this, 'add_safe_style_css')); // remove after we save
|
| 289 |
+
|
| 290 |
+
if (!empty($_POST['options']['design']['text_color'])) {
|
| 291 |
+
$_POST['options']['design']['text_color'] = sanitize_text_field($_POST['options']['design']['text_color']);
|
| 292 |
+
$custom_css['text_color'] = '.wrap h2 { color: ' . $_POST['options']['design']['text_color'] . '; }';
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
// BACKGROUND & CUSTOM CSS
|
| 296 |
+
if (!empty($_POST['options']['design']['bg_type'])) {
|
| 297 |
+
$_POST['options']['design']['bg_type'] = sanitize_text_field($_POST['options']['design']['bg_type']);
|
| 298 |
+
|
| 299 |
+
if ($_POST['options']['design']['bg_type'] == 'color' && !empty($_POST['options']['design']['bg_color'])) {
|
| 300 |
+
$_POST['options']['design']['bg_color'] = sanitize_text_field($_POST['options']['design']['bg_color']);
|
| 301 |
+
$custom_css['bg_color'] = 'body { background-color: ' . $_POST['options']['design']['bg_color'] . '; }';
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
if ($_POST['options']['design']['bg_type'] == 'custom' && !empty($_POST['options']['design']['bg_custom'])) {
|
| 305 |
+
$_POST['options']['design']['bg_custom'] = esc_url($_POST['options']['design']['bg_custom']);
|
| 306 |
+
$custom_css['bg_url'] = '.background { background: url(' . $_POST['options']['design']['bg_custom'] . ') no-repeat center top fixed; background-size: cover; }';
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
if ($_POST['options']['design']['bg_type'] == 'predefined' && !empty($_POST['options']['design']['bg_predefined'])) {
|
| 310 |
+
$_POST['options']['design']['bg_predefined'] = sanitize_text_field($_POST['options']['design']['bg_predefined']);
|
| 311 |
+
$custom_css['bg_url'] = '.background { background: url(' . esc_url(WPMM_URL . 'assets/images/backgrounds/' . $_POST['options']['design']['bg_predefined']) . ') no-repeat center top fixed; background-size: cover; }';
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
$_POST['options']['design']['custom_css'] = $custom_css;
|
| 316 |
+
|
| 317 |
+
// delete cache when is activated
|
| 318 |
+
if (!empty($this->plugin_settings['general']['status']) && $this->plugin_settings['general']['status'] == 1) {
|
| 319 |
+
$this->delete_cache();
|
| 320 |
+
}
|
| 321 |
+
break;
|
| 322 |
+
case 'modules':
|
| 323 |
+
$custom_css = array();
|
| 324 |
+
|
| 325 |
+
// COUNTDOWN & CUSTOM CSS
|
| 326 |
+
$_POST['options']['modules']['countdown_status'] = (int) $_POST['options']['modules']['countdown_status'];
|
| 327 |
+
$_POST['options']['modules']['countdown_start'] = sanitize_text_field($_POST['options']['modules']['countdown_start']);
|
| 328 |
+
$_POST['options']['modules']['countdown_details'] = array_map('trim', $_POST['options']['modules']['countdown_details']);
|
| 329 |
+
$_POST['options']['modules']['countdown_details']['days'] = isset($_POST['options']['modules']['countdown_details']['days']) && is_numeric($_POST['options']['modules']['countdown_details']['days']) ? $_POST['options']['modules']['countdown_details']['days'] : 0;
|
| 330 |
+
$_POST['options']['modules']['countdown_details']['hours'] = isset($_POST['options']['modules']['countdown_details']['hours']) && is_numeric($_POST['options']['modules']['countdown_details']['hours']) ? $_POST['options']['modules']['countdown_details']['hours'] : 1;
|
| 331 |
+
$_POST['options']['modules']['countdown_details']['minutes'] = isset($_POST['options']['modules']['countdown_details']['minutes']) && is_numeric($_POST['options']['modules']['countdown_details']['minutes']) ? $_POST['options']['modules']['countdown_details']['minutes'] : 0;
|
| 332 |
+
if (!empty($_POST['options']['modules']['countdown_color'])) {
|
| 333 |
+
$_POST['options']['modules']['countdown_color'] = sanitize_text_field($_POST['options']['modules']['countdown_color']);
|
| 334 |
+
$custom_css['countdown_color'] = '.wrap .countdown span { color: ' . $_POST['options']['modules']['countdown_color'] . '; }';
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
// SUBSCRIBE & CUSTOM CSS
|
| 338 |
+
$_POST['options']['modules']['subscribe_status'] = (int) $_POST['options']['modules']['subscribe_status'];
|
| 339 |
+
$_POST['options']['modules']['subscribe_text'] = sanitize_text_field($_POST['options']['modules']['subscribe_text']);
|
| 340 |
+
if (!empty($_POST['options']['modules']['subscribe_text_color'])) {
|
| 341 |
+
$_POST['options']['modules']['subscribe_text_color'] = sanitize_text_field($_POST['options']['modules']['subscribe_text_color']);
|
| 342 |
+
$custom_css['subscribe_text_color'] = '.wrap h3, .wrap .subscribe_wrapper { color: ' . $_POST['options']['modules']['subscribe_text_color'] . '; }';
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
// SOCIAL NETWORKS
|
| 346 |
+
$_POST['options']['modules']['social_status'] = (int) $_POST['options']['modules']['social_status'];
|
| 347 |
+
$_POST['options']['modules']['social_target'] = (int) $_POST['options']['modules']['social_target'];
|
| 348 |
+
$_POST['options']['modules']['social_github'] = sanitize_text_field($_POST['options']['modules']['social_github']);
|
| 349 |
+
$_POST['options']['modules']['social_dribbble'] = sanitize_text_field($_POST['options']['modules']['social_dribbble']);
|
| 350 |
+
$_POST['options']['modules']['social_twitter'] = sanitize_text_field($_POST['options']['modules']['social_twitter']);
|
| 351 |
+
$_POST['options']['modules']['social_facebook'] = sanitize_text_field($_POST['options']['modules']['social_facebook']);
|
| 352 |
+
$_POST['options']['modules']['social_pinterest'] = sanitize_text_field($_POST['options']['modules']['social_pinterest']);
|
| 353 |
+
$_POST['options']['modules']['social_google+'] = sanitize_text_field($_POST['options']['modules']['social_google+']);
|
| 354 |
+
$_POST['options']['modules']['social_linkedin'] = sanitize_text_field($_POST['options']['modules']['social_linkedin']);
|
| 355 |
+
|
| 356 |
+
// CONTACT
|
| 357 |
+
$_POST['options']['modules']['contact_status'] = (int) $_POST['options']['modules']['contact_status'];
|
| 358 |
+
$_POST['options']['modules']['contact_email'] = sanitize_text_field($_POST['options']['modules']['contact_email']);
|
| 359 |
+
$_POST['options']['modules']['contact_effects'] = sanitize_text_field($_POST['options']['modules']['contact_effects']);
|
| 360 |
+
|
| 361 |
+
// GOOGLE ANALYTICS
|
| 362 |
+
$_POST['options']['modules']['ga_status'] = (int) $_POST['options']['modules']['ga_status'];
|
| 363 |
+
$_POST['options']['modules']['ga_code'] = wp_kses(trim($_POST['options']['modules']['ga_code']), array('script' => array()));
|
| 364 |
+
|
| 365 |
+
$_POST['options']['modules']['custom_css'] = $custom_css;
|
| 366 |
+
|
| 367 |
+
// delete cache when is activated
|
| 368 |
+
if (!empty($this->plugin_settings['general']['status']) && $this->plugin_settings['general']['status'] == 1) {
|
| 369 |
+
$this->delete_cache();
|
| 370 |
+
}
|
| 371 |
+
break;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
$this->plugin_settings[$tab] = $_POST['options'][$tab];
|
| 375 |
+
update_option('wpmm_settings', $this->plugin_settings);
|
| 376 |
+
}
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
/**
|
| 380 |
+
* Add new safe inline style css (use by wp_kses_attr in wp_kses_post)
|
| 381 |
+
* - bug discovered by cokemorgan: https://github.com/Designmodocom/WP-Maintenance-Mode/issues/56
|
| 382 |
+
*
|
| 383 |
+
* @since 2.0.3
|
| 384 |
+
* @param array $properties
|
| 385 |
+
* @return array
|
| 386 |
+
*/
|
| 387 |
+
public function add_safe_style_css($properties) {
|
| 388 |
+
$new_properties = array(
|
| 389 |
+
'min-height',
|
| 390 |
+
'max-height',
|
| 391 |
+
'min-width',
|
| 392 |
+
'max-width'
|
| 393 |
+
);
|
| 394 |
+
|
| 395 |
+
return array_merge($new_properties, $properties);
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
/**
|
| 399 |
+
* Delete cache if any cache plugin (wp_cache or w3tc) is activated
|
| 400 |
+
*
|
| 401 |
+
* @since 2.0.1
|
| 402 |
+
*/
|
| 403 |
+
public function delete_cache() {
|
| 404 |
+
// Super Cache Plugin
|
| 405 |
+
if (function_exists('wp_cache_clear_cache')) {
|
| 406 |
+
wp_cache_clear_cache(is_multisite() && is_plugin_active_for_network($this->plugin_basename) ? get_current_blog_id() : '');
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
// W3 Total Cache Plugin
|
| 410 |
+
if (function_exists('w3tc_pgcache_flush')) {
|
| 411 |
+
w3tc_pgcache_flush();
|
| 412 |
+
}
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
/**
|
| 416 |
+
* Add settings link
|
| 417 |
+
*
|
| 418 |
+
* @since 2.0.0
|
| 419 |
+
* @param array $links
|
| 420 |
+
* @return array
|
| 421 |
+
*/
|
| 422 |
+
public function add_settings_link($links) {
|
| 423 |
+
return array_merge(
|
| 424 |
+
array(
|
| 425 |
+
'wpmm_settings' => '<a href="' . admin_url('options-general.php?page=' . $this->plugin_slug) . '">' . __('Settings', $this->plugin_slug) . '</a>'
|
| 426 |
+
), $links
|
| 427 |
+
);
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
/**
|
| 431 |
+
* Add notices - will be displayed on dashboard
|
| 432 |
+
*
|
| 433 |
+
* @since 2.0.0
|
| 434 |
+
*/
|
| 435 |
+
public function add_notices() {
|
| 436 |
+
$screen = get_current_screen();
|
| 437 |
+
$notices = array();
|
| 438 |
+
|
| 439 |
+
if ($this->plugin_screen_hook_suffix != $screen->id) {
|
| 440 |
+
// notice if plugin is activated
|
| 441 |
+
if ($this->plugin_settings['general']['status'] == 1 && $this->plugin_settings['general']['notice'] == 1) {
|
| 442 |
+
$notices['is_activated'] = array(
|
| 443 |
+
'class' => 'error',
|
| 444 |
+
'msg' => sprintf(__('The Maintenance Mode is <strong>active</strong>. Please don\'t forget to <a href="%s">deactivate</a> as soon as you are done.', $this->plugin_slug), admin_url('options-general.php?page=' . $this->plugin_slug))
|
| 445 |
+
);
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
// show notice if plugin has a notice saved
|
| 449 |
+
$wpmm_notice = get_option('wpmm_notice');
|
| 450 |
+
if (!empty($wpmm_notice) && is_array($wpmm_notice)) {
|
| 451 |
+
$notices['other'] = $wpmm_notice;
|
| 452 |
+
}
|
| 453 |
+
} else {
|
| 454 |
+
// delete wpmm_notice
|
| 455 |
+
delete_option('wpmm_notice');
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
// notice promo for codepad
|
| 459 |
+
ob_start();
|
| 460 |
+
include_once(WPMM_VIEWS_PATH . 'promo-codepad.php');
|
| 461 |
+
$notices['promo_codepad'] = array(
|
| 462 |
+
'class' => 'wpmm_notices updated notice' . ($this->plugin_screen_hook_suffix != $screen->id ? ' is-dismissible' : ''),
|
| 463 |
+
'msg' => ob_get_clean()
|
| 464 |
+
);
|
| 465 |
+
|
| 466 |
+
// get dismissed notices
|
| 467 |
+
$dismissed_notices = $this->get_dismissed_notices(get_current_user_id());
|
| 468 |
+
|
| 469 |
+
// template
|
| 470 |
+
include_once(WPMM_VIEWS_PATH . 'notice.php');
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
/**
|
| 474 |
+
* Dismiss plugin notices via AJAX
|
| 475 |
+
*
|
| 476 |
+
* @throws Exception
|
| 477 |
+
*/
|
| 478 |
+
public function dismiss_notices() {
|
| 479 |
+
try {
|
| 480 |
+
if (empty($_POST['notice_key'])) {
|
| 481 |
+
throw new Exception(__('Notice key cannot be empty.', $this->plugin_slug));
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
// save new notice key
|
| 485 |
+
$notice_key = sanitize_text_field($_POST['notice_key']);
|
| 486 |
+
$this->save_dismissed_notices(get_current_user_id(), $notice_key);
|
| 487 |
+
|
| 488 |
+
wp_send_json_success();
|
| 489 |
+
} catch (Exception $ex) {
|
| 490 |
+
wp_send_json_error($ex->getMessage());
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
/**
|
| 495 |
+
* Get dismissed notices
|
| 496 |
+
*
|
| 497 |
+
* @param int $user_id
|
| 498 |
+
* @return array
|
| 499 |
+
*/
|
| 500 |
+
public function get_dismissed_notices($user_id) {
|
| 501 |
+
$dismissed_notices = get_user_meta($user_id, $this->dismissed_notices_key, true);
|
| 502 |
+
|
| 503 |
+
return array_filter(explode(',', $dismissed_notices), 'trim');
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
/**
|
| 507 |
+
* Save dismissed notices
|
| 508 |
+
* - save as string because of http://wordpress.stackexchange.com/questions/13353/problem-storing-arrays-with-update-user-meta
|
| 509 |
+
*
|
| 510 |
+
* @param int $user_id
|
| 511 |
+
* @param string $notice_key
|
| 512 |
+
*/
|
| 513 |
+
public function save_dismissed_notices($user_id, $notice_key) {
|
| 514 |
+
$dismissed_notices = $this->get_dismissed_notices($user_id);
|
| 515 |
+
$dismissed_notices[] = $notice_key;
|
| 516 |
+
|
| 517 |
+
update_user_meta($user_id, $this->dismissed_notices_key, implode(',', $dismissed_notices));
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
Â
}
|
|
@@ -1,76 +1,76 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
if (!class_exists('WP_Maintenance_Mode_Shortcodes')) {
|
| 4 |
-
class WP_Maintenance_Mode_Shortcodes {
|
| 5 |
-
|
| 6 |
-
/**
|
| 7 |
-
* Add shortcodes
|
| 8 |
-
*
|
| 9 |
-
* @since 2.0.3
|
| 10 |
-
*/
|
| 11 |
-
public static function init() {
|
| 12 |
-
$shortcodes = array(
|
| 13 |
-
'loginform' => __CLASS__ . '::loginform'
|
| 14 |
-
);
|
| 15 |
-
|
| 16 |
-
foreach ($shortcodes as $shortcode => $method) {
|
| 17 |
-
add_shortcode($shortcode, $method);
|
| 18 |
-
}
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
/**
|
| 22 |
-
* Shortcode Wrapper
|
| 23 |
-
*
|
| 24 |
-
* @since 2.0.3
|
| 25 |
-
* @param string $function
|
| 26 |
-
* @param array $atts
|
| 27 |
-
* @param array $wrapper
|
| 28 |
-
* @return string
|
| 29 |
-
*/
|
| 30 |
-
public static function shortcode_wrapper($function, $atts = array(), $wrapper = array('before' => null, 'after' => null)) {
|
| 31 |
-
ob_start();
|
| 32 |
-
|
| 33 |
-
echo $wrapper['before'];
|
| 34 |
-
call_user_func($function, $atts);
|
| 35 |
-
echo $wrapper['after'];
|
| 36 |
-
|
| 37 |
-
return ob_get_clean();
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
/**
|
| 41 |
-
* Login form shortcode.
|
| 42 |
-
*
|
| 43 |
-
* @since 2.0.3
|
| 44 |
-
* @param array $atts
|
| 45 |
-
* @return string
|
| 46 |
-
*/
|
| 47 |
-
public static function loginform($atts) {
|
| 48 |
-
return self::shortcode_wrapper(array('WP_Maintenance_Mode_Shortcode_Login', 'display'), $atts);
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
if (!class_exists('WP_Maintenance_Mode_Shortcode_Login')) {
|
| 56 |
-
|
| 57 |
-
class WP_Maintenance_Mode_Shortcode_Login {
|
| 58 |
-
|
| 59 |
-
public function __construct() { }
|
| 60 |
-
|
| 61 |
-
/**
|
| 62 |
-
* Show login form
|
| 63 |
-
*
|
| 64 |
-
* @since 2.0.3
|
| 65 |
-
* @param array $atts
|
| 66 |
-
* @param string $content
|
| 67 |
-
*/
|
| 68 |
-
public static function display($atts) {
|
| 69 |
-
extract(shortcode_atts(array('redirect' => ''), $atts));
|
| 70 |
-
|
| 71 |
-
include_once(WPMM_VIEWS_PATH . 'loginform.php');
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
}
|
| 75 |
-
|
| 76 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
if (!class_exists('WP_Maintenance_Mode_Shortcodes')) {
|
| 4 |
+
class WP_Maintenance_Mode_Shortcodes {
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* Add shortcodes
|
| 8 |
+
*
|
| 9 |
+
* @since 2.0.3
|
| 10 |
+
*/
|
| 11 |
+
public static function init() {
|
| 12 |
+
$shortcodes = array(
|
| 13 |
+
'loginform' => __CLASS__ . '::loginform'
|
| 14 |
+
);
|
| 15 |
+
|
| 16 |
+
foreach ($shortcodes as $shortcode => $method) {
|
| 17 |
+
add_shortcode($shortcode, $method);
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Shortcode Wrapper
|
| 23 |
+
*
|
| 24 |
+
* @since 2.0.3
|
| 25 |
+
* @param string $function
|
| 26 |
+
* @param array $atts
|
| 27 |
+
* @param array $wrapper
|
| 28 |
+
* @return string
|
| 29 |
+
*/
|
| 30 |
+
public static function shortcode_wrapper($function, $atts = array(), $wrapper = array('before' => null, 'after' => null)) {
|
| 31 |
+
ob_start();
|
| 32 |
+
|
| 33 |
+
echo $wrapper['before'];
|
| 34 |
+
call_user_func($function, $atts);
|
| 35 |
+
echo $wrapper['after'];
|
| 36 |
+
|
| 37 |
+
return ob_get_clean();
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Login form shortcode.
|
| 42 |
+
*
|
| 43 |
+
* @since 2.0.3
|
| 44 |
+
* @param array $atts
|
| 45 |
+
* @return string
|
| 46 |
+
*/
|
| 47 |
+
public static function loginform($atts) {
|
| 48 |
+
return self::shortcode_wrapper(array('WP_Maintenance_Mode_Shortcode_Login', 'display'), $atts);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if (!class_exists('WP_Maintenance_Mode_Shortcode_Login')) {
|
| 56 |
+
|
| 57 |
+
class WP_Maintenance_Mode_Shortcode_Login {
|
| 58 |
+
|
| 59 |
+
public function __construct() { }
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* Show login form
|
| 63 |
+
*
|
| 64 |
+
* @since 2.0.3
|
| 65 |
+
* @param array $atts
|
| 66 |
+
* @param string $content
|
| 67 |
+
*/
|
| 68 |
+
public static function display($atts) {
|
| 69 |
+
extract(shortcode_atts(array('redirect' => ''), $atts));
|
| 70 |
+
|
| 71 |
+
include_once(WPMM_VIEWS_PATH . 'loginform.php');
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
}
|
|
@@ -1,714 +1,746 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
protected $
|
| 10 |
-
protected $
|
| 11 |
-
protected
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
$this->
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
add_action('
|
| 36 |
-
add_action('
|
| 37 |
-
add_action('
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
*
|
| 60 |
-
*
|
| 61 |
-
* @
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
*
|
| 70 |
-
*
|
| 71 |
-
* @
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
*
|
| 80 |
-
*
|
| 81 |
-
* @
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
'
|
| 88 |
-
'
|
| 89 |
-
'
|
| 90 |
-
'
|
| 91 |
-
'
|
| 92 |
-
'
|
| 93 |
-
'
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
'
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
'
|
| 104 |
-
'
|
| 105 |
-
'
|
| 106 |
-
'
|
| 107 |
-
'
|
| 108 |
-
'
|
| 109 |
-
'
|
| 110 |
-
'
|
| 111 |
-
'
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
'
|
| 116 |
-
'
|
| 117 |
-
|
| 118 |
-
'
|
| 119 |
-
'
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
'
|
| 123 |
-
'
|
| 124 |
-
'
|
| 125 |
-
'
|
| 126 |
-
'
|
| 127 |
-
'
|
| 128 |
-
'
|
| 129 |
-
'
|
| 130 |
-
'
|
| 131 |
-
'
|
| 132 |
-
'
|
| 133 |
-
'
|
| 134 |
-
'
|
| 135 |
-
'
|
| 136 |
-
'
|
| 137 |
-
'
|
| 138 |
-
'
|
| 139 |
-
'
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
*
|
| 147 |
-
*
|
| 148 |
-
* @
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
delete_option('wp-maintenance-mode
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
*
|
| 179 |
-
*
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
*
|
| 192 |
-
*
|
| 193 |
-
* @
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
*
|
| 216 |
-
*
|
| 217 |
-
* @
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
*
|
| 232 |
-
*
|
| 233 |
-
* @
|
| 234 |
-
* @
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
`
|
| 243 |
-
`
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
$
|
| 252 |
-
$
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
if
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
'
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
'
|
| 323 |
-
'
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
'
|
| 330 |
-
'
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
'
|
| 337 |
-
'
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
'
|
| 343 |
-
'
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
'
|
| 350 |
-
'
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
'
|
| 357 |
-
'
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
'
|
| 364 |
-
'
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
*
|
| 383 |
-
*
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
*
|
| 392 |
-
*
|
| 393 |
-
* @
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
*
|
| 404 |
-
*
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
$
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
*
|
| 417 |
-
*
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
!strstr($_SERVER['PHP_SELF'], 'wp-
|
| 427 |
-
!strstr($_SERVER['PHP_SELF'], 'wp-
|
| 428 |
-
|
| 429 |
-
!(strstr($_SERVER['PHP_SELF'], '
|
| 430 |
-
!strstr($_SERVER['PHP_SELF'], '/
|
| 431 |
-
!strstr($_SERVER['PHP_SELF'], '/
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
$
|
| 442 |
-
|
| 443 |
-
//
|
| 444 |
-
$
|
| 445 |
-
$
|
| 446 |
-
$
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
$
|
| 450 |
-
|
| 451 |
-
$
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
$
|
| 455 |
-
|
| 456 |
-
$
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
$
|
| 460 |
-
$
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
$
|
| 464 |
-
$
|
| 465 |
-
$
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
$
|
| 470 |
-
$
|
| 471 |
-
$
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
$
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
$
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
$
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
$
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
);
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
'
|
| 579 |
-
'
|
| 580 |
-
'
|
| 581 |
-
'
|
| 582 |
-
'
|
| 583 |
-
'
|
| 584 |
-
'
|
| 585 |
-
'
|
| 586 |
-
'
|
| 587 |
-
'
|
| 588 |
-
'
|
| 589 |
-
'
|
| 590 |
-
'
|
| 591 |
-
'
|
| 592 |
-
'
|
| 593 |
-
'
|
| 594 |
-
'
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
}
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
}
|
| 671 |
-
|
| 672 |
-
/**
|
| 673 |
-
*
|
| 674 |
-
*
|
| 675 |
-
* @since 2.0.0
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 714 |
Â
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
if (!class_exists('WP_Maintenance_Mode')) {
|
| 4 |
+
|
| 5 |
+
class WP_Maintenance_Mode {
|
| 6 |
+
|
| 7 |
+
const VERSION = '2.0.4';
|
| 8 |
+
|
| 9 |
+
protected $plugin_slug = 'wp-maintenance-mode';
|
| 10 |
+
protected $plugin_settings;
|
| 11 |
+
protected $plugin_basename;
|
| 12 |
+
protected static $instance = null;
|
| 13 |
+
|
| 14 |
+
private function __construct() {
|
| 15 |
+
$this->plugin_settings = get_option('wpmm_settings');
|
| 16 |
+
$this->plugin_basename = plugin_basename(WPMM_PATH . $this->plugin_slug . '.php');
|
| 17 |
+
|
| 18 |
+
// Load plugin text domain
|
| 19 |
+
add_action('init', array($this, 'load_plugin_textdomain'));
|
| 20 |
+
|
| 21 |
+
// Add shortcodes
|
| 22 |
+
add_action('init', array('WP_Maintenance_Mode_Shortcodes', 'init'));
|
| 23 |
+
|
| 24 |
+
// Activate plugin when new blog is added
|
| 25 |
+
add_action('wpmu_new_blog', array($this, 'activate_new_site'));
|
| 26 |
+
|
| 27 |
+
// Check update
|
| 28 |
+
add_action('admin_init', array($this, 'check_update'));
|
| 29 |
+
|
| 30 |
+
if (!empty($this->plugin_settings['general']['status']) && $this->plugin_settings['general']['status'] == 1) {
|
| 31 |
+
// INIT
|
| 32 |
+
add_action('init', array($this, 'init'));
|
| 33 |
+
|
| 34 |
+
// Add ajax methods
|
| 35 |
+
add_action('wp_ajax_nopriv_wpmm_add_subscriber', array($this, 'add_subscriber'));
|
| 36 |
+
add_action('wp_ajax_wpmm_add_subscriber', array($this, 'add_subscriber'));
|
| 37 |
+
add_action('wp_ajax_nopriv_wpmm_send_contact', array($this, 'send_contact'));
|
| 38 |
+
add_action('wp_ajax_wpmm_send_contact', array($this, 'send_contact'));
|
| 39 |
+
|
| 40 |
+
// Redirect
|
| 41 |
+
add_action('init', array($this, 'redirect'), 9);
|
| 42 |
+
|
| 43 |
+
// Google Analytics tracking script
|
| 44 |
+
if (!empty($this->plugin_settings['modules']['ga_status']) && $this->plugin_settings['modules']['ga_status'] == 1 && !empty($this->plugin_settings['modules']['ga_code'])) {
|
| 45 |
+
add_action('wpmm_head', create_function('', 'echo "' . stripslashes($this->plugin_settings['modules']['ga_code']) . '";'));
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
public static function get_instance() {
|
| 51 |
+
if (null == self::$instance) {
|
| 52 |
+
self::$instance = new self;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
return self::$instance;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* Return plugin slug
|
| 60 |
+
*
|
| 61 |
+
* @since 2.0.0
|
| 62 |
+
* @return string
|
| 63 |
+
*/
|
| 64 |
+
public function get_plugin_slug() {
|
| 65 |
+
return $this->plugin_slug;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* Return plugin settings
|
| 70 |
+
*
|
| 71 |
+
* @since 2.0.0
|
| 72 |
+
* @return array
|
| 73 |
+
*/
|
| 74 |
+
public function get_plugin_settings() {
|
| 75 |
+
return $this->plugin_settings;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Return plugin default settings
|
| 80 |
+
*
|
| 81 |
+
* @since 2.0.0
|
| 82 |
+
* @return array
|
| 83 |
+
*/
|
| 84 |
+
public function default_settings() {
|
| 85 |
+
return array(
|
| 86 |
+
'general' => array(
|
| 87 |
+
'status' => 0,
|
| 88 |
+
'status_date' => '',
|
| 89 |
+
'bypass_bots' => 0,
|
| 90 |
+
'backend_role' => array(),
|
| 91 |
+
'frontend_role' => array(),
|
| 92 |
+
'meta_robots' => 0,
|
| 93 |
+
'redirection' => '',
|
| 94 |
+
'exclude' => array(
|
| 95 |
+
0 => 'feed',
|
| 96 |
+
1 => 'wp-login',
|
| 97 |
+
2 => 'login'
|
| 98 |
+
),
|
| 99 |
+
'notice' => 1,
|
| 100 |
+
'admin_link' => 0
|
| 101 |
+
),
|
| 102 |
+
'design' => array(
|
| 103 |
+
'title' => __('Maintenance mode', $this->plugin_slug),
|
| 104 |
+
'heading' => __('Maintenance mode', $this->plugin_slug),
|
| 105 |
+
'heading_color' => '',
|
| 106 |
+
'text' => __('<p>Sorry for the inconvenience.<br />Our website is currently undergoing scheduled maintenance.<br />Thank you for your understanding.</p>', $this->plugin_slug),
|
| 107 |
+
'text_color' => '',
|
| 108 |
+
'bg_type' => 'color',
|
| 109 |
+
'bg_color' => '',
|
| 110 |
+
'bg_custom' => '',
|
| 111 |
+
'bg_predefined' => 'bg1.jpg',
|
| 112 |
+
'custom_css' => array()
|
| 113 |
+
),
|
| 114 |
+
'modules' => array(
|
| 115 |
+
'countdown_status' => 0,
|
| 116 |
+
'countdown_start' => date('Y-m-d H:i:s'),
|
| 117 |
+
'countdown_details' => array(
|
| 118 |
+
'days' => 0,
|
| 119 |
+
'hours' => 1,
|
| 120 |
+
'minutes' => 0
|
| 121 |
+
),
|
| 122 |
+
'countdown_color' => '',
|
| 123 |
+
'subscribe_status' => 0,
|
| 124 |
+
'subscribe_text' => __('Notify me when it\'s ready', $this->plugin_slug),
|
| 125 |
+
'subscribe_text_color' => '',
|
| 126 |
+
'social_status' => 0,
|
| 127 |
+
'social_target' => 1,
|
| 128 |
+
'social_github' => '',
|
| 129 |
+
'social_dribbble' => '',
|
| 130 |
+
'social_twitter' => '',
|
| 131 |
+
'social_facebook' => '',
|
| 132 |
+
'social_pinterest' => '',
|
| 133 |
+
'social_google+' => '',
|
| 134 |
+
'social_linkedin' => '',
|
| 135 |
+
'contact_status' => 0,
|
| 136 |
+
'contact_email' => get_option('admin_email') ? get_option('admin_email') : '',
|
| 137 |
+
'contact_effects' => 'move_top|move_bottom',
|
| 138 |
+
'ga_status' => 0,
|
| 139 |
+
'ga_code' => '',
|
| 140 |
+
'custom_css' => array()
|
| 141 |
+
)
|
| 142 |
+
);
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
/**
|
| 146 |
+
* What to do when the plugin is activated
|
| 147 |
+
*
|
| 148 |
+
* @since 2.0.0
|
| 149 |
+
* @param boolean $network_wide
|
| 150 |
+
*/
|
| 151 |
+
public static function activate($network_wide) {
|
| 152 |
+
// because we need translated items when activate :)
|
| 153 |
+
load_plugin_textdomain(self::get_instance()->plugin_slug, FALSE, WPMM_LANGUAGES_PATH);
|
| 154 |
+
|
| 155 |
+
// do the job
|
| 156 |
+
if (function_exists('is_multisite') && is_multisite()) {
|
| 157 |
+
if ($network_wide) {
|
| 158 |
+
// Get all blog ids
|
| 159 |
+
$blog_ids = self::get_blog_ids();
|
| 160 |
+
foreach ($blog_ids as $blog_id) {
|
| 161 |
+
switch_to_blog($blog_id);
|
| 162 |
+
self::single_activate($network_wide);
|
| 163 |
+
restore_current_blog();
|
| 164 |
+
}
|
| 165 |
+
} else {
|
| 166 |
+
self::single_activate();
|
| 167 |
+
}
|
| 168 |
+
} else {
|
| 169 |
+
self::single_activate();
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
// delete old options
|
| 173 |
+
delete_option('wp-maintenance-mode');
|
| 174 |
+
delete_option('wp-maintenance-mode-msqld');
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
/**
|
| 178 |
+
* Check plugin version for updating process
|
| 179 |
+
*
|
| 180 |
+
* @since 2.0.3
|
| 181 |
+
*/
|
| 182 |
+
public function check_update() {
|
| 183 |
+
$version = get_option('wpmm_version', '0');
|
| 184 |
+
|
| 185 |
+
if (!version_compare($version, WP_Maintenance_Mode::VERSION, '=')) {
|
| 186 |
+
self::activate(is_multisite() && is_plugin_active_for_network($this->plugin_basename) ? true : false);
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* What to do when the plugin is deactivated
|
| 192 |
+
*
|
| 193 |
+
* @since 2.0.0
|
| 194 |
+
* @param boolean $network_wide
|
| 195 |
+
*/
|
| 196 |
+
public static function deactivate($network_wide) {
|
| 197 |
+
if (function_exists('is_multisite') && is_multisite()) {
|
| 198 |
+
if ($network_wide) {
|
| 199 |
+
// Get all blog ids
|
| 200 |
+
$blog_ids = self::get_blog_ids();
|
| 201 |
+
foreach ($blog_ids as $blog_id) {
|
| 202 |
+
switch_to_blog($blog_id);
|
| 203 |
+
self::single_deactivate();
|
| 204 |
+
restore_current_blog();
|
| 205 |
+
}
|
| 206 |
+
} else {
|
| 207 |
+
self::single_deactivate();
|
| 208 |
+
}
|
| 209 |
+
} else {
|
| 210 |
+
self::single_deactivate();
|
| 211 |
+
}
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* What to do when a new site is activated (multisite env)
|
| 216 |
+
*
|
| 217 |
+
* @since 2.0.0
|
| 218 |
+
* @param int $blog_id.
|
| 219 |
+
*/
|
| 220 |
+
public function activate_new_site($blog_id) {
|
| 221 |
+
if (1 !== did_action('wpmu_new_blog')) {
|
| 222 |
+
return;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
switch_to_blog($blog_id);
|
| 226 |
+
self::single_activate();
|
| 227 |
+
restore_current_blog();
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
/**
|
| 231 |
+
* What to do on single activate
|
| 232 |
+
*
|
| 233 |
+
* @since 2.0.0
|
| 234 |
+
* @global object $wpdb
|
| 235 |
+
* @param boolean $network_wide
|
| 236 |
+
*/
|
| 237 |
+
public static function single_activate($network_wide = false) {
|
| 238 |
+
global $wpdb;
|
| 239 |
+
|
| 240 |
+
// create wpmm_subscribers table
|
| 241 |
+
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wpmm_subscribers (
|
| 242 |
+
`id_subscriber` bigint(20) NOT NULL AUTO_INCREMENT,
|
| 243 |
+
`email` varchar(50) NOT NULL,
|
| 244 |
+
`insert_date` datetime NOT NULL,
|
| 245 |
+
PRIMARY KEY (`id_subscriber`)
|
| 246 |
+
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
|
| 247 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
| 248 |
+
dbDelta($sql);
|
| 249 |
+
|
| 250 |
+
// get all options for different versions of the plugin
|
| 251 |
+
$v2_options = get_option('wpmm_settings');
|
| 252 |
+
$old_options = (is_multisite() && $network_wide) ? get_site_option('wp-maintenance-mode') : get_option('wp-maintenance-mode');
|
| 253 |
+
$default_options = self::get_instance()->default_settings();
|
| 254 |
+
|
| 255 |
+
// set notice if the plugin was installed before & set default settings
|
| 256 |
+
if (!empty($old_options) && empty($v2_options)) {
|
| 257 |
+
add_option('wpmm_notice', array(
|
| 258 |
+
'class' => 'updated notice',
|
| 259 |
+
'msg' => sprintf(__('WP Maintenance Mode plugin was relaunched and you MUST revise <a href="%s">settings</a>.', self::get_instance()->plugin_slug), admin_url('options-general.php?page=' . self::get_instance()->plugin_slug))
|
| 260 |
+
));
|
| 261 |
+
|
| 262 |
+
// import old options
|
| 263 |
+
if (isset($old_options['active'])) {
|
| 264 |
+
$default_options['general']['status'] = $old_options['active'];
|
| 265 |
+
}
|
| 266 |
+
if (isset($old_options['bypass'])) {
|
| 267 |
+
$default_options['general']['bypass_bots'] = $old_options['bypass'];
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
if (!empty($old_options['role'][0])) {
|
| 271 |
+
$default_options['general']['backend_role'] = $old_options['role'][0] == 'administrator' ? array() : $old_options['role'];
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
if (!empty($old_options['role_frontend'][0])) {
|
| 275 |
+
$default_options['general']['frontend_role'] = $old_options['role_frontend'][0] == 'administrator' ? array() : $old_options['role_frontend'];
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
if (isset($old_options['index'])) {
|
| 279 |
+
$default_options['general']['meta_robots'] = $old_options['index'];
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
if (!empty($old_options['rewrite'])) {
|
| 283 |
+
$default_options['general']['redirection'] = $old_options['rewrite'];
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
if (!empty($old_options['exclude'][0])) {
|
| 287 |
+
$default_options['general']['exclude'] = array_unique(array_merge($default_options['general']['exclude'], $old_options['exclude']));
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
if (isset($old_options['notice'])) {
|
| 291 |
+
$default_options['general']['notice'] = $old_options['notice'];
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
if (isset($old_options['admin_link'])) {
|
| 295 |
+
$default_options['general']['admin_link'] = $old_options['admin_link'];
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
if (!empty($old_options['title'])) {
|
| 299 |
+
$default_options['design']['title'] = $old_options['title'];
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
if (!empty($old_options['heading'])) {
|
| 303 |
+
$default_options['design']['heading'] = $old_options['heading'];
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
if (!empty($old_options['text'])) {
|
| 307 |
+
$default_options['design']['text'] = $old_options['text'];
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
if (isset($old_options['radio'])) {
|
| 311 |
+
$default_options['modules']['countdown_status'] = $old_options['radio'];
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
if (!empty($old_options['date'])) {
|
| 315 |
+
$default_options['modules']['countdown_start'] = $old_options['date'];
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
if (isset($old_options['time']) && isset($old_options['unit'])) {
|
| 319 |
+
switch ($old_options['unit']) {
|
| 320 |
+
case 0: // seconds
|
| 321 |
+
$default_options['modules']['countdown_details'] = array(
|
| 322 |
+
'days' => 0,
|
| 323 |
+
'hours' => 0,
|
| 324 |
+
'minutes' => floor($old_options['time'] / 60)
|
| 325 |
+
);
|
| 326 |
+
break;
|
| 327 |
+
case 1: // minutes
|
| 328 |
+
$default_options['modules']['countdown_details'] = array(
|
| 329 |
+
'days' => 0,
|
| 330 |
+
'hours' => 0,
|
| 331 |
+
'minutes' => $old_options['time']
|
| 332 |
+
);
|
| 333 |
+
break;
|
| 334 |
+
case 2: // hours
|
| 335 |
+
$default_options['modules']['countdown_details'] = array(
|
| 336 |
+
'days' => 0,
|
| 337 |
+
'hours' => $old_options['time'],
|
| 338 |
+
'minutes' => 0
|
| 339 |
+
);
|
| 340 |
+
case 3: // days
|
| 341 |
+
$default_options['modules']['countdown_details'] = array(
|
| 342 |
+
'days' => $old_options['time'],
|
| 343 |
+
'hours' => 0,
|
| 344 |
+
'minutes' => 0
|
| 345 |
+
);
|
| 346 |
+
break;
|
| 347 |
+
case 4: // weeks
|
| 348 |
+
$default_options['modules']['countdown_details'] = array(
|
| 349 |
+
'days' => $old_options['time'] * 7,
|
| 350 |
+
'hours' => 0,
|
| 351 |
+
'minutes' => 0
|
| 352 |
+
);
|
| 353 |
+
break;
|
| 354 |
+
case 5: // months
|
| 355 |
+
$default_options['modules']['countdown_details'] = array(
|
| 356 |
+
'days' => $old_options['time'] * 30,
|
| 357 |
+
'hours' => 0,
|
| 358 |
+
'minutes' => 0
|
| 359 |
+
);
|
| 360 |
+
break;
|
| 361 |
+
case 6: // years
|
| 362 |
+
$default_options['modules']['countdown_details'] = array(
|
| 363 |
+
'days' => $old_options['time'] * 365,
|
| 364 |
+
'hours' => 0,
|
| 365 |
+
'minutes' => 0
|
| 366 |
+
);
|
| 367 |
+
break;
|
| 368 |
+
default:
|
| 369 |
+
break;
|
| 370 |
+
}
|
| 371 |
+
}
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
// set options
|
| 375 |
+
add_option('wpmm_settings', $default_options);
|
| 376 |
+
|
| 377 |
+
// set current version
|
| 378 |
+
update_option('wpmm_version', WP_Maintenance_Mode::VERSION);
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
/**
|
| 382 |
+
* What to do on single deactivate
|
| 383 |
+
*
|
| 384 |
+
* @since 2.0.0
|
| 385 |
+
*/
|
| 386 |
+
public static function single_deactivate() {
|
| 387 |
+
// nothing
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
/**
|
| 391 |
+
* Get all blog ids of blogs in the current network
|
| 392 |
+
*
|
| 393 |
+
* @since 2.0.0
|
| 394 |
+
* @return array / false
|
| 395 |
+
*/
|
| 396 |
+
private static function get_blog_ids() {
|
| 397 |
+
global $wpdb;
|
| 398 |
+
|
| 399 |
+
return $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM {$wpdb->blogs} WHERE archived = %d AND spam = %d AND deleted = %d", array(0, 0, 0)));
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
/**
|
| 403 |
+
* Load languages files
|
| 404 |
+
*
|
| 405 |
+
* @since 2.0.0
|
| 406 |
+
*/
|
| 407 |
+
public function load_plugin_textdomain() {
|
| 408 |
+
$domain = $this->plugin_slug;
|
| 409 |
+
$locale = apply_filters('plugin_locale', get_locale(), $domain);
|
| 410 |
+
|
| 411 |
+
load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
|
| 412 |
+
load_plugin_textdomain($domain, FALSE, WPMM_LANGUAGES_PATH);
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
/**
|
| 416 |
+
* Initialize when plugin is activated
|
| 417 |
+
*
|
| 418 |
+
* @since 2.0.0
|
| 419 |
+
*/
|
| 420 |
+
public function init() {
|
| 421 |
+
/**
|
| 422 |
+
* CHECKS
|
| 423 |
+
*/
|
| 424 |
+
if (
|
| 425 |
+
(!$this->check_user_role()) &&
|
| 426 |
+
!strstr($_SERVER['PHP_SELF'], 'wp-cron.php') &&
|
| 427 |
+
!strstr($_SERVER['PHP_SELF'], 'wp-login.php') &&
|
| 428 |
+
// wp-admin/ is available to everyone only if the user is not loggedin, otherwise.. check_user_role decides
|
| 429 |
+
!(strstr($_SERVER['PHP_SELF'], 'wp-admin/') && !is_user_logged_in()) &&
|
| 430 |
+
// !strstr($_SERVER['PHP_SELF'], 'wp-admin/') &&
|
| 431 |
+
!strstr($_SERVER['PHP_SELF'], 'wp-admin/admin-ajax.php') &&
|
| 432 |
+
!strstr($_SERVER['PHP_SELF'], 'async-upload.php') &&
|
| 433 |
+
!(strstr($_SERVER['PHP_SELF'], 'upgrade.php') && $this->check_user_role()) &&
|
| 434 |
+
!strstr($_SERVER['PHP_SELF'], '/plugins/') &&
|
| 435 |
+
!strstr($_SERVER['PHP_SELF'], '/xmlrpc.php') &&
|
| 436 |
+
!$this->check_exclude() &&
|
| 437 |
+
!$this->check_search_bots() &&
|
| 438 |
+
!(defined('WP_CLI') && WP_CLI)
|
| 439 |
+
) {
|
| 440 |
+
// HEADER STUFF
|
| 441 |
+
$protocol = !empty($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.1', 'HTTP/1.0')) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
|
| 442 |
+
$charset = get_bloginfo('charset') ? get_bloginfo('charset') : 'UTF-8';
|
| 443 |
+
$status_code = (int) apply_filters('wp_maintenance_mode_status_code', 503); // this hook will be removed in the next versions
|
| 444 |
+
$status_code = (int) apply_filters('wpmm_status_code', 503);
|
| 445 |
+
$backtime_seconds = $this->calculate_backtime();
|
| 446 |
+
$backtime = (int) apply_filters('wpmm_backtime', $backtime_seconds);
|
| 447 |
+
|
| 448 |
+
// META STUFF
|
| 449 |
+
$title = !empty($this->plugin_settings['design']['title']) ? $this->plugin_settings['design']['title'] : get_bloginfo('name') . ' - ' . __('Maintenance Mode', $this->plugin_slug);
|
| 450 |
+
$title = apply_filters('wm_title', $title); // this hook will be removed in the next versions
|
| 451 |
+
$title = apply_filters('wpmm_meta_title', $title);
|
| 452 |
+
|
| 453 |
+
$robots = $this->plugin_settings['general']['meta_robots'] == 1 ? 'noindex, nofollow' : 'index, follow';
|
| 454 |
+
$robots = apply_filters('wpmm_meta_robots', $robots);
|
| 455 |
+
|
| 456 |
+
$author = apply_filters('wm_meta_author', get_bloginfo('name')); // this hook will be removed in the next versions
|
| 457 |
+
$author = apply_filters('wpmm_meta_author', get_bloginfo('name'));
|
| 458 |
+
|
| 459 |
+
$description = get_bloginfo('name') . ' - ' . get_bloginfo('description');
|
| 460 |
+
$description = apply_filters('wm_meta_description', $description); // this hook will be removed in the next versions
|
| 461 |
+
$description = apply_filters('wpmm_meta_description', $description);
|
| 462 |
+
|
| 463 |
+
$keywords = __('Maintenance Mode', $this->plugin_slug);
|
| 464 |
+
$keywords = apply_filters('wm_meta_keywords', $keywords); // this hook will be removed in the next versions
|
| 465 |
+
$keywords = apply_filters('wpmm_meta_keywords', $keywords);
|
| 466 |
+
|
| 467 |
+
// CSS STUFF
|
| 468 |
+
$body_classes = !empty($this->plugin_settings['design']['bg_type']) && $this->plugin_settings['design']['bg_type'] != 'color' ? 'background' : '';
|
| 469 |
+
$custom_css_design = !empty($this->plugin_settings['design']['custom_css']) && is_array($this->plugin_settings['design']['custom_css']) ? $this->plugin_settings['design']['custom_css'] : array();
|
| 470 |
+
$custom_css_modules = !empty($this->plugin_settings['modules']['custom_css']) && is_array($this->plugin_settings['modules']['custom_css']) ? $this->plugin_settings['modules']['custom_css'] : array();
|
| 471 |
+
$custom_css = array_merge($custom_css_design, $custom_css_modules);
|
| 472 |
+
|
| 473 |
+
// CONTENT
|
| 474 |
+
$heading = !empty($this->plugin_settings['design']['heading']) ? $this->plugin_settings['design']['heading'] : '';
|
| 475 |
+
$heading = apply_filters('wm_heading', $heading); // this hook will be removed in the next versions
|
| 476 |
+
$heading = apply_filters('wpmm_heading', $heading);
|
| 477 |
+
|
| 478 |
+
$text = !empty($this->plugin_settings['design']['text']) ? $this->plugin_settings['design']['text'] : '';
|
| 479 |
+
$text = apply_filters('wpmm_text', do_shortcode($text));
|
| 480 |
+
|
| 481 |
+
// COUNTDOWN
|
| 482 |
+
$countdown_start = !empty($this->plugin_settings['modules']['countdown_start']) ? $this->plugin_settings['modules']['countdown_start'] : $this->plugin_settings['general']['status_data'];
|
| 483 |
+
$countdown_end = strtotime($countdown_start . ' +' . $backtime_seconds . ' seconds');
|
| 484 |
+
|
| 485 |
+
// JS FILES
|
| 486 |
+
$wp_scripts = new WP_Scripts();
|
| 487 |
+
$scripts = array(
|
| 488 |
+
'jquery' => !empty($wp_scripts->registered['jquery-core']) ? site_url($wp_scripts->registered['jquery-core']->src) : '//ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.' . WPMM_ASSETS_SUFFIX . '.js',
|
| 489 |
+
'frontend' => WPMM_JS_URL . 'scripts' . WPMM_ASSETS_SUFFIX . '.js'
|
| 490 |
+
);
|
| 491 |
+
if (!empty($this->plugin_settings['modules']['countdown_status']) && $this->plugin_settings['modules']['countdown_status'] == 1) {
|
| 492 |
+
$scripts['countdown-dependency'] = WPMM_JS_URL . 'jquery.plugin' . WPMM_ASSETS_SUFFIX . '.js';
|
| 493 |
+
$scripts['countdown'] = WPMM_JS_URL . 'jquery.countdown' . WPMM_ASSETS_SUFFIX . '.js';
|
| 494 |
+
}
|
| 495 |
+
if ((!empty($this->plugin_settings['modules']['contact_status']) && $this->plugin_settings['modules']['contact_status'] == 1) || (!empty($this->plugin_settings['modules']['subscribe_status']) && $this->plugin_settings['modules']['subscribe_status'] == 1)) {
|
| 496 |
+
$scripts['validate'] = WPMM_JS_URL . 'jquery.validate' . WPMM_ASSETS_SUFFIX . '.js';
|
| 497 |
+
}
|
| 498 |
+
$scripts = apply_filters('wpmm_scripts', $scripts);
|
| 499 |
+
|
| 500 |
+
// CSS FILES
|
| 501 |
+
$styles = array(
|
| 502 |
+
'frontend' => WPMM_CSS_URL . 'style' . WPMM_ASSETS_SUFFIX . '.css'
|
| 503 |
+
);
|
| 504 |
+
$styles = apply_filters('wpmm_styles', $styles);
|
| 505 |
+
|
| 506 |
+
nocache_headers();
|
| 507 |
+
ob_start();
|
| 508 |
+
header("Content-type: text/html; charset=$charset");
|
| 509 |
+
header("$protocol $status_code Service Unavailable", TRUE, $status_code);
|
| 510 |
+
header("Retry-After: $backtime");
|
| 511 |
+
|
| 512 |
+
if (file_exists(WP_CONTENT_DIR . '/wp-maintenance-mode.php')) {
|
| 513 |
+
include_once(WP_CONTENT_DIR . '/wp-maintenance-mode.php');
|
| 514 |
+
} else {
|
| 515 |
+
include_once(WPMM_VIEWS_PATH . 'maintenance.php');
|
| 516 |
+
}
|
| 517 |
+
ob_flush();
|
| 518 |
+
|
| 519 |
+
exit();
|
| 520 |
+
}
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/**
|
| 524 |
+
* Check if the current user has access to backend / frontend based on his role compared with role from settings (refactor @ 2.0.4)
|
| 525 |
+
*
|
| 526 |
+
* @since 2.0.0
|
| 527 |
+
* @return boolean
|
| 528 |
+
*/
|
| 529 |
+
public function check_user_role() {
|
| 530 |
+
if (is_super_admin()) {
|
| 531 |
+
return true;
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
$user = wp_get_current_user();
|
| 535 |
+
$user_roles = !empty($user->roles) && is_array($user->roles) ? $user->roles : array();
|
| 536 |
+
$allowed_roles = is_admin() ? $this->plugin_settings['general']['backend_role'] : $this->plugin_settings['general']['frontend_role'];
|
| 537 |
+
$is_allowed = (bool) array_intersect($user_roles, $allowed_roles);
|
| 538 |
+
|
| 539 |
+
// echo "<pre>";
|
| 540 |
+
// echo "user roles:";
|
| 541 |
+
// print_r($user_roles);
|
| 542 |
+
// echo "allowed roles:";
|
| 543 |
+
// print_r($allowed_roles);
|
| 544 |
+
// echo "is allowed:";
|
| 545 |
+
// var_dump($is_allowed);
|
| 546 |
+
// die;
|
| 547 |
+
|
| 548 |
+
return $is_allowed;
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
/**
|
| 552 |
+
* Calculate backtime based on countdown remaining time if it is activated
|
| 553 |
+
*
|
| 554 |
+
* @since 2.0.0
|
| 555 |
+
* @return int
|
| 556 |
+
*/
|
| 557 |
+
public function calculate_backtime() {
|
| 558 |
+
$backtime = 3600;
|
| 559 |
+
|
| 560 |
+
if (!empty($this->plugin_settings['modules']['countdown_status']) && $this->plugin_settings['modules']['countdown_status'] == 1) {
|
| 561 |
+
$backtime = ($this->plugin_settings['modules']['countdown_details']['days'] * DAY_IN_SECONDS) + ($this->plugin_settings['modules']['countdown_details']['hours'] * HOUR_IN_SECONDS) + ($this->plugin_settings['modules']['countdown_details']['minutes'] * MINUTE_IN_SECONDS);
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
return $backtime;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
/**
|
| 568 |
+
* Check if the visitor is a bot (using useragent)
|
| 569 |
+
*
|
| 570 |
+
* @since 2.0.0
|
| 571 |
+
* @return boolean
|
| 572 |
+
*/
|
| 573 |
+
public function check_search_bots() {
|
| 574 |
+
$is_search_bots = false;
|
| 575 |
+
|
| 576 |
+
if (!empty($this->plugin_settings['general']['bypass_bots']) && $this->plugin_settings['general']['bypass_bots'] == 1) {
|
| 577 |
+
$bots = apply_filters('wpmm_search_bots', array(
|
| 578 |
+
'Abacho' => 'AbachoBOT',
|
| 579 |
+
'Accoona' => 'Acoon',
|
| 580 |
+
'AcoiRobot' => 'AcoiRobot',
|
| 581 |
+
'Adidxbot' => 'adidxbot',
|
| 582 |
+
'AltaVista robot' => 'Altavista',
|
| 583 |
+
'Altavista robot' => 'Scooter',
|
| 584 |
+
'ASPSeek' => 'ASPSeek',
|
| 585 |
+
'Atomz' => 'Atomz',
|
| 586 |
+
'Bing' => 'bingbot',
|
| 587 |
+
'BingPreview' => 'BingPreview',
|
| 588 |
+
'CrocCrawler' => 'CrocCrawler',
|
| 589 |
+
'Dumbot' => 'Dumbot',
|
| 590 |
+
'eStyle Bot' => 'eStyle',
|
| 591 |
+
'FAST-WebCrawler' => 'FAST-WebCrawler',
|
| 592 |
+
'GeonaBot' => 'GeonaBot',
|
| 593 |
+
'Gigabot' => 'Gigabot',
|
| 594 |
+
'Google' => 'Googlebot',
|
| 595 |
+
'ID-Search Bot' => 'IDBot',
|
| 596 |
+
'Lycos spider' => 'Lycos',
|
| 597 |
+
'MSN' => 'msnbot',
|
| 598 |
+
'MSRBOT' => 'MSRBOT',
|
| 599 |
+
'Rambler' => 'Rambler',
|
| 600 |
+
'Scrubby robot' => 'Scrubby',
|
| 601 |
+
'Yahoo' => 'Yahoo'
|
| 602 |
+
));
|
| 603 |
+
|
| 604 |
+
$is_search_bots = (bool) preg_match('~(' . implode('|', array_values($bots)) . ')~i', $_SERVER['HTTP_USER_AGENT']);
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
return $is_search_bots;
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
/**
|
| 611 |
+
* Check if slug / ip address exists in exclude list
|
| 612 |
+
*
|
| 613 |
+
* @since 2.0.0
|
| 614 |
+
* @return boolean
|
| 615 |
+
*/
|
| 616 |
+
public function check_exclude() {
|
| 617 |
+
$is_excluded = false;
|
| 618 |
+
$excluded_list = array();
|
| 619 |
+
|
| 620 |
+
if (!empty($this->plugin_settings['general']['exclude']) && is_array($this->plugin_settings['general']['exclude'])) {
|
| 621 |
+
$excluded_list = $this->plugin_settings['general']['exclude'];
|
| 622 |
+
|
| 623 |
+
foreach ($excluded_list as $item) {
|
| 624 |
+
if (empty($item)) { // just to be sure :-)
|
| 625 |
+
continue;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
if ((!empty($_SERVER['REMOTE_ADDR']) && strstr($_SERVER['REMOTE_ADDR'], $item)) || (!empty($_SERVER['REQUEST_URI']) && strstr($_SERVER['REQUEST_URI'], $item))) {
|
| 629 |
+
$is_excluded = true;
|
| 630 |
+
break;
|
| 631 |
+
}
|
| 632 |
+
}
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
$is_excluded = apply_filters('wpmm_is_excluded', $is_excluded, $excluded_list);
|
| 636 |
+
|
| 637 |
+
return $is_excluded;
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
/**
|
| 641 |
+
* Redirect if "Redirection" option is used and users don't have access to WordPress dashboard
|
| 642 |
+
*
|
| 643 |
+
* @since 2.0.0
|
| 644 |
+
* @return null
|
| 645 |
+
*/
|
| 646 |
+
public function redirect() {
|
| 647 |
+
// we do not redirect if there's nothing saved in "redirect" input
|
| 648 |
+
if (empty($this->plugin_settings['general']['redirection'])) {
|
| 649 |
+
return NULL;
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
// we do not redirect ajax calls
|
| 653 |
+
if ((defined('DOING_AJAX') && DOING_AJAX)) {
|
| 654 |
+
return NULL;
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
// we do not redirect visitors or logged-in users that are not using /wp-admin/
|
| 658 |
+
if (!is_user_logged_in() || !is_admin()) {
|
| 659 |
+
return NULL;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
// we do not redirect users that have access to backend
|
| 663 |
+
if ($this->check_user_role()) {
|
| 664 |
+
return NULL;
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
$redirect_to = stripslashes($this->plugin_settings['general']['redirection']);
|
| 668 |
+
wp_redirect($redirect_to);
|
| 669 |
+
exit;
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
/**
|
| 673 |
+
* Save subscriber into database (refactor @ 2.0.4)
|
| 674 |
+
*
|
| 675 |
+
* @since 2.0.0
|
| 676 |
+
* @global object $wpdb
|
| 677 |
+
* @throws Exception
|
| 678 |
+
*/
|
| 679 |
+
public function add_subscriber() {
|
| 680 |
+
global $wpdb;
|
| 681 |
+
|
| 682 |
+
try {
|
| 683 |
+
$_POST = array_map('trim', $_POST);
|
| 684 |
+
|
| 685 |
+
// checks
|
| 686 |
+
if (empty($_POST['email']) || !is_email($_POST['email'])) {
|
| 687 |
+
throw new Exception(__('Please enter a valid email address.', $this->plugin_slug));
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
// save
|
| 691 |
+
$exists = $wpdb->get_row($wpdb->prepare("SELECT id_subscriber FROM {$wpdb->prefix}wpmm_subscribers WHERE email = %s", sanitize_text_field($_POST['email'])), ARRAY_A);
|
| 692 |
+
if (empty($exists)) {
|
| 693 |
+
$wpdb->insert($wpdb->prefix . 'wpmm_subscribers', array(
|
| 694 |
+
'email' => sanitize_text_field($_POST['email']),
|
| 695 |
+
'insert_date' => date('Y-m-d H:i:s')
|
| 696 |
+
), array('%s', '%s'));
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
wp_send_json_success(__('You successfully subscribed. Thanks!', $this->plugin_slug));
|
| 700 |
+
} catch (Exception $ex) {
|
| 701 |
+
wp_send_json_error($ex->getMessage());
|
| 702 |
+
}
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
/**
|
| 706 |
+
* Send email via contact form (refactor @ 2.0.4)
|
| 707 |
+
*
|
| 708 |
+
* @since 2.0.0
|
| 709 |
+
* @throws Exception
|
| 710 |
+
*/
|
| 711 |
+
public function send_contact() {
|
| 712 |
+
try {
|
| 713 |
+
$_POST = array_map('trim', $_POST);
|
| 714 |
+
|
| 715 |
+
// checks
|
| 716 |
+
if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['content'])) {
|
| 717 |
+
throw new Exception(__('All fields required.', $this->plugin_slug));
|
| 718 |
+
}
|
| 719 |
+
|
| 720 |
+
if (!is_email($_POST['email'])) {
|
| 721 |
+
throw new Exception(__('Please enter a valid email address.', $this->plugin_slug));
|
| 722 |
+
}
|
| 723 |
+
|
| 724 |
+
// vars
|
| 725 |
+
$send_to = !empty($this->plugin_settings['modules']['contact_email']) ? stripslashes($this->plugin_settings['modules']['contact_email']) : get_option('admin_email');
|
| 726 |
+
$subject = __('Message via contact', $this->plugin_slug);
|
| 727 |
+
$headers = array('Reply-To: ' . sanitize_text_field($_POST['email']));
|
| 728 |
+
ob_start();
|
| 729 |
+
include_once(WPMM_VIEWS_PATH . 'contact.php');
|
| 730 |
+
$message = ob_get_clean();
|
| 731 |
+
|
| 732 |
+
// filters
|
| 733 |
+
add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
|
| 734 |
+
add_filter('wp_mail_from_name', create_function('', 'return sanitize_text_field($_POST["name"]);'));
|
| 735 |
+
|
| 736 |
+
// send email
|
| 737 |
+
@wp_mail($send_to, $subject, $message, $headers);
|
| 738 |
+
wp_send_json_success(__('Your email was sent to the website administrator. Thanks!', $this->plugin_slug));
|
| 739 |
+
} catch (Exception $ex) {
|
| 740 |
+
wp_send_json_error($ex->getMessage());
|
| 741 |
+
}
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
}
|
| 745 |
+
|
| 746 |
Â
}
|
|
@@ -1,31 +1,90 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Get plugin info
|
| 5 |
-
*
|
| 6 |
-
* @
|
| 7 |
-
* @
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
-
*
|
| 21 |
-
*
|
| 22 |
-
* @
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
| 31 |
Â
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Get plugin info
|
| 5 |
+
*
|
| 6 |
+
* @since 2.0.0
|
| 7 |
+
* @param string $plugin_slug
|
| 8 |
+
* @return array
|
| 9 |
+
*/
|
| 10 |
+
function wpmm_plugin_info($plugin_slug) {
|
| 11 |
+
add_filter('extra_plugin_headers', create_function('', 'return array("GitHub Plugin URI","Twitter");'));
|
| 12 |
+
$plugin_data = get_plugin_data(WPMM_PATH . $plugin_slug . '.php');
|
| 13 |
+
|
| 14 |
+
return $plugin_data;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* Count db records using where
|
| 19 |
+
*
|
| 20 |
+
* EDIT: PHP Notice: wpdb::prepare was called <strong>incorrectly</strong>. The query argument of wpdb::prepare() must have a placeholder.
|
| 21 |
+
*
|
| 22 |
+
* @since 2.0.0
|
| 23 |
+
* @global object $wpdb
|
| 24 |
+
* @param string $table
|
| 25 |
+
* @param string $field
|
| 26 |
+
* @param array $where eg: array('id_subscriber = %d' => 12)
|
| 27 |
+
*/
|
| 28 |
+
function wpmm_count_where($table, $field = 'ID', $where = array()) {
|
| 29 |
+
global $wpdb;
|
| 30 |
+
|
| 31 |
+
$table = $wpdb->prefix . $table;
|
| 32 |
+
$where_keys = array_keys($where);
|
| 33 |
+
$where_values = array_values($where);
|
| 34 |
+
|
| 35 |
+
if (!empty($where)) {
|
| 36 |
+
$query = $wpdb->prepare("SELECT COUNT({$field}) FROM {$table} WHERE " . implode(' AND ', $where_keys), $where_values);
|
| 37 |
+
} else {
|
| 38 |
+
$query = "SELECT COUNT({$field}) FROM {$table}";
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
$count = $wpdb->get_var($query);
|
| 42 |
+
|
| 43 |
+
return intval($count);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* Outputs the html selected attribute
|
| 48 |
+
*
|
| 49 |
+
* @since 2.0.4
|
| 50 |
+
* @param array $values
|
| 51 |
+
* @param string $current
|
| 52 |
+
* @param bool $echo
|
| 53 |
+
* @return string html attribute or empty string
|
| 54 |
+
*/
|
| 55 |
+
function wpmm_multiselect($values, $current) {
|
| 56 |
+
foreach ($values as $k => $role) {
|
| 57 |
+
$is_selected = __checked_selected_helper($role, $current, false, 'selected');
|
| 58 |
+
if (!empty($is_selected)) {
|
| 59 |
+
return $is_selected;
|
| 60 |
+
break;
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* Get banners list from Maintenance Mode API
|
| 67 |
+
*
|
| 68 |
+
* @since 2.0.4
|
| 69 |
+
* @return array
|
| 70 |
+
*/
|
| 71 |
+
function wpmm_get_banners() {
|
| 72 |
+
if (false === ($banners = get_transient('wpmm_banners_list'))) {
|
| 73 |
+
$response = wp_remote_get('http://maintenancemode.co/wp-json/wpmm/v1/banners', array(
|
| 74 |
+
'timeout' => 10
|
| 75 |
+
));
|
| 76 |
+
|
| 77 |
+
$banners = array();
|
| 78 |
+
$items = json_decode(wp_remote_retrieve_body($response), true);
|
| 79 |
+
|
| 80 |
+
if (!empty($items) && is_array($items)) {
|
| 81 |
+
foreach ($items as $item) {
|
| 82 |
+
$banners[$item['type']][] = $item;
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
set_transient('wpmm_banners_list', $banners, 3 * HOUR_IN_SECONDS);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
return $banners;
|
| 90 |
Â
}
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
// Silence is golden.
|
| 1 |
+
<?php
|
| 2 |
+
// Silence is golden.
|
|
Binary file
|
|
@@ -1,459 +1,532 @@
|
|
| 1 |
-
msgid ""
|
| 2 |
-
msgstr ""
|
| 3 |
-
"Project-Id-Version: WP Maintenance Mode 2.0.
|
| 4 |
-
"POT-Creation-Date:
|
| 5 |
-
"PO-Revision-Date:
|
| 6 |
-
"Last-Translator:
|
| 7 |
-
"Language-Team: Designmodo <info@designmodo.com>\n"
|
| 8 |
-
"Language:
|
| 9 |
-
"MIME-Version: 1.0\n"
|
| 10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
-
"X-Generator: Poedit 1.
|
| 13 |
-
"X-Poedit-
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"X-Poedit-
|
| 19 |
-
"
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
#: includes/classes/wp-maintenance-mode-admin.php:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
"
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 40 |
-
msgid "
|
| 41 |
-
msgstr "
|
| 42 |
-
|
| 43 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 44 |
-
msgid ""
|
| 45 |
-
"
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
"
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
"
|
| 62 |
-
"
|
| 63 |
-
|
| 64 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 65 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 66 |
-
msgid "Maintenance
|
| 67 |
-
msgstr "Wartungsmodus"
|
| 68 |
-
|
| 69 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
msgstr "
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
#: views/maintenance.php:
|
| 95 |
-
msgid "
|
| 96 |
-
msgstr "
|
| 97 |
-
|
| 98 |
-
#:
|
| 99 |
-
msgid "
|
| 100 |
-
msgstr "
|
| 101 |
-
|
| 102 |
-
#:
|
| 103 |
-
msgid "
|
| 104 |
-
msgstr "
|
| 105 |
-
|
| 106 |
-
#:
|
| 107 |
-
msgid "
|
| 108 |
-
msgstr "
|
| 109 |
-
|
| 110 |
-
#:
|
| 111 |
-
msgid "Your
|
| 112 |
-
msgstr "Deine
|
| 113 |
-
|
| 114 |
-
#: views/
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
#: views/
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
"
|
| 201 |
-
"
|
| 202 |
-
|
| 203 |
-
#: views/settings.php:
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
#: views/settings.php:
|
| 216 |
-
msgid "
|
| 217 |
-
msgstr "
|
| 218 |
-
|
| 219 |
-
#: views/settings.php:
|
| 220 |
-
msgid ""
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
"
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
#: views/settings.php:
|
| 228 |
-
msgid "
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
#: views/settings.php:
|
| 257 |
-
msgid "
|
| 258 |
-
msgstr "
|
| 259 |
-
|
| 260 |
-
#: views/settings.php:
|
| 261 |
-
msgid "
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
msgstr "
|
| 295 |
-
|
| 296 |
-
#: views/settings.php:
|
| 297 |
-
msgid "
|
| 298 |
-
msgstr "
|
| 299 |
-
|
| 300 |
-
#: views/settings.php:
|
| 301 |
-
msgid "
|
| 302 |
-
msgstr "
|
| 303 |
-
|
| 304 |
-
#: views/settings.php:
|
| 305 |
-
msgid "
|
| 306 |
-
msgstr "
|
| 307 |
-
|
| 308 |
-
#: views/settings.php:
|
| 309 |
-
msgid "
|
| 310 |
-
msgstr "
|
| 311 |
-
|
| 312 |
-
#: views/settings.php:
|
| 313 |
-
msgid "
|
| 314 |
-
msgstr "
|
| 315 |
-
|
| 316 |
-
#: views/settings.php:
|
| 317 |
-
msgid "
|
| 318 |
-
msgstr "
|
| 319 |
-
|
| 320 |
-
#: views/settings.php:
|
| 321 |
-
msgid "
|
| 322 |
-
msgstr "
|
| 323 |
-
|
| 324 |
-
#: views/settings.php:
|
| 325 |
-
msgid "
|
| 326 |
-
msgstr "
|
| 327 |
-
|
| 328 |
-
#: views/settings.php:
|
| 329 |
-
msgid "
|
| 330 |
-
msgstr "
|
| 331 |
-
|
| 332 |
-
#: views/settings.php:
|
| 333 |
-
msgid "
|
| 334 |
-
msgstr "
|
| 335 |
-
|
| 336 |
-
#: views/settings.php:
|
| 337 |
-
msgid "
|
| 338 |
-
msgstr "
|
| 339 |
-
|
| 340 |
-
#: views/settings.php:
|
| 341 |
-
msgid "
|
| 342 |
-
msgstr "
|
| 343 |
-
|
| 344 |
-
#: views/settings.php:
|
| 345 |
-
msgid "
|
| 346 |
-
msgstr "
|
| 347 |
-
|
| 348 |
-
#: views/settings.php:
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
msgid "
|
| 359 |
-
msgstr "
|
| 360 |
-
|
| 361 |
-
#: views/settings.php:
|
| 362 |
-
msgid "
|
| 363 |
-
msgstr "
|
| 364 |
-
|
| 365 |
-
#: views/settings.php:
|
| 366 |
-
msgid "
|
| 367 |
-
msgstr ""
|
| 368 |
-
|
| 369 |
-
#: views/settings.php:
|
| 370 |
-
msgid "
|
| 371 |
-
msgstr ""
|
| 372 |
-
|
| 373 |
-
#: views/settings.php:
|
| 374 |
-
msgid "
|
| 375 |
-
msgstr ""
|
| 376 |
-
|
| 377 |
-
#: views/settings.php:
|
| 378 |
-
msgid "
|
| 379 |
-
msgstr ""
|
| 380 |
-
|
| 381 |
-
#: views/settings.php:
|
| 382 |
-
msgid "
|
| 383 |
-
msgstr "
|
| 384 |
-
|
| 385 |
-
#: views/settings.php:
|
| 386 |
-
msgid "
|
| 387 |
-
msgstr "
|
| 388 |
-
|
| 389 |
-
#: views/settings.php:
|
| 390 |
-
msgid "
|
| 391 |
-
msgstr "
|
| 392 |
-
|
| 393 |
-
#: views/settings.php:
|
| 394 |
-
msgid "
|
| 395 |
-
msgstr "
|
| 396 |
-
|
| 397 |
-
#: views/settings.php:
|
| 398 |
-
msgid "
|
| 399 |
-
msgstr "
|
| 400 |
-
|
| 401 |
-
#: views/settings.php:
|
| 402 |
-
msgid "
|
| 403 |
-
msgstr "
|
| 404 |
-
|
| 405 |
-
#: views/settings.php:
|
| 406 |
-
msgid "
|
| 407 |
-
msgstr "
|
| 408 |
-
|
| 409 |
-
#: views/settings.php:
|
| 410 |
-
msgid "
|
| 411 |
-
msgstr ""
|
| 412 |
-
|
| 413 |
-
#: views/settings.php:
|
| 414 |
-
msgid "
|
| 415 |
-
msgstr ""
|
| 416 |
-
|
| 417 |
-
#: views/settings.php:
|
| 418 |
-
msgid "
|
| 419 |
-
msgstr ""
|
| 420 |
-
|
| 421 |
-
#: views/
|
| 422 |
-
msgid "
|
| 423 |
-
msgstr "
|
| 424 |
-
|
| 425 |
-
#: views/
|
| 426 |
-
msgid "
|
| 427 |
-
msgstr "
|
| 428 |
-
|
| 429 |
-
#: views/
|
| 430 |
-
msgid "
|
| 431 |
-
msgstr "
|
| 432 |
-
|
| 433 |
-
#: views/
|
| 434 |
-
msgid "
|
| 435 |
-
msgstr "
|
| 436 |
-
|
| 437 |
-
#: views/
|
| 438 |
-
msgid "
|
| 439 |
-
msgstr "
|
| 440 |
-
|
| 441 |
-
#: views/
|
| 442 |
-
msgid "
|
| 443 |
-
msgstr ""
|
| 444 |
-
|
| 445 |
-
#: views/
|
| 446 |
-
msgid "
|
| 447 |
-
msgstr "
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: WP Maintenance Mode 2.0.4\n"
|
| 4 |
+
"POT-Creation-Date: 2016-06-17 03:11+0300\n"
|
| 5 |
+
"PO-Revision-Date: \n"
|
| 6 |
+
"Last-Translator: \n"
|
| 7 |
+
"Language-Team: Designmodo <info@designmodo.com>\n"
|
| 8 |
+
"Language: de\n"
|
| 9 |
+
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"X-Generator: Poedit 1.8.8\n"
|
| 13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
| 14 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
| 15 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
|
| 16 |
+
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;"
|
| 17 |
+
"esc_html_x:1,2c\n"
|
| 18 |
+
"X-Poedit-Basepath: ..\n"
|
| 19 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
| 20 |
+
"X-Poedit-SearchPath-0: includes/classes\n"
|
| 21 |
+
"X-Poedit-SearchPath-1: views\n"
|
| 22 |
+
"X-Poedit-SearchPath-2: .\n"
|
| 23 |
+
|
| 24 |
+
#: includes/classes/wp-maintenance-mode-admin.php:121
|
| 25 |
+
#: includes/classes/wp-maintenance-mode-admin.php:159
|
| 26 |
+
#: includes/classes/wp-maintenance-mode-admin.php:181
|
| 27 |
+
msgid "You do not have access to this resource."
|
| 28 |
+
msgstr ""
|
| 29 |
+
|
| 30 |
+
#: includes/classes/wp-maintenance-mode-admin.php:165 views/settings.php:295
|
| 31 |
+
#, php-format
|
| 32 |
+
msgid "You have %d subscriber(s)"
|
| 33 |
+
msgstr "Du hast %d Abonnenten"
|
| 34 |
+
|
| 35 |
+
#: includes/classes/wp-maintenance-mode-admin.php:186
|
| 36 |
+
msgid "The tab slug must not be empty."
|
| 37 |
+
msgstr ""
|
| 38 |
+
|
| 39 |
+
#: includes/classes/wp-maintenance-mode-admin.php:191
|
| 40 |
+
msgid "The tab slug must exist."
|
| 41 |
+
msgstr ""
|
| 42 |
+
|
| 43 |
+
#: includes/classes/wp-maintenance-mode-admin.php:211
|
| 44 |
+
msgid "WP Maintenance Mode"
|
| 45 |
+
msgstr "WP Wartungsmodus"
|
| 46 |
+
|
| 47 |
+
#: includes/classes/wp-maintenance-mode-admin.php:425
|
| 48 |
+
msgid "Settings"
|
| 49 |
+
msgstr "Einstellungen"
|
| 50 |
+
|
| 51 |
+
#: includes/classes/wp-maintenance-mode-admin.php:444
|
| 52 |
+
#, php-format
|
| 53 |
+
msgid ""
|
| 54 |
+
"The Maintenance Mode is <strong>active</strong>. Please don't forget to <a "
|
| 55 |
+
"href=\"%s\">deactivate</a> as soon as you are done."
|
| 56 |
+
msgstr ""
|
| 57 |
+
"Der Wartungsmodus ist <strong>aktiv</strong>. Bitte vergiss nicht ihn zu <a "
|
| 58 |
+
"href=\"%s\">deaktivieren</a>, wenn er nicht mehr benötigt wird."
|
| 59 |
+
|
| 60 |
+
#: includes/classes/wp-maintenance-mode-admin.php:481
|
| 61 |
+
msgid "Notice key cannot be empty."
|
| 62 |
+
msgstr ""
|
| 63 |
+
|
| 64 |
+
#: includes/classes/wp-maintenance-mode.php:103
|
| 65 |
+
#: includes/classes/wp-maintenance-mode.php:104
|
| 66 |
+
msgid "Maintenance mode"
|
| 67 |
+
msgstr "Wartungsmodus"
|
| 68 |
+
|
| 69 |
+
#: includes/classes/wp-maintenance-mode.php:106
|
| 70 |
+
msgid ""
|
| 71 |
+
"<p>Sorry for the inconvenience.<br />Our website is currently undergoing "
|
| 72 |
+
"scheduled maintenance.<br />Thank you for your understanding.</p>"
|
| 73 |
+
msgstr ""
|
| 74 |
+
|
| 75 |
+
#: includes/classes/wp-maintenance-mode.php:124
|
| 76 |
+
msgid "Notify me when it's ready"
|
| 77 |
+
msgstr "Informiere mich, wenn die Arbeiten abgeschlossen sind."
|
| 78 |
+
|
| 79 |
+
#: includes/classes/wp-maintenance-mode.php:259
|
| 80 |
+
#, php-format
|
| 81 |
+
msgid ""
|
| 82 |
+
"WP Maintenance Mode plugin was relaunched and you MUST revise <a href=\"%s"
|
| 83 |
+
"\">settings</a>."
|
| 84 |
+
msgstr ""
|
| 85 |
+
"Das WP Wartungsmodus Plugin wurde neu erstellt und du MUSST die <a href=\"%s"
|
| 86 |
+
"\"></a> Einstellungen bearbeiten."
|
| 87 |
+
|
| 88 |
+
#: includes/classes/wp-maintenance-mode.php:449
|
| 89 |
+
#: includes/classes/wp-maintenance-mode.php:463
|
| 90 |
+
msgid "Maintenance Mode"
|
| 91 |
+
msgstr "Wartungsmodus"
|
| 92 |
+
|
| 93 |
+
#: includes/classes/wp-maintenance-mode.php:687
|
| 94 |
+
#: includes/classes/wp-maintenance-mode.php:721 views/maintenance.php:85
|
| 95 |
+
msgid "Please enter a valid email address."
|
| 96 |
+
msgstr "Bitte gib eine gültige E-Mail-Adresse an."
|
| 97 |
+
|
| 98 |
+
#: includes/classes/wp-maintenance-mode.php:699
|
| 99 |
+
msgid "You successfully subscribed. Thanks!"
|
| 100 |
+
msgstr ""
|
| 101 |
+
|
| 102 |
+
#: includes/classes/wp-maintenance-mode.php:717
|
| 103 |
+
msgid "All fields required."
|
| 104 |
+
msgstr "Alle Felder sind notwendig."
|
| 105 |
+
|
| 106 |
+
#: includes/classes/wp-maintenance-mode.php:726
|
| 107 |
+
msgid "Message via contact"
|
| 108 |
+
msgstr "Mitteilung via Kontakt"
|
| 109 |
+
|
| 110 |
+
#: includes/classes/wp-maintenance-mode.php:738
|
| 111 |
+
msgid "Your email was sent to the website administrator. Thanks!"
|
| 112 |
+
msgstr "Deine E-Mail wurde an den Administrator der Website gesendet. Danke!"
|
| 113 |
+
|
| 114 |
+
#: views/contact.php:34
|
| 115 |
+
#, php-format
|
| 116 |
+
msgid "You have been contacted via %s."
|
| 117 |
+
msgstr ""
|
| 118 |
+
|
| 119 |
+
#: views/contact.php:50
|
| 120 |
+
msgid "Name:"
|
| 121 |
+
msgstr ""
|
| 122 |
+
|
| 123 |
+
#: views/contact.php:62
|
| 124 |
+
msgid "Email:"
|
| 125 |
+
msgstr ""
|
| 126 |
+
|
| 127 |
+
#: views/contact.php:74
|
| 128 |
+
msgid "Content:"
|
| 129 |
+
msgstr ""
|
| 130 |
+
|
| 131 |
+
#: views/loginform.php:8
|
| 132 |
+
msgid "Login"
|
| 133 |
+
msgstr ""
|
| 134 |
+
|
| 135 |
+
#: views/maintenance.php:42
|
| 136 |
+
msgid "your e-mail..."
|
| 137 |
+
msgstr "deine E-Mail..."
|
| 138 |
+
|
| 139 |
+
#: views/maintenance.php:43 views/settings.php:270
|
| 140 |
+
msgid "Subscribe"
|
| 141 |
+
msgstr "Abonniere"
|
| 142 |
+
|
| 143 |
+
#: views/maintenance.php:84 views/sidebar.php:7
|
| 144 |
+
msgid "Name"
|
| 145 |
+
msgstr "Name"
|
| 146 |
+
|
| 147 |
+
#: views/maintenance.php:84 views/maintenance.php:85 views/maintenance.php:87
|
| 148 |
+
msgid "This field is required."
|
| 149 |
+
msgstr ""
|
| 150 |
+
|
| 151 |
+
#: views/maintenance.php:85
|
| 152 |
+
msgid "E-mail"
|
| 153 |
+
msgstr "E-Mail"
|
| 154 |
+
|
| 155 |
+
#: views/maintenance.php:87
|
| 156 |
+
msgid "Your message"
|
| 157 |
+
msgstr "Deine Mitteilung"
|
| 158 |
+
|
| 159 |
+
#: views/maintenance.php:88
|
| 160 |
+
msgid "Send"
|
| 161 |
+
msgstr "Senden"
|
| 162 |
+
|
| 163 |
+
#: views/maintenance.php:93
|
| 164 |
+
msgid "Contact us"
|
| 165 |
+
msgstr "Kontaktiere uns"
|
| 166 |
+
|
| 167 |
+
#: views/maintenance.php:98
|
| 168 |
+
msgid "Dashboard"
|
| 169 |
+
msgstr ""
|
| 170 |
+
|
| 171 |
+
#: views/settings.php:6
|
| 172 |
+
msgid "Settings saved."
|
| 173 |
+
msgstr "Einstellungen gespeichert."
|
| 174 |
+
|
| 175 |
+
#: views/settings.php:13
|
| 176 |
+
msgid "General"
|
| 177 |
+
msgstr "Allgemein"
|
| 178 |
+
|
| 179 |
+
#: views/settings.php:14
|
| 180 |
+
msgid "Design"
|
| 181 |
+
msgstr "Design"
|
| 182 |
+
|
| 183 |
+
#: views/settings.php:15
|
| 184 |
+
msgid "Modules"
|
| 185 |
+
msgstr "Module"
|
| 186 |
+
|
| 187 |
+
#: views/settings.php:24
|
| 188 |
+
msgid "Status"
|
| 189 |
+
msgstr "Status"
|
| 190 |
+
|
| 191 |
+
#: views/settings.php:26
|
| 192 |
+
msgid "Activated"
|
| 193 |
+
msgstr "Aktiv"
|
| 194 |
+
|
| 195 |
+
#: views/settings.php:27
|
| 196 |
+
msgid "Deactivated"
|
| 197 |
+
msgstr "Inaktiv"
|
| 198 |
+
|
| 199 |
+
#: views/settings.php:31
|
| 200 |
+
msgid "Bypass for Search Bots"
|
| 201 |
+
msgstr "Bypass für Such-Bots"
|
| 202 |
+
|
| 203 |
+
#: views/settings.php:34 views/settings.php:104 views/settings.php:114
|
| 204 |
+
#: views/settings.php:242 views/settings.php:278 views/settings.php:316
|
| 205 |
+
#: views/settings.php:384 views/settings.php:416
|
| 206 |
+
msgid "Yes"
|
| 207 |
+
msgstr "Ja"
|
| 208 |
+
|
| 209 |
+
#: views/settings.php:35 views/settings.php:105 views/settings.php:115
|
| 210 |
+
#: views/settings.php:243 views/settings.php:279 views/settings.php:317
|
| 211 |
+
#: views/settings.php:385 views/settings.php:417
|
| 212 |
+
msgid "No"
|
| 213 |
+
msgstr "Nein"
|
| 214 |
+
|
| 215 |
+
#: views/settings.php:37
|
| 216 |
+
msgid "Allow Search Bots to bypass maintenance mode?"
|
| 217 |
+
msgstr "Erlaube Such-Bots den Zugang via Bypass?"
|
| 218 |
+
|
| 219 |
+
#: views/settings.php:41
|
| 220 |
+
msgid "Backend Role"
|
| 221 |
+
msgstr "Backend-Rolle"
|
| 222 |
+
|
| 223 |
+
#: views/settings.php:43 views/settings.php:59
|
| 224 |
+
msgid "Select role(s)"
|
| 225 |
+
msgstr ""
|
| 226 |
+
|
| 227 |
+
#: views/settings.php:53
|
| 228 |
+
msgid ""
|
| 229 |
+
"Which user role is allowed to access the backend of this blog? "
|
| 230 |
+
"Administrators will always have access."
|
| 231 |
+
msgstr ""
|
| 232 |
+
|
| 233 |
+
#: views/settings.php:57
|
| 234 |
+
msgid "Frontend Role"
|
| 235 |
+
msgstr "Frontend-Rolle"
|
| 236 |
+
|
| 237 |
+
#: views/settings.php:69
|
| 238 |
+
msgid ""
|
| 239 |
+
"Which user role is allowed to access the frontend of this blog? "
|
| 240 |
+
"Administrators will always have access."
|
| 241 |
+
msgstr ""
|
| 242 |
+
|
| 243 |
+
#: views/settings.php:73
|
| 244 |
+
msgid "Robots Meta Tag"
|
| 245 |
+
msgstr "Robots Meta Tag"
|
| 246 |
+
|
| 247 |
+
#: views/settings.php:79
|
| 248 |
+
msgid ""
|
| 249 |
+
"The robots meta tag lets you use a granular, page-specific approach to "
|
| 250 |
+
"control how an individual page should be indexed and served to users in "
|
| 251 |
+
"search results."
|
| 252 |
+
msgstr ""
|
| 253 |
+
"Mit dem Robots Meta Tag kannst du steuern, wie die Seite während des "
|
| 254 |
+
"Wartungsmodus indiziert werden soll."
|
| 255 |
+
|
| 256 |
+
#: views/settings.php:83
|
| 257 |
+
msgid "Redirection"
|
| 258 |
+
msgstr "Weiterleitung"
|
| 259 |
+
|
| 260 |
+
#: views/settings.php:86
|
| 261 |
+
msgid ""
|
| 262 |
+
"If you want to redirect a user (with no access to Dashboard/Backend) to a "
|
| 263 |
+
"URL (different from WordPress Dashboard URL) after login, then define a URL "
|
| 264 |
+
"(incl. http://)"
|
| 265 |
+
msgstr ""
|
| 266 |
+
|
| 267 |
+
#: views/settings.php:90
|
| 268 |
+
msgid "Exclude"
|
| 269 |
+
msgstr "Ausschluss"
|
| 270 |
+
|
| 271 |
+
#: views/settings.php:97
|
| 272 |
+
msgid ""
|
| 273 |
+
"Exclude feed, pages, archives or IPs from maintenance mode. Add one slug / "
|
| 274 |
+
"IP per line!"
|
| 275 |
+
msgstr ""
|
| 276 |
+
"Ausschluss vom Wartungsmodus von Feed, Seiten, Archiven oder IPs möglich. "
|
| 277 |
+
"Ergänze einen Slug oder die IP pro Zeile."
|
| 278 |
+
|
| 279 |
+
#: views/settings.php:101
|
| 280 |
+
msgid "Notice"
|
| 281 |
+
msgstr "Hinweis"
|
| 282 |
+
|
| 283 |
+
#: views/settings.php:107
|
| 284 |
+
msgid "Do you want to see notices when maintenance mode is activated?"
|
| 285 |
+
msgstr "Willst du den Hinweis sehen, wenn der Wartungsmodus aktiv ist?"
|
| 286 |
+
|
| 287 |
+
#: views/settings.php:111
|
| 288 |
+
msgid "Dashboard link"
|
| 289 |
+
msgstr ""
|
| 290 |
+
|
| 291 |
+
#: views/settings.php:117
|
| 292 |
+
msgid ""
|
| 293 |
+
"Do you want to add a link to the dashboard on your maintenance mode page?"
|
| 294 |
+
msgstr "Soll ein Link zum Backend auf der Wartungswebseite angezeigt werden?"
|
| 295 |
+
|
| 296 |
+
#: views/settings.php:125 views/settings.php:228 views/settings.php:432
|
| 297 |
+
msgid "Save settings"
|
| 298 |
+
msgstr "Einstellungen speichern"
|
| 299 |
+
|
| 300 |
+
#: views/settings.php:126 views/settings.php:229 views/settings.php:433
|
| 301 |
+
msgid "Reset settings"
|
| 302 |
+
msgstr "Einstellungen zurücksetzen"
|
| 303 |
+
|
| 304 |
+
#: views/settings.php:131
|
| 305 |
+
msgid "Content"
|
| 306 |
+
msgstr "Inhalt"
|
| 307 |
+
|
| 308 |
+
#: views/settings.php:136
|
| 309 |
+
msgid "Title (HTML tag)"
|
| 310 |
+
msgstr "Titel (html Tag)"
|
| 311 |
+
|
| 312 |
+
#: views/settings.php:142
|
| 313 |
+
msgid "Heading"
|
| 314 |
+
msgstr "Überschrift"
|
| 315 |
+
|
| 316 |
+
#: views/settings.php:149 views/settings.php:284
|
| 317 |
+
msgid "Text"
|
| 318 |
+
msgstr "Text"
|
| 319 |
+
|
| 320 |
+
#: views/settings.php:169
|
| 321 |
+
msgid "Background"
|
| 322 |
+
msgstr "Hintergrund"
|
| 323 |
+
|
| 324 |
+
#: views/settings.php:174
|
| 325 |
+
msgid "Choose type"
|
| 326 |
+
msgstr "Type wählen"
|
| 327 |
+
|
| 328 |
+
#: views/settings.php:177
|
| 329 |
+
msgid "Custom color"
|
| 330 |
+
msgstr "Benutzerdefinierte Farbe"
|
| 331 |
+
|
| 332 |
+
#: views/settings.php:178
|
| 333 |
+
msgid "Uploaded background"
|
| 334 |
+
msgstr "Hochgeladene Hintergründe"
|
| 335 |
+
|
| 336 |
+
#: views/settings.php:179
|
| 337 |
+
msgid "Predefined background"
|
| 338 |
+
msgstr "Vordefinierte Hintergründe"
|
| 339 |
+
|
| 340 |
+
#: views/settings.php:184
|
| 341 |
+
msgid "Choose color"
|
| 342 |
+
msgstr "Farbe wählen"
|
| 343 |
+
|
| 344 |
+
#: views/settings.php:190
|
| 345 |
+
msgid "Upload background"
|
| 346 |
+
msgstr "Hintergrund laden"
|
| 347 |
+
|
| 348 |
+
#: views/settings.php:194
|
| 349 |
+
msgid "Backgrounds should have 1920x1280 px size."
|
| 350 |
+
msgstr "Hintergründe sollten eine Größe von 1920x1280 px haben."
|
| 351 |
+
|
| 352 |
+
#: views/settings.php:199
|
| 353 |
+
msgid "Choose background"
|
| 354 |
+
msgstr "Hintergrund wählen"
|
| 355 |
+
|
| 356 |
+
#: views/settings.php:201
|
| 357 |
+
#, php-format
|
| 358 |
+
msgid "source <a href=\"%s\" target=\"_blank\">Free Photos</a>"
|
| 359 |
+
msgstr ""
|
| 360 |
+
|
| 361 |
+
#: views/settings.php:234
|
| 362 |
+
msgid "Countdown"
|
| 363 |
+
msgstr "Countdown"
|
| 364 |
+
|
| 365 |
+
#: views/settings.php:239
|
| 366 |
+
msgid "Show countdown?"
|
| 367 |
+
msgstr "Zeige Countdown?"
|
| 368 |
+
|
| 369 |
+
#: views/settings.php:248
|
| 370 |
+
msgid "Start date"
|
| 371 |
+
msgstr "Start-Datum"
|
| 372 |
+
|
| 373 |
+
#: views/settings.php:254
|
| 374 |
+
msgid "Countdown (remaining time)"
|
| 375 |
+
msgstr "Countdown (Restzeit)"
|
| 376 |
+
|
| 377 |
+
#: views/settings.php:256
|
| 378 |
+
msgid "Days"
|
| 379 |
+
msgstr "Tage"
|
| 380 |
+
|
| 381 |
+
#: views/settings.php:257
|
| 382 |
+
msgid "Hours"
|
| 383 |
+
msgstr "Stunden"
|
| 384 |
+
|
| 385 |
+
#: views/settings.php:258
|
| 386 |
+
msgid "Minutes"
|
| 387 |
+
msgstr "Minuten"
|
| 388 |
+
|
| 389 |
+
#: views/settings.php:262
|
| 390 |
+
msgid "Color"
|
| 391 |
+
msgstr "Farbe"
|
| 392 |
+
|
| 393 |
+
#: views/settings.php:275
|
| 394 |
+
msgid "Show subscribe?"
|
| 395 |
+
msgstr "Zeige Abonnenten?"
|
| 396 |
+
|
| 397 |
+
#: views/settings.php:291
|
| 398 |
+
msgid "Stats"
|
| 399 |
+
msgstr "Statistik"
|
| 400 |
+
|
| 401 |
+
#: views/settings.php:300
|
| 402 |
+
msgid "Export as CSV"
|
| 403 |
+
msgstr "Export als CSV"
|
| 404 |
+
|
| 405 |
+
#: views/settings.php:301
|
| 406 |
+
msgid "Empty subscribers list"
|
| 407 |
+
msgstr ""
|
| 408 |
+
|
| 409 |
+
#: views/settings.php:308
|
| 410 |
+
msgid "Social Networks"
|
| 411 |
+
msgstr "Soziale Netzwerke"
|
| 412 |
+
|
| 413 |
+
#: views/settings.php:313
|
| 414 |
+
msgid "Show social networks?"
|
| 415 |
+
msgstr "Zeige soziale Netzwerke?"
|
| 416 |
+
|
| 417 |
+
#: views/settings.php:322
|
| 418 |
+
msgid "Links target?"
|
| 419 |
+
msgstr "Link-Ziel"
|
| 420 |
+
|
| 421 |
+
#: views/settings.php:325
|
| 422 |
+
msgid "New page"
|
| 423 |
+
msgstr "Neue Seite"
|
| 424 |
+
|
| 425 |
+
#: views/settings.php:326
|
| 426 |
+
msgid "Same page"
|
| 427 |
+
msgstr "Selbe Seite"
|
| 428 |
+
|
| 429 |
+
#: views/settings.php:328
|
| 430 |
+
msgid "Choose how the links will open."
|
| 431 |
+
msgstr "Wie soll der Link geöffnet werden?"
|
| 432 |
+
|
| 433 |
+
#: views/settings.php:376
|
| 434 |
+
msgid "Contact"
|
| 435 |
+
msgstr "Kontakt"
|
| 436 |
+
|
| 437 |
+
#: views/settings.php:381
|
| 438 |
+
msgid "Show contact?"
|
| 439 |
+
msgstr "Zeige Kontakt?"
|
| 440 |
+
|
| 441 |
+
#: views/settings.php:390
|
| 442 |
+
msgid "Email address"
|
| 443 |
+
msgstr "E-Mail-Adresse"
|
| 444 |
+
|
| 445 |
+
#: views/settings.php:396
|
| 446 |
+
msgid "Effects"
|
| 447 |
+
msgstr "Effekte"
|
| 448 |
+
|
| 449 |
+
#: views/settings.php:399
|
| 450 |
+
msgid "Move top - Move bottom"
|
| 451 |
+
msgstr "Bewegung nach oben - nach untern"
|
| 452 |
+
|
| 453 |
+
#: views/settings.php:400
|
| 454 |
+
msgid "Zoom - Zoomed"
|
| 455 |
+
msgstr "Zoom - Vergrößern"
|
| 456 |
+
|
| 457 |
+
#: views/settings.php:401
|
| 458 |
+
msgid "Fold - Unfold"
|
| 459 |
+
msgstr "Falten - Klappen"
|
| 460 |
+
|
| 461 |
+
#: views/settings.php:408
|
| 462 |
+
msgid "Google Analytics"
|
| 463 |
+
msgstr "Google Analytics"
|
| 464 |
+
|
| 465 |
+
#: views/settings.php:413
|
| 466 |
+
msgid "Use Google Analytics?"
|
| 467 |
+
msgstr "Wird Google Analytics verwendet?"
|
| 468 |
+
|
| 469 |
+
#: views/settings.php:422
|
| 470 |
+
msgid "Tracking code"
|
| 471 |
+
msgstr ""
|
| 472 |
+
|
| 473 |
+
#: views/sidebar.php:3
|
| 474 |
+
msgid "Plugin Info"
|
| 475 |
+
msgstr "Plugin Info"
|
| 476 |
+
|
| 477 |
+
#: views/sidebar.php:13
|
| 478 |
+
msgid "Author"
|
| 479 |
+
msgstr "Autor"
|
| 480 |
+
|
| 481 |
+
#: views/sidebar.php:14
|
| 482 |
+
msgid "Website"
|
| 483 |
+
msgstr "Webseite"
|
| 484 |
+
|
| 485 |
+
#: views/sidebar.php:15
|
| 486 |
+
msgid "Twitter"
|
| 487 |
+
msgstr "Twitter"
|
| 488 |
+
|
| 489 |
+
#: views/sidebar.php:16
|
| 490 |
+
msgid "GitHub"
|
| 491 |
+
msgstr "GitHub"
|
| 492 |
+
|
| 493 |
+
#: views/sidebar.php:27
|
| 494 |
+
msgid "Other products"
|
| 495 |
+
msgstr ""
|
| 496 |
+
|
| 497 |
+
#: views/sidebar.php:44
|
| 498 |
+
msgid "Resources"
|
| 499 |
+
msgstr "Ressourcen"
|
| 500 |
+
|
| 501 |
+
#~ msgid "You successfuly subscribed. Thanks!"
|
| 502 |
+
#~ msgstr "Erfolgreich abonniert, Danke!"
|
| 503 |
+
|
| 504 |
+
#~ msgid "Which user role is allowed to access the backend of this blog?"
|
| 505 |
+
#~ msgstr ""
|
| 506 |
+
#~ "Mit welcher Rolle soll man Zugang zum Backend der Webseite erhalten?"
|
| 507 |
+
|
| 508 |
+
#~ msgid "Which user role is allowed to access the frontend of this blog?"
|
| 509 |
+
#~ msgstr ""
|
| 510 |
+
#~ "Mit welcher Rolle soll man Zugang zum Frontend der Webseite erhalten?"
|
| 511 |
+
|
| 512 |
+
#~ msgid ""
|
| 513 |
+
#~ "If you want to redirect a user to a URL (which is not the WordPress "
|
| 514 |
+
#~ "dashboard) after login, then define a URL (incl. http://)"
|
| 515 |
+
#~ msgstr ""
|
| 516 |
+
#~ "Willst du eine Weiterleitung nach dem Login zu einer URL, dann definiere "
|
| 517 |
+
#~ "eine URL (inkl. http://)?"
|
| 518 |
+
|
| 519 |
+
#~ msgid "source <a href=\"%\" target=\"_blank\">Free Photos</a>"
|
| 520 |
+
#~ msgstr "Quelle <a href=\"%\" target=\"_blank\">Free Photos</a>"
|
| 521 |
+
|
| 522 |
+
#~ msgid "Subscribe now for early access to new WordPress themes."
|
| 523 |
+
#~ msgstr "Abonniere jetzt für frühen Zugang zu neuen WordPress Themes."
|
| 524 |
+
|
| 525 |
+
#~ msgid "Enter your email address"
|
| 526 |
+
#~ msgstr "Gib deine E-Mail-Adresse an"
|
| 527 |
+
|
| 528 |
+
#~ msgid "News"
|
| 529 |
+
#~ msgstr "News"
|
| 530 |
+
|
| 531 |
+
#~ msgid "Developed by <a href=\"%s\">Designmodo</a>"
|
| 532 |
+
#~ msgstr "Entwickelt durch <a href=\"%s\">Designmodo</a>"
|
|
Binary file
|
|
@@ -1,435 +1,491 @@
|
|
| 1 |
-
msgid ""
|
| 2 |
-
msgstr ""
|
| 3 |
-
"Project-Id-Version: WP Maintenance Mode 2.0.
|
| 4 |
-
"POT-Creation-Date:
|
| 5 |
-
"PO-Revision-Date:
|
| 6 |
-
"Last-Translator:
|
| 7 |
-
"Language-Team: Designmodo <info@designmodo.com>\n"
|
| 8 |
-
"Language: en\n"
|
| 9 |
-
"MIME-Version: 1.0\n"
|
| 10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
-
"X-Generator: Poedit 1.
|
| 13 |
-
"X-Poedit-Basepath:
|
| 14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
| 15 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
| 16 |
-
"X-Poedit-KeywordsList: __;_e
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
#: includes/classes/wp-maintenance-mode-admin.php:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
"
|
| 45 |
-
msgstr ""
|
| 46 |
-
|
| 47 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 48 |
-
msgid "
|
| 49 |
-
msgstr ""
|
| 50 |
-
|
| 51 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 52 |
-
#, php-format
|
| 53 |
-
msgid ""
|
| 54 |
-
"
|
| 55 |
-
"\">
|
| 56 |
-
msgstr ""
|
| 57 |
-
|
| 58 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
#: includes/classes/wp-maintenance-mode.php:
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
msgstr ""
|
| 83 |
-
|
| 84 |
-
#:
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
#: views/
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
msgstr ""
|
| 194 |
-
|
| 195 |
-
#: views/settings.php:
|
| 196 |
-
msgid "
|
| 197 |
-
msgstr ""
|
| 198 |
-
|
| 199 |
-
#: views/settings.php:
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
msgstr ""
|
| 204 |
-
|
| 205 |
-
#: views/settings.php:
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
"
|
| 213 |
-
msgstr ""
|
| 214 |
-
|
| 215 |
-
#: views/settings.php:
|
| 216 |
-
msgid "
|
| 217 |
-
msgstr ""
|
| 218 |
-
|
| 219 |
-
#: views/settings.php:
|
| 220 |
-
msgid "
|
| 221 |
-
msgstr ""
|
| 222 |
-
|
| 223 |
-
#: views/settings.php:
|
| 224 |
-
msgid "
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
msgstr ""
|
| 287 |
-
|
| 288 |
-
#: views/settings.php:
|
| 289 |
-
msgid "
|
| 290 |
-
msgstr ""
|
| 291 |
-
|
| 292 |
-
#: views/settings.php:
|
| 293 |
-
msgid "
|
| 294 |
-
msgstr ""
|
| 295 |
-
|
| 296 |
-
#: views/settings.php:
|
| 297 |
-
msgid "
|
| 298 |
-
msgstr ""
|
| 299 |
-
|
| 300 |
-
#: views/settings.php:
|
| 301 |
-
msgid "
|
| 302 |
-
msgstr ""
|
| 303 |
-
|
| 304 |
-
#: views/settings.php:
|
| 305 |
-
msgid "
|
| 306 |
-
msgstr ""
|
| 307 |
-
|
| 308 |
-
#: views/settings.php:
|
| 309 |
-
msgid "
|
| 310 |
-
msgstr ""
|
| 311 |
-
|
| 312 |
-
#: views/settings.php:
|
| 313 |
-
msgid "
|
| 314 |
-
msgstr ""
|
| 315 |
-
|
| 316 |
-
#: views/settings.php:
|
| 317 |
-
msgid "
|
| 318 |
-
msgstr ""
|
| 319 |
-
|
| 320 |
-
#: views/settings.php:
|
| 321 |
-
msgid "
|
| 322 |
-
msgstr ""
|
| 323 |
-
|
| 324 |
-
#: views/settings.php:
|
| 325 |
-
msgid "
|
| 326 |
-
msgstr ""
|
| 327 |
-
|
| 328 |
-
#: views/settings.php:
|
| 329 |
-
msgid "
|
| 330 |
-
msgstr ""
|
| 331 |
-
|
| 332 |
-
#: views/settings.php:
|
| 333 |
-
msgid "
|
| 334 |
-
msgstr ""
|
| 335 |
-
|
| 336 |
-
#: views/settings.php:
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
msgid "
|
| 351 |
-
msgstr ""
|
| 352 |
-
|
| 353 |
-
#: views/settings.php:
|
| 354 |
-
msgid "
|
| 355 |
-
msgstr ""
|
| 356 |
-
|
| 357 |
-
#: views/settings.php:
|
| 358 |
-
msgid "
|
| 359 |
-
msgstr ""
|
| 360 |
-
|
| 361 |
-
#: views/settings.php:
|
| 362 |
-
msgid "
|
| 363 |
-
msgstr ""
|
| 364 |
-
|
| 365 |
-
#: views/settings.php:
|
| 366 |
-
msgid "
|
| 367 |
-
msgstr ""
|
| 368 |
-
|
| 369 |
-
#: views/settings.php:
|
| 370 |
-
msgid "
|
| 371 |
-
msgstr ""
|
| 372 |
-
|
| 373 |
-
#: views/settings.php:
|
| 374 |
-
msgid "
|
| 375 |
-
msgstr ""
|
| 376 |
-
|
| 377 |
-
#: views/settings.php:
|
| 378 |
-
msgid "
|
| 379 |
-
msgstr ""
|
| 380 |
-
|
| 381 |
-
#: views/settings.php:
|
| 382 |
-
msgid "
|
| 383 |
-
msgstr ""
|
| 384 |
-
|
| 385 |
-
#: views/settings.php:
|
| 386 |
-
msgid "
|
| 387 |
-
msgstr ""
|
| 388 |
-
|
| 389 |
-
#: views/settings.php:
|
| 390 |
-
msgid "
|
| 391 |
-
msgstr ""
|
| 392 |
-
|
| 393 |
-
#: views/settings.php:
|
| 394 |
-
msgid "
|
| 395 |
-
msgstr ""
|
| 396 |
-
|
| 397 |
-
#: views/settings.php:
|
| 398 |
-
msgid "
|
| 399 |
-
msgstr ""
|
| 400 |
-
|
| 401 |
-
#: views/settings.php:
|
| 402 |
-
msgid "
|
| 403 |
-
msgstr ""
|
| 404 |
-
|
| 405 |
-
#: views/settings.php:
|
| 406 |
-
msgid "
|
| 407 |
-
msgstr ""
|
| 408 |
-
|
| 409 |
-
#: views/
|
| 410 |
-
msgid "
|
| 411 |
-
msgstr ""
|
| 412 |
-
|
| 413 |
-
#: views/
|
| 414 |
-
msgid "
|
| 415 |
-
msgstr ""
|
| 416 |
-
|
| 417 |
-
#: views/
|
| 418 |
-
msgid "
|
| 419 |
-
msgstr ""
|
| 420 |
-
|
| 421 |
-
#: views/
|
| 422 |
-
msgid "
|
| 423 |
-
msgstr ""
|
| 424 |
-
|
| 425 |
-
#: views/
|
| 426 |
-
msgid "
|
| 427 |
-
msgstr ""
|
| 428 |
-
|
| 429 |
-
#: views/
|
| 430 |
-
msgid "
|
| 431 |
-
msgstr ""
|
| 432 |
-
|
| 433 |
-
#: views/
|
| 434 |
-
msgid "
|
| 435 |
-
msgstr ""
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
|
|
Â
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: WP Maintenance Mode 2.0.4\n"
|
| 4 |
+
"POT-Creation-Date: 2016-06-17 03:13+0300\n"
|
| 5 |
+
"PO-Revision-Date: 2016-06-17 03:14+0300\n"
|
| 6 |
+
"Last-Translator: Maciej Gryniuk <maciejka45@gmail.com>\n"
|
| 7 |
+
"Language-Team: Designmodo <info@designmodo.com>\n"
|
| 8 |
+
"Language: en\n"
|
| 9 |
+
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"X-Generator: Poedit 1.8.8\n"
|
| 13 |
+
"X-Poedit-Basepath: ..\n"
|
| 14 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
| 15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
| 16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
| 17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
|
| 18 |
+
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;"
|
| 19 |
+
"esc_html_x:1,2c\n"
|
| 20 |
+
"X-Poedit-SearchPath-0: .\n"
|
| 21 |
+
"X-Poedit-SearchPath-1: includes/classes\n"
|
| 22 |
+
"X-Poedit-SearchPath-2: views\n"
|
| 23 |
+
|
| 24 |
+
#: includes/classes/wp-maintenance-mode-admin.php:121
|
| 25 |
+
#: includes/classes/wp-maintenance-mode-admin.php:159
|
| 26 |
+
#: includes/classes/wp-maintenance-mode-admin.php:181
|
| 27 |
+
msgid "You do not have access to this resource."
|
| 28 |
+
msgstr ""
|
| 29 |
+
|
| 30 |
+
#: includes/classes/wp-maintenance-mode-admin.php:165 views/settings.php:295
|
| 31 |
+
#, php-format
|
| 32 |
+
msgid "You have %d subscriber(s)"
|
| 33 |
+
msgstr ""
|
| 34 |
+
|
| 35 |
+
#: includes/classes/wp-maintenance-mode-admin.php:186
|
| 36 |
+
msgid "The tab slug must not be empty."
|
| 37 |
+
msgstr ""
|
| 38 |
+
|
| 39 |
+
#: includes/classes/wp-maintenance-mode-admin.php:191
|
| 40 |
+
msgid "The tab slug must exist."
|
| 41 |
+
msgstr ""
|
| 42 |
+
|
| 43 |
+
#: includes/classes/wp-maintenance-mode-admin.php:211
|
| 44 |
+
msgid "WP Maintenance Mode"
|
| 45 |
+
msgstr ""
|
| 46 |
+
|
| 47 |
+
#: includes/classes/wp-maintenance-mode-admin.php:425
|
| 48 |
+
msgid "Settings"
|
| 49 |
+
msgstr ""
|
| 50 |
+
|
| 51 |
+
#: includes/classes/wp-maintenance-mode-admin.php:444
|
| 52 |
+
#, php-format
|
| 53 |
+
msgid ""
|
| 54 |
+
"The Maintenance Mode is <strong>active</strong>. Please don't forget to <a "
|
| 55 |
+
"href=\"%s\">deactivate</a> as soon as you are done."
|
| 56 |
+
msgstr ""
|
| 57 |
+
|
| 58 |
+
#: includes/classes/wp-maintenance-mode-admin.php:481
|
| 59 |
+
msgid "Notice key cannot be empty."
|
| 60 |
+
msgstr ""
|
| 61 |
+
|
| 62 |
+
#: includes/classes/wp-maintenance-mode.php:103
|
| 63 |
+
#: includes/classes/wp-maintenance-mode.php:104
|
| 64 |
+
msgid "Maintenance mode"
|
| 65 |
+
msgstr ""
|
| 66 |
+
|
| 67 |
+
#: includes/classes/wp-maintenance-mode.php:106
|
| 68 |
+
msgid ""
|
| 69 |
+
"<p>Sorry for the inconvenience.<br />Our website is currently undergoing "
|
| 70 |
+
"scheduled maintenance.<br />Thank you for your understanding.</p>"
|
| 71 |
+
msgstr ""
|
| 72 |
+
|
| 73 |
+
#: includes/classes/wp-maintenance-mode.php:124
|
| 74 |
+
msgid "Notify me when it's ready"
|
| 75 |
+
msgstr ""
|
| 76 |
+
|
| 77 |
+
#: includes/classes/wp-maintenance-mode.php:259
|
| 78 |
+
#, php-format
|
| 79 |
+
msgid ""
|
| 80 |
+
"WP Maintenance Mode plugin was relaunched and you MUST revise <a href=\"%s"
|
| 81 |
+
"\">settings</a>."
|
| 82 |
+
msgstr ""
|
| 83 |
+
|
| 84 |
+
#: includes/classes/wp-maintenance-mode.php:449
|
| 85 |
+
#: includes/classes/wp-maintenance-mode.php:463
|
| 86 |
+
msgid "Maintenance Mode"
|
| 87 |
+
msgstr ""
|
| 88 |
+
|
| 89 |
+
#: includes/classes/wp-maintenance-mode.php:687
|
| 90 |
+
#: includes/classes/wp-maintenance-mode.php:721 views/maintenance.php:85
|
| 91 |
+
msgid "Please enter a valid email address."
|
| 92 |
+
msgstr ""
|
| 93 |
+
|
| 94 |
+
#: includes/classes/wp-maintenance-mode.php:699
|
| 95 |
+
msgid "You successfully subscribed. Thanks!"
|
| 96 |
+
msgstr ""
|
| 97 |
+
|
| 98 |
+
#: includes/classes/wp-maintenance-mode.php:717
|
| 99 |
+
msgid "All fields required."
|
| 100 |
+
msgstr ""
|
| 101 |
+
|
| 102 |
+
#: includes/classes/wp-maintenance-mode.php:726
|
| 103 |
+
msgid "Message via contact"
|
| 104 |
+
msgstr ""
|
| 105 |
+
|
| 106 |
+
#: includes/classes/wp-maintenance-mode.php:738
|
| 107 |
+
msgid "Your email was sent to the website administrator. Thanks!"
|
| 108 |
+
msgstr ""
|
| 109 |
+
|
| 110 |
+
#: views/contact.php:34
|
| 111 |
+
#, php-format
|
| 112 |
+
msgid "You have been contacted via %s."
|
| 113 |
+
msgstr ""
|
| 114 |
+
|
| 115 |
+
#: views/contact.php:50
|
| 116 |
+
msgid "Name:"
|
| 117 |
+
msgstr ""
|
| 118 |
+
|
| 119 |
+
#: views/contact.php:62
|
| 120 |
+
msgid "Email:"
|
| 121 |
+
msgstr ""
|
| 122 |
+
|
| 123 |
+
#: views/contact.php:74
|
| 124 |
+
msgid "Content:"
|
| 125 |
+
msgstr ""
|
| 126 |
+
|
| 127 |
+
#: views/loginform.php:8
|
| 128 |
+
msgid "Login"
|
| 129 |
+
msgstr ""
|
| 130 |
+
|
| 131 |
+
#: views/maintenance.php:42
|
| 132 |
+
msgid "your e-mail..."
|
| 133 |
+
msgstr ""
|
| 134 |
+
|
| 135 |
+
#: views/maintenance.php:43 views/settings.php:270
|
| 136 |
+
msgid "Subscribe"
|
| 137 |
+
msgstr ""
|
| 138 |
+
|
| 139 |
+
#: views/maintenance.php:84 views/sidebar.php:7
|
| 140 |
+
msgid "Name"
|
| 141 |
+
msgstr ""
|
| 142 |
+
|
| 143 |
+
#: views/maintenance.php:84 views/maintenance.php:85 views/maintenance.php:87
|
| 144 |
+
msgid "This field is required."
|
| 145 |
+
msgstr ""
|
| 146 |
+
|
| 147 |
+
#: views/maintenance.php:85
|
| 148 |
+
msgid "E-mail"
|
| 149 |
+
msgstr ""
|
| 150 |
+
|
| 151 |
+
#: views/maintenance.php:87
|
| 152 |
+
msgid "Your message"
|
| 153 |
+
msgstr ""
|
| 154 |
+
|
| 155 |
+
#: views/maintenance.php:88
|
| 156 |
+
msgid "Send"
|
| 157 |
+
msgstr ""
|
| 158 |
+
|
| 159 |
+
#: views/maintenance.php:93
|
| 160 |
+
msgid "Contact us"
|
| 161 |
+
msgstr ""
|
| 162 |
+
|
| 163 |
+
#: views/maintenance.php:98
|
| 164 |
+
msgid "Dashboard"
|
| 165 |
+
msgstr ""
|
| 166 |
+
|
| 167 |
+
#: views/settings.php:6
|
| 168 |
+
msgid "Settings saved."
|
| 169 |
+
msgstr ""
|
| 170 |
+
|
| 171 |
+
#: views/settings.php:13
|
| 172 |
+
msgid "General"
|
| 173 |
+
msgstr ""
|
| 174 |
+
|
| 175 |
+
#: views/settings.php:14
|
| 176 |
+
msgid "Design"
|
| 177 |
+
msgstr ""
|
| 178 |
+
|
| 179 |
+
#: views/settings.php:15
|
| 180 |
+
msgid "Modules"
|
| 181 |
+
msgstr ""
|
| 182 |
+
|
| 183 |
+
#: views/settings.php:24
|
| 184 |
+
msgid "Status"
|
| 185 |
+
msgstr ""
|
| 186 |
+
|
| 187 |
+
#: views/settings.php:26
|
| 188 |
+
msgid "Activated"
|
| 189 |
+
msgstr ""
|
| 190 |
+
|
| 191 |
+
#: views/settings.php:27
|
| 192 |
+
msgid "Deactivated"
|
| 193 |
+
msgstr ""
|
| 194 |
+
|
| 195 |
+
#: views/settings.php:31
|
| 196 |
+
msgid "Bypass for Search Bots"
|
| 197 |
+
msgstr ""
|
| 198 |
+
|
| 199 |
+
#: views/settings.php:34 views/settings.php:104 views/settings.php:114
|
| 200 |
+
#: views/settings.php:242 views/settings.php:278 views/settings.php:316
|
| 201 |
+
#: views/settings.php:384 views/settings.php:416
|
| 202 |
+
msgid "Yes"
|
| 203 |
+
msgstr ""
|
| 204 |
+
|
| 205 |
+
#: views/settings.php:35 views/settings.php:105 views/settings.php:115
|
| 206 |
+
#: views/settings.php:243 views/settings.php:279 views/settings.php:317
|
| 207 |
+
#: views/settings.php:385 views/settings.php:417
|
| 208 |
+
msgid "No"
|
| 209 |
+
msgstr ""
|
| 210 |
+
|
| 211 |
+
#: views/settings.php:37
|
| 212 |
+
msgid "Allow Search Bots to bypass maintenance mode?"
|
| 213 |
+
msgstr ""
|
| 214 |
+
|
| 215 |
+
#: views/settings.php:41
|
| 216 |
+
msgid "Backend Role"
|
| 217 |
+
msgstr ""
|
| 218 |
+
|
| 219 |
+
#: views/settings.php:43 views/settings.php:59
|
| 220 |
+
msgid "Select role(s)"
|
| 221 |
+
msgstr ""
|
| 222 |
+
|
| 223 |
+
#: views/settings.php:53
|
| 224 |
+
msgid ""
|
| 225 |
+
"Which user role is allowed to access the backend of this blog? "
|
| 226 |
+
"Administrators will always have access."
|
| 227 |
+
msgstr ""
|
| 228 |
+
|
| 229 |
+
#: views/settings.php:57
|
| 230 |
+
msgid "Frontend Role"
|
| 231 |
+
msgstr ""
|
| 232 |
+
|
| 233 |
+
#: views/settings.php:69
|
| 234 |
+
msgid ""
|
| 235 |
+
"Which user role is allowed to access the frontend of this blog? "
|
| 236 |
+
"Administrators will always have access."
|
| 237 |
+
msgstr ""
|
| 238 |
+
|
| 239 |
+
#: views/settings.php:73
|
| 240 |
+
msgid "Robots Meta Tag"
|
| 241 |
+
msgstr ""
|
| 242 |
+
|
| 243 |
+
#: views/settings.php:79
|
| 244 |
+
msgid ""
|
| 245 |
+
"The robots meta tag lets you use a granular, page-specific approach to "
|
| 246 |
+
"control how an individual page should be indexed and served to users in "
|
| 247 |
+
"search results."
|
| 248 |
+
msgstr ""
|
| 249 |
+
|
| 250 |
+
#: views/settings.php:83
|
| 251 |
+
msgid "Redirection"
|
| 252 |
+
msgstr ""
|
| 253 |
+
|
| 254 |
+
#: views/settings.php:86
|
| 255 |
+
msgid ""
|
| 256 |
+
"If you want to redirect a user (with no access to Dashboard/Backend) to a "
|
| 257 |
+
"URL (different from WordPress Dashboard URL) after login, then define a URL "
|
| 258 |
+
"(incl. http://)"
|
| 259 |
+
msgstr ""
|
| 260 |
+
|
| 261 |
+
#: views/settings.php:90
|
| 262 |
+
msgid "Exclude"
|
| 263 |
+
msgstr ""
|
| 264 |
+
|
| 265 |
+
#: views/settings.php:97
|
| 266 |
+
msgid ""
|
| 267 |
+
"Exclude feed, pages, archives or IPs from maintenance mode. Add one slug / "
|
| 268 |
+
"IP per line!"
|
| 269 |
+
msgstr ""
|
| 270 |
+
|
| 271 |
+
#: views/settings.php:101
|
| 272 |
+
msgid "Notice"
|
| 273 |
+
msgstr ""
|
| 274 |
+
|
| 275 |
+
#: views/settings.php:107
|
| 276 |
+
msgid "Do you want to see notices when maintenance mode is activated?"
|
| 277 |
+
msgstr ""
|
| 278 |
+
|
| 279 |
+
#: views/settings.php:111
|
| 280 |
+
msgid "Dashboard link"
|
| 281 |
+
msgstr ""
|
| 282 |
+
|
| 283 |
+
#: views/settings.php:117
|
| 284 |
+
msgid ""
|
| 285 |
+
"Do you want to add a link to the dashboard on your maintenance mode page?"
|
| 286 |
+
msgstr ""
|
| 287 |
+
|
| 288 |
+
#: views/settings.php:125 views/settings.php:228 views/settings.php:432
|
| 289 |
+
msgid "Save settings"
|
| 290 |
+
msgstr ""
|
| 291 |
+
|
| 292 |
+
#: views/settings.php:126 views/settings.php:229 views/settings.php:433
|
| 293 |
+
msgid "Reset settings"
|
| 294 |
+
msgstr ""
|
| 295 |
+
|
| 296 |
+
#: views/settings.php:131
|
| 297 |
+
msgid "Content"
|
| 298 |
+
msgstr ""
|
| 299 |
+
|
| 300 |
+
#: views/settings.php:136
|
| 301 |
+
msgid "Title (HTML tag)"
|
| 302 |
+
msgstr ""
|
| 303 |
+
|
| 304 |
+
#: views/settings.php:142
|
| 305 |
+
msgid "Heading"
|
| 306 |
+
msgstr ""
|
| 307 |
+
|
| 308 |
+
#: views/settings.php:149 views/settings.php:284
|
| 309 |
+
msgid "Text"
|
| 310 |
+
msgstr ""
|
| 311 |
+
|
| 312 |
+
#: views/settings.php:169
|
| 313 |
+
msgid "Background"
|
| 314 |
+
msgstr ""
|
| 315 |
+
|
| 316 |
+
#: views/settings.php:174
|
| 317 |
+
msgid "Choose type"
|
| 318 |
+
msgstr ""
|
| 319 |
+
|
| 320 |
+
#: views/settings.php:177
|
| 321 |
+
msgid "Custom color"
|
| 322 |
+
msgstr ""
|
| 323 |
+
|
| 324 |
+
#: views/settings.php:178
|
| 325 |
+
msgid "Uploaded background"
|
| 326 |
+
msgstr ""
|
| 327 |
+
|
| 328 |
+
#: views/settings.php:179
|
| 329 |
+
msgid "Predefined background"
|
| 330 |
+
msgstr ""
|
| 331 |
+
|
| 332 |
+
#: views/settings.php:184
|
| 333 |
+
msgid "Choose color"
|
| 334 |
+
msgstr ""
|
| 335 |
+
|
| 336 |
+
#: views/settings.php:190
|
| 337 |
+
msgid "Upload background"
|
| 338 |
+
msgstr ""
|
| 339 |
+
|
| 340 |
+
#: views/settings.php:194
|
| 341 |
+
msgid "Backgrounds should have 1920x1280 px size."
|
| 342 |
+
msgstr ""
|
| 343 |
+
|
| 344 |
+
#: views/settings.php:199
|
| 345 |
+
msgid "Choose background"
|
| 346 |
+
msgstr ""
|
| 347 |
+
|
| 348 |
