r77136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77135‎ | r77136 | r77137 >
Date:08:02, 23 November 2010
Author:neilk
Status:deferred
Tags:
Comment:
Overhaul to error handling, interface flow on file upload page, and some aspects of how it looks.

- Uploading multiple files with varying success now works
- Explicit step to retry failed uploads or proceed
- Error handling (usually) works, results can be understood by user
- buttons on file step, and navigation buttons throughout, are jquery styled
- using Vector theme

Fixes or partial fix for the following issues:

bug#25787 UploadWizard's error handling is totally broken
bug#26011 The error sign comes with OK text for bad files
bug#24695 Error handling system
bug#24699 Add upload confirmation
bug#25967 Safari error when uploading multiple files
bug#26057 User gets to navigate to the next section even after an upload cancellation
bug#26051 'Upload more files' and 'Go to wiki home page' buttons should be placed properly
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/combined.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/combined.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/combined.min.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/combined.min.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/dir.combined.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/dir.combined.min.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.css (added) (history)
  • /trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.min.css (added) (history)
  • /trunk/extensions/UploadWizard/resources/mw.IframeTransport.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -16,9 +16,12 @@
1717 'scripts' => array(
1818 // jquery ui
1919 // FIXME: These can be replaced with dependencies when pre-RL compat is dropped
20 - 'resources/jquery.ui/ui/ui.core.js',
21 - 'resources/jquery.ui/ui/ui.datepicker.js',
22 - 'resources/jquery.ui/ui/ui.progressbar.js',
 20+ 'resources/jquery.ui/jquery.ui.core.js',
 21+ 'resources/jquery.ui/jquery.ui.widget.js',
 22+ 'resources/jquery.ui/jquery.ui.button.js',
 23+ 'resources/jquery.ui/jquery.ui.dialog.js',
 24+ 'resources/jquery.ui/jquery.ui.datepicker.js',
 25+ 'resources/jquery.ui/jquery.ui.progressbar.js',
2326
2427 // jquery interface helpers
2528 'resources/jquery/jquery.tipsy.js',
@@ -123,7 +126,12 @@
124127 'resources/jquery/jquery.arrowSteps.css',
125128 'resources/jquery/jquery.mwCoolCats.css',
126129 'resources/jquery/jquery.removeCtrl.css',
127 - 'resources/jquery.ui/themes/redmond/jquery-ui-1.7.1.custom.css'
 130+ 'resources/jquery.ui/themes/vector/jquery.ui.core.css',
 131+ 'resources/jquery.ui/themes/vector/jquery.ui.theme.css',
 132+ 'resources/jquery.ui/themes/vector/jquery.ui.button.css',
 133+ 'resources/jquery.ui/themes/vector/jquery.ui.dialog.css',
 134+ 'resources/jquery.ui/themes/vector/jquery.ui.datepicker.css',
 135+ 'resources/jquery.ui/themes/vector/jquery.ui.progressbar.css',
128136 ),
129137 'messages' => array(
130138 'linktest',
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -78,6 +78,11 @@
7979 'mwe-upwiz-remove-upload' => 'Remove this file from the list of files to upload',
8080 'mwe-upwiz-remove-description' => 'Remove this description',
8181 'mwe-upwiz-upload' => 'Upload',
 82+ 'mwe-upwiz-file-all-ok' => 'All uploads were successful!',
 83+ 'mwe-upwiz-file-some-failed' => 'Some uploads failed.',
 84+ 'mwe-upwiz-file-retry' => 'Retry failed uploads',
 85+ 'mwe-upwiz-next-file-despite-failures' => 'Continue anyway',
 86+ 'mwe-upwiz-file-all-failed' => 'None of the uploads were successful.',
8287 'mwe-upwiz-upload-count' => '$1 of $2 {{PLURAL:$2|file|files}} uploaded',
8388 'mwe-upwiz-progressbar-uploading' => 'uploading',
8489 'mwe-upwiz-finished' => 'Finished!',
@@ -143,7 +148,7 @@
144149 'mwe-copyright-macro' => 'As above',
145150 'mwe-copyright-custom' => 'Custom',
146151 'mwe-upwiz-next' => 'Next',
147 - 'mwe-upwiz-next-file' => 'Upload files and continue',
 152+ 'mwe-upwiz-next-file' => 'Continue',
148153 'mwe-upwiz-next-deeds' => 'Next',
149154 'mwe-upwiz-next-details' => 'Next',
150155 'mwe-upwiz-home' => 'Go to wiki home page',
Index: trunk/extensions/UploadWizard/resources/dir.combined.css
@@ -27,6 +27,7 @@
2828
2929 #mwe-upwiz-steps li {
3030 color: #666666;
 31+ font-size: 1.2em;
3132 }
3233
3334 #mwe-upwiz-steps li.head {
@@ -49,10 +50,11 @@
5051
5152 .mwe-upwiz-add-files-0 {
5253 text-align: center;
53 - font-size: large;
5454 }
5555
56 -#mwe-upwiz-add-file {
 56+.mwe-upwiz-add-files-0 #mwe-upwiz-add-file {
 57+ font-size: large;
 58+ padding: 1em;
5759 }
5860
5961 /* NOT a pseudoclass */
@@ -61,7 +63,7 @@
6264 }
6365
6466 /* perhaps a general class for links that are actually "buttons" */
65 -#mwe-upwiz-add-file, .mwe-upwiz-more-options {
 67+#mwe-upwiz-add-file, .mwe-upwiz-more-options, #mwe-upwiz-upload-ctrl {
6668 outline: none;
6769 cursor: pointer;
6870 }
@@ -159,16 +161,20 @@
160162
161163 .mwe-upwiz-add-files-n {
162164 float: left;
163 - margin-top: 5px;
164 - margin-left: 4px;
165165 }
166166
167167 #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n, .mwe-upwiz-progress-bar-etr {
168168 width: 300px;
169 - padding-left: 5px;
170169 }
171170
 171+#mwe-upwiz-upload-ctrl-container {
 172+ float: right;
 173+ display: none;
 174+}
172175
 176+#mwe-upwiz-upload-ctrl:hover {
 177+ text-decoration: none;
 178+}
173179 #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n {
174180 float: left;
175181 }
@@ -208,6 +214,22 @@
209215 margin-top: 1em;
210216 }
211217
 218+#mwe-upwiz-upload-ctrls button, .mwe-upwiz-buttons button {
 219+ padding: 0.25em 0.75em;
 220+ font-size: 1em;
 221+}
 222+
 223+#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons {
 224+ display: none;
 225+}
 226+
 227+#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice {
 228+ display: none;
 229+}
 230+
 231+
 232+
 233+
212234 #mwe-upwiz-add-file-container {
213235 /* empty; this changes a lot */
214236 }
@@ -588,3 +610,13 @@
589611 .ui-datepicker-current-day a.ui-state-active {
590612 background: #ffff99;
591613 }
 614+
 615+#upload-wizard .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
 616+#upload-wizard .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
 617+#upload-wizard .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
 618+#upload-wizard .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 619+#upload-wizard .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
 620+#upload-wizard .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 621+#upload-wizard .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 622+#upload-wizard .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
 623+#upload-wizard .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
Index: trunk/extensions/UploadWizard/resources/dir.combined.min.css
@@ -1,15 +1,16 @@
22 form.mwe-upwiz-form{display:inline;}#upload-wizard{margin-top:18px;min-width:750px;
33 max-width:900px;
4 -}#mwe-upwiz-steps{background-color:white;background-image:none;border:solid 1px #a7d7f9;}#mwe-upwiz-steps li{color:#666666;}#mwe-upwiz-steps li.head{color:#000000;}.mwe-upwiz-clearing{clear:left;width:100%;}#mwe-upwiz-content{padding:1em;}.mwe-upwiz-add-files-0,#mwe-upwiz-files{margin-top:3em;margin-bottom:3em;}.mwe-upwiz-add-files-0{text-align:center;font-size:large;}#mwe-upwiz-add-file{}
 4+}#mwe-upwiz-steps{background-color:white;background-image:none;border:solid 1px #a7d7f9;}#mwe-upwiz-steps li{color:#666666;font-size:1.2em;}#mwe-upwiz-steps li.head{color:#000000;}.mwe-upwiz-clearing{clear:left;width:100%;}#mwe-upwiz-content{padding:1em;}.mwe-upwiz-add-files-0,#mwe-upwiz-files{margin-top:3em;margin-bottom:3em;}.mwe-upwiz-add-files-0{text-align:center;}.mwe-upwiz-add-files-0 #mwe-upwiz-add-file{font-size:large;padding:1em;}
55 #mwe-upwiz-add-file.hover{text-decoration:underline;}
6 -#mwe-upwiz-add-file,.mwe-upwiz-more-options{outline:none;cursor:pointer;}
 6+#mwe-upwiz-add-file,.mwe-upwiz-more-options,#mwe-upwiz-upload-ctrl{outline:none;cursor:pointer;}
77 .mwe-upwiz-file-ctrl-container{position:absolute;overflow:hidden;}.mwe-upwiz-file-input,.mwe-upwiz-visible-file{cursor:pointer;}
88 .mwe-upwiz-file-input,.disabler{font-size:100px;-moz-opacity:0.3;filter:alpha(opacity:0);opacity:0;z-index:2;}.mwe-upwiz-file.filled{position:relative;}.mwe-upwiz-file.odd .mwe-upwiz-visible-file{background:#f5f5f5;}.mwe-upwiz-file-status-line-item{display:inline-block;float:left;margin-right:.5em;}.mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl{visibility:hidden;}.mwe-upwiz-file-indicator,.mwe-upwiz-count{float:right;margin-left:0.5em;padding:0.5em;}.mwe-upwiz-visible-file .mwe-upwiz-file-indicator{visibility:hidden;}.mwe-upwiz-visible-file{display:none;}.mwe-upwiz-file.filled .mwe-upwiz-visible-file{display:block;}.mwe-upwiz-visible-file-filename{padding:0.5em;margin-right:40px;overflow:hidden;}.mwe-upwiz-icon{float:left;}.mwe-upwiz-filled-filelist{border:1px solid #d8d8d8;}.mwe-upwiz-file-texts{margin-left:46px;}.mwe-upwiz-file-status{display:none;color:#797979;}.mwe-upwiz-progress-bar-etr-container{
99 }
10 -.mwe-upwiz-file-preview{float:left;height:40px;width:40px;margin-right:6px;background:url(32px-Blank-document.svg.png) no-repeat center top;}.mwe-upwiz-add-files-n{float:left;margin-top:5px;margin-left:4px;}#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n,.mwe-upwiz-progress-bar-etr{width:300px;padding-left:5px;}#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n{float:left;}.mwe-upwiz-visible-file{width:100%;
 10+.mwe-upwiz-file-preview{float:left;height:40px;width:40px;margin-right:6px;background:url(32px-Blank-document.svg.png) no-repeat center top;}.mwe-upwiz-add-files-n{float:left;}#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n,.mwe-upwiz-progress-bar-etr{width:300px;}#mwe-upwiz-upload-ctrl-container{float:right;display:none;}#mwe-upwiz-upload-ctrl:hover{text-decoration:none;}
 11+#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n{float:left;}.mwe-upwiz-visible-file{width:100%;
1112 white-space:nowrap;overflow:hidden;}.mwe-upwiz-file.hover .mwe-upwiz-visible-file{background:#e0f0ff !important;}.mwe-upwiz-file.hover .mwe-upwiz-remove-ctrl{visibility:visible;}
1213 .helper{color:#cccccc;
13 -font-variant:italic,oblique;text-align:center;}#mwe-upwiz-files{margin-right:8em;margin-left:8em;}.filled + .filled{border-top:1px solid #d8d8d8;}#mwe-upwiz-upload-ctrls{margin-top:1em;}#mwe-upwiz-add-file-container{
 14+font-variant:italic,oblique;text-align:center;}#mwe-upwiz-files{margin-right:8em;margin-left:8em;}.filled + .filled{border-top:1px solid #d8d8d8;}#mwe-upwiz-upload-ctrls{margin-top:1em;}#mwe-upwiz-upload-ctrls button,.mwe-upwiz-buttons button{padding:0.25em 0.75em;font-size:1em;}#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons{display:none;}#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice{display:none;}#mwe-upwiz-add-file-container{
1415 }.mwe-upwiz-details-descriptions .mwe-upwiz-remove-ctrl{vertical-align:top;display:inline-block;}a[disabled=true]{color:#999999;text-decoration:none;cursor:default;}a[disabled=true]:hover{text-decoration:none;}.mwe-upwiz-file-indicator{height:40px;width:40px;}.mwe-upwiz-status-progress{background:url(24px-spinner-0645ad.gif) no-repeat center center;}.mwe-upwiz-status-stashed{background:url(32px-Dialog-apply-009900.svg.png) no-repeat center center;}.mwe-upwiz-status-error{background:url(32px-Nuvola_apps_important_orange.svg.png) no-repeat center center;font-weight:bold;color:#CC0000;}.mwe-upwiz-progress{margin-top:15px;}.mwe-upwiz-progress-bar-etr{float:left;}.mwe-upwiz-etr{text-align:center;}.mwe-upwiz-upload-warning{background:#ffffe0;}.mwe-upwiz-details-error{display:none;background:#ffffe0;}.mwe-upwiz-thumbnail,.mwe-upwiz-thumbnail-small{border:1px solid #cccccc;text-align:center;background:#ffffff;}.mwe-upwiz-thumbnail{padding:0.5em;width:120px;}.mwe-upwiz-thumbnail-side{float:left;margin-bottom:1em;margin-right:1em;}.mwe-upwiz-thumbnail-small{padding:0.25em;width:60px;}#mwe-upwiz-deeds-thumbnails{text-align:center;margin:1em 0;background:#f0f0f0;}#mwe-upwiz-deeds-thumbnails .mwe-upwiz-thumbnail-small{display:inline-block;margin:1em;vertical-align:middle;}
1516 .mwe-upwiz-data{float:left;width:46em;}
1617 .busy{
@@ -26,4 +27,12 @@
2728 }a.mwe-upwiz-tooltip-link{cursor:pointer;}.mwe-error,.mwe-validator-error{color:#ff0000;}.mwe-upwiz-deed-thirdparty .mwe-upwiz-deed-form-internal label.mwe-error,.mwe-upwiz-deed-thirdparty .mwe-upwiz-deed-form-internal label.mwe-validator-error{margin-left:9em;}
2829 input[type='text'].mwe-error,textarea.mwe-error,input[type='text'].mwe-validator-error,textarea.mwe-validator-error{color:black;border-color:#ff0000;}.mwe-upwiz-toggler{margin-bottom:0;padding:4px 0 3px 18px;background:url('toggle.png') no-repeat left center;}.mwe-upwiz-toggler-open{background:url('toggle-open.png') no-repeat left center;}.mwe-upwiz-toggled{margin-top:1em;}.mwe-upwiz-thanks{margin-bottom:2em;}
2930 .mwe-upwiz-required-field{
30 -}.mwe-upwiz-required-marker{color:#0099cc;}.mwe-readonly{background-color:#ffffff;}.mwe-date-display{width:100%;background:#ffffff url('calendar.gif') no-repeat right center;}.ui-datepicker-current-day a.ui-state-active{background:#ffff99;}
\ No newline at end of file
 31+}.mwe-upwiz-required-marker{color:#0099cc;}.mwe-readonly{background-color:#ffffff;}.mwe-date-display{width:100%;background:#ffffff url('calendar.gif') no-repeat right center;}.ui-datepicker-current-day a.ui-state-active{background:#ffff99;}#upload-wizard .ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;}
 32+#upload-wizard .ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;}
 33+#upload-wizard .ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;}
 34+#upload-wizard .ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;}
 35+#upload-wizard .ui-corner-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;}
 36+#upload-wizard .ui-corner-bottom{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;}
 37+#upload-wizard .ui-corner-right{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;}
 38+#upload-wizard .ui-corner-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;}
 39+#upload-wizard .ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;}
\ No newline at end of file
Index: trunk/extensions/UploadWizard/resources/combined.css
@@ -1,3 +1,3 @@
22 @import "jquery/dir.combined.css";
33 @import "dir.combined.css";
4 -@import "jquery.ui/themes/redmond/dir.combined.css";
 4+@import "jquery.ui/themes/vector/dir.combined.css";
Index: trunk/extensions/UploadWizard/resources/combined.min.css
@@ -1,3 +1,3 @@
22 @import "jquery/dir.combined.min.css";
33 @import "dir.combined.min.css";
4 -@import "jquery.ui/themes/redmond/dir.combined.min.css";
 4+@import "jquery.ui/themes/vector/dir.combined.min.css";
Index: trunk/extensions/UploadWizard/resources/combined.js
@@ -1,20 +1,26 @@
2 -/*
3 - * jQuery UI 1.7.1
 2+/*!
 3+ * jQuery UI 1.8.2
44 *
5 - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 5+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
66 * Dual licensed under the MIT (MIT-LICENSE.txt)
77 * and GPL (GPL-LICENSE.txt) licenses.
88 *
99 * http://docs.jquery.com/UI
1010 */
11 -;jQuery.ui || (function($) {
1211
13 -var _remove = $.fn.remove,
14 - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
 12+(function($) {
1513
 14+// prevent duplicate loading
 15+// this is only a problem because we proxy existing functions
 16+// and we don't want to double proxy them
 17+$.ui = $.ui || {};
 18+if ($.ui.version) {
 19+ return;
 20+}
 21+
1622 //Helper functions and ui object
17 -$.ui = {
18 - version: "1.7.1",
 23+$.extend($.ui, {
 24+ version: "1.8.2",
1925
2026 // $.ui.plugin is deprecated. Use the proxy pattern instead.
2127 plugin: {
@@ -73,9 +79,13 @@
7480 },
7581
7682 keyCode: {
 83+ ALT: 18,
7784 BACKSPACE: 8,
7885 CAPS_LOCK: 20,
7986 COMMA: 188,
 87+ COMMAND: 91,
 88+ COMMAND_LEFT: 91, // COMMAND
 89+ COMMAND_RIGHT: 93,
8090 CONTROL: 17,
8191 DELETE: 46,
8292 DOWN: 40,
@@ -85,6 +95,7 @@
8696 HOME: 36,
8797 INSERT: 45,
8898 LEFT: 37,
 99+ MENU: 93, // COMMAND_RIGHT
89100 NUMPAD_ADD: 107,
90101 NUMPAD_DECIMAL: 110,
91102 NUMPAD_DIVIDE: 111,
@@ -98,64 +109,36 @@
99110 SHIFT: 16,
100111 SPACE: 32,
101112 TAB: 9,
102 - UP: 38
 113+ UP: 38,
 114+ WINDOWS: 91 // COMMAND
103115 }
104 -};
 116+});
105117
106 -// WAI-ARIA normalization
107 -if (isFF2) {
108 - var attr = $.attr,
109 - removeAttr = $.fn.removeAttr,
110 - ariaNS = "http://www.w3.org/2005/07/aaa",
111 - ariaState = /^aria-/,
112 - ariaRole = /^wairole:/;
113 -
114 - $.attr = function(elem, name, value) {
115 - var set = value !== undefined;
116 -
117 - return (name == 'role'
118 - ? (set
119 - ? attr.call(this, elem, name, "wairole:" + value)
120 - : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
121 - : (ariaState.test(name)
122 - ? (set
123 - ? elem.setAttributeNS(ariaNS,
124 - name.replace(ariaState, "aaa:"), value)
125 - : attr.call(this, elem, name.replace(ariaState, "aaa:")))
126 - : attr.apply(this, arguments)));
127 - };
128 -
129 - $.fn.removeAttr = function(name) {
130 - return (ariaState.test(name)
131 - ? this.each(function() {
132 - this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
133 - }) : removeAttr.call(this, name));
134 - };
135 -}
136 -
137118 //jQuery plugins
138119 $.fn.extend({
139 - remove: function() {
140 - // Safari has a native remove event which actually removes DOM elements,
141 - // so we have to use triggerHandler instead of trigger (#3037).
142 - $("*", this).add(this).each(function() {
143 - $(this).triggerHandler("remove");
144 - });
145 - return _remove.apply(this, arguments );
 120+ _focus: $.fn.focus,
 121+ focus: function(delay, fn) {
 122+ return typeof delay === 'number'
 123+ ? this.each(function() {
 124+ var elem = this;
 125+ setTimeout(function() {
 126+ $(elem).focus();
 127+ (fn && fn.call(elem));
 128+ }, delay);
 129+ })
 130+ : this._focus.apply(this, arguments);
146131 },
147 -
 132+
148133 enableSelection: function() {
149134 return this
150135 .attr('unselectable', 'off')
151 - .css('MozUserSelect', '')
152 - .unbind('selectstart.ui');
 136+ .css('MozUserSelect', '');
153137 },
154138
155139 disableSelection: function() {
156140 return this
157141 .attr('unselectable', 'on')
158 - .css('MozUserSelect', 'none')
159 - .bind('selectstart.ui', function() { return false; });
 142+ .css('MozUserSelect', 'none');
160143 },
161144
162145 scrollParent: function() {
@@ -171,6 +154,36 @@
172155 }
173156
174157 return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
 158+ },
 159+
 160+ zIndex: function(zIndex) {
 161+ if (zIndex !== undefined) {
 162+ return this.css('zIndex', zIndex);
 163+ }
 164+
 165+ if (this.length) {
 166+ var elem = $(this[0]), position, value;
 167+ while (elem.length && elem[0] !== document) {
 168+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
 169+ // This makes behavior of this function consistent across browsers
 170+ // WebKit always returns auto if the element is positioned
 171+ position = elem.css('position');
 172+ if (position == 'absolute' || position == 'relative' || position == 'fixed')
 173+ {
 174+ // IE returns 0 when zIndex is not specified
 175+ // other browsers return a string
 176+ // we ignore the case of nested elements with an explicit value of 0
 177+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
 178+ value = parseInt(elem.css('zIndex'));
 179+ if (!isNaN(value) && value != 0) {
 180+ return value;
 181+ }
 182+ }
 183+ elem = elem.parent();
 184+ }
 185+ }
 186+
 187+ return 0;
175188 }
176189 });
177190
@@ -200,340 +213,1450 @@
201214 }
202215 });
203216
 217+})(jQuery);
 218+/*!
 219+ * jQuery UI Widget 1.8.2
 220+ *
 221+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 222+ * Dual licensed under the MIT (MIT-LICENSE.txt)
 223+ * and GPL (GPL-LICENSE.txt) licenses.
 224+ *
 225+ * http://docs.jquery.com/UI/Widget
 226+ */
 227+(function( $ ) {
204228
205 -// $.widget is a factory to create jQuery plugins
206 -// taking some boilerplate code out of the plugin code
207 -function getter(namespace, plugin, method, args) {
208 - function getMethods(type) {
209 - var methods = $[namespace][plugin][type] || [];
210 - return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
211 - }
 229+var _remove = $.fn.remove;
212230
213 - var methods = getMethods('getter');
214 - if (args.length == 1 && typeof args[0] == 'string') {
215 - methods = methods.concat(getMethods('getterSetter'));
216 - }
217 - return ($.inArray(method, methods) != -1);
218 -}
 231+$.fn.remove = function( selector, keepData ) {
 232+ return this.each(function() {
 233+ if ( !keepData ) {
 234+ if ( !selector || $.filter( selector, [ this ] ).length ) {
 235+ $( "*", this ).add( this ).each(function() {
 236+ $( this ).triggerHandler( "remove" );
 237+ });
 238+ }
 239+ }
 240+ return _remove.call( $(this), selector, keepData );
 241+ });
 242+};
219243
220 -$.widget = function(name, prototype) {
221 - var namespace = name.split(".")[0];
222 - name = name.split(".")[1];
 244+$.widget = function( name, base, prototype ) {
 245+ var namespace = name.split( "." )[ 0 ],
 246+ fullName;
 247+ name = name.split( "." )[ 1 ];
 248+ fullName = namespace + "-" + name;
223249
224 - // create plugin method
225 - $.fn[name] = function(options) {
226 - var isMethodCall = (typeof options == 'string'),
227 - args = Array.prototype.slice.call(arguments, 1);
 250+ if ( !prototype ) {
 251+ prototype = base;
 252+ base = $.Widget;
 253+ }
228254
229 - // prevent calls to internal methods
230 - if (isMethodCall && options.substring(0, 1) == '_') {
231 - return this;
232 - }
 255+ // create selector for plugin
 256+ $.expr[ ":" ][ fullName ] = function( elem ) {
 257+ return !!$.data( elem, name );
 258+ };
233259
234 - // handle getter methods
235 - if (isMethodCall && getter(namespace, name, options, args)) {
236 - var instance = $.data(this[0], name);
237 - return (instance ? instance[options].apply(instance, args)
238 - : undefined);
 260+ $[ namespace ] = $[ namespace ] || {};
 261+ $[ namespace ][ name ] = function( options, element ) {
 262+ // allow instantiation without initializing for simple inheritance
 263+ if ( arguments.length ) {
 264+ this._createWidget( options, element );
239265 }
 266+ };
240267
241 - // handle initialization and non-getter methods
242 - return this.each(function() {
243 - var instance = $.data(this, name);
 268+ var basePrototype = new base();
 269+ // we need to make the options hash a property directly on the new instance
 270+ // otherwise we'll modify the options hash on the prototype that we're
 271+ // inheriting from
 272+// $.each( basePrototype, function( key, val ) {
 273+// if ( $.isPlainObject(val) ) {
 274+// basePrototype[ key ] = $.extend( {}, val );
 275+// }
 276+// });
 277+ basePrototype.options = $.extend( {}, basePrototype.options );
 278+ $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
 279+ namespace: namespace,
 280+ widgetName: name,
 281+ widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
 282+ widgetBaseClass: fullName
 283+ }, prototype );
244284
245 - // constructor
246 - (!instance && !isMethodCall &&
247 - $.data(this, name, new $[namespace][name](this, options))._init());
 285+ $.widget.bridge( name, $[ namespace ][ name ] );
 286+};
248287
249 - // method call
250 - (instance && isMethodCall && $.isFunction(instance[options]) &&
251 - instance[options].apply(instance, args));
252 - });
253 - };
 288+$.widget.bridge = function( name, object ) {
 289+ $.fn[ name ] = function( options ) {
 290+ var isMethodCall = typeof options === "string",
 291+ args = Array.prototype.slice.call( arguments, 1 ),
 292+ returnValue = this;
254293
255 - // create widget constructor
256 - $[namespace] = $[namespace] || {};
257 - $[namespace][name] = function(element, options) {
258 - var self = this;
 294+ // allow multiple hashes to be passed on init
 295+ options = !isMethodCall && args.length ?
 296+ $.extend.apply( null, [ true, options ].concat(args) ) :
 297+ options;
259298
260 - this.namespace = namespace;
261 - this.widgetName = name;
262 - this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
263 - this.widgetBaseClass = namespace + '-' + name;
 299+ // prevent calls to internal methods
 300+ if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
 301+ return returnValue;
 302+ }
264303
265 - this.options = $.extend({},
266 - $.widget.defaults,
267 - $[namespace][name].defaults,
268 - $.metadata && $.metadata.get(element)[name],
269 - options);
270 -
271 - this.element = $(element)
272 - .bind('setData.' + name, function(event, key, value) {
273 - if (event.target == element) {
274 - return self._setData(key, value);
 304+ if ( isMethodCall ) {
 305+ this.each(function() {
 306+ var instance = $.data( this, name ),
 307+ methodValue = instance && $.isFunction( instance[options] ) ?
 308+ instance[ options ].apply( instance, args ) :
 309+ instance;
 310+ if ( methodValue !== instance && methodValue !== undefined ) {
 311+ returnValue = methodValue;
 312+ return false;
275313 }
276 - })
277 - .bind('getData.' + name, function(event, key) {
278 - if (event.target == element) {
279 - return self._getData(key);
 314+ });
 315+ } else {
 316+ this.each(function() {
 317+ var instance = $.data( this, name );
 318+ if ( instance ) {
 319+ if ( options ) {
 320+ instance.option( options );
 321+ }
 322+ instance._init();
 323+ } else {
 324+ $.data( this, name, new object( options, this ) );
280325 }
281 - })
282 - .bind('remove', function() {
283 - return self.destroy();
284326 });
 327+ }
 328+
 329+ return returnValue;
285330 };
 331+};
286332
287 - // add widget prototype
288 - $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
289 -
290 - // TODO: merge getter and getterSetter properties from widget prototype
291 - // and plugin prototype
292 - $[namespace][name].getterSetter = 'option';
 333+$.Widget = function( options, element ) {
 334+ // allow instantiation without initializing for simple inheritance
 335+ if ( arguments.length ) {
 336+ this._createWidget( options, element );
 337+ }
293338 };
294339
295 -$.widget.prototype = {
 340+$.Widget.prototype = {
 341+ widgetName: "widget",
 342+ widgetEventPrefix: "",
 343+ options: {
 344+ disabled: false
 345+ },
 346+ _createWidget: function( options, element ) {
 347+ // $.widget.bridge stores the plugin instance, but we do it anyway
 348+ // so that it's stored even before the _create function runs
 349+ this.element = $( element ).data( this.widgetName, this );
 350+ this.options = $.extend( true, {},
 351+ this.options,
 352+ $.metadata && $.metadata.get( element )[ this.widgetName ],
 353+ options );
 354+
 355+ var self = this;
 356+ this.element.bind( "remove." + this.widgetName, function() {
 357+ self.destroy();
 358+ });
 359+
 360+ this._create();
 361+ this._init();
 362+ },
 363+ _create: function() {},
296364 _init: function() {},
 365+
297366 destroy: function() {
298 - this.element.removeData(this.widgetName)
299 - .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
300 - .removeAttr('aria-disabled');
 367+ this.element
 368+ .unbind( "." + this.widgetName )
 369+ .removeData( this.widgetName );
 370+ this.widget()
 371+ .unbind( "." + this.widgetName )
 372+ .removeAttr( "aria-disabled" )
 373+ .removeClass(
 374+ this.widgetBaseClass + "-disabled " +
 375+ "ui-state-disabled" );
301376 },
302377
303 - option: function(key, value) {
 378+ widget: function() {
 379+ return this.element;
 380+ },
 381+
 382+ option: function( key, value ) {
304383 var options = key,
305384 self = this;
306385
307 - if (typeof key == "string") {
308 - if (value === undefined) {
309 - return this._getData(key);
 386+ if ( arguments.length === 0 ) {
 387+ // don't return a reference to the internal hash
 388+ return $.extend( {}, self.options );
 389+ }
 390+
 391+ if (typeof key === "string" ) {
 392+ if ( value === undefined ) {
 393+ return this.options[ key ];
310394 }
311395 options = {};
312 - options[key] = value;
 396+ options[ key ] = value;
313397 }
314398
315 - $.each(options, function(key, value) {
316 - self._setData(key, value);
 399+ $.each( options, function( key, value ) {
 400+ self._setOption( key, value );
317401 });
 402+
 403+ return self;
318404 },
319 - _getData: function(key) {
320 - return this.options[key];
321 - },
322 - _setData: function(key, value) {
323 - this.options[key] = value;
 405+ _setOption: function( key, value ) {
 406+ this.options[ key ] = value;
324407
325 - if (key == 'disabled') {
326 - this.element
327 - [value ? 'addClass' : 'removeClass'](
328 - this.widgetBaseClass + '-disabled' + ' ' +
329 - this.namespace + '-state-disabled')
330 - .attr("aria-disabled", value);
 408+ if ( key === "disabled" ) {
 409+ this.widget()
 410+ [ value ? "addClass" : "removeClass"](
 411+ this.widgetBaseClass + "-disabled" + " " +
 412+ "ui-state-disabled" )
 413+ .attr( "aria-disabled", value );
331414 }
 415+
 416+ return this;
332417 },
333418
334419 enable: function() {
335 - this._setData('disabled', false);
 420+ return this._setOption( "disabled", false );
336421 },
337422 disable: function() {
338 - this._setData('disabled', true);
 423+ return this._setOption( "disabled", true );
339424 },
340425
341 - _trigger: function(type, event, data) {
342 - var callback = this.options[type],
343 - eventName = (type == this.widgetEventPrefix
344 - ? type : this.widgetEventPrefix + type);
 426+ _trigger: function( type, event, data ) {
 427+ var callback = this.options[ type ];
345428
346 - event = $.Event(event);
347 - event.type = eventName;
 429+ event = $.Event( event );
 430+ event.type = ( type === this.widgetEventPrefix ?
 431+ type :
 432+ this.widgetEventPrefix + type ).toLowerCase();
 433+ data = data || {};
348434
349435 // copy original event properties over to the new event
350436 // this would happen if we could call $.event.fix instead of $.Event
351437 // but we don't have a way to force an event to be fixed multiple times
352 - if (event.originalEvent) {
353 - for (var i = $.event.props.length, prop; i;) {
354 - prop = $.event.props[--i];
355 - event[prop] = event.originalEvent[prop];
 438+ if ( event.originalEvent ) {
 439+ for ( var i = $.event.props.length, prop; i; ) {
 440+ prop = $.event.props[ --i ];
 441+ event[ prop ] = event.originalEvent[ prop ];
356442 }
357443 }
358444
359 - this.element.trigger(event, data);
 445+ this.element.trigger( event, data );
360446
361 - return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
362 - || event.isDefaultPrevented());
 447+ return !( $.isFunction(callback) &&
 448+ callback.call( this.element[0], event, data ) === false ||
 449+ event.isDefaultPrevented() );
363450 }
364451 };
365452
366 -$.widget.defaults = {
367 - disabled: false
368 -};
 453+})( jQuery );
 454+/*
 455+ * jQuery UI Button 1.8.2
 456+ *
 457+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 458+ * Dual licensed under the MIT (MIT-LICENSE.txt)
 459+ * and GPL (GPL-LICENSE.txt) licenses.
 460+ *
 461+ * http://docs.jquery.com/UI/Button
 462+ *
 463+ * Depends:
 464+ * jquery.ui.core.js
 465+ * jquery.ui.widget.js
 466+ */
 467+(function( $ ) {
369468
 469+var lastActive,
 470+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
 471+ stateClasses = "ui-state-hover ui-state-active ",
 472+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",
 473+ formResetHandler = function( event ) {
 474+ $( ":ui-button", event.target.form ).each(function() {
 475+ var inst = $( this ).data( "button" );
 476+ setTimeout(function() {
 477+ inst.refresh();
 478+ }, 1 );
 479+ });
 480+ },
 481+ radioGroup = function( radio ) {
 482+ var name = radio.name,
 483+ form = radio.form,
 484+ radios = $( [] );
 485+ if ( name ) {
 486+ if ( form ) {
 487+ radios = $( form ).find( "[name='" + name + "']" );
 488+ } else {
 489+ radios = $( "[name='" + name + "']", radio.ownerDocument )
 490+ .filter(function() {
 491+ return !this.form;
 492+ });
 493+ }
 494+ }
 495+ return radios;
 496+ };
370497
371 -/** Mouse Interaction Plugin **/
 498+$.widget( "ui.button", {
 499+ options: {
 500+ text: true,
 501+ label: null,
 502+ icons: {
 503+ primary: null,
 504+ secondary: null
 505+ }
 506+ },
 507+ _create: function() {
 508+ this.element.closest( "form" )
 509+ .unbind( "reset.button" )
 510+ .bind( "reset.button", formResetHandler );
372511
373 -$.ui.mouse = {
374 - _mouseInit: function() {
375 - var self = this;
 512+ this._determineButtonType();
 513+ this.hasTitle = !!this.buttonElement.attr( "title" );
376514
 515+ var self = this,
 516+ options = this.options,
 517+ toggleButton = this.type === "checkbox" || this.type === "radio",
 518+ hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
 519+ focusClass = "ui-state-focus";
 520+
 521+ if ( options.label === null ) {
 522+ options.label = this.buttonElement.html();
 523+ }
 524+
 525+ if ( this.element.is( ":disabled" ) ) {
 526+ options.disabled = true;
 527+ }
 528+
 529+ this.buttonElement
 530+ .addClass( baseClasses )
 531+ .attr( "role", "button" )
 532+ .bind( "mouseenter.button", function() {
 533+ if ( options.disabled ) {
 534+ return;
 535+ }
 536+ $( this ).addClass( "ui-state-hover" );
 537+ if ( this === lastActive ) {
 538+ $( this ).addClass( "ui-state-active" );
 539+ }
 540+ })
 541+ .bind( "mouseleave.button", function() {
 542+ if ( options.disabled ) {
 543+ return;
 544+ }
 545+ $( this ).removeClass( hoverClass );
 546+ })
 547+ .bind( "focus.button", function() {
 548+ // no need to check disabled, focus won't be triggered anyway
 549+ $( this ).addClass( focusClass );
 550+ })
 551+ .bind( "blur.button", function() {
 552+ $( this ).removeClass( focusClass );
 553+ });
 554+
 555+ if ( toggleButton ) {
 556+ this.element.bind( "change.button", function() {
 557+ self.refresh();
 558+ });
 559+ }
 560+
 561+ if ( this.type === "checkbox" ) {
 562+ this.buttonElement.bind( "click.button", function() {
 563+ if ( options.disabled ) {
 564+ return false;
 565+ }
 566+ $( this ).toggleClass( "ui-state-active" );
 567+ self.buttonElement.attr( "aria-pressed", self.element[0].checked );
 568+ });
 569+ } else if ( this.type === "radio" ) {
 570+ this.buttonElement.bind( "click.button", function() {
 571+ if ( options.disabled ) {
 572+ return false;
 573+ }
 574+ $( this ).addClass( "ui-state-active" );
 575+ self.buttonElement.attr( "aria-pressed", true );
 576+
 577+ var radio = self.element[ 0 ];
 578+ radioGroup( radio )
 579+ .not( radio )
 580+ .map(function() {
 581+ return $( this ).button( "widget" )[ 0 ];
 582+ })
 583+ .removeClass( "ui-state-active" )
 584+ .attr( "aria-pressed", false );
 585+ });
 586+ } else {
 587+ this.buttonElement
 588+ .bind( "mousedown.button", function() {
 589+ if ( options.disabled ) {
 590+ return false;
 591+ }
 592+ $( this ).addClass( "ui-state-active" );
 593+ lastActive = this;
 594+ $( document ).one( "mouseup", function() {
 595+ lastActive = null;
 596+ });
 597+ })
 598+ .bind( "mouseup.button", function() {
 599+ if ( options.disabled ) {
 600+ return false;
 601+ }
 602+ $( this ).removeClass( "ui-state-active" );
 603+ })
 604+ .bind( "keydown.button", function(event) {
 605+ if ( options.disabled ) {
 606+ return false;
 607+ }
 608+ if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
 609+ $( this ).addClass( "ui-state-active" );
 610+ }
 611+ })
 612+ .bind( "keyup.button", function() {
 613+ $( this ).removeClass( "ui-state-active" );
 614+ });
 615+
 616+ if ( this.buttonElement.is("a") ) {
 617+ this.buttonElement.keyup(function(event) {
 618+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
 619+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
 620+ $( this ).click();
 621+ }
 622+ });
 623+ }
 624+ }
 625+
 626+ // TODO: pull out $.Widget's handling for the disabled option into
 627+ // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
 628+ // be overridden by individual plugins
 629+ this._setOption( "disabled", options.disabled );
 630+ },
 631+
 632+ _determineButtonType: function() {
 633+
 634+ if ( this.element.is(":checkbox") ) {
 635+ this.type = "checkbox";
 636+ } else {
 637+ if ( this.element.is(":radio") ) {
 638+ this.type = "radio";
 639+ } else {
 640+ if ( this.element.is("input") ) {
 641+ this.type = "input";
 642+ } else {
 643+ this.type = "button";
 644+ }
 645+ }
 646+ }
 647+
 648+ if ( this.type === "checkbox" || this.type === "radio" ) {
 649+ // we don't search against the document in case the element
 650+ // is disconnected from the DOM
 651+ this.buttonElement = this.element.parents().last()
 652+ .find( "[for=" + this.element.attr("id") + "]" );
 653+ this.element.addClass( "ui-helper-hidden-accessible" );
 654+
 655+ var checked = this.element.is( ":checked" );
 656+ if ( checked ) {
 657+ this.buttonElement.addClass( "ui-state-active" );
 658+ }
 659+ this.buttonElement.attr( "aria-pressed", checked );
 660+ } else {
 661+ this.buttonElement = this.element;
 662+ }
 663+ },
 664+
 665+ widget: function() {
 666+ return this.buttonElement;
 667+ },
 668+
 669+ destroy: function() {
377670 this.element
378 - .bind('mousedown.'+this.widgetName, function(event) {
379 - return self._mouseDown(event);
 671+ .removeClass( "ui-helper-hidden-accessible" );
 672+ this.buttonElement
 673+ .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
 674+ .removeAttr( "role" )
 675+ .removeAttr( "aria-pressed" )
 676+ .html( this.buttonElement.find(".ui-button-text").html() );
 677+
 678+ if ( !this.hasTitle ) {
 679+ this.buttonElement.removeAttr( "title" );
 680+ }
 681+
 682+ $.Widget.prototype.destroy.call( this );
 683+ },
 684+
 685+ _setOption: function( key, value ) {
 686+ $.Widget.prototype._setOption.apply( this, arguments );
 687+ if ( key === "disabled" ) {
 688+ if ( value ) {
 689+ this.element.attr( "disabled", true );
 690+ } else {
 691+ this.element.removeAttr( "disabled" );
 692+ }
 693+ }
 694+ this._resetButton();
 695+ },
 696+
 697+ refresh: function() {
 698+ var isDisabled = this.element.is( ":disabled" );
 699+ if ( isDisabled !== this.options.disabled ) {
 700+ this._setOption( "disabled", isDisabled );
 701+ }
 702+ if ( this.type === "radio" ) {
 703+ radioGroup( this.element[0] ).each(function() {
 704+ if ( $( this ).is( ":checked" ) ) {
 705+ $( this ).button( "widget" )
 706+ .addClass( "ui-state-active" )
 707+ .attr( "aria-pressed", true );
 708+ } else {
 709+ $( this ).button( "widget" )
 710+ .removeClass( "ui-state-active" )
 711+ .attr( "aria-pressed", false );
 712+ }
 713+ });
 714+ } else if ( this.type === "checkbox" ) {
 715+ if ( this.element.is( ":checked" ) ) {
 716+ this.buttonElement
 717+ .addClass( "ui-state-active" )
 718+ .attr( "aria-pressed", true );
 719+ } else {
 720+ this.buttonElement
 721+ .removeClass( "ui-state-active" )
 722+ .attr( "aria-pressed", false );
 723+ }
 724+ }
 725+ },
 726+
 727+ _resetButton: function() {
 728+ if ( this.type === "input" ) {
 729+ if ( this.options.label ) {
 730+ this.element.val( this.options.label );
 731+ }
 732+ return;
 733+ }
 734+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
 735+ buttonText = $( "<span></span>" )
 736+ .addClass( "ui-button-text" )
 737+ .html( this.options.label )
 738+ .appendTo( buttonElement.empty() )
 739+ .text(),
 740+ icons = this.options.icons,
 741+ multipleIcons = icons.primary && icons.secondary;
 742+ if ( icons.primary || icons.secondary ) {
 743+ buttonElement.addClass( "ui-button-text-icon" +
 744+ ( multipleIcons ? "s" : "" ) );
 745+ if ( icons.primary ) {
 746+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
 747+ }
 748+ if ( icons.secondary ) {
 749+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
 750+ }
 751+ if ( !this.options.text ) {
 752+ buttonElement
 753+ .addClass( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" )
 754+ .removeClass( "ui-button-text-icons ui-button-text-icon" );
 755+ if ( !this.hasTitle ) {
 756+ buttonElement.attr( "title", buttonText );
 757+ }
 758+ }
 759+ } else {
 760+ buttonElement.addClass( "ui-button-text-only" );
 761+ }
 762+ }
 763+});
 764+
 765+$.widget( "ui.buttonset", {
 766+ _create: function() {
 767+ this.element.addClass( "ui-buttonset" );
 768+ this._init();
 769+ },
 770+
 771+ _init: function() {
 772+ this.refresh();
 773+ },
 774+
 775+ _setOption: function( key, value ) {
 776+ if ( key === "disabled" ) {
 777+ this.buttons.button( "option", key, value );
 778+ }
 779+
 780+ $.Widget.prototype._setOption.apply( this, arguments );
 781+ },
 782+
 783+ refresh: function() {
 784+ this.buttons = this.element.find( ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" )
 785+ .filter( ":ui-button" )
 786+ .button( "refresh" )
 787+ .end()
 788+ .not( ":ui-button" )
 789+ .button()
 790+ .end()
 791+ .map(function() {
 792+ return $( this ).button( "widget" )[ 0 ];
380793 })
381 - .bind('click.'+this.widgetName, function(event) {
382 - if(self._preventClickEvent) {
383 - self._preventClickEvent = false;
384 - event.stopImmediatePropagation();
 794+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
 795+ .filter( ":first" )
 796+ .addClass( "ui-corner-left" )
 797+ .end()
 798+ .filter( ":last" )
 799+ .addClass( "ui-corner-right" )
 800+ .end()
 801+ .end();
 802+ },
 803+
 804+ destroy: function() {
 805+ this.element.removeClass( "ui-buttonset" );
 806+ this.buttons
 807+ .map(function() {
 808+ return $( this ).button( "widget" )[ 0 ];
 809+ })
 810+ .removeClass( "ui-corner-left ui-corner-right" )
 811+ .end()
 812+ .button( "destroy" );
 813+
 814+ $.Widget.prototype.destroy.call( this );
 815+ }
 816+});
 817+
 818+}( jQuery ) );
 819+/*
 820+ * jQuery UI Dialog 1.8.2
 821+ *
 822+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 823+ * Dual licensed under the MIT (MIT-LICENSE.txt)
 824+ * and GPL (GPL-LICENSE.txt) licenses.
 825+ *
 826+ * http://docs.jquery.com/UI/Dialog
 827+ *
 828+ * Depends:
 829+ * jquery.ui.core.js
 830+ * jquery.ui.widget.js
 831+ * jquery.ui.button.js
 832+ * jquery.ui.draggable.js
 833+ * jquery.ui.mouse.js
 834+ * jquery.ui.position.js
 835+ * jquery.ui.resizable.js
 836+ */
 837+(function($) {
 838+
 839+var uiDialogClasses =
 840+ 'ui-dialog ' +
 841+ 'ui-widget ' +
 842+ 'ui-widget-content ' +
 843+ 'ui-corner-all ';
 844+
 845+$.widget("ui.dialog", {
 846+ options: {
 847+ autoOpen: true,
 848+ buttons: {},
 849+ closeOnEscape: true,
 850+ closeText: 'close',
 851+ dialogClass: '',
 852+ draggable: true,
 853+ hide: null,
 854+ height: 'auto',
 855+ maxHeight: false,
 856+ maxWidth: false,
 857+ minHeight: 150,
 858+ minWidth: 150,
 859+ modal: false,
 860+ position: 'center',
 861+ resizable: true,
 862+ show: null,
 863+ stack: true,
 864+ title: '',
 865+ width: 300,
 866+ zIndex: 1000
 867+ },
 868+ _create: function() {
 869+ this.originalTitle = this.element.attr('title');
 870+
 871+ var self = this,
 872+ options = self.options,
 873+
 874+ title = options.title || self.originalTitle || '&#160;',
 875+ titleId = $.ui.dialog.getTitleId(self.element),
 876+
 877+ uiDialog = (self.uiDialog = $('<div></div>'))
 878+ .appendTo(document.body)
 879+ .hide()
 880+ .addClass(uiDialogClasses + options.dialogClass)
 881+ .css({
 882+ zIndex: options.zIndex
 883+ })
 884+ // setting tabIndex makes the div focusable
 885+ // setting outline to 0 prevents a border on focus in Mozilla
 886+ .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
 887+ if (options.closeOnEscape && event.keyCode &&
 888+ event.keyCode === $.ui.keyCode.ESCAPE) {
 889+
 890+ self.close(event);
 891+ event.preventDefault();
 892+ }
 893+ })
 894+ .attr({
 895+ role: 'dialog',
 896+ 'aria-labelledby': titleId
 897+ })
 898+ .mousedown(function(event) {
 899+ self.moveToTop(false, event);
 900+ }),
 901+
 902+ uiDialogContent = self.element
 903+ .show()
 904+ .removeAttr('title')
 905+ .addClass(
 906+ 'ui-dialog-content ' +
 907+ 'ui-widget-content')
 908+ .appendTo(uiDialog),
 909+
 910+ uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>'))
 911+ .addClass(
 912+ 'ui-dialog-titlebar ' +
 913+ 'ui-widget-header ' +
 914+ 'ui-corner-all ' +
 915+ 'ui-helper-clearfix'
 916+ )
 917+ .prependTo(uiDialog),
 918+
 919+ uiDialogTitlebarClose = $('<a href="#"></a>')
 920+ .addClass(
 921+ 'ui-dialog-titlebar-close ' +
 922+ 'ui-corner-all'
 923+ )
 924+ .attr('role', 'button')
 925+ .hover(
 926+ function() {
 927+ uiDialogTitlebarClose.addClass('ui-state-hover');
 928+ },
 929+ function() {
 930+ uiDialogTitlebarClose.removeClass('ui-state-hover');
 931+ }
 932+ )
 933+ .focus(function() {
 934+ uiDialogTitlebarClose.addClass('ui-state-focus');
 935+ })
 936+ .blur(function() {
 937+ uiDialogTitlebarClose.removeClass('ui-state-focus');
 938+ })
 939+ .click(function(event) {
 940+ self.close(event);
385941 return false;
 942+ })
 943+ .appendTo(uiDialogTitlebar),
 944+
 945+ uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>'))
 946+ .addClass(
 947+ 'ui-icon ' +
 948+ 'ui-icon-closethick'
 949+ )
 950+ .text(options.closeText)
 951+ .appendTo(uiDialogTitlebarClose),
 952+
 953+ uiDialogTitle = $('<span></span>')
 954+ .addClass('ui-dialog-title')
 955+ .attr('id', titleId)
 956+ .html(title)
 957+ .prependTo(uiDialogTitlebar);
 958+
 959+ //handling of deprecated beforeclose (vs beforeClose) option
 960+ //Ticket #4669 http://dev.jqueryui.com/ticket/4669
 961+ //TODO: remove in 1.9pre
 962+ if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
 963+ options.beforeClose = options.beforeclose;
 964+ }
 965+
 966+ uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
 967+
 968+ if (options.draggable && $.fn.draggable) {
 969+ self._makeDraggable();
 970+ }
 971+ if (options.resizable && $.fn.resizable) {
 972+ self._makeResizable();
 973+ }
 974+
 975+ self._createButtons(options.buttons);
 976+ self._isOpen = false;
 977+
 978+ if ($.fn.bgiframe) {
 979+ uiDialog.bgiframe();
 980+ }
 981+ },
 982+ _init: function() {
 983+ if ( this.options.autoOpen ) {
 984+ this.open();
 985+ }
 986+ },
 987+
 988+ destroy: function() {
 989+ var self = this;
 990+
 991+ if (self.overlay) {
 992+ self.overlay.destroy();
 993+ }
 994+ self.uiDialog.hide();
 995+ self.element
 996+ .unbind('.dialog')
 997+ .removeData('dialog')
 998+ .removeClass('ui-dialog-content ui-widget-content')
 999+ .hide().appendTo('body');
 1000+ self.uiDialog.remove();
 1001+
 1002+ if (self.originalTitle) {
 1003+ self.element.attr('title', self.originalTitle);
 1004+ }
 1005+
 1006+ return self;
 1007+ },
 1008+
 1009+ widget: function() {
 1010+ return this.uiDialog;
 1011+ },
 1012+
 1013+ close: function(event) {
 1014+ var self = this,
 1015+ maxZ;
 1016+
 1017+ if (false === self._trigger('beforeClose', event)) {
 1018+ return;
 1019+ }
 1020+
 1021+ if (self.overlay) {
 1022+ self.overlay.destroy();
 1023+ }
 1024+ self.uiDialog.unbind('keypress.ui-dialog');
 1025+
 1026+ self._isOpen = false;
 1027+
 1028+ if (self.options.hide) {
 1029+ self.uiDialog.hide(self.options.hide, function() {
 1030+ self._trigger('close', event);
 1031+ });
 1032+ } else {
 1033+ self.uiDialog.hide();
 1034+ self._trigger('close', event);
 1035+ }
 1036+
 1037+ $.ui.dialog.overlay.resize();
 1038+
 1039+ // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
 1040+ if (self.options.modal) {
 1041+ maxZ = 0;
 1042+ $('.ui-dialog').each(function() {
 1043+ if (this !== self.uiDialog[0]) {
 1044+ maxZ = Math.max(maxZ, $(this).css('z-index'));
3861045 }
3871046 });
 1047+ $.ui.dialog.maxZ = maxZ;
 1048+ }
3881049
389 - // Prevent text selection in IE
390 - if ($.browser.msie) {
391 - this._mouseUnselectable = this.element.attr('unselectable');
392 - this.element.attr('unselectable', 'on');
 1050+ return self;
 1051+ },
 1052+
 1053+ isOpen: function() {
 1054+ return this._isOpen;
 1055+ },
 1056+
 1057+ // the force parameter allows us to move modal dialogs to their correct
 1058+ // position on open
 1059+ moveToTop: function(force, event) {
 1060+ var self = this,
 1061+ options = self.options,
 1062+ saveScroll;
 1063+
 1064+ if ((options.modal && !force) ||
 1065+ (!options.stack && !options.modal)) {
 1066+ return self._trigger('focus', event);
3931067 }
 1068+
 1069+ if (options.zIndex > $.ui.dialog.maxZ) {
 1070+ $.ui.dialog.maxZ = options.zIndex;
 1071+ }
 1072+ if (self.overlay) {
 1073+ $.ui.dialog.maxZ += 1;
 1074+ self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);
 1075+ }
3941076
395 - this.started = false;
 1077+ //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
 1078+ // http://ui.jquery.com/bugs/ticket/3193
 1079+ saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') };
 1080+ $.ui.dialog.maxZ += 1;
 1081+ self.uiDialog.css('z-index', $.ui.dialog.maxZ);
 1082+ self.element.attr(saveScroll);
 1083+ self._trigger('focus', event);
 1084+
 1085+ return self;
3961086 },
3971087
398 - // TODO: make sure destroying one instance of mouse doesn't mess with
399 - // other instances of mouse
400 - _mouseDestroy: function() {
401 - this.element.unbind('.'+this.widgetName);
 1088+ open: function() {
 1089+ if (this._isOpen) { return; }
4021090
403 - // Restore text selection in IE
404 - ($.browser.msie
405 - && this.element.attr('unselectable', this._mouseUnselectable));
 1091+ var self = this,
 1092+ options = self.options,
 1093+ uiDialog = self.uiDialog;
 1094+
 1095+ self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
 1096+ if (uiDialog.next().length) {
 1097+ uiDialog.appendTo('body');
 1098+ }
 1099+ self._size();
 1100+ self._position(options.position);
 1101+ uiDialog.show(options.show);
 1102+ self.moveToTop(true);
 1103+
 1104+ // prevent tabbing out of modal dialogs
 1105+ if (options.modal) {
 1106+ uiDialog.bind('keypress.ui-dialog', function(event) {
 1107+ if (event.keyCode !== $.ui.keyCode.TAB) {
 1108+ return;
 1109+ }
 1110+
 1111+ var tabbables = $(':tabbable', this),
 1112+ first = tabbables.filter(':first'),
 1113+ last = tabbables.filter(':last');
 1114+
 1115+ if (event.target === last[0] && !event.shiftKey) {
 1116+ first.focus(1);
 1117+ return false;
 1118+ } else if (event.target === first[0] && event.shiftKey) {
 1119+ last.focus(1);
 1120+ return false;
 1121+ }
 1122+ });
 1123+ }
 1124+
 1125+ // set focus to the first tabbable element in the content area or the first button
 1126+ // if there are no tabbable elements, set focus on the dialog itself
 1127+ $([])
 1128+ .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
 1129+ .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
 1130+ .add(uiDialog)
 1131+ .filter(':first')
 1132+ .focus();
 1133+
 1134+ self._trigger('open');
 1135+ self._isOpen = true;
 1136+
 1137+ return self;
4061138 },
4071139
408 - _mouseDown: function(event) {
409 - // don't let more than one widget handle mouseStart
410 - // TODO: figure out why we have to use originalEvent
411 - event.originalEvent = event.originalEvent || {};
412 - if (event.originalEvent.mouseHandled) { return; }
 1140+ _createButtons: function(buttons) {
 1141+ var self = this,
 1142+ hasButtons = false,
 1143+ uiDialogButtonPane = $('<div></div>')
 1144+ .addClass(
 1145+ 'ui-dialog-buttonpane ' +
 1146+ 'ui-widget-content ' +
 1147+ 'ui-helper-clearfix'
 1148+ );
4131149
414 - // we may have missed mouseup (out of window)
415 - (this._mouseStarted && this._mouseUp(event));
 1150+ // if we already have a button pane, remove it
 1151+ self.uiDialog.find('.ui-dialog-buttonpane').remove();
4161152
417 - this._mouseDownEvent = event;
 1153+ if (typeof buttons === 'object' && buttons !== null) {
 1154+ $.each(buttons, function() {
 1155+ return !(hasButtons = true);
 1156+ });
 1157+ }
 1158+ if (hasButtons) {
 1159+ $.each(buttons, function(name, fn) {
 1160+ var button = $('<button type="button"></button>')
 1161+ .text(name)
 1162+ .click(function() { fn.apply(self.element[0], arguments); })
 1163+ .appendTo(uiDialogButtonPane);
 1164+ if ($.fn.button) {
 1165+ button.button();
 1166+ }
 1167+ });
 1168+ uiDialogButtonPane.appendTo(self.uiDialog);
 1169+ }
 1170+ },
4181171
 1172+ _makeDraggable: function() {
4191173 var self = this,
420 - btnIsLeft = (event.which == 1),
421 - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
422 - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
423 - return true;
 1174+ options = self.options,
 1175+ doc = $(document),
 1176+ heightBeforeDrag;
 1177+
 1178+ function filteredUi(ui) {
 1179+ return {
 1180+ position: ui.position,
 1181+ offset: ui.offset
 1182+ };
4241183 }
4251184
426 - this.mouseDelayMet = !this.options.delay;
427 - if (!this.mouseDelayMet) {
428 - this._mouseDelayTimer = setTimeout(function() {
429 - self.mouseDelayMet = true;
430 - }, this.options.delay);
 1185+ self.uiDialog.draggable({
 1186+ cancel: '.ui-dialog-content, .ui-dialog-titlebar-close',
 1187+ handle: '.ui-dialog-titlebar',
 1188+ containment: 'document',
 1189+ start: function(event, ui) {
 1190+ heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height();
 1191+ $(this).height($(this).height()).addClass("ui-dialog-dragging");
 1192+ self._trigger('dragStart', event, filteredUi(ui));
 1193+ },
 1194+ drag: function(event, ui) {
 1195+ self._trigger('drag', event, filteredUi(ui));
 1196+ },
 1197+ stop: function(event, ui) {
 1198+ options.position = [ui.position.left - doc.scrollLeft(),
 1199+ ui.position.top - doc.scrollTop()];
 1200+ $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
 1201+ self._trigger('dragStop', event, filteredUi(ui));
 1202+ $.ui.dialog.overlay.resize();
 1203+ }
 1204+ });
 1205+ },
 1206+
 1207+ _makeResizable: function(handles) {
 1208+ handles = (handles === undefined ? this.options.resizable : handles);
 1209+ var self = this,
 1210+ options = self.options,
 1211+ // .ui-resizable has position: relative defined in the stylesheet
 1212+ // but dialogs have to use absolute or fixed positioning
 1213+ position = self.uiDialog.css('position'),
 1214+ resizeHandles = (typeof handles === 'string' ?
 1215+ handles :
 1216+ 'n,e,s,w,se,sw,ne,nw'
 1217+ );
 1218+
 1219+ function filteredUi(ui) {
 1220+ return {
 1221+ originalPosition: ui.originalPosition,
 1222+ originalSize: ui.originalSize,
 1223+ position: ui.position,
 1224+ size: ui.size
 1225+ };
4311226 }
4321227
433 - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
434 - this._mouseStarted = (this._mouseStart(event) !== false);
435 - if (!this._mouseStarted) {
436 - event.preventDefault();
437 - return true;
 1228+ self.uiDialog.resizable({
 1229+ cancel: '.ui-dialog-content',
 1230+ containment: 'document',
 1231+ alsoResize: self.element,
 1232+ maxWidth: options.maxWidth,
 1233+ maxHeight: options.maxHeight,
 1234+ minWidth: options.minWidth,
 1235+ minHeight: self._minHeight(),
 1236+ handles: resizeHandles,
 1237+ start: function(event, ui) {
 1238+ $(this).addClass("ui-dialog-resizing");
 1239+ self._trigger('resizeStart', event, filteredUi(ui));
 1240+ },
 1241+ resize: function(event, ui) {
 1242+ self._trigger('resize', event, filteredUi(ui));
 1243+ },
 1244+ stop: function(event, ui) {
 1245+ $(this).removeClass("ui-dialog-resizing");
 1246+ options.height = $(this).height();
 1247+ options.width = $(this).width();
 1248+ self._trigger('resizeStop', event, filteredUi(ui));
 1249+ $.ui.dialog.overlay.resize();
4381250 }
 1251+ })
 1252+ .css('position', position)
 1253+ .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
 1254+ },
 1255+
 1256+ _minHeight: function() {
 1257+ var options = this.options;
 1258+
 1259+ if (options.height === 'auto') {
 1260+ return options.minHeight;
 1261+ } else {
 1262+ return Math.min(options.minHeight, options.height);
4391263 }
 1264+ },
4401265
441 - // these delegates are required to keep context
442 - this._mouseMoveDelegate = function(event) {
443 - return self._mouseMove(event);
444 - };
445 - this._mouseUpDelegate = function(event) {
446 - return self._mouseUp(event);
447 - };
448 - $(document)
449 - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
450 - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
 1266+ _position: function(position) {
 1267+ var myAt = [],
 1268+ offset = [0, 0],
 1269+ isVisible;
4511270
452 - // preventDefault() is used to prevent the selection of text here -
453 - // however, in Safari, this causes select boxes not to be selectable
454 - // anymore, so this fix is needed
455 - ($.browser.safari || event.preventDefault());
 1271+ position = position || $.ui.dialog.prototype.options.position;
4561272
457 - event.originalEvent.mouseHandled = true;
458 - return true;
 1273+ // deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
 1274+// if (typeof position == 'string' || $.isArray(position)) {
 1275+// myAt = $.isArray(position) ? position : position.split(' ');
 1276+
 1277+ if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) {
 1278+ myAt = position.split ? position.split(' ') : [position[0], position[1]];
 1279+ if (myAt.length === 1) {
 1280+ myAt[1] = myAt[0];
 1281+ }
 1282+
 1283+ $.each(['left', 'top'], function(i, offsetPosition) {
 1284+ if (+myAt[i] === myAt[i]) {
 1285+ offset[i] = myAt[i];
 1286+ myAt[i] = offsetPosition;
 1287+ }
 1288+ });
 1289+ } else if (typeof position === 'object') {
 1290+ if ('left' in position) {
 1291+ myAt[0] = 'left';
 1292+ offset[0] = position.left;
 1293+ } else if ('right' in position) {
 1294+ myAt[0] = 'right';
 1295+ offset[0] = -position.right;
 1296+ }
 1297+
 1298+ if ('top' in position) {
 1299+ myAt[1] = 'top';
 1300+ offset[1] = position.top;
 1301+ } else if ('bottom' in position) {
 1302+ myAt[1] = 'bottom';
 1303+ offset[1] = -position.bottom;
 1304+ }
 1305+ }
 1306+
 1307+ // need to show the dialog to get the actual offset in the position plugin
 1308+ isVisible = this.uiDialog.is(':visible');
 1309+ if (!isVisible) {
 1310+ this.uiDialog.show();
 1311+ }
 1312+ this.uiDialog
 1313+ // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
 1314+ .css({ top: 0, left: 0 })
 1315+ .position({
 1316+ my: myAt.join(' '),
 1317+ at: myAt.join(' '),
 1318+ offset: offset.join(' '),
 1319+ of: window,
 1320+ collision: 'fit',
 1321+ // ensure that the titlebar is never outside the document
 1322+ using: function(pos) {
 1323+ var topOffset = $(this).css(pos).offset().top;
 1324+ if (topOffset < 0) {
 1325+ $(this).css('top', pos.top - topOffset);
 1326+ }
 1327+ }
 1328+ });
 1329+ if (!isVisible) {
 1330+ this.uiDialog.hide();
 1331+ }
4591332 },
4601333
461 - _mouseMove: function(event) {
462 - // IE mouseup check - mouseup happened when mouse was out of window
463 - if ($.browser.msie && !event.button) {
464 - return this._mouseUp(event);
 1334+ _setOption: function(key, value){
 1335+ var self = this,
 1336+ uiDialog = self.uiDialog,
 1337+ isResizable = uiDialog.is(':data(resizable)'),
 1338+ resize = false;
 1339+
 1340+ switch (key) {
 1341+ //handling of deprecated beforeclose (vs beforeClose) option
 1342+ //Ticket #4669 http://dev.jqueryui.com/ticket/4669
 1343+ //TODO: remove in 1.9pre
 1344+ case "beforeclose":
 1345+ key = "beforeClose";
 1346+ break;
 1347+ case "buttons":
 1348+ self._createButtons(value);
 1349+ break;
 1350+ case "closeText":
 1351+ // convert whatever was passed in to a string, for text() to not throw up
 1352+ self.uiDialogTitlebarCloseText.text("" + value);
 1353+ break;
 1354+ case "dialogClass":
 1355+ uiDialog
 1356+ .removeClass(self.options.dialogClass)
 1357+ .addClass(uiDialogClasses + value);
 1358+ break;
 1359+ case "disabled":
 1360+ if (value) {
 1361+ uiDialog.addClass('ui-dialog-disabled');
 1362+ } else {
 1363+ uiDialog.removeClass('ui-dialog-disabled');
 1364+ }
 1365+ break;
 1366+ case "draggable":
 1367+ if (value) {
 1368+ self._makeDraggable();
 1369+ } else {
 1370+ uiDialog.draggable('destroy');
 1371+ }
 1372+ break;
 1373+ case "height":
 1374+ resize = true;
 1375+ break;
 1376+ case "maxHeight":
 1377+ if (isResizable) {
 1378+ uiDialog.resizable('option', 'maxHeight', value);
 1379+ }
 1380+ resize = true;
 1381+ break;
 1382+ case "maxWidth":
 1383+ if (isResizable) {
 1384+ uiDialog.resizable('option', 'maxWidth', value);
 1385+ }
 1386+ resize = true;
 1387+ break;
 1388+ case "minHeight":
 1389+ if (isResizable) {
 1390+ uiDialog.resizable('option', 'minHeight', value);
 1391+ }
 1392+ resize = true;
 1393+ break;
 1394+ case "minWidth":
 1395+ if (isResizable) {
 1396+ uiDialog.resizable('option', 'minWidth', value);
 1397+ }
 1398+ resize = true;
 1399+ break;
 1400+ case "position":
 1401+ self._position(value);
 1402+ break;
 1403+ case "resizable":
 1404+ // currently resizable, becoming non-resizable
 1405+ if (isResizable && !value) {
 1406+ uiDialog.resizable('destroy');
 1407+ }
 1408+
 1409+ // currently resizable, changing handles
 1410+ if (isResizable && typeof value === 'string') {
 1411+ uiDialog.resizable('option', 'handles', value);
 1412+ }
 1413+
 1414+ // currently non-resizable, becoming resizable
 1415+ if (!isResizable && value !== false) {
 1416+ self._makeResizable(value);
 1417+ }
 1418+ break;
 1419+ case "title":
 1420+ // convert whatever was passed in o a string, for html() to not throw up
 1421+ $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || '&#160;'));
 1422+ break;
 1423+ case "width":
 1424+ resize = true;
 1425+ break;
4651426 }
4661427
467 - if (this._mouseStarted) {
468 - this._mouseDrag(event);
469 - return event.preventDefault();
 1428+ $.Widget.prototype._setOption.apply(self, arguments);
 1429+ if (resize) {
 1430+ self._size();
4701431 }
 1432+ },
4711433
472 - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
473 - this._mouseStarted =
474 - (this._mouseStart(this._mouseDownEvent, event) !== false);
475 - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
 1434+ _size: function() {
 1435+ /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
 1436+ * divs will both have width and height set, so we need to reset them
 1437+ */
 1438+ var options = this.options,
 1439+ nonContentHeight;
 1440+
 1441+ // reset content sizing
 1442+ // hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
 1443+ this.element.css({
 1444+ width: 'auto',
 1445+ minHeight: 0,
 1446+ height: 0
 1447+ });
 1448+
 1449+ // reset wrapper sizing
 1450+ // determine the height of all the non-content elements
 1451+ nonContentHeight = this.uiDialog.css({
 1452+ height: 'auto',
 1453+ width: options.width
 1454+ })
 1455+ .height();
 1456+
 1457+ this.element
 1458+ .css(options.height === 'auto' ? {
 1459+ minHeight: Math.max(options.minHeight - nonContentHeight, 0),
 1460+ height: 'auto'
 1461+ } : {
 1462+ minHeight: 0,
 1463+ height: Math.max(options.height - nonContentHeight, 0)
 1464+ })
 1465+ .show();
 1466+
 1467+ if (this.uiDialog.is(':data(resizable)')) {
 1468+ this.uiDialog.resizable('option', 'minHeight', this._minHeight());
4761469 }
 1470+ }
 1471+});
4771472
478 - return !this._mouseStarted;
 1473+$.extend($.ui.dialog, {
 1474+ version: "1.8.2",
 1475+
 1476+ uuid: 0,
 1477+ maxZ: 0,
 1478+
 1479+ getTitleId: function($el) {
 1480+ var id = $el.attr('id');
 1481+ if (!id) {
 1482+ this.uuid += 1;
 1483+ id = this.uuid;
 1484+ }
 1485+ return 'ui-dialog-title-' + id;
4791486 },
4801487
481 - _mouseUp: function(event) {
482 - $(document)
483 - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
484 - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
 1488+ overlay: function(dialog) {
 1489+ this.$el = $.ui.dialog.overlay.create(dialog);
 1490+ }
 1491+});
4851492
486 - if (this._mouseStarted) {
487 - this._mouseStarted = false;
488 - this._preventClickEvent = (event.target == this._mouseDownEvent.target);
489 - this._mouseStop(event);
 1493+$.extend($.ui.dialog.overlay, {
 1494+ instances: [],
 1495+ // reuse old instances due to IE memory leak with alpha transparency (see #5185)
 1496+ oldInstances: [],
 1497+ maxZ: 0,
 1498+ events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
 1499+ function(event) { return event + '.dialog-overlay'; }).join(' '),
 1500+ create: function(dialog) {
 1501+ if (this.instances.length === 0) {
 1502+ // prevent use of anchors and inputs
 1503+ // we use a setTimeout in case the overlay is created from an
 1504+ // event that we're going to be cancelling (see #2804)
 1505+ setTimeout(function() {
 1506+ // handle $(el).dialog().dialog('close') (see #4065)
 1507+ if ($.ui.dialog.overlay.instances.length) {
 1508+ $(document).bind($.ui.dialog.overlay.events, function(event) {
 1509+ // stop events if the z-index of the target is < the z-index of the overlay
 1510+ return ($(event.target).zIndex() >= $.ui.dialog.overlay.maxZ);
 1511+ });
 1512+ }
 1513+ }, 1);
 1514+
 1515+ // allow closing by pressing the escape key
 1516+ $(document).bind('keydown.dialog-overlay', function(event) {
 1517+ if (dialog.options.closeOnEscape && event.keyCode &&
 1518+ event.keyCode === $.ui.keyCode.ESCAPE) {
 1519+
 1520+ dialog.close(event);
 1521+ event.preventDefault();
 1522+ }
 1523+ });
 1524+
 1525+ // handle window resize
 1526+ $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
4901527 }
4911528
492 - return false;
 1529+ var $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay'))
 1530+ .appendTo(document.body)
 1531+ .css({
 1532+ width: this.width(),
 1533+ height: this.height()
 1534+ });
 1535+
 1536+ if ($.fn.bgiframe) {
 1537+ $el.bgiframe();
 1538+ }
 1539+
 1540+ this.instances.push($el);
 1541+ return $el;
4931542 },
4941543
495 - _mouseDistanceMet: function(event) {
496 - return (Math.max(
497 - Math.abs(this._mouseDownEvent.pageX - event.pageX),
498 - Math.abs(this._mouseDownEvent.pageY - event.pageY)
499 - ) >= this.options.distance
500 - );
 1544+ destroy: function($el) {
 1545+ this.oldInstances.push(this.instances.splice($.inArray($el, this.instances), 1)[0]);
 1546+
 1547+ if (this.instances.length === 0) {
 1548+ $([document, window]).unbind('.dialog-overlay');
 1549+ }
 1550+
 1551+ $el.remove();
 1552+
 1553+ // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
 1554+ var maxZ = 0;
 1555+ $.each(this.instances, function() {
 1556+ maxZ = Math.max(maxZ, this.css('z-index'));
 1557+ });
 1558+ this.maxZ = maxZ;
5011559 },
5021560
503 - _mouseDelayMet: function(event) {
504 - return this.mouseDelayMet;
 1561+ height: function() {
 1562+ var scrollHeight,
 1563+ offsetHeight;
 1564+ // handle IE 6
 1565+ if ($.browser.msie && $.browser.version < 7) {
 1566+ scrollHeight = Math.max(
 1567+ document.documentElement.scrollHeight,
 1568+ document.body.scrollHeight
 1569+ );
 1570+ offsetHeight = Math.max(
 1571+ document.documentElement.offsetHeight,
 1572+ document.body.offsetHeight
 1573+ );
 1574+
 1575+ if (scrollHeight < offsetHeight) {
 1576+ return $(window).height() + 'px';
 1577+ } else {
 1578+ return scrollHeight + 'px';
 1579+ }
 1580+ // handle "good" browsers
 1581+ } else {
 1582+ return $(document).height() + 'px';
 1583+ }
5051584 },
5061585
507 - // These are placeholder methods, to be overriden by extending plugin
508 - _mouseStart: function(event) {},
509 - _mouseDrag: function(event) {},
510 - _mouseStop: function(event) {},
511 - _mouseCapture: function(event) { return true; }
512 -};
 1586+ width: function() {
 1587+ var scrollWidth,
 1588+ offsetWidth;
 1589+ // handle IE 6
 1590+ if ($.browser.msie && $.browser.version < 7) {
 1591+ scrollWidth = Math.max(
 1592+ document.documentElement.scrollWidth,
 1593+ document.body.scrollWidth
 1594+ );
 1595+ offsetWidth = Math.max(
 1596+ document.documentElement.offsetWidth,
 1597+ document.body.offsetWidth
 1598+ );
5131599
514 -$.ui.mouse.defaults = {
515 - cancel: null,
516 - distance: 1,
517 - delay: 0
518 -};
 1600+ if (scrollWidth < offsetWidth) {
 1601+ return $(window).width() + 'px';
 1602+ } else {
 1603+ return scrollWidth + 'px';
 1604+ }
 1605+ // handle "good" browsers
 1606+ } else {
 1607+ return $(document).width() + 'px';
 1608+ }
 1609+ },
5191610
520 -})(jQuery);/*
521 - * jQuery UI Datepicker 1.7.1
 1611+ resize: function() {
 1612+ /* If the dialog is draggable and the user drags it past the
 1613+ * right edge of the window, the document becomes wider so we
 1614+ * need to stretch the overlay. If the user then drags the
 1615+ * dialog back to the left, the document will become narrower,
 1616+ * so we need to shrink the overlay to the appropriate size.
 1617+ * This is handled by shrinking the overlay before setting it
 1618+ * to the full document size.
 1619+ */
 1620+ var $overlays = $([]);
 1621+ $.each($.ui.dialog.overlay.instances, function() {
 1622+ $overlays = $overlays.add(this);
 1623+ });
 1624+
 1625+ $overlays.css({
 1626+ width: 0,
 1627+ height: 0
 1628+ }).css({
 1629+ width: $.ui.dialog.overlay.width(),
 1630+ height: $.ui.dialog.overlay.height()
 1631+ });
 1632+ }
 1633+});
 1634+
 1635+$.extend($.ui.dialog.overlay.prototype, {
 1636+ destroy: function() {
 1637+ $.ui.dialog.overlay.destroy(this.$el);
 1638+ }
 1639+});
 1640+
 1641+}(jQuery));
 1642+/*
 1643+ * jQuery UI Datepicker 1.8.2
5221644 *
523 - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 1645+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
5241646 * Dual licensed under the MIT (MIT-LICENSE.txt)
5251647 * and GPL (GPL-LICENSE.txt) licenses.
5261648 *
5271649 * http://docs.jquery.com/UI/Datepicker
5281650 *
5291651 * Depends:
530 - * ui.core.js
 1652+ * jquery.ui.core.js
5311653 */
5321654
5331655 (function($) { // hide the namespace
5341656
535 -$.extend($.ui, { datepicker: { version: "1.7.1" } });
 1657+$.extend($.ui, { datepicker: { version: "1.8.2" } });
5361658
5371659 var PROP_NAME = 'datepicker';
 1660+var dpuuid = new Date().getTime();
5381661
5391662 /* Date picker manager.
5401663 Use the singleton instance of this class, $.datepicker, to interact with the date picker.
@@ -568,14 +1691,17 @@
5691692 dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
5701693 dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
5711694 dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
 1695+ weekHeader: 'Wk', // Column header for week of the year
5721696 dateFormat: 'mm/dd/yy', // See format options on parseDate
5731697 firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
574 - isRTL: false // True if right-to-left language, false if left-to-right
 1698+ isRTL: false, // True if right-to-left language, false if left-to-right
 1699+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
 1700+ yearSuffix: '' // Additional text to append to the year in the month headers
5751701 };
5761702 this._defaults = { // Global defaults for all the date picker instances
5771703 showOn: 'focus', // 'focus' for popup on focus,
5781704 // 'button' for trigger button, or 'both' for either
579 - showAnim: 'show', // Name of jQuery animation for popup
 1705+ showAnim: 'fadeIn', // Name of jQuery animation for popup
5801706 showOptions: {}, // Options for enhanced animations
5811707 defaultDate: null, // Used when field is blank: actual date,
5821708 // +/-number for offset from today, null for today
@@ -589,10 +1715,12 @@
5901716 gotoCurrent: false, // True if today link goes back to current selection instead
5911717 changeMonth: false, // True if month can be selected directly, false if only prev/next
5921718 changeYear: false, // True if year can be selected directly, false if only prev/next
593 - showMonthAfterYear: false, // True if the year select precedes month, false for month then year
594 - yearRange: '-10:+10', // Range of years to display in drop-down,
595 - // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
 1719+ yearRange: 'c-10:c+10', // Range of years to display in drop-down,
 1720+ // either relative to today's year (-nn:+nn), relative to currently displayed year
 1721+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
5961722 showOtherMonths: false, // True to show dates in other months, false to leave blank
 1723+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
 1724+ showWeek: false, // True to show week of the year, false to not show it
5971725 calculateWeek: this.iso8601Week, // How to calculate the week of the year,
5981726 // takes a Date and returns the number of the week for it
5991727 shortYearCutoff: '+10', // Short year values < this are in the current century,
@@ -600,7 +1728,7 @@
6011729 // string value starting with '+' for current year + value
6021730 minDate: null, // The earliest selectable date, or null for no limit
6031731 maxDate: null, // The latest selectable date, or null for no limit
604 - duration: 'normal', // Duration of display/closure
 1732+ duration: 'fast', // Duration of display/closure
6051733 beforeShowDay: null, // Function that takes a date and returns an array with
6061734 // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
6071735 // [2] = cell title (optional), e.g. $.datepicker.noWeekends
@@ -616,7 +1744,8 @@
6171745 altField: '', // Selector for an alternate field to store selected dates into
6181746 altFormat: '', // The date format to use for the alternate field
6191747 constrainInput: true, // The input is constrained by the current date format
620 - showButtonPanel: false // True to show button panel, false to not show it
 1748+ showButtonPanel: false, // True to show button panel, false to not show it
 1749+ autoSize: false // True to size the input for the date format, false to leave as is
6211750 };
6221751 $.extend(this._defaults, this.regional['']);
6231752 this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
@@ -631,6 +1760,11 @@
6321761 if (this.debug)
6331762 console.log.apply('', arguments);
6341763 },
 1764+
 1765+ // TODO rename to "widget" when switching to widget factory
 1766+ _widgetDatepicker: function() {
 1767+ return this.dpDiv;
 1768+ },
6351769
6361770 /* Override the default settings for all instances of the date picker.
6371771 @param settings object - the new settings to use as defaults (anonymous object)
@@ -659,8 +1793,10 @@
6601794 }
6611795 var nodeName = target.nodeName.toLowerCase();
6621796 var inline = (nodeName == 'div' || nodeName == 'span');
663 - if (!target.id)
664 - target.id = 'dp' + (++this.uuid);
 1797+ if (!target.id) {
 1798+ this.uuid += 1;
 1799+ target.id = 'dp' + this.uuid;
 1800+ }
6651801 var inst = this._newInst($(target), inline);
6661802 inst.settings = $.extend({}, settings || {}, inlineSettings || {});
6671803 if (nodeName == 'input') {
@@ -672,7 +1808,7 @@
6731809
6741810 /* Create a new instance object. */
6751811 _newInst: function(target, inline) {
676 - var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars
 1812+ var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars
6771813 return {id: id, input: target, // associated target
6781814 selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
6791815 drawMonth: 0, drawYear: 0, // month being drawn
@@ -684,13 +1820,35 @@
6851821 /* Attach the date picker to an input field. */
6861822 _connectDatepicker: function(target, inst) {
6871823 var input = $(target);
 1824+ inst.append = $([]);
6881825 inst.trigger = $([]);
6891826 if (input.hasClass(this.markerClassName))
6901827 return;
 1828+ this._attachments(input, inst);
 1829+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
 1830+ keypress(this._doKeyPress).keyup(this._doKeyUp).
 1831+ bind("setData.datepicker", function(event, key, value) {
 1832+ inst.settings[key] = value;
 1833+ }).bind("getData.datepicker", function(event, key) {
 1834+ return this._get(inst, key);
 1835+ });
 1836+ this._autoSize(inst);
 1837+ $.data(target, PROP_NAME, inst);
 1838+ },
 1839+
 1840+ /* Make attachments based on settings. */
 1841+ _attachments: function(input, inst) {
6911842 var appendText = this._get(inst, 'appendText');
6921843 var isRTL = this._get(inst, 'isRTL');
693 - if (appendText)
694 - input[isRTL ? 'before' : 'after']('<span class="' + this._appendClass + '">' + appendText + '</span>');
 1844+ if (inst.append)
 1845+ inst.append.remove();
 1846+ if (appendText) {
 1847+ inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
 1848+ input[isRTL ? 'before' : 'after'](inst.append);
 1849+ }
 1850+ input.unbind('focus', this._showDatepicker);
 1851+ if (inst.trigger)
 1852+ inst.trigger.remove();
6951853 var showOn = this._get(inst, 'showOn');
6961854 if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
6971855 input.focus(this._showDatepicker);
@@ -705,22 +1863,41 @@
7061864 { src:buttonImage, alt:buttonText, title:buttonText })));
7071865 input[isRTL ? 'before' : 'after'](inst.trigger);
7081866 inst.trigger.click(function() {
709 - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
 1867+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
7101868 $.datepicker._hideDatepicker();
7111869 else
712 - $.datepicker._showDatepicker(target);
 1870+ $.datepicker._showDatepicker(input[0]);
7131871 return false;
7141872 });
7151873 }
716 - input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
717 - bind("setData.datepicker", function(event, key, value) {
718 - inst.settings[key] = value;
719 - }).bind("getData.datepicker", function(event, key) {
720 - return this._get(inst, key);
721 - });
722 - $.data(target, PROP_NAME, inst);
7231874 },
7241875
 1876+ /* Apply the maximum length for the date format. */
 1877+ _autoSize: function(inst) {
 1878+ if (this._get(inst, 'autoSize') && !inst.inline) {
 1879+ var date = new Date(2009, 12 - 1, 20); // Ensure double digits
 1880+ var dateFormat = this._get(inst, 'dateFormat');
 1881+ if (dateFormat.match(/[DM]/)) {
 1882+ var findMax = function(names) {
 1883+ var max = 0;
 1884+ var maxI = 0;
 1885+ for (var i = 0; i < names.length; i++) {
 1886+ if (names[i].length > max) {
 1887+ max = names[i].length;
 1888+ maxI = i;
 1889+ }
 1890+ }
 1891+ return maxI;
 1892+ };
 1893+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
 1894+ 'monthNames' : 'monthNamesShort'))));
 1895+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
 1896+ 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
 1897+ }
 1898+ inst.input.attr('size', this._formatDate(inst, date).length);
 1899+ }
 1900+ },
 1901+
7251902 /* Attach an inline date picker to a div. */
7261903 _inlineDatepicker: function(target, inst) {
7271904 var divSpan = $(target);
@@ -733,26 +1910,27 @@
7341911 return this._get(inst, key);
7351912 });
7361913 $.data(target, PROP_NAME, inst);
737 - this._setDate(inst, this._getDefaultDate(inst));
 1914+ this._setDate(inst, this._getDefaultDate(inst), true);
7381915 this._updateDatepicker(inst);
7391916 this._updateAlternate(inst);
7401917 },
7411918
7421919 /* Pop-up the date picker in a "dialog" box.
7431920 @param input element - ignored
744 - @param dateText string - the initial date to display (in the current format)
745 - @param onSelect function - the function(dateText) to call when a date is selected
 1921+ @param date string or Date - the initial date to display
 1922+ @param onSelect function - the function to call when a date is selected
7461923 @param settings object - update the dialog date picker instance's settings (anonymous object)
7471924 @param pos int[2] - coordinates for the dialog's position within the screen or
7481925 event - with x/y coordinates or
7491926 leave empty for default (screen centre)
7501927 @return the manager object */
751 - _dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
 1928+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
7521929 var inst = this._dialogInst; // internal instance
7531930 if (!inst) {
754 - var id = 'dp' + (++this.uuid);
 1931+ this.uuid += 1;
 1932+ var id = 'dp' + this.uuid;
7551933 this._dialogInput = $('<input type="text" id="' + id +
756 - '" size="1" style="position: absolute; top: -100px;"/>');
 1934+ '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');
7571935 this._dialogInput.keydown(this._doKeyDown);
7581936 $('body').append(this._dialogInput);
7591937 inst = this._dialogInst = this._newInst(this._dialogInput, false);
@@ -760,12 +1938,13 @@
7611939 $.data(this._dialogInput[0], PROP_NAME, inst);
7621940 }
7631941 extendRemove(inst.settings, settings || {});
764 - this._dialogInput.val(dateText);
 1942+ date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);
 1943+ this._dialogInput.val(date);
7651944
7661945 this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
7671946 if (!this._pos) {
768 - var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
769 - var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
 1947+ var browserWidth = document.documentElement.clientWidth;
 1948+ var browserHeight = document.documentElement.clientHeight;
7701949 var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
7711950 var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
7721951 this._pos = // should use actual width/height below
@@ -773,7 +1952,7 @@
7741953 }
7751954
7761955 // move input on screen for focus, but hidden behind dialog
777 - this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
 1956+ this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');
7781957 inst.settings.onSelect = onSelect;
7791958 this._inDialog = true;
7801959 this.dpDiv.addClass(this._dialogClass);
@@ -795,12 +1974,13 @@
7961975 var nodeName = target.nodeName.toLowerCase();
7971976 $.removeData(target, PROP_NAME);
7981977 if (nodeName == 'input') {
 1978+ inst.append.remove();
7991979 inst.trigger.remove();
800 - $target.siblings('.' + this._appendClass).remove().end().
801 - removeClass(this.markerClassName).
 1980+ $target.removeClass(this.markerClassName).
8021981 unbind('focus', this._showDatepicker).
8031982 unbind('keydown', this._doKeyDown).
804 - unbind('keypress', this._doKeyPress);
 1983+ unbind('keypress', this._doKeyPress).
 1984+ unbind('keyup', this._doKeyUp);
8051985 } else if (nodeName == 'div' || nodeName == 'span')
8061986 $target.removeClass(this.markerClassName).empty();
8071987 },
@@ -815,11 +1995,10 @@
8161996 }
8171997 var nodeName = target.nodeName.toLowerCase();
8181998 if (nodeName == 'input') {
819 - target.disabled = false;
820 - inst.trigger.filter("button").
821 - each(function() { this.disabled = false; }).end().
822 - filter("img").
823 - css({opacity: '1.0', cursor: ''});
 1999+ target.disabled = false;
 2000+ inst.trigger.filter('button').
 2001+ each(function() { this.disabled = false; }).end().
 2002+ filter('img').css({opacity: '1.0', cursor: ''});
8242003 }
8252004 else if (nodeName == 'div' || nodeName == 'span') {
8262005 var inline = $target.children('.' + this._inlineClass);
@@ -839,11 +2018,10 @@
8402019 }
8412020 var nodeName = target.nodeName.toLowerCase();
8422021 if (nodeName == 'input') {
843 - target.disabled = true;
844 - inst.trigger.filter("button").
845 - each(function() { this.disabled = true; }).end().
846 - filter("img").
847 - css({opacity: '0.5', cursor: 'default'});
 2022+ target.disabled = true;
 2023+ inst.trigger.filter('button').
 2024+ each(function() { this.disabled = true; }).end().
 2025+ filter('img').css({opacity: '0.5', cursor: 'default'});
8482026 }
8492027 else if (nodeName == 'div' || nodeName == 'span') {
8502028 var inline = $target.children('.' + this._inlineClass);
@@ -881,31 +2059,35 @@
8822060 }
8832061 },
8842062
885 - /* Update the settings for a date picker attached to an input field or division.
 2063+ /* Update or retrieve the settings for a date picker attached to an input field or division.
8862064 @param target element - the target input field or division or span
8872065 @param name object - the new settings to update or
888 - string - the name of the setting to change or
889 - @param value any - the new value for the setting (omit if above is an object) */
 2066+ string - the name of the setting to change or retrieve,
 2067+ when retrieving also 'all' for all instance settings or
 2068+ 'defaults' for all global defaults
 2069+ @param value any - the new value for the setting
 2070+ (omit if above is an object or to retrieve a value) */
8902071 _optionDatepicker: function(target, name, value) {
 2072+ var inst = this._getInst(target);
 2073+ if (arguments.length == 2 && typeof name == 'string') {
 2074+ return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
 2075+ (inst ? (name == 'all' ? $.extend({}, inst.settings) :
 2076+ this._get(inst, name)) : null));
 2077+ }
8912078 var settings = name || {};
8922079 if (typeof name == 'string') {
8932080 settings = {};
8942081 settings[name] = value;
8952082 }
896 - var inst = this._getInst(target);
8972083 if (inst) {
8982084 if (this._curInst == inst) {
899 - this._hideDatepicker(null);
 2085+ this._hideDatepicker();
9002086 }
 2087+ var date = this._getDateDatepicker(target, true);
9012088 extendRemove(inst.settings, settings);
902 - var date = new Date();
903 - extendRemove(inst, {rangeStart: null, // start of range
904 - endDay: null, endMonth: null, endYear: null, // end of range
905 - selectedDay: date.getDate(), selectedMonth: date.getMonth(),
906 - selectedYear: date.getFullYear(), // starting point
907 - currentDay: date.getDate(), currentMonth: date.getMonth(),
908 - currentYear: date.getFullYear(), // current selection
909 - drawMonth: date.getMonth(), drawYear: date.getFullYear()}); // month being drawn
 2089+ this._attachments($(target), inst);
 2090+ this._autoSize(inst);
 2091+ this._setDateDatepicker(target, date);
9102092 this._updateDatepicker(inst);
9112093 }
9122094 },
@@ -926,25 +2108,24 @@
9272109
9282110 /* Set the dates for a jQuery selection.
9292111 @param target element - the target input field or division or span
930 - @param date Date - the new date
931 - @param endDate Date - the new end date for a range (optional) */
932 - _setDateDatepicker: function(target, date, endDate) {
 2112+ @param date Date - the new date */
 2113+ _setDateDatepicker: function(target, date) {
9332114 var inst = this._getInst(target);
9342115 if (inst) {
935 - this._setDate(inst, date, endDate);
 2116+ this._setDate(inst, date);
9362117 this._updateDatepicker(inst);
9372118 this._updateAlternate(inst);
9382119 }
9392120 },
9402121
9412122 /* Get the date(s) for the first entry in a jQuery selection.
942 - @param target element - the target input field or division or span
943 - @return Date - the current date or
944 - Date[2] - the current dates for a range */
945 - _getDateDatepicker: function(target) {
 2123+ @param target element - the target input field or division or span
 2124+ @param noDefault boolean - true if no default date is to be used
 2125+ @return Date - the current date */
 2126+ _getDateDatepicker: function(target, noDefault) {
9462127 var inst = this._getInst(target);
9472128 if (inst && !inst.inline)
948 - this._setDateFromField(inst);
 2129+ this._setDateFromField(inst, noDefault);
9492130 return (inst ? this._getDate(inst) : null);
9502131 },
9512132
@@ -956,17 +2137,18 @@
9572138 inst._keyEvent = true;
9582139 if ($.datepicker._datepickerShowing)
9592140 switch (event.keyCode) {
960 - case 9: $.datepicker._hideDatepicker(null, '');
 2141+ case 9: $.datepicker._hideDatepicker();
 2142+ handled = false;
9612143 break; // hide on tab out
962 - case 13: var sel = $('td.' + $.datepicker._dayOverClass +
963 - ', td.' + $.datepicker._currentClass, inst.dpDiv);
 2144+ case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv).
 2145+ add($('td.' + $.datepicker._currentClass, inst.dpDiv));
9642146 if (sel[0])
9652147 $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
9662148 else
967 - $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
 2149+ $.datepicker._hideDatepicker();
9682150 return false; // don't submit the form
9692151 break; // select the value on enter
970 - case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
 2152+ case 27: $.datepicker._hideDatepicker();
9712153 break; // hide on escape
9722154 case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
9732155 -$.datepicker._get(inst, 'stepBigMonths') :
@@ -1027,6 +2209,27 @@
10282210 }
10292211 },
10302212
 2213+ /* Synchronise manual entry and field/alternate field. */
 2214+ _doKeyUp: function(event) {
 2215+ var inst = $.datepicker._getInst(event.target);
 2216+ if (inst.input.val() != inst.lastVal) {
 2217+ try {
 2218+ var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
 2219+ (inst.input ? inst.input.val() : null),
 2220+ $.datepicker._getFormatConfig(inst));
 2221+ if (date) { // only if valid
 2222+ $.datepicker._setDateFromField(inst);
 2223+ $.datepicker._updateAlternate(inst);
 2224+ $.datepicker._updateDatepicker(inst);
 2225+ }
 2226+ }
 2227+ catch (event) {
 2228+ $.datepicker.log(event);
 2229+ }
 2230+ }
 2231+ return true;
 2232+ },
 2233+
10312234 /* Pop-up the date picker for a given input field.
10322235 @param input element - the input field attached to the date picker or
10332236 event - if triggered by focus */
@@ -1037,9 +2240,12 @@
10382241 if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
10392242 return;
10402243 var inst = $.datepicker._getInst(input);
 2244+ if ($.datepicker._curInst && $.datepicker._curInst != inst) {
 2245+ $.datepicker._curInst.dpDiv.stop(true, true);
 2246+ }
10412247 var beforeShow = $.datepicker._get(inst, 'beforeShow');
10422248 extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
1043 - $.datepicker._hideDatepicker(null, '');
 2249+ inst.lastVal = null;
10442250 $.datepicker._lastInput = input;
10452251 $.datepicker._setDateFromField(inst);
10462252 if ($.datepicker._inDialog) // hide cursor
@@ -1059,7 +2265,6 @@
10602266 }
10612267 var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
10622268 $.datepicker._pos = null;
1063 - inst.rangeStart = null;
10642269 // determine sizing offscreen
10652270 inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
10662271 $.datepicker._updateDatepicker(inst);
@@ -1070,34 +2275,36 @@
10712276 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
10722277 left: offset.left + 'px', top: offset.top + 'px'});
10732278 if (!inst.inline) {
1074 - var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
 2279+ var showAnim = $.datepicker._get(inst, 'showAnim');
10752280 var duration = $.datepicker._get(inst, 'duration');
10762281 var postProcess = function() {
10772282 $.datepicker._datepickerShowing = true;
1078 - if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems
1079 - $('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
1080 - height: inst.dpDiv.height() + 4});
 2283+ var borders = $.datepicker._getBorders(inst.dpDiv);
 2284+ inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only
 2285+ css({left: -borders[0], top: -borders[1],
 2286+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
10812287 };
 2288+ inst.dpDiv.zIndex($(input).zIndex()+1);
10822289 if ($.effects && $.effects[showAnim])
10832290 inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
10842291 else
1085 - inst.dpDiv[showAnim](duration, postProcess);
1086 - if (duration == '')
 2292+ inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
 2293+ if (!showAnim || !duration)
10872294 postProcess();
1088 - if (inst.input[0].type != 'hidden')
1089 - inst.input[0].focus();
 2295+ if (inst.input.is(':visible') && !inst.input.is(':disabled'))
 2296+ inst.input.focus();
10902297 $.datepicker._curInst = inst;
10912298 }
10922299 },
10932300
10942301 /* Generate the date picker content. */
10952302 _updateDatepicker: function(inst) {
1096 - var dims = {width: inst.dpDiv.width() + 4,
1097 - height: inst.dpDiv.height() + 4};
10982303 var self = this;
 2304+ var borders = $.datepicker._getBorders(inst.dpDiv);
10992305 inst.dpDiv.empty().append(this._generateHTML(inst))
1100 - .find('iframe.ui-datepicker-cover').
1101 - css({width: dims.width, height: dims.height})
 2306+ .find('iframe.ui-datepicker-cover') // IE6- only
 2307+ .css({left: -borders[0], top: -borders[1],
 2308+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
11022309 .end()
11032310 .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
11042311 .bind('mouseout', function(){
@@ -1120,73 +2327,83 @@
11212328 var numMonths = this._getNumberOfMonths(inst);
11222329 var cols = numMonths[1];
11232330 var width = 17;
1124 - if (cols > 1) {
 2331+ if (cols > 1)
11252332 inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
1126 - } else {
 2333+ else
11272334 inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
1128 - }
11292335 inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
11302336 'Class']('ui-datepicker-multi');
11312337 inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
11322338 'Class']('ui-datepicker-rtl');
1133 - if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
1134 - $(inst.input[0]).focus();
 2339+ if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
 2340+ inst.input.is(':visible') && !inst.input.is(':disabled'))
 2341+ inst.input.focus();
11352342 },
11362343
 2344+ /* Retrieve the size of left and top borders for an element.
 2345+ @param elem (jQuery object) the element of interest
 2346+ @return (number[2]) the left and top borders */
 2347+ _getBorders: function(elem) {
 2348+ var convert = function(value) {
 2349+ return {thin: 1, medium: 2, thick: 3}[value] || value;
 2350+ };
 2351+ return [parseFloat(convert(elem.css('border-left-width'))),
 2352+ parseFloat(convert(elem.css('border-top-width')))];
 2353+ },
 2354+
11372355 /* Check positioning to remain on screen. */
11382356 _checkOffset: function(inst, offset, isFixed) {
11392357 var dpWidth = inst.dpDiv.outerWidth();
11402358 var dpHeight = inst.dpDiv.outerHeight();
11412359 var inputWidth = inst.input ? inst.input.outerWidth() : 0;
11422360 var inputHeight = inst.input ? inst.input.outerHeight() : 0;
1143 - var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft();
1144 - var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop();
 2361+ var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
 2362+ var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
11452363
11462364 offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
11472365 offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
11482366 offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
11492367
11502368 // now check if datepicker is showing outside window viewport - move to a better place if so.
1151 - offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0;
1152 - offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0;
 2369+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
 2370+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
 2371+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
 2372+ Math.abs(dpHeight + inputHeight) : 0);
11532373
11542374 return offset;
11552375 },
11562376
11572377 /* Find an object's position on the screen. */
11582378 _findPos: function(obj) {
 2379+ var inst = this._getInst(obj);
 2380+ var isRTL = this._get(inst, 'isRTL');
11592381 while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
1160 - obj = obj.nextSibling;
 2382+ obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
11612383 }
11622384 var position = $(obj).offset();
11632385 return [position.left, position.top];
11642386 },
11652387
11662388 /* Hide the date picker from view.
1167 - @param input element - the input field attached to the date picker
1168 - @param duration string - the duration over which to close the date picker */
1169 - _hideDatepicker: function(input, duration) {
 2389+ @param input element - the input field attached to the date picker */
 2390+ _hideDatepicker: function(input) {
11702391 var inst = this._curInst;
11712392 if (!inst || (input && inst != $.data(input, PROP_NAME)))
11722393 return;
1173 - if (inst.stayOpen)
1174 - this._selectDate('#' + inst.id, this._formatDate(inst,
1175 - inst.currentDay, inst.currentMonth, inst.currentYear));
1176 - inst.stayOpen = false;
11772394 if (this._datepickerShowing) {
1178 - duration = (duration != null ? duration : this._get(inst, 'duration'));
11792395 var showAnim = this._get(inst, 'showAnim');
 2396+ var duration = this._get(inst, 'duration');
11802397 var postProcess = function() {
11812398 $.datepicker._tidyDialog(inst);
 2399+ this._curInst = null;
11822400 };
1183 - if (duration != '' && $.effects && $.effects[showAnim])
1184 - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
1185 - duration, postProcess);
 2401+ if ($.effects && $.effects[showAnim])
 2402+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
11862403 else
1187 - inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' :
1188 - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess);
1189 - if (duration == '')
1190 - this._tidyDialog(inst);
 2404+ inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :
 2405+ (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
 2406+ if (!showAnim)
 2407+ postProcess();
11912408 var onClose = this._get(inst, 'onClose');
11922409 if (onClose)
11932410 onClose.apply((inst.input ? inst.input[0] : null),
@@ -1202,7 +2419,6 @@
12032420 }
12042421 this._inDialog = false;
12052422 }
1206 - this._curInst = null;
12072423 },
12082424
12092425 /* Tidy up after a dialog display. */
@@ -1215,11 +2431,12 @@
12162432 if (!$.datepicker._curInst)
12172433 return;
12182434 var $target = $(event.target);
1219 - if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
 2435+ if ($target[0].id != $.datepicker._mainDivId &&
 2436+ $target.parents('#' + $.datepicker._mainDivId).length == 0 &&
12202437 !$target.hasClass($.datepicker.markerClassName) &&
12212438 !$target.hasClass($.datepicker._triggerClass) &&
12222439 $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
1223 - $.datepicker._hideDatepicker(null, '');
 2440+ $.datepicker._hideDatepicker();
12242441 },
12252442
12262443 /* Adjust one of the date sub-fields. */
@@ -1245,10 +2462,10 @@
12462463 inst.drawYear = inst.selectedYear = inst.currentYear;
12472464 }
12482465 else {
1249 - var date = new Date();
1250 - inst.selectedDay = date.getDate();
1251 - inst.drawMonth = inst.selectedMonth = date.getMonth();
1252 - inst.drawYear = inst.selectedYear = date.getFullYear();
 2466+ var date = new Date();
 2467+ inst.selectedDay = date.getDate();
 2468+ inst.drawMonth = inst.selectedMonth = date.getMonth();
 2469+ inst.drawYear = inst.selectedYear = date.getFullYear();
12532470 }
12542471 this._notifyChange(inst);
12552472 this._adjustDate(target);
@@ -1271,7 +2488,7 @@
12722489 var target = $(id);
12732490 var inst = this._getInst(target[0]);
12742491 if (inst.input && inst._selectingMonthYear && !$.browser.msie)
1275 - inst.input[0].focus();
 2492+ inst.input.focus();
12762493 inst._selectingMonthYear = !inst._selectingMonthYear;
12772494 },
12782495
@@ -1285,24 +2502,14 @@
12862503 inst.selectedDay = inst.currentDay = $('a', td).html();
12872504 inst.selectedMonth = inst.currentMonth = month;
12882505 inst.selectedYear = inst.currentYear = year;
1289 - if (inst.stayOpen) {
1290 - inst.endDay = inst.endMonth = inst.endYear = null;
1291 - }
12922506 this._selectDate(id, this._formatDate(inst,
12932507 inst.currentDay, inst.currentMonth, inst.currentYear));
1294 - if (inst.stayOpen) {
1295 - inst.rangeStart = this._daylightSavingAdjust(
1296 - new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
1297 - this._updateDatepicker(inst);
1298 - }
12992508 },
13002509
13012510 /* Erase the input field and hide the date picker. */
13022511 _clearDate: function(id) {
13032512 var target = $(id);
13042513 var inst = this._getInst(target[0]);
1305 - inst.stayOpen = false;
1306 - inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
13072514 this._selectDate(target, '');
13082515 },
13092516
@@ -1321,11 +2528,11 @@
13222529 inst.input.trigger('change'); // fire the change event
13232530 if (inst.inline)
13242531 this._updateDatepicker(inst);
1325 - else if (!inst.stayOpen) {
1326 - this._hideDatepicker(null, this._get(inst, 'duration'));
 2532+ else {
 2533+ this._hideDatepicker();
13272534 this._lastInput = inst.input[0];
13282535 if (typeof(inst.input[0]) != 'object')
1329 - inst.input[0].focus(); // restore focus
 2536+ inst.input.focus(); // restore focus
13302537 this._lastInput = null;
13312538 }
13322539 },
@@ -1336,7 +2543,7 @@
13372544 if (altField) { // update alternate field too
13382545 var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
13392546 var date = this._getDate(inst);
1340 - dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
 2547+ var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
13412548 $(altField).each(function() { $(this).val(dateStr); });
13422549 }
13432550 },
@@ -1353,20 +2560,13 @@
13542561 @param date Date - the date to get the week for
13552562 @return number - the number of the week within the year that contains this date */
13562563 iso8601Week: function(date) {
1357 - var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
1358 - var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
1359 - var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
1360 - firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
1361 - if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
1362 - checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
1363 - return $.datepicker.iso8601Week(checkDate);
1364 - } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
1365 - firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
1366 - if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
1367 - return 1;
1368 - }
1369 - }
1370 - return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
 2564+ var checkDate = new Date(date.getTime());
 2565+ // Find Thursday of this week starting on Monday
 2566+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
 2567+ var time = checkDate.getTime();
 2568+ checkDate.setMonth(0); // Compare with Jan 1
 2569+ checkDate.setDate(1);
 2570+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
13712571 },
13722572
13732573 /* Parse a string value into a date object.
@@ -1407,34 +2607,25 @@
14082608 // Extract a number from the string value
14092609 var getNumber = function(match) {
14102610 lookAhead(match);
1411 - var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2)));
1412 - var size = origSize;
1413 - var num = 0;
1414 - while (size > 0 && iValue < value.length &&
1415 - value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
1416 - num = num * 10 + parseInt(value.charAt(iValue++),10);
1417 - size--;
1418 - }
1419 - if (size == origSize)
 2611+ var size = (match == '@' ? 14 : (match == '!' ? 20 :
 2612+ (match == 'y' ? 4 : (match == 'o' ? 3 : 2))));
 2613+ var digits = new RegExp('^\\d{1,' + size + '}');
 2614+ var num = value.substring(iValue).match(digits);
 2615+ if (!num)
14202616 throw 'Missing number at position ' + iValue;
1421 - return num;
 2617+ iValue += num[0].length;
 2618+ return parseInt(num[0], 10);
14222619 };
14232620 // Extract a name from the string value and convert to an index
14242621 var getName = function(match, shortNames, longNames) {
14252622 var names = (lookAhead(match) ? longNames : shortNames);
1426 - var size = 0;
1427 - for (var j = 0; j < names.length; j++)
1428 - size = Math.max(size, names[j].length);
1429 - var name = '';
1430 - var iInit = iValue;
1431 - while (size > 0 && iValue < value.length) {
1432 - name += value.charAt(iValue++);
1433 - for (var i = 0; i < names.length; i++)
1434 - if (name == names[i])
1435 - return i + 1;
1436 - size--;
 2623+ for (var i = 0; i < names.length; i++) {
 2624+ if (value.substr(iValue, names[i].length) == names[i]) {
 2625+ iValue += names[i].length;
 2626+ return i + 1;
 2627+ }
14372628 }
1438 - throw 'Unknown name at position ' + iInit;
 2629+ throw 'Unknown name at position ' + iValue;
14392630 };
14402631 // Confirm that a literal character matches the string value
14412632 var checkLiteral = function() {
@@ -1475,6 +2666,12 @@
14762667 month = date.getMonth() + 1;
14772668 day = date.getDate();
14782669 break;
 2670+ case '!':
 2671+ var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);
 2672+ year = date.getFullYear();
 2673+ month = date.getMonth() + 1;
 2674+ day = date.getDate();
 2675+ break;
14792676 case "'":
14802677 if (lookAhead("'"))
14812678 checkLiteral();
@@ -1517,9 +2714,13 @@
15182715 RFC_1123: 'D, d M yy',
15192716 RFC_2822: 'D, d M yy',
15202717 RSS: 'D, d M y', // RFC 822
 2718+ TICKS: '!',
15212719 TIMESTAMP: '@',
15222720 W3C: 'yy-mm-dd', // ISO 8601
15232721
 2722+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
 2723+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
 2724+
15242725 /* Format a date object into a string value.
15252726 The format can be combinations of the following:
15262727 d - day of month (no leading zero)
@@ -1535,6 +2736,7 @@
15362737 y - year (two digit)
15372738 yy - year (four digit)
15382739 @ - Unix timestamp (ms since 01/01/1970)
 2740+ ! - Windows ticks (100ns since 01/01/0001)
15392741 '...' - literal text
15402742 '' - single quote
15412743
@@ -1590,10 +2792,8 @@
15912793 output += formatName('D', date.getDay(), dayNamesShort, dayNames);
15922794 break;
15932795 case 'o':
1594 - var doy = date.getDate();
1595 - for (var m = date.getMonth() - 1; m >= 0; m--)
1596 - doy += this._getDaysInMonth(date.getFullYear(), m);
1597 - output += formatNumber('o', doy, 3);
 2796+ output += formatNumber('o',
 2797+ (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3);
15982798 break;
15992799 case 'm':
16002800 output += formatNumber('m', date.getMonth() + 1, 2);
@@ -1608,6 +2808,9 @@
16092809 case '@':
16102810 output += date.getTime();
16112811 break;
 2812+ case '!':
 2813+ output += date.getTime() * 10000 + this._ticksTo1970;
 2814+ break;
16122815 case "'":
16132816 if (lookAhead("'"))
16142817 output += "'";
@@ -1625,6 +2828,13 @@
16262829 _possibleChars: function (format) {
16272830 var chars = '';
16282831 var literal = false;
 2832+ // Check whether a format character is doubled
 2833+ var lookAhead = function(match) {
 2834+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
 2835+ if (matches)
 2836+ iFormat++;
 2837+ return matches;
 2838+ };
16292839 for (var iFormat = 0; iFormat < format.length; iFormat++)
16302840 if (literal)
16312841 if (format.charAt(iFormat) == "'" && !lookAhead("'"))
@@ -1657,17 +2867,20 @@
16582868 },
16592869
16602870 /* Parse existing date and initialise date picker. */
1661 - _setDateFromField: function(inst) {
 2871+ _setDateFromField: function(inst, noDefault) {
 2872+ if (inst.input.val() == inst.lastVal) {
 2873+ return;
 2874+ }
16622875 var dateFormat = this._get(inst, 'dateFormat');
1663 - var dates = inst.input ? inst.input.val() : null;
1664 - inst.endDay = inst.endMonth = inst.endYear = null;
1665 - var date = defaultDate = this._getDefaultDate(inst);
 2876+ var dates = inst.lastVal = inst.input ? inst.input.val() : null;
 2877+ var date, defaultDate;
 2878+ date = defaultDate = this._getDefaultDate(inst);
16662879 var settings = this._getFormatConfig(inst);
16672880 try {
16682881 date = this.parseDate(dateFormat, dates, settings) || defaultDate;
16692882 } catch (event) {
16702883 this.log(event);
1671 - date = defaultDate;
 2884+ dates = (noDefault ? '' : dates);
16722885 }
16732886 inst.selectedDay = date.getDate();
16742887 inst.drawMonth = inst.selectedMonth = date.getMonth();
@@ -1680,23 +2893,27 @@
16812894
16822895 /* Retrieve the default date shown on opening. */
16832896 _getDefaultDate: function(inst) {
1684 - var date = this._determineDate(this._get(inst, 'defaultDate'), new Date());
1685 - var minDate = this._getMinMaxDate(inst, 'min', true);
1686 - var maxDate = this._getMinMaxDate(inst, 'max');
1687 - date = (minDate && date < minDate ? minDate : date);
1688 - date = (maxDate && date > maxDate ? maxDate : date);
1689 - return date;
 2897+ return this._restrictMinMax(inst,
 2898+ this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));
16902899 },
16912900
16922901 /* A date may be specified as an exact value or a relative one. */
1693 - _determineDate: function(date, defaultDate) {
 2902+ _determineDate: function(inst, date, defaultDate) {
16942903 var offsetNumeric = function(offset) {
16952904 var date = new Date();
16962905 date.setDate(date.getDate() + offset);
16972906 return date;
16982907 };
1699 - var offsetString = function(offset, getDaysInMonth) {
1700 - var date = new Date();
 2908+ var offsetString = function(offset) {
 2909+ try {
 2910+ return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
 2911+ offset, $.datepicker._getFormatConfig(inst));
 2912+ }
 2913+ catch (e) {
 2914+ // Ignore
 2915+ }
 2916+ var date = (offset.toLowerCase().match(/^c/) ?
 2917+ $.datepicker._getDate(inst) : null) || new Date();
17012918 var year = date.getFullYear();
17022919 var month = date.getMonth();
17032920 var day = date.getDate();
@@ -1710,19 +2927,18 @@
17112928 day += parseInt(matches[1],10) * 7; break;
17122929 case 'm' : case 'M' :
17132930 month += parseInt(matches[1],10);
1714 - day = Math.min(day, getDaysInMonth(year, month));
 2931+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
17152932 break;
17162933 case 'y': case 'Y' :
17172934 year += parseInt(matches[1],10);
1718 - day = Math.min(day, getDaysInMonth(year, month));
 2935+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
17192936 break;
17202937 }
17212938 matches = pattern.exec(offset);
17222939 }
17232940 return new Date(year, month, day);
17242941 };
1725 - date = (date == null ? defaultDate :
1726 - (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
 2942+ date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) :
17272943 (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date)));
17282944 date = (date && date.toString() == 'Invalid Date' ? defaultDate : date);
17292945 if (date) {
@@ -1747,15 +2963,15 @@
17482964 },
17492965
17502966 /* Set the date(s) directly. */
1751 - _setDate: function(inst, date, endDate) {
 2967+ _setDate: function(inst, date, noChange) {
17522968 var clear = !(date);
17532969 var origMonth = inst.selectedMonth;
17542970 var origYear = inst.selectedYear;
1755 - date = this._determineDate(date, new Date());
 2971+ date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
17562972 inst.selectedDay = inst.currentDay = date.getDate();
17572973 inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
17582974 inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
1759 - if (origMonth != inst.selectedMonth || origYear != inst.selectedYear)
 2975+ if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
17602976 this._notifyChange(inst);
17612977 this._adjustInstDate(inst);
17622978 if (inst.input) {
@@ -1783,11 +2999,10 @@
17843000 var numMonths = this._getNumberOfMonths(inst);
17853001 var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
17863002 var stepMonths = this._get(inst, 'stepMonths');
1787 - var stepBigMonths = this._get(inst, 'stepBigMonths');
17883003 var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
17893004 var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
17903005 new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
1791 - var minDate = this._getMinMaxDate(inst, 'min', true);
 3006+ var minDate = this._getMinMaxDate(inst, 'min');
17923007 var maxDate = this._getMinMaxDate(inst, 'max');
17933008 var drawMonth = inst.drawMonth - showCurrentAtPos;
17943009 var drawYear = inst.drawYear;
@@ -1797,7 +3012,7 @@
17983013 }
17993014 if (maxDate) {
18003015 var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
1801 - maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()));
 3016+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
18023017 maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
18033018 while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
18043019 drawMonth--;
@@ -1814,7 +3029,8 @@
18153030 this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
18163031 this._getFormatConfig(inst)));
18173032 var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
1818 - '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
 3033+ '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid +
 3034+ '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
18193035 ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
18203036 (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>'));
18213037 var nextText = this._get(inst, 'nextText');
@@ -1822,19 +3038,23 @@
18233039 this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
18243040 this._getFormatConfig(inst)));
18253041 var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
1826 - '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
 3042+ '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid +
 3043+ '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
18273044 ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
18283045 (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>'));
18293046 var currentText = this._get(inst, 'currentText');
18303047 var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
18313048 currentText = (!navigationAsDateFormat ? currentText :
18323049 this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
1833 - var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
 3050+ var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
 3051+ '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
18343052 var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
1835 - (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' +
 3053+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
 3054+ '.datepicker._gotoToday(\'#' + inst.id + '\');"' +
18363055 '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
18373056 var firstDay = parseInt(this._get(inst, 'firstDay'),10);
18383057 firstDay = (isNaN(firstDay) ? 0 : firstDay);
 3058+ var showWeek = this._get(inst, 'showWeek');
18393059 var dayNames = this._get(inst, 'dayNames');
18403060 var dayNamesShort = this._get(inst, 'dayNamesShort');
18413061 var dayNamesMin = this._get(inst, 'dayNamesMin');
@@ -1842,9 +3062,8 @@
18433063 var monthNamesShort = this._get(inst, 'monthNamesShort');
18443064 var beforeShowDay = this._get(inst, 'beforeShowDay');
18453065 var showOtherMonths = this._get(inst, 'showOtherMonths');
 3066+ var selectOtherMonths = this._get(inst, 'selectOtherMonths');
18463067 var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
1847 - var endDate = inst.endDay ? this._daylightSavingAdjust(
1848 - new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate;
18493068 var defaultDate = this._getDefaultDate(inst);
18503069 var html = '';
18513070 for (var row = 0; row < numMonths[0]; row++) {
@@ -1854,22 +3073,25 @@
18553074 var cornerClass = ' ui-corner-all';
18563075 var calender = '';
18573076 if (isMultiMonth) {
1858 - calender += '<div class="ui-datepicker-group ui-datepicker-group-';
1859 - switch (col) {
1860 - case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
1861 - case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
1862 - default: calender += 'middle'; cornerClass = ''; break;
1863 - }
 3077+ calender += '<div class="ui-datepicker-group';
 3078+ if (numMonths[1] > 1)
 3079+ switch (col) {
 3080+ case 0: calender += ' ui-datepicker-group-first';
 3081+ cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
 3082+ case numMonths[1]-1: calender += ' ui-datepicker-group-last';
 3083+ cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
 3084+ default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;
 3085+ }
18643086 calender += '">';
18653087 }
18663088 calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
18673089 (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
18683090 (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
18693091 this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
1870 - selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
 3092+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
18713093 '</div><table class="ui-datepicker-calendar"><thead>' +
18723094 '<tr>';
1873 - var thead = '';
 3095+ var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');
18743096 for (var dow = 0; dow < 7; dow++) { // days of the week
18753097 var day = (dow + firstDay) % 7;
18763098 thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
@@ -1884,12 +3106,13 @@
18853107 var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
18863108 for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
18873109 calender += '<tr>';
1888 - var tbody = '';
 3110+ var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
 3111+ this._get(inst, 'calculateWeek')(printDate) + '</td>');
18893112 for (var dow = 0; dow < 7; dow++) { // create date picker days
18903113 var daySettings = (beforeShowDay ?
18913114 beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
18923115 var otherMonth = (printDate.getMonth() != drawMonth);
1893 - var unselectable = otherMonth || !daySettings[0] ||
 3116+ var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
18943117 (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
18953118 tbody += '<td class="' +
18963119 ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
@@ -1900,18 +3123,17 @@
19013124 ' ' + this._dayOverClass : '') + // highlight selected day
19023125 (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days
19033126 (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
1904 - (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
1905 - ' ' + this._currentClass : '') + // highlight selected day
 3127+ (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
19063128 (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
19073129 ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
1908 - (unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' +
1909 - inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions
1910 - (otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
 3130+ (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' +
 3131+ inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions
 3132+ (otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
19113133 (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
19123134 (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
1913 - (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
1914 - ' ui-state-active' : '') + // highlight selected day
1915 - '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
 3135+ (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
 3136+ (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
 3137+ '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
19163138 printDate.setDate(printDate.getDate() + 1);
19173139 printDate = this._daylightSavingAdjust(printDate);
19183140 }
@@ -1936,8 +3158,7 @@
19373159
19383160 /* Generate the month and year header. */
19393161 _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
1940 - selectedDate, secondary, monthNames, monthNamesShort) {
1941 - minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
 3162+ secondary, monthNames, monthNamesShort) {
19423163 var changeMonth = this._get(inst, 'changeMonth');
19433164 var changeYear = this._get(inst, 'changeYear');
19443165 var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
@@ -1945,13 +3166,13 @@
19463167 var monthHtml = '';
19473168 // month selection
19483169 if (secondary || !changeMonth)
1949 - monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> ';
 3170+ monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';
19503171 else {
19513172 var inMinYear = (minDate && minDate.getFullYear() == drawYear);
19523173 var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
19533174 monthHtml += '<select class="ui-datepicker-month" ' +
1954 - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
1955 - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
 3175+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
 3176+ 'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
19563177 '>';
19573178 for (var month = 0; month < 12; month++) {
19583179 if ((!inMinYear || month >= minDate.getMonth()) &&
@@ -1963,30 +3184,27 @@
19643185 monthHtml += '</select>';
19653186 }
19663187 if (!showMonthAfterYear)
1967 - html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? '&#xa0;' : '');
 3188+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');
19683189 // year selection
19693190 if (secondary || !changeYear)
19703191 html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
19713192 else {
19723193 // determine range of years to display
19733194 var years = this._get(inst, 'yearRange').split(':');
1974 - var year = 0;
1975 - var endYear = 0;
1976 - if (years.length != 2) {
1977 - year = drawYear - 10;
1978 - endYear = drawYear + 10;
1979 - } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
1980 - year = drawYear + parseInt(years[0], 10);
1981 - endYear = drawYear + parseInt(years[1], 10);
1982 - } else {
1983 - year = parseInt(years[0], 10);
1984 - endYear = parseInt(years[1], 10);
1985 - }
 3195+ var thisYear = new Date().getFullYear();
 3196+ var determineYear = function(value) {
 3197+ var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :
 3198+ (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :
 3199+ parseInt(value, 10)));
 3200+ return (isNaN(year) ? thisYear : year);
 3201+ };
 3202+ var year = determineYear(years[0]);
 3203+ var endYear = Math.max(year, determineYear(years[1] || ''));
19863204 year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
19873205 endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
19883206 html += '<select class="ui-datepicker-year" ' +
1989 - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
1990 - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
 3207+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
 3208+ 'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
19913209 '>';
19923210 for (; year <= endYear; year++) {
19933211 html += '<option value="' + year + '"' +
@@ -1995,8 +3213,9 @@
19963214 }
19973215 html += '</select>';
19983216 }
 3217+ html += this._get(inst, 'yearSuffix');
19993218 if (showMonthAfterYear)
2000 - html += (secondary || changeMonth || changeYear ? '&#xa0;' : '') + monthHtml;
 3219+ html += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;
20013220 html += '</div>'; // Close datepicker_header
20023221 return html;
20033222 },
@@ -2007,12 +3226,8 @@
20083227 var month = inst.drawMonth + (period == 'M' ? offset : 0);
20093228 var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
20103229 (period == 'D' ? offset : 0);
2011 - var date = this._daylightSavingAdjust(new Date(year, month, day));
2012 - // ensure it is within the bounds set
2013 - var minDate = this._getMinMaxDate(inst, 'min', true);
2014 - var maxDate = this._getMinMaxDate(inst, 'max');
2015 - date = (minDate && date < minDate ? minDate : date);
2016 - date = (maxDate && date > maxDate ? maxDate : date);
 3230+ var date = this._restrictMinMax(inst,
 3231+ this._daylightSavingAdjust(new Date(year, month, day)));
20173232 inst.selectedDay = date.getDate();
20183233 inst.drawMonth = inst.selectedMonth = date.getMonth();
20193234 inst.drawYear = inst.selectedYear = date.getFullYear();
@@ -2020,6 +3235,15 @@
20213236 this._notifyChange(inst);
20223237 },
20233238
 3239+ /* Ensure a date is within any min/max bounds. */
 3240+ _restrictMinMax: function(inst, date) {
 3241+ var minDate = this._getMinMaxDate(inst, 'min');
 3242+ var maxDate = this._getMinMaxDate(inst, 'max');
 3243+ date = (minDate && date < minDate ? minDate : date);
 3244+ date = (maxDate && date > maxDate ? maxDate : date);
 3245+ return date;
 3246+ },
 3247+
20243248 /* Notify change of month/year. */
20253249 _notifyChange: function(inst) {
20263250 var onChange = this._get(inst, 'onChangeMonthYear');
@@ -2034,11 +3258,9 @@
20353259 return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
20363260 },
20373261
2038 - /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
2039 - _getMinMaxDate: function(inst, minMax, checkRange) {
2040 - var date = this._determineDate(this._get(inst, minMax + 'Date'), null);
2041 - return (!checkRange || !inst.rangeStart ? date :
2042 - (!date || inst.rangeStart > date ? inst.rangeStart : date));
 3262+ /* Determine the current maximum date - ensure no time components are set. */
 3263+ _getMinMaxDate: function(inst, minMax) {
 3264+ return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);
20433265 },
20443266
20453267 /* Find the number of days in a given month. */
@@ -2054,8 +3276,8 @@
20553277 /* Determines if we should allow a "next/prev" month display change. */
20563278 _canAdjustMonth: function(inst, offset, curYear, curMonth) {
20573279 var numMonths = this._getNumberOfMonths(inst);
2058 - var date = this._daylightSavingAdjust(new Date(
2059 - curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1));
 3280+ var date = this._daylightSavingAdjust(new Date(curYear,
 3281+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
20603282 if (offset < 0)
20613283 date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
20623284 return this._isInRange(inst, date);
@@ -2063,13 +3285,10 @@
20643286
20653287 /* Is the given date in the accepted range? */
20663288 _isInRange: function(inst, date) {
2067 - // during range selection, use minimum of selected date and range start
2068 - var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust(
2069 - new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)));
2070 - newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate);
2071 - var minDate = newMinDate || this._getMinMaxDate(inst, 'min');
 3289+ var minDate = this._getMinMaxDate(inst, 'min');
20723290 var maxDate = this._getMinMaxDate(inst, 'max');
2073 - return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
 3291+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
 3292+ (!maxDate || date.getTime() <= maxDate.getTime()));
20743293 },
20753294
20763295 /* Provide the configuration settings for formatting/parsing. */
@@ -2125,9 +3344,12 @@
21263345 }
21273346
21283347 var otherArgs = Array.prototype.slice.call(arguments, 1);
2129 - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
 3348+ if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))
21303349 return $.datepicker['_' + options + 'Datepicker'].
21313350 apply($.datepicker, [this[0]].concat(otherArgs));
 3351+ if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
 3352+ return $.datepicker['_' + options + 'Datepicker'].
 3353+ apply($.datepicker, [this[0]].concat(otherArgs));
21323354 return this.each(function() {
21333355 typeof options == 'string' ?
21343356 $.datepicker['_' + options + 'Datepicker'].
@@ -2139,36 +3361,35 @@
21403362 $.datepicker = new Datepicker(); // singleton instance
21413363 $.datepicker.initialized = false;
21423364 $.datepicker.uuid = new Date().getTime();
2143 -$.datepicker.version = "1.7.1";
 3365+$.datepicker.version = "1.8.2";
21443366
21453367 // Workaround for #4055
21463368 // Add another global to avoid noConflict issues with inline event handlers
2147 -window.DP_jQuery = $;
 3369+window['DP_jQuery_' + dpuuid] = $;
21483370
21493371 })(jQuery);
21503372 /*
2151 - * jQuery UI Progressbar 1.7.1
 3373+ * jQuery UI Progressbar 1.8.2
21523374 *
2153 - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 3375+ * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
21543376 * Dual licensed under the MIT (MIT-LICENSE.txt)
21553377 * and GPL (GPL-LICENSE.txt) licenses.
21563378 *
21573379 * http://docs.jquery.com/UI/Progressbar
21583380 *
21593381 * Depends:
2160 - * ui.core.js
 3382+ * jquery.ui.core.js
 3383+ * jquery.ui.widget.js
21613384 */
2162 -(function($) {
 3385+(function( $ ) {
21633386
2164 -$.widget("ui.progressbar", {
2165 -
2166 - _init: function() {
2167 -
 3387+$.widget( "ui.progressbar", {
 3388+ options: {
 3389+ value: 0
 3390+ },
 3391+ _create: function() {
21683392 this.element
2169 - .addClass("ui-progressbar"
2170 - + " ui-widget"
2171 - + " ui-widget-content"
2172 - + " ui-corner-all")
 3393+ .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
21733394 .attr({
21743395 role: "progressbar",
21753396 "aria-valuemin": this._valueMin(),
@@ -2176,88 +3397,84 @@
21773398 "aria-valuenow": this._value()
21783399 });
21793400
2180 - this.valueDiv = $('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);
 3401+ this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
 3402+ .appendTo( this.element );
21813403
21823404 this._refreshValue();
2183 -
21843405 },
21853406
21863407 destroy: function() {
2187 -
21883408 this.element
2189 - .removeClass("ui-progressbar"
2190 - + " ui-widget"
2191 - + " ui-widget-content"
2192 - + " ui-corner-all")
2193 - .removeAttr("role")
2194 - .removeAttr("aria-valuemin")
2195 - .removeAttr("aria-valuemax")
2196 - .removeAttr("aria-valuenow")
2197 - .removeData("progressbar")
2198 - .unbind(".progressbar");
 3409+ .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
 3410+ .removeAttr( "role" )
 3411+ .removeAttr( "aria-valuemin" )
 3412+ .removeAttr( "aria-valuemax" )
 3413+ .removeAttr( "aria-valuenow" );
21993414
22003415 this.valueDiv.remove();
22013416
2202 - $.widget.prototype.destroy.apply(this, arguments);
2203 -
 3417+ $.Widget.prototype.destroy.apply( this, arguments );
22043418 },
22053419
2206 - value: function(newValue) {
2207 - arguments.length && this._setData("value", newValue);
2208 - return this._value();
 3420+ value: function( newValue ) {
 3421+ if ( newValue === undefined ) {
 3422+ return this._value();
 3423+ }
 3424+
 3425+ this._setOption( "value", newValue );
 3426+ return this;
22093427 },
22103428
2211 - _setData: function(key, value) {
2212 -
2213 - switch (key) {
2214 - case 'value':
 3429+ _setOption: function( key, value ) {
 3430+ switch ( key ) {
 3431+ case "value":
22153432 this.options.value = value;
22163433 this._refreshValue();
2217 - this._trigger('change', null, {});
 3434+ this._trigger( "change" );
22183435 break;
22193436 }
22203437
2221 - $.widget.prototype._setData.apply(this, arguments);
2222 -
 3438+ $.Widget.prototype._setOption.apply( this, arguments );
22233439 },
22243440
22253441 _value: function() {
2226 -
22273442 var val = this.options.value;
2228 - if (val < this._valueMin()) val = this._valueMin();
2229 - if (val > this._valueMax()) val = this._valueMax();
 3443+ // normalize invalid value
 3444+ if ( typeof val !== "number" ) {
 3445+ val = 0;
 3446+ }
 3447+ if ( val < this._valueMin() ) {
 3448+ val = this._valueMin();
 3449+ }
 3450+ if ( val > this._valueMax() ) {
 3451+ val = this._valueMax();
 3452+ }
22303453
22313454 return val;
2232 -
22333455 },
22343456
22353457 _valueMin: function() {
2236 - var valueMin = 0;
2237 - return valueMin;
 3458+ return 0;
22383459 },
22393460
22403461 _valueMax: function() {
2241 - var valueMax = 100;
2242 - return valueMax;
 3462+ return 100;
22433463 },
22443464
22453465 _refreshValue: function() {
22463466 var value = this.value();
2247 - this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right");
2248 - this.valueDiv.width(value + '%');
2249 - this.element.attr("aria-valuenow", value);
 3467+ this.valueDiv
 3468+ [ value === this._valueMax() ? "addClass" : "removeClass"]( "ui-corner-right" )
 3469+ .width( value + "%" );
 3470+ this.element.attr( "aria-valuenow", value );
22503471 }
2251 -
22523472 });
22533473
2254 -$.extend($.ui.progressbar, {
2255 - version: "1.7.1",
2256 - defaults: {
2257 - value: 0
2258 - }
 3474+$.extend( $.ui.progressbar, {
 3475+ version: "1.8.2"
22593476 });
22603477
2261 -})(jQuery);
 3478+})( jQuery );
22623479 // tipsy, facebook style tooltips for jquery
22633480 // version 1.0.0a
22643481 // (c) 2008-2010 jason frame [jason@onehackoranother.com]
@@ -7912,7 +9129,9 @@
79139130 // because IE does not load JSON properly in an iframe
79149131 json = $j( doc.body ).find( 'pre' ).text();
79159132 mw.log( 'iframe:json::' + json );
7916 - if ( json ) {
 9133+ // check that the JSON is not an XML error message
 9134+ // (this happens when user aborts upload, we get the API docs in XML wrapped in HTML)
 9135+ if ( json && json.substring(0, 5) !== '<?xml' ) {
79179136 response = window["eval"]( "( " + json + " )" );
79189137 } else {
79199138 response = {};
@@ -9210,6 +10429,7 @@
921110430 * remove this upload. n.b. we trigger a removeUpload this is usually triggered from
921210431 */
921310432 remove: function() {
 10433+ this.state = 'aborted';
921410434 if ( this.details && this.details.div ) {
921510435 this.details.div.remove();
921610436 }
@@ -9251,6 +10471,9 @@
925210472 */
925310473 setTransported: function( result ) {
925410474 var _this = this;
 10475+ if ( _this.state == 'aborted' ) {
 10476+ return;
 10477+ }
925510478
925610479 if ( result.upload && result.upload.imageinfo ) {
925710480 // success
@@ -9462,10 +10685,11 @@
946310686 _this.$fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
946410687 .change( function() { _this.fileChanged(); } );
946510688
 10689+ _this.$indicator = $j( '<div class="mwe-upwiz-file-indicator"></div>' );
946610690
946710691 visibleFilenameDiv = $j('<div class="mwe-upwiz-visible-file"></div>')
9468 - .append( '<div class="mwe-upwiz-file-indicator"></div>'
9469 - + '<div class="mwe-upwiz-visible-file-filename">'
 10692+ .append( _this.$indicator )
 10693+ .append( '<div class="mwe-upwiz-visible-file-filename">'
947010694 + '<div class="mwe-upwiz-file-preview"/>'
947110695 + '<div class="mwe-upwiz-file-texts">'
947210696 + '<div class="mwe-upwiz-visible-file-filename-text"/>'
@@ -9551,16 +10775,22 @@
955210776 * @param String statusClass: corresponds to a class mwe-upwiz-status which changes style of indicator.
955310777 */
955410778 showIndicator: function( statusClass ) {
9555 - var $indicator = $j( this.div ).find( '.mwe-upwiz-file-indicator' );
9556 - // remove any other such classes
9557 - $j.each( $indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
 10779+ this.clearIndicator();
 10780+ // add the desired class and make it visible, if it wasn't already.
 10781+ this.$indicator.addClass( 'mwe-upwiz-status-' + statusClass )
 10782+ .css( 'visibility', 'visible' );
 10783+ },
 10784+
 10785+ /**
 10786+ * Reset the graphic indicator
 10787+ */
 10788+ clearIndicator: function() {
 10789+ var _this = this;
 10790+ $j.each( _this.$indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
955810791 if ( className.match( /^mwe-upwiz-status/ ) ) {
9559 - $indicator.removeClass( className );
 10792+ _this.$indicator.removeClass( className );
956010793 }
956110794 } );
9562 - // add the desired class and make it visible, if it wasn't already.
9563 - $indicator.addClass( 'mwe-upwiz-status-' + statusClass )
9564 - .css( 'visibility', 'visible' );
956510795 },
956610796
956710797 /**
@@ -9671,12 +10901,14 @@
967210902 .width( $covered.outerWidth() )
967310903 .height( $covered.outerHeight() );
967410904
 10905+ this.fileCtrlContainer.css( { 'z-index': 1 } );
 10906+
967510907 // shift the file input over with negative margins,
967610908 // internal to the overflow-containing div, so the div shows all button
967710909 // and none of the textfield-like input
967810910 this.$fileInputCtrl.css( {
967910911 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px',
9680 - 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px'
 10912+ 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px',
968110913 } );
968210914
968310915
@@ -10708,35 +11940,41 @@
1070911941 createInterface: function( selector ) {
1071011942 var _this = this;
1071111943
 11944+ // construct the arrow steps from the UL in the HTML
1071211945 $j( '#mwe-upwiz-steps' )
1071311946 .addClass( 'ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix' )
1071411947 .arrowSteps();
10715 -
 11948+
 11949+ // make all stepdiv proceed buttons into jquery buttons
 11950+ $j( '.mwe-upwiz-stepdiv .mwe-upwiz-buttons button' )
 11951+ .button()
 11952+ .css( { 'margin-left': '1em' } );
 11953+
 11954+
 11955+ $j( '.mwe-upwiz-button-begin' )
 11956+ .click( function() { _this.reset(); } );
 11957+
1071611958 $j( '.mwe-upwiz-button-home' )
10717 - .append( gM( 'mwe-upwiz-home' ) )
1071811959 .click( function() { window.location.href = '/'; } );
10719 -
10720 - $j( '.mwe-upwiz-button-begin' )
10721 - .append( gM( 'mwe-upwiz-upload-another' ) )
10722 - .click( function() { _this.reset(); } );
10723 -
 11960+
1072411961 // handler for next button
1072511962 $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next')
10726 - .append( gM( 'mwe-upwiz-next' ) )
1072711963 .click( function() {
1072811964 _this.moveToStep( 'file', function() {
1072911965 // we explicitly move the file input at this point
1073011966 // because it was probably jumping around due to other "steps" on this page during file construction.
1073111967 // XXX using a timeout is lame, are there other options?
1073211968 // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML
10733 - setTimeout( function() {
 11969+ setTimeout( function() {
1073411970 upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
1073511971 }, 300 );
1073611972 } );
1073711973 } );
1073811974
10739 - $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-button-next')
10740 - .append( gM( 'mwe-upwiz-next-file' ) )
 11975+ $j( '#mwe-upwiz-add-file' ).button();
 11976+
 11977+ $j( '#mwe-upwiz-upload-ctrl' )
 11978+ .button()
1074111979 .click( function() {
1074211980 // check if there is an upload at all (should never happen)
1074311981 if ( _this.uploads.length === 0 ) {
@@ -10746,19 +11984,24 @@
1074711985 }
1074811986
1074911987 _this.removeEmptyUploads();
10750 - _this.startUploads( function() {
10751 - // okay all uploads are done, we may be ready to go to the next step
10752 - alert( "hey, uploads are done");
10753 -
10754 - } );
 11988+ _this.startUploads();
1075511989 } );
1075611990
 11991+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-next' ).click( function() {
 11992+ _this.removeErrorUploads();
 11993+ _this.prepareAndMoveToDeeds();
 11994+ } );
 11995+ $j ( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-retry' ).click( function() {
 11996+ _this.hideFileEndButtons();
 11997+ _this.startUploads();
 11998+ } );
 11999+
 12000+
1075712001 // DEEDS div
1075812002
1075912003 $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) );
1076012004
1076112005 $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next')
10762 - .append( gM( 'mwe-upwiz-next-deeds' ) )
1076312006 .click( function() {
1076412007 // validate has the side effect of notifying the user of problems, or removing existing notifications.
1076512008 // if returns false, you can assume there are notifications in the interface.
@@ -10791,7 +12034,6 @@
1079212035 // DETAILS div
1079312036
1079412037 $j( '#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next' )
10795 - .append( gM( 'mwe-upwiz-next-details' ) )
1079612038 .click( function() {
1079712039 if ( _this.detailsValid() ) {
1079812040 _this.detailsSubmit( function() {
@@ -10816,6 +12058,7 @@
1081712059
1081812060 // do some last minute prep before advancing to the DEEDS page
1081912061 prepareAndMoveToDeeds: function() {
 12062+ var _this = this;
1082012063
1082112064 // these deeds are standard
1082212065 var deeds = [
@@ -10985,25 +12228,56 @@
1098612229 });
1098712230 },
1098812231
 12232+
 12233+ /**
 12234+ * Hide the button choices at the end of the file step.
 12235+ */
 12236+ hideFileEndButtons: function() {
 12237+ $j( '#mwe-upwiz-stepdiv .mwe-upwiz-buttons' ).hide();
 12238+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice' ).hide();
 12239+ },
 12240+
1098912241 /**
1099012242 * This is useful to clean out unused upload file inputs if the user hits GO.
1099112243 * We are using a second array to iterate, because we will be splicing the main one, _this.uploads
1099212244 */
1099312245 removeEmptyUploads: function() {
10994 - var _this = this;
 12246+ this.removeMatchingUploads( function( upload ) {
 12247+ return mw.isEmpty( upload.ui.$fileInputCtrl.val() );
 12248+ } );
 12249+ },
 12250+
 12251+ /**
 12252+ * Clear out uploads that are in error mode, perhaps before proceeding to the next step
 12253+ */
 12254+ removeErrorUploads: function() {
 12255+ this.removeMatchingUploads( function( upload ) {
 12256+ return upload.state === 'error';
 12257+ } );
 12258+ },
 12259+
 12260+
 12261+ /**
 12262+ * This is useful to clean out file inputs that we don't want for some reason (error, empty...)
 12263+ * We are using a second array to iterate, because we will be splicing the main one, _this.uploads
 12264+ * @param Function criterion: function to test the upload, returns boolean; true if should be removed
 12265+ */
 12266+ removeMatchingUploads: function( criterion ) {
1099512267 var toRemove = [];
1099612268
10997 - for ( var i = 0; i < _this.uploads.length; i++ ) {
10998 - if ( mw.isEmpty( _this.uploads[i].ui.$fileInputCtrl.val() ) ) {
10999 - toRemove.push( _this.uploads[i] );
 12269+ $j.each( this.uploads, function( i, upload ) {
 12270+ if ( criterion( upload ) ) {
 12271+ toRemove.push( upload );
1100012272 }
11001 - }
 12273+ } );
1100212274
11003 - for ( var j = 0; j < toRemove.length; j++ ) {
11004 - toRemove[j].remove();
11005 - }
 12275+ $j.each( toRemove, function( i, upload ) {
 12276+ upload.remove();
 12277+ } )
1100612278 },
1100712279
 12280+
 12281+
1100812282 /**
1100912283 * Manage transitioning all of our uploads from one state to another -- like from "new" to "uploaded".
1101012284 *
@@ -11028,7 +12302,7 @@
1102912303 } else if ( ( upload.state == beginState ) && ( uploadsToStart > 0 ) ) {
1103012304 starter( upload );
1103112305 uploadsToStart--;
11032 - }
 12306+ }
1103312307 } );
1103412308
1103512309 // build in a little delay even for the end state, so user can see progress bar in a complete state.
@@ -11049,17 +12323,28 @@
1105012324 * and kicks off a thread which will take from the queue.
1105112325 * @param endCallback - to execute when uploads are completed
1105212326 */
11053 - startUploads: function( endCallback ) {
 12327+ startUploads: function() {
1105412328 var _this = this;
 12329+
1105512330 // remove the upload button, and the add file button
1105612331 $j( '#mwe-upwiz-upload-ctrls' ).hide();
 12332+ _this.hideFileEndButtons();
1105712333 $j( '#mwe-upwiz-add-file' ).hide();
1105812334
 12335+ // reset any uploads in error state back to be shiny & new
 12336+ $j.each( _this.uploads, function( i, upload ) {
 12337+ if ( upload.state === 'error' ) {
 12338+ upload.state = 'new';
 12339+ upload.ui.clearIndicator();
 12340+ upload.ui.clearStatus();
 12341+ }
 12342+ } );
 12343+
1105912344 var allowCloseWindow = $j().preventCloseWindow( {
1106012345 message: gM( 'mwe-prevent-close')
1106112346 } );
1106212347
11063 -
 12348+ $j( '#mwe-upwiz-progress' ).show();
1106412349 var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress',
1106512350 gM( 'mwe-upwiz-uploading' ),
1106612351 _this.uploads,
@@ -11069,46 +12354,89 @@
1107012355 'transportWeight' );
1107112356 progressBar.start();
1107212357
11073 -
1107412358 // remove ability to change files
1107512359 // ideally also hide the "button"... but then we require styleable file input CSS trickery
1107612360 // although, we COULD do this just for files already in progress...
1107712361
1107812362 // it might be interesting to just make this creational -- attach it to the dom element representing
1107912363 // the progress bar and elapsed time
 12364+
1108012365 _this.makeTransitioner(
1108112366 'new',
1108212367 [ 'transporting', 'transported', 'metadata' ],
11083 - [ 'error', 'verified' ],
 12368+ [ 'error', 'stashed' ],
1108412369 function( upload ) {
1108512370 upload.start();
1108612371 },
1108712372 function() {
1108812373 allowCloseWindow();
1108912374 $j().notify( gM( 'mwe-upwiz-files-complete' ) );
11090 - endCallback();
 12375+ _this.showFileNext();
1109112376 }
1109212377 );
1109312378 },
1109412379
 12380+ /**
 12381+ * Figure out what to do and what options to show after the uploads have stopped.
 12382+ * Uploading has stopped for one of the following reasons:
 12383+ * 1) The user removed all uploads before they completed, in which case we are at upload.length === 0. We should start over and allow them to add new ones
 12384+ * 2) All succeeded - show link to next step
 12385+ * 3) Some failed, some succeeded - offer them the chance to retry the failed ones or go on to the next step
 12386+ * 4) All failed -- have to retry, no other option
 12387+ * In principle there could be other configurations, like having the uploads not all in error or stashed state, but
 12388+ * we trust that this hasn't happened.
 12389+ */
 12390+ showFileNext: function() {
 12391+ if ( this.uploads.length === 0 ) {
 12392+ this.updateFileCounts();
 12393+ $j( '#mwe-upwiz-progress' ).hide();
 12394+ $j( '#mwe-upwiz-upload-ctrls' ).show();
 12395+ $j( '#mwe-upwiz-add-file' ).show();
 12396+ return;
 12397+ }
 12398+ var errorCount = 0;
 12399+ var stashedCount = 0;
 12400+ $j.each( this.uploads, function( i, upload ) {
 12401+ if ( upload.state === 'error' ) {
 12402+ errorCount++;
 12403+ } else if ( upload.state === 'stashed' ) {
 12404+ stashedCount++;
 12405+ } else {
 12406+ mw.log( "upload " + i + " not in appropriate state for filenext: " + upload.state );
 12407+ }
 12408+ } );
 12409+ var selector = null;
 12410+ if ( stashedCount === this.uploads.length ) {
 12411+ selector = '.mwe-upwiz-file-next-all-ok';
 12412+ } else if ( errorCount === this.uploads.length ) {
 12413+ selector = '.mwe-upwiz-file-next-all-failed';
 12414+ } else {
 12415+ selector = '.mwe-upwiz-file-next-some-failed';
 12416+ }
 12417+
 12418+ // perhaps the button should slide down?
 12419+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show().find( selector ).show();
 12420+
 12421+ },
1109512422
11096 -
1109712423 /**
1109812424 * Occurs whenever we need to update the interface based on how many files there are
1109912425 * Thhere is an uncounted upload, waiting to be used, which has a fileInput which covers the
1110012426 * "add an upload" button. This is absolutely positioned, so it needs to be moved if another upload was removed.
1110112427 * The uncounted upload is also styled differently between the zero and n files cases
 12428+ *
 12429+ * TODO in the case of aborting the only upload, we get kicked back here, but the file input over the add file
 12430+ * button has been removed. How to get it back into "virginal" state?
1110212431 */
1110312432 updateFileCounts: function() {
1110412433 var _this = this;
1110512434
1110612435 if ( _this.uploads.length ) {
1110712436 // we have uploads ready to go, so allow us to proceed
11108 - $j( '#mwe-upwiz-upload-ctrl' ).removeAttr( 'disabled' );
11109 - $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show();
 12437+ $j( '#mwe-upwiz-upload-ctrl-container' ).show();
1111012438
1111112439 // changes the "click here to add files" to "add another file"
11112 - $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-n' ) );
 12440+ $j( '#mwe-upwiz-add-file span' ).html( gM( 'mwe-upwiz-add-file-n' ) );
1111312441 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
1111412442 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
1111512443
@@ -11124,7 +12452,8 @@
1112512453 $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' );
1112612454 } else {
1112712455 // no uploads, so don't allow us to proceed
11128 - $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 12456+ // $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 12457+ $j( '#mwe-upwiz-upload-ctrl-container' ).hide();
1112912458
1113012459 // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced
1113112460 // file input element that becomes the "click here to add"
Index: trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.css
@@ -0,0 +1,445 @@
 2+/*
 3+* jQuery UI CSS Framework
 4+* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 5+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 6+*/
 7+
 8+/* Layout helpers
 9+----------------------------------*/
 10+.ui-helper-hidden { display: none; }
 11+.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
 12+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
 13+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
 14+.ui-helper-clearfix { display: inline-block; }
 15+/* required comment for clearfix to work in Opera \*/
 16+* html .ui-helper-clearfix { height:1%; }
 17+.ui-helper-clearfix { display:block; }
 18+/* end clearfix */
 19+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
 20+
 21+
 22+/* Interaction Cues
 23+----------------------------------*/
 24+.ui-state-disabled { cursor: default !important; }
 25+
 26+
 27+/* Icons
 28+----------------------------------*/
 29+
 30+/* states and images */
 31+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
 32+
 33+
 34+/* Misc visuals
 35+----------------------------------*/
 36+
 37+/* Overlays */
 38+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
 39+
 40+
 41+/*
 42+* jQuery UI CSS Framework
 43+* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 44+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 45+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=normal&fsDefault=1.0em&cornerRadius=3px&bgColorHeader=ffffff&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=aed0ea&fcHeader=222222&iconColorHeader=72a7cf&bgColorContent=f2f5f7&bgTextureContent=04_highlight_hard.png&bgImgOpacityContent=100&borderColorContent=cccccc&fcContent=362b36&iconColorContent=72a7cf&bgColorDefault=d7ebf9&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=80&borderColorDefault=aed0ea&fcDefault=2779aa&iconColorDefault=3d80b3&bgColorHover=e4f1fb&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=100&borderColorHover=74b2e2&fcHover=0070a3&iconColorHover=2694e8&bgColorActive=f0f0f0&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=cccccc&fcActive=000000&iconColorActive=666666&bgColorHighlight=ffef8f&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=25&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=cd0a0a&bgTextureError=01_flat.png&bgImgOpacityError=15&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=000000&bgTextureOverlay=21_glow_ball.png&bgImgOpacityOverlay=100&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=70&opacityShadow=20&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px
 46+*/
 47+
 48+
 49+/* Component containers
 50+----------------------------------*/
 51+.ui-widget { font-family: sans-serif; font-size: 0.8em; }
 52+.ui-widget .ui-widget { font-size: 1em; }
 53+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: sans-serif; font-size: 1em; }
 54+.ui-widget-content { border: none; background: #f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; color: #362b36; }
 55+.ui-widget-content a { color: #362b36; }
 56+.ui-widget-header { border: 1px solid #aed0ea; line-height: 1em; background: #ffffff url(images/ui-bg_highlight-soft_100_ffffff_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
 57+.ui-widget-header a { color: #222222; }
 58+
 59+/* Interaction states
 60+----------------------------------*/
 61+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aed0ea; background: #d7ebf9 url(images/ui-bg_highlight-hard_80_d7ebf9_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #2779aa; }
 62+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2779aa; text-decoration: none; }
 63+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #74b2e2; background: #e4f1fb url(images/ui-bg_highlight-soft_100_e4f1fb_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #0070a3; }
 64+.ui-state-hover a, .ui-state-hover a:hover { color: #0070a3; text-decoration: none; }
 65+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #cccccc; background: #f0f0f0 url(images/ui-bg_inset-hard_100_f0f0f0_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; }
 66+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #000000; text-decoration: none; }
 67+.ui-widget :active { outline: none; }
 68+
 69+/* Interaction Cues
 70+----------------------------------*/
 71+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #ffef8f url(images/ui-bg_highlight-soft_25_ffef8f_1x100.png) 50% top repeat-x; color: #363636; }
 72+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
 73+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #cd0a0a url(images/ui-bg_flat_15_cd0a0a_40x100.png) 50% 50% repeat-x; color: #ffffff; }
 74+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
 75+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
 76+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
 77+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
 78+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
 79+
 80+/* Icons
 81+----------------------------------*/
 82+
 83+/* states and images */
 84+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_72a7cf_256x240.png); }
 85+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); }
 86+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); }
 87+.ui-state-default .ui-icon { background-image: url(images/ui-icons_3d80b3_256x240.png); }
 88+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_2694e8_256x240.png); }
 89+.ui-state-active .ui-icon {background-image: url(images/ui-icons_666666_256x240.png); }
 90+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
 91+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
 92+
 93+/* positioning */
 94+.ui-icon-carat-1-n { background-position: 0 0; }
 95+.ui-icon-carat-1-ne { background-position: -16px 0; }
 96+.ui-icon-carat-1-e { background-position: -32px 0; }
 97+.ui-icon-carat-1-se { background-position: -48px 0; }
 98+.ui-icon-carat-1-s { background-position: -64px 0; }
 99+.ui-icon-carat-1-sw { background-position: -80px 0; }
 100+.ui-icon-carat-1-w { background-position: -96px 0; }
 101+.ui-icon-carat-1-nw { background-position: -112px 0; }
 102+.ui-icon-carat-2-n-s { background-position: -128px 0; }
 103+.ui-icon-carat-2-e-w { background-position: -144px 0; }
 104+.ui-icon-triangle-1-n { background-position: 0 -16px; }
 105+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
 106+.ui-icon-triangle-1-e { background-position: -32px -16px; }
 107+.ui-icon-triangle-1-se { background-position: -48px -16px; }
 108+.ui-icon-triangle-1-s { background-position: -64px -16px; }
 109+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
 110+.ui-icon-triangle-1-w { background-position: -96px -16px; }
 111+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
 112+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
 113+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
 114+.ui-icon-arrow-1-n { background-position: 0 -32px; }
 115+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
 116+.ui-icon-arrow-1-e { background-position: -32px -32px; }
 117+.ui-icon-arrow-1-se { background-position: -48px -32px; }
 118+.ui-icon-arrow-1-s { background-position: -64px -32px; }
 119+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
 120+.ui-icon-arrow-1-w { background-position: -96px -32px; }
 121+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
 122+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
 123+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
 124+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
 125+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
 126+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
 127+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
 128+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
 129+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
 130+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
 131+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
 132+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
 133+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
 134+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
 135+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
 136+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
 137+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
 138+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
 139+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
 140+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
 141+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
 142+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
 143+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
 144+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
 145+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
 146+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
 147+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
 148+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
 149+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
 150+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
 151+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
 152+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
 153+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
 154+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
 155+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
 156+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
 157+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
 158+.ui-icon-arrow-4 { background-position: 0 -80px; }
 159+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
 160+.ui-icon-extlink { background-position: -32px -80px; }
 161+.ui-icon-newwin { background-position: -48px -80px; }
 162+.ui-icon-refresh { background-position: -64px -80px; }
 163+.ui-icon-shuffle { background-position: -80px -80px; }
 164+.ui-icon-transfer-e-w { background-position: -96px -80px; }
 165+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
 166+.ui-icon-folder-collapsed { background-position: 0 -96px; }
 167+.ui-icon-folder-open { background-position: -16px -96px; }
 168+.ui-icon-document { background-position: -32px -96px; }
 169+.ui-icon-document-b { background-position: -48px -96px; }
 170+.ui-icon-note { background-position: -64px -96px; }
 171+.ui-icon-mail-closed { background-position: -80px -96px; }
 172+.ui-icon-mail-open { background-position: -96px -96px; }
 173+.ui-icon-suitcase { background-position: -112px -96px; }
 174+.ui-icon-comment { background-position: -128px -96px; }
 175+.ui-icon-person { background-position: -144px -96px; }
 176+.ui-icon-print { background-position: -160px -96px; }
 177+.ui-icon-trash { background-position: -176px -96px; }
 178+.ui-icon-locked { background-position: -192px -96px; }
 179+.ui-icon-unlocked { background-position: -208px -96px; }
 180+.ui-icon-bookmark { background-position: -224px -96px; }
 181+.ui-icon-tag { background-position: -240px -96px; }
 182+.ui-icon-home { background-position: 0 -112px; }
 183+.ui-icon-flag { background-position: -16px -112px; }
 184+.ui-icon-calendar { background-position: -32px -112px; }
 185+.ui-icon-cart { background-position: -48px -112px; }
 186+.ui-icon-pencil { background-position: -64px -112px; }
 187+.ui-icon-clock { background-position: -80px -112px; }
 188+.ui-icon-disk { background-position: -96px -112px; }
 189+.ui-icon-calculator { background-position: -112px -112px; }
 190+.ui-icon-zoomin { background-position: -128px -112px; }
 191+.ui-icon-zoomout { background-position: -144px -112px; }
 192+.ui-icon-search { background-position: -160px -112px; }
 193+.ui-icon-wrench { background-position: -176px -112px; }
 194+.ui-icon-gear { background-position: -192px -112px; }
 195+.ui-icon-heart { background-position: -208px -112px; }
 196+.ui-icon-star { background-position: -224px -112px; }
 197+.ui-icon-link { background-position: -240px -112px; }
 198+.ui-icon-cancel { background-position: 0 -128px; }
 199+.ui-icon-plus { background-position: -16px -128px; }
 200+.ui-icon-plusthick { background-position: -32px -128px; }
 201+.ui-icon-minus { background-position: -48px -128px; }
 202+.ui-icon-minusthick { background-position: -64px -128px; }
 203+.ui-icon-close { background-position: -80px -128px; }
 204+.ui-icon-closethick { background-position: -96px -128px; }
 205+.ui-icon-key { background-position: -112px -128px; }
 206+.ui-icon-lightbulb { background-position: -128px -128px; }
 207+.ui-icon-scissors { background-position: -144px -128px; }
 208+.ui-icon-clipboard { background-position: -160px -128px; }
 209+.ui-icon-copy { background-position: -176px -128px; }
 210+.ui-icon-contact { background-position: -192px -128px; }
 211+.ui-icon-image { background-position: -208px -128px; }
 212+.ui-icon-video { background-position: -224px -128px; }
 213+.ui-icon-script { background-position: -240px -128px; }
 214+.ui-icon-alert { background-position: 0 -144px; }
 215+.ui-icon-info { background-position: -16px -144px; }
 216+.ui-icon-notice { background-position: -32px -144px; }
 217+.ui-icon-help { background-position: -48px -144px; }
 218+.ui-icon-check { background-position: -64px -144px; }
 219+.ui-icon-bullet { background-position: -80px -144px; }
 220+.ui-icon-radio-off { background-position: -96px -144px; }
 221+.ui-icon-radio-on { background-position: -112px -144px; }
 222+.ui-icon-pin-w { background-position: -128px -144px; }
 223+.ui-icon-pin-s { background-position: -144px -144px; }
 224+.ui-icon-play { background-position: 0 -160px; }
 225+.ui-icon-pause { background-position: -16px -160px; }
 226+.ui-icon-seek-next { background-position: -32px -160px; }
 227+.ui-icon-seek-prev { background-position: -48px -160px; }
 228+.ui-icon-seek-end { background-position: -64px -160px; }
 229+.ui-icon-seek-start { background-position: -80px -160px; }
 230+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
 231+.ui-icon-seek-first { background-position: -80px -160px; }
 232+.ui-icon-stop { background-position: -96px -160px; }
 233+.ui-icon-eject { background-position: -112px -160px; }
 234+.ui-icon-volume-off { background-position: -128px -160px; }
 235+.ui-icon-volume-on { background-position: -144px -160px; }
 236+.ui-icon-power { background-position: 0 -176px; }
 237+.ui-icon-signal-diag { background-position: -16px -176px; }
 238+.ui-icon-signal { background-position: -32px -176px; }
 239+.ui-icon-battery-0 { background-position: -48px -176px; }
 240+.ui-icon-battery-1 { background-position: -64px -176px; }
 241+.ui-icon-battery-2 { background-position: -80px -176px; }
 242+.ui-icon-battery-3 { background-position: -96px -176px; }
 243+.ui-icon-circle-plus { background-position: 0 -192px; }
 244+.ui-icon-circle-minus { background-position: -16px -192px; }
 245+.ui-icon-circle-close { background-position: -32px -192px; }
 246+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
 247+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
 248+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
 249+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
 250+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
 251+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
 252+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
 253+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
 254+.ui-icon-circle-zoomin { background-position: -176px -192px; }
 255+.ui-icon-circle-zoomout { background-position: -192px -192px; }
 256+.ui-icon-circle-check { background-position: -208px -192px; }
 257+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
 258+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
 259+.ui-icon-circlesmall-close { background-position: -32px -208px; }
 260+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
 261+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
 262+.ui-icon-squaresmall-close { background-position: -80px -208px; }
 263+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
 264+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
 265+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
 266+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
 267+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
 268+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
 269+
 270+
 271+/* Misc visuals
 272+----------------------------------*/
 273+
 274+/* Corner radius */
 275+.ui-corner-tl { -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; }
 276+.ui-corner-tr { -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; }
 277+.ui-corner-bl { -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; }
 278+.ui-corner-br { -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; }
 279+.ui-corner-top { -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; }
 280+.ui-corner-bottom { -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; }
 281+.ui-corner-right { -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; }
 282+.ui-corner-left { -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; }
 283+.ui-corner-all { -moz-border-radius: 0; -webkit-border-radius: 0; }
 284+
 285+/* Overlays */
 286+.ui-widget-overlay { background: #000000; opacity: .75;filter:Alpha(Opacity=75); }
 287+.ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; background: #000000 url(images/ui-bg_flat_70_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* Button
 288+----------------------------------*/
 289+
 290+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
 291+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
 292+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
 293+.ui-button-icons-only { width: 3.4em; }
 294+button.ui-button-icons-only { width: 3.7em; }
 295+
 296+/*button text element */
 297+.ui-button .ui-button-text { display: block; line-height: 1.4; }
 298+.ui-button-text-only .ui-button-text { padding: .125em .25em; }
 299+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
 300+.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
 301+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
 302+/* no icon support for input elements, provide padding by default */
 303+input.ui-button { padding: .4em 1em; }
 304+
 305+/*button icon element(s) */
 306+.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
 307+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
 308+.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
 309+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
 310+
 311+/*button sets*/
 312+.ui-buttonset { margin-right: 7px; }
 313+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
 314+
 315+/* workarounds */
 316+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
 317+
 318+
 319+
 320+
 321+
 322+/* Dialog
 323+----------------------------------*/
 324+.ui-dialog { position: absolute; padding: 0; width: 300px; }
 325+.ui-dialog .ui-dialog-titlebar { padding: .75em; position: relative; }
 326+.ui-dialog .ui-dialog-title { float: left; margin: 0; }
 327+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .75em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
 328+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
 329+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
 330+.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
 331+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
 332+.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
 333+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
 334+.ui-draggable .ui-dialog-titlebar { cursor: move; }
 335+/* Customizations */
 336+body .ui-dialog .ui-dialog-titlebar-close:hover {
 337+ text-decoration: none;
 338+}
 339+body .ui-dialog .ui-dialog-content .status-invalid input {
 340+ border: 2px solid red;
 341+ padding: 2px 1px;
 342+}
 343+body .ui-dialog .ui-dialog-titlebar {
 344+ padding: 0.9em 1.4em 0.6em !important;
 345+}
 346+body .ui-dialog .ui-dialog-buttonpane button {
 347+ -moz-border-radius: 4px;
 348+ -webkit-border-radius: 4px;
 349+ padding: 0.2em 0.6em 0.15em !important;
 350+ margin: 0.5em 0 0.5em 0.4em !important;
 351+ border: 1px solid #a6a6a6 !important;
 352+ background: #f2f2f2 url(images/button-off.png) repeat-x scroll 50% 100% !important;
 353+}
 354+body .ui-dialog .ui-dialog-buttonpane button:hover {
 355+ border-color: #6e7273;
 356+ background: #e1e1e1 url(images/button-over.png) repeat-x scroll 50% 100% !important;
 357+}
 358+body .ui-dialog .ui-dialog-buttonpane button:active,
 359+body .ui-dialog .ui-dialog-buttonpane button:focus {
 360+ border-color: #707271;
 361+ background: #bfbfbf url(images/button-down.png) repeat-x scroll 50% 100% !important;
 362+}
 363+body .ui-dialog .ui-dialog-buttonpane button.disabled {
 364+ color: #7f7f7f;
 365+ border-color: #cccccc;
 366+ background: #f2f2f2 url(images/button-disabled.png) repeat-x scroll 50% 100% !important;
 367+}
 368+/* Disables the annoying dashed border Firefox puts on active buttons */
 369+body .ui-dialog .ui-dialog-buttonpane button::-moz-focus-inner {
 370+ border: 0;
 371+}
 372+body .ui-dialog .ui-widget-header {
 373+ background: #f0f0f0 url(images/titlebar-fade.png) repeat-x scroll 50% 100% !important;
 374+}
 375+/* FIXME: Should just update the icon sprite if we're keeping this X */
 376+body .ui-dialog .ui-icon-closethick {
 377+ background: url(images/close-x.png) no-repeat 50% 50% !important;
 378+}
 379+body .ui-dialog .ui-dialog-buttonpane {
 380+ margin-top: 0 !important;
 381+ padding:0.3em 1.4em 0.5em 1.4em !important;
 382+}
 383+/* Datepicker
 384+----------------------------------*/
 385+.ui-datepicker { width: 17em; padding: .2em .2em 0; }
 386+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
 387+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
 388+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
 389+.ui-datepicker .ui-datepicker-prev { left:2px; }
 390+.ui-datepicker .ui-datepicker-next { right:2px; }
 391+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
 392+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
 393+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
 394+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
 395+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
 396+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
 397+.ui-datepicker select.ui-datepicker-month,
 398+.ui-datepicker select.ui-datepicker-year { width: 49%;}
 399+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
 400+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
 401+.ui-datepicker td { border: 0; padding: 1px; }
 402+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
 403+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
 404+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
 405+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
 406+
 407+/* with multiple calendars */
 408+.ui-datepicker.ui-datepicker-multi { width:auto; }
 409+.ui-datepicker-multi .ui-datepicker-group { float:left; }
 410+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
 411+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
 412+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
 413+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
 414+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
 415+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
 416+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
 417+.ui-datepicker-row-break { clear:both; width:100%; }
 418+
 419+/* RTL support */
 420+.ui-datepicker-rtl { direction: rtl; }
 421+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
 422+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
 423+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
 424+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
 425+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
 426+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
 427+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
 428+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
 429+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
 430+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
 431+
 432+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
 433+.ui-datepicker-cover {
 434+ display: none; /*sorry for IE5*/
 435+ display/**/: block; /*sorry for IE5*/
 436+ position: absolute; /*must have*/
 437+ z-index: -1; /*must have*/
 438+ filter: mask(); /*must have*/
 439+ top: -4px; /*must have*/
 440+ left: -4px; /*must have*/
 441+ width: 200px; /*must have*/
 442+ height: 200px; /*must have*/
 443+}/* Progressbar
 444+----------------------------------*/
 445+.ui-progressbar { height:2em; text-align: left; }
 446+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
Property changes on: trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.css
___________________________________________________________________
Added: svn:eol-style
1447 + native
Index: trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.min.css
@@ -0,0 +1,327 @@
 2+
 3+.ui-helper-hidden{display:none;}
 4+.ui-helper-hidden-accessible{position:absolute;left:-99999999px;}
 5+.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none;}
 6+.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
 7+.ui-helper-clearfix{display:inline-block;}
 8+
 9+* html .ui-helper-clearfix{height:1%;}
 10+.ui-helper-clearfix{display:block;}
 11+
 12+.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0);}
 13+.ui-state-disabled{cursor:default !important;}
 14+.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;}
 15+.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}
 16+.ui-widget{font-family:sans-serif;font-size:0.8em;}
 17+.ui-widget .ui-widget{font-size:1em;}
 18+.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:sans-serif;font-size:1em;}
 19+.ui-widget-content{border:none;background:#f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x;color:#362b36;}
 20+.ui-widget-content a{color:#362b36;}
 21+.ui-widget-header{border:1px solid #aed0ea;line-height:1em;background:#ffffff url(images/ui-bg_highlight-soft_100_ffffff_1x100.png) 50% 50% repeat-x;color:#222222;font-weight:bold;}
 22+.ui-widget-header a{color:#222222;}
 23+.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #aed0ea;background:#d7ebf9 url(images/ui-bg_highlight-hard_80_d7ebf9_1x100.png) 50% 50% repeat-x;font-weight:normal;color:#2779aa;}
 24+.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#2779aa;text-decoration:none;}
 25+.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #74b2e2;background:#e4f1fb url(images/ui-bg_highlight-soft_100_e4f1fb_1x100.png) 50% 50% repeat-x;font-weight:normal;color:#0070a3;}
 26+.ui-state-hover a,.ui-state-hover a:hover{color:#0070a3;text-decoration:none;}
 27+.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #cccccc;background:#f0f0f0 url(images/ui-bg_inset-hard_100_f0f0f0_1x100.png) 50% 50% repeat-x;font-weight:normal;color:#000000;}
 28+.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#000000;text-decoration:none;}
 29+.ui-widget :active{outline:none;}
 30+.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #f9dd34;background:#ffef8f url(images/ui-bg_highlight-soft_25_ffef8f_1x100.png) 50% top repeat-x;color:#363636;}
 31+.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636;}
 32+.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#cd0a0a url(images/ui-bg_flat_15_cd0a0a_40x100.png) 50% 50% repeat-x;color:#ffffff;}
 33+.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#ffffff;}
 34+.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#ffffff;}
 35+.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold;}
 36+.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal;}
 37+.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none;}
 38+.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_72a7cf_256x240.png);}
 39+.ui-widget-content .ui-icon{background-image:url(images/ui-icons_72a7cf_256x240.png);}
 40+.ui-widget-header .ui-icon{background-image:url(images/ui-icons_72a7cf_256x240.png);}
 41+.ui-state-default .ui-icon{background-image:url(images/ui-icons_3d80b3_256x240.png);}
 42+.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_2694e8_256x240.png);}
 43+.ui-state-active .ui-icon{background-image:url(images/ui-icons_666666_256x240.png);}
 44+.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png);}
 45+.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png);}
 46+.ui-icon-carat-1-n{background-position:0 0;}
 47+.ui-icon-carat-1-ne{background-position:-16px 0;}
 48+.ui-icon-carat-1-e{background-position:-32px 0;}
 49+.ui-icon-carat-1-se{background-position:-48px 0;}
 50+.ui-icon-carat-1-s{background-position:-64px 0;}
 51+.ui-icon-carat-1-sw{background-position:-80px 0;}
 52+.ui-icon-carat-1-w{background-position:-96px 0;}
 53+.ui-icon-carat-1-nw{background-position:-112px 0;}
 54+.ui-icon-carat-2-n-s{background-position:-128px 0;}
 55+.ui-icon-carat-2-e-w{background-position:-144px 0;}
 56+.ui-icon-triangle-1-n{background-position:0 -16px;}
 57+.ui-icon-triangle-1-ne{background-position:-16px -16px;}
 58+.ui-icon-triangle-1-e{background-position:-32px -16px;}
 59+.ui-icon-triangle-1-se{background-position:-48px -16px;}
 60+.ui-icon-triangle-1-s{background-position:-64px -16px;}
 61+.ui-icon-triangle-1-sw{background-position:-80px -16px;}
 62+.ui-icon-triangle-1-w{background-position:-96px -16px;}
 63+.ui-icon-triangle-1-nw{background-position:-112px -16px;}
 64+.ui-icon-triangle-2-n-s{background-position:-128px -16px;}
 65+.ui-icon-triangle-2-e-w{background-position:-144px -16px;}
 66+.ui-icon-arrow-1-n{background-position:0 -32px;}
 67+.ui-icon-arrow-1-ne{background-position:-16px -32px;}
 68+.ui-icon-arrow-1-e{background-position:-32px -32px;}
 69+.ui-icon-arrow-1-se{background-position:-48px -32px;}
 70+.ui-icon-arrow-1-s{background-position:-64px -32px;}
 71+.ui-icon-arrow-1-sw{background-position:-80px -32px;}
 72+.ui-icon-arrow-1-w{background-position:-96px -32px;}
 73+.ui-icon-arrow-1-nw{background-position:-112px -32px;}
 74+.ui-icon-arrow-2-n-s{background-position:-128px -32px;}
 75+.ui-icon-arrow-2-ne-sw{background-position:-144px -32px;}
 76+.ui-icon-arrow-2-e-w{background-position:-160px -32px;}
 77+.ui-icon-arrow-2-se-nw{background-position:-176px -32px;}
 78+.ui-icon-arrowstop-1-n{background-position:-192px -32px;}
 79+.ui-icon-arrowstop-1-e{background-position:-208px -32px;}
 80+.ui-icon-arrowstop-1-s{background-position:-224px -32px;}
 81+.ui-icon-arrowstop-1-w{background-position:-240px -32px;}
 82+.ui-icon-arrowthick-1-n{background-position:0 -48px;}
 83+.ui-icon-arrowthick-1-ne{background-position:-16px -48px;}
 84+.ui-icon-arrowthick-1-e{background-position:-32px -48px;}
 85+.ui-icon-arrowthick-1-se{background-position:-48px -48px;}
 86+.ui-icon-arrowthick-1-s{background-position:-64px -48px;}
 87+.ui-icon-arrowthick-1-sw{background-position:-80px -48px;}
 88+.ui-icon-arrowthick-1-w{background-position:-96px -48px;}
 89+.ui-icon-arrowthick-1-nw{background-position:-112px -48px;}
 90+.ui-icon-arrowthick-2-n-s{background-position:-128px -48px;}
 91+.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px;}
 92+.ui-icon-arrowthick-2-e-w{background-position:-160px -48px;}
 93+.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px;}
 94+.ui-icon-arrowthickstop-1-n{background-position:-192px -48px;}
 95+.ui-icon-arrowthickstop-1-e{background-position:-208px -48px;}
 96+.ui-icon-arrowthickstop-1-s{background-position:-224px -48px;}
 97+.ui-icon-arrowthickstop-1-w{background-position:-240px -48px;}
 98+.ui-icon-arrowreturnthick-1-w{background-position:0 -64px;}
 99+.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px;}
 100+.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px;}
 101+.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px;}
 102+.ui-icon-arrowreturn-1-w{background-position:-64px -64px;}
 103+.ui-icon-arrowreturn-1-n{background-position:-80px -64px;}
 104+.ui-icon-arrowreturn-1-e{background-position:-96px -64px;}
 105+.ui-icon-arrowreturn-1-s{background-position:-112px -64px;}
 106+.ui-icon-arrowrefresh-1-w{background-position:-128px -64px;}
 107+.ui-icon-arrowrefresh-1-n{background-position:-144px -64px;}
 108+.ui-icon-arrowrefresh-1-e{background-position:-160px -64px;}
 109+.ui-icon-arrowrefresh-1-s{background-position:-176px -64px;}
 110+.ui-icon-arrow-4{background-position:0 -80px;}
 111+.ui-icon-arrow-4-diag{background-position:-16px -80px;}
 112+.ui-icon-extlink{background-position:-32px -80px;}
 113+.ui-icon-newwin{background-position:-48px -80px;}
 114+.ui-icon-refresh{background-position:-64px -80px;}
 115+.ui-icon-shuffle{background-position:-80px -80px;}
 116+.ui-icon-transfer-e-w{background-position:-96px -80px;}
 117+.ui-icon-transferthick-e-w{background-position:-112px -80px;}
 118+.ui-icon-folder-collapsed{background-position:0 -96px;}
 119+.ui-icon-folder-open{background-position:-16px -96px;}
 120+.ui-icon-document{background-position:-32px -96px;}
 121+.ui-icon-document-b{background-position:-48px -96px;}
 122+.ui-icon-note{background-position:-64px -96px;}
 123+.ui-icon-mail-closed{background-position:-80px -96px;}
 124+.ui-icon-mail-open{background-position:-96px -96px;}
 125+.ui-icon-suitcase{background-position:-112px -96px;}
 126+.ui-icon-comment{background-position:-128px -96px;}
 127+.ui-icon-person{background-position:-144px -96px;}
 128+.ui-icon-print{background-position:-160px -96px;}
 129+.ui-icon-trash{background-position:-176px -96px;}
 130+.ui-icon-locked{background-position:-192px -96px;}
 131+.ui-icon-unlocked{background-position:-208px -96px;}
 132+.ui-icon-bookmark{background-position:-224px -96px;}
 133+.ui-icon-tag{background-position:-240px -96px;}
 134+.ui-icon-home{background-position:0 -112px;}
 135+.ui-icon-flag{background-position:-16px -112px;}
 136+.ui-icon-calendar{background-position:-32px -112px;}
 137+.ui-icon-cart{background-position:-48px -112px;}
 138+.ui-icon-pencil{background-position:-64px -112px;}
 139+.ui-icon-clock{background-position:-80px -112px;}
 140+.ui-icon-disk{background-position:-96px -112px;}
 141+.ui-icon-calculator{background-position:-112px -112px;}
 142+.ui-icon-zoomin{background-position:-128px -112px;}
 143+.ui-icon-zoomout{background-position:-144px -112px;}
 144+.ui-icon-search{background-position:-160px -112px;}
 145+.ui-icon-wrench{background-position:-176px -112px;}
 146+.ui-icon-gear{background-position:-192px -112px;}
 147+.ui-icon-heart{background-position:-208px -112px;}
 148+.ui-icon-star{background-position:-224px -112px;}
 149+.ui-icon-link{background-position:-240px -112px;}
 150+.ui-icon-cancel{background-position:0 -128px;}
 151+.ui-icon-plus{background-position:-16px -128px;}
 152+.ui-icon-plusthick{background-position:-32px -128px;}
 153+.ui-icon-minus{background-position:-48px -128px;}
 154+.ui-icon-minusthick{background-position:-64px -128px;}
 155+.ui-icon-close{background-position:-80px -128px;}
 156+.ui-icon-closethick{background-position:-96px -128px;}
 157+.ui-icon-key{background-position:-112px -128px;}
 158+.ui-icon-lightbulb{background-position:-128px -128px;}
 159+.ui-icon-scissors{background-position:-144px -128px;}
 160+.ui-icon-clipboard{background-position:-160px -128px;}
 161+.ui-icon-copy{background-position:-176px -128px;}
 162+.ui-icon-contact{background-position:-192px -128px;}
 163+.ui-icon-image{background-position:-208px -128px;}
 164+.ui-icon-video{background-position:-224px -128px;}
 165+.ui-icon-script{background-position:-240px -128px;}
 166+.ui-icon-alert{background-position:0 -144px;}
 167+.ui-icon-info{background-position:-16px -144px;}
 168+.ui-icon-notice{background-position:-32px -144px;}
 169+.ui-icon-help{background-position:-48px -144px;}
 170+.ui-icon-check{background-position:-64px -144px;}
 171+.ui-icon-bullet{background-position:-80px -144px;}
 172+.ui-icon-radio-off{background-position:-96px -144px;}
 173+.ui-icon-radio-on{background-position:-112px -144px;}
 174+.ui-icon-pin-w{background-position:-128px -144px;}
 175+.ui-icon-pin-s{background-position:-144px -144px;}
 176+.ui-icon-play{background-position:0 -160px;}
 177+.ui-icon-pause{background-position:-16px -160px;}
 178+.ui-icon-seek-next{background-position:-32px -160px;}
 179+.ui-icon-seek-prev{background-position:-48px -160px;}
 180+.ui-icon-seek-end{background-position:-64px -160px;}
 181+.ui-icon-seek-start{background-position:-80px -160px;}
 182+
 183+.ui-icon-seek-first{background-position:-80px -160px;}
 184+.ui-icon-stop{background-position:-96px -160px;}
 185+.ui-icon-eject{background-position:-112px -160px;}
 186+.ui-icon-volume-off{background-position:-128px -160px;}
 187+.ui-icon-volume-on{background-position:-144px -160px;}
 188+.ui-icon-power{background-position:0 -176px;}
 189+.ui-icon-signal-diag{background-position:-16px -176px;}
 190+.ui-icon-signal{background-position:-32px -176px;}
 191+.ui-icon-battery-0{background-position:-48px -176px;}
 192+.ui-icon-battery-1{background-position:-64px -176px;}
 193+.ui-icon-battery-2{background-position:-80px -176px;}
 194+.ui-icon-battery-3{background-position:-96px -176px;}
 195+.ui-icon-circle-plus{background-position:0 -192px;}
 196+.ui-icon-circle-minus{background-position:-16px -192px;}
 197+.ui-icon-circle-close{background-position:-32px -192px;}
 198+.ui-icon-circle-triangle-e{background-position:-48px -192px;}
 199+.ui-icon-circle-triangle-s{background-position:-64px -192px;}
 200+.ui-icon-circle-triangle-w{background-position:-80px -192px;}
 201+.ui-icon-circle-triangle-n{background-position:-96px -192px;}
 202+.ui-icon-circle-arrow-e{background-position:-112px -192px;}
 203+.ui-icon-circle-arrow-s{background-position:-128px -192px;}
 204+.ui-icon-circle-arrow-w{background-position:-144px -192px;}
 205+.ui-icon-circle-arrow-n{background-position:-160px -192px;}
 206+.ui-icon-circle-zoomin{background-position:-176px -192px;}
 207+.ui-icon-circle-zoomout{background-position:-192px -192px;}
 208+.ui-icon-circle-check{background-position:-208px -192px;}
 209+.ui-icon-circlesmall-plus{background-position:0 -208px;}
 210+.ui-icon-circlesmall-minus{background-position:-16px -208px;}
 211+.ui-icon-circlesmall-close{background-position:-32px -208px;}
 212+.ui-icon-squaresmall-plus{background-position:-48px -208px;}
 213+.ui-icon-squaresmall-minus{background-position:-64px -208px;}
 214+.ui-icon-squaresmall-close{background-position:-80px -208px;}
 215+.ui-icon-grip-dotted-vertical{background-position:0 -224px;}
 216+.ui-icon-grip-dotted-horizontal{background-position:-16px -224px;}
 217+.ui-icon-grip-solid-vertical{background-position:-32px -224px;}
 218+.ui-icon-grip-solid-horizontal{background-position:-48px -224px;}
 219+.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px;}
 220+.ui-icon-grip-diagonal-se{background-position:-80px -224px;}
 221+.ui-corner-tl{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;}
 222+.ui-corner-tr{-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;}
 223+.ui-corner-bl{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;}
 224+.ui-corner-br{-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;}
 225+.ui-corner-top{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;}
 226+.ui-corner-bottom{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;}
 227+.ui-corner-right{-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;}
 228+.ui-corner-left{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;}
 229+.ui-corner-all{-moz-border-radius:0;-webkit-border-radius:0;}
 230+.ui-widget-overlay{background:#000000;opacity:.75;filter:Alpha(Opacity=75);}
 231+.ui-widget-shadow{margin:-7px 0 0 -7px;padding:7px;background:#000000 url(images/ui-bg_flat_70_000000_40x100.png) 50% 50% repeat-x;opacity:.20;filter:Alpha(Opacity=20);-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none !important;cursor:pointer;text-align:center;zoom:1;overflow:visible;}
 232+.ui-button-icon-only{width:2.2em;}
 233+button.ui-button-icon-only{width:2.4em;}
 234+.ui-button-icons-only{width:3.4em;}
 235+button.ui-button-icons-only{width:3.7em;}
 236+.ui-button .ui-button-text{display:block;line-height:1.4;}
 237+.ui-button-text-only .ui-button-text{padding:.125em .25em;}
 238+.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px;}
 239+.ui-button-text-icon .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em;}
 240+.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em;}
 241+
 242+input.ui-button{padding:.4em 1em;}
 243+.ui-button-icon-only .ui-icon,.ui-button-text-icon .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px;}
 244+.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px;}
 245+.ui-button-text-icon .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em;}
 246+.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em;}
 247+.ui-buttonset{margin-right:7px;}
 248+.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em;}
 249+button.ui-button::-moz-focus-inner{border:0;padding:0;}
 250+.ui-dialog{position:absolute;padding:0;width:300px;}
 251+.ui-dialog .ui-dialog-titlebar{padding:.75em;position:relative;}
 252+.ui-dialog .ui-dialog-title{float:left;margin:0;}
 253+.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.75em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px;}
 254+.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px;}
 255+.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0;}
 256+.ui-dialog .ui-dialog-content{border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1;}
 257+.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em;}
 258+.ui-dialog .ui-dialog-buttonpane button{float:right;margin:.5em .4em .5em 0;cursor:pointer;padding:.2em .6em .3em .6em;line-height:1.4em;width:auto;overflow:visible;}
 259+.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px;}
 260+.ui-draggable .ui-dialog-titlebar{cursor:move;}
 261+
 262+body .ui-dialog .ui-dialog-titlebar-close:hover{text-decoration:none;}
 263+body .ui-dialog .ui-dialog-content .status-invalid input{border:2px solid red;padding:2px 1px;}
 264+body .ui-dialog .ui-dialog-titlebar{padding:0.9em 1.4em 0.6em !important;}
 265+body .ui-dialog .ui-dialog-buttonpane button{-moz-border-radius:4px;-webkit-border-radius:4px;padding:0.2em 0.6em 0.15em !important;margin:0.5em 0 0.5em 0.4em !important;border:1px solid #a6a6a6 !important;background:#f2f2f2 url(images/button-off.png) repeat-x scroll 50% 100% !important;}
 266+body .ui-dialog .ui-dialog-buttonpane button:hover{border-color:#6e7273;background:#e1e1e1 url(images/button-over.png) repeat-x scroll 50% 100% !important;}
 267+body .ui-dialog .ui-dialog-buttonpane button:active,body .ui-dialog .ui-dialog-buttonpane button:focus{border-color:#707271;background:#bfbfbf url(images/button-down.png) repeat-x scroll 50% 100% !important;}
 268+body .ui-dialog .ui-dialog-buttonpane button.disabled{color:#7f7f7f;border-color:#cccccc;background:#f2f2f2 url(images/button-disabled.png) repeat-x scroll 50% 100% !important;}
 269+
 270+body .ui-dialog .ui-dialog-buttonpane button::-moz-focus-inner{border:0;}
 271+body .ui-dialog .ui-widget-header{background:#f0f0f0 url(images/titlebar-fade.png) repeat-x scroll 50% 100% !important;}
 272+
 273+body .ui-dialog .ui-icon-closethick{background:url(images/close-x.png) no-repeat 50% 50% !important;}
 274+body .ui-dialog .ui-dialog-buttonpane{margin-top:0 !important;padding:0.3em 1.4em 0.5em 1.4em !important;}
 275+
 276+.ui-datepicker{width:17em;padding:.2em .2em 0;}
 277+.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0;}
 278+.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em;}
 279+.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px;}
 280+.ui-datepicker .ui-datepicker-prev{left:2px;}
 281+.ui-datepicker .ui-datepicker-next{right:2px;}
 282+.ui-datepicker .ui-datepicker-prev-hover{left:1px;}
 283+.ui-datepicker .ui-datepicker-next-hover{right:1px;}
 284+.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px;}
 285+.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center;}
 286+.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0;}
 287+.ui-datepicker select.ui-datepicker-month-year{width:100%;}
 288+.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%;}
 289+.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em;}
 290+.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0;}
 291+.ui-datepicker td{border:0;padding:1px;}
 292+.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none;}
 293+.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0;}
 294+.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible;}
 295+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left;}
 296+.ui-datepicker.ui-datepicker-multi{width:auto;}
 297+.ui-datepicker-multi .ui-datepicker-group{float:left;}
 298+.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em;}
 299+.ui-datepicker-multi-2 .ui-datepicker-group{width:50%;}
 300+.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%;}
 301+.ui-datepicker-multi-4 .ui-datepicker-group{width:25%;}
 302+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0;}
 303+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0;}
 304+.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left;}
 305+.ui-datepicker-row-break{clear:both;width:100%;}
 306+.ui-datepicker-rtl{direction:rtl;}
 307+.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto;}
 308+.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto;}
 309+.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto;}
 310+.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto;}
 311+.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right;}
 312+.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left;}
 313+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right;}
 314+.ui-datepicker-rtl .ui-datepicker-group{float:right;}
 315+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px;}
 316+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px;}
 317+.ui-datepicker-cover{display:none;
 318+display:block;
 319+position:absolute;
 320+z-index:-1;
 321+filter:mask();
 322+top:-4px;
 323+left:-4px;
 324+width:200px;
 325+height:200px;
 326+}
 327+.ui-progressbar{height:2em;text-align:left;}
 328+.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%;}
\ No newline at end of file
Property changes on: trunk/extensions/UploadWizard/resources/jquery.ui/themes/vector/dir.combined.min.css
___________________________________________________________________
Added: svn:eol-style
1329 + native
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -27,6 +27,7 @@
2828
2929 #mwe-upwiz-steps li {
3030 color: #666666;
 31+ font-size: 1.2em;
3132 margin-right: -1px;
3233 }
3334
@@ -50,10 +51,11 @@
5152
5253 .mwe-upwiz-add-files-0 {
5354 text-align: center;
54 - font-size: large;
5555 }
5656
57 -#mwe-upwiz-add-file {
 57+.mwe-upwiz-add-files-0 #mwe-upwiz-add-file {
 58+ font-size: large;
 59+ padding: 1em;
5860 }
5961
6062 /* NOT a pseudoclass */
@@ -62,7 +64,7 @@
6365 }
6466
6567 /* perhaps a general class for links that are actually "buttons" */
66 -#mwe-upwiz-add-file, .mwe-upwiz-more-options {
 68+#mwe-upwiz-add-file, .mwe-upwiz-more-options, #mwe-upwiz-upload-ctrl {
6769 outline: none;
6870 cursor: pointer;
6971 }
@@ -160,16 +162,20 @@
161163
162164 .mwe-upwiz-add-files-n {
163165 float: left;
164 - margin-top: 5px;
165 - margin-left: 4px;
166166 }
167167
168168 #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n, .mwe-upwiz-progress-bar-etr {
169169 width: 300px;
170 - padding-left: 5px;
171170 }
172171
 172+#mwe-upwiz-upload-ctrl-container {
 173+ float: right;
 174+ display: none;
 175+}
173176
 177+#mwe-upwiz-upload-ctrl:hover {
 178+ text-decoration: none;
 179+}
174180 #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n {
175181 float: left;
176182 }
@@ -209,6 +215,22 @@
210216 margin-top: 1em;
211217 }
212218
 219+#mwe-upwiz-upload-ctrls button, .mwe-upwiz-buttons button {
 220+ padding: 0.25em 0.75em;
 221+ font-size: 1em;
 222+}
 223+
 224+#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons {
 225+ display: none;
 226+}
 227+
 228+#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice {
 229+ display: none;
 230+}
 231+
 232+
 233+
 234+
213235 #mwe-upwiz-add-file-container {
214236 /* empty; this changes a lot */
215237 }
@@ -589,3 +611,13 @@
590612 .ui-datepicker-current-day a.ui-state-active {
591613 background: #ffff99;
592614 }
 615+
 616+#upload-wizard .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
 617+#upload-wizard .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
 618+#upload-wizard .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
 619+#upload-wizard .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 620+#upload-wizard .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
 621+#upload-wizard .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 622+#upload-wizard .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
 623+#upload-wizard .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
 624+#upload-wizard .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -52,6 +52,7 @@
5353 * remove this upload. n.b. we trigger a removeUpload this is usually triggered from
5454 */
5555 remove: function() {
 56+ this.state = 'aborted';
5657 if ( this.details && this.details.div ) {
5758 this.details.div.remove();
5859 }
@@ -93,6 +94,9 @@
9495 */
9596 setTransported: function( result ) {
9697 var _this = this;
 98+ if ( _this.state == 'aborted' ) {
 99+ return;
 100+ }
97101
98102 if ( result.upload && result.upload.imageinfo ) {
99103 // success
@@ -304,10 +308,11 @@
305309 _this.$fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
306310 .change( function() { _this.fileChanged(); } );
307311
 312+ _this.$indicator = $j( '<div class="mwe-upwiz-file-indicator"></div>' );
308313
309314 visibleFilenameDiv = $j('<div class="mwe-upwiz-visible-file"></div>')
310 - .append( '<div class="mwe-upwiz-file-indicator"></div>'
311 - + '<div class="mwe-upwiz-visible-file-filename">'
 315+ .append( _this.$indicator )
 316+ .append( '<div class="mwe-upwiz-visible-file-filename">'
312317 + '<div class="mwe-upwiz-file-preview"/>'
313318 + '<div class="mwe-upwiz-file-texts">'
314319 + '<div class="mwe-upwiz-visible-file-filename-text"/>'
@@ -393,16 +398,22 @@
394399 * @param String statusClass: corresponds to a class mwe-upwiz-status which changes style of indicator.
395400 */
396401 showIndicator: function( statusClass ) {
397 - var $indicator = $j( this.div ).find( '.mwe-upwiz-file-indicator' );
398 - // remove any other such classes
399 - $j.each( $indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
 402+ this.clearIndicator();
 403+ // add the desired class and make it visible, if it wasn't already.
 404+ this.$indicator.addClass( 'mwe-upwiz-status-' + statusClass )
 405+ .css( 'visibility', 'visible' );
 406+ },
 407+
 408+ /**
 409+ * Reset the graphic indicator
 410+ */
 411+ clearIndicator: function() {
 412+ var _this = this;
 413+ $j.each( _this.$indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
400414 if ( className.match( /^mwe-upwiz-status/ ) ) {
401 - $indicator.removeClass( className );
 415+ _this.$indicator.removeClass( className );
402416 }
403417 } );
404 - // add the desired class and make it visible, if it wasn't already.
405 - $indicator.addClass( 'mwe-upwiz-status-' + statusClass )
406 - .css( 'visibility', 'visible' );
407418 },
408419
409420 /**
@@ -513,12 +524,14 @@
514525 .width( $covered.outerWidth() )
515526 .height( $covered.outerHeight() );
516527
 528+ this.fileCtrlContainer.css( { 'z-index': 1 } );
 529+
517530 // shift the file input over with negative margins,
518531 // internal to the overflow-containing div, so the div shows all button
519532 // and none of the textfield-like input
520533 this.$fileInputCtrl.css( {
521534 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px',
522 - 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px'
 535+ 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px',
523536 } );
524537
525538
@@ -1550,35 +1563,41 @@
15511564 createInterface: function( selector ) {
15521565 var _this = this;
15531566
 1567+ // construct the arrow steps from the UL in the HTML
15541568 $j( '#mwe-upwiz-steps' )
15551569 .addClass( 'ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix' )
15561570 .arrowSteps();
1557 -
 1571+
 1572+ // make all stepdiv proceed buttons into jquery buttons
 1573+ $j( '.mwe-upwiz-stepdiv .mwe-upwiz-buttons button' )
 1574+ .button()
 1575+ .css( { 'margin-left': '1em' } );
 1576+
 1577+
 1578+ $j( '.mwe-upwiz-button-begin' )
 1579+ .click( function() { _this.reset(); } );
 1580+
15581581 $j( '.mwe-upwiz-button-home' )
1559 - .append( gM( 'mwe-upwiz-home' ) )
15601582 .click( function() { window.location.href = '/'; } );
1561 -
1562 - $j( '.mwe-upwiz-button-begin' )
1563 - .append( gM( 'mwe-upwiz-upload-another' ) )
1564 - .click( function() { _this.reset(); } );
1565 -
 1583+
15661584 // handler for next button
15671585 $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next')
1568 - .append( gM( 'mwe-upwiz-next' ) )
15691586 .click( function() {
15701587 _this.moveToStep( 'file', function() {
15711588 // we explicitly move the file input at this point
15721589 // because it was probably jumping around due to other "steps" on this page during file construction.
15731590 // XXX using a timeout is lame, are there other options?
15741591 // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML
1575 - setTimeout( function() {
 1592+ setTimeout( function() {
15761593 upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
15771594 }, 300 );
15781595 } );
15791596 } );
15801597
1581 - $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-button-next')
1582 - .append( gM( 'mwe-upwiz-next-file' ) )
 1598+ $j( '#mwe-upwiz-add-file' ).button();
 1599+
 1600+ $j( '#mwe-upwiz-upload-ctrl' )
 1601+ .button()
15831602 .click( function() {
15841603 // check if there is an upload at all (should never happen)
15851604 if ( _this.uploads.length === 0 ) {
@@ -1588,19 +1607,24 @@
15891608 }
15901609
15911610 _this.removeEmptyUploads();
1592 - _this.startUploads( function() {
1593 - // okay all uploads are done, we may be ready to go to the next step
1594 - alert( "hey, uploads are done");
1595 -
1596 - } );
 1611+ _this.startUploads();
15971612 } );
15981613
 1614+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-next' ).click( function() {
 1615+ _this.removeErrorUploads();
 1616+ _this.prepareAndMoveToDeeds();
 1617+ } );
 1618+ $j ( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-retry' ).click( function() {
 1619+ _this.hideFileEndButtons();
 1620+ _this.startUploads();
 1621+ } );
 1622+
 1623+
15991624 // DEEDS div
16001625
16011626 $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) );
16021627
16031628 $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next')
1604 - .append( gM( 'mwe-upwiz-next-deeds' ) )
16051629 .click( function() {
16061630 // validate has the side effect of notifying the user of problems, or removing existing notifications.
16071631 // if returns false, you can assume there are notifications in the interface.
@@ -1633,7 +1657,6 @@
16341658 // DETAILS div
16351659
16361660 $j( '#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next' )
1637 - .append( gM( 'mwe-upwiz-next-details' ) )
16381661 .click( function() {
16391662 if ( _this.detailsValid() ) {
16401663 _this.detailsSubmit( function() {
@@ -1658,6 +1681,7 @@
16591682
16601683 // do some last minute prep before advancing to the DEEDS page
16611684 prepareAndMoveToDeeds: function() {
 1685+ var _this = this;
16621686
16631687 // these deeds are standard
16641688 var deeds = [
@@ -1827,25 +1851,56 @@
18281852 });
18291853 },
18301854
 1855+
 1856+ /**
 1857+ * Hide the button choices at the end of the file step.
 1858+ */
 1859+ hideFileEndButtons: function() {
 1860+ $j( '#mwe-upwiz-stepdiv .mwe-upwiz-buttons' ).hide();
 1861+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice' ).hide();
 1862+ },
 1863+
18311864 /**
18321865 * This is useful to clean out unused upload file inputs if the user hits GO.
18331866 * We are using a second array to iterate, because we will be splicing the main one, _this.uploads
18341867 */
18351868 removeEmptyUploads: function() {
1836 - var _this = this;
 1869+ this.removeMatchingUploads( function( upload ) {
 1870+ return mw.isEmpty( upload.ui.$fileInputCtrl.val() );
 1871+ } );
 1872+ },
 1873+
 1874+ /**
 1875+ * Clear out uploads that are in error mode, perhaps before proceeding to the next step
 1876+ */
 1877+ removeErrorUploads: function() {
 1878+ this.removeMatchingUploads( function( upload ) {
 1879+ return upload.state === 'error';
 1880+ } );
 1881+ },
 1882+
 1883+
 1884+ /**
 1885+ * This is useful to clean out file inputs that we don't want for some reason (error, empty...)
 1886+ * We are using a second array to iterate, because we will be splicing the main one, _this.uploads
 1887+ * @param Function criterion: function to test the upload, returns boolean; true if should be removed
 1888+ */
 1889+ removeMatchingUploads: function( criterion ) {
18371890 var toRemove = [];
18381891
1839 - for ( var i = 0; i < _this.uploads.length; i++ ) {
1840 - if ( mw.isEmpty( _this.uploads[i].ui.$fileInputCtrl.val() ) ) {
1841 - toRemove.push( _this.uploads[i] );
 1892+ $j.each( this.uploads, function( i, upload ) {
 1893+ if ( criterion( upload ) ) {
 1894+ toRemove.push( upload );
18421895 }
1843 - }
 1896+ } );
18441897
1845 - for ( var j = 0; j < toRemove.length; j++ ) {
1846 - toRemove[j].remove();
1847 - }
 1898+ $j.each( toRemove, function( i, upload ) {
 1899+ upload.remove();
 1900+ } )
18481901 },
18491902
 1903+
 1904+
18501905 /**
18511906 * Manage transitioning all of our uploads from one state to another -- like from "new" to "uploaded".
18521907 *
@@ -1870,7 +1925,7 @@
18711926 } else if ( ( upload.state == beginState ) && ( uploadsToStart > 0 ) ) {
18721927 starter( upload );
18731928 uploadsToStart--;
1874 - }
 1929+ }
18751930 } );
18761931
18771932 // build in a little delay even for the end state, so user can see progress bar in a complete state.
@@ -1891,17 +1946,28 @@
18921947 * and kicks off a thread which will take from the queue.
18931948 * @param endCallback - to execute when uploads are completed
18941949 */
1895 - startUploads: function( endCallback ) {
 1950+ startUploads: function() {
18961951 var _this = this;
 1952+
18971953 // remove the upload button, and the add file button
18981954 $j( '#mwe-upwiz-upload-ctrls' ).hide();
 1955+ _this.hideFileEndButtons();
18991956 $j( '#mwe-upwiz-add-file' ).hide();
19001957
 1958+ // reset any uploads in error state back to be shiny & new
 1959+ $j.each( _this.uploads, function( i, upload ) {
 1960+ if ( upload.state === 'error' ) {
 1961+ upload.state = 'new';
 1962+ upload.ui.clearIndicator();
 1963+ upload.ui.clearStatus();
 1964+ }
 1965+ } );
 1966+
19011967 var allowCloseWindow = $j().preventCloseWindow( {
19021968 message: gM( 'mwe-prevent-close')
19031969 } );
19041970
1905 -
 1971+ $j( '#mwe-upwiz-progress' ).show();
19061972 var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress',
19071973 gM( 'mwe-upwiz-uploading' ),
19081974 _this.uploads,
@@ -1911,46 +1977,89 @@
19121978 'transportWeight' );
19131979 progressBar.start();
19141980
1915 -
19161981 // remove ability to change files
19171982 // ideally also hide the "button"... but then we require styleable file input CSS trickery
19181983 // although, we COULD do this just for files already in progress...
19191984
19201985 // it might be interesting to just make this creational -- attach it to the dom element representing
19211986 // the progress bar and elapsed time
 1987+
19221988 _this.makeTransitioner(
19231989 'new',
19241990 [ 'transporting', 'transported', 'metadata' ],
1925 - [ 'error', 'verified' ],
 1991+ [ 'error', 'stashed' ],
19261992 function( upload ) {
19271993 upload.start();
19281994 },
19291995 function() {
19301996 allowCloseWindow();
19311997 $j().notify( gM( 'mwe-upwiz-files-complete' ) );
1932 - endCallback();
 1998+ _this.showFileNext();
19331999 }
19342000 );
19352001 },
19362002
 2003+ /**
 2004+ * Figure out what to do and what options to show after the uploads have stopped.
 2005+ * Uploading has stopped for one of the following reasons:
 2006+ * 1) The user removed all uploads before they completed, in which case we are at upload.length === 0. We should start over and allow them to add new ones
 2007+ * 2) All succeeded - show link to next step
 2008+ * 3) Some failed, some succeeded - offer them the chance to retry the failed ones or go on to the next step
 2009+ * 4) All failed -- have to retry, no other option
 2010+ * In principle there could be other configurations, like having the uploads not all in error or stashed state, but
 2011+ * we trust that this hasn't happened.
 2012+ */
 2013+ showFileNext: function() {
 2014+ if ( this.uploads.length === 0 ) {
 2015+ this.updateFileCounts();
 2016+ $j( '#mwe-upwiz-progress' ).hide();
 2017+ $j( '#mwe-upwiz-upload-ctrls' ).show();
 2018+ $j( '#mwe-upwiz-add-file' ).show();
 2019+ return;
 2020+ }
 2021+ var errorCount = 0;
 2022+ var stashedCount = 0;
 2023+ $j.each( this.uploads, function( i, upload ) {
 2024+ if ( upload.state === 'error' ) {
 2025+ errorCount++;
 2026+ } else if ( upload.state === 'stashed' ) {
 2027+ stashedCount++;
 2028+ } else {
 2029+ mw.log( "upload " + i + " not in appropriate state for filenext: " + upload.state );
 2030+ }
 2031+ } );
 2032+ var selector = null;
 2033+ if ( stashedCount === this.uploads.length ) {
 2034+ selector = '.mwe-upwiz-file-next-all-ok';
 2035+ } else if ( errorCount === this.uploads.length ) {
 2036+ selector = '.mwe-upwiz-file-next-all-failed';
 2037+ } else {
 2038+ selector = '.mwe-upwiz-file-next-some-failed';
 2039+ }
 2040+
 2041+ // perhaps the button should slide down?
 2042+ $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show().find( selector ).show();
 2043+
 2044+ },
19372045
1938 -
19392046 /**
19402047 * Occurs whenever we need to update the interface based on how many files there are
19412048 * Thhere is an uncounted upload, waiting to be used, which has a fileInput which covers the
19422049 * "add an upload" button. This is absolutely positioned, so it needs to be moved if another upload was removed.
19432050 * The uncounted upload is also styled differently between the zero and n files cases
 2051+ *
 2052+ * TODO in the case of aborting the only upload, we get kicked back here, but the file input over the add file
 2053+ * button has been removed. How to get it back into "virginal" state?
19442054 */
19452055 updateFileCounts: function() {
19462056 var _this = this;
19472057
19482058 if ( _this.uploads.length ) {
19492059 // we have uploads ready to go, so allow us to proceed
1950 - $j( '#mwe-upwiz-upload-ctrl' ).removeAttr( 'disabled' );
1951 - $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show();
 2060+ $j( '#mwe-upwiz-upload-ctrl-container' ).show();
19522061
19532062 // changes the "click here to add files" to "add another file"
1954 - $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-n' ) );
 2063+ $j( '#mwe-upwiz-add-file span' ).html( gM( 'mwe-upwiz-add-file-n' ) );
19552064 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
19562065 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
19572066
@@ -1966,7 +2075,8 @@
19672076 $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' );
19682077 } else {
19692078 // no uploads, so don't allow us to proceed
1970 - $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 2079+ // $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 2080+ $j( '#mwe-upwiz-upload-ctrl-container' ).hide();
19712081
19722082 // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced
19732083 // file input element that becomes the "click here to add"
Index: trunk/extensions/UploadWizard/resources/mw.IframeTransport.js
@@ -93,7 +93,9 @@
9494 // because IE does not load JSON properly in an iframe
9595 json = $j( doc.body ).find( 'pre' ).text();
9696 mw.log( 'iframe:json::' + json );
97 - if ( json ) {
 97+ // check that the JSON is not an XML error message
 98+ // (this happens when user aborts upload, we get the API docs in XML wrapped in HTML)
 99+ if ( json && json.substring(0, 5) !== '<?xml' ) {
98100 response = window["eval"]( "( " + json + " )" );
99101 } else {
100102 response = {};
Index: trunk/extensions/UploadWizard/resources/combined.min.js
@@ -7,16 +7,22 @@
88
99
1010
11 -;jQuery.ui||(function($){
1211
13 -var _remove=$.fn.remove,
14 -isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);
 12+(function($){
1513
1614
17 -$.ui={
18 -version:"1.7.1",
1915
2016
 17+$.ui=$.ui||{};
 18+if($.ui.version){
 19+return;
 20+}
 21+
 22+
 23+$.extend($.ui,{
 24+version:"1.8.2",
 25+
 26+
2127 plugin:{
2228 add:function(module,option,set){
2329 var proto=$.ui[module].prototype;
@@ -73,9 +79,13 @@
7480 },
7581
7682 keyCode:{
 83+ALT:18,
7784 BACKSPACE:8,
7885 CAPS_LOCK:20,
7986 COMMA:188,
 87+COMMAND:91,
 88+COMMAND_LEFT:91,
 89+COMMAND_RIGHT:93,
8090 CONTROL:17,
8191 DELETE:46,
8292 DOWN:40,
@@ -85,6 +95,7 @@
8696 HOME:36,
8797 INSERT:45,
8898 LEFT:37,
 99+MENU:93,
89100 NUMPAD_ADD:107,
90101 NUMPAD_DECIMAL:110,
91102 NUMPAD_DIVIDE:111,
@@ -98,64 +109,36 @@
99110 SHIFT:16,
100111 SPACE:32,
101112 TAB:9,
102 -UP:38
 113+UP:38,
 114+WINDOWS:91
103115 }
104 -};
 116+});
105117
106118
107 -if(isFF2){
108 -var attr=$.attr,
109 -removeAttr=$.fn.removeAttr,
110 -ariaNS="http://www.w3.org/2005/07/aaa",
111 -ariaState=/^aria-/,
112 -ariaRole=/^wairole:/;
113 -
114 -$.attr=function(elem,name,value){
115 -var set=value!==undefined;
116 -
117 -return(name=='role'
118 -?(set
119 -?attr.call(this,elem,name,"wairole:"+value)
120 -:(attr.apply(this,arguments)||"").replace(ariaRole,""))
121 -:(ariaState.test(name)
122 -?(set
123 -?elem.setAttributeNS(ariaNS,
124 -name.replace(ariaState,"aaa:"),value)
125 -:attr.call(this,elem,name.replace(ariaState,"aaa:")))
126 -:attr.apply(this,arguments)));
127 -};
128 -
129 -$.fn.removeAttr=function(name){
130 -return(ariaState.test(name)
 119+$.fn.extend({
 120+_focus:$.fn.focus,
 121+focus:function(delay,fn){
 122+return typeof delay==='number'
131123 ?this.each(function(){
132 -this.removeAttributeNS(ariaNS,name.replace(ariaState,""));
133 -}):removeAttr.call(this,name));
134 -};
135 -}
136 -
137 -
138 -$.fn.extend({
139 -remove:function(){
140 -
141 -
142 -$("*",this).add(this).each(function(){
143 -$(this).triggerHandler("remove");
144 -});
145 -return _remove.apply(this,arguments);
 124+var elem=this;
 125+setTimeout(function(){
 126+$(elem).focus();
 127+(fn&&fn.call(elem));
 128+},delay);
 129+})
 130+:this._focus.apply(this,arguments);
146131 },
147132
148133 enableSelection:function(){
149134 return this
150135 .attr('unselectable','off')
151 -.css('MozUserSelect','')
152 -.unbind('selectstart.ui');
 136+.css('MozUserSelect','');
153137 },
154138
155139 disableSelection:function(){
156140 return this
157141 .attr('unselectable','on')
158 -.css('MozUserSelect','none')
159 -.bind('selectstart.ui',function(){return false;});
 142+.css('MozUserSelect','none');
160143 },
161144
162145 scrollParent:function(){
@@ -171,7 +154,37 @@
172155 }
173156
174157 return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;
 158+},
 159+
 160+zIndex:function(zIndex){
 161+if(zIndex!==undefined){
 162+return this.css('zIndex',zIndex);
175163 }
 164+
 165+if(this.length){
 166+var elem=$(this[0]),position,value;
 167+while(elem.length&&elem[0]!==document){
 168+
 169+
 170+
 171+position=elem.css('position');
 172+if(position=='absolute'||position=='relative'||position=='fixed')
 173+{
 174+
 175+
 176+
 177+
 178+value=parseInt(elem.css('zIndex'));
 179+if(!isNaN(value)&&value!=0){
 180+return value;
 181+}
 182+}
 183+elem=elem.parent();
 184+}
 185+}
 186+
 187+return 0;
 188+}
176189 });
177190
178191
@@ -200,150 +213,223 @@
201214 }
202215 });
203216
 217+})(jQuery);
204218
205219
206220
207 -function getter(namespace,plugin,method,args){
208 -function getMethods(type){
209 -var methods=$[namespace][plugin][type]||[];
210 -return(typeof methods=='string'?methods.split(/,?\s+/):methods);
211 -}
212221
213 -var methods=getMethods('getter');
214 -if(args.length==1&&typeof args[0]=='string'){
215 -methods=methods.concat(getMethods('getterSetter'));
 222+
 223+
 224+
 225+
 226+
 227+(function($){
 228+
 229+var _remove=$.fn.remove;
 230+
 231+$.fn.remove=function(selector,keepData){
 232+return this.each(function(){
 233+if(!keepData){
 234+if(!selector||$.filter(selector,[this]).length){
 235+$("*",this).add(this).each(function(){
 236+$(this).triggerHandler("remove");
 237+});
216238 }
217 -return($.inArray(method,methods)!=-1);
218239 }
 240+return _remove.call($(this),selector,keepData);
 241+});
 242+};
219243
220 -$.widget=function(name,prototype){
221 -var namespace=name.split(".")[0];
 244+$.widget=function(name,base,prototype){
 245+var namespace=name.split(".")[0],
 246+fullName;
222247 name=name.split(".")[1];
 248+fullName=namespace+"-"+name;
223249
 250+if(!prototype){
 251+prototype=base;
 252+base=$.Widget;
 253+}
224254
225 -$.fn[name]=function(options){
226 -var isMethodCall=(typeof options=='string'),
227 -args=Array.prototype.slice.call(arguments,1);
228255
 256+$.expr[":"][fullName]=function(elem){
 257+return!!$.data(elem,name);
 258+};
229259
230 -if(isMethodCall&&options.substring(0,1)=='_'){
231 -return this;
 260+$[namespace]=$[namespace]||{};
 261+$[namespace][name]=function(options,element){
 262+
 263+if(arguments.length){
 264+this._createWidget(options,element);
232265 }
 266+};
233267
 268+var basePrototype=new base();
234269
235 -if(isMethodCall&&getter(namespace,name,options,args)){
236 -var instance=$.data(this[0],name);
237 -return(instance?instance[options].apply(instance,args)
238 -:undefined);
239 -}
240270
241271
242 -return this.each(function(){
243 -var instance=$.data(this,name);
244272
245273
246 -(!instance&&!isMethodCall&&
247 -$.data(this,name,new $[namespace][name](this,options))._init());
248274
249275
250 -(instance&&isMethodCall&&$.isFunction(instance[options])&&
251 -instance[options].apply(instance,args));
252 -});
 276+
 277+basePrototype.options=$.extend({},basePrototype.options);
 278+$[namespace][name].prototype=$.extend(true,basePrototype,{
 279+namespace:namespace,
 280+widgetName:name,
 281+widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,
 282+widgetBaseClass:fullName
 283+},prototype);
 284+
 285+$.widget.bridge(name,$[namespace][name]);
253286 };
254287
 288+$.widget.bridge=function(name,object){
 289+$.fn[name]=function(options){
 290+var isMethodCall=typeof options==="string",
 291+args=Array.prototype.slice.call(arguments,1),
 292+returnValue=this;
255293
256 -$[namespace]=$[namespace]||{};
257 -$[namespace][name]=function(element,options){
258 -var self=this;
259294
260 -this.namespace=namespace;
261 -this.widgetName=name;
262 -this.widgetEventPrefix=$[namespace][name].eventPrefix||name;
263 -this.widgetBaseClass=namespace+'-'+name;
 295+options=!isMethodCall&&args.length?
 296+$.extend.apply(null,[true,options].concat(args)):
 297+options;
264298
265 -this.options=$.extend({},
266 -$.widget.defaults,
267 -$[namespace][name].defaults,
268 -$.metadata&&$.metadata.get(element)[name],
269 -options);
270299
271 -this.element=$(element)
272 -.bind('setData.'+name,function(event,key,value){
273 -if(event.target==element){
274 -return self._setData(key,value);
 300+if(isMethodCall&&options.substring(0,1)==="_"){
 301+return returnValue;
275302 }
276 -})
277 -.bind('getData.'+name,function(event,key){
278 -if(event.target==element){
279 -return self._getData(key);
 303+
 304+if(isMethodCall){
 305+this.each(function(){
 306+var instance=$.data(this,name),
 307+methodValue=instance&&$.isFunction(instance[options])?
 308+instance[options].apply(instance,args):
 309+instance;
 310+if(methodValue!==instance&&methodValue!==undefined){
 311+returnValue=methodValue;
 312+return false;
280313 }
281 -})
282 -.bind('remove',function(){
283 -return self.destroy();
284314 });
 315+}else{
 316+this.each(function(){
 317+var instance=$.data(this,name);
 318+if(instance){
 319+if(options){
 320+instance.option(options);
 321+}
 322+instance._init();
 323+}else{
 324+$.data(this,name,new object(options,this));
 325+}
 326+});
 327+}
 328+
 329+return returnValue;
285330 };
 331+};
286332
 333+$.Widget=function(options,element){
287334
288 -$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);
 335+if(arguments.length){
 336+this._createWidget(options,element);
 337+}
 338+};
289339
 340+$.Widget.prototype={
 341+widgetName:"widget",
 342+widgetEventPrefix:"",
 343+options:{
 344+disabled:false
 345+},
 346+_createWidget:function(options,element){
290347
291348
292 -$[namespace][name].getterSetter='option';
293 -};
 349+this.element=$(element).data(this.widgetName,this);
 350+this.options=$.extend(true,{},
 351+this.options,
 352+$.metadata&&$.metadata.get(element)[this.widgetName],
 353+options);
294354
295 -$.widget.prototype={
 355+var self=this;
 356+this.element.bind("remove."+this.widgetName,function(){
 357+self.destroy();
 358+});
 359+
 360+this._create();
 361+this._init();
 362+},
 363+_create:function(){},
296364 _init:function(){},
 365+
297366 destroy:function(){
298 -this.element.removeData(this.widgetName)
299 -.removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled')
300 -.removeAttr('aria-disabled');
 367+this.element
 368+.unbind("."+this.widgetName)
 369+.removeData(this.widgetName);
 370+this.widget()
 371+.unbind("."+this.widgetName)
 372+.removeAttr("aria-disabled")
 373+.removeClass(
 374+this.widgetBaseClass+"-disabled "+
 375+"ui-state-disabled");
301376 },
302377
 378+widget:function(){
 379+return this.element;
 380+},
 381+
303382 option:function(key,value){
304383 var options=key,
305384 self=this;
306385
307 -if(typeof key=="string"){
 386+if(arguments.length===0){
 387+
 388+return $.extend({},self.options);
 389+}
 390+
 391+if(typeof key==="string"){
308392 if(value===undefined){
309 -return this._getData(key);
 393+return this.options[key];
310394 }
311395 options={};
312396 options[key]=value;
313397 }
314398
315399 $.each(options,function(key,value){
316 -self._setData(key,value);
 400+self._setOption(key,value);
317401 });
 402+
 403+return self;
318404 },
319 -_getData:function(key){
320 -return this.options[key];
321 -},
322 -_setData:function(key,value){
 405+_setOption:function(key,value){
323406 this.options[key]=value;
324407
325 -if(key=='disabled'){
326 -this.element
327 -[value?'addClass':'removeClass'](
328 -this.widgetBaseClass+'-disabled'+' '+
329 -this.namespace+'-state-disabled')
 408+if(key==="disabled"){
 409+this.widget()
 410+[value?"addClass":"removeClass"](
 411+this.widgetBaseClass+"-disabled"+" "+
 412+"ui-state-disabled")
330413 .attr("aria-disabled",value);
331414 }
 415+
 416+return this;
332417 },
333418
334419 enable:function(){
335 -this._setData('disabled',false);
 420+return this._setOption("disabled",false);
336421 },
337422 disable:function(){
338 -this._setData('disabled',true);
 423+return this._setOption("disabled",true);
339424 },
340425
341426 _trigger:function(type,event,data){
342 -var callback=this.options[type],
343 -eventName=(type==this.widgetEventPrefix
344 -?type:this.widgetEventPrefix+type);
 427+var callback=this.options[type];
345428
346429 event=$.Event(event);
347 -event.type=eventName;
 430+event.type=(type===this.widgetEventPrefix?
 431+type:
 432+this.widgetEventPrefix+type).toLowerCase();
 433+data=data||{};
348434
349435
350436
@@ -357,183 +443,1220 @@
358444
359445 this.element.trigger(event,data);
360446
361 -return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false
362 -||event.isDefaultPrevented());
 447+return!($.isFunction(callback)&&
 448+callback.call(this.element[0],event,data)===false||
 449+event.isDefaultPrevented());
363450 }
364451 };
365452
366 -$.widget.defaults={
367 -disabled:false
 453+})(jQuery);
 454+
 455+
 456+
 457+
 458+
 459+
 460+
 461+
 462+
 463+
 464+
 465+
 466+
 467+(function($){
 468+
 469+var lastActive,
 470+baseClasses="ui-button ui-widget ui-state-default ui-corner-all",
 471+stateClasses="ui-state-hover ui-state-active ",
 472+typeClasses="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",
 473+formResetHandler=function(event){
 474+$(":ui-button",event.target.form).each(function(){
 475+var inst=$(this).data("button");
 476+setTimeout(function(){
 477+inst.refresh();
 478+},1);
 479+});
 480+},
 481+radioGroup=function(radio){
 482+var name=radio.name,
 483+form=radio.form,
 484+radios=$([]);
 485+if(name){
 486+if(form){
 487+radios=$(form).find("[name='"+name+"']");
 488+}else{
 489+radios=$("[name='"+name+"']",radio.ownerDocument)
 490+.filter(function(){
 491+return!this.form;
 492+});
 493+}
 494+}
 495+return radios;
368496 };
369497
 498+$.widget("ui.button",{
 499+options:{
 500+text:true,
 501+label:null,
 502+icons:{
 503+primary:null,
 504+secondary:null
 505+}
 506+},
 507+_create:function(){
 508+this.element.closest("form")
 509+.unbind("reset.button")
 510+.bind("reset.button",formResetHandler);
370511
 512+this._determineButtonType();
 513+this.hasTitle=!!this.buttonElement.attr("title");
371514
 515+var self=this,
 516+options=this.options,
 517+toggleButton=this.type==="checkbox"||this.type==="radio",
 518+hoverClass="ui-state-hover"+(!toggleButton?" ui-state-active":""),
 519+focusClass="ui-state-focus";
372520
373 -$.ui.mouse={
374 -_mouseInit:function(){
375 -var self=this;
 521+if(options.label===null){
 522+options.label=this.buttonElement.html();
 523+}
376524
377 -this.element
378 -.bind('mousedown.'+this.widgetName,function(event){
379 -return self._mouseDown(event);
 525+if(this.element.is(":disabled")){
 526+options.disabled=true;
 527+}
 528+
 529+this.buttonElement
 530+.addClass(baseClasses)
 531+.attr("role","button")
 532+.bind("mouseenter.button",function(){
 533+if(options.disabled){
 534+return;
 535+}
 536+$(this).addClass("ui-state-hover");
 537+if(this===lastActive){
 538+$(this).addClass("ui-state-active");
 539+}
380540 })
381 -.bind('click.'+this.widgetName,function(event){
382 -if(self._preventClickEvent){
383 -self._preventClickEvent=false;
384 -event.stopImmediatePropagation();
 541+.bind("mouseleave.button",function(){
 542+if(options.disabled){
 543+return;
 544+}
 545+$(this).removeClass(hoverClass);
 546+})
 547+.bind("focus.button",function(){
 548+
 549+$(this).addClass(focusClass);
 550+})
 551+.bind("blur.button",function(){
 552+$(this).removeClass(focusClass);
 553+});
 554+
 555+if(toggleButton){
 556+this.element.bind("change.button",function(){
 557+self.refresh();
 558+});
 559+}
 560+
 561+if(this.type==="checkbox"){
 562+this.buttonElement.bind("click.button",function(){
 563+if(options.disabled){
385564 return false;
386565 }
 566+$(this).toggleClass("ui-state-active");
 567+self.buttonElement.attr("aria-pressed",self.element[0].checked);
387568 });
 569+}else if(this.type==="radio"){
 570+this.buttonElement.bind("click.button",function(){
 571+if(options.disabled){
 572+return false;
 573+}
 574+$(this).addClass("ui-state-active");
 575+self.buttonElement.attr("aria-pressed",true);
388576
 577+var radio=self.element[0];
 578+radioGroup(radio)
 579+.not(radio)
 580+.map(function(){
 581+return $(this).button("widget")[0];
 582+})
 583+.removeClass("ui-state-active")
 584+.attr("aria-pressed",false);
 585+});
 586+}else{
 587+this.buttonElement
 588+.bind("mousedown.button",function(){
 589+if(options.disabled){
 590+return false;
 591+}
 592+$(this).addClass("ui-state-active");
 593+lastActive=this;
 594+$(document).one("mouseup",function(){
 595+lastActive=null;
 596+});
 597+})
 598+.bind("mouseup.button",function(){
 599+if(options.disabled){
 600+return false;
 601+}
 602+$(this).removeClass("ui-state-active");
 603+})
 604+.bind("keydown.button",function(event){
 605+if(options.disabled){
 606+return false;
 607+}
 608+if(event.keyCode==$.ui.keyCode.SPACE||event.keyCode==$.ui.keyCode.ENTER){
 609+$(this).addClass("ui-state-active");
 610+}
 611+})
 612+.bind("keyup.button",function(){
 613+$(this).removeClass("ui-state-active");
 614+});
389615
390 -if($.browser.msie){
391 -this._mouseUnselectable=this.element.attr('unselectable');
392 -this.element.attr('unselectable','on');
 616+if(this.buttonElement.is("a")){
 617+this.buttonElement.keyup(function(event){
 618+if(event.keyCode===$.ui.keyCode.SPACE){
 619+
 620+$(this).click();
393621 }
 622+});
 623+}
 624+}
394625
395 -this.started=false;
 626+
 627+
 628+
 629+this._setOption("disabled",options.disabled);
396630 },
397631
 632+_determineButtonType:function(){
398633
 634+if(this.element.is(":checkbox")){
 635+this.type="checkbox";
 636+}else{
 637+if(this.element.is(":radio")){
 638+this.type="radio";
 639+}else{
 640+if(this.element.is("input")){
 641+this.type="input";
 642+}else{
 643+this.type="button";
 644+}
 645+}
 646+}
399647
400 -_mouseDestroy:function(){
401 -this.element.unbind('.'+this.widgetName);
 648+if(this.type==="checkbox"||this.type==="radio"){
402649
403650
404 -($.browser.msie
405 -&&this.element.attr('unselectable',this._mouseUnselectable));
 651+this.buttonElement=this.element.parents().last()
 652+.find("[for="+this.element.attr("id")+"]");
 653+this.element.addClass("ui-helper-hidden-accessible");
 654+
 655+var checked=this.element.is(":checked");
 656+if(checked){
 657+this.buttonElement.addClass("ui-state-active");
 658+}
 659+this.buttonElement.attr("aria-pressed",checked);
 660+}else{
 661+this.buttonElement=this.element;
 662+}
406663 },
407664
408 -_mouseDown:function(event){
 665+widget:function(){
 666+return this.buttonElement;
 667+},
409668
 669+destroy:function(){
 670+this.element
 671+.removeClass("ui-helper-hidden-accessible");
 672+this.buttonElement
 673+.removeClass(baseClasses+" "+stateClasses+" "+typeClasses)
 674+.removeAttr("role")
 675+.removeAttr("aria-pressed")
 676+.html(this.buttonElement.find(".ui-button-text").html());
410677
411 -event.originalEvent=event.originalEvent||{};
412 -if(event.originalEvent.mouseHandled){return;}
 678+if(!this.hasTitle){
 679+this.buttonElement.removeAttr("title");
 680+}
413681
 682+$.Widget.prototype.destroy.call(this);
 683+},
414684
415 -(this._mouseStarted&&this._mouseUp(event));
 685+_setOption:function(key,value){
 686+$.Widget.prototype._setOption.apply(this,arguments);
 687+if(key==="disabled"){
 688+if(value){
 689+this.element.attr("disabled",true);
 690+}else{
 691+this.element.removeAttr("disabled");
 692+}
 693+}
 694+this._resetButton();
 695+},
416696
417 -this._mouseDownEvent=event;
 697+refresh:function(){
 698+var isDisabled=this.element.is(":disabled");
 699+if(isDisabled!==this.options.disabled){
 700+this._setOption("disabled",isDisabled);
 701+}
 702+if(this.type==="radio"){
 703+radioGroup(this.element[0]).each(function(){
 704+if($(this).is(":checked")){
 705+$(this).button("widget")
 706+.addClass("ui-state-active")
 707+.attr("aria-pressed",true);
 708+}else{
 709+$(this).button("widget")
 710+.removeClass("ui-state-active")
 711+.attr("aria-pressed",false);
 712+}
 713+});
 714+}else if(this.type==="checkbox"){
 715+if(this.element.is(":checked")){
 716+this.buttonElement
 717+.addClass("ui-state-active")
 718+.attr("aria-pressed",true);
 719+}else{
 720+this.buttonElement
 721+.removeClass("ui-state-active")
 722+.attr("aria-pressed",false);
 723+}
 724+}
 725+},
418726
419 -var self=this,
420 -btnIsLeft=(event.which==1),
421 -elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);
422 -if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){
423 -return true;
 727+_resetButton:function(){
 728+if(this.type==="input"){
 729+if(this.options.label){
 730+this.element.val(this.options.label);
424731 }
 732+return;
 733+}
 734+var buttonElement=this.buttonElement.removeClass(typeClasses),
 735+buttonText=$("<span></span>")
 736+.addClass("ui-button-text")
 737+.html(this.options.label)
 738+.appendTo(buttonElement.empty())
 739+.text(),
 740+icons=this.options.icons,
 741+multipleIcons=icons.primary&&icons.secondary;
 742+if(icons.primary||icons.secondary){
 743+buttonElement.addClass("ui-button-text-icon"+
 744+(multipleIcons?"s":""));
 745+if(icons.primary){
 746+buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>");
 747+}
 748+if(icons.secondary){
 749+buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>");
 750+}
 751+if(!this.options.text){
 752+buttonElement
 753+.addClass(multipleIcons?"ui-button-icons-only":"ui-button-icon-only")
 754+.removeClass("ui-button-text-icons ui-button-text-icon");
 755+if(!this.hasTitle){
 756+buttonElement.attr("title",buttonText);
 757+}
 758+}
 759+}else{
 760+buttonElement.addClass("ui-button-text-only");
 761+}
 762+}
 763+});
425764
426 -this.mouseDelayMet=!this.options.delay;
427 -if(!this.mouseDelayMet){
428 -this._mouseDelayTimer=setTimeout(function(){
429 -self.mouseDelayMet=true;
430 -},this.options.delay);
 765+$.widget("ui.buttonset",{
 766+_create:function(){
 767+this.element.addClass("ui-buttonset");
 768+this._init();
 769+},
 770+
 771+_init:function(){
 772+this.refresh();
 773+},
 774+
 775+_setOption:function(key,value){
 776+if(key==="disabled"){
 777+this.buttons.button("option",key,value);
431778 }
432779
433 -if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){
434 -this._mouseStarted=(this._mouseStart(event)!==false);
435 -if(!this._mouseStarted){
 780+$.Widget.prototype._setOption.apply(this,arguments);
 781+},
 782+
 783+refresh:function(){
 784+this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)")
 785+.filter(":ui-button")
 786+.button("refresh")
 787+.end()
 788+.not(":ui-button")
 789+.button()
 790+.end()
 791+.map(function(){
 792+return $(this).button("widget")[0];
 793+})
 794+.removeClass("ui-corner-all ui-corner-left ui-corner-right")
 795+.filter(":first")
 796+.addClass("ui-corner-left")
 797+.end()
 798+.filter(":last")
 799+.addClass("ui-corner-right")
 800+.end()
 801+.end();
 802+},
 803+
 804+destroy:function(){
 805+this.element.removeClass("ui-buttonset");
 806+this.buttons
 807+.map(function(){
 808+return $(this).button("widget")[0];
 809+})
 810+.removeClass("ui-corner-left ui-corner-right")
 811+.end()
 812+.button("destroy");
 813+
 814+$.Widget.prototype.destroy.call(this);
 815+}
 816+});
 817+
 818+}(jQuery));
 819+
 820+
 821+
 822+
 823+
 824+
 825+
 826+
 827+
 828+
 829+
 830+
 831+
 832+
 833+
 834+
 835+
 836+
 837+(function($){
 838+
 839+var uiDialogClasses=
 840+'ui-dialog '+
 841+'ui-widget '+
 842+'ui-widget-content '+
 843+'ui-corner-all ';
 844+
 845+$.widget("ui.dialog",{
 846+options:{
 847+autoOpen:true,
 848+buttons:{},
 849+closeOnEscape:true,
 850+closeText:'close',
 851+dialogClass:'',
 852+draggable:true,
 853+hide:null,
 854+height:'auto',
 855+maxHeight:false,
 856+maxWidth:false,
 857+minHeight:150,
 858+minWidth:150,
 859+modal:false,
 860+position:'center',
 861+resizable:true,
 862+show:null,
 863+stack:true,
 864+title:'',
 865+width:300,
 866+zIndex:1000
 867+},
 868+_create:function(){
 869+this.originalTitle=this.element.attr('title');
 870+
 871+var self=this,
 872+options=self.options,
 873+
 874+title=options.title||self.originalTitle||'&#160;',
 875+titleId=$.ui.dialog.getTitleId(self.element),
 876+
 877+uiDialog=(self.uiDialog=$('<div></div>'))
 878+.appendTo(document.body)
 879+.hide()
 880+.addClass(uiDialogClasses+options.dialogClass)
 881+.css({
 882+zIndex:options.zIndex
 883+})
 884+
 885+
 886+.attr('tabIndex',-1).css('outline',0).keydown(function(event){
 887+if(options.closeOnEscape&&event.keyCode&&
 888+event.keyCode===$.ui.keyCode.ESCAPE){
 889+
 890+self.close(event);
436891 event.preventDefault();
437 -return true;
438892 }
 893+})
 894+.attr({
 895+role:'dialog',
 896+'aria-labelledby':titleId
 897+})
 898+.mousedown(function(event){
 899+self.moveToTop(false,event);
 900+}),
 901+
 902+uiDialogContent=self.element
 903+.show()
 904+.removeAttr('title')
 905+.addClass(
 906+'ui-dialog-content '+
 907+'ui-widget-content')
 908+.appendTo(uiDialog),
 909+
 910+uiDialogTitlebar=(self.uiDialogTitlebar=$('<div></div>'))
 911+.addClass(
 912+'ui-dialog-titlebar '+
 913+'ui-widget-header '+
 914+'ui-corner-all '+
 915+'ui-helper-clearfix'
 916+)
 917+.prependTo(uiDialog),
 918+
 919+uiDialogTitlebarClose=$('<a href="#"></a>')
 920+.addClass(
 921+'ui-dialog-titlebar-close '+
 922+'ui-corner-all'
 923+)
 924+.attr('role','button')
 925+.hover(
 926+function(){
 927+uiDialogTitlebarClose.addClass('ui-state-hover');
 928+},
 929+function(){
 930+uiDialogTitlebarClose.removeClass('ui-state-hover');
439931 }
 932+)
 933+.focus(function(){
 934+uiDialogTitlebarClose.addClass('ui-state-focus');
 935+})
 936+.blur(function(){
 937+uiDialogTitlebarClose.removeClass('ui-state-focus');
 938+})
 939+.click(function(event){
 940+self.close(event);
 941+return false;
 942+})
 943+.appendTo(uiDialogTitlebar),
440944
 945+uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$('<span></span>'))
 946+.addClass(
 947+'ui-icon '+
 948+'ui-icon-closethick'
 949+)
 950+.text(options.closeText)
 951+.appendTo(uiDialogTitlebarClose),
441952
442 -this._mouseMoveDelegate=function(event){
443 -return self._mouseMove(event);
444 -};
445 -this._mouseUpDelegate=function(event){
446 -return self._mouseUp(event);
447 -};
448 -$(document)
449 -.bind('mousemove.'+this.widgetName,this._mouseMoveDelegate)
450 -.bind('mouseup.'+this.widgetName,this._mouseUpDelegate);
 953+uiDialogTitle=$('<span></span>')
 954+.addClass('ui-dialog-title')
 955+.attr('id',titleId)
 956+.html(title)
 957+.prependTo(uiDialogTitlebar);
451958
452959
453960
454961
455 -($.browser.safari||event.preventDefault());
 962+if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){
 963+options.beforeClose=options.beforeclose;
 964+}
456965
457 -event.originalEvent.mouseHandled=true;
458 -return true;
 966+uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
 967+
 968+if(options.draggable&&$.fn.draggable){
 969+self._makeDraggable();
 970+}
 971+if(options.resizable&&$.fn.resizable){
 972+self._makeResizable();
 973+}
 974+
 975+self._createButtons(options.buttons);
 976+self._isOpen=false;
 977+
 978+if($.fn.bgiframe){
 979+uiDialog.bgiframe();
 980+}
459981 },
 982+_init:function(){
 983+if(this.options.autoOpen){
 984+this.open();
 985+}
 986+},
460987
461 -_mouseMove:function(event){
 988+destroy:function(){
 989+var self=this;
462990
463 -if($.browser.msie&&!event.button){
464 -return this._mouseUp(event);
 991+if(self.overlay){
 992+self.overlay.destroy();
465993 }
 994+self.uiDialog.hide();
 995+self.element
 996+.unbind('.dialog')
 997+.removeData('dialog')
 998+.removeClass('ui-dialog-content ui-widget-content')
 999+.hide().appendTo('body');
 1000+self.uiDialog.remove();
4661001
467 -if(this._mouseStarted){
468 -this._mouseDrag(event);
469 -return event.preventDefault();
 1002+if(self.originalTitle){
 1003+self.element.attr('title',self.originalTitle);
4701004 }
4711005
472 -if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){
473 -this._mouseStarted=
474 -(this._mouseStart(this._mouseDownEvent,event)!==false);
475 -(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));
 1006+return self;
 1007+},
 1008+
 1009+widget:function(){
 1010+return this.uiDialog;
 1011+},
 1012+
 1013+close:function(event){
 1014+var self=this,
 1015+maxZ;
 1016+
 1017+if(false===self._trigger('beforeClose',event)){
 1018+return;
4761019 }
4771020
478 -return!this._mouseStarted;
 1021+if(self.overlay){
 1022+self.overlay.destroy();
 1023+}
 1024+self.uiDialog.unbind('keypress.ui-dialog');
 1025+
 1026+self._isOpen=false;
 1027+
 1028+if(self.options.hide){
 1029+self.uiDialog.hide(self.options.hide,function(){
 1030+self._trigger('close',event);
 1031+});
 1032+}else{
 1033+self.uiDialog.hide();
 1034+self._trigger('close',event);
 1035+}
 1036+
 1037+$.ui.dialog.overlay.resize();
 1038+
 1039+
 1040+if(self.options.modal){
 1041+maxZ=0;
 1042+$('.ui-dialog').each(function(){
 1043+if(this!==self.uiDialog[0]){
 1044+maxZ=Math.max(maxZ,$(this).css('z-index'));
 1045+}
 1046+});
 1047+$.ui.dialog.maxZ=maxZ;
 1048+}
 1049+
 1050+return self;
4791051 },
4801052
481 -_mouseUp:function(event){
482 -$(document)
483 -.unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate)
484 -.unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);
 1053+isOpen:function(){
 1054+return this._isOpen;
 1055+},
4851056
486 -if(this._mouseStarted){
487 -this._mouseStarted=false;
488 -this._preventClickEvent=(event.target==this._mouseDownEvent.target);
489 -this._mouseStop(event);
 1057+
 1058+
 1059+moveToTop:function(force,event){
 1060+var self=this,
 1061+options=self.options,
 1062+saveScroll;
 1063+
 1064+if((options.modal&&!force)||
 1065+(!options.stack&&!options.modal)){
 1066+return self._trigger('focus',event);
4901067 }
4911068
 1069+if(options.zIndex>$.ui.dialog.maxZ){
 1070+$.ui.dialog.maxZ=options.zIndex;
 1071+}
 1072+if(self.overlay){
 1073+$.ui.dialog.maxZ+=1;
 1074+self.overlay.$el.css('z-index',$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ);
 1075+}
 1076+
 1077+
 1078+
 1079+saveScroll={scrollTop:self.element.attr('scrollTop'),scrollLeft:self.element.attr('scrollLeft')};
 1080+$.ui.dialog.maxZ+=1;
 1081+self.uiDialog.css('z-index',$.ui.dialog.maxZ);
 1082+self.element.attr(saveScroll);
 1083+self._trigger('focus',event);
 1084+
 1085+return self;
 1086+},
 1087+
 1088+open:function(){
 1089+if(this._isOpen){return;}
 1090+
 1091+var self=this,
 1092+options=self.options,
 1093+uiDialog=self.uiDialog;
 1094+
 1095+self.overlay=options.modal?new $.ui.dialog.overlay(self):null;
 1096+if(uiDialog.next().length){
 1097+uiDialog.appendTo('body');
 1098+}
 1099+self._size();
 1100+self._position(options.position);
 1101+uiDialog.show(options.show);
 1102+self.moveToTop(true);
 1103+
 1104+
 1105+if(options.modal){
 1106+uiDialog.bind('keypress.ui-dialog',function(event){
 1107+if(event.keyCode!==$.ui.keyCode.TAB){
 1108+return;
 1109+}
 1110+
 1111+var tabbables=$(':tabbable',this),
 1112+first=tabbables.filter(':first'),
 1113+last=tabbables.filter(':last');
 1114+
 1115+if(event.target===last[0]&&!event.shiftKey){
 1116+first.focus(1);
4921117 return false;
 1118+}else if(event.target===first[0]&&event.shiftKey){
 1119+last.focus(1);
 1120+return false;
 1121+}
 1122+});
 1123+}
 1124+
 1125+
 1126+
 1127+$([])
 1128+.add(uiDialog.find('.ui-dialog-content :tabbable:first'))
 1129+.add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
 1130+.add(uiDialog)
 1131+.filter(':first')
 1132+.focus();
 1133+
 1134+self._trigger('open');
 1135+self._isOpen=true;
 1136+
 1137+return self;
4931138 },
4941139
495 -_mouseDistanceMet:function(event){
496 -return(Math.max(
497 -Math.abs(this._mouseDownEvent.pageX-event.pageX),
498 -Math.abs(this._mouseDownEvent.pageY-event.pageY)
499 -)>=this.options.distance
 1140+_createButtons:function(buttons){
 1141+var self=this,
 1142+hasButtons=false,
 1143+uiDialogButtonPane=$('<div></div>')
 1144+.addClass(
 1145+'ui-dialog-buttonpane '+
 1146+'ui-widget-content '+
 1147+'ui-helper-clearfix'
5001148 );
501 -},
5021149
503 -_mouseDelayMet:function(event){
504 -return this.mouseDelayMet;
 1150+
 1151+self.uiDialog.find('.ui-dialog-buttonpane').remove();
 1152+
 1153+if(typeof buttons==='object'&&buttons!==null){
 1154+$.each(buttons,function(){
 1155+return!(hasButtons=true);
 1156+});
 1157+}
 1158+if(hasButtons){
 1159+$.each(buttons,function(name,fn){
 1160+var button=$('<button type="button"></button>')
 1161+.text(name)
 1162+.click(function(){fn.apply(self.element[0],arguments);})
 1163+.appendTo(uiDialogButtonPane);
 1164+if($.fn.button){
 1165+button.button();
 1166+}
 1167+});
 1168+uiDialogButtonPane.appendTo(self.uiDialog);
 1169+}
5051170 },
5061171
 1172+_makeDraggable:function(){
 1173+var self=this,
 1174+options=self.options,
 1175+doc=$(document),
 1176+heightBeforeDrag;
5071177
508 -_mouseStart:function(event){},
509 -_mouseDrag:function(event){},
510 -_mouseStop:function(event){},
511 -_mouseCapture:function(event){return true;}
 1178+function filteredUi(ui){
 1179+return{
 1180+position:ui.position,
 1181+offset:ui.offset
5121182 };
 1183+}
5131184
514 -$.ui.mouse.defaults={
515 -cancel:null,
516 -distance:1,
517 -delay:0
 1185+self.uiDialog.draggable({
 1186+cancel:'.ui-dialog-content, .ui-dialog-titlebar-close',
 1187+handle:'.ui-dialog-titlebar',
 1188+containment:'document',
 1189+start:function(event,ui){
 1190+heightBeforeDrag=options.height==="auto"?"auto":$(this).height();
 1191+$(this).height($(this).height()).addClass("ui-dialog-dragging");
 1192+self._trigger('dragStart',event,filteredUi(ui));
 1193+},
 1194+drag:function(event,ui){
 1195+self._trigger('drag',event,filteredUi(ui));
 1196+},
 1197+stop:function(event,ui){
 1198+options.position=[ui.position.left-doc.scrollLeft(),
 1199+ui.position.top-doc.scrollTop()];
 1200+$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
 1201+self._trigger('dragStop',event,filteredUi(ui));
 1202+$.ui.dialog.overlay.resize();
 1203+}
 1204+});
 1205+},
 1206+
 1207+_makeResizable:function(handles){
 1208+handles=(handles===undefined?this.options.resizable:handles);
 1209+var self=this,
 1210+options=self.options,
 1211+
 1212+
 1213+position=self.uiDialog.css('position'),
 1214+resizeHandles=(typeof handles==='string'?
 1215+handles:
 1216+'n,e,s,w,se,sw,ne,nw'
 1217+);
 1218+
 1219+function filteredUi(ui){
 1220+return{
 1221+originalPosition:ui.originalPosition,
 1222+originalSize:ui.originalSize,
 1223+position:ui.position,
 1224+size:ui.size
5181225 };
 1226+}
5191227
520 -})(jQuery);
 1228+self.uiDialog.resizable({
 1229+cancel:'.ui-dialog-content',
 1230+containment:'document',
 1231+alsoResize:self.element,
 1232+maxWidth:options.maxWidth,
 1233+maxHeight:options.maxHeight,
 1234+minWidth:options.minWidth,
 1235+minHeight:self._minHeight(),
 1236+handles:resizeHandles,
 1237+start:function(event,ui){
 1238+$(this).addClass("ui-dialog-resizing");
 1239+self._trigger('resizeStart',event,filteredUi(ui));
 1240+},
 1241+resize:function(event,ui){
 1242+self._trigger('resize',event,filteredUi(ui));
 1243+},
 1244+stop:function(event,ui){
 1245+$(this).removeClass("ui-dialog-resizing");
 1246+options.height=$(this).height();
 1247+options.width=$(this).width();
 1248+self._trigger('resizeStop',event,filteredUi(ui));
 1249+$.ui.dialog.overlay.resize();
 1250+}
 1251+})
 1252+.css('position',position)
 1253+.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
 1254+},
5211255
 1256+_minHeight:function(){
 1257+var options=this.options;
5221258
 1259+if(options.height==='auto'){
 1260+return options.minHeight;
 1261+}else{
 1262+return Math.min(options.minHeight,options.height);
 1263+}
 1264+},
5231265
 1266+_position:function(position){
 1267+var myAt=[],
 1268+offset=[0,0],
 1269+isVisible;
5241270
 1271+position=position||$.ui.dialog.prototype.options.position;
5251272
5261273
5271274
5281275
5291276
 1277+if(typeof position==='string'||(typeof position==='object'&&'0'in position)){
 1278+myAt=position.split?position.split(' '):[position[0],position[1]];
 1279+if(myAt.length===1){
 1280+myAt[1]=myAt[0];
 1281+}
5301282
 1283+$.each(['left','top'],function(i,offsetPosition){
 1284+if(+myAt[i]===myAt[i]){
 1285+offset[i]=myAt[i];
 1286+myAt[i]=offsetPosition;
 1287+}
 1288+});
 1289+}else if(typeof position==='object'){
 1290+if('left'in position){
 1291+myAt[0]='left';
 1292+offset[0]=position.left;
 1293+}else if('right'in position){
 1294+myAt[0]='right';
 1295+offset[0]=-position.right;
 1296+}
5311297
 1298+if('top'in position){
 1299+myAt[1]='top';
 1300+offset[1]=position.top;
 1301+}else if('bottom'in position){
 1302+myAt[1]='bottom';
 1303+offset[1]=-position.bottom;
 1304+}
 1305+}
5321306
 1307+
 1308+isVisible=this.uiDialog.is(':visible');
 1309+if(!isVisible){
 1310+this.uiDialog.show();
 1311+}
 1312+this.uiDialog
 1313+
 1314+.css({top:0,left:0})
 1315+.position({
 1316+my:myAt.join(' '),
 1317+at:myAt.join(' '),
 1318+offset:offset.join(' '),
 1319+of:window,
 1320+collision:'fit',
 1321+
 1322+using:function(pos){
 1323+var topOffset=$(this).css(pos).offset().top;
 1324+if(topOffset<0){
 1325+$(this).css('top',pos.top-topOffset);
 1326+}
 1327+}
 1328+});
 1329+if(!isVisible){
 1330+this.uiDialog.hide();
 1331+}
 1332+},
 1333+
 1334+_setOption:function(key,value){
 1335+var self=this,
 1336+uiDialog=self.uiDialog,
 1337+isResizable=uiDialog.is(':data(resizable)'),
 1338+resize=false;
 1339+
 1340+switch(key){
 1341+
 1342+
 1343+
 1344+case"beforeclose":
 1345+key="beforeClose";
 1346+break;
 1347+case"buttons":
 1348+self._createButtons(value);
 1349+break;
 1350+case"closeText":
 1351+
 1352+self.uiDialogTitlebarCloseText.text(""+value);
 1353+break;
 1354+case"dialogClass":
 1355+uiDialog
 1356+.removeClass(self.options.dialogClass)
 1357+.addClass(uiDialogClasses+value);
 1358+break;
 1359+case"disabled":
 1360+if(value){
 1361+uiDialog.addClass('ui-dialog-disabled');
 1362+}else{
 1363+uiDialog.removeClass('ui-dialog-disabled');
 1364+}
 1365+break;
 1366+case"draggable":
 1367+if(value){
 1368+self._makeDraggable();
 1369+}else{
 1370+uiDialog.draggable('destroy');
 1371+}
 1372+break;
 1373+case"height":
 1374+resize=true;
 1375+break;
 1376+case"maxHeight":
 1377+if(isResizable){
 1378+uiDialog.resizable('option','maxHeight',value);
 1379+}
 1380+resize=true;
 1381+break;
 1382+case"maxWidth":
 1383+if(isResizable){
 1384+uiDialog.resizable('option','maxWidth',value);
 1385+}
 1386+resize=true;
 1387+break;
 1388+case"minHeight":
 1389+if(isResizable){
 1390+uiDialog.resizable('option','minHeight',value);
 1391+}
 1392+resize=true;
 1393+break;
 1394+case"minWidth":
 1395+if(isResizable){
 1396+uiDialog.resizable('option','minWidth',value);
 1397+}
 1398+resize=true;
 1399+break;
 1400+case"position":
 1401+self._position(value);
 1402+break;
 1403+case"resizable":
 1404+
 1405+if(isResizable&&!value){
 1406+uiDialog.resizable('destroy');
 1407+}
 1408+
 1409+
 1410+if(isResizable&&typeof value==='string'){
 1411+uiDialog.resizable('option','handles',value);
 1412+}
 1413+
 1414+
 1415+if(!isResizable&&value!==false){
 1416+self._makeResizable(value);
 1417+}
 1418+break;
 1419+case"title":
 1420+
 1421+$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||'&#160;'));
 1422+break;
 1423+case"width":
 1424+resize=true;
 1425+break;
 1426+}
 1427+
 1428+$.Widget.prototype._setOption.apply(self,arguments);
 1429+if(resize){
 1430+self._size();
 1431+}
 1432+},
 1433+
 1434+_size:function(){
 1435+
 1436+
 1437+
 1438+var options=this.options,
 1439+nonContentHeight;
 1440+
 1441+
 1442+
 1443+this.element.css({
 1444+width:'auto',
 1445+minHeight:0,
 1446+height:0
 1447+});
 1448+
 1449+
 1450+
 1451+nonContentHeight=this.uiDialog.css({
 1452+height:'auto',
 1453+width:options.width
 1454+})
 1455+.height();
 1456+
 1457+this.element
 1458+.css(options.height==='auto'?{
 1459+minHeight:Math.max(options.minHeight-nonContentHeight,0),
 1460+height:'auto'
 1461+}:{
 1462+minHeight:0,
 1463+height:Math.max(options.height-nonContentHeight,0)
 1464+})
 1465+.show();
 1466+
 1467+if(this.uiDialog.is(':data(resizable)')){
 1468+this.uiDialog.resizable('option','minHeight',this._minHeight());
 1469+}
 1470+}
 1471+});
 1472+
 1473+$.extend($.ui.dialog,{
 1474+version:"1.8.2",
 1475+
 1476+uuid:0,
 1477+maxZ:0,
 1478+
 1479+getTitleId:function($el){
 1480+var id=$el.attr('id');
 1481+if(!id){
 1482+this.uuid+=1;
 1483+id=this.uuid;
 1484+}
 1485+return'ui-dialog-title-'+id;
 1486+},
 1487+
 1488+overlay:function(dialog){
 1489+this.$el=$.ui.dialog.overlay.create(dialog);
 1490+}
 1491+});
 1492+
 1493+$.extend($.ui.dialog.overlay,{
 1494+instances:[],
 1495+
 1496+oldInstances:[],
 1497+maxZ:0,
 1498+events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
 1499+function(event){return event+'.dialog-overlay';}).join(' '),
 1500+create:function(dialog){
 1501+if(this.instances.length===0){
 1502+
 1503+
 1504+
 1505+setTimeout(function(){
 1506+
 1507+if($.ui.dialog.overlay.instances.length){
 1508+$(document).bind($.ui.dialog.overlay.events,function(event){
 1509+
 1510+return($(event.target).zIndex()>=$.ui.dialog.overlay.maxZ);
 1511+});
 1512+}
 1513+},1);
 1514+
 1515+
 1516+$(document).bind('keydown.dialog-overlay',function(event){
 1517+if(dialog.options.closeOnEscape&&event.keyCode&&
 1518+event.keyCode===$.ui.keyCode.ESCAPE){
 1519+
 1520+dialog.close(event);
 1521+event.preventDefault();
 1522+}
 1523+});
 1524+
 1525+
 1526+$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);
 1527+}
 1528+
 1529+var $el=(this.oldInstances.pop()||$('<div></div>').addClass('ui-widget-overlay'))
 1530+.appendTo(document.body)
 1531+.css({
 1532+width:this.width(),
 1533+height:this.height()
 1534+});
 1535+
 1536+if($.fn.bgiframe){
 1537+$el.bgiframe();
 1538+}
 1539+
 1540+this.instances.push($el);
 1541+return $el;
 1542+},
 1543+
 1544+destroy:function($el){
 1545+this.oldInstances.push(this.instances.splice($.inArray($el,this.instances),1)[0]);
 1546+
 1547+if(this.instances.length===0){
 1548+$([document,window]).unbind('.dialog-overlay');
 1549+}
 1550+
 1551+$el.remove();
 1552+
 1553+
 1554+var maxZ=0;
 1555+$.each(this.instances,function(){
 1556+maxZ=Math.max(maxZ,this.css('z-index'));
 1557+});
 1558+this.maxZ=maxZ;
 1559+},
 1560+
 1561+height:function(){
 1562+var scrollHeight,
 1563+offsetHeight;
 1564+
 1565+if($.browser.msie&&$.browser.version<7){
 1566+scrollHeight=Math.max(
 1567+document.documentElement.scrollHeight,
 1568+document.body.scrollHeight
 1569+);
 1570+offsetHeight=Math.max(
 1571+document.documentElement.offsetHeight,
 1572+document.body.offsetHeight
 1573+);
 1574+
 1575+if(scrollHeight<offsetHeight){
 1576+return $(window).height()+'px';
 1577+}else{
 1578+return scrollHeight+'px';
 1579+}
 1580+
 1581+}else{
 1582+return $(document).height()+'px';
 1583+}
 1584+},
 1585+
 1586+width:function(){
 1587+var scrollWidth,
 1588+offsetWidth;
 1589+
 1590+if($.browser.msie&&$.browser.version<7){
 1591+scrollWidth=Math.max(
 1592+document.documentElement.scrollWidth,
 1593+document.body.scrollWidth
 1594+);
 1595+offsetWidth=Math.max(
 1596+document.documentElement.offsetWidth,
 1597+document.body.offsetWidth
 1598+);
 1599+
 1600+if(scrollWidth<offsetWidth){
 1601+return $(window).width()+'px';
 1602+}else{
 1603+return scrollWidth+'px';
 1604+}
 1605+
 1606+}else{
 1607+return $(document).width()+'px';
 1608+}
 1609+},
 1610+
 1611+resize:function(){
 1612+
 1613+
 1614+
 1615+
 1616+
 1617+
 1618+
 1619+
 1620+var $overlays=$([]);
 1621+$.each($.ui.dialog.overlay.instances,function(){
 1622+$overlays=$overlays.add(this);
 1623+});
 1624+
 1625+$overlays.css({
 1626+width:0,
 1627+height:0
 1628+}).css({
 1629+width:$.ui.dialog.overlay.width(),
 1630+height:$.ui.dialog.overlay.height()
 1631+});
 1632+}
 1633+});
 1634+
 1635+$.extend($.ui.dialog.overlay.prototype,{
 1636+destroy:function(){
 1637+$.ui.dialog.overlay.destroy(this.$el);
 1638+}
 1639+});
 1640+
 1641+}(jQuery));
 1642+
 1643+
 1644+
 1645+
 1646+
 1647+
 1648+
 1649+
 1650+
 1651+
 1652+
 1653+
 1654+
5331655 (function($){
5341656
535 -$.extend($.ui,{datepicker:{version:"1.7.1"}});
 1657+$.extend($.ui,{datepicker:{version:"1.8.2"}});
5361658
5371659 var PROP_NAME='datepicker';
 1660+var dpuuid=new Date().getTime();
5381661
5391662
5401663
@@ -568,14 +1691,17 @@
5691692 dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
5701693 dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
5711694 dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],
 1695+weekHeader:'Wk',
5721696 dateFormat:'mm/dd/yy',
5731697 firstDay:0,
574 -isRTL:false
 1698+isRTL:false,
 1699+showMonthAfterYear:false,
 1700+yearSuffix:''
5751701 };
5761702 this._defaults={
5771703 showOn:'focus',
5781704
579 -showAnim:'show',
 1705+showAnim:'fadeIn',
5801706 showOptions:{},
5811707 defaultDate:null,
5821708
@@ -589,10 +1715,12 @@
5901716 gotoCurrent:false,
5911717 changeMonth:false,
5921718 changeYear:false,
593 -showMonthAfterYear:false,
594 -yearRange:'-10:+10',
 1719+yearRange:'c-10:c+10',
5951720
 1721+
5961722 showOtherMonths:false,
 1723+selectOtherMonths:false,
 1724+showWeek:false,
5971725 calculateWeek:this.iso8601Week,
5981726
5991727 shortYearCutoff:'+10',
@@ -600,7 +1728,7 @@
6011729
6021730 minDate:null,
6031731 maxDate:null,
604 -duration:'normal',
 1732+duration:'fast',
6051733 beforeShowDay:null,
6061734
6071735
@@ -616,7 +1744,8 @@
6171745 altField:'',
6181746 altFormat:'',
6191747 constrainInput:true,
620 -showButtonPanel:false
 1748+showButtonPanel:false,
 1749+autoSize:false
6211750 };
6221751 $.extend(this._defaults,this.regional['']);
6231752 this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
@@ -633,8 +1762,13 @@
6341763 },
6351764
6361765
 1766+_widgetDatepicker:function(){
 1767+return this.dpDiv;
 1768+},
6371769
6381770
 1771+
 1772+
6391773 setDefaults:function(settings){
6401774 extendRemove(this._defaults,settings||{});
6411775 return this;
@@ -659,8 +1793,10 @@
6601794 }
6611795 var nodeName=target.nodeName.toLowerCase();
6621796 var inline=(nodeName=='div'||nodeName=='span');
663 -if(!target.id)
664 -target.id='dp'+(++this.uuid);
 1797+if(!target.id){
 1798+this.uuid+=1;
 1799+target.id='dp'+this.uuid;
 1800+}
6651801 var inst=this._newInst($(target),inline);
6661802 inst.settings=$.extend({},settings||{},inlineSettings||{});
6671803 if(nodeName=='input'){
@@ -672,7 +1808,7 @@
6731809
6741810
6751811 _newInst:function(target,inline){
676 -var id=target[0].id.replace(/([:\[\]\.])/g,'\\\\$1');
 1812+var id=target[0].id.replace(/([^A-Za-z0-9_])/g,'\\\\$1');
6771813 return{id:id,input:target,
6781814 selectedDay:0,selectedMonth:0,selectedYear:0,
6791815 drawMonth:0,drawYear:0,
@@ -684,13 +1820,35 @@
6851821
6861822 _connectDatepicker:function(target,inst){
6871823 var input=$(target);
 1824+inst.append=$([]);
6881825 inst.trigger=$([]);
6891826 if(input.hasClass(this.markerClassName))
6901827 return;
 1828+this._attachments(input,inst);
 1829+input.addClass(this.markerClassName).keydown(this._doKeyDown).
 1830+keypress(this._doKeyPress).keyup(this._doKeyUp).
 1831+bind("setData.datepicker",function(event,key,value){
 1832+inst.settings[key]=value;
 1833+}).bind("getData.datepicker",function(event,key){
 1834+return this._get(inst,key);
 1835+});
 1836+this._autoSize(inst);
 1837+$.data(target,PROP_NAME,inst);
 1838+},
 1839+
 1840+
 1841+_attachments:function(input,inst){
6911842 var appendText=this._get(inst,'appendText');
6921843 var isRTL=this._get(inst,'isRTL');
693 -if(appendText)
694 -input[isRTL?'before':'after']('<span class="'+this._appendClass+'">'+appendText+'</span>');
 1844+if(inst.append)
 1845+inst.append.remove();
 1846+if(appendText){
 1847+inst.append=$('<span class="'+this._appendClass+'">'+appendText+'</span>');
 1848+input[isRTL?'before':'after'](inst.append);
 1849+}
 1850+input.unbind('focus',this._showDatepicker);
 1851+if(inst.trigger)
 1852+inst.trigger.remove();
6951853 var showOn=this._get(inst,'showOn');
6961854 if(showOn=='focus'||showOn=='both')
6971855 input.focus(this._showDatepicker);
@@ -705,23 +1863,42 @@
7061864 {src:buttonImage,alt:buttonText,title:buttonText})));
7071865 input[isRTL?'before':'after'](inst.trigger);
7081866 inst.trigger.click(function(){
709 -if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target)
 1867+if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0])
7101868 $.datepicker._hideDatepicker();
7111869 else
712 -$.datepicker._showDatepicker(target);
 1870+$.datepicker._showDatepicker(input[0]);
7131871 return false;
7141872 });
7151873 }
716 -input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
717 -bind("setData.datepicker",function(event,key,value){
718 -inst.settings[key]=value;
719 -}).bind("getData.datepicker",function(event,key){
720 -return this._get(inst,key);
721 -});
722 -$.data(target,PROP_NAME,inst);
7231874 },
7241875
7251876
 1877+_autoSize:function(inst){
 1878+if(this._get(inst,'autoSize')&&!inst.inline){
 1879+var date=new Date(2009,12-1,20);
 1880+var dateFormat=this._get(inst,'dateFormat');
 1881+if(dateFormat.match(/[DM]/)){
 1882+var findMax=function(names){
 1883+var max=0;
 1884+var maxI=0;
 1885+for(var i=0;i<names.length;i++){
 1886+if(names[i].length>max){
 1887+max=names[i].length;
 1888+maxI=i;
 1889+}
 1890+}
 1891+return maxI;
 1892+};
 1893+date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?
 1894+'monthNames':'monthNamesShort'))));
 1895+date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?
 1896+'dayNames':'dayNamesShort')))+20-date.getDay());
 1897+}
 1898+inst.input.attr('size',this._formatDate(inst,date).length);
 1899+}
 1900+},
 1901+
 1902+
7261903 _inlineDatepicker:function(target,inst){
7271904 var divSpan=$(target);
7281905 if(divSpan.hasClass(this.markerClassName))
@@ -733,7 +1910,7 @@
7341911 return this._get(inst,key);
7351912 });
7361913 $.data(target,PROP_NAME,inst);
737 -this._setDate(inst,this._getDefaultDate(inst));
 1914+this._setDate(inst,this._getDefaultDate(inst),true);
7381915 this._updateDatepicker(inst);
7391916 this._updateAlternate(inst);
7401917 },
@@ -747,12 +1924,13 @@
7481925
7491926
7501927
751 -_dialogDatepicker:function(input,dateText,onSelect,settings,pos){
 1928+_dialogDatepicker:function(input,date,onSelect,settings,pos){
7521929 var inst=this._dialogInst;
7531930 if(!inst){
754 -var id='dp'+(++this.uuid);
 1931+this.uuid+=1;
 1932+var id='dp'+this.uuid;
7551933 this._dialogInput=$('<input type="text" id="'+id+
756 -'" size="1" style="position: absolute; top: -100px;"/>');
 1934+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');
7571935 this._dialogInput.keydown(this._doKeyDown);
7581936 $('body').append(this._dialogInput);
7591937 inst=this._dialogInst=this._newInst(this._dialogInput,false);
@@ -760,12 +1938,13 @@
7611939 $.data(this._dialogInput[0],PROP_NAME,inst);
7621940 }
7631941 extendRemove(inst.settings,settings||{});
764 -this._dialogInput.val(dateText);
 1942+date=(date&&date.constructor==Date?this._formatDate(inst,date):date);
 1943+this._dialogInput.val(date);
7651944
7661945 this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);
7671946 if(!this._pos){
768 -var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
769 -var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
 1947+var browserWidth=document.documentElement.clientWidth;
 1948+var browserHeight=document.documentElement.clientHeight;
7701949 var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;
7711950 var scrollY=document.documentElement.scrollTop||document.body.scrollTop;
7721951 this._pos=
@@ -773,7 +1952,7 @@
7741953 }
7751954
7761955
777 -this._dialogInput.css('left',this._pos[0]+'px').css('top',this._pos[1]+'px');
 1956+this._dialogInput.css('left',(this._pos[0]+20)+'px').css('top',this._pos[1]+'px');
7781957 inst.settings.onSelect=onSelect;
7791958 this._inDialog=true;
7801959 this.dpDiv.addClass(this._dialogClass);
@@ -795,12 +1974,13 @@
7961975 var nodeName=target.nodeName.toLowerCase();
7971976 $.removeData(target,PROP_NAME);
7981977 if(nodeName=='input'){
 1978+inst.append.remove();
7991979 inst.trigger.remove();
800 -$target.siblings('.'+this._appendClass).remove().end().
801 -removeClass(this.markerClassName).
 1980+$target.removeClass(this.markerClassName).
8021981 unbind('focus',this._showDatepicker).
8031982 unbind('keydown',this._doKeyDown).
804 -unbind('keypress',this._doKeyPress);
 1983+unbind('keypress',this._doKeyPress).
 1984+unbind('keyup',this._doKeyUp);
8051985 }else if(nodeName=='div'||nodeName=='span')
8061986 $target.removeClass(this.markerClassName).empty();
8071987 },
@@ -816,10 +1996,9 @@
8171997 var nodeName=target.nodeName.toLowerCase();
8181998 if(nodeName=='input'){
8191999 target.disabled=false;
820 -inst.trigger.filter("button").
 2000+inst.trigger.filter('button').
8212001 each(function(){this.disabled=false;}).end().
822 -filter("img").
823 -css({opacity:'1.0',cursor:''});
 2002+filter('img').css({opacity:'1.0',cursor:''});
8242003 }
8252004 else if(nodeName=='div'||nodeName=='span'){
8262005 var inline=$target.children('.'+this._inlineClass);
@@ -840,10 +2019,9 @@
8412020 var nodeName=target.nodeName.toLowerCase();
8422021 if(nodeName=='input'){
8432022 target.disabled=true;
844 -inst.trigger.filter("button").
 2023+inst.trigger.filter('button').
8452024 each(function(){this.disabled=true;}).end().
846 -filter("img").
847 -css({opacity:'0.5',cursor:'default'});
 2025+filter('img').css({opacity:'0.5',cursor:'default'});
8482026 }
8492027 else if(nodeName=='div'||nodeName=='span'){
8502028 var inline=$target.children('.'+this._inlineClass);
@@ -886,26 +2064,30 @@
8872065
8882066
8892067
 2068+
 2069+
 2070+
8902071 _optionDatepicker:function(target,name,value){
 2072+var inst=this._getInst(target);
 2073+if(arguments.length==2&&typeof name=='string'){
 2074+return(name=='defaults'?$.extend({},$.datepicker._defaults):
 2075+(inst?(name=='all'?$.extend({},inst.settings):
 2076+this._get(inst,name)):null));
 2077+}
8912078 var settings=name||{};
8922079 if(typeof name=='string'){
8932080 settings={};
8942081 settings[name]=value;
8952082 }
896 -var inst=this._getInst(target);
8972083 if(inst){
8982084 if(this._curInst==inst){
899 -this._hideDatepicker(null);
 2085+this._hideDatepicker();
9002086 }
 2087+var date=this._getDateDatepicker(target,true);
9012088 extendRemove(inst.settings,settings);
902 -var date=new Date();
903 -extendRemove(inst,{rangeStart:null,
904 -endDay:null,endMonth:null,endYear:null,
905 -selectedDay:date.getDate(),selectedMonth:date.getMonth(),
906 -selectedYear:date.getFullYear(),
907 -currentDay:date.getDate(),currentMonth:date.getMonth(),
908 -currentYear:date.getFullYear(),
909 -drawMonth:date.getMonth(),drawYear:date.getFullYear()});
 2089+this._attachments($(target),inst);
 2090+this._autoSize(inst);
 2091+this._setDateDatepicker(target,date);
9102092 this._updateDatepicker(inst);
9112093 }
9122094 },
@@ -927,11 +2109,10 @@
9282110
9292111
9302112
931 -
932 -_setDateDatepicker:function(target,date,endDate){
 2113+_setDateDatepicker:function(target,date){
9332114 var inst=this._getInst(target);
9342115 if(inst){
935 -this._setDate(inst,date,endDate);
 2116+this._setDate(inst,date);
9362117 this._updateDatepicker(inst);
9372118 this._updateAlternate(inst);
9382119 }
@@ -941,10 +2122,10 @@
9422123
9432124
9442125
945 -_getDateDatepicker:function(target){
 2126+_getDateDatepicker:function(target,noDefault){
9462127 var inst=this._getInst(target);
9472128 if(inst&&!inst.inline)
948 -this._setDateFromField(inst);
 2129+this._setDateFromField(inst,noDefault);
9492130 return(inst?this._getDate(inst):null);
9502131 },
9512132
@@ -956,17 +2137,18 @@
9572138 inst._keyEvent=true;
9582139 if($.datepicker._datepickerShowing)
9592140 switch(event.keyCode){
960 -case 9:$.datepicker._hideDatepicker(null,'');
 2141+case 9:$.datepicker._hideDatepicker();
 2142+handled=false;
9612143 break;
962 -case 13:var sel=$('td.'+$.datepicker._dayOverClass+
963 -', td.'+$.datepicker._currentClass,inst.dpDiv);
 2144+case 13:var sel=$('td.'+$.datepicker._dayOverClass,inst.dpDiv).
 2145+add($('td.'+$.datepicker._currentClass,inst.dpDiv));
9642146 if(sel[0])
9652147 $.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);
9662148 else
967 -$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration'));
 2149+$.datepicker._hideDatepicker();
9682150 return false;
9692151 break;
970 -case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration'));
 2152+case 27:$.datepicker._hideDatepicker();
9712153 break;
9722154 case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?
9732155 -$.datepicker._get(inst,'stepBigMonths'):
@@ -1028,8 +2210,29 @@
10292211 },
10302212
10312213
 2214+_doKeyUp:function(event){
 2215+var inst=$.datepicker._getInst(event.target);
 2216+if(inst.input.val()!=inst.lastVal){
 2217+try{
 2218+var date=$.datepicker.parseDate($.datepicker._get(inst,'dateFormat'),
 2219+(inst.input?inst.input.val():null),
 2220+$.datepicker._getFormatConfig(inst));
 2221+if(date){
 2222+$.datepicker._setDateFromField(inst);
 2223+$.datepicker._updateAlternate(inst);
 2224+$.datepicker._updateDatepicker(inst);
 2225+}
 2226+}
 2227+catch(event){
 2228+$.datepicker.log(event);
 2229+}
 2230+}
 2231+return true;
 2232+},
10322233
10332234
 2235+
 2236+
10342237 _showDatepicker:function(input){
10352238 input=input.target||input;
10362239 if(input.nodeName.toLowerCase()!='input')
@@ -1037,9 +2240,12 @@
10382241 if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input)
10392242 return;
10402243 var inst=$.datepicker._getInst(input);
 2244+if($.datepicker._curInst&&$.datepicker._curInst!=inst){
 2245+$.datepicker._curInst.dpDiv.stop(true,true);
 2246+}
10412247 var beforeShow=$.datepicker._get(inst,'beforeShow');
10422248 extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));
1043 -$.datepicker._hideDatepicker(null,'');
 2249+inst.lastVal=null;
10442250 $.datepicker._lastInput=input;
10452251 $.datepicker._setDateFromField(inst);
10462252 if($.datepicker._inDialog)
@@ -1059,7 +2265,6 @@
10602266 }
10612267 var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};
10622268 $.datepicker._pos=null;
1063 -inst.rangeStart=null;
10642269
10652270 inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});
10662271 $.datepicker._updateDatepicker(inst);
@@ -1070,34 +2275,36 @@
10712276 'static':(isFixed?'fixed':'absolute')),display:'none',
10722277 left:offset.left+'px',top:offset.top+'px'});
10732278 if(!inst.inline){
1074 -var showAnim=$.datepicker._get(inst,'showAnim')||'show';
 2279+var showAnim=$.datepicker._get(inst,'showAnim');
10752280 var duration=$.datepicker._get(inst,'duration');
10762281 var postProcess=function(){
10772282 $.datepicker._datepickerShowing=true;
1078 -if($.browser.msie&&parseInt($.browser.version,10)<7)
1079 -$('iframe.ui-datepicker-cover').css({width:inst.dpDiv.width()+4,
1080 -height:inst.dpDiv.height()+4});
 2283+var borders=$.datepicker._getBorders(inst.dpDiv);
 2284+inst.dpDiv.find('iframe.ui-datepicker-cover').
 2285+css({left:-borders[0],top:-borders[1],
 2286+width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});
10812287 };
 2288+inst.dpDiv.zIndex($(input).zIndex()+1);
10822289 if($.effects&&$.effects[showAnim])
10832290 inst.dpDiv.show(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);
10842291 else
1085 -inst.dpDiv[showAnim](duration,postProcess);
1086 -if(duration=='')
 2292+inst.dpDiv[showAnim||'show']((showAnim?duration:null),postProcess);
 2293+if(!showAnim||!duration)
10872294 postProcess();
1088 -if(inst.input[0].type!='hidden')
1089 -inst.input[0].focus();
 2295+if(inst.input.is(':visible')&&!inst.input.is(':disabled'))
 2296+inst.input.focus();
10902297 $.datepicker._curInst=inst;
10912298 }
10922299 },
10932300
10942301
10952302 _updateDatepicker:function(inst){
1096 -var dims={width:inst.dpDiv.width()+4,
1097 -height:inst.dpDiv.height()+4};
10982303 var self=this;
 2304+var borders=$.datepicker._getBorders(inst.dpDiv);
10992305 inst.dpDiv.empty().append(this._generateHTML(inst))
1100 -.find('iframe.ui-datepicker-cover').
1101 -css({width:dims.width,height:dims.height})
 2306+.find('iframe.ui-datepicker-cover')
 2307+.css({left:-borders[0],top:-borders[1],
 2308+width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})
11022309 .end()
11032310 .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
11042311 .bind('mouseout',function(){
@@ -1120,43 +2327,58 @@
11212328 var numMonths=this._getNumberOfMonths(inst);
11222329 var cols=numMonths[1];
11232330 var width=17;
1124 -if(cols>1){
 2331+if(cols>1)
11252332 inst.dpDiv.addClass('ui-datepicker-multi-'+cols).css('width',(width*cols)+'em');
1126 -}else{
 2333+else
11272334 inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
1128 -}
11292335 inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?'add':'remove')+
11302336 'Class']('ui-datepicker-multi');
11312337 inst.dpDiv[(this._get(inst,'isRTL')?'add':'remove')+
11322338 'Class']('ui-datepicker-rtl');
1133 -if(inst.input&&inst.input[0].type!='hidden'&&inst==$.datepicker._curInst)
1134 -$(inst.input[0]).focus();
 2339+if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&
 2340+inst.input.is(':visible')&&!inst.input.is(':disabled'))
 2341+inst.input.focus();
11352342 },
11362343
11372344
 2345+
 2346+
 2347+_getBorders:function(elem){
 2348+var convert=function(value){
 2349+return{thin:1,medium:2,thick:3}[value]||value;
 2350+};
 2351+return[parseFloat(convert(elem.css('border-left-width'))),
 2352+parseFloat(convert(elem.css('border-top-width')))];
 2353+},
 2354+
 2355+
11382356 _checkOffset:function(inst,offset,isFixed){
11392357 var dpWidth=inst.dpDiv.outerWidth();
11402358 var dpHeight=inst.dpDiv.outerHeight();
11412359 var inputWidth=inst.input?inst.input.outerWidth():0;
11422360 var inputHeight=inst.input?inst.input.outerHeight():0;
1143 -var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();
1144 -var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();
 2361+var viewWidth=document.documentElement.clientWidth+$(document).scrollLeft();
 2362+var viewHeight=document.documentElement.clientHeight+$(document).scrollTop();
11452363
11462364 offset.left-=(this._get(inst,'isRTL')?(dpWidth-inputWidth):0);
11472365 offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;
11482366 offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;
11492367
11502368
1151 -offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;
1152 -offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;
 2369+offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?
 2370+Math.abs(offset.left+dpWidth-viewWidth):0);
 2371+offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?
 2372+Math.abs(dpHeight+inputHeight):0);
11532373
11542374 return offset;
11552375 },
11562376
11572377
11582378 _findPos:function(obj){
 2379+var inst=this._getInst(obj);
 2380+var isRTL=this._get(inst,'isRTL');
11592381 while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){
1160 -obj=obj.nextSibling;
 2382+obj=obj[isRTL?'previousSibling':'nextSibling'];
11612383 }
11622384 var position=$(obj).offset();
11632385 return[position.left,position.top];
@@ -1164,29 +2386,24 @@
11652387
11662388
11672389
1168 -
1169 -_hideDatepicker:function(input,duration){
 2390+_hideDatepicker:function(input){
11702391 var inst=this._curInst;
11712392 if(!inst||(input&&inst!=$.data(input,PROP_NAME)))
11722393 return;
1173 -if(inst.stayOpen)
1174 -this._selectDate('#'+inst.id,this._formatDate(inst,
1175 -inst.currentDay,inst.currentMonth,inst.currentYear));
1176 -inst.stayOpen=false;
11772394 if(this._datepickerShowing){
1178 -duration=(duration!=null?duration:this._get(inst,'duration'));
11792395 var showAnim=this._get(inst,'showAnim');
 2396+var duration=this._get(inst,'duration');
11802397 var postProcess=function(){
11812398 $.datepicker._tidyDialog(inst);
 2399+this._curInst=null;
11822400 };
1183 -if(duration!=''&&$.effects&&$.effects[showAnim])
1184 -inst.dpDiv.hide(showAnim,$.datepicker._get(inst,'showOptions'),
1185 -duration,postProcess);
 2401+if($.effects&&$.effects[showAnim])
 2402+inst.dpDiv.hide(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);
11862403 else
1187 -inst.dpDiv[(duration==''?'hide':(showAnim=='slideDown'?'slideUp':
1188 -(showAnim=='fadeIn'?'fadeOut':'hide')))](duration,postProcess);
1189 -if(duration=='')
1190 -this._tidyDialog(inst);
 2404+inst.dpDiv[(showAnim=='slideDown'?'slideUp':
 2405+(showAnim=='fadeIn'?'fadeOut':'hide'))]((showAnim?duration:null),postProcess);
 2406+if(!showAnim)
 2407+postProcess();
11912408 var onClose=this._get(inst,'onClose');
11922409 if(onClose)
11932410 onClose.apply((inst.input?inst.input[0]:null),
@@ -1202,7 +2419,6 @@
12032420 }
12042421 this._inDialog=false;
12052422 }
1206 -this._curInst=null;
12072423 },
12082424
12092425
@@ -1215,11 +2431,12 @@
12162432 if(!$.datepicker._curInst)
12172433 return;
12182434 var $target=$(event.target);
1219 -if(($target.parents('#'+$.datepicker._mainDivId).length==0)&&
 2435+if($target[0].id!=$.datepicker._mainDivId&&
 2436+$target.parents('#'+$.datepicker._mainDivId).length==0&&
12202437 !$target.hasClass($.datepicker.markerClassName)&&
12212438 !$target.hasClass($.datepicker._triggerClass)&&
12222439 $.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))
1223 -$.datepicker._hideDatepicker(null,'');
 2440+$.datepicker._hideDatepicker();
12242441 },
12252442
12262443
@@ -1271,7 +2488,7 @@
12722489 var target=$(id);
12732490 var inst=this._getInst(target[0]);
12742491 if(inst.input&&inst._selectingMonthYear&&!$.browser.msie)
1275 -inst.input[0].focus();
 2492+inst.input.focus();
12762493 inst._selectingMonthYear=!inst._selectingMonthYear;
12772494 },
12782495
@@ -1285,24 +2502,14 @@
12862503 inst.selectedDay=inst.currentDay=$('a',td).html();
12872504 inst.selectedMonth=inst.currentMonth=month;
12882505 inst.selectedYear=inst.currentYear=year;
1289 -if(inst.stayOpen){
1290 -inst.endDay=inst.endMonth=inst.endYear=null;
1291 -}
12922506 this._selectDate(id,this._formatDate(inst,
12932507 inst.currentDay,inst.currentMonth,inst.currentYear));
1294 -if(inst.stayOpen){
1295 -inst.rangeStart=this._daylightSavingAdjust(
1296 -new Date(inst.currentYear,inst.currentMonth,inst.currentDay));
1297 -this._updateDatepicker(inst);
1298 -}
12992508 },
13002509
13012510
13022511 _clearDate:function(id){
13032512 var target=$(id);
13042513 var inst=this._getInst(target[0]);
1305 -inst.stayOpen=false;
1306 -inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;
13072514 this._selectDate(target,'');
13082515 },
13092516
@@ -1321,11 +2528,11 @@
13222529 inst.input.trigger('change');
13232530 if(inst.inline)
13242531 this._updateDatepicker(inst);
1325 -else if(!inst.stayOpen){
1326 -this._hideDatepicker(null,this._get(inst,'duration'));
 2532+else{
 2533+this._hideDatepicker();
13272534 this._lastInput=inst.input[0];
13282535 if(typeof(inst.input[0])!='object')
1329 -inst.input[0].focus();
 2536+inst.input.focus();
13302537 this._lastInput=null;
13312538 }
13322539 },
@@ -1336,7 +2543,7 @@
13372544 if(altField){
13382545 var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat');
13392546 var date=this._getDate(inst);
1340 -dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));
 2547+var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));
13412548 $(altField).each(function(){$(this).val(dateStr);});
13422549 }
13432550 },
@@ -1353,20 +2560,13 @@
13542561
13552562
13562563 iso8601Week:function(date){
1357 -var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());
1358 -var firstMon=new Date(checkDate.getFullYear(),1-1,4);
1359 -var firstDay=firstMon.getDay()||7;
1360 -firstMon.setDate(firstMon.getDate()+1-firstDay);
1361 -if(firstDay<4&&checkDate<firstMon){
1362 -checkDate.setDate(checkDate.getDate()-3);
1363 -return $.datepicker.iso8601Week(checkDate);
1364 -}else if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){
1365 -firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;
1366 -if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){
1367 -return 1;
1368 -}
1369 -}
1370 -return Math.floor(((checkDate-firstMon)/86400000)/7)+1;
 2564+var checkDate=new Date(date.getTime());
 2565+
 2566+checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));
 2567+var time=checkDate.getTime();
 2568+checkDate.setMonth(0);
 2569+checkDate.setDate(1);
 2570+return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;
13712571 },
13722572
13732573
@@ -1407,34 +2607,25 @@
14082608
14092609 var getNumber=function(match){
14102610 lookAhead(match);
1411 -var origSize=(match=='@'?14:(match=='y'?4:(match=='o'?3:2)));
1412 -var size=origSize;
1413 -var num=0;
1414 -while(size>0&&iValue<value.length&&
1415 -value.charAt(iValue)>='0'&&value.charAt(iValue)<='9'){
1416 -num=num*10+parseInt(value.charAt(iValue++),10);
1417 -size--;
1418 -}
1419 -if(size==origSize)
 2611+var size=(match=='@'?14:(match=='!'?20:
 2612+(match=='y'?4:(match=='o'?3:2))));
 2613+var digits=new RegExp('^\\d{1,'+size+'}');
 2614+var num=value.substring(iValue).match(digits);
 2615+if(!num)
14202616 throw'Missing number at position '+iValue;
1421 -return num;
 2617+iValue+=num[0].length;
 2618+return parseInt(num[0],10);
14222619 };
14232620
14242621 var getName=function(match,shortNames,longNames){
14252622 var names=(lookAhead(match)?longNames:shortNames);
1426 -var size=0;
1427 -for(var j=0;j<names.length;j++)
1428 -size=Math.max(size,names[j].length);
1429 -var name='';
1430 -var iInit=iValue;
1431 -while(size>0&&iValue<value.length){
1432 -name+=value.charAt(iValue++);
1433 -for(var i=0;i<names.length;i++)
1434 -if(name==names[i])
 2623+for(var i=0;i<names.length;i++){
 2624+if(value.substr(iValue,names[i].length)==names[i]){
 2625+iValue+=names[i].length;
14352626 return i+1;
1436 -size--;
14372627 }
1438 -throw'Unknown name at position '+iInit;
 2628+}
 2629+throw'Unknown name at position '+iValue;
14392630 };
14402631
14412632 var checkLiteral=function(){
@@ -1475,6 +2666,12 @@
14762667 month=date.getMonth()+1;
14772668 day=date.getDate();
14782669 break;
 2670+case'!':
 2671+var date=new Date((getNumber('!')-this._ticksTo1970)/10000);
 2672+year=date.getFullYear();
 2673+month=date.getMonth()+1;
 2674+day=date.getDate();
 2675+break;
14792676 case"'":
14802677 if(lookAhead("'"))
14812678 checkLiteral();
@@ -1517,9 +2714,12 @@
15182715 RFC_1123:'D, d M yy',
15192716 RFC_2822:'D, d M yy',
15202717 RSS:'D, d M y',
 2718+TICKS:'!',
15212719 TIMESTAMP:'@',
15222720 W3C:'yy-mm-dd',
15232721
 2722+_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+
 2723+Math.floor(1970/400))*24*60*60*10000000),
15242724
15252725
15262726
@@ -1546,6 +2746,8 @@
15472747
15482748
15492749
 2750+
 2751+
15502752 formatDate:function(format,date,settings){
15512753 if(!date)
15522754 return'';
@@ -1590,10 +2792,8 @@
15912793 output+=formatName('D',date.getDay(),dayNamesShort,dayNames);
15922794 break;
15932795 case'o':
1594 -var doy=date.getDate();
1595 -for(var m=date.getMonth()-1;m>=0;m--)
1596 -doy+=this._getDaysInMonth(date.getFullYear(),m);
1597 -output+=formatNumber('o',doy,3);
 2796+output+=formatNumber('o',
 2797+(date.getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000,3);
15982798 break;
15992799 case'm':
16002800 output+=formatNumber('m',date.getMonth()+1,2);
@@ -1608,6 +2808,9 @@
16092809 case'@':
16102810 output+=date.getTime();
16112811 break;
 2812+case'!':
 2813+output+=date.getTime()*10000+this._ticksTo1970;
 2814+break;
16122815 case"'":
16132816 if(lookAhead("'"))
16142817 output+="'";
@@ -1625,6 +2828,13 @@
16262829 _possibleChars:function(format){
16272830 var chars='';
16282831 var literal=false;
 2832+
 2833+var lookAhead=function(match){
 2834+var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);
 2835+if(matches)
 2836+iFormat++;
 2837+return matches;
 2838+};
16292839 for(var iFormat=0;iFormat<format.length;iFormat++)
16302840 if(literal)
16312841 if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
@@ -1657,17 +2867,20 @@
16582868 },
16592869
16602870
1661 -_setDateFromField:function(inst){
 2871+_setDateFromField:function(inst,noDefault){
 2872+if(inst.input.val()==inst.lastVal){
 2873+return;
 2874+}
16622875 var dateFormat=this._get(inst,'dateFormat');
1663 -var dates=inst.input?inst.input.val():null;
1664 -inst.endDay=inst.endMonth=inst.endYear=null;
1665 -var date=defaultDate=this._getDefaultDate(inst);
 2876+var dates=inst.lastVal=inst.input?inst.input.val():null;
 2877+var date,defaultDate;
 2878+date=defaultDate=this._getDefaultDate(inst);
16662879 var settings=this._getFormatConfig(inst);
16672880 try{
16682881 date=this.parseDate(dateFormat,dates,settings)||defaultDate;
16692882 }catch(event){
16702883 this.log(event);
1671 -date=defaultDate;
 2884+dates=(noDefault?'':dates);
16722885 }
16732886 inst.selectedDay=date.getDate();
16742887 inst.drawMonth=inst.selectedMonth=date.getMonth();
@@ -1680,23 +2893,27 @@
16812894
16822895
16832896 _getDefaultDate:function(inst){
1684 -var date=this._determineDate(this._get(inst,'defaultDate'),new Date());
1685 -var minDate=this._getMinMaxDate(inst,'min',true);
1686 -var maxDate=this._getMinMaxDate(inst,'max');
1687 -date=(minDate&&date<minDate?minDate:date);
1688 -date=(maxDate&&date>maxDate?maxDate:date);
1689 -return date;
 2897+return this._restrictMinMax(inst,
 2898+this._determineDate(inst,this._get(inst,'defaultDate'),new Date()));
16902899 },
16912900
16922901
1693 -_determineDate:function(date,defaultDate){
 2902+_determineDate:function(inst,date,defaultDate){
16942903 var offsetNumeric=function(offset){
16952904 var date=new Date();
16962905 date.setDate(date.getDate()+offset);
16972906 return date;
16982907 };
1699 -var offsetString=function(offset,getDaysInMonth){
1700 -var date=new Date();
 2908+var offsetString=function(offset){
 2909+try{
 2910+return $.datepicker.parseDate($.datepicker._get(inst,'dateFormat'),
 2911+offset,$.datepicker._getFormatConfig(inst));
 2912+}
 2913+catch(e){
 2914+
 2915+}
 2916+var date=(offset.toLowerCase().match(/^c/)?
 2917+$.datepicker._getDate(inst):null)||new Date();
17012918 var year=date.getFullYear();
17022919 var month=date.getMonth();
17032920 var day=date.getDate();
@@ -1710,19 +2927,18 @@
17112928 day+=parseInt(matches[1],10)*7;break;
17122929 case'm':case'M':
17132930 month+=parseInt(matches[1],10);
1714 -day=Math.min(day,getDaysInMonth(year,month));
 2931+day=Math.min(day,$.datepicker._getDaysInMonth(year,month));
17152932 break;
17162933 case'y':case'Y':
17172934 year+=parseInt(matches[1],10);
1718 -day=Math.min(day,getDaysInMonth(year,month));
 2935+day=Math.min(day,$.datepicker._getDaysInMonth(year,month));
17192936 break;
17202937 }
17212938 matches=pattern.exec(offset);
17222939 }
17232940 return new Date(year,month,day);
17242941 };
1725 -date=(date==null?defaultDate:
1726 -(typeof date=='string'?offsetString(date,this._getDaysInMonth):
 2942+date=(date==null?defaultDate:(typeof date=='string'?offsetString(date):
17272943 (typeof date=='number'?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));
17282944 date=(date&&date.toString()=='Invalid Date'?defaultDate:date);
17292945 if(date){
@@ -1747,15 +2963,15 @@
17482964 },
17492965
17502966
1751 -_setDate:function(inst,date,endDate){
 2967+_setDate:function(inst,date,noChange){
17522968 var clear=!(date);
17532969 var origMonth=inst.selectedMonth;
17542970 var origYear=inst.selectedYear;
1755 -date=this._determineDate(date,new Date());
 2971+date=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));
17562972 inst.selectedDay=inst.currentDay=date.getDate();
17572973 inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();
17582974 inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();
1759 -if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)
 2975+if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange)
17602976 this._notifyChange(inst);
17612977 this._adjustInstDate(inst);
17622978 if(inst.input){
@@ -1783,11 +2999,10 @@
17843000 var numMonths=this._getNumberOfMonths(inst);
17853001 var showCurrentAtPos=this._get(inst,'showCurrentAtPos');
17863002 var stepMonths=this._get(inst,'stepMonths');
1787 -var stepBigMonths=this._get(inst,'stepBigMonths');
17883003 var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);
17893004 var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):
17903005 new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
1791 -var minDate=this._getMinMaxDate(inst,'min',true);
 3006+var minDate=this._getMinMaxDate(inst,'min');
17923007 var maxDate=this._getMinMaxDate(inst,'max');
17933008 var drawMonth=inst.drawMonth-showCurrentAtPos;
17943009 var drawYear=inst.drawYear;
@@ -1797,7 +3012,7 @@
17983013 }
17993014 if(maxDate){
18003015 var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
1801 -maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));
 3016+maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));
18023017 maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);
18033018 while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){
18043019 drawMonth--;
@@ -1814,7 +3029,8 @@
18153030 this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),
18163031 this._getFormatConfig(inst)));
18173032 var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?
1818 -'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepMonths+', \'M\');"'+
 3033+'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+
 3034+'.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepMonths+', \'M\');"'+
18193035 ' title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>':
18203036 (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>'));
18213037 var nextText=this._get(inst,'nextText');
@@ -1822,19 +3038,23 @@
18233039 this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),
18243040 this._getFormatConfig(inst)));
18253041 var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?
1826 -'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepMonths+', \'M\');"'+
 3042+'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+
 3043+'.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepMonths+', \'M\');"'+
18273044 ' title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>':
18283045 (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>'));
18293046 var currentText=this._get(inst,'currentText');
18303047 var gotoDate=(this._get(inst,'gotoCurrent')&&inst.currentDay?currentDate:today);
18313048 currentText=(!navigationAsDateFormat?currentText:
18323049 this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));
1833 -var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,'closeText')+'</button>':'');
 3050+var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+
 3051+'.datepicker._hideDatepicker();">'+this._get(inst,'closeText')+'</button>':'');
18343052 var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:'')+
1835 -(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+'\');"'+
 3053+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+
 3054+'.datepicker._gotoToday(\'#'+inst.id+'\');"'+
18363055 '>'+currentText+'</button>':'')+(isRTL?'':controls)+'</div>':'';
18373056 var firstDay=parseInt(this._get(inst,'firstDay'),10);
18383057 firstDay=(isNaN(firstDay)?0:firstDay);
 3058+var showWeek=this._get(inst,'showWeek');
18393059 var dayNames=this._get(inst,'dayNames');
18403060 var dayNamesShort=this._get(inst,'dayNamesShort');
18413061 var dayNamesMin=this._get(inst,'dayNamesMin');
@@ -1842,9 +3062,8 @@
18433063 var monthNamesShort=this._get(inst,'monthNamesShort');
18443064 var beforeShowDay=this._get(inst,'beforeShowDay');
18453065 var showOtherMonths=this._get(inst,'showOtherMonths');
 3066+var selectOtherMonths=this._get(inst,'selectOtherMonths');
18463067 var calculateWeek=this._get(inst,'calculateWeek')||this.iso8601Week;
1847 -var endDate=inst.endDay?this._daylightSavingAdjust(
1848 -new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;
18493068 var defaultDate=this._getDefaultDate(inst);
18503069 var html='';
18513070 for(var row=0;row<numMonths[0];row++){
@@ -1854,11 +3073,14 @@
18553074 var cornerClass=' ui-corner-all';
18563075 var calender='';
18573076 if(isMultiMonth){
1858 -calender+='<div class="ui-datepicker-group ui-datepicker-group-';
 3077+calender+='<div class="ui-datepicker-group';
 3078+if(numMonths[1]>1)
18593079 switch(col){
1860 -case 0:calender+='first';cornerClass=' ui-corner-'+(isRTL?'right':'left');break;
1861 -case numMonths[1]-1:calender+='last';cornerClass=' ui-corner-'+(isRTL?'left':'right');break;
1862 -default:calender+='middle';cornerClass='';break;
 3080+case 0:calender+=' ui-datepicker-group-first';
 3081+cornerClass=' ui-corner-'+(isRTL?'right':'left');break;
 3082+case numMonths[1]-1:calender+=' ui-datepicker-group-last';
 3083+cornerClass=' ui-corner-'+(isRTL?'left':'right');break;
 3084+default:calender+=' ui-datepicker-group-middle';cornerClass='';break;
18633085 }
18643086 calender+='">';
18653087 }
@@ -1866,10 +3088,10 @@
18673089 (/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):'')+
18683090 (/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):'')+
18693091 this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,
1870 -selectedDate,row>0||col>0,monthNames,monthNamesShort)+
 3092+row>0||col>0,monthNames,monthNamesShort)+
18713093 '</div><table class="ui-datepicker-calendar"><thead>'+
18723094 '<tr>';
1873 -var thead='';
 3095+var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,'weekHeader')+'</th>':'');
18743096 for(var dow=0;dow<7;dow++){
18753097 var day=(dow+firstDay)%7;
18763098 thead+='<th'+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':'')+'>'+
@@ -1884,12 +3106,13 @@
18853107 var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));
18863108 for(var dRow=0;dRow<numRows;dRow++){
18873109 calender+='<tr>';
1888 -var tbody='';
 3110+var tbody=(!showWeek?'':'<td class="ui-datepicker-week-col">'+
 3111+this._get(inst,'calculateWeek')(printDate)+'</td>');
18893112 for(var dow=0;dow<7;dow++){
18903113 var daySettings=(beforeShowDay?
18913114 beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,'']);
18923115 var otherMonth=(printDate.getMonth()!=drawMonth);
1893 -var unselectable=otherMonth||!daySettings[0]||
 3116+var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||
18943117 (minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);
18953118 tbody+='<td class="'+
18963119 ((dow+firstDay+6)%7>=5?' ui-datepicker-week-end':'')+
@@ -1900,17 +3123,16 @@
19013124 ' '+this._dayOverClass:'')+
19023125 (unselectable?' '+this._unselectableClass+' ui-state-disabled':'')+
19033126 (otherMonth&&!showOtherMonths?'':' '+daySettings[1]+
1904 -(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?
1905 -' '+this._currentClass:'')+
 3127+(printDate.getTime()==currentDate.getTime()?' '+this._currentClass:'')+
19063128 (printDate.getTime()==today.getTime()?' ui-datepicker-today':''))+'"'+
19073129 ((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':'')+
1908 -(unselectable?'':' onclick="DP_jQuery.datepicker._selectDay(\'#'+
1909 -inst.id+'\','+drawMonth+','+drawYear+', this);return false;"')+'>'+
1910 -(otherMonth?(showOtherMonths?printDate.getDate():'&#xa0;'):
 3130+(unselectable?'':' onclick="DP_jQuery_'+dpuuid+'.datepicker._selectDay(\'#'+
 3131+inst.id+'\','+printDate.getMonth()+','+printDate.getFullYear()+', this);return false;"')+'>'+
 3132+(otherMonth&&!showOtherMonths?'&#xa0;':
19113133 (unselectable?'<span class="ui-state-default">'+printDate.getDate()+'</span>':'<a class="ui-state-default'+
19123134 (printDate.getTime()==today.getTime()?' ui-state-highlight':'')+
1913 -(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?
1914 -' ui-state-active':'')+
 3135+(printDate.getTime()==currentDate.getTime()?' ui-state-active':'')+
 3136+(otherMonth?' ui-priority-secondary':'')+
19153137 '" href="#">'+printDate.getDate()+'</a>'))+'</td>';
19163138 printDate.setDate(printDate.getDate()+1);
19173139 printDate=this._daylightSavingAdjust(printDate);
@@ -1936,8 +3158,7 @@
19373159
19383160
19393161 _generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,
1940 -selectedDate,secondary,monthNames,monthNamesShort){
1941 -minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);
 3162+secondary,monthNames,monthNamesShort){
19423163 var changeMonth=this._get(inst,'changeMonth');
19433164 var changeYear=this._get(inst,'changeYear');
19443165 var showMonthAfterYear=this._get(inst,'showMonthAfterYear');
@@ -1945,13 +3166,13 @@
19463167 var monthHtml='';
19473168
19483169 if(secondary||!changeMonth)
1949 -monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span> ';
 3170+monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span>';
19503171 else{
19513172 var inMinYear=(minDate&&minDate.getFullYear()==drawYear);
19523173 var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);
19533174 monthHtml+='<select class="ui-datepicker-month" '+
1954 -'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+
1955 -'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
 3175+'onchange="DP_jQuery_'+dpuuid+'.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+
 3176+'onclick="DP_jQuery_'+dpuuid+'.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
19563177 '>';
19573178 for(var month=0;month<12;month++){
19583179 if((!inMinYear||month>=minDate.getMonth())&&
@@ -1963,30 +3184,27 @@
19643185 monthHtml+='</select>';
19653186 }
19663187 if(!showMonthAfterYear)
1967 -html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?'&#xa0;':'');
 3188+html+=monthHtml+(secondary||!(changeMonth&&changeYear)?'&#xa0;':'');
19683189
19693190 if(secondary||!changeYear)
19703191 html+='<span class="ui-datepicker-year">'+drawYear+'</span>';
19713192 else{
19723193
19733194 var years=this._get(inst,'yearRange').split(':');
1974 -var year=0;
1975 -var endYear=0;
1976 -if(years.length!=2){
1977 -year=drawYear-10;
1978 -endYear=drawYear+10;
1979 -}else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){
1980 -year=drawYear+parseInt(years[0],10);
1981 -endYear=drawYear+parseInt(years[1],10);
1982 -}else{
1983 -year=parseInt(years[0],10);
1984 -endYear=parseInt(years[1],10);
1985 -}
 3195+var thisYear=new Date().getFullYear();
 3196+var determineYear=function(value){
 3197+var year=(value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):
 3198+(value.match(/[+-].*/)?thisYear+parseInt(value,10):
 3199+parseInt(value,10)));
 3200+return(isNaN(year)?thisYear:year);
 3201+};
 3202+var year=determineYear(years[0]);
 3203+var endYear=Math.max(year,determineYear(years[1]||''));
19863204 year=(minDate?Math.max(year,minDate.getFullYear()):year);
19873205 endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);
19883206 html+='<select class="ui-datepicker-year" '+
1989 -'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+
1990 -'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
 3207+'onchange="DP_jQuery_'+dpuuid+'.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+
 3208+'onclick="DP_jQuery_'+dpuuid+'.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
19913209 '>';
19923210 for(;year<=endYear;year++){
19933211 html+='<option value="'+year+'"'+
@@ -1995,8 +3213,9 @@
19963214 }
19973215 html+='</select>';
19983216 }
 3217+html+=this._get(inst,'yearSuffix');
19993218 if(showMonthAfterYear)
2000 -html+=(secondary||changeMonth||changeYear?'&#xa0;':'')+monthHtml;
 3219+html+=(secondary||!(changeMonth&&changeYear)?'&#xa0;':'')+monthHtml;
20013220 html+='</div>';
20023221 return html;
20033222 },
@@ -2007,12 +3226,8 @@
20083227 var month=inst.drawMonth+(period=='M'?offset:0);
20093228 var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+
20103229 (period=='D'?offset:0);
2011 -var date=this._daylightSavingAdjust(new Date(year,month,day));
2012 -
2013 -var minDate=this._getMinMaxDate(inst,'min',true);
2014 -var maxDate=this._getMinMaxDate(inst,'max');
2015 -date=(minDate&&date<minDate?minDate:date);
2016 -date=(maxDate&&date>maxDate?maxDate:date);
 3230+var date=this._restrictMinMax(inst,
 3231+this._daylightSavingAdjust(new Date(year,month,day)));
20173232 inst.selectedDay=date.getDate();
20183233 inst.drawMonth=inst.selectedMonth=date.getMonth();
20193234 inst.drawYear=inst.selectedYear=date.getFullYear();
@@ -2021,6 +3236,15 @@
20223237 },
20233238
20243239
 3240+_restrictMinMax:function(inst,date){
 3241+var minDate=this._getMinMaxDate(inst,'min');
 3242+var maxDate=this._getMinMaxDate(inst,'max');
 3243+date=(minDate&&date<minDate?minDate:date);
 3244+date=(maxDate&&date>maxDate?maxDate:date);
 3245+return date;
 3246+},
 3247+
 3248+
20253249 _notifyChange:function(inst){
20263250 var onChange=this._get(inst,'onChangeMonthYear');
20273251 if(onChange)
@@ -2035,10 +3259,8 @@
20363260 },
20373261
20383262
2039 -_getMinMaxDate:function(inst,minMax,checkRange){
2040 -var date=this._determineDate(this._get(inst,minMax+'Date'),null);
2041 -return(!checkRange||!inst.rangeStart?date:
2042 -(!date||inst.rangeStart>date?inst.rangeStart:date));
 3263+_getMinMaxDate:function(inst,minMax){
 3264+return this._determineDate(inst,this._get(inst,minMax+'Date'),null);
20433265 },
20443266
20453267
@@ -2054,8 +3276,8 @@
20553277
20563278 _canAdjustMonth:function(inst,offset,curYear,curMonth){
20573279 var numMonths=this._getNumberOfMonths(inst);
2058 -var date=this._daylightSavingAdjust(new Date(
2059 -curYear,curMonth+(offset<0?offset:numMonths[1]),1));
 3280+var date=this._daylightSavingAdjust(new Date(curYear,
 3281+curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));
20603282 if(offset<0)
20613283 date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));
20623284 return this._isInRange(inst,date);
@@ -2063,13 +3285,10 @@
20643286
20653287
20663288 _isInRange:function(inst,date){
2067 -
2068 -var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(
2069 -new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));
2070 -newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);
2071 -var minDate=newMinDate||this._getMinMaxDate(inst,'min');
 3289+var minDate=this._getMinMaxDate(inst,'min');
20723290 var maxDate=this._getMinMaxDate(inst,'max');
2073 -return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));
 3291+return((!minDate||date.getTime()>=minDate.getTime())&&
 3292+(!maxDate||date.getTime()<=maxDate.getTime()));
20743293 },
20753294
20763295
@@ -2125,9 +3344,12 @@
21263345 }
21273346
21283347 var otherArgs=Array.prototype.slice.call(arguments,1);
2129 -if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'))
 3348+if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'||options=='widget'))
21303349 return $.datepicker['_'+options+'Datepicker'].
21313350 apply($.datepicker,[this[0]].concat(otherArgs));
 3351+if(options=='option'&&arguments.length==2&&typeof arguments[1]=='string')
 3352+return $.datepicker['_'+options+'Datepicker'].
 3353+apply($.datepicker,[this[0]].concat(otherArgs));
21323354 return this.each(function(){
21333355 typeof options=='string'?
21343356 $.datepicker['_'+options+'Datepicker'].
@@ -2139,11 +3361,11 @@
21403362 $.datepicker=new Datepicker();
21413363 $.datepicker.initialized=false;
21423364 $.datepicker.uuid=new Date().getTime();
2143 -$.datepicker.version="1.7.1";
 3365+$.datepicker.version="1.8.2";
21443366
21453367
21463368
2147 -window.DP_jQuery=$;
 3369+window['DP_jQuery_'+dpuuid]=$;
21483370
21493371 })(jQuery);
21503372
@@ -2158,17 +3380,16 @@
21593381
21603382
21613383
 3384+
21623385 (function($){
21633386
21643387 $.widget("ui.progressbar",{
2165 -
2166 -_init:function(){
2167 -
 3388+options:{
 3389+value:0
 3390+},
 3391+_create:function(){
21683392 this.element
2169 -.addClass("ui-progressbar"
2170 -+" ui-widget"
2171 -+" ui-widget-content"
2172 -+" ui-corner-all")
 3393+.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all")
21733394 .attr({
21743395 role:"progressbar",
21753396 "aria-valuemin":this._valueMin(),
@@ -2176,85 +3397,81 @@
21773398 "aria-valuenow":this._value()
21783399 });
21793400
2180 -this.valueDiv=$('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);
 3401+this.valueDiv=$("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>")
 3402+.appendTo(this.element);
21813403
21823404 this._refreshValue();
2183 -
21843405 },
21853406
21863407 destroy:function(){
2187 -
21883408 this.element
2189 -.removeClass("ui-progressbar"
2190 -+" ui-widget"
2191 -+" ui-widget-content"
2192 -+" ui-corner-all")
 3409+.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all")
21933410 .removeAttr("role")
21943411 .removeAttr("aria-valuemin")
21953412 .removeAttr("aria-valuemax")
2196 -.removeAttr("aria-valuenow")
2197 -.removeData("progressbar")
2198 -.unbind(".progressbar");
 3413+.removeAttr("aria-valuenow");
21993414
22003415 this.valueDiv.remove();
22013416
2202 -$.widget.prototype.destroy.apply(this,arguments);
2203 -
 3417+$.Widget.prototype.destroy.apply(this,arguments);
22043418 },
22053419
22063420 value:function(newValue){
2207 -arguments.length&&this._setData("value",newValue);
 3421+if(newValue===undefined){
22083422 return this._value();
 3423+}
 3424+
 3425+this._setOption("value",newValue);
 3426+return this;
22093427 },
22103428
2211 -_setData:function(key,value){
2212 -
 3429+_setOption:function(key,value){
22133430 switch(key){
2214 -case'value':
 3431+case"value":
22153432 this.options.value=value;
22163433 this._refreshValue();
2217 -this._trigger('change',null,{});
 3434+this._trigger("change");
22183435 break;
22193436 }
22203437
2221 -$.widget.prototype._setData.apply(this,arguments);
2222 -
 3438+$.Widget.prototype._setOption.apply(this,arguments);
22233439 },
22243440
22253441 _value:function(){
2226 -
22273442 var val=this.options.value;
2228 -if(val<this._valueMin())val=this._valueMin();
2229 -if(val>this._valueMax())val=this._valueMax();
22303443
 3444+if(typeof val!=="number"){
 3445+val=0;
 3446+}
 3447+if(val<this._valueMin()){
 3448+val=this._valueMin();
 3449+}
 3450+if(val>this._valueMax()){
 3451+val=this._valueMax();
 3452+}
 3453+
22313454 return val;
2232 -
22333455 },
22343456
22353457 _valueMin:function(){
2236 -var valueMin=0;
2237 -return valueMin;
 3458+return 0;
22383459 },
22393460
22403461 _valueMax:function(){
2241 -var valueMax=100;
2242 -return valueMax;
 3462+return 100;
22433463 },
22443464
22453465 _refreshValue:function(){
22463466 var value=this.value();
2247 -this.valueDiv[value==this._valueMax()?'addClass':'removeClass']("ui-corner-right");
2248 -this.valueDiv.width(value+'%');
 3467+this.valueDiv
 3468+[value===this._valueMax()?"addClass":"removeClass"]("ui-corner-right")
 3469+.width(value+"%");
22493470 this.element.attr("aria-valuenow",value);
22503471 }
2251 -
22523472 });
22533473
22543474 $.extend($.ui.progressbar,{
2255 -version:"1.7.1",
2256 -defaults:{
2257 -value:0
2258 -}
 3475+version:"1.8.2"
22593476 });
22603477
22613478 })(jQuery);
@@ -7912,7 +9129,9 @@
79139130
79149131 json=$j(doc.body).find('pre').text();
79159132 mw.log('iframe:json::'+json);
7916 -if(json){
 9133+
 9134+
 9135+if(json&&json.substring(0,5)!=='<?xml'){
79179136 response=window["eval"]("( "+json+" )");
79189137 }else{
79199138 response={};
@@ -9210,6 +10429,7 @@
921110430
921210431
921310432 remove:function(){
 10433+this.state='aborted';
921410434 if(this.details&&this.details.div){
921510435 this.details.div.remove();
921610436 }
@@ -9251,6 +10471,9 @@
925210472
925310473 setTransported:function(result){
925410474 var _this=this;
 10475+if(_this.state=='aborted'){
 10476+return;
 10477+}
925510478
925610479 if(result.upload&&result.upload.imageinfo){
925710480
@@ -9462,10 +10685,11 @@
946310686 _this.$fileInputCtrl=$j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
946410687 .change(function(){_this.fileChanged();});
946510688
 10689+_this.$indicator=$j('<div class="mwe-upwiz-file-indicator"></div>');
946610690
946710691 visibleFilenameDiv=$j('<div class="mwe-upwiz-visible-file"></div>')
9468 -.append('<div class="mwe-upwiz-file-indicator"></div>'
9469 -+'<div class="mwe-upwiz-visible-file-filename">'
 10692+.append(_this.$indicator)
 10693+.append('<div class="mwe-upwiz-visible-file-filename">'
947010694 +'<div class="mwe-upwiz-file-preview"/>'
947110695 +'<div class="mwe-upwiz-file-texts">'
947210696 +'<div class="mwe-upwiz-visible-file-filename-text"/>'
@@ -9551,16 +10775,22 @@
955210776
955310777
955410778 showIndicator:function(statusClass){
9555 -var $indicator=$j(this.div).find('.mwe-upwiz-file-indicator');
 10779+this.clearIndicator();
955610780
9557 -$j.each($indicator.attr('class').split(/\s+/),function(i,className){
 10781+this.$indicator.addClass('mwe-upwiz-status-'+statusClass)
 10782+.css('visibility','visible');
 10783+},
 10784+
 10785+
 10786+
 10787+
 10788+clearIndicator:function(){
 10789+var _this=this;
 10790+$j.each(_this.$indicator.attr('class').split(/\s+/),function(i,className){
955810791 if(className.match(/^mwe-upwiz-status/)){
9559 -$indicator.removeClass(className);
 10792+_this.$indicator.removeClass(className);
956010793 }
956110794 });
9562 -
9563 -$indicator.addClass('mwe-upwiz-status-'+statusClass)
9564 -.css('visibility','visible');
956510795 },
956610796
956710797
@@ -9671,12 +10901,14 @@
967210902 .width($covered.outerWidth())
967310903 .height($covered.outerHeight());
967410904
 10905+this.fileCtrlContainer.css({'z-index':1});
967510906
967610907
967710908
 10909+
967810910 this.$fileInputCtrl.css({
967910911 'margin-left':'-'+~~(this.$fileInputCtrl.width()-$covered.outerWidth()-10)+'px',
9680 -'margin-top':'-'+~~(this.$fileInputCtrl.height()-$covered.outerHeight()-10)+'px'
 10912+'margin-top':'-'+~~(this.$fileInputCtrl.height()-$covered.outerHeight()-10)+'px',
968110913 });
968210914
968310915
@@ -10708,21 +11940,25 @@
1070911941 createInterface:function(selector){
1071011942 var _this=this;
1071111943
 11944+
1071211945 $j('#mwe-upwiz-steps')
1071311946 .addClass('ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix')
1071411947 .arrowSteps();
1071511948
10716 -$j('.mwe-upwiz-button-home')
10717 -.append(gM('mwe-upwiz-home'))
10718 -.click(function(){window.location.href='/';});
1071911949
 11950+$j('.mwe-upwiz-stepdiv .mwe-upwiz-buttons button')
 11951+.button()
 11952+.css({'margin-left':'1em'});
 11953+
 11954+
1072011955 $j('.mwe-upwiz-button-begin')
10721 -.append(gM('mwe-upwiz-upload-another'))
1072211956 .click(function(){_this.reset();});
1072311957
 11958+$j('.mwe-upwiz-button-home')
 11959+.click(function(){window.location.href='/';});
1072411960
 11961+
1072511962 $j('#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next')
10726 -.append(gM('mwe-upwiz-next'))
1072711963 .click(function(){
1072811964 _this.moveToStep('file',function(){
1072911965
@@ -10735,8 +11971,10 @@
1073611972 });
1073711973 });
1073811974
10739 -$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-button-next')
10740 -.append(gM('mwe-upwiz-next-file'))
 11975+$j('#mwe-upwiz-add-file').button();
 11976+
 11977+$j('#mwe-upwiz-upload-ctrl')
 11978+.button()
1074111979 .click(function(){
1074211980
1074311981 if(_this.uploads.length===0){
@@ -10746,19 +11984,24 @@
1074711985 }
1074811986
1074911987 _this.removeEmptyUploads();
10750 -_this.startUploads(function(){
 11988+_this.startUploads();
 11989+});
1075111990
10752 -alert("hey, uploads are done");
10753 -
 11991+$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-next').click(function(){
 11992+_this.removeErrorUploads();
 11993+_this.prepareAndMoveToDeeds();
1075411994 });
 11995+$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-retry').click(function(){
 11996+_this.hideFileEndButtons();
 11997+_this.startUploads();
1075511998 });
1075611999
1075712000
1075812001
 12002+
1075912003 $j('#mwe-upwiz-deeds-intro').html(gM('mwe-upwiz-deeds-intro'));
1076012004
1076112005 $j('#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next')
10762 -.append(gM('mwe-upwiz-next-deeds'))
1076312006 .click(function(){
1076412007
1076512008
@@ -10791,7 +12034,6 @@
1079212035
1079312036
1079412037 $j('#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next')
10795 -.append(gM('mwe-upwiz-next-details'))
1079612038 .click(function(){
1079712039 if(_this.detailsValid()){
1079812040 _this.detailsSubmit(function(){
@@ -10816,6 +12058,7 @@
1081712059
1081812060
1081912061 prepareAndMoveToDeeds:function(){
 12062+var _this=this;
1082012063
1082112064
1082212065 var deeds=[
@@ -10989,19 +12232,48 @@
1099012233
1099112234
1099212235
 12236+hideFileEndButtons:function(){
 12237+$j('#mwe-upwiz-stepdiv .mwe-upwiz-buttons').hide();
 12238+$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-file-endchoice').hide();
 12239+},
 12240+
 12241+
 12242+
 12243+
 12244+
1099312245 removeEmptyUploads:function(){
10994 -var _this=this;
 12246+this.removeMatchingUploads(function(upload){
 12247+return mw.isEmpty(upload.ui.$fileInputCtrl.val());
 12248+});
 12249+},
 12250+
 12251+
 12252+
 12253+
 12254+removeErrorUploads:function(){
 12255+this.removeMatchingUploads(function(upload){
 12256+return upload.state==='error';
 12257+});
 12258+},
 12259+
 12260+
 12261+
 12262+
 12263+
 12264+
 12265+
 12266+removeMatchingUploads:function(criterion){
1099512267 var toRemove=[];
1099612268
10997 -for(var i=0;i<_this.uploads.length;i++){
10998 -if(mw.isEmpty(_this.uploads[i].ui.$fileInputCtrl.val())){
10999 -toRemove.push(_this.uploads[i]);
 12269+$j.each(this.uploads,function(i,upload){
 12270+if(criterion(upload)){
 12271+toRemove.push(upload);
1100012272 }
11001 -}
 12273+});
1100212274
11003 -for(var j=0;j<toRemove.length;j++){
11004 -toRemove[j].remove();
11005 -}
 12275+$j.each(toRemove,function(i,upload){
 12276+upload.remove();
 12277+})
1100612278 },
1100712279
1100812280
@@ -11013,6 +12285,8 @@
1101412286
1101512287
1101612288
 12289+
 12290+
1101712291 makeTransitioner:function(beginState,progressStates,endStates,starter,endCallback){
1101812292
1101912293 var _this=this;
@@ -11049,17 +12323,28 @@
1105012324
1105112325
1105212326
11053 -startUploads:function(endCallback){
 12327+startUploads:function(){
1105412328 var _this=this;
1105512329
 12330+
1105612331 $j('#mwe-upwiz-upload-ctrls').hide();
 12332+_this.hideFileEndButtons();
1105712333 $j('#mwe-upwiz-add-file').hide();
1105812334
 12335+
 12336+$j.each(_this.uploads,function(i,upload){
 12337+if(upload.state==='error'){
 12338+upload.state='new';
 12339+upload.ui.clearIndicator();
 12340+upload.ui.clearStatus();
 12341+}
 12342+});
 12343+
1105912344 var allowCloseWindow=$j().preventCloseWindow({
1106012345 message:gM('mwe-prevent-close')
1106112346 });
1106212347
11063 -
 12348+$j('#mwe-upwiz-progress').show();
1106412349 var progressBar=new mw.GroupProgressBar('#mwe-upwiz-progress',
1106512350 gM('mwe-upwiz-uploading'),
1106612351 _this.uploads,
@@ -11079,14 +12364,14 @@
1108012365 _this.makeTransitioner(
1108112366 'new',
1108212367 ['transporting','transported','metadata'],
11083 -['error','verified'],
 12368+['error','stashed'],
1108412369 function(upload){
1108512370 upload.start();
1108612371 },
1108712372 function(){
1108812373 allowCloseWindow();
1108912374 $j().notify(gM('mwe-upwiz-files-complete'));
11090 -endCallback();
 12375+_this.showFileNext();
1109112376 }
1109212377 );
1109312378 },
@@ -11099,16 +12384,59 @@
1110012385
1110112386
1110212387
 12388+
 12389+
 12390+showFileNext:function(){
 12391+if(this.uploads.length===0){
 12392+this.updateFileCounts();
 12393+$j('#mwe-upwiz-progress').hide();
 12394+$j('#mwe-upwiz-upload-ctrls').show();
 12395+$j('#mwe-upwiz-add-file').show();
 12396+return;
 12397+}
 12398+var errorCount=0;
 12399+var stashedCount=0;
 12400+$j.each(this.uploads,function(i,upload){
 12401+if(upload.state==='error'){
 12402+errorCount++;
 12403+}else if(upload.state==='stashed'){
 12404+stashedCount++;
 12405+}else{
 12406+mw.log("upload "+i+" not in appropriate state for filenext: "+upload.state);
 12407+}
 12408+});
 12409+var selector=null;
 12410+if(stashedCount===this.uploads.length){
 12411+selector='.mwe-upwiz-file-next-all-ok';
 12412+}else if(errorCount===this.uploads.length){
 12413+selector='.mwe-upwiz-file-next-all-failed';
 12414+}else{
 12415+selector='.mwe-upwiz-file-next-some-failed';
 12416+}
 12417+
 12418+
 12419+$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons').show().find(selector).show();
 12420+
 12421+},
 12422+
 12423+
 12424+
 12425+
 12426+
 12427+
 12428+
 12429+
 12430+
 12431+
1110312432 updateFileCounts:function(){
1110412433 var _this=this;
1110512434
1110612435 if(_this.uploads.length){
1110712436
11108 -$j('#mwe-upwiz-upload-ctrl').removeAttr('disabled');
11109 -$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons').show();
 12437+$j('#mwe-upwiz-upload-ctrl-container').show();
1111012438
1111112439
11112 -$j('#mwe-upwiz-add-file').html(gM('mwe-upwiz-add-file-n'));
 12440+$j('#mwe-upwiz-add-file span').html(gM('mwe-upwiz-add-file-n'));
1111312441 $j('#mwe-upwiz-add-file-container').removeClass('mwe-upwiz-add-files-0');
1111412442 $j('#mwe-upwiz-add-file-container').addClass('mwe-upwiz-add-files-n');
1111512443
@@ -11124,10 +12452,11 @@
1112512453 $j('#mwe-upwiz-filelist .filled:even').removeClass('odd');
1112612454 }else{
1112712455
11128 -$j('#mwe-upwiz-upload-ctrl').attr('disabled','disabled');
1112912456
 12457+$j('#mwe-upwiz-upload-ctrl-container').hide();
1113012458
1113112459
 12460+
1113212461 $j('#mwe-upwiz-filelist').removeClass('mwe-upwiz-filled-filelist');
1113312462
1113412463
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -194,22 +194,38 @@
195195 . UploadWizardTutorial::getHtml()
196196 . '</div>'
197197 . '<div class="mwe-upwiz-buttons">'
198 - . '<button class="mwe-upwiz-button-next"></button>'
 198+ . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next" ) . '</button>'
199199 . '</div>'
200200 . '</div>'
201201
202202 . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">'
203203 . '<div id="mwe-upwiz-files">'
204204 . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>'
205 - . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file">'
 205+ . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file ui-helper-clearfix">'
206206 . '<div id="mwe-upwiz-add-file-container" class="mwe-upwiz-add-files-0">'
207 - . '<a id="mwe-upwiz-add-file">' . wfMsg("mwe-upwiz-add-file-0") . '</a>'
208 - . '</div>'
 207+ . '<button id="mwe-upwiz-add-file">' . wfMsg("mwe-upwiz-add-file-0") . '</button>'
 208+ . '</div>'
 209+ . '<div id="mwe-upwiz-upload-ctrl-container">'
 210+ . '<button id="mwe-upwiz-upload-ctrl">' . wfMsg( "mwe-upwiz-upload" ) . '</button>'
 211+ . '</div>'
209212 . '</div>'
210213 . '<div id="mwe-upwiz-progress" class="ui-helper-clearfix"></div>'
 214+ . '<div id="mwe-upwiz-continue" class="ui-helper-clearfix"></div>'
211215 . '</div>'
212 - . '<div class="mwe-upwiz-buttons" style="display: none"/>'
213 - . '<button class="mwe-upwiz-button-next"></button>'
 216+ . '<div class="mwe-upwiz-buttons">'
 217+ . '<div class="mwe-upwiz-file-next-all-ok mwe-upwiz-file-endchoice">'
 218+ . wfMsg( "mwe-upwiz-file-all-ok" )
 219+ . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-file" ) . '</button>'
 220+ . '</div>'
 221+ . '<div class="mwe-upwiz-file-next-some-failed mwe-upwiz-file-endchoice">'
 222+ . wfMsg( "mwe-upwiz-file-some-failed" )
 223+ . '<button class="mwe-upwiz-button-retry">' . wfMsg( "mwe-upwiz-file-retry" ) . '</button>'
 224+ . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-file-despite-failures" ) . '</button>'
 225+ . '</div>'
 226+ . '<div class="mwe-upwiz-file-next-all-failed mwe-upwiz-file-endchoice">'
 227+ . wfMsg( "mwe-upwiz-file-all-failed" )
 228+ . '<button class="mwe-upwiz-button-retry"> ' . wfMsg( "mwe-upwiz-file-retry" ) . '</button>'
 229+ . '</div>'
214230 . '</div>'
215231 . '</div>'
216232
@@ -219,7 +235,7 @@
220236 . '<div id="mwe-upwiz-deeds" class="ui-helper-clearfix"></div>'
221237 . '<div id="mwe-upwiz-deeds-custom" class="ui-helper-clearfix"></div>'
222238 . '<div class="mwe-upwiz-buttons"/>'
223 - . '<button class="mwe-upwiz-button-next"></button>'
 239+ . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-deeds" ) . '</button>'
224240 . '</div>'
225241 . '</div>'
226242
@@ -232,15 +248,15 @@
233249 . '<div id="mwe-upwiz-macro-files"></div>'
234250 . '</div>'
235251 . '<div class="mwe-upwiz-buttons"/>'
236 - . '<button class="mwe-upwiz-button-next"></button>'
 252+ . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-details" ) . '</button>'
237253 . '</div>'
238254 . '</div>'
239255
240256 . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-thanks">'
241257 . '<div id="mwe-upwiz-thanks"></div>'
242258 . '<div class="mwe-upwiz-buttons"/>'
243 - . '<button class="mwe-upwiz-button-begin"></button>'
244 - . '<br/><button class="mwe-upwiz-button-home"></button>'
 259+ . '<button class="mwe-upwiz-button-home">' . wfMsg( "mwe-upwiz-home" ) . '</button>'
 260+ . '<button class="mwe-upwiz-button-begin">' . wfMsg( "mwe-upwiz-upload-another" ) . '</button>'
245261 . '</div>'
246262 . '</div>'
247263

Status & tagging log