Self hosted FLOSS fitness/workout, nutrition and weight tracker
Replace jqueryUI's datepicker with one for bootstrap
Roland Geiderecf3ba321ec9
diff --git a/wger/core/static/css/datepicker3.css b/wger/core/static/css/datepicker3.cssnew file mode 100644index 000000000..aa78b1d4b--- /dev/null+++ b/wger/core/static/css/datepicker3.css@@ -0,0 +1,790 @@+/*!+ * Datepicker for Bootstrap+ *+ * Copyright 2012 Stefan Petre+ * Improvements by Andrew Rowls+ * Licensed under the Apache License v2.0+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ */+.datepicker {+ padding: 4px;+ border-radius: 4px;+ direction: ltr;+ /*.dow {+ border-top: 1px solid #ddd !important;+ }*/+}+.datepicker-inline {+ width: 220px;+}+.datepicker.datepicker-rtl {+ direction: rtl;+}+.datepicker.datepicker-rtl table tr td span {+ float: right;+}+.datepicker-dropdown {+ top: 0;+ left: 0;+}+.datepicker-dropdown:before {+ content: '';+ display: inline-block;+ border-left: 7px solid transparent;+ border-right: 7px solid transparent;+ border-bottom: 7px solid #ccc;+ border-top: 0;+ border-bottom-color: rgba(0, 0, 0, 0.2);+ position: absolute;+}+.datepicker-dropdown:after {+ content: '';+ display: inline-block;+ border-left: 6px solid transparent;+ border-right: 6px solid transparent;+ border-bottom: 6px solid #fff;+ border-top: 0;+ position: absolute;+}+.datepicker-dropdown.datepicker-orient-left:before {+ left: 6px;+}+.datepicker-dropdown.datepicker-orient-left:after {+ left: 7px;+}+.datepicker-dropdown.datepicker-orient-right:before {+ right: 6px;+}+.datepicker-dropdown.datepicker-orient-right:after {+ right: 7px;+}+.datepicker-dropdown.datepicker-orient-top:before {+ top: -7px;+}+.datepicker-dropdown.datepicker-orient-top:after {+ top: -6px;+}+.datepicker-dropdown.datepicker-orient-bottom:before {+ bottom: -7px;+ border-bottom: 0;+ border-top: 7px solid #999;+}+.datepicker-dropdown.datepicker-orient-bottom:after {+ bottom: -6px;+ border-bottom: 0;+ border-top: 6px solid #fff;+}+.datepicker > div {+ display: none;+}+.datepicker.days div.datepicker-days {+ display: block;+}+.datepicker.months div.datepicker-months {+ display: block;+}+.datepicker.years div.datepicker-years {+ display: block;+}+.datepicker table {+ margin: 0;+ -webkit-touch-callout: none;+ -webkit-user-select: none;+ -khtml-user-select: none;+ -moz-user-select: none;+ -ms-user-select: none;+ user-select: none;+}+.datepicker table tr td,+.datepicker table tr th {+ text-align: center;+ width: 30px;+ height: 30px;+ border-radius: 4px;+ border: none;+}+.table-striped .datepicker table tr td,+.table-striped .datepicker table tr th {+ background-color: transparent;+}+.datepicker table tr td.day:hover,+.datepicker table tr td.day.focused {+ background: #eeeeee;+ cursor: pointer;+}+.datepicker table tr td.old,+.datepicker table tr td.new {+ color: #999999;+}+.datepicker table tr td.disabled,+.datepicker table tr td.disabled:hover {+ background: none;+ color: #999999;+ cursor: default;+}+.datepicker table tr td.today,+.datepicker table tr td.today:hover,+.datepicker table tr td.today.disabled,+.datepicker table tr td.today.disabled:hover {+ color: #000000;+ background-color: #ffdb99;+ border-color: #ffb733;+}+.datepicker table tr td.today:hover,+.datepicker table tr td.today:hover:hover,+.datepicker table tr td.today.disabled:hover,+.datepicker table tr td.today.disabled:hover:hover,+.datepicker table tr td.today:focus,+.datepicker table tr td.today:hover:focus,+.datepicker table tr td.today.disabled:focus,+.datepicker table tr td.today.disabled:hover:focus,+.datepicker table tr td.today:active,+.datepicker table tr td.today:hover:active,+.datepicker table tr td.today.disabled:active,+.datepicker table tr td.today.disabled:hover:active,+.datepicker table tr td.today.active,+.datepicker table tr td.today:hover.active,+.datepicker table tr td.today.disabled.active,+.datepicker table tr td.today.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.today,+.open .dropdown-toggle.datepicker table tr td.today:hover,+.open .dropdown-toggle.datepicker table tr td.today.disabled,+.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {+ color: #000000;+ background-color: #ffcd70;+ border-color: #f59e00;+}+.datepicker table tr td.today:active,+.datepicker table tr td.today:hover:active,+.datepicker table tr td.today.disabled:active,+.datepicker table tr td.today.disabled:hover:active,+.datepicker table tr td.today.active,+.datepicker table tr td.today:hover.active,+.datepicker table tr td.today.disabled.active,+.datepicker table tr td.today.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.today,+.open .dropdown-toggle.datepicker table tr td.today:hover,+.open .dropdown-toggle.datepicker table tr td.today.disabled,+.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {+ background-image: none;+}+.datepicker table tr td.today.disabled,+.datepicker table tr td.today:hover.disabled,+.datepicker table tr td.today.disabled.disabled,+.datepicker table tr td.today.disabled:hover.disabled,+.datepicker table tr td.today[disabled],+.datepicker table tr td.today:hover[disabled],+.datepicker table tr td.today.disabled[disabled],+.datepicker table tr td.today.disabled:hover[disabled],+fieldset[disabled] .datepicker table tr td.today,+fieldset[disabled] .datepicker table tr td.today:hover,+fieldset[disabled] .datepicker table tr td.today.disabled,+fieldset[disabled] .datepicker table tr td.today.disabled:hover,+.datepicker table tr td.today.disabled:hover,+.datepicker table tr td.today:hover.disabled:hover,+.datepicker table tr td.today.disabled.disabled:hover,+.datepicker table tr td.today.disabled:hover.disabled:hover,+.datepicker table tr td.today[disabled]:hover,+.datepicker table tr td.today:hover[disabled]:hover,+.datepicker table tr td.today.disabled[disabled]:hover,+.datepicker table tr td.today.disabled:hover[disabled]:hover,+fieldset[disabled] .datepicker table tr td.today:hover,+fieldset[disabled] .datepicker table tr td.today:hover:hover,+fieldset[disabled] .datepicker table tr td.today.disabled:hover,+fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover,+.datepicker table tr td.today.disabled:focus,+.datepicker table tr td.today:hover.disabled:focus,+.datepicker table tr td.today.disabled.disabled:focus,+.datepicker table tr td.today.disabled:hover.disabled:focus,+.datepicker table tr td.today[disabled]:focus,+.datepicker table tr td.today:hover[disabled]:focus,+.datepicker table tr td.today.disabled[disabled]:focus,+.datepicker table tr td.today.disabled:hover[disabled]:focus,+fieldset[disabled] .datepicker table tr td.today:focus,+fieldset[disabled] .datepicker table tr td.today:hover:focus,+fieldset[disabled] .datepicker table tr td.today.disabled:focus,+fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus,+.datepicker table tr td.today.disabled:active,+.datepicker table tr td.today:hover.disabled:active,+.datepicker table tr td.today.disabled.disabled:active,+.datepicker table tr td.today.disabled:hover.disabled:active,+.datepicker table tr td.today[disabled]:active,+.datepicker table tr td.today:hover[disabled]:active,+.datepicker table tr td.today.disabled[disabled]:active,+.datepicker table tr td.today.disabled:hover[disabled]:active,+fieldset[disabled] .datepicker table tr td.today:active,+fieldset[disabled] .datepicker table tr td.today:hover:active,+fieldset[disabled] .datepicker table tr td.today.disabled:active,+fieldset[disabled] .datepicker table tr td.today.disabled:hover:active,+.datepicker table tr td.today.disabled.active,+.datepicker table tr td.today:hover.disabled.active,+.datepicker table tr td.today.disabled.disabled.active,+.datepicker table tr td.today.disabled:hover.disabled.active,+.datepicker table tr td.today[disabled].active,+.datepicker table tr td.today:hover[disabled].active,+.datepicker table tr td.today.disabled[disabled].active,+.datepicker table tr td.today.disabled:hover[disabled].active,+fieldset[disabled] .datepicker table tr td.today.active,+fieldset[disabled] .datepicker table tr td.today:hover.active,+fieldset[disabled] .datepicker table tr td.today.disabled.active,+fieldset[disabled] .datepicker table tr td.today.disabled:hover.active {+ background-color: #ffdb99;+ border-color: #ffb733;+}+.datepicker table tr td.today:hover:hover {+ color: #000;+}+.datepicker table tr td.today.active:hover {+ color: #fff;+}+.datepicker table tr td.range,+.datepicker table tr td.range:hover,+.datepicker table tr td.range.disabled,+.datepicker table tr td.range.disabled:hover {+ background: #eeeeee;+ border-radius: 0;+}+.datepicker table tr td.range.today,+.datepicker table tr td.range.today:hover,+.datepicker table tr td.range.today.disabled,+.datepicker table tr td.range.today.disabled:hover {+ color: #000000;+ background-color: #f7ca77;+ border-color: #f1a417;+ border-radius: 0;+}+.datepicker table tr td.range.today:hover,+.datepicker table tr td.range.today:hover:hover,+.datepicker table tr td.range.today.disabled:hover,+.datepicker table tr td.range.today.disabled:hover:hover,+.datepicker table tr td.range.today:focus,+.datepicker table tr td.range.today:hover:focus,+.datepicker table tr td.range.today.disabled:focus,+.datepicker table tr td.range.today.disabled:hover:focus,+.datepicker table tr td.range.today:active,+.datepicker table tr td.range.today:hover:active,+.datepicker table tr td.range.today.disabled:active,+.datepicker table tr td.range.today.disabled:hover:active,+.datepicker table tr td.range.today.active,+.datepicker table tr td.range.today:hover.active,+.datepicker table tr td.range.today.disabled.active,+.datepicker table tr td.range.today.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.range.today,+.open .dropdown-toggle.datepicker table tr td.range.today:hover,+.open .dropdown-toggle.datepicker table tr td.range.today.disabled,+.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {+ color: #000000;+ background-color: #f4bb51;+ border-color: #bf800c;+}+.datepicker table tr td.range.today:active,+.datepicker table tr td.range.today:hover:active,+.datepicker table tr td.range.today.disabled:active,+.datepicker table tr td.range.today.disabled:hover:active,+.datepicker table tr td.range.today.active,+.datepicker table tr td.range.today:hover.active,+.datepicker table tr td.range.today.disabled.active,+.datepicker table tr td.range.today.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.range.today,+.open .dropdown-toggle.datepicker table tr td.range.today:hover,+.open .dropdown-toggle.datepicker table tr td.range.today.disabled,+.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {+ background-image: none;+}+.datepicker table tr td.range.today.disabled,+.datepicker table tr td.range.today:hover.disabled,+.datepicker table tr td.range.today.disabled.disabled,+.datepicker table tr td.range.today.disabled:hover.disabled,+.datepicker table tr td.range.today[disabled],+.datepicker table tr td.range.today:hover[disabled],+.datepicker table tr td.range.today.disabled[disabled],+.datepicker table tr td.range.today.disabled:hover[disabled],+fieldset[disabled] .datepicker table tr td.range.today,+fieldset[disabled] .datepicker table tr td.range.today:hover,+fieldset[disabled] .datepicker table tr td.range.today.disabled,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,+.datepicker table tr td.range.today.disabled:hover,+.datepicker table tr td.range.today:hover.disabled:hover,+.datepicker table tr td.range.today.disabled.disabled:hover,+.datepicker table tr td.range.today.disabled:hover.disabled:hover,+.datepicker table tr td.range.today[disabled]:hover,+.datepicker table tr td.range.today:hover[disabled]:hover,+.datepicker table tr td.range.today.disabled[disabled]:hover,+.datepicker table tr td.range.today.disabled:hover[disabled]:hover,+fieldset[disabled] .datepicker table tr td.range.today:hover,+fieldset[disabled] .datepicker table tr td.range.today:hover:hover,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover,+.datepicker table tr td.range.today.disabled:focus,+.datepicker table tr td.range.today:hover.disabled:focus,+.datepicker table tr td.range.today.disabled.disabled:focus,+.datepicker table tr td.range.today.disabled:hover.disabled:focus,+.datepicker table tr td.range.today[disabled]:focus,+.datepicker table tr td.range.today:hover[disabled]:focus,+.datepicker table tr td.range.today.disabled[disabled]:focus,+.datepicker table tr td.range.today.disabled:hover[disabled]:focus,+fieldset[disabled] .datepicker table tr td.range.today:focus,+fieldset[disabled] .datepicker table tr td.range.today:hover:focus,+fieldset[disabled] .datepicker table tr td.range.today.disabled:focus,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus,+.datepicker table tr td.range.today.disabled:active,+.datepicker table tr td.range.today:hover.disabled:active,+.datepicker table tr td.range.today.disabled.disabled:active,+.datepicker table tr td.range.today.disabled:hover.disabled:active,+.datepicker table tr td.range.today[disabled]:active,+.datepicker table tr td.range.today:hover[disabled]:active,+.datepicker table tr td.range.today.disabled[disabled]:active,+.datepicker table tr td.range.today.disabled:hover[disabled]:active,+fieldset[disabled] .datepicker table tr td.range.today:active,+fieldset[disabled] .datepicker table tr td.range.today:hover:active,+fieldset[disabled] .datepicker table tr td.range.today.disabled:active,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active,+.datepicker table tr td.range.today.disabled.active,+.datepicker table tr td.range.today:hover.disabled.active,+.datepicker table tr td.range.today.disabled.disabled.active,+.datepicker table tr td.range.today.disabled:hover.disabled.active,+.datepicker table tr td.range.today[disabled].active,+.datepicker table tr td.range.today:hover[disabled].active,+.datepicker table tr td.range.today.disabled[disabled].active,+.datepicker table tr td.range.today.disabled:hover[disabled].active,+fieldset[disabled] .datepicker table tr td.range.today.active,+fieldset[disabled] .datepicker table tr td.range.today:hover.active,+fieldset[disabled] .datepicker table tr td.range.today.disabled.active,+fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active {+ background-color: #f7ca77;+ border-color: #f1a417;+}+.datepicker table tr td.selected,+.datepicker table tr td.selected:hover,+.datepicker table tr td.selected.disabled,+.datepicker table tr td.selected.disabled:hover {+ color: #ffffff;+ background-color: #999999;+ border-color: #555555;+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);+}+.datepicker table tr td.selected:hover,+.datepicker table tr td.selected:hover:hover,+.datepicker table tr td.selected.disabled:hover,+.datepicker table tr td.selected.disabled:hover:hover,+.datepicker table tr td.selected:focus,+.datepicker table tr td.selected:hover:focus,+.datepicker table tr td.selected.disabled:focus,+.datepicker table tr td.selected.disabled:hover:focus,+.datepicker table tr td.selected:active,+.datepicker table tr td.selected:hover:active,+.datepicker table tr td.selected.disabled:active,+.datepicker table tr td.selected.disabled:hover:active,+.datepicker table tr td.selected.active,+.datepicker table tr td.selected:hover.active,+.datepicker table tr td.selected.disabled.active,+.datepicker table tr td.selected.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.selected,+.open .dropdown-toggle.datepicker table tr td.selected:hover,+.open .dropdown-toggle.datepicker table tr td.selected.disabled,+.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {+ color: #ffffff;+ background-color: #858585;+ border-color: #373737;+}+.datepicker table tr td.selected:active,+.datepicker table tr td.selected:hover:active,+.datepicker table tr td.selected.disabled:active,+.datepicker table tr td.selected.disabled:hover:active,+.datepicker table tr td.selected.active,+.datepicker table tr td.selected:hover.active,+.datepicker table tr td.selected.disabled.active,+.datepicker table tr td.selected.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.selected,+.open .dropdown-toggle.datepicker table tr td.selected:hover,+.open .dropdown-toggle.datepicker table tr td.selected.disabled,+.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {+ background-image: none;+}+.datepicker table tr td.selected.disabled,+.datepicker table tr td.selected:hover.disabled,+.datepicker table tr td.selected.disabled.disabled,+.datepicker table tr td.selected.disabled:hover.disabled,+.datepicker table tr td.selected[disabled],+.datepicker table tr td.selected:hover[disabled],+.datepicker table tr td.selected.disabled[disabled],+.datepicker table tr td.selected.disabled:hover[disabled],+fieldset[disabled] .datepicker table tr td.selected,+fieldset[disabled] .datepicker table tr td.selected:hover,+fieldset[disabled] .datepicker table tr td.selected.disabled,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover,+.datepicker table tr td.selected.disabled:hover,+.datepicker table tr td.selected:hover.disabled:hover,+.datepicker table tr td.selected.disabled.disabled:hover,+.datepicker table tr td.selected.disabled:hover.disabled:hover,+.datepicker table tr td.selected[disabled]:hover,+.datepicker table tr td.selected:hover[disabled]:hover,+.datepicker table tr td.selected.disabled[disabled]:hover,+.datepicker table tr td.selected.disabled:hover[disabled]:hover,+fieldset[disabled] .datepicker table tr td.selected:hover,+fieldset[disabled] .datepicker table tr td.selected:hover:hover,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover,+.datepicker table tr td.selected.disabled:focus,+.datepicker table tr td.selected:hover.disabled:focus,+.datepicker table tr td.selected.disabled.disabled:focus,+.datepicker table tr td.selected.disabled:hover.disabled:focus,+.datepicker table tr td.selected[disabled]:focus,+.datepicker table tr td.selected:hover[disabled]:focus,+.datepicker table tr td.selected.disabled[disabled]:focus,+.datepicker table tr td.selected.disabled:hover[disabled]:focus,+fieldset[disabled] .datepicker table tr td.selected:focus,+fieldset[disabled] .datepicker table tr td.selected:hover:focus,+fieldset[disabled] .datepicker table tr td.selected.disabled:focus,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus,+.datepicker table tr td.selected.disabled:active,+.datepicker table tr td.selected:hover.disabled:active,+.datepicker table tr td.selected.disabled.disabled:active,+.datepicker table tr td.selected.disabled:hover.disabled:active,+.datepicker table tr td.selected[disabled]:active,+.datepicker table tr td.selected:hover[disabled]:active,+.datepicker table tr td.selected.disabled[disabled]:active,+.datepicker table tr td.selected.disabled:hover[disabled]:active,+fieldset[disabled] .datepicker table tr td.selected:active,+fieldset[disabled] .datepicker table tr td.selected:hover:active,+fieldset[disabled] .datepicker table tr td.selected.disabled:active,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active,+.datepicker table tr td.selected.disabled.active,+.datepicker table tr td.selected:hover.disabled.active,+.datepicker table tr td.selected.disabled.disabled.active,+.datepicker table tr td.selected.disabled:hover.disabled.active,+.datepicker table tr td.selected[disabled].active,+.datepicker table tr td.selected:hover[disabled].active,+.datepicker table tr td.selected.disabled[disabled].active,+.datepicker table tr td.selected.disabled:hover[disabled].active,+fieldset[disabled] .datepicker table tr td.selected.active,+fieldset[disabled] .datepicker table tr td.selected:hover.active,+fieldset[disabled] .datepicker table tr td.selected.disabled.active,+fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active {+ background-color: #999999;+ border-color: #555555;+}+.datepicker table tr td.active,+.datepicker table tr td.active:hover,+.datepicker table tr td.active.disabled,+.datepicker table tr td.active.disabled:hover {+ color: #ffffff;+ background-color: #428bca;+ border-color: #357ebd;+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);+}+.datepicker table tr td.active:hover,+.datepicker table tr td.active:hover:hover,+.datepicker table tr td.active.disabled:hover,+.datepicker table tr td.active.disabled:hover:hover,+.datepicker table tr td.active:focus,+.datepicker table tr td.active:hover:focus,+.datepicker table tr td.active.disabled:focus,+.datepicker table tr td.active.disabled:hover:focus,+.datepicker table tr td.active:active,+.datepicker table tr td.active:hover:active,+.datepicker table tr td.active.disabled:active,+.datepicker table tr td.active.disabled:hover:active,+.datepicker table tr td.active.active,+.datepicker table tr td.active:hover.active,+.datepicker table tr td.active.disabled.active,+.datepicker table tr td.active.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.active,+.open .dropdown-toggle.datepicker table tr td.active:hover,+.open .dropdown-toggle.datepicker table tr td.active.disabled,+.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {+ color: #ffffff;+ background-color: #3276b1;+ border-color: #285e8e;+}+.datepicker table tr td.active:active,+.datepicker table tr td.active:hover:active,+.datepicker table tr td.active.disabled:active,+.datepicker table tr td.active.disabled:hover:active,+.datepicker table tr td.active.active,+.datepicker table tr td.active:hover.active,+.datepicker table tr td.active.disabled.active,+.datepicker table tr td.active.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td.active,+.open .dropdown-toggle.datepicker table tr td.active:hover,+.open .dropdown-toggle.datepicker table tr td.active.disabled,+.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {+ background-image: none;+}+.datepicker table tr td.active.disabled,+.datepicker table tr td.active:hover.disabled,+.datepicker table tr td.active.disabled.disabled,+.datepicker table tr td.active.disabled:hover.disabled,+.datepicker table tr td.active[disabled],+.datepicker table tr td.active:hover[disabled],+.datepicker table tr td.active.disabled[disabled],+.datepicker table tr td.active.disabled:hover[disabled],+fieldset[disabled] .datepicker table tr td.active,+fieldset[disabled] .datepicker table tr td.active:hover,+fieldset[disabled] .datepicker table tr td.active.disabled,+fieldset[disabled] .datepicker table tr td.active.disabled:hover,+.datepicker table tr td.active.disabled:hover,+.datepicker table tr td.active:hover.disabled:hover,+.datepicker table tr td.active.disabled.disabled:hover,+.datepicker table tr td.active.disabled:hover.disabled:hover,+.datepicker table tr td.active[disabled]:hover,+.datepicker table tr td.active:hover[disabled]:hover,+.datepicker table tr td.active.disabled[disabled]:hover,+.datepicker table tr td.active.disabled:hover[disabled]:hover,+fieldset[disabled] .datepicker table tr td.active:hover,+fieldset[disabled] .datepicker table tr td.active:hover:hover,+fieldset[disabled] .datepicker table tr td.active.disabled:hover,+fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover,+.datepicker table tr td.active.disabled:focus,+.datepicker table tr td.active:hover.disabled:focus,+.datepicker table tr td.active.disabled.disabled:focus,+.datepicker table tr td.active.disabled:hover.disabled:focus,+.datepicker table tr td.active[disabled]:focus,+.datepicker table tr td.active:hover[disabled]:focus,+.datepicker table tr td.active.disabled[disabled]:focus,+.datepicker table tr td.active.disabled:hover[disabled]:focus,+fieldset[disabled] .datepicker table tr td.active:focus,+fieldset[disabled] .datepicker table tr td.active:hover:focus,+fieldset[disabled] .datepicker table tr td.active.disabled:focus,+fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus,+.datepicker table tr td.active.disabled:active,+.datepicker table tr td.active:hover.disabled:active,+.datepicker table tr td.active.disabled.disabled:active,+.datepicker table tr td.active.disabled:hover.disabled:active,+.datepicker table tr td.active[disabled]:active,+.datepicker table tr td.active:hover[disabled]:active,+.datepicker table tr td.active.disabled[disabled]:active,+.datepicker table tr td.active.disabled:hover[disabled]:active,+fieldset[disabled] .datepicker table tr td.active:active,+fieldset[disabled] .datepicker table tr td.active:hover:active,+fieldset[disabled] .datepicker table tr td.active.disabled:active,+fieldset[disabled] .datepicker table tr td.active.disabled:hover:active,+.datepicker table tr td.active.disabled.active,+.datepicker table tr td.active:hover.disabled.active,+.datepicker table tr td.active.disabled.disabled.active,+.datepicker table tr td.active.disabled:hover.disabled.active,+.datepicker table tr td.active[disabled].active,+.datepicker table tr td.active:hover[disabled].active,+.datepicker table tr td.active.disabled[disabled].active,+.datepicker table tr td.active.disabled:hover[disabled].active,+fieldset[disabled] .datepicker table tr td.active.active,+fieldset[disabled] .datepicker table tr td.active:hover.active,+fieldset[disabled] .datepicker table tr td.active.disabled.active,+fieldset[disabled] .datepicker table tr td.active.disabled:hover.active {+ background-color: #428bca;+ border-color: #357ebd;+}+.datepicker table tr td span {+ display: block;+ width: 23%;+ height: 54px;+ line-height: 54px;+ float: left;+ margin: 1%;+ cursor: pointer;+ border-radius: 4px;+}+.datepicker table tr td span:hover {+ background: #eeeeee;+}+.datepicker table tr td span.disabled,+.datepicker table tr td span.disabled:hover {+ background: none;+ color: #999999;+ cursor: default;+}+.datepicker table tr td span.active,+.datepicker table tr td span.active:hover,+.datepicker table tr td span.active.disabled,+.datepicker table tr td span.active.disabled:hover {+ color: #ffffff;+ background-color: #428bca;+ border-color: #357ebd;+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);+}+.datepicker table tr td span.active:hover,+.datepicker table tr td span.active:hover:hover,+.datepicker table tr td span.active.disabled:hover,+.datepicker table tr td span.active.disabled:hover:hover,+.datepicker table tr td span.active:focus,+.datepicker table tr td span.active:hover:focus,+.datepicker table tr td span.active.disabled:focus,+.datepicker table tr td span.active.disabled:hover:focus,+.datepicker table tr td span.active:active,+.datepicker table tr td span.active:hover:active,+.datepicker table tr td span.active.disabled:active,+.datepicker table tr td span.active.disabled:hover:active,+.datepicker table tr td span.active.active,+.datepicker table tr td span.active:hover.active,+.datepicker table tr td span.active.disabled.active,+.datepicker table tr td span.active.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td span.active,+.open .dropdown-toggle.datepicker table tr td span.active:hover,+.open .dropdown-toggle.datepicker table tr td span.active.disabled,+.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {+ color: #ffffff;+ background-color: #3276b1;+ border-color: #285e8e;+}+.datepicker table tr td span.active:active,+.datepicker table tr td span.active:hover:active,+.datepicker table tr td span.active.disabled:active,+.datepicker table tr td span.active.disabled:hover:active,+.datepicker table tr td span.active.active,+.datepicker table tr td span.active:hover.active,+.datepicker table tr td span.active.disabled.active,+.datepicker table tr td span.active.disabled:hover.active,+.open .dropdown-toggle.datepicker table tr td span.active,+.open .dropdown-toggle.datepicker table tr td span.active:hover,+.open .dropdown-toggle.datepicker table tr td span.active.disabled,+.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {+ background-image: none;+}+.datepicker table tr td span.active.disabled,+.datepicker table tr td span.active:hover.disabled,+.datepicker table tr td span.active.disabled.disabled,+.datepicker table tr td span.active.disabled:hover.disabled,+.datepicker table tr td span.active[disabled],+.datepicker table tr td span.active:hover[disabled],+.datepicker table tr td span.active.disabled[disabled],+.datepicker table tr td span.active.disabled:hover[disabled],+fieldset[disabled] .datepicker table tr td span.active,+fieldset[disabled] .datepicker table tr td span.active:hover,+fieldset[disabled] .datepicker table tr td span.active.disabled,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover,+.datepicker table tr td span.active.disabled:hover,+.datepicker table tr td span.active:hover.disabled:hover,+.datepicker table tr td span.active.disabled.disabled:hover,+.datepicker table tr td span.active.disabled:hover.disabled:hover,+.datepicker table tr td span.active[disabled]:hover,+.datepicker table tr td span.active:hover[disabled]:hover,+.datepicker table tr td span.active.disabled[disabled]:hover,+.datepicker table tr td span.active.disabled:hover[disabled]:hover,+fieldset[disabled] .datepicker table tr td span.active:hover,+fieldset[disabled] .datepicker table tr td span.active:hover:hover,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,+.datepicker table tr td span.active.disabled:focus,+.datepicker table tr td span.active:hover.disabled:focus,+.datepicker table tr td span.active.disabled.disabled:focus,+.datepicker table tr td span.active.disabled:hover.disabled:focus,+.datepicker table tr td span.active[disabled]:focus,+.datepicker table tr td span.active:hover[disabled]:focus,+.datepicker table tr td span.active.disabled[disabled]:focus,+.datepicker table tr td span.active.disabled:hover[disabled]:focus,+fieldset[disabled] .datepicker table tr td span.active:focus,+fieldset[disabled] .datepicker table tr td span.active:hover:focus,+fieldset[disabled] .datepicker table tr td span.active.disabled:focus,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,+.datepicker table tr td span.active.disabled:active,+.datepicker table tr td span.active:hover.disabled:active,+.datepicker table tr td span.active.disabled.disabled:active,+.datepicker table tr td span.active.disabled:hover.disabled:active,+.datepicker table tr td span.active[disabled]:active,+.datepicker table tr td span.active:hover[disabled]:active,+.datepicker table tr td span.active.disabled[disabled]:active,+.datepicker table tr td span.active.disabled:hover[disabled]:active,+fieldset[disabled] .datepicker table tr td span.active:active,+fieldset[disabled] .datepicker table tr td span.active:hover:active,+fieldset[disabled] .datepicker table tr td span.active.disabled:active,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active,+.datepicker table tr td span.active.disabled.active,+.datepicker table tr td span.active:hover.disabled.active,+.datepicker table tr td span.active.disabled.disabled.active,+.datepicker table tr td span.active.disabled:hover.disabled.active,+.datepicker table tr td span.active[disabled].active,+.datepicker table tr td span.active:hover[disabled].active,+.datepicker table tr td span.active.disabled[disabled].active,+.datepicker table tr td span.active.disabled:hover[disabled].active,+fieldset[disabled] .datepicker table tr td span.active.active,+fieldset[disabled] .datepicker table tr td span.active:hover.active,+fieldset[disabled] .datepicker table tr td span.active.disabled.active,+fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {+ background-color: #428bca;+ border-color: #357ebd;+}+.datepicker table tr td span.old,+.datepicker table tr td span.new {+ color: #999999;+}+.datepicker th.datepicker-switch {+ width: 145px;+}+.datepicker thead tr:first-child th,+.datepicker tfoot tr th {+ cursor: pointer;+}+.datepicker thead tr:first-child th:hover,+.datepicker tfoot tr th:hover {+ background: #eeeeee;+}+.datepicker .cw {+ font-size: 10px;+ width: 12px;+ padding: 0 2px 0 5px;+ vertical-align: middle;+}+.datepicker thead tr:first-child th.cw {+ cursor: default;+ background-color: transparent;+}+.input-group.date .input-group-addon i {+ cursor: pointer;+ width: 16px;+ height: 16px;+}+.input-daterange input {+ text-align: center;+}+.input-daterange input:first-child {+ border-radius: 3px 0 0 3px;+}+.input-daterange input:last-child {+ border-radius: 0 3px 3px 0;+}+.input-daterange .input-group-addon {+ width: auto;+ min-width: 16px;+ padding: 4px 5px;+ font-weight: normal;+ line-height: 1.428571429;+ text-align: center;+ text-shadow: 0 1px 0 #fff;+ vertical-align: middle;+ background-color: #eeeeee;+ border: solid #cccccc;+ border-width: 1px 0;+ margin-left: -5px;+ margin-right: -5px;+}+.datepicker.dropdown-menu {+ position: absolute;+ top: 100%;+ left: 0;+ z-index: 1000;+ float: left;+ display: none;+ min-width: 160px;+ list-style: none;+ background-color: #ffffff;+ border: 1px solid #ccc;+ border: 1px solid rgba(0, 0, 0, 0.2);+ border-radius: 5px;+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);+ -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);+ -webkit-background-clip: padding-box;+ -moz-background-clip: padding;+ background-clip: padding-box;+ *border-right-width: 2px;+ *border-bottom-width: 2px;+ color: #333333;+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;+ font-size: 13px;+ line-height: 1.428571429;+}+.datepicker.dropdown-menu th,+.datepicker.dropdown-menu td {+ padding: 4px 5px;+}diff --git a/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.js b/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.jsnew file mode 100644index 000000000..f17de6d1c--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.js@@ -0,0 +1,1671 @@+/* =========================================================+ * bootstrap-datepicker.js+ * Repo: https://github.com/eternicode/bootstrap-datepicker/+ * Demo: http://eternicode.github.io/bootstrap-datepicker/+ * Docs: http://bootstrap-datepicker.readthedocs.org/+ * Forked from http://www.eyecon.ro/bootstrap-datepicker+ * =========================================================+ * Started by Stefan Petre; improvements by Andrew Rowls + contributors+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ * ========================================================= */++(function($, undefined){++ var $window = $(window);++ function UTCDate(){+ return new Date(Date.UTC.apply(Date, arguments));+ }+ function UTCToday(){+ var today = new Date();+ return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());+ }+ function alias(method){+ return function(){+ return this[method].apply(this, arguments);+ };+ }++ var DateArray = (function(){+ var extras = {+ get: function(i){+ return this.slice(i)[0];+ },+ contains: function(d){+ // Array.indexOf is not cross-browser;+ // $.inArray doesn't work with Dates+ var val = d && d.valueOf();+ for (var i=0, l=this.length; i < l; i++)+ if (this[i].valueOf() === val)+ return i;+ return -1;+ },+ remove: function(i){+ this.splice(i,1);+ },+ replace: function(new_array){+ if (!new_array)+ return;+ if (!$.isArray(new_array))+ new_array = [new_array];+ this.clear();+ this.push.apply(this, new_array);+ },+ clear: function(){+ this.splice(0);+ },+ copy: function(){+ var a = new DateArray();+ a.replace(this);+ return a;+ }+ };++ return function(){+ var a = [];+ a.push.apply(a, arguments);+ $.extend(a, extras);+ return a;+ };+ })();+++ // Picker object++ var Datepicker = function(element, options){+ this.dates = new DateArray();+ this.viewDate = UTCToday();+ this.focusDate = null;++ this._process_options(options);++ this.element = $(element);+ this.isInline = false;+ this.isInput = this.element.is('input');+ this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;+ this.hasInput = this.component && this.element.find('input').length;+ if (this.component && this.component.length === 0)+ this.component = false;++ this.picker = $(DPGlobal.template);+ this._buildEvents();+ this._attachEvents();++ if (this.isInline){+ this.picker.addClass('datepicker-inline').appendTo(this.element);+ }+ else {+ this.picker.addClass('datepicker-dropdown dropdown-menu');+ }++ if (this.o.rtl){+ this.picker.addClass('datepicker-rtl');+ }++ this.viewMode = this.o.startView;++ if (this.o.calendarWeeks)+ this.picker.find('tfoot th.today')+ .attr('colspan', function(i, val){+ return parseInt(val) + 1;+ });++ this._allow_update = false;++ this.setStartDate(this._o.startDate);+ this.setEndDate(this._o.endDate);+ this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);++ this.fillDow();+ this.fillMonths();++ this._allow_update = true;++ this.update();+ this.showMode();++ if (this.isInline){+ this.show();+ }+ };++ Datepicker.prototype = {+ constructor: Datepicker,++ _process_options: function(opts){+ // Store raw options for reference+ this._o = $.extend({}, this._o, opts);+ // Processed options+ var o = this.o = $.extend({}, this._o);++ // Check if "de-DE" style date is available, if not language should+ // fallback to 2 letter code eg "de"+ var lang = o.language;+ if (!dates[lang]){+ lang = lang.split('-')[0];+ if (!dates[lang])+ lang = defaults.language;+ }+ o.language = lang;++ switch (o.startView){+ case 2:+ case 'decade':+ o.startView = 2;+ break;+ case 1:+ case 'year':+ o.startView = 1;+ break;+ default:+ o.startView = 0;+ }++ switch (o.minViewMode){+ case 1:+ case 'months':+ o.minViewMode = 1;+ break;+ case 2:+ case 'years':+ o.minViewMode = 2;+ break;+ default:+ o.minViewMode = 0;+ }++ o.startView = Math.max(o.startView, o.minViewMode);++ // true, false, or Number > 0+ if (o.multidate !== true){+ o.multidate = Number(o.multidate) || false;+ if (o.multidate !== false)+ o.multidate = Math.max(0, o.multidate);+ else+ o.multidate = 1;+ }+ o.multidateSeparator = String(o.multidateSeparator);++ o.weekStart %= 7;+ o.weekEnd = ((o.weekStart + 6) % 7);++ var format = DPGlobal.parseFormat(o.format);+ if (o.startDate !== -Infinity){+ if (!!o.startDate){+ if (o.startDate instanceof Date)+ o.startDate = this._local_to_utc(this._zero_time(o.startDate));+ else+ o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);+ }+ else {+ o.startDate = -Infinity;+ }+ }+ if (o.endDate !== Infinity){+ if (!!o.endDate){+ if (o.endDate instanceof Date)+ o.endDate = this._local_to_utc(this._zero_time(o.endDate));+ else+ o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);+ }+ else {+ o.endDate = Infinity;+ }+ }++ o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];+ if (!$.isArray(o.daysOfWeekDisabled))+ o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);+ o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){+ return parseInt(d, 10);+ });++ var plc = String(o.orientation).toLowerCase().split(/\s+/g),+ _plc = o.orientation.toLowerCase();+ plc = $.grep(plc, function(word){+ return (/^auto|left|right|top|bottom$/).test(word);+ });+ o.orientation = {x: 'auto', y: 'auto'};+ if (!_plc || _plc === 'auto')+ ; // no action+ else if (plc.length === 1){+ switch (plc[0]){+ case 'top':+ case 'bottom':+ o.orientation.y = plc[0];+ break;+ case 'left':+ case 'right':+ o.orientation.x = plc[0];+ break;+ }+ }+ else {+ _plc = $.grep(plc, function(word){+ return (/^left|right$/).test(word);+ });+ o.orientation.x = _plc[0] || 'auto';++ _plc = $.grep(plc, function(word){+ return (/^top|bottom$/).test(word);+ });+ o.orientation.y = _plc[0] || 'auto';+ }+ },+ _events: [],+ _secondaryEvents: [],+ _applyEvents: function(evs){+ for (var i=0, el, ch, ev; i < evs.length; i++){+ el = evs[i][0];+ if (evs[i].length === 2){+ ch = undefined;+ ev = evs[i][1];+ }+ else if (evs[i].length === 3){+ ch = evs[i][1];+ ev = evs[i][2];+ }+ el.on(ev, ch);+ }+ },+ _unapplyEvents: function(evs){+ for (var i=0, el, ev, ch; i < evs.length; i++){+ el = evs[i][0];+ if (evs[i].length === 2){+ ch = undefined;+ ev = evs[i][1];+ }+ else if (evs[i].length === 3){+ ch = evs[i][1];+ ev = evs[i][2];+ }+ el.off(ev, ch);+ }+ },+ _buildEvents: function(){+ if (this.isInput){ // single input+ this._events = [+ [this.element, {+ focus: $.proxy(this.show, this),+ keyup: $.proxy(function(e){+ if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)+ this.update();+ }, this),+ keydown: $.proxy(this.keydown, this)+ }]+ ];+ }+ else if (this.component && this.hasInput){ // component: input + button+ this._events = [+ // For components that are not readonly, allow keyboard nav+ [this.element.find('input'), {+ focus: $.proxy(this.show, this),+ keyup: $.proxy(function(e){+ if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)+ this.update();+ }, this),+ keydown: $.proxy(this.keydown, this)+ }],+ [this.component, {+ click: $.proxy(this.show, this)+ }]+ ];+ }+ else if (this.element.is('div')){ // inline datepicker+ this.isInline = true;+ }+ else {+ this._events = [+ [this.element, {+ click: $.proxy(this.show, this)+ }]+ ];+ }+ this._events.push(+ // Component: listen for blur on element descendants+ [this.element, '*', {+ blur: $.proxy(function(e){+ this._focused_from = e.target;+ }, this)+ }],+ // Input: listen for blur on element+ [this.element, {+ blur: $.proxy(function(e){+ this._focused_from = e.target;+ }, this)+ }]+ );++ this._secondaryEvents = [+ [this.picker, {+ click: $.proxy(this.click, this)+ }],+ [$(window), {+ resize: $.proxy(this.place, this)+ }],+ [$(document), {+ 'mousedown touchstart': $.proxy(function(e){+ // Clicked outside the datepicker, hide it+ if (!(+ this.element.is(e.target) ||+ this.element.find(e.target).length ||+ this.picker.is(e.target) ||+ this.picker.find(e.target).length+ )){+ this.hide();+ }+ }, this)+ }]+ ];+ },+ _attachEvents: function(){+ this._detachEvents();+ this._applyEvents(this._events);+ },+ _detachEvents: function(){+ this._unapplyEvents(this._events);+ },+ _attachSecondaryEvents: function(){+ this._detachSecondaryEvents();+ this._applyEvents(this._secondaryEvents);+ },+ _detachSecondaryEvents: function(){+ this._unapplyEvents(this._secondaryEvents);+ },+ _trigger: function(event, altdate){+ var date = altdate || this.dates.get(-1),+ local_date = this._utc_to_local(date);++ this.element.trigger({+ type: event,+ date: local_date,+ dates: $.map(this.dates, this._utc_to_local),+ format: $.proxy(function(ix, format){+ if (arguments.length === 0){+ ix = this.dates.length - 1;+ format = this.o.format;+ }+ else if (typeof ix === 'string'){+ format = ix;+ ix = this.dates.length - 1;+ }+ format = format || this.o.format;+ var date = this.dates.get(ix);+ return DPGlobal.formatDate(date, format, this.o.language);+ }, this)+ });+ },++ show: function(){+ if (!this.isInline)+ this.picker.appendTo('body');+ this.picker.show();+ this.place();+ this._attachSecondaryEvents();+ this._trigger('show');+ },++ hide: function(){+ if (this.isInline)+ return;+ if (!this.picker.is(':visible'))+ return;+ this.focusDate = null;+ this.picker.hide().detach();+ this._detachSecondaryEvents();+ this.viewMode = this.o.startView;+ this.showMode();++ if (+ this.o.forceParse &&+ (+ this.isInput && this.element.val() ||+ this.hasInput && this.element.find('input').val()+ )+ )+ this.setValue();+ this._trigger('hide');+ },++ remove: function(){+ this.hide();+ this._detachEvents();+ this._detachSecondaryEvents();+ this.picker.remove();+ delete this.element.data().datepicker;+ if (!this.isInput){+ delete this.element.data().date;+ }+ },++ _utc_to_local: function(utc){+ return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));+ },+ _local_to_utc: function(local){+ return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));+ },+ _zero_time: function(local){+ return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());+ },+ _zero_utc_time: function(utc){+ return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));+ },++ getDates: function(){+ return $.map(this.dates, this._utc_to_local);+ },++ getUTCDates: function(){+ return $.map(this.dates, function(d){+ return new Date(d);+ });+ },++ getDate: function(){+ return this._utc_to_local(this.getUTCDate());+ },++ getUTCDate: function(){+ return new Date(this.dates.get(-1));+ },++ setDates: function(){+ var args = $.isArray(arguments[0]) ? arguments[0] : arguments;+ this.update.apply(this, args);+ this._trigger('changeDate');+ this.setValue();+ },++ setUTCDates: function(){+ var args = $.isArray(arguments[0]) ? arguments[0] : arguments;+ this.update.apply(this, $.map(args, this._utc_to_local));+ this._trigger('changeDate');+ this.setValue();+ },++ setDate: alias('setDates'),+ setUTCDate: alias('setUTCDates'),++ setValue: function(){+ var formatted = this.getFormattedDate();+ if (!this.isInput){+ if (this.component){+ this.element.find('input').val(formatted).change();+ }+ }+ else {+ this.element.val(formatted).change();+ }+ },++ getFormattedDate: function(format){+ if (format === undefined)+ format = this.o.format;++ var lang = this.o.language;+ return $.map(this.dates, function(d){+ return DPGlobal.formatDate(d, format, lang);+ }).join(this.o.multidateSeparator);+ },++ setStartDate: function(startDate){+ this._process_options({startDate: startDate});+ this.update();+ this.updateNavArrows();+ },++ setEndDate: function(endDate){+ this._process_options({endDate: endDate});+ this.update();+ this.updateNavArrows();+ },++ setDaysOfWeekDisabled: function(daysOfWeekDisabled){+ this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});+ this.update();+ this.updateNavArrows();+ },++ place: function(){+ if (this.isInline)+ return;+ var calendarWidth = this.picker.outerWidth(),+ calendarHeight = this.picker.outerHeight(),+ visualPadding = 10,+ windowWidth = $window.width(),+ windowHeight = $window.height(),+ scrollTop = $window.scrollTop();++ var zIndex = parseInt(this.element.parents().filter(function(){+ return $(this).css('z-index') !== 'auto';+ }).first().css('z-index'))+10;+ var offset = this.component ? this.component.parent().offset() : this.element.offset();+ var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);+ var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);+ var left = offset.left,+ top = offset.top;++ this.picker.removeClass(+ 'datepicker-orient-top datepicker-orient-bottom '++ 'datepicker-orient-right datepicker-orient-left'+ );++ if (this.o.orientation.x !== 'auto'){+ this.picker.addClass('datepicker-orient-' + this.o.orientation.x);+ if (this.o.orientation.x === 'right')+ left -= calendarWidth - width;+ }+ // auto x orientation is best-placement: if it crosses a window+ // edge, fudge it sideways+ else {+ // Default to left+ this.picker.addClass('datepicker-orient-left');+ if (offset.left < 0)+ left -= offset.left - visualPadding;+ else if (offset.left + calendarWidth > windowWidth)+ left = windowWidth - calendarWidth - visualPadding;+ }++ // auto y orientation is best-situation: top or bottom, no fudging,+ // decision based on which shows more of the calendar+ var yorient = this.o.orientation.y,+ top_overflow, bottom_overflow;+ if (yorient === 'auto'){+ top_overflow = -scrollTop + offset.top - calendarHeight;+ bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);+ if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)+ yorient = 'top';+ else+ yorient = 'bottom';+ }+ this.picker.addClass('datepicker-orient-' + yorient);+ if (yorient === 'top')+ top += height;+ else+ top -= calendarHeight + parseInt(this.picker.css('padding-top'));++ this.picker.css({+ top: top,+ left: left,+ zIndex: zIndex+ });+ },++ _allow_update: true,+ update: function(){+ if (!this._allow_update)+ return;++ var oldDates = this.dates.copy(),+ dates = [],+ fromArgs = false;+ if (arguments.length){+ $.each(arguments, $.proxy(function(i, date){+ if (date instanceof Date)+ date = this._local_to_utc(date);+ dates.push(date);+ }, this));+ fromArgs = true;+ }+ else {+ dates = this.isInput+ ? this.element.val()+ : this.element.data('date') || this.element.find('input').val();+ if (dates && this.o.multidate)+ dates = dates.split(this.o.multidateSeparator);+ else+ dates = [dates];+ delete this.element.data().date;+ }++ dates = $.map(dates, $.proxy(function(date){+ return DPGlobal.parseDate(date, this.o.format, this.o.language);+ }, this));+ dates = $.grep(dates, $.proxy(function(date){+ return (+ date < this.o.startDate ||+ date > this.o.endDate ||+ !date+ );+ }, this), true);+ this.dates.replace(dates);++ if (this.dates.length)+ this.viewDate = new Date(this.dates.get(-1));+ else if (this.viewDate < this.o.startDate)+ this.viewDate = new Date(this.o.startDate);+ else if (this.viewDate > this.o.endDate)+ this.viewDate = new Date(this.o.endDate);++ if (fromArgs){+ // setting date by clicking+ this.setValue();+ }+ else if (dates.length){+ // setting date by typing+ if (String(oldDates) !== String(this.dates))+ this._trigger('changeDate');+ }+ if (!this.dates.length && oldDates.length)+ this._trigger('clearDate');++ this.fill();+ },++ fillDow: function(){+ var dowCnt = this.o.weekStart,+ html = '<tr>';+ if (this.o.calendarWeeks){+ var cell = '<th class="cw"> </th>';+ html += cell;+ this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);+ }+ while (dowCnt < this.o.weekStart + 7){+ html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';+ }+ html += '</tr>';+ this.picker.find('.datepicker-days thead').append(html);+ },++ fillMonths: function(){+ var html = '',+ i = 0;+ while (i < 12){+ html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';+ }+ this.picker.find('.datepicker-months td').html(html);+ },++ setRange: function(range){+ if (!range || !range.length)+ delete this.range;+ else+ this.range = $.map(range, function(d){+ return d.valueOf();+ });+ this.fill();+ },++ getClassNames: function(date){+ var cls = [],+ year = this.viewDate.getUTCFullYear(),+ month = this.viewDate.getUTCMonth(),+ today = new Date();+ if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){+ cls.push('old');+ }+ else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){+ cls.push('new');+ }+ if (this.focusDate && date.valueOf() === this.focusDate.valueOf())+ cls.push('focused');+ // Compare internal UTC date with local today, not UTC today+ if (this.o.todayHighlight &&+ date.getUTCFullYear() === today.getFullYear() &&+ date.getUTCMonth() === today.getMonth() &&+ date.getUTCDate() === today.getDate()){+ cls.push('today');+ }+ if (this.dates.contains(date) !== -1)+ cls.push('active');+ if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||+ $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){+ cls.push('disabled');+ }+ if (this.range){+ if (date > this.range[0] && date < this.range[this.range.length-1]){+ cls.push('range');+ }+ if ($.inArray(date.valueOf(), this.range) !== -1){+ cls.push('selected');+ }+ }+ return cls;+ },++ fill: function(){+ var d = new Date(this.viewDate),+ year = d.getUTCFullYear(),+ month = d.getUTCMonth(),+ startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,+ startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,+ endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,+ endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,+ todaytxt = dates[this.o.language].today || dates['en'].today || '',+ cleartxt = dates[this.o.language].clear || dates['en'].clear || '',+ tooltip;+ this.picker.find('.datepicker-days thead th.datepicker-switch')+ .text(dates[this.o.language].months[month]+' '+year);+ this.picker.find('tfoot th.today')+ .text(todaytxt)+ .toggle(this.o.todayBtn !== false);+ this.picker.find('tfoot th.clear')+ .text(cleartxt)+ .toggle(this.o.clearBtn !== false);+ this.updateNavArrows();+ this.fillMonths();+ var prevMonth = UTCDate(year, month-1, 28),+ day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());+ prevMonth.setUTCDate(day);+ prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);+ var nextMonth = new Date(prevMonth);+ nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);+ nextMonth = nextMonth.valueOf();+ var html = [];+ var clsName;+ while (prevMonth.valueOf() < nextMonth){+ if (prevMonth.getUTCDay() === this.o.weekStart){+ html.push('<tr>');+ if (this.o.calendarWeeks){+ // ISO 8601: First week contains first thursday.+ // ISO also states week starts on Monday, but we can be more abstract here.+ var+ // Start of current week: based on weekstart/current date+ ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),+ // Thursday of this week+ th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),+ // First Thursday of year, year from thursday+ yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),+ // Calendar week: ms between thursdays, div ms per day, div 7 days+ calWeek = (th - yth) / 864e5 / 7 + 1;+ html.push('<td class="cw">'+ calWeek +'</td>');++ }+ }+ clsName = this.getClassNames(prevMonth);+ clsName.push('day');++ if (this.o.beforeShowDay !== $.noop){+ var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));+ if (before === undefined)+ before = {};+ else if (typeof(before) === 'boolean')+ before = {enabled: before};+ else if (typeof(before) === 'string')+ before = {classes: before};+ if (before.enabled === false)+ clsName.push('disabled');+ if (before.classes)+ clsName = clsName.concat(before.classes.split(/\s+/));+ if (before.tooltip)+ tooltip = before.tooltip;+ }++ clsName = $.unique(clsName);+ html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');+ if (prevMonth.getUTCDay() === this.o.weekEnd){+ html.push('</tr>');+ }+ prevMonth.setUTCDate(prevMonth.getUTCDate()+1);+ }+ this.picker.find('.datepicker-days tbody').empty().append(html.join(''));++ var months = this.picker.find('.datepicker-months')+ .find('th:eq(1)')+ .text(year)+ .end()+ .find('span').removeClass('active');++ $.each(this.dates, function(i, d){+ if (d.getUTCFullYear() === year)+ months.eq(d.getUTCMonth()).addClass('active');+ });++ if (year < startYear || year > endYear){+ months.addClass('disabled');+ }+ if (year === startYear){+ months.slice(0, startMonth).addClass('disabled');+ }+ if (year === endYear){+ months.slice(endMonth+1).addClass('disabled');+ }++ html = '';+ year = parseInt(year/10, 10) * 10;+ var yearCont = this.picker.find('.datepicker-years')+ .find('th:eq(1)')+ .text(year + '-' + (year + 9))+ .end()+ .find('td');+ year -= 1;+ var years = $.map(this.dates, function(d){+ return d.getUTCFullYear();+ }),+ classes;+ for (var i = -1; i < 11; i++){+ classes = ['year'];+ if (i === -1)+ classes.push('old');+ else if (i === 10)+ classes.push('new');+ if ($.inArray(year, years) !== -1)+ classes.push('active');+ if (year < startYear || year > endYear)+ classes.push('disabled');+ html += '<span class="' + classes.join(' ') + '">'+year+'</span>';+ year += 1;+ }+ yearCont.html(html);+ },++ updateNavArrows: function(){+ if (!this._allow_update)+ return;++ var d = new Date(this.viewDate),+ year = d.getUTCFullYear(),+ month = d.getUTCMonth();+ switch (this.viewMode){+ case 0:+ if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){+ this.picker.find('.prev').css({visibility: 'hidden'});+ }+ else {+ this.picker.find('.prev').css({visibility: 'visible'});+ }+ if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){+ this.picker.find('.next').css({visibility: 'hidden'});+ }+ else {+ this.picker.find('.next').css({visibility: 'visible'});+ }+ break;+ case 1:+ case 2:+ if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){+ this.picker.find('.prev').css({visibility: 'hidden'});+ }+ else {+ this.picker.find('.prev').css({visibility: 'visible'});+ }+ if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){+ this.picker.find('.next').css({visibility: 'hidden'});+ }+ else {+ this.picker.find('.next').css({visibility: 'visible'});+ }+ break;+ }+ },++ click: function(e){+ e.preventDefault();+ var target = $(e.target).closest('span, td, th'),+ year, month, day;+ if (target.length === 1){+ switch (target[0].nodeName.toLowerCase()){+ case 'th':+ switch (target[0].className){+ case 'datepicker-switch':+ this.showMode(1);+ break;+ case 'prev':+ case 'next':+ var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);+ switch (this.viewMode){+ case 0:+ this.viewDate = this.moveMonth(this.viewDate, dir);+ this._trigger('changeMonth', this.viewDate);+ break;+ case 1:+ case 2:+ this.viewDate = this.moveYear(this.viewDate, dir);+ if (this.viewMode === 1)+ this._trigger('changeYear', this.viewDate);+ break;+ }+ this.fill();+ break;+ case 'today':+ var date = new Date();+ date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);++ this.showMode(-2);+ var which = this.o.todayBtn === 'linked' ? null : 'view';+ this._setDate(date, which);+ break;+ case 'clear':+ var element;+ if (this.isInput)+ element = this.element;+ else if (this.component)+ element = this.element.find('input');+ if (element)+ element.val("").change();+ this.update();+ this._trigger('changeDate');+ if (this.o.autoclose)+ this.hide();+ break;+ }+ break;+ case 'span':+ if (!target.is('.disabled')){+ this.viewDate.setUTCDate(1);+ if (target.is('.month')){+ day = 1;+ month = target.parent().find('span').index(target);+ year = this.viewDate.getUTCFullYear();+ this.viewDate.setUTCMonth(month);+ this._trigger('changeMonth', this.viewDate);+ if (this.o.minViewMode === 1){+ this._setDate(UTCDate(year, month, day));+ }+ }+ else {+ day = 1;+ month = 0;+ year = parseInt(target.text(), 10)||0;+ this.viewDate.setUTCFullYear(year);+ this._trigger('changeYear', this.viewDate);+ if (this.o.minViewMode === 2){+ this._setDate(UTCDate(year, month, day));+ }+ }+ this.showMode(-1);+ this.fill();+ }+ break;+ case 'td':+ if (target.is('.day') && !target.is('.disabled')){+ day = parseInt(target.text(), 10)||1;+ year = this.viewDate.getUTCFullYear();+ month = this.viewDate.getUTCMonth();+ if (target.is('.old')){+ if (month === 0){+ month = 11;+ year -= 1;+ }+ else {+ month -= 1;+ }+ }+ else if (target.is('.new')){+ if (month === 11){+ month = 0;+ year += 1;+ }+ else {+ month += 1;+ }+ }+ this._setDate(UTCDate(year, month, day));+ }+ break;+ }+ }+ if (this.picker.is(':visible') && this._focused_from){+ $(this._focused_from).focus();+ }+ delete this._focused_from;+ },++ _toggle_multidate: function(date){+ var ix = this.dates.contains(date);+ if (!date){+ this.dates.clear();+ }+ else if (ix !== -1){+ this.dates.remove(ix);+ }+ else {+ this.dates.push(date);+ }+ if (typeof this.o.multidate === 'number')+ while (this.dates.length > this.o.multidate)+ this.dates.remove(0);+ },++ _setDate: function(date, which){+ if (!which || which === 'date')+ this._toggle_multidate(date && new Date(date));+ if (!which || which === 'view')+ this.viewDate = date && new Date(date);++ this.fill();+ this.setValue();+ this._trigger('changeDate');+ var element;+ if (this.isInput){+ element = this.element;+ }+ else if (this.component){+ element = this.element.find('input');+ }+ if (element){+ element.change();+ }+ if (this.o.autoclose && (!which || which === 'date')){+ this.hide();+ }+ },++ moveMonth: function(date, dir){+ if (!date)+ return undefined;+ if (!dir)+ return date;+ var new_date = new Date(date.valueOf()),+ day = new_date.getUTCDate(),+ month = new_date.getUTCMonth(),+ mag = Math.abs(dir),+ new_month, test;+ dir = dir > 0 ? 1 : -1;+ if (mag === 1){+ test = dir === -1+ // If going back one month, make sure month is not current month+ // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)+ ? function(){+ return new_date.getUTCMonth() === month;+ }+ // If going forward one month, make sure month is as expected+ // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)+ : function(){+ return new_date.getUTCMonth() !== new_month;+ };+ new_month = month + dir;+ new_date.setUTCMonth(new_month);+ // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11+ if (new_month < 0 || new_month > 11)+ new_month = (new_month + 12) % 12;+ }+ else {+ // For magnitudes >1, move one month at a time...+ for (var i=0; i < mag; i++)+ // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...+ new_date = this.moveMonth(new_date, dir);+ // ...then reset the day, keeping it in the new month+ new_month = new_date.getUTCMonth();+ new_date.setUTCDate(day);+ test = function(){+ return new_month !== new_date.getUTCMonth();+ };+ }+ // Common date-resetting loop -- if date is beyond end of month, make it+ // end of month+ while (test()){+ new_date.setUTCDate(--day);+ new_date.setUTCMonth(new_month);+ }+ return new_date;+ },++ moveYear: function(date, dir){+ return this.moveMonth(date, dir*12);+ },++ dateWithinRange: function(date){+ return date >= this.o.startDate && date <= this.o.endDate;+ },++ keydown: function(e){+ if (this.picker.is(':not(:visible)')){+ if (e.keyCode === 27) // allow escape to hide and re-show picker+ this.show();+ return;+ }+ var dateChanged = false,+ dir, newDate, newViewDate,+ focusDate = this.focusDate || this.viewDate;+ switch (e.keyCode){+ case 27: // escape+ if (this.focusDate){+ this.focusDate = null;+ this.viewDate = this.dates.get(-1) || this.viewDate;+ this.fill();+ }+ else+ this.hide();+ e.preventDefault();+ break;+ case 37: // left+ case 39: // right+ if (!this.o.keyboardNavigation)+ break;+ dir = e.keyCode === 37 ? -1 : 1;+ if (e.ctrlKey){+ newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);+ newViewDate = this.moveYear(focusDate, dir);+ this._trigger('changeYear', this.viewDate);+ }+ else if (e.shiftKey){+ newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);+ newViewDate = this.moveMonth(focusDate, dir);+ this._trigger('changeMonth', this.viewDate);+ }+ else {+ newDate = new Date(this.dates.get(-1) || UTCToday());+ newDate.setUTCDate(newDate.getUTCDate() + dir);+ newViewDate = new Date(focusDate);+ newViewDate.setUTCDate(focusDate.getUTCDate() + dir);+ }+ if (this.dateWithinRange(newDate)){+ this.focusDate = this.viewDate = newViewDate;+ this.setValue();+ this.fill();+ e.preventDefault();+ }+ break;+ case 38: // up+ case 40: // down+ if (!this.o.keyboardNavigation)+ break;+ dir = e.keyCode === 38 ? -1 : 1;+ if (e.ctrlKey){+ newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);+ newViewDate = this.moveYear(focusDate, dir);+ this._trigger('changeYear', this.viewDate);+ }+ else if (e.shiftKey){+ newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);+ newViewDate = this.moveMonth(focusDate, dir);+ this._trigger('changeMonth', this.viewDate);+ }+ else {+ newDate = new Date(this.dates.get(-1) || UTCToday());+ newDate.setUTCDate(newDate.getUTCDate() + dir * 7);+ newViewDate = new Date(focusDate);+ newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);+ }+ if (this.dateWithinRange(newDate)){+ this.focusDate = this.viewDate = newViewDate;+ this.setValue();+ this.fill();+ e.preventDefault();+ }+ break;+ case 32: // spacebar+ // Spacebar is used in manually typing dates in some formats.+ // As such, its behavior should not be hijacked.+ break;+ case 13: // enter+ focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;+ this._toggle_multidate(focusDate);+ dateChanged = true;+ this.focusDate = null;+ this.viewDate = this.dates.get(-1) || this.viewDate;+ this.setValue();+ this.fill();+ if (this.picker.is(':visible')){+ e.preventDefault();+ if (this.o.autoclose)+ this.hide();+ }+ break;+ case 9: // tab+ this.focusDate = null;+ this.viewDate = this.dates.get(-1) || this.viewDate;+ this.fill();+ this.hide();+ break;+ }+ if (dateChanged){+ if (this.dates.length)+ this._trigger('changeDate');+ else+ this._trigger('clearDate');+ var element;+ if (this.isInput){+ element = this.element;+ }+ else if (this.component){+ element = this.element.find('input');+ }+ if (element){+ element.change();+ }+ }+ },++ showMode: function(dir){+ if (dir){+ this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));+ }+ this.picker+ .find('>div')+ .hide()+ .filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)+ .css('display', 'block');+ this.updateNavArrows();+ }+ };++ var DateRangePicker = function(element, options){+ this.element = $(element);+ this.inputs = $.map(options.inputs, function(i){+ return i.jquery ? i[0] : i;+ });+ delete options.inputs;++ $(this.inputs)+ .datepicker(options)+ .bind('changeDate', $.proxy(this.dateUpdated, this));++ this.pickers = $.map(this.inputs, function(i){+ return $(i).data('datepicker');+ });+ this.updateDates();+ };+ DateRangePicker.prototype = {+ updateDates: function(){+ this.dates = $.map(this.pickers, function(i){+ return i.getUTCDate();+ });+ this.updateRanges();+ },+ updateRanges: function(){+ var range = $.map(this.dates, function(d){+ return d.valueOf();+ });+ $.each(this.pickers, function(i, p){+ p.setRange(range);+ });+ },+ dateUpdated: function(e){+ // `this.updating` is a workaround for preventing infinite recursion+ // between `changeDate` triggering and `setUTCDate` calling. Until+ // there is a better mechanism.+ if (this.updating)+ return;+ this.updating = true;++ var dp = $(e.target).data('datepicker'),+ new_date = dp.getUTCDate(),+ i = $.inArray(e.target, this.inputs),+ l = this.inputs.length;+ if (i === -1)+ return;++ $.each(this.pickers, function(i, p){+ if (!p.getUTCDate())+ p.setUTCDate(new_date);+ });++ if (new_date < this.dates[i]){+ // Date being moved earlier/left+ while (i >= 0 && new_date < this.dates[i]){+ this.pickers[i--].setUTCDate(new_date);+ }+ }+ else if (new_date > this.dates[i]){+ // Date being moved later/right+ while (i < l && new_date > this.dates[i]){+ this.pickers[i++].setUTCDate(new_date);+ }+ }+ this.updateDates();++ delete this.updating;+ },+ remove: function(){+ $.map(this.pickers, function(p){ p.remove(); });+ delete this.element.data().datepicker;+ }+ };++ function opts_from_el(el, prefix){+ // Derive options from element data-attrs+ var data = $(el).data(),+ out = {}, inkey,+ replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');+ prefix = new RegExp('^' + prefix.toLowerCase());+ function re_lower(_,a){+ return a.toLowerCase();+ }+ for (var key in data)+ if (prefix.test(key)){+ inkey = key.replace(replace, re_lower);+ out[inkey] = data[key];+ }+ return out;+ }++ function opts_from_locale(lang){+ // Derive options from locale plugins+ var out = {};+ // Check if "de-DE" style date is available, if not language should+ // fallback to 2 letter code eg "de"+ if (!dates[lang]){+ lang = lang.split('-')[0];+ if (!dates[lang])+ return;+ }+ var d = dates[lang];+ $.each(locale_opts, function(i,k){+ if (k in d)+ out[k] = d[k];+ });+ return out;+ }++ var old = $.fn.datepicker;+ $.fn.datepicker = function(option){+ var args = Array.apply(null, arguments);+ args.shift();+ var internal_return;+ this.each(function(){+ var $this = $(this),+ data = $this.data('datepicker'),+ options = typeof option === 'object' && option;+ if (!data){+ var elopts = opts_from_el(this, 'date'),+ // Preliminary otions+ xopts = $.extend({}, defaults, elopts, options),+ locopts = opts_from_locale(xopts.language),+ // Options priority: js args, data-attrs, locales, defaults+ opts = $.extend({}, defaults, locopts, elopts, options);+ if ($this.is('.input-daterange') || opts.inputs){+ var ropts = {+ inputs: opts.inputs || $this.find('input').toArray()+ };+ $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));+ }+ else {+ $this.data('datepicker', (data = new Datepicker(this, opts)));+ }+ }+ if (typeof option === 'string' && typeof data[option] === 'function'){+ internal_return = data[option].apply(data, args);+ if (internal_return !== undefined)+ return false;+ }+ });+ if (internal_return !== undefined)+ return internal_return;+ else+ return this;+ };++ var defaults = $.fn.datepicker.defaults = {+ autoclose: false,+ beforeShowDay: $.noop,+ calendarWeeks: false,+ clearBtn: false,+ daysOfWeekDisabled: [],+ endDate: Infinity,+ forceParse: true,+ format: 'mm/dd/yyyy',+ keyboardNavigation: true,+ language: 'en',+ minViewMode: 0,+ multidate: false,+ multidateSeparator: ',',+ orientation: "auto",+ rtl: false,+ startDate: -Infinity,+ startView: 0,+ todayBtn: false,+ todayHighlight: false,+ weekStart: 0+ };+ var locale_opts = $.fn.datepicker.locale_opts = [+ 'format',+ 'rtl',+ 'weekStart'+ ];+ $.fn.datepicker.Constructor = Datepicker;+ var dates = $.fn.datepicker.dates = {+ en: {+ days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],+ daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],+ daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],+ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],+ today: "Today",+ clear: "Clear"+ }+ };++ var DPGlobal = {+ modes: [+ {+ clsName: 'days',+ navFnc: 'Month',+ navStep: 1+ },+ {+ clsName: 'months',+ navFnc: 'FullYear',+ navStep: 1+ },+ {+ clsName: 'years',+ navFnc: 'FullYear',+ navStep: 10+ }],+ isLeapYear: function(year){+ return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));+ },+ getDaysInMonth: function(year, month){+ return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];+ },+ validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,+ nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,+ parseFormat: function(format){+ // IE treats \0 as a string end in inputs (truncating the value),+ // so it's a bad format delimiter, anyway+ var separators = format.replace(this.validParts, '\0').split('\0'),+ parts = format.match(this.validParts);+ if (!separators || !separators.length || !parts || parts.length === 0){+ throw new Error("Invalid date format.");+ }+ return {separators: separators, parts: parts};+ },+ parseDate: function(date, format, language){+ if (!date)+ return undefined;+ if (date instanceof Date)+ return date;+ if (typeof format === 'string')+ format = DPGlobal.parseFormat(format);+ var part_re = /([\-+]\d+)([dmwy])/,+ parts = date.match(/([\-+]\d+)([dmwy])/g),+ part, dir, i;+ if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){+ date = new Date();+ for (i=0; i < parts.length; i++){+ part = part_re.exec(parts[i]);+ dir = parseInt(part[1]);+ switch (part[2]){+ case 'd':+ date.setUTCDate(date.getUTCDate() + dir);+ break;+ case 'm':+ date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);+ break;+ case 'w':+ date.setUTCDate(date.getUTCDate() + dir * 7);+ break;+ case 'y':+ date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);+ break;+ }+ }+ return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);+ }+ parts = date && date.match(this.nonpunctuation) || [];+ date = new Date();+ var parsed = {},+ setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],+ setters_map = {+ yyyy: function(d,v){+ return d.setUTCFullYear(v);+ },+ yy: function(d,v){+ return d.setUTCFullYear(2000+v);+ },+ m: function(d,v){+ if (isNaN(d))+ return d;+ v -= 1;+ while (v < 0) v += 12;+ v %= 12;+ d.setUTCMonth(v);+ while (d.getUTCMonth() !== v)+ d.setUTCDate(d.getUTCDate()-1);+ return d;+ },+ d: function(d,v){+ return d.setUTCDate(v);+ }+ },+ val, filtered;+ setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];+ setters_map['dd'] = setters_map['d'];+ date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);+ var fparts = format.parts.slice();+ // Remove noop parts+ if (parts.length !== fparts.length){+ fparts = $(fparts).filter(function(i,p){+ return $.inArray(p, setters_order) !== -1;+ }).toArray();+ }+ // Process remainder+ function match_part(){+ var m = this.slice(0, parts[i].length),+ p = parts[i].slice(0, m.length);+ return m === p;+ }+ if (parts.length === fparts.length){+ var cnt;+ for (i=0, cnt = fparts.length; i < cnt; i++){+ val = parseInt(parts[i], 10);+ part = fparts[i];+ if (isNaN(val)){+ switch (part){+ case 'MM':+ filtered = $(dates[language].months).filter(match_part);+ val = $.inArray(filtered[0], dates[language].months) + 1;+ break;+ case 'M':+ filtered = $(dates[language].monthsShort).filter(match_part);+ val = $.inArray(filtered[0], dates[language].monthsShort) + 1;+ break;+ }+ }+ parsed[part] = val;+ }+ var _date, s;+ for (i=0; i < setters_order.length; i++){+ s = setters_order[i];+ if (s in parsed && !isNaN(parsed[s])){+ _date = new Date(date);+ setters_map[s](_date, parsed[s]);+ if (!isNaN(_date))+ date = _date;+ }+ }+ }+ return date;+ },+ formatDate: function(date, format, language){+ if (!date)+ return '';+ if (typeof format === 'string')+ format = DPGlobal.parseFormat(format);+ var val = {+ d: date.getUTCDate(),+ D: dates[language].daysShort[date.getUTCDay()],+ DD: dates[language].days[date.getUTCDay()],+ m: date.getUTCMonth() + 1,+ M: dates[language].monthsShort[date.getUTCMonth()],+ MM: dates[language].months[date.getUTCMonth()],+ yy: date.getUTCFullYear().toString().substring(2),+ yyyy: date.getUTCFullYear()+ };+ val.dd = (val.d < 10 ? '0' : '') + val.d;+ val.mm = (val.m < 10 ? '0' : '') + val.m;+ date = [];+ var seps = $.extend([], format.separators);+ for (var i=0, cnt = format.parts.length; i <= cnt; i++){+ if (seps.length)+ date.push(seps.shift());+ date.push(val[format.parts[i]]);+ }+ return date.join('');+ },+ headTemplate: '<thead>'++ '<tr>'++ '<th class="prev">«</th>'++ '<th colspan="5" class="datepicker-switch"></th>'++ '<th class="next">»</th>'++ '</tr>'++ '</thead>',+ contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',+ footTemplate: '<tfoot>'++ '<tr>'++ '<th colspan="7" class="today"></th>'++ '</tr>'++ '<tr>'++ '<th colspan="7" class="clear"></th>'++ '</tr>'++ '</tfoot>'+ };+ DPGlobal.template = '<div class="datepicker">'++ '<div class="datepicker-days">'++ '<table class=" table-condensed">'++ DPGlobal.headTemplate++ '<tbody></tbody>'++ DPGlobal.footTemplate++ '</table>'++ '</div>'++ '<div class="datepicker-months">'++ '<table class="table-condensed">'++ DPGlobal.headTemplate++ DPGlobal.contTemplate++ DPGlobal.footTemplate++ '</table>'++ '</div>'++ '<div class="datepicker-years">'++ '<table class="table-condensed">'++ DPGlobal.headTemplate++ DPGlobal.contTemplate++ DPGlobal.footTemplate++ '</table>'++ '</div>'++ '</div>';++ $.fn.datepicker.DPGlobal = DPGlobal;+++ /* DATEPICKER NO CONFLICT+ * =================== */++ $.fn.datepicker.noConflict = function(){+ $.fn.datepicker = old;+ return this;+ };+++ /* DATEPICKER DATA-API+ * ================== */++ $(document).on(+ 'focus.datepicker.data-api click.datepicker.data-api',+ '[data-provide="datepicker"]',+ function(e){+ var $this = $(this);+ if ($this.data('datepicker'))+ return;+ e.preventDefault();+ // component click requires us to explicitly show it+ $this.datepicker('show');+ }+ );+ $(function(){+ $('[data-provide="datepicker-inline"]').datepicker();+ });++}(window.jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.min.js b/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.min.jsnew file mode 100644index 000000000..e5ad70f05--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/bootstrap-datepicker.min.js@@ -0,0 +1,2 @@+eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([8S-Y]|[1-5]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(T(e,y){U G=e(3O);T w(){V 16 1a(1a.4n.2g(1a,1w))}T A(){U a=16 1a();V w(a.2O(),a.2P(),a.2C())}T I(a){V T(){V 8[a].2g(8,1w)}}U J=(T(){U f={1t:T(a){V 8.2D(a)[0]},3P:T(a){U c=a&&a.1A();1K(U b=0,d=8.17;b<d;b++)S(8[b].1A()===c)V b;V-1},2p:T(a){8.4o(a,1)},2Q:T(a){S(!a)V;S(!e.3k(a))a=[a];8.1U();8.1d.2g(8,a)},1U:T(){8.4o(0)},4p:T(){U a=16 J();a.2Q(8);V a}};V T(){U a=[];a.1d.2g(a,1w);e.2q(a,f);V a}})();U z=T(a,c){8.Y=16 J();8.18=A();8.1B=2r;8._3(c);8.19=e(a);8.2s=1j;8.1V=8.19.is(\'1C\');8.1q=8.19.is(\'.1W\')?8.19.1b(\'.add-on, .1C-group-addon, .btn\'):1j;8.3R=8.1q&&8.19.1b(\'1C\').17;S(8.1q&&8.1q.17===0)8.1q=1j;8.14=e(n.4q);8._g();8._h();S(8.2s){8.14.1L(\'X-4t\').4u(8.19)}W{8.14.1L(\'X-4v 4v-menu\')}S(8.o.3l){8.14.1L(\'X-3l\')}8.1X=8.o.1Y;S(8.o.3m)8.14.1b(\'2S th.2h\').attr(\'2T\',T(i,1Z){V 20(1Z)+1});8._4=1j;8.4w(8._5.1e);8.4x(8._5.1f);8.4y(8.o.1F);8.4z();8.3S();8._4=1D;8.1M();8.2E();S(8.2s){8.1N()}};z.2F={constructor:z,_3:T(c){8._5=e.2q({},8._5,c);U b=8.o=e.2q({},8._5);U d=b.1u;S(!o[d]){d=d.2t(\'-\')[0];S(!o[d])d=H.1u}b.1u=d;1x(b.1Y){15 2:15\'decade\':b.1Y=2;1c;15 1:15\'4A\':b.1Y=1;1c;4B:b.1Y=0}1x(b.21){15 1:15\'1O\':b.21=1;1c;15 2:15\'3n\':b.21=2;1c;4B:b.21=0}b.1Y=2G.3o(b.1Y,b.21);S(b.1G!==1D){b.1G=3T(b.1G)||1j;S(b.1G!==1j)b.1G=2G.3o(0,b.1G);W b.1G=1}b.2W=3p(b.2W);b.22%=7;b.4C=((b.22+6)%7);U f=n.3q(b.23);S(b.1e!==-1n){S(!!b.1e){S(b.1e 3r 1a)b.1e=8._8(8._b(b.1e));W b.1e=n.3t(b.1e,f,b.1u)}W{b.1e=-1n}}S(b.1f!==1n){S(!!b.1f){S(b.1f 3r 1a)b.1f=8._8(8._b(b.1f));W b.1f=n.3t(b.1f,f,b.1u)}W{b.1f=1n}}b.1F=b.1F||[];S(!e.3k(b.1F))b.1F=b.1F.2t(/[,\\s]*/);b.1F=e.1v(b.1F,T(a){V 20(a,10)});U g=3p(b.1E).2H().2t(/\\s+/g),h=b.1E.2H();g=e.3u(g,T(a){V(/^1P|1Q|2X|1H|2Y$/).2Z(a)});b.1E={x:\'1P\',y:\'1P\'};S(!h||h===\'1P\');W S(g.17===1){1x(g[0]){15\'1H\':15\'2Y\':b.1E.y=g[0];1c;15\'1Q\':15\'2X\':b.1E.x=g[0];1c}}W{h=e.3u(g,T(a){V(/^1Q|2X$/).2Z(a)});b.1E.x=h[0]||\'1P\';h=e.3u(g,T(a){V(/^1H|2Y$/).2Z(a)});b.1E.y=h[0]||\'1P\'}},_1:[],_9:[],_c:T(a){1K(U c=0,b,d,f;c<a.17;c++){b=a[c][0];S(a[c].17===2){d=y;f=a[c][1]}W S(a[c].17===3){d=a[c][1];f=a[c][2]}b.on(f,d)}},_d:T(a){1K(U c=0,b,d,f;c<a.17;c++){b=a[c][0];S(a[c].17===2){f=y;d=a[c][1]}W S(a[c].17===3){f=a[c][1];d=a[c][2]}b.off(d,f)}},_g:T(){S(8.1V){8._1=[[8.19,{3w:e.1o(8.1N,8),4D:e.1o(T(a){S(e.24(a.2I,[27,37,39,38,40,32,13,9])===-1)8.1M()},8),33:e.1o(8.33,8)}]]}W S(8.1q&&8.3R){8._1=[[8.19.1b(\'1C\'),{3w:e.1o(8.1N,8),4D:e.1o(T(a){S(e.24(a.2I,[27,37,39,38,40,32,13,9])===-1)8.1M()},8),33:e.1o(8.33,8)}],[8.1q,{2J:e.1o(8.1N,8)}]]}W S(8.19.is(\'1R\')){8.2s=1D}W{8._1=[[8.19,{2J:e.1o(8.1N,8)}]]}8._1.1d([8.19,\'*\',{4E:e.1o(T(a){8._6=a.25},8)}],[8.19,{4E:e.1o(T(a){8._6=a.25},8)}]);8._9=[[8.14,{2J:e.1o(8.2J,8)}],[e(3O),{resize:e.1o(8.3X,8)}],[e(4F),{\'mousedown touchstart\':e.1o(T(a){S(!(8.19.is(a.25)||8.19.1b(a.25).17||8.14.is(a.25)||8.14.1b(a.25).17)){8.1I()}},8)}]]},_h:T(){8._e();8._c(8._1)},_e:T(){8._d(8._1)},_i:T(){8._a();8._c(8._9)},_a:T(){8._d(8._9)},_0:T(d,f){U g=f||8.Y.1t(-1),h=8._2(g);8.19.trigger({type:d,1W:h,Y:e.1v(8.Y,8._2),23:e.1o(T(a,c){S(1w.17===0){a=8.Y.17-1;c=8.o.23}W S(26 a===\'35\'){c=a;a=8.Y.17-1}c=c||8.o.23;U b=8.Y.1t(a);V n.3Z(b,c,8.o.1u)},8)})},1N:T(){S(!8.2s)8.14.4u(\'body\');8.14.1N();8.3X();8._i();8._0(\'1N\')},1I:T(){S(8.2s)V;S(!8.14.is(\':2i\'))V;8.1B=2r;8.14.1I().detach();8._a();8.1X=8.o.1Y;8.2E();S(8.o.4H&&(8.1V&&8.19.1Z()||8.3R&&8.19.1b(\'1C\').1Z()))8.2a();8._0(\'1I\')},2p:T(){8.1I();8._e();8._a();8.14.2p();2j 8.19.1s().X;S(!8.1V){2j 8.19.1s().1W}},_2:T(a){V a&&16 1a(a.4I()+(a.4J()*4K))},_8:T(a){V a&&16 1a(a.4I()-(a.4J()*4K))},_b:T(a){V a&&16 1a(a.2O(),a.2P(),a.2C())},_j:T(a){V a&&16 1a(1a.4n(a.1g(),a.1h(),a.1k()))},getDates:T(){V e.1v(8.Y,8._2)},getUTCDates:T(){V e.1v(8.Y,T(a){V 16 1a(a)})},2C:T(){V 8._2(8.1k())},1k:T(){V 16 1a(8.Y.1t(-1))},4L:T(){U a=e.3k(1w[0])?1w[0]:1w;8.1M.2g(8,a);8._0(\'2w\');8.2a()},4M:T(){U a=e.3k(1w[0])?1w[0]:1w;8.1M.2g(8,e.1v(a,8._2));8._0(\'2w\');8.2a()},setDate:I(\'4L\'),1m:I(\'4M\'),2a:T(){U a=8.4N();S(!8.1V){S(8.1q){8.19.1b(\'1C\').1Z(a).36()}}W{8.19.1Z(a).36()}},4N:T(c){S(c===y)c=8.o.23;U b=8.o.1u;V e.1v(8.Y,T(a){V n.3Z(a,c,b)}).3a(8.o.2W)},4w:T(a){8._3({1e:a});8.1M();8.2K()},4x:T(a){8._3({1f:a});8.1M();8.2K()},4y:T(a){8._3({1F:a});8.1M();8.2K()},3X:T(){S(8.2s)V;U a=8.14.41(),c=8.14.43(),b=10,d=G.width(),f=G.height(),g=G.scrollTop();U h=20(8.19.parents().3b(T(){V e(8).1y(\'z-44\')!==\'1P\'}).4O().1y(\'z-44\'))+10;U k=8.1q?8.1q.4P().4Q():8.19.4Q();U l=8.1q?8.1q.43(1D):8.19.43(1j);U m=8.1q?8.1q.41(1D):8.19.41(1j);U p=k.1Q,t=k.1H;8.14.4R(\'X-2x-1H X-2x-2Y X-2x-2X X-2x-1Q\');S(8.o.1E.x!==\'1P\'){8.14.1L(\'X-2x-\'+8.o.1E.x);S(8.o.1E.x===\'2X\')p-=a-m}W{8.14.1L(\'X-2x-1Q\');S(k.1Q<0)p-=k.1Q-b;W S(k.1Q+a>d)p=d-a-b}U j=8.o.1E.y,u,r;S(j===\'1P\'){u=-g+k.1H-c;r=g+f-(k.1H+l+c);S(2G.3o(u,r)===r)j=\'1H\';W j=\'2Y\'}8.14.1L(\'X-2x-\'+j);S(j===\'1H\')t+=l;W t-=c+20(8.14.1y(\'padding-1H\'));8.14.1y({1H:t,1Q:p,zIndex:h})},_4:1D,1M:T(){S(!8._4)V;U b=8.Y.4p(),d=[],f=1j;S(1w.17){e.2L(1w,e.1o(T(a,c){S(c 3r 1a)c=8._8(c);d.1d(c)},8));f=1D}W{d=8.1V?8.19.1Z():8.19.1s(\'1W\')||8.19.1b(\'1C\').1Z();S(d&&8.o.1G)d=d.2t(8.o.2W);W d=[d];2j 8.19.1s().1W}d=e.1v(d,e.1o(T(a){V n.3t(a,8.o.23,8.o.1u)},8));d=e.3u(d,e.1o(T(a){V(a<8.o.1e||a>8.o.1f||!a)},8),1D);8.Y.2Q(d);S(8.Y.17)8.18=16 1a(8.Y.1t(-1));W S(8.18<8.o.1e)8.18=16 1a(8.o.1e);W S(8.18>8.o.1f)8.18=16 1a(8.o.1f);S(f){8.2a()}W S(d.17){S(3p(b)!==3p(8.Y))8._0(\'2w\')}S(!8.Y.17&&b.17)8._0(\'4S\');8.1J()},4z:T(){U a=8.o.22,c=\'<tr>\';S(8.o.3m){U b=\'<th 1p="cw"> </th>\';c+=b;8.14.1b(\'.X-2k 3c tr:4O-child\').prepend(b)}2b(a<8.o.22+7){c+=\'<th 1p="dow">\'+o[8.o.1u].4U[(a++)%7]+\'</th>\'}c+=\'</tr>\';8.14.1b(\'.X-2k 3c\').4V(c)},3S:T(){U a=\'\',c=0;2b(c<12){a+=\'<2l 1p="4W">\'+o[8.o.1u].3d[c++]+\'</2l>\'}8.14.1b(\'.X-1O td\').4X(a)},4Y:T(c){S(!c||!c.17)2j 8.2m;W 8.2m=e.1v(c,T(a){V a.1A()});8.1J()},4Z:T(a){U c=[],b=8.18.1g(),d=8.18.1h(),f=16 1a();S(a.1g()<b||(a.1g()===b&&a.1h()<d)){c.1d(\'45\')}W S(a.1g()>b||(a.1g()===b&&a.1h()>d)){c.1d(\'16\')}S(8.1B&&a.1A()===8.1B.1A())c.1d(\'focused\');S(8.o.50&&a.1g()===f.2O()&&a.1h()===f.2P()&&a.1k()===f.2C()){c.1d(\'2h\')}S(8.Y.3P(a)!==-1)c.1d(\'3y\');S(a.1A()<8.o.1e||a.1A()>8.o.1f||e.24(a.2c(),8.o.1F)!==-1){c.1d(\'2n\')}S(8.2m){S(a>8.2m[0]&&a<8.2m[8.2m.17-1]){c.1d(\'2m\')}S(e.24(a.1A(),8.2m)!==-1){c.1d(\'selected\')}}V c},1J:T(){U b=16 1a(8.18),d=b.1g(),f=b.1h(),g=8.o.1e!==-1n?8.o.1e.1g():-1n,h=8.o.1e!==-1n?8.o.1e.1h():-1n,k=8.o.1f!==1n?8.o.1f.1g():1n,l=8.o.1f!==1n?8.o.1f.1h():1n,m=o[8.o.1u].2h||o[\'en\'].2h||\'\',p=o[8.o.1u].1U||o[\'en\'].1U||\'\',t;8.14.1b(\'.X-2k 3c th.X-1x\').2y(o[8.o.1u].1O[f]+\' \'+d);8.14.1b(\'2S th.2h\').2y(m).51(8.o.46!==1j);8.14.1b(\'2S th.1U\').2y(p).51(8.o.52!==1j);8.2K();8.3S();U j=w(d,f-1,28),u=n.53(j.1g(),j.1h());j.1m(u);j.1m(u-(j.2c()-8.o.22+7)%7);U r=16 1a(j);r.1m(r.1k()+42);r=r.1A();U q=[];U v;2b(j.1A()<r){S(j.2c()===8.o.22){q.1d(\'<tr>\');S(8.o.3m){U D=16 1a(+j+(8.o.22-j.2c()-7)%7*3A),B=16 1a(3T(D)+(7+4-D.2c())%7*3A),x=16 1a(3T(x=w(B.1g(),0,1))+(7+4-x.2c())%7*3A),L=(B-x)/3A/7+1;q.1d(\'<td 1p="cw">\'+L+\'</td>\')}}v=8.4Z(j);v.1d(\'54\');S(8.o.47!==e.55){U s=8.o.47(8._2(j));S(s===y)s={};W S(26(s)===\'boolean\')s={56:s};W S(26(s)===\'35\')s={48:s};S(s.56===1j)v.1d(\'2n\');S(s.48)v=v.concat(s.48.2t(/\\s+/));S(s.57)t=s.57}v=e.unique(v);q.1d(\'<td 1p="\'+v.3a(\' \')+\'"\'+(t?\' title="\'+t+\'"\':\'\')+\'>\'+j.1k()+\'</td>\');S(j.2c()===8.o.4C){q.1d(\'</tr>\')}j.1m(j.1k()+1)}8.14.1b(\'.X-2k 3e\').empty().4V(q.3a(\'\'));U E=8.14.1b(\'.X-1O\').1b(\'th:eq(1)\').2y(d).58().1b(\'2l\').4R(\'3y\');e.2L(8.Y,T(a,c){S(c.1g()===d)E.eq(c.1h()).1L(\'3y\')});S(d<g||d>k){E.1L(\'2n\')}S(d===g){E.2D(0,h).1L(\'2n\')}S(d===k){E.2D(l+1).1L(\'2n\')}q=\'\';d=20(d/10,10)*10;U M=8.14.1b(\'.X-3n\').1b(\'th:eq(1)\').2y(d+\'-\'+(d+9)).58().1b(\'td\');d-=1;U N=e.1v(8.Y,T(a){V a.1g()}),C;1K(U F=-1;F<11;F++){C=[\'4A\'];S(F===-1)C.1d(\'45\');W S(F===10)C.1d(\'16\');S(e.24(d,N)!==-1)C.1d(\'3y\');S(d<g||d>k)C.1d(\'2n\');q+=\'<2l 1p="\'+C.3a(\' \')+\'">\'+d+\'</2l>\';d+=1}M.4X(q)},2K:T(){S(!8._4)V;U a=16 1a(8.18),c=a.1g(),b=a.1h();1x(8.1X){15 0:S(8.o.1e!==-1n&&c<=8.o.1e.1g()&&b<=8.o.1e.1h()){8.14.1b(\'.2z\').1y({2o:\'3B\'})}W{8.14.1b(\'.2z\').1y({2o:\'2i\'})}S(8.o.1f!==1n&&c>=8.o.1f.1g()&&b>=8.o.1f.1h()){8.14.1b(\'.2M\').1y({2o:\'3B\'})}W{8.14.1b(\'.2M\').1y({2o:\'2i\'})}1c;15 1:15 2:S(8.o.1e!==-1n&&c<=8.o.1e.1g()){8.14.1b(\'.2z\').1y({2o:\'3B\'})}W{8.14.1b(\'.2z\').1y({2o:\'2i\'})}S(8.o.1f!==1n&&c>=8.o.1f.1g()){8.14.1b(\'.2M\').1y({2o:\'3B\'})}W{8.14.1b(\'.2M\').1y({2o:\'2i\'})}1c}},2J:T(a){a.2N();U c=e(a.25).closest(\'2l, td, th\'),b,d,f;S(c.17===1){1x(c[0].nodeName.2H()){15\'th\':1x(c[0].59){15\'X-1x\':8.2E(1);1c;15\'2z\':15\'2M\':U g=n.4a[8.1X].3C*(c[0].59===\'2z\'?-1:1);1x(8.1X){15 0:8.18=8.2d(8.18,g);8._0(\'3D\',8.18);1c;15 1:15 2:8.18=8.2A(8.18,g);S(8.1X===1)8._0(\'3E\',8.18);1c}8.1J();1c;15\'2h\':U h=16 1a();h=w(h.2O(),h.2P(),h.2C(),0,0,0);8.2E(-2);U k=8.o.46===\'linked\'?2r:\'5a\';8._7(h,k);1c;15\'1U\':U l;S(8.1V)l=8.19;W S(8.1q)l=8.19.1b(\'1C\');S(l)l.1Z("").36();8.1M();8._0(\'2w\');S(8.o.3F)8.1I();1c}1c;15\'2l\':S(!c.is(\'.2n\')){8.18.1m(1);S(c.is(\'.4W\')){f=1;d=c.4P().1b(\'2l\').44(c);b=8.18.1g();8.18.3G(d);8._0(\'3D\',8.18);S(8.o.21===1){8._7(w(b,d,f))}}W{f=1;d=0;b=20(c.2y(),10)||0;8.18.4b(b);8._0(\'3E\',8.18);S(8.o.21===2){8._7(w(b,d,f))}}8.2E(-1);8.1J()}1c;15\'td\':S(c.is(\'.54\')&&!c.is(\'.2n\')){f=20(c.2y(),10)||1;b=8.18.1g();d=8.18.1h();S(c.is(\'.45\')){S(d===0){d=11;b-=1}W{d-=1}}W S(c.is(\'.16\')){S(d===11){d=0;b+=1}W{d+=1}}8._7(w(b,d,f))}1c}}S(8.14.is(\':2i\')&&8._6){e(8._6).3w()}2j 8._6},_f:T(a){U c=8.Y.3P(a);S(!a){8.Y.1U()}W S(c!==-1){8.Y.2p(c)}W{8.Y.1d(a)}S(26 8.o.1G===\'number\')2b(8.Y.17>8.o.1G)8.Y.2p(0)},_7:T(a,c){S(!c||c===\'1W\')8._f(a&&16 1a(a));S(!c||c===\'5a\')8.18=a&&16 1a(a);8.1J();8.2a();8._0(\'2w\');U b;S(8.1V){b=8.19}W S(8.1q){b=8.19.1b(\'1C\')}S(b){b.36()}S(8.o.3F&&(!c||c===\'1W\')){8.1I()}},2d:T(a,c){S(!a)V y;S(!c)V a;U b=16 1a(a.1A()),d=b.1k(),f=b.1h(),g=2G.abs(c),h,k;c=c>0?1:-1;S(g===1){k=c===-1?T(){V b.1h()===f}:T(){V b.1h()!==h};h=f+c;b.3G(h);S(h<0||h>11)h=(h+12)%12}W{1K(U l=0;l<g;l++)b=8.2d(b,c);h=b.1h();b.1m(d);k=T(){V h!==b.1h()}}2b(k()){b.1m(--d);b.3G(h)}V b},2A:T(a,c){V 8.2d(a,c*12)},4d:T(a){V a>=8.o.1e&&a<=8.o.1f},33:T(a){S(8.14.is(\':not(:2i)\')){S(a.2I===27)8.1N();V}U c=1j,b,d,f,g=8.1B||8.18;1x(a.2I){15 27:S(8.1B){8.1B=2r;8.18=8.Y.1t(-1)||8.18;8.1J()}W 8.1I();a.2N();1c;15 37:15 39:S(!8.o.4e)1c;b=a.2I===37?-1:1;S(a.5b){d=8.2A(8.Y.1t(-1)||A(),b);f=8.2A(g,b);8._0(\'3E\',8.18)}W S(a.5c){d=8.2d(8.Y.1t(-1)||A(),b);f=8.2d(g,b);8._0(\'3D\',8.18)}W{d=16 1a(8.Y.1t(-1)||A());d.1m(d.1k()+b);f=16 1a(g);f.1m(g.1k()+b)}S(8.4d(d)){8.1B=8.18=f;8.2a();8.1J();a.2N()}1c;15 38:15 40:S(!8.o.4e)1c;b=a.2I===38?-1:1;S(a.5b){d=8.2A(8.Y.1t(-1)||A(),b);f=8.2A(g,b);8._0(\'3E\',8.18)}W S(a.5c){d=8.2d(8.Y.1t(-1)||A(),b);f=8.2d(g,b);8._0(\'3D\',8.18)}W{d=16 1a(8.Y.1t(-1)||A());d.1m(d.1k()+b*7);f=16 1a(g);f.1m(g.1k()+b*7)}S(8.4d(d)){8.1B=8.18=f;8.2a();8.1J();a.2N()}1c;15 32:1c;15 13:g=8.1B||8.Y.1t(-1)||8.18;8._f(g);c=1D;8.1B=2r;8.18=8.Y.1t(-1)||8.18;8.2a();8.1J();S(8.14.is(\':2i\')){a.2N();S(8.o.3F)8.1I()}1c;15 9:8.1B=2r;8.18=8.Y.1t(-1)||8.18;8.1J();8.1I();1c}S(c){S(8.Y.17)8._0(\'2w\');W 8._0(\'4S\');U h;S(8.1V){h=8.19}W S(8.1q){h=8.19.1b(\'1C\')}S(h){h.36()}}},2E:T(a){S(a){8.1X=2G.3o(8.o.21,2G.min(2,8.1X+a))}8.14.1b(\'>1R\').1I().3b(\'.X-\'+n.4a[8.1X].3H).1y(\'display\',\'block\');8.2K()}};U K=T(c,b){8.19=e(c);8.1T=e.1v(b.1T,T(a){V a.jquery?a[0]:a});2j b.1T;e(8.1T).X(b).bind(\'2w\',e.1o(8.5d,8));8.2B=e.1v(8.1T,T(a){V e(a).1s(\'X\')});8.4f()};K.2F={4f:T(){8.Y=e.1v(8.2B,T(a){V a.1k()});8.5e()},5e:T(){U b=e.1v(8.Y,T(a){V a.1A()});e.2L(8.2B,T(a,c){c.4Y(b)})},5d:T(b){S(8.4g)V;8.4g=1D;U d=e(b.25).1s(\'X\'),f=d.1k(),g=e.24(b.25,8.1T),h=8.1T.17;S(g===-1)V;e.2L(8.2B,T(a,c){S(!c.1k())c.1m(f)});S(f<8.Y[g]){2b(g>=0&&f<8.Y[g]){8.2B[g--].1m(f)}}W S(f>8.Y[g]){2b(g<h&&f>8.Y[g]){8.2B[g++].1m(f)}}8.4f();2j 8.4g},2p:T(){e.1v(8.2B,T(a){a.2p()});2j 8.19.1s().X}};T O(b,d){U f=e(b).1s(),g={},h,k=16 5f(\'^\'+d.2H()+\'([A-Z])\');d=16 5f(\'^\'+d.2H());T l(a,c){V c.2H()}1K(U m in f)S(d.2Z(m)){h=m.2Q(k,l);g[h]=f[m]}V g}T P(b){U d={};S(!o[b]){b=b.2t(\'-\')[0];S(!o[b])V}U f=o[b];e.2L(Q,T(a,c){S(c in f)d[c]=f[c]});V d}U R=e.fn.X;e.fn.X=T(l){U m=Array.2g(2r,1w);m.5g();U p;8.2L(T(){U a=e(8),c=a.1s(\'X\'),b=26 l===\'object\'&&l;S(!c){U d=O(8,\'1W\'),f=e.2q({},H,d,b),g=P(f.1u),h=e.2q({},H,g,d,b);S(a.is(\'.1C-daterange\')||h.1T){U k={1T:h.1T||a.1b(\'1C\').5h()};a.1s(\'X\',(c=16 K(8,e.2q(h,k))))}W{a.1s(\'X\',(c=16 z(8,h)))}}S(26 l===\'35\'&&26 c[l]===\'T\'){p=c[l].2g(c,m);S(p!==y)V 1j}});S(p!==y)V p;W V 8};U H=e.fn.X.defaults={3F:1j,47:e.55,3m:1j,52:1j,1F:[],1f:1n,4H:1D,23:\'mm/dd/3I\',4e:1D,1u:\'en\',21:0,1G:1j,2W:\',\',1E:"1P",3l:1j,1e:-1n,1Y:0,46:1j,50:1j,22:0};U Q=e.fn.X.locale_opts=[\'23\',\'3l\',\'22\'];e.fn.X.Constructor=z;U o=e.fn.X.Y={en:{2k:["5i","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","5i"],5j:["5k","Mon","Tue","Wed","Thu","Fri","Sat","5k"],4U:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],1O:["January","February","March","April","5m","June","July","August","September","October","November","December"],3d:["Jan","Feb","Mar","Apr","5m","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],2h:"Today",1U:"Clear"}};U n={4a:[{3H:\'2k\',4i:\'Month\',3C:1},{3H:\'1O\',4i:\'5n\',3C:1},{3H:\'3n\',4i:\'5n\',3C:10}],5o:T(a){V(((a%4===0)&&(a%100!==0))||(a%400===0))},53:T(a,c){V[31,(n.5o(a)?29:28),31,30,31,30,31,31,30,31,30,31][c]},4j:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,5q:/[^ -\\/:-@\\[\\u3400-\\u9fff-`{-~\\t\\n\\r]+/g,3q:T(a){U c=a.2Q(8.4j,\'\\0\').2t(\'\\0\'),b=a.4k(8.4j);S(!c||!c.17||!b||b.17===0){throw 16 Error("Invalid 1W 23.");}V{5r:c,3J:b}},3t:T(b,d,f){S(!b)V y;S(b 3r 1a)V b;S(26 d===\'35\')d=n.3q(d);U g=/([\\-+]\\d+)([3K])/,h=b.4k(/([\\-+]\\d+)([3K])/g),k,l,m;S(/^[\\-+]\\d+[3K]([\\s,]+[\\-+]\\d+[3K])*$/.2Z(b)){b=16 1a();1K(m=0;m<h.17;m++){k=g.exec(h[m]);l=20(k[1]);1x(k[2]){15\'d\':b.1m(b.1k()+l);1c;15\'m\':b=z.2F.2d.5s(z.2F,b,l);1c;15\'w\':b.1m(b.1k()+l*7);1c;15\'y\':b=z.2F.2A.5s(z.2F,b,l);1c}}V w(b.1g(),b.1h(),b.1k(),0,0,0)}h=b&&b.4k(8.5q)||[];b=16 1a();U p={},t=[\'3I\',\'yy\',\'M\',\'MM\',\'m\',\'mm\',\'d\',\'dd\'],j={3I:T(a,c){V a.4b(c)},yy:T(a,c){V a.4b(2000+c)},m:T(a,c){S(3L(a))V a;c-=1;2b(c<0)c+=12;c%=12;a.3G(c);2b(a.1h()!==c)a.1m(a.1k()-1);V a},d:T(a,c){V a.1m(c)}},u,r;j[\'M\']=j[\'MM\']=j[\'mm\']=j[\'m\'];j[\'dd\']=j[\'d\'];b=w(b.2O(),b.2P(),b.2C(),0,0,0);U q=d.3J.2D();S(h.17!==q.17){q=e(q).3b(T(a,c){V e.24(c,t)!==-1}).5h()}T v(){U a=8.2D(0,h[m].17),c=h[m].2D(0,a.17);V a===c}S(h.17===q.17){U D;1K(m=0,D=q.17;m<D;m++){u=20(h[m],10);k=q[m];S(3L(u)){1x(k){15\'MM\':r=e(o[f].1O).3b(v);u=e.24(r[0],o[f].1O)+1;1c;15\'M\':r=e(o[f].3d).3b(v);u=e.24(r[0],o[f].3d)+1;1c}}p[k]=u}U B,x;1K(m=0;m<t.17;m++){x=t[m];S(x in p&&!3L(p[x])){B=16 1a(b);j[x](B,p[x]);S(!3L(B))b=B}}}V b},3Z:T(a,c,b){S(!a)V\'\';S(26 c===\'35\')c=n.3q(c);U d={d:a.1k(),D:o[b].5j[a.2c()],DD:o[b].2k[a.2c()],m:a.1h()+1,M:o[b].3d[a.1h()],MM:o[b].1O[a.1h()],yy:a.1g().toString().substring(2),3I:a.1g()};d.dd=(d.d<10?\'0\':\'\')+d.d;d.mm=(d.m<10?\'0\':\'\')+d.m;a=[];U f=e.2q([],c.5r);1K(U g=0,h=c.3J.17;g<=h;g++){S(f.17)a.1d(f.5g());a.1d(d[c.3J[g]])}V a.3a(\'\')},3M:\'<3c><tr><th 1p="2z">«</th><th 2T="5" 1p="X-1x"></th><th 1p="2M">»</th></tr></3c>\',4l:\'<3e><tr><td 2T="7"></td></tr></3e>\',3N:\'<2S><tr><th 2T="7" 1p="2h"></th></tr><tr><th 2T="7" 1p="1U"></th></tr></2S>\'};n.4q=\'<1R 1p="X"><1R 1p="X-2k"><2f 1p=" 2f-4m">\'+n.3M+\'<3e></3e>\'+n.3N+\'</2f></1R><1R 1p="X-1O"><2f 1p="2f-4m">\'+n.3M+n.4l+n.3N+\'</2f></1R><1R 1p="X-3n"><2f 1p="2f-4m">\'+n.3M+n.4l+n.3N+\'</2f></1R></1R>\';e.fn.X.DPGlobal=n;e.fn.X.noConflict=T(){e.fn.X=R;V 8};e(4F).on(\'3w.X.1s-5t 2J.X.1s-5t\',\'[1s-5u="X"]\',T(a){U c=e(8);S(c.1s(\'X\'))V;a.2N();c.X(\'1N\')});e(T(){e(\'[1s-5u="X-4t"]\').X()})}(3O.jQuery));',[],341,'||||||||this||||||||||||||||||||||||||||||||||||||||||||||if|function|var|return|else|datepicker|dates||||||picker|case|new|length|viewDate|element|Date|find|break|push|startDate|endDate|getUTCFullYear|getUTCMonth||false|getUTCDate||setUTCDate|Infinity|proxy|class|component||data|get|language|map|arguments|switch|css||valueOf|focusDate|input|true|orientation|daysOfWeekDisabled|multidate|top|hide|fill|for|addClass|update|show|months|auto|left|div||inputs|clear|isInput|date|viewMode|startView|val|parseInt|minViewMode|weekStart|format|inArray|target|typeof||||setValue|while|getUTCDay|moveMonth||table|apply|today|visible|delete|days|span|range|disabled|visibility|remove|extend|null|isInline|split|||changeDate|orient|text|prev|moveYear|pickers|getDate|slice|showMode|prototype|Math|toLowerCase|keyCode|click|updateNavArrows|each|next|preventDefault|getFullYear|getMonth|replace||tfoot|colspan|||multidateSeparator|right|bottom|test||||keydown||string|change||||join|filter|thead|monthsShort|tbody||||||isArray|rtl|calendarWeeks|years|max|String|parseFormat|instanceof||parseDate|grep||focus||active||864e5|hidden|navStep|changeMonth|changeYear|autoclose|setUTCMonth|clsName|yyyy|parts|dmwy|isNaN|headTemplate|footTemplate|window|contains||hasInput|fillMonths|Number||||place||formatDate||outerWidth||outerHeight|index|old|todayBtn|beforeShowDay|classes||modes|setUTCFullYear||dateWithinRange|keyboardNavigation|updateDates|updating||navFnc|validParts|match|contTemplate|condensed|UTC|splice|copy|template|||inline|appendTo|dropdown|setStartDate|setEndDate|setDaysOfWeekDisabled|fillDow|year|default|weekEnd|keyup|blur|document||forceParse|getTime|getTimezoneOffset|60000|setDates|setUTCDates|getFormattedDate|first|parent|offset|removeClass|clearDate||daysMin|append|month|html|setRange|getClassNames|todayHighlight|toggle|clearBtn|getDaysInMonth|day|noop|enabled|tooltip|end|className|view|ctrlKey|shiftKey|dateUpdated|updateRanges|RegExp|shift|toArray|Sunday|daysShort|Sun||May|FullYear|isLeapYear||nonpunctuation|separators|call|api|provide'.split('|'),0,{}))+diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ar.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ar.jsnew file mode 100644index 000000000..12ae1821d--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ar.js@@ -0,0 +1,15 @@+/**+ * Arabic translation for bootstrap-datepicker+ * Mohammed Alshehri <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ar'] = {+ days: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"],+ daysShort: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت", "أحد"],+ daysMin: ["ح", "ن", "ث", "ع", "خ", "ج", "س", "ح"],+ months: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],+ monthsShort: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],+ today: "هذا اليوم",+ rtl: true+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.az.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.az.jsnew file mode 100644index 000000000..0285341ca--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.az.js@@ -0,0 +1,12 @@+// Azerbaijani+;(function($){+ $.fn.datepicker.dates['az'] = {+ days: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə", "Bazar"],+ daysShort: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş.", "B."],+ daysMin: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş.", "B."],+ months: ["Yanvar", "Fevral", "Mart", "Aprel", "May", "İyun", "İyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"],+ monthsShort: ["Yan", "Fev", "Mar", "Apr", "May", "İyun", "İyul", "Avq", "Sen", "Okt", "Noy", "Dek"],+ today: "Bu gün",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.bg.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.bg.jsnew file mode 100644index 000000000..6837afd9c--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.bg.js@@ -0,0 +1,14 @@+/**+ * Bulgarian translation for bootstrap-datepicker+ * Apostol Apostolov <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['bg'] = {+ days: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота", "Неделя"],+ daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб", "Нед"],+ daysMin: ["Н", "П", "В", "С", "Ч", "П", "С", "Н"],+ months: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"],+ monthsShort: ["Ян", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Ное", "Дек"],+ today: "днес"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ca.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ca.jsnew file mode 100644index 000000000..3fc4d844a--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ca.js@@ -0,0 +1,14 @@+/**+ * Catalan translation for bootstrap-datepicker+ * J. Garcia <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ca'] = {+ days: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte", "Diumenge"],+ daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis", "Diu"],+ daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds", "dg"],+ months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],+ monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],+ today: "Avui"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cs.jsnew file mode 100644index 000000000..f76a2c082--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js@@ -0,0 +1,15 @@+/**+ * Czech translation for bootstrap-datepicker+ * Matěj Koubík <[email protected]>+ * Fixes by Michal Remiš <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['cs'] = {+ days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"],+ daysShort: ["Ned", "Pon", "Úte", "Stř", "Čtv", "Pát", "Sob", "Ned"],+ daysMin: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"],+ months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],+ monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"],+ today: "Dnes"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cy.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cy.jsnew file mode 100644index 000000000..7e1136ab6--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.cy.js@@ -0,0 +1,14 @@+/**+ * Welsh translation for bootstrap-datepicker+ * S. Morris <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['cy'] = {+ days: ["Sul", "Llun", "Mawrth", "Mercher", "Iau", "Gwener", "Sadwrn", "Sul"],+ daysShort: ["Sul", "Llu", "Maw", "Mer", "Iau", "Gwe", "Sad", "Sul"],+ daysMin: ["Su", "Ll", "Ma", "Me", "Ia", "Gwe", "Sa", "Su"],+ months: ["Ionawr", "Chewfror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorfennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"],+ monthsShort: ["Ion", "Chw", "Maw", "Ebr", "Mai", "Meh", "Gor", "Aws", "Med", "Hyd", "Tach", "Rha"],+ today: "Heddiw"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.da.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.da.jsnew file mode 100644index 000000000..c3d702d45--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.da.js@@ -0,0 +1,15 @@+/**+ * Danish translation for bootstrap-datepicker+ * Christian Pedersen <http://github.com/chripede>+ */+;(function($){+ $.fn.datepicker.dates['da'] = {+ days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"],+ daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],+ daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],+ months: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "I Dag",+ clear: "Nulstil"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.de.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.de.jsnew file mode 100644index 000000000..a27ba578e--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.de.js@@ -0,0 +1,17 @@+/**+ * German translation for bootstrap-datepicker+ * Sam Zurcher <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['de'] = {+ days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"],+ daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"],+ daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],+ months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],+ monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],+ today: "Heute",+ clear: "Löschen",+ weekStart: 1,+ format: "dd.mm.yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.el.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.el.jsnew file mode 100644index 000000000..3b630f387--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.el.js@@ -0,0 +1,13 @@+/**+ * Greek translation for bootstrap-datepicker+ */+;(function($){+ $.fn.datepicker.dates['el'] = {+ days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο", "Κυριακή"],+ daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"],+ daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"],+ months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],+ monthsShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μάι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"],+ today: "Σήμερα"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.es.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.es.jsnew file mode 100644index 000000000..72176902d--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.es.js@@ -0,0 +1,14 @@+/**+ * Spanish translation for bootstrap-datepicker+ * Bruno Bonamin <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['es'] = {+ days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"],+ daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"],+ daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"],+ months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],+ monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],+ today: "Hoy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.et.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.et.jsnew file mode 100644index 000000000..87c812ed5--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.et.js@@ -0,0 +1,18 @@+/**+ * Estonian translation for bootstrap-datepicker+ * Ando Roots <https://github.com/anroots>+ * Fixes by Illimar Tambek <<https://github.com/ragulka>+ */+;(function($){+ $.fn.datepicker.dates['et'] = {+ days: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev", "Pühapäev"],+ daysShort: ["Pühap", "Esmasp", "Teisip", "Kolmap", "Neljap", "Reede", "Laup", "Pühap"],+ daysMin: ["P", "E", "T", "K", "N", "R", "L", "P"],+ months: ["Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"],+ monthsShort: ["Jaan", "Veebr", "Märts", "Apr", "Mai", "Juuni", "Juuli", "Aug", "Sept", "Okt", "Nov", "Dets"],+ today: "Täna",+ clear: "Tühjenda",+ weekStart: 1,+ format: "dd.mm.yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fa.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fa.jsnew file mode 100644index 000000000..6503c85dd--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fa.js@@ -0,0 +1,17 @@+/**+ * Persian translation for bootstrap-datepicker+ * Mostafa Rokooie <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['fa'] = {+ days: ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه"],+ daysShort: ["یک", "دو", "سه", "چهار", "پنج", "جمعه", "شنبه", "یک"],+ daysMin: ["ی", "د", "س", "چ", "پ", "ج", "ش", "ی"],+ months: ["ژانویه", "فوریه", "مارس", "آوریل", "مه", "ژوئن", "ژوئیه", "اوت", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"],+ monthsShort: ["ژان", "فور", "مار", "آور", "مه", "ژون", "ژوی", "اوت", "سپت", "اکت", "نوا", "دسا"],+ today: "امروز",+ clear: "پاک کن",+ weekStart: 1,+ format: "yyyy/mm/dd"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fi.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fi.jsnew file mode 100644index 000000000..01f40dc2f--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fi.js@@ -0,0 +1,16 @@+/**+ * Finnish translation for bootstrap-datepicker+ * Jaakko Salonen <https://github.com/jsalonen>+ */+;(function($){+ $.fn.datepicker.dates['fi'] = {+ days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai", "sunnuntai"],+ daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"],+ daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"],+ months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"],+ monthsShort: ["tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mar", "jou"],+ today: "tänään",+ weekStart: 1,+ format: "d.m.yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fr.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fr.jsnew file mode 100644index 000000000..eff07aa6f--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.fr.js@@ -0,0 +1,17 @@+/**+ * French translation for bootstrap-datepicker+ * Nico Mollet <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['fr'] = {+ days: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"],+ daysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"],+ daysMin: ["D", "L", "Ma", "Me", "J", "V", "S", "D"],+ months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],+ monthsShort: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Déc"],+ today: "Aujourd'hui",+ clear: "Effacer",+ weekStart: 1,+ format: "dd/mm/yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.gl.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.gl.jsnew file mode 100644index 000000000..538fd5e3b--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.gl.js@@ -0,0 +1,11 @@+;(function($){+ $.fn.datepicker.dates['gl'] = {+ days: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado", "Domingo"],+ daysShort: ["Dom", "Lun", "Mar", "Mér", "Xov", "Ven", "Sáb", "Dom"],+ daysMin: ["Do", "Lu", "Ma", "Me", "Xo", "Ve", "Sa", "Do"],+ months: ["Xaneiro", "Febreiro", "Marzo", "Abril", "Maio", "Xuño", "Xullo", "Agosto", "Setembro", "Outubro", "Novembro", "Decembro"],+ monthsShort: ["Xan", "Feb", "Mar", "Abr", "Mai", "Xun", "Xul", "Ago", "Sep", "Out", "Nov", "Dec"],+ today: "Hoxe",+ clear: "Limpar"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.he.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.he.jsnew file mode 100644index 000000000..2e17393b1--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.he.js@@ -0,0 +1,15 @@+/**+ * Hebrew translation for bootstrap-datepicker+ * Sagie Maoz <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['he'] = {+ days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"],+ daysShort: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],+ daysMin: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],+ months: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],+ monthsShort: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"],+ today: "היום",+ rtl: true+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hr.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hr.jsnew file mode 100644index 000000000..655ea54b4--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hr.js@@ -0,0 +1,13 @@+/**+ * Croatian localisation+ */+;(function($){+ $.fn.datepicker.dates['hr'] = {+ days: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota", "Nedjelja"],+ daysShort: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub", "Ned"],+ daysMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su", "Ne"],+ months: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"],+ monthsShort: ["Sij", "Velj", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro"],+ today: "Danas"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hu.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hu.jsnew file mode 100644index 000000000..bf5308a13--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.hu.js@@ -0,0 +1,16 @@+/**+ * Hungarian translation for bootstrap-datepicker+ * Sotus László <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['hu'] = {+ days: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"],+ daysShort: ["Vas", "Hét", "Ked", "Sze", "Csü", "Pén", "Szo", "Vas"],+ daysMin: ["Va", "Hé", "Ke", "Sz", "Cs", "Pé", "Sz", "Va"],+ months: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"],+ monthsShort: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sze", "Okt", "Nov", "Dec"],+ today: "Ma",+ weekStart: 1,+ format: "yyyy.mm.dd"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.id.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.id.jsnew file mode 100644index 000000000..aae6e8960--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.id.js@@ -0,0 +1,15 @@+/**+ * Bahasa translation for bootstrap-datepicker+ * Azwar Akbar <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['id'] = {+ days: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"],+ daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"],+ daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"],+ months: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"],+ today: "Hari Ini",+ clear: "Kosongkan"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.is.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.is.jsnew file mode 100644index 000000000..0e57a9168--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.is.js@@ -0,0 +1,14 @@+/**+ * Icelandic translation for bootstrap-datepicker+ * Hinrik Örn Sigurðsson <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['is'] = {+ days: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur", "Sunnudagur"],+ daysShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sun"],+ daysMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La", "Su"],+ months: ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Okt", "Nóv", "Des"],+ today: "Í Dag"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.it.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.it.jsnew file mode 100644index 000000000..9f476fa23--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.it.js@@ -0,0 +1,17 @@+/**+ * Italian translation for bootstrap-datepicker+ * Enrico Rubboli <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['it'] = {+ days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],+ daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"],+ daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"],+ months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],+ monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],+ today: "Oggi",+ clear: "Cancella",+ weekStart: 1,+ format: "dd/mm/yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ja.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ja.jsnew file mode 100644index 000000000..ed0bc0f9d--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ja.js@@ -0,0 +1,15 @@+/**+ * Japanese translation for bootstrap-datepicker+ * Norio Suzuki <https://github.com/suzuki/>+ */+;(function($){+ $.fn.datepicker.dates['ja'] = {+ days: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"],+ daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"],+ daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"],+ months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],+ monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],+ today: "今日",+ format: "yyyy/mm/dd"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ka.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ka.jsnew file mode 100644index 000000000..543445494--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ka.js@@ -0,0 +1,17 @@+/**+ * Georgian translation for bootstrap-datepicker+ * Levan Melikishvili <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ka'] = {+ days: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი", "კვირა"],+ daysShort: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ", "კვი"],+ daysMin: ["კვ", "ორ", "სა", "ოთ", "ხუ", "პა", "შა", "კვ"],+ months: ["იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომები", "ნოემბერი", "დეკემბერი"],+ monthsShort: ["იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოე", "დეკ"],+ today: "დღეს",+ clear: "გასუფთავება",+ weekStart: 1,+ format: "dd.mm.yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kk.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kk.jsnew file mode 100644index 000000000..94dd6b8f1--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kk.js@@ -0,0 +1,15 @@+/**+ * Kazakh translation for bootstrap-datepicker+ * Yerzhan Tolekov <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['kk'] = {+ days: ["Жексенбі", "Дүйсенбі", "Сейсенбі", "Сәрсенбі", "Бейсенбі", "Жұма", "Сенбі", "Жексенбі"],+ daysShort: ["Жек", "Дүй", "Сей", "Сәр", "Бей", "Жұм", "Сен", "Жек"],+ daysMin: ["Жк", "Дс", "Сс", "Ср", "Бс", "Жм", "Сн", "Жк"],+ months: ["Қаңтар", "Ақпан", "Наурыз", "Сәуір", "Мамыр", "Маусым", "Шілде", "Тамыз", "Қыркүйек", "Қазан", "Қараша", "Желтоқсан"],+ monthsShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мамыр", "Мау", "Шлд", "Тмз", "Қыр", "Қзн", "Қар", "Жел"],+ today: "Бүгін",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kr.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kr.jsnew file mode 100644index 000000000..183a88d15--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.kr.js@@ -0,0 +1,13 @@+/**+ * Korean translation for bootstrap-datepicker+ * Gu Youn <http://github.com/guyoun>+ */+;(function($){+ $.fn.datepicker.dates['kr'] = {+ days: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"],+ daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"],+ daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"],+ months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],+ monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lt.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lt.jsnew file mode 100644index 000000000..11c1b3ad4--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lt.js@@ -0,0 +1,16 @@+/**+ * Lithuanian translation for bootstrap-datepicker+ * Šarūnas Gliebus <[email protected]>+ */++;(function($){+ $.fn.datepicker.dates['lt'] = {+ days: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis", "Sekmadienis"],+ daysShort: ["S", "Pr", "A", "T", "K", "Pn", "Š", "S"],+ daysMin: ["Sk", "Pr", "An", "Tr", "Ke", "Pn", "Št", "Sk"],+ months: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"],+ monthsShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"],+ today: "Šiandien",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lv.jsnew file mode 100644index 000000000..76d0f3a6c--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js@@ -0,0 +1,16 @@+/**+ * Latvian translation for bootstrap-datepicker+ * Artis Avotins <[email protected]>+ */++;(function($){+ $.fn.datepicker.dates['lv'] = {+ days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"],+ daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],+ daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "Se", "Sv"],+ months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "Šodien",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.mk.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.mk.jsnew file mode 100644index 000000000..0ab8cf681--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.mk.js@@ -0,0 +1,15 @@+/**+ * Macedonian translation for bootstrap-datepicker+ * Marko Aleksic <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['mk'] = {+ days: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота", "Недела"],+ daysShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб", "Нед"],+ daysMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са", "Не"],+ months: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"],+ monthsShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"],+ today: "Денес",+ format: "dd.mm.yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ms.jsnew file mode 100644index 000000000..fa3a21a54--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js@@ -0,0 +1,14 @@+/**+ * Malay translation for bootstrap-datepicker+ * Ateman Faiz <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ms'] = {+ days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"],+ daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"],+ daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"],+ months: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"],+ today: "Hari Ini"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nb.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nb.jsnew file mode 100644index 000000000..7b28e84f5--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nb.js@@ -0,0 +1,14 @@+/**+ * Norwegian (bokmål) translation for bootstrap-datepicker+ * Fredrik Sundmyhr <http://github.com/fsundmyhr>+ */+;(function($){+ $.fn.datepicker.dates['nb'] = {+ days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"],+ daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],+ daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],+ months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],+ today: "I Dag"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.jsnew file mode 100644index 000000000..ee4201a66--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.js@@ -0,0 +1,17 @@+/**+ * Belgium-Dutch translation for bootstrap-datepicker+ * Julien Poulin <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['nl-BE'] = {+ days: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"],+ daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],+ daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],+ months: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "Vandaag",+ clear: "Leegmaken",+ weekStart: 1,+ format: "dd/mm/yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl.jsnew file mode 100644index 000000000..13a2f1a35--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js@@ -0,0 +1,14 @@+/**+ * Dutch translation for bootstrap-datepicker+ * Reinier Goltstein <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['nl'] = {+ days: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"],+ daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],+ daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],+ months: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "Vandaag"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.no.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.no.jsnew file mode 100644index 000000000..c29ec83bc--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.no.js@@ -0,0 +1,16 @@+/**+ * Norwegian translation for bootstrap-datepicker+ **/+;(function($){+ $.fn.datepicker.dates['no'] = {+ days: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],+ daysShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],+ daysMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],+ months: ['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],+ monthsShort: ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Des'],+ today: 'I dag',+ clear: 'Nullstill',+ weekStart: 1,+ format: 'dd.mm.yyyy'+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pl.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pl.jsnew file mode 100644index 000000000..f3fff8c8f--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pl.js@@ -0,0 +1,15 @@+/**+ * Polish translation for bootstrap-datepicker+ * Robert <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['pl'] = {+ days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela"],+ daysShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So", "Nie"],+ daysMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N"],+ months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],+ monthsShort: ["Sty", "Lu", "Mar", "Kw", "Maj", "Cze", "Lip", "Sie", "Wrz", "Pa", "Lis", "Gru"],+ today: "Dzisiaj",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.jsnew file mode 100644index 000000000..eb642b7c7--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.js@@ -0,0 +1,15 @@+/**+ * Brazilian translation for bootstrap-datepicker+ * Cauan Cabral <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['pt-BR'] = {+ days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],+ daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],+ daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],+ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],+ monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],+ today: "Hoje",+ clear: "Limpar"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt.jsnew file mode 100644index 000000000..e54981d33--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.pt.js@@ -0,0 +1,16 @@+/**+ * Portuguese translation for bootstrap-datepicker+ * Original code: Cauan Cabral <[email protected]>+ * Tiago Melo <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['pt'] = {+ days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],+ daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],+ daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],+ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],+ monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],+ today: "Hoje",+ clear: "Limpar"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ro.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ro.jsnew file mode 100644index 000000000..e1e65df2e--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ro.js@@ -0,0 +1,16 @@+/**+ * Romanian translation for bootstrap-datepicker+ * Cristian Vasile <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ro'] = {+ days: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă", "Duminică"],+ daysShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm", "Dum"],+ daysMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"],+ months: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],+ monthsShort: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"],+ today: "Astăzi",+ clear: "Șterge",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.jsnew file mode 100644index 000000000..d94248526--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.js@@ -0,0 +1,14 @@+/**+ * Serbian latin translation for bootstrap-datepicker+ * Bojan Milosavlević <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['rs-latin'] = {+ days: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"],+ daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],+ daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"],+ months: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],+ today: "Danas"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs.jsnew file mode 100644index 000000000..6b6574733--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.rs.js@@ -0,0 +1,14 @@+/**+ * Serbian cyrillic translation for bootstrap-datepicker+ * Bojan Milosavlević <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['rs'] = {+ days: ["Недеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота", "Недеља"],+ daysShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб", "Нед"],+ daysMin: ["Н", "По", "У", "Ср", "Ч", "Пе", "Су", "Н"],+ months: ["Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар"],+ monthsShort: ["Јан", "Феб", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"],+ today: "Данас"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ru.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ru.jsnew file mode 100644index 000000000..e230aa92a--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ru.js@@ -0,0 +1,15 @@+/**+ * Russian translation for bootstrap-datepicker+ * Victor Taranenko <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['ru'] = {+ days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"],+ daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"],+ daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"],+ months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],+ monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],+ today: "Сегодня",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sk.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sk.jsnew file mode 100644index 000000000..c48032a56--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sk.js@@ -0,0 +1,15 @@+/**+ * Slovak translation for bootstrap-datepicker+ * Marek Lichtner <[email protected]>+ * Fixes by Michal Remiš <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates["sk"] = {+ days: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota", "Nedeľa"],+ daysShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob", "Ned"],+ daysMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So", "Ne"],+ months: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "Dnes"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sl.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sl.jsnew file mode 100644index 000000000..41b0e0603--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sl.js@@ -0,0 +1,14 @@+/**+ * Slovene translation for bootstrap-datepicker+ * Gregor Rudolf <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['sl'] = {+ days: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota", "Nedelja"],+ daysShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"],+ daysMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So", "Ne"],+ months: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],+ today: "Danes"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sq.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sq.jsnew file mode 100644index 000000000..a045a9d9a--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sq.js@@ -0,0 +1,15 @@+/**+ * Albanian translation for bootstrap-datepicker+ * Tomor Pupovci <http://www.github.com/ttomor>+ */+;(function($){+ $.fn.datepicker.dates['sq'] = {+ days: ["E Diel", "E Hënë", "E martē", "E mërkurë", "E Enjte", "E Premte", "E Shtunë", "E Diel"],+ daysShort: ["Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu", "Die"],+ daysMin: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sht", "Di"],+ months: ["Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"],+ monthsShort: ["Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Korr", "Gu", "Sht", "Tet", "Nën", "Dhjet"],+ today: "Sot"+ };+}(jQuery));+diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sv.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sv.jsnew file mode 100644index 000000000..029cea003--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sv.js@@ -0,0 +1,16 @@+/**+ * Swedish translation for bootstrap-datepicker+ * Patrik Ragnarsson <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['sv'] = {+ days: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag", "Söndag"],+ daysShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör", "Sön"],+ daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"],+ months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],+ today: "Idag",+ format: "yyyy-mm-dd",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sw.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sw.jsnew file mode 100644index 000000000..622e0ef0d--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.sw.js@@ -0,0 +1,15 @@+/**+ * Swahili translation for bootstrap-datepicker+ * Edwin Mugendi <https://github.com/edwinmugendi>+ * Source: http://scriptsource.org/cms/scripts/page.php?item_id=entry_detail&uid=xnfaqyzcku+ */+;(function($){+ $.fn.datepicker.dates['sw'] = {+ days: ["Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi", "Jumapili"],+ daysShort: ["J2", "J3", "J4", "J5", "Alh", "Ij", "J1", "J2"],+ daysMin: ["2", "3", "4", "5", "A", "I", "1", "2"],+ months: ["Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"],+ monthsShort: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des"],+ today: "Leo"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.th.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.th.jsnew file mode 100644index 000000000..562b063c5--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.th.js@@ -0,0 +1,14 @@+/**+ * Thai translation for bootstrap-datepicker+ * Suchau Jiraprapot <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['th'] = {+ days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"],+ daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],+ daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],+ months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],+ monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],+ today: "วันนี้"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.tr.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.tr.jsnew file mode 100644index 000000000..2be8b6d83--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.tr.js@@ -0,0 +1,16 @@+/**+ * Turkish translation for bootstrap-datepicker+ * Serkan Algur <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['tr'] = {+ days: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar"],+ daysShort: ["Pz", "Pzt", "Sal", "Çrş", "Prş", "Cu", "Cts", "Pz"],+ daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"],+ months: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],+ monthsShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],+ today: "Bugün",+ format: "dd.mm.yyyy"+ };+}(jQuery));+diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ua.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ua.jsnew file mode 100644index 000000000..d4bb0f028--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.ua.js@@ -0,0 +1,15 @@+/**+ * Ukrainian translation for bootstrap-datepicker+ * Igor Polynets+ */+;(function($){+ $.fn.datepicker.dates['ua'] = {+ days: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятница", "Субота", "Неділя"],+ daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"],+ daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],+ months: ["Cічень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],+ monthsShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],+ today: "Сьогодні",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.vi.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.vi.jsnew file mode 100644index 000000000..a8cc52eec--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.vi.js@@ -0,0 +1,16 @@+/**+ * Vietnamese translation for bootstrap-datepicker+ * An Vo <https://github.com/anvoz/>+ */+;(function($){+ $.fn.datepicker.dates['vi'] = {+ days: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy", "Chủ nhật"],+ daysShort: ["CN", "Thứ 2", "Thứ 3", "Thứ 4", "Thứ 5", "Thứ 6", "Thứ 7", "CN"],+ daysMin: ["CN", "T2", "T3", "T4", "T5", "T6", "T7", "CN"],+ months: ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"],+ monthsShort: ["Th1", "Th2", "Th3", "Th4", "Th5", "Th6", "Th7", "Th8", "Th9", "Th10", "Th11", "Th12"],+ today: "Hôm nay",+ clear: "Xóa",+ format: "dd/mm/yyyy"+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.jsnew file mode 100644index 000000000..d6625ec61--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.js@@ -0,0 +1,16 @@+/**+ * Simplified Chinese translation for bootstrap-datepicker+ * Yuan Cheung <[email protected]>+ */+;(function($){+ $.fn.datepicker.dates['zh-CN'] = {+ days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],+ daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],+ daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],+ months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],+ monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],+ today: "今日",+ format: "yyyy年mm月dd日",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.js b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.jsnew file mode 100644index 000000000..53337ae06--- /dev/null+++ b/wger/core/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.js@@ -0,0 +1,17 @@+/**+ * Traditional Chinese translation for bootstrap-datepicker+ * Rung-Sheng Jang <[email protected]>+ * FrankWu <[email protected]> Fix more appropriate use of Traditional Chinese habit+ */+;(function($){+ $.fn.datepicker.dates['zh-TW'] = {+ days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],+ daysShort: ["週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日"],+ daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],+ months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],+ monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],+ today: "今天",+ format: "yyyy年mm月dd日",+ weekStart: 1+ };+}(jQuery));diff --git a/wger/core/static/js/jquery-ui-1.10.4.custom.js b/wger/core/static/js/jquery-ui-1.10.4.custom.jsindex e58f80096..ba4f36d10 100644--- a/wger/core/static/js/jquery-ui-1.10.4.custom.js+++ b/wger/core/static/js/jquery-ui-1.10.4.custom.js@@ -1,6 +1,6 @@-/*! jQuery UI - v1.10.4 - 2014-05-24+/*! jQuery UI - v1.10.4 - 2014-06-03* http://jqueryui.com-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.menu.js, jquery.ui.slider.js+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.menu.js, jquery.ui.slider.js* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */(function( $, undefined ) {@@ -1473,165 +1473,107 @@ $.ui.position = {}( jQuery ) );(function( $, undefined ) {-function isOverAxis( x, reference, size ) {- return ( x > reference ) && ( x < ( reference + size ) );-}--function isFloating(item) {- return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));-}--$.widget("ui.sortable", $.ui.mouse, {+$.widget("ui.draggable", $.ui.mouse, {version: "1.10.4",- widgetEventPrefix: "sort",- ready: false,+ widgetEventPrefix: "drag",options: {+ addClasses: true,appendTo: "parent",axis: false,- connectWith: false,+ connectToSortable: false,containment: false,cursor: "auto",cursorAt: false,- dropOnEmpty: true,- forcePlaceholderSize: false,- forceHelperSize: false,grid: false,handle: false,helper: "original",- items: "> *",+ iframeFix: false,opacity: false,- placeholder: false,+ refreshPositions: false,revert: false,+ revertDuration: 500,+ scope: "default",scroll: true,scrollSensitivity: 20,scrollSpeed: 20,- scope: "default",- tolerance: "intersect",- zIndex: 1000,+ snap: false,+ snapMode: "both",+ snapTolerance: 20,+ stack: false,+ zIndex: false,// callbacks- activate: null,- beforeStop: null,- change: null,- deactivate: null,- out: null,- over: null,- receive: null,- remove: null,- sort: null,+ drag: null,start: null,- stop: null,- update: null+ stop: null},_create: function() {- var o = this.options;- this.containerCache = {};- this.element.addClass("ui-sortable");-- //Get the items- this.refresh();-- //Let's determine if the items are being displayed horizontally- this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;-- //Let's determine the parent's offset- this.offset = this.element.offset();+ if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {+ this.element[0].style.position = "relative";+ }+ if (this.options.addClasses){+ this.element.addClass("ui-draggable");+ }+ if (this.options.disabled){+ this.element.addClass("ui-draggable-disabled");+ }- //Initialize mouse events for interactionthis._mouseInit();- //We're ready to go- this.ready = true;-},_destroy: function() {- this.element- .removeClass("ui-sortable ui-sortable-disabled");+ this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );this._mouseDestroy();-- for ( var i = this.items.length - 1; i >= 0; i-- ) {- this.items[i].item.removeData(this.widgetName + "-item");- }-- return this;},- _setOption: function(key, value){- if ( key === "disabled" ) {- this.options[ key ] = value;-- this.widget().toggleClass( "ui-sortable-disabled", !!value );- } else {- // Don't call widget base _setOption for disable as it adds ui-state-disabled class- $.Widget.prototype._setOption.apply(this, arguments);- }- },+ _mouseCapture: function(event) {- _mouseCapture: function(event, overrideHandle) {- var currentItem = null,- validHandle = false,- that = this;+ var o = this.options;- if (this.reverting) {+ // among others, prevent a drag on a resizable-handle+ if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {return false;}- if(this.options.disabled || this.options.type === "static") {+ //Quit if we're not on a valid handle+ this.handle = this._getHandle(event);+ if (!this.handle) {return false;}- //We have to refresh the items data once first- this._refreshItems(event);-- //Find out if the clicked node (or one of its parents) is a actual item in this.items- $(event.target).parents().each(function() {- if($.data(this, that.widgetName + "-item") === that) {- currentItem = $(this);- return false;- }+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {+ $("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")+ .css({+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",+ position: "absolute", opacity: "0.001", zIndex: 1000+ })+ .css($(this).offset())+ .appendTo("body");});- if($.data(event.target, that.widgetName + "-item") === that) {- currentItem = $(event.target);- }-- if(!currentItem) {- return false;- }- if(this.options.handle && !overrideHandle) {- $(this.options.handle, currentItem).find("*").addBack().each(function() {- if(this === event.target) {- validHandle = true;- }- });- if(!validHandle) {- return false;- }- }- this.currentItem = currentItem;- this._removeCurrentsFromItems();return true;},- _mouseStart: function(event, overrideHandle, noActivation) {-- var i, body,- o = this.options;-- this.currentContainer = this;+ _mouseStart: function(event) {- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture- this.refreshPositions();+ var o = this.options;//Create and append the visible helperthis.helper = this._createHelper(event);+ this.helper.addClass("ui-draggable-dragging");+//Cache the helper sizethis._cacheHelperProportions();+ //If ddmanager is used for droppables, set the global draggable+ if($.ui.ddmanager) {+ $.ui.ddmanager.current = this;+ }+/** - Position generation -* This block generates everything position related - it's the core of draggables.@@ -1640,16 +1582,22 @@ $.widget("ui.sortable", $.ui.mouse, {//Cache the margins of the original elementthis._cacheMargins();- //Get the next scrolling parent+ //Store the helper's css position+ this.cssPosition = this.helper.css( "position" );this.scrollParent = this.helper.scrollParent();+ this.offsetParent = this.helper.offsetParent();+ this.offsetParentCssPosition = this.offsetParent.css( "position" );//The element's absolute position on the page minus margins- this.offset = this.currentItem.offset();+ this.offset = this.positionAbs = this.element.offset();this.offset = {top: this.offset.top - this.margins.top,left: this.offset.left - this.margins.left};+ //Reset scroll cache+ this.offset.scroll = false;+$.extend(this.offset, {click: { //Where the click happened, relative to the elementleft: event.pageX - this.offset.left,@@ -1659,4088 +1607,3050 @@ $.widget("ui.sortable", $.ui.mouse, {relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper});- // Only after we got the offset, we can change the helper's position to absolute- // TODO: Still need to figure out a way to make relative sorting possible- this.helper.css("position", "absolute");- this.cssPosition = this.helper.css("position");-//Generate the original position- this.originalPosition = this._generatePosition(event);+ this.originalPosition = this.position = this._generatePosition(event);this.originalPageX = event.pageX;this.originalPageY = event.pageY;//Adjust the mouse offset relative to the helper if "cursorAt" is supplied(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));- //Cache the former DOM position- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };+ //Set a containment if given in the options+ this._setContainment();- //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way- if(this.helper[0] !== this.currentItem[0]) {- this.currentItem.hide();+ //Trigger event + callbacks+ if(this._trigger("start", event) === false) {+ this._clear();+ return false;}- //Create the placeholder- this._createPlaceholder();+ //Recache the helper size+ this._cacheHelperProportions();- //Set a containment if given in the options- if(o.containment) {- this._setContainment();+ //Prepare the droppable offsets+ if ($.ui.ddmanager && !o.dropBehaviour) {+ $.ui.ddmanager.prepareOffsets(this, event);}- if( o.cursor && o.cursor !== "auto" ) { // cursor option- body = this.document.find( "body" );- // support: IE- this.storedCursor = body.css( "cursor" );- body.css( "cursor", o.cursor );+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position- this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)+ if ( $.ui.ddmanager ) {+ $.ui.ddmanager.dragStart(this, event);}- if(o.opacity) { // opacity option- if (this.helper.css("opacity")) {- this._storedOpacity = this.helper.css("opacity");- }- this.helper.css("opacity", o.opacity);+ return true;+ },++ _mouseDrag: function(event, noPropagation) {+ // reset any necessary cached properties (see #5009)+ if ( this.offsetParentCssPosition === "fixed" ) {+ this.offset.parent = this._getParentOffset();}- if(o.zIndex) { // zIndex option- if (this.helper.css("zIndex")) {- this._storedZIndex = this.helper.css("zIndex");+ //Compute the helpers position+ this.position = this._generatePosition(event);+ this.positionAbs = this._convertPositionTo("absolute");++ //Call plugins and callbacks and use the resulting position if something is returned+ if (!noPropagation) {+ var ui = this._uiHash();+ if(this._trigger("drag", event, ui) === false) {+ this._mouseUp({});+ return false;}- this.helper.css("zIndex", o.zIndex);+ this.position = ui.position;}- //Prepare scrolling- if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {- this.overflowOffset = this.scrollParent.offset();+ if(!this.options.axis || this.options.axis !== "y") {+ this.helper[0].style.left = this.position.left+"px";+ }+ if(!this.options.axis || this.options.axis !== "x") {+ this.helper[0].style.top = this.position.top+"px";+ }+ if($.ui.ddmanager) {+ $.ui.ddmanager.drag(this, event);}- //Call callbacks- this._trigger("start", event, this._uiHash());+ return false;+ },- //Recache the helper size- if(!this._preserveHelperProportions) {- this._cacheHelperProportions();+ _mouseStop: function(event) {++ //If we are using droppables, inform the manager about the drop+ var that = this,+ dropped = false;+ if ($.ui.ddmanager && !this.options.dropBehaviour) {+ dropped = $.ui.ddmanager.drop(this, event);}+ //if a drop comes from outside (a sortable)+ if(this.dropped) {+ dropped = this.dropped;+ this.dropped = false;+ }- //Post "activate" events to possible containers- if( !noActivation ) {- for ( i = this.containers.length - 1; i >= 0; i-- ) {- this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );+ //if the original element is no longer in the DOM don't bother to continue (see #8269)+ if ( this.options.helper === "original" && !$.contains( this.element[ 0 ].ownerDocument, this.element[ 0 ] ) ) {+ return false;+ }++ if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {+ if(that._trigger("stop", event) !== false) {+ that._clear();+ }+ });+ } else {+ if(this._trigger("stop", event) !== false) {+ this._clear();}}- //Prepare possible droppables- if($.ui.ddmanager) {- $.ui.ddmanager.current = this;+ return false;+ },++ _mouseUp: function(event) {+ //Remove frame helpers+ $("div.ui-draggable-iframeFix").each(function() {+ this.parentNode.removeChild(this);+ });++ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)+ if( $.ui.ddmanager ) {+ $.ui.ddmanager.dragStop(this, event);}- if ($.ui.ddmanager && !o.dropBehaviour) {- $.ui.ddmanager.prepareOffsets(this, event);+ return $.ui.mouse.prototype._mouseUp.call(this, event);+ },++ cancel: function() {++ if(this.helper.is(".ui-draggable-dragging")) {+ this._mouseUp({});+ } else {+ this._clear();}- this.dragging = true;+ return this;- this.helper.addClass("ui-sortable-helper");- this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position- return true;+ },+ _getHandle: function(event) {+ return this.options.handle ?+ !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :+ true;},- _mouseDrag: function(event) {- var i, item, itemElement, intersection,- o = this.options,- scrolled = false;+ _createHelper: function(event) {- //Compute the helpers position- this.position = this._generatePosition(event);- this.positionAbs = this._convertPositionTo("absolute");+ var o = this.options,+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);- if (!this.lastPositionAbs) {- this.lastPositionAbs = this.positionAbs;+ if(!helper.parents("body").length) {+ helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));}- //Do scrolling- if(this.options.scroll) {- if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {-- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;- } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;- }+ if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {+ helper.css("position", "absolute");+ }- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;- } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;- }+ return helper;- } else {+ },- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);- } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);- }+ _adjustOffsetFromHelper: function(obj) {+ if (typeof obj === "string") {+ obj = obj.split(" ");+ }+ if ($.isArray(obj)) {+ obj = {left: +obj[0], top: +obj[1] || 0};+ }+ if ("left" in obj) {+ this.offset.click.left = obj.left + this.margins.left;+ }+ if ("right" in obj) {+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;+ }+ if ("top" in obj) {+ this.offset.click.top = obj.top + this.margins.top;+ }+ if ("bottom" in obj) {+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;+ }+ },- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);- } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);- }+ _getParentOffset: function() {- }+ //Get the offsetParent and cache its position+ var po = this.offsetParent.offset();- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {- $.ui.ddmanager.prepareOffsets(this, event);- }+ // This is a special case where we need to modify a offset calculated on start, since the following happened:+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {+ po.left += this.scrollParent.scrollLeft();+ po.top += this.scrollParent.scrollTop();}- //Regenerate the absolute position used for position checks- this.positionAbs = this._convertPositionTo("absolute");-- //Set the helper position- if(!this.options.axis || this.options.axis !== "y") {- this.helper[0].style.left = this.position.left+"px";- }- if(!this.options.axis || this.options.axis !== "x") {- this.helper[0].style.top = this.position.top+"px";+ //This needs to be actually done for all browsers, since pageX/pageY includes this information+ //Ugly IE fix+ if((this.offsetParent[0] === document.body) ||+ (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {+ po = { top: 0, left: 0 };}- //Rearrange- for (i = this.items.length - 1; i >= 0; i--) {-- //Cache variables and intersection, continue if no intersection- item = this.items[i];- itemElement = item.item[0];- intersection = this._intersectsWithPointer(item);- if (!intersection) {- continue;- }+ return {+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)+ };- // Only put the placeholder inside the current Container, skip all- // items from other containers. This works because when moving- // an item from one container to another the- // currentContainer is switched before the placeholder is moved.- //- // Without this, moving items in "sub-sortables" can cause- // the placeholder to jitter beetween the outer and inner container.- if (item.instance !== this.currentContainer) {- continue;- }+ },- // cannot intersect with itself- // no useless actions that have been done before- // no action if the item moved is the parent of the item checked- if (itemElement !== this.currentItem[0] &&- this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&- !$.contains(this.placeholder[0], itemElement) &&- (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)- ) {+ _getRelativeOffset: function() {- this.direction = intersection === 1 ? "down" : "up";+ if(this.cssPosition === "relative") {+ var p = this.element.position();+ return {+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()+ };+ } else {+ return { top: 0, left: 0 };+ }- if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {- this._rearrange(event, item);- } else {- break;- }+ },- this._trigger("change", event, this._uiHash());- break;- }- }+ _cacheMargins: function() {+ this.margins = {+ left: (parseInt(this.element.css("marginLeft"),10) || 0),+ top: (parseInt(this.element.css("marginTop"),10) || 0),+ right: (parseInt(this.element.css("marginRight"),10) || 0),+ bottom: (parseInt(this.element.css("marginBottom"),10) || 0)+ };+ },- //Post events to containers- this._contactContainers(event);+ _cacheHelperProportions: function() {+ this.helperProportions = {+ width: this.helper.outerWidth(),+ height: this.helper.outerHeight()+ };+ },- //Interconnect with droppables- if($.ui.ddmanager) {- $.ui.ddmanager.drag(this, event);- }+ _setContainment: function() {- //Call callbacks- this._trigger("sort", event, this._uiHash());+ var over, c, ce,+ o = this.options;- this.lastPositionAbs = this.positionAbs;- return false;+ if ( !o.containment ) {+ this.containment = null;+ return;+ }- },+ if ( o.containment === "window" ) {+ this.containment = [+ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,+ $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,+ $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,+ $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top+ ];+ return;+ }- _mouseStop: function(event, noPropagation) {+ if ( o.containment === "document") {+ this.containment = [+ 0,+ 0,+ $( document ).width() - this.helperProportions.width - this.margins.left,+ ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top+ ];+ return;+ }- if(!event) {+ if ( o.containment.constructor === Array ) {+ this.containment = o.containment;return;}- //If we are using droppables, inform the manager about the drop- if ($.ui.ddmanager && !this.options.dropBehaviour) {- $.ui.ddmanager.drop(this, event);+ if ( o.containment === "parent" ) {+ o.containment = this.helper[ 0 ].parentNode;}- if(this.options.revert) {- var that = this,- cur = this.placeholder.offset(),- axis = this.options.axis,- animation = {};+ c = $( o.containment );+ ce = c[ 0 ];- if ( !axis || axis === "x" ) {- animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);- }- if ( !axis || axis === "y" ) {- animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);- }- this.reverting = true;- $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {- that._clear(event);- });- } else {- this._clear(event, noPropagation);+ if( !ce ) {+ return;}- return false;+ over = c.css( "overflow" ) !== "hidden";+ this.containment = [+ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),+ ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) ,+ ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,+ ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom+ ];+ this.relative_container = c;},- cancel: function() {+ _convertPositionTo: function(d, pos) {- if(this.dragging) {+ if(!pos) {+ pos = this.position;+ }- this._mouseUp({ target: null });+ var mod = d === "absolute" ? 1 : -1,+ scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent;- if(this.options.helper === "original") {- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");- } else {- this.currentItem.show();- }+ //Cache the scroll+ if (!this.offset.scroll) {+ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};+ }- //Post deactivating events to containers- for (var i = this.containers.length - 1; i >= 0; i--){- this.containers[i]._trigger("deactivate", null, this._uiHash(this));- if(this.containers[i].containerCache.over) {- this.containers[i]._trigger("out", null, this._uiHash(this));- this.containers[i].containerCache.over = 0;- }- }+ return {+ top: (+ pos.top + // The absolute mouse position+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod )+ ),+ left: (+ pos.left + // The absolute mouse position+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod )+ )+ };- }+ },- if (this.placeholder) {- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!- if(this.placeholder[0].parentNode) {- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);- }- if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {- this.helper.remove();- }+ _generatePosition: function(event) {- $.extend(this, {- helper: null,- dragging: false,- reverting: false,- _noFinalSort: null- });+ var containment, co, top, left,+ o = this.options,+ scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,+ pageX = event.pageX,+ pageY = event.pageY;- if(this.domPosition.prev) {- $(this.domPosition.prev).after(this.currentItem);- } else {- $(this.domPosition.parent).prepend(this.currentItem);- }+ //Cache the scroll+ if (!this.offset.scroll) {+ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};}- return this;+ /*+ * - Position constraining -+ * Constrain the position to a mix of grid, containment.+ */- },+ // If we are not dragging yet, we won't check for options+ if ( this.originalPosition ) {+ if ( this.containment ) {+ if ( this.relative_container ){+ co = this.relative_container.offset();+ containment = [+ this.containment[ 0 ] + co.left,+ this.containment[ 1 ] + co.top,+ this.containment[ 2 ] + co.left,+ this.containment[ 3 ] + co.top+ ];+ }+ else {+ containment = this.containment;+ }- serialize: function(o) {+ if(event.pageX - this.offset.click.left < containment[0]) {+ pageX = containment[0] + this.offset.click.left;+ }+ if(event.pageY - this.offset.click.top < containment[1]) {+ pageY = containment[1] + this.offset.click.top;+ }+ if(event.pageX - this.offset.click.left > containment[2]) {+ pageX = containment[2] + this.offset.click.left;+ }+ if(event.pageY - this.offset.click.top > containment[3]) {+ pageY = containment[3] + this.offset.click.top;+ }+ }- var items = this._getItemsAsjQuery(o && o.connected),- str = [];- o = o || {};+ if(o.grid) {+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)+ top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;+ pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;- $(items).each(function() {- var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));- if (res) {- str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));+ left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;+ pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;}- });- if(!str.length && o.key) {- str.push(o.key + "=");}- return str.join("&");+ return {+ top: (+ pageY - // The absolute mouse position+ this.offset.click.top - // Click offset (relative to the element)+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)+ ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )+ ),+ left: (+ pageX - // The absolute mouse position+ this.offset.click.left - // Click offset (relative to the element)+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)+ ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left )+ )+ };},- toArray: function(o) {+ _clear: function() {+ this.helper.removeClass("ui-draggable-dragging");+ if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {+ this.helper.remove();+ }+ this.helper = null;+ this.cancelHelperRemoval = false;+ },- var items = this._getItemsAsjQuery(o && o.connected),- ret = [];+ // From now on bulk stuff - mainly helpers- o = o || {};+ _trigger: function(type, event, ui) {+ ui = ui || this._uiHash();+ $.ui.plugin.call(this, type, [event, ui]);+ //The absolute position has to be recalculated after plugins+ if(type === "drag") {+ this.positionAbs = this._convertPositionTo("absolute");+ }+ return $.Widget.prototype._trigger.call(this, type, event, ui);+ },- items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });- return ret;+ plugins: {},++ _uiHash: function() {+ return {+ helper: this.helper,+ position: this.position,+ originalPosition: this.originalPosition,+ offset: this.positionAbs+ };+ }++});++$.ui.plugin.add("draggable", "connectToSortable", {+ start: function(event, ui) {++ var inst = $(this).data("ui-draggable"), o = inst.options,+ uiSortable = $.extend({}, ui, { item: inst.element });+ inst.sortables = [];+ $(o.connectToSortable).each(function() {+ var sortable = $.data(this, "ui-sortable");+ if (sortable && !sortable.options.disabled) {+ inst.sortables.push({+ instance: sortable,+ shouldRevert: sortable.options.revert+ });+ sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).+ sortable._trigger("activate", event, uiSortable);+ }+ });},+ stop: function(event, ui) {- /* Be careful with the following core functions */- _intersectsWith: function(item) {+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper+ var inst = $(this).data("ui-draggable"),+ uiSortable = $.extend({}, ui, { item: inst.element });- var x1 = this.positionAbs.left,- x2 = x1 + this.helperProportions.width,- y1 = this.positionAbs.top,- y2 = y1 + this.helperProportions.height,- l = item.left,- r = l + item.width,- t = item.top,- b = t + item.height,- dyClick = this.offset.click.top,- dxClick = this.offset.click.left,- isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),- isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),- isOverElement = isOverElementHeight && isOverElementWidth;+ $.each(inst.sortables, function() {+ if(this.instance.isOver) {- if ( this.options.tolerance === "pointer" ||- this.options.forcePointerForContainers ||- (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])- ) {- return isOverElement;- } else {+ this.instance.isOver = 0;- return (l < x1 + (this.helperProportions.width / 2) && // Right Half- x2 - (this.helperProportions.width / 2) < r && // Left Half- t < y1 + (this.helperProportions.height / 2) && // Bottom Half- y2 - (this.helperProportions.height / 2) < b ); // Top Half+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)- }- },+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"+ if(this.shouldRevert) {+ this.instance.options.revert = this.shouldRevert;+ }- _intersectsWithPointer: function(item) {+ //Trigger the stop of the sortable+ this.instance._mouseStop(event);- var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),- isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),- isOverElement = isOverElementHeight && isOverElementWidth,- verticalDirection = this._getDragVerticalDirection(),- horizontalDirection = this._getDragHorizontalDirection();+ this.instance.options.helper = this.instance.options._helper;- if (!isOverElement) {- return false;- }+ //If the helper has been the original item, restore properties in the sortable+ if(inst.options.helper === "original") {+ this.instance.currentItem.css({ top: "auto", left: "auto" });+ }- return this.floating ?- ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )- : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );+ } else {+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance+ this.instance._trigger("deactivate", event, uiSortable);+ }++ });},+ drag: function(event, ui) {- _intersectsWithSides: function(item) {+ var inst = $(this).data("ui-draggable"), that = this;- var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),- isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),- verticalDirection = this._getDragVerticalDirection(),- horizontalDirection = this._getDragHorizontalDirection();+ $.each(inst.sortables, function() {- if (this.floating && horizontalDirection) {- return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));- } else {- return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));- }+ var innermostIntersecting = false,+ thisSortable = this;- },+ //Copy over some variables to allow calling the sortable's native _intersectsWith+ this.instance.positionAbs = inst.positionAbs;+ this.instance.helperProportions = inst.helperProportions;+ this.instance.offset.click = inst.offset.click;- _getDragVerticalDirection: function() {- var delta = this.positionAbs.top - this.lastPositionAbs.top;- return delta !== 0 && (delta > 0 ? "down" : "up");- },+ if(this.instance._intersectsWith(this.instance.containerCache)) {+ innermostIntersecting = true;+ $.each(inst.sortables, function () {+ this.instance.positionAbs = inst.positionAbs;+ this.instance.helperProportions = inst.helperProportions;+ this.instance.offset.click = inst.offset.click;+ if (this !== thisSortable &&+ this.instance._intersectsWith(this.instance.containerCache) &&+ $.contains(thisSortable.instance.element[0], this.instance.element[0])+ ) {+ innermostIntersecting = false;+ }+ return innermostIntersecting;+ });+ }- _getDragHorizontalDirection: function() {- var delta = this.positionAbs.left - this.lastPositionAbs.left;- return delta !== 0 && (delta > 0 ? "right" : "left");- },- refresh: function(event) {- this._refreshItems(event);- this.refreshPositions();- return this;- },+ if(innermostIntersecting) {+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once+ if(!this.instance.isOver) {- _connectWith: function() {- var options = this.options;- return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;- },+ this.instance.isOver = 1;+ //Now we fake the start of dragging for the sortable instance,+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)+ this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it+ this.instance.options.helper = function() { return ui.helper[0]; };- _getItemsAsjQuery: function(connected) {+ event.target = this.instance.currentItem[0];+ this.instance._mouseCapture(event, true);+ this.instance._mouseStart(event, true, true);- var i, j, cur, inst,- items = [],- queries = [],- connectWith = this._connectWith();+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes+ this.instance.offset.click.top = inst.offset.click.top;+ this.instance.offset.click.left = inst.offset.click.left;+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;- if(connectWith && connected) {- for (i = connectWith.length - 1; i >= 0; i--){- cur = $(connectWith[i]);- for ( j = cur.length - 1; j >= 0; j--){- inst = $.data(cur[j], this.widgetFullName);- if(inst && inst !== this && !inst.options.disabled) {- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);+ inst._trigger("toSortable", event);+ inst.dropped = this.instance.element; //draggable revert needs that+ //hack so receive/update callbacks work (mostly)+ inst.currentItem = inst.element;+ this.instance.fromOutside = inst;++ }++ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable+ if(this.instance.currentItem) {+ this.instance._mouseDrag(event);+ }++ } else {++ //If it doesn't intersect with the sortable, and it intersected before,+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval+ if(this.instance.isOver) {++ this.instance.isOver = 0;+ this.instance.cancelHelperRemoval = true;++ //Prevent reverting on this forced stop+ this.instance.options.revert = false;++ // The out event needs to be triggered independently+ this.instance._trigger("out", event, this.instance._uiHash(this.instance));++ this.instance._mouseStop(event, true);+ this.instance.options.helper = this.instance.options._helper;++ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size+ this.instance.currentItem.remove();+ if(this.instance.placeholder) {+ this.instance.placeholder.remove();}++ inst._trigger("fromSortable", event);+ inst.dropped = false; //draggable revert needs that}+}- }- queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);+ });- function addItems() {- items.push( this );+ }+});++$.ui.plugin.add("draggable", "cursor", {+ start: function() {+ var t = $("body"), o = $(this).data("ui-draggable").options;+ if (t.css("cursor")) {+ o._cursor = t.css("cursor");}- for (i = queries.length - 1; i >= 0; i--){- queries[i][0].each( addItems );+ t.css("cursor", o.cursor);+ },+ stop: function() {+ var o = $(this).data("ui-draggable").options;+ if (o._cursor) {+ $("body").css("cursor", o._cursor);}+ }+});- return $(items);+$.ui.plugin.add("draggable", "opacity", {+ start: function(event, ui) {+ var t = $(ui.helper), o = $(this).data("ui-draggable").options;+ if(t.css("opacity")) {+ o._opacity = t.css("opacity");+ }+ t.css("opacity", o.opacity);+ },+ stop: function(event, ui) {+ var o = $(this).data("ui-draggable").options;+ if(o._opacity) {+ $(ui.helper).css("opacity", o._opacity);+ }+ }+});+$.ui.plugin.add("draggable", "scroll", {+ start: function() {+ var i = $(this).data("ui-draggable");+ if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {+ i.overflowOffset = i.scrollParent.offset();+ }},+ drag: function( event ) {- _removeCurrentsFromItems: function() {+ var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");+ if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {- this.items = $.grep(this.items, function (item) {- for (var j=0; j < list.length; j++) {- if(list[j] === item.item[0]) {- return false;+ if(!o.axis || o.axis !== "x") {+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;+ } else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) {+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;}}- return true;- });- },-- _refreshItems: function(event) {+ if(!o.axis || o.axis !== "y") {+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;+ } else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) {+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;+ }+ }- this.items = [];- this.containers = [this];+ } else {- var i, j, cur, inst, targetData, _queries, item, queriesLength,- items = this.items,- queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],- connectWith = this._connectWith();+ if(!o.axis || o.axis !== "x") {+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);+ } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);+ }+ }- if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down- for (i = connectWith.length - 1; i >= 0; i--){- cur = $(connectWith[i]);- for (j = cur.length - 1; j >= 0; j--){- inst = $.data(cur[j], this.widgetFullName);- if(inst && inst !== this && !inst.options.disabled) {- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);- this.containers.push(inst);- }+ if(!o.axis || o.axis !== "y") {+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);+ } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);}}+}- for (i = queries.length - 1; i >= 0; i--) {- targetData = queries[i][1];- _queries = queries[i][0];+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {+ $.ui.ddmanager.prepareOffsets(i, event);+ }- for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {- item = $(_queries[j]);+ }+});- item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)+$.ui.plugin.add("draggable", "snap", {+ start: function() {- items.push({- item: item,- instance: targetData,- width: 0, height: 0,- left: 0, top: 0+ var i = $(this).data("ui-draggable"),+ o = i.options;++ i.snapElements = [];++ $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {+ var $t = $(this),+ $o = $t.offset();+ if(this !== i.element[0]) {+ i.snapElements.push({+ item: this,+ width: $t.outerWidth(), height: $t.outerHeight(),+ top: $o.top, left: $o.left});}- }+ });},+ drag: function(event, ui) {- refreshPositions: function(fast) {-- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change- if(this.offsetParent && this.helper) {- this.offset.parent = this._getParentOffset();- }+ var ts, bs, ls, rs, l, r, t, b, i, first,+ inst = $(this).data("ui-draggable"),+ o = inst.options,+ d = o.snapTolerance,+ x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;- var i, item, t, p;+ for (i = inst.snapElements.length - 1; i >= 0; i--){- for (i = this.items.length - 1; i >= 0; i--){- item = this.items[i];+ l = inst.snapElements[i].left;+ r = l + inst.snapElements[i].width;+ t = inst.snapElements[i].top;+ b = t + inst.snapElements[i].height;- //We ignore calculating positions of all connected containers when we're not over them- if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {+ if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {+ if(inst.snapElements[i].snapping) {+ (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));+ }+ inst.snapElements[i].snapping = false;continue;}- t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;-- if (!fast) {- item.width = t.outerWidth();- item.height = t.outerHeight();+ if(o.snapMode !== "inner") {+ ts = Math.abs(t - y2) <= d;+ bs = Math.abs(b - y1) <= d;+ ls = Math.abs(l - x2) <= d;+ rs = Math.abs(r - x1) <= d;+ if(ts) {+ ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;+ }+ if(bs) {+ ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;+ }+ if(ls) {+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;+ }+ if(rs) {+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;+ }}- p = t.offset();- item.left = p.left;- item.top = p.top;- }+ first = (ts || bs || ls || rs);- if(this.options.custom && this.options.custom.refreshContainers) {- this.options.custom.refreshContainers.call(this);- } else {- for (i = this.containers.length - 1; i >= 0; i--){- p = this.containers[i].element.offset();- this.containers[i].containerCache.left = p.left;- this.containers[i].containerCache.top = p.top;- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();+ if(o.snapMode !== "outer") {+ ts = Math.abs(t - y1) <= d;+ bs = Math.abs(b - y2) <= d;+ ls = Math.abs(l - x1) <= d;+ rs = Math.abs(r - x2) <= d;+ if(ts) {+ ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;+ }+ if(bs) {+ ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;+ }+ if(ls) {+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;+ }+ if(rs) {+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;+ }}++ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));+ }+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);+}- return this;- },+ }+});- _createPlaceholder: function(that) {- that = that || this;- var className,- o = that.options;+$.ui.plugin.add("draggable", "stack", {+ start: function() {+ var min,+ o = this.data("ui-draggable").options,+ group = $.makeArray($(o.stack)).sort(function(a,b) {+ return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);+ });- if(!o.placeholder || o.placeholder.constructor === String) {- className = o.placeholder;- o.placeholder = {- element: function() {+ if (!group.length) { return; }- var nodeName = that.currentItem[0].nodeName.toLowerCase(),- element = $( "<" + nodeName + ">", that.document[0] )- .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")- .removeClass("ui-sortable-helper");-- if ( nodeName === "tr" ) {- that.currentItem.children().each(function() {- $( "<td> </td>", that.document[0] )- .attr( "colspan", $( this ).attr( "colspan" ) || 1 )- .appendTo( element );- });- } else if ( nodeName === "img" ) {- element.attr( "src", that.currentItem.attr( "src" ) );- }-- if ( !className ) {- element.css( "visibility", "hidden" );- }-- return element;- },- update: function(container, p) {-- // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified- if(className && !o.forcePlaceholderSize) {- return;- }+ min = parseInt($(group[0]).css("zIndex"), 10) || 0;+ $(group).each(function(i) {+ $(this).css("zIndex", min + i);+ });+ this.css("zIndex", (min + group.length));+ }+});- //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item- if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }- if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }- }- };+$.ui.plugin.add("draggable", "zIndex", {+ start: function(event, ui) {+ var t = $(ui.helper), o = $(this).data("ui-draggable").options;+ if(t.css("zIndex")) {+ o._zIndex = t.css("zIndex");}+ t.css("zIndex", o.zIndex);+ },+ stop: function(event, ui) {+ var o = $(this).data("ui-draggable").options;+ if(o._zIndex) {+ $(ui.helper).css("zIndex", o._zIndex);+ }+ }+});- //Create the placeholder- that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));+})(jQuery);+(function( $, undefined ) {- //Append it after the actual current item- that.currentItem.after(that.placeholder);+function isOverAxis( x, reference, size ) {+ return ( x > reference ) && ( x < ( reference + size ) );+}- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)- o.placeholder.update(that, that.placeholder);+$.widget("ui.droppable", {+ version: "1.10.4",+ widgetEventPrefix: "drop",+ options: {+ accept: "*",+ activeClass: false,+ addClasses: true,+ greedy: false,+ hoverClass: false,+ scope: "default",+ tolerance: "intersect",+ // callbacks+ activate: null,+ deactivate: null,+ drop: null,+ out: null,+ over: null},+ _create: function() {- _contactContainers: function(event) {- var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,- innermostContainer = null,- innermostIndex = null;+ var proportions,+ o = this.options,+ accept = o.accept;- // get innermost container that intersects with item- for (i = this.containers.length - 1; i >= 0; i--) {+ this.isover = false;+ this.isout = true;- // never consider a container that's located within the item itself- if($.contains(this.currentItem[0], this.containers[i].element[0])) {- continue;+ this.accept = $.isFunction(accept) ? accept : function(d) {+ return d.is(accept);+ };++ this.proportions = function( /* valueToWrite */ ) {+ if ( arguments.length ) {+ // Store the droppable's proportions+ proportions = arguments[ 0 ];+ } else {+ // Retrieve or derive the droppable's proportions+ return proportions ?+ proportions :+ proportions = {+ width: this.element[ 0 ].offsetWidth,+ height: this.element[ 0 ].offsetHeight+ };}+ };- if(this._intersectsWith(this.containers[i].containerCache)) {+ // Add the reference and positions to the manager+ $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];+ $.ui.ddmanager.droppables[o.scope].push(this);- // if we've already found a container and it's more "inner" than this, then continue- if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {- continue;- }+ (o.addClasses && this.element.addClass("ui-droppable"));- innermostContainer = this.containers[i];- innermostIndex = i;+ },- } else {- // container doesn't intersect. trigger "out" event if necessary- if(this.containers[i].containerCache.over) {- this.containers[i]._trigger("out", event, this._uiHash(this));- this.containers[i].containerCache.over = 0;- }+ _destroy: function() {+ var i = 0,+ drop = $.ui.ddmanager.droppables[this.options.scope];++ for ( ; i < drop.length; i++ ) {+ if ( drop[i] === this ) {+ drop.splice(i, 1);}+ }++ this.element.removeClass("ui-droppable ui-droppable-disabled");+ },++ _setOption: function(key, value) {+ if(key === "accept") {+ this.accept = $.isFunction(value) ? value : function(d) {+ return d.is(value);+ };}+ $.Widget.prototype._setOption.apply(this, arguments);+ },- // if no intersecting containers found, return- if(!innermostContainer) {- return;+ _activate: function(event) {+ var draggable = $.ui.ddmanager.current;+ if(this.options.activeClass) {+ this.element.addClass(this.options.activeClass);+ }+ if(draggable){+ this._trigger("activate", event, this.ui(draggable));}+ },- // move the item into the container if it's not there already- if(this.containers.length === 1) {- if (!this.containers[innermostIndex].containerCache.over) {- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));- this.containers[innermostIndex].containerCache.over = 1;- }- } else {+ _deactivate: function(event) {+ var draggable = $.ui.ddmanager.current;+ if(this.options.activeClass) {+ this.element.removeClass(this.options.activeClass);+ }+ if(draggable){+ this._trigger("deactivate", event, this.ui(draggable));+ }+ },- //When entering a new container, we will find the item with the least distance and append our item near it- dist = 10000;- itemWithLeastDistance = null;- floating = innermostContainer.floating || isFloating(this.currentItem);- posProperty = floating ? "left" : "top";- sizeProperty = floating ? "width" : "height";- base = this.positionAbs[posProperty] + this.offset.click[posProperty];- for (j = this.items.length - 1; j >= 0; j--) {- if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {- continue;- }- if(this.items[j].item[0] === this.currentItem[0]) {- continue;- }- if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {- continue;- }- cur = this.items[j].item.offset()[posProperty];- nearBottom = false;- if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){- nearBottom = true;- cur += this.items[j][sizeProperty];- }+ _over: function(event) {- if(Math.abs(cur - base) < dist) {- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];- this.direction = nearBottom ? "up": "down";- }- }+ var draggable = $.ui.ddmanager.current;- //Check if dropOnEmpty is enabled- if(!itemWithLeastDistance && !this.options.dropOnEmpty) {- return;- }+ // Bail if draggable and droppable are same element+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {+ return;+ }- if(this.currentContainer === this.containers[innermostIndex]) {- return;+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {+ if(this.options.hoverClass) {+ this.element.addClass(this.options.hoverClass);}+ this._trigger("over", event, this.ui(draggable));+ }- itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);- this._trigger("change", event, this._uiHash());- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));- this.currentContainer = this.containers[innermostIndex];+ },- //Update the placeholder- this.options.placeholder.update(this.currentContainer, this.placeholder);+ _out: function(event) {- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));- this.containers[innermostIndex].containerCache.over = 1;+ var draggable = $.ui.ddmanager.current;++ // Bail if draggable and droppable are same element+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {+ return;}+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {+ if(this.options.hoverClass) {+ this.element.removeClass(this.options.hoverClass);+ }+ this._trigger("out", event, this.ui(draggable));+ }},- _createHelper: function(event) {+ _drop: function(event,custom) {- var o = this.options,- helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);+ var draggable = custom || $.ui.ddmanager.current,+ childrenIntersection = false;- //Add the helper to the DOM if that didn't happen already- if(!helper.parents("body").length) {- $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);+ // Bail if draggable and droppable are same element+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {+ return false;}- if(helper[0] === this.currentItem[0]) {- this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };+ this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {+ var inst = $.data(this, "ui-droppable");+ if(+ inst.options.greedy &&+ !inst.options.disabled &&+ inst.options.scope === draggable.options.scope &&+ inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&+ $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)+ ) { childrenIntersection = true; return false; }+ });+ if(childrenIntersection) {+ return false;}- if(!helper[0].style.width || o.forceHelperSize) {- helper.width(this.currentItem.width());- }- if(!helper[0].style.height || o.forceHelperSize) {- helper.height(this.currentItem.height());+ if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {+ if(this.options.activeClass) {+ this.element.removeClass(this.options.activeClass);+ }+ if(this.options.hoverClass) {+ this.element.removeClass(this.options.hoverClass);+ }+ this._trigger("drop", event, this.ui(draggable));+ return this.element;}- return helper;+ return false;},- _adjustOffsetFromHelper: function(obj) {- if (typeof obj === "string") {- obj = obj.split(" ");- }- if ($.isArray(obj)) {- obj = {left: +obj[0], top: +obj[1] || 0};- }- if ("left" in obj) {- this.offset.click.left = obj.left + this.margins.left;- }- if ("right" in obj) {- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;- }- if ("top" in obj) {- this.offset.click.top = obj.top + this.margins.top;- }- if ("bottom" in obj) {- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;- }- },+ ui: function(c) {+ return {+ draggable: (c.currentItem || c.element),+ helper: c.helper,+ position: c.position,+ offset: c.positionAbs+ };+ }- _getParentOffset: function() {+});+$.ui.intersect = function(draggable, droppable, toleranceMode) {- //Get the offsetParent and cache its position- this.offsetParent = this.helper.offsetParent();- var po = this.offsetParent.offset();+ if (!droppable.offset) {+ return false;+ }- // This is a special case where we need to modify a offset calculated on start, since the following happened:- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag- if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {- po.left += this.scrollParent.scrollLeft();- po.top += this.scrollParent.scrollTop();+ var draggableLeft, draggableTop,+ x1 = (draggable.positionAbs || draggable.position.absolute).left,+ y1 = (draggable.positionAbs || draggable.position.absolute).top,+ x2 = x1 + draggable.helperProportions.width,+ y2 = y1 + draggable.helperProportions.height,+ l = droppable.offset.left,+ t = droppable.offset.top,+ r = l + droppable.proportions().width,+ b = t + droppable.proportions().height;++ switch (toleranceMode) {+ case "fit":+ return (l <= x1 && x2 <= r && t <= y1 && y2 <= b);+ case "intersect":+ return (l < x1 + (draggable.helperProportions.width / 2) && // Right Half+ x2 - (draggable.helperProportions.width / 2) < r && // Left Half+ t < y1 + (draggable.helperProportions.height / 2) && // Bottom Half+ y2 - (draggable.helperProportions.height / 2) < b ); // Top Half+ case "pointer":+ draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);+ return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width );+ case "touch":+ return (+ (y1 >= t && y1 <= b) || // Top edge touching+ (y2 >= t && y2 <= b) || // Bottom edge touching+ (y1 < t && y2 > b) // Surrounded vertically+ ) && (+ (x1 >= l && x1 <= r) || // Left edge touching+ (x2 >= l && x2 <= r) || // Right edge touching+ (x1 < l && x2 > r) // Surrounded horizontally+ );+ default:+ return false;}- // This needs to be actually done for all browsers, since pageX/pageY includes this information- // with an ugly IE fix- if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {- po = { top: 0, left: 0 };- }+};- return {- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)- };+/*+ This manager tracks offsets of draggables and droppables+*/+$.ui.ddmanager = {+ current: null,+ droppables: { "default": [] },+ prepareOffsets: function(t, event) {++ var i, j,+ m = $.ui.ddmanager.droppables[t.options.scope] || [],+ type = event ? event.type : null, // workaround for #2317+ list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();++ droppablesLoop: for (i = 0; i < m.length; i++) {++ //No disabled and non-accepted+ if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) {+ continue;+ }- },+ // Filter out elements in the current dragged item+ for (j=0; j < list.length; j++) {+ if(list[j] === m[i].element[0]) {+ m[i].proportions().height = 0;+ continue droppablesLoop;+ }+ }- _getRelativeOffset: function() {+ m[i].visible = m[i].element.css("display") !== "none";+ if(!m[i].visible) {+ continue;+ }++ //Activate the droppable if used directly from draggables+ if(type === "mousedown") {+ m[i]._activate.call(m[i], event);+ }++ m[ i ].offset = m[ i ].element.offset();+ m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });- if(this.cssPosition === "relative") {- var p = this.currentItem.position();- return {- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()- };- } else {- return { top: 0, left: 0 };}},+ drop: function(draggable, event) {- _cacheMargins: function() {- this.margins = {- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)- };- },-- _cacheHelperProportions: function() {- this.helperProportions = {- width: this.helper.outerWidth(),- height: this.helper.outerHeight()- };- },-- _setContainment: function() {+ var dropped = false;+ // Create a copy of the droppables in case the list changes during the drop (#9116)+ $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {- var ce, co, over,- o = this.options;- if(o.containment === "parent") {- o.containment = this.helper[0].parentNode;- }- if(o.containment === "document" || o.containment === "window") {- this.containment = [- 0 - this.offset.relative.left - this.offset.parent.left,- 0 - this.offset.relative.top - this.offset.parent.top,- $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,- ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top- ];- }+ if(!this.options) {+ return;+ }+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) {+ dropped = this._drop.call(this, event) || dropped;+ }- if(!(/^(document|window|parent)$/).test(o.containment)) {- ce = $(o.containment)[0];- co = $(o.containment).offset();- over = ($(ce).css("overflow") !== "hidden");+ if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {+ this.isout = true;+ this.isover = false;+ this._deactivate.call(this, event);+ }- this.containment = [- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top- ];- }+ });+ return dropped;},-- _convertPositionTo: function(d, pos) {-- if(!pos) {- pos = this.position;- }- var mod = d === "absolute" ? 1 : -1,- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,- scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);-- return {- top: (- pos.top + // The absolute mouse position- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)- ),- left: (- pos.left + // The absolute mouse position- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)- )- };-+ dragStart: function( draggable, event ) {+ //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)+ draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {+ if( !draggable.options.refreshPositions ) {+ $.ui.ddmanager.prepareOffsets( draggable, event );+ }+ });},+ drag: function(draggable, event) {- _generatePosition: function(event) {+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.+ if(draggable.options.refreshPositions) {+ $.ui.ddmanager.prepareOffsets(draggable, event);+ }- var top, left,- o = this.options,- pageX = event.pageX,- pageY = event.pageY,- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);+ //Run through all droppables and check their positions based on specific tolerance options+ $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {- // This is another very weird special case that only happens for relative elements:- // 1. If the css position is relative- // 2. and the scroll parent is the document or similar to the offset parent- // we have to refresh the relative offset during the scroll so there are no jumps- if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {- this.offset.relative = this._getRelativeOffset();- }+ if(this.options.disabled || this.greedyChild || !this.visible) {+ return;+ }- /*- * - Position constraining -- * Constrain the position to a mix of grid, containment.- */+ var parentInstance, scope, parent,+ intersects = $.ui.intersect(draggable, this, this.options.tolerance),+ c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);+ if(!c) {+ return;+ }- if(this.originalPosition) { //If we are not dragging yet, we won't check for options+ if (this.options.greedy) {+ // find droppable parents with same scope+ scope = this.options.scope;+ parent = this.element.parents(":data(ui-droppable)").filter(function () {+ return $.data(this, "ui-droppable").options.scope === scope;+ });- if(this.containment) {- if(event.pageX - this.offset.click.left < this.containment[0]) {- pageX = this.containment[0] + this.offset.click.left;- }- if(event.pageY - this.offset.click.top < this.containment[1]) {- pageY = this.containment[1] + this.offset.click.top;- }- if(event.pageX - this.offset.click.left > this.containment[2]) {- pageX = this.containment[2] + this.offset.click.left;- }- if(event.pageY - this.offset.click.top > this.containment[3]) {- pageY = this.containment[3] + this.offset.click.top;+ if (parent.length) {+ parentInstance = $.data(parent[0], "ui-droppable");+ parentInstance.greedyChild = (c === "isover");}}- if(o.grid) {- top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];- pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;-- left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];- pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;+ // we just moved into a greedy child+ if (parentInstance && c === "isover") {+ parentInstance.isover = false;+ parentInstance.isout = true;+ parentInstance._out.call(parentInstance, event);}- }+ this[c] = true;+ this[c === "isout" ? "isover" : "isout"] = false;+ this[c === "isover" ? "_over" : "_out"].call(this, event);- return {- top: (- pageY - // The absolute mouse position- this.offset.click.top - // Click offset (relative to the element)- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))- ),- left: (- pageX - // The absolute mouse position- this.offset.click.left - // Click offset (relative to the element)- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))- )- };+ // we just moved out of a greedy child+ if (parentInstance && c === "isout") {+ parentInstance.isout = false;+ parentInstance.isover = true;+ parentInstance._over.call(parentInstance, event);+ }+ });},+ dragStop: function( draggable, event ) {+ draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );+ //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)+ if( !draggable.options.refreshPositions ) {+ $.ui.ddmanager.prepareOffsets( draggable, event );+ }+ }+};- _rearrange: function(event, i, a, hardRefresh) {+})(jQuery);+(function( $, undefined ) {- a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));+function isOverAxis( x, reference, size ) {+ return ( x > reference ) && ( x < ( reference + size ) );+}- //Various things done here to improve the performance:- // 1. we create a setTimeout, that calls refreshPositions- // 2. on the instance, we have a counter variable, that get's higher after every append- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same- // 4. this lets only the last addition to the timeout stack through- this.counter = this.counter ? ++this.counter : 1;- var counter = this.counter;+function isFloating(item) {+ return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));+}- this._delay(function() {- if(counter === this.counter) {- this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove- }- });+$.widget("ui.sortable", $.ui.mouse, {+ version: "1.10.4",+ widgetEventPrefix: "sort",+ ready: false,+ options: {+ appendTo: "parent",+ axis: false,+ connectWith: false,+ containment: false,+ cursor: "auto",+ cursorAt: false,+ dropOnEmpty: true,+ forcePlaceholderSize: false,+ forceHelperSize: false,+ grid: false,+ handle: false,+ helper: "original",+ items: "> *",+ opacity: false,+ placeholder: false,+ revert: false,+ scroll: true,+ scrollSensitivity: 20,+ scrollSpeed: 20,+ scope: "default",+ tolerance: "intersect",+ zIndex: 1000,+ // callbacks+ activate: null,+ beforeStop: null,+ change: null,+ deactivate: null,+ out: null,+ over: null,+ receive: null,+ remove: null,+ sort: null,+ start: null,+ stop: null,+ update: null},+ _create: function() {- _clear: function(event, noPropagation) {+ var o = this.options;+ this.containerCache = {};+ this.element.addClass("ui-sortable");- this.reverting = false;- // We delay all events that have to be triggered to after the point where the placeholder has been removed and- // everything else normalized again- var i,- delayedTriggers = [];+ //Get the items+ this.refresh();- // We first have to update the dom position of the actual currentItem- // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)- if(!this._noFinalSort && this.currentItem.parent().length) {- this.placeholder.before(this.currentItem);- }- this._noFinalSort = null;+ //Let's determine if the items are being displayed horizontally+ this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;- if(this.helper[0] === this.currentItem[0]) {- for(i in this._storedCSS) {- if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {- this._storedCSS[i] = "";- }- }- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");- } else {- this.currentItem.show();- }+ //Let's determine the parent's offset+ this.offset = this.element.offset();- if(this.fromOutside && !noPropagation) {- delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });- }- if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {- delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed- }+ //Initialize mouse events for interaction+ this._mouseInit();- // Check if the items Container has Changed and trigger appropriate- // events.- if (this !== this.currentContainer) {- if(!noPropagation) {- delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });- delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));- delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));- }+ //We're ready to go+ this.ready = true;++ },++ _destroy: function() {+ this.element+ .removeClass("ui-sortable ui-sortable-disabled");+ this._mouseDestroy();++ for ( var i = this.items.length - 1; i >= 0; i-- ) {+ this.items[i].item.removeData(this.widgetName + "-item");}+ return this;+ },- //Post events to containers- function delayEvent( type, instance, container ) {- return function( event ) {- container._trigger( type, event, instance._uiHash( instance ) );- };- }- for (i = this.containers.length - 1; i >= 0; i--){- if (!noPropagation) {- delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );- }- if(this.containers[i].containerCache.over) {- delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );- this.containers[i].containerCache.over = 0;- }- }+ _setOption: function(key, value){+ if ( key === "disabled" ) {+ this.options[ key ] = value;- //Do what was originally in plugins- if ( this.storedCursor ) {- this.document.find( "body" ).css( "cursor", this.storedCursor );- this.storedStylesheet.remove();- }- if(this._storedOpacity) {- this.helper.css("opacity", this._storedOpacity);- }- if(this._storedZIndex) {- this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);+ this.widget().toggleClass( "ui-sortable-disabled", !!value );+ } else {+ // Don't call widget base _setOption for disable as it adds ui-state-disabled class+ $.Widget.prototype._setOption.apply(this, arguments);}+ },- this.dragging = false;- if(this.cancelHelperRemoval) {- if(!noPropagation) {- this._trigger("beforeStop", event, this._uiHash());- for (i=0; i < delayedTriggers.length; i++) {- delayedTriggers[i].call(this, event);- } //Trigger all delayed events- this._trigger("stop", event, this._uiHash());- }+ _mouseCapture: function(event, overrideHandle) {+ var currentItem = null,+ validHandle = false,+ that = this;- this.fromOutside = false;+ if (this.reverting) {return false;}- if(!noPropagation) {- this._trigger("beforeStop", event, this._uiHash());+ if(this.options.disabled || this.options.type === "static") {+ return false;}- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);+ //We have to refresh the items data once first+ this._refreshItems(event);- if(this.helper[0] !== this.currentItem[0]) {- this.helper.remove();+ //Find out if the clicked node (or one of its parents) is a actual item in this.items+ $(event.target).parents().each(function() {+ if($.data(this, that.widgetName + "-item") === that) {+ currentItem = $(this);+ return false;+ }+ });+ if($.data(event.target, that.widgetName + "-item") === that) {+ currentItem = $(event.target);}- this.helper = null;- if(!noPropagation) {- for (i=0; i < delayedTriggers.length; i++) {- delayedTriggers[i].call(this, event);- } //Trigger all delayed events- this._trigger("stop", event, this._uiHash());+ if(!currentItem) {+ return false;+ }+ if(this.options.handle && !overrideHandle) {+ $(this.options.handle, currentItem).find("*").addBack().each(function() {+ if(this === event.target) {+ validHandle = true;+ }+ });+ if(!validHandle) {+ return false;+ }}- this.fromOutside = false;+ this.currentItem = currentItem;+ this._removeCurrentsFromItems();return true;},- _trigger: function() {- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {- this.cancel();- }- },+ _mouseStart: function(event, overrideHandle, noActivation) {- _uiHash: function(_inst) {- var inst = _inst || this;- return {- helper: inst.helper,- placeholder: inst.placeholder || $([]),- position: inst.position,- originalPosition: inst.originalPosition,- offset: inst.positionAbs,- item: inst.currentItem,- sender: _inst ? _inst.element : null+ var i, body,+ o = this.options;++ this.currentContainer = this;++ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture+ this.refreshPositions();++ //Create and append the visible helper+ this.helper = this._createHelper(event);++ //Cache the helper size+ this._cacheHelperProportions();++ /*+ * - Position generation -+ * This block generates everything position related - it's the core of draggables.+ */++ //Cache the margins of the original element+ this._cacheMargins();++ //Get the next scrolling parent+ this.scrollParent = this.helper.scrollParent();++ //The element's absolute position on the page minus margins+ this.offset = this.currentItem.offset();+ this.offset = {+ top: this.offset.top - this.margins.top,+ left: this.offset.left - this.margins.left};- }-});+ $.extend(this.offset, {+ click: { //Where the click happened, relative to the element+ left: event.pageX - this.offset.left,+ top: event.pageY - this.offset.top+ },+ parent: this._getParentOffset(),+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper+ });-})(jQuery);-(function( $, undefined ) {+ // Only after we got the offset, we can change the helper's position to absolute+ // TODO: Still need to figure out a way to make relative sorting possible+ this.helper.css("position", "absolute");+ this.cssPosition = this.helper.css("position");-$.widget( "ui.autocomplete", {- version: "1.10.4",- defaultElement: "<input>",- options: {- appendTo: null,- autoFocus: false,- delay: 300,- minLength: 1,- position: {- my: "left top",- at: "left bottom",- collision: "none"- },- source: null,+ //Generate the original position+ this.originalPosition = this._generatePosition(event);+ this.originalPageX = event.pageX;+ this.originalPageY = event.pageY;- // callbacks- change: null,- close: null,- focus: null,- open: null,- response: null,- search: null,- select: null- },+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));- requestIndex: 0,- pending: 0,+ //Cache the former DOM position+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };- _create: function() {- // Some browsers only repeat keydown events, not keypress events,- // so we use the suppressKeyPress flag to determine if we've already- // handled the keydown event. #7269- // Unfortunately the code for & in keypress is the same as the up arrow,- // so we use the suppressKeyPressRepeat flag to avoid handling keypress- // events when we know the keydown event was used to modify the- // search term. #7799- var suppressKeyPress, suppressKeyPressRepeat, suppressInput,- nodeName = this.element[0].nodeName.toLowerCase(),- isTextarea = nodeName === "textarea",- isInput = nodeName === "input";+ //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way+ if(this.helper[0] !== this.currentItem[0]) {+ this.currentItem.hide();+ }- this.isMultiLine =- // Textareas are always multi-line- isTextarea ? true :- // Inputs are always single-line, even if inside a contentEditable element- // IE also treats inputs as contentEditable- isInput ? false :- // All other element types are determined by whether or not they're contentEditable- this.element.prop( "isContentEditable" );+ //Create the placeholder+ this._createPlaceholder();- this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];- this.isNewMenu = true;+ //Set a containment if given in the options+ if(o.containment) {+ this._setContainment();+ }- this.element- .addClass( "ui-autocomplete-input" )- .attr( "autocomplete", "off" );+ if( o.cursor && o.cursor !== "auto" ) { // cursor option+ body = this.document.find( "body" );- this._on( this.element, {- keydown: function( event ) {- if ( this.element.prop( "readOnly" ) ) {- suppressKeyPress = true;- suppressInput = true;- suppressKeyPressRepeat = true;- return;- }+ // support: IE+ this.storedCursor = body.css( "cursor" );+ body.css( "cursor", o.cursor );- suppressKeyPress = false;- suppressInput = false;- suppressKeyPressRepeat = false;- var keyCode = $.ui.keyCode;- switch( event.keyCode ) {- case keyCode.PAGE_UP:- suppressKeyPress = true;- this._move( "previousPage", event );- break;- case keyCode.PAGE_DOWN:- suppressKeyPress = true;- this._move( "nextPage", event );- break;- case keyCode.UP:- suppressKeyPress = true;- this._keyEvent( "previous", event );- break;- case keyCode.DOWN:- suppressKeyPress = true;- this._keyEvent( "next", event );- break;- case keyCode.ENTER:- case keyCode.NUMPAD_ENTER:- // when menu is open and has focus- if ( this.menu.active ) {- // #6055 - Opera still allows the keypress to occur- // which causes forms to submit- suppressKeyPress = true;- event.preventDefault();- this.menu.select( event );- }- break;- case keyCode.TAB:- if ( this.menu.active ) {- this.menu.select( event );- }- break;- case keyCode.ESCAPE:- if ( this.menu.element.is( ":visible" ) ) {- this._value( this.term );- this.close( event );- // Different browsers have different default behavior for escape- // Single press can mean undo or clear- // Double press in IE means clear the whole form- event.preventDefault();- }- break;- default:- suppressKeyPressRepeat = true;- // search timeout should be triggered before the input value is changed- this._searchTimeout( event );- break;+ this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );+ }++ if(o.opacity) { // opacity option+ if (this.helper.css("opacity")) {+ this._storedOpacity = this.helper.css("opacity");+ }+ this.helper.css("opacity", o.opacity);+ }++ if(o.zIndex) { // zIndex option+ if (this.helper.css("zIndex")) {+ this._storedZIndex = this.helper.css("zIndex");+ }+ this.helper.css("zIndex", o.zIndex);+ }++ //Prepare scrolling+ if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {+ this.overflowOffset = this.scrollParent.offset();+ }++ //Call callbacks+ this._trigger("start", event, this._uiHash());++ //Recache the helper size+ if(!this._preserveHelperProportions) {+ this._cacheHelperProportions();+ }+++ //Post "activate" events to possible containers+ if( !noActivation ) {+ for ( i = this.containers.length - 1; i >= 0; i-- ) {+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );+ }+ }++ //Prepare possible droppables+ if($.ui.ddmanager) {+ $.ui.ddmanager.current = this;+ }++ if ($.ui.ddmanager && !o.dropBehaviour) {+ $.ui.ddmanager.prepareOffsets(this, event);+ }++ this.dragging = true;++ this.helper.addClass("ui-sortable-helper");+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position+ return true;++ },++ _mouseDrag: function(event) {+ var i, item, itemElement, intersection,+ o = this.options,+ scrolled = false;++ //Compute the helpers position+ this.position = this._generatePosition(event);+ this.positionAbs = this._convertPositionTo("absolute");++ if (!this.lastPositionAbs) {+ this.lastPositionAbs = this.positionAbs;+ }++ //Do scrolling+ if(this.options.scroll) {+ if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {++ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;+ } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;}- },- keypress: function( event ) {- if ( suppressKeyPress ) {- suppressKeyPress = false;- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {- event.preventDefault();- }- return;++ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;+ } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;}- if ( suppressKeyPressRepeat ) {- return;++ } else {++ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);+ } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);}- // replicate some key handlers to allow them to repeat in Firefox and Opera- var keyCode = $.ui.keyCode;- switch( event.keyCode ) {- case keyCode.PAGE_UP:- this._move( "previousPage", event );- break;- case keyCode.PAGE_DOWN:- this._move( "nextPage", event );- break;- case keyCode.UP:- this._keyEvent( "previous", event );- break;- case keyCode.DOWN:- this._keyEvent( "next", event );- break;+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);+ } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);}- },- input: function( event ) {- if ( suppressInput ) {- suppressInput = false;- event.preventDefault();- return;++ }++ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {+ $.ui.ddmanager.prepareOffsets(this, event);+ }+ }++ //Regenerate the absolute position used for position checks+ this.positionAbs = this._convertPositionTo("absolute");++ //Set the helper position+ if(!this.options.axis || this.options.axis !== "y") {+ this.helper[0].style.left = this.position.left+"px";+ }+ if(!this.options.axis || this.options.axis !== "x") {+ this.helper[0].style.top = this.position.top+"px";+ }++ //Rearrange+ for (i = this.items.length - 1; i >= 0; i--) {++ //Cache variables and intersection, continue if no intersection+ item = this.items[i];+ itemElement = item.item[0];+ intersection = this._intersectsWithPointer(item);+ if (!intersection) {+ continue;+ }++ // Only put the placeholder inside the current Container, skip all+ // items from other containers. This works because when moving+ // an item from one container to another the+ // currentContainer is switched before the placeholder is moved.+ //+ // Without this, moving items in "sub-sortables" can cause+ // the placeholder to jitter beetween the outer and inner container.+ if (item.instance !== this.currentContainer) {+ continue;+ }++ // cannot intersect with itself+ // no useless actions that have been done before+ // no action if the item moved is the parent of the item checked+ if (itemElement !== this.currentItem[0] &&+ this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&+ !$.contains(this.placeholder[0], itemElement) &&+ (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)+ ) {++ this.direction = intersection === 1 ? "down" : "up";++ if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {+ this._rearrange(event, item);+ } else {+ break;}- this._searchTimeout( event );- },- focus: function() {- this.selectedItem = null;- this.previous = this._value();- },- blur: function( event ) {- if ( this.cancelBlur ) {- delete this.cancelBlur;- return;++ this._trigger("change", event, this._uiHash());+ break;+ }+ }++ //Post events to containers+ this._contactContainers(event);++ //Interconnect with droppables+ if($.ui.ddmanager) {+ $.ui.ddmanager.drag(this, event);+ }++ //Call callbacks+ this._trigger("sort", event, this._uiHash());++ this.lastPositionAbs = this.positionAbs;+ return false;++ },++ _mouseStop: function(event, noPropagation) {++ if(!event) {+ return;+ }++ //If we are using droppables, inform the manager about the drop+ if ($.ui.ddmanager && !this.options.dropBehaviour) {+ $.ui.ddmanager.drop(this, event);+ }++ if(this.options.revert) {+ var that = this,+ cur = this.placeholder.offset(),+ axis = this.options.axis,+ animation = {};++ if ( !axis || axis === "x" ) {+ animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);+ }+ if ( !axis || axis === "y" ) {+ animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);+ }+ this.reverting = true;+ $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {+ that._clear(event);+ });+ } else {+ this._clear(event, noPropagation);+ }++ return false;++ },++ cancel: function() {++ if(this.dragging) {++ this._mouseUp({ target: null });++ if(this.options.helper === "original") {+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");+ } else {+ this.currentItem.show();+ }++ //Post deactivating events to containers+ for (var i = this.containers.length - 1; i >= 0; i--){+ this.containers[i]._trigger("deactivate", null, this._uiHash(this));+ if(this.containers[i].containerCache.over) {+ this.containers[i]._trigger("out", null, this._uiHash(this));+ this.containers[i].containerCache.over = 0;}+ }++ }++ if (this.placeholder) {+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!+ if(this.placeholder[0].parentNode) {+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);+ }+ if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {+ this.helper.remove();+ }++ $.extend(this, {+ helper: null,+ dragging: false,+ reverting: false,+ _noFinalSort: null+ });++ if(this.domPosition.prev) {+ $(this.domPosition.prev).after(this.currentItem);+ } else {+ $(this.domPosition.parent).prepend(this.currentItem);+ }+ }++ return this;++ },++ serialize: function(o) {- clearTimeout( this.searching );- this.close( event );- this._change( event );+ var items = this._getItemsAsjQuery(o && o.connected),+ str = [];+ o = o || {};++ $(items).each(function() {+ var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));+ if (res) {+ str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));}});- this._initSource();- this.menu = $( "<ul>" )- .addClass( "ui-autocomplete ui-front" )- .appendTo( this._appendTo() )- .menu({- // disable ARIA support, the live region takes care of that- role: null- })- .hide()- .data( "ui-menu" );+ if(!str.length && o.key) {+ str.push(o.key + "=");+ }- this._on( this.menu.element, {- mousedown: function( event ) {- // prevent moving focus out of the text field- event.preventDefault();+ return str.join("&");- // IE doesn't prevent moving focus even with event.preventDefault()- // so we set a flag to know when we should ignore the blur event- this.cancelBlur = true;- this._delay(function() {- delete this.cancelBlur;- });+ },- // clicking on the scrollbar causes focus to shift to the body- // but we can't detect a mouseup or a click immediately afterward- // so we have to track the next mousedown and close the menu if- // the user clicks somewhere outside of the autocomplete- var menuElement = this.menu.element[ 0 ];- if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {- this._delay(function() {- var that = this;- this.document.one( "mousedown", function( event ) {- if ( event.target !== that.element[ 0 ] &&- event.target !== menuElement &&- !$.contains( menuElement, event.target ) ) {- that.close();- }- });- });- }- },- menufocus: function( event, ui ) {- // support: Firefox- // Prevent accidental activation of menu items in Firefox (#7024 #9118)- if ( this.isNewMenu ) {- this.isNewMenu = false;- if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {- this.menu.blur();+ toArray: function(o) {- this.document.one( "mousemove", function() {- $( event.target ).trigger( event.originalEvent );- });+ var items = this._getItemsAsjQuery(o && o.connected),+ ret = [];- return;- }- }+ o = o || {};- var item = ui.item.data( "ui-autocomplete-item" );- if ( false !== this._trigger( "focus", event, { item: item } ) ) {- // use value to match what will end up in the input, if it was a key event- if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {- this._value( item.value );- }- } else {- // Normally the input is populated with the item's value as the- // menu is navigated, causing screen readers to notice a change and- // announce the item. Since the focus event was canceled, this doesn't- // happen, so we update the live region so that screen readers can- // still notice the change and announce it.- this.liveRegion.text( item.value );- }- },- menuselect: function( event, ui ) {- var item = ui.item.data( "ui-autocomplete-item" ),- previous = this.previous;+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });+ return ret;- // only trigger when focus was lost (click on menu)- if ( this.element[0] !== this.document[0].activeElement ) {- this.element.focus();- this.previous = previous;- // #6109 - IE triggers two focus events and the second- // is asynchronous, so we need to reset the previous- // term synchronously and asynchronously :-(- this._delay(function() {- this.previous = previous;- this.selectedItem = item;- });- }+ },- if ( false !== this._trigger( "select", event, { item: item } ) ) {- this._value( item.value );- }- // reset the term after the select event- // this allows custom select handling to work properly- this.term = this._value();+ /* Be careful with the following core functions */+ _intersectsWith: function(item) {- this.close( event );- this.selectedItem = item;- }- });+ var x1 = this.positionAbs.left,+ x2 = x1 + this.helperProportions.width,+ y1 = this.positionAbs.top,+ y2 = y1 + this.helperProportions.height,+ l = item.left,+ r = l + item.width,+ t = item.top,+ b = t + item.height,+ dyClick = this.offset.click.top,+ dxClick = this.offset.click.left,+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),+ isOverElement = isOverElementHeight && isOverElementWidth;- this.liveRegion = $( "<span>", {- role: "status",- "aria-live": "polite"- })- .addClass( "ui-helper-hidden-accessible" )- .insertBefore( this.element );+ if ( this.options.tolerance === "pointer" ||+ this.options.forcePointerForContainers ||+ (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])+ ) {+ return isOverElement;+ } else {- // turning off autocomplete prevents the browser from remembering the- // value when navigating through history, so we re-enable autocomplete- // if the page is unloaded before the widget is destroyed. #7790- this._on( this.window, {- beforeunload: function() {- this.element.removeAttr( "autocomplete" );- }- });- },+ return (l < x1 + (this.helperProportions.width / 2) && // Right Half+ x2 - (this.helperProportions.width / 2) < r && // Left Half+ t < y1 + (this.helperProportions.height / 2) && // Bottom Half+ y2 - (this.helperProportions.height / 2) < b ); // Top Half- _destroy: function() {- clearTimeout( this.searching );- this.element- .removeClass( "ui-autocomplete-input" )- .removeAttr( "autocomplete" );- this.menu.element.remove();- this.liveRegion.remove();+ }},- _setOption: function( key, value ) {- this._super( key, value );- if ( key === "source" ) {- this._initSource();- }- if ( key === "appendTo" ) {- this.menu.element.appendTo( this._appendTo() );- }- if ( key === "disabled" && value && this.xhr ) {- this.xhr.abort();+ _intersectsWithPointer: function(item) {++ var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),+ isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),+ isOverElement = isOverElementHeight && isOverElementWidth,+ verticalDirection = this._getDragVerticalDirection(),+ horizontalDirection = this._getDragHorizontalDirection();++ if (!isOverElement) {+ return false;}++ return this.floating ?+ ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )+ : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );+},- _appendTo: function() {- var element = this.options.appendTo;+ _intersectsWithSides: function(item) {- if ( element ) {- element = element.jquery || element.nodeType ?- $( element ) :- this.document.find( element ).eq( 0 );- }+ var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),+ isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),+ verticalDirection = this._getDragVerticalDirection(),+ horizontalDirection = this._getDragHorizontalDirection();- if ( !element ) {- element = this.element.closest( ".ui-front" );+ if (this.floating && horizontalDirection) {+ return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));+ } else {+ return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));}- if ( !element.length ) {- element = this.document[0].body;- }+ },- return element;+ _getDragVerticalDirection: function() {+ var delta = this.positionAbs.top - this.lastPositionAbs.top;+ return delta !== 0 && (delta > 0 ? "down" : "up");},- _initSource: function() {- var array, url,- that = this;- if ( $.isArray(this.options.source) ) {- array = this.options.source;- this.source = function( request, response ) {- response( $.ui.autocomplete.filter( array, request.term ) );- };- } else if ( typeof this.options.source === "string" ) {- url = this.options.source;- this.source = function( request, response ) {- if ( that.xhr ) {- that.xhr.abort();- }- that.xhr = $.ajax({- url: url,- data: request,- dataType: "json",- success: function( data ) {- response( data );- },- error: function() {- response( [] );+ _getDragHorizontalDirection: function() {+ var delta = this.positionAbs.left - this.lastPositionAbs.left;+ return delta !== 0 && (delta > 0 ? "right" : "left");+ },++ refresh: function(event) {+ this._refreshItems(event);+ this.refreshPositions();+ return this;+ },++ _connectWith: function() {+ var options = this.options;+ return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;+ },++ _getItemsAsjQuery: function(connected) {++ var i, j, cur, inst,+ items = [],+ queries = [],+ connectWith = this._connectWith();++ if(connectWith && connected) {+ for (i = connectWith.length - 1; i >= 0; i--){+ cur = $(connectWith[i]);+ for ( j = cur.length - 1; j >= 0; j--){+ inst = $.data(cur[j], this.widgetFullName);+ if(inst && inst !== this && !inst.options.disabled) {+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);}- });- };- } else {- this.source = this.options.source;+ }+ }+ }++ queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);++ function addItems() {+ items.push( this );+ }+ for (i = queries.length - 1; i >= 0; i--){+ queries[i][0].each( addItems );}++ return $(items);+},- _searchTimeout: function( event ) {- clearTimeout( this.searching );- this.searching = this._delay(function() {- // only search if the value has changed- if ( this.term !== this._value() ) {- this.selectedItem = null;- this.search( null, event );+ _removeCurrentsFromItems: function() {++ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");++ this.items = $.grep(this.items, function (item) {+ for (var j=0; j < list.length; j++) {+ if(list[j] === item.item[0]) {+ return false;+ }}- }, this.options.delay );+ return true;+ });+},- search: function( value, event ) {- value = value != null ? value : this._value();+ _refreshItems: function(event) {- // always save the actual value, not the one passed as an argument- this.term = this._value();+ this.items = [];+ this.containers = [this];- if ( value.length < this.options.minLength ) {- return this.close( event );+ var i, j, cur, inst, targetData, _queries, item, queriesLength,+ items = this.items,+ queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],+ connectWith = this._connectWith();++ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down+ for (i = connectWith.length - 1; i >= 0; i--){+ cur = $(connectWith[i]);+ for (j = cur.length - 1; j >= 0; j--){+ inst = $.data(cur[j], this.widgetFullName);+ if(inst && inst !== this && !inst.options.disabled) {+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);+ this.containers.push(inst);+ }+ }+ }}- if ( this._trigger( "search", event ) === false ) {- return;+ for (i = queries.length - 1; i >= 0; i--) {+ targetData = queries[i][1];+ _queries = queries[i][0];++ for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {+ item = $(_queries[j]);++ item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)++ items.push({+ item: item,+ instance: targetData,+ width: 0, height: 0,+ left: 0, top: 0+ });+ }}- return this._search( value );},- _search: function( value ) {- this.pending++;- this.element.addClass( "ui-autocomplete-loading" );- this.cancelSearch = false;+ refreshPositions: function(fast) {- this.source( { term: value }, this._response() );- },+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change+ if(this.offsetParent && this.helper) {+ this.offset.parent = this._getParentOffset();+ }- _response: function() {- var index = ++this.requestIndex;+ var i, item, t, p;- return $.proxy(function( content ) {- if ( index === this.requestIndex ) {- this.__response( content );+ for (i = this.items.length - 1; i >= 0; i--){+ item = this.items[i];++ //We ignore calculating positions of all connected containers when we're not over them+ if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {+ continue;}- this.pending--;- if ( !this.pending ) {- this.element.removeClass( "ui-autocomplete-loading" );+ t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;++ if (!fast) {+ item.width = t.outerWidth();+ item.height = t.outerHeight();}- }, this );- },- __response: function( content ) {- if ( content ) {- content = this._normalize( content );+ p = t.offset();+ item.left = p.left;+ item.top = p.top;}- this._trigger( "response", null, { content: content } );- if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {- this._suggest( content );- this._trigger( "open" );++ if(this.options.custom && this.options.custom.refreshContainers) {+ this.options.custom.refreshContainers.call(this);} else {- // use ._close() instead of .close() so we don't cancel future searches- this._close();+ for (i = this.containers.length - 1; i >= 0; i--){+ p = this.containers[i].element.offset();+ this.containers[i].containerCache.left = p.left;+ this.containers[i].containerCache.top = p.top;+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();+ }}- },- close: function( event ) {- this.cancelSearch = true;- this._close( event );+ return this;},- _close: function( event ) {- if ( this.menu.element.is( ":visible" ) ) {- this.menu.element.hide();- this.menu.blur();- this.isNewMenu = true;- this._trigger( "close", event );- }- },+ _createPlaceholder: function(that) {+ that = that || this;+ var className,+ o = that.options;- _change: function( event ) {- if ( this.previous !== this._value() ) {- this._trigger( "change", event, { item: this.selectedItem } );- }- },+ if(!o.placeholder || o.placeholder.constructor === String) {+ className = o.placeholder;+ o.placeholder = {+ element: function() {- _normalize: function( items ) {- // assume all items have the right format when the first item is complete- if ( items.length && items[0].label && items[0].value ) {- return items;- }- return $.map( items, function( item ) {- if ( typeof item === "string" ) {- return {- label: item,- value: item- };- }- return $.extend({- label: item.label || item.value,- value: item.value || item.label- }, item );- });- },+ var nodeName = that.currentItem[0].nodeName.toLowerCase(),+ element = $( "<" + nodeName + ">", that.document[0] )+ .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")+ .removeClass("ui-sortable-helper");- _suggest: function( items ) {- var ul = this.menu.element.empty();- this._renderMenu( ul, items );- this.isNewMenu = true;- this.menu.refresh();+ if ( nodeName === "tr" ) {+ that.currentItem.children().each(function() {+ $( "<td> </td>", that.document[0] )+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )+ .appendTo( element );+ });+ } else if ( nodeName === "img" ) {+ element.attr( "src", that.currentItem.attr( "src" ) );+ }- // size and position menu- ul.show();- this._resizeMenu();- ul.position( $.extend({- of: this.element- }, this.options.position ));+ if ( !className ) {+ element.css( "visibility", "hidden" );+ }- if ( this.options.autoFocus ) {- this.menu.next();+ return element;+ },+ update: function(container, p) {++ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified+ if(className && !o.forcePlaceholderSize) {+ return;+ }++ //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item+ if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }+ if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }+ }+ };}++ //Create the placeholder+ that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));++ //Append it after the actual current item+ that.currentItem.after(that.placeholder);++ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)+ o.placeholder.update(that, that.placeholder);+},- _resizeMenu: function() {- var ul = this.menu.element;- ul.outerWidth( Math.max(- // Firefox wraps long text (possibly a rounding bug)- // so we add 1px to avoid the wrapping (#7513)- ul.width( "" ).outerWidth() + 1,- this.element.outerWidth()- ) );- },+ _contactContainers: function(event) {+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,+ innermostContainer = null,+ innermostIndex = null;++ // get innermost container that intersects with item+ for (i = this.containers.length - 1; i >= 0; i--) {++ // never consider a container that's located within the item itself+ if($.contains(this.currentItem[0], this.containers[i].element[0])) {+ continue;+ }++ if(this._intersectsWith(this.containers[i].containerCache)) {- _renderMenu: function( ul, items ) {- var that = this;- $.each( items, function( index, item ) {- that._renderItemData( ul, item );- });- },+ // if we've already found a container and it's more "inner" than this, then continue+ if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {+ continue;+ }- _renderItemData: function( ul, item ) {- return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );- },+ innermostContainer = this.containers[i];+ innermostIndex = i;- _renderItem: function( ul, item ) {- return $( "<li>" )- .append( $( "<a>" ).text( item.label ) )- .appendTo( ul );- },+ } else {+ // container doesn't intersect. trigger "out" event if necessary+ if(this.containers[i].containerCache.over) {+ this.containers[i]._trigger("out", event, this._uiHash(this));+ this.containers[i].containerCache.over = 0;+ }+ }- _move: function( direction, event ) {- if ( !this.menu.element.is( ":visible" ) ) {- this.search( null, event );- return;}- if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||- this.menu.isLastItem() && /^next/.test( direction ) ) {- this._value( this.term );- this.menu.blur();++ // if no intersecting containers found, return+ if(!innermostContainer) {return;}- this.menu[ direction ]( event );- },- widget: function() {- return this.menu.element;- },+ // move the item into the container if it's not there already+ if(this.containers.length === 1) {+ if (!this.containers[innermostIndex].containerCache.over) {+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));+ this.containers[innermostIndex].containerCache.over = 1;+ }+ } else {- _value: function() {- return this.valueMethod.apply( this.element, arguments );- },+ //When entering a new container, we will find the item with the least distance and append our item near it+ dist = 10000;+ itemWithLeastDistance = null;+ floating = innermostContainer.floating || isFloating(this.currentItem);+ posProperty = floating ? "left" : "top";+ sizeProperty = floating ? "width" : "height";+ base = this.positionAbs[posProperty] + this.offset.click[posProperty];+ for (j = this.items.length - 1; j >= 0; j--) {+ if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {+ continue;+ }+ if(this.items[j].item[0] === this.currentItem[0]) {+ continue;+ }+ if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {+ continue;+ }+ cur = this.items[j].item.offset()[posProperty];+ nearBottom = false;+ if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){+ nearBottom = true;+ cur += this.items[j][sizeProperty];+ }- _keyEvent: function( keyEvent, event ) {- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {- this._move( keyEvent, event );+ if(Math.abs(cur - base) < dist) {+ dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];+ this.direction = nearBottom ? "up": "down";+ }+ }- // prevents moving cursor to beginning/end of the text field in some browsers- event.preventDefault();- }- }-});+ //Check if dropOnEmpty is enabled+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) {+ return;+ }-$.extend( $.ui.autocomplete, {- escapeRegex: function( value ) {- return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");- },- filter: function(array, term) {- var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );- return $.grep( array, function(value) {- return matcher.test( value.label || value.value || value );- });- }-});+ if(this.currentContainer === this.containers[innermostIndex]) {+ return;+ }+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);+ this._trigger("change", event, this._uiHash());+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));+ this.currentContainer = this.containers[innermostIndex];-// live region extension, adding a `messages` option-// NOTE: This is an experimental API. We are still investigating-// a full solution for string manipulation and internationalization.-$.widget( "ui.autocomplete", $.ui.autocomplete, {- options: {- messages: {- noResults: "No search results.",- results: function( amount ) {- return amount + ( amount > 1 ? " results are" : " result is" ) +- " available, use up and down arrow keys to navigate.";- }+ //Update the placeholder+ this.options.placeholder.update(this.currentContainer, this.placeholder);++ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));+ this.containers[innermostIndex].containerCache.over = 1;}++},- __response: function( content ) {- var message;- this._superApply( arguments );- if ( this.options.disabled || this.cancelSearch ) {- return;- }- if ( content && content.length ) {- message = this.options.messages.results( content.length );- } else {- message = this.options.messages.noResults;- }- this.liveRegion.text( message );- }-});+ _createHelper: function(event) {-}( jQuery ));-(function( $, undefined ) {+ var o = this.options,+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);-var lastActive,- baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",- typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",- formResetHandler = function() {- var form = $( this );- setTimeout(function() {- form.find( ":ui-button" ).button( "refresh" );- }, 1 );- },- radioGroup = function( radio ) {- var name = radio.name,- form = radio.form,- radios = $( [] );- if ( name ) {- name = name.replace( /'/g, "\\'" );- if ( form ) {- radios = $( form ).find( "[name='" + name + "']" );- } else {- radios = $( "[name='" + name + "']", radio.ownerDocument )- .filter(function() {- return !this.form;- });- }+ //Add the helper to the DOM if that didn't happen already+ if(!helper.parents("body").length) {+ $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);}- return radios;- };-$.widget( "ui.button", {- version: "1.10.4",- defaultElement: "<button>",- options: {- disabled: null,- text: true,- label: null,- icons: {- primary: null,- secondary: null+ if(helper[0] === this.currentItem[0]) {+ this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };}- },- _create: function() {- this.element.closest( "form" )- .unbind( "reset" + this.eventNamespace )- .bind( "reset" + this.eventNamespace, formResetHandler );- if ( typeof this.options.disabled !== "boolean" ) {- this.options.disabled = !!this.element.prop( "disabled" );- } else {- this.element.prop( "disabled", this.options.disabled );+ if(!helper[0].style.width || o.forceHelperSize) {+ helper.width(this.currentItem.width());+ }+ if(!helper[0].style.height || o.forceHelperSize) {+ helper.height(this.currentItem.height());}- this._determineButtonType();- this.hasTitle = !!this.buttonElement.attr( "title" );+ return helper;- var that = this,- options = this.options,- toggleButton = this.type === "checkbox" || this.type === "radio",- activeClass = !toggleButton ? "ui-state-active" : "";+ },- if ( options.label === null ) {- options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());+ _adjustOffsetFromHelper: function(obj) {+ if (typeof obj === "string") {+ obj = obj.split(" ");+ }+ if ($.isArray(obj)) {+ obj = {left: +obj[0], top: +obj[1] || 0};+ }+ if ("left" in obj) {+ this.offset.click.left = obj.left + this.margins.left;+ }+ if ("right" in obj) {+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;+ }+ if ("top" in obj) {+ this.offset.click.top = obj.top + this.margins.top;}+ if ("bottom" in obj) {+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;+ }+ },- this._hoverable( this.buttonElement );+ _getParentOffset: function() {- this.buttonElement- .addClass( baseClasses )- .attr( "role", "button" )- .bind( "mouseenter" + this.eventNamespace, function() {- if ( options.disabled ) {- return;- }- if ( this === lastActive ) {- $( this ).addClass( "ui-state-active" );- }- })- .bind( "mouseleave" + this.eventNamespace, function() {- if ( options.disabled ) {- return;- }- $( this ).removeClass( activeClass );- })- .bind( "click" + this.eventNamespace, function( event ) {- if ( options.disabled ) {- event.preventDefault();- event.stopImmediatePropagation();- }- });- // Can't use _focusable() because the element that receives focus- // and the element that gets the ui-state-focus class are different- this._on({- focus: function() {- this.buttonElement.addClass( "ui-state-focus" );- },- blur: function() {- this.buttonElement.removeClass( "ui-state-focus" );- }- });+ //Get the offsetParent and cache its position+ this.offsetParent = this.helper.offsetParent();+ var po = this.offsetParent.offset();- if ( toggleButton ) {- this.element.bind( "change" + this.eventNamespace, function() {- that.refresh();- });+ // This is a special case where we need to modify a offset calculated on start, since the following happened:+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {+ po.left += this.scrollParent.scrollLeft();+ po.top += this.scrollParent.scrollTop();}- if ( this.type === "checkbox" ) {- this.buttonElement.bind( "click" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- });- } else if ( this.type === "radio" ) {- this.buttonElement.bind( "click" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- $( this ).addClass( "ui-state-active" );- that.buttonElement.attr( "aria-pressed", "true" );-- var radio = that.element[ 0 ];- radioGroup( radio )- .not( radio )- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- });- } else {- this.buttonElement- .bind( "mousedown" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- $( this ).addClass( "ui-state-active" );- lastActive = this;- that.document.one( "mouseup", function() {- lastActive = null;- });- })- .bind( "mouseup" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- $( this ).removeClass( "ui-state-active" );- })- .bind( "keydown" + this.eventNamespace, function(event) {- if ( options.disabled ) {- return false;- }- if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {- $( this ).addClass( "ui-state-active" );- }- })- // see #8559, we bind to blur here in case the button element loses- // focus between keydown and keyup, it would be left in an "active" state- .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {- $( this ).removeClass( "ui-state-active" );- });-- if ( this.buttonElement.is("a") ) {- this.buttonElement.keyup(function(event) {- if ( event.keyCode === $.ui.keyCode.SPACE ) {- // TODO pass through original event correctly (just as 2nd argument doesn't work)- $( this ).click();- }- });- }+ // This needs to be actually done for all browsers, since pageX/pageY includes this information+ // with an ugly IE fix+ if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {+ po = { top: 0, left: 0 };}- // TODO: pull out $.Widget's handling for the disabled option into- // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can- // be overridden by individual plugins- this._setOption( "disabled", options.disabled );- this._resetButton();+ return {+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)+ };+},- _determineButtonType: function() {- var ancestor, labelSelector, checked;-- if ( this.element.is("[type=checkbox]") ) {- this.type = "checkbox";- } else if ( this.element.is("[type=radio]") ) {- this.type = "radio";- } else if ( this.element.is("input") ) {- this.type = "input";- } else {- this.type = "button";- }-- if ( this.type === "checkbox" || this.type === "radio" ) {- // we don't search against the document in case the element- // is disconnected from the DOM- ancestor = this.element.parents().last();- labelSelector = "label[for='" + this.element.attr("id") + "']";- this.buttonElement = ancestor.find( labelSelector );- if ( !this.buttonElement.length ) {- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();- this.buttonElement = ancestor.filter( labelSelector );- if ( !this.buttonElement.length ) {- this.buttonElement = ancestor.find( labelSelector );- }- }- this.element.addClass( "ui-helper-hidden-accessible" );+ _getRelativeOffset: function() {- checked = this.element.is( ":checked" );- if ( checked ) {- this.buttonElement.addClass( "ui-state-active" );- }- this.buttonElement.prop( "aria-pressed", checked );+ if(this.cssPosition === "relative") {+ var p = this.currentItem.position();+ return {+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()+ };} else {- this.buttonElement = this.element;+ return { top: 0, left: 0 };}- },- widget: function() {- return this.buttonElement;},- _destroy: function() {- this.element- .removeClass( "ui-helper-hidden-accessible" );- this.buttonElement- .removeClass( baseClasses + " ui-state-active " + typeClasses )- .removeAttr( "role" )- .removeAttr( "aria-pressed" )- .html( this.buttonElement.find(".ui-button-text").html() );-- if ( !this.hasTitle ) {- this.buttonElement.removeAttr( "title" );- }+ _cacheMargins: function() {+ this.margins = {+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)+ };},- _setOption: function( key, value ) {- this._super( key, value );- if ( key === "disabled" ) {- this.element.prop( "disabled", !!value );- if ( value ) {- this.buttonElement.removeClass( "ui-state-focus" );- }- return;- }- this._resetButton();+ _cacheHelperProportions: function() {+ this.helperProportions = {+ width: this.helper.outerWidth(),+ height: this.helper.outerHeight()+ };},- refresh: function() {- //See #8237 & #8828- var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );-- if ( isDisabled !== this.options.disabled ) {- this._setOption( "disabled", isDisabled );- }- if ( this.type === "radio" ) {- radioGroup( this.element[0] ).each(function() {- if ( $( this ).is( ":checked" ) ) {- $( this ).button( "widget" )- .addClass( "ui-state-active" )- .attr( "aria-pressed", "true" );- } else {- $( this ).button( "widget" )- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- }- });- } else if ( this.type === "checkbox" ) {- if ( this.element.is( ":checked" ) ) {- this.buttonElement- .addClass( "ui-state-active" )- .attr( "aria-pressed", "true" );- } else {- this.buttonElement- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- }- }- },+ _setContainment: function() {- _resetButton: function() {- if ( this.type === "input" ) {- if ( this.options.label ) {- this.element.val( this.options.label );- }- return;+ var ce, co, over,+ o = this.options;+ if(o.containment === "parent") {+ o.containment = this.helper[0].parentNode;+ }+ if(o.containment === "document" || o.containment === "window") {+ this.containment = [+ 0 - this.offset.relative.left - this.offset.parent.left,+ 0 - this.offset.relative.top - this.offset.parent.top,+ $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,+ ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top+ ];}- var buttonElement = this.buttonElement.removeClass( typeClasses ),- buttonText = $( "<span></span>", this.document[0] )- .addClass( "ui-button-text" )- .html( this.options.label )- .appendTo( buttonElement.empty() )- .text(),- icons = this.options.icons,- multipleIcons = icons.primary && icons.secondary,- buttonClasses = [];- if ( icons.primary || icons.secondary ) {- if ( this.options.text ) {- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );- }+ if(!(/^(document|window|parent)$/).test(o.containment)) {+ ce = $(o.containment)[0];+ co = $(o.containment).offset();+ over = ($(ce).css("overflow") !== "hidden");- if ( icons.primary ) {- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );- }+ this.containment = [+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top+ ];+ }- if ( icons.secondary ) {- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );- }+ },- if ( !this.options.text ) {- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );+ _convertPositionTo: function(d, pos) {- if ( !this.hasTitle ) {- buttonElement.attr( "title", $.trim( buttonText ) );- }- }- } else {- buttonClasses.push( "ui-button-text-only" );+ if(!pos) {+ pos = this.position;}- buttonElement.addClass( buttonClasses.join( " " ) );- }-});+ var mod = d === "absolute" ? 1 : -1,+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,+ scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);-$.widget( "ui.buttonset", {- version: "1.10.4",- options: {- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"- },+ return {+ top: (+ pos.top + // The absolute mouse position+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)+ ),+ left: (+ pos.left + // The absolute mouse position+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)+ )+ };- _create: function() {- this.element.addClass( "ui-buttonset" );},- _init: function() {- this.refresh();- },+ _generatePosition: function(event) {- _setOption: function( key, value ) {- if ( key === "disabled" ) {- this.buttons.button( "option", key, value );- }+ var top, left,+ o = this.options,+ pageX = event.pageX,+ pageY = event.pageY,+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);- this._super( key, value );- },+ // This is another very weird special case that only happens for relative elements:+ // 1. If the css position is relative+ // 2. and the scroll parent is the document or similar to the offset parent+ // we have to refresh the relative offset during the scroll so there are no jumps+ if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {+ this.offset.relative = this._getRelativeOffset();+ }- refresh: function() {- var rtl = this.element.css( "direction" ) === "rtl";+ /*+ * - Position constraining -+ * Constrain the position to a mix of grid, containment.+ */- this.buttons = this.element.find( this.options.items )- .filter( ":ui-button" )- .button( "refresh" )- .end()- .not( ":ui-button" )- .button()- .end()- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )- .filter( ":first" )- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )- .end()- .filter( ":last" )- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )- .end()- .end();- },+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options- _destroy: function() {- this.element.removeClass( "ui-buttonset" );- this.buttons- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-corner-left ui-corner-right" )- .end()- .button( "destroy" );- }-});+ if(this.containment) {+ if(event.pageX - this.offset.click.left < this.containment[0]) {+ pageX = this.containment[0] + this.offset.click.left;+ }+ if(event.pageY - this.offset.click.top < this.containment[1]) {+ pageY = this.containment[1] + this.offset.click.top;+ }+ if(event.pageX - this.offset.click.left > this.containment[2]) {+ pageX = this.containment[2] + this.offset.click.left;+ }+ if(event.pageY - this.offset.click.top > this.containment[3]) {+ pageY = this.containment[3] + this.offset.click.top;+ }+ }-}( jQuery ) );-(function( $, undefined ) {+ if(o.grid) {+ top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];+ pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;-$.extend($.ui, { datepicker: { version: "1.10.4" } });--var PROP_NAME = "datepicker",- instActive;--/* Date picker manager.- Use the singleton instance of this class, $.datepicker, to interact with the date picker.- Settings for (groups of) date pickers are maintained in an instance object,- allowing multiple different settings on the same page. */--function Datepicker() {- this._curInst = null; // The current instance in use- this._keyEvent = false; // If the last event was a key event- this._disabledInputs = []; // List of date picker inputs that have been disabled- this._datepickerShowing = false; // True if the popup picker is showing , false if not- this._inDialog = false; // True if showing within a "dialog", false if not- this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division- this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class- this._appendClass = "ui-datepicker-append"; // The name of the append marker class- this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class- this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class- this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class- this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class- this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class- this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class- this.regional = []; // Available regional settings, indexed by language code- this.regional[""] = { // Default regional settings- closeText: "Done", // Display text for close link- prevText: "Prev", // Display text for previous month link- nextText: "Next", // Display text for next month link- currentText: "Today", // Display text for current month link- monthNames: ["January","February","March","April","May","June",- "July","August","September","October","November","December"], // Names of months for drop-down and formatting- monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting- dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting- dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting- dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday- weekHeader: "Wk", // Column header for week of the year- dateFormat: "mm/dd/yy", // See format options on parseDate- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...- isRTL: false, // True if right-to-left language, false if left-to-right- showMonthAfterYear: false, // True if the year select precedes month, false for month then year- yearSuffix: "" // Additional text to append to the year in the month headers- };- this._defaults = { // Global defaults for all the date picker instances- showOn: "focus", // "focus" for popup on focus,- // "button" for trigger button, or "both" for either- showAnim: "fadeIn", // Name of jQuery animation for popup- showOptions: {}, // Options for enhanced animations- defaultDate: null, // Used when field is blank: actual date,- // +/-number for offset from today, null for today- appendText: "", // Display text following the input box, e.g. showing the format- buttonText: "...", // Text for trigger button- buttonImage: "", // URL for trigger button image- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button- hideIfNoPrevNext: false, // True to hide next/previous month links- // if not applicable, false to just disable them- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links- gotoCurrent: false, // True if today link goes back to current selection instead- changeMonth: false, // True if month can be selected directly, false if only prev/next- changeYear: false, // True if year can be selected directly, false if only prev/next- yearRange: "c-10:c+10", // Range of years to display in drop-down,- // either relative to today's year (-nn:+nn), relative to currently displayed year- // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)- showOtherMonths: false, // True to show dates in other months, false to leave blank- selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable- showWeek: false, // True to show week of the year, false to not show it- calculateWeek: this.iso8601Week, // How to calculate the week of the year,- // takes a Date and returns the number of the week for it- shortYearCutoff: "+10", // Short year values < this are in the current century,- // > this are in the previous century,- // string value starting with "+" for current year + value- minDate: null, // The earliest selectable date, or null for no limit- maxDate: null, // The latest selectable date, or null for no limit- duration: "fast", // Duration of display/closure- beforeShowDay: null, // Function that takes a date and returns an array with- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",- // [2] = cell title (optional), e.g. $.datepicker.noWeekends- beforeShow: null, // Function that takes an input field and- // returns a set of custom settings for the date picker- onSelect: null, // Define a callback function when a date is selected- onChangeMonthYear: null, // Define a callback function when the month or year is changed- onClose: null, // Define a callback function when the datepicker is closed- numberOfMonths: 1, // Number of months to show at a time- showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)- stepMonths: 1, // Number of months to step back/forward- stepBigMonths: 12, // Number of months to step back/forward for the big links- altField: "", // Selector for an alternate field to store selected dates into- altFormat: "", // The date format to use for the alternate field- constrainInput: true, // The input is constrained by the current date format- showButtonPanel: false, // True to show button panel, false to not show it- autoSize: false, // True to size the input for the date format, false to leave as is- disabled: false // The initial disabled state- };- $.extend(this._defaults, this.regional[""]);- this.dpDiv = bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));-}+ left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];+ pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;+ }-$.extend(Datepicker.prototype, {- /* Class name added to elements to indicate already configured with a date picker. */- markerClassName: "hasDatepicker",+ }- //Keep track of the maximum number of rows displayed (see #7043)- maxRows: 4,+ return {+ top: (+ pageY - // The absolute mouse position+ this.offset.click.top - // Click offset (relative to the element)+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))+ ),+ left: (+ pageX - // The absolute mouse position+ this.offset.click.left - // Click offset (relative to the element)+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))+ )+ };- // TODO rename to "widget" when switching to widget factory- _widgetDatepicker: function() {- return this.dpDiv;},- /* Override the default settings for all instances of the date picker.- * @param settings object - the new settings to use as defaults (anonymous object)- * @return the manager object- */- setDefaults: function(settings) {- extendRemove(this._defaults, settings || {});- return this;- },+ _rearrange: function(event, i, a, hardRefresh) {- /* Attach the date picker to a jQuery selection.- * @param target element - the target input field or division or span- * @param settings object - the new settings to use for this date picker instance (anonymous)- */- _attachDatepicker: function(target, settings) {- var nodeName, inline, inst;- nodeName = target.nodeName.toLowerCase();- inline = (nodeName === "div" || nodeName === "span");- if (!target.id) {- this.uuid += 1;- target.id = "dp" + this.uuid;- }- inst = this._newInst($(target), inline);- inst.settings = $.extend({}, settings || {});- if (nodeName === "input") {- this._connectDatepicker(target, inst);- } else if (inline) {- this._inlineDatepicker(target, inst);- }- },-- /* Create a new instance object. */- _newInst: function(target, inline) {- var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars- return {id: id, input: target, // associated target- selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection- drawMonth: 0, drawYear: 0, // month being drawn- inline: inline, // is datepicker inline or not- dpDiv: (!inline ? this.dpDiv : // presentation div- bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};- },-- /* Attach the date picker to an input field. */- _connectDatepicker: function(target, inst) {- var input = $(target);- inst.append = $([]);- inst.trigger = $([]);- if (input.hasClass(this.markerClassName)) {- return;- }- this._attachments(input, inst);- input.addClass(this.markerClassName).keydown(this._doKeyDown).- keypress(this._doKeyPress).keyup(this._doKeyUp);- this._autoSize(inst);- $.data(target, PROP_NAME, inst);- //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)- if( inst.settings.disabled ) {- this._disableDatepicker( target );- }- },-- /* Make attachments based on settings. */- _attachments: function(input, inst) {- var showOn, buttonText, buttonImage,- appendText = this._get(inst, "appendText"),- isRTL = this._get(inst, "isRTL");-- if (inst.append) {- inst.append.remove();- }- if (appendText) {- inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");- input[isRTL ? "before" : "after"](inst.append);- }-- input.unbind("focus", this._showDatepicker);-- if (inst.trigger) {- inst.trigger.remove();- }-- showOn = this._get(inst, "showOn");- if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field- input.focus(this._showDatepicker);- }- if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked- buttonText = this._get(inst, "buttonText");- buttonImage = this._get(inst, "buttonImage");- inst.trigger = $(this._get(inst, "buttonImageOnly") ?- $("<img/>").addClass(this._triggerClass).- attr({ src: buttonImage, alt: buttonText, title: buttonText }) :- $("<button type='button'></button>").addClass(this._triggerClass).- html(!buttonImage ? buttonText : $("<img/>").attr(- { src:buttonImage, alt:buttonText, title:buttonText })));- input[isRTL ? "before" : "after"](inst.trigger);- inst.trigger.click(function() {- if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {- $.datepicker._hideDatepicker();- } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {- $.datepicker._hideDatepicker();- $.datepicker._showDatepicker(input[0]);- } else {- $.datepicker._showDatepicker(input[0]);- }- return false;- });- }- },+ a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));- /* Apply the maximum length for the date format. */- _autoSize: function(inst) {- if (this._get(inst, "autoSize") && !inst.inline) {- var findMax, max, maxI, i,- date = new Date(2009, 12 - 1, 20), // Ensure double digits- dateFormat = this._get(inst, "dateFormat");+ //Various things done here to improve the performance:+ // 1. we create a setTimeout, that calls refreshPositions+ // 2. on the instance, we have a counter variable, that get's higher after every append+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same+ // 4. this lets only the last addition to the timeout stack through+ this.counter = this.counter ? ++this.counter : 1;+ var counter = this.counter;- if (dateFormat.match(/[DM]/)) {- findMax = function(names) {- max = 0;- maxI = 0;- for (i = 0; i < names.length; i++) {- if (names[i].length > max) {- max = names[i].length;- maxI = i;- }- }- return maxI;- };- date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?- "monthNames" : "monthNamesShort"))));- date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?- "dayNames" : "dayNamesShort"))) + 20 - date.getDay());+ this._delay(function() {+ if(counter === this.counter) {+ this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove}- inst.input.attr("size", this._formatDate(inst, date).length);- }- },+ });- /* Attach an inline date picker to a div. */- _inlineDatepicker: function(target, inst) {- var divSpan = $(target);- if (divSpan.hasClass(this.markerClassName)) {- return;- }- divSpan.addClass(this.markerClassName).append(inst.dpDiv);- $.data(target, PROP_NAME, inst);- this._setDate(inst, this._getDefaultDate(inst), true);- this._updateDatepicker(inst);- this._updateAlternate(inst);- //If disabled option is true, disable the datepicker before showing it (see ticket #5665)- if( inst.settings.disabled ) {- this._disableDatepicker( target );- }- // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height- inst.dpDiv.css( "display", "block" );- },-- /* Pop-up the date picker in a "dialog" box.- * @param input element - ignored- * @param date string or Date - the initial date to display- * @param onSelect function - the function to call when a date is selected- * @param settings object - update the dialog date picker instance's settings (anonymous object)- * @param pos int[2] - coordinates for the dialog's position within the screen or- * event - with x/y coordinates or- * leave empty for default (screen centre)- * @return the manager object- */- _dialogDatepicker: function(input, date, onSelect, settings, pos) {- var id, browserWidth, browserHeight, scrollX, scrollY,- inst = this._dialogInst; // internal instance-- if (!inst) {- this.uuid += 1;- id = "dp" + this.uuid;- this._dialogInput = $("<input type='text' id='" + id +- "' style='position: absolute; top: -100px; width: 0px;'/>");- this._dialogInput.keydown(this._doKeyDown);- $("body").append(this._dialogInput);- inst = this._dialogInst = this._newInst(this._dialogInput, false);- inst.settings = {};- $.data(this._dialogInput[0], PROP_NAME, inst);- }- extendRemove(inst.settings, settings || {});- date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);- this._dialogInput.val(date);-- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);- if (!this._pos) {- browserWidth = document.documentElement.clientWidth;- browserHeight = document.documentElement.clientHeight;- scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;- scrollY = document.documentElement.scrollTop || document.body.scrollTop;- this._pos = // should use actual width/height below- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];- }-- // move input on screen for focus, but hidden behind dialog- this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");- inst.settings.onSelect = onSelect;- this._inDialog = true;- this.dpDiv.addClass(this._dialogClass);- this._showDatepicker(this._dialogInput[0]);- if ($.blockUI) {- $.blockUI(this.dpDiv);- }- $.data(this._dialogInput[0], PROP_NAME, inst);- return this;},- /* Detach a datepicker from its control.- * @param target element - the target input field or division or span- */- _destroyDatepicker: function(target) {- var nodeName,- $target = $(target),- inst = $.data(target, PROP_NAME);+ _clear: function(event, noPropagation) {- if (!$target.hasClass(this.markerClassName)) {- return;- }+ this.reverting = false;+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and+ // everything else normalized again+ var i,+ delayedTriggers = [];- nodeName = target.nodeName.toLowerCase();- $.removeData(target, PROP_NAME);- if (nodeName === "input") {- inst.append.remove();- inst.trigger.remove();- $target.removeClass(this.markerClassName).- unbind("focus", this._showDatepicker).- unbind("keydown", this._doKeyDown).- unbind("keypress", this._doKeyPress).- unbind("keyup", this._doKeyUp);- } else if (nodeName === "div" || nodeName === "span") {- $target.removeClass(this.markerClassName).empty();+ // We first have to update the dom position of the actual currentItem+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)+ if(!this._noFinalSort && this.currentItem.parent().length) {+ this.placeholder.before(this.currentItem);}- },-- /* Enable the date picker to a jQuery selection.- * @param target element - the target input field or division or span- */- _enableDatepicker: function(target) {- var nodeName, inline,- $target = $(target),- inst = $.data(target, PROP_NAME);+ this._noFinalSort = null;- if (!$target.hasClass(this.markerClassName)) {- return;+ if(this.helper[0] === this.currentItem[0]) {+ for(i in this._storedCSS) {+ if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {+ this._storedCSS[i] = "";+ }+ }+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");+ } else {+ this.currentItem.show();}- nodeName = target.nodeName.toLowerCase();- if (nodeName === "input") {- target.disabled = false;- inst.trigger.filter("button").- each(function() { this.disabled = false; }).end().- filter("img").css({opacity: "1.0", cursor: ""});- } else if (nodeName === "div" || nodeName === "span") {- inline = $target.children("." + this._inlineClass);- inline.children().removeClass("ui-state-disabled");- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").- prop("disabled", false);+ if(this.fromOutside && !noPropagation) {+ delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });+ }+ if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {+ delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed}- this._disabledInputs = $.map(this._disabledInputs,- function(value) { return (value === target ? null : value); }); // delete entry- },-- /* Disable the date picker to a jQuery selection.- * @param target element - the target input field or division or span- */- _disableDatepicker: function(target) {- var nodeName, inline,- $target = $(target),- inst = $.data(target, PROP_NAME);- if (!$target.hasClass(this.markerClassName)) {- return;+ // Check if the items Container has Changed and trigger appropriate+ // events.+ if (this !== this.currentContainer) {+ if(!noPropagation) {+ delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));+ }}- nodeName = target.nodeName.toLowerCase();- if (nodeName === "input") {- target.disabled = true;- inst.trigger.filter("button").- each(function() { this.disabled = true; }).end().- filter("img").css({opacity: "0.5", cursor: "default"});- } else if (nodeName === "div" || nodeName === "span") {- inline = $target.children("." + this._inlineClass);- inline.children().addClass("ui-state-disabled");- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").- prop("disabled", true);- }- this._disabledInputs = $.map(this._disabledInputs,- function(value) { return (value === target ? null : value); }); // delete entry- this._disabledInputs[this._disabledInputs.length] = target;- },-- /* Is the first field in a jQuery collection disabled as a datepicker?- * @param target element - the target input field or division or span- * @return boolean - true if disabled, false if enabled- */- _isDisabledDatepicker: function(target) {- if (!target) {- return false;++ //Post events to containers+ function delayEvent( type, instance, container ) {+ return function( event ) {+ container._trigger( type, event, instance._uiHash( instance ) );+ };}- for (var i = 0; i < this._disabledInputs.length; i++) {- if (this._disabledInputs[i] === target) {- return true;+ for (i = this.containers.length - 1; i >= 0; i--){+ if (!noPropagation) {+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );+ }+ if(this.containers[i].containerCache.over) {+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );+ this.containers[i].containerCache.over = 0;}}- return false;- },- /* Retrieve the instance data for the target control.- * @param target element - the target input field or division or span- * @return object - the associated instance data- * @throws error if a jQuery problem getting data- */- _getInst: function(target) {- try {- return $.data(target, PROP_NAME);+ //Do what was originally in plugins+ if ( this.storedCursor ) {+ this.document.find( "body" ).css( "cursor", this.storedCursor );+ this.storedStylesheet.remove();}- catch (err) {- throw "Missing instance data for this datepicker";+ if(this._storedOpacity) {+ this.helper.css("opacity", this._storedOpacity);+ }+ if(this._storedZIndex) {+ this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);}- },- /* Update or retrieve the settings for a date picker attached to an input field or division.- * @param target element - the target input field or division or span- * @param name object - the new settings to update or- * string - the name of the setting to change or retrieve,- * when retrieving also "all" for all instance settings or- * "defaults" for all global defaults- * @param value any - the new value for the setting- * (omit if above is an object or to retrieve a value)- */- _optionDatepicker: function(target, name, value) {- var settings, date, minDate, maxDate,- inst = this._getInst(target);+ this.dragging = false;+ if(this.cancelHelperRemoval) {+ if(!noPropagation) {+ this._trigger("beforeStop", event, this._uiHash());+ for (i=0; i < delayedTriggers.length; i++) {+ delayedTriggers[i].call(this, event);+ } //Trigger all delayed events+ this._trigger("stop", event, this._uiHash());+ }- if (arguments.length === 2 && typeof name === "string") {- return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :- (inst ? (name === "all" ? $.extend({}, inst.settings) :- this._get(inst, name)) : null));+ this.fromOutside = false;+ return false;}- settings = name || {};- if (typeof name === "string") {- settings = {};- settings[name] = value;+ if(!noPropagation) {+ this._trigger("beforeStop", event, this._uiHash());}- if (inst) {- if (this._curInst === inst) {- this._hideDatepicker();- }+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);- date = this._getDateDatepicker(target, true);- minDate = this._getMinMaxDate(inst, "min");- maxDate = this._getMinMaxDate(inst, "max");- extendRemove(inst.settings, settings);- // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided- if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {- inst.settings.minDate = this._formatDate(inst, minDate);- }- if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {- inst.settings.maxDate = this._formatDate(inst, maxDate);- }- if ( "disabled" in settings ) {- if ( settings.disabled ) {- this._disableDatepicker(target);- } else {- this._enableDatepicker(target);- }- }- this._attachments($(target), inst);- this._autoSize(inst);- this._setDate(inst, date);- this._updateAlternate(inst);- this._updateDatepicker(inst);+ if(this.helper[0] !== this.currentItem[0]) {+ this.helper.remove();}- },-- // change method deprecated- _changeDatepicker: function(target, name, value) {- this._optionDatepicker(target, name, value);- },+ this.helper = null;- /* Redraw the date picker attached to an input field or division.- * @param target element - the target input field or division or span- */- _refreshDatepicker: function(target) {- var inst = this._getInst(target);- if (inst) {- this._updateDatepicker(inst);+ if(!noPropagation) {+ for (i=0; i < delayedTriggers.length; i++) {+ delayedTriggers[i].call(this, event);+ } //Trigger all delayed events+ this._trigger("stop", event, this._uiHash());}- },- /* Set the dates for a jQuery selection.- * @param target element - the target input field or division or span- * @param date Date - the new date- */- _setDateDatepicker: function(target, date) {- var inst = this._getInst(target);- if (inst) {- this._setDate(inst, date);- this._updateDatepicker(inst);- this._updateAlternate(inst);- }+ this.fromOutside = false;+ return true;+},- /* Get the date(s) for the first entry in a jQuery selection.- * @param target element - the target input field or division or span- * @param noDefault boolean - true if no default date is to be used- * @return Date - the current date- */- _getDateDatepicker: function(target, noDefault) {- var inst = this._getInst(target);- if (inst && !inst.inline) {- this._setDateFromField(inst, noDefault);+ _trigger: function() {+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {+ this.cancel();}- return (inst ? this._getDate(inst) : null);},- /* Handle keystrokes. */- _doKeyDown: function(event) {- var onSelect, dateStr, sel,- inst = $.datepicker._getInst(event.target),- handled = true,- isRTL = inst.dpDiv.is(".ui-datepicker-rtl");-- inst._keyEvent = true;- if ($.datepicker._datepickerShowing) {- switch (event.keyCode) {- case 9: $.datepicker._hideDatepicker();- handled = false;- break; // hide on tab out- case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +- $.datepicker._currentClass + ")", inst.dpDiv);- if (sel[0]) {- $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);- }+ _uiHash: function(_inst) {+ var inst = _inst || this;+ return {+ helper: inst.helper,+ placeholder: inst.placeholder || $([]),+ position: inst.position,+ originalPosition: inst.originalPosition,+ offset: inst.positionAbs,+ item: inst.currentItem,+ sender: _inst ? _inst.element : null+ };+ }- onSelect = $.datepicker._get(inst, "onSelect");- if (onSelect) {- dateStr = $.datepicker._formatDate(inst);+});- // trigger custom callback- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);- } else {- $.datepicker._hideDatepicker();- }+})(jQuery);+(function( $, undefined ) {- return false; // don't submit the form- case 27: $.datepicker._hideDatepicker();- break; // hide on escape- case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?- -$.datepicker._get(inst, "stepBigMonths") :- -$.datepicker._get(inst, "stepMonths")), "M");- break; // previous month/year on page up/+ ctrl- case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?- +$.datepicker._get(inst, "stepBigMonths") :- +$.datepicker._get(inst, "stepMonths")), "M");- break; // next month/year on page down/+ ctrl- case 35: if (event.ctrlKey || event.metaKey) {- $.datepicker._clearDate(event.target);- }- handled = event.ctrlKey || event.metaKey;- break; // clear on ctrl or command +end- case 36: if (event.ctrlKey || event.metaKey) {- $.datepicker._gotoToday(event.target);- }- handled = event.ctrlKey || event.metaKey;- break; // current on ctrl or command +home- case 37: if (event.ctrlKey || event.metaKey) {- $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");- }- handled = event.ctrlKey || event.metaKey;- // -1 day on ctrl or command +left- if (event.originalEvent.altKey) {- $.datepicker._adjustDate(event.target, (event.ctrlKey ?- -$.datepicker._get(inst, "stepBigMonths") :- -$.datepicker._get(inst, "stepMonths")), "M");- }- // next month/year on alt +left on Mac- break;- case 38: if (event.ctrlKey || event.metaKey) {- $.datepicker._adjustDate(event.target, -7, "D");- }- handled = event.ctrlKey || event.metaKey;- break; // -1 week on ctrl or command +up- case 39: if (event.ctrlKey || event.metaKey) {- $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");- }- handled = event.ctrlKey || event.metaKey;- // +1 day on ctrl or command +right- if (event.originalEvent.altKey) {- $.datepicker._adjustDate(event.target, (event.ctrlKey ?- +$.datepicker._get(inst, "stepBigMonths") :- +$.datepicker._get(inst, "stepMonths")), "M");- }- // next month/year on alt +right- break;- case 40: if (event.ctrlKey || event.metaKey) {- $.datepicker._adjustDate(event.target, +7, "D");- }- handled = event.ctrlKey || event.metaKey;- break; // +1 week on ctrl or command +down- default: handled = false;- }- } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home- $.datepicker._showDatepicker(this);- } else {- handled = false;- }+$.widget( "ui.autocomplete", {+ version: "1.10.4",+ defaultElement: "<input>",+ options: {+ appendTo: null,+ autoFocus: false,+ delay: 300,+ minLength: 1,+ position: {+ my: "left top",+ at: "left bottom",+ collision: "none"+ },+ source: null,- if (handled) {- event.preventDefault();- event.stopPropagation();- }+ // callbacks+ change: null,+ close: null,+ focus: null,+ open: null,+ response: null,+ search: null,+ select: null},- /* Filter entered characters - based on date format. */- _doKeyPress: function(event) {- var chars, chr,- inst = $.datepicker._getInst(event.target);+ requestIndex: 0,+ pending: 0,- if ($.datepicker._get(inst, "constrainInput")) {- chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));- chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);- return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);- }- },+ _create: function() {+ // Some browsers only repeat keydown events, not keypress events,+ // so we use the suppressKeyPress flag to determine if we've already+ // handled the keydown event. #7269+ // Unfortunately the code for & in keypress is the same as the up arrow,+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress+ // events when we know the keydown event was used to modify the+ // search term. #7799+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,+ nodeName = this.element[0].nodeName.toLowerCase(),+ isTextarea = nodeName === "textarea",+ isInput = nodeName === "input";- /* Synchronise manual entry and field/alternate field. */- _doKeyUp: function(event) {- var date,- inst = $.datepicker._getInst(event.target);+ this.isMultiLine =+ // Textareas are always multi-line+ isTextarea ? true :+ // Inputs are always single-line, even if inside a contentEditable element+ // IE also treats inputs as contentEditable+ isInput ? false :+ // All other element types are determined by whether or not they're contentEditable+ this.element.prop( "isContentEditable" );- if (inst.input.val() !== inst.lastVal) {- try {- date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),- (inst.input ? inst.input.val() : null),- $.datepicker._getFormatConfig(inst));+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];+ this.isNewMenu = true;- if (date) { // only if valid- $.datepicker._setDateFromField(inst);- $.datepicker._updateAlternate(inst);- $.datepicker._updateDatepicker(inst);- }- }- catch (err) {- }- }- return true;- },+ this.element+ .addClass( "ui-autocomplete-input" )+ .attr( "autocomplete", "off" );- /* Pop-up the date picker for a given input field.- * If false returned from beforeShow event handler do not show.- * @param input element - the input field attached to the date picker or- * event - if triggered by focus- */- _showDatepicker: function(input) {- input = input.target || input;- if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger- input = $("input", input.parentNode)[0];- }+ this._on( this.element, {+ keydown: function( event ) {+ if ( this.element.prop( "readOnly" ) ) {+ suppressKeyPress = true;+ suppressInput = true;+ suppressKeyPressRepeat = true;+ return;+ }- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here- return;- }+ suppressKeyPress = false;+ suppressInput = false;+ suppressKeyPressRepeat = false;+ var keyCode = $.ui.keyCode;+ switch( event.keyCode ) {+ case keyCode.PAGE_UP:+ suppressKeyPress = true;+ this._move( "previousPage", event );+ break;+ case keyCode.PAGE_DOWN:+ suppressKeyPress = true;+ this._move( "nextPage", event );+ break;+ case keyCode.UP:+ suppressKeyPress = true;+ this._keyEvent( "previous", event );+ break;+ case keyCode.DOWN:+ suppressKeyPress = true;+ this._keyEvent( "next", event );+ break;+ case keyCode.ENTER:+ case keyCode.NUMPAD_ENTER:+ // when menu is open and has focus+ if ( this.menu.active ) {+ // #6055 - Opera still allows the keypress to occur+ // which causes forms to submit+ suppressKeyPress = true;+ event.preventDefault();+ this.menu.select( event );+ }+ break;+ case keyCode.TAB:+ if ( this.menu.active ) {+ this.menu.select( event );+ }+ break;+ case keyCode.ESCAPE:+ if ( this.menu.element.is( ":visible" ) ) {+ this._value( this.term );+ this.close( event );+ // Different browsers have different default behavior for escape+ // Single press can mean undo or clear+ // Double press in IE means clear the whole form+ event.preventDefault();+ }+ break;+ default:+ suppressKeyPressRepeat = true;+ // search timeout should be triggered before the input value is changed+ this._searchTimeout( event );+ break;+ }+ },+ keypress: function( event ) {+ if ( suppressKeyPress ) {+ suppressKeyPress = false;+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {+ event.preventDefault();+ }+ return;+ }+ if ( suppressKeyPressRepeat ) {+ return;+ }- var inst, beforeShow, beforeShowSettings, isFixed,- offset, showAnim, duration;+ // replicate some key handlers to allow them to repeat in Firefox and Opera+ var keyCode = $.ui.keyCode;+ switch( event.keyCode ) {+ case keyCode.PAGE_UP:+ this._move( "previousPage", event );+ break;+ case keyCode.PAGE_DOWN:+ this._move( "nextPage", event );+ break;+ case keyCode.UP:+ this._keyEvent( "previous", event );+ break;+ case keyCode.DOWN:+ this._keyEvent( "next", event );+ break;+ }+ },+ input: function( event ) {+ if ( suppressInput ) {+ suppressInput = false;+ event.preventDefault();+ return;+ }+ this._searchTimeout( event );+ },+ focus: function() {+ this.selectedItem = null;+ this.previous = this._value();+ },+ blur: function( event ) {+ if ( this.cancelBlur ) {+ delete this.cancelBlur;+ return;+ }- inst = $.datepicker._getInst(input);- if ($.datepicker._curInst && $.datepicker._curInst !== inst) {- $.datepicker._curInst.dpDiv.stop(true, true);- if ( inst && $.datepicker._datepickerShowing ) {- $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );+ clearTimeout( this.searching );+ this.close( event );+ this._change( event );}- }-- beforeShow = $.datepicker._get(inst, "beforeShow");- beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};- if(beforeShowSettings === false){- return;- }- extendRemove(inst.settings, beforeShowSettings);-- inst.lastVal = null;- $.datepicker._lastInput = input;- $.datepicker._setDateFromField(inst);-- if ($.datepicker._inDialog) { // hide cursor- input.value = "";- }- if (!$.datepicker._pos) { // position below input- $.datepicker._pos = $.datepicker._findPos(input);- $.datepicker._pos[1] += input.offsetHeight; // add the height- }-- isFixed = false;- $(input).parents().each(function() {- isFixed |= $(this).css("position") === "fixed";- return !isFixed;});- offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};- $.datepicker._pos = null;- //to avoid flashes on Firefox- inst.dpDiv.empty();- // determine sizing offscreen- inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});- $.datepicker._updateDatepicker(inst);- // fix width for dynamic number of date pickers- // and adjust position before showing- offset = $.datepicker._checkOffset(inst, offset, isFixed);- inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?- "static" : (isFixed ? "fixed" : "absolute")), display: "none",- left: offset.left + "px", top: offset.top + "px"});-- if (!inst.inline) {- showAnim = $.datepicker._get(inst, "showAnim");- duration = $.datepicker._get(inst, "duration");- inst.dpDiv.zIndex($(input).zIndex()+1);- $.datepicker._datepickerShowing = true;-- if ( $.effects && $.effects.effect[ showAnim ] ) {- inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);- } else {- inst.dpDiv[showAnim || "show"](showAnim ? duration : null);- }-- if ( $.datepicker._shouldFocusInput( inst ) ) {- inst.input.focus();- }-- $.datepicker._curInst = inst;- }- },-- /* Generate the date picker content. */- _updateDatepicker: function(inst) {- this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)- instActive = inst; // for delegate hover events- inst.dpDiv.empty().append(this._generateHTML(inst));- this._attachHandlers(inst);- inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();-- var origyearshtml,- numMonths = this._getNumberOfMonths(inst),- cols = numMonths[1],- width = 17;+ this._initSource();+ this.menu = $( "<ul>" )+ .addClass( "ui-autocomplete ui-front" )+ .appendTo( this._appendTo() )+ .menu({+ // disable ARIA support, the live region takes care of that+ role: null+ })+ .hide()+ .data( "ui-menu" );- inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");- if (cols > 1) {- inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");- }- inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +- "Class"]("ui-datepicker-multi");- inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +- "Class"]("ui-datepicker-rtl");+ this._on( this.menu.element, {+ mousedown: function( event ) {+ // prevent moving focus out of the text field+ event.preventDefault();- if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {- inst.input.focus();- }+ // IE doesn't prevent moving focus even with event.preventDefault()+ // so we set a flag to know when we should ignore the blur event+ this.cancelBlur = true;+ this._delay(function() {+ delete this.cancelBlur;+ });- // deffered render of the years select (to avoid flashes on Firefox)- if( inst.yearshtml ){- origyearshtml = inst.yearshtml;- setTimeout(function(){- //assure that inst.yearshtml didn't change.- if( origyearshtml === inst.yearshtml && inst.yearshtml ){- inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);+ // clicking on the scrollbar causes focus to shift to the body+ // but we can't detect a mouseup or a click immediately afterward+ // so we have to track the next mousedown and close the menu if+ // the user clicks somewhere outside of the autocomplete+ var menuElement = this.menu.element[ 0 ];+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {+ this._delay(function() {+ var that = this;+ this.document.one( "mousedown", function( event ) {+ if ( event.target !== that.element[ 0 ] &&+ event.target !== menuElement &&+ !$.contains( menuElement, event.target ) ) {+ that.close();+ }+ });+ });}- origyearshtml = inst.yearshtml = null;- }, 0);- }- },-- // #6694 - don't focus the input if it's already focused- // this breaks the change event in IE- // Support: IE and jQuery <1.9- _shouldFocusInput: function( inst ) {- return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );- },-- /* Check positioning to remain on screen. */- _checkOffset: function(inst, offset, isFixed) {- var dpWidth = inst.dpDiv.outerWidth(),- dpHeight = inst.dpDiv.outerHeight(),- inputWidth = inst.input ? inst.input.outerWidth() : 0,- inputHeight = inst.input ? inst.input.outerHeight() : 0,- viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),- viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());-- offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);- offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;- offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;-- // now check if datepicker is showing outside window viewport - move to a better place if so.- offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?- Math.abs(offset.left + dpWidth - viewWidth) : 0);- offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?- Math.abs(dpHeight + inputHeight) : 0);-- return offset;- },-- /* Find an object's position on the screen. */- _findPos: function(obj) {- var position,- inst = this._getInst(obj),- isRTL = this._get(inst, "isRTL");-- while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {- obj = obj[isRTL ? "previousSibling" : "nextSibling"];- }+ },+ menufocus: function( event, ui ) {+ // support: Firefox+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)+ if ( this.isNewMenu ) {+ this.isNewMenu = false;+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {+ this.menu.blur();- position = $(obj).offset();- return [position.left, position.top];- },+ this.document.one( "mousemove", function() {+ $( event.target ).trigger( event.originalEvent );+ });- /* Hide the date picker from view.- * @param input element - the input field attached to the date picker- */- _hideDatepicker: function(input) {- var showAnim, duration, postProcess, onClose,- inst = this._curInst;+ return;+ }+ }- if (!inst || (input && inst !== $.data(input, PROP_NAME))) {- return;- }+ var item = ui.item.data( "ui-autocomplete-item" );+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {+ // use value to match what will end up in the input, if it was a key event+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {+ this._value( item.value );+ }+ } else {+ // Normally the input is populated with the item's value as the+ // menu is navigated, causing screen readers to notice a change and+ // announce the item. Since the focus event was canceled, this doesn't+ // happen, so we update the live region so that screen readers can+ // still notice the change and announce it.+ this.liveRegion.text( item.value );+ }+ },+ menuselect: function( event, ui ) {+ var item = ui.item.data( "ui-autocomplete-item" ),+ previous = this.previous;- if (this._datepickerShowing) {- showAnim = this._get(inst, "showAnim");- duration = this._get(inst, "duration");- postProcess = function() {- $.datepicker._tidyDialog(inst);- };+ // only trigger when focus was lost (click on menu)+ if ( this.element[0] !== this.document[0].activeElement ) {+ this.element.focus();+ this.previous = previous;+ // #6109 - IE triggers two focus events and the second+ // is asynchronous, so we need to reset the previous+ // term synchronously and asynchronously :-(+ this._delay(function() {+ this.previous = previous;+ this.selectedItem = item;+ });+ }- // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed- if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);- } else {- inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :- (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);- }+ if ( false !== this._trigger( "select", event, { item: item } ) ) {+ this._value( item.value );+ }+ // reset the term after the select event+ // this allows custom select handling to work properly+ this.term = this._value();- if (!showAnim) {- postProcess();+ this.close( event );+ this.selectedItem = item;}- this._datepickerShowing = false;+ });- onClose = this._get(inst, "onClose");- if (onClose) {- onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);- }+ this.liveRegion = $( "<span>", {+ role: "status",+ "aria-live": "polite"+ })+ .addClass( "ui-helper-hidden-accessible" )+ .insertBefore( this.element );- this._lastInput = null;- if (this._inDialog) {- this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });- if ($.blockUI) {- $.unblockUI();- $("body").append(this.dpDiv);- }+ // turning off autocomplete prevents the browser from remembering the+ // value when navigating through history, so we re-enable autocomplete+ // if the page is unloaded before the widget is destroyed. #7790+ this._on( this.window, {+ beforeunload: function() {+ this.element.removeAttr( "autocomplete" );}- this._inDialog = false;- }+ });},- /* Tidy up after a dialog display. */- _tidyDialog: function(inst) {- inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");+ _destroy: function() {+ clearTimeout( this.searching );+ this.element+ .removeClass( "ui-autocomplete-input" )+ .removeAttr( "autocomplete" );+ this.menu.element.remove();+ this.liveRegion.remove();},- /* Close date picker if clicked elsewhere. */- _checkExternalClick: function(event) {- if (!$.datepicker._curInst) {- return;- }-- var $target = $(event.target),- inst = $.datepicker._getInst($target[0]);-- if ( ( ( $target[0].id !== $.datepicker._mainDivId &&- $target.parents("#" + $.datepicker._mainDivId).length === 0 &&- !$target.hasClass($.datepicker.markerClassName) &&- !$target.closest("." + $.datepicker._triggerClass).length &&- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||- ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {- $.datepicker._hideDatepicker();+ _setOption: function( key, value ) {+ this._super( key, value );+ if ( key === "source" ) {+ this._initSource();}- },-- /* Adjust one of the date sub-fields. */- _adjustDate: function(id, offset, period) {- var target = $(id),- inst = this._getInst(target[0]);-- if (this._isDisabledDatepicker(target[0])) {- return;+ if ( key === "appendTo" ) {+ this.menu.element.appendTo( this._appendTo() );}- this._adjustInstDate(inst, offset +- (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning- period);- this._updateDatepicker(inst);- },-- /* Action for current link. */- _gotoToday: function(id) {- var date,- target = $(id),- inst = this._getInst(target[0]);-- if (this._get(inst, "gotoCurrent") && inst.currentDay) {- inst.selectedDay = inst.currentDay;- inst.drawMonth = inst.selectedMonth = inst.currentMonth;- inst.drawYear = inst.selectedYear = inst.currentYear;- } else {- date = new Date();- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();+ if ( key === "disabled" && value && this.xhr ) {+ this.xhr.abort();}- this._notifyChange(inst);- this._adjustDate(target);- },-- /* Action for selecting a new month/year. */- _selectMonthYear: function(id, select, period) {- var target = $(id),- inst = this._getInst(target[0]);-- inst["selected" + (period === "M" ? "Month" : "Year")] =- inst["draw" + (period === "M" ? "Month" : "Year")] =- parseInt(select.options[select.selectedIndex].value,10);-- this._notifyChange(inst);- this._adjustDate(target);},- /* Action for selecting a day. */- _selectDay: function(id, month, year, td) {- var inst,- target = $(id);+ _appendTo: function() {+ var element = this.options.appendTo;- if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {- return;+ if ( element ) {+ element = element.jquery || element.nodeType ?+ $( element ) :+ this.document.find( element ).eq( 0 );}- inst = this._getInst(target[0]);- inst.selectedDay = inst.currentDay = $("a", td).html();- inst.selectedMonth = inst.currentMonth = month;- inst.selectedYear = inst.currentYear = year;- this._selectDate(id, this._formatDate(inst,- inst.currentDay, inst.currentMonth, inst.currentYear));- },-- /* Erase the input field and hide the date picker. */- _clearDate: function(id) {- var target = $(id);- this._selectDate(target, "");- },-- /* Update the input field with the selected date. */- _selectDate: function(id, dateStr) {- var onSelect,- target = $(id),- inst = this._getInst(target[0]);-- dateStr = (dateStr != null ? dateStr : this._formatDate(inst));- if (inst.input) {- inst.input.val(dateStr);+ if ( !element ) {+ element = this.element.closest( ".ui-front" );}- this._updateAlternate(inst);- onSelect = this._get(inst, "onSelect");- if (onSelect) {- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback- } else if (inst.input) {- inst.input.trigger("change"); // fire the change event+ if ( !element.length ) {+ element = this.document[0].body;}- if (inst.inline){- this._updateDatepicker(inst);- } else {- this._hideDatepicker();- this._lastInput = inst.input[0];- if (typeof(inst.input[0]) !== "object") {- inst.input.focus(); // restore focus- }- this._lastInput = null;- }- },-- /* Update any alternate field to synchronise with the main field. */- _updateAlternate: function(inst) {- var altFormat, date, dateStr,- altField = this._get(inst, "altField");-- if (altField) { // update alternate field too- altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");- date = this._getDate(inst);- dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));- $(altField).each(function() { $(this).val(dateStr); });- }- },-- /* Set as beforeShowDay function to prevent selection of weekends.- * @param date Date - the date to customise- * @return [boolean, string] - is this date selectable?, what is its CSS class?- */- noWeekends: function(date) {- var day = date.getDay();- return [(day > 0 && day < 6), ""];- },-- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.- * @param date Date - the date to get the week for- * @return number - the number of the week within the year that contains this date- */- iso8601Week: function(date) {- var time,- checkDate = new Date(date.getTime());-- // Find Thursday of this week starting on Monday- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));-- time = checkDate.getTime();- checkDate.setMonth(0); // Compare with Jan 1- checkDate.setDate(1);- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;- },-- /* Parse a string value into a date object.- * See formatDate below for the possible formats.- *- * @param format string - the expected format of the date- * @param value string - the date in the above format- * @param settings Object - attributes include:- * shortYearCutoff number - the cutoff year for determining the century (optional)- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)- * dayNames string[7] - names of the days from Sunday (optional)- * monthNamesShort string[12] - abbreviated names of the months (optional)- * monthNames string[12] - names of the months (optional)- * @return Date - the extracted date value or null if value is blank- */- parseDate: function (format, value, settings) {- if (format == null || value == null) {- throw "Invalid arguments";- }-- value = (typeof value === "object" ? value.toString() : value + "");- if (value === "") {- return null;- }-- var iFormat, dim, extra,- iValue = 0,- shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,- shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :- new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,- year = -1,- month = -1,- day = -1,- doy = -1,- literal = false,- date,- // Check whether a format character is doubled- lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);- if (matches) {- iFormat++;- }- return matches;- },- // Extract a number from the string value- getNumber = function(match) {- var isDoubled = lookAhead(match),- size = (match === "@" ? 14 : (match === "!" ? 20 :- (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),- digits = new RegExp("^\\d{1," + size + "}"),- num = value.substring(iValue).match(digits);- if (!num) {- throw "Missing number at position " + iValue;- }- iValue += num[0].length;- return parseInt(num[0], 10);- },- // Extract a name from the string value and convert to an index- getName = function(match, shortNames, longNames) {- var index = -1,- names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {- return [ [k, v] ];- }).sort(function (a, b) {- return -(a[1].length - b[1].length);- });+ return element;+ },- $.each(names, function (i, pair) {- var name = pair[1];- if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {- index = pair[0];- iValue += name.length;- return false;- }- });- if (index !== -1) {- return index + 1;- } else {- throw "Unknown name at position " + iValue;- }- },- // Confirm that a literal character matches the string value- checkLiteral = function() {- if (value.charAt(iValue) !== format.charAt(iFormat)) {- throw "Unexpected literal at position " + iValue;- }- iValue++;+ _initSource: function() {+ var array, url,+ that = this;+ if ( $.isArray(this.options.source) ) {+ array = this.options.source;+ this.source = function( request, response ) {+ response( $.ui.autocomplete.filter( array, request.term ) );};-- for (iFormat = 0; iFormat < format.length; iFormat++) {- if (literal) {- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {- literal = false;- } else {- checkLiteral();- }- } else {- switch (format.charAt(iFormat)) {- case "d":- day = getNumber("d");- break;- case "D":- getName("D", dayNamesShort, dayNames);- break;- case "o":- doy = getNumber("o");- break;- case "m":- month = getNumber("m");- break;- case "M":- month = getName("M", monthNamesShort, monthNames);- break;- case "y":- year = getNumber("y");- break;- case "@":- date = new Date(getNumber("@"));- year = date.getFullYear();- month = date.getMonth() + 1;- day = date.getDate();- break;- case "!":- date = new Date((getNumber("!") - this._ticksTo1970) / 10000);- year = date.getFullYear();- month = date.getMonth() + 1;- day = date.getDate();- break;- case "'":- if (lookAhead("'")){- checkLiteral();- } else {- literal = true;- }- break;- default:- checkLiteral();- }- }- }-- if (iValue < value.length){- extra = value.substr(iValue);- if (!/^\s+/.test(extra)) {- throw "Extra/unparsed characters found in date: " + extra;- }- }-- if (year === -1) {- year = new Date().getFullYear();- } else if (year < 100) {- year += new Date().getFullYear() - new Date().getFullYear() % 100 +- (year <= shortYearCutoff ? 0 : -100);- }-- if (doy > -1) {- month = 1;- day = doy;- do {- dim = this._getDaysInMonth(year, month - 1);- if (day <= dim) {- break;- }- month++;- day -= dim;- } while (true);- }-- date = this._daylightSavingAdjust(new Date(year, month - 1, day));- if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {- throw "Invalid date"; // E.g. 31/02/00- }- return date;- },-- /* Standard date formats. */- ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)- COOKIE: "D, dd M yy",- ISO_8601: "yy-mm-dd",- RFC_822: "D, d M y",- RFC_850: "DD, dd-M-y",- RFC_1036: "D, d M y",- RFC_1123: "D, d M yy",- RFC_2822: "D, d M yy",- RSS: "D, d M y", // RFC 822- TICKS: "!",- TIMESTAMP: "@",- W3C: "yy-mm-dd", // ISO 8601-- _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +- Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),-- /* Format a date object into a string value.- * The format can be combinations of the following:- * d - day of month (no leading zero)- * dd - day of month (two digit)- * o - day of year (no leading zeros)- * oo - day of year (three digit)- * D - day name short- * DD - day name long- * m - month of year (no leading zero)- * mm - month of year (two digit)- * M - month name short- * MM - month name long- * y - year (two digit)- * yy - year (four digit)- * @ - Unix timestamp (ms since 01/01/1970)- * ! - Windows ticks (100ns since 01/01/0001)- * "..." - literal text- * '' - single quote- *- * @param format string - the desired format of the date- * @param date Date - the date value to format- * @param settings Object - attributes include:- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)- * dayNames string[7] - names of the days from Sunday (optional)- * monthNamesShort string[12] - abbreviated names of the months (optional)- * monthNames string[12] - names of the months (optional)- * @return string - the date in the above format- */- formatDate: function (format, date, settings) {- if (!date) {- return "";- }-- var iFormat,- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,- // Check whether a format character is doubled- lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);- if (matches) {- iFormat++;- }- return matches;- },- // Format a number, with leading zero if necessary- formatNumber = function(match, value, len) {- var num = "" + value;- if (lookAhead(match)) {- while (num.length < len) {- num = "0" + num;- }+ } else if ( typeof this.options.source === "string" ) {+ url = this.options.source;+ this.source = function( request, response ) {+ if ( that.xhr ) {+ that.xhr.abort();}- return num;- },- // Format a name, short or long as requested- formatName = function(match, value, shortNames, longNames) {- return (lookAhead(match) ? longNames[value] : shortNames[value]);- },- output = "",- literal = false;-- if (date) {- for (iFormat = 0; iFormat < format.length; iFormat++) {- if (literal) {- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {- literal = false;- } else {- output += format.charAt(iFormat);- }- } else {- switch (format.charAt(iFormat)) {- case "d":- output += formatNumber("d", date.getDate(), 2);- break;- case "D":- output += formatName("D", date.getDay(), dayNamesShort, dayNames);- break;- case "o":- output += formatNumber("o",- Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);- break;- case "m":- output += formatNumber("m", date.getMonth() + 1, 2);- break;- case "M":- output += formatName("M", date.getMonth(), monthNamesShort, monthNames);- break;- case "y":- output += (lookAhead("y") ? date.getFullYear() :- (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);- break;- case "@":- output += date.getTime();- break;- case "!":- output += date.getTime() * 10000 + this._ticksTo1970;- break;- case "'":- if (lookAhead("'")) {- output += "'";- } else {- literal = true;- }- break;- default:- output += format.charAt(iFormat);+ that.xhr = $.ajax({+ url: url,+ data: request,+ dataType: "json",+ success: function( data ) {+ response( data );+ },+ error: function() {+ response( [] );}- }- }+ });+ };+ } else {+ this.source = this.options.source;}- return output;},- /* Extract all possible characters from the date format. */- _possibleChars: function (format) {- var iFormat,- chars = "",- literal = false,- // Check whether a format character is doubled- lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);- if (matches) {- iFormat++;- }- return matches;- };-- for (iFormat = 0; iFormat < format.length; iFormat++) {- if (literal) {- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {- literal = false;- } else {- chars += format.charAt(iFormat);- }- } else {- switch (format.charAt(iFormat)) {- case "d": case "m": case "y": case "@":- chars += "0123456789";- break;- case "D": case "M":- return null; // Accept anything- case "'":- if (lookAhead("'")) {- chars += "'";- } else {- literal = true;- }- break;- default:- chars += format.charAt(iFormat);- }+ _searchTimeout: function( event ) {+ clearTimeout( this.searching );+ this.searching = this._delay(function() {+ // only search if the value has changed+ if ( this.term !== this._value() ) {+ this.selectedItem = null;+ this.search( null, event );}- }- return chars;+ }, this.options.delay );},- /* Get a setting value, defaulting if necessary. */- _get: function(inst, name) {- return inst.settings[name] !== undefined ?- inst.settings[name] : this._defaults[name];- },+ search: function( value, event ) {+ value = value != null ? value : this._value();++ // always save the actual value, not the one passed as an argument+ this.term = this._value();++ if ( value.length < this.options.minLength ) {+ return this.close( event );+ }- /* Parse existing date and initialise date picker. */- _setDateFromField: function(inst, noDefault) {- if (inst.input.val() === inst.lastVal) {+ if ( this._trigger( "search", event ) === false ) {return;}- var dateFormat = this._get(inst, "dateFormat"),- dates = inst.lastVal = inst.input ? inst.input.val() : null,- defaultDate = this._getDefaultDate(inst),- date = defaultDate,- settings = this._getFormatConfig(inst);+ return this._search( value );+ },- try {- date = this.parseDate(dateFormat, dates, settings) || defaultDate;- } catch (event) {- dates = (noDefault ? "" : dates);- }- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();- inst.currentDay = (dates ? date.getDate() : 0);- inst.currentMonth = (dates ? date.getMonth() : 0);- inst.currentYear = (dates ? date.getFullYear() : 0);- this._adjustInstDate(inst);- },-- /* Retrieve the default date shown on opening. */- _getDefaultDate: function(inst) {- return this._restrictMinMax(inst,- this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));- },-- /* A date may be specified as an exact value or a relative one. */- _determineDate: function(inst, date, defaultDate) {- var offsetNumeric = function(offset) {- var date = new Date();- date.setDate(date.getDate() + offset);- return date;- },- offsetString = function(offset) {- try {- return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),- offset, $.datepicker._getFormatConfig(inst));- }- catch (e) {- // Ignore- }+ _search: function( value ) {+ this.pending++;+ this.element.addClass( "ui-autocomplete-loading" );+ this.cancelSearch = false;- var date = (offset.toLowerCase().match(/^c/) ?- $.datepicker._getDate(inst) : null) || new Date(),- year = date.getFullYear(),- month = date.getMonth(),- day = date.getDate(),- pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,- matches = pattern.exec(offset);-- while (matches) {- switch (matches[2] || "d") {- case "d" : case "D" :- day += parseInt(matches[1],10); break;- case "w" : case "W" :- day += parseInt(matches[1],10) * 7; break;- case "m" : case "M" :- month += parseInt(matches[1],10);- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));- break;- case "y": case "Y" :- year += parseInt(matches[1],10);- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));- break;- }- matches = pattern.exec(offset);- }- return new Date(year, month, day);- },- newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :- (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));-- newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);- if (newDate) {- newDate.setHours(0);- newDate.setMinutes(0);- newDate.setSeconds(0);- newDate.setMilliseconds(0);- }- return this._daylightSavingAdjust(newDate);- },-- /* Handle switch to/from daylight saving.- * Hours may be non-zero on daylight saving cut-over:- * > 12 when midnight changeover, but then cannot generate- * midnight datetime, so jump to 1AM, otherwise reset.- * @param date (Date) the date to check- * @return (Date) the corrected date- */- _daylightSavingAdjust: function(date) {- if (!date) {- return null;- }- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);- return date;- },-- /* Set the date(s) directly. */- _setDate: function(inst, date, noChange) {- var clear = !date,- origMonth = inst.selectedMonth,- origYear = inst.selectedYear,- newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));-- inst.selectedDay = inst.currentDay = newDate.getDate();- inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();- inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();- if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {- this._notifyChange(inst);- }- this._adjustInstDate(inst);- if (inst.input) {- inst.input.val(clear ? "" : this._formatDate(inst));- }- },-- /* Retrieve the date(s) directly. */- _getDate: function(inst) {- var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :- this._daylightSavingAdjust(new Date(- inst.currentYear, inst.currentMonth, inst.currentDay)));- return startDate;- },-- /* Attach the onxxx handlers. These are declared statically so- * they work with static code transformers like Caja.- */- _attachHandlers: function(inst) {- var stepMonths = this._get(inst, "stepMonths"),- id = "#" + inst.id.replace( /\\\\/g, "\\" );- inst.dpDiv.find("[data-handler]").map(function () {- var handler = {- prev: function () {- $.datepicker._adjustDate(id, -stepMonths, "M");- },- next: function () {- $.datepicker._adjustDate(id, +stepMonths, "M");- },- hide: function () {- $.datepicker._hideDatepicker();- },- today: function () {- $.datepicker._gotoToday(id);- },- selectDay: function () {- $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);- return false;- },- selectMonth: function () {- $.datepicker._selectMonthYear(id, this, "M");- return false;- },- selectYear: function () {- $.datepicker._selectMonthYear(id, this, "Y");- return false;- }- };- $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);- });+ this.source( { term: value }, this._response() );},- /* Generate the HTML for the current state of the date picker. */- _generateHTML: function(inst) {- var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,- controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,- monthNames, monthNamesShort, beforeShowDay, showOtherMonths,- selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,- cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,- printDate, dRow, tbody, daySettings, otherMonth, unselectable,- tempDate = new Date(),- today = this._daylightSavingAdjust(- new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time- isRTL = this._get(inst, "isRTL"),- showButtonPanel = this._get(inst, "showButtonPanel"),- hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),- navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),- numMonths = this._getNumberOfMonths(inst),- showCurrentAtPos = this._get(inst, "showCurrentAtPos"),- stepMonths = this._get(inst, "stepMonths"),- isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),- currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :- new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),- minDate = this._getMinMaxDate(inst, "min"),- maxDate = this._getMinMaxDate(inst, "max"),- drawMonth = inst.drawMonth - showCurrentAtPos,- drawYear = inst.drawYear;-- if (drawMonth < 0) {- drawMonth += 12;- drawYear--;- }- if (maxDate) {- maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),- maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);- while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {- drawMonth--;- if (drawMonth < 0) {- drawMonth = 11;- drawYear--;- }+ _response: function() {+ var index = ++this.requestIndex;++ return $.proxy(function( content ) {+ if ( index === this.requestIndex ) {+ this.__response( content );}- }- inst.drawMonth = drawMonth;- inst.drawYear = drawYear;-- prevText = this._get(inst, "prevText");- prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,- this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),- this._getFormatConfig(inst)));-- prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?- "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +- " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :- (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));-- nextText = this._get(inst, "nextText");- nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,- this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),- this._getFormatConfig(inst)));-- next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?- "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +- " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :- (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));-- currentText = this._get(inst, "currentText");- gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);- currentText = (!navigationAsDateFormat ? currentText :- this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));-- controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +- this._get(inst, "closeText") + "</button>" : "");-- buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +- (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +- ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";-- firstDay = parseInt(this._get(inst, "firstDay"),10);- firstDay = (isNaN(firstDay) ? 0 : firstDay);-- showWeek = this._get(inst, "showWeek");- dayNames = this._get(inst, "dayNames");- dayNamesMin = this._get(inst, "dayNamesMin");- monthNames = this._get(inst, "monthNames");- monthNamesShort = this._get(inst, "monthNamesShort");- beforeShowDay = this._get(inst, "beforeShowDay");- showOtherMonths = this._get(inst, "showOtherMonths");- selectOtherMonths = this._get(inst, "selectOtherMonths");- defaultDate = this._getDefaultDate(inst);- html = "";- dow;- for (row = 0; row < numMonths[0]; row++) {- group = "";- this.maxRows = 4;- for (col = 0; col < numMonths[1]; col++) {- selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));- cornerClass = " ui-corner-all";- calender = "";- if (isMultiMonth) {- calender += "<div class='ui-datepicker-group";- if (numMonths[1] > 1) {- switch (col) {- case 0: calender += " ui-datepicker-group-first";- cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;- case numMonths[1]-1: calender += " ui-datepicker-group-last";- cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;- default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;- }- }- calender += "'>";- }- calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +- (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +- (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +- this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,- row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers- "</div><table class='ui-datepicker-calendar'><thead>" +- "<tr>";- thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");- for (dow = 0; dow < 7; dow++) { // days of the week- day = (dow + firstDay) % 7;- thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +- "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";- }- calender += thead + "</tr></thead><tbody>";- daysInMonth = this._getDaysInMonth(drawYear, drawMonth);- if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {- inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);- }- leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;- curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate- numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)- this.maxRows = numRows;- printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));- for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows- calender += "<tr>";- tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +- this._get(inst, "calculateWeek")(printDate) + "</td>");- for (dow = 0; dow < 7; dow++) { // create date picker days- daySettings = (beforeShowDay ?- beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);- otherMonth = (printDate.getMonth() !== drawMonth);- unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);- tbody += "<td class='" +- ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends- (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months- ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key- (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?- // or defaultDate is current printedDate and defaultDate is selectedDate- " " + this._dayOverClass : "") + // highlight selected day- (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days- (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates- (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day- (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)- ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "'") + "'" : "") + // cell title- (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions- (otherMonth && !showOtherMonths ? " " : // display for other months- (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +- (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +- (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day- (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months- "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date- printDate.setDate(printDate.getDate() + 1);- printDate = this._daylightSavingAdjust(printDate);- }- calender += tbody + "</tr>";- }- drawMonth++;- if (drawMonth > 11) {- drawMonth = 0;- drawYear++;- }- calender += "</tbody></table>" + (isMultiMonth ? "</div>" +- ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");- group += calender;++ this.pending--;+ if ( !this.pending ) {+ this.element.removeClass( "ui-autocomplete-loading" );}- html += group;- }- html += buttonPanel;- inst._keyEvent = false;- return html;+ }, this );},- /* Generate the month and year header. */- _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,- secondary, monthNames, monthNamesShort) {-- var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,- changeMonth = this._get(inst, "changeMonth"),- changeYear = this._get(inst, "changeYear"),- showMonthAfterYear = this._get(inst, "showMonthAfterYear"),- html = "<div class='ui-datepicker-title'>",- monthHtml = "";-- // month selection- if (secondary || !changeMonth) {- monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";- } else {- inMinYear = (minDate && minDate.getFullYear() === drawYear);- inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);- monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";- for ( month = 0; month < 12; month++) {- if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {- monthHtml += "<option value='" + month + "'" +- (month === drawMonth ? " selected='selected'" : "") +- ">" + monthNamesShort[month] + "</option>";- }- }- monthHtml += "</select>";+ __response: function( content ) {+ if ( content ) {+ content = this._normalize( content );}-- if (!showMonthAfterYear) {- html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : "");+ this._trigger( "response", null, { content: content } );+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {+ this._suggest( content );+ this._trigger( "open" );+ } else {+ // use ._close() instead of .close() so we don't cancel future searches+ this._close();}+ },- // year selection- if ( !inst.yearshtml ) {- inst.yearshtml = "";- if (secondary || !changeYear) {- html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";- } else {- // determine range of years to display- years = this._get(inst, "yearRange").split(":");- thisYear = new Date().getFullYear();- determineYear = function(value) {- var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :- (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :- parseInt(value, 10)));- return (isNaN(year) ? thisYear : year);- };- year = determineYear(years[0]);- endYear = Math.max(year, determineYear(years[1] || ""));- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);- inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";- for (; year <= endYear; year++) {- inst.yearshtml += "<option value='" + year + "'" +- (year === drawYear ? " selected='selected'" : "") +- ">" + year + "</option>";- }- inst.yearshtml += "</select>";+ close: function( event ) {+ this.cancelSearch = true;+ this._close( event );+ },- html += inst.yearshtml;- inst.yearshtml = null;- }+ _close: function( event ) {+ if ( this.menu.element.is( ":visible" ) ) {+ this.menu.element.hide();+ this.menu.blur();+ this.isNewMenu = true;+ this._trigger( "close", event );}+ },- html += this._get(inst, "yearSuffix");- if (showMonthAfterYear) {- html += (secondary || !(changeMonth && changeYear) ? " " : "") + monthHtml;+ _change: function( event ) {+ if ( this.previous !== this._value() ) {+ this._trigger( "change", event, { item: this.selectedItem } );}- html += "</div>"; // Close datepicker_header- return html;},- /* Adjust one of the date sub-fields. */- _adjustInstDate: function(inst, offset, period) {- var year = inst.drawYear + (period === "Y" ? offset : 0),- month = inst.drawMonth + (period === "M" ? offset : 0),- day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),- date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));-- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();- if (period === "M" || period === "Y") {- this._notifyChange(inst);+ _normalize: function( items ) {+ // assume all items have the right format when the first item is complete+ if ( items.length && items[0].label && items[0].value ) {+ return items;}+ return $.map( items, function( item ) {+ if ( typeof item === "string" ) {+ return {+ label: item,+ value: item+ };+ }+ return $.extend({+ label: item.label || item.value,+ value: item.value || item.label+ }, item );+ });},- /* Ensure a date is within any min/max bounds. */- _restrictMinMax: function(inst, date) {- var minDate = this._getMinMaxDate(inst, "min"),- maxDate = this._getMinMaxDate(inst, "max"),- newDate = (minDate && date < minDate ? minDate : date);- return (maxDate && newDate > maxDate ? maxDate : newDate);- },+ _suggest: function( items ) {+ var ul = this.menu.element.empty();+ this._renderMenu( ul, items );+ this.isNewMenu = true;+ this.menu.refresh();++ // size and position menu+ ul.show();+ this._resizeMenu();+ ul.position( $.extend({+ of: this.element+ }, this.options.position ));- /* Notify change of month/year. */- _notifyChange: function(inst) {- var onChange = this._get(inst, "onChangeMonthYear");- if (onChange) {- onChange.apply((inst.input ? inst.input[0] : null),- [inst.selectedYear, inst.selectedMonth + 1, inst]);+ if ( this.options.autoFocus ) {+ this.menu.next();}},- /* Determine the number of months to show. */- _getNumberOfMonths: function(inst) {- var numMonths = this._get(inst, "numberOfMonths");- return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));+ _resizeMenu: function() {+ var ul = this.menu.element;+ ul.outerWidth( Math.max(+ // Firefox wraps long text (possibly a rounding bug)+ // so we add 1px to avoid the wrapping (#7513)+ ul.width( "" ).outerWidth() + 1,+ this.element.outerWidth()+ ) );},- /* Determine the current maximum date - ensure no time components are set. */- _getMinMaxDate: function(inst, minMax) {- return this._determineDate(inst, this._get(inst, minMax + "Date"), null);+ _renderMenu: function( ul, items ) {+ var that = this;+ $.each( items, function( index, item ) {+ that._renderItemData( ul, item );+ });},- /* Find the number of days in a given month. */- _getDaysInMonth: function(year, month) {- return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();+ _renderItemData: function( ul, item ) {+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );},- /* Find the day of the week of the first of a month. */- _getFirstDayOfMonth: function(year, month) {- return new Date(year, month, 1).getDay();+ _renderItem: function( ul, item ) {+ return $( "<li>" )+ .append( $( "<a>" ).text( item.label ) )+ .appendTo( ul );},- /* Determines if we should allow a "next/prev" month display change. */- _canAdjustMonth: function(inst, offset, curYear, curMonth) {- var numMonths = this._getNumberOfMonths(inst),- date = this._daylightSavingAdjust(new Date(curYear,- curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));-- if (offset < 0) {- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));+ _move: function( direction, event ) {+ if ( !this.menu.element.is( ":visible" ) ) {+ this.search( null, event );+ return;+ }+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||+ this.menu.isLastItem() && /^next/.test( direction ) ) {+ this._value( this.term );+ this.menu.blur();+ return;}- return this._isInRange(inst, date);+ this.menu[ direction ]( event );},- /* Is the given date in the accepted range? */- _isInRange: function(inst, date) {- var yearSplit, currentYear,- minDate = this._getMinMaxDate(inst, "min"),- maxDate = this._getMinMaxDate(inst, "max"),- minYear = null,- maxYear = null,- years = this._get(inst, "yearRange");- if (years){- yearSplit = years.split(":");- currentYear = new Date().getFullYear();- minYear = parseInt(yearSplit[0], 10);- maxYear = parseInt(yearSplit[1], 10);- if ( yearSplit[0].match(/[+\-].*/) ) {- minYear += currentYear;- }- if ( yearSplit[1].match(/[+\-].*/) ) {- maxYear += currentYear;- }- }-- return ((!minDate || date.getTime() >= minDate.getTime()) &&- (!maxDate || date.getTime() <= maxDate.getTime()) &&- (!minYear || date.getFullYear() >= minYear) &&- (!maxYear || date.getFullYear() <= maxYear));+ widget: function() {+ return this.menu.element;},- /* Provide the configuration settings for formatting/parsing. */- _getFormatConfig: function(inst) {- var shortYearCutoff = this._get(inst, "shortYearCutoff");- shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));- return {shortYearCutoff: shortYearCutoff,- dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),- monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};+ _value: function() {+ return this.valueMethod.apply( this.element, arguments );},- /* Format the given date for display. */- _formatDate: function(inst, day, month, year) {- if (!day) {- inst.currentDay = inst.selectedDay;- inst.currentMonth = inst.selectedMonth;- inst.currentYear = inst.selectedYear;+ _keyEvent: function( keyEvent, event ) {+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {+ this._move( keyEvent, event );++ // prevents moving cursor to beginning/end of the text field in some browsers+ event.preventDefault();}- var date = (day ? (typeof day === "object" ? day :- this._daylightSavingAdjust(new Date(year, month, day))) :- this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));- return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));}});-/*- * Bind hover events for datepicker elements.- * Done via delegate so the binding only occurs once in the lifetime of the parent div.- * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.- */-function bindHover(dpDiv) {- var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";- return dpDiv.delegate(selector, "mouseout", function() {- $(this).removeClass("ui-state-hover");- if (this.className.indexOf("ui-datepicker-prev") !== -1) {- $(this).removeClass("ui-datepicker-prev-hover");- }- if (this.className.indexOf("ui-datepicker-next") !== -1) {- $(this).removeClass("ui-datepicker-next-hover");- }- })- .delegate(selector, "mouseover", function(){- if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {- $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");- $(this).addClass("ui-state-hover");- if (this.className.indexOf("ui-datepicker-prev") !== -1) {- $(this).addClass("ui-datepicker-prev-hover");- }- if (this.className.indexOf("ui-datepicker-next") !== -1) {- $(this).addClass("ui-datepicker-next-hover");- }- }+$.extend( $.ui.autocomplete, {+ escapeRegex: function( value ) {+ return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");+ },+ filter: function(array, term) {+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );+ return $.grep( array, function(value) {+ return matcher.test( value.label || value.value || value );});-}--/* jQuery extend now ignores nulls! */-function extendRemove(target, props) {- $.extend(target, props);- for (var name in props) {- if (props[name] == null) {- target[name] = props[name];- }- }- return target;-}--/* Invoke the datepicker functionality.- @param options string - a command, optionally followed by additional parameters or- Object - settings for attaching new datepicker functionality- @return jQuery object */-$.fn.datepicker = function(options){-- /* Verify an empty collection wasn't passed - Fixes #6976 */- if ( !this.length ) {- return this;}+});- /* Initialise the date picker. */- if (!$.datepicker.initialized) {- $(document).mousedown($.datepicker._checkExternalClick);- $.datepicker.initialized = true;- }- /* Append datepicker main container to body if not exist. */- if ($("#"+$.datepicker._mainDivId).length === 0) {- $("body").append($.datepicker.dpDiv);- }+// live region extension, adding a `messages` option+// NOTE: This is an experimental API. We are still investigating+// a full solution for string manipulation and internationalization.+$.widget( "ui.autocomplete", $.ui.autocomplete, {+ options: {+ messages: {+ noResults: "No search results.",+ results: function( amount ) {+ return amount + ( amount > 1 ? " results are" : " result is" ) ++ " available, use up and down arrow keys to navigate.";+ }+ }+ },- var otherArgs = Array.prototype.slice.call(arguments, 1);- if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {- return $.datepicker["_" + options + "Datepicker"].- apply($.datepicker, [this[0]].concat(otherArgs));- }- if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {- return $.datepicker["_" + options + "Datepicker"].- apply($.datepicker, [this[0]].concat(otherArgs));+ __response: function( content ) {+ var message;+ this._superApply( arguments );+ if ( this.options.disabled || this.cancelSearch ) {+ return;+ }+ if ( content && content.length ) {+ message = this.options.messages.results( content.length );+ } else {+ message = this.options.messages.noResults;+ }+ this.liveRegion.text( message );}- return this.each(function() {- typeof options === "string" ?- $.datepicker["_" + options + "Datepicker"].- apply($.datepicker, [this].concat(otherArgs)) :- $.datepicker._attachDatepicker(this, options);- });-};--$.datepicker = new Datepicker(); // singleton instance-$.datepicker.initialized = false;-$.datepicker.uuid = new Date().getTime();-$.datepicker.version = "1.10.4";+});-})(jQuery);+}( jQuery ));(function( $, undefined ) {$.widget( "ui.menu", {diff --git a/wger/core/static/js/jquery-ui-1.10.4.custom.min.js b/wger/core/static/js/jquery-ui-1.10.4.custom.min.jsindex 4ff118149..a1e6e36e8 100644--- a/wger/core/static/js/jquery-ui-1.10.4.custom.min.js+++ b/wger/core/static/js/jquery-ui-1.10.4.custom.min.js@@ -1,7 +1,6 @@-/*! jQuery UI - v1.10.4 - 2014-05-24+/*! jQuery UI - v1.10.4 - 2014-06-03* http://jqueryui.com-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.menu.js, jquery.ui.slider.js+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.menu.js, jquery.ui.slider.js* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */-(function(t,e){function n(e,n){var r,s,o,a=e.nodeName.toLowerCase();return"area"===a?(r=e.parentNode,s=r.name,e.href&&s&&"map"===r.nodeName.toLowerCase()?(o=t("img[usemap=#"+s+"]")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a?e.href||n:n)&&i(e)}function i(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var r=0,s=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(n,i){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),i&&i.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,s=t(this[0]);s.length&&s[0]!==document;){if(i=s.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(r=parseInt(s.css("zIndex"),10),!isNaN(r)&&0!==r))return r;s=s.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++r)})},removeUniqueId:function(){return this.each(function(){s.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||i>=0)&&n(e,!r)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(s,function(){n-=parseFloat(t.css(e,"padding"+this))||0,i&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0),r&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var s="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,r(this,e,!0,n)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,n,i){var r,s=t.ui[e].prototype;for(r in i)s.plugins[r]=s.plugins[r]||[],s.plugins[r].push([n,i[r]])},call:function(t,e,n){var i,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(i=0;r.length>i;i++)t.options[r[i][0]]&&r[i][1].apply(t.element,n)}},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop",r=!1;return e[i]>0?!0:(e[i]=1,r=e[i]>0,e[i]=0,r)}})})(jQuery);(function(t,e){var i=0,a=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,a=0;null!=(i=e[a]);a++)try{t(i).triggerHandler("remove")}catch(s){}n(e)},t.widget=function(i,a,n){var s,r,o,l,u={},c=i.split(".")[0];i=i.split(".")[1],s=c+"-"+i,n||(n=a,a=t.Widget),t.expr[":"][s.toLowerCase()]=function(e){return!!t.data(e,s)},t[c]=t[c]||{},r=t[c][i],o=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new o(t,i)},t.extend(o,r,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),l=new a,l.options=t.widget.extend({},l.options),t.each(n,function(i,n){return t.isFunction(n)?(u[i]=function(){var t=function(){return a.prototype[i].apply(this,arguments)},e=function(t){return a.prototype[i].apply(this,t)};return function(){var i,a=this._super,s=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=a,this._superApply=s,i}}(),e):(u[i]=n,e)}),o.prototype=t.widget.extend(l,{widgetEventPrefix:r?l.widgetEventPrefix||i:i},u,{constructor:o,namespace:c,widgetName:i,widgetFullName:s}),r?(t.each(r._childConstructors,function(e,i){var a=i.prototype;t.widget(a.namespace+"."+a.widgetName,o,i._proto)}),delete r._childConstructors):a._childConstructors.push(o),t.widget.bridge(i,o)},t.widget.extend=function(i){for(var n,s,r=a.call(arguments,1),o=0,l=r.length;l>o;o++)for(n in r[o])s=r[o][n],r[o].hasOwnProperty(n)&&s!==e&&(i[n]=t.isPlainObject(s)?t.isPlainObject(i[n])?t.widget.extend({},i[n],s):t.widget.extend({},s):s);return i},t.widget.bridge=function(i,n){var s=n.prototype.widgetFullName||i;t.fn[i]=function(r){var o="string"==typeof r,l=a.call(arguments,1),u=this;return r=!o&&l.length?t.widget.extend.apply(null,[r].concat(l)):r,o?this.each(function(){var a,n=t.data(this,s);return n?t.isFunction(n[r])&&"_"!==r.charAt(0)?(a=n[r].apply(n,l),a!==n&&a!==e?(u=a&&a.jquery?u.pushStack(a.get()):a,!1):e):t.error("no such method '"+r+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var e=t.data(this,s);e?e.option(r||{})._init():t.data(this,s,new n(r,this))}),u}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,a){a=t(a||this.defaultElement||this)[0],this.element=t(a),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),a!==this&&(t.data(a,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===a&&this.destroy()}}),this.document=t(a.style?a.ownerDocument:a.document||a),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,a){var n,s,r,o=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(s=o[i]=t.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)s[n[r]]=s[n[r]]||{},s=s[n[r]];if(i=n.pop(),1===arguments.length)return s[i]===e?null:s[i];s[i]=a}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];o[i]=a}return this._setOptions(o),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,a,n){var s,r=this;"boolean"!=typeof i&&(n=a,a=i,i=!1),n?(a=s=t(a),this.bindings=this.bindings.add(a)):(n=a,a=this.element,s=this.widget()),t.each(n,function(n,o){function l(){return i||r.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):e}"string"!=typeof o&&(l.guid=o.guid=o.guid||l.guid||t.guid++);var u=n.match(/^(\w+)\s*(.*)$/),c=u[1]+r.eventNamespace,d=u[2];d?s.delegate(d,c,l):a.bind(c,l)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?a[t]:t).apply(a,arguments)}var a=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,a){var n,s,r=this.options[e];if(a=a||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(n in s)n in i||(i[n]=s[n]);return this.element.trigger(i,a),!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(a))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(a,n,s){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),r=!t.isEmptyObject(n),n.complete=s,n.delay&&a.delay(n.delay),r&&t.effects&&t.effects.effect[o]?a[e](n):o!==e&&a[o]?a[o](n.duration,n.easing,s):a.queue(function(i){t(this)[e](),s&&s.call(a[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(a){return!0===e.data(a.target,t.widgetName+".preventClickEvent")?(e.removeData(a.target,t.widgetName+".preventClickEvent"),a.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(a){if(!t){this._mouseStarted&&this._mouseUp(a),this._mouseDownEvent=a;var i=this,s=1===a.which,n="string"==typeof this.options.cancel&&a.target.nodeName?e(a.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(a)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=this._mouseStart(a)!==!1,!this._mouseStarted)?(a.preventDefault(),!0):(!0===e.data(a.target,this.widgetName+".preventClickEvent")&&e.removeData(a.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),a.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function a(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var n,r=Math.max,o=Math.abs,l=Math.round,c=/left|center|right/,d=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,p=/%$/,g=t.fn.position;t.position={scrollbarWidth:function(){if(n!==e)return n;var i,a,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=s.children()[0];return t("body").append(s),i=r.offsetWidth,s.css("overflow","scroll"),a=r.offsetWidth,i===a&&(a=s[0].clientWidth),s.remove(),n=i-a},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),a=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),s="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,n="scroll"===a||"auto"===a&&e.height<e.element[0].scrollHeight;return{width:n?t.position.scrollbarWidth():0,height:s?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),a=t.isWindow(i[0]),s=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:a,isDocument:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:a?i.width():i.outerWidth(),height:a?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return g.apply(this,arguments);e=t.extend({},e);var n,p,f,m,_,D,k=t(e.of),y=t.position.getWithinInfo(e.within),v=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),b={};return D=s(k),k[0].preventDefault&&(e.at="left top"),p=D.width,f=D.height,m=D.offset,_=t.extend({},m),t.each(["my","at"],function(){var t,i,a=(e[this]||"").split(" ");1===a.length&&(a=c.test(a[0])?a.concat(["center"]):d.test(a[0])?["center"].concat(a):["center","center"]),a[0]=c.test(a[0])?a[0]:"center",a[1]=d.test(a[1])?a[1]:"center",t=u.exec(a[0]),i=u.exec(a[1]),b[this]=[t?t[0]:0,i?i[0]:0],e[this]=[h.exec(a[0])[0],h.exec(a[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?_.left+=p:"center"===e.at[0]&&(_.left+=p/2),"bottom"===e.at[1]?_.top+=f:"center"===e.at[1]&&(_.top+=f/2),n=i(b.at,p,f),_.left+=n[0],_.top+=n[1],this.each(function(){var s,c,d=t(this),u=d.outerWidth(),h=d.outerHeight(),g=a(this,"marginLeft"),D=a(this,"marginTop"),M=u+g+a(this,"marginRight")+v.width,C=h+D+a(this,"marginBottom")+v.height,x=t.extend({},_),I=i(b.my,d.outerWidth(),d.outerHeight());"right"===e.my[0]?x.left-=u:"center"===e.my[0]&&(x.left-=u/2),"bottom"===e.my[1]?x.top-=h:"center"===e.my[1]&&(x.top-=h/2),x.left+=I[0],x.top+=I[1],t.support.offsetFractions||(x.left=l(x.left),x.top=l(x.top)),s={marginLeft:g,marginTop:D},t.each(["left","top"],function(i,a){t.ui.position[w[i]]&&t.ui.position[w[i]][a](x,{targetWidth:p,targetHeight:f,elemWidth:u,elemHeight:h,collisionPosition:s,collisionWidth:M,collisionHeight:C,offset:[n[0]+I[0],n[1]+I[1]],my:e.my,at:e.at,within:y,elem:d})}),e.using&&(c=function(t){var i=m.left-x.left,a=i+p-u,s=m.top-x.top,n=s+f-h,l={target:{element:k,left:m.left,top:m.top,width:p,height:f},element:{element:d,left:x.left,top:x.top,width:u,height:h},horizontal:0>a?"left":i>0?"right":"center",vertical:0>n?"top":s>0?"bottom":"middle"};u>p&&p>o(i+a)&&(l.horizontal="center"),h>f&&f>o(s+n)&&(l.vertical="middle"),l.important=r(o(i),o(a))>r(o(s),o(n))?"horizontal":"vertical",e.using.call(this,t,l)}),d.offset(t.extend(x,{using:c}))})},t.ui.position={fit:{left:function(t,e){var i,a=e.within,s=a.isWindow?a.scrollLeft:a.offset.left,n=a.width,o=t.left-e.collisionPosition.marginLeft,l=s-o,c=o+e.collisionWidth-n-s;e.collisionWidth>n?l>0&&0>=c?(i=t.left+l+e.collisionWidth-n-s,t.left+=l-i):t.left=c>0&&0>=l?s:l>c?s+n-e.collisionWidth:s:l>0?t.left+=l:c>0?t.left-=c:t.left=r(t.left-o,t.left)},top:function(t,e){var i,a=e.within,s=a.isWindow?a.scrollTop:a.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,l=s-o,c=o+e.collisionHeight-n-s;e.collisionHeight>n?l>0&&0>=c?(i=t.top+l+e.collisionHeight-n-s,t.top+=l-i):t.top=c>0&&0>=l?s:l>c?s+n-e.collisionHeight:s:l>0?t.top+=l:c>0?t.top-=c:t.top=r(t.top-o,t.top)}},flip:{left:function(t,e){var i,a,s=e.within,n=s.offset.left+s.scrollLeft,r=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,c=t.left-e.collisionPosition.marginLeft,d=c-l,u=c+e.collisionWidth-r-l,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,g=-2*e.offset[0];0>d?(i=t.left+h+p+g+e.collisionWidth-r-n,(0>i||o(d)>i)&&(t.left+=h+p+g)):u>0&&(a=t.left-e.collisionPosition.marginLeft+h+p+g-l,(a>0||u>o(a))&&(t.left+=h+p+g))},top:function(t,e){var i,a,s=e.within,n=s.offset.top+s.scrollTop,r=s.height,l=s.isWindow?s.scrollTop:s.offset.top,c=t.top-e.collisionPosition.marginTop,d=c-l,u=c+e.collisionHeight-r-l,h="top"===e.my[1],p=h?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,g="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];0>d?(a=t.top+p+g+f+e.collisionHeight-r-n,t.top+p+g+f>d&&(0>a||o(d)>a)&&(t.top+=p+g+f)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+g+f-l,t.top+p+g+f>u&&(i>0||u>o(i))&&(t.top+=p+g+f))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,a,s,n,r=document.getElementsByTagName("body")[0],o=document.createElement("div");e=document.createElement(r?"div":"body"),a={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&t.extend(a,{position:"absolute",left:"-1000px",top:"-1000px"});for(n in a)e.style[n]=a[n];e.appendChild(o),i=r||document.documentElement,i.insertBefore(e,i.firstChild),o.style.cssText="position: absolute; left: 10.7432222px;",s=t(o).offset().left,t.support.offsetFractions=s>10&&11>s,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}function i(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,i){"disabled"===t?(this.options[t]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,i){var a=null,s=!1,r=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,r.widgetName+"-item")===r?(a=e(this),!1):undefined}),e.data(t.target,r.widgetName+"-item")===r&&(a=e(t.target)),a?!this.options.handle||i||(e(this.options.handle,a).find("*").addBack().each(function(){this===t.target&&(s=!0)}),s)?(this.currentItem=a,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,a){var s,r,n=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),n.containment&&this._setContainment(),n.cursor&&"auto"!==n.cursor&&(r=this.document.find("body"),this.storedCursor=r.css("cursor"),r.css("cursor",n.cursor),this.storedStylesheet=e("<style>*{ cursor: "+n.cursor+" !important; }</style>").appendTo(r)),n.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",n.opacity)),n.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",n.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!a)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,a,s,r,n=this.options,o=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?o=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(o=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?o=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(o=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),o!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(a=this.items[i],s=a.item[0],r=this._intersectsWithPointer(a),r&&a.instance===this.currentContainer&&s!==this.currentItem[0]&&this.placeholder[1===r?"next":"prev"]()[0]!==s&&!e.contains(this.placeholder[0],s)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],s):!0)){if(this.direction=1===r?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(a))break;this._rearrange(t,a),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var a=this,s=this.placeholder.offset(),r=this.options.axis,n={};r&&"x"!==r||(n.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(n.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(n,parseInt(this.options.revert,10)||500,function(){a._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),a=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&a.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!a.length&&t.key&&a.push(t.key+"="),a.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),a=[];return t=t||{},i.each(function(){a.push(e(t.item||this).attr(t.attribute||"id")||"")}),a},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,a=this.positionAbs.top,s=a+this.helperProportions.height,r=e.left,n=r+e.width,o=e.top,h=o+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||a+l>o&&h>a+l,c="y"===this.options.axis||t+u>r&&n>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>r&&n>i-this.helperProportions.width/2&&a+this.helperProportions.height/2>o&&h>s-this.helperProportions.height/2},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t(this.positionAbs.top+this.offset.click.top,e.top,e.height),a="y"===this.options.axis||t(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=i&&a,r=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return s?this.floating?n&&"right"===n||"down"===r?2:1:r&&("down"===r?2:1):!1},_intersectsWithSides:function(e){var i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),a=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"===r&&a||"left"===r&&!a:s&&("down"===s&&i||"up"===s&&!i)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){o.push(this)}var a,s,r,n,o=[],h=[],l=this._connectWith();if(l&&t)for(a=l.length-1;a>=0;a--)for(r=e(l[a]),s=r.length-1;s>=0;s--)n=e.data(r[s],this.widgetFullName),n&&n!==this&&!n.options.disabled&&h.push([e.isFunction(n.options.items)?n.options.items.call(n.element):e(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),a=h.length-1;a>=0;a--)h[a][0].each(i);return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,a,s,r,n,o,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(s=e(c[i]),a=s.length-1;a>=0;a--)r=e.data(s[a],this.widgetFullName),r&&r!==this&&!r.options.disabled&&(d.push([e.isFunction(r.options.items)?r.options.items.call(r.element[0],t,{item:this.currentItem}):e(r.options.items,r.element),r]),this.containers.push(r));for(i=d.length-1;i>=0;i--)for(n=d[i][1],o=d[i][0],a=0,l=o.length;l>a;a++)h=e(o[a]),h.data(this.widgetName+"-item",n),u.push({item:h,instance:n,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,a,s,r;for(i=this.items.length-1;i>=0;i--)a=this.items[i],a.instance!==this.currentContainer&&this.currentContainer&&a.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,a.item):a.item,t||(a.width=s.outerWidth(),a.height=s.outerHeight()),r=s.offset(),a.left=r.left,a.top=r.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)r=this.containers[i].element.offset(),this.containers[i].containerCache.left=r.left,this.containers[i].containerCache.top=r.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,a=t.options;a.placeholder&&a.placeholder.constructor!==String||(i=a.placeholder,a.placeholder={element:function(){var a=t.currentItem[0].nodeName.toLowerCase(),s=e("<"+a+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===a?t.currentItem.children().each(function(){e("<td> </td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(s)}):"img"===a&&s.attr("src",t.currentItem.attr("src")),i||s.css("visibility","hidden"),s},update:function(e,s){(!i||a.forcePlaceholderSize)&&(s.height()||s.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(a.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),a.placeholder.update(t,t.placeholder)},_contactContainers:function(a){var s,r,n,o,h,l,u,d,c,p,m=null,f=null;for(s=this.containers.length-1;s>=0;s--)if(!e.contains(this.currentItem[0],this.containers[s].element[0]))if(this._intersectsWith(this.containers[s].containerCache)){if(m&&e.contains(this.containers[s].element[0],m.element[0]))continue;m=this.containers[s],f=s}else this.containers[s].containerCache.over&&(this.containers[s]._trigger("out",a,this._uiHash(this)),this.containers[s].containerCache.over=0);if(m)if(1===this.containers.length)this.containers[f].containerCache.over||(this.containers[f]._trigger("over",a,this._uiHash(this)),this.containers[f].containerCache.over=1);else{for(n=1e4,o=null,p=m.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",u=this.positionAbs[h]+this.offset.click[h],r=this.items.length-1;r>=0;r--)e.contains(this.containers[f].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(!p||t(this.positionAbs.top+this.offset.click.top,this.items[r].top,this.items[r].height))&&(d=this.items[r].item.offset()[h],c=!1,Math.abs(d-u)>Math.abs(d+this.items[r][l]-u)&&(c=!0,d+=this.items[r][l]),n>Math.abs(d-u)&&(n=Math.abs(d-u),o=this.items[r],this.direction=c?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[f])return;o?this._rearrange(a,o,null,!0):this._rearrange(a,null,this.containers[f].element,!0),this._trigger("change",a,this._uiHash()),this.containers[f]._trigger("change",a,this._uiHash(this)),this.currentContainer=this.containers[f],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[f]._trigger("over",a,this._uiHash(this)),this.containers[f].containerCache.over=1}},_createHelper:function(t){var i=this.options,a=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return a.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]),a[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!a[0].style.width||i.forceHelperSize)&&a.width(this.currentItem.width()),(!a[0].style.height||i.forceHelperSize)&&a.height(this.currentItem.height()),a},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,a,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),("document"===s.containment||"window"===s.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===s.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===s.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(t=e(s.containment)[0],i=e(s.containment).offset(),a="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(a?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(a?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var a="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:s.scrollTop())*a,left:i.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:s.scrollLeft())*a}},_generatePosition:function(t){var i,a,s=this.options,r=t.pageX,n=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(r=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(n=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(r=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(n=this.containment[3]+this.offset.click.top)),s.grid&&(i=this.originalPageY+Math.round((n-this.originalPageY)/s.grid[1])*s.grid[1],n=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-s.grid[1]:i+s.grid[1]:i,a=this.originalPageX+Math.round((r-this.originalPageX)/s.grid[0])*s.grid[0],r=this.containment?a-this.offset.click.left>=this.containment[0]&&a-this.offset.click.left<=this.containment[2]?a:a-this.offset.click.left>=this.containment[0]?a-s.grid[0]:a+s.grid[0]:a)),{top:n-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:o.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:o.scrollLeft())}},_rearrange:function(e,t,i,a){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay(function(){s===this.counter&&this.refreshPositions(!a)})},_clear:function(e,t){function i(e,t,i){return function(a){i._trigger(e,a,t._uiHash(t))}}this.reverting=!1;var a,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(a in this._storedCSS)("auto"===this._storedCSS[a]||"static"===this._storedCSS[a])&&(this._storedCSS[a]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&s.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||s.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(s.push(function(e){this._trigger("remove",e,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),a=this.containers.length-1;a>=0;a--)t||s.push(i("deactivate",this,this.containers[a])),this.containers[a].containerCache.over&&(s.push(i("out",this,this.containers[a])),this.containers[a].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),a=0;s.length>a;a++)s[a].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(a=0;s.length>a;a++)s[a].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,a,r=this.element[0].nodeName.toLowerCase(),s="textarea"===r,n="input"===r;this.isMultiLine=s?!0:n?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[s||n?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly"))return t=!0,a=!0,i=!0,undefined;t=!1,a=!1,i=!1;var s=e.ui.keyCode;switch(r.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",r);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",r);break;case s.UP:t=!0,this._keyEvent("previous",r);break;case s.DOWN:t=!0,this._keyEvent("next",r);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,r.preventDefault(),this.menu.select(r));break;case s.TAB:this.menu.active&&this.menu.select(r);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(r),r.preventDefault());break;default:i=!0,this._searchTimeout(r)}},keypress:function(a){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&a.preventDefault(),undefined;if(!i){var r=e.ui.keyCode;switch(a.keyCode){case r.PAGE_UP:this._move("previousPage",a);break;case r.PAGE_DOWN:this._move("nextPage",a);break;case r.UP:this._keyEvent("previous",a);break;case r.DOWN:this._keyEvent("next",a)}}},input:function(e){return a?(a=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(a){a.target===t.element[0]||a.target===i||e.contains(i,a.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var a=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:a})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(a.value):this.liveRegion.text(a.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),a=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=a,this._delay(function(){this.previous=a,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,a=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,a){a(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,r){a.xhr&&a.xhr.abort(),a.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){r(e)},error:function(){r([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var a=this;e.each(i,function(e,i){a._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var a=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return a.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",r=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},s=function(t){var i=t.name,a=t.form,r=e([]);return i&&(i=i.replace(/'/g,"\\'"),r=a?e(a).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),r};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,r),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var a=this,n=this.options,o="checkbox"===this.type||"radio"===this.type,u=o?"":"ui-state-active";null===n.label&&(n.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){n.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){n.disabled||e(this).removeClass(u)}).bind("click"+this.eventNamespace,function(e){n.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),o&&this.element.bind("change"+this.eventNamespace,function(){a.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return n.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(n.disabled)return!1;e(this).addClass("ui-state-active"),a.buttonElement.attr("aria-pressed","true");var t=a.element[0];s(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return n.disabled?!1:(e(this).addClass("ui-state-active"),t=this,a.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return n.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return n.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",n.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?s(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(a),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,s=r.primary&&r.secondary,n=[];r.primary||r.secondary?(this.options.text&&n.push("ui-button-text-icon"+(s?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(n.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):n.push("ui-button-text-only"),t.addClass(n.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=i(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function i(t){var a="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(a,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(a,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,a){e.extend(t,a);for(var i in a)null==a[i]&&(t[i]=a[i]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(a.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,a){var i,s,n;i=t.nodeName.toLowerCase(),s="div"===i||"span"===i,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},a||{}),"input"===i?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,a){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:a,dpDiv:a?i(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,a){var i=e(t);a.append=e([]),a.trigger=e([]),i.hasClass(this.markerClassName)||(this._attachments(i,a),i.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(a),e.data(t,r,a),a.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,a){var i,s,n,r=this._get(a,"appendText"),o=this._get(a,"isRTL");a.append&&a.append.remove(),r&&(a.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](a.append)),t.unbind("focus",this._showDatepicker),a.trigger&&a.trigger.remove(),i=this._get(a,"showOn"),("focus"===i||"both"===i)&&t.focus(this._showDatepicker),("button"===i||"both"===i)&&(s=this._get(a,"buttonText"),n=this._get(a,"buttonImage"),a.trigger=e(this._get(a,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](a.trigger),a.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,a,i,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(a=0,i=0,s=0;e.length>s;s++)e[s].length>a&&(a=e[s].length,i=s);return i},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,a){var i=e(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(a.dpDiv),e.data(t,r,a),this._setDate(a,this._getDefaultDate(a),!0),this._updateDatepicker(a),this._updateAlternate(a),a.settings.disabled&&this._disableDatepicker(t),a.dpDiv.css("display","block"))},_dialogDatepicker:function(t,a,i,n,o){var c,d,l,u,h,p=this._dialogInst;return p||(this.uuid+=1,c="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+c+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),a=a&&a.constructor===Date?this._formatDate(p,a):a,this._dialogInput.val(a),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(d=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,h=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[d/2-100+u,l/2-150+h]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var a,i=e(t),s=e.data(t,r);i.hasClass(this.markerClassName)&&(a=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===a?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===a||"span"===a)&&i.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var a,i,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(a=t.nodeName.toLowerCase(),"input"===a?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===a||"span"===a)&&(i=s.children("."+this._inlineClass),i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var a,i,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(a=t.nodeName.toLowerCase(),"input"===a?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===a||"span"===a)&&(i=s.children("."+this._inlineClass),i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(a){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,i,n){var r,o,c,d,l=this._getInst(a);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(r=i||{},"string"==typeof i&&(r={},r[i]=n),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(a,!0),c=this._getMinMaxDate(l,"min"),d=this._getMinMaxDate(l,"max"),s(l.settings,r),null!==c&&r.dateFormat!==t&&r.minDate===t&&(l.settings.minDate=this._formatDate(l,c)),null!==d&&r.dateFormat!==t&&r.maxDate===t&&(l.settings.maxDate=this._formatDate(l,d)),"disabled"in r&&(r.disabled?this._disableDatepicker(a):this._enableDatepicker(a)),this._attachments(e(a),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),t)},_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var a=this._getInst(e);a&&(this._setDate(a,t),this._updateDatepicker(a),this._updateAlternate(a))},_getDateDatepicker:function(e,t){var a=this._getInst(e);return a&&!a.inline&&this._setDateFromField(a,t),a?this._getDate(a):null},_doKeyDown:function(t){var a,i,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),a=e.datepicker._get(n,"onSelect"),a?(i=e.datepicker._formatDate(n),a.apply(n.input?n.input[0]:null,[i,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(a){var i,s,n=e.datepicker._getInst(a.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),a.ctrlKey||a.metaKey||" ">s||!i||i.indexOf(s)>-1):t},_doKeyUp:function(t){var a,i=e.datepicker._getInst(t.target);if(i.input.val()!==i.lastVal)try{a=e.datepicker.parseDate(e.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,e.datepicker._getFormatConfig(i)),a&&(e.datepicker._setDateFromField(i),e.datepicker._updateAlternate(i),e.datepicker._updateDatepicker(i))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var a,i,n,r,o,c,d;a=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==a&&(e.datepicker._curInst.dpDiv.stop(!0,!0),a&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),i=e.datepicker._get(a,"beforeShow"),n=i?i.apply(t,[t,a]):{},n!==!1&&(s(a.settings,n),a.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(a),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,a.dpDiv.empty(),a.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(a),o=e.datepicker._checkOffset(a,o,r),a.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),a.inline||(c=e.datepicker._get(a,"showAnim"),d=e.datepicker._get(a,"duration"),a.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[c]?a.dpDiv.show(c,e.datepicker._get(a,"showOptions"),d):a.dpDiv[c||"show"](c?d:null),e.datepicker._shouldFocusInput(a)&&a.input.focus(),e.datepicker._curInst=a))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var a,i=this._getNumberOfMonths(t),s=i[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(a=t.yearshtml,setTimeout(function(){a===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),a=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,a,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,c=document.documentElement.clientWidth+(i?0:e(document).scrollLeft()),d=document.documentElement.clientHeight+(i?0:e(document).scrollTop());return a.left-=this._get(t,"isRTL")?s-r:0,a.left-=i&&a.left===t.input.offset().left?e(document).scrollLeft():0,a.top-=i&&a.top===t.input.offset().top+o?e(document).scrollTop():0,a.left-=Math.min(a.left,a.left+s>c&&c>s?Math.abs(a.left+s-c):0),a.top-=Math.min(a.top,a.top+n>d&&d>n?Math.abs(n+o):0),a},_findPos:function(t){for(var a,i=this._getInst(t),s=this._get(i,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return a=e(t).offset(),[a.left,a.top]},_hideDatepicker:function(t){var a,i,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(a=this._get(o,"showAnim"),i=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[a]||e.effects[a])?o.dpDiv.hide(a,e.datepicker._get(o,"showOptions"),i,s):o.dpDiv["slideDown"===a?"slideUp":"fadeIn"===a?"fadeOut":"hide"](a?i:null,s),a||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var a=e(t.target),i=e.datepicker._getInst(a[0]);(a[0].id!==e.datepicker._mainDivId&&0===a.parents("#"+e.datepicker._mainDivId).length&&!a.hasClass(e.datepicker.markerClassName)&&!a.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||a.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==i)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,a,i){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,a+("M"===i?this._get(n,"showCurrentAtPos"):0),i),this._updateDatepicker(n))},_gotoToday:function(t){var a,i=e(t),s=this._getInst(i[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(a=new Date,s.selectedDay=a.getDate(),s.drawMonth=s.selectedMonth=a.getMonth(),s.drawYear=s.selectedYear=a.getFullYear()),this._notifyChange(s),this._adjustDate(i)},_selectMonthYear:function(t,a,i){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===i?"Month":"Year")]=n["draw"+("M"===i?"Month":"Year")]=parseInt(a.options[a.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,a,i,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=a,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var a=e(t);this._selectDate(a,"")},_selectDate:function(t,a){var i,s=e(t),n=this._getInst(s[0]);a=null!=a?a:this._formatDate(n),n.input&&n.input.val(a),this._updateAlternate(n),i=this._get(n,"onSelect"),i?i.apply(n.input?n.input[0]:null,[a,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var a,i,s,n=this._get(t,"altField");n&&(a=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),s=this.formatDate(a,i,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,a=new Date(e.getTime());return a.setDate(a.getDate()+4-(a.getDay()||7)),t=a.getTime(),a.setMonth(0),a.setDate(1),Math.floor(Math.round((t-a)/864e5)/7)+1},parseDate:function(a,i,s){if(null==a||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,r,o,c,d=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),h=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,_=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,m=-1,D=-1,k=-1,y=!1,v=function(e){var t=a.length>n+1&&a.charAt(n+1)===e;return t&&n++,t},M=function(e){var t=v(e),a="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+a+"}"),n=i.substring(d).match(s);if(!n)throw"Missing number at position "+d;return d+=n[0].length,parseInt(n[0],10)},b=function(a,s,n){var r=-1,o=e.map(v(a)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,a){var s=a[1];return i.substr(d,s.length).toLowerCase()===s.toLowerCase()?(r=a[0],d+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+d},w=function(){if(i.charAt(d)!==a.charAt(n))throw"Unexpected literal at position "+d;d++};for(n=0;a.length>n;n++)if(y)"'"!==a.charAt(n)||v("'")?w():y=!1;else switch(a.charAt(n)){case"d":D=M("d");break;case"D":b("D",h,p);break;case"o":k=M("o");break;case"m":m=M("m");break;case"M":m=b("M",g,_);break;case"y":f=M("y");break;case"@":c=new Date(M("@")),f=c.getFullYear(),m=c.getMonth()+1,D=c.getDate();break;case"!":c=new Date((M("!")-this._ticksTo1970)/1e4),f=c.getFullYear(),m=c.getMonth()+1,D=c.getDate();break;case"'":v("'")?w():y=!0;break;default:w()}if(i.length>d&&(o=i.substr(d),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=f?0:-100)),k>-1)for(m=1,D=k;;){if(r=this._getDaysInMonth(f,m-1),r>=D)break;m++,D-=r}if(c=this._daylightSavingAdjust(new Date(f,m-1,D)),c.getFullYear()!==f||c.getMonth()+1!==m||c.getDate()!==D)throw"Invalid date";return c},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,a){if(!t)return"";var i,s=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,n=(a?a.dayNames:null)||this._defaults.dayNames,r=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,o=(a?a.monthNames:null)||this._defaults.monthNames,c=function(t){var a=e.length>i+1&&e.charAt(i+1)===t;return a&&i++,a},d=function(e,t,a){var i=""+t;if(c(e))for(;a>i.length;)i="0"+i;return i},l=function(e,t,a,i){return c(e)?i[t]:a[t]},u="",h=!1;if(t)for(i=0;e.length>i;i++)if(h)"'"!==e.charAt(i)||c("'")?u+=e.charAt(i):h=!1;else switch(e.charAt(i)){case"d":u+=d("d",t.getDate(),2);break;case"D":u+=l("D",t.getDay(),s,n);break;case"o":u+=d("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=d("m",t.getMonth()+1,2);break;case"M":u+=l("M",t.getMonth(),r,o);break;case"y":u+=c("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":h=!0;break;default:u+=e.charAt(i)}return u},_possibleChars:function(e){var t,a="",i=!1,s=function(a){var i=e.length>t+1&&e.charAt(t+1)===a;return i&&t++,i};for(t=0;e.length>t;t++)if(i)"'"!==e.charAt(t)||s("'")?a+=e.charAt(t):i=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":a+="0123456789";break;case"D":case"M":return null;case"'":s("'")?a+="'":i=!0;break;default:a+=e.charAt(t)}return a},_get:function(e,a){return e.settings[a]!==t?e.settings[a]:this._defaults[a]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var a=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(a,i,r)||s}catch(o){i=t?"":i}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=i?n.getDate():0,e.currentMonth=i?n.getMonth():0,e.currentYear=i?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,a,i){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(a){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),a,e.datepicker._getFormatConfig(t))}catch(i){}for(var s=(a.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),c=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,d=c.exec(a);d;){switch(d[2]||"d"){case"d":case"D":o+=parseInt(d[1],10);break;case"w":case"W":o+=7*parseInt(d[1],10);break;case"m":case"M":r+=parseInt(d[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(d[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}d=c.exec(a)}return new Date(n,r,o)},r=null==a||""===a?i:"string"==typeof a?n(a):"number"==typeof a?isNaN(a)?i:s(a):new Date(a.getTime());return r=r&&"Invalid Date"==""+r?i:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,a){var i=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var a=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(i,-a,"M")},next:function(){e.datepicker._adjustDate(i,+a,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(i)},selectDay:function(){return e.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(i,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,a,i,s,n,r,o,c,d,l,u,h,p,g,_,f,m,D,k,y,v,M,b,w,C,I,x,N,Y,S,A,T,F,j,K,O,E,P,L,R=new Date,W=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),H=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),z=this._get(e,"hideIfNoPrevNext"),B=this._get(e,"navigationAsDateFormat"),J=this._getNumberOfMonths(e),q=this._get(e,"showCurrentAtPos"),V=this._get(e,"stepMonths"),G=1!==J[0]||1!==J[1],Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-q,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-J[0]*J[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,a=this._get(e,"prevText"),a=B?this.formatDate(a,this._daylightSavingAdjust(new Date(et,Z-V,1)),this._getFormatConfig(e)):a,i=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+a+"</span></a>":z?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+a+"</span></a>",s=this._get(e,"nextText"),s=B?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+V,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>":z?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?Q:W,r=B?this.formatDate(r,o,this._getFormatConfig(e)):r,c=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",d=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(H?c:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(H?"":c)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,u=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),_=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),m=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",M=0;J[0]>M;M++){for(b="",this.maxRows=4,w=0;J[1]>w;w++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),I=" ui-corner-all",x="",G){if(x+="<div class='ui-datepicker-group",J[1]>1)switch(w){case 0:x+=" ui-datepicker-group-first",I=" ui-corner-"+(H?"right":"left");break;case J[1]-1:x+=" ui-datepicker-group-last",I=" ui-corner-"+(H?"left":"right");break;default:x+=" ui-datepicker-group-middle",I=""}x+="'>"}for(x+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===M?H?n:i:"")+(/all|right/.test(I)&&0===M?H?i:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,M>0||w>0,g,_)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=u?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",v=0;7>v;v++)Y=(v+l)%7,N+="<th"+((v+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[Y]+"'>"+p[Y]+"</span></th>";for(x+=N+"</tr></thead><tbody>",S=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,S)),A=(this._getFirstDayOfMonth(et,Z)-l+7)%7,T=Math.ceil((A+S)/7),F=G?this.maxRows>T?this.maxRows:T:T,this.maxRows=F,j=this._daylightSavingAdjust(new Date(et,Z,1-A)),K=0;F>K;K++){for(x+="<tr>",O=u?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(j)+"</td>":"",v=0;7>v;v++)E=f?f.apply(e.input?e.input[0]:null,[j]):[!0,""],P=j.getMonth()!==Z,L=P&&!D||!E[0]||$&&$>j||X&&j>X,O+="<td class='"+((v+l+6)%7>=5?" ui-datepicker-week-end":"")+(P?" ui-datepicker-other-month":"")+(j.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===j.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(P&&!m?"":" "+E[1]+(j.getTime()===Q.getTime()?" "+this._currentClass:"")+(j.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(P&&!m||!E[2]?"":" title='"+E[2].replace(/'/g,"'")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+j.getMonth()+"' data-year='"+j.getFullYear()+"'")+">"+(P&&!m?" ":L?"<span class='ui-state-default'>"+j.getDate()+"</span>":"<a class='ui-state-default"+(j.getTime()===W.getTime()?" ui-state-highlight":"")+(j.getTime()===Q.getTime()?" ui-state-active":"")+(P?" ui-priority-secondary":"")+"' href='#'>"+j.getDate()+"</a>")+"</td>",j.setDate(j.getDate()+1),j=this._daylightSavingAdjust(j);x+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),x+="</tbody></table>"+(G?"</div>"+(J[0]>0&&w===J[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),b+=x}y+=b}return y+=d,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,a,i,s,n,r,o){var c,d,l,u,h,p,g,_,f=this._get(e,"changeMonth"),m=this._get(e,"changeYear"),D=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(c=i&&i.getFullYear()===a,d=s&&s.getFullYear()===a,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;12>l;l++)(!c||l>=i.getMonth())&&(!d||s.getMonth()>=l)&&(y+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+o[l]+"</option>");y+="</select>"}if(D||(k+=y+(!n&&f&&m?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!m)k+="<span class='ui-datepicker-year'>"+a+"</span>";else{for(u=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);-return isNaN(t)?h:t},g=p(u[0]),_=Math.max(g,p(u[1]||"")),g=i?Math.max(g,i.getFullYear()):g,_=s?Math.min(_,s.getFullYear()):_,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";_>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===a?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),D&&(k+=(!n&&f&&m?"":" ")+y),k+="</div>"},_adjustInstDate:function(e,t,a){var i=e.drawYear+("Y"===a?t:0),s=e.drawMonth+("M"===a?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===a||"Y"===a)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),s=a&&a>t?a:t;return i&&s>i?i:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,a,i){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(a,i+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var a,i,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,c=this._get(e,"yearRange");return c&&(a=c.split(":"),i=(new Date).getFullYear(),r=parseInt(a[0],10),o=parseInt(a[1],10),a[0].match(/[+\-].*/)&&(r+=i),a[1].match(/[+\-].*/)&&(o+=i)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var a=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(a)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(a)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(a))},e.datepicker=new a,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){e.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var i=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var a,s,r,n,o,h=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:h=!1,s=this.previousFilter||"",r=String.fromCharCode(t.keyCode),n=!1,clearTimeout(this.filterTimer),r===s?n=!0:r=s+r,o=RegExp("^"+i(r),"i"),a=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),a=n&&-1!==a.index(this.active.next())?this.active.nextAll(".ui-menu-item"):a,a.length||(r=String.fromCharCode(t.keyCode),o=RegExp("^"+i(r),"i"),a=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),a.length?(this.focus(t,a),a.length>1?(this.previousFilter=r,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),a=t.prev("a"),s=e("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);a.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",a.attr("id"))}),t=a.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-\u2014\u2013\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var i,a;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),a=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",a.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,a,s,r,n,o;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,a=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-i-a,r=this.activeMenu.scrollTop(),n=this.activeMenu.height(),o=t.height(),0>s?this.activeMenu.scrollTop(r+s):s+o>n&&this.activeMenu.scrollTop(r+s-n+o))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var a=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));a.length||(a=this.element),this._close(a),this.blur(t),this.activeMenu=a},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var a;this.active&&(a="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),a&&a.length&&this.active||(a=this.activeMenu.children(".ui-menu-item")[t]()),this.focus(i,a)},nextPage:function(t){var i,a,s;return this.active?(this.isLastItem()||(this._hasScroll()?(a=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-a-s}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(t),undefined)},previousPage:function(t){var i,a,s;return this.active?(this.isFirstItem()||(this._hasScroll()?(a=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-a+s>0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(t),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}})})(jQuery);(function(e){var t=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,a=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),r="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",n=[];for(i=a.values&&a.values.length||1,s.length>i&&(s.slice(i).remove(),s=s.slice(0,i)),t=s.length;i>t;t++)n.push(r);this.handles=s.add(e(n.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,a,s,r,n,o,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},a=this._normValueFromMouse(i),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(a-u.values(t));(s>i||s===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(s=i,r=e(this),n=t)}),o=this._start(t,n),o===!1?!1:(this._mouseSliding=!0,this._handleIndex=n,r.addClass("ui-state-active").focus(),h=r.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-r.width()/2,top:t.pageY-h.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,n,a),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,a,s,r;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),a=i/t,a>1&&(a=1),0>a&&(a=0),"vertical"===this.orientation&&(a=1-a),s=this._valueMax()-this._valueMin(),r=this._valueMin()+a*s,this._trimAlignValue(r)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var a,s,r;this.options.values&&this.options.values.length?(a=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>a||1===t&&a>i)&&(i=a),i!==this.values(t)&&(s=this.values(),s[t]=i,r=this._trigger("slide",e,{handle:this.handles[t],value:i,values:s}),a=this.values(t?0:1),r!==!1&&this.values(t,i))):i!==this.value()&&(r=this._trigger("slide",e,{handle:this.handles[t],value:i}),r!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(t,i){var a,s,r;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),undefined;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(a=this.options.values,s=arguments[0],r=0;a.length>r;r+=1)a[r]=this._trimAlignValue(s[r]),this._change(null,r);this._refreshValue()},_setOption:function(t,i){var a,s=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(s=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),a=0;s>a;a+=1)this._change(null,a);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,a;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),a=0;i.length>a;a+=1)i[a]=this._trimAlignValue(i[a]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,a=e-i;return 2*Math.abs(i)>=t&&(a+=i>0?t:-t),parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,a,s,r,n=this.options.range,o=this.options,h=this,l=this._animateOff?!1:o.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(a){i=100*((h.values(a)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,o.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===a&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},o.animate),1===a&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:o.animate})):(0===a&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},o.animate),1===a&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:o.animate}))),t=i}):(a=this.value(),s=this._valueMin(),r=this._valueMax(),i=r!==s?100*((a-s)/(r-s)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,o.animate),"min"===n&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},o.animate),"max"===n&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:o.animate}),"min"===n&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},o.animate),"max"===n&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:o.animate}))},_handleEvents:{keydown:function(i){var a,s,r,n,o=e(i.target).data("ui-slider-handle-index");switch(i.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(i.target).addClass("ui-state-active"),a=this._start(i,o),a===!1))return}switch(n=this.options.step,s=r=this.options.values&&this.options.values.length?this.values(o):this.value(),i.keyCode){case e.ui.keyCode.HOME:r=this._valueMin();break;case e.ui.keyCode.END:r=this._valueMax();break;case e.ui.keyCode.PAGE_UP:r=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.PAGE_DOWN:r=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;r=this._trimAlignValue(s+n);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;r=this._trimAlignValue(s-n)}this._slide(i,o,r)},click:function(e){e.preventDefault()},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})})(jQuery);\ No newline at end of file+(function(t,e){function i(e,i){var s,o,a,u=e.nodeName.toLowerCase();return"area"===u?(s=e.parentNode,o=s.name,e.href&&o&&"map"===s.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&n(a)):!1):(/input|select|textarea|button|object/.test(u)?!e.disabled:"a"===u?e.href||i:i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var s=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,n){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),n&&n.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,s,o=t(this[0]);o.length&&o[0]!==document;){if(n=o.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(o.css("zIndex"),10),!isNaN(s)&&0!==s))return s;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(e,!s)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,n){function s(e,i,n,s){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),s&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===n?["Left","Right"]:["Top","Bottom"],a=n.toLowerCase(),u={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?u["inner"+n].call(this):this.each(function(){t(this).css(a,s(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?u["outer"+n].call(this,e):this.each(function(){t(this).css(a,s(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var s,o=t.ui[e].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(t,e,i){var n,s=t.plugins[e];if(s&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)t.options[s[n][0]]&&s[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return e[n]>0?!0:(e[n]=1,s=e[n]>0,e[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,o=1===i.which,n="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return o&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(d.test(t[0])?e/100:1),parseFloat(t[1])*(d.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function o(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var n,a=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,d=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(n!==e)return n;var i,s,o=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=o.children()[0];return t("body").append(o),i=a.offsetWidth,o.css("overflow","scroll"),s=a.offsetWidth,i===s&&(s=o[0].clientWidth),o.remove(),n=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,n="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:n?t.position.scrollbarWidth():0,height:o?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),o=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:o,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var n,d,g,m,b,v,_=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),P=(e.collision||"flip").split(" "),x={};return v=o(_),_[0].preventDefault&&(e.at="left top"),d=v.width,g=v.height,m=v.offset,b=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):u.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=u.test(s[1])?s[1]:"center",t=c.exec(s[0]),i=c.exec(s[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[p.exec(s[0])[0],p.exec(s[1])[0]]}),1===P.length&&(P[1]=P[0]),"right"===e.at[0]?b.left+=d:"center"===e.at[0]&&(b.left+=d/2),"bottom"===e.at[1]?b.top+=g:"center"===e.at[1]&&(b.top+=g/2),n=i(x.at,d,g),b.left+=n[0],b.top+=n[1],this.each(function(){var o,h,u=t(this),c=u.outerWidth(),p=u.outerHeight(),f=s(this,"marginLeft"),v=s(this,"marginTop"),T=c+f+s(this,"marginRight")+w.width,C=p+v+s(this,"marginBottom")+w.height,D=t.extend({},b),k=i(x.my,u.outerWidth(),u.outerHeight());"right"===e.my[0]?D.left-=c:"center"===e.my[0]&&(D.left-=c/2),"bottom"===e.my[1]?D.top-=p:"center"===e.my[1]&&(D.top-=p/2),D.left+=k[0],D.top+=k[1],t.support.offsetFractions||(D.left=l(D.left),D.top=l(D.top)),o={marginLeft:f,marginTop:v},t.each(["left","top"],function(i,s){t.ui.position[P[i]]&&t.ui.position[P[i]][s](D,{targetWidth:d,targetHeight:g,elemWidth:c,elemHeight:p,collisionPosition:o,collisionWidth:T,collisionHeight:C,offset:[n[0]+k[0],n[1]+k[1]],my:e.my,at:e.at,within:y,elem:u})}),e.using&&(h=function(t){var i=m.left-D.left,s=i+d-c,o=m.top-D.top,n=o+g-p,l={target:{element:_,left:m.left,top:m.top,width:d,height:g},element:{element:u,left:D.left,top:D.top,width:c,height:p},horizontal:0>s?"left":i>0?"right":"center",vertical:0>n?"top":o>0?"bottom":"middle"};c>d&&d>r(i+s)&&(l.horizontal="center"),p>g&&g>r(o+n)&&(l.vertical="middle"),l.important=a(r(i),r(s))>a(r(o),r(n))?"horizontal":"vertical",e.using.call(this,t,l)}),u.offset(t.extend(D,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,o=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,r=t.left-e.collisionPosition.marginLeft,l=o-r,h=r+e.collisionWidth-n-o;e.collisionWidth>n?l>0&&0>=h?(i=t.left+l+e.collisionWidth-n-o,t.left+=l-i):t.left=h>0&&0>=l?o:l>h?o+n-e.collisionWidth:o:l>0?t.left+=l:h>0?t.left-=h:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,o=s.isWindow?s.scrollTop:s.offset.top,n=e.within.height,r=t.top-e.collisionPosition.marginTop,l=o-r,h=r+e.collisionHeight-n-o;e.collisionHeight>n?l>0&&0>=h?(i=t.top+l+e.collisionHeight-n-o,t.top+=l-i):t.top=h>0&&0>=l?o:l>h?o+n-e.collisionHeight:o:l>0?t.top+=l:h>0?t.top-=h:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,o=e.within,n=o.offset.left+o.scrollLeft,a=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,h=t.left-e.collisionPosition.marginLeft,u=h-l,c=h+e.collisionWidth-a-l,p="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>u?(i=t.left+p+d+f+e.collisionWidth-a-n,(0>i||r(u)>i)&&(t.left+=p+d+f)):c>0&&(s=t.left-e.collisionPosition.marginLeft+p+d+f-l,(s>0||c>r(s))&&(t.left+=p+d+f))},top:function(t,e){var i,s,o=e.within,n=o.offset.top+o.scrollTop,a=o.height,l=o.isWindow?o.scrollTop:o.offset.top,h=t.top-e.collisionPosition.marginTop,u=h-l,c=h+e.collisionHeight-a-l,p="top"===e.my[1],d=p?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>u?(s=t.top+d+f+g+e.collisionHeight-a-n,t.top+d+f+g>u&&(0>s||r(u)>s)&&(t.top+=d+f+g)):c>0&&(i=t.top-e.collisionPosition.marginTop+d+f+g-l,t.top+d+f+g>c&&(i>0||c>r(i))&&(t.top+=d+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,o,n,a=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(n in s)e.style[n]=s[n];e.appendChild(r),i=a||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",o=t(r).offset().left,t.support.offsetFractions=o>10&&11>o,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,o,a,r,l,h,c,u,p,d=t(this).data("ui-draggable"),f=d.options,g=f.snapTolerance,m=i.offset.left,b=m+d.helperProportions.width,v=i.offset.top,_=v+d.helperProportions.height;for(u=d.snapElements.length-1;u>=0;u--)r=d.snapElements[u].left,l=r+d.snapElements[u].width,h=d.snapElements[u].top,c=h+d.snapElements[u].height,r-g>b||m>l+g||h-g>_||v>c+g||!t.contains(d.snapElements[u].item.ownerDocument,d.snapElements[u].item)?(d.snapElements[u].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,e,t.extend(d._uiHash(),{snapItem:d.snapElements[u].item})),d.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(h-_),n=g>=Math.abs(c-v),o=g>=Math.abs(r-b),a=g>=Math.abs(l-m),s&&(i.position.top=d._convertPositionTo("relative",{top:h-d.helperProportions.height,left:0}).top-d.margins.top),n&&(i.position.top=d._convertPositionTo("relative",{top:c,left:0}).top-d.margins.top),o&&(i.position.left=d._convertPositionTo("relative",{top:0,left:r-d.helperProportions.width}).left-d.margins.left),a&&(i.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left)),p=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(h-v),n=g>=Math.abs(c-_),o=g>=Math.abs(r-m),a=g>=Math.abs(l-b),s&&(i.position.top=d._convertPositionTo("relative",{top:h,left:0}).top-d.margins.top),n&&(i.position.top=d._convertPositionTo("relative",{top:c-d.helperProportions.height,left:0}).top-d.margins.top),o&&(i.position.left=d._convertPositionTo("relative",{top:0,left:r}).left-d.margins.left),a&&(i.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left)),!d.snapElements[u].snapping&&(s||n||o||a||p)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,e,t.extend(d._uiHash(),{snapItem:d.snapElements[u].item})),d.snapElements[u].snapping=s||n||o||a||p)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=a+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,p=c+i.proportions().width,d=u+i.proportions().height;switch(s){case"fit":return a>=c&&p>=l&&r>=u&&d>=h;case"intersect":return a+t.helperProportions.width/2>c&&p>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&d>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&d>=r||h>=u&&d>=h||u>r&&h>d)&&(a>=c&&p>=a||l>=c&&p>=l||c>a&&l>p);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,o=!1,n=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,n.widgetName+"-item")===n?(s=t(this),!1):undefined}),t.data(e.target,n.widgetName+"-item")===n&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(o=!0)}),o)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var o,n,r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",r.cursor),this.storedStylesheet=t("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(n)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,o,n,r=this.options,a=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<r.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+r.scrollSpeed:e.pageY-this.overflowOffset.top<r.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-r.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<r.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+r.scrollSpeed:e.pageX-this.overflowOffset.left<r.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-r.scrollSpeed)):(e.pageY-t(document).scrollTop()<r.scrollSensitivity?a=t(document).scrollTop(t(document).scrollTop()-r.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<r.scrollSensitivity&&(a=t(document).scrollTop(t(document).scrollTop()+r.scrollSpeed)),e.pageX-t(document).scrollLeft()<r.scrollSensitivity?a=t(document).scrollLeft(t(document).scrollLeft()-r.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<r.scrollSensitivity&&(a=t(document).scrollLeft(t(document).scrollLeft()+r.scrollSpeed))),a!==!1&&t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],o=s.item[0],n=this._intersectsWithPointer(s),n&&s.instance===this.currentContainer&&o!==this.currentItem[0]&&this.placeholder[1===n?"next":"prev"]()[0]!==o&&!t.contains(this.placeholder[0],o)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],o):!0)){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,o=this.placeholder.offset(),n=this.options.axis,r={};n&&"x"!==n||(r.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(r.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,n=t.left,r=n+t.width,a=t.top,h=a+t.height,l=this.offset.click.top,c=this.offset.click.left,p="x"===this.options.axis||s+l>a&&h>s+l,u="y"===this.options.axis||e+c>n&&r>e+c,d=p&&u;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:e+this.helperProportions.width/2>n&&r>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>a&&h>o-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=i&&s,n=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return o?this.floating?r&&"right"===r||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),o=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&s||"left"===n&&!s:o&&("down"===o&&i||"up"===o&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){a.push(this)}var s,o,n,r,a=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(n=t(l[s]),o=n.length-1;o>=0;o--)r=t.data(n[o],this.widgetFullName),r&&r!==this&&!r.options.disabled&&h.push([t.isFunction(r.options.items)?r.options.items.call(r.element):t(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,o,n,r,a,h,l,c=this.items,p=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(i=u.length-1;i>=0;i--)for(o=t(u[i]),s=o.length-1;s>=0;s--)n=t.data(o[s],this.widgetFullName),n&&n!==this&&!n.options.disabled&&(p.push([t.isFunction(n.options.items)?n.options.items.call(n.element[0],e,{item:this.currentItem}):t(n.options.items,n.element),n]),this.containers.push(n));for(i=p.length-1;i>=0;i--)for(r=p[i][1],a=p[i][0],s=0,l=a.length;l>s;s++)h=t(a[s]),h.data(this.widgetName+"-item",r),c.push({item:h,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,o,n;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(o=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=o.outerWidth(),s.height=o.outerHeight()),n=o.offset(),s.left=n.left,s.top=n.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)n=this.containers[i].element.offset(),this.containers[i].containerCache.left=n.left,this.containers[i].containerCache.top=n.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),o=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(o)}):"img"===s&&o.attr("src",e.currentItem.attr("src")),i||o.css("visibility","hidden"),o},update:function(t,o){(!i||s.forcePlaceholderSize)&&(o.height()||o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var o,n,r,a,h,l,c,p,u,d,f=null,g=null;for(o=this.containers.length-1;o>=0;o--)if(!t.contains(this.currentItem[0],this.containers[o].element[0]))if(this._intersectsWith(this.containers[o].containerCache)){if(f&&t.contains(this.containers[o].element[0],f.element[0]))continue;f=this.containers[o],g=o}else this.containers[o].containerCache.over&&(this.containers[o]._trigger("out",s,this._uiHash(this)),this.containers[o].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(r=1e4,a=null,d=f.floating||i(this.currentItem),h=d?"left":"top",l=d?"width":"height",c=this.positionAbs[h]+this.offset.click[h],n=this.items.length-1;n>=0;n--)t.contains(this.containers[g].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(!d||e(this.positionAbs.top+this.offset.click.top,this.items[n].top,this.items[n].height))&&(p=this.items[n].item.offset()[h],u=!1,Math.abs(p-c)>Math.abs(p+this.items[n][l]-c)&&(u=!0,p+=this.items[n][l]),r>Math.abs(p-c)&&(r=Math.abs(p-c),a=this.items[n],this.direction=u?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;a?this._rearrange(s,a,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),("document"===o.containment||"window"===o.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===o.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===o.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(e=t(o.containment)[0],i=t(o.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(o[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():n?0:o.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())*s}},_generatePosition:function(e){var i,s,o=this.options,n=e.pageX,r=e.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(n=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(r=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(n=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),o.grid&&(i=this.originalPageY+Math.round((r-this.originalPageY)/o.grid[1])*o.grid[1],r=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-o.grid[1]:i+o.grid[1]:i,s=this.originalPageX+Math.round((n-this.originalPageX)/o.grid[0])*o.grid[0],n=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-o.grid[0]:s+o.grid[0]:s)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:a.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:a.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,o=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&o.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||o.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(o.push(function(t){this._trigger("remove",t,this._uiHash())}),o.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),o.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||o.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(o.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;o.length>s;s++)o[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;o.length>s;s++)o[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){t.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,o,a,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===n?a=!0:o=n+o,r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=a&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(o=String.fromCharCode(e.keyCode),r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);\ No newline at end of filediff --git a/wger/core/static/js/jquery.ui.datepicker-bg.js b/wger/core/static/js/jquery.ui.datepicker-bg.jsdeleted file mode 100644index 3bd9b0262..000000000--- a/wger/core/static/js/jquery.ui.datepicker-bg.js+++ /dev/null@@ -1,26 +0,0 @@-/* Bulgarian initialisation for the jQuery UI date picker plugin. */-/* Written by Stoyan Kyosev (http://svest.org). */-jQuery(function($){- $.datepicker.regional['bg'] = {- closeText: 'затвори',- prevText: '<назад',- nextText: 'напред>',- nextBigText: '>>',- currentText: 'днес',- monthNames: ['Януари','Февруари','Март','Април','Май','Юни',- 'Юли','Август','Септември','Октомври','Ноември','Декември'],- monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',- 'Юли','Авг','Сеп','Окт','Нов','Дек'],- dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],- dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],- dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],- weekHeader: 'Wk',- //dateFormat: 'dd.mm.yy',- // Replacing the default date format to make handling dates with JS easier- dateFormat: 'yy-mm-dd',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};- $.datepicker.setDefaults($.datepicker.regional['bg']);-});diff --git a/wger/core/static/js/jquery.ui.datepicker-de.js b/wger/core/static/js/jquery.ui.datepicker-de.jsdeleted file mode 100644index fe31742e9..000000000--- a/wger/core/static/js/jquery.ui.datepicker-de.js+++ /dev/null@@ -1,25 +0,0 @@-/* German initialisation for the jQuery UI date picker plugin. */-/* Written by Milian Wolff ([email protected]). */-jQuery(function($){- $.datepicker.regional['de'] = {- closeText: 'schließen',- prevText: '<zurück',- nextText: 'Vor>',- currentText: 'heute',- monthNames: ['Januar','Februar','März','April','Mai','Juni',- 'Juli','August','September','Oktober','November','Dezember'],- monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',- 'Jul','Aug','Sep','Okt','Nov','Dez'],- dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],- dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],- dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],- weekHeader: 'Wo',- //dateFormat: 'dd.mm.yy',- // Replacing the default date format to make handling dates with JS easier- dateFormat: 'yy-mm-dd',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};- $.datepicker.setDefaults($.datepicker.regional['de']);-});diff --git a/wger/core/static/js/jquery.ui.datepicker-en.js b/wger/core/static/js/jquery.ui.datepicker-en.jsdeleted file mode 100644index a2d60909b..000000000--- a/wger/core/static/js/jquery.ui.datepicker-en.js+++ /dev/null@@ -1,25 +0,0 @@-/* English/UK initialisation for the jQuery UI date picker plugin. */-/* Written by Stuart. */-jQuery(function($){- $.datepicker.regional['en-GB'] = {- closeText: 'Done',- prevText: 'Prev',- nextText: 'Next',- currentText: 'Today',- monthNames: ['January','February','March','April','May','June',- 'July','August','September','October','November','December'],- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],- weekHeader: 'Wk',- //dateFormat: 'dd.mm.yy',- // Replacing the default date format to make handling dates with JS easier- dateFormat: 'yy-mm-dd',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};- $.datepicker.setDefaults($.datepicker.regional['en-GB']);-});diff --git a/wger/core/static/js/jquery.ui.datepicker-es.js b/wger/core/static/js/jquery.ui.datepicker-es.jsdeleted file mode 100644index 7b1e74b4d..000000000--- a/wger/core/static/js/jquery.ui.datepicker-es.js+++ /dev/null@@ -1,25 +0,0 @@-/* Inicialización en español para la extensión 'UI date picker' para jQuery. */-/* Traducido por Vester ([email protected]). */-jQuery(function($){- $.datepicker.regional['es'] = {- closeText: 'Cerrar',- prevText: '<Ant',- nextText: 'Sig>',- currentText: 'Hoy',- monthNames: ['enero','febrero','marzo','abril','mayo','junio',- 'julio','agosto','septiembre','octubre','noviembre','diciembre'],- monthNamesShort: ['ene','feb','mar','abr','may','jun',- 'jul','ogo','sep','oct','nov','dic'],- dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],- dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'],- dayNamesMin: ['D','L','M','X','J','V','S'],- weekHeader: 'Sm',- //dateFormat: 'dd.mm.yy',- // Replacing the default date format to make handling dates with JS easier- dateFormat: 'yy-mm-dd',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};- $.datepicker.setDefaults($.datepicker.regional['es']);-});diff --git a/wger/core/static/js/jquery.ui.datepicker-i18n.README b/wger/core/static/js/jquery.ui.datepicker-i18n.READMEdeleted file mode 100644index 41bac3633..000000000--- a/wger/core/static/js/jquery.ui.datepicker-i18n.README+++ /dev/null@@ -1,3 +0,0 @@-Datepicker translations files from:--https://github.com/jquery/jquery-ui/tree/master/ui/i18ndiff --git a/wger/core/static/js/jquery.ui.datepicker-nl.js b/wger/core/static/js/jquery.ui.datepicker-nl.jsdeleted file mode 100644index 9be14bb2a..000000000--- a/wger/core/static/js/jquery.ui.datepicker-nl.js+++ /dev/null@@ -1,37 +0,0 @@-/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */-/* Written by Mathias Bynens <http://mathiasbynens.be/> */-(function( factory ) {- if ( typeof define === "function" && define.amd ) {-- // AMD. Register as an anonymous module.- define([ "../datepicker" ], factory );- } else {-- // Browser globals- factory( jQuery.datepicker );- }-}(function( datepicker ) {--datepicker.regional.nl = {- closeText: 'Sluiten',- prevText: '←',- nextText: '→',- currentText: 'Vandaag',- monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',- 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],- monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',- 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],- dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],- dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],- dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],- weekHeader: 'Wk',- dateFormat: 'dd-mm-yy',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};-datepicker.setDefaults(datepicker.regional.nl);--return datepicker.regional.nl;--}));diff --git a/wger/core/static/js/jquery.ui.datepicker-ru.js b/wger/core/static/js/jquery.ui.datepicker-ru.jsdeleted file mode 100644index f3c30e021..000000000--- a/wger/core/static/js/jquery.ui.datepicker-ru.js+++ /dev/null@@ -1,25 +0,0 @@-/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */-/* Written by Andrew Stromnov ([email protected]). */-jQuery(function($){- $.datepicker.regional['ru'] = {- closeText: 'Закрыть',- prevText: '<Пред',- nextText: 'След>',- currentText: 'Сегодня',- monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',- 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],- monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',- 'Июл','Авг','Сен','Окт','Ноя','Дек'],- dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],- dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],- dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],- weekHeader: 'Нед',- //dateFormat: 'dd.mm.yy',- // Replacing the default date format to make handling dates with JS easier- dateFormat: 'yy-mm-dd',- firstDay: 1,- isRTL: false,- showMonthAfterYear: false,- yearSuffix: ''};- $.datepicker.setDefaults($.datepicker.regional['ru']);-});diff --git a/wger/core/static/js/workout-manager-mobile.js b/wger/core/static/js/workout-manager-mobile.jsindex caed781ec..63edc9caf 100644--- a/wger/core/static/js/workout-manager-mobile.js+++ b/wger/core/static/js/workout-manager-mobile.js@@ -8,12 +8,6 @@"use strict";-/*- * There are no datepickers in the mobile version- */-function init_weight_datepicker() {-}-/** Open a modal dialog for form editing*/diff --git a/wger/core/static/js/workout-manager.js b/wger/core/static/js/workout-manager.jsindex 4a5bbadf6..8ec0a1d9c 100644--- a/wger/core/static/js/workout-manager.js+++ b/wger/core/static/js/workout-manager.js@@ -161,6 +161,11 @@ function form_modal_dialog() {$("#ajax-info-content").load(targetUrl + " .form-horizontal",function(responseText, textStatus, XMLHttpRequest){+ // Initialise datepickers for any date input+ $('#ajax-info-content input[type="date"]').datepicker({autoclose: true,+ language: $('html').attr('lang'),+ });+if (textStatus == "error") {$("#ajax-info-title").html("Sorry but an error occured")$("#ajax-info-content").html(XMLHttpRequest.status + " " + XMLHttpRequest.statusText);@@ -415,19 +420,6 @@ function init_edit_set() {});}-function init_schedule_datepicker() {- $("#id_start_date").datepicker();-}--function init_weight_datepicker() {- $("#id_creation_date").datepicker();-}--function init_weight_log_datepicker() {- $("#id_date").datepicker();-}--function toggle_weight_log_table() {$(".weight-chart-table-toggle").click(function (e) {diff --git a/wger/core/templates/template.html b/wger/core/templates/template.htmlindex bd0c75ff9..7a91c37a2 100644--- a/wger/core/templates/template.html+++ b/wger/core/templates/template.html@@ -34,6 +34,7 @@<link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui-custom.css' %}"><link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}"><link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-custom.css' %}">+ <link rel="stylesheet" type="text/css" href="{% static 'css/datepicker3.css' %}">{% endcompress %}<link rel="icon" href="{% static 'images/favicon.png' %}" type="image/png">@@ -45,13 +46,15 @@<script src="{% static 'js/workout-manager.js' %}" type="text/javascript"></script><script src="{% static 'js/browserid.js' %}" type="text/javascript"></script><script src="{% static 'js/ubuntu-unity.js' %}" type="text/javascript"></script>- <script src="{% static 'js/bootstrap.min.js' %}" type="text/javascript"></script>+ <script src="{% static 'js/bootstrap.min.js' %}" type="text/javascript"></script>+ <script src="{% static 'js/bootstrap-datepicker/bootstrap-datepicker.min.js' %}" type="text/javascript"></script><script src="{% static 'js/exercises.js' %}" type="text/javascript"></script><script src="{% static 'js/weight.js' %}" type="text/javascript"></script><script src="{% static 'js/nutrition.js' %}" type="text/javascript"></script>{% endcompress %}- <script src="{% static datepicker_i18n_path %}"></script>+ <script src="/static/js/bootstrap-datepicker/locales/bootstrap-datepicker.{{language.short_name}}.js" type="text/javascript"></script>+{% block header %}{% endblock %}<script>@@ -71,6 +74,11 @@// Toggle weight chart tablestoggle_weight_log_table();++ $('input[type="date"]').datepicker({+ autoclose: true,+ language: $('html').attr('lang')+ });});</script>@@ -83,7 +91,7 @@<div class="container"><div class="row"><div class="col-md-offset-9 col-md-3">- <a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>+ <a href="{% url 'core:contact' %}">{{language.short_name}}{% trans "Get in touch" %}</a>|{# #}diff --git a/wger/exercises/templates/exercise/view.html b/wger/exercises/templates/exercise/view.htmlindex 560160596..c3e0af054 100644--- a/wger/exercises/templates/exercise/view.html+++ b/wger/exercises/templates/exercise/view.html@@ -13,9 +13,6 @@ function custom_modal_init(){// Set up the tinyMCE editor on modal dialogsinit_tinymce();-- // Initialise the datepicker for the modal dialog- init_weight_log_datepicker();}</script>{% endblock %}diff --git a/wger/exercises/templates/mobile/exercise/view.html b/wger/exercises/templates/mobile/exercise/view.htmlindex 36b7c3563..ac43684ef 100644--- a/wger/exercises/templates/mobile/exercise/view.html+++ b/wger/exercises/templates/mobile/exercise/view.html@@ -13,9 +13,6 @@ function custom_modal_init(){// Set up the tinyMCE editor on modal dialogsinit_tinymce();-- // Initialise the datepicker for the modal dialog- init_weight_log_datepicker();}</script>{% endblock %}diff --git a/wger/manager/templates/mobile/schedule/overview.html b/wger/manager/templates/mobile/schedule/overview.htmlindex 7c22757bf..624757d0e 100644--- a/wger/manager/templates/mobile/schedule/overview.html+++ b/wger/manager/templates/mobile/schedule/overview.html@@ -6,14 +6,6 @@{% block header %}-<script type="text/javascript">--// Initialise the datepicker for the modal dialog-function custom_modal_init()-{- init_schedule_datepicker();-}-</script>{% endblock %}{% block content %}diff --git a/wger/manager/templates/schedule/overview.html b/wger/manager/templates/schedule/overview.htmlindex 620302a3e..a9892c622 100644--- a/wger/manager/templates/schedule/overview.html+++ b/wger/manager/templates/schedule/overview.html@@ -6,14 +6,6 @@{% block header %}-<script type="text/javascript">--// Initialise the datepicker for the modal dialog-function custom_modal_init()-{- init_schedule_datepicker();-}-</script>{% endblock %}{% block content %}diff --git a/wger/manager/templates/schedule/view.html b/wger/manager/templates/schedule/view.htmlindex c9bef2ff3..3f35203a2 100644--- a/wger/manager/templates/schedule/view.html+++ b/wger/manager/templates/schedule/view.html@@ -34,14 +34,8 @@ function init_sortable()}// Initialise the datepicker for the modal dialog-function custom_modal_init()-{- init_schedule_datepicker();-}-$(function() {init_sortable();- init_schedule_datepicker();});</script>{% endblock %}diff --git a/wger/manager/templates/workout/log.html b/wger/manager/templates/workout/log.htmlindex 531133507..f0de95771 100644--- a/wger/manager/templates/workout/log.html+++ b/wger/manager/templates/workout/log.html@@ -6,14 +6,6 @@{% block title %}{% trans "Weight log for workout" %}{% endblock %}{% block header %}--<script type="text/javascript">-// Initialise the datepicker for the modal dialog-function custom_modal_init()-{- init_weight_log_datepicker();-}-</script>{% endblock %}{% block content %}diff --git a/wger/manager/views/log.py b/wger/manager/views/log.pyindex cdeba56b3..7edeb268a 100644--- a/wger/manager/views/log.py+++ b/wger/manager/views/log.py@@ -63,9 +63,6 @@ class WorkoutLogUpdateView(WgerFormMixin, UpdateView, WgerPermissionMixin):form_class = WorkoutLogFormsuccess_url = reverse_lazy('workout-calendar')login_required = True- custom_js = '''$(document).ready(function () {- init_weight_log_datepicker();- });'''def get_context_data(self, **kwargs):context = super(WorkoutLogUpdateView, self).get_context_data(**kwargs)diff --git a/wger/weight/templates/weight_overview.html b/wger/weight/templates/weight_overview.htmlindex e079e1545..d00dede61 100644--- a/wger/weight/templates/weight_overview.html+++ b/wger/weight/templates/weight_overview.html@@ -15,14 +15,6 @@<script type="text/javascript">--// Initialise the datepicker for the modal dialog-function custom_modal_init()-{- init_weight_datepicker();-}--$(document).ready(function () {$.getJSON("/weight/api/get_weight_data/", function(json) {diff --git a/wger/weight/views.py b/wger/weight/views.pyindex 1a43d2cdb..45e4f7df9 100644--- a/wger/weight/views.py+++ b/wger/weight/views.py@@ -66,9 +66,6 @@ class WeightAddView(WgerFormMixin, CreateView):'''model = WeightEntryform_class = WeightForm- custom_js = '''$(document).ready(function () {- init_weight_datepicker();- });'''title = ugettext_lazy('Add weight entry')form_action = reverse_lazy('weight-add')success_url = reverse_lazy('weight-overview')