Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -16,9 +16,12 @@ |
17 | 17 | 'scripts' => array( |
18 | 18 | // jquery ui |
19 | 19 | // 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', |
23 | 26 | |
24 | 27 | // jquery interface helpers |
25 | 28 | 'resources/jquery/jquery.tipsy.js', |
— | — | @@ -123,7 +126,12 @@ |
124 | 127 | 'resources/jquery/jquery.arrowSteps.css', |
125 | 128 | 'resources/jquery/jquery.mwCoolCats.css', |
126 | 129 | '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', |
128 | 136 | ), |
129 | 137 | 'messages' => array( |
130 | 138 | 'linktest', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -78,6 +78,11 @@ |
79 | 79 | 'mwe-upwiz-remove-upload' => 'Remove this file from the list of files to upload', |
80 | 80 | 'mwe-upwiz-remove-description' => 'Remove this description', |
81 | 81 | '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.', |
82 | 87 | 'mwe-upwiz-upload-count' => '$1 of $2 {{PLURAL:$2|file|files}} uploaded', |
83 | 88 | 'mwe-upwiz-progressbar-uploading' => 'uploading', |
84 | 89 | 'mwe-upwiz-finished' => 'Finished!', |
— | — | @@ -143,7 +148,7 @@ |
144 | 149 | 'mwe-copyright-macro' => 'As above', |
145 | 150 | 'mwe-copyright-custom' => 'Custom', |
146 | 151 | 'mwe-upwiz-next' => 'Next', |
147 | | - 'mwe-upwiz-next-file' => 'Upload files and continue', |
| 152 | + 'mwe-upwiz-next-file' => 'Continue', |
148 | 153 | 'mwe-upwiz-next-deeds' => 'Next', |
149 | 154 | 'mwe-upwiz-next-details' => 'Next', |
150 | 155 | 'mwe-upwiz-home' => 'Go to wiki home page', |
Index: trunk/extensions/UploadWizard/resources/dir.combined.css |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | |
29 | 29 | #mwe-upwiz-steps li { |
30 | 30 | color: #666666; |
| 31 | + font-size: 1.2em; |
31 | 32 | } |
32 | 33 | |
33 | 34 | #mwe-upwiz-steps li.head { |
— | — | @@ -49,10 +50,11 @@ |
50 | 51 | |
51 | 52 | .mwe-upwiz-add-files-0 { |
52 | 53 | text-align: center; |
53 | | - font-size: large; |
54 | 54 | } |
55 | 55 | |
56 | | -#mwe-upwiz-add-file { |
| 56 | +.mwe-upwiz-add-files-0 #mwe-upwiz-add-file { |
| 57 | + font-size: large; |
| 58 | + padding: 1em; |
57 | 59 | } |
58 | 60 | |
59 | 61 | /* NOT a pseudoclass */ |
— | — | @@ -61,7 +63,7 @@ |
62 | 64 | } |
63 | 65 | |
64 | 66 | /* 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 { |
66 | 68 | outline: none; |
67 | 69 | cursor: pointer; |
68 | 70 | } |
— | — | @@ -159,16 +161,20 @@ |
160 | 162 | |
161 | 163 | .mwe-upwiz-add-files-n { |
162 | 164 | float: left; |
163 | | - margin-top: 5px; |
164 | | - margin-left: 4px; |
165 | 165 | } |
166 | 166 | |
167 | 167 | #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n, .mwe-upwiz-progress-bar-etr { |
168 | 168 | width: 300px; |
169 | | - padding-left: 5px; |
170 | 169 | } |
171 | 170 | |
| 171 | +#mwe-upwiz-upload-ctrl-container { |
| 172 | + float: right; |
| 173 | + display: none; |
| 174 | +} |
172 | 175 | |
| 176 | +#mwe-upwiz-upload-ctrl:hover { |
| 177 | + text-decoration: none; |
| 178 | +} |
173 | 179 | #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n { |
174 | 180 | float: left; |
175 | 181 | } |
— | — | @@ -208,6 +214,22 @@ |
209 | 215 | margin-top: 1em; |
210 | 216 | } |
211 | 217 | |
| 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 | + |
212 | 234 | #mwe-upwiz-add-file-container { |
213 | 235 | /* empty; this changes a lot */ |
214 | 236 | } |
— | — | @@ -588,3 +610,13 @@ |
589 | 611 | .ui-datepicker-current-day a.ui-state-active { |
590 | 612 | background: #ffff99; |
591 | 613 | } |
| 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 @@ |
2 | 2 | form.mwe-upwiz-form{display:inline;}#upload-wizard{margin-top:18px;min-width:750px; |
3 | 3 | 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;} |
5 | 5 | #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;} |
7 | 7 | .mwe-upwiz-file-ctrl-container{position:absolute;overflow:hidden;}.mwe-upwiz-file-input,.mwe-upwiz-visible-file{cursor:pointer;} |
8 | 8 | .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{ |
9 | 9 | } |
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%; |
11 | 12 | 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;} |
12 | 13 | .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{ |
14 | 15 | }.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;} |
15 | 16 | .mwe-upwiz-data{float:left;width:46em;} |
16 | 17 | .busy{ |
— | — | @@ -26,4 +27,12 @@ |
27 | 28 | }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;} |
28 | 29 | 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;} |
29 | 30 | .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 @@ |
2 | 2 | @import "jquery/dir.combined.css"; |
3 | 3 | @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 @@ |
2 | 2 | @import "jquery/dir.combined.min.css"; |
3 | 3 | @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 |
4 | 4 | * |
5 | | - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 5 | + * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) |
6 | 6 | * Dual licensed under the MIT (MIT-LICENSE.txt) |
7 | 7 | * and GPL (GPL-LICENSE.txt) licenses. |
8 | 8 | * |
9 | 9 | * http://docs.jquery.com/UI |
10 | 10 | */ |
11 | | -;jQuery.ui || (function($) { |
12 | 11 | |
13 | | -var _remove = $.fn.remove, |
14 | | - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); |
| 12 | +(function($) { |
15 | 13 | |
| 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 | + |
16 | 22 | //Helper functions and ui object |
17 | | -$.ui = { |
18 | | - version: "1.7.1", |
| 23 | +$.extend($.ui, { |
| 24 | + version: "1.8.2", |
19 | 25 | |
20 | 26 | // $.ui.plugin is deprecated. Use the proxy pattern instead. |
21 | 27 | plugin: { |
— | — | @@ -73,9 +79,13 @@ |
74 | 80 | }, |
75 | 81 | |
76 | 82 | keyCode: { |
| 83 | + ALT: 18, |
77 | 84 | BACKSPACE: 8, |
78 | 85 | CAPS_LOCK: 20, |
79 | 86 | COMMA: 188, |
| 87 | + COMMAND: 91, |
| 88 | + COMMAND_LEFT: 91, // COMMAND |
| 89 | + COMMAND_RIGHT: 93, |
80 | 90 | CONTROL: 17, |
81 | 91 | DELETE: 46, |
82 | 92 | DOWN: 40, |
— | — | @@ -85,6 +95,7 @@ |
86 | 96 | HOME: 36, |
87 | 97 | INSERT: 45, |
88 | 98 | LEFT: 37, |
| 99 | + MENU: 93, // COMMAND_RIGHT |
89 | 100 | NUMPAD_ADD: 107, |
90 | 101 | NUMPAD_DECIMAL: 110, |
91 | 102 | NUMPAD_DIVIDE: 111, |
— | — | @@ -98,64 +109,36 @@ |
99 | 110 | SHIFT: 16, |
100 | 111 | SPACE: 32, |
101 | 112 | TAB: 9, |
102 | | - UP: 38 |
| 113 | + UP: 38, |
| 114 | + WINDOWS: 91 // COMMAND |
103 | 115 | } |
104 | | -}; |
| 116 | +}); |
105 | 117 | |
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 | | - |
137 | 118 | //jQuery plugins |
138 | 119 | $.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); |
146 | 131 | }, |
147 | | - |
| 132 | + |
148 | 133 | enableSelection: function() { |
149 | 134 | return this |
150 | 135 | .attr('unselectable', 'off') |
151 | | - .css('MozUserSelect', '') |
152 | | - .unbind('selectstart.ui'); |
| 136 | + .css('MozUserSelect', ''); |
153 | 137 | }, |
154 | 138 | |
155 | 139 | disableSelection: function() { |
156 | 140 | return this |
157 | 141 | .attr('unselectable', 'on') |
158 | | - .css('MozUserSelect', 'none') |
159 | | - .bind('selectstart.ui', function() { return false; }); |
| 142 | + .css('MozUserSelect', 'none'); |
160 | 143 | }, |
161 | 144 | |
162 | 145 | scrollParent: function() { |
— | — | @@ -171,6 +154,36 @@ |
172 | 155 | } |
173 | 156 | |
174 | 157 | 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; |
175 | 188 | } |
176 | 189 | }); |
177 | 190 | |
— | — | @@ -200,340 +213,1450 @@ |
201 | 214 | } |
202 | 215 | }); |
203 | 216 | |
| 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( $ ) { |
204 | 228 | |
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; |
212 | 230 | |
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 | +}; |
219 | 243 | |
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; |
223 | 249 | |
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 | + } |
228 | 254 | |
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 | + }; |
233 | 259 | |
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 ); |
239 | 265 | } |
| 266 | + }; |
240 | 267 | |
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 ); |
244 | 284 | |
245 | | - // constructor |
246 | | - (!instance && !isMethodCall && |
247 | | - $.data(this, name, new $[namespace][name](this, options))._init()); |
| 285 | + $.widget.bridge( name, $[ namespace ][ name ] ); |
| 286 | +}; |
248 | 287 | |
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; |
254 | 293 | |
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; |
259 | 298 | |
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 | + } |
264 | 303 | |
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; |
275 | 313 | } |
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 ) ); |
280 | 325 | } |
281 | | - }) |
282 | | - .bind('remove', function() { |
283 | | - return self.destroy(); |
284 | 326 | }); |
| 327 | + } |
| 328 | + |
| 329 | + return returnValue; |
285 | 330 | }; |
| 331 | +}; |
286 | 332 | |
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 | + } |
293 | 338 | }; |
294 | 339 | |
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() {}, |
296 | 364 | _init: function() {}, |
| 365 | + |
297 | 366 | 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" ); |
301 | 376 | }, |
302 | 377 | |
303 | | - option: function(key, value) { |
| 378 | + widget: function() { |
| 379 | + return this.element; |
| 380 | + }, |
| 381 | + |
| 382 | + option: function( key, value ) { |
304 | 383 | var options = key, |
305 | 384 | self = this; |
306 | 385 | |
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 ]; |
310 | 394 | } |
311 | 395 | options = {}; |
312 | | - options[key] = value; |
| 396 | + options[ key ] = value; |
313 | 397 | } |
314 | 398 | |
315 | | - $.each(options, function(key, value) { |
316 | | - self._setData(key, value); |
| 399 | + $.each( options, function( key, value ) { |
| 400 | + self._setOption( key, value ); |
317 | 401 | }); |
| 402 | + |
| 403 | + return self; |
318 | 404 | }, |
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; |
324 | 407 | |
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 ); |
331 | 414 | } |
| 415 | + |
| 416 | + return this; |
332 | 417 | }, |
333 | 418 | |
334 | 419 | enable: function() { |
335 | | - this._setData('disabled', false); |
| 420 | + return this._setOption( "disabled", false ); |
336 | 421 | }, |
337 | 422 | disable: function() { |
338 | | - this._setData('disabled', true); |
| 423 | + return this._setOption( "disabled", true ); |
339 | 424 | }, |
340 | 425 | |
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 ]; |
345 | 428 | |
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 || {}; |
348 | 434 | |
349 | 435 | // copy original event properties over to the new event |
350 | 436 | // this would happen if we could call $.event.fix instead of $.Event |
351 | 437 | // 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 ]; |
356 | 442 | } |
357 | 443 | } |
358 | 444 | |
359 | | - this.element.trigger(event, data); |
| 445 | + this.element.trigger( event, data ); |
360 | 446 | |
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() ); |
363 | 450 | } |
364 | 451 | }; |
365 | 452 | |
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( $ ) { |
369 | 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; |
| 496 | + }; |
370 | 497 | |
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 ); |
372 | 511 | |
373 | | -$.ui.mouse = { |
374 | | - _mouseInit: function() { |
375 | | - var self = this; |
| 512 | + this._determineButtonType(); |
| 513 | + this.hasTitle = !!this.buttonElement.attr( "title" ); |
376 | 514 | |
| 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() { |
377 | 670 | 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 ]; |
380 | 793 | }) |
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 || ' ', |
| 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); |
385 | 941 | 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')); |
386 | 1045 | } |
387 | 1046 | }); |
| 1047 | + $.ui.dialog.maxZ = maxZ; |
| 1048 | + } |
388 | 1049 | |
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); |
393 | 1067 | } |
| 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 | + } |
394 | 1076 | |
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; |
396 | 1086 | }, |
397 | 1087 | |
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; } |
402 | 1090 | |
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; |
406 | 1138 | }, |
407 | 1139 | |
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 | + ); |
413 | 1149 | |
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(); |
416 | 1152 | |
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 | + }, |
418 | 1171 | |
| 1172 | + _makeDraggable: function() { |
419 | 1173 | 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 | + }; |
424 | 1183 | } |
425 | 1184 | |
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 | + }; |
431 | 1226 | } |
432 | 1227 | |
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(); |
438 | 1250 | } |
| 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); |
439 | 1263 | } |
| 1264 | + }, |
440 | 1265 | |
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; |
451 | 1270 | |
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; |
456 | 1272 | |
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 | + } |
459 | 1332 | }, |
460 | 1333 | |
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 || ' ')); |
| 1422 | + break; |
| 1423 | + case "width": |
| 1424 | + resize = true; |
| 1425 | + break; |
465 | 1426 | } |
466 | 1427 | |
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(); |
470 | 1431 | } |
| 1432 | + }, |
471 | 1433 | |
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()); |
476 | 1469 | } |
| 1470 | + } |
| 1471 | +}); |
477 | 1472 | |
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; |
479 | 1486 | }, |
480 | 1487 | |
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 | +}); |
485 | 1492 | |
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); |
490 | 1527 | } |
491 | 1528 | |
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; |
493 | 1542 | }, |
494 | 1543 | |
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; |
501 | 1559 | }, |
502 | 1560 | |
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 | + } |
505 | 1584 | }, |
506 | 1585 | |
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 | + ); |
513 | 1599 | |
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 | + }, |
519 | 1610 | |
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 |
522 | 1644 | * |
523 | | - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 1645 | + * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) |
524 | 1646 | * Dual licensed under the MIT (MIT-LICENSE.txt) |
525 | 1647 | * and GPL (GPL-LICENSE.txt) licenses. |
526 | 1648 | * |
527 | 1649 | * http://docs.jquery.com/UI/Datepicker |
528 | 1650 | * |
529 | 1651 | * Depends: |
530 | | - * ui.core.js |
| 1652 | + * jquery.ui.core.js |
531 | 1653 | */ |
532 | 1654 | |
533 | 1655 | (function($) { // hide the namespace |
534 | 1656 | |
535 | | -$.extend($.ui, { datepicker: { version: "1.7.1" } }); |
| 1657 | +$.extend($.ui, { datepicker: { version: "1.8.2" } }); |
536 | 1658 | |
537 | 1659 | var PROP_NAME = 'datepicker'; |
| 1660 | +var dpuuid = new Date().getTime(); |
538 | 1661 | |
539 | 1662 | /* Date picker manager. |
540 | 1663 | Use the singleton instance of this class, $.datepicker, to interact with the date picker. |
— | — | @@ -568,14 +1691,17 @@ |
569 | 1692 | dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting |
570 | 1693 | dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting |
571 | 1694 | 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 |
572 | 1696 | dateFormat: 'mm/dd/yy', // See format options on parseDate |
573 | 1697 | 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 |
575 | 1701 | }; |
576 | 1702 | this._defaults = { // Global defaults for all the date picker instances |
577 | 1703 | showOn: 'focus', // 'focus' for popup on focus, |
578 | 1704 | // '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 |
580 | 1706 | showOptions: {}, // Options for enhanced animations |
581 | 1707 | defaultDate: null, // Used when field is blank: actual date, |
582 | 1708 | // +/-number for offset from today, null for today |
— | — | @@ -589,10 +1715,12 @@ |
590 | 1716 | gotoCurrent: false, // True if today link goes back to current selection instead |
591 | 1717 | changeMonth: false, // True if month can be selected directly, false if only prev/next |
592 | 1718 | 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) |
596 | 1722 | 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 |
597 | 1725 | calculateWeek: this.iso8601Week, // How to calculate the week of the year, |
598 | 1726 | // takes a Date and returns the number of the week for it |
599 | 1727 | shortYearCutoff: '+10', // Short year values < this are in the current century, |
— | — | @@ -600,7 +1728,7 @@ |
601 | 1729 | // string value starting with '+' for current year + value |
602 | 1730 | minDate: null, // The earliest selectable date, or null for no limit |
603 | 1731 | 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 |
605 | 1733 | beforeShowDay: null, // Function that takes a date and returns an array with |
606 | 1734 | // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', |
607 | 1735 | // [2] = cell title (optional), e.g. $.datepicker.noWeekends |
— | — | @@ -616,7 +1744,8 @@ |
617 | 1745 | altField: '', // Selector for an alternate field to store selected dates into |
618 | 1746 | altFormat: '', // The date format to use for the alternate field |
619 | 1747 | 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 |
621 | 1750 | }; |
622 | 1751 | $.extend(this._defaults, this.regional['']); |
623 | 1752 | 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 @@ |
632 | 1761 | if (this.debug) |
633 | 1762 | console.log.apply('', arguments); |
634 | 1763 | }, |
| 1764 | + |
| 1765 | + // TODO rename to "widget" when switching to widget factory |
| 1766 | + _widgetDatepicker: function() { |
| 1767 | + return this.dpDiv; |
| 1768 | + }, |
635 | 1769 | |
636 | 1770 | /* Override the default settings for all instances of the date picker. |
637 | 1771 | @param settings object - the new settings to use as defaults (anonymous object) |
— | — | @@ -659,8 +1793,10 @@ |
660 | 1794 | } |
661 | 1795 | var nodeName = target.nodeName.toLowerCase(); |
662 | 1796 | 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 | + } |
665 | 1801 | var inst = this._newInst($(target), inline); |
666 | 1802 | inst.settings = $.extend({}, settings || {}, inlineSettings || {}); |
667 | 1803 | if (nodeName == 'input') { |
— | — | @@ -672,7 +1808,7 @@ |
673 | 1809 | |
674 | 1810 | /* Create a new instance object. */ |
675 | 1811 | _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 |
677 | 1813 | return {id: id, input: target, // associated target |
678 | 1814 | selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection |
679 | 1815 | drawMonth: 0, drawYear: 0, // month being drawn |
— | — | @@ -684,13 +1820,35 @@ |
685 | 1821 | /* Attach the date picker to an input field. */ |
686 | 1822 | _connectDatepicker: function(target, inst) { |
687 | 1823 | var input = $(target); |
| 1824 | + inst.append = $([]); |
688 | 1825 | inst.trigger = $([]); |
689 | 1826 | if (input.hasClass(this.markerClassName)) |
690 | 1827 | 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) { |
691 | 1842 | var appendText = this._get(inst, 'appendText'); |
692 | 1843 | 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(); |
695 | 1853 | var showOn = this._get(inst, 'showOn'); |
696 | 1854 | if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field |
697 | 1855 | input.focus(this._showDatepicker); |
— | — | @@ -705,22 +1863,41 @@ |
706 | 1864 | { src:buttonImage, alt:buttonText, title:buttonText }))); |
707 | 1865 | input[isRTL ? 'before' : 'after'](inst.trigger); |
708 | 1866 | inst.trigger.click(function() { |
709 | | - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) |
| 1867 | + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) |
710 | 1868 | $.datepicker._hideDatepicker(); |
711 | 1869 | else |
712 | | - $.datepicker._showDatepicker(target); |
| 1870 | + $.datepicker._showDatepicker(input[0]); |
713 | 1871 | return false; |
714 | 1872 | }); |
715 | 1873 | } |
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); |
723 | 1874 | }, |
724 | 1875 | |
| 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 | + |
725 | 1902 | /* Attach an inline date picker to a div. */ |
726 | 1903 | _inlineDatepicker: function(target, inst) { |
727 | 1904 | var divSpan = $(target); |
— | — | @@ -733,26 +1910,27 @@ |
734 | 1911 | return this._get(inst, key); |
735 | 1912 | }); |
736 | 1913 | $.data(target, PROP_NAME, inst); |
737 | | - this._setDate(inst, this._getDefaultDate(inst)); |
| 1914 | + this._setDate(inst, this._getDefaultDate(inst), true); |
738 | 1915 | this._updateDatepicker(inst); |
739 | 1916 | this._updateAlternate(inst); |
740 | 1917 | }, |
741 | 1918 | |
742 | 1919 | /* Pop-up the date picker in a "dialog" box. |
743 | 1920 | @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 |
746 | 1923 | @param settings object - update the dialog date picker instance's settings (anonymous object) |
747 | 1924 | @param pos int[2] - coordinates for the dialog's position within the screen or |
748 | 1925 | event - with x/y coordinates or |
749 | 1926 | leave empty for default (screen centre) |
750 | 1927 | @return the manager object */ |
751 | | - _dialogDatepicker: function(input, dateText, onSelect, settings, pos) { |
| 1928 | + _dialogDatepicker: function(input, date, onSelect, settings, pos) { |
752 | 1929 | var inst = this._dialogInst; // internal instance |
753 | 1930 | if (!inst) { |
754 | | - var id = 'dp' + (++this.uuid); |
| 1931 | + this.uuid += 1; |
| 1932 | + var id = 'dp' + this.uuid; |
755 | 1933 | 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;"/>'); |
757 | 1935 | this._dialogInput.keydown(this._doKeyDown); |
758 | 1936 | $('body').append(this._dialogInput); |
759 | 1937 | inst = this._dialogInst = this._newInst(this._dialogInput, false); |
— | — | @@ -760,12 +1938,13 @@ |
761 | 1939 | $.data(this._dialogInput[0], PROP_NAME, inst); |
762 | 1940 | } |
763 | 1941 | 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); |
765 | 1944 | |
766 | 1945 | this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); |
767 | 1946 | 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; |
770 | 1949 | var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; |
771 | 1950 | var scrollY = document.documentElement.scrollTop || document.body.scrollTop; |
772 | 1951 | this._pos = // should use actual width/height below |
— | — | @@ -773,7 +1952,7 @@ |
774 | 1953 | } |
775 | 1954 | |
776 | 1955 | // 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'); |
778 | 1957 | inst.settings.onSelect = onSelect; |
779 | 1958 | this._inDialog = true; |
780 | 1959 | this.dpDiv.addClass(this._dialogClass); |
— | — | @@ -795,12 +1974,13 @@ |
796 | 1975 | var nodeName = target.nodeName.toLowerCase(); |
797 | 1976 | $.removeData(target, PROP_NAME); |
798 | 1977 | if (nodeName == 'input') { |
| 1978 | + inst.append.remove(); |
799 | 1979 | inst.trigger.remove(); |
800 | | - $target.siblings('.' + this._appendClass).remove().end(). |
801 | | - removeClass(this.markerClassName). |
| 1980 | + $target.removeClass(this.markerClassName). |
802 | 1981 | unbind('focus', this._showDatepicker). |
803 | 1982 | unbind('keydown', this._doKeyDown). |
804 | | - unbind('keypress', this._doKeyPress); |
| 1983 | + unbind('keypress', this._doKeyPress). |
| 1984 | + unbind('keyup', this._doKeyUp); |
805 | 1985 | } else if (nodeName == 'div' || nodeName == 'span') |
806 | 1986 | $target.removeClass(this.markerClassName).empty(); |
807 | 1987 | }, |
— | — | @@ -815,11 +1995,10 @@ |
816 | 1996 | } |
817 | 1997 | var nodeName = target.nodeName.toLowerCase(); |
818 | 1998 | 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: ''}); |
824 | 2003 | } |
825 | 2004 | else if (nodeName == 'div' || nodeName == 'span') { |
826 | 2005 | var inline = $target.children('.' + this._inlineClass); |
— | — | @@ -839,11 +2018,10 @@ |
840 | 2019 | } |
841 | 2020 | var nodeName = target.nodeName.toLowerCase(); |
842 | 2021 | 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'}); |
848 | 2026 | } |
849 | 2027 | else if (nodeName == 'div' || nodeName == 'span') { |
850 | 2028 | var inline = $target.children('.' + this._inlineClass); |
— | — | @@ -881,31 +2059,35 @@ |
882 | 2060 | } |
883 | 2061 | }, |
884 | 2062 | |
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. |
886 | 2064 | @param target element - the target input field or division or span |
887 | 2065 | @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) */ |
890 | 2071 | _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 | + } |
891 | 2078 | var settings = name || {}; |
892 | 2079 | if (typeof name == 'string') { |
893 | 2080 | settings = {}; |
894 | 2081 | settings[name] = value; |
895 | 2082 | } |
896 | | - var inst = this._getInst(target); |
897 | 2083 | if (inst) { |
898 | 2084 | if (this._curInst == inst) { |
899 | | - this._hideDatepicker(null); |
| 2085 | + this._hideDatepicker(); |
900 | 2086 | } |
| 2087 | + var date = this._getDateDatepicker(target, true); |
901 | 2088 | 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); |
910 | 2092 | this._updateDatepicker(inst); |
911 | 2093 | } |
912 | 2094 | }, |
— | — | @@ -926,25 +2108,24 @@ |
927 | 2109 | |
928 | 2110 | /* Set the dates for a jQuery selection. |
929 | 2111 | @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) { |
933 | 2114 | var inst = this._getInst(target); |
934 | 2115 | if (inst) { |
935 | | - this._setDate(inst, date, endDate); |
| 2116 | + this._setDate(inst, date); |
936 | 2117 | this._updateDatepicker(inst); |
937 | 2118 | this._updateAlternate(inst); |
938 | 2119 | } |
939 | 2120 | }, |
940 | 2121 | |
941 | 2122 | /* 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) { |
946 | 2127 | var inst = this._getInst(target); |
947 | 2128 | if (inst && !inst.inline) |
948 | | - this._setDateFromField(inst); |
| 2129 | + this._setDateFromField(inst, noDefault); |
949 | 2130 | return (inst ? this._getDate(inst) : null); |
950 | 2131 | }, |
951 | 2132 | |
— | — | @@ -956,17 +2137,18 @@ |
957 | 2138 | inst._keyEvent = true; |
958 | 2139 | if ($.datepicker._datepickerShowing) |
959 | 2140 | switch (event.keyCode) { |
960 | | - case 9: $.datepicker._hideDatepicker(null, ''); |
| 2141 | + case 9: $.datepicker._hideDatepicker(); |
| 2142 | + handled = false; |
961 | 2143 | 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)); |
964 | 2146 | if (sel[0]) |
965 | 2147 | $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); |
966 | 2148 | else |
967 | | - $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); |
| 2149 | + $.datepicker._hideDatepicker(); |
968 | 2150 | return false; // don't submit the form |
969 | 2151 | break; // select the value on enter |
970 | | - case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); |
| 2152 | + case 27: $.datepicker._hideDatepicker(); |
971 | 2153 | break; // hide on escape |
972 | 2154 | case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? |
973 | 2155 | -$.datepicker._get(inst, 'stepBigMonths') : |
— | — | @@ -1027,6 +2209,27 @@ |
1028 | 2210 | } |
1029 | 2211 | }, |
1030 | 2212 | |
| 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 | + |
1031 | 2234 | /* Pop-up the date picker for a given input field. |
1032 | 2235 | @param input element - the input field attached to the date picker or |
1033 | 2236 | event - if triggered by focus */ |
— | — | @@ -1037,9 +2240,12 @@ |
1038 | 2241 | if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here |
1039 | 2242 | return; |
1040 | 2243 | var inst = $.datepicker._getInst(input); |
| 2244 | + if ($.datepicker._curInst && $.datepicker._curInst != inst) { |
| 2245 | + $.datepicker._curInst.dpDiv.stop(true, true); |
| 2246 | + } |
1041 | 2247 | var beforeShow = $.datepicker._get(inst, 'beforeShow'); |
1042 | 2248 | extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); |
1043 | | - $.datepicker._hideDatepicker(null, ''); |
| 2249 | + inst.lastVal = null; |
1044 | 2250 | $.datepicker._lastInput = input; |
1045 | 2251 | $.datepicker._setDateFromField(inst); |
1046 | 2252 | if ($.datepicker._inDialog) // hide cursor |
— | — | @@ -1059,7 +2265,6 @@ |
1060 | 2266 | } |
1061 | 2267 | var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; |
1062 | 2268 | $.datepicker._pos = null; |
1063 | | - inst.rangeStart = null; |
1064 | 2269 | // determine sizing offscreen |
1065 | 2270 | inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); |
1066 | 2271 | $.datepicker._updateDatepicker(inst); |
— | — | @@ -1070,34 +2275,36 @@ |
1071 | 2276 | 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', |
1072 | 2277 | left: offset.left + 'px', top: offset.top + 'px'}); |
1073 | 2278 | if (!inst.inline) { |
1074 | | - var showAnim = $.datepicker._get(inst, 'showAnim') || 'show'; |
| 2279 | + var showAnim = $.datepicker._get(inst, 'showAnim'); |
1075 | 2280 | var duration = $.datepicker._get(inst, 'duration'); |
1076 | 2281 | var postProcess = function() { |
1077 | 2282 | $.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()}); |
1081 | 2287 | }; |
| 2288 | + inst.dpDiv.zIndex($(input).zIndex()+1); |
1082 | 2289 | if ($.effects && $.effects[showAnim]) |
1083 | 2290 | inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); |
1084 | 2291 | else |
1085 | | - inst.dpDiv[showAnim](duration, postProcess); |
1086 | | - if (duration == '') |
| 2292 | + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); |
| 2293 | + if (!showAnim || !duration) |
1087 | 2294 | 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(); |
1090 | 2297 | $.datepicker._curInst = inst; |
1091 | 2298 | } |
1092 | 2299 | }, |
1093 | 2300 | |
1094 | 2301 | /* Generate the date picker content. */ |
1095 | 2302 | _updateDatepicker: function(inst) { |
1096 | | - var dims = {width: inst.dpDiv.width() + 4, |
1097 | | - height: inst.dpDiv.height() + 4}; |
1098 | 2303 | var self = this; |
| 2304 | + var borders = $.datepicker._getBorders(inst.dpDiv); |
1099 | 2305 | 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()}) |
1102 | 2309 | .end() |
1103 | 2310 | .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') |
1104 | 2311 | .bind('mouseout', function(){ |
— | — | @@ -1120,73 +2327,83 @@ |
1121 | 2328 | var numMonths = this._getNumberOfMonths(inst); |
1122 | 2329 | var cols = numMonths[1]; |
1123 | 2330 | var width = 17; |
1124 | | - if (cols > 1) { |
| 2331 | + if (cols > 1) |
1125 | 2332 | inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); |
1126 | | - } else { |
| 2333 | + else |
1127 | 2334 | inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); |
1128 | | - } |
1129 | 2335 | inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + |
1130 | 2336 | 'Class']('ui-datepicker-multi'); |
1131 | 2337 | inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + |
1132 | 2338 | '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(); |
1135 | 2342 | }, |
1136 | 2343 | |
| 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 | + |
1137 | 2355 | /* Check positioning to remain on screen. */ |
1138 | 2356 | _checkOffset: function(inst, offset, isFixed) { |
1139 | 2357 | var dpWidth = inst.dpDiv.outerWidth(); |
1140 | 2358 | var dpHeight = inst.dpDiv.outerHeight(); |
1141 | 2359 | var inputWidth = inst.input ? inst.input.outerWidth() : 0; |
1142 | 2360 | 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(); |
1145 | 2363 | |
1146 | 2364 | offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); |
1147 | 2365 | offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; |
1148 | 2366 | offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; |
1149 | 2367 | |
1150 | 2368 | // 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); |
1153 | 2373 | |
1154 | 2374 | return offset; |
1155 | 2375 | }, |
1156 | 2376 | |
1157 | 2377 | /* Find an object's position on the screen. */ |
1158 | 2378 | _findPos: function(obj) { |
| 2379 | + var inst = this._getInst(obj); |
| 2380 | + var isRTL = this._get(inst, 'isRTL'); |
1159 | 2381 | while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { |
1160 | | - obj = obj.nextSibling; |
| 2382 | + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; |
1161 | 2383 | } |
1162 | 2384 | var position = $(obj).offset(); |
1163 | 2385 | return [position.left, position.top]; |
1164 | 2386 | }, |
1165 | 2387 | |
1166 | 2388 | /* 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) { |
1170 | 2391 | var inst = this._curInst; |
1171 | 2392 | if (!inst || (input && inst != $.data(input, PROP_NAME))) |
1172 | 2393 | return; |
1173 | | - if (inst.stayOpen) |
1174 | | - this._selectDate('#' + inst.id, this._formatDate(inst, |
1175 | | - inst.currentDay, inst.currentMonth, inst.currentYear)); |
1176 | | - inst.stayOpen = false; |
1177 | 2394 | if (this._datepickerShowing) { |
1178 | | - duration = (duration != null ? duration : this._get(inst, 'duration')); |
1179 | 2395 | var showAnim = this._get(inst, 'showAnim'); |
| 2396 | + var duration = this._get(inst, 'duration'); |
1180 | 2397 | var postProcess = function() { |
1181 | 2398 | $.datepicker._tidyDialog(inst); |
| 2399 | + this._curInst = null; |
1182 | 2400 | }; |
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); |
1186 | 2403 | 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(); |
1191 | 2408 | var onClose = this._get(inst, 'onClose'); |
1192 | 2409 | if (onClose) |
1193 | 2410 | onClose.apply((inst.input ? inst.input[0] : null), |
— | — | @@ -1202,7 +2419,6 @@ |
1203 | 2420 | } |
1204 | 2421 | this._inDialog = false; |
1205 | 2422 | } |
1206 | | - this._curInst = null; |
1207 | 2423 | }, |
1208 | 2424 | |
1209 | 2425 | /* Tidy up after a dialog display. */ |
— | — | @@ -1215,11 +2431,12 @@ |
1216 | 2432 | if (!$.datepicker._curInst) |
1217 | 2433 | return; |
1218 | 2434 | 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 && |
1220 | 2437 | !$target.hasClass($.datepicker.markerClassName) && |
1221 | 2438 | !$target.hasClass($.datepicker._triggerClass) && |
1222 | 2439 | $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) |
1223 | | - $.datepicker._hideDatepicker(null, ''); |
| 2440 | + $.datepicker._hideDatepicker(); |
1224 | 2441 | }, |
1225 | 2442 | |
1226 | 2443 | /* Adjust one of the date sub-fields. */ |
— | — | @@ -1245,10 +2462,10 @@ |
1246 | 2463 | inst.drawYear = inst.selectedYear = inst.currentYear; |
1247 | 2464 | } |
1248 | 2465 | 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(); |
1253 | 2470 | } |
1254 | 2471 | this._notifyChange(inst); |
1255 | 2472 | this._adjustDate(target); |
— | — | @@ -1271,7 +2488,7 @@ |
1272 | 2489 | var target = $(id); |
1273 | 2490 | var inst = this._getInst(target[0]); |
1274 | 2491 | if (inst.input && inst._selectingMonthYear && !$.browser.msie) |
1275 | | - inst.input[0].focus(); |
| 2492 | + inst.input.focus(); |
1276 | 2493 | inst._selectingMonthYear = !inst._selectingMonthYear; |
1277 | 2494 | }, |
1278 | 2495 | |
— | — | @@ -1285,24 +2502,14 @@ |
1286 | 2503 | inst.selectedDay = inst.currentDay = $('a', td).html(); |
1287 | 2504 | inst.selectedMonth = inst.currentMonth = month; |
1288 | 2505 | inst.selectedYear = inst.currentYear = year; |
1289 | | - if (inst.stayOpen) { |
1290 | | - inst.endDay = inst.endMonth = inst.endYear = null; |
1291 | | - } |
1292 | 2506 | this._selectDate(id, this._formatDate(inst, |
1293 | 2507 | 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 | | - } |
1299 | 2508 | }, |
1300 | 2509 | |
1301 | 2510 | /* Erase the input field and hide the date picker. */ |
1302 | 2511 | _clearDate: function(id) { |
1303 | 2512 | var target = $(id); |
1304 | 2513 | var inst = this._getInst(target[0]); |
1305 | | - inst.stayOpen = false; |
1306 | | - inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null; |
1307 | 2514 | this._selectDate(target, ''); |
1308 | 2515 | }, |
1309 | 2516 | |
— | — | @@ -1321,11 +2528,11 @@ |
1322 | 2529 | inst.input.trigger('change'); // fire the change event |
1323 | 2530 | if (inst.inline) |
1324 | 2531 | this._updateDatepicker(inst); |
1325 | | - else if (!inst.stayOpen) { |
1326 | | - this._hideDatepicker(null, this._get(inst, 'duration')); |
| 2532 | + else { |
| 2533 | + this._hideDatepicker(); |
1327 | 2534 | this._lastInput = inst.input[0]; |
1328 | 2535 | if (typeof(inst.input[0]) != 'object') |
1329 | | - inst.input[0].focus(); // restore focus |
| 2536 | + inst.input.focus(); // restore focus |
1330 | 2537 | this._lastInput = null; |
1331 | 2538 | } |
1332 | 2539 | }, |
— | — | @@ -1336,7 +2543,7 @@ |
1337 | 2544 | if (altField) { // update alternate field too |
1338 | 2545 | var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); |
1339 | 2546 | var date = this._getDate(inst); |
1340 | | - dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); |
| 2547 | + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); |
1341 | 2548 | $(altField).each(function() { $(this).val(dateStr); }); |
1342 | 2549 | } |
1343 | 2550 | }, |
— | — | @@ -1353,20 +2560,13 @@ |
1354 | 2561 | @param date Date - the date to get the week for |
1355 | 2562 | @return number - the number of the week within the year that contains this date */ |
1356 | 2563 | 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; |
1371 | 2571 | }, |
1372 | 2572 | |
1373 | 2573 | /* Parse a string value into a date object. |
— | — | @@ -1407,34 +2607,25 @@ |
1408 | 2608 | // Extract a number from the string value |
1409 | 2609 | var getNumber = function(match) { |
1410 | 2610 | 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) |
1420 | 2616 | throw 'Missing number at position ' + iValue; |
1421 | | - return num; |
| 2617 | + iValue += num[0].length; |
| 2618 | + return parseInt(num[0], 10); |
1422 | 2619 | }; |
1423 | 2620 | // Extract a name from the string value and convert to an index |
1424 | 2621 | var getName = function(match, shortNames, longNames) { |
1425 | 2622 | 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 | + } |
1437 | 2628 | } |
1438 | | - throw 'Unknown name at position ' + iInit; |
| 2629 | + throw 'Unknown name at position ' + iValue; |
1439 | 2630 | }; |
1440 | 2631 | // Confirm that a literal character matches the string value |
1441 | 2632 | var checkLiteral = function() { |
— | — | @@ -1475,6 +2666,12 @@ |
1476 | 2667 | month = date.getMonth() + 1; |
1477 | 2668 | day = date.getDate(); |
1478 | 2669 | 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; |
1479 | 2676 | case "'": |
1480 | 2677 | if (lookAhead("'")) |
1481 | 2678 | checkLiteral(); |
— | — | @@ -1517,9 +2714,13 @@ |
1518 | 2715 | RFC_1123: 'D, d M yy', |
1519 | 2716 | RFC_2822: 'D, d M yy', |
1520 | 2717 | RSS: 'D, d M y', // RFC 822 |
| 2718 | + TICKS: '!', |
1521 | 2719 | TIMESTAMP: '@', |
1522 | 2720 | W3C: 'yy-mm-dd', // ISO 8601 |
1523 | 2721 | |
| 2722 | + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + |
| 2723 | + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), |
| 2724 | + |
1524 | 2725 | /* Format a date object into a string value. |
1525 | 2726 | The format can be combinations of the following: |
1526 | 2727 | d - day of month (no leading zero) |
— | — | @@ -1535,6 +2736,7 @@ |
1536 | 2737 | y - year (two digit) |
1537 | 2738 | yy - year (four digit) |
1538 | 2739 | @ - Unix timestamp (ms since 01/01/1970) |
| 2740 | + ! - Windows ticks (100ns since 01/01/0001) |
1539 | 2741 | '...' - literal text |
1540 | 2742 | '' - single quote |
1541 | 2743 | |
— | — | @@ -1590,10 +2792,8 @@ |
1591 | 2793 | output += formatName('D', date.getDay(), dayNamesShort, dayNames); |
1592 | 2794 | break; |
1593 | 2795 | 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); |
1598 | 2798 | break; |
1599 | 2799 | case 'm': |
1600 | 2800 | output += formatNumber('m', date.getMonth() + 1, 2); |
— | — | @@ -1608,6 +2808,9 @@ |
1609 | 2809 | case '@': |
1610 | 2810 | output += date.getTime(); |
1611 | 2811 | break; |
| 2812 | + case '!': |
| 2813 | + output += date.getTime() * 10000 + this._ticksTo1970; |
| 2814 | + break; |
1612 | 2815 | case "'": |
1613 | 2816 | if (lookAhead("'")) |
1614 | 2817 | output += "'"; |
— | — | @@ -1625,6 +2828,13 @@ |
1626 | 2829 | _possibleChars: function (format) { |
1627 | 2830 | var chars = ''; |
1628 | 2831 | 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 | + }; |
1629 | 2839 | for (var iFormat = 0; iFormat < format.length; iFormat++) |
1630 | 2840 | if (literal) |
1631 | 2841 | if (format.charAt(iFormat) == "'" && !lookAhead("'")) |
— | — | @@ -1657,17 +2867,20 @@ |
1658 | 2868 | }, |
1659 | 2869 | |
1660 | 2870 | /* 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 | + } |
1662 | 2875 | 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); |
1666 | 2879 | var settings = this._getFormatConfig(inst); |
1667 | 2880 | try { |
1668 | 2881 | date = this.parseDate(dateFormat, dates, settings) || defaultDate; |
1669 | 2882 | } catch (event) { |
1670 | 2883 | this.log(event); |
1671 | | - date = defaultDate; |
| 2884 | + dates = (noDefault ? '' : dates); |
1672 | 2885 | } |
1673 | 2886 | inst.selectedDay = date.getDate(); |
1674 | 2887 | inst.drawMonth = inst.selectedMonth = date.getMonth(); |
— | — | @@ -1680,23 +2893,27 @@ |
1681 | 2894 | |
1682 | 2895 | /* Retrieve the default date shown on opening. */ |
1683 | 2896 | _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())); |
1690 | 2899 | }, |
1691 | 2900 | |
1692 | 2901 | /* A date may be specified as an exact value or a relative one. */ |
1693 | | - _determineDate: function(date, defaultDate) { |
| 2902 | + _determineDate: function(inst, date, defaultDate) { |
1694 | 2903 | var offsetNumeric = function(offset) { |
1695 | 2904 | var date = new Date(); |
1696 | 2905 | date.setDate(date.getDate() + offset); |
1697 | 2906 | return date; |
1698 | 2907 | }; |
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(); |
1701 | 2918 | var year = date.getFullYear(); |
1702 | 2919 | var month = date.getMonth(); |
1703 | 2920 | var day = date.getDate(); |
— | — | @@ -1710,19 +2927,18 @@ |
1711 | 2928 | day += parseInt(matches[1],10) * 7; break; |
1712 | 2929 | case 'm' : case 'M' : |
1713 | 2930 | month += parseInt(matches[1],10); |
1714 | | - day = Math.min(day, getDaysInMonth(year, month)); |
| 2931 | + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); |
1715 | 2932 | break; |
1716 | 2933 | case 'y': case 'Y' : |
1717 | 2934 | year += parseInt(matches[1],10); |
1718 | | - day = Math.min(day, getDaysInMonth(year, month)); |
| 2935 | + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); |
1719 | 2936 | break; |
1720 | 2937 | } |
1721 | 2938 | matches = pattern.exec(offset); |
1722 | 2939 | } |
1723 | 2940 | return new Date(year, month, day); |
1724 | 2941 | }; |
1725 | | - date = (date == null ? defaultDate : |
1726 | | - (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) : |
| 2942 | + date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) : |
1727 | 2943 | (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); |
1728 | 2944 | date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); |
1729 | 2945 | if (date) { |
— | — | @@ -1747,15 +2963,15 @@ |
1748 | 2964 | }, |
1749 | 2965 | |
1750 | 2966 | /* Set the date(s) directly. */ |
1751 | | - _setDate: function(inst, date, endDate) { |
| 2967 | + _setDate: function(inst, date, noChange) { |
1752 | 2968 | var clear = !(date); |
1753 | 2969 | var origMonth = inst.selectedMonth; |
1754 | 2970 | var origYear = inst.selectedYear; |
1755 | | - date = this._determineDate(date, new Date()); |
| 2971 | + date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); |
1756 | 2972 | inst.selectedDay = inst.currentDay = date.getDate(); |
1757 | 2973 | inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); |
1758 | 2974 | 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) |
1760 | 2976 | this._notifyChange(inst); |
1761 | 2977 | this._adjustInstDate(inst); |
1762 | 2978 | if (inst.input) { |
— | — | @@ -1783,11 +2999,10 @@ |
1784 | 3000 | var numMonths = this._getNumberOfMonths(inst); |
1785 | 3001 | var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); |
1786 | 3002 | var stepMonths = this._get(inst, 'stepMonths'); |
1787 | | - var stepBigMonths = this._get(inst, 'stepBigMonths'); |
1788 | 3003 | var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); |
1789 | 3004 | var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : |
1790 | 3005 | new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); |
1791 | | - var minDate = this._getMinMaxDate(inst, 'min', true); |
| 3006 | + var minDate = this._getMinMaxDate(inst, 'min'); |
1792 | 3007 | var maxDate = this._getMinMaxDate(inst, 'max'); |
1793 | 3008 | var drawMonth = inst.drawMonth - showCurrentAtPos; |
1794 | 3009 | var drawYear = inst.drawYear; |
— | — | @@ -1797,7 +3012,7 @@ |
1798 | 3013 | } |
1799 | 3014 | if (maxDate) { |
1800 | 3015 | 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())); |
1802 | 3017 | maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); |
1803 | 3018 | while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { |
1804 | 3019 | drawMonth--; |
— | — | @@ -1814,7 +3029,8 @@ |
1815 | 3030 | this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), |
1816 | 3031 | this._getFormatConfig(inst))); |
1817 | 3032 | 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\');"' + |
1819 | 3035 | ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : |
1820 | 3036 | (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>')); |
1821 | 3037 | var nextText = this._get(inst, 'nextText'); |
— | — | @@ -1822,19 +3038,23 @@ |
1823 | 3039 | this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), |
1824 | 3040 | this._getFormatConfig(inst))); |
1825 | 3041 | 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\');"' + |
1827 | 3044 | ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : |
1828 | 3045 | (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>')); |
1829 | 3046 | var currentText = this._get(inst, 'currentText'); |
1830 | 3047 | var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); |
1831 | 3048 | currentText = (!navigationAsDateFormat ? currentText : |
1832 | 3049 | 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>' : ''); |
1834 | 3052 | 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 + '\');"' + |
1836 | 3055 | '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; |
1837 | 3056 | var firstDay = parseInt(this._get(inst, 'firstDay'),10); |
1838 | 3057 | firstDay = (isNaN(firstDay) ? 0 : firstDay); |
| 3058 | + var showWeek = this._get(inst, 'showWeek'); |
1839 | 3059 | var dayNames = this._get(inst, 'dayNames'); |
1840 | 3060 | var dayNamesShort = this._get(inst, 'dayNamesShort'); |
1841 | 3061 | var dayNamesMin = this._get(inst, 'dayNamesMin'); |
— | — | @@ -1842,9 +3062,8 @@ |
1843 | 3063 | var monthNamesShort = this._get(inst, 'monthNamesShort'); |
1844 | 3064 | var beforeShowDay = this._get(inst, 'beforeShowDay'); |
1845 | 3065 | var showOtherMonths = this._get(inst, 'showOtherMonths'); |
| 3066 | + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); |
1846 | 3067 | 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; |
1849 | 3068 | var defaultDate = this._getDefaultDate(inst); |
1850 | 3069 | var html = ''; |
1851 | 3070 | for (var row = 0; row < numMonths[0]; row++) { |
— | — | @@ -1854,22 +3073,25 @@ |
1855 | 3074 | var cornerClass = ' ui-corner-all'; |
1856 | 3075 | var calender = ''; |
1857 | 3076 | 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 | + } |
1864 | 3086 | calender += '">'; |
1865 | 3087 | } |
1866 | 3088 | calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + |
1867 | 3089 | (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + |
1868 | 3090 | (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + |
1869 | 3091 | 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 |
1871 | 3093 | '</div><table class="ui-datepicker-calendar"><thead>' + |
1872 | 3094 | '<tr>'; |
1873 | | - var thead = ''; |
| 3095 | + var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : ''); |
1874 | 3096 | for (var dow = 0; dow < 7; dow++) { // days of the week |
1875 | 3097 | var day = (dow + firstDay) % 7; |
1876 | 3098 | thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + |
— | — | @@ -1884,12 +3106,13 @@ |
1885 | 3107 | var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); |
1886 | 3108 | for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows |
1887 | 3109 | calender += '<tr>'; |
1888 | | - var tbody = ''; |
| 3110 | + var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' + |
| 3111 | + this._get(inst, 'calculateWeek')(printDate) + '</td>'); |
1889 | 3112 | for (var dow = 0; dow < 7; dow++) { // create date picker days |
1890 | 3113 | var daySettings = (beforeShowDay ? |
1891 | 3114 | beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); |
1892 | 3115 | var otherMonth = (printDate.getMonth() != drawMonth); |
1893 | | - var unselectable = otherMonth || !daySettings[0] || |
| 3116 | + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || |
1894 | 3117 | (minDate && printDate < minDate) || (maxDate && printDate > maxDate); |
1895 | 3118 | tbody += '<td class="' + |
1896 | 3119 | ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends |
— | — | @@ -1900,18 +3123,17 @@ |
1901 | 3124 | ' ' + this._dayOverClass : '') + // highlight selected day |
1902 | 3125 | (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days |
1903 | 3126 | (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 |
1906 | 3128 | (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) |
1907 | 3129 | ((!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() : ' ') : // 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 ? ' ' : // display for other months |
1911 | 3133 | (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + |
1912 | 3134 | (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 |
1916 | 3138 | printDate.setDate(printDate.getDate() + 1); |
1917 | 3139 | printDate = this._daylightSavingAdjust(printDate); |
1918 | 3140 | } |
— | — | @@ -1936,8 +3158,7 @@ |
1937 | 3159 | |
1938 | 3160 | /* Generate the month and year header. */ |
1939 | 3161 | _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) { |
1942 | 3163 | var changeMonth = this._get(inst, 'changeMonth'); |
1943 | 3164 | var changeYear = this._get(inst, 'changeYear'); |
1944 | 3165 | var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); |
— | — | @@ -1945,13 +3166,13 @@ |
1946 | 3167 | var monthHtml = ''; |
1947 | 3168 | // month selection |
1948 | 3169 | if (secondary || !changeMonth) |
1949 | | - monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> '; |
| 3170 | + monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>'; |
1950 | 3171 | else { |
1951 | 3172 | var inMinYear = (minDate && minDate.getFullYear() == drawYear); |
1952 | 3173 | var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); |
1953 | 3174 | 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 + '\');"' + |
1956 | 3177 | '>'; |
1957 | 3178 | for (var month = 0; month < 12; month++) { |
1958 | 3179 | if ((!inMinYear || month >= minDate.getMonth()) && |
— | — | @@ -1963,30 +3184,27 @@ |
1964 | 3185 | monthHtml += '</select>'; |
1965 | 3186 | } |
1966 | 3187 | if (!showMonthAfterYear) |
1967 | | - html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? ' ' : ''); |
| 3188 | + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); |
1968 | 3189 | // year selection |
1969 | 3190 | if (secondary || !changeYear) |
1970 | 3191 | html += '<span class="ui-datepicker-year">' + drawYear + '</span>'; |
1971 | 3192 | else { |
1972 | 3193 | // determine range of years to display |
1973 | 3194 | 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] || '')); |
1986 | 3204 | year = (minDate ? Math.max(year, minDate.getFullYear()) : year); |
1987 | 3205 | endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); |
1988 | 3206 | 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 + '\');"' + |
1991 | 3209 | '>'; |
1992 | 3210 | for (; year <= endYear; year++) { |
1993 | 3211 | html += '<option value="' + year + '"' + |
— | — | @@ -1995,8 +3213,9 @@ |
1996 | 3214 | } |
1997 | 3215 | html += '</select>'; |
1998 | 3216 | } |
| 3217 | + html += this._get(inst, 'yearSuffix'); |
1999 | 3218 | if (showMonthAfterYear) |
2000 | | - html += (secondary || changeMonth || changeYear ? ' ' : '') + monthHtml; |
| 3219 | + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; |
2001 | 3220 | html += '</div>'; // Close datepicker_header |
2002 | 3221 | return html; |
2003 | 3222 | }, |
— | — | @@ -2007,12 +3226,8 @@ |
2008 | 3227 | var month = inst.drawMonth + (period == 'M' ? offset : 0); |
2009 | 3228 | var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + |
2010 | 3229 | (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))); |
2017 | 3232 | inst.selectedDay = date.getDate(); |
2018 | 3233 | inst.drawMonth = inst.selectedMonth = date.getMonth(); |
2019 | 3234 | inst.drawYear = inst.selectedYear = date.getFullYear(); |
— | — | @@ -2020,6 +3235,15 @@ |
2021 | 3236 | this._notifyChange(inst); |
2022 | 3237 | }, |
2023 | 3238 | |
| 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 | + |
2024 | 3248 | /* Notify change of month/year. */ |
2025 | 3249 | _notifyChange: function(inst) { |
2026 | 3250 | var onChange = this._get(inst, 'onChangeMonthYear'); |
— | — | @@ -2034,11 +3258,9 @@ |
2035 | 3259 | return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); |
2036 | 3260 | }, |
2037 | 3261 | |
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); |
2043 | 3265 | }, |
2044 | 3266 | |
2045 | 3267 | /* Find the number of days in a given month. */ |
— | — | @@ -2054,8 +3276,8 @@ |
2055 | 3277 | /* Determines if we should allow a "next/prev" month display change. */ |
2056 | 3278 | _canAdjustMonth: function(inst, offset, curYear, curMonth) { |
2057 | 3279 | 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)); |
2060 | 3282 | if (offset < 0) |
2061 | 3283 | date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); |
2062 | 3284 | return this._isInRange(inst, date); |
— | — | @@ -2063,13 +3285,10 @@ |
2064 | 3286 | |
2065 | 3287 | /* Is the given date in the accepted range? */ |
2066 | 3288 | _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'); |
2072 | 3290 | 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())); |
2074 | 3293 | }, |
2075 | 3294 | |
2076 | 3295 | /* Provide the configuration settings for formatting/parsing. */ |
— | — | @@ -2125,9 +3344,12 @@ |
2126 | 3345 | } |
2127 | 3346 | |
2128 | 3347 | 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')) |
2130 | 3349 | return $.datepicker['_' + options + 'Datepicker']. |
2131 | 3350 | 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)); |
2132 | 3354 | return this.each(function() { |
2133 | 3355 | typeof options == 'string' ? |
2134 | 3356 | $.datepicker['_' + options + 'Datepicker']. |
— | — | @@ -2139,36 +3361,35 @@ |
2140 | 3362 | $.datepicker = new Datepicker(); // singleton instance |
2141 | 3363 | $.datepicker.initialized = false; |
2142 | 3364 | $.datepicker.uuid = new Date().getTime(); |
2143 | | -$.datepicker.version = "1.7.1"; |
| 3365 | +$.datepicker.version = "1.8.2"; |
2144 | 3366 | |
2145 | 3367 | // Workaround for #4055 |
2146 | 3368 | // Add another global to avoid noConflict issues with inline event handlers |
2147 | | -window.DP_jQuery = $; |
| 3369 | +window['DP_jQuery_' + dpuuid] = $; |
2148 | 3370 | |
2149 | 3371 | })(jQuery); |
2150 | 3372 | /* |
2151 | | - * jQuery UI Progressbar 1.7.1 |
| 3373 | + * jQuery UI Progressbar 1.8.2 |
2152 | 3374 | * |
2153 | | - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 3375 | + * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) |
2154 | 3376 | * Dual licensed under the MIT (MIT-LICENSE.txt) |
2155 | 3377 | * and GPL (GPL-LICENSE.txt) licenses. |
2156 | 3378 | * |
2157 | 3379 | * http://docs.jquery.com/UI/Progressbar |
2158 | 3380 | * |
2159 | 3381 | * Depends: |
2160 | | - * ui.core.js |
| 3382 | + * jquery.ui.core.js |
| 3383 | + * jquery.ui.widget.js |
2161 | 3384 | */ |
2162 | | -(function($) { |
| 3385 | +(function( $ ) { |
2163 | 3386 | |
2164 | | -$.widget("ui.progressbar", { |
2165 | | - |
2166 | | - _init: function() { |
2167 | | - |
| 3387 | +$.widget( "ui.progressbar", { |
| 3388 | + options: { |
| 3389 | + value: 0 |
| 3390 | + }, |
| 3391 | + _create: function() { |
2168 | 3392 | 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" ) |
2173 | 3394 | .attr({ |
2174 | 3395 | role: "progressbar", |
2175 | 3396 | "aria-valuemin": this._valueMin(), |
— | — | @@ -2176,88 +3397,84 @@ |
2177 | 3398 | "aria-valuenow": this._value() |
2178 | 3399 | }); |
2179 | 3400 | |
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 ); |
2181 | 3403 | |
2182 | 3404 | this._refreshValue(); |
2183 | | - |
2184 | 3405 | }, |
2185 | 3406 | |
2186 | 3407 | destroy: function() { |
2187 | | - |
2188 | 3408 | 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" ); |
2199 | 3414 | |
2200 | 3415 | this.valueDiv.remove(); |
2201 | 3416 | |
2202 | | - $.widget.prototype.destroy.apply(this, arguments); |
2203 | | - |
| 3417 | + $.Widget.prototype.destroy.apply( this, arguments ); |
2204 | 3418 | }, |
2205 | 3419 | |
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; |
2209 | 3427 | }, |
2210 | 3428 | |
2211 | | - _setData: function(key, value) { |
2212 | | - |
2213 | | - switch (key) { |
2214 | | - case 'value': |
| 3429 | + _setOption: function( key, value ) { |
| 3430 | + switch ( key ) { |
| 3431 | + case "value": |
2215 | 3432 | this.options.value = value; |
2216 | 3433 | this._refreshValue(); |
2217 | | - this._trigger('change', null, {}); |
| 3434 | + this._trigger( "change" ); |
2218 | 3435 | break; |
2219 | 3436 | } |
2220 | 3437 | |
2221 | | - $.widget.prototype._setData.apply(this, arguments); |
2222 | | - |
| 3438 | + $.Widget.prototype._setOption.apply( this, arguments ); |
2223 | 3439 | }, |
2224 | 3440 | |
2225 | 3441 | _value: function() { |
2226 | | - |
2227 | 3442 | 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 | + } |
2230 | 3453 | |
2231 | 3454 | return val; |
2232 | | - |
2233 | 3455 | }, |
2234 | 3456 | |
2235 | 3457 | _valueMin: function() { |
2236 | | - var valueMin = 0; |
2237 | | - return valueMin; |
| 3458 | + return 0; |
2238 | 3459 | }, |
2239 | 3460 | |
2240 | 3461 | _valueMax: function() { |
2241 | | - var valueMax = 100; |
2242 | | - return valueMax; |
| 3462 | + return 100; |
2243 | 3463 | }, |
2244 | 3464 | |
2245 | 3465 | _refreshValue: function() { |
2246 | 3466 | 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 ); |
2250 | 3471 | } |
2251 | | - |
2252 | 3472 | }); |
2253 | 3473 | |
2254 | | -$.extend($.ui.progressbar, { |
2255 | | - version: "1.7.1", |
2256 | | - defaults: { |
2257 | | - value: 0 |
2258 | | - } |
| 3474 | +$.extend( $.ui.progressbar, { |
| 3475 | + version: "1.8.2" |
2259 | 3476 | }); |
2260 | 3477 | |
2261 | | -})(jQuery); |
| 3478 | +})( jQuery ); |
2262 | 3479 | // tipsy, facebook style tooltips for jquery |
2263 | 3480 | // version 1.0.0a |
2264 | 3481 | // (c) 2008-2010 jason frame [jason@onehackoranother.com] |
— | — | @@ -7912,7 +9129,9 @@ |
7913 | 9130 | // because IE does not load JSON properly in an iframe |
7914 | 9131 | json = $j( doc.body ).find( 'pre' ).text(); |
7915 | 9132 | 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' ) { |
7917 | 9136 | response = window["eval"]( "( " + json + " )" ); |
7918 | 9137 | } else { |
7919 | 9138 | response = {}; |
— | — | @@ -9210,6 +10429,7 @@ |
9211 | 10430 | * remove this upload. n.b. we trigger a removeUpload this is usually triggered from |
9212 | 10431 | */ |
9213 | 10432 | remove: function() { |
| 10433 | + this.state = 'aborted'; |
9214 | 10434 | if ( this.details && this.details.div ) { |
9215 | 10435 | this.details.div.remove(); |
9216 | 10436 | } |
— | — | @@ -9251,6 +10471,9 @@ |
9252 | 10472 | */ |
9253 | 10473 | setTransported: function( result ) { |
9254 | 10474 | var _this = this; |
| 10475 | + if ( _this.state == 'aborted' ) { |
| 10476 | + return; |
| 10477 | + } |
9255 | 10478 | |
9256 | 10479 | if ( result.upload && result.upload.imageinfo ) { |
9257 | 10480 | // success |
— | — | @@ -9462,10 +10685,11 @@ |
9463 | 10686 | _this.$fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>') |
9464 | 10687 | .change( function() { _this.fileChanged(); } ); |
9465 | 10688 | |
| 10689 | + _this.$indicator = $j( '<div class="mwe-upwiz-file-indicator"></div>' ); |
9466 | 10690 | |
9467 | 10691 | 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">' |
9470 | 10694 | + '<div class="mwe-upwiz-file-preview"/>' |
9471 | 10695 | + '<div class="mwe-upwiz-file-texts">' |
9472 | 10696 | + '<div class="mwe-upwiz-visible-file-filename-text"/>' |
— | — | @@ -9551,16 +10775,22 @@ |
9552 | 10776 | * @param String statusClass: corresponds to a class mwe-upwiz-status which changes style of indicator. |
9553 | 10777 | */ |
9554 | 10778 | 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 ) { |
9558 | 10791 | if ( className.match( /^mwe-upwiz-status/ ) ) { |
9559 | | - $indicator.removeClass( className ); |
| 10792 | + _this.$indicator.removeClass( className ); |
9560 | 10793 | } |
9561 | 10794 | } ); |
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' ); |
9565 | 10795 | }, |
9566 | 10796 | |
9567 | 10797 | /** |
— | — | @@ -9671,12 +10901,14 @@ |
9672 | 10902 | .width( $covered.outerWidth() ) |
9673 | 10903 | .height( $covered.outerHeight() ); |
9674 | 10904 | |
| 10905 | + this.fileCtrlContainer.css( { 'z-index': 1 } ); |
| 10906 | + |
9675 | 10907 | // shift the file input over with negative margins, |
9676 | 10908 | // internal to the overflow-containing div, so the div shows all button |
9677 | 10909 | // and none of the textfield-like input |
9678 | 10910 | this.$fileInputCtrl.css( { |
9679 | 10911 | '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', |
9681 | 10913 | } ); |
9682 | 10914 | |
9683 | 10915 | |
— | — | @@ -10708,35 +11940,41 @@ |
10709 | 11941 | createInterface: function( selector ) { |
10710 | 11942 | var _this = this; |
10711 | 11943 | |
| 11944 | + // construct the arrow steps from the UL in the HTML |
10712 | 11945 | $j( '#mwe-upwiz-steps' ) |
10713 | 11946 | .addClass( 'ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix' ) |
10714 | 11947 | .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 | + |
10716 | 11958 | $j( '.mwe-upwiz-button-home' ) |
10717 | | - .append( gM( 'mwe-upwiz-home' ) ) |
10718 | 11959 | .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 | + |
10724 | 11961 | // handler for next button |
10725 | 11962 | $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next') |
10726 | | - .append( gM( 'mwe-upwiz-next' ) ) |
10727 | 11963 | .click( function() { |
10728 | 11964 | _this.moveToStep( 'file', function() { |
10729 | 11965 | // we explicitly move the file input at this point |
10730 | 11966 | // because it was probably jumping around due to other "steps" on this page during file construction. |
10731 | 11967 | // XXX using a timeout is lame, are there other options? |
10732 | 11968 | // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML |
10733 | | - setTimeout( function() { |
| 11969 | + setTimeout( function() { |
10734 | 11970 | upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' ); |
10735 | 11971 | }, 300 ); |
10736 | 11972 | } ); |
10737 | 11973 | } ); |
10738 | 11974 | |
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() |
10741 | 11979 | .click( function() { |
10742 | 11980 | // check if there is an upload at all (should never happen) |
10743 | 11981 | if ( _this.uploads.length === 0 ) { |
— | — | @@ -10746,19 +11984,24 @@ |
10747 | 11985 | } |
10748 | 11986 | |
10749 | 11987 | _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(); |
10755 | 11989 | } ); |
10756 | 11990 | |
| 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 | + |
10757 | 12001 | // DEEDS div |
10758 | 12002 | |
10759 | 12003 | $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) ); |
10760 | 12004 | |
10761 | 12005 | $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next') |
10762 | | - .append( gM( 'mwe-upwiz-next-deeds' ) ) |
10763 | 12006 | .click( function() { |
10764 | 12007 | // validate has the side effect of notifying the user of problems, or removing existing notifications. |
10765 | 12008 | // if returns false, you can assume there are notifications in the interface. |
— | — | @@ -10791,7 +12034,6 @@ |
10792 | 12035 | // DETAILS div |
10793 | 12036 | |
10794 | 12037 | $j( '#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next' ) |
10795 | | - .append( gM( 'mwe-upwiz-next-details' ) ) |
10796 | 12038 | .click( function() { |
10797 | 12039 | if ( _this.detailsValid() ) { |
10798 | 12040 | _this.detailsSubmit( function() { |
— | — | @@ -10816,6 +12058,7 @@ |
10817 | 12059 | |
10818 | 12060 | // do some last minute prep before advancing to the DEEDS page |
10819 | 12061 | prepareAndMoveToDeeds: function() { |
| 12062 | + var _this = this; |
10820 | 12063 | |
10821 | 12064 | // these deeds are standard |
10822 | 12065 | var deeds = [ |
— | — | @@ -10985,25 +12228,56 @@ |
10986 | 12229 | }); |
10987 | 12230 | }, |
10988 | 12231 | |
| 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 | + |
10989 | 12241 | /** |
10990 | 12242 | * This is useful to clean out unused upload file inputs if the user hits GO. |
10991 | 12243 | * We are using a second array to iterate, because we will be splicing the main one, _this.uploads |
10992 | 12244 | */ |
10993 | 12245 | 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 ) { |
10995 | 12267 | var toRemove = []; |
10996 | 12268 | |
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 ); |
11000 | 12272 | } |
11001 | | - } |
| 12273 | + } ); |
11002 | 12274 | |
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 | + } ) |
11006 | 12278 | }, |
11007 | 12279 | |
| 12280 | + |
| 12281 | + |
11008 | 12282 | /** |
11009 | 12283 | * Manage transitioning all of our uploads from one state to another -- like from "new" to "uploaded". |
11010 | 12284 | * |
— | — | @@ -11028,7 +12302,7 @@ |
11029 | 12303 | } else if ( ( upload.state == beginState ) && ( uploadsToStart > 0 ) ) { |
11030 | 12304 | starter( upload ); |
11031 | 12305 | uploadsToStart--; |
11032 | | - } |
| 12306 | + } |
11033 | 12307 | } ); |
11034 | 12308 | |
11035 | 12309 | // build in a little delay even for the end state, so user can see progress bar in a complete state. |
— | — | @@ -11049,17 +12323,28 @@ |
11050 | 12324 | * and kicks off a thread which will take from the queue. |
11051 | 12325 | * @param endCallback - to execute when uploads are completed |
11052 | 12326 | */ |
11053 | | - startUploads: function( endCallback ) { |
| 12327 | + startUploads: function() { |
11054 | 12328 | var _this = this; |
| 12329 | + |
11055 | 12330 | // remove the upload button, and the add file button |
11056 | 12331 | $j( '#mwe-upwiz-upload-ctrls' ).hide(); |
| 12332 | + _this.hideFileEndButtons(); |
11057 | 12333 | $j( '#mwe-upwiz-add-file' ).hide(); |
11058 | 12334 | |
| 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 | + |
11059 | 12344 | var allowCloseWindow = $j().preventCloseWindow( { |
11060 | 12345 | message: gM( 'mwe-prevent-close') |
11061 | 12346 | } ); |
11062 | 12347 | |
11063 | | - |
| 12348 | + $j( '#mwe-upwiz-progress' ).show(); |
11064 | 12349 | var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress', |
11065 | 12350 | gM( 'mwe-upwiz-uploading' ), |
11066 | 12351 | _this.uploads, |
— | — | @@ -11069,46 +12354,89 @@ |
11070 | 12355 | 'transportWeight' ); |
11071 | 12356 | progressBar.start(); |
11072 | 12357 | |
11073 | | - |
11074 | 12358 | // remove ability to change files |
11075 | 12359 | // ideally also hide the "button"... but then we require styleable file input CSS trickery |
11076 | 12360 | // although, we COULD do this just for files already in progress... |
11077 | 12361 | |
11078 | 12362 | // it might be interesting to just make this creational -- attach it to the dom element representing |
11079 | 12363 | // the progress bar and elapsed time |
| 12364 | + |
11080 | 12365 | _this.makeTransitioner( |
11081 | 12366 | 'new', |
11082 | 12367 | [ 'transporting', 'transported', 'metadata' ], |
11083 | | - [ 'error', 'verified' ], |
| 12368 | + [ 'error', 'stashed' ], |
11084 | 12369 | function( upload ) { |
11085 | 12370 | upload.start(); |
11086 | 12371 | }, |
11087 | 12372 | function() { |
11088 | 12373 | allowCloseWindow(); |
11089 | 12374 | $j().notify( gM( 'mwe-upwiz-files-complete' ) ); |
11090 | | - endCallback(); |
| 12375 | + _this.showFileNext(); |
11091 | 12376 | } |
11092 | 12377 | ); |
11093 | 12378 | }, |
11094 | 12379 | |
| 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 | + }, |
11095 | 12422 | |
11096 | | - |
11097 | 12423 | /** |
11098 | 12424 | * Occurs whenever we need to update the interface based on how many files there are |
11099 | 12425 | * Thhere is an uncounted upload, waiting to be used, which has a fileInput which covers the |
11100 | 12426 | * "add an upload" button. This is absolutely positioned, so it needs to be moved if another upload was removed. |
11101 | 12427 | * 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? |
11102 | 12431 | */ |
11103 | 12432 | updateFileCounts: function() { |
11104 | 12433 | var _this = this; |
11105 | 12434 | |
11106 | 12435 | if ( _this.uploads.length ) { |
11107 | 12436 | // 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(); |
11110 | 12438 | |
11111 | 12439 | // 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' ) ); |
11113 | 12441 | $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0'); |
11114 | 12442 | $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n'); |
11115 | 12443 | |
— | — | @@ -11124,7 +12452,8 @@ |
11125 | 12453 | $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' ); |
11126 | 12454 | } else { |
11127 | 12455 | // 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(); |
11129 | 12458 | |
11130 | 12459 | // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced |
11131 | 12460 | // 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 |
1 | 447 | + 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 |
1 | 329 | + native |
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | |
29 | 29 | #mwe-upwiz-steps li { |
30 | 30 | color: #666666; |
| 31 | + font-size: 1.2em; |
31 | 32 | margin-right: -1px; |
32 | 33 | } |
33 | 34 | |
— | — | @@ -50,10 +51,11 @@ |
51 | 52 | |
52 | 53 | .mwe-upwiz-add-files-0 { |
53 | 54 | text-align: center; |
54 | | - font-size: large; |
55 | 55 | } |
56 | 56 | |
57 | | -#mwe-upwiz-add-file { |
| 57 | +.mwe-upwiz-add-files-0 #mwe-upwiz-add-file { |
| 58 | + font-size: large; |
| 59 | + padding: 1em; |
58 | 60 | } |
59 | 61 | |
60 | 62 | /* NOT a pseudoclass */ |
— | — | @@ -62,7 +64,7 @@ |
63 | 65 | } |
64 | 66 | |
65 | 67 | /* 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 { |
67 | 69 | outline: none; |
68 | 70 | cursor: pointer; |
69 | 71 | } |
— | — | @@ -160,16 +162,20 @@ |
161 | 163 | |
162 | 164 | .mwe-upwiz-add-files-n { |
163 | 165 | float: left; |
164 | | - margin-top: 5px; |
165 | | - margin-left: 4px; |
166 | 166 | } |
167 | 167 | |
168 | 168 | #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n, .mwe-upwiz-progress-bar-etr { |
169 | 169 | width: 300px; |
170 | | - padding-left: 5px; |
171 | 170 | } |
172 | 171 | |
| 172 | +#mwe-upwiz-upload-ctrl-container { |
| 173 | + float: right; |
| 174 | + display: none; |
| 175 | +} |
173 | 176 | |
| 177 | +#mwe-upwiz-upload-ctrl:hover { |
| 178 | + text-decoration: none; |
| 179 | +} |
174 | 180 | #mwe-upwiz-add-file-container.mwe-upwiz-add-files-n { |
175 | 181 | float: left; |
176 | 182 | } |
— | — | @@ -209,6 +215,22 @@ |
210 | 216 | margin-top: 1em; |
211 | 217 | } |
212 | 218 | |
| 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 | + |
213 | 235 | #mwe-upwiz-add-file-container { |
214 | 236 | /* empty; this changes a lot */ |
215 | 237 | } |
— | — | @@ -589,3 +611,13 @@ |
590 | 612 | .ui-datepicker-current-day a.ui-state-active { |
591 | 613 | background: #ffff99; |
592 | 614 | } |
| 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 @@ |
53 | 53 | * remove this upload. n.b. we trigger a removeUpload this is usually triggered from |
54 | 54 | */ |
55 | 55 | remove: function() { |
| 56 | + this.state = 'aborted'; |
56 | 57 | if ( this.details && this.details.div ) { |
57 | 58 | this.details.div.remove(); |
58 | 59 | } |
— | — | @@ -93,6 +94,9 @@ |
94 | 95 | */ |
95 | 96 | setTransported: function( result ) { |
96 | 97 | var _this = this; |
| 98 | + if ( _this.state == 'aborted' ) { |
| 99 | + return; |
| 100 | + } |
97 | 101 | |
98 | 102 | if ( result.upload && result.upload.imageinfo ) { |
99 | 103 | // success |
— | — | @@ -304,10 +308,11 @@ |
305 | 309 | _this.$fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>') |
306 | 310 | .change( function() { _this.fileChanged(); } ); |
307 | 311 | |
| 312 | + _this.$indicator = $j( '<div class="mwe-upwiz-file-indicator"></div>' ); |
308 | 313 | |
309 | 314 | 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">' |
312 | 317 | + '<div class="mwe-upwiz-file-preview"/>' |
313 | 318 | + '<div class="mwe-upwiz-file-texts">' |
314 | 319 | + '<div class="mwe-upwiz-visible-file-filename-text"/>' |
— | — | @@ -393,16 +398,22 @@ |
394 | 399 | * @param String statusClass: corresponds to a class mwe-upwiz-status which changes style of indicator. |
395 | 400 | */ |
396 | 401 | 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 ) { |
400 | 414 | if ( className.match( /^mwe-upwiz-status/ ) ) { |
401 | | - $indicator.removeClass( className ); |
| 415 | + _this.$indicator.removeClass( className ); |
402 | 416 | } |
403 | 417 | } ); |
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' ); |
407 | 418 | }, |
408 | 419 | |
409 | 420 | /** |
— | — | @@ -513,12 +524,14 @@ |
514 | 525 | .width( $covered.outerWidth() ) |
515 | 526 | .height( $covered.outerHeight() ); |
516 | 527 | |
| 528 | + this.fileCtrlContainer.css( { 'z-index': 1 } ); |
| 529 | + |
517 | 530 | // shift the file input over with negative margins, |
518 | 531 | // internal to the overflow-containing div, so the div shows all button |
519 | 532 | // and none of the textfield-like input |
520 | 533 | this.$fileInputCtrl.css( { |
521 | 534 | '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', |
523 | 536 | } ); |
524 | 537 | |
525 | 538 | |
— | — | @@ -1550,35 +1563,41 @@ |
1551 | 1564 | createInterface: function( selector ) { |
1552 | 1565 | var _this = this; |
1553 | 1566 | |
| 1567 | + // construct the arrow steps from the UL in the HTML |
1554 | 1568 | $j( '#mwe-upwiz-steps' ) |
1555 | 1569 | .addClass( 'ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix' ) |
1556 | 1570 | .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 | + |
1558 | 1581 | $j( '.mwe-upwiz-button-home' ) |
1559 | | - .append( gM( 'mwe-upwiz-home' ) ) |
1560 | 1582 | .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 | + |
1566 | 1584 | // handler for next button |
1567 | 1585 | $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next') |
1568 | | - .append( gM( 'mwe-upwiz-next' ) ) |
1569 | 1586 | .click( function() { |
1570 | 1587 | _this.moveToStep( 'file', function() { |
1571 | 1588 | // we explicitly move the file input at this point |
1572 | 1589 | // because it was probably jumping around due to other "steps" on this page during file construction. |
1573 | 1590 | // XXX using a timeout is lame, are there other options? |
1574 | 1591 | // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML |
1575 | | - setTimeout( function() { |
| 1592 | + setTimeout( function() { |
1576 | 1593 | upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' ); |
1577 | 1594 | }, 300 ); |
1578 | 1595 | } ); |
1579 | 1596 | } ); |
1580 | 1597 | |
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() |
1583 | 1602 | .click( function() { |
1584 | 1603 | // check if there is an upload at all (should never happen) |
1585 | 1604 | if ( _this.uploads.length === 0 ) { |
— | — | @@ -1588,19 +1607,24 @@ |
1589 | 1608 | } |
1590 | 1609 | |
1591 | 1610 | _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(); |
1597 | 1612 | } ); |
1598 | 1613 | |
| 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 | + |
1599 | 1624 | // DEEDS div |
1600 | 1625 | |
1601 | 1626 | $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) ); |
1602 | 1627 | |
1603 | 1628 | $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next') |
1604 | | - .append( gM( 'mwe-upwiz-next-deeds' ) ) |
1605 | 1629 | .click( function() { |
1606 | 1630 | // validate has the side effect of notifying the user of problems, or removing existing notifications. |
1607 | 1631 | // if returns false, you can assume there are notifications in the interface. |
— | — | @@ -1633,7 +1657,6 @@ |
1634 | 1658 | // DETAILS div |
1635 | 1659 | |
1636 | 1660 | $j( '#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next' ) |
1637 | | - .append( gM( 'mwe-upwiz-next-details' ) ) |
1638 | 1661 | .click( function() { |
1639 | 1662 | if ( _this.detailsValid() ) { |
1640 | 1663 | _this.detailsSubmit( function() { |
— | — | @@ -1658,6 +1681,7 @@ |
1659 | 1682 | |
1660 | 1683 | // do some last minute prep before advancing to the DEEDS page |
1661 | 1684 | prepareAndMoveToDeeds: function() { |
| 1685 | + var _this = this; |
1662 | 1686 | |
1663 | 1687 | // these deeds are standard |
1664 | 1688 | var deeds = [ |
— | — | @@ -1827,25 +1851,56 @@ |
1828 | 1852 | }); |
1829 | 1853 | }, |
1830 | 1854 | |
| 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 | + |
1831 | 1864 | /** |
1832 | 1865 | * This is useful to clean out unused upload file inputs if the user hits GO. |
1833 | 1866 | * We are using a second array to iterate, because we will be splicing the main one, _this.uploads |
1834 | 1867 | */ |
1835 | 1868 | 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 ) { |
1837 | 1890 | var toRemove = []; |
1838 | 1891 | |
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 ); |
1842 | 1895 | } |
1843 | | - } |
| 1896 | + } ); |
1844 | 1897 | |
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 | + } ) |
1848 | 1901 | }, |
1849 | 1902 | |
| 1903 | + |
| 1904 | + |
1850 | 1905 | /** |
1851 | 1906 | * Manage transitioning all of our uploads from one state to another -- like from "new" to "uploaded". |
1852 | 1907 | * |
— | — | @@ -1870,7 +1925,7 @@ |
1871 | 1926 | } else if ( ( upload.state == beginState ) && ( uploadsToStart > 0 ) ) { |
1872 | 1927 | starter( upload ); |
1873 | 1928 | uploadsToStart--; |
1874 | | - } |
| 1929 | + } |
1875 | 1930 | } ); |
1876 | 1931 | |
1877 | 1932 | // build in a little delay even for the end state, so user can see progress bar in a complete state. |
— | — | @@ -1891,17 +1946,28 @@ |
1892 | 1947 | * and kicks off a thread which will take from the queue. |
1893 | 1948 | * @param endCallback - to execute when uploads are completed |
1894 | 1949 | */ |
1895 | | - startUploads: function( endCallback ) { |
| 1950 | + startUploads: function() { |
1896 | 1951 | var _this = this; |
| 1952 | + |
1897 | 1953 | // remove the upload button, and the add file button |
1898 | 1954 | $j( '#mwe-upwiz-upload-ctrls' ).hide(); |
| 1955 | + _this.hideFileEndButtons(); |
1899 | 1956 | $j( '#mwe-upwiz-add-file' ).hide(); |
1900 | 1957 | |
| 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 | + |
1901 | 1967 | var allowCloseWindow = $j().preventCloseWindow( { |
1902 | 1968 | message: gM( 'mwe-prevent-close') |
1903 | 1969 | } ); |
1904 | 1970 | |
1905 | | - |
| 1971 | + $j( '#mwe-upwiz-progress' ).show(); |
1906 | 1972 | var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress', |
1907 | 1973 | gM( 'mwe-upwiz-uploading' ), |
1908 | 1974 | _this.uploads, |
— | — | @@ -1911,46 +1977,89 @@ |
1912 | 1978 | 'transportWeight' ); |
1913 | 1979 | progressBar.start(); |
1914 | 1980 | |
1915 | | - |
1916 | 1981 | // remove ability to change files |
1917 | 1982 | // ideally also hide the "button"... but then we require styleable file input CSS trickery |
1918 | 1983 | // although, we COULD do this just for files already in progress... |
1919 | 1984 | |
1920 | 1985 | // it might be interesting to just make this creational -- attach it to the dom element representing |
1921 | 1986 | // the progress bar and elapsed time |
| 1987 | + |
1922 | 1988 | _this.makeTransitioner( |
1923 | 1989 | 'new', |
1924 | 1990 | [ 'transporting', 'transported', 'metadata' ], |
1925 | | - [ 'error', 'verified' ], |
| 1991 | + [ 'error', 'stashed' ], |
1926 | 1992 | function( upload ) { |
1927 | 1993 | upload.start(); |
1928 | 1994 | }, |
1929 | 1995 | function() { |
1930 | 1996 | allowCloseWindow(); |
1931 | 1997 | $j().notify( gM( 'mwe-upwiz-files-complete' ) ); |
1932 | | - endCallback(); |
| 1998 | + _this.showFileNext(); |
1933 | 1999 | } |
1934 | 2000 | ); |
1935 | 2001 | }, |
1936 | 2002 | |
| 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 | + }, |
1937 | 2045 | |
1938 | | - |
1939 | 2046 | /** |
1940 | 2047 | * Occurs whenever we need to update the interface based on how many files there are |
1941 | 2048 | * Thhere is an uncounted upload, waiting to be used, which has a fileInput which covers the |
1942 | 2049 | * "add an upload" button. This is absolutely positioned, so it needs to be moved if another upload was removed. |
1943 | 2050 | * 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? |
1944 | 2054 | */ |
1945 | 2055 | updateFileCounts: function() { |
1946 | 2056 | var _this = this; |
1947 | 2057 | |
1948 | 2058 | if ( _this.uploads.length ) { |
1949 | 2059 | // 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(); |
1952 | 2061 | |
1953 | 2062 | // 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' ) ); |
1955 | 2064 | $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0'); |
1956 | 2065 | $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n'); |
1957 | 2066 | |
— | — | @@ -1966,7 +2075,8 @@ |
1967 | 2076 | $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' ); |
1968 | 2077 | } else { |
1969 | 2078 | // 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(); |
1971 | 2081 | |
1972 | 2082 | // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced |
1973 | 2083 | // file input element that becomes the "click here to add" |
Index: trunk/extensions/UploadWizard/resources/mw.IframeTransport.js |
— | — | @@ -93,7 +93,9 @@ |
94 | 94 | // because IE does not load JSON properly in an iframe |
95 | 95 | json = $j( doc.body ).find( 'pre' ).text(); |
96 | 96 | 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' ) { |
98 | 100 | response = window["eval"]( "( " + json + " )" ); |
99 | 101 | } else { |
100 | 102 | response = {}; |
Index: trunk/extensions/UploadWizard/resources/combined.min.js |
— | — | @@ -7,16 +7,22 @@ |
8 | 8 | |
9 | 9 | |
10 | 10 | |
11 | | -;jQuery.ui||(function($){ |
12 | 11 | |
13 | | -var _remove=$.fn.remove, |
14 | | -isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9); |
| 12 | +(function($){ |
15 | 13 | |
16 | 14 | |
17 | | -$.ui={ |
18 | | -version:"1.7.1", |
19 | 15 | |
20 | 16 | |
| 17 | +$.ui=$.ui||{}; |
| 18 | +if($.ui.version){ |
| 19 | +return; |
| 20 | +} |
| 21 | + |
| 22 | + |
| 23 | +$.extend($.ui,{ |
| 24 | +version:"1.8.2", |
| 25 | + |
| 26 | + |
21 | 27 | plugin:{ |
22 | 28 | add:function(module,option,set){ |
23 | 29 | var proto=$.ui[module].prototype; |
— | — | @@ -73,9 +79,13 @@ |
74 | 80 | }, |
75 | 81 | |
76 | 82 | keyCode:{ |
| 83 | +ALT:18, |
77 | 84 | BACKSPACE:8, |
78 | 85 | CAPS_LOCK:20, |
79 | 86 | COMMA:188, |
| 87 | +COMMAND:91, |
| 88 | +COMMAND_LEFT:91, |
| 89 | +COMMAND_RIGHT:93, |
80 | 90 | CONTROL:17, |
81 | 91 | DELETE:46, |
82 | 92 | DOWN:40, |
— | — | @@ -85,6 +95,7 @@ |
86 | 96 | HOME:36, |
87 | 97 | INSERT:45, |
88 | 98 | LEFT:37, |
| 99 | +MENU:93, |
89 | 100 | NUMPAD_ADD:107, |
90 | 101 | NUMPAD_DECIMAL:110, |
91 | 102 | NUMPAD_DIVIDE:111, |
— | — | @@ -98,64 +109,36 @@ |
99 | 110 | SHIFT:16, |
100 | 111 | SPACE:32, |
101 | 112 | TAB:9, |
102 | | -UP:38 |
| 113 | +UP:38, |
| 114 | +WINDOWS:91 |
103 | 115 | } |
104 | | -}; |
| 116 | +}); |
105 | 117 | |
106 | 118 | |
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' |
131 | 123 | ?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); |
146 | 131 | }, |
147 | 132 | |
148 | 133 | enableSelection:function(){ |
149 | 134 | return this |
150 | 135 | .attr('unselectable','off') |
151 | | -.css('MozUserSelect','') |
152 | | -.unbind('selectstart.ui'); |
| 136 | +.css('MozUserSelect',''); |
153 | 137 | }, |
154 | 138 | |
155 | 139 | disableSelection:function(){ |
156 | 140 | return this |
157 | 141 | .attr('unselectable','on') |
158 | | -.css('MozUserSelect','none') |
159 | | -.bind('selectstart.ui',function(){return false;}); |
| 142 | +.css('MozUserSelect','none'); |
160 | 143 | }, |
161 | 144 | |
162 | 145 | scrollParent:function(){ |
— | — | @@ -171,7 +154,37 @@ |
172 | 155 | } |
173 | 156 | |
174 | 157 | 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); |
175 | 163 | } |
| 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 | +} |
176 | 189 | }); |
177 | 190 | |
178 | 191 | |
— | — | @@ -200,150 +213,223 @@ |
201 | 214 | } |
202 | 215 | }); |
203 | 216 | |
| 217 | +})(jQuery); |
204 | 218 | |
205 | 219 | |
206 | 220 | |
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 | | -} |
212 | 221 | |
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 | +}); |
216 | 238 | } |
217 | | -return($.inArray(method,methods)!=-1); |
218 | 239 | } |
| 240 | +return _remove.call($(this),selector,keepData); |
| 241 | +}); |
| 242 | +}; |
219 | 243 | |
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; |
222 | 247 | name=name.split(".")[1]; |
| 248 | +fullName=namespace+"-"+name; |
223 | 249 | |
| 250 | +if(!prototype){ |
| 251 | +prototype=base; |
| 252 | +base=$.Widget; |
| 253 | +} |
224 | 254 | |
225 | | -$.fn[name]=function(options){ |
226 | | -var isMethodCall=(typeof options=='string'), |
227 | | -args=Array.prototype.slice.call(arguments,1); |
228 | 255 | |
| 256 | +$.expr[":"][fullName]=function(elem){ |
| 257 | +return!!$.data(elem,name); |
| 258 | +}; |
229 | 259 | |
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); |
232 | 265 | } |
| 266 | +}; |
233 | 267 | |
| 268 | +var basePrototype=new base(); |
234 | 269 | |
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 | | -} |
240 | 270 | |
241 | 271 | |
242 | | -return this.each(function(){ |
243 | | -var instance=$.data(this,name); |
244 | 272 | |
245 | 273 | |
246 | | -(!instance&&!isMethodCall&& |
247 | | -$.data(this,name,new $[namespace][name](this,options))._init()); |
248 | 274 | |
249 | 275 | |
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]); |
253 | 286 | }; |
254 | 287 | |
| 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; |
255 | 293 | |
256 | | -$[namespace]=$[namespace]||{}; |
257 | | -$[namespace][name]=function(element,options){ |
258 | | -var self=this; |
259 | 294 | |
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; |
264 | 298 | |
265 | | -this.options=$.extend({}, |
266 | | -$.widget.defaults, |
267 | | -$[namespace][name].defaults, |
268 | | -$.metadata&&$.metadata.get(element)[name], |
269 | | -options); |
270 | 299 | |
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; |
275 | 302 | } |
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; |
280 | 313 | } |
281 | | -}) |
282 | | -.bind('remove',function(){ |
283 | | -return self.destroy(); |
284 | 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)); |
| 325 | +} |
| 326 | +}); |
| 327 | +} |
| 328 | + |
| 329 | +return returnValue; |
285 | 330 | }; |
| 331 | +}; |
286 | 332 | |
| 333 | +$.Widget=function(options,element){ |
287 | 334 | |
288 | | -$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype); |
| 335 | +if(arguments.length){ |
| 336 | +this._createWidget(options,element); |
| 337 | +} |
| 338 | +}; |
289 | 339 | |
| 340 | +$.Widget.prototype={ |
| 341 | +widgetName:"widget", |
| 342 | +widgetEventPrefix:"", |
| 343 | +options:{ |
| 344 | +disabled:false |
| 345 | +}, |
| 346 | +_createWidget:function(options,element){ |
290 | 347 | |
291 | 348 | |
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); |
294 | 354 | |
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(){}, |
296 | 364 | _init:function(){}, |
| 365 | + |
297 | 366 | 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"); |
301 | 376 | }, |
302 | 377 | |
| 378 | +widget:function(){ |
| 379 | +return this.element; |
| 380 | +}, |
| 381 | + |
303 | 382 | option:function(key,value){ |
304 | 383 | var options=key, |
305 | 384 | self=this; |
306 | 385 | |
307 | | -if(typeof key=="string"){ |
| 386 | +if(arguments.length===0){ |
| 387 | + |
| 388 | +return $.extend({},self.options); |
| 389 | +} |
| 390 | + |
| 391 | +if(typeof key==="string"){ |
308 | 392 | if(value===undefined){ |
309 | | -return this._getData(key); |
| 393 | +return this.options[key]; |
310 | 394 | } |
311 | 395 | options={}; |
312 | 396 | options[key]=value; |
313 | 397 | } |
314 | 398 | |
315 | 399 | $.each(options,function(key,value){ |
316 | | -self._setData(key,value); |
| 400 | +self._setOption(key,value); |
317 | 401 | }); |
| 402 | + |
| 403 | +return self; |
318 | 404 | }, |
319 | | -_getData:function(key){ |
320 | | -return this.options[key]; |
321 | | -}, |
322 | | -_setData:function(key,value){ |
| 405 | +_setOption:function(key,value){ |
323 | 406 | this.options[key]=value; |
324 | 407 | |
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") |
330 | 413 | .attr("aria-disabled",value); |
331 | 414 | } |
| 415 | + |
| 416 | +return this; |
332 | 417 | }, |
333 | 418 | |
334 | 419 | enable:function(){ |
335 | | -this._setData('disabled',false); |
| 420 | +return this._setOption("disabled",false); |
336 | 421 | }, |
337 | 422 | disable:function(){ |
338 | | -this._setData('disabled',true); |
| 423 | +return this._setOption("disabled",true); |
339 | 424 | }, |
340 | 425 | |
341 | 426 | _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]; |
345 | 428 | |
346 | 429 | event=$.Event(event); |
347 | | -event.type=eventName; |
| 430 | +event.type=(type===this.widgetEventPrefix? |
| 431 | +type: |
| 432 | +this.widgetEventPrefix+type).toLowerCase(); |
| 433 | +data=data||{}; |
348 | 434 | |
349 | 435 | |
350 | 436 | |
— | — | @@ -357,183 +443,1220 @@ |
358 | 444 | |
359 | 445 | this.element.trigger(event,data); |
360 | 446 | |
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()); |
363 | 450 | } |
364 | 451 | }; |
365 | 452 | |
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; |
368 | 496 | }; |
369 | 497 | |
| 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); |
370 | 511 | |
| 512 | +this._determineButtonType(); |
| 513 | +this.hasTitle=!!this.buttonElement.attr("title"); |
371 | 514 | |
| 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"; |
372 | 520 | |
373 | | -$.ui.mouse={ |
374 | | -_mouseInit:function(){ |
375 | | -var self=this; |
| 521 | +if(options.label===null){ |
| 522 | +options.label=this.buttonElement.html(); |
| 523 | +} |
376 | 524 | |
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 | +} |
380 | 540 | }) |
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){ |
385 | 564 | return false; |
386 | 565 | } |
| 566 | +$(this).toggleClass("ui-state-active"); |
| 567 | +self.buttonElement.attr("aria-pressed",self.element[0].checked); |
387 | 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); |
388 | 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 | +}); |
389 | 615 | |
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(); |
393 | 621 | } |
| 622 | +}); |
| 623 | +} |
| 624 | +} |
394 | 625 | |
395 | | -this.started=false; |
| 626 | + |
| 627 | + |
| 628 | + |
| 629 | +this._setOption("disabled",options.disabled); |
396 | 630 | }, |
397 | 631 | |
| 632 | +_determineButtonType:function(){ |
398 | 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 | +} |
399 | 647 | |
400 | | -_mouseDestroy:function(){ |
401 | | -this.element.unbind('.'+this.widgetName); |
| 648 | +if(this.type==="checkbox"||this.type==="radio"){ |
402 | 649 | |
403 | 650 | |
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 | +} |
406 | 663 | }, |
407 | 664 | |
408 | | -_mouseDown:function(event){ |
| 665 | +widget:function(){ |
| 666 | +return this.buttonElement; |
| 667 | +}, |
409 | 668 | |
| 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()); |
410 | 677 | |
411 | | -event.originalEvent=event.originalEvent||{}; |
412 | | -if(event.originalEvent.mouseHandled){return;} |
| 678 | +if(!this.hasTitle){ |
| 679 | +this.buttonElement.removeAttr("title"); |
| 680 | +} |
413 | 681 | |
| 682 | +$.Widget.prototype.destroy.call(this); |
| 683 | +}, |
414 | 684 | |
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 | +}, |
416 | 696 | |
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 | +}, |
418 | 726 | |
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); |
424 | 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 | +}); |
425 | 764 | |
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); |
431 | 778 | } |
432 | 779 | |
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||' ', |
| 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); |
436 | 891 | event.preventDefault(); |
437 | | -return true; |
438 | 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'); |
439 | 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); |
| 941 | +return false; |
| 942 | +}) |
| 943 | +.appendTo(uiDialogTitlebar), |
440 | 944 | |
| 945 | +uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$('<span></span>')) |
| 946 | +.addClass( |
| 947 | +'ui-icon '+ |
| 948 | +'ui-icon-closethick' |
| 949 | +) |
| 950 | +.text(options.closeText) |
| 951 | +.appendTo(uiDialogTitlebarClose), |
441 | 952 | |
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); |
451 | 958 | |
452 | 959 | |
453 | 960 | |
454 | 961 | |
455 | | -($.browser.safari||event.preventDefault()); |
| 962 | +if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){ |
| 963 | +options.beforeClose=options.beforeclose; |
| 964 | +} |
456 | 965 | |
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 | +} |
459 | 981 | }, |
| 982 | +_init:function(){ |
| 983 | +if(this.options.autoOpen){ |
| 984 | +this.open(); |
| 985 | +} |
| 986 | +}, |
460 | 987 | |
461 | | -_mouseMove:function(event){ |
| 988 | +destroy:function(){ |
| 989 | +var self=this; |
462 | 990 | |
463 | | -if($.browser.msie&&!event.button){ |
464 | | -return this._mouseUp(event); |
| 991 | +if(self.overlay){ |
| 992 | +self.overlay.destroy(); |
465 | 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(); |
466 | 1001 | |
467 | | -if(this._mouseStarted){ |
468 | | -this._mouseDrag(event); |
469 | | -return event.preventDefault(); |
| 1002 | +if(self.originalTitle){ |
| 1003 | +self.element.attr('title',self.originalTitle); |
470 | 1004 | } |
471 | 1005 | |
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; |
476 | 1019 | } |
477 | 1020 | |
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; |
479 | 1051 | }, |
480 | 1052 | |
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 | +}, |
485 | 1056 | |
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); |
490 | 1067 | } |
491 | 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 | +} |
| 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); |
492 | 1117 | 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; |
493 | 1138 | }, |
494 | 1139 | |
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' |
500 | 1148 | ); |
501 | | -}, |
502 | 1149 | |
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 | +} |
505 | 1170 | }, |
506 | 1171 | |
| 1172 | +_makeDraggable:function(){ |
| 1173 | +var self=this, |
| 1174 | +options=self.options, |
| 1175 | +doc=$(document), |
| 1176 | +heightBeforeDrag; |
507 | 1177 | |
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 |
512 | 1182 | }; |
| 1183 | +} |
513 | 1184 | |
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 |
518 | 1225 | }; |
| 1226 | +} |
519 | 1227 | |
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 | +}, |
521 | 1255 | |
| 1256 | +_minHeight:function(){ |
| 1257 | +var options=this.options; |
522 | 1258 | |
| 1259 | +if(options.height==='auto'){ |
| 1260 | +return options.minHeight; |
| 1261 | +}else{ |
| 1262 | +return Math.min(options.minHeight,options.height); |
| 1263 | +} |
| 1264 | +}, |
523 | 1265 | |
| 1266 | +_position:function(position){ |
| 1267 | +var myAt=[], |
| 1268 | +offset=[0,0], |
| 1269 | +isVisible; |
524 | 1270 | |
| 1271 | +position=position||$.ui.dialog.prototype.options.position; |
525 | 1272 | |
526 | 1273 | |
527 | 1274 | |
528 | 1275 | |
529 | 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 | +} |
530 | 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 | +} |
531 | 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 | +} |
532 | 1306 | |
| 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||' ')); |
| 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 | + |
533 | 1655 | (function($){ |
534 | 1656 | |
535 | | -$.extend($.ui,{datepicker:{version:"1.7.1"}}); |
| 1657 | +$.extend($.ui,{datepicker:{version:"1.8.2"}}); |
536 | 1658 | |
537 | 1659 | var PROP_NAME='datepicker'; |
| 1660 | +var dpuuid=new Date().getTime(); |
538 | 1661 | |
539 | 1662 | |
540 | 1663 | |
— | — | @@ -568,14 +1691,17 @@ |
569 | 1692 | dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], |
570 | 1693 | dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], |
571 | 1694 | dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'], |
| 1695 | +weekHeader:'Wk', |
572 | 1696 | dateFormat:'mm/dd/yy', |
573 | 1697 | firstDay:0, |
574 | | -isRTL:false |
| 1698 | +isRTL:false, |
| 1699 | +showMonthAfterYear:false, |
| 1700 | +yearSuffix:'' |
575 | 1701 | }; |
576 | 1702 | this._defaults={ |
577 | 1703 | showOn:'focus', |
578 | 1704 | |
579 | | -showAnim:'show', |
| 1705 | +showAnim:'fadeIn', |
580 | 1706 | showOptions:{}, |
581 | 1707 | defaultDate:null, |
582 | 1708 | |
— | — | @@ -589,10 +1715,12 @@ |
590 | 1716 | gotoCurrent:false, |
591 | 1717 | changeMonth:false, |
592 | 1718 | changeYear:false, |
593 | | -showMonthAfterYear:false, |
594 | | -yearRange:'-10:+10', |
| 1719 | +yearRange:'c-10:c+10', |
595 | 1720 | |
| 1721 | + |
596 | 1722 | showOtherMonths:false, |
| 1723 | +selectOtherMonths:false, |
| 1724 | +showWeek:false, |
597 | 1725 | calculateWeek:this.iso8601Week, |
598 | 1726 | |
599 | 1727 | shortYearCutoff:'+10', |
— | — | @@ -600,7 +1728,7 @@ |
601 | 1729 | |
602 | 1730 | minDate:null, |
603 | 1731 | maxDate:null, |
604 | | -duration:'normal', |
| 1732 | +duration:'fast', |
605 | 1733 | beforeShowDay:null, |
606 | 1734 | |
607 | 1735 | |
— | — | @@ -616,7 +1744,8 @@ |
617 | 1745 | altField:'', |
618 | 1746 | altFormat:'', |
619 | 1747 | constrainInput:true, |
620 | | -showButtonPanel:false |
| 1748 | +showButtonPanel:false, |
| 1749 | +autoSize:false |
621 | 1750 | }; |
622 | 1751 | $.extend(this._defaults,this.regional['']); |
623 | 1752 | 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 @@ |
634 | 1763 | }, |
635 | 1764 | |
636 | 1765 | |
| 1766 | +_widgetDatepicker:function(){ |
| 1767 | +return this.dpDiv; |
| 1768 | +}, |
637 | 1769 | |
638 | 1770 | |
| 1771 | + |
| 1772 | + |
639 | 1773 | setDefaults:function(settings){ |
640 | 1774 | extendRemove(this._defaults,settings||{}); |
641 | 1775 | return this; |
— | — | @@ -659,8 +1793,10 @@ |
660 | 1794 | } |
661 | 1795 | var nodeName=target.nodeName.toLowerCase(); |
662 | 1796 | 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 | +} |
665 | 1801 | var inst=this._newInst($(target),inline); |
666 | 1802 | inst.settings=$.extend({},settings||{},inlineSettings||{}); |
667 | 1803 | if(nodeName=='input'){ |
— | — | @@ -672,7 +1808,7 @@ |
673 | 1809 | |
674 | 1810 | |
675 | 1811 | _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'); |
677 | 1813 | return{id:id,input:target, |
678 | 1814 | selectedDay:0,selectedMonth:0,selectedYear:0, |
679 | 1815 | drawMonth:0,drawYear:0, |
— | — | @@ -684,13 +1820,35 @@ |
685 | 1821 | |
686 | 1822 | _connectDatepicker:function(target,inst){ |
687 | 1823 | var input=$(target); |
| 1824 | +inst.append=$([]); |
688 | 1825 | inst.trigger=$([]); |
689 | 1826 | if(input.hasClass(this.markerClassName)) |
690 | 1827 | 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){ |
691 | 1842 | var appendText=this._get(inst,'appendText'); |
692 | 1843 | 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(); |
695 | 1853 | var showOn=this._get(inst,'showOn'); |
696 | 1854 | if(showOn=='focus'||showOn=='both') |
697 | 1855 | input.focus(this._showDatepicker); |
— | — | @@ -705,23 +1863,42 @@ |
706 | 1864 | {src:buttonImage,alt:buttonText,title:buttonText}))); |
707 | 1865 | input[isRTL?'before':'after'](inst.trigger); |
708 | 1866 | inst.trigger.click(function(){ |
709 | | -if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target) |
| 1867 | +if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0]) |
710 | 1868 | $.datepicker._hideDatepicker(); |
711 | 1869 | else |
712 | | -$.datepicker._showDatepicker(target); |
| 1870 | +$.datepicker._showDatepicker(input[0]); |
713 | 1871 | return false; |
714 | 1872 | }); |
715 | 1873 | } |
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); |
723 | 1874 | }, |
724 | 1875 | |
725 | 1876 | |
| 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 | + |
726 | 1903 | _inlineDatepicker:function(target,inst){ |
727 | 1904 | var divSpan=$(target); |
728 | 1905 | if(divSpan.hasClass(this.markerClassName)) |
— | — | @@ -733,7 +1910,7 @@ |
734 | 1911 | return this._get(inst,key); |
735 | 1912 | }); |
736 | 1913 | $.data(target,PROP_NAME,inst); |
737 | | -this._setDate(inst,this._getDefaultDate(inst)); |
| 1914 | +this._setDate(inst,this._getDefaultDate(inst),true); |
738 | 1915 | this._updateDatepicker(inst); |
739 | 1916 | this._updateAlternate(inst); |
740 | 1917 | }, |
— | — | @@ -747,12 +1924,13 @@ |
748 | 1925 | |
749 | 1926 | |
750 | 1927 | |
751 | | -_dialogDatepicker:function(input,dateText,onSelect,settings,pos){ |
| 1928 | +_dialogDatepicker:function(input,date,onSelect,settings,pos){ |
752 | 1929 | var inst=this._dialogInst; |
753 | 1930 | if(!inst){ |
754 | | -var id='dp'+(++this.uuid); |
| 1931 | +this.uuid+=1; |
| 1932 | +var id='dp'+this.uuid; |
755 | 1933 | 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;"/>'); |
757 | 1935 | this._dialogInput.keydown(this._doKeyDown); |
758 | 1936 | $('body').append(this._dialogInput); |
759 | 1937 | inst=this._dialogInst=this._newInst(this._dialogInput,false); |
— | — | @@ -760,12 +1938,13 @@ |
761 | 1939 | $.data(this._dialogInput[0],PROP_NAME,inst); |
762 | 1940 | } |
763 | 1941 | 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); |
765 | 1944 | |
766 | 1945 | this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null); |
767 | 1946 | 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; |
770 | 1949 | var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft; |
771 | 1950 | var scrollY=document.documentElement.scrollTop||document.body.scrollTop; |
772 | 1951 | this._pos= |
— | — | @@ -773,7 +1952,7 @@ |
774 | 1953 | } |
775 | 1954 | |
776 | 1955 | |
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'); |
778 | 1957 | inst.settings.onSelect=onSelect; |
779 | 1958 | this._inDialog=true; |
780 | 1959 | this.dpDiv.addClass(this._dialogClass); |
— | — | @@ -795,12 +1974,13 @@ |
796 | 1975 | var nodeName=target.nodeName.toLowerCase(); |
797 | 1976 | $.removeData(target,PROP_NAME); |
798 | 1977 | if(nodeName=='input'){ |
| 1978 | +inst.append.remove(); |
799 | 1979 | inst.trigger.remove(); |
800 | | -$target.siblings('.'+this._appendClass).remove().end(). |
801 | | -removeClass(this.markerClassName). |
| 1980 | +$target.removeClass(this.markerClassName). |
802 | 1981 | unbind('focus',this._showDatepicker). |
803 | 1982 | unbind('keydown',this._doKeyDown). |
804 | | -unbind('keypress',this._doKeyPress); |
| 1983 | +unbind('keypress',this._doKeyPress). |
| 1984 | +unbind('keyup',this._doKeyUp); |
805 | 1985 | }else if(nodeName=='div'||nodeName=='span') |
806 | 1986 | $target.removeClass(this.markerClassName).empty(); |
807 | 1987 | }, |
— | — | @@ -816,10 +1996,9 @@ |
817 | 1997 | var nodeName=target.nodeName.toLowerCase(); |
818 | 1998 | if(nodeName=='input'){ |
819 | 1999 | target.disabled=false; |
820 | | -inst.trigger.filter("button"). |
| 2000 | +inst.trigger.filter('button'). |
821 | 2001 | each(function(){this.disabled=false;}).end(). |
822 | | -filter("img"). |
823 | | -css({opacity:'1.0',cursor:''}); |
| 2002 | +filter('img').css({opacity:'1.0',cursor:''}); |
824 | 2003 | } |
825 | 2004 | else if(nodeName=='div'||nodeName=='span'){ |
826 | 2005 | var inline=$target.children('.'+this._inlineClass); |
— | — | @@ -840,10 +2019,9 @@ |
841 | 2020 | var nodeName=target.nodeName.toLowerCase(); |
842 | 2021 | if(nodeName=='input'){ |
843 | 2022 | target.disabled=true; |
844 | | -inst.trigger.filter("button"). |
| 2023 | +inst.trigger.filter('button'). |
845 | 2024 | 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'}); |
848 | 2026 | } |
849 | 2027 | else if(nodeName=='div'||nodeName=='span'){ |
850 | 2028 | var inline=$target.children('.'+this._inlineClass); |
— | — | @@ -886,26 +2064,30 @@ |
887 | 2065 | |
888 | 2066 | |
889 | 2067 | |
| 2068 | + |
| 2069 | + |
| 2070 | + |
890 | 2071 | _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 | +} |
891 | 2078 | var settings=name||{}; |
892 | 2079 | if(typeof name=='string'){ |
893 | 2080 | settings={}; |
894 | 2081 | settings[name]=value; |
895 | 2082 | } |
896 | | -var inst=this._getInst(target); |
897 | 2083 | if(inst){ |
898 | 2084 | if(this._curInst==inst){ |
899 | | -this._hideDatepicker(null); |
| 2085 | +this._hideDatepicker(); |
900 | 2086 | } |
| 2087 | +var date=this._getDateDatepicker(target,true); |
901 | 2088 | 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); |
910 | 2092 | this._updateDatepicker(inst); |
911 | 2093 | } |
912 | 2094 | }, |
— | — | @@ -927,11 +2109,10 @@ |
928 | 2110 | |
929 | 2111 | |
930 | 2112 | |
931 | | - |
932 | | -_setDateDatepicker:function(target,date,endDate){ |
| 2113 | +_setDateDatepicker:function(target,date){ |
933 | 2114 | var inst=this._getInst(target); |
934 | 2115 | if(inst){ |
935 | | -this._setDate(inst,date,endDate); |
| 2116 | +this._setDate(inst,date); |
936 | 2117 | this._updateDatepicker(inst); |
937 | 2118 | this._updateAlternate(inst); |
938 | 2119 | } |
— | — | @@ -941,10 +2122,10 @@ |
942 | 2123 | |
943 | 2124 | |
944 | 2125 | |
945 | | -_getDateDatepicker:function(target){ |
| 2126 | +_getDateDatepicker:function(target,noDefault){ |
946 | 2127 | var inst=this._getInst(target); |
947 | 2128 | if(inst&&!inst.inline) |
948 | | -this._setDateFromField(inst); |
| 2129 | +this._setDateFromField(inst,noDefault); |
949 | 2130 | return(inst?this._getDate(inst):null); |
950 | 2131 | }, |
951 | 2132 | |
— | — | @@ -956,17 +2137,18 @@ |
957 | 2138 | inst._keyEvent=true; |
958 | 2139 | if($.datepicker._datepickerShowing) |
959 | 2140 | switch(event.keyCode){ |
960 | | -case 9:$.datepicker._hideDatepicker(null,''); |
| 2141 | +case 9:$.datepicker._hideDatepicker(); |
| 2142 | +handled=false; |
961 | 2143 | 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)); |
964 | 2146 | if(sel[0]) |
965 | 2147 | $.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]); |
966 | 2148 | else |
967 | | -$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration')); |
| 2149 | +$.datepicker._hideDatepicker(); |
968 | 2150 | return false; |
969 | 2151 | break; |
970 | | -case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration')); |
| 2152 | +case 27:$.datepicker._hideDatepicker(); |
971 | 2153 | break; |
972 | 2154 | case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey? |
973 | 2155 | -$.datepicker._get(inst,'stepBigMonths'): |
— | — | @@ -1028,8 +2210,29 @@ |
1029 | 2211 | }, |
1030 | 2212 | |
1031 | 2213 | |
| 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 | +}, |
1032 | 2233 | |
1033 | 2234 | |
| 2235 | + |
| 2236 | + |
1034 | 2237 | _showDatepicker:function(input){ |
1035 | 2238 | input=input.target||input; |
1036 | 2239 | if(input.nodeName.toLowerCase()!='input') |
— | — | @@ -1037,9 +2240,12 @@ |
1038 | 2241 | if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input) |
1039 | 2242 | return; |
1040 | 2243 | var inst=$.datepicker._getInst(input); |
| 2244 | +if($.datepicker._curInst&&$.datepicker._curInst!=inst){ |
| 2245 | +$.datepicker._curInst.dpDiv.stop(true,true); |
| 2246 | +} |
1041 | 2247 | var beforeShow=$.datepicker._get(inst,'beforeShow'); |
1042 | 2248 | extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{})); |
1043 | | -$.datepicker._hideDatepicker(null,''); |
| 2249 | +inst.lastVal=null; |
1044 | 2250 | $.datepicker._lastInput=input; |
1045 | 2251 | $.datepicker._setDateFromField(inst); |
1046 | 2252 | if($.datepicker._inDialog) |
— | — | @@ -1059,7 +2265,6 @@ |
1060 | 2266 | } |
1061 | 2267 | var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]}; |
1062 | 2268 | $.datepicker._pos=null; |
1063 | | -inst.rangeStart=null; |
1064 | 2269 | |
1065 | 2270 | inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'}); |
1066 | 2271 | $.datepicker._updateDatepicker(inst); |
— | — | @@ -1070,34 +2275,36 @@ |
1071 | 2276 | 'static':(isFixed?'fixed':'absolute')),display:'none', |
1072 | 2277 | left:offset.left+'px',top:offset.top+'px'}); |
1073 | 2278 | if(!inst.inline){ |
1074 | | -var showAnim=$.datepicker._get(inst,'showAnim')||'show'; |
| 2279 | +var showAnim=$.datepicker._get(inst,'showAnim'); |
1075 | 2280 | var duration=$.datepicker._get(inst,'duration'); |
1076 | 2281 | var postProcess=function(){ |
1077 | 2282 | $.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()}); |
1081 | 2287 | }; |
| 2288 | +inst.dpDiv.zIndex($(input).zIndex()+1); |
1082 | 2289 | if($.effects&&$.effects[showAnim]) |
1083 | 2290 | inst.dpDiv.show(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess); |
1084 | 2291 | else |
1085 | | -inst.dpDiv[showAnim](duration,postProcess); |
1086 | | -if(duration=='') |
| 2292 | +inst.dpDiv[showAnim||'show']((showAnim?duration:null),postProcess); |
| 2293 | +if(!showAnim||!duration) |
1087 | 2294 | 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(); |
1090 | 2297 | $.datepicker._curInst=inst; |
1091 | 2298 | } |
1092 | 2299 | }, |
1093 | 2300 | |
1094 | 2301 | |
1095 | 2302 | _updateDatepicker:function(inst){ |
1096 | | -var dims={width:inst.dpDiv.width()+4, |
1097 | | -height:inst.dpDiv.height()+4}; |
1098 | 2303 | var self=this; |
| 2304 | +var borders=$.datepicker._getBorders(inst.dpDiv); |
1099 | 2305 | 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()}) |
1102 | 2309 | .end() |
1103 | 2310 | .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') |
1104 | 2311 | .bind('mouseout',function(){ |
— | — | @@ -1120,43 +2327,58 @@ |
1121 | 2328 | var numMonths=this._getNumberOfMonths(inst); |
1122 | 2329 | var cols=numMonths[1]; |
1123 | 2330 | var width=17; |
1124 | | -if(cols>1){ |
| 2331 | +if(cols>1) |
1125 | 2332 | inst.dpDiv.addClass('ui-datepicker-multi-'+cols).css('width',(width*cols)+'em'); |
1126 | | -}else{ |
| 2333 | +else |
1127 | 2334 | inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); |
1128 | | -} |
1129 | 2335 | inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?'add':'remove')+ |
1130 | 2336 | 'Class']('ui-datepicker-multi'); |
1131 | 2337 | inst.dpDiv[(this._get(inst,'isRTL')?'add':'remove')+ |
1132 | 2338 | '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(); |
1135 | 2342 | }, |
1136 | 2343 | |
1137 | 2344 | |
| 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 | + |
1138 | 2356 | _checkOffset:function(inst,offset,isFixed){ |
1139 | 2357 | var dpWidth=inst.dpDiv.outerWidth(); |
1140 | 2358 | var dpHeight=inst.dpDiv.outerHeight(); |
1141 | 2359 | var inputWidth=inst.input?inst.input.outerWidth():0; |
1142 | 2360 | 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(); |
1145 | 2363 | |
1146 | 2364 | offset.left-=(this._get(inst,'isRTL')?(dpWidth-inputWidth):0); |
1147 | 2365 | offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0; |
1148 | 2366 | offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0; |
1149 | 2367 | |
1150 | 2368 | |
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); |
1153 | 2373 | |
1154 | 2374 | return offset; |
1155 | 2375 | }, |
1156 | 2376 | |
1157 | 2377 | |
1158 | 2378 | _findPos:function(obj){ |
| 2379 | +var inst=this._getInst(obj); |
| 2380 | +var isRTL=this._get(inst,'isRTL'); |
1159 | 2381 | while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){ |
1160 | | -obj=obj.nextSibling; |
| 2382 | +obj=obj[isRTL?'previousSibling':'nextSibling']; |
1161 | 2383 | } |
1162 | 2384 | var position=$(obj).offset(); |
1163 | 2385 | return[position.left,position.top]; |
— | — | @@ -1164,29 +2386,24 @@ |
1165 | 2387 | |
1166 | 2388 | |
1167 | 2389 | |
1168 | | - |
1169 | | -_hideDatepicker:function(input,duration){ |
| 2390 | +_hideDatepicker:function(input){ |
1170 | 2391 | var inst=this._curInst; |
1171 | 2392 | if(!inst||(input&&inst!=$.data(input,PROP_NAME))) |
1172 | 2393 | return; |
1173 | | -if(inst.stayOpen) |
1174 | | -this._selectDate('#'+inst.id,this._formatDate(inst, |
1175 | | -inst.currentDay,inst.currentMonth,inst.currentYear)); |
1176 | | -inst.stayOpen=false; |
1177 | 2394 | if(this._datepickerShowing){ |
1178 | | -duration=(duration!=null?duration:this._get(inst,'duration')); |
1179 | 2395 | var showAnim=this._get(inst,'showAnim'); |
| 2396 | +var duration=this._get(inst,'duration'); |
1180 | 2397 | var postProcess=function(){ |
1181 | 2398 | $.datepicker._tidyDialog(inst); |
| 2399 | +this._curInst=null; |
1182 | 2400 | }; |
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); |
1186 | 2403 | 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(); |
1191 | 2408 | var onClose=this._get(inst,'onClose'); |
1192 | 2409 | if(onClose) |
1193 | 2410 | onClose.apply((inst.input?inst.input[0]:null), |
— | — | @@ -1202,7 +2419,6 @@ |
1203 | 2420 | } |
1204 | 2421 | this._inDialog=false; |
1205 | 2422 | } |
1206 | | -this._curInst=null; |
1207 | 2423 | }, |
1208 | 2424 | |
1209 | 2425 | |
— | — | @@ -1215,11 +2431,12 @@ |
1216 | 2432 | if(!$.datepicker._curInst) |
1217 | 2433 | return; |
1218 | 2434 | 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&& |
1220 | 2437 | !$target.hasClass($.datepicker.markerClassName)&& |
1221 | 2438 | !$target.hasClass($.datepicker._triggerClass)&& |
1222 | 2439 | $.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)) |
1223 | | -$.datepicker._hideDatepicker(null,''); |
| 2440 | +$.datepicker._hideDatepicker(); |
1224 | 2441 | }, |
1225 | 2442 | |
1226 | 2443 | |
— | — | @@ -1271,7 +2488,7 @@ |
1272 | 2489 | var target=$(id); |
1273 | 2490 | var inst=this._getInst(target[0]); |
1274 | 2491 | if(inst.input&&inst._selectingMonthYear&&!$.browser.msie) |
1275 | | -inst.input[0].focus(); |
| 2492 | +inst.input.focus(); |
1276 | 2493 | inst._selectingMonthYear=!inst._selectingMonthYear; |
1277 | 2494 | }, |
1278 | 2495 | |
— | — | @@ -1285,24 +2502,14 @@ |
1286 | 2503 | inst.selectedDay=inst.currentDay=$('a',td).html(); |
1287 | 2504 | inst.selectedMonth=inst.currentMonth=month; |
1288 | 2505 | inst.selectedYear=inst.currentYear=year; |
1289 | | -if(inst.stayOpen){ |
1290 | | -inst.endDay=inst.endMonth=inst.endYear=null; |
1291 | | -} |
1292 | 2506 | this._selectDate(id,this._formatDate(inst, |
1293 | 2507 | 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 | | -} |
1299 | 2508 | }, |
1300 | 2509 | |
1301 | 2510 | |
1302 | 2511 | _clearDate:function(id){ |
1303 | 2512 | var target=$(id); |
1304 | 2513 | var inst=this._getInst(target[0]); |
1305 | | -inst.stayOpen=false; |
1306 | | -inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null; |
1307 | 2514 | this._selectDate(target,''); |
1308 | 2515 | }, |
1309 | 2516 | |
— | — | @@ -1321,11 +2528,11 @@ |
1322 | 2529 | inst.input.trigger('change'); |
1323 | 2530 | if(inst.inline) |
1324 | 2531 | this._updateDatepicker(inst); |
1325 | | -else if(!inst.stayOpen){ |
1326 | | -this._hideDatepicker(null,this._get(inst,'duration')); |
| 2532 | +else{ |
| 2533 | +this._hideDatepicker(); |
1327 | 2534 | this._lastInput=inst.input[0]; |
1328 | 2535 | if(typeof(inst.input[0])!='object') |
1329 | | -inst.input[0].focus(); |
| 2536 | +inst.input.focus(); |
1330 | 2537 | this._lastInput=null; |
1331 | 2538 | } |
1332 | 2539 | }, |
— | — | @@ -1336,7 +2543,7 @@ |
1337 | 2544 | if(altField){ |
1338 | 2545 | var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat'); |
1339 | 2546 | var date=this._getDate(inst); |
1340 | | -dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst)); |
| 2547 | +var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst)); |
1341 | 2548 | $(altField).each(function(){$(this).val(dateStr);}); |
1342 | 2549 | } |
1343 | 2550 | }, |
— | — | @@ -1353,20 +2560,13 @@ |
1354 | 2561 | |
1355 | 2562 | |
1356 | 2563 | 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; |
1371 | 2571 | }, |
1372 | 2572 | |
1373 | 2573 | |
— | — | @@ -1407,34 +2607,25 @@ |
1408 | 2608 | |
1409 | 2609 | var getNumber=function(match){ |
1410 | 2610 | 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) |
1420 | 2616 | throw'Missing number at position '+iValue; |
1421 | | -return num; |
| 2617 | +iValue+=num[0].length; |
| 2618 | +return parseInt(num[0],10); |
1422 | 2619 | }; |
1423 | 2620 | |
1424 | 2621 | var getName=function(match,shortNames,longNames){ |
1425 | 2622 | 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; |
1435 | 2626 | return i+1; |
1436 | | -size--; |
1437 | 2627 | } |
1438 | | -throw'Unknown name at position '+iInit; |
| 2628 | +} |
| 2629 | +throw'Unknown name at position '+iValue; |
1439 | 2630 | }; |
1440 | 2631 | |
1441 | 2632 | var checkLiteral=function(){ |
— | — | @@ -1475,6 +2666,12 @@ |
1476 | 2667 | month=date.getMonth()+1; |
1477 | 2668 | day=date.getDate(); |
1478 | 2669 | 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; |
1479 | 2676 | case"'": |
1480 | 2677 | if(lookAhead("'")) |
1481 | 2678 | checkLiteral(); |
— | — | @@ -1517,9 +2714,12 @@ |
1518 | 2715 | RFC_1123:'D, d M yy', |
1519 | 2716 | RFC_2822:'D, d M yy', |
1520 | 2717 | RSS:'D, d M y', |
| 2718 | +TICKS:'!', |
1521 | 2719 | TIMESTAMP:'@', |
1522 | 2720 | W3C:'yy-mm-dd', |
1523 | 2721 | |
| 2722 | +_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+ |
| 2723 | +Math.floor(1970/400))*24*60*60*10000000), |
1524 | 2724 | |
1525 | 2725 | |
1526 | 2726 | |
— | — | @@ -1546,6 +2746,8 @@ |
1547 | 2747 | |
1548 | 2748 | |
1549 | 2749 | |
| 2750 | + |
| 2751 | + |
1550 | 2752 | formatDate:function(format,date,settings){ |
1551 | 2753 | if(!date) |
1552 | 2754 | return''; |
— | — | @@ -1590,10 +2792,8 @@ |
1591 | 2793 | output+=formatName('D',date.getDay(),dayNamesShort,dayNames); |
1592 | 2794 | break; |
1593 | 2795 | 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); |
1598 | 2798 | break; |
1599 | 2799 | case'm': |
1600 | 2800 | output+=formatNumber('m',date.getMonth()+1,2); |
— | — | @@ -1608,6 +2808,9 @@ |
1609 | 2809 | case'@': |
1610 | 2810 | output+=date.getTime(); |
1611 | 2811 | break; |
| 2812 | +case'!': |
| 2813 | +output+=date.getTime()*10000+this._ticksTo1970; |
| 2814 | +break; |
1612 | 2815 | case"'": |
1613 | 2816 | if(lookAhead("'")) |
1614 | 2817 | output+="'"; |
— | — | @@ -1625,6 +2828,13 @@ |
1626 | 2829 | _possibleChars:function(format){ |
1627 | 2830 | var chars=''; |
1628 | 2831 | 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 | +}; |
1629 | 2839 | for(var iFormat=0;iFormat<format.length;iFormat++) |
1630 | 2840 | if(literal) |
1631 | 2841 | if(format.charAt(iFormat)=="'"&&!lookAhead("'")) |
— | — | @@ -1657,17 +2867,20 @@ |
1658 | 2868 | }, |
1659 | 2869 | |
1660 | 2870 | |
1661 | | -_setDateFromField:function(inst){ |
| 2871 | +_setDateFromField:function(inst,noDefault){ |
| 2872 | +if(inst.input.val()==inst.lastVal){ |
| 2873 | +return; |
| 2874 | +} |
1662 | 2875 | 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); |
1666 | 2879 | var settings=this._getFormatConfig(inst); |
1667 | 2880 | try{ |
1668 | 2881 | date=this.parseDate(dateFormat,dates,settings)||defaultDate; |
1669 | 2882 | }catch(event){ |
1670 | 2883 | this.log(event); |
1671 | | -date=defaultDate; |
| 2884 | +dates=(noDefault?'':dates); |
1672 | 2885 | } |
1673 | 2886 | inst.selectedDay=date.getDate(); |
1674 | 2887 | inst.drawMonth=inst.selectedMonth=date.getMonth(); |
— | — | @@ -1680,23 +2893,27 @@ |
1681 | 2894 | |
1682 | 2895 | |
1683 | 2896 | _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())); |
1690 | 2899 | }, |
1691 | 2900 | |
1692 | 2901 | |
1693 | | -_determineDate:function(date,defaultDate){ |
| 2902 | +_determineDate:function(inst,date,defaultDate){ |
1694 | 2903 | var offsetNumeric=function(offset){ |
1695 | 2904 | var date=new Date(); |
1696 | 2905 | date.setDate(date.getDate()+offset); |
1697 | 2906 | return date; |
1698 | 2907 | }; |
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(); |
1701 | 2918 | var year=date.getFullYear(); |
1702 | 2919 | var month=date.getMonth(); |
1703 | 2920 | var day=date.getDate(); |
— | — | @@ -1710,19 +2927,18 @@ |
1711 | 2928 | day+=parseInt(matches[1],10)*7;break; |
1712 | 2929 | case'm':case'M': |
1713 | 2930 | month+=parseInt(matches[1],10); |
1714 | | -day=Math.min(day,getDaysInMonth(year,month)); |
| 2931 | +day=Math.min(day,$.datepicker._getDaysInMonth(year,month)); |
1715 | 2932 | break; |
1716 | 2933 | case'y':case'Y': |
1717 | 2934 | year+=parseInt(matches[1],10); |
1718 | | -day=Math.min(day,getDaysInMonth(year,month)); |
| 2935 | +day=Math.min(day,$.datepicker._getDaysInMonth(year,month)); |
1719 | 2936 | break; |
1720 | 2937 | } |
1721 | 2938 | matches=pattern.exec(offset); |
1722 | 2939 | } |
1723 | 2940 | return new Date(year,month,day); |
1724 | 2941 | }; |
1725 | | -date=(date==null?defaultDate: |
1726 | | -(typeof date=='string'?offsetString(date,this._getDaysInMonth): |
| 2942 | +date=(date==null?defaultDate:(typeof date=='string'?offsetString(date): |
1727 | 2943 | (typeof date=='number'?(isNaN(date)?defaultDate:offsetNumeric(date)):date))); |
1728 | 2944 | date=(date&&date.toString()=='Invalid Date'?defaultDate:date); |
1729 | 2945 | if(date){ |
— | — | @@ -1747,15 +2963,15 @@ |
1748 | 2964 | }, |
1749 | 2965 | |
1750 | 2966 | |
1751 | | -_setDate:function(inst,date,endDate){ |
| 2967 | +_setDate:function(inst,date,noChange){ |
1752 | 2968 | var clear=!(date); |
1753 | 2969 | var origMonth=inst.selectedMonth; |
1754 | 2970 | var origYear=inst.selectedYear; |
1755 | | -date=this._determineDate(date,new Date()); |
| 2971 | +date=this._restrictMinMax(inst,this._determineDate(inst,date,new Date())); |
1756 | 2972 | inst.selectedDay=inst.currentDay=date.getDate(); |
1757 | 2973 | inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth(); |
1758 | 2974 | 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) |
1760 | 2976 | this._notifyChange(inst); |
1761 | 2977 | this._adjustInstDate(inst); |
1762 | 2978 | if(inst.input){ |
— | — | @@ -1783,11 +2999,10 @@ |
1784 | 3000 | var numMonths=this._getNumberOfMonths(inst); |
1785 | 3001 | var showCurrentAtPos=this._get(inst,'showCurrentAtPos'); |
1786 | 3002 | var stepMonths=this._get(inst,'stepMonths'); |
1787 | | -var stepBigMonths=this._get(inst,'stepBigMonths'); |
1788 | 3003 | var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1); |
1789 | 3004 | var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9): |
1790 | 3005 | new Date(inst.currentYear,inst.currentMonth,inst.currentDay))); |
1791 | | -var minDate=this._getMinMaxDate(inst,'min',true); |
| 3006 | +var minDate=this._getMinMaxDate(inst,'min'); |
1792 | 3007 | var maxDate=this._getMinMaxDate(inst,'max'); |
1793 | 3008 | var drawMonth=inst.drawMonth-showCurrentAtPos; |
1794 | 3009 | var drawYear=inst.drawYear; |
— | — | @@ -1797,7 +3012,7 @@ |
1798 | 3013 | } |
1799 | 3014 | if(maxDate){ |
1800 | 3015 | 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())); |
1802 | 3017 | maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw); |
1803 | 3018 | while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){ |
1804 | 3019 | drawMonth--; |
— | — | @@ -1814,7 +3029,8 @@ |
1815 | 3030 | this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)), |
1816 | 3031 | this._getFormatConfig(inst))); |
1817 | 3032 | 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\');"'+ |
1819 | 3035 | ' title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>': |
1820 | 3036 | (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>')); |
1821 | 3037 | var nextText=this._get(inst,'nextText'); |
— | — | @@ -1822,19 +3038,23 @@ |
1823 | 3039 | this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)), |
1824 | 3040 | this._getFormatConfig(inst))); |
1825 | 3041 | 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\');"'+ |
1827 | 3044 | ' title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>': |
1828 | 3045 | (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>')); |
1829 | 3046 | var currentText=this._get(inst,'currentText'); |
1830 | 3047 | var gotoDate=(this._get(inst,'gotoCurrent')&&inst.currentDay?currentDate:today); |
1831 | 3048 | currentText=(!navigationAsDateFormat?currentText: |
1832 | 3049 | 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>':''); |
1834 | 3052 | 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+'\');"'+ |
1836 | 3055 | '>'+currentText+'</button>':'')+(isRTL?'':controls)+'</div>':''; |
1837 | 3056 | var firstDay=parseInt(this._get(inst,'firstDay'),10); |
1838 | 3057 | firstDay=(isNaN(firstDay)?0:firstDay); |
| 3058 | +var showWeek=this._get(inst,'showWeek'); |
1839 | 3059 | var dayNames=this._get(inst,'dayNames'); |
1840 | 3060 | var dayNamesShort=this._get(inst,'dayNamesShort'); |
1841 | 3061 | var dayNamesMin=this._get(inst,'dayNamesMin'); |
— | — | @@ -1842,9 +3062,8 @@ |
1843 | 3063 | var monthNamesShort=this._get(inst,'monthNamesShort'); |
1844 | 3064 | var beforeShowDay=this._get(inst,'beforeShowDay'); |
1845 | 3065 | var showOtherMonths=this._get(inst,'showOtherMonths'); |
| 3066 | +var selectOtherMonths=this._get(inst,'selectOtherMonths'); |
1846 | 3067 | 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; |
1849 | 3068 | var defaultDate=this._getDefaultDate(inst); |
1850 | 3069 | var html=''; |
1851 | 3070 | for(var row=0;row<numMonths[0];row++){ |
— | — | @@ -1854,11 +3073,14 @@ |
1855 | 3074 | var cornerClass=' ui-corner-all'; |
1856 | 3075 | var calender=''; |
1857 | 3076 | if(isMultiMonth){ |
1858 | | -calender+='<div class="ui-datepicker-group ui-datepicker-group-'; |
| 3077 | +calender+='<div class="ui-datepicker-group'; |
| 3078 | +if(numMonths[1]>1) |
1859 | 3079 | 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; |
1863 | 3085 | } |
1864 | 3086 | calender+='">'; |
1865 | 3087 | } |
— | — | @@ -1866,10 +3088,10 @@ |
1867 | 3089 | (/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):'')+ |
1868 | 3090 | (/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):'')+ |
1869 | 3091 | this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate, |
1870 | | -selectedDate,row>0||col>0,monthNames,monthNamesShort)+ |
| 3092 | +row>0||col>0,monthNames,monthNamesShort)+ |
1871 | 3093 | '</div><table class="ui-datepicker-calendar"><thead>'+ |
1872 | 3094 | '<tr>'; |
1873 | | -var thead=''; |
| 3095 | +var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,'weekHeader')+'</th>':''); |
1874 | 3096 | for(var dow=0;dow<7;dow++){ |
1875 | 3097 | var day=(dow+firstDay)%7; |
1876 | 3098 | thead+='<th'+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':'')+'>'+ |
— | — | @@ -1884,12 +3106,13 @@ |
1885 | 3107 | var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays)); |
1886 | 3108 | for(var dRow=0;dRow<numRows;dRow++){ |
1887 | 3109 | calender+='<tr>'; |
1888 | | -var tbody=''; |
| 3110 | +var tbody=(!showWeek?'':'<td class="ui-datepicker-week-col">'+ |
| 3111 | +this._get(inst,'calculateWeek')(printDate)+'</td>'); |
1889 | 3112 | for(var dow=0;dow<7;dow++){ |
1890 | 3113 | var daySettings=(beforeShowDay? |
1891 | 3114 | beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,'']); |
1892 | 3115 | var otherMonth=(printDate.getMonth()!=drawMonth); |
1893 | | -var unselectable=otherMonth||!daySettings[0]|| |
| 3116 | +var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]|| |
1894 | 3117 | (minDate&&printDate<minDate)||(maxDate&&printDate>maxDate); |
1895 | 3118 | tbody+='<td class="'+ |
1896 | 3119 | ((dow+firstDay+6)%7>=5?' ui-datepicker-week-end':'')+ |
— | — | @@ -1900,17 +3123,16 @@ |
1901 | 3124 | ' '+this._dayOverClass:'')+ |
1902 | 3125 | (unselectable?' '+this._unselectableClass+' ui-state-disabled':'')+ |
1903 | 3126 | (otherMonth&&!showOtherMonths?'':' '+daySettings[1]+ |
1904 | | -(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()? |
1905 | | -' '+this._currentClass:'')+ |
| 3127 | +(printDate.getTime()==currentDate.getTime()?' '+this._currentClass:'')+ |
1906 | 3128 | (printDate.getTime()==today.getTime()?' ui-datepicker-today':''))+'"'+ |
1907 | 3129 | ((!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():' '): |
| 3130 | +(unselectable?'':' onclick="DP_jQuery_'+dpuuid+'.datepicker._selectDay(\'#'+ |
| 3131 | +inst.id+'\','+printDate.getMonth()+','+printDate.getFullYear()+', this);return false;"')+'>'+ |
| 3132 | +(otherMonth&&!showOtherMonths?' ': |
1911 | 3133 | (unselectable?'<span class="ui-state-default">'+printDate.getDate()+'</span>':'<a class="ui-state-default'+ |
1912 | 3134 | (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':'')+ |
1915 | 3137 | '" href="#">'+printDate.getDate()+'</a>'))+'</td>'; |
1916 | 3138 | printDate.setDate(printDate.getDate()+1); |
1917 | 3139 | printDate=this._daylightSavingAdjust(printDate); |
— | — | @@ -1936,8 +3158,7 @@ |
1937 | 3159 | |
1938 | 3160 | |
1939 | 3161 | _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){ |
1942 | 3163 | var changeMonth=this._get(inst,'changeMonth'); |
1943 | 3164 | var changeYear=this._get(inst,'changeYear'); |
1944 | 3165 | var showMonthAfterYear=this._get(inst,'showMonthAfterYear'); |
— | — | @@ -1945,13 +3166,13 @@ |
1946 | 3167 | var monthHtml=''; |
1947 | 3168 | |
1948 | 3169 | if(secondary||!changeMonth) |
1949 | | -monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span> '; |
| 3170 | +monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span>'; |
1950 | 3171 | else{ |
1951 | 3172 | var inMinYear=(minDate&&minDate.getFullYear()==drawYear); |
1952 | 3173 | var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear); |
1953 | 3174 | 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+'\');"'+ |
1956 | 3177 | '>'; |
1957 | 3178 | for(var month=0;month<12;month++){ |
1958 | 3179 | if((!inMinYear||month>=minDate.getMonth())&& |
— | — | @@ -1963,30 +3184,27 @@ |
1964 | 3185 | monthHtml+='</select>'; |
1965 | 3186 | } |
1966 | 3187 | if(!showMonthAfterYear) |
1967 | | -html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?' ':''); |
| 3188 | +html+=monthHtml+(secondary||!(changeMonth&&changeYear)?' ':''); |
1968 | 3189 | |
1969 | 3190 | if(secondary||!changeYear) |
1970 | 3191 | html+='<span class="ui-datepicker-year">'+drawYear+'</span>'; |
1971 | 3192 | else{ |
1972 | 3193 | |
1973 | 3194 | 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]||'')); |
1986 | 3204 | year=(minDate?Math.max(year,minDate.getFullYear()):year); |
1987 | 3205 | endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear); |
1988 | 3206 | 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+'\');"'+ |
1991 | 3209 | '>'; |
1992 | 3210 | for(;year<=endYear;year++){ |
1993 | 3211 | html+='<option value="'+year+'"'+ |
— | — | @@ -1995,8 +3213,9 @@ |
1996 | 3214 | } |
1997 | 3215 | html+='</select>'; |
1998 | 3216 | } |
| 3217 | +html+=this._get(inst,'yearSuffix'); |
1999 | 3218 | if(showMonthAfterYear) |
2000 | | -html+=(secondary||changeMonth||changeYear?' ':'')+monthHtml; |
| 3219 | +html+=(secondary||!(changeMonth&&changeYear)?' ':'')+monthHtml; |
2001 | 3220 | html+='</div>'; |
2002 | 3221 | return html; |
2003 | 3222 | }, |
— | — | @@ -2007,12 +3226,8 @@ |
2008 | 3227 | var month=inst.drawMonth+(period=='M'?offset:0); |
2009 | 3228 | var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+ |
2010 | 3229 | (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))); |
2017 | 3232 | inst.selectedDay=date.getDate(); |
2018 | 3233 | inst.drawMonth=inst.selectedMonth=date.getMonth(); |
2019 | 3234 | inst.drawYear=inst.selectedYear=date.getFullYear(); |
— | — | @@ -2021,6 +3236,15 @@ |
2022 | 3237 | }, |
2023 | 3238 | |
2024 | 3239 | |
| 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 | + |
2025 | 3249 | _notifyChange:function(inst){ |
2026 | 3250 | var onChange=this._get(inst,'onChangeMonthYear'); |
2027 | 3251 | if(onChange) |
— | — | @@ -2035,10 +3259,8 @@ |
2036 | 3260 | }, |
2037 | 3261 | |
2038 | 3262 | |
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); |
2043 | 3265 | }, |
2044 | 3266 | |
2045 | 3267 | |
— | — | @@ -2054,8 +3276,8 @@ |
2055 | 3277 | |
2056 | 3278 | _canAdjustMonth:function(inst,offset,curYear,curMonth){ |
2057 | 3279 | 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)); |
2060 | 3282 | if(offset<0) |
2061 | 3283 | date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth())); |
2062 | 3284 | return this._isInRange(inst,date); |
— | — | @@ -2063,13 +3285,10 @@ |
2064 | 3286 | |
2065 | 3287 | |
2066 | 3288 | _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'); |
2072 | 3290 | 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())); |
2074 | 3293 | }, |
2075 | 3294 | |
2076 | 3295 | |
— | — | @@ -2125,9 +3344,12 @@ |
2126 | 3345 | } |
2127 | 3346 | |
2128 | 3347 | 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')) |
2130 | 3349 | return $.datepicker['_'+options+'Datepicker']. |
2131 | 3350 | 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)); |
2132 | 3354 | return this.each(function(){ |
2133 | 3355 | typeof options=='string'? |
2134 | 3356 | $.datepicker['_'+options+'Datepicker']. |
— | — | @@ -2139,11 +3361,11 @@ |
2140 | 3362 | $.datepicker=new Datepicker(); |
2141 | 3363 | $.datepicker.initialized=false; |
2142 | 3364 | $.datepicker.uuid=new Date().getTime(); |
2143 | | -$.datepicker.version="1.7.1"; |
| 3365 | +$.datepicker.version="1.8.2"; |
2144 | 3366 | |
2145 | 3367 | |
2146 | 3368 | |
2147 | | -window.DP_jQuery=$; |
| 3369 | +window['DP_jQuery_'+dpuuid]=$; |
2148 | 3370 | |
2149 | 3371 | })(jQuery); |
2150 | 3372 | |
— | — | @@ -2158,17 +3380,16 @@ |
2159 | 3381 | |
2160 | 3382 | |
2161 | 3383 | |
| 3384 | + |
2162 | 3385 | (function($){ |
2163 | 3386 | |
2164 | 3387 | $.widget("ui.progressbar",{ |
2165 | | - |
2166 | | -_init:function(){ |
2167 | | - |
| 3388 | +options:{ |
| 3389 | +value:0 |
| 3390 | +}, |
| 3391 | +_create:function(){ |
2168 | 3392 | 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") |
2173 | 3394 | .attr({ |
2174 | 3395 | role:"progressbar", |
2175 | 3396 | "aria-valuemin":this._valueMin(), |
— | — | @@ -2176,85 +3397,81 @@ |
2177 | 3398 | "aria-valuenow":this._value() |
2178 | 3399 | }); |
2179 | 3400 | |
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); |
2181 | 3403 | |
2182 | 3404 | this._refreshValue(); |
2183 | | - |
2184 | 3405 | }, |
2185 | 3406 | |
2186 | 3407 | destroy:function(){ |
2187 | | - |
2188 | 3408 | 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") |
2193 | 3410 | .removeAttr("role") |
2194 | 3411 | .removeAttr("aria-valuemin") |
2195 | 3412 | .removeAttr("aria-valuemax") |
2196 | | -.removeAttr("aria-valuenow") |
2197 | | -.removeData("progressbar") |
2198 | | -.unbind(".progressbar"); |
| 3413 | +.removeAttr("aria-valuenow"); |
2199 | 3414 | |
2200 | 3415 | this.valueDiv.remove(); |
2201 | 3416 | |
2202 | | -$.widget.prototype.destroy.apply(this,arguments); |
2203 | | - |
| 3417 | +$.Widget.prototype.destroy.apply(this,arguments); |
2204 | 3418 | }, |
2205 | 3419 | |
2206 | 3420 | value:function(newValue){ |
2207 | | -arguments.length&&this._setData("value",newValue); |
| 3421 | +if(newValue===undefined){ |
2208 | 3422 | return this._value(); |
| 3423 | +} |
| 3424 | + |
| 3425 | +this._setOption("value",newValue); |
| 3426 | +return this; |
2209 | 3427 | }, |
2210 | 3428 | |
2211 | | -_setData:function(key,value){ |
2212 | | - |
| 3429 | +_setOption:function(key,value){ |
2213 | 3430 | switch(key){ |
2214 | | -case'value': |
| 3431 | +case"value": |
2215 | 3432 | this.options.value=value; |
2216 | 3433 | this._refreshValue(); |
2217 | | -this._trigger('change',null,{}); |
| 3434 | +this._trigger("change"); |
2218 | 3435 | break; |
2219 | 3436 | } |
2220 | 3437 | |
2221 | | -$.widget.prototype._setData.apply(this,arguments); |
2222 | | - |
| 3438 | +$.Widget.prototype._setOption.apply(this,arguments); |
2223 | 3439 | }, |
2224 | 3440 | |
2225 | 3441 | _value:function(){ |
2226 | | - |
2227 | 3442 | var val=this.options.value; |
2228 | | -if(val<this._valueMin())val=this._valueMin(); |
2229 | | -if(val>this._valueMax())val=this._valueMax(); |
2230 | 3443 | |
| 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 | + |
2231 | 3454 | return val; |
2232 | | - |
2233 | 3455 | }, |
2234 | 3456 | |
2235 | 3457 | _valueMin:function(){ |
2236 | | -var valueMin=0; |
2237 | | -return valueMin; |
| 3458 | +return 0; |
2238 | 3459 | }, |
2239 | 3460 | |
2240 | 3461 | _valueMax:function(){ |
2241 | | -var valueMax=100; |
2242 | | -return valueMax; |
| 3462 | +return 100; |
2243 | 3463 | }, |
2244 | 3464 | |
2245 | 3465 | _refreshValue:function(){ |
2246 | 3466 | 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+"%"); |
2249 | 3470 | this.element.attr("aria-valuenow",value); |
2250 | 3471 | } |
2251 | | - |
2252 | 3472 | }); |
2253 | 3473 | |
2254 | 3474 | $.extend($.ui.progressbar,{ |
2255 | | -version:"1.7.1", |
2256 | | -defaults:{ |
2257 | | -value:0 |
2258 | | -} |
| 3475 | +version:"1.8.2" |
2259 | 3476 | }); |
2260 | 3477 | |
2261 | 3478 | })(jQuery); |
— | — | @@ -7912,7 +9129,9 @@ |
7913 | 9130 | |
7914 | 9131 | json=$j(doc.body).find('pre').text(); |
7915 | 9132 | mw.log('iframe:json::'+json); |
7916 | | -if(json){ |
| 9133 | + |
| 9134 | + |
| 9135 | +if(json&&json.substring(0,5)!=='<?xml'){ |
7917 | 9136 | response=window["eval"]("( "+json+" )"); |
7918 | 9137 | }else{ |
7919 | 9138 | response={}; |
— | — | @@ -9210,6 +10429,7 @@ |
9211 | 10430 | |
9212 | 10431 | |
9213 | 10432 | remove:function(){ |
| 10433 | +this.state='aborted'; |
9214 | 10434 | if(this.details&&this.details.div){ |
9215 | 10435 | this.details.div.remove(); |
9216 | 10436 | } |
— | — | @@ -9251,6 +10471,9 @@ |
9252 | 10472 | |
9253 | 10473 | setTransported:function(result){ |
9254 | 10474 | var _this=this; |
| 10475 | +if(_this.state=='aborted'){ |
| 10476 | +return; |
| 10477 | +} |
9255 | 10478 | |
9256 | 10479 | if(result.upload&&result.upload.imageinfo){ |
9257 | 10480 | |
— | — | @@ -9462,10 +10685,11 @@ |
9463 | 10686 | _this.$fileInputCtrl=$j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>') |
9464 | 10687 | .change(function(){_this.fileChanged();}); |
9465 | 10688 | |
| 10689 | +_this.$indicator=$j('<div class="mwe-upwiz-file-indicator"></div>'); |
9466 | 10690 | |
9467 | 10691 | 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">' |
9470 | 10694 | +'<div class="mwe-upwiz-file-preview"/>' |
9471 | 10695 | +'<div class="mwe-upwiz-file-texts">' |
9472 | 10696 | +'<div class="mwe-upwiz-visible-file-filename-text"/>' |
— | — | @@ -9551,16 +10775,22 @@ |
9552 | 10776 | |
9553 | 10777 | |
9554 | 10778 | showIndicator:function(statusClass){ |
9555 | | -var $indicator=$j(this.div).find('.mwe-upwiz-file-indicator'); |
| 10779 | +this.clearIndicator(); |
9556 | 10780 | |
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){ |
9558 | 10791 | if(className.match(/^mwe-upwiz-status/)){ |
9559 | | -$indicator.removeClass(className); |
| 10792 | +_this.$indicator.removeClass(className); |
9560 | 10793 | } |
9561 | 10794 | }); |
9562 | | - |
9563 | | -$indicator.addClass('mwe-upwiz-status-'+statusClass) |
9564 | | -.css('visibility','visible'); |
9565 | 10795 | }, |
9566 | 10796 | |
9567 | 10797 | |
— | — | @@ -9671,12 +10901,14 @@ |
9672 | 10902 | .width($covered.outerWidth()) |
9673 | 10903 | .height($covered.outerHeight()); |
9674 | 10904 | |
| 10905 | +this.fileCtrlContainer.css({'z-index':1}); |
9675 | 10906 | |
9676 | 10907 | |
9677 | 10908 | |
| 10909 | + |
9678 | 10910 | this.$fileInputCtrl.css({ |
9679 | 10911 | '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', |
9681 | 10913 | }); |
9682 | 10914 | |
9683 | 10915 | |
— | — | @@ -10708,21 +11940,25 @@ |
10709 | 11941 | createInterface:function(selector){ |
10710 | 11942 | var _this=this; |
10711 | 11943 | |
| 11944 | + |
10712 | 11945 | $j('#mwe-upwiz-steps') |
10713 | 11946 | .addClass('ui-helper-clearfix ui-state-default ui-widget ui-helper-reset ui-helper-clearfix') |
10714 | 11947 | .arrowSteps(); |
10715 | 11948 | |
10716 | | -$j('.mwe-upwiz-button-home') |
10717 | | -.append(gM('mwe-upwiz-home')) |
10718 | | -.click(function(){window.location.href='/';}); |
10719 | 11949 | |
| 11950 | +$j('.mwe-upwiz-stepdiv .mwe-upwiz-buttons button') |
| 11951 | +.button() |
| 11952 | +.css({'margin-left':'1em'}); |
| 11953 | + |
| 11954 | + |
10720 | 11955 | $j('.mwe-upwiz-button-begin') |
10721 | | -.append(gM('mwe-upwiz-upload-another')) |
10722 | 11956 | .click(function(){_this.reset();}); |
10723 | 11957 | |
| 11958 | +$j('.mwe-upwiz-button-home') |
| 11959 | +.click(function(){window.location.href='/';}); |
10724 | 11960 | |
| 11961 | + |
10725 | 11962 | $j('#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next') |
10726 | | -.append(gM('mwe-upwiz-next')) |
10727 | 11963 | .click(function(){ |
10728 | 11964 | _this.moveToStep('file',function(){ |
10729 | 11965 | |
— | — | @@ -10735,8 +11971,10 @@ |
10736 | 11972 | }); |
10737 | 11973 | }); |
10738 | 11974 | |
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() |
10741 | 11979 | .click(function(){ |
10742 | 11980 | |
10743 | 11981 | if(_this.uploads.length===0){ |
— | — | @@ -10746,19 +11984,24 @@ |
10747 | 11985 | } |
10748 | 11986 | |
10749 | 11987 | _this.removeEmptyUploads(); |
10750 | | -_this.startUploads(function(){ |
| 11988 | +_this.startUploads(); |
| 11989 | +}); |
10751 | 11990 | |
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(); |
10754 | 11994 | }); |
| 11995 | +$j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons .mwe-upwiz-button-retry').click(function(){ |
| 11996 | +_this.hideFileEndButtons(); |
| 11997 | +_this.startUploads(); |
10755 | 11998 | }); |
10756 | 11999 | |
10757 | 12000 | |
10758 | 12001 | |
| 12002 | + |
10759 | 12003 | $j('#mwe-upwiz-deeds-intro').html(gM('mwe-upwiz-deeds-intro')); |
10760 | 12004 | |
10761 | 12005 | $j('#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next') |
10762 | | -.append(gM('mwe-upwiz-next-deeds')) |
10763 | 12006 | .click(function(){ |
10764 | 12007 | |
10765 | 12008 | |
— | — | @@ -10791,7 +12034,6 @@ |
10792 | 12035 | |
10793 | 12036 | |
10794 | 12037 | $j('#mwe-upwiz-stepdiv-details .mwe-upwiz-button-next') |
10795 | | -.append(gM('mwe-upwiz-next-details')) |
10796 | 12038 | .click(function(){ |
10797 | 12039 | if(_this.detailsValid()){ |
10798 | 12040 | _this.detailsSubmit(function(){ |
— | — | @@ -10816,6 +12058,7 @@ |
10817 | 12059 | |
10818 | 12060 | |
10819 | 12061 | prepareAndMoveToDeeds:function(){ |
| 12062 | +var _this=this; |
10820 | 12063 | |
10821 | 12064 | |
10822 | 12065 | var deeds=[ |
— | — | @@ -10989,19 +12232,48 @@ |
10990 | 12233 | |
10991 | 12234 | |
10992 | 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 | + |
| 12241 | + |
| 12242 | + |
| 12243 | + |
| 12244 | + |
10993 | 12245 | 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){ |
10995 | 12267 | var toRemove=[]; |
10996 | 12268 | |
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); |
11000 | 12272 | } |
11001 | | -} |
| 12273 | +}); |
11002 | 12274 | |
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 | +}) |
11006 | 12278 | }, |
11007 | 12279 | |
11008 | 12280 | |
— | — | @@ -11013,6 +12285,8 @@ |
11014 | 12286 | |
11015 | 12287 | |
11016 | 12288 | |
| 12289 | + |
| 12290 | + |
11017 | 12291 | makeTransitioner:function(beginState,progressStates,endStates,starter,endCallback){ |
11018 | 12292 | |
11019 | 12293 | var _this=this; |
— | — | @@ -11049,17 +12323,28 @@ |
11050 | 12324 | |
11051 | 12325 | |
11052 | 12326 | |
11053 | | -startUploads:function(endCallback){ |
| 12327 | +startUploads:function(){ |
11054 | 12328 | var _this=this; |
11055 | 12329 | |
| 12330 | + |
11056 | 12331 | $j('#mwe-upwiz-upload-ctrls').hide(); |
| 12332 | +_this.hideFileEndButtons(); |
11057 | 12333 | $j('#mwe-upwiz-add-file').hide(); |
11058 | 12334 | |
| 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 | + |
11059 | 12344 | var allowCloseWindow=$j().preventCloseWindow({ |
11060 | 12345 | message:gM('mwe-prevent-close') |
11061 | 12346 | }); |
11062 | 12347 | |
11063 | | - |
| 12348 | +$j('#mwe-upwiz-progress').show(); |
11064 | 12349 | var progressBar=new mw.GroupProgressBar('#mwe-upwiz-progress', |
11065 | 12350 | gM('mwe-upwiz-uploading'), |
11066 | 12351 | _this.uploads, |
— | — | @@ -11079,14 +12364,14 @@ |
11080 | 12365 | _this.makeTransitioner( |
11081 | 12366 | 'new', |
11082 | 12367 | ['transporting','transported','metadata'], |
11083 | | -['error','verified'], |
| 12368 | +['error','stashed'], |
11084 | 12369 | function(upload){ |
11085 | 12370 | upload.start(); |
11086 | 12371 | }, |
11087 | 12372 | function(){ |
11088 | 12373 | allowCloseWindow(); |
11089 | 12374 | $j().notify(gM('mwe-upwiz-files-complete')); |
11090 | | -endCallback(); |
| 12375 | +_this.showFileNext(); |
11091 | 12376 | } |
11092 | 12377 | ); |
11093 | 12378 | }, |
— | — | @@ -11099,16 +12384,59 @@ |
11100 | 12385 | |
11101 | 12386 | |
11102 | 12387 | |
| 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 | + |
11103 | 12432 | updateFileCounts:function(){ |
11104 | 12433 | var _this=this; |
11105 | 12434 | |
11106 | 12435 | if(_this.uploads.length){ |
11107 | 12436 | |
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(); |
11110 | 12438 | |
11111 | 12439 | |
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')); |
11113 | 12441 | $j('#mwe-upwiz-add-file-container').removeClass('mwe-upwiz-add-files-0'); |
11114 | 12442 | $j('#mwe-upwiz-add-file-container').addClass('mwe-upwiz-add-files-n'); |
11115 | 12443 | |
— | — | @@ -11124,10 +12452,11 @@ |
11125 | 12453 | $j('#mwe-upwiz-filelist .filled:even').removeClass('odd'); |
11126 | 12454 | }else{ |
11127 | 12455 | |
11128 | | -$j('#mwe-upwiz-upload-ctrl').attr('disabled','disabled'); |
11129 | 12456 | |
| 12457 | +$j('#mwe-upwiz-upload-ctrl-container').hide(); |
11130 | 12458 | |
11131 | 12459 | |
| 12460 | + |
11132 | 12461 | $j('#mwe-upwiz-filelist').removeClass('mwe-upwiz-filled-filelist'); |
11133 | 12462 | |
11134 | 12463 | |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -194,22 +194,38 @@ |
195 | 195 | . UploadWizardTutorial::getHtml() |
196 | 196 | . '</div>' |
197 | 197 | . '<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>' |
199 | 199 | . '</div>' |
200 | 200 | . '</div>' |
201 | 201 | |
202 | 202 | . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">' |
203 | 203 | . '<div id="mwe-upwiz-files">' |
204 | 204 | . '<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">' |
206 | 206 | . '<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>' |
209 | 212 | . '</div>' |
210 | 213 | . '<div id="mwe-upwiz-progress" class="ui-helper-clearfix"></div>' |
| 214 | + . '<div id="mwe-upwiz-continue" class="ui-helper-clearfix"></div>' |
211 | 215 | . '</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>' |
214 | 230 | . '</div>' |
215 | 231 | . '</div>' |
216 | 232 | |
— | — | @@ -219,7 +235,7 @@ |
220 | 236 | . '<div id="mwe-upwiz-deeds" class="ui-helper-clearfix"></div>' |
221 | 237 | . '<div id="mwe-upwiz-deeds-custom" class="ui-helper-clearfix"></div>' |
222 | 238 | . '<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>' |
224 | 240 | . '</div>' |
225 | 241 | . '</div>' |
226 | 242 | |
— | — | @@ -232,15 +248,15 @@ |
233 | 249 | . '<div id="mwe-upwiz-macro-files"></div>' |
234 | 250 | . '</div>' |
235 | 251 | . '<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>' |
237 | 253 | . '</div>' |
238 | 254 | . '</div>' |
239 | 255 | |
240 | 256 | . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-thanks">' |
241 | 257 | . '<div id="mwe-upwiz-thanks"></div>' |
242 | 258 | . '<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>' |
245 | 261 | . '</div>' |
246 | 262 | . '</div>' |
247 | 263 | |